Path Class

  • A Path object is a collection of curves that join head-to-tail to form a path.
  • A Path object does not bound a planar region. Use Loop to indicate region bounding.

@see Curve Collections learning article.

Extends

Methods

Name Description
constructor(): Path Construct an empty path.  
announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void Invoke processor.announcePath(this, indexInParent)  
cloneEmptyPeer(): Path Clone as a new Path with no primitives  
cloneStroked(options?: StrokeOptions): Path Return a deep copy, with leaf-level curve primitives stroked.  
dgnBoundaryType(): number Return the boundary type (1) of a corresponding MicroStation CurveVector  
dispatchToGeometryHandler(handler: GeometryHandler): any Second step of double dispatch: call handler.handlePath(this)  
isSameGeometryClass(other: GeometryQuery): boolean Test if other is an instance of Path  
create(...curves: Point3d[] | CurvePrimitive[]): Path Static Create a path from a variable length list of curve primitives  
createArray(curves: CurvePrimitive[]): Path Static Create a path from a an array of curve primitives.  

Inherited methods

Name Inherited from Description
checkForNonLinearPrimitives(): boolean CurveChain Return true if the curve collection has any primitives other than LineSegment3d and LineString3d
childIndex(target: undefined | CurvePrimitive, alsoSearchProxies?: boolean): undefined | number CurveChain Return the index where target is found in the array of children.
clone(): CurveCollection CurveChain Return a deep copy.
cloneTransformed(transform: Transform): undefined | CurveCollection CurveChain Create a deep copy of transformed curves.
cloneWithExpandedLineStrings(): CurveCollection CurveChain Create a deep copy with all linestrings broken down into multiple LineSegment3d.
closestPoint(spacePoint: Point3d): undefined | CurveLocationDetail CurveChain Return the closest point on the contained curves
collectCurvePrimitives(collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLineStrings: boolean = false): CurvePrimitive[] CurveChain Return an array containing all CurvePrimitives in the instance.
cyclicCurvePrimitive(index: number, cyclic: boolean = true): undefined | CurvePrimitive CurveChain Return the curve primitive at the given index, optionally using modulo to map index to the cyclic indexing.
extendRange(range: Range3d, transform?: Transform): void CurveChain Invoke curve.extendRange(range, transform) for each child
getChild(i: number): undefined | CurvePrimitive CurveChain Return a child by index
getPackedStrokes(options?: StrokeOptions): undefined | GrowableXYZArray CurveChain Stroke the chain into a simple xyz array.
isAlmostEqual(other: GeometryQuery): boolean CurveChain Test for exact structure and nearly identical geometry.
isAnyRegion(): this is AnyRegion CurveChain Type guard for AnyRegion
isLoop(): this is Loop CurveChain Type guard for Loop
isPath(): this is Path CurveChain Type guard for Path
maxGap(): number CurveChain Return the max gap between adjacent primitives in Path and Loop collections.
primitiveIndexAndFractionToCurveLocationDetailPointAndDerivative(index: number, fraction: number, cyclic: boolean = false, result?: CurveLocationDetail): undefined | CurveLocationDetail CurveChain Evaluate an indexed curve at a fraction.
projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): undefined | Range1d CurveChain Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters
range(transform?: Transform, result?: Range3d): Range3d CurveChain Return the range of the entire GeometryQuery tree.
reverseChildrenInPlace(): void CurveChain Reverse each child curve (in place)
sumLengths(): number CurveChain Return the sum of the lengths of all contained curves.
tryAddChild(child: undefined | AnyCurve): boolean CurveChain Add a child curve.
tryTransformInPlace(transform: Transform): boolean CurveChain Apply transform recursively to children
tryTranslateInPlace(dx: number, dy: number = 0.0, dz: number = 0.0): boolean CurveChain Try to move the geometry by dx,dy,dz.
areAlmostEqual(a: undefined | GeometryQuery, b: undefined | GeometryQuery): boolean Static CurveChain Apply instance method CurveChain.isAlmostEqual if both are defined.
createCurveLocationDetailOnAnyCurvePrimitive(source: undefined | GeometryQuery, fraction: number = 0.5): undefined | CurveLocationDetail Static CurveChain Find any CurvePrimitive in the source and evaluate it at the given fraction.

Properties

Name Type Description
curveCollectionType Readonly "path" String name for schema properties  

Inherited properties

Name Type Inherited from Description
_curves Protected CurvePrimitive[] CurveChain The curve primitives in the chain.
children Accessor ReadOnly CurvePrimitive[] CurveChain Return the array of CurvePrimitive
geometryCategory Readonly "curveCollection" CurveChain String name for schema properties
isAnyRegionType Accessor ReadOnly boolean CurveChain Return true for planar region types:
* Loop
* ParityRegion
* UnionRegion
isClosedPath Accessor ReadOnly boolean CurveChain Return true for a single-loop planar region type, i.e. Loop.
* This is NOT a test for physical closure of a Path.
isInner boolean CurveChain Flag for inner loop status.
isOpenPath Accessor ReadOnly boolean CurveChain Return true for a Path, i.e. a chain of curves joined head-to-tail

Defined in

Last Updated: 25 April, 2024