@itwin/core-geometry 5.0.0-dev.11 → 5.0.0-dev.111
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 +71 -1
- package/lib/cjs/Constant.js +17 -17
- package/lib/cjs/Constant.js.map +1 -1
- package/lib/cjs/Geometry.d.ts +13 -4
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +51 -39
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/AkimaCurve3d.js +3 -1
- package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.d.ts +90 -54
- package/lib/cjs/bspline/BSpline1dNd.d.ts.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js +137 -84
- package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts +193 -155
- package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +249 -181
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve3dH.js +1 -0
- package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.js +18 -21
- package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.js +22 -2
- package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
- package/lib/cjs/bspline/Bezier1dNd.js +6 -0
- package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3d.d.ts +3 -1
- package/lib/cjs/bspline/BezierCurve3d.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurve3d.js +5 -5
- package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3dH.js +2 -0
- package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.js +21 -2
- package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js +12 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/cjs/bspline/KnotVector.d.ts +82 -60
- package/lib/cjs/bspline/KnotVector.d.ts.map +1 -1
- package/lib/cjs/bspline/KnotVector.js +144 -84
- package/lib/cjs/bspline/KnotVector.js.map +1 -1
- package/lib/cjs/bspline/SurfaceLocationDetail.js +12 -0
- package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js +14 -13
- package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.js +4 -0
- package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +10 -1
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +19 -0
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +5 -1
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.js +11 -8
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +5 -3
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +2 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js +3 -0
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +1 -0
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +1 -0
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +20 -4
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +86 -21
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/ConstructCurveBetweenCurves.js +3 -0
- package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/cjs/curve/CoordinateXYZ.js +3 -2
- package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +0 -2
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +25 -10
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +10 -0
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +35 -9
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.d.ts +13 -5
- package/lib/cjs/curve/CurveExtendMode.d.ts.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.js +19 -15
- package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +87 -53
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +213 -135
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +44 -0
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveOps.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +74 -18
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +86 -18
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/CurveProcessor.js +2 -0
- package/lib/cjs/curve/CurveProcessor.js.map +1 -1
- package/lib/cjs/curve/CurveTypes.js.map +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.js +2 -0
- package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/cjs/curve/GeometryQuery.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +6 -2
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +8 -7
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +52 -29
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.js +12 -4
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/OffsetOptions.js +25 -21
- package/lib/cjs/curve/OffsetOptions.js.map +1 -1
- package/lib/cjs/curve/ParityRegion.js +4 -2
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.js +2 -2
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/PointString3d.js +3 -2
- package/lib/cjs/curve/PointString3d.js.map +1 -1
- package/lib/cjs/curve/ProxyCurve.js +1 -0
- package/lib/cjs/curve/ProxyCurve.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +1 -0
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/CurveSplitContext.js +3 -0
- package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.js +6 -2
- package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js +4 -6
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js +12 -0
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountMap.js +14 -0
- package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js +4 -5
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.js +9 -10
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js +24 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts +10 -5
- package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js +30 -8
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.js +4 -2
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.d.ts +71 -0
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js +181 -0
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -0
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js +13 -7
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ChainCollectorContext.js +6 -0
- package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneCurvesContext.js +2 -0
- package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts +21 -5
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js +53 -20
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js +3 -0
- package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +18 -5
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +26 -13
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +11 -5
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveLengthContext.js +6 -0
- package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js +8 -6
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +38 -5
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.js +1 -0
- package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js +12 -0
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.d.ts +5 -3
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js +6 -3
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js +7 -0
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +22 -4
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js +1 -0
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js +3 -0
- package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js +2 -0
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/ClothoidSeries.js +4 -0
- package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/cjs/curve/spiral/CubicEvaluator.js +2 -0
- package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js +4 -0
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js +5 -0
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js +12 -2
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +24 -4
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +2 -0
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.js +5 -0
- package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js +2 -0
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js +10 -0
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js +10 -0
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js +6 -0
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.js +18 -16
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts +8 -3
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +22 -10
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js +25 -0
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js +8 -0
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js +5 -0
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.d.ts +8 -7
- package/lib/cjs/geometry3d/Ellipsoid.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js +63 -14
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js +12 -4
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/FrustumAnimation.js +7 -0
- package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.d.ts +15 -16
- package/lib/cjs/geometry3d/GeometryHandler.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.js +12 -0
- package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js +3 -0
- package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts +0 -5
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js +16 -7
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +32 -10
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +70 -16
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedCollectionInterval.js +6 -0
- package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.js +1 -0
- package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +13 -2
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +26 -11
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js +3 -0
- package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +13 -15
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +47 -26
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.js +10 -2
- package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +2 -0
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +7 -0
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js +2 -0
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +4 -0
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js +3 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +7 -10
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +16 -10
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts +15 -4
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +29 -8
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js +12 -4
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +2 -2
- package/lib/cjs/geometry3d/PolygonOps.js +62 -25
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +7 -3
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts +9 -5
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +12 -5
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.js +21 -4
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.js +2 -0
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts +2 -2
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +20 -11
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js +4 -0
- package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/cjs/geometry3d/Segment1d.js +4 -0
- package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js +11 -0
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +1 -1
- package/lib/cjs/geometry3d/Transform.js +4 -1
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js +6 -0
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/geometry4d/Map4d.js +2 -0
- package/lib/cjs/geometry4d/Map4d.js.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js +1 -0
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/geometry4d/MomentData.d.ts +72 -73
- package/lib/cjs/geometry4d/MomentData.d.ts.map +1 -1
- package/lib/cjs/geometry4d/MomentData.js +90 -66
- package/lib/cjs/geometry4d/MomentData.js.map +1 -1
- package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js +6 -0
- package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js +2 -0
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/BandedSystem.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js +8 -0
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/ClusterableArray.js +29 -13
- package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
- package/lib/cjs/numerics/Complex.js +2 -0
- package/lib/cjs/numerics/Complex.js.map +1 -1
- package/lib/cjs/numerics/ConvexPolygon2d.js +3 -0
- package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/cjs/numerics/Newton.js +59 -4
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/PascalCoefficients.js +1 -1
- package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
- package/lib/cjs/numerics/PolarData.js +13 -1
- package/lib/cjs/numerics/PolarData.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.js +64 -26
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/numerics/Quadrature.js +26 -20
- package/lib/cjs/numerics/Quadrature.js.map +1 -1
- package/lib/cjs/numerics/Range1dArray.js.map +1 -1
- package/lib/cjs/numerics/SmallSystem.js.map +1 -1
- package/lib/cjs/numerics/TriDiagonalSystem.js +11 -0
- package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/cjs/numerics/UnionFind.js +1 -0
- package/lib/cjs/numerics/UnionFind.js.map +1 -1
- package/lib/cjs/numerics/UsageSums.js +10 -0
- package/lib/cjs/numerics/UsageSums.js.map +1 -1
- package/lib/cjs/polyface/AuxData.js +16 -0
- package/lib/cjs/polyface/AuxData.js.map +1 -1
- package/lib/cjs/polyface/BoxTopology.js +67 -67
- package/lib/cjs/polyface/BoxTopology.js.map +1 -1
- package/lib/cjs/polyface/FacetFaceData.d.ts +1 -1
- package/lib/cjs/polyface/FacetFaceData.js +3 -1
- package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
- package/lib/cjs/polyface/FacetLocationDetail.js +30 -0
- package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/cjs/polyface/FacetOrientation.js +12 -1
- package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js +18 -2
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +33 -23
- package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js +63 -33
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +4 -3
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +16 -5
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts +233 -0
- package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts.map +1 -0
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js +353 -0
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -0
- package/lib/cjs/polyface/Polyface.d.ts +43 -14
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +90 -19
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +14 -27
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +47 -79
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js +8 -0
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +36 -3
- package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +114 -8
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +47 -7
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeLengthData.js +7 -0
- package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js +12 -0
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/MinimumValueTester.js +5 -2
- package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js +12 -0
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js +14 -0
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +5 -0
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js +43 -0
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/cjs/polyface/TaggedNumericData.js +8 -0
- package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
- package/lib/cjs/polyface/TriangleCandidate.js +3 -0
- package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js +7 -0
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js +6 -0
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js +3 -0
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js +3 -0
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js +32 -0
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/cjs/polyface/multiclip/RangeSearch.js +5 -5
- package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +21 -8
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/XYPointBuckets.js +6 -0
- package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.d.ts +35 -9
- package/lib/cjs/serialization/BGFBAccessors.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.js +141 -179
- package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.d.ts +2 -2
- package/lib/cjs/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js +75 -62
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.d.ts +5 -1
- package/lib/cjs/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js +18 -3
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js +1 -0
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/cjs/serialization/DeepCompare.js +17 -17
- package/lib/cjs/serialization/DeepCompare.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +5 -5
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +113 -112
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts +78 -64
- package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js +107 -83
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.d.ts +36 -0
- package/lib/cjs/serialization/SerializationHelpers.d.ts.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.js +117 -0
- package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
- package/lib/cjs/solid/Box.js +7 -2
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.d.ts +39 -14
- package/lib/cjs/solid/Cone.d.ts.map +1 -1
- package/lib/cjs/solid/Cone.js +52 -16
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.js +4 -2
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts +17 -17
- package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js +38 -25
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts +26 -23
- package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RuledSweep.js +32 -24
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.d.ts +12 -11
- package/lib/cjs/solid/SolidPrimitive.d.ts.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.js +11 -6
- package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
- package/lib/cjs/solid/Sphere.d.ts +36 -17
- package/lib/cjs/solid/Sphere.d.ts.map +1 -1
- package/lib/cjs/solid/Sphere.js +53 -24
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.d.ts +24 -15
- package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
- package/lib/cjs/solid/SweepContour.js +33 -15
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.js +7 -2
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.js +16 -4
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/Graph.js +41 -6
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js +5 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js +2 -0
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js +9 -2
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphValidation.js +7 -9
- package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeMarkSet.js +5 -0
- package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js +6 -0
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js +1 -0
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.js +16 -0
- package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js +2 -0
- package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.js +4 -0
- package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/cjs/topology/MaskManager.js +3 -0
- package/lib/cjs/topology/MaskManager.js.map +1 -1
- package/lib/cjs/topology/Merging.js +11 -6
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js +22 -0
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/SignedDataSummary.js +22 -0
- package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
- package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
- package/lib/cjs/topology/Triangulation.d.ts +3 -3
- package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
- package/lib/cjs/topology/Triangulation.js +28 -18
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.js +13 -0
- package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
- package/lib/esm/Constant.js +17 -17
- package/lib/esm/Constant.js.map +1 -1
- package/lib/esm/Geometry.d.ts +13 -4
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +51 -39
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.js +3 -1
- package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.d.ts +90 -54
- package/lib/esm/bspline/BSpline1dNd.d.ts.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.js +137 -84
- package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts +193 -155
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +249 -181
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve3dH.js +1 -0
- package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js +18 -21
- package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/esm/bspline/BSplineSurface.js +22 -2
- package/lib/esm/bspline/BSplineSurface.js.map +1 -1
- package/lib/esm/bspline/Bezier1dNd.js +6 -0
- package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3d.d.ts +3 -1
- package/lib/esm/bspline/BezierCurve3d.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurve3d.js +5 -5
- package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3dH.js +2 -0
- package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js +21 -2
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.js +12 -1
- package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/esm/bspline/KnotVector.d.ts +82 -60
- package/lib/esm/bspline/KnotVector.d.ts.map +1 -1
- package/lib/esm/bspline/KnotVector.js +144 -84
- package/lib/esm/bspline/KnotVector.js.map +1 -1
- package/lib/esm/bspline/SurfaceLocationDetail.js +12 -0
- package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js +14 -13
- package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.js +4 -0
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +10 -1
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +19 -0
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +5 -1
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.js +11 -8
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +5 -3
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +2 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js +3 -0
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +1 -0
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +1 -0
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +20 -4
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +86 -21
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/ConstructCurveBetweenCurves.js +3 -0
- package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/esm/curve/CoordinateXYZ.js +3 -2
- package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +0 -2
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +25 -10
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +10 -0
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +35 -9
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveExtendMode.d.ts +13 -5
- package/lib/esm/curve/CurveExtendMode.d.ts.map +1 -1
- package/lib/esm/curve/CurveExtendMode.js +19 -15
- package/lib/esm/curve/CurveExtendMode.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +87 -53
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +213 -135
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +44 -0
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveOps.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +74 -18
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +86 -18
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/CurveProcessor.js +2 -0
- package/lib/esm/curve/CurveProcessor.js.map +1 -1
- package/lib/esm/curve/CurveTypes.js.map +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.js +2 -0
- package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/esm/curve/GeometryQuery.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +6 -2
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +8 -7
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +52 -29
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.js +12 -4
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/OffsetOptions.js +25 -21
- package/lib/esm/curve/OffsetOptions.js.map +1 -1
- package/lib/esm/curve/ParityRegion.js +4 -2
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.js +2 -2
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/PointString3d.js +3 -2
- package/lib/esm/curve/PointString3d.js.map +1 -1
- package/lib/esm/curve/ProxyCurve.js +1 -0
- package/lib/esm/curve/ProxyCurve.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +1 -0
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/CurveSplitContext.js +3 -0
- package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/esm/curve/Query/CylindricalRange.js +6 -2
- package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/esm/curve/Query/InOutTests.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js +4 -6
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js +12 -0
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountMap.js +14 -0
- package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js +4 -5
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.js +9 -10
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js +24 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts +10 -5
- package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/esm/curve/StrokeOptions.js +30 -8
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.js +4 -2
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.d.ts +71 -0
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js +177 -0
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -0
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js +13 -7
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/ChainCollectorContext.js +6 -0
- package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneCurvesContext.js +2 -0
- package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts +21 -5
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js +53 -20
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js +3 -0
- package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +18 -5
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +26 -13
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +11 -5
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveLengthContext.js +6 -0
- package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js +8 -6
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +38 -5
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.js +1 -0
- package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js +12 -0
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.d.ts +5 -3
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js +6 -3
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js +7 -0
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +22 -4
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js +1 -0
- package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransformInPlaceContext.js +3 -0
- package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js +2 -0
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/ClothoidSeries.js +4 -0
- package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/esm/curve/spiral/CubicEvaluator.js +2 -0
- package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js +4 -0
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js +5 -0
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js +12 -2
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js +24 -4
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +2 -0
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.js +5 -0
- package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js +2 -0
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js +10 -0
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js +10 -0
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js +6 -0
- package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/esm/geometry3d/Angle.js +18 -16
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts +8 -3
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +22 -10
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js +25 -0
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js +8 -0
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.js +5 -0
- package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.d.ts +8 -7
- package/lib/esm/geometry3d/Ellipsoid.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js +63 -14
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js +12 -4
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/FrustumAnimation.js +7 -0
- package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.d.ts +15 -16
- package/lib/esm/geometry3d/GeometryHandler.d.ts.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.js +12 -0
- package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js +3 -0
- package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.d.ts +0 -5
- package/lib/esm/geometry3d/GrowableXYArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js +16 -7
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts +32 -10
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +70 -16
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedCollectionInterval.js +6 -0
- package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.js +1 -0
- package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +13 -2
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +26 -11
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js +3 -0
- package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +13 -15
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +47 -26
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.js +10 -2
- package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +2 -0
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +7 -0
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js +2 -0
- package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +4 -0
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js +3 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +7 -10
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +16 -10
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts +15 -4
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +29 -8
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js +12 -4
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +2 -2
- package/lib/esm/geometry3d/PolygonOps.js +62 -25
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +7 -3
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts +9 -5
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +12 -5
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.js +21 -4
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.js +2 -0
- package/lib/esm/geometry3d/Ray2d.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts +2 -2
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +20 -11
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js +4 -0
- package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/esm/geometry3d/Segment1d.js +4 -0
- package/lib/esm/geometry3d/Segment1d.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js +11 -0
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +1 -1
- package/lib/esm/geometry3d/Transform.js +4 -1
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/esm/geometry3d/XYZProps.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js +6 -0
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/geometry4d/Map4d.js +2 -0
- package/lib/esm/geometry4d/Map4d.js.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js +1 -0
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/geometry4d/MomentData.d.ts +72 -73
- package/lib/esm/geometry4d/MomentData.d.ts.map +1 -1
- package/lib/esm/geometry4d/MomentData.js +90 -66
- package/lib/esm/geometry4d/MomentData.js.map +1 -1
- package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js +6 -0
- package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.js +2 -0
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/BandedSystem.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js +8 -0
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/ClusterableArray.js +29 -13
- package/lib/esm/numerics/ClusterableArray.js.map +1 -1
- package/lib/esm/numerics/Complex.js +2 -0
- package/lib/esm/numerics/Complex.js.map +1 -1
- package/lib/esm/numerics/ConvexPolygon2d.js +3 -0
- package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/esm/numerics/Newton.js +59 -4
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/PascalCoefficients.js +1 -1
- package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
- package/lib/esm/numerics/PolarData.js +13 -1
- package/lib/esm/numerics/PolarData.js.map +1 -1
- package/lib/esm/numerics/Polynomials.js +64 -26
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/numerics/Quadrature.js +26 -20
- package/lib/esm/numerics/Quadrature.js.map +1 -1
- package/lib/esm/numerics/Range1dArray.js.map +1 -1
- package/lib/esm/numerics/SmallSystem.js.map +1 -1
- package/lib/esm/numerics/TriDiagonalSystem.js +11 -0
- package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/esm/numerics/UnionFind.js +1 -0
- package/lib/esm/numerics/UnionFind.js.map +1 -1
- package/lib/esm/numerics/UsageSums.js +10 -0
- package/lib/esm/numerics/UsageSums.js.map +1 -1
- package/lib/esm/polyface/AuxData.js +16 -0
- package/lib/esm/polyface/AuxData.js.map +1 -1
- package/lib/esm/polyface/BoxTopology.js +67 -67
- package/lib/esm/polyface/BoxTopology.js.map +1 -1
- package/lib/esm/polyface/FacetFaceData.d.ts +1 -1
- package/lib/esm/polyface/FacetFaceData.js +3 -1
- package/lib/esm/polyface/FacetFaceData.js.map +1 -1
- package/lib/esm/polyface/FacetLocationDetail.js +30 -0
- package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/esm/polyface/FacetOrientation.js +12 -1
- package/lib/esm/polyface/FacetOrientation.js.map +1 -1
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js +18 -2
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +33 -23
- package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js +63 -33
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +4 -3
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js +16 -5
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts +233 -0
- package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts.map +1 -0
- package/lib/esm/polyface/IndexedPolyfaceWalker.js +349 -0
- package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -0
- package/lib/esm/polyface/Polyface.d.ts +43 -14
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +90 -19
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +14 -27
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +48 -80
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js +8 -0
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +36 -3
- package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js +114 -8
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +47 -7
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeLengthData.js +7 -0
- package/lib/esm/polyface/RangeLengthData.js.map +1 -1
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js +12 -0
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/MinimumValueTester.js +5 -2
- package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js +12 -0
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js +14 -0
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js +5 -0
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js +43 -0
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/esm/polyface/TaggedNumericData.js +8 -0
- package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
- package/lib/esm/polyface/TriangleCandidate.js +3 -0
- package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js +7 -0
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js +6 -0
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js +3 -0
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js +3 -0
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js +32 -0
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/esm/polyface/multiclip/RangeSearch.js +5 -5
- package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +21 -8
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/XYPointBuckets.js +6 -0
- package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.d.ts +35 -9
- package/lib/esm/serialization/BGFBAccessors.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.js +141 -179
- package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.d.ts +2 -2
- package/lib/esm/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBReader.js +75 -62
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.d.ts +5 -1
- package/lib/esm/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js +18 -3
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js +1 -0
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/esm/serialization/DeepCompare.js +17 -17
- package/lib/esm/serialization/DeepCompare.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +5 -5
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +113 -112
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts +78 -64
- package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js +107 -83
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.d.ts +36 -0
- package/lib/esm/serialization/SerializationHelpers.d.ts.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.js +117 -0
- package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
- package/lib/esm/solid/Box.js +7 -2
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.d.ts +39 -14
- package/lib/esm/solid/Cone.d.ts.map +1 -1
- package/lib/esm/solid/Cone.js +53 -17
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.js +4 -2
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts +17 -17
- package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/esm/solid/RotationalSweep.js +38 -25
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.d.ts +26 -23
- package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
- package/lib/esm/solid/RuledSweep.js +32 -24
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SolidPrimitive.d.ts +12 -11
- package/lib/esm/solid/SolidPrimitive.d.ts.map +1 -1
- package/lib/esm/solid/SolidPrimitive.js +11 -6
- package/lib/esm/solid/SolidPrimitive.js.map +1 -1
- package/lib/esm/solid/Sphere.d.ts +36 -17
- package/lib/esm/solid/Sphere.d.ts.map +1 -1
- package/lib/esm/solid/Sphere.js +54 -25
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.d.ts +24 -15
- package/lib/esm/solid/SweepContour.d.ts.map +1 -1
- package/lib/esm/solid/SweepContour.js +33 -15
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/solid/TorusPipe.js +7 -2
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.js +16 -4
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/Graph.js +41 -6
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js +5 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js +2 -0
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js +9 -2
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphValidation.js +7 -9
- package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/esm/topology/HalfEdgeMarkSet.js +5 -0
- package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js +6 -0
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js +1 -0
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.js +16 -0
- package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js +2 -0
- package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js +4 -0
- package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/esm/topology/MaskManager.js +3 -0
- package/lib/esm/topology/MaskManager.js.map +1 -1
- package/lib/esm/topology/Merging.js +11 -6
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.js +22 -0
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/SignedDataSummary.js +22 -0
- package/lib/esm/topology/SignedDataSummary.js.map +1 -1
- package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
- package/lib/esm/topology/Triangulation.d.ts +3 -3
- package/lib/esm/topology/Triangulation.d.ts.map +1 -1
- package/lib/esm/topology/Triangulation.js +28 -18
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js +13 -0
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +9 -9
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Curve
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.AnnounceTangentStrokeHandler = void 0;
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
|
+
const Geometry_1 = require("../../Geometry");
|
|
13
|
+
const Point3dVector3d_1 = require("../../geometry3d/Point3dVector3d");
|
|
14
|
+
const Ray3d_1 = require("../../geometry3d/Ray3d");
|
|
15
|
+
const Newton_1 = require("../../numerics/Newton");
|
|
16
|
+
const CurveLocationDetail_1 = require("../CurveLocationDetail");
|
|
17
|
+
const NewtonRtoRStrokeHandler_1 = require("./NewtonRtoRStrokeHandler");
|
|
18
|
+
/**
|
|
19
|
+
* Context for searching for the tangent(s) to a CurvePrimitive.
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
class AnnounceTangentStrokeHandler extends NewtonRtoRStrokeHandler_1.NewtonRtoRStrokeHandler {
|
|
23
|
+
_curve;
|
|
24
|
+
_announceTangent;
|
|
25
|
+
_spacePoint;
|
|
26
|
+
_vectorToEye;
|
|
27
|
+
_distanceTol;
|
|
28
|
+
_distanceTolSquared;
|
|
29
|
+
// fraction and function value on one side of an interval that may bracket a root
|
|
30
|
+
_fractionA = 0;
|
|
31
|
+
_functionA = 0;
|
|
32
|
+
// fraction and function value on the other side of an interval that may bracket a root
|
|
33
|
+
_fractionB = 0;
|
|
34
|
+
_functionB = 0;
|
|
35
|
+
_numThisCurve = 0;
|
|
36
|
+
// scratch vars to use within methods
|
|
37
|
+
_fractionMRU;
|
|
38
|
+
_curveMRU;
|
|
39
|
+
_workRay;
|
|
40
|
+
_workDetail;
|
|
41
|
+
_newtonSolver;
|
|
42
|
+
/** Constructor */
|
|
43
|
+
constructor(spacePoint, announceTangent, options) {
|
|
44
|
+
super();
|
|
45
|
+
this._announceTangent = announceTangent;
|
|
46
|
+
this._spacePoint = spacePoint;
|
|
47
|
+
this._vectorToEye = options?.vectorToEye ?? Point3dVector3d_1.Vector3d.unitZ();
|
|
48
|
+
this._distanceTol = options?.distanceTol ?? Geometry_1.Geometry.smallMetricDistance;
|
|
49
|
+
this._distanceTolSquared = this._distanceTol * this._distanceTol;
|
|
50
|
+
this._workRay = Ray3d_1.Ray3d.createZero();
|
|
51
|
+
this.startCurvePrimitive(undefined);
|
|
52
|
+
this._newtonSolver = new Newton_1.Newton1dUnboundedApproximateDerivative(this);
|
|
53
|
+
}
|
|
54
|
+
/** Specified by IStrokeHandler. */
|
|
55
|
+
needPrimaryGeometryForStrokes() {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
/** Specified by IStrokeHandler. */
|
|
59
|
+
startCurvePrimitive(curve) {
|
|
60
|
+
this._curve = curve;
|
|
61
|
+
this._fractionA = 0.0;
|
|
62
|
+
this._numThisCurve = 0;
|
|
63
|
+
this._functionA = 0.0;
|
|
64
|
+
}
|
|
65
|
+
/** Specified by IStrokeHandler. */
|
|
66
|
+
endCurvePrimitive() {
|
|
67
|
+
}
|
|
68
|
+
/** Specified by IStrokeHandler. */
|
|
69
|
+
announceIntervalForUniformStepStrokes(cp, numStrokes, fraction0, fraction1) {
|
|
70
|
+
this.startCurvePrimitive(cp);
|
|
71
|
+
if (numStrokes < 1)
|
|
72
|
+
numStrokes = 1;
|
|
73
|
+
const df = 1.0 / numStrokes;
|
|
74
|
+
for (let i = 0; i <= numStrokes; i++) {
|
|
75
|
+
const fraction = Geometry_1.Geometry.interpolate(fraction0, i * df, fraction1);
|
|
76
|
+
cp.fractionToPointAndDerivative(fraction, this._workRay);
|
|
77
|
+
this.announceRay(fraction, this._workRay);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
announceCandidate(cp, fraction, point) {
|
|
81
|
+
if (this._parentCurvePrimitive)
|
|
82
|
+
cp = this._parentCurvePrimitive;
|
|
83
|
+
if (this._curveMRU === cp && Geometry_1.Geometry.isAlmostEqualOptional(this._fractionMRU, fraction, Geometry_1.Geometry.smallFloatingPoint))
|
|
84
|
+
return; // avoid announcing duplicate tangents in succession (e.g., at interior stroke point)
|
|
85
|
+
this._workDetail = CurveLocationDetail_1.CurveLocationDetail.createCurveFractionPoint(cp, fraction, point, this._workDetail);
|
|
86
|
+
this._announceTangent(this._workDetail);
|
|
87
|
+
this._fractionMRU = fraction;
|
|
88
|
+
this._curveMRU = cp;
|
|
89
|
+
}
|
|
90
|
+
/** Specified by IStrokeHandler. */
|
|
91
|
+
announceSegmentInterval(cp, point0, point1, _numStrokes, fraction0, fraction1) {
|
|
92
|
+
let fraction;
|
|
93
|
+
let point;
|
|
94
|
+
const distance0 = this._spacePoint.distanceSquared(point0);
|
|
95
|
+
const distance1 = this._spacePoint.distanceSquared(point1);
|
|
96
|
+
if (distance0 < distance1) {
|
|
97
|
+
fraction = fraction0;
|
|
98
|
+
point = point0;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
fraction = fraction1;
|
|
102
|
+
point = point1;
|
|
103
|
+
}
|
|
104
|
+
// evaluate at midpoint; the endpoints may be at corners, which have ambiguous tangent
|
|
105
|
+
const value = this.evaluateFunction(undefined, (fraction0 + fraction1) / 2, cp);
|
|
106
|
+
if (value !== undefined && Geometry_1.Geometry.isDistanceWithinTol(value, this._distanceTol))
|
|
107
|
+
this.announceCandidate(cp, fraction, point);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Given a function `f` and (unordered) fractions `a` and `b`, search for and announce a root of `f` in this
|
|
111
|
+
* fractional interval.
|
|
112
|
+
* * This method searches for a root of `f` if and only if the stroke segment defined by `(a, f(a))` and
|
|
113
|
+
* `(b, f(b))` has a root. This is a HEURISTIC: given continuous `f` between `a` and `b`, a root of the stroke
|
|
114
|
+
* segment implies a root of `f`, but not vice-versa. Therefore, if the strokes are not sufficiently dense,
|
|
115
|
+
* this method can miss a root of `f`.
|
|
116
|
+
*/
|
|
117
|
+
searchInterval() {
|
|
118
|
+
// directly announce at endpoint if we are extra certain it's a root; Newton can miss it if it has multiplicity > 1
|
|
119
|
+
if (Geometry_1.Geometry.isDistanceWithinTol(this._functionA, this._distanceTolSquared))
|
|
120
|
+
this.announceSolutionFraction(this._fractionA);
|
|
121
|
+
if (Geometry_1.Geometry.isDistanceWithinTol(this._functionB, this._distanceTolSquared))
|
|
122
|
+
this.announceSolutionFraction(this._fractionB);
|
|
123
|
+
if (this._functionA * this._functionB < 0) {
|
|
124
|
+
// by the Intermediate Value Theorem, a root lies between fractionA and fractionB; use Newton to find it.
|
|
125
|
+
const fraction = Geometry_1.Geometry.inverseInterpolate(this._fractionA, this._functionA, this._fractionB, this._functionB);
|
|
126
|
+
if (fraction) {
|
|
127
|
+
this._newtonSolver.setX(fraction);
|
|
128
|
+
if (this._newtonSolver.runIterations())
|
|
129
|
+
this.announceSolutionFraction(this._newtonSolver.getX());
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
announceSolutionFraction(fraction) {
|
|
134
|
+
if (this._curve)
|
|
135
|
+
this.announceCandidate(this._curve, fraction, this._curve.fractionToPoint(fraction));
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Evaluate the univariate real-valued function for which we are finding roots.
|
|
139
|
+
* * For finding the tangents to curve `X` from point `Q` as seen in a view plane with normal `N`, this
|
|
140
|
+
* function is `f(t) := (Q - X(t)) dot (X'(t) cross N)`. The second vector in the dot product defines a
|
|
141
|
+
* _tangent plane_ at `X(t)`.
|
|
142
|
+
* * Either `pointAndDerivative` must be defined, or both `fraction` and `curve`.
|
|
143
|
+
* @param pointAndDerivative pre-evaluated curve
|
|
144
|
+
* @param fraction fraction at which to evaluate `curve`
|
|
145
|
+
* @param curve curve to evaluate at `fraction`
|
|
146
|
+
* @returns distance of `Q` from the tangent plane at `X(t)`.
|
|
147
|
+
*/
|
|
148
|
+
evaluateFunction(pointAndDerivative, fraction, curve) {
|
|
149
|
+
if (pointAndDerivative)
|
|
150
|
+
this._workRay.setFrom(pointAndDerivative);
|
|
151
|
+
else if (fraction !== undefined && curve)
|
|
152
|
+
this._workRay = curve.fractionToPointAndDerivative(fraction, this._workRay);
|
|
153
|
+
else
|
|
154
|
+
return undefined;
|
|
155
|
+
const cross = this._vectorToEye.unitCrossProduct(this._workRay.direction); // normalized so we return true distance
|
|
156
|
+
return cross ? cross.dotProductStartEnd(this._workRay.origin, this._spacePoint) : undefined;
|
|
157
|
+
}
|
|
158
|
+
/** Specified by NewtonRtoRStrokeHandler. */
|
|
159
|
+
evaluate(fraction) {
|
|
160
|
+
const curve = this._parentCurvePrimitive ?? this._curve;
|
|
161
|
+
const value = this.evaluateFunction(undefined, fraction, curve);
|
|
162
|
+
if (value === undefined)
|
|
163
|
+
return false;
|
|
164
|
+
this.currentF = value;
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
announceRay(fraction, data) {
|
|
168
|
+
this._functionB = this.evaluateFunction(data);
|
|
169
|
+
this._fractionB = fraction;
|
|
170
|
+
if (this._numThisCurve++ > 0) // after the first stroke point, a stroke segment is defined, so we have an interval
|
|
171
|
+
this.searchInterval();
|
|
172
|
+
this._functionA = this._functionB;
|
|
173
|
+
this._fractionA = this._fractionB;
|
|
174
|
+
}
|
|
175
|
+
/** Specified by IStrokeHandler. */
|
|
176
|
+
announcePointTangent(_point, _fraction, _tangent) {
|
|
177
|
+
(0, core_bentley_1.assert)(false, "No callers expected. IStrokeHandler probably didn't need to specify this method.");
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
exports.AnnounceTangentStrokeHandler = AnnounceTangentStrokeHandler;
|
|
181
|
+
//# sourceMappingURL=AnnounceTangentStrokeHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnnounceTangentStrokeHandler.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/AnnounceTangentStrokeHandler.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAC7C,6CAA0C;AAE1C,sEAAqE;AACrE,kDAA+C;AAC/C,kDAA+E;AAC/E,gEAA6D;AAE7D,uEAAoE;AAEpE;;;GAGG;AACH,MAAa,4BAA6B,SAAQ,iDAAuB;IAC/D,MAAM,CAA6B;IACnC,gBAAgB,CAAwC;IACxD,WAAW,CAAU;IACrB,YAAY,CAAW;IACvB,YAAY,CAAS;IACrB,mBAAmB,CAAS;IACpC,iFAAiF;IACzE,UAAU,GAAW,CAAC,CAAC;IACvB,UAAU,GAAW,CAAC,CAAC;IAC/B,uFAAuF;IAC/E,UAAU,GAAW,CAAC,CAAC;IACvB,UAAU,GAAW,CAAC,CAAC;IACvB,aAAa,GAAW,CAAC,CAAC;IAClC,qCAAqC;IAC7B,YAAY,CAAU;IACtB,SAAS,CAAkB;IAC3B,QAAQ,CAAQ;IAChB,WAAW,CAAuB;IAClC,aAAa,CAAyC;IAC9D,kBAAkB;IAClB,YAAmB,UAAmB,EAAE,eAAsD,EAAE,OAAwB;QACtH,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,YAAY,GAAG,O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C;QAC/C,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;QAC3B,IAAI,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,EAAE,oFAAoF;YAChH,IAAI,CAAC,cAAc,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACpC,CAAC;IACD,mCAAmC;IAC5B,oBAAoB,CAAC,MAAe,EAAE,SAAiB,EAAE,QAAkB;QAChF,IAAA,qBAAM,EAAC,KAAK,EAAE,kFAAkF,CAAC,CAAC;IACpG,CAAC;CACF;AAhKD,oEAgKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { Geometry } from \"../../Geometry\";\nimport { IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\nimport { Point3d, Vector3d } from \"../../geometry3d/Point3dVector3d\";\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\nimport { Newton1dUnboundedApproximateDerivative } from \"../../numerics/Newton\";\nimport { CurveLocationDetail } from \"../CurveLocationDetail\";\nimport { CurvePrimitive, TangentOptions } from \"../CurvePrimitive\";\nimport { NewtonRtoRStrokeHandler } from \"./NewtonRtoRStrokeHandler\";\n\n/**\n * Context for searching for the tangent(s) to a CurvePrimitive.\n * @internal\n */\nexport class AnnounceTangentStrokeHandler extends NewtonRtoRStrokeHandler implements IStrokeHandler {\n private _curve: CurvePrimitive | undefined;\n private _announceTangent: (tangent: CurveLocationDetail) => any;\n private _spacePoint: Point3d;\n private _vectorToEye: Vector3d;\n private _distanceTol: number;\n private _distanceTolSquared: number;\n // fraction and function value on one side of an interval that may bracket a root\n private _fractionA: number = 0;\n private _functionA: number = 0;\n // fraction and function value on the other side of an interval that may bracket a root\n private _fractionB: number = 0;\n private _functionB: number = 0;\n private _numThisCurve: number = 0;\n // scratch vars to use within methods\n private _fractionMRU?: number;\n private _curveMRU?: CurvePrimitive;\n private _workRay: Ray3d;\n private _workDetail?: CurveLocationDetail;\n private _newtonSolver: Newton1dUnboundedApproximateDerivative;\n /** Constructor */\n public constructor(spacePoint: Point3d, announceTangent: (tangent: CurveLocationDetail) => any, options?: TangentOptions) {\n super();\n this._announceTangent = announceTangent;\n this._spacePoint = spacePoint;\n this._vectorToEye = options?.vectorToEye ?? Vector3d.unitZ();\n this._distanceTol = options?.distanceTol ?? Geometry.smallMetricDistance;\n this._distanceTolSquared = this._distanceTol * this._distanceTol;\n this._workRay = Ray3d.createZero();\n this.startCurvePrimitive(undefined);\n this._newtonSolver = new Newton1dUnboundedApproximateDerivative(this);\n }\n /** Specified by IStrokeHandler. */\n public needPrimaryGeometryForStrokes() {\n return true;\n }\n /** Specified by IStrokeHandler. */\n public startCurvePrimitive(curve: CurvePrimitive | undefined) {\n this._curve = curve;\n this._fractionA = 0.0;\n this._numThisCurve = 0;\n this._functionA = 0.0;\n }\n /** Specified by IStrokeHandler. */\n public endCurvePrimitive() {\n }\n /** Specified by IStrokeHandler. */\n public announceIntervalForUniformStepStrokes(\n cp: CurvePrimitive, numStrokes: number, fraction0: number, fraction1: number,\n ): void {\n this.startCurvePrimitive(cp);\n if (numStrokes < 1)\n numStrokes = 1;\n const df = 1.0 / numStrokes;\n for (let i = 0; i <= numStrokes; i++) {\n const fraction = Geometry.interpolate(fraction0, i * df, fraction1);\n cp.fractionToPointAndDerivative(fraction, this._workRay);\n this.announceRay(fraction, this._workRay);\n }\n }\n private announceCandidate(cp: CurvePrimitive, fraction: number, point: Point3d) {\n if (this._parentCurvePrimitive)\n cp = this._parentCurvePrimitive;\n if (this._curveMRU === cp && Geometry.isAlmostEqualOptional(this._fractionMRU, fraction, Geometry.smallFloatingPoint))\n return; // avoid announcing duplicate tangents in succession (e.g., at interior stroke point)\n this._workDetail = CurveLocationDetail.createCurveFractionPoint(cp, fraction, point, this._workDetail);\n this._announceTangent(this._workDetail);\n this._fractionMRU = fraction;\n this._curveMRU = cp;\n }\n /** Specified by IStrokeHandler. */\n public announceSegmentInterval(\n cp: CurvePrimitive, point0: Point3d, point1: Point3d, _numStrokes: number, fraction0: number, fraction1: number,\n ): void {\n let fraction: number;\n let point: Point3d;\n const distance0 = this._spacePoint.distanceSquared(point0);\n const distance1 = this._spacePoint.distanceSquared(point1);\n if (distance0 < distance1) {\n fraction = fraction0;\n point = point0;\n } else {\n fraction = fraction1;\n point = point1;\n }\n // evaluate at midpoint; the endpoints may be at corners, which have ambiguous tangent\n const value = this.evaluateFunction(undefined, (fraction0 + fraction1) / 2, cp);\n if (value !== undefined && Geometry.isDistanceWithinTol(value, this._distanceTol))\n this.announceCandidate(cp, fraction, point);\n }\n /**\n * Given a function `f` and (unordered) fractions `a` and `b`, search for and announce a root of `f` in this\n * fractional interval.\n * * This method searches for a root of `f` if and only if the stroke segment defined by `(a, f(a))` and\n * `(b, f(b))` has a root. This is a HEURISTIC: given continuous `f` between `a` and `b`, a root of the stroke\n * segment implies a root of `f`, but not vice-versa. Therefore, if the strokes are not sufficiently dense,\n * this method can miss a root of `f`.\n */\n private searchInterval() {\n // directly announce at endpoint if we are extra certain it's a root; Newton can miss it if it has multiplicity > 1\n if (Geometry.isDistanceWithinTol(this._functionA, this._distanceTolSquared))\n this.announceSolutionFraction(this._fractionA);\n if (Geometry.isDistanceWithinTol(this._functionB, this._distanceTolSquared))\n this.announceSolutionFraction(this._fractionB);\n if (this._functionA * this._functionB < 0) {\n // by the Intermediate Value Theorem, a root lies between fractionA and fractionB; use Newton to find it.\n const fraction = Geometry.inverseInterpolate(this._fractionA, this._functionA, this._fractionB, this._functionB);\n if (fraction) {\n this._newtonSolver.setX(fraction);\n if (this._newtonSolver.runIterations())\n this.announceSolutionFraction(this._newtonSolver.getX());\n }\n }\n }\n private announceSolutionFraction(fraction: number) {\n if (this._curve)\n this.announceCandidate(this._curve, fraction, this._curve.fractionToPoint(fraction));\n }\n /**\n * Evaluate the univariate real-valued function for which we are finding roots.\n * * For finding the tangents to curve `X` from point `Q` as seen in a view plane with normal `N`, this\n * function is `f(t) := (Q - X(t)) dot (X'(t) cross N)`. The second vector in the dot product defines a\n * _tangent plane_ at `X(t)`.\n * * Either `pointAndDerivative` must be defined, or both `fraction` and `curve`.\n * @param pointAndDerivative pre-evaluated curve\n * @param fraction fraction at which to evaluate `curve`\n * @param curve curve to evaluate at `fraction`\n * @returns distance of `Q` from the tangent plane at `X(t)`.\n */\n private evaluateFunction(pointAndDerivative?: Ray3d, fraction?: number, curve?: CurvePrimitive): number | undefined {\n if (pointAndDerivative)\n this._workRay.setFrom(pointAndDerivative);\n else if (fraction !== undefined && curve)\n this._workRay = curve.fractionToPointAndDerivative(fraction, this._workRay);\n else\n return undefined;\n const cross = this._vectorToEye.unitCrossProduct(this._workRay.direction); // normalized so we return true distance\n return cross ? cross.dotProductStartEnd(this._workRay.origin, this._spacePoint) : undefined;\n }\n /** Specified by NewtonRtoRStrokeHandler. */\n public evaluate(fraction: number): boolean {\n const curve = this._parentCurvePrimitive ?? this._curve;\n const value = this.evaluateFunction(undefined, fraction, curve);\n if (value === undefined)\n return false;\n this.currentF = value;\n return true;\n }\n private announceRay(fraction: number, data: Ray3d): void {\n this._functionB = this.evaluateFunction(data)!;\n this._fractionB = fraction;\n if (this._numThisCurve++ > 0) // after the first stroke point, a stroke segment is defined, so we have an interval\n this.searchInterval();\n this._functionA = this._functionB;\n this._fractionA = this._fractionB;\n }\n /** Specified by IStrokeHandler. */\n public announcePointTangent(_point: Point3d, _fraction: number, _tangent: Vector3d) {\n assert(false, \"No callers expected. IStrokeHandler probably didn't need to specify this method.\");\n }\n}\n"]}
|
|
@@ -19,6 +19,19 @@ const NewtonRtoRStrokeHandler_1 = require("./NewtonRtoRStrokeHandler");
|
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
21
|
class AppendPlaneIntersectionStrokeHandler extends NewtonRtoRStrokeHandler_1.NewtonRtoRStrokeHandler {
|
|
22
|
+
_curve;
|
|
23
|
+
_plane;
|
|
24
|
+
_intersections;
|
|
25
|
+
_fractionA = 0;
|
|
26
|
+
_functionA = 0;
|
|
27
|
+
// private derivativeA: number; <---- Not currently used
|
|
28
|
+
_functionB = 0;
|
|
29
|
+
_fractionB = 0;
|
|
30
|
+
_derivativeB = 0;
|
|
31
|
+
_numThisCurve = 0;
|
|
32
|
+
// scratch vars for use within methods.
|
|
33
|
+
_ray;
|
|
34
|
+
_newtonSolver;
|
|
22
35
|
// Return the first defined curve among: this.parentCurvePrimitive, this.curve;
|
|
23
36
|
effectiveCurve() {
|
|
24
37
|
if (this._parentCurvePrimitive)
|
|
@@ -30,13 +43,6 @@ class AppendPlaneIntersectionStrokeHandler extends NewtonRtoRStrokeHandler_1.New
|
|
|
30
43
|
}
|
|
31
44
|
constructor(plane, intersections) {
|
|
32
45
|
super();
|
|
33
|
-
this._fractionA = 0;
|
|
34
|
-
this._functionA = 0;
|
|
35
|
-
// private derivativeA: number; <---- Not currently used
|
|
36
|
-
this._functionB = 0;
|
|
37
|
-
this._fractionB = 0;
|
|
38
|
-
this._derivativeB = 0;
|
|
39
|
-
this._numThisCurve = 0;
|
|
40
46
|
this._plane = plane;
|
|
41
47
|
this._intersections = intersections;
|
|
42
48
|
this.startCurvePrimitive(undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppendPlaneIntersectionStrokeHandler.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,6CAAkE;AAGlE,kDAA+C;AAC/C,wEAAgE;AAChE,kDAA+E;AAC/E,gEAA6D;AAE7D,uEAAoE;AAEpE;;;GAGG;AACH,MAAa,oCAAqC,SAAQ,iDAAuB;IAe/E,+EAA+E;I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,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAClC,IAAI,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE;oBACpC,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;YAC7D,CAAC;QACH,CAAC;IACH,CAAC;IAED,kEAAkE;IAC1D,SAAS,CAAC,GAAY,EAAE,QAAgB,EAAE,OAAiB;QACjE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAED;;;;;;;;;OASG;IACI,oBAAoB,CAAC,GAAY,EAAE,QAAgB,EAAE,OAAiB;QAC3E,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACvC,IAAI,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC;YAAE,IAAI,CAAC,cAAc,EAAE,CAAC;QACpD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACpC,CAAC;CACF;AA/ID,oFA+IC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { Geometry, PlaneAltitudeEvaluator } from \"../../Geometry\";\r\nimport { IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\r\nimport { Point3d, Vector3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\r\nimport { Order2Bezier } from \"../../numerics/BezierPolynomials\";\r\nimport { Newton1dUnboundedApproximateDerivative } from \"../../numerics/Newton\";\r\nimport { CurveLocationDetail } from \"../CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"../CurvePrimitive\";\r\nimport { NewtonRtoRStrokeHandler } from \"./NewtonRtoRStrokeHandler\";\r\n\r\n/**\r\n * Context for computing intersections of a CurvePrimitive with a plane.\r\n * @internal\r\n */\r\nexport class AppendPlaneIntersectionStrokeHandler extends NewtonRtoRStrokeHandler implements IStrokeHandler {\r\n private _curve: CurvePrimitive | undefined;\r\n private _plane: PlaneAltitudeEvaluator;\r\n private _intersections: CurveLocationDetail[];\r\n private _fractionA: number = 0;\r\n private _functionA: number = 0;\r\n // private derivativeA: number; <---- Not currently used\r\n private _functionB: number = 0;\r\n private _fractionB: number = 0;\r\n private _derivativeB: number = 0;\r\n private _numThisCurve: number = 0;\r\n // scratch vars for use within methods.\r\n private _ray: Ray3d;\r\n private _newtonSolver: Newton1dUnboundedApproximateDerivative;\r\n\r\n // Return the first defined curve among: this.parentCurvePrimitive, this.curve;\r\n public effectiveCurve(): CurvePrimitive | undefined {\r\n if (this._parentCurvePrimitive)\r\n return this._parentCurvePrimitive;\r\n return this._curve;\r\n }\r\n\r\n public get getDerivativeB() {\r\n return this._derivativeB; // <--- _derivativeB is not currently used anywhere. Provided getter to suppress lint error\r\n }\r\n\r\n public constructor(plane: PlaneAltitudeEvaluator, intersections: CurveLocationDetail[]) {\r\n super();\r\n this._plane = plane;\r\n this._intersections = intersections;\r\n this.startCurvePrimitive(undefined);\r\n this._ray = Ray3d.createZero();\r\n this._newtonSolver = new Newton1dUnboundedApproximateDerivative(this);\r\n }\r\n\r\n public startCurvePrimitive(curve: CurvePrimitive | undefined) {\r\n this._curve = curve;\r\n this._fractionA = 0.0;\r\n this._numThisCurve = 0;\r\n this._functionA = 0.0;\r\n // this.derivativeA = 0.0;\r\n }\r\n\r\n public endCurvePrimitive() {\r\n }\r\n\r\n public announceIntervalForUniformStepStrokes(\r\n cp: CurvePrimitive,\r\n numStrokes: number,\r\n fraction0: number,\r\n fraction1: number): void {\r\n this.startCurvePrimitive(cp);\r\n if (numStrokes < 1) numStrokes = 1;\r\n const df = 1.0 / numStrokes;\r\n for (let i = 0; i <= numStrokes; i++) {\r\n const fraction = Geometry.interpolate(fraction0, i * df, fraction1);\r\n cp.fractionToPointAndDerivative(fraction, this._ray);\r\n this.announcePointTangent(this._ray.origin, fraction, this._ray.direction);\r\n }\r\n }\r\n\r\n public announceSegmentInterval(\r\n _cp: CurvePrimitive,\r\n point0: Point3d,\r\n point1: Point3d,\r\n _numStrokes: number,\r\n fraction0: number,\r\n fraction1: number): void {\r\n const h0 = this._plane.altitude(point0);\r\n const h1 = this._plane.altitude(point1);\r\n if (h0 * h1 > 0.0)\r\n return;\r\n const fraction01 = Order2Bezier.solveCoffs(h0, h1);\r\n // let numIntersection = 0;\r\n if (fraction01 !== undefined) {\r\n // numIntersection++;\r\n const fraction = Geometry.interpolate(fraction0, fraction01, fraction1);\r\n this._newtonSolver.setX(fraction);\r\n if (this._newtonSolver.runIterations()) {\r\n this.announceSolutionFraction(this._newtonSolver.getX());\r\n }\r\n // this.intersections.push(CurveLocationDetail.createCurveFractionPoint(cp, fraction, cp.fractionToPoint(fraction)));\r\n }\r\n }\r\n\r\n private announceSolutionFraction(fraction: number) {\r\n const curve = this.effectiveCurve();\r\n if (curve) {\r\n this._ray = curve.fractionToPointAndDerivative(fraction, this._ray);\r\n this._intersections.push(CurveLocationDetail.createCurveFractionPoint(curve, fraction, this._ray.origin));\r\n }\r\n }\r\n\r\n public evaluate(fraction: number): boolean {\r\n const curve = this.effectiveCurve();\r\n if (!curve)\r\n return false;\r\n this.currentF = this._plane.altitude(curve.fractionToPoint(fraction));\r\n return true;\r\n }\r\n\r\n /**\r\n * * ASSUME both the \"A\" and \"B\" evaluations (fraction, function, and derivative) are known.\r\n * * If function value changed sign between, interpolate an approximate root and improve it with\r\n * the newton solver.\r\n */\r\n private searchInterval() {\r\n if (this._functionA * this._functionB > 0) return;\r\n if (this._functionA === 0) this.announceSolutionFraction(this._fractionA);\r\n if (this._functionB === 0) this.announceSolutionFraction(this._fractionB);\r\n if (this._functionA * this._functionB < 0) {\r\n const fraction = Geometry.inverseInterpolate(this._fractionA, this._functionA, this._fractionB, this._functionB);\r\n if (fraction) {\r\n this._newtonSolver.setX(fraction);\r\n if (this._newtonSolver.runIterations())\r\n this.announceSolutionFraction(this._newtonSolver.getX());\r\n }\r\n }\r\n }\r\n\r\n /** Evaluate and save _functionB, _derivativeB, and _fractionB. */\r\n private evaluateB(xyz: Point3d, fraction: number, tangent: Vector3d) {\r\n this._functionB = this._plane.altitude(xyz);\r\n this._derivativeB = this._plane.velocity(tangent);\r\n this._fractionB = fraction;\r\n }\r\n\r\n /**\r\n * Announce point and tangent for evaluations.\r\n * * The function evaluation is saved as the \"B\" function point.\r\n * * The function point count is incremented\r\n * * If function point count is greater than 1, the current interval is searched.\r\n * * The just-evaluated point (\"B\") is saved as the \"old\" (\"A\") evaluation point.\r\n * @param xyz\r\n * @param fraction\r\n * @param tangent\r\n */\r\n public announcePointTangent(xyz: Point3d, fraction: number, tangent: Vector3d): void {\r\n this.evaluateB(xyz, fraction, tangent);\r\n if (this._numThisCurve++ > 0) this.searchInterval();\r\n this._functionA = this._functionB;\r\n this._fractionA = this._fractionB;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"AppendPlaneIntersectionStrokeHandler.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,6CAAkE;AAGlE,kDAA+C;AAC/C,wEAAgE;AAChE,kDAA+E;AAC/E,gEAA6D;AAE7D,uEAAoE;AAEpE;;;GAGG;AACH,MAAa,oCAAqC,SAAQ,iDAAuB;IACvE,MAAM,CAA6B;IACnC,MAAM,CAAyB;IAC/B,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AAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;YACjH,IAAI,QAAQ,EAAE,CAAC;gBACb,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAClC,IAAI,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE;oBACpC,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;YAC7D,CAAC;QACH,CAAC;IACH,CAAC;IAED,kEAAkE;IAC1D,SAAS,CAAC,GAAY,EAAE,QAAgB,EAAE,OAAiB;QACjE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAED;;;;;;;;;OASG;IACI,oBAAoB,CAAC,GAAY,EAAE,QAAgB,EAAE,OAAiB;QAC3E,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACvC,IAAI,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC;YAAE,IAAI,CAAC,cAAc,EAAE,CAAC;QACpD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACpC,CAAC;CACF;AA/ID,oFA+IC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { Geometry, PlaneAltitudeEvaluator } from \"../../Geometry\";\nimport { IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\nimport { Point3d, Vector3d } from \"../../geometry3d/Point3dVector3d\";\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\nimport { Order2Bezier } from \"../../numerics/BezierPolynomials\";\nimport { Newton1dUnboundedApproximateDerivative } from \"../../numerics/Newton\";\nimport { CurveLocationDetail } from \"../CurveLocationDetail\";\nimport { CurvePrimitive } from \"../CurvePrimitive\";\nimport { NewtonRtoRStrokeHandler } from \"./NewtonRtoRStrokeHandler\";\n\n/**\n * Context for computing intersections of a CurvePrimitive with a plane.\n * @internal\n */\nexport class AppendPlaneIntersectionStrokeHandler extends NewtonRtoRStrokeHandler implements IStrokeHandler {\n private _curve: CurvePrimitive | undefined;\n private _plane: PlaneAltitudeEvaluator;\n private _intersections: CurveLocationDetail[];\n private _fractionA: number = 0;\n private _functionA: number = 0;\n // private derivativeA: number; <---- Not currently used\n private _functionB: number = 0;\n private _fractionB: number = 0;\n private _derivativeB: number = 0;\n private _numThisCurve: number = 0;\n // scratch vars for use within methods.\n private _ray: Ray3d;\n private _newtonSolver: Newton1dUnboundedApproximateDerivative;\n\n // Return the first defined curve among: this.parentCurvePrimitive, this.curve;\n public effectiveCurve(): CurvePrimitive | undefined {\n if (this._parentCurvePrimitive)\n return this._parentCurvePrimitive;\n return this._curve;\n }\n\n public get getDerivativeB() {\n return this._derivativeB; // <--- _derivativeB is not currently used anywhere. Provided getter to suppress lint error\n }\n\n public constructor(plane: PlaneAltitudeEvaluator, intersections: CurveLocationDetail[]) {\n super();\n this._plane = plane;\n this._intersections = intersections;\n this.startCurvePrimitive(undefined);\n this._ray = Ray3d.createZero();\n this._newtonSolver = new Newton1dUnboundedApproximateDerivative(this);\n }\n\n public startCurvePrimitive(curve: CurvePrimitive | undefined) {\n this._curve = curve;\n this._fractionA = 0.0;\n this._numThisCurve = 0;\n this._functionA = 0.0;\n // this.derivativeA = 0.0;\n }\n\n public endCurvePrimitive() {\n }\n\n public announceIntervalForUniformStepStrokes(\n cp: CurvePrimitive,\n numStrokes: number,\n fraction0: number,\n fraction1: number): void {\n this.startCurvePrimitive(cp);\n if (numStrokes < 1) numStrokes = 1;\n const df = 1.0 / numStrokes;\n for (let i = 0; i <= numStrokes; i++) {\n const fraction = Geometry.interpolate(fraction0, i * df, fraction1);\n cp.fractionToPointAndDerivative(fraction, this._ray);\n this.announcePointTangent(this._ray.origin, fraction, this._ray.direction);\n }\n }\n\n public announceSegmentInterval(\n _cp: CurvePrimitive,\n point0: Point3d,\n point1: Point3d,\n _numStrokes: number,\n fraction0: number,\n fraction1: number): void {\n const h0 = this._plane.altitude(point0);\n const h1 = this._plane.altitude(point1);\n if (h0 * h1 > 0.0)\n return;\n const fraction01 = Order2Bezier.solveCoffs(h0, h1);\n // let numIntersection = 0;\n if (fraction01 !== undefined) {\n // numIntersection++;\n const fraction = Geometry.interpolate(fraction0, fraction01, fraction1);\n this._newtonSolver.setX(fraction);\n if (this._newtonSolver.runIterations()) {\n this.announceSolutionFraction(this._newtonSolver.getX());\n }\n // this.intersections.push(CurveLocationDetail.createCurveFractionPoint(cp, fraction, cp.fractionToPoint(fraction)));\n }\n }\n\n private announceSolutionFraction(fraction: number) {\n const curve = this.effectiveCurve();\n if (curve) {\n this._ray = curve.fractionToPointAndDerivative(fraction, this._ray);\n this._intersections.push(CurveLocationDetail.createCurveFractionPoint(curve, fraction, this._ray.origin));\n }\n }\n\n public evaluate(fraction: number): boolean {\n const curve = this.effectiveCurve();\n if (!curve)\n return false;\n this.currentF = this._plane.altitude(curve.fractionToPoint(fraction));\n return true;\n }\n\n /**\n * * ASSUME both the \"A\" and \"B\" evaluations (fraction, function, and derivative) are known.\n * * If function value changed sign between, interpolate an approximate root and improve it with\n * the newton solver.\n */\n private searchInterval() {\n if (this._functionA * this._functionB > 0) return;\n if (this._functionA === 0) this.announceSolutionFraction(this._fractionA);\n if (this._functionB === 0) this.announceSolutionFraction(this._fractionB);\n if (this._functionA * this._functionB < 0) {\n const fraction = Geometry.inverseInterpolate(this._fractionA, this._functionA, this._fractionB, this._functionB);\n if (fraction) {\n this._newtonSolver.setX(fraction);\n if (this._newtonSolver.runIterations())\n this.announceSolutionFraction(this._newtonSolver.getX());\n }\n }\n }\n\n /** Evaluate and save _functionB, _derivativeB, and _fractionB. */\n private evaluateB(xyz: Point3d, fraction: number, tangent: Vector3d) {\n this._functionB = this._plane.altitude(xyz);\n this._derivativeB = this._plane.velocity(tangent);\n this._fractionB = fraction;\n }\n\n /**\n * Announce point and tangent for evaluations.\n * * The function evaluation is saved as the \"B\" function point.\n * * The function point count is incremented\n * * If function point count is greater than 1, the current interval is searched.\n * * The just-evaluated point (\"B\") is saved as the \"old\" (\"A\") evaluation point.\n * @param xyz\n * @param fraction\n * @param tangent\n */\n public announcePointTangent(xyz: Point3d, fraction: number, tangent: Vector3d): void {\n this.evaluateB(xyz, fraction, tangent);\n if (this._numThisCurve++ > 0) this.searchInterval();\n this._functionA = this._functionB;\n this._fractionA = this._fractionB;\n }\n}\n"]}
|
|
@@ -30,6 +30,10 @@ const Path_1 = require("../Path");
|
|
|
30
30
|
* @internal
|
|
31
31
|
*/
|
|
32
32
|
class ChainCollectorContext {
|
|
33
|
+
_chains;
|
|
34
|
+
_makeClones;
|
|
35
|
+
static _staticPointA;
|
|
36
|
+
static _staticPointB;
|
|
33
37
|
/**
|
|
34
38
|
* Push a new chain with an optional first primitive.
|
|
35
39
|
*/
|
|
@@ -44,6 +48,7 @@ class ChainCollectorContext {
|
|
|
44
48
|
this.pushNewChain();
|
|
45
49
|
return this._chains[this._chains.length - 1];
|
|
46
50
|
}
|
|
51
|
+
_xyzWork0;
|
|
47
52
|
findAnyChainToConnect(xyz) {
|
|
48
53
|
for (let chainIndexA = 0; chainIndexA < this._chains.length; chainIndexA++) {
|
|
49
54
|
const path = this._chains[chainIndexA];
|
|
@@ -63,6 +68,7 @@ class ChainCollectorContext {
|
|
|
63
68
|
this._chains = [];
|
|
64
69
|
this._makeClones = makeClones;
|
|
65
70
|
}
|
|
71
|
+
_xyzWork1;
|
|
66
72
|
/** Announce a curve primitive
|
|
67
73
|
* * searchAllChains controls the extent of search for connecting points.
|
|
68
74
|
* * false ==> only consider connection to most recent chain.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainCollectorContext.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/ChainCollectorContext.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAM/F,wDAAiD;AACjD,sDAAmD;AACnD,kCAA+B;AAC/B,kCAA+B;AAE/B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,qBAAqB;IAOhC;;OAEG;IACK,YAAY,CAAC,SAA0B;QAC7C,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,IAAI,SAAS;YACX,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IACO,qBAAqB;QAC3B,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;YAC3B,IAAI,CAAC,YAAY,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/C,CAAC;IAEO,qBAAqB,CAAC,GAAY;QAExC,KAAK,IAAI,WAAW,GAAG,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,CAAC;YAC3E,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;YACvC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAChE,IAAI,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC;gBACnC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;YAClD,IAAI,CAAC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AC3B,MAAM,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;YAC7D,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,0BAA0B,CAAC,UAAsC,EAAE,UAAsC,EAAE,WAAoB,KAAK;QAChJ,IAAI,UAAU,KAAK,SAAS;YAC1B,OAAO,IAAI,CAAC;QACd,IAAI,UAAU,KAAK,SAAS;YAC1B,OAAO,IAAI,CAAC;QACd,IAAI,UAAU,CAAC,MAAM,KAAK,SAAS;YACjC,OAAO,IAAI,CAAC;QACd,IAAI,UAAU,CAAC,QAAQ,KAAK,SAAS;YACnC,OAAO,IAAI,CAAC;QACd,qBAAqB,CAAC,aAAa,GAAG,UAAU,CAAC,QAAQ,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;QAC/F,qBAAqB,CAAC,aAAa,GAAG,UAAU,CAAC,UAAU,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;QACjG,OAAO,QAAQ;YACb,CAAC,CAAC,CAAC,qBAAqB,CAAC,aAAa,CAAC,eAAe,CAAC,qBAAqB,CAAC,aAAa,CAAC;YAC3F,CAAC,CAAC,CAAC,qBAAqB,CAAC,aAAa,CAAC,aAAa,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC9F,CAAC;CACF;AAxJD,sDAwJC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport { BagOfCurves } from \"../CurveCollection\";\r\nimport { CurvePrimitive } from \"../CurvePrimitive\";\r\nimport { Loop } from \"../Loop\";\r\nimport { Path } from \"../Path\";\r\n\r\n/**\r\n * Manage a growing array of arrays of curve primitives that are to be joined \"head to tail\" in paths.\r\n * * The caller makes a sequence of calls to announce individual primitives.\r\n * * The collector has 2 use cases in mind, controlled by `searchAllPaths` flag on `chainCollectorContext.announceCurvePrimitive`\r\n * * (a) \"simple chains\" -- the caller has the curve primitives in order and just needs to have them monitored for coordinate breaks that indicate transition to a new chain.\r\n * * The collector needs to watch for connection to the most recent path but not search for prior paths to join to instead.\r\n * * (b) \"mixed\" primitives -- primitive order is NOT significant for chain assembly.\r\n * * The collector needs to search all prior paths at both start and end, and consider connection to both the start and end of each new primitive.\r\n * * The per-curve announcement is\r\n * * chainCollector.announceCurvePrimitive (curve, searchAllPaths).\r\n * * When all curves have been announced, the call to grab the paths option\r\n * * formLoopsIfClosed\r\n * * If true, convert closed paths to `Loop`, open paths to `Path`\r\n * * If false, convert all paths (open or not) to `Path`\r\n * * Usage pattern is\r\n * * initialization: `context = new ChainCollectorContext (makeClones: boolean)`\r\n * * many times: ` context.announceCurvePrimitive (primitive, searchAllPaths)`\r\n * * end: ` result = context.grabResults (formLoopsIfClosed)`\r\n * @internal\r\n */\r\nexport class ChainCollectorContext {\r\n private _chains: CurvePrimitive[][];\r\n private _makeClones: boolean;\r\n\r\n private static _staticPointA: Point3d;\r\n private static _staticPointB: Point3d;\r\n\r\n /**\r\n * Push a new chain with an optional first primitive.\r\n */\r\n private pushNewChain(primitive?: CurvePrimitive) {\r\n const chain = [];\r\n if (primitive)\r\n chain.push(primitive);\r\n this._chains.push(chain);\r\n }\r\n private findOrCreateTailChain(): CurvePrimitive[] {\r\n if (this._chains.length === 0)\r\n this.pushNewChain();\r\n return this._chains[this._chains.length - 1];\r\n }\r\n private _xyzWork0?: Point3d;\r\n private findAnyChainToConnect(xyz: Point3d): { chainIndex: number, atEnd: boolean } | undefined {\r\n\r\n for (let chainIndexA = 0; chainIndexA < this._chains.length; chainIndexA++) {\r\n const path = this._chains[chainIndexA];\r\n this._xyzWork1 = path[path.length - 1].endPoint(this._xyzWork1);\r\n if (this._xyzWork1.isAlmostEqual(xyz))\r\n return { chainIndex: chainIndexA, atEnd: true };\r\n this._xyzWork1 = path[0].startPoint(this._xyzWork1);\r\n if (this._xyzWork1.isAlmostEqual(xyz))\r\n return { chainIndex: chainIndexA, atEnd: false };\r\n }\r\n return undefined;\r\n }\r\n\r\n /** Initialize with an empty array of chains.\r\n * @param makeClones if true, all CurvePrimitives sent to `announceCurvePrimitive` is immediately cloned. If false, the reference to the original curve is maintained.\r\n */\r\n public constructor(makeClones: boolean) {\r\n this._chains = [];\r\n this._makeClones = makeClones;\r\n }\r\n\r\n private _xyzWork1?: Point3d;\r\n\r\n /** Announce a curve primitive\r\n * * searchAllChains controls the extent of search for connecting points.\r\n * * false ==> only consider connection to most recent chain.\r\n * * true ==> search for any connection, reversing direction as needed.\r\n * * Otherwise start a new chain.\r\n */\r\n public announceCurvePrimitive(candidate: CurvePrimitive, searchAllChains: boolean = false) {\r\n if (candidate) {\r\n if (this._makeClones) {\r\n const candidate1 = candidate.clone();\r\n if (!candidate1 || !(candidate1 instanceof CurvePrimitive))\r\n return;\r\n this.transferMarkup(candidate, candidate1);\r\n candidate = candidate1;\r\n }\r\n if (!searchAllChains) {\r\n const activeChain = this.findOrCreateTailChain();\r\n if (activeChain.length === 0 || !ChainCollectorContext.needBreakBetweenPrimitives(activeChain[activeChain.length - 1], candidate))\r\n activeChain.push(candidate);\r\n else\r\n this.pushNewChain(candidate);\r\n } else {\r\n this._xyzWork0 = candidate.startPoint(this._xyzWork0);\r\n let connect = this.findAnyChainToConnect(this._xyzWork0);\r\n if (connect) {\r\n if (connect.atEnd) {\r\n this._chains[connect.chainIndex].push(candidate);\r\n } else {\r\n candidate.reverseInPlace();\r\n this._chains[connect.chainIndex].splice(0, 0, candidate);\r\n }\r\n } else {\r\n this._xyzWork0 = candidate.endPoint(this._xyzWork0);\r\n connect = this.findAnyChainToConnect(this._xyzWork0);\r\n if (connect) { // START of new primitive ..\r\n if (connect.atEnd) {\r\n candidate.reverseInPlace();\r\n this._chains[connect.chainIndex].push(candidate);\r\n } else {\r\n this._chains[connect.chainIndex].splice(0, 0, candidate);\r\n }\r\n } else {\r\n this._chains.push([candidate]);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n /** Transfer markup (e.g. startCut, endCut) from source to destination */\r\n private transferMarkup(source: CurvePrimitive, dest: CurvePrimitive) {\r\n if (source && dest) {\r\n dest.startCut = source.startCut;\r\n dest.endCut = source.endCut;\r\n }\r\n }\r\n /** turn an array of curve primitives into the simplest possible strongly typed curve structure.\r\n * * The input array is assumed to be connected appropriately to act as the curves of a Path.\r\n * * When a path is created the curves array is CAPTURED.\r\n */\r\n private promoteArrayToCurves(curves: CurvePrimitive[], makeLoopIfClosed: boolean): CurvePrimitive | Path | Loop | undefined {\r\n if (curves.length === 0)\r\n return undefined;\r\n if (makeLoopIfClosed) {\r\n ChainCollectorContext._staticPointA = curves[0].startPoint(ChainCollectorContext._staticPointA);\r\n ChainCollectorContext._staticPointB = curves[curves.length - 1].endPoint(ChainCollectorContext._staticPointB);\r\n if (ChainCollectorContext._staticPointA.isAlmostEqual(ChainCollectorContext._staticPointB))\r\n return Loop.createArray(curves);\r\n }\r\n if (curves.length === 1)\r\n return curves[0];\r\n return Path.createArray(curves);\r\n }\r\n /** Return the collected results, structured as the simplest possible type. */\r\n public grabResult(makeLoopIfClosed: boolean = false): CurvePrimitive | Path | BagOfCurves | Loop | undefined {\r\n const chains = this._chains;\r\n if (chains.length === 0)\r\n return undefined;\r\n if (chains.length === 1)\r\n return this.promoteArrayToCurves(chains[0], makeLoopIfClosed);\r\n const bag = BagOfCurves.create();\r\n for (const chain of chains) {\r\n const q = this.promoteArrayToCurves(chain, makeLoopIfClosed);\r\n bag.tryAddChild(q);\r\n }\r\n return bag;\r\n }\r\n /** test if there is a break between primitiveA and primitiveB, due to any condition such as\r\n * * primitiveA.endCut\r\n * * primitiveB.startCut\r\n * * physical gap between primitives.\r\n */\r\n public static needBreakBetweenPrimitives(primitiveA: CurvePrimitive | undefined, primitiveB: CurvePrimitive | undefined, isXYOnly: boolean = false): boolean {\r\n if (primitiveA === undefined)\r\n return true;\r\n if (primitiveB === undefined)\r\n return true;\r\n if (primitiveA.endCut !== undefined)\r\n return true;\r\n if (primitiveB.startCut !== undefined)\r\n return true;\r\n ChainCollectorContext._staticPointA = primitiveA.endPoint(ChainCollectorContext._staticPointA);\r\n ChainCollectorContext._staticPointB = primitiveB.startPoint(ChainCollectorContext._staticPointB);\r\n return isXYOnly\r\n ? !ChainCollectorContext._staticPointA.isAlmostEqualXY(ChainCollectorContext._staticPointB)\r\n : !ChainCollectorContext._staticPointA.isAlmostEqual(ChainCollectorContext._staticPointB);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ChainCollectorContext.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/ChainCollectorContext.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAM/F,wDAAiD;AACjD,sDAAmD;AACnD,kCAA+B;AAC/B,kCAA+B;AAE/B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,qBAAqB;IACxB,OAAO,CAAqB;IAC5B,WAAW,CAAU;IAErB,MAAM,CAAC,aAAa,CAAU;IAC9B,MAAM,CAAC,aAAa,CAAU;IAEtC;;OAEG;IACK,YAAY,CAAC,SAA0B;QAC7C,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,IAAI,SAAS;YACX,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IACO,qBAAqB;QAC3B,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;YAC3B,IAAI,CAAC,YAAY,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/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Q;YACb,CAAC,CAAC,CAAC,qBAAqB,CAAC,aAAa,CAAC,eAAe,CAAC,qBAAqB,CAAC,aAAa,CAAC;YAC3F,CAAC,CAAC,CAAC,qBAAqB,CAAC,aAAa,CAAC,aAAa,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC9F,CAAC;CACF;AAxJD,sDAwJC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\nimport { BagOfCurves } from \"../CurveCollection\";\nimport { CurvePrimitive } from \"../CurvePrimitive\";\nimport { Loop } from \"../Loop\";\nimport { Path } from \"../Path\";\n\n/**\n * Manage a growing array of arrays of curve primitives that are to be joined \"head to tail\" in paths.\n * * The caller makes a sequence of calls to announce individual primitives.\n * * The collector has 2 use cases in mind, controlled by `searchAllPaths` flag on `chainCollectorContext.announceCurvePrimitive`\n * * (a) \"simple chains\" -- the caller has the curve primitives in order and just needs to have them monitored for coordinate breaks that indicate transition to a new chain.\n * * The collector needs to watch for connection to the most recent path but not search for prior paths to join to instead.\n * * (b) \"mixed\" primitives -- primitive order is NOT significant for chain assembly.\n * * The collector needs to search all prior paths at both start and end, and consider connection to both the start and end of each new primitive.\n * * The per-curve announcement is\n * * chainCollector.announceCurvePrimitive (curve, searchAllPaths).\n * * When all curves have been announced, the call to grab the paths option\n * * formLoopsIfClosed\n * * If true, convert closed paths to `Loop`, open paths to `Path`\n * * If false, convert all paths (open or not) to `Path`\n * * Usage pattern is\n * * initialization: `context = new ChainCollectorContext (makeClones: boolean)`\n * * many times: ` context.announceCurvePrimitive (primitive, searchAllPaths)`\n * * end: ` result = context.grabResults (formLoopsIfClosed)`\n * @internal\n */\nexport class ChainCollectorContext {\n private _chains: CurvePrimitive[][];\n private _makeClones: boolean;\n\n private static _staticPointA: Point3d;\n private static _staticPointB: Point3d;\n\n /**\n * Push a new chain with an optional first primitive.\n */\n private pushNewChain(primitive?: CurvePrimitive) {\n const chain = [];\n if (primitive)\n chain.push(primitive);\n this._chains.push(chain);\n }\n private findOrCreateTailChain(): CurvePrimitive[] {\n if (this._chains.length === 0)\n this.pushNewChain();\n return this._chains[this._chains.length - 1];\n }\n private _xyzWork0?: Point3d;\n private findAnyChainToConnect(xyz: Point3d): { chainIndex: number, atEnd: boolean } | undefined {\n\n for (let chainIndexA = 0; chainIndexA < this._chains.length; chainIndexA++) {\n const path = this._chains[chainIndexA];\n this._xyzWork1 = path[path.length - 1].endPoint(this._xyzWork1);\n if (this._xyzWork1.isAlmostEqual(xyz))\n return { chainIndex: chainIndexA, atEnd: true };\n this._xyzWork1 = path[0].startPoint(this._xyzWork1);\n if (this._xyzWork1.isAlmostEqual(xyz))\n return { chainIndex: chainIndexA, atEnd: false };\n }\n return undefined;\n }\n\n /** Initialize with an empty array of chains.\n * @param makeClones if true, all CurvePrimitives sent to `announceCurvePrimitive` is immediately cloned. If false, the reference to the original curve is maintained.\n */\n public constructor(makeClones: boolean) {\n this._chains = [];\n this._makeClones = makeClones;\n }\n\n private _xyzWork1?: Point3d;\n\n /** Announce a curve primitive\n * * searchAllChains controls the extent of search for connecting points.\n * * false ==> only consider connection to most recent chain.\n * * true ==> search for any connection, reversing direction as needed.\n * * Otherwise start a new chain.\n */\n public announceCurvePrimitive(candidate: CurvePrimitive, searchAllChains: boolean = false) {\n if (candidate) {\n if (this._makeClones) {\n const candidate1 = candidate.clone();\n if (!candidate1 || !(candidate1 instanceof CurvePrimitive))\n return;\n this.transferMarkup(candidate, candidate1);\n candidate = candidate1;\n }\n if (!searchAllChains) {\n const activeChain = this.findOrCreateTailChain();\n if (activeChain.length === 0 || !ChainCollectorContext.needBreakBetweenPrimitives(activeChain[activeChain.length - 1], candidate))\n activeChain.push(candidate);\n else\n this.pushNewChain(candidate);\n } else {\n this._xyzWork0 = candidate.startPoint(this._xyzWork0);\n let connect = this.findAnyChainToConnect(this._xyzWork0);\n if (connect) {\n if (connect.atEnd) {\n this._chains[connect.chainIndex].push(candidate);\n } else {\n candidate.reverseInPlace();\n this._chains[connect.chainIndex].splice(0, 0, candidate);\n }\n } else {\n this._xyzWork0 = candidate.endPoint(this._xyzWork0);\n connect = this.findAnyChainToConnect(this._xyzWork0);\n if (connect) { // START of new primitive ..\n if (connect.atEnd) {\n candidate.reverseInPlace();\n this._chains[connect.chainIndex].push(candidate);\n } else {\n this._chains[connect.chainIndex].splice(0, 0, candidate);\n }\n } else {\n this._chains.push([candidate]);\n }\n }\n }\n }\n }\n /** Transfer markup (e.g. startCut, endCut) from source to destination */\n private transferMarkup(source: CurvePrimitive, dest: CurvePrimitive) {\n if (source && dest) {\n dest.startCut = source.startCut;\n dest.endCut = source.endCut;\n }\n }\n /** turn an array of curve primitives into the simplest possible strongly typed curve structure.\n * * The input array is assumed to be connected appropriately to act as the curves of a Path.\n * * When a path is created the curves array is CAPTURED.\n */\n private promoteArrayToCurves(curves: CurvePrimitive[], makeLoopIfClosed: boolean): CurvePrimitive | Path | Loop | undefined {\n if (curves.length === 0)\n return undefined;\n if (makeLoopIfClosed) {\n ChainCollectorContext._staticPointA = curves[0].startPoint(ChainCollectorContext._staticPointA);\n ChainCollectorContext._staticPointB = curves[curves.length - 1].endPoint(ChainCollectorContext._staticPointB);\n if (ChainCollectorContext._staticPointA.isAlmostEqual(ChainCollectorContext._staticPointB))\n return Loop.createArray(curves);\n }\n if (curves.length === 1)\n return curves[0];\n return Path.createArray(curves);\n }\n /** Return the collected results, structured as the simplest possible type. */\n public grabResult(makeLoopIfClosed: boolean = false): CurvePrimitive | Path | BagOfCurves | Loop | undefined {\n const chains = this._chains;\n if (chains.length === 0)\n return undefined;\n if (chains.length === 1)\n return this.promoteArrayToCurves(chains[0], makeLoopIfClosed);\n const bag = BagOfCurves.create();\n for (const chain of chains) {\n const q = this.promoteArrayToCurves(chain, makeLoopIfClosed);\n bag.tryAddChild(q);\n }\n return bag;\n }\n /** test if there is a break between primitiveA and primitiveB, due to any condition such as\n * * primitiveA.endCut\n * * primitiveB.startCut\n * * physical gap between primitives.\n */\n public static needBreakBetweenPrimitives(primitiveA: CurvePrimitive | undefined, primitiveB: CurvePrimitive | undefined, isXYOnly: boolean = false): boolean {\n if (primitiveA === undefined)\n return true;\n if (primitiveB === undefined)\n return true;\n if (primitiveA.endCut !== undefined)\n return true;\n if (primitiveB.startCut !== undefined)\n return true;\n ChainCollectorContext._staticPointA = primitiveA.endPoint(ChainCollectorContext._staticPointA);\n ChainCollectorContext._staticPointB = primitiveB.startPoint(ChainCollectorContext._staticPointB);\n return isXYOnly\n ? !ChainCollectorContext._staticPointA.isAlmostEqualXY(ChainCollectorContext._staticPointB)\n : !ChainCollectorContext._staticPointA.isAlmostEqual(ChainCollectorContext._staticPointB);\n }\n}\n"]}
|
|
@@ -16,6 +16,8 @@ const CurveProcessor_1 = require("../CurveProcessor");
|
|
|
16
16
|
* * for individual primitive, invoke doClone (protected) for direct clone; insert into parent
|
|
17
17
|
*/
|
|
18
18
|
class CloneCurvesContext extends CurveProcessor_1.RecursiveCurveProcessorWithStack {
|
|
19
|
+
_result;
|
|
20
|
+
_transform;
|
|
19
21
|
constructor(transform) {
|
|
20
22
|
super();
|
|
21
23
|
this._transform = transform;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloneCurvesContext.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/CloneCurvesContext.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAA8E;AAE9E,sDAAqE;AAErE;;;;GAIG;AACH,MAAa,kBAAmB,SAAQ,iDAAgC;
|
|
1
|
+
{"version":3,"file":"CloneCurvesContext.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/CloneCurvesContext.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAA8E;AAE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G,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAClC,IAAI,CAAC,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YACnD,IAAI,MAAM,YAAY,4BAAU,IAAI,MAAM,YAAY,6BAAW;gBAC/D,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;oBACrB,KAAK,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;wBACnB,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;oBACzB,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;gBACxB,CAAC;QACL,CAAC;IACH,CAAC;CACF;AA/CD,gDA+CC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { Transform } from \"../../geometry3d/Transform\";\nimport { BagOfCurves, CurveChain, CurveCollection } from \"../CurveCollection\";\nimport { CurvePrimitive } from \"../CurvePrimitive\";\nimport { RecursiveCurveProcessorWithStack } from \"../CurveProcessor\";\n\n/**\n * Algorithmic class for cloning curve collections.\n * * recurse through collection nodes, building image nodes as needed and inserting clones of children.\n * * for individual primitive, invoke doClone (protected) for direct clone; insert into parent\n */\nexport class CloneCurvesContext extends RecursiveCurveProcessorWithStack {\n protected _result: CurveCollection | undefined;\n private _transform: Transform | undefined;\n protected constructor(transform?: Transform) {\n super();\n this._transform = transform;\n this._result = undefined;\n }\n public static clone(target: CurveCollection, transform?: Transform): CurveCollection | undefined {\n const context = new CloneCurvesContext(transform);\n target.announceToCurveProcessor(context);\n return context._result;\n }\n public override enter(c: CurveCollection) {\n if (c instanceof CurveCollection)\n super.enter(c.cloneEmptyPeer());\n }\n public override leave(): CurveCollection | undefined {\n const result = super.leave();\n if (result) {\n if (this._stack.length === 0) // this should only happen once !!!\n this._result = result;\n else // push this result to top of stack.\n this._stack[this._stack.length - 1].tryAddChild(result);\n }\n return result;\n }\n // specialized clone methods override this (and allow announceCurvePrimitive to insert to parent)\n protected doClone(primitive: CurvePrimitive): CurvePrimitive | CurvePrimitive[] | undefined {\n if (this._transform)\n return primitive.cloneTransformed(this._transform);\n return primitive.clone();\n }\n public override announceCurvePrimitive(primitive: CurvePrimitive, _indexInParent: number): void {\n const c = this.doClone(primitive);\n if (c !== undefined && this._stack.length > 0) {\n const parent = this._stack[this._stack.length - 1];\n if (parent instanceof CurveChain || parent instanceof BagOfCurves)\n if (Array.isArray(c)) {\n for (const c1 of c) {\n parent.tryAddChild(c1);\n }\n } else {\n parent.tryAddChild(c);\n }\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloneWithExpandedLineStrings.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/CloneWithExpandedLineStrings.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAQ/F,oDAAiD;AACjD,kDAA+C;AAC/C,6DAA0D;AAE1D;;;GAGG;AACH,MAAa,4BAA6B,SAAQ,uCAAkB;IAClE;QACE,4BAA4B;QAC5B,KAAK,CAAC,SAAS,CAAC,CAAC;IACnB,CAAC;IACD,mCAAmC;IAChB,OAAO,CAAC,SAAyB;QAClD,IAAI,SAAS,YAAY,2BAAY,IAAI,SAAS,CAAC,SAAS,EAAE,GAAG,CAAC,EAAE,CAAC;YACnE,MAAM,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;YAC5C,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC;YAC9B,MAAM,QAAQ,GAAG,EAAE,CAAC;YACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC/B,QAAQ,CAAC,IAAI,CAAC,6BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,+BAA+B,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,+BAA+B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACnJ,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,OAAO,SAAS,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IACM,MAAM,CAAU,KAAK,CAAC,MAAuB;QAClD,MAAM,OAAO,GAAG,IAAI,4BAA4B,EAAE,CAAC;QACnD,MAAM,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QACzC,OAAO,OAAO,CAAC,OAA0B,CAAC;IAC5C,CAAC;CACF;AAvBD,oEAuBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"CloneWithExpandedLineStrings.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/CloneWithExpandedLineStrings.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAQ/F,oDAAiD;AACjD,kDAA+C;AAC/C,6DAA0D;AAE1D;;;GAGG;AACH,MAAa,4BAA6B,SAAQ,uCAAkB;IAClE;QACE,4BAA4B;QAC5B,KAAK,CAAC,SAAS,CAAC,CAAC;IACnB,CAAC;IACD,mCAAmC;IAChB,OAAO,CAAC,SAAyB;QAClD,IAAI,SAAS,YAAY,2BAAY,IAAI,SAAS,CAAC,SAAS,EAAE,GAAG,CAAC,EAAE,CAAC;YACnE,MAAM,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;YAC5C,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC;YAC9B,MAAM,QAAQ,GAAG,EAAE,CAAC;YACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC/B,QAAQ,CAAC,IAAI,CAAC,6BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,+BAA+B,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,+BAA+B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACnJ,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,OAAO,SAAS,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IACM,MAAM,CAAU,KAAK,CAAC,MAAuB;QAClD,MAAM,OAAO,GAAG,IAAI,4BAA4B,EAAE,CAAC;QACnD,MAAM,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QACzC,OAAO,OAAO,CAAC,OAA0B,CAAC;IAC5C,CAAC;CACF;AAvBD,oEAuBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { CurveCollection } from \"../CurveCollection\";\nimport { CurvePrimitive } from \"../CurvePrimitive\";\nimport { LineSegment3d } from \"../LineSegment3d\";\nimport { LineString3d } from \"../LineString3d\";\nimport { CloneCurvesContext } from \"./CloneCurvesContext\";\n\n/**\n * Algorithmic class for cloning with linestrings expanded to line segments\n * @internal\n */\nexport class CloneWithExpandedLineStrings extends CloneCurvesContext {\n public constructor() {\n // we have no transform ....\n super(undefined);\n }\n // We know we have no transform !!!\n protected override doClone(primitive: CurvePrimitive): CurvePrimitive | CurvePrimitive[] {\n if (primitive instanceof LineString3d && primitive.numPoints() > 1) {\n const packedPoints = primitive.packedPoints;\n const n = packedPoints.length;\n const segments = [];\n for (let i = 0; i + 1 < n; i++) {\n segments.push(LineSegment3d.createCapture(packedPoints.getPoint3dAtUncheckedPointIndex(i), packedPoints.getPoint3dAtUncheckedPointIndex(i + 1)));\n }\n return segments;\n }\n return primitive.clone();\n }\n public static override clone(target: CurveCollection): CurveCollection {\n const context = new CloneWithExpandedLineStrings();\n target.announceToCurveProcessor(context);\n return context._result as CurveCollection;\n }\n}\n"]}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { IStrokeHandler } from "../../geometry3d/GeometryHandler";
|
|
5
5
|
import { Point3d, Vector3d } from "../../geometry3d/Point3dVector3d";
|
|
6
|
-
import { Ray3d } from "../../geometry3d/Ray3d";
|
|
7
6
|
import { VariantCurveExtendParameter } from "../CurveExtendMode";
|
|
8
7
|
import { CurveLocationDetail } from "../CurveLocationDetail";
|
|
9
8
|
import { CurvePrimitive } from "../CurvePrimitive";
|
|
@@ -19,13 +18,14 @@ export declare class ClosestPointStrokeHandler extends NewtonRtoRStrokeHandler i
|
|
|
19
18
|
private _extend;
|
|
20
19
|
private _fractionA;
|
|
21
20
|
private _functionA;
|
|
22
|
-
private _functionB;
|
|
23
21
|
private _fractionB;
|
|
22
|
+
private _functionB;
|
|
24
23
|
private _numThisCurve;
|
|
25
24
|
private _workPoint;
|
|
26
25
|
private _workRay;
|
|
27
26
|
private _newtonSolver;
|
|
28
|
-
|
|
27
|
+
/** Constructor */
|
|
28
|
+
constructor(spacePoint: Point3d, extend?: VariantCurveExtendParameter, result?: CurveLocationDetail);
|
|
29
29
|
claimResult(): CurveLocationDetail | undefined;
|
|
30
30
|
needPrimaryGeometryForStrokes(): boolean;
|
|
31
31
|
startCurvePrimitive(curve: CurvePrimitive | undefined): void;
|
|
@@ -33,11 +33,27 @@ export declare class ClosestPointStrokeHandler extends NewtonRtoRStrokeHandler i
|
|
|
33
33
|
announceIntervalForUniformStepStrokes(cp: CurvePrimitive, numStrokes: number, fraction0: number, fraction1: number): void;
|
|
34
34
|
private announceCandidate;
|
|
35
35
|
announceSegmentInterval(cp: CurvePrimitive, point0: Point3d, point1: Point3d, _numStrokes: number, fraction0: number, fraction1: number): void;
|
|
36
|
+
/**
|
|
37
|
+
* Given a function `f` and (unordered) fractions `a` and `b`, search for and announce a root of `f` in this
|
|
38
|
+
* fractional interval.
|
|
39
|
+
* * This method searches for a root of `f` if and only if the stroke segment defined by `(a, f(a))` and
|
|
40
|
+
* `(b, f(b))` has a root. This is a HEURISTIC: given continuous `f` between `a` and `b`, a root of the stroke
|
|
41
|
+
* segment implies a root of `f`, but not vice-versa. Therefore, if the strokes are not sufficiently dense,
|
|
42
|
+
* this method can miss a root of `f`.
|
|
43
|
+
*/
|
|
36
44
|
private searchInterval;
|
|
37
|
-
private evaluateB;
|
|
38
45
|
private announceSolutionFraction;
|
|
46
|
+
/**
|
|
47
|
+
* Evaluate the univariate real-valued function for which we are finding roots.
|
|
48
|
+
* * For finding the closest point to curve X from point Q, this function is `f(t) := Q-X(t) dot X'(t)`.
|
|
49
|
+
* * Either `pointAndDerivative` must be defined, or both `fraction` and `curve`.
|
|
50
|
+
* @param pointAndDerivative pre-evaluated curve
|
|
51
|
+
* @param fraction fraction at which to evaluate `curve`
|
|
52
|
+
* @param curve curve to evaluate at `fraction`
|
|
53
|
+
*/
|
|
54
|
+
private evaluateFunction;
|
|
39
55
|
evaluate(fraction: number): boolean;
|
|
40
|
-
announceRay
|
|
56
|
+
private announceRay;
|
|
41
57
|
announcePointTangent(point: Point3d, fraction: number, tangent: Vector3d): void;
|
|
42
58
|
}
|
|
43
59
|
//# sourceMappingURL=ClosestPointStrokeHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClosestPointStrokeHandler.d.ts","sourceRoot":"","sources":["../../../../src/curve/internalContexts/ClosestPointStrokeHandler.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"ClosestPointStrokeHandler.d.ts","sourceRoot":"","sources":["../../../../src/curve/internalContexts/ClosestPointStrokeH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