Clipper

概述

Clipper 是 Aspose.Page FOSS 中用于 Python 的类。继承自:ClipperBase。

Clipper 类提供诸如 execute() 和 add_edge_to_sel() 等方法,用于执行多边形裁剪和边缘管理。

此类在 Python 程序中提供了用于操作 Clipper 对象的 116 个方法。可用的方法包括:__init__、add_bounds_to_lml、add_edge_to_sel、add_ghost_join、add_join、add_local_max_poly、add_local_min_poly、add_out_pt、add_path、add_paths、all_horizontal、append_polygon,以及另外 104 个方法。安装 Aspose.Page FOSS for Python 包后,所有公共成员对任何 Python 应用程序均可访问。属性:active_edges、clip_fill_type、clip_type、current_lm、edges、execute_locked,以及另外 14 项。

属性

名称类型访问描述
scanbeamOptional[Scanbeam]读取获取 scanbeam。
active_edgesOptional[TEdge]读取获取活动边缘。
sorted_edgesOptional[TEdge]读取获取已排序的边。
intersect_nodesOptional[IntersectNode]读取获取相交节点。
execute_locked``读取获取执行锁定。
using_polytree``读取获取正在使用的多叉树。
poly_outsList[OutRec]读取获取 poly 输出。
joinsList[Join]读取获取连接。
ghost_joinsList[Join]读取获取幽灵连接。
reverse_solution``读取获取反向解。
strictly_simple``读取获取严格的简洁。
preserve_collinear``读取获取 preserve collinear。
clip_type``读取获取剪辑类型。
clip_fill_type``读取获取剪辑填充类型。
subj_fill_type``读取获取 subj 填充类型。
minima_listOptional[LocalMinima]读取获取 minima 列表。
current_lmOptional[LocalMinima]读取获取当前的 lm。
edgesList[List[TEdge]]读取获取边缘。
use_full_range``读取获取使用的完整范围。
has_open_paths``读取获取是否有打开的路径。

方法

签名描述
__init__(init_options: int)
clear()
reset()
insert_scanbeam(y: int)
execute(clip_type: int, solution: List[List[IntPoint]], subj_fill: int, clip_fill: int) → bool
execute_internal() → bool
pop_scanbeam() → int
dispose_all_poly_pts()
dispose_out_rec(index: int)
dispose_out_pts(pp: OutPt)
add_join(op1: OutPt, op2: OutPt, off_pt: IntPoint)
add_ghost_join(op: OutPt, off_pt: IntPoint)
insert_local_minima_into_ael(bot_y: int)
insert_edge_into_ael(edge: TEdge, start_edge: Optional[TEdge])
e2_inserts_before_e1(e1: TEdge, e2: TEdge) → bool
is_even_odd_fill_type(edge: TEdge) → bool
is_even_odd_alt_fill_type(edge: TEdge) → bool
is_contributing(edge: TEdge) → bool
set_winding_count(edge: TEdge)设置 winding count 值。
add_edge_to_sel(edge: TEdge)
copy_ael_to_sel()
swap_positions_in_ael(edge1: TEdge, edge2: TEdge)
swap_positions_in_sel(edge1: TEdge, edge2: TEdge)
add_local_max_poly(e1: TEdge, e2: TEdge, pt: IntPoint)
add_local_min_poly(e1: TEdge, e2: TEdge, pt: IntPoint) → OutPt
create_out_rec() → OutRec
add_out_pt(e: TEdge, pt: IntPoint) → OutPt
swap_points(pt1: IntPoint, pt2: IntPoint) → tuple[IntPoint, IntPoint]
horz_segments_overlap(pt1a: IntPoint, pt1b: IntPoint, pt2a: IntPoint, pt2b: IntPoint) → bool
insert_poly_pt_between(p1: OutPt, p2: OutPt, pt: IntPoint) → OutPt
set_hole_state(e: TEdge, out_rec: OutRec)设置孔的状态值。
get_dx(pt1: IntPoint, pt2: IntPoint) → float
first_is_bottom_pt(btm_pt1: OutPt, btm_pt2: OutPt) → bool
get_bottom_pt(pp: OutPt) → OutPt
get_lowermost_rec(out_rec1: OutRec, out_rec2: OutRec) → OutRec
param1_right_of_param2(out_rec1: OutRec, out_rec2: OutRec) → bool
get_out_rec(idx: int) → OutRec
append_polygon(e1: TEdge, e2: TEdge)
reverse_poly_pt_links(pp: OutPt)
swap_sides(edge1: TEdge, edge2: TEdge)
swap_poly_indexes(edge1: TEdge, edge2: TEdge)
intersect_edges(e1: TEdge, e2: TEdge, pt: IntPoint, protect: bool)
delete_from_ael(e: TEdge)
delete_from_sel(e: TEdge)
update_edge_into_ael(e: TEdge) → TEdge
process_horizontals(is_top_of_scanbeam: bool)
get_horz_direction(horz_edge: TEdge) → tuple[int, int, int]
prepare_horz_joins(horz_edge: TEdge, is_top_of_scanbeam: bool)
process_horizontal(horz_edge: TEdge, is_top_of_scanbeam: bool)
get_next_in_ael(e: TEdge, direction: int) → Optional[TEdge]
is_minima(e: TEdge) → bool
is_maxima(e: TEdge, y: float) → bool
is_intermediate(e: TEdge, y: float) → bool
get_maxima_pair(e: TEdge) → Optional[TEdge]
process_intersections(bot_y: int, top_y: int) → bool
build_intersect_list(bot_y: int, top_y: int)
edges_adjacent(inode: IntersectNode) → bool
fixup_intersection_order() → bool
process_intersect_list()
round(value: float) → int
top_x(edge: TEdge, current_y: int) → int
insert_intersect_node(e1: TEdge, e2: TEdge, pt: IntPoint)
swap_intersect_nodes(int1: IntersectNode, int2: IntersectNode)
intersect_point(edge1: TEdge, edge2: TEdge, ip: IntPoint) → bool
dispose_intersect_nodes()
process_edges_at_top_of_scanbeam(top_y: int)
do_maxima(e: TEdge)
reverse_paths(polys: List[List[IntPoint]])
orientation(poly: List[IntPoint]) → bool
point_count(pts: Optional[OutPt]) → int
build_result(polyg: List[List[IntPoint]])
fixup_out_polygon(out_rec: OutRec)
dup_out_pt(out_pt: OutPt, insert_after: bool) → OutPt
get_overlap(a1: int, a2: int, b1: int, b2: int) → Optional[tuple[int, int]]
join_horz(op1: OutPt, op1b: OutPt, op2: OutPt, op2b: OutPt, pt: IntPoint, discard_left: bool) → bool
join_points(j: Join) → Optional[tuple[OutPt, OutPt]]
poly2_contains_poly1(out_pt1: OutPt, out_pt2: OutPt) → bool
fixup_first_lefts1(old_out_rec: OutRec, new_out_rec: OutRec)
fixup_first_lefts2(old_out_rec: OutRec, new_out_rec: OutRec)
join_common_edges()
update_out_pt_idxs(out_rec: OutRec)
do_simple_polygons()
area(poly: List[IntPoint]) → float
area_outrec(out_rec: OutRec) → float
near_zero(val: float) → bool
is_horizontal(e: TEdge) → bool
point_is_vertex(pt: IntPoint, pp: OutPt) → bool
point_on_line_segment(pt: IntPoint, line_pt1: IntPoint, line_pt2: IntPoint) → bool
point_on_polygon(pt: IntPoint, pp: OutPt) → bool
point_in_polygon(pt: IntPoint, pp: OutPt) → bool
slopes_equal(e1: TEdge, e2: TEdge) → bool
slopes_equal_pts(pt1: IntPoint, pt2: IntPoint, pt3: IntPoint) → bool
slopes_equal_pts4(pt1: IntPoint, pt2: IntPoint, pt3: IntPoint, pt4: IntPoint) → bool
range_test(pt: IntPoint)
init_edge(e: TEdge, e_next: TEdge, e_prev: TEdge, pt: IntPoint)
init_edge2(e: TEdge, poly_type: int)
add_path(pg: List[IntPoint], poly_type: int, closed: bool) → bool
add_paths(ppg: List[List[IntPoint]], poly_type: int, closed: bool) → bool
pt2_is_between_pt1_and_pt3(pt1: IntPoint, pt2: IntPoint, pt3: IntPoint) → bool
remove_edge(e: TEdge) → TEdge
get_last_horz(edge: TEdge) → TEdge
shared_vert_with_prev_at_top(edge: TEdge) → bool
shared_vert_with_next_is_bot(edge: TEdge) → bool
more_below(edge: TEdge) → bool
just_before_loc_min(edge: TEdge) → bool
more_above(edge: TEdge) → bool
all_horizontal(edge: TEdge) → bool
set_dx(e: TEdge)设置 dx 值。
do_minima_lml(e1: Optional[TEdge], e2: Optional[TEdge], is_closed: bool)
descend_to_min(e: TEdge) → TEdge
ascend_to_max(e: TEdge, appending: bool, is_closed: bool)
add_bounds_to_lml(e: TEdge, closed: bool) → TEdge
insert_local_minima(new_lm: LocalMinima)
pop_local_minima()
reverse_horizontal(e: TEdge)
get_bounds() → IntRect返回范围。

另请参阅

 中文