ClipUtilities Class

Static class whose various methods are functions for clipping geometry

Methods

Name Description
constructor(): ClipUtilities    
announceLoopsOfConvexClipPlaneSetIntersectRange(convexSet: ConvexClipPlaneSet | ClipPlane, range: Range3d, loopFunction: (loopPoints: GrowableXYZArray) => void, includeConvexSetFaces: boolean = true, includeRangeFaces: boolean = true, ignoreInvisiblePlanes: boolean = false): void Static Emit point loops for intersection of a convex set with a range.  
announceNNC(intervals: Range1d[], cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): boolean Static Announce triples of (low, high, cp) for each entry in intervals  
announcePolylineClip(clipper: Clipper, points: Point3d[], announce: (point0: Point3d, point1: Point3d) => void): void Static Pass line segments from a polyline to the clipper.  
captureOrDrop(data: GrowableXYZArray, minLength: number, destination: GrowableXYZArray[], cache: ): void Static if data.length >= minLength threshold, push it to destination; if smaller drop it back to the cache.  
clipPolygonToClipShape(polygon: Point3d[], clipShape: ClipPrimitive): Point3d[][] Static Clip a polygon down to regions defined by each shape of a ClipShape.  
clipPolygonToClipShapeReturnGrowableXYZArrays(polygon: Point3d[], clipShape: ClipPrimitive): GrowableXYZArray[] Static Clip a polygon down to regions defined by each shape of a ClipShape.  
clipSegmentBelowPlaneXY(plane: Plane3dByOriginAndUnitNormal, segmentPoint0: Readonly<WritableXAndY>, segmentPoint1: Readonly<WritableXAndY>, interval: Range1d, absoluteTolerance: number = 1.0e-14): void Static Find the portion of a line within a half-plane clip.  
clipSegmentBelowPlanesXY(planes: Plane3dByOriginAndUnitNormal[], segment0: Readonly<WritableXAndY>, segment1: Readonly<WritableXAndY>, interval: Range1d, signedAltitude: number = 1.0e-14): void Static Clip an interval of a line segment to an array of planes  
clipSegmentToCCWTriangleXY(pointA: Readonly<WritableXAndY>, pointB: Readonly<WritableXAndY>, pointC: Readonly<WritableXAndY>, segment0: Readonly<WritableXAndY>, segment1: Readonly<WritableXAndY>, interval: Range1d, absoluteTolerance: number = 1.0e-14): void Static Clip an interval of a line segment to a triangle.  
clipSegmentToLLeftOfLineXY(linePointA: Readonly<WritableXAndY>, linePointB: Readonly<WritableXAndY>, segmentPoint0: Readonly<WritableXAndY>, segmentPoint1: Readonly<WritableXAndY>, interval: Range1d, absoluteTolerance: number = 1.0e-14): void Static Find the portion of a line within a half-plane clip.  
collectClippedCurves(curve: CurvePrimitive, clipper: Clipper): CurvePrimitive[] Static Find portions of the curve that are within the clipper.  
createComplementaryClips(clipper: ConvexClipPlaneSet): UnionOfConvexClipPlaneSets Static For each plane of clipper, construct a UnionOfConvexClipPlaneSets for an outer (infinite) convex volume that  
doPolygonClipParitySequence(xyz: GrowableXYZArray, clippers: Clipper[], acceptedIn: undefined | GrowableXYZArray[], acceptedOut: undefined | GrowableXYZArray[], arrayCache: undefined | ): void Static Pass polygon xyz through a sequence of PolygonClip steps with "parity" rules  
doPolygonClipSequence(xyz: GrowableXYZArray, clippers: Clipper[], acceptedIn: undefined | GrowableXYZArray[], acceptedOut: undefined | GrowableXYZArray[], finalCandidates: undefined | GrowableXYZArray[], inAction: ClipStepAction, outAction: ClipStepAction, finalFragmentAction: ClipStepAction, arrayCache: undefined | ): void Static Pass polygon xyz through a sequence of PolygonClip steps.  
doesClipperIntersectRange(clipper: undefined | ConvexClipPlaneSet | ClipPrimitive | UnionOfConvexClipPlaneSets | ClipVector, range: Range3d, observeInvisibleFlag: boolean = true): boolean Static Test if various types of clippers have any intersection with a range.  
doesConvexClipPlaneSetIntersectRange(convexSet: ConvexClipPlaneSet, range: Range3d, includeConvexSetFaces: boolean = true, includeRangeFaces: boolean = true, ignoreInvisiblePlanes: boolean = false): boolean Static Emit point loops for intersection of a convex set with a range.  
isClipper(obj: any): boolean Static Test if obj is a Clipper object.  
loopsOfConvexClipPlaneIntersectionWithRange(allClippers: ConvexClipPlaneSet | ClipPlane | UnionOfConvexClipPlaneSets, range: Range3d, includeConvexSetFaces: boolean = true, includeRangeFaces: boolean = true, ignoreInvisiblePlanes: boolean = false): GeometryQuery[] Static Return a (possibly empty) array of geometry (Loops !!) which are facets of the intersection of the convex set intersecting a range.  
pointSetSingleClipStatus(points: GrowableXYZArray, planeSet: UnionOfConvexClipPlaneSets, tolerance: number): ClipStatus Static Given an array of points, test for trivial containment conditions.  
rangeOfClipperIntersectionWithRange(clipper: undefined | ConvexClipPlaneSet | ClipPrimitive | UnionOfConvexClipPlaneSets | ClipVector, range: Range3d, observeInvisibleFlag: boolean = true): Range3d Static Return the range of various types of clippers  
rangeOfConvexClipPlaneSetIntersectionWithRange(convexSet: ConvexClipPlaneSet, range: Range3d): Range3d Static Return the (possibly null) range of the intersection of the convex set with a range.  
restoreSingletonInPlaceOfMultipleShards(fragments: undefined | GrowableXYZArray[], baseCount: number, singleton: GrowableXYZArray, arrayCache: ): void Static Specialized logic for replacing clip fragments by an equivalent singleton.  
selectIntervals01(curve: CurvePrimitive, unsortedFractions: GrowableFloat64Array, clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean Static * Augment the unsortedFractionsArray with 0 and 1  
sumPolylineClipLength(clipper: Clipper, points: Point3d[]): number Static Pass line segments from a polyline to the clipper.  

Defined in

Last Updated: 20 June, 2023