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: boolean = false, invisible: boolean = false): 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: boolean = true, transpose: boolean = true): 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: boolean = false, invisible: boolean = false, transform?: Transform, result?: ClipShape): ClipShape Static Create a ClipShape that exists as a 3 dimensional box of the range given.  
createEmpty(isMask: boolean = false, invisible: boolean = false, 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: boolean = false, invisible: boolean = false, 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: undefined | ClipPrimitiveShapeProps, result?: ClipShape): undefined | ClipShape Static parse json to a clip shape.  

Inherited methods

Name Inherited from Description
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 (b) finite distance from origin.
fetchClipPlanesRef(): undefined | UnionOfConvexClipPlaneSets ClipPrimitive Get a reference to the UnionOfConvexClipPlaneSets.
pointInside(point: Point3d, onTolerance: number = Geometry.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: undefined | ConvexClipPlaneSet | UnionOfConvexClipPlaneSets, isInvisible: boolean = false): ClipPrimitive Static ClipPrimitive Create a ClipPrimitive, capturing the supplied plane set as the clip planes.
fromJSON(json: undefined | ClipPrimitiveProps): undefined | ClipPrimitive Static ClipPrimitive Promote json object form to class instance
fromJSONClipPrimitive(json: undefined | 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 undefined | Transform transform from local to world  
_transformToClip Protected undefined | Transform Transform from world to local  
_zHigh Protected undefined | number optional high z (in local coordinates)  
_zLow Protected undefined | number 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 undefined | UnionOfConvexClipPlaneSets 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: 12 June, 2024