ClipPrimitive Class

  • ClipPrimitive is a base class for clipping implementations that use
    • A UnionOfConvexClipPlaneSets designated "clipPlanes".
    • An "invisible" flag.
  • When constructed directly, objects of type ClipPrimitive (directly, not through a derived class) will have just planes.
  • Derived classes (e.g. ClipShape) carry additional data such as a swept shape.
  • ClipPrimitive can be constructed with no planes.
    • Derived class is responsible for filling the plane sets.
    • At discretion of derived classes, plane construction can be done at construction time or "on demand when" queries call ensurePlaneSets ()
  • ClipPrimitive can be constructed directly with planes (and no derived class).
  • The prevailing use is via a ClipShape derived class.
    • The 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.
  • Note that the ClipShape's isMask property and the ClipPrimitive's isInvisible property are distinct controls.
    • In normal usage, callers get "outside" clip behavior using ONLY the ClipShape isMask property.
    • The ClipShape happens to pass the _invisible bit down to ClipPlanes that it creates.
      • At that level, the flag controls whether the cut edges are produced on the plane

Extended by

Implements

Methods

Name Description
constructor(planeSet?: UnionOfConvexClipPlaneSets, isInvisible: booleanfalse): ClipPrimitive Protected    
announceClippedArcIntervals(arc: Arc3d, 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[], ignoreInvisibleSetting: boolean): 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(): undefined | UnionOfConvexClipPlaneSets Get a reference to the UnionOfConvexClipPlaneSets.  
isPointOnOrInside(point: Point3d, onTolerance: numberGeometry.smallMetricDistanceSquared): boolean Method from Clipper interface.  
multiplyPlanesByMatrix4d(matrix: Matrix4d, invert: booleantrue, transpose: booleantrue): boolean Multiply all ClipPlanes DPoint4d by matrix.  
pointInside(point: Point3d, onTolerance: numberGeometry.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 both the clip plane set and the mask set 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: booleanfalse): ClipPrimitive Static Create a ClipPrimitive, capturing the supplied plane set as the clip planes.  
fromJSON(json: ClipPrimitiveProps): undefined | ClipPrimitive Static Promote json object form to class instance.  
fromJSONClipPrimitive(json: ClipPrimitivePlanesProps): undefined | ClipPrimitive Static Specific converter producing the base class ClipPrimitive.  

Properties

Name Type Description
_clipPlanes Protected UnionOfConvexClipPlaneSets | undefined The (union of) convex regions.  
_invisible Protected boolean If true, pointInside inverts the sense of the pointInside for the _clipPlanes  
invisible Accessor ReadOnly boolean Ask if this primitive is a hole.  

Defined in

Last Updated: 23 November, 2024