Clipping¶
Clipping module: ezdxf.math.clipping
- ezdxf.math.clipping.greiner_hormann_union(p1: Iterable[UVec], p2: Iterable[UVec]) list[list[ezdxf.math._vector.Vec2]] ¶
Returns the UNION of polygon p1 | polygon p2. This algorithm works only for polygons with real intersection points and line end points on face edges are not considered as such intersection points!
- ezdxf.math.clipping.greiner_hormann_difference(p1: Iterable[UVec], p2: Iterable[UVec]) list[list[ezdxf.math._vector.Vec2]] ¶
Returns the DIFFERENCE of polygon p1 - polygon p2. This algorithm works only for polygons with real intersection points and line end points on face edges are not considered as such intersection points!
- ezdxf.math.clipping.greiner_hormann_intersection(p1: Iterable[UVec], p2: Iterable[UVec]) list[list[ezdxf.math._vector.Vec2]] ¶
Returns the INTERSECTION of polygon p1 & polygon p2. This algorithm works only for polygons with real intersection points and line end points on face edges are not considered as such intersection points!
- class ezdxf.math.clipping.ClippingPolygon2d(vertices: Iterable[Vec2], ccw_check=True)¶
The clipping path is an arbitrary polygon.
- class ezdxf.math.clipping.ClippingRect2d(bottom_left: Vec2, top_right: Vec2)¶
The clipping path is a rectangle parallel to the x- and y-axis.
This class will get an optimized implementation in the future.