@itwin/core-geometry 3.5.0-dev.7 → 3.6.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 +65 -1
- package/lib/cjs/Geometry.d.ts +26 -10
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +32 -17
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts +11 -5
- package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +47 -18
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.d.ts +10 -3
- package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.js +12 -4
- package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.d.ts.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js +4 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/cjs/bspline/KnotVector.d.ts.map +1 -1
- package/lib/cjs/bspline/KnotVector.js +3 -0
- package/lib/cjs/bspline/KnotVector.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +10 -4
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +17 -5
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +15 -7
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +46 -29
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +13 -4
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +23 -2
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.js +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXYZ.d.ts +4 -3
- package/lib/cjs/curve/CurveCurveIntersectXYZ.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXYZ.js +8 -6
- package/lib/cjs/curve/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +20 -18
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +58 -339
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.d.ts +8 -2
- package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +9 -0
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +18 -2
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +39 -23
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/ProxyCurve.d.ts +9 -7
- package/lib/cjs/curve/ProxyCurve.d.ts.map +1 -1
- package/lib/cjs/curve/ProxyCurve.js +4 -0
- package/lib/cjs/curve/ProxyCurve.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +2 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js +5 -4
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +5 -0
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +17 -3
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +9 -6
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js +55 -47
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.d.ts +55 -0
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js +143 -0
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -0
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts +43 -0
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js +146 -0
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -0
- package/lib/cjs/curve/internalContexts/CurveLengthContext.d.ts +33 -0
- package/lib/cjs/curve/internalContexts/CurveLengthContext.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/CurveLengthContext.js +91 -0
- package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -0
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.d.ts +21 -0
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js +34 -0
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -0
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts +31 -8
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js +77 -12
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts +2 -2
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js +15 -8
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts +12 -7
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js +12 -3
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.d.ts +66 -42
- package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Angle.js +201 -99
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts +102 -60
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +191 -106
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +25 -8
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +67 -15
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.d.ts +1 -0
- package/lib/cjs/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js +2 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts +86 -25
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +230 -81
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts +14 -4
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js +15 -5
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +121 -67
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +318 -137
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts +1 -2
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +1 -2
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts +5 -5
- package/lib/cjs/geometry3d/Ray3d.js +5 -5
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/Polynomials.js +0 -1
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +4 -4
- package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js +3 -3
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/Polyface.d.ts +7 -2
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +8 -1
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +36 -8
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +112 -31
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js +4 -3
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/solid/Sphere.d.ts +1 -1
- package/lib/cjs/solid/Sphere.js +3 -3
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.d.ts +17 -13
- package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
- package/lib/cjs/solid/TorusPipe.js +67 -38
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts +1 -1
- package/lib/cjs/topology/Graph.js +1 -1
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/Merging.d.ts.map +1 -1
- package/lib/cjs/topology/Merging.js +9 -1
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/Triangulation.d.ts +1 -1
- package/lib/cjs/topology/Triangulation.js +1 -1
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/esm/Geometry.d.ts +26 -10
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +32 -17
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts +11 -5
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +47 -18
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.d.ts +10 -3
- package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js +12 -4
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.d.ts.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.js +4 -1
- package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/esm/bspline/KnotVector.d.ts.map +1 -1
- package/lib/esm/bspline/KnotVector.js +3 -0
- package/lib/esm/bspline/KnotVector.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +10 -4
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +17 -5
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +15 -7
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +46 -29
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +13 -4
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +23 -2
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXY.js +1 -1
- package/lib/esm/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXYZ.d.ts +4 -3
- package/lib/esm/curve/CurveCurveIntersectXYZ.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXYZ.js +8 -6
- package/lib/esm/curve/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +20 -18
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +52 -333
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.d.ts +8 -2
- package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +9 -0
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +18 -2
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +39 -23
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/ProxyCurve.d.ts +9 -7
- package/lib/esm/curve/ProxyCurve.d.ts.map +1 -1
- package/lib/esm/curve/ProxyCurve.js +4 -0
- package/lib/esm/curve/ProxyCurve.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts +2 -1
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js +5 -4
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +5 -0
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +17 -3
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +9 -6
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js +56 -48
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.d.ts +55 -0
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js +139 -0
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -0
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts +43 -0
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js +142 -0
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -0
- package/lib/esm/curve/internalContexts/CurveLengthContext.d.ts +33 -0
- package/lib/esm/curve/internalContexts/CurveLengthContext.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/CurveLengthContext.js +87 -0
- package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -0
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.d.ts +21 -0
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js +30 -0
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -0
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts +31 -8
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js +77 -12
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts +2 -2
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js +15 -8
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts +12 -7
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js +12 -3
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/geometry3d/Angle.d.ts +66 -42
- package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
- package/lib/esm/geometry3d/Angle.js +201 -99
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts +102 -60
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +191 -106
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +25 -8
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +67 -15
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.d.ts +1 -0
- package/lib/esm/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js +2 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.d.ts +86 -25
- package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +230 -81
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts +14 -4
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js +15 -5
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +121 -67
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +318 -137
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts +1 -2
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +1 -2
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts +5 -5
- package/lib/esm/geometry3d/Ray3d.js +5 -5
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
- package/lib/esm/numerics/Polynomials.js +0 -1
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +4 -4
- package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js +3 -3
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/Polyface.d.ts +7 -2
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +8 -1
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +36 -8
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +113 -32
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js +4 -3
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/solid/Sphere.d.ts +1 -1
- package/lib/esm/solid/Sphere.js +3 -3
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/TorusPipe.d.ts +17 -13
- package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
- package/lib/esm/solid/TorusPipe.js +67 -38
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +1 -1
- package/lib/esm/topology/Graph.js +1 -1
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/Merging.d.ts.map +1 -1
- package/lib/esm/topology/Merging.js +9 -1
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/Triangulation.d.ts +1 -1
- package/lib/esm/topology/Triangulation.js +1 -1
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,16 +1,23 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Curve
|
|
7
|
+
*/
|
|
8
|
+
import { assert } from "@itwin/core-bentley";
|
|
1
9
|
import { StrokeCountMap } from "../curve/Query/StrokeCountMap";
|
|
2
10
|
import { AxisOrder, Geometry } from "../Geometry";
|
|
3
11
|
import { Matrix3d } from "../geometry3d/Matrix3d";
|
|
4
12
|
import { Point3d } from "../geometry3d/Point3dVector3d";
|
|
13
|
+
import { Range3d } from "../geometry3d/Range";
|
|
5
14
|
import { Ray3d } from "../geometry3d/Ray3d";
|
|
6
15
|
import { Transform } from "../geometry3d/Transform";
|
|
7
|
-
import { Order2Bezier } from "../numerics/BezierPolynomials";
|
|
8
|
-
import { Newton1dUnboundedApproximateDerivative, NewtonEvaluatorRtoR } from "../numerics/Newton";
|
|
9
|
-
import { GaussMapper } from "../numerics/Quadrature";
|
|
10
|
-
import { CurveExtendOptions } from "./CurveExtendMode";
|
|
11
16
|
import { CurveIntervalRole, CurveLocationDetail, CurveSearchStatus } from "./CurveLocationDetail";
|
|
12
17
|
import { GeometryQuery } from "./GeometryQuery";
|
|
13
|
-
import {
|
|
18
|
+
import { AppendPlaneIntersectionStrokeHandler } from "./internalContexts/AppendPlaneIntersectionStrokeHandler";
|
|
19
|
+
import { ClosestPointStrokeHandler } from "./internalContexts/ClosestPointStrokeHandler";
|
|
20
|
+
import { CurveLengthContext } from "./internalContexts/CurveLengthContext";
|
|
14
21
|
/**
|
|
15
22
|
* A curve primitive is bounded
|
|
16
23
|
* A curve primitive maps fractions in 0..1 to points in space.
|
|
@@ -220,9 +227,8 @@ export class CurvePrimitive extends GeometryQuery {
|
|
|
220
227
|
* * (Attempt to) find a position on the curve at a signed distance from start fraction.
|
|
221
228
|
* * Return the position as a CurveLocationDetail.
|
|
222
229
|
* * In the `CurveLocationDetail`, record:
|
|
223
|
-
* * `
|
|
224
|
-
* * `
|
|
225
|
-
* * `search
|
|
230
|
+
* * `fraction` = fractional position
|
|
231
|
+
* * `point` = coordinates of the point
|
|
226
232
|
* * `a` = (signed!) distance moved. If `allowExtension` is false and the move reached the start or end of the curve, this distance is smaller than the requested signedDistance.
|
|
227
233
|
* * `curveSearchStatus` indicates one of:
|
|
228
234
|
* * `error` (unusual) computation failed not supported for this curve.
|
|
@@ -277,13 +283,39 @@ export class CurvePrimitive extends GeometryQuery {
|
|
|
277
283
|
* @param result
|
|
278
284
|
*/
|
|
279
285
|
moveSignedDistanceFromFractionGeneric(startFraction, signedDistance, allowExtension, result) {
|
|
280
|
-
|
|
286
|
+
let limitFraction;
|
|
287
|
+
const slackFraction = 0.1; // slack to use when integration would otherwise have no room to work
|
|
288
|
+
if (signedDistance === 0.0)
|
|
289
|
+
return CurveLocationDetail.createCurveEvaluatedFraction(this, startFraction, result); // no movement, just evaluate at startFraction
|
|
290
|
+
if (signedDistance > 0.0) {
|
|
291
|
+
limitFraction = 1.0;
|
|
292
|
+
if (startFraction >= 1.0) {
|
|
293
|
+
const newStartFraction = 1.0 - slackFraction;
|
|
294
|
+
signedDistance += this.curveLengthBetweenFractions(newStartFraction, startFraction);
|
|
295
|
+
startFraction = newStartFraction;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
else { // signedDistance < 0.0
|
|
299
|
+
limitFraction = 0.0;
|
|
300
|
+
if (startFraction <= 0.0) {
|
|
301
|
+
const newStartFraction = 0.0 + slackFraction;
|
|
302
|
+
signedDistance -= this.curveLengthBetweenFractions(startFraction, newStartFraction);
|
|
303
|
+
startFraction = newStartFraction;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
const availableLength = this.curveLengthBetweenFractions(startFraction, limitFraction);
|
|
307
|
+
assert(availableLength > 0.0);
|
|
281
308
|
const absDistance = Math.abs(signedDistance);
|
|
282
|
-
const directionFactor = signedDistance < 0.0 ? -1.0 : 1.0;
|
|
283
|
-
const availableLength = this.curveLengthBetweenFractions(startFraction, limitFraction); // that is always positive
|
|
284
309
|
if (availableLength < absDistance && !allowExtension)
|
|
285
310
|
return CurveLocationDetail.createConditionalMoveSignedDistance(allowExtension, this, startFraction, limitFraction, signedDistance, result);
|
|
286
|
-
const fractionStep = absDistance
|
|
311
|
+
const fractionStep = Geometry.conditionalDivideCoordinate(absDistance, availableLength);
|
|
312
|
+
if (undefined === fractionStep) {
|
|
313
|
+
// no available length!
|
|
314
|
+
result = CurveLocationDetail.createCurveEvaluatedFraction(this, startFraction, result);
|
|
315
|
+
result.curveSearchStatus = CurveSearchStatus.error;
|
|
316
|
+
return result;
|
|
317
|
+
}
|
|
318
|
+
const directionFactor = signedDistance < 0.0 ? -1.0 : 1.0;
|
|
287
319
|
let fractionB = Geometry.interpolate(startFraction, fractionStep, limitFraction);
|
|
288
320
|
let fractionA = startFraction;
|
|
289
321
|
let distanceA = 0.0;
|
|
@@ -318,9 +350,8 @@ export class CurvePrimitive extends GeometryQuery {
|
|
|
318
350
|
distanceA = distance0B;
|
|
319
351
|
}
|
|
320
352
|
if (numConverged > 1)
|
|
321
|
-
return CurveLocationDetail.createConditionalMoveSignedDistance(
|
|
353
|
+
return CurveLocationDetail.createConditionalMoveSignedDistance(allowExtension, this, startFraction, fractionB, signedDistance, result);
|
|
322
354
|
result = CurveLocationDetail.createCurveEvaluatedFraction(this, startFraction, result);
|
|
323
|
-
result.a = 0.0;
|
|
324
355
|
result.curveSearchStatus = CurveSearchStatus.error;
|
|
325
356
|
return result;
|
|
326
357
|
}
|
|
@@ -364,7 +395,7 @@ export class CurvePrimitive extends GeometryQuery {
|
|
|
364
395
|
return undefined;
|
|
365
396
|
}
|
|
366
397
|
/**
|
|
367
|
-
* * If the curve primitive has distance-along-curve strictly proportional to curve fraction, return
|
|
398
|
+
* * If the curve primitive has distance-along-curve strictly proportional to curve fraction, return the scale factor.
|
|
368
399
|
* * If distance-along-the-curve is not proportional, return undefined.
|
|
369
400
|
* * When defined, the scale factor is always the length of the curve.
|
|
370
401
|
* * This scale factor is typically available for these curve types:
|
|
@@ -536,325 +567,13 @@ export class CurvePrimitive extends GeometryQuery {
|
|
|
536
567
|
this.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);
|
|
537
568
|
return results;
|
|
538
569
|
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
super();
|
|
544
|
-
this._parentCurvePrimitive = undefined;
|
|
545
|
-
}
|
|
546
|
-
/** retain the parentCurvePrimitive.
|
|
547
|
-
* * Calling this method tells the handler that the parent curve is to be used for detail searches.
|
|
548
|
-
* * Example: Transition spiral search is based on linestring first, then the exact spiral.
|
|
549
|
-
* * Example: CurveChainWithDistanceIndex does NOT do this announcement -- the constituents act independently.
|
|
550
|
-
*/
|
|
551
|
-
startParentCurvePrimitive(curve) { this._parentCurvePrimitive = curve; }
|
|
552
|
-
/** Forget the parentCurvePrimitive */
|
|
553
|
-
endParentCurvePrimitive(_curve) { this._parentCurvePrimitive = undefined; }
|
|
554
|
-
}
|
|
555
|
-
class AppendPlaneIntersectionStrokeHandler extends NewtonRotRStrokeHandler {
|
|
556
|
-
constructor(plane, intersections) {
|
|
557
|
-
super();
|
|
558
|
-
this._fractionA = 0;
|
|
559
|
-
this._functionA = 0;
|
|
560
|
-
// private derivativeA: number; <---- Not currently used
|
|
561
|
-
this._functionB = 0;
|
|
562
|
-
this._fractionB = 0;
|
|
563
|
-
this._derivativeB = 0;
|
|
564
|
-
this._numThisCurve = 0;
|
|
565
|
-
this._plane = plane;
|
|
566
|
-
this._intersections = intersections;
|
|
567
|
-
this.startCurvePrimitive(undefined);
|
|
568
|
-
this._ray = Ray3d.createZero();
|
|
569
|
-
this._newtonSolver = new Newton1dUnboundedApproximateDerivative(this);
|
|
570
|
-
}
|
|
571
|
-
// Return the first defined curve among: this.parentCurvePrimitive, this.curve;
|
|
572
|
-
effectiveCurve() {
|
|
573
|
-
if (this._parentCurvePrimitive)
|
|
574
|
-
return this._parentCurvePrimitive;
|
|
575
|
-
return this._curve;
|
|
576
|
-
}
|
|
577
|
-
get getDerivativeB() { return this._derivativeB; } // <--- DerivativeB is not currently used anywhere. Provided getter to suppress lint error
|
|
578
|
-
startCurvePrimitive(curve) {
|
|
579
|
-
this._curve = curve;
|
|
580
|
-
this._fractionA = 0.0;
|
|
581
|
-
this._numThisCurve = 0;
|
|
582
|
-
this._functionA = 0.0;
|
|
583
|
-
// this.derivativeA = 0.0;
|
|
584
|
-
}
|
|
585
|
-
endCurvePrimitive() { }
|
|
586
|
-
announceIntervalForUniformStepStrokes(cp, numStrokes, fraction0, fraction1) {
|
|
587
|
-
this.startCurvePrimitive(cp);
|
|
588
|
-
if (numStrokes < 1)
|
|
589
|
-
numStrokes = 1;
|
|
590
|
-
const df = 1.0 / numStrokes;
|
|
591
|
-
for (let i = 0; i <= numStrokes; i++) {
|
|
592
|
-
const fraction = Geometry.interpolate(fraction0, i * df, fraction1);
|
|
593
|
-
cp.fractionToPointAndDerivative(fraction, this._ray);
|
|
594
|
-
this.announcePointTangent(this._ray.origin, fraction, this._ray.direction);
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
announceSegmentInterval(_cp, point0, point1, _numStrokes, fraction0, fraction1) {
|
|
598
|
-
const h0 = this._plane.altitude(point0);
|
|
599
|
-
const h1 = this._plane.altitude(point1);
|
|
600
|
-
if (h0 * h1 > 0.0)
|
|
601
|
-
return;
|
|
602
|
-
const fraction01 = Order2Bezier.solveCoffs(h0, h1);
|
|
603
|
-
// let numIntersection = 0;
|
|
604
|
-
if (fraction01 !== undefined) {
|
|
605
|
-
// numIntersection++;
|
|
606
|
-
const fraction = Geometry.interpolate(fraction0, fraction01, fraction1);
|
|
607
|
-
this._newtonSolver.setX(fraction);
|
|
608
|
-
if (this._newtonSolver.runIterations()) {
|
|
609
|
-
this.announceSolutionFraction(this._newtonSolver.getX());
|
|
610
|
-
}
|
|
611
|
-
// this.intersections.push(CurveLocationDetail.createCurveFractionPoint(cp, fraction, cp.fractionToPoint(fraction)));
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
announceSolutionFraction(fraction) {
|
|
615
|
-
const curve = this.effectiveCurve();
|
|
616
|
-
if (curve) {
|
|
617
|
-
this._ray = curve.fractionToPointAndDerivative(fraction, this._ray);
|
|
618
|
-
this._intersections.push(CurveLocationDetail.createCurveFractionPoint(curve, fraction, this._ray.origin));
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
evaluate(fraction) {
|
|
622
|
-
const curve = this.effectiveCurve();
|
|
623
|
-
if (!curve)
|
|
624
|
-
return false;
|
|
625
|
-
this.currentF = this._plane.altitude(curve.fractionToPoint(fraction));
|
|
626
|
-
return true;
|
|
627
|
-
}
|
|
628
|
-
/**
|
|
629
|
-
* * ASSUME both the "A" and "B" evaluations (fraction, function, and derivative) are known.
|
|
630
|
-
* * If function value changed sign between, interpolate an approximate root and improve it with
|
|
631
|
-
* the newton solver.
|
|
570
|
+
/** Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of projection.
|
|
571
|
+
* @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.
|
|
572
|
+
* @param lowHigh optional receiver for output
|
|
573
|
+
* @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the end of the ray.
|
|
632
574
|
*/
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
return;
|
|
636
|
-
if (this._functionA === 0)
|
|
637
|
-
this.announceSolutionFraction(this._fractionA);
|
|
638
|
-
if (this._functionB === 0)
|
|
639
|
-
this.announceSolutionFraction(this._fractionB);
|
|
640
|
-
if (this._functionA * this._functionB < 0) {
|
|
641
|
-
const fraction = Geometry.inverseInterpolate(this._fractionA, this._functionA, this._fractionB, this._functionB);
|
|
642
|
-
if (fraction) {
|
|
643
|
-
this._newtonSolver.setX(fraction);
|
|
644
|
-
if (this._newtonSolver.runIterations())
|
|
645
|
-
this.announceSolutionFraction(this._newtonSolver.getX());
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
/** Evaluate and save _functionB, _derivativeB, and _fractionB. */
|
|
650
|
-
evaluateB(xyz, fraction, tangent) {
|
|
651
|
-
this._functionB = this._plane.altitude(xyz);
|
|
652
|
-
this._derivativeB = this._plane.velocity(tangent);
|
|
653
|
-
this._fractionB = fraction;
|
|
654
|
-
}
|
|
655
|
-
/**
|
|
656
|
-
* Announce point and tangent for evaluations.
|
|
657
|
-
* * The function evaluation is saved as the "B" function point.
|
|
658
|
-
* * The function point count is incremented
|
|
659
|
-
* * If function point count is greater than 1, the current interval is searched.
|
|
660
|
-
* * The just-evaluated point ("B") is saved as the "old" ("A") evaluation point.
|
|
661
|
-
* @param xyz
|
|
662
|
-
* @param fraction
|
|
663
|
-
* @param tangent
|
|
664
|
-
*/
|
|
665
|
-
announcePointTangent(xyz, fraction, tangent) {
|
|
666
|
-
this.evaluateB(xyz, fraction, tangent);
|
|
667
|
-
if (this._numThisCurve++ > 0)
|
|
668
|
-
this.searchInterval();
|
|
669
|
-
this._functionA = this._functionB;
|
|
670
|
-
this._fractionA = this._fractionB;
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
class CurveLengthContext {
|
|
674
|
-
constructor(fraction0 = 0.0, fraction1 = 1.0, numGaussPoints = 5) {
|
|
675
|
-
this.startCurvePrimitive(undefined);
|
|
676
|
-
this._summedLength = 0.0;
|
|
677
|
-
this._ray = Ray3d.createZero();
|
|
678
|
-
if (fraction0 < fraction1) {
|
|
679
|
-
this._fraction0 = fraction0;
|
|
680
|
-
this._fraction1 = fraction1;
|
|
681
|
-
}
|
|
682
|
-
else {
|
|
683
|
-
this._fraction0 = fraction1;
|
|
684
|
-
this._fraction1 = fraction0;
|
|
685
|
-
}
|
|
686
|
-
this._gaussMapper = new GaussMapper(numGaussPoints);
|
|
687
|
-
}
|
|
688
|
-
tangentMagnitude(fraction) {
|
|
689
|
-
this._ray = this._curve.fractionToPointAndDerivative(fraction, this._ray);
|
|
690
|
-
return this._ray.direction.magnitude();
|
|
691
|
-
}
|
|
692
|
-
getSum() { return this._summedLength; }
|
|
693
|
-
startCurvePrimitive(curve) {
|
|
694
|
-
this._curve = curve;
|
|
695
|
-
}
|
|
696
|
-
startParentCurvePrimitive(_curve) { }
|
|
697
|
-
endParentCurvePrimitive(_curve) { }
|
|
698
|
-
endCurvePrimitive() { }
|
|
699
|
-
announceIntervalForUniformStepStrokes(cp, numStrokes, fraction0, fraction1) {
|
|
700
|
-
if (fraction0 < this._fraction0)
|
|
701
|
-
fraction0 = this._fraction0;
|
|
702
|
-
if (fraction1 > this._fraction1)
|
|
703
|
-
fraction1 = this._fraction1;
|
|
704
|
-
if (fraction1 > fraction0) {
|
|
705
|
-
this.startCurvePrimitive(cp);
|
|
706
|
-
if (numStrokes < 1)
|
|
707
|
-
numStrokes = 1;
|
|
708
|
-
const df = 1.0 / numStrokes;
|
|
709
|
-
for (let i = 1; i <= numStrokes; i++) {
|
|
710
|
-
const fractionA = Geometry.interpolate(fraction0, (i - 1) * df, fraction1);
|
|
711
|
-
const fractionB = i === numStrokes ? fraction1 : Geometry.interpolate(fraction0, (i) * df, fraction1);
|
|
712
|
-
const numGauss = this._gaussMapper.mapXAndW(fractionA, fractionB);
|
|
713
|
-
for (let k = 0; k < numGauss; k++) {
|
|
714
|
-
this._summedLength += this._gaussMapper.gaussW[k] * this.tangentMagnitude(this._gaussMapper.gaussX[k]);
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
announceSegmentInterval(_cp, point0, point1, _numStrokes, fraction0, fraction1) {
|
|
720
|
-
const segmentLength = point0.distance(point1);
|
|
721
|
-
if (this._fraction0 <= fraction0 && fraction1 <= this._fraction1)
|
|
722
|
-
this._summedLength += segmentLength;
|
|
723
|
-
else {
|
|
724
|
-
let g0 = fraction0;
|
|
725
|
-
let g1 = fraction1;
|
|
726
|
-
if (g0 < this._fraction0)
|
|
727
|
-
g0 = this._fraction0;
|
|
728
|
-
if (g1 > this._fraction1)
|
|
729
|
-
g1 = this._fraction1;
|
|
730
|
-
if (g1 > g0) {
|
|
731
|
-
this._summedLength += segmentLength * (g1 - g0) / (fraction1 - fraction0);
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
announcePointTangent(_xyz, _fraction, _tangent) {
|
|
736
|
-
// uh oh -- need to retain point for next interval
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
// context for searching for closest point .. .
|
|
740
|
-
class ClosestPointStrokeHandler extends NewtonRotRStrokeHandler {
|
|
741
|
-
constructor(spacePoint, extend) {
|
|
742
|
-
super();
|
|
743
|
-
this._fractionA = 0;
|
|
744
|
-
this._functionA = 0;
|
|
745
|
-
this._functionB = 0;
|
|
746
|
-
this._fractionB = 0;
|
|
747
|
-
this._numThisCurve = 0;
|
|
748
|
-
this._spacePoint = spacePoint;
|
|
749
|
-
this._workPoint = Point3d.create();
|
|
750
|
-
this._workRay = Ray3d.createZero();
|
|
751
|
-
this._closestPoint = undefined;
|
|
752
|
-
this._extend = extend;
|
|
753
|
-
this.startCurvePrimitive(undefined);
|
|
754
|
-
this._newtonSolver = new Newton1dUnboundedApproximateDerivative(this);
|
|
755
|
-
}
|
|
756
|
-
claimResult() {
|
|
757
|
-
if (this._closestPoint) {
|
|
758
|
-
this._newtonSolver.setX(this._closestPoint.fraction);
|
|
759
|
-
this._curve = this._closestPoint.curve;
|
|
760
|
-
if (this._newtonSolver.runIterations()) {
|
|
761
|
-
let fraction = this._newtonSolver.getX();
|
|
762
|
-
fraction = CurveExtendOptions.correctFraction(this._extend, fraction);
|
|
763
|
-
this.announceSolutionFraction(fraction);
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
return this._closestPoint;
|
|
767
|
-
}
|
|
768
|
-
needPrimaryGeometryForStrokes() { return true; }
|
|
769
|
-
startCurvePrimitive(curve) {
|
|
770
|
-
this._curve = curve;
|
|
771
|
-
this._fractionA = 0.0;
|
|
772
|
-
this._numThisCurve = 0;
|
|
773
|
-
this._functionA = 0.0;
|
|
774
|
-
}
|
|
775
|
-
endCurvePrimitive() { }
|
|
776
|
-
announceIntervalForUniformStepStrokes(cp, numStrokes, fraction0, fraction1) {
|
|
777
|
-
this.startCurvePrimitive(cp);
|
|
778
|
-
this.announceSolutionFraction(0.0); // test start point as closest
|
|
779
|
-
this.announceSolutionFraction(1.0); // test end point as closest
|
|
780
|
-
if (numStrokes < 1)
|
|
781
|
-
numStrokes = 1;
|
|
782
|
-
const df = 1.0 / numStrokes;
|
|
783
|
-
for (let i = 0; i <= numStrokes; i++) {
|
|
784
|
-
const fraction = Geometry.interpolate(fraction0, i * df, fraction1);
|
|
785
|
-
cp.fractionToPointAndDerivative(fraction, this._workRay);
|
|
786
|
-
this.announceRay(fraction, this._workRay);
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
announceCandidate(cp, fraction, point) {
|
|
790
|
-
const distance = this._spacePoint.distance(point);
|
|
791
|
-
if (this._closestPoint && distance > this._closestPoint.a)
|
|
792
|
-
return;
|
|
793
|
-
this._closestPoint = CurveLocationDetail.createCurveFractionPoint(cp, fraction, point, this._closestPoint);
|
|
794
|
-
this._closestPoint.a = distance;
|
|
795
|
-
if (this._parentCurvePrimitive !== undefined)
|
|
796
|
-
this._closestPoint.curve = this._parentCurvePrimitive;
|
|
797
|
-
}
|
|
798
|
-
announceSegmentInterval(cp, point0, point1, _numStrokes, fraction0, fraction1) {
|
|
799
|
-
let localFraction = this._spacePoint.fractionOfProjectionToLine(point0, point1, 0.0);
|
|
800
|
-
// only consider extending the segment if the immediate caller says we are at endpoints ...
|
|
801
|
-
if (!this._extend)
|
|
802
|
-
localFraction = Geometry.clampToStartEnd(localFraction, 0.0, 1.0);
|
|
803
|
-
else {
|
|
804
|
-
if (fraction0 !== 0.0)
|
|
805
|
-
localFraction = Math.max(localFraction, 0.0);
|
|
806
|
-
if (fraction1 !== 1.0)
|
|
807
|
-
localFraction = Math.min(localFraction, 1.0);
|
|
808
|
-
}
|
|
809
|
-
this._workPoint = point0.interpolate(localFraction, point1);
|
|
810
|
-
const globalFraction = Geometry.interpolate(fraction0, localFraction, fraction1);
|
|
811
|
-
this.announceCandidate(cp, globalFraction, this._workPoint);
|
|
812
|
-
}
|
|
813
|
-
searchInterval() {
|
|
814
|
-
if (this._functionA * this._functionB > 0)
|
|
815
|
-
return;
|
|
816
|
-
if (this._functionA === 0)
|
|
817
|
-
this.announceSolutionFraction(this._fractionA);
|
|
818
|
-
if (this._functionB === 0)
|
|
819
|
-
this.announceSolutionFraction(this._fractionB);
|
|
820
|
-
if (this._functionA * this._functionB < 0) {
|
|
821
|
-
const fraction = Geometry.inverseInterpolate(this._fractionA, this._functionA, this._fractionB, this._functionB);
|
|
822
|
-
if (fraction) {
|
|
823
|
-
this._newtonSolver.setX(fraction);
|
|
824
|
-
if (this._newtonSolver.runIterations())
|
|
825
|
-
this.announceSolutionFraction(this._newtonSolver.getX());
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
}
|
|
829
|
-
evaluateB(fractionB, dataB) {
|
|
830
|
-
this._functionB = dataB.dotProductToPoint(this._spacePoint);
|
|
831
|
-
this._fractionB = fractionB;
|
|
832
|
-
}
|
|
833
|
-
announceSolutionFraction(fraction) {
|
|
834
|
-
if (this._curve)
|
|
835
|
-
this.announceCandidate(this._curve, fraction, this._curve.fractionToPoint(fraction));
|
|
836
|
-
}
|
|
837
|
-
evaluate(fraction) {
|
|
838
|
-
let curve = this._curve;
|
|
839
|
-
if (this._parentCurvePrimitive)
|
|
840
|
-
curve = this._parentCurvePrimitive;
|
|
841
|
-
if (curve) {
|
|
842
|
-
this._workRay = curve.fractionToPointAndDerivative(fraction, this._workRay);
|
|
843
|
-
this.currentF = this._workRay.dotProductToPoint(this._spacePoint);
|
|
844
|
-
return true;
|
|
845
|
-
}
|
|
846
|
-
return false;
|
|
847
|
-
}
|
|
848
|
-
announceRay(fraction, data) {
|
|
849
|
-
this.evaluateB(fraction, data);
|
|
850
|
-
if (this._numThisCurve++ > 0)
|
|
851
|
-
this.searchInterval();
|
|
852
|
-
this._functionA = this._functionB;
|
|
853
|
-
this._fractionA = this._fractionB;
|
|
854
|
-
}
|
|
855
|
-
announcePointTangent(point, fraction, tangent) {
|
|
856
|
-
this._workRay.set(point, tangent);
|
|
857
|
-
this.announceRay(fraction, this._workRay);
|
|
575
|
+
projectedParameterRange(_ray, _lowHigh) {
|
|
576
|
+
return undefined; // common implementation delegated to subclasses to avoid circular dependency
|
|
858
577
|
}
|
|
859
578
|
}
|
|
860
579
|
//# sourceMappingURL=CurvePrimitive.js.map
|