@itwin/core-geometry 4.2.0-dev.9 → 4.3.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -1
- package/lib/cjs/Geometry.d.ts +4 -4
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +2 -2
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts +4 -3
- package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.d.ts +4 -3
- package/lib/cjs/clipping/BooleanClipNode.d.ts.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +2 -1
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.d.ts +17 -11
- package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +14 -8
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.d.ts +6 -5
- package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipVector.js +1 -1
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +3 -2
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +2 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +1 -3
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +1 -3
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +4 -4
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +93 -91
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +171 -152
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +19 -19
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +20 -22
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.d.ts +47 -30
- package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurve.js +81 -46
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +1 -1
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +17 -5
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +14 -2
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveOps.d.ts +1 -1
- package/lib/cjs/curve/CurveOps.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +1 -2
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +2 -2
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/CurveProcessor.d.ts +1 -1
- package/lib/cjs/curve/CurveProcessor.js.map +1 -1
- package/lib/cjs/curve/{CurveChain.d.ts → CurveTypes.d.ts} +6 -6
- package/lib/cjs/curve/CurveTypes.d.ts.map +1 -0
- package/lib/cjs/curve/{CurveChain.js → CurveTypes.js} +1 -1
- package/lib/cjs/curve/CurveTypes.js.map +1 -0
- package/lib/cjs/curve/CurveWireMomentsXYZ.d.ts +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/cjs/curve/ParityRegion.d.ts +3 -3
- package/lib/cjs/curve/ParityRegion.d.ts.map +1 -1
- package/lib/cjs/curve/ParityRegion.js +2 -2
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts +3 -2
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +2 -2
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/CurveSplitContext.d.ts +1 -1
- package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.d.ts +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/cjs/curve/Query/InOutTests.d.ts +1 -1
- package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.d.ts +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +54 -5
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +154 -3
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts +20 -11
- package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js +22 -11
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.d.ts +3 -3
- package/lib/cjs/curve/UnionRegion.d.ts.map +1 -1
- package/lib/cjs/curve/UnionRegion.js +2 -2
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js +2 -2
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +233 -0
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -0
- package/lib/cjs/curve/{CurveCurveCloseApproachXY.js → internalContexts/CurveCurveCloseApproachXY.js} +299 -202
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -0
- package/lib/{esm/curve → cjs/curve/internalContexts}/CurveCurveIntersectXY.d.ts +45 -51
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -0
- package/lib/cjs/curve/{CurveCurveIntersectXY.js → internalContexts/CurveCurveIntersectXY.js} +104 -115
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -0
- package/lib/cjs/curve/{CurveCurveIntersectXYZ.d.ts → internalContexts/CurveCurveIntersectXYZ.d.ts} +18 -18
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -0
- package/lib/cjs/curve/{CurveCurveIntersectXYZ.js → internalContexts/CurveCurveIntersectXYZ.js} +134 -108
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -0
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.d.ts +2 -2
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js +9 -5
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +1 -0
- package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js +1 -0
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.d.ts +28 -11
- package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js +57 -45
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.d.ts +15 -26
- package/lib/cjs/geometry3d/GeometryHandler.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.js +23 -32
- package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +0 -8
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +0 -16
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +4 -4
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +12 -0
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +3 -6
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +1 -2
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +0 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +2 -2
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +2 -3
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts +1 -1
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +1 -1
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts +3 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +4 -3
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.d.ts +2 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.d.ts.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.d.ts +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +4 -6
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/geometry4d/Map4d.d.ts +14 -8
- package/lib/cjs/geometry4d/Map4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Map4d.js +38 -16
- package/lib/cjs/geometry4d/Map4d.js.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js +4 -2
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.d.ts +2 -2
- package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/Polynomials.js +2 -2
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +18 -6
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +55 -25
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.d.ts +16 -7
- package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js +38 -7
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +5 -39
- package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +7 -41
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +10 -8
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +64 -18
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +6 -0
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +68 -2
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts +1 -1
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SweepContour.d.ts +35 -26
- package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
- package/lib/cjs/solid/SweepContour.js +84 -100
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts +29 -11
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +45 -26
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeMarkSet.d.ts +2 -2
- package/lib/cjs/topology/HalfEdgeMarkSet.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeMarkSet.js +4 -4
- package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/cjs/topology/Merging.d.ts +3 -0
- package/lib/cjs/topology/Merging.d.ts.map +1 -1
- package/lib/cjs/topology/Merging.js +19 -5
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/Triangulation.d.ts +15 -7
- package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
- package/lib/cjs/topology/Triangulation.js +89 -47
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/esm/Geometry.d.ts +4 -4
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +2 -2
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.d.ts +4 -3
- package/lib/esm/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.d.ts +4 -3
- package/lib/esm/clipping/BooleanClipNode.d.ts.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +2 -1
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.d.ts +17 -11
- package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +14 -8
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.d.ts +6 -5
- package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
- package/lib/esm/clipping/ClipVector.js +1 -1
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +3 -2
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +2 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +1 -3
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +1 -3
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +4 -4
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +93 -91
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +171 -152
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +19 -19
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +19 -20
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.d.ts +47 -30
- package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurve.js +81 -46
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +1 -1
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +17 -5
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +12 -1
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveOps.d.ts +1 -1
- package/lib/esm/curve/CurveOps.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +1 -2
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +2 -2
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/CurveProcessor.d.ts +1 -1
- package/lib/esm/curve/CurveProcessor.js.map +1 -1
- package/lib/esm/curve/{CurveChain.d.ts → CurveTypes.d.ts} +6 -6
- package/lib/esm/curve/CurveTypes.d.ts.map +1 -0
- package/lib/esm/curve/{CurveChain.js → CurveTypes.js} +1 -1
- package/lib/esm/curve/CurveTypes.js.map +1 -0
- package/lib/esm/curve/CurveWireMomentsXYZ.d.ts +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/esm/curve/ParityRegion.d.ts +3 -3
- package/lib/esm/curve/ParityRegion.d.ts.map +1 -1
- package/lib/esm/curve/ParityRegion.js +2 -2
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts +3 -2
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/CurveSplitContext.d.ts +1 -1
- package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/esm/curve/Query/CylindricalRange.d.ts +1 -1
- package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/esm/curve/Query/InOutTests.d.ts +1 -1
- package/lib/esm/curve/Query/InOutTests.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.d.ts +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +54 -5
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +153 -3
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts +20 -11
- package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/esm/curve/StrokeOptions.js +22 -11
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.d.ts +3 -3
- package/lib/esm/curve/UnionRegion.d.ts.map +1 -1
- package/lib/esm/curve/UnionRegion.js +2 -2
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js +2 -2
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +233 -0
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -0
- package/lib/esm/curve/{CurveCurveCloseApproachXY.js → internalContexts/CurveCurveCloseApproachXY.js} +299 -202
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -0
- package/lib/{cjs/curve → esm/curve/internalContexts}/CurveCurveIntersectXY.d.ts +45 -51
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -0
- package/lib/esm/curve/{CurveCurveIntersectXY.js → internalContexts/CurveCurveIntersectXY.js} +103 -113
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -0
- package/lib/esm/curve/{CurveCurveIntersectXYZ.d.ts → internalContexts/CurveCurveIntersectXYZ.d.ts} +18 -18
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -0
- package/lib/esm/curve/{CurveCurveIntersectXYZ.js → internalContexts/CurveCurveIntersectXYZ.js} +134 -108
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -0
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.d.ts +2 -2
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js +9 -5
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.d.ts +1 -0
- package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js +1 -0
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.d.ts +28 -11
- package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js +57 -45
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.d.ts +15 -26
- package/lib/esm/geometry3d/GeometryHandler.d.ts.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.js +23 -32
- package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts +0 -8
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +0 -16
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +4 -4
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +12 -0
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +3 -6
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +1 -2
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +0 -1
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +2 -2
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +2 -3
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts +1 -1
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +1 -1
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts +3 -1
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +4 -3
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.d.ts +2 -1
- package/lib/esm/geometry3d/ReusableObjectCache.d.ts.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.d.ts +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +4 -6
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/geometry4d/Map4d.d.ts +14 -8
- package/lib/esm/geometry4d/Map4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Map4d.js +38 -16
- package/lib/esm/geometry4d/Map4d.js.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js +4 -2
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/Polynomials.d.ts +2 -2
- package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
- package/lib/esm/numerics/Polynomials.js +2 -2
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +18 -6
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +55 -25
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.d.ts +16 -7
- package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js +38 -7
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +5 -39
- package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js +7 -41
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +10 -8
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +64 -18
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +6 -0
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +68 -2
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/solid/LinearSweep.d.ts +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts +1 -1
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.d.ts +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SweepContour.d.ts +35 -26
- package/lib/esm/solid/SweepContour.d.ts.map +1 -1
- package/lib/esm/solid/SweepContour.js +84 -100
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +29 -11
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +45 -26
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeMarkSet.d.ts +2 -2
- package/lib/esm/topology/HalfEdgeMarkSet.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeMarkSet.js +2 -2
- package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/esm/topology/Merging.d.ts +3 -0
- package/lib/esm/topology/Merging.d.ts.map +1 -1
- package/lib/esm/topology/Merging.js +19 -5
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/Triangulation.d.ts +15 -7
- package/lib/esm/topology/Triangulation.d.ts.map +1 -1
- package/lib/esm/topology/Triangulation.js +89 -47
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/package.json +4 -4
- package/lib/cjs/curve/CurveChain.d.ts.map +0 -1
- package/lib/cjs/curve/CurveChain.js.map +0 -1
- package/lib/cjs/curve/CurveCurveCloseApproachXY.d.ts +0 -175
- package/lib/cjs/curve/CurveCurveCloseApproachXY.d.ts.map +0 -1
- package/lib/cjs/curve/CurveCurveCloseApproachXY.js.map +0 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.d.ts.map +0 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.js.map +0 -1
- package/lib/cjs/curve/CurveCurveIntersectXYZ.d.ts.map +0 -1
- package/lib/cjs/curve/CurveCurveIntersectXYZ.js.map +0 -1
- package/lib/esm/curve/CurveChain.d.ts.map +0 -1
- package/lib/esm/curve/CurveChain.js.map +0 -1
- package/lib/esm/curve/CurveCurveCloseApproachXY.d.ts +0 -175
- package/lib/esm/curve/CurveCurveCloseApproachXY.d.ts.map +0 -1
- package/lib/esm/curve/CurveCurveCloseApproachXY.js.map +0 -1
- package/lib/esm/curve/CurveCurveIntersectXY.d.ts.map +0 -1
- package/lib/esm/curve/CurveCurveIntersectXY.js.map +0 -1
- package/lib/esm/curve/CurveCurveIntersectXYZ.d.ts.map +0 -1
- package/lib/esm/curve/CurveCurveIntersectXYZ.js.map +0 -1
|
@@ -8,6 +8,7 @@ exports.CurveChainWithDistanceIndex = exports.PathFragment = void 0;
|
|
|
8
8
|
/** @packageDocumentation
|
|
9
9
|
* @module Curve
|
|
10
10
|
*/
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
11
12
|
const CurvePrimitive_1 = require("../curve/CurvePrimitive");
|
|
12
13
|
const StrokeCountMap_1 = require("../curve/Query/StrokeCountMap");
|
|
13
14
|
const Geometry_1 = require("../Geometry");
|
|
@@ -20,14 +21,14 @@ const PlaneAltitudeRangeContext_1 = require("./internalContexts/PlaneAltitudeRan
|
|
|
20
21
|
const OffsetOptions_1 = require("./OffsetOptions");
|
|
21
22
|
const Path_1 = require("./Path");
|
|
22
23
|
/**
|
|
23
|
-
* Annotation of an interval of a curve.
|
|
24
|
+
* Annotation of a fragment, i.e. an interval of a curve.
|
|
24
25
|
* * The interval is marked with two pairs of numbers:
|
|
25
|
-
* * * fraction0, fraction1 = fraction parameters along the child curve
|
|
26
|
-
* * * distance0,distance1 = distances within containing CurveChainWithDistanceIndex
|
|
26
|
+
* * * fraction0, fraction1 = fraction parameters along the child curve.
|
|
27
|
+
* * * distance0, distance1 = distances within containing CurveChainWithDistanceIndex.
|
|
27
28
|
* @public
|
|
28
29
|
*/
|
|
29
30
|
class PathFragment {
|
|
30
|
-
/** Create a fragment with complete fraction, distance and child data. */
|
|
31
|
+
/** Create a fragment with complete fraction, distance, and child data. */
|
|
31
32
|
constructor(childFraction0, childFraction1, distance0, distance1, childCurve, range) {
|
|
32
33
|
this.childFraction0 = childFraction0;
|
|
33
34
|
this.childFraction1 = childFraction1;
|
|
@@ -37,68 +38,64 @@ class PathFragment {
|
|
|
37
38
|
this.range = range;
|
|
38
39
|
this.a = 0;
|
|
39
40
|
}
|
|
40
|
-
/**
|
|
41
|
-
* Return true if the distance is within the distance limits of this fragment.
|
|
42
|
-
* @param distance
|
|
43
|
-
*/
|
|
41
|
+
/** Return true if the distance is within the distance limits of this fragment. */
|
|
44
42
|
containsChainDistance(distance) {
|
|
45
43
|
return distance >= this.chainDistance0 && distance <= this.chainDistance1;
|
|
46
44
|
}
|
|
47
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Return a quick minimum distance from spacePoint to the curve.
|
|
47
|
+
* * The returned distance is to the curve's range box if defined; otherwise, the true distance is computed.
|
|
48
|
+
* * Thus the returned distance may be SMALLER than the true distance to the curve, but not larger.
|
|
49
|
+
*/
|
|
48
50
|
quickMinDistanceToChildCurve(spacePoint) {
|
|
49
|
-
if (this.range)
|
|
51
|
+
if (this.range)
|
|
50
52
|
return this.range.distanceToPoint(spacePoint);
|
|
51
|
-
}
|
|
52
|
-
// ugh. have to do real computation ..
|
|
53
53
|
const detail = this.childCurve.closestPoint(spacePoint, false);
|
|
54
54
|
if (detail)
|
|
55
55
|
return detail.a;
|
|
56
56
|
return 0;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
* Return an array with (references to) all the path fragments, sorted smallest to largest on the "a" value
|
|
60
|
-
*
|
|
59
|
+
* Return an array with (references to) all the input path fragments, sorted smallest to largest on the "a" value,
|
|
60
|
+
* initialized with `quickMinDistanceToChildCurve`
|
|
61
61
|
*/
|
|
62
62
|
static collectSortedQuickMinDistances(fragments, spacePoint) {
|
|
63
63
|
const sortedFragments = [];
|
|
64
|
-
for (const
|
|
65
|
-
|
|
66
|
-
sortedFragments.push(
|
|
64
|
+
for (const frag of fragments) {
|
|
65
|
+
frag.a = frag.quickMinDistanceToChildCurve(spacePoint);
|
|
66
|
+
sortedFragments.push(frag);
|
|
67
67
|
}
|
|
68
|
-
sortedFragments.sort((
|
|
68
|
+
sortedFragments.sort((frag1, frag2) => frag1.a - frag2.a);
|
|
69
69
|
return sortedFragments;
|
|
70
70
|
}
|
|
71
|
-
/**
|
|
72
|
-
* Return true if this fragment addresses `curve` and brackets `fraction`
|
|
73
|
-
* @param distance
|
|
74
|
-
*/
|
|
71
|
+
/** Return true if `this` fragment addresses `curve` and brackets `fraction`. */
|
|
75
72
|
containsChildCurveAndChildFraction(curve, fraction) {
|
|
76
73
|
return this.childCurve === curve && fraction >= this.childFraction0 && fraction <= this.childFraction1;
|
|
77
74
|
}
|
|
78
75
|
/**
|
|
79
|
-
* Convert distance to local fraction
|
|
80
|
-
* Note that proportional calculation does NOT account for
|
|
76
|
+
* Convert distance to local fraction and apply that to interpolate between the stored curve fractions.
|
|
77
|
+
* Note that proportional calculation does NOT account for non-uniform parameterization in the child curve.
|
|
81
78
|
*/
|
|
82
79
|
chainDistanceToInterpolatedChildFraction(distance) {
|
|
83
|
-
return Geometry_1.Geometry.inverseInterpolate(this.childFraction0, this.chainDistance0, this.childFraction1, this.chainDistance1, distance, this.childFraction0); // the interval
|
|
80
|
+
return Geometry_1.Geometry.inverseInterpolate(this.childFraction0, this.chainDistance0, this.childFraction1, this.chainDistance1, distance, this.childFraction0); // the interval must have nonzero length so division should be safe
|
|
84
81
|
}
|
|
85
|
-
/** Convert chainDistance to
|
|
82
|
+
/** Convert the given chainDistance to a fraction along this childCurve using `moveSignedDistanceFromFraction`. */
|
|
86
83
|
chainDistanceToAccurateChildFraction(chainDistance, allowExtrapolation) {
|
|
87
|
-
// The fragments are really expected to do good mappings in their distance range ...
|
|
88
84
|
const childDetail = this.childCurve.moveSignedDistanceFromFraction(this.childFraction0, chainDistance - this.chainDistance0, allowExtrapolation ?? false);
|
|
89
85
|
return childDetail.fraction;
|
|
90
86
|
}
|
|
91
87
|
/**
|
|
92
|
-
* Return the scale factor to map childCurve fraction derivatives to chain fraction derivatives
|
|
93
|
-
* @param globalDistance total length of the global curve
|
|
88
|
+
* Return the scale factor to map childCurve fraction derivatives to chain fraction derivatives.
|
|
89
|
+
* @param globalDistance total length of the global curve
|
|
94
90
|
*/
|
|
95
91
|
fractionScaleFactor(globalDistance) {
|
|
96
92
|
return globalDistance * (this.childFraction1 - this.childFraction0) / (this.chainDistance1 - this.chainDistance0);
|
|
97
93
|
}
|
|
98
94
|
/**
|
|
99
95
|
* Reverse the fraction and distance data.
|
|
100
|
-
* *
|
|
101
|
-
* *
|
|
96
|
+
* * Each child fraction `f` is replaced by `1-f`
|
|
97
|
+
* * Each `chainDistance` is replaced by `totalDistance - chainDistance`
|
|
98
|
+
* @param totalDistance the total distance
|
|
102
99
|
*/
|
|
103
100
|
reverseFractionsAndDistances(totalDistance) {
|
|
104
101
|
const f0 = this.childFraction0;
|
|
@@ -110,14 +107,14 @@ class PathFragment {
|
|
|
110
107
|
this.chainDistance0 = totalDistance - d1;
|
|
111
108
|
this.chainDistance1 = totalDistance - d0;
|
|
112
109
|
}
|
|
113
|
-
/** @deprecated in 3.x. Use childFractionToChainDistance */
|
|
110
|
+
/** @deprecated in 3.x. Use `PathFragment.childFractionToChainDistance`. */
|
|
114
111
|
childFractionTChainDistance(fraction) {
|
|
115
112
|
return this.childFractionToChainDistance(fraction);
|
|
116
113
|
}
|
|
117
114
|
/**
|
|
118
|
-
* Convert a fractional position on the childCurve to distance
|
|
119
|
-
* * Return value is SIGNED
|
|
120
|
-
* @param fraction
|
|
115
|
+
* Convert a fractional position on the childCurve of this fragment to distance on the curve chain.
|
|
116
|
+
* * Return value is SIGNED and will be negative when `fraction < this.childFraction0`.
|
|
117
|
+
* @param fraction the fractional position on the childCurve of this fragment
|
|
121
118
|
*/
|
|
122
119
|
childFractionToChainDistance(fraction) {
|
|
123
120
|
let d = this.childCurve.curveLengthBetweenFractions(this.childFraction0, fraction);
|
|
@@ -127,7 +124,7 @@ class PathFragment {
|
|
|
127
124
|
}
|
|
128
125
|
}
|
|
129
126
|
exports.PathFragment = PathFragment;
|
|
130
|
-
/** Non-instantiable class to build a distance index for a
|
|
127
|
+
/** Non-instantiable class to build a distance index for a curve chain. */
|
|
131
128
|
class DistanceIndexConstructionContext {
|
|
132
129
|
constructor() {
|
|
133
130
|
this._accumulatedDistance = 0;
|
|
@@ -139,7 +136,6 @@ class DistanceIndexConstructionContext {
|
|
|
139
136
|
endParentCurvePrimitive(_cp) { }
|
|
140
137
|
endCurvePrimitive(_cp) { }
|
|
141
138
|
announcePointTangent(_xyz, _fraction, _tangent) { }
|
|
142
|
-
/** Announce numPoints interpolated between point0 and point1, with associated fractions */
|
|
143
139
|
announceSegmentInterval(cp, point0, point1, numStrokes, fraction0, fraction1) {
|
|
144
140
|
const fragmentPoint0 = point0.clone();
|
|
145
141
|
const fragmentPoint1 = point1.clone();
|
|
@@ -171,7 +167,10 @@ class DistanceIndexConstructionContext {
|
|
|
171
167
|
this._fragments.push(new PathFragment(f0, f1, d0, this._accumulatedDistance, cp, range));
|
|
172
168
|
}
|
|
173
169
|
}
|
|
174
|
-
needPrimaryGeometryForStrokes() {
|
|
170
|
+
needPrimaryGeometryForStrokes() {
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
/** Create an array of PathFragment from input curve chain. */
|
|
175
174
|
static createPathFragmentIndex(path, options) {
|
|
176
175
|
const handler = new DistanceIndexConstructionContext();
|
|
177
176
|
for (const curve of path.children) {
|
|
@@ -186,12 +185,11 @@ class DistanceIndexConstructionContext {
|
|
|
186
185
|
* distance along a CurveChain.
|
|
187
186
|
* * For example if the total length of the chain is `L`, then the distance along the chain from parameters `t0`
|
|
188
187
|
* to `t1` is easily computed as `L*(t1-t0)`.
|
|
189
|
-
* * The curve chain can be any type derived from CurveChain.
|
|
190
|
-
* * * i.e. either a `Path` or a `Loop`
|
|
188
|
+
* * The curve chain can be any type derived from `CurveChain`, i.e., either a `Path` or a `Loop`.
|
|
191
189
|
* @public
|
|
192
190
|
*/
|
|
193
191
|
class CurveChainWithDistanceIndex extends CurvePrimitive_1.CurvePrimitive {
|
|
194
|
-
/** Test if other is a `CurveChainWithDistanceIndex` */
|
|
192
|
+
/** Test if `other` is a `CurveChainWithDistanceIndex` */
|
|
195
193
|
isSameGeometryClass(other) {
|
|
196
194
|
return other instanceof CurveChainWithDistanceIndex;
|
|
197
195
|
}
|
|
@@ -216,7 +214,7 @@ class CurveChainWithDistanceIndex extends CurvePrimitive_1.CurvePrimitive {
|
|
|
216
214
|
}
|
|
217
215
|
/**
|
|
218
216
|
* Reference to the contained path.
|
|
219
|
-
* * Do not modify the path.
|
|
217
|
+
* * Do not modify the path. The distance index will be wrong.
|
|
220
218
|
*/
|
|
221
219
|
get path() {
|
|
222
220
|
return this._path;
|
|
@@ -310,14 +308,14 @@ class CurveChainWithDistanceIndex extends CurvePrimitive_1.CurvePrimitive {
|
|
|
310
308
|
}
|
|
311
309
|
return true;
|
|
312
310
|
}
|
|
313
|
-
/** Return the start point of
|
|
311
|
+
/** Return the start point of `this` curve. */
|
|
314
312
|
startPoint(result) {
|
|
315
313
|
const c = this._path.cyclicCurvePrimitive(0);
|
|
316
314
|
if (c)
|
|
317
315
|
return c.startPoint(result);
|
|
318
316
|
return Point3dVector3d_1.Point3d.createZero(result);
|
|
319
317
|
}
|
|
320
|
-
/** Return the end point of
|
|
318
|
+
/** Return the end point of of `this` curve. */
|
|
321
319
|
endPoint(result) {
|
|
322
320
|
const c = this._path.cyclicCurvePrimitive(-1);
|
|
323
321
|
if (c)
|
|
@@ -353,7 +351,7 @@ class CurveChainWithDistanceIndex extends CurvePrimitive_1.CurvePrimitive {
|
|
|
353
351
|
/**
|
|
354
352
|
* Return an array containing only the curve primitives.
|
|
355
353
|
* @param collectorArray array to receive primitives (pushed -- the array is not cleared)
|
|
356
|
-
* @param smallestPossiblePrimitives if true, recurse on the
|
|
354
|
+
* @param smallestPossiblePrimitives if true, recurse on the children. If false, only push `this`.
|
|
357
355
|
* @param explodeLinestrings (if smallestPossiblePrimitives is true) whether to push a [[LineSegment3d]] for each
|
|
358
356
|
* segment of a [[LineString3d]] child. If false, push only the [[LineString3d]].
|
|
359
357
|
*/
|
|
@@ -380,21 +378,17 @@ class CurveChainWithDistanceIndex extends CurvePrimitive_1.CurvePrimitive {
|
|
|
380
378
|
CurvePrimitive_1.CurvePrimitive.installStrokeCountMap(this, myMap, parentStrokeMap);
|
|
381
379
|
}
|
|
382
380
|
/**
|
|
383
|
-
* Second step of double dispatch:
|
|
381
|
+
* Second step of double dispatch: call `this._path.dispatchToGeometryHandler (handler)`
|
|
384
382
|
* * Note that this exposes the children individually to the handler.
|
|
385
383
|
*/
|
|
386
384
|
dispatchToGeometryHandler(handler) {
|
|
387
|
-
return
|
|
385
|
+
return handler.handleCurveChainWithDistanceIndex(this);
|
|
388
386
|
}
|
|
389
|
-
/** Extend
|
|
387
|
+
/** Extend `rangeToExtend` as needed to include these curves (optionally transformed) */
|
|
390
388
|
extendRange(rangeToExtend, transform) {
|
|
391
389
|
this._path.extendRange(rangeToExtend, transform);
|
|
392
390
|
}
|
|
393
|
-
/**
|
|
394
|
-
* Curve length is always positive.
|
|
395
|
-
* @returns Returns a (high accuracy) length of the curve between fractional positions
|
|
396
|
-
* @returns Returns the length of the curve.
|
|
397
|
-
*/
|
|
391
|
+
/** Return a (high accuracy and positive) length of the curve between fractional positions */
|
|
398
392
|
curveLengthBetweenFractions(fraction0, fraction1) {
|
|
399
393
|
return Math.abs(fraction1 - fraction0) * this._totalLength;
|
|
400
394
|
}
|
|
@@ -408,9 +402,10 @@ class CurveChainWithDistanceIndex extends CurvePrimitive_1.CurvePrimitive {
|
|
|
408
402
|
return result;
|
|
409
403
|
}
|
|
410
404
|
/**
|
|
411
|
-
*
|
|
412
|
-
* @param distance
|
|
413
|
-
* @param allowExtrapolation
|
|
405
|
+
* Return the PathFragment object at the given `distance` along the chain.
|
|
406
|
+
* @param distance distance along the chain.
|
|
407
|
+
* @param allowExtrapolation if `true`, returns first fragment for negative distances and returns last fragment
|
|
408
|
+
* for distances larger than curve length. If `false` returns `undefined` for those out of bound distances.
|
|
414
409
|
*/
|
|
415
410
|
chainDistanceToFragment(distance, allowExtrapolation = false) {
|
|
416
411
|
const i = this.chainDistanceToFragmentIndex(distance, allowExtrapolation);
|
|
@@ -419,9 +414,10 @@ class CurveChainWithDistanceIndex extends CurvePrimitive_1.CurvePrimitive {
|
|
|
419
414
|
return undefined;
|
|
420
415
|
}
|
|
421
416
|
/**
|
|
422
|
-
*
|
|
423
|
-
* @param distance
|
|
424
|
-
* @param allowExtrapolation
|
|
417
|
+
* Return the index of the PathFragment at the given `distance` along the chain.
|
|
418
|
+
* @param distance distance along the chain.
|
|
419
|
+
* @param allowExtrapolation if `true`, returns 0 for negative distances and returns last fragment index for
|
|
420
|
+
* distances larger than curve length. If `false` returns `undefined` for those out of bound distances.
|
|
425
421
|
*/
|
|
426
422
|
chainDistanceToFragmentIndex(distance, allowExtrapolation = false) {
|
|
427
423
|
const numFragments = this._fragments.length;
|
|
@@ -431,7 +427,7 @@ class CurveChainWithDistanceIndex extends CurvePrimitive_1.CurvePrimitive {
|
|
|
431
427
|
return allowExtrapolation ? 0 : undefined;
|
|
432
428
|
if (distance > this._totalLength)
|
|
433
429
|
return allowExtrapolation ? (numFragments - 1) : undefined;
|
|
434
|
-
//
|
|
430
|
+
// linear search (opportunity for improvement)
|
|
435
431
|
for (let i = 0; i < numFragments; i++) {
|
|
436
432
|
if (fragments[i].containsChainDistance(distance))
|
|
437
433
|
return i;
|
|
@@ -441,33 +437,29 @@ class CurveChainWithDistanceIndex extends CurvePrimitive_1.CurvePrimitive {
|
|
|
441
437
|
}
|
|
442
438
|
/**
|
|
443
439
|
* Convert distance along the chain to fraction along the chain.
|
|
444
|
-
* @param distance distance along the chain
|
|
440
|
+
* @param distance distance along the chain.
|
|
445
441
|
*/
|
|
446
442
|
chainDistanceToChainFraction(distance) {
|
|
447
443
|
return distance / this._totalLength;
|
|
448
444
|
}
|
|
449
|
-
/**
|
|
450
|
-
* Resolve a fraction within a specific curve to a fragment.
|
|
451
|
-
* @param curve
|
|
452
|
-
* @param fraction
|
|
453
|
-
*/
|
|
445
|
+
/** Return the PathFragment object containing the point at the given `fraction` of the given child curve. */
|
|
454
446
|
curveAndChildFractionToFragment(curve, fraction) {
|
|
455
447
|
const numFragments = this._fragments.length;
|
|
456
448
|
const fragments = this._fragments;
|
|
457
449
|
if (numFragments > 0) {
|
|
458
|
-
|
|
450
|
+
if (fraction < 0)
|
|
451
|
+
return fragments[0];
|
|
452
|
+
if (fraction > 1.0)
|
|
453
|
+
return fragments[numFragments - 1];
|
|
454
|
+
// linear search (opportunity for improvement)
|
|
459
455
|
for (const fragment of fragments) {
|
|
460
456
|
if (fragment.containsChildCurveAndChildFraction(curve, fraction))
|
|
461
457
|
return fragment;
|
|
462
458
|
}
|
|
463
|
-
if (fraction <= 0)
|
|
464
|
-
return fragments[0];
|
|
465
|
-
if (fraction > 1.0)
|
|
466
|
-
return fragments[numFragments - 1];
|
|
467
459
|
}
|
|
468
460
|
return undefined;
|
|
469
461
|
}
|
|
470
|
-
/** Returns the total length of
|
|
462
|
+
/** Returns the total length of `this` curve. */
|
|
471
463
|
curveLength() {
|
|
472
464
|
return this._totalLength;
|
|
473
465
|
}
|
|
@@ -480,52 +472,59 @@ class CurveChainWithDistanceIndex extends CurvePrimitive_1.CurvePrimitive {
|
|
|
480
472
|
}
|
|
481
473
|
/**
|
|
482
474
|
* Return the point (x,y,z) on the curve at fractional position along the chain.
|
|
483
|
-
* @param fraction fractional position along the
|
|
484
|
-
* @returns
|
|
475
|
+
* @param fraction fractional position along the curve.
|
|
476
|
+
* @returns a point on the curve.
|
|
485
477
|
*/
|
|
486
478
|
fractionToPoint(fraction, result) {
|
|
487
|
-
const
|
|
488
|
-
const fragment = this.chainDistanceToFragment(
|
|
479
|
+
const distanceAlongPath = fraction * this._totalLength;
|
|
480
|
+
const fragment = this.chainDistanceToFragment(distanceAlongPath, true);
|
|
489
481
|
if (fragment) {
|
|
490
|
-
const childFraction = fragment.chainDistanceToAccurateChildFraction(
|
|
482
|
+
const childFraction = fragment.chainDistanceToAccurateChildFraction(distanceAlongPath, true);
|
|
491
483
|
return fragment.childCurve.fractionToPoint(childFraction, result);
|
|
492
484
|
}
|
|
493
|
-
//
|
|
494
|
-
//
|
|
485
|
+
(0, core_bentley_1.assert)(false); // we never expect to get here
|
|
486
|
+
// no fragment found. just return the first point on the curve.
|
|
495
487
|
return this._fragments[0].childCurve.fractionToPoint(0.0, result);
|
|
496
488
|
}
|
|
497
489
|
/**
|
|
498
490
|
* Return the point (x,y,z) and derivative on the curve at fractional position.
|
|
499
|
-
* * Note that
|
|
500
|
-
* *
|
|
501
|
-
* *
|
|
491
|
+
* * Note that the derivative is "derivative of xyz with respect to fraction".
|
|
492
|
+
* * The derivative shows the speed of the "fractional point" moving along the curve.
|
|
493
|
+
* * The derivative is not generally a unit vector. Use `fractionToPointAndUnitTangent` for a unit vector.
|
|
502
494
|
* @param fraction fractional position along the geometry.
|
|
503
|
-
* @
|
|
495
|
+
* @param result optional receiver for the result.
|
|
496
|
+
* @returns a ray whose origin is the curve point and direction is the derivative with respect to the fraction.
|
|
504
497
|
*/
|
|
505
498
|
fractionToPointAndDerivative(fraction, result) {
|
|
506
499
|
const distanceAlongPath = fraction * this._totalLength;
|
|
507
500
|
const fragment = this.chainDistanceToFragment(distanceAlongPath, true);
|
|
508
|
-
const
|
|
509
|
-
result = fragment.childCurve.fractionToPointAndDerivative(
|
|
510
|
-
//
|
|
511
|
-
//
|
|
512
|
-
// Then
|
|
513
|
-
// derivative we seek is
|
|
514
|
-
|
|
501
|
+
const childFraction = fragment.chainDistanceToAccurateChildFraction(distanceAlongPath, true);
|
|
502
|
+
result = fragment.childCurve.fractionToPointAndDerivative(childFraction, result);
|
|
503
|
+
// Recall the standard arclength formula s(t) for the curve C = C(t), with derivative s'(t) = ||C'||.
|
|
504
|
+
// Define fractional arclength for C by f = f(t) = s(t)/L, where L is the total length of C. Then f' = ||C'||/L.
|
|
505
|
+
// Denote the inverse of f by t = t(f). Then C = C(t(f)) is a parameterization of C by its fractional arclength f.
|
|
506
|
+
// Since the derivative of t is t'=1/f'=L/||C'||, the derivative we seek is d/df(C(t(f))) = C' t' = C' L/||C'||.
|
|
507
|
+
// The fragment gives us C', so we're just a scale away.
|
|
508
|
+
// Math details can be found at core/geometry/internaldocs/Curve.md
|
|
509
|
+
const a = this._totalLength / result.direction.magnitude(); // L/||C'||
|
|
515
510
|
result.direction.scaleInPlace(a);
|
|
516
511
|
return result;
|
|
517
512
|
}
|
|
518
513
|
/**
|
|
519
|
-
*
|
|
514
|
+
* Return the point (x,y,z) and normalized derivative on the curve at fractional position.
|
|
515
|
+
* * Note that the derivative is "derivative of xyz with respect to fraction".
|
|
516
|
+
* * The un-normalized derivative shows the speed of the "fractional point" moving along the curve.
|
|
517
|
+
* * To find the un-normalized derivative, use `fractionToPointAndDerivative`.
|
|
520
518
|
* @param fraction fractional position on the curve
|
|
521
519
|
* @param result optional receiver for the result.
|
|
522
|
-
*
|
|
520
|
+
* @returns a ray whose origin is the curve point and direction is the normalized derivative with respect to
|
|
521
|
+
* the fraction.
|
|
523
522
|
*/
|
|
524
523
|
fractionToPointAndUnitTangent(fraction, result) {
|
|
525
524
|
const distanceAlongPath = fraction * this._totalLength;
|
|
526
525
|
const fragment = this.chainDistanceToFragment(distanceAlongPath, true);
|
|
527
|
-
const
|
|
528
|
-
result = fragment.childCurve.fractionToPointAndDerivative(
|
|
526
|
+
const childFraction = fragment.chainDistanceToAccurateChildFraction(distanceAlongPath, true);
|
|
527
|
+
result = fragment.childCurve.fractionToPointAndDerivative(childFraction, result);
|
|
529
528
|
result.direction.normalizeInPlace();
|
|
530
529
|
return result;
|
|
531
530
|
}
|
|
@@ -534,34 +533,39 @@ class CurveChainWithDistanceIndex extends CurvePrimitive_1.CurvePrimitive {
|
|
|
534
533
|
* * origin at fractional position along the curve
|
|
535
534
|
* * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to
|
|
536
535
|
* the fraction.
|
|
537
|
-
* * vectorV is the second derivative, i.e.derivative of vectorU
|
|
536
|
+
* * vectorV is the second derivative, i.e. derivative of vectorU which points in the direction of the curve's
|
|
537
|
+
* derivative's change.
|
|
538
538
|
*/
|
|
539
539
|
fractionToPointAnd2Derivatives(fraction, result) {
|
|
540
540
|
const distanceAlongPath = fraction * this._totalLength;
|
|
541
541
|
const fragment = this.chainDistanceToFragment(distanceAlongPath, true);
|
|
542
|
-
const
|
|
543
|
-
result = fragment.childCurve.fractionToPointAnd2Derivatives(
|
|
542
|
+
const childFraction = fragment.chainDistanceToAccurateChildFraction(distanceAlongPath, true);
|
|
543
|
+
result = fragment.childCurve.fractionToPointAnd2Derivatives(childFraction, result);
|
|
544
544
|
if (!result)
|
|
545
545
|
return undefined;
|
|
546
|
-
// See fractionToPointAndDerivative
|
|
547
|
-
//
|
|
548
|
-
// d/
|
|
549
|
-
//
|
|
546
|
+
// See fractionToPointAndDerivative, where we show d/df(C(t(f))) = L C'/||C'||.
|
|
547
|
+
// Here we seek the 2nd derivative. We'll use the quotient rule, and the identities
|
|
548
|
+
// d/dt||x(t)|| = x.x'/||x|| and ||x||^2 = x.x, where "." is the dot product.
|
|
549
|
+
// d2/df2(C(t(f))) = L d/df(C'/||C'||) = L (||C'|| d/df(C') - C' d/df||C'||) / ||C'||^2
|
|
550
550
|
// = L (||C'|| C" L/||C'|| - C' C'.C"/||C'|| L/||C'||) / ||C'||^2
|
|
551
|
-
// = (L/||C'||)^2 (C" - C' C'.C"/C'.C' )
|
|
552
|
-
//
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
const
|
|
558
|
-
result.vectorU.
|
|
559
|
-
|
|
551
|
+
// = (L/||C'||)^2 (C" - C' C'.C"/C'.C' ), where C' and C" are given by the fragment.
|
|
552
|
+
// The second derivative that fractionToPointAnd2Derivatives returns is C", so the second
|
|
553
|
+
// derivative we seek is just few scales away.
|
|
554
|
+
// Math details can be found at core/geometry/internaldocs/Curve.md
|
|
555
|
+
const magU = result.vectorU.magnitude(); // ||C'||
|
|
556
|
+
const dotUU = magU * magU; // ||C'||^2
|
|
557
|
+
const dotUV = result.vectorU.dotProduct(result.vectorV); // C'.C"
|
|
558
|
+
result.vectorV.addScaledInPlace(result.vectorU, -dotUV / dotUU); // add -(C'*C'.C")/(||C'||^2) to vectorV
|
|
559
|
+
const scale = this._totalLength / magU; // L/||C'||
|
|
560
|
+
result.vectorU.scaleInPlace(scale); // scale vectorU by L/||C'||
|
|
561
|
+
result.vectorV.scaleInPlace(scale * scale); // scale vectorV by (L/||C'(t)||)^2
|
|
560
562
|
return result;
|
|
561
563
|
}
|
|
562
564
|
/**
|
|
563
565
|
* Attempt to transform in place.
|
|
564
|
-
* * Warning: If any child fails, this object becomes invalid
|
|
566
|
+
* * Warning: If any child transform fails, `this` object becomes invalid but that should never happen.
|
|
567
|
+
* @param transform the transform to be applied.
|
|
568
|
+
* @returns true if all of child transforms succeed and false otherwise.
|
|
565
569
|
*/
|
|
566
570
|
tryTransformInPlace(transform) {
|
|
567
571
|
let numFail = 0;
|
|
@@ -574,48 +578,45 @@ class CurveChainWithDistanceIndex extends CurvePrimitive_1.CurvePrimitive {
|
|
|
574
578
|
/** Reverse the curve's data so that its fractional stroking moves in the opposite direction. */
|
|
575
579
|
reverseInPlace() {
|
|
576
580
|
this._path.reverseChildrenInPlace();
|
|
577
|
-
const totalLength = this._totalLength;
|
|
578
581
|
for (const fragment of this._fragments) {
|
|
579
|
-
fragment.reverseFractionsAndDistances(
|
|
582
|
+
fragment.reverseFractionsAndDistances(this._totalLength);
|
|
580
583
|
}
|
|
581
584
|
this._fragments.reverse();
|
|
582
585
|
}
|
|
583
586
|
/**
|
|
584
|
-
* Test for equality conditions
|
|
585
|
-
* * Mismatched
|
|
586
|
-
* * If
|
|
587
|
-
* @param other
|
|
587
|
+
* Test for equality conditions.
|
|
588
|
+
* * Mismatched total length is a quick exit condition.
|
|
589
|
+
* * If total length matches, recurse to the path for matching primitives.
|
|
588
590
|
*/
|
|
589
591
|
isAlmostEqual(other) {
|
|
590
592
|
if (other instanceof CurveChainWithDistanceIndex) {
|
|
591
|
-
return Geometry_1.Geometry.isSameCoordinate(this._totalLength, other._totalLength)
|
|
592
|
-
&& this._path.isAlmostEqual(other._path);
|
|
593
|
+
return Geometry_1.Geometry.isSameCoordinate(this._totalLength, other._totalLength) && this._path.isAlmostEqual(other._path);
|
|
593
594
|
}
|
|
594
595
|
return false;
|
|
595
596
|
}
|
|
596
597
|
/**
|
|
597
|
-
*
|
|
598
|
-
* * See `CurvePrimitive` for parameter details.
|
|
599
|
-
* * The returned location directly identifies fractional position along the CurveChainWithDistanceIndex
|
|
598
|
+
* (Attempt to) find a position on the curve at a signed distance from start fraction.
|
|
599
|
+
* * See `CurvePrimitive.moveSignedDistanceFromFraction` for parameter details.
|
|
600
|
+
* * The returned location directly identifies fractional position along the CurveChainWithDistanceIndex and
|
|
600
601
|
* has pointer to an additional detail for the child curve.
|
|
601
602
|
*/
|
|
602
603
|
moveSignedDistanceFromFraction(startFraction, signedDistance, allowExtension, result) {
|
|
603
604
|
const distanceA = startFraction * this._totalLength;
|
|
604
605
|
const distanceB = distanceA + signedDistance;
|
|
605
606
|
const fragmentB = this.chainDistanceToFragment(distanceB, true);
|
|
606
|
-
const childDetail = fragmentB.childCurve.moveSignedDistanceFromFraction(fragmentB.childFraction0, distanceB - fragmentB.chainDistance0, allowExtension, result);
|
|
607
|
+
const childDetail = fragmentB.childCurve.moveSignedDistanceFromFraction(fragmentB.childFraction0, distanceB - fragmentB.chainDistance0, allowExtension, result); // local detail related to the child curve
|
|
607
608
|
const endFraction = startFraction + (signedDistance / this._totalLength);
|
|
608
|
-
const chainDetail = CurveLocationDetail_1.CurveLocationDetail.createConditionalMoveSignedDistance(allowExtension, this, startFraction, endFraction, signedDistance, result);
|
|
609
|
+
const chainDetail = CurveLocationDetail_1.CurveLocationDetail.createConditionalMoveSignedDistance(allowExtension, this, startFraction, endFraction, signedDistance, result); // global detail related to the curve chain
|
|
609
610
|
chainDetail.childDetail = childDetail;
|
|
610
611
|
return chainDetail;
|
|
611
612
|
}
|
|
612
613
|
/**
|
|
614
|
+
* Return an object summarizing closest point test counts.
|
|
613
615
|
* The returned object has
|
|
614
616
|
* * numCalls = number of times closestPoint was called.
|
|
615
|
-
* * numCurvesTested = number of curves tested with full closestPoint
|
|
616
|
-
* * numAssigned = number of times a new minimum value was recorded
|
|
617
|
+
* * numCurvesTested = number of curves tested with full closestPoint.
|
|
618
|
+
* * numAssigned = number of times a new minimum value was recorded.
|
|
617
619
|
* * numCandidate = number of curves that would be tested in worst case.
|
|
618
|
-
* return an object summarizing closest point test counts
|
|
619
620
|
* @param clear if true, counts are cleared after the return object is formed.
|
|
620
621
|
*/
|
|
621
622
|
static getClosestPointTestCounts(clear = true) {
|
|
@@ -632,13 +633,13 @@ class CurveChainWithDistanceIndex extends CurvePrimitive_1.CurvePrimitive {
|
|
|
632
633
|
}
|
|
633
634
|
/**
|
|
634
635
|
* Search for the curve point that is closest to the spacePoint.
|
|
635
|
-
* * The CurveChainWithDistanceIndex invokes the base class CurvePrimitive method, which
|
|
636
|
-
*
|
|
637
|
-
* * The returned detail directly identifies fractional position along the CurveChainWithDistanceIndex
|
|
636
|
+
* * The CurveChainWithDistanceIndex invokes the base class CurvePrimitive method, which (via a handler)
|
|
637
|
+
* determines a CurveLocation detail among the children.
|
|
638
|
+
* * The returned detail directly identifies fractional position along the CurveChainWithDistanceIndex and
|
|
638
639
|
* has pointer to an additional detail for the child curve.
|
|
639
640
|
* @param spacePoint point in space
|
|
640
641
|
* @param extend true to extend the curve
|
|
641
|
-
* @returns
|
|
642
|
+
* @returns a CurveLocationDetail structure that holds the details of the close point.
|
|
642
643
|
*/
|
|
643
644
|
closestPoint(spacePoint, extend) {
|
|
644
645
|
let childDetail;
|
|
@@ -649,44 +650,43 @@ class CurveChainWithDistanceIndex extends CurvePrimitive_1.CurvePrimitive {
|
|
|
649
650
|
}
|
|
650
651
|
else {
|
|
651
652
|
const sortedFragments = PathFragment.collectSortedQuickMinDistances(this._fragments, spacePoint);
|
|
652
|
-
const extend0 = [
|
|
653
|
-
|
|
653
|
+
const extend0 = [
|
|
654
|
+
CurveExtendMode_1.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 0),
|
|
655
|
+
CurveExtendMode_1.CurveExtendMode.None,
|
|
656
|
+
];
|
|
657
|
+
const extend1 = [
|
|
658
|
+
CurveExtendMode_1.CurveExtendMode.None,
|
|
659
|
+
CurveExtendMode_1.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 1),
|
|
660
|
+
];
|
|
654
661
|
const fragment0 = this._fragments[0];
|
|
655
662
|
const fragment1 = this._fragments[this._fragments.length - 1];
|
|
656
663
|
CurveChainWithDistanceIndex._numCalls++;
|
|
657
664
|
CurveChainWithDistanceIndex._numCandidate += sortedFragments.length;
|
|
658
|
-
|
|
659
|
-
|
|
665
|
+
let detailA;
|
|
666
|
+
for (const sortedFragment of sortedFragments) {
|
|
667
|
+
if (sortedFragment.a > aMin)
|
|
668
|
+
// sortedFragments help early exit because it is likely that one of the first few fragments
|
|
669
|
+
// in sortedFragments is the fragment with minimum distance from space point to the curve.
|
|
660
670
|
break;
|
|
661
671
|
CurveChainWithDistanceIndex._numTested++;
|
|
662
|
-
const child =
|
|
663
|
-
|
|
672
|
+
const child = sortedFragment.childCurve;
|
|
673
|
+
detailA = child.closestPoint(spacePoint, sortedFragment === fragment0 ? extend0 : sortedFragment === fragment1 ? extend1 : false, detailA);
|
|
664
674
|
if (detailA && detailA.a < aMin) {
|
|
665
675
|
aMin = detailA.a;
|
|
666
|
-
childDetail =
|
|
667
|
-
childDetail.a = detailA.a;
|
|
676
|
+
childDetail = detailA.clone(childDetail);
|
|
668
677
|
CurveChainWithDistanceIndex._numAssigned++;
|
|
669
678
|
}
|
|
670
679
|
}
|
|
671
680
|
}
|
|
672
681
|
if (!childDetail)
|
|
673
682
|
return undefined;
|
|
674
|
-
|
|
675
|
-
if (fragment) {
|
|
676
|
-
const chainDistance = fragment.childFractionToChainDistance(childDetail.fraction);
|
|
677
|
-
const chainFraction = this.chainDistanceToChainFraction(chainDistance);
|
|
678
|
-
const chainDetail = CurveLocationDetail_1.CurveLocationDetail.createCurveFractionPoint(this, chainFraction, childDetail.point);
|
|
679
|
-
chainDetail.childDetail = childDetail;
|
|
680
|
-
chainDetail.a = childDetail.a;
|
|
681
|
-
return chainDetail;
|
|
682
|
-
}
|
|
683
|
-
return undefined;
|
|
683
|
+
return this.computeChainDetail(childDetail);
|
|
684
684
|
}
|
|
685
685
|
/**
|
|
686
686
|
* Construct an offset of each child as viewed in the xy-plane (ignoring z).
|
|
687
|
-
* * No attempt is made to join the offset children. Use RegionOps.constructCurveXYOffset
|
|
687
|
+
* * No attempt is made to join the offset children. Use RegionOps.constructCurveXYOffset to return a fully
|
|
688
688
|
* joined offset.
|
|
689
|
-
* @param offsetDistanceOrOptions offset distance (positive to left of the instance curve)
|
|
689
|
+
* @param offsetDistanceOrOptions offset distance (positive to left of the instance curve) or offset options object.
|
|
690
690
|
*/
|
|
691
691
|
constructOffsetXY(offsetDistanceOrOptions) {
|
|
692
692
|
const options = OffsetOptions_1.OffsetOptions.create(offsetDistanceOrOptions);
|
|
@@ -706,13 +706,32 @@ class CurveChainWithDistanceIndex extends CurvePrimitive_1.CurvePrimitive {
|
|
|
706
706
|
* Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of
|
|
707
707
|
* projection.
|
|
708
708
|
* @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.
|
|
709
|
-
* @param lowHigh optional receiver for output
|
|
709
|
+
* @param lowHigh optional receiver for output.
|
|
710
710
|
* @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the
|
|
711
711
|
* end of the ray.
|
|
712
712
|
*/
|
|
713
713
|
projectedParameterRange(ray, lowHigh) {
|
|
714
714
|
return PlaneAltitudeRangeContext_1.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
|
|
715
715
|
}
|
|
716
|
+
/**
|
|
717
|
+
* Compute the global chain detail corresponding to a local child detail.
|
|
718
|
+
* @param childDetail the local detail, with respect to a child of this chain.
|
|
719
|
+
* @returns the global detail, with respect to this chain.
|
|
720
|
+
*/
|
|
721
|
+
computeChainDetail(childDetail) {
|
|
722
|
+
if (!childDetail.curve)
|
|
723
|
+
return undefined;
|
|
724
|
+
const fragment = this.curveAndChildFractionToFragment(childDetail.curve, childDetail.fraction);
|
|
725
|
+
if (fragment) {
|
|
726
|
+
const chainDistance = fragment.childFractionToChainDistance(childDetail.fraction);
|
|
727
|
+
const chainFraction = this.chainDistanceToChainFraction(chainDistance);
|
|
728
|
+
const chainDetail = CurveLocationDetail_1.CurveLocationDetail.createCurveFractionPoint(this, chainFraction, childDetail.point);
|
|
729
|
+
chainDetail.childDetail = childDetail;
|
|
730
|
+
chainDetail.a = childDetail.a;
|
|
731
|
+
return chainDetail;
|
|
732
|
+
}
|
|
733
|
+
return undefined;
|
|
734
|
+
}
|
|
716
735
|
}
|
|
717
736
|
CurveChainWithDistanceIndex._numCalls = 0;
|
|
718
737
|
CurveChainWithDistanceIndex._numTested = 0;
|