clipConvexPolygonInPlace MethodStatic
Clip a polygon to one side of a 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.
- plane is passed as unrolled Point4d (ax,ay,az,aw) point (x,y,z) acts as homogeneous (x,y,z,1)
keepPositive === true
selects positive altitudes.
clipConvexPolygonInPlace(plane: PlaneAltitudeEvaluator, xyz: GrowableXYZArray, work: GrowableXYZArray, keepPositive: booleantrue, tolerance: numberGeometry.smallMetricDistance): number
@returns the number of crossings. If this is larger than 2, the result is "correct" in a parity sense but may have overlapping (hence cancelling) parts.
Parameter | Type | Description |
---|---|---|
plane | PlaneAltitudeEvaluator | any type that has plane.altitude |
xyz | GrowableXYZArray | input points. |
work | GrowableXYZArray | work buffer |
keepPositive | boolean | |
tolerance | number | tolerance for "on plane" decision. |
Returns - number
the number of crossings. If this is larger than 2, the result is "correct" in a parity sense but may have overlapping (hence cancelling) parts.
Defined in
- geometry3d/PolygonOps.ts Line 1518
Last Updated: 23 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.