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.



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): AnyCurve 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: Array<CurvePrimitive | Point3d[]>): Path Static Create a path from a variable length list of curve primitives
* CurvePrimitive params are captured !!!
createArray(curves: CurvePrimitive[]): Path Static Create a path from a an array of curve primitives  

Inherited methods

Name Inherited from Description
checkForNonLinearPrimitives(): boolean CurveCollection return true if the curve collection has any primitives other than LineSegment3d and LineString3d
clone(): CurveCollection | undefined CurveCollection Return a deep copy.
cloneTransformed(transform: Transform): CurveCollection | undefined CurveCollection Create a deep copy of transformed curves.
cloneWithExpandedLineStrings(): CurveCollection | undefined CurveCollection Create a deep copy with all linestrings expanded to multiple LineSegment3d.
collectCurvePrimitives(): CurvePrimitive[] CurveCollection Return an array containing only the curve primitives.
cyclicCurvePrimitive(index: number): CurvePrimitive | undefined CurveChain Return the [index] curve primitive, using modulo to mapindex to the cyclic indexing.
extendRange(range: Range3d, transform?: Transform): void CurveChain invoke curve.extendRange(range, transform) for each child
getChild(i: number): CurvePrimitive | undefined CurveChain Return a child by index
getPackedStrokes(options?: StrokeOptions): GrowableXYZArray | undefined CurveChain Stroke the chain into a simple xyz array.
isAlmostEqual(other: GeometryQuery): boolean GeometryQuery test for exact structure and nearly identical geometry.
maxGap(): number CurveCollection return the max gap between adjacent primitives in Path and Loop collections.
range(transform?: Transform, result?: Range3d): Range3d GeometryQuery return the range of the entire (tree) GeometryQuery
reverseChildrenInPlace(): void CurveChain Reverse each child curve (in place)
Reverse the order of the children in the CurveChain array.
sumLengths(): number CurveCollection Return the sum of the lengths of all contained curves.
tryAddChild(child: AnyCurve | undefined): boolean CurveChain add a child curve.
tryTransformInPlace(transform: Transform): boolean CurveCollection Apply transform recursively to children
tryTranslateInPlace(dx: number, dy: number = 0, dz: number = 0): boolean GeometryQuery try to move the geometry by dx,dy,dz
createCurveLocationDetailOnAnyCurvePrimitive(source: GeometryQuery | undefined, fraction: number = 0.5): CurveLocationDetail | undefined Static CurveCollection * Find any curve primitive in the source.


Name Type Description
curveCollectionType "path" = "path"    

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 "curveCollection" = "curveCollection" CurveCollection  
isAnyRegionType Accessor ReadOnly boolean CurveCollection Return true for planar region types:
* UnionRegion
isClosedPath Accessor ReadOnly boolean CurveCollection 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 CurveCollection Flag for inner loop status.
isOpenPath Accessor ReadOnly boolean CurveCollection Return true for a Path, i.e. a chain of curves joined head-to-tail

Defined in

Last Updated: 20 September, 2019