ClipUtilities Class

Class whose various static methods are functions for clipping geometry

Methods

Name Description
constructor(): ClipUtilities    
announceLoopsOfConvexClipPlaneSetIntersectRange(convexSet: ClipPlane | ConvexClipPlaneSet, 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.  
clipAnyCurve(curve: AnyCurve, clipper: Clipper): AnyCurve[] Static Compute and return portions of the input curve or region that are within the clipper.  
clipAnyRegion(region: AnyRegion, clipper: Clipper): undefined | AnyRegion Static Compute and return the portions of the input region that are within the clipper.  
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 Compute and return portions of the input 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  
doLocalRangesIntersect(range0: Range3d, local0ToWorld: Transform, range1: Range3d, local1ToWorld: Transform, range1Margin?: number): boolean Static Test for intersection of two ranges in different local coordinates.  
doPolygonClipParitySequence(xyz: IndexedXYZCollection, 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: IndexedXYZCollection, 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 | UnionOfConvexClipPlaneSets | ClipPrimitive | 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: ClipPlane | ConvexClipPlaneSet | 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  
pointSetSingleClipStatus(points: GrowableXYZArray, planeSet: UnionOfConvexClipPlaneSets, tolerance: number): ClipStatus Static Given an array of points, test for trivial containment conditions.  
rangeOfClipperIntersectionWithRange(clipper: undefined | ConvexClipPlaneSet | UnionOfConvexClipPlaneSets | ClipPrimitive | 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.  
rangeOfIntersectionOfLocalRanges(range0: Range3d, local0ToWorld: Transform, range1: Range3d, local1ToWorld: Transform, result?: Range3d): Range3d Static Compute the range of the intersection between two local (e.g., element-aligned) ranges.  
restoreSingletonInPlaceOfMultipleShards(fragments: undefined | GrowableXYZArray[], baseCount: number, singleton: IndexedXYZCollection, 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: 18 April, 2024