clipConvexPolygonInPlace Method
Clip a polygon to the inside or outside of the plane.
- Results with 2 or fewer points are ignored.
- Other than ensuring capacity in the arrays, there are no object allocations during execution of this function.
- For a convex input polygon, the output polygon is also convex.
- For non-convex input, the output polygon may have double-back edges along plane intersections. This is still a valid clip in a parity sense (overlapping regions cancel).
clipConvexPolygonInPlace(xyz: GrowableXYZArray, work?: GrowableXYZArray, inside: booleantrue, tolerance: numberGeometry.smallMetricDistance): number
@returns the number of crossings. If this is larger than 2, the input polygon was non-convex.
@see appendPolygonClip
Parameter | Type | Description |
---|---|---|
xyz | GrowableXYZArray | input points. |
work | GrowableXYZArray | optional work buffer |
inside | boolean | whether the positive side of the plane survives (true, default), or negative side (false). |
tolerance | number | distance tolerance for "on plane" decision. Default value is smallMetricDistance. |
Returns - number
the number of crossings. If this is larger than 2, the input polygon was non-convex.
Defined in
- clipping/ClipPlane.ts Line 519
Last Updated: 08 October, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.