Clipping¶
Clipping module: ezdxf.math.clipping
-
ezdxf.math.clipping.
greiner_hormann_union
(p1: Iterable[UVec], p2: Iterable[UVec]) → list[list[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[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[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[ezdxf.math._vector.Vec2], ccw_check=True)¶ The clipping path is an arbitrary polygon.
-
clip_polygon
(polygon: Iterable[ezdxf.math._vector.Vec2]) → Sequence[ezdxf.math._vector.Vec2]¶ Returns the clipped polygon.
-
clip_polyline
(polyline: Iterable[ezdxf.math._vector.Vec2]) → Sequence[Sequence[ezdxf.math._vector.Vec2]]¶ Returns the parts of the clipped polyline.
-
clip_line
(start: ezdxf.math._vector.Vec2, end: ezdxf.math._vector.Vec2) → Sequence[ezdxf.math._vector.Vec2]¶ Returns the clipped line.
-
is_inside
(point: ezdxf.math._vector.Vec2) → bool¶ Returns
True
if point is inside the clipping polygon.
-
-
class
ezdxf.math.clipping.
ClippingRect2d
(bottom_left: ezdxf.math._vector.Vec2, top_right: ezdxf.math._vector.Vec2)¶ The clipping path is a rectangle parallel to the x- and y-axis.
This class will get an optimized implementation in the future.
-
clip_polygon
(polygon: Iterable[ezdxf.math._vector.Vec2]) → Sequence[ezdxf.math._vector.Vec2]¶ Returns the clipped polygon.
-
clip_polyline
(polyline: Iterable[ezdxf.math._vector.Vec2]) → Sequence[Sequence[ezdxf.math._vector.Vec2]]¶ Returns the parts of the clipped polyline.
-
clip_line
(start: ezdxf.math._vector.Vec2, end: ezdxf.math._vector.Vec2) → Sequence[ezdxf.math._vector.Vec2]¶ Returns the clipped line.
-
is_inside
(point: ezdxf.math._vector.Vec2) → bool¶ Returns
True
if point is inside the clipping rectangle.
-