ClipPlane Class

A ClipPlane is a single plane represented as

  • An inward unit normal (u,v,w)
  • A signedDistance More details can be found at docs/learning/geometry/Clipping.md

Hence

  • The halfspace function evaluation for "point" (x,y,z) is (x,y,z) DOT (u,v,w) - signedDistance.
  • POSITIVE values of the halfspace function are "inside".
  • ZERO value of the halfspace function is "on".
  • NEGATIVE value of the halfspace function is "outside".
  • A representative point on the plane is (signedDistance * u, signedDistance * v, signedDistance * w).
  • Given a point on the plane and the inward normal of the plane, signedDistance = point DOT normal.

Extends

Implements

Methods

Name Description
altitude(point: Point3d): number Evaluate the distance from the plane to a point in space, i.e.  
altitudeXYZ(x: number, y: number, z: number): number Evaluate the distance from the plane to a point in space with point given as x,y,z, i.e.  
announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean Announce fractional intervals of arc clip.  
announceClippedSegmentIntervals(f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: (fraction0: number, fraction1: number) => void): boolean Announce the interval (if any) where a line is within the clip plane half space.  
appendIntersectionRadians(arc: Arc3d, intersectionRadians: GrowableFloat64Array): void Compute intersections of an (UNBOUNDED) arc with the plane.  
appendPolygonClip(xyz: IndexedXYZCollection, insideFragments: GrowableXYZArray[], outsideFragments: GrowableXYZArray[], arrayCache: ): void Implement appendPolygonClip, as defined in interface PolygonClipper.  
clipConvexPolygonInPlace(xyz: GrowableXYZArray, work: GrowableXYZArray, inside: booleantrue, tolerance: numberGeometry.smallMetricDistance): number Clip a polygon to the inside or outside of the plane.  
clone(): ClipPlane Return a cloned plane  
cloneNegated(): ClipPlane Return a cloned plane with coordinate data negated.  
dotProductPlaneNormalPoint(point: Point3d): number Return the dot product of the plane normal with the point (treating the point xyz as a vector, and NOT  
getBoundedSegmentSimpleIntersection(pointA: Point3d, pointB: Point3d): undefined | number Compute intersection of (unbounded) segment with the plane.  
getFrame(): Transform Return a coordinate frame with  
getPlane3d(): Plane3dByOriginAndUnitNormal Return the Plane3d form of the plane.  
getPlane4d(): Point4d Return the Point4d d form of the plane.  
intersectRange(range: Range3d, addClosurePoint: booleanfalse): undefined | GrowableXYZArray Return the intersection of the plane with a range cube.  
isAlmostEqual(other: ClipPlane): boolean Return true if all members are almostEqual to corresponding members of other.  
isPointInside(point: Point3d, tolerance: numberGeometry.smallMetricDistance): boolean Return true if spacePoint is strictly inside the halfspace, with tolerance applied to "on".  
isPointOn(point: Point3d, tolerance: numberGeometry.smallMetricDistance): boolean Return true if spacePoint is strictly on the plane, within tolerance  
isPointOnOrInside(spacePoint: Point3d, tolerance: numberGeometry.smallMetricDistance): boolean Return true if spacePoint is inside or on the plane, with tolerance applied to "on".  
multiplyPlaneByMatrix4d(matrix: Matrix4d, invert: booleantrue, transpose: booleantrue): boolean Multiply the ClipPlane's DPoint4d by matrix.  
negateInPlace(): void Reverse the sign of all coefficients, so outside and inside reverse  
normalX(): number Return the x component of the normal used to evaluate altitude.  
normalY(): number Return the x component of the normal used to evaluate altitude.  
normalZ(): number Return the z component of the normal used to evaluate altitude.  
offsetDistance(offset: number): void Move the plane INWARD by given distance  
projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d Project a point in space to the plane.  
setFlags(invisible: boolean, interior: boolean): void Set both the invisible and interior flags.  
setInvisible(invisible: boolean): void Set the invisible flag.  
setPlane4d(plane: Point4d): void Set the plane from DPoint4d style plane.  
toJSON(): ClipPlaneProps Return a json object of the form  
transformInPlace(transform: Transform): boolean Apply transform to the origin.  
velocity(vector: Vector3d): number Return the dot product of the plane normal with the vector (NOT using the plane's distanceFromOrigin).  
velocityXYZ(x: number, y: number, z: number): number Return the dot product of the plane normal with the x,yz, vector components (NOT using the plane's  
weightedAltitude(point: Point4d): number Evaluate the altitude in weighted space, i.e.  
createEdgeAndUpVector(point0: Point3d, point1: Point3d, upVector: Vector3d, tiltAngle?: Angle, result?: ClipPlane): undefined | ClipPlane Static Create a plane defined by two points, an up vector, and a tilt angle relative to the up vector.  
createEdgeXY(point0: Point3d, point1: Point3d, result?: ClipPlane): undefined | ClipPlane Static Create a plane perpendicular to the edge between the xy parts of point0 and point1.  
createNormalAndDistance(normal: Vector3d, distance: number, invisible: booleanfalse, interior: booleanfalse, result?: ClipPlane): undefined | ClipPlane Static Create a ClipPlane with direct normal and signedDistance.  
createNormalAndPoint(normal: Vector3d, point: Point3d, invisible: booleanfalse, interior: booleanfalse, result?: ClipPlane): undefined | ClipPlane Static Create a ClipPlane  
createNormalAndPointXYZXYZ(normalX: number, normalY: number, normalZ: number, originX: number, originY: number, originZ: number, invisible: booleanfalse, interior: booleanfalse, result?: ClipPlane): undefined | ClipPlane Static Create a ClipPlane  
createOriginAndVectors(origin: Point3d, vectorA: Vector3d, vectorB: Vector3d, invisible: booleanfalse, interior: booleanfalse, result?: ClipPlane): undefined | ClipPlane Static Create a clip plane  
createPlane(plane: Plane3dByOriginAndUnitNormal, invisible: booleanfalse, interior: booleanfalse, result?: ClipPlane): ClipPlane Static Create a ClipPlane from Plane3dByOriginAndUnitNormal.  
fromJSON(json: ClipPlaneProps, result?: ClipPlane): undefined | ClipPlane Static Parse json object to ClipPlane instance  

Inherited methods

Name Inherited from Description
classifyAltitude(point: Point3d, tolerance: numberGeometry.smallMetricDistance): "-1" | "0" | "1" Inherited Plane3d Return a value -1, 0, 1 giving a signed indicator of whether the toleranced altitude of the point is
classifyAltitudeXYZ(x: number, y: number, z: number, tolerance: numberGeometry.smallMetricDistance): "-1" | "0" | "1" Inherited Plane3d Return a value -1, 0, 1 giving a signed indicator of whether the toleranced altitude of x,y,z is
getAnyPointOnPlane(result?: Point3d): Point3d Inherited Plane3d Return any point on the plane.
getUnitNormal(result?: Vector3d): undefined | Vector3d Inherited Plane3d Return the unit normal for the plane.
isPointInPlane(spacePoint: Point3d, tolerance: numberGeometry.smallMetricDistance): boolean Inherited Plane3d Returns true if spacePoint is within distance tolerance of the plane.

Properties

Name Type Description
distance Accessor ReadOnly number Return the stored distanceFromOrigin property.  
interior Accessor ReadOnly boolean Return the "interior" property bit  
invisible Accessor ReadOnly boolean Return the "invisible" property bit.  
inwardNormalRef Accessor ReadOnly Vector3d * Return the stored inward normal property.  

Defined in

Last Updated: 14 November, 2024