ClipPrimitive Class

  • ClipPrimitive is a base class for clipping implementations that use:
  • A ClipPrimitive can be constructed with or without planes. If without planes:
    • The derived class is responsible for filling the plane sets.
    • The derived class can populate the plane sets at construction time or afterwards with ensurePlaneSets.
  • The prevailing use is via derived class ClipShape.
    • A ClipShape carries a swept shape that generates the planes.
    • A ClipShape has an isMask property
      • isMask === false means the plane sets should cover the inside of its polygon.
      • isMask === true means the plane sets should cover the outside of its polygon, i.e., the ClipShape acts as a hole.
  • Note that the ClipShape's isMask property and the ClipPrimitive's invisible property are distinct flags.
    • In normal usage, callers get "outside" clip behavior using ONLY the ClipShape isMask property.
    • The ClipShape passes its invisible flag down to ClipPlanes that it creates.
      • At that level, this flag controls whether cut edges are produced on the planes.

Extended by

Implements

Methods

Name Description
constructor(planeSet?: UnionOfConvexClipPlaneSets, isInvisible: boolean = false): ClipPrimitive Protected    
announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean Method from Clipper interface.  
announceClippedCurveIntervals(curve: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): boolean Method from Clipper interface.  
announceClippedSegmentIntervals(f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber): boolean Method from Clipper interface.  
arePlanesDefined(): boolean Returns true if the planes are present.  
classifyPointContainment(points: Point3d[], _ignoreMasks: boolean = true): ClipPlaneContainment Quick test of whether the given points fall completely inside or outside.  
clone(): ClipPrimitive Return a deep clone.  
containsZClip(): boolean Return true if any plane of the primary clipPlanes has (a) non-zero z component in its normal vector and  
ensurePlaneSets(): void Trigger (if needed) computation of plane sets (if applicable) in the derived class.  
fetchClipPlanesRef(): UnionOfConvexClipPlaneSets | undefined Get a reference to the UnionOfConvexClipPlaneSets.  
isPointOnOrInside(point: Point3d, onTolerance: number = Geometry.smallMetricDistanceSquared): boolean Method from Clipper interface.  
multiplyPlanesByMatrix4d(matrix: Matrix4d, invert: boolean = true, transpose: boolean = true): boolean Multiply all ClipPlanes DPoint4d by matrix.  
pointInside(point: Point3d, onTolerance: number = Geometry.smallMetricDistanceSquared): boolean Return true if the point lies inside/on this polygon (or not inside/on if this polygon is a mask).  
setInvisible(invisible: boolean): void Sets the primitive visibility.  
toJSON(): ClipPrimitiveProps Emit json form of the clip planes  
transformInPlace(transform: Transform): boolean Apply a transform to the clipper (e.g.  
createCapture(planes: ConvexClipPlaneSet | UnionOfConvexClipPlaneSets, isInvisible: boolean = false): ClipPrimitive Static Create a ClipPrimitive, capturing the supplied plane set as the clip planes.  
fromJSON(json: ClipPrimitiveProps): ClipPrimitive | undefined Static Promote json object form to class instance.  
fromJSONClipPrimitive(json: ClipPrimitivePlanesProps): ClipPrimitive | undefined Static Specific converter producing the base class ClipPrimitive.  

Properties

Name Type Description
_clipPlanes Protected UnionOfConvexClipPlaneSets | undefined The union of convex regions.  
_invisible Protected boolean The invisible flag of the primitive, passed down to the clip planes.  
invisible Accessor ReadOnly boolean Return whether this primitive is invisible.  

Defined in

Last Updated: 23 June, 2026