Clipper
Overview
Clipper is a class in Aspose.Page FOSS for Python.
Inherits from: ClipperBase.
The Clipper class offers methods such as execute() and add_edge_to_sel() to perform polygon clipping and edge management.
This class provides 116 methods for working with Clipper objects in Python programs.
Available methods include: __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, and 104 additional methods.
All public members are accessible to any Python application after installing the Aspose.Page FOSS for Python package.
Properties: active_edges, clip_fill_type, clip_type, current_lm, edges, execute_locked, and 14 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
scanbeam | Optional[Scanbeam] | Read | Gets the scanbeam. |
active_edges | Optional[TEdge] | Read | Gets the active edges. |
sorted_edges | Optional[TEdge] | Read | Gets the sorted edges. |
intersect_nodes | Optional[IntersectNode] | Read | Gets the intersect nodes. |
execute_locked | `` | Read | Gets the execute locked. |
using_polytree | `` | Read | Gets the using polytree. |
poly_outs | List[OutRec] | Read | Gets the poly outs. |
joins | List[Join] | Read | Gets the joins. |
ghost_joins | List[Join] | Read | Gets the ghost joins. |
reverse_solution | `` | Read | Gets the reverse solution. |
strictly_simple | `` | Read | Gets the strictly simple. |
preserve_collinear | `` | Read | Gets the preserve collinear. |
clip_type | `` | Read | Gets the clip type. |
clip_fill_type | `` | Read | Gets the clip fill type. |
subj_fill_type | `` | Read | Gets the subj fill type. |
minima_list | Optional[LocalMinima] | Read | Gets the minima list. |
current_lm | Optional[LocalMinima] | Read | Gets the current lm. |
edges | List[List[TEdge]] | Read | Gets the edges. |
use_full_range | `` | Read | Gets the use full range. |
has_open_paths | `` | Read | Gets the has open paths. |
Methods
| Signature | Description |
|---|---|
__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) | Sets the winding count value. |
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) | Sets the hole state value. |
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) | Sets the dx value. |
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 | Returns the bounds. |