ClipShape Class

A clipping volume defined by a shape (an array of 3d points using only x and y dimensions). May be given either a ClipPlaneSet to store directly, or an array of polygon points as well as other parameters for parsing ClipPlanes from the shape later.

Extends

Methods

Name Description
constructor(polygon: Point3d[][], zLow?: number, zHigh?: number, transform?: Transform, isMask: booleanfalse, invisible: booleanfalse): ClipShape Protected    
clone(result?: ClipShape): ClipShape Returns a deep copy of this instance of ClipShape, storing in an optional result.  
ensurePlaneSets(): void If the ClipShape's associated UnionOfConvexClipPlaneSets is defined, do nothing.  
initSecondaryProps(isMask: boolean, zLow?: number, zHigh?: number, transform?: Transform): void Initialize the members of the ClipShape class that may at times be undefined.  
multiplyPlanesByMatrix4d(matrix: Matrix4d, invert: booleantrue, transpose: booleantrue): boolean Multiply all ClipPlanes DPoint4d by matrix.  
performTransformFromClip(point: Point3d): void Transform the input point in place using this instance's transformFromClip member  
performTransformToClip(point: Point3d): void Transform the input point in place using this instance's transformToClip member  
setPolygon(polygon: Point3d[]): void Sets the polygon points array of this ClipShape to the array given (by reference).  
toJSON(): ClipPrimitiveShapeProps Emit json object form  
transformInPlace(transform: Transform): boolean Apply transform to the local to world (transformFromClip) transform.  
createBlock(extremities: Range3d, clipMask: ClipMaskXYZRangePlanes, isMask: booleanfalse, invisible: booleanfalse, transform?: Transform, result?: ClipShape): ClipShape Static Create a ClipShape that exists as a 3 dimensional box of the range given.  
createEmpty(isMask: booleanfalse, invisible: booleanfalse, transform?: Transform, result?: ClipShape): ClipShape Static Creates a new ClipShape with undefined members and a polygon points array of zero length.  
createFrom(other: ClipShape, result?: ClipShape): ClipShape Static Returns a new ClipShape that is a deep copy of the ClipShape given  
createShape(polygon: Point3d[][], zLow?: number, zHigh?: number, transform?: Transform, isMask: booleanfalse, invisible: booleanfalse, result?: ClipShape): undefined | ClipShape Static Create a new ClipShape from an array of points that make up a 2d shape (stores a deep copy of these points).  
fromClipShapeJSON(json: ClipPrimitiveShapeProps, result?: ClipShape): undefined | ClipShape Static Parse json to a clip shape.  

Inherited methods

Name Inherited from Description
announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean ClipPrimitive Method from Clipper interface.
announceClippedSegmentIntervals(f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber): boolean ClipPrimitive Method from Clipper interface.
arePlanesDefined(): boolean ClipPrimitive Returns true if the planes are present.
classifyPointContainment(points: Point3d[], ignoreInvisibleSetting: boolean): ClipPlaneContainment ClipPrimitive Quick test of whether the given points fall completely inside or outside.
containsZClip(): boolean ClipPrimitive Return true if any plane of the primary clipPlanes has (a) non-zero z component in its normal vector and
fetchClipPlanesRef(): undefined | UnionOfConvexClipPlaneSets ClipPrimitive Get a reference to the UnionOfConvexClipPlaneSets.
isPointOnOrInside(point: Point3d, onTolerance: numberGeometry.smallMetricDistanceSquared): boolean ClipPrimitive Method from Clipper interface.
pointInside(point: Point3d, onTolerance: numberGeometry.smallMetricDistanceSquared): boolean ClipPrimitive Return true if the point lies inside/on this polygon (or not inside/on if this polygon is a mask).
setInvisible(invisible: boolean): void ClipPrimitive Sets both the clip plane set and the mask set visibility
createCapture(planes: ConvexClipPlaneSet | UnionOfConvexClipPlaneSets, isInvisible: booleanfalse): ClipPrimitive Static ClipPrimitive Create a ClipPrimitive, capturing the supplied plane set as the clip planes.
fromJSON(json: ClipPrimitiveProps): undefined | ClipPrimitive Static ClipPrimitive Promote json object form to class instance.
fromJSONClipPrimitive(json: ClipPrimitivePlanesProps): undefined | ClipPrimitive Static ClipPrimitive Specific converter producing the base class ClipPrimitive.

Properties

Name Type Description
_isMask Protected boolean true if this is considered a hole (keep geometry outside of the polygon).  
_polygon Protected Point3d[] Points of the polygon, in the xy plane of the local coordinate system.  
_transformFromClip Protected Transform | undefined transform from local to world.  
_transformToClip Protected Transform | undefined Transform from world to local.  
_zHigh Protected number | undefined optional high z (in local coordinates).  
_zLow Protected number | undefined optional low z (in local coordinates).  
invisible Accessor ReadOnly boolean Returns true if this ClipShape is marked as invisible.  
isMask Accessor ReadOnly boolean Returns true if this ClipShape is a masking set.  
isValidPolygon Accessor ReadOnly boolean Checks to ensure that the member polygon has an area, and that the polygon is closed.  
isXYPolygon Accessor ReadOnly boolean Return true if  
polygon Accessor ReadOnly Point3d[] Returns a reference to this ClipShape's polygon array.  
transformFromClip Accessor ReadOnly undefined | Transform Return this transformFromClip, which may be undefined.  
transformIsValid Accessor ReadOnly boolean Return true if this ClipShape has a local to world transform  
transformToClip Accessor ReadOnly undefined | Transform Return this transformToClip, which may be undefined.  
transformValid Accessor ReadOnly boolean Returns true if this ClipShape's transforms are currently set.  
zHigh Accessor ReadOnly undefined | number Return this zHigh, which may be undefined.  
zHighValid Accessor ReadOnly boolean Returns true if this ClipShape's upper z boundary is set.  
zLow Accessor ReadOnly undefined | number Return this zLow, which may be undefined.  
zLowValid Accessor ReadOnly boolean Returns true if this ClipShape's lower z boundary is set.  

Inherited properties

Name Type Inherited from Description
_clipPlanes Protected UnionOfConvexClipPlaneSets | undefined ClipPrimitive The (union of) convex regions.
_invisible Protected boolean ClipPrimitive If true, pointInside inverts the sense of the pointInside for the _clipPlanes

Defined in

Last Updated: 28 October, 2024