@itwin/core-geometry 5.2.0-dev.8 → 5.3.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -1
- package/lib/cjs/Geometry.d.ts +30 -10
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +74 -10
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/AkimaCurve3d.d.ts +19 -6
- package/lib/cjs/bspline/AkimaCurve3d.d.ts.map +1 -1
- package/lib/cjs/bspline/AkimaCurve3d.js +21 -5
- package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts +3 -3
- package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +6 -6
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.js +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.d.ts +2 -2
- package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.js +4 -6
- package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.d.ts +27 -17
- package/lib/cjs/bspline/InterpolationCurve3d.d.ts.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js +17 -7
- package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +19 -6
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +17 -2
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.d.ts +14 -1
- package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +21 -3
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +14 -11
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +23 -16
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +20 -3
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +22 -5
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +27 -17
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +61 -35
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +1 -0
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +1 -0
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +8 -7
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveOps.d.ts +51 -1
- package/lib/cjs/curve/CurveOps.d.ts.map +1 -1
- package/lib/cjs/curve/CurveOps.js +97 -3
- package/lib/cjs/curve/CurveOps.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +4 -4
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +8 -8
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +3 -3
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +6 -2
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js +12 -7
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +9 -4
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +10 -5
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +2 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +4 -4
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js +21 -18
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +30 -50
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts +2 -2
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js +6 -2
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts +2 -2
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +6 -2
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts +5 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js +0 -3
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts +6 -2
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +12 -3
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.d.ts +2 -1
- package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js +14 -18
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts +18 -2
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +37 -4
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +1 -0
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.d.ts +8 -0
- package/lib/cjs/geometry3d/PointStreaming.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js +18 -2
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +18 -9
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +53 -26
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts +8 -2
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +10 -4
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts +14 -3
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +20 -4
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts +34 -32
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +28 -21
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.d.ts +16 -6
- package/lib/cjs/geometry3d/Ray2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.js +28 -4
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +3 -4
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +1 -1
- package/lib/cjs/geometry3d/Transform.js +1 -1
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.d.ts +12 -1
- package/lib/cjs/geometry3d/XYZProps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.js +17 -2
- package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.d.ts +16 -0
- package/lib/cjs/geometry4d/Matrix4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js +26 -0
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js +5 -9
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/SmallSystem.d.ts +13 -7
- package/lib/cjs/numerics/SmallSystem.d.ts.map +1 -1
- package/lib/cjs/numerics/SmallSystem.js +13 -7
- package/lib/cjs/numerics/SmallSystem.js.map +1 -1
- package/lib/cjs/polyface/Polyface.d.ts +1 -3
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +2 -6
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +25 -6
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +59 -8
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +2 -0
- package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +7 -3
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +8 -10
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts +8 -5
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js +8 -4
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts +3 -3
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +4 -2
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +9 -12
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.d.ts +8 -3
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js +13 -6
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/cjs/serialization/DeepCompare.js +1 -1
- package/lib/cjs/serialization/DeepCompare.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +2 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +2 -1
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts +38 -12
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +91 -23
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +5 -4
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js +6 -5
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts +20 -11
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js +43 -39
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/Merging.d.ts +7 -4
- package/lib/cjs/topology/Merging.d.ts.map +1 -1
- package/lib/cjs/topology/Merging.js +16 -11
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/Triangulation.d.ts +13 -11
- package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
- package/lib/cjs/topology/Triangulation.js +40 -36
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/cjs/topology/Voronoi.d.ts +195 -0
- package/lib/cjs/topology/Voronoi.d.ts.map +1 -0
- package/lib/cjs/topology/Voronoi.js +700 -0
- package/lib/cjs/topology/Voronoi.js.map +1 -0
- package/lib/cjs/topology/XYParitySearchContext.d.ts +1 -1
- package/lib/cjs/topology/XYParitySearchContext.d.ts.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
- package/lib/esm/Geometry.d.ts +30 -10
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +74 -10
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.d.ts +19 -6
- package/lib/esm/bspline/AkimaCurve3d.d.ts.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.js +21 -5
- package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts +3 -3
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +6 -6
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.d.ts +2 -2
- package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js +4 -6
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.d.ts +27 -17
- package/lib/esm/bspline/InterpolationCurve3d.d.ts.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.js +17 -7
- package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +19 -6
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +17 -2
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.d.ts +14 -1
- package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +21 -3
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +14 -11
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +23 -16
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +20 -3
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +22 -5
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +27 -17
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +61 -35
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +1 -0
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +1 -0
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +8 -7
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveOps.d.ts +51 -1
- package/lib/esm/curve/CurveOps.d.ts.map +1 -1
- package/lib/esm/curve/CurveOps.js +98 -4
- package/lib/esm/curve/CurveOps.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +4 -4
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +8 -8
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +3 -3
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts +6 -2
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js +12 -7
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +9 -4
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +10 -5
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +2 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +4 -4
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js +21 -18
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +30 -50
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts +2 -2
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js +6 -2
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts +2 -2
- package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js +6 -2
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts +5 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js +0 -3
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts +6 -2
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +12 -3
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.d.ts +2 -1
- package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js +14 -18
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +1 -1
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.d.ts +18 -2
- package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +37 -4
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +1 -0
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.d.ts +8 -0
- package/lib/esm/geometry3d/PointStreaming.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js +18 -2
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +18 -9
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +53 -26
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts +8 -2
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +10 -4
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts +14 -3
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +20 -4
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts +34 -32
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +28 -21
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.d.ts +16 -6
- package/lib/esm/geometry3d/Ray2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray2d.js +28 -4
- package/lib/esm/geometry3d/Ray2d.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +3 -4
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +1 -1
- package/lib/esm/geometry3d/Transform.js +1 -1
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/XYZProps.d.ts +12 -1
- package/lib/esm/geometry3d/XYZProps.d.ts.map +1 -1
- package/lib/esm/geometry3d/XYZProps.js +16 -1
- package/lib/esm/geometry3d/XYZProps.js.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.d.ts +16 -0
- package/lib/esm/geometry4d/Matrix4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js +26 -0
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js +5 -9
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/SmallSystem.d.ts +13 -7
- package/lib/esm/numerics/SmallSystem.d.ts.map +1 -1
- package/lib/esm/numerics/SmallSystem.js +13 -7
- package/lib/esm/numerics/SmallSystem.js.map +1 -1
- package/lib/esm/polyface/Polyface.d.ts +1 -3
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +2 -6
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +25 -6
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +59 -8
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +2 -0
- package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js +7 -3
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +8 -10
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts +8 -5
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js +8 -4
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts +3 -3
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +4 -2
- package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js +9 -12
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.d.ts +8 -3
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js +13 -6
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/esm/serialization/DeepCompare.js +1 -1
- package/lib/esm/serialization/DeepCompare.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +2 -1
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +2 -1
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +38 -12
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +92 -24
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +5 -4
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js +6 -5
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts +20 -11
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js +43 -39
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/Merging.d.ts +7 -4
- package/lib/esm/topology/Merging.d.ts.map +1 -1
- package/lib/esm/topology/Merging.js +17 -12
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/Triangulation.d.ts +13 -11
- package/lib/esm/topology/Triangulation.d.ts.map +1 -1
- package/lib/esm/topology/Triangulation.js +40 -36
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/lib/esm/topology/Voronoi.d.ts +195 -0
- package/lib/esm/topology/Voronoi.d.ts.map +1 -0
- package/lib/esm/topology/Voronoi.js +696 -0
- package/lib/esm/topology/Voronoi.js.map +1 -0
- package/lib/esm/topology/XYParitySearchContext.d.ts +1 -1
- package/lib/esm/topology/XYParitySearchContext.d.ts.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InterpolationCurve3d.d.ts","sourceRoot":"","sources":["../../../src/bspline/InterpolationCurve3d.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"InterpolationCurve3d.d.ts","sourceRoot":"","sources":["../../../src/bspline/InterpolationCurve3d.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,kCAAkC,EAAkB,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8HAA8H;IAC9H,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0JAA0J;IAC1J,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gMAAgM;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AAC,iCAAiC;WASlC,cAAc,CAAC,KAAK,EAAE,2BAA2B,GAAG,SAAS,EAAE,KAAK,EAAE,2BAA2B,GAAG,SAAS,GAAG,OAAO;IA6BrI,yEAAyE;IAClE,cAAc;CAStB;AAED;;;;;;GAMG;AACH,qBAAa,oBAAqB,SAAQ,UAAU;IAClD,SAAgB,kBAAkB,wBAAwB;IAC1D,OAAO,CAAC,QAAQ,CAA8B;IAC9C,0CAA0C;IAC1C,OAAO;IAIP,sFAAsF;IACtE,yBAAyB,CAAC,OAAO,EAAE,eAAe,GAAG,GAAG;IAMxE;;;;OAIG;WACW,MAAM,CAAC,OAAO,EAAE,2BAA2B,GAAG,yBAAyB,GAAG,oBAAoB,GAAG,SAAS;IASxH;;;OAGG;WACW,aAAa,CAAC,OAAO,EAAE,2BAA2B,GAAG,oBAAoB,GAAG,SAAS;IAMnG,uEAAuE;IAChE,yBAAyB,IAAI,YAAY;IAIhD;;;OAGG;IACI,MAAM,IAAI,GAAG;IAGpB,sFAAsF;IAC/E,UAAU,IAAI,yBAAyB;IAI9C,iCAAiC;IACjC,IAAW,OAAO,IAAI,2BAA2B,CAA0B;IAE3E;;;OAGG;IACI,cAAc,IAAI,IAAI;IAI7B;;OAEG;IACI,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO;IAWzD;;;;;;OAMG;IACa,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,kCAAkC,GAAG,OAAO;IAG/G,0BAA0B;IACV,KAAK,IAAI,oBAAoB;IAI7B,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;IAO5D,0DAA0D;IACnD,mBAAmB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;CAE1D"}
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.InterpolationCurve3d = exports.InterpolationCurve3dOptions = void 0;
|
|
11
|
-
const
|
|
11
|
+
const BSplineCurveOps_1 = require("../bspline/BSplineCurveOps");
|
|
12
|
+
const ProxyCurve_1 = require("../curve/ProxyCurve");
|
|
12
13
|
const Geometry_1 = require("../Geometry");
|
|
14
|
+
const Point3dVector3d_1 = require("../geometry3d/Point3dVector3d");
|
|
13
15
|
const PointHelpers_1 = require("../geometry3d/PointHelpers");
|
|
14
|
-
const ProxyCurve_1 = require("../curve/ProxyCurve");
|
|
15
|
-
const BSplineCurveOps_1 = require("../bspline/BSplineCurveOps");
|
|
16
16
|
const BSplineCurve_1 = require("./BSplineCurve");
|
|
17
17
|
/**
|
|
18
18
|
* fitPoints and end condition data for [[InterpolationCurve3d]]
|
|
@@ -196,13 +196,12 @@ exports.InterpolationCurve3dOptions = InterpolationCurve3dOptions;
|
|
|
196
196
|
class InterpolationCurve3d extends ProxyCurve_1.ProxyCurve {
|
|
197
197
|
curvePrimitiveType = "interpolationCurve";
|
|
198
198
|
_options;
|
|
199
|
-
/**
|
|
200
|
-
* CAPTURE properties and proxy curve.
|
|
201
|
-
*/
|
|
199
|
+
/** CAPTURE properties and proxy curve. */
|
|
202
200
|
constructor(properties, proxyCurve) {
|
|
203
201
|
super(proxyCurve);
|
|
204
202
|
this._options = properties;
|
|
205
203
|
}
|
|
204
|
+
/** Second step of double dispatch: call `handler.handleInterpolationCurve3d(this)` */
|
|
206
205
|
dispatchToGeometryHandler(handler) {
|
|
207
206
|
let result = handler.handleInterpolationCurve3d(this);
|
|
208
207
|
if (undefined === result) // if handler doesn't specialize on interpolation curves, default to proxy
|
|
@@ -224,7 +223,8 @@ class InterpolationCurve3d extends ProxyCurve_1.ProxyCurve {
|
|
|
224
223
|
}
|
|
225
224
|
return InterpolationCurve3d.createCapture(optionsCopy);
|
|
226
225
|
}
|
|
227
|
-
/**
|
|
226
|
+
/**
|
|
227
|
+
* Create an [[InterpolationCurve3d]]
|
|
228
228
|
* * The options object is captured into the new curve object (not copied)
|
|
229
229
|
*/
|
|
230
230
|
static createCapture(options) {
|
|
@@ -272,6 +272,16 @@ class InterpolationCurve3d extends ProxyCurve_1.ProxyCurve {
|
|
|
272
272
|
}
|
|
273
273
|
return proxyOk;
|
|
274
274
|
}
|
|
275
|
+
/**
|
|
276
|
+
* Find intervals of this CurvePrimitive that are interior to a clipper.
|
|
277
|
+
* * This implementation simply passes the call to the proxy curve.
|
|
278
|
+
* @param clipper clip structure (e.g. clip planes).
|
|
279
|
+
* @param announce (optional) function to be called announcing fractional intervals of the input curve.
|
|
280
|
+
* @returns true if any "in" segments are announced.
|
|
281
|
+
*/
|
|
282
|
+
announceClipIntervals(clipper, announce) {
|
|
283
|
+
return this._proxyCurve.announceClipIntervals(clipper, announce);
|
|
284
|
+
}
|
|
275
285
|
/** Return a deep clone */
|
|
276
286
|
clone() {
|
|
277
287
|
return new InterpolationCurve3d(this._options.clone(), this._proxyCurve.clone());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InterpolationCurve3d.js","sourceRoot":"","sources":["../../../src/bspline/InterpolationCurve3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,mEAAkE;AAClE,0CAAuC;AACvC,6DAA0D;AAC1D,oDAAiD;AAEjD,gEAA6D;AAC7D,iDAAgD;AAkChD;;;;;GAKG;AACH,MAAa,2BAA2B;IACtC;;;;OAIG;IACH,YAAmB,SAAqB,EAAE,KAAgB;QACxD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAEO,MAAM,CAAU;IAChB,OAAO,CAAW;IAClB,gBAAgB,CAAU;IAC1B,mBAAmB,CAAU;IAC7B,mBAAmB,CAAU;IAC7B,kBAAkB,CAAU;IAC5B,aAAa,CAAY;IACzB,WAAW,CAAY;IACvB,UAAU,CAAY;IACtB,MAAM,CAAY;IAE1B,0BAA0B;IAC1B,I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AI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE3E;;;OAGG;IACI,cAAc;QACnB,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC;QAClC,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC;IACjC,CAAC;IACD;;OAEG;IACI,mBAAmB,CAAC,SAAoB;QAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAChE,IAAI,OAAO,EAAE,CAAC;YACZ,SAAS,CAAC,2BAA2B,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAC/D,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY;gBAC5B,SAAS,CAAC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;YAC9D,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU;gBAC1B,SAAS,CAAC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,0BAA0B;IACV,KAAK;QACnB,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC;IACnF,CAAC;IAEe,aAAa,CAAC,KAAoB;QAChD,IAAI,KAAK,YAAY,oBAAoB,EAAE,CAAC;YAC1C,OAAO,2BAA2B,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;QACnF,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0DAA0D;IACnD,mBAAmB,CAAC,KAAoB,IAAa,OAAO,KAAK,YAAY,oBAAoB,CAAC,CAAC,CAAC;CAE5G;AAlGD,oDAkGC","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 Bspline\n */\n\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Geometry } from \"../Geometry\";\nimport { Point3dArray } from \"../geometry3d/PointHelpers\";\nimport { ProxyCurve } from \"../curve/ProxyCurve\";\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { BSplineCurveOps } from \"../bspline/BSplineCurveOps\";\nimport { BSplineCurve3d } from \"./BSplineCurve\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { XYZProps } from \"../geometry3d/XYZProps\";\n\n/**\n * fitPoints and end condition data for [[InterpolationCurve3d]]\n * * This is a \"json compatible\" version of [[InterpolationCurve3dOptions]]\n * @public\n */\nexport interface InterpolationCurve3dProps {\n /** order of the computed bspline (one more than degree) */\n order?: number;\n /** true if the B-spline construction should be periodic */\n closed?: boolean;\n /** if closed and no knots, compute chord length knots (1) or uniform knots (0). Chord length knots give best fit. */\n isChordLenKnots?: number;\n /** if !closed but first and last fitPoints are equal, pivot computed start/end tangent(s) so that they are colinear (1) or leave them be (0). */\n isColinearTangents?: number;\n /** if !closed and start/endTangent is given, set its magnitude to the first/last fit point chord length (1) or to the magnitude of the Bessel tangent (0). Bessel gives best fit. */\n isChordLenTangents?: number;\n /** if !closed and start/endTangent is absent, compute it using the natural end condition (1) or Bessel (0). Bessel gives best fit. */\n isNaturalTangents?: number;\n /** optional start tangent, pointing into curve. Magnitude is ignored. */\n startTangent?: XYZProps;\n /** optional end tangent, pointing into curve. Magnitude is ignored. */\n endTangent?: XYZProps;\n /** points that the curve must pass through */\n fitPoints: XYZProps[];\n /** parameters for curve fitting, one per fit point */\n knots?: number[];\n}\n\n/**\n * fitPoints and end condition data for [[InterpolationCurve3d]]\n * * This is a \"typed object\" version of the serializer-friendly [[InterpolationCurve3dProps]]\n * * Typical use cases rarely require all parameters, so the constructor does not itemize them as parameters.\n * @public\n */\nexport class InterpolationCurve3dOptions {\n /**\n * Constructor.\n * @param fitPoints points to CAPTURE\n * @param knots array to CAPTURE\n */\n public constructor(fitPoints?: Point3d[], knots?: number[]) {\n this._fitPoints = fitPoints ? fitPoints : [];\n this._knots = knots;\n }\n\n private _order?: number;\n private _closed?: boolean;\n private _isChordLenKnots?: number;\n private _isColinearTangents?: number;\n private _isChordLenTangents?: number;\n private _isNaturalTangents?: number;\n private _startTangent?: Vector3d;\n private _endTangent?: Vector3d;\n private _fitPoints: Point3d[];\n private _knots?: number[];\n\n /** `order` as property */\n public get order(): number { return Geometry.resolveNumber(this._order, 4); }\n public set order(val: number) { this._order = val; }\n /** `closed` as property */\n public get closed(): boolean { return Geometry.resolveValue(this._closed, false); }\n public set closed(val: boolean) { this._closed = val; }\n /** `isChordLenKnots` as property */\n public get isChordLenKnots(): number { return Geometry.resolveNumber(this._isChordLenKnots, 0); }\n public set isChordLenKnots(val: number) { this._isChordLenKnots = val; }\n /** `isColinearTangents` as property */\n public get isColinearTangents(): number { return Geometry.resolveNumber(this._isColinearTangents, 0); }\n public set isColinearTangents(val: number) { this._isColinearTangents = val; }\n /** `isChordLenTangents` as property */\n public get isChordLenTangents(): number { return Geometry.resolveNumber(this._isChordLenTangents, 0); }\n public set isChordLenTangents(val: number) { this._isChordLenTangents = val; }\n /** `isNaturalTangents` as property */\n public get isNaturalTangents(): number { return Geometry.resolveNumber(this._isNaturalTangents, 0); }\n public set isNaturalTangents(val: number) { this._isNaturalTangents = val; }\n /** access POSSIBLY UNDEFINED start tangent. Setter CAPTURES. */\n public get startTangent(): Vector3d | undefined { return this._startTangent; }\n public set startTangent(val: Vector3d | undefined) { this._startTangent = val; }\n /** access POSSIBLY UNDEFINED end tangent. Setter CAPTURES. */\n public get endTangent(): Vector3d | undefined { return this._endTangent; }\n public set endTangent(val: Vector3d | undefined) { this._endTangent = val; }\n /** access POINTER TO fit points. Setter CAPTURES. */\n public get fitPoints(): Point3d[] { return this._fitPoints; }\n public set fitPoints(val: Point3d[]) { this._fitPoints = val; }\n /** access POSSIBLY UNDEFINED knots array. Setter CAPTURES. */\n public get knots(): number[] | undefined { return this._knots; }\n public set knots(val: number[] | undefined) { this._knots = val; }\n\n /** One step setup of properties not named in constructor.\n * * CAPTURE pointers to tangents.\n * * OPTIONALLY downgrade \"0\" values to undefined.\n */\n public captureOptionalProps(\n order: number | undefined,\n closed: boolean | undefined,\n isChordLenKnots: number | undefined,\n isColinearTangents: number | undefined,\n isChordLenTangent: number | undefined,\n isNaturalTangents: number | undefined,\n startTangent: Vector3d | undefined,\n endTangent: Vector3d | undefined,\n ) {\n this._order = Geometry.resolveToUndefined(order, 0);\n this._closed = Geometry.resolveToUndefined(closed, false);\n this._isChordLenKnots = Geometry.resolveToUndefined(isChordLenKnots, 0);\n this._isColinearTangents = Geometry.resolveToUndefined(isColinearTangents, 0);\n this._isChordLenTangents = Geometry.resolveToUndefined(isChordLenTangent, 0);\n this._isNaturalTangents = Geometry.resolveToUndefined(isNaturalTangents, 0);\n this._startTangent = startTangent;\n this._endTangent = endTangent;\n\n }\n /** Clone with strongly typed members reduced to simple json, with \"undefined\" members omitted */\n public cloneAsInterpolationCurve3dProps(): InterpolationCurve3dProps {\n const props: InterpolationCurve3dProps = {\n fitPoints: Point3dArray.cloneDeepJSONNumberArrays(this.fitPoints),\n knots: this._knots?.slice(),\n };\n if (this._order !== undefined)\n props.order = this._order;\n if (this._closed !== undefined)\n props.closed = this._closed;\n if (this._isChordLenKnots !== undefined)\n props.isChordLenKnots = this._isChordLenKnots;\n if (this._isColinearTangents !== undefined)\n props.isColinearTangents = this._isColinearTangents;\n if (this._isChordLenTangents !== undefined)\n props.isChordLenTangents = this._isChordLenTangents;\n if (this._isNaturalTangents !== undefined)\n props.isNaturalTangents = this._isNaturalTangents;\n if (this._startTangent !== undefined)\n props.startTangent = this._startTangent?.toArray();\n if (this._endTangent !== undefined)\n props.endTangent = this._endTangent?.toArray();\n return props;\n }\n /** Clone with strongly typed members reduced to simple json. */\n public clone(): InterpolationCurve3dOptions {\n const clone = new InterpolationCurve3dOptions(Point3dArray.clonePoint3dArray(this.fitPoints), this.knots?.slice());\n clone._order = this.order;\n clone._closed = this.closed;\n clone._isChordLenKnots = this.isChordLenKnots;\n clone._isColinearTangents = this.isColinearTangents;\n clone._isChordLenTangents = this.isChordLenTangents;\n clone._isNaturalTangents = this.isNaturalTangents;\n clone._startTangent = this._startTangent?.clone();\n clone._endTangent = this._endTangent?.clone();\n return clone;\n }\n\n /** Clone with strongly typed members reduced to simple json. */\n public static create(source: InterpolationCurve3dProps): InterpolationCurve3dOptions {\n const result = new InterpolationCurve3dOptions(Point3dArray.clonePoint3dArray(source.fitPoints), source.knots?.slice());\n result._order = source.order;\n result._closed = source.closed;\n result._isChordLenKnots = source.isChordLenKnots;\n result._isColinearTangents = source.isColinearTangents;\n result._isChordLenTangents = source.isChordLenTangents;\n result._isNaturalTangents = source.isNaturalTangents;\n result._startTangent = source.startTangent ? Vector3d.fromJSON(source.startTangent) : undefined;\n result._endTangent = source.endTangent ? Vector3d.fromJSON(source.endTangent) : undefined;\n return result;\n }\n // ugh.\n // vector equality test with awkward rule that 000 matches undefined.\n private static areAlmostEqualAllow000AsUndefined(a: Vector3d | undefined, b: Vector3d | undefined): boolean {\n if (a !== undefined && a.maxAbs() === 0)\n a = undefined;\n if (b !== undefined && b.maxAbs() === 0)\n b = undefined;\n if (a !== undefined && b !== undefined)\n return a.isAlmostEqual(b);\n return a === undefined && b === undefined;\n }\n public static areAlmostEqual(dataA: InterpolationCurve3dOptions | undefined, dataB: InterpolationCurve3dOptions | undefined): boolean {\n if (dataA === undefined && dataB === undefined)\n return true;\n if (dataA !== undefined && dataB !== undefined) {\n if (Geometry.areEqualAllowUndefined(dataA.order, dataB.order)\n && Geometry.areEqualAllowUndefined(dataA.closed, dataB.closed)\n && Geometry.areEqualAllowUndefined(dataA.isChordLenKnots, dataB.isChordLenKnots)\n && Geometry.areEqualAllowUndefined(dataA.isColinearTangents, dataB.isColinearTangents)\n && Geometry.areEqualAllowUndefined(dataA.isNaturalTangents, dataB.isNaturalTangents)\n && this.areAlmostEqualAllow000AsUndefined(dataA.startTangent, dataB.startTangent)\n && this.areAlmostEqualAllow000AsUndefined(dataA.endTangent, dataB.endTangent)\n && Geometry.almostEqualArrays(dataA.fitPoints, dataB.fitPoints, (a: Point3d, b: Point3d) => a.isAlmostEqual(b))) {\n if (Geometry.almostEqualNumberArrays(dataA.knots, dataB.knots, (a: number, b: number) => a === b))\n return true;\n if (dataA.knots === undefined && dataB.knots === undefined)\n return true;\n /* alas .. need to allow tricky mismatch of end replication */\n let knotsA = dataA.knots, knotsB = dataB.knots;\n if (dataA.knots === undefined) // construct undefined knots to compare against defined knots\n knotsA = BSplineCurveOps.C2CubicFit.constructFitParametersFromPoints(dataA.fitPoints, dataA.isChordLenKnots, dataA.closed);\n else if (dataB.knots === undefined)\n knotsB = BSplineCurveOps.C2CubicFit.constructFitParametersFromPoints(dataB.fitPoints, dataB.isChordLenKnots, dataB.closed);\n knotsA = BSplineCurveOps.C2CubicFit.convertCubicKnotVectorToFitParams(knotsA, dataA.fitPoints.length, false);\n knotsB = BSplineCurveOps.C2CubicFit.convertCubicKnotVectorToFitParams(knotsB, dataB.fitPoints.length, false);\n return Geometry.almostEqualNumberArrays(knotsA, knotsB, (a: number, b: number) => Geometry.isAlmostEqualNumber(a, b));\n }\n }\n return false;\n }\n /** reverse the order or sense of all start-to-end related properties. */\n public reverseInPlace() {\n this.fitPoints.reverse();\n if (this.knots)\n this.knots.reverse();\n // Swap pointers to tangents. They don't need to be negated because they point into the curve.\n const oldStart = this._startTangent;\n this._startTangent = this.endTangent;\n this._endTangent = oldStart;\n }\n}\n\n/**\n * Interpolating curve.\n * * Derive from [[ProxyCurve]]\n * * Use a [[BSplineCurve3d]] as the proxy\n * *\n * @public\n */\nexport class InterpolationCurve3d extends ProxyCurve {\n public readonly curvePrimitiveType = \"interpolationCurve\";\n private _options: InterpolationCurve3dOptions;\n /**\n * CAPTURE properties and proxy curve.\n */\n private constructor(properties: InterpolationCurve3dOptions, proxyCurve: CurvePrimitive) {\n super(proxyCurve);\n this._options = properties;\n }\n\n public override dispatchToGeometryHandler(handler: GeometryHandler): any {\n let result = handler.handleInterpolationCurve3d(this);\n if (undefined === result) // if handler doesn't specialize on interpolation curves, default to proxy\n result = this._proxyCurve.dispatchToGeometryHandler(handler);\n return result;\n }\n /**\n * Create an [[InterpolationCurve3d]] based on points, knots, and other properties in the [[InterpolationCurve3dProps]] or [[InterpolationCurve3dOptions]].\n * * This saves a COPY OF the options or props.\n * * Use createCapture () if the options or props can be used without copy\n */\n public static create(options: InterpolationCurve3dOptions | InterpolationCurve3dProps): InterpolationCurve3d | undefined {\n let optionsCopy;\n if (options instanceof InterpolationCurve3dOptions) {\n optionsCopy = options.clone();\n } else {\n optionsCopy = InterpolationCurve3dOptions.create(options);\n }\n return InterpolationCurve3d.createCapture(optionsCopy);\n }\n /** Create an [[InterpolationCurve3d]]\n * * The options object is captured into the new curve object (not copied)\n */\n public static createCapture(options: InterpolationCurve3dOptions): InterpolationCurve3d | undefined {\n const proxyCurve = BSplineCurve3d.createFromInterpolationCurve3dOptions(options);\n if (proxyCurve)\n return new InterpolationCurve3d(options, proxyCurve);\n return undefined;\n }\n /** Return a (copy of) the defining points, packed as a Float64Array */\n public copyFitPointsFloat64Array(): Float64Array {\n return Point3dArray.cloneXYZPropsAsFloat64Array(this._options.fitPoints);\n }\n\n /**\n * Return json key-value pairs for for this [[InterpolationCurve3d]].\n * @returns\n */\n public toJSON(): any {\n return this._options.cloneAsInterpolationCurve3dProps();\n }\n /** Clone the [[InterpolationCurve3dProps]] object in this [[InterpolationCurve3d]] */\n public cloneProps(): InterpolationCurve3dProps {\n return this._options.cloneAsInterpolationCurve3dProps();\n }\n\n /** return the options pointer */\n public get options(): InterpolationCurve3dOptions { return this._options; }\n\n /**\n * Reverse the curve direction.\n * * This updates both the defining properties and the proxy bspline.\n */\n public reverseInPlace(): void {\n this._proxyCurve.reverseInPlace();\n this._options.reverseInPlace();\n }\n /**\n * Transform this [[InterpolationCurve3d]] and its defining data in place\n */\n public tryTransformInPlace(transform: Transform): boolean {\n const proxyOk = this._proxyCurve.tryTransformInPlace(transform);\n if (proxyOk) {\n transform.multiplyPoint3dArrayInPlace(this._options.fitPoints);\n if (this._options.startTangent)\n transform.multiplyVectorInPlace(this._options.startTangent);\n if (this._options.endTangent)\n transform.multiplyVectorInPlace(this._options.endTangent);\n }\n return proxyOk;\n }\n\n /** Return a deep clone */\n public override clone(): InterpolationCurve3d {\n return new InterpolationCurve3d(this._options.clone(), this._proxyCurve.clone());\n }\n\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof InterpolationCurve3d) {\n return InterpolationCurve3dOptions.areAlmostEqual(this._options, other._options);\n }\n return false;\n }\n\n /** Test if `other` is also an [[InterpolationCurve3d]] */\n public isSameGeometryClass(other: GeometryQuery): boolean { return other instanceof InterpolationCurve3d; }\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"InterpolationCurve3d.js","sourceRoot":"","sources":["../../../src/bspline/InterpolationCurve3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAA6D;AAI7D,oDAAiD;AACjD,0CAAuC;AAEvC,mEAAkE;AAClE,6DAA0D;AAG1D,iDAAgD;AA8BhD;;;;;GAKG;AACH,MAAa,2BAA2B;IACtC;;;;OAIG;IACH,YAAmB,SAAqB,EAAE,KAAgB;QACxD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAEO,MAAM,CAAU;IAChB,OAAO,CAAW;IAClB,gBAAgB,CAAU;IAC1B,mBAAmB,CAAU;IA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C,OAAO,2BAA2B,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;QACnF,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0DAA0D;IACnD,mBAAmB,CAAC,KAAoB,IAAa,OAAO,KAAK,YAAY,oBAAoB,CAAC,CAAC,CAAC;CAE5G;AA1GD,oDA0GC","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 Bspline\n */\n\nimport { BSplineCurveOps } from \"../bspline/BSplineCurveOps\";\nimport { Clipper } from \"../clipping/ClipUtils\";\nimport { AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { ProxyCurve } from \"../curve/ProxyCurve\";\nimport { Geometry } from \"../Geometry\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Point3dArray } from \"../geometry3d/PointHelpers\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { XYZProps } from \"../geometry3d/XYZProps\";\nimport { BSplineCurve3d } from \"./BSplineCurve\";\n\n/**\n * fitPoints and end condition data for [[InterpolationCurve3d]]\n * * This is a \"json compatible\" version of [[InterpolationCurve3dOptions]]\n * @public\n */\nexport interface InterpolationCurve3dProps {\n /** The order of the computed B-spline curve (one more than its degree). */\n order?: number;\n /** Whether the B-spline construction should be periodic. Default is `false`. */\n closed?: boolean;\n /** If closed and no knots, compute chord length knots (1) or uniform knots (0, default). Chord length knots give best fit. */\n isChordLenKnots?: number;\n /** If !closed but first and last fitPoints are equal, pivot computed start/end tangent(s) so that they are colinear (1) or leave them be (0, default). */\n isColinearTangents?: number;\n /** If !closed and start/endTangent is defined, set its magnitude to the first/last fit point chord length (1) or to the magnitude of the Bessel tangent (0, default). Bessel gives best fit. */\n isChordLenTangents?: number;\n /** If !closed and start/endTangent is `undefined`, compute it using the natural end condition (1) or Bessel (0, default). Bessel gives best fit. */\n isNaturalTangents?: number;\n /** Optional start tangent, pointing into curve. Magnitude is ignored. */\n startTangent?: XYZProps;\n /** Optional end tangent, pointing into curve. Magnitude is ignored. */\n endTangent?: XYZProps;\n /** Points that the curve must pass through. */\n fitPoints: XYZProps[];\n /** Optional parameters for curve fitting, one per fit point. If `undefined`, knots are computed. */\n knots?: number[];\n}\n\n/**\n * fitPoints and end condition data for [[InterpolationCurve3d]]\n * * This is a \"typed object\" version of the serializer-friendly [[InterpolationCurve3dProps]]\n * * Typical use cases rarely require all parameters, so the constructor does not itemize them as parameters.\n * @public\n */\nexport class InterpolationCurve3dOptions {\n /**\n * Constructor.\n * @param fitPoints points to CAPTURE\n * @param knots array to CAPTURE\n */\n public constructor(fitPoints?: Point3d[], knots?: number[]) {\n this._fitPoints = fitPoints ? fitPoints : [];\n this._knots = knots;\n }\n\n private _order?: number;\n private _closed?: boolean;\n private _isChordLenKnots?: number;\n private _isColinearTangents?: number;\n private _isChordLenTangents?: number;\n private _isNaturalTangents?: number;\n private _startTangent?: Vector3d;\n private _endTangent?: Vector3d;\n private _fitPoints: Point3d[];\n private _knots?: number[];\n\n /** `order` as property */\n public get order(): number { return Geometry.resolveNumber(this._order, 4); }\n public set order(val: number) { this._order = val; }\n /** `closed` as property */\n public get closed(): boolean { return Geometry.resolveValue(this._closed, false); }\n public set closed(val: boolean) { this._closed = val; }\n /** `isChordLenKnots` as property */\n public get isChordLenKnots(): number { return Geometry.resolveNumber(this._isChordLenKnots, 0); }\n public set isChordLenKnots(val: number) { this._isChordLenKnots = val; }\n /** `isColinearTangents` as property */\n public get isColinearTangents(): number { return Geometry.resolveNumber(this._isColinearTangents, 0); }\n public set isColinearTangents(val: number) { this._isColinearTangents = val; }\n /** `isChordLenTangents` as property */\n public get isChordLenTangents(): number { return Geometry.resolveNumber(this._isChordLenTangents, 0); }\n public set isChordLenTangents(val: number) { this._isChordLenTangents = val; }\n /** `isNaturalTangents` as property */\n public get isNaturalTangents(): number { return Geometry.resolveNumber(this._isNaturalTangents, 0); }\n public set isNaturalTangents(val: number) { this._isNaturalTangents = val; }\n /** access POSSIBLY UNDEFINED start tangent. Setter CAPTURES. */\n public get startTangent(): Vector3d | undefined { return this._startTangent; }\n public set startTangent(val: Vector3d | undefined) { this._startTangent = val; }\n /** access POSSIBLY UNDEFINED end tangent. Setter CAPTURES. */\n public get endTangent(): Vector3d | undefined { return this._endTangent; }\n public set endTangent(val: Vector3d | undefined) { this._endTangent = val; }\n /** access POINTER TO fit points. Setter CAPTURES. */\n public get fitPoints(): Point3d[] { return this._fitPoints; }\n public set fitPoints(val: Point3d[]) { this._fitPoints = val; }\n /** access POSSIBLY UNDEFINED knots array. Setter CAPTURES. */\n public get knots(): number[] | undefined { return this._knots; }\n public set knots(val: number[] | undefined) { this._knots = val; }\n\n /** One step setup of properties not named in constructor.\n * * CAPTURE pointers to tangents.\n * * OPTIONALLY downgrade \"0\" values to undefined.\n */\n public captureOptionalProps(\n order: number | undefined,\n closed: boolean | undefined,\n isChordLenKnots: number | undefined,\n isColinearTangents: number | undefined,\n isChordLenTangent: number | undefined,\n isNaturalTangents: number | undefined,\n startTangent: Vector3d | undefined,\n endTangent: Vector3d | undefined,\n ) {\n this._order = Geometry.resolveToUndefined(order, 0);\n this._closed = Geometry.resolveToUndefined(closed, false);\n this._isChordLenKnots = Geometry.resolveToUndefined(isChordLenKnots, 0);\n this._isColinearTangents = Geometry.resolveToUndefined(isColinearTangents, 0);\n this._isChordLenTangents = Geometry.resolveToUndefined(isChordLenTangent, 0);\n this._isNaturalTangents = Geometry.resolveToUndefined(isNaturalTangents, 0);\n this._startTangent = startTangent;\n this._endTangent = endTangent;\n\n }\n /** Clone with strongly typed members reduced to simple json, with \"undefined\" members omitted */\n public cloneAsInterpolationCurve3dProps(): InterpolationCurve3dProps {\n const props: InterpolationCurve3dProps = {\n fitPoints: Point3dArray.cloneDeepJSONNumberArrays(this.fitPoints),\n knots: this._knots?.slice(),\n };\n if (this._order !== undefined)\n props.order = this._order;\n if (this._closed !== undefined)\n props.closed = this._closed;\n if (this._isChordLenKnots !== undefined)\n props.isChordLenKnots = this._isChordLenKnots;\n if (this._isColinearTangents !== undefined)\n props.isColinearTangents = this._isColinearTangents;\n if (this._isChordLenTangents !== undefined)\n props.isChordLenTangents = this._isChordLenTangents;\n if (this._isNaturalTangents !== undefined)\n props.isNaturalTangents = this._isNaturalTangents;\n if (this._startTangent !== undefined)\n props.startTangent = this._startTangent?.toArray();\n if (this._endTangent !== undefined)\n props.endTangent = this._endTangent?.toArray();\n return props;\n }\n /** Clone with strongly typed members reduced to simple json. */\n public clone(): InterpolationCurve3dOptions {\n const clone = new InterpolationCurve3dOptions(Point3dArray.clonePoint3dArray(this.fitPoints), this.knots?.slice());\n clone._order = this.order;\n clone._closed = this.closed;\n clone._isChordLenKnots = this.isChordLenKnots;\n clone._isColinearTangents = this.isColinearTangents;\n clone._isChordLenTangents = this.isChordLenTangents;\n clone._isNaturalTangents = this.isNaturalTangents;\n clone._startTangent = this._startTangent?.clone();\n clone._endTangent = this._endTangent?.clone();\n return clone;\n }\n\n /** Clone with strongly typed members reduced to simple json. */\n public static create(source: InterpolationCurve3dProps): InterpolationCurve3dOptions {\n const result = new InterpolationCurve3dOptions(Point3dArray.clonePoint3dArray(source.fitPoints), source.knots?.slice());\n result._order = source.order;\n result._closed = source.closed;\n result._isChordLenKnots = source.isChordLenKnots;\n result._isColinearTangents = source.isColinearTangents;\n result._isChordLenTangents = source.isChordLenTangents;\n result._isNaturalTangents = source.isNaturalTangents;\n result._startTangent = source.startTangent ? Vector3d.fromJSON(source.startTangent) : undefined;\n result._endTangent = source.endTangent ? Vector3d.fromJSON(source.endTangent) : undefined;\n return result;\n }\n // ugh.\n // vector equality test with awkward rule that 000 matches undefined.\n private static areAlmostEqualAllow000AsUndefined(a: Vector3d | undefined, b: Vector3d | undefined): boolean {\n if (a !== undefined && a.maxAbs() === 0)\n a = undefined;\n if (b !== undefined && b.maxAbs() === 0)\n b = undefined;\n if (a !== undefined && b !== undefined)\n return a.isAlmostEqual(b);\n return a === undefined && b === undefined;\n }\n public static areAlmostEqual(dataA: InterpolationCurve3dOptions | undefined, dataB: InterpolationCurve3dOptions | undefined): boolean {\n if (dataA === undefined && dataB === undefined)\n return true;\n if (dataA !== undefined && dataB !== undefined) {\n if (Geometry.areEqualAllowUndefined(dataA.order, dataB.order)\n && Geometry.areEqualAllowUndefined(dataA.closed, dataB.closed)\n && Geometry.areEqualAllowUndefined(dataA.isChordLenKnots, dataB.isChordLenKnots)\n && Geometry.areEqualAllowUndefined(dataA.isColinearTangents, dataB.isColinearTangents)\n && Geometry.areEqualAllowUndefined(dataA.isNaturalTangents, dataB.isNaturalTangents)\n && this.areAlmostEqualAllow000AsUndefined(dataA.startTangent, dataB.startTangent)\n && this.areAlmostEqualAllow000AsUndefined(dataA.endTangent, dataB.endTangent)\n && Geometry.almostEqualArrays(dataA.fitPoints, dataB.fitPoints, (a: Point3d, b: Point3d) => a.isAlmostEqual(b))) {\n if (Geometry.almostEqualNumberArrays(dataA.knots, dataB.knots, (a: number, b: number) => a === b))\n return true;\n if (dataA.knots === undefined && dataB.knots === undefined)\n return true;\n /* alas .. need to allow tricky mismatch of end replication */\n let knotsA = dataA.knots, knotsB = dataB.knots;\n if (dataA.knots === undefined) // construct undefined knots to compare against defined knots\n knotsA = BSplineCurveOps.C2CubicFit.constructFitParametersFromPoints(dataA.fitPoints, dataA.isChordLenKnots, dataA.closed);\n else if (dataB.knots === undefined)\n knotsB = BSplineCurveOps.C2CubicFit.constructFitParametersFromPoints(dataB.fitPoints, dataB.isChordLenKnots, dataB.closed);\n knotsA = BSplineCurveOps.C2CubicFit.convertCubicKnotVectorToFitParams(knotsA, dataA.fitPoints.length, false);\n knotsB = BSplineCurveOps.C2CubicFit.convertCubicKnotVectorToFitParams(knotsB, dataB.fitPoints.length, false);\n return Geometry.almostEqualNumberArrays(knotsA, knotsB, (a: number, b: number) => Geometry.isAlmostEqualNumber(a, b));\n }\n }\n return false;\n }\n /** reverse the order or sense of all start-to-end related properties. */\n public reverseInPlace() {\n this.fitPoints.reverse();\n if (this.knots)\n this.knots.reverse();\n // Swap pointers to tangents. They don't need to be negated because they point into the curve.\n const oldStart = this._startTangent;\n this._startTangent = this.endTangent;\n this._endTangent = oldStart;\n }\n}\n\n/**\n * Interpolating curve.\n * * Derive from [[ProxyCurve]]\n * * Use a [[BSplineCurve3d]] as the proxy\n * *\n * @public\n */\nexport class InterpolationCurve3d extends ProxyCurve {\n public readonly curvePrimitiveType = \"interpolationCurve\";\n private _options: InterpolationCurve3dOptions;\n /** CAPTURE properties and proxy curve. */\n private constructor(properties: InterpolationCurve3dOptions, proxyCurve: CurvePrimitive) {\n super(proxyCurve);\n this._options = properties;\n }\n /** Second step of double dispatch: call `handler.handleInterpolationCurve3d(this)` */\n public override dispatchToGeometryHandler(handler: GeometryHandler): any {\n let result = handler.handleInterpolationCurve3d(this);\n if (undefined === result) // if handler doesn't specialize on interpolation curves, default to proxy\n result = this._proxyCurve.dispatchToGeometryHandler(handler);\n return result;\n }\n /**\n * Create an [[InterpolationCurve3d]] based on points, knots, and other properties in the [[InterpolationCurve3dProps]] or [[InterpolationCurve3dOptions]].\n * * This saves a COPY OF the options or props.\n * * Use createCapture () if the options or props can be used without copy\n */\n public static create(options: InterpolationCurve3dOptions | InterpolationCurve3dProps): InterpolationCurve3d | undefined {\n let optionsCopy;\n if (options instanceof InterpolationCurve3dOptions) {\n optionsCopy = options.clone();\n } else {\n optionsCopy = InterpolationCurve3dOptions.create(options);\n }\n return InterpolationCurve3d.createCapture(optionsCopy);\n }\n /**\n * Create an [[InterpolationCurve3d]]\n * * The options object is captured into the new curve object (not copied)\n */\n public static createCapture(options: InterpolationCurve3dOptions): InterpolationCurve3d | undefined {\n const proxyCurve = BSplineCurve3d.createFromInterpolationCurve3dOptions(options);\n if (proxyCurve)\n return new InterpolationCurve3d(options, proxyCurve);\n return undefined;\n }\n /** Return a (copy of) the defining points, packed as a Float64Array */\n public copyFitPointsFloat64Array(): Float64Array {\n return Point3dArray.cloneXYZPropsAsFloat64Array(this._options.fitPoints);\n }\n\n /**\n * Return json key-value pairs for for this [[InterpolationCurve3d]].\n * @returns\n */\n public toJSON(): any {\n return this._options.cloneAsInterpolationCurve3dProps();\n }\n /** Clone the [[InterpolationCurve3dProps]] object in this [[InterpolationCurve3d]] */\n public cloneProps(): InterpolationCurve3dProps {\n return this._options.cloneAsInterpolationCurve3dProps();\n }\n\n /** return the options pointer */\n public get options(): InterpolationCurve3dOptions { return this._options; }\n\n /**\n * Reverse the curve direction.\n * * This updates both the defining properties and the proxy bspline.\n */\n public reverseInPlace(): void {\n this._proxyCurve.reverseInPlace();\n this._options.reverseInPlace();\n }\n /**\n * Transform this [[InterpolationCurve3d]] and its defining data in place\n */\n public tryTransformInPlace(transform: Transform): boolean {\n const proxyOk = this._proxyCurve.tryTransformInPlace(transform);\n if (proxyOk) {\n transform.multiplyPoint3dArrayInPlace(this._options.fitPoints);\n if (this._options.startTangent)\n transform.multiplyVectorInPlace(this._options.startTangent);\n if (this._options.endTangent)\n transform.multiplyVectorInPlace(this._options.endTangent);\n }\n return proxyOk;\n }\n /**\n * Find intervals of this CurvePrimitive that are interior to a clipper.\n * * This implementation simply passes the call to the proxy curve.\n * @param clipper clip structure (e.g. clip planes).\n * @param announce (optional) function to be called announcing fractional intervals of the input curve.\n * @returns true if any \"in\" segments are announced.\n */\n public override announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n return this._proxyCurve.announceClipIntervals(clipper, announce);\n }\n /** Return a deep clone */\n public override clone(): InterpolationCurve3d {\n return new InterpolationCurve3d(this._options.clone(), this._proxyCurve.clone());\n }\n\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof InterpolationCurve3d) {\n return InterpolationCurve3dOptions.areAlmostEqual(this._options, other._options);\n }\n return false;\n }\n\n /** Test if `other` is also an [[InterpolationCurve3d]] */\n public isSameGeometryClass(other: GeometryQuery): boolean { return other instanceof InterpolationCurve3d; }\n\n}\n"]}
|
|
@@ -13,7 +13,7 @@ import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d";
|
|
|
13
13
|
import { Range3d } from "../geometry3d/Range";
|
|
14
14
|
import { GrowableXYZArrayCache } from "../geometry3d/ReusableObjectCache";
|
|
15
15
|
import { Transform } from "../geometry3d/Transform";
|
|
16
|
-
import { XYZProps } from "../geometry3d/XYZProps";
|
|
16
|
+
import { XYAndZ, XYZProps } from "../geometry3d/XYZProps";
|
|
17
17
|
import { Matrix4d } from "../geometry4d/Matrix4d";
|
|
18
18
|
import { Point4d } from "../geometry4d/Point4d";
|
|
19
19
|
import { Clipper, PolygonClipper } from "./ClipUtils";
|
|
@@ -81,7 +81,7 @@ export declare class ClipPlane extends Plane3d implements Clipper, PolygonClippe
|
|
|
81
81
|
* * The stored distance for the plane is the dot product of the point with the normal (i.e. treat the point's xyz as
|
|
82
82
|
* a vector from the origin.)
|
|
83
83
|
*/
|
|
84
|
-
static createNormalAndPoint(normal: Vector3d, point:
|
|
84
|
+
static createNormalAndPoint(normal: Vector3d, point: XYAndZ, invisible?: boolean, interior?: boolean, result?: ClipPlane): ClipPlane | undefined;
|
|
85
85
|
/**
|
|
86
86
|
* Create a clip plane
|
|
87
87
|
* @param origin any point on the plane.
|
|
@@ -127,7 +127,13 @@ export declare class ClipPlane extends Plane3d implements Clipper, PolygonClippe
|
|
|
127
127
|
*/
|
|
128
128
|
static createEdgeAndUpVector(point0: Point3d, point1: Point3d, upVector: Vector3d, tiltAngle?: Angle, result?: ClipPlane): ClipPlane | undefined;
|
|
129
129
|
/** Create a plane perpendicular to the edge between the xy parts of point0 and point1. */
|
|
130
|
-
static createEdgeXY(point0:
|
|
130
|
+
static createEdgeXY(point0: XYAndZ, point1: XYAndZ, result?: ClipPlane): ClipPlane | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* Variant of [[createEdgeXY]] that computes the plane using the edge midpoint instead of its start point.
|
|
133
|
+
* * This is more stable for creating a pair of clip planes from a long edge and its reversal, as is commonly found
|
|
134
|
+
* in a [[UnionOfConvexClipPlaneSets]].
|
|
135
|
+
*/
|
|
136
|
+
static createMidPointEdgeXY(point0: XYAndZ, point1: XYAndZ, result?: ClipPlane): ClipPlane | undefined;
|
|
131
137
|
/**
|
|
132
138
|
* Return the Plane3d form of the plane.
|
|
133
139
|
* * The plane origin is the point `distance * inwardNormal`
|
|
@@ -235,11 +241,17 @@ export declare class ClipPlane extends Plane3d implements Clipper, PolygonClippe
|
|
|
235
241
|
* Clip a polygon to the inside or outside of the plane.
|
|
236
242
|
* * Results with 2 or fewer points are ignored.
|
|
237
243
|
* * Other than ensuring capacity in the arrays, there are no object allocations during execution of this function.
|
|
244
|
+
* * For a convex input polygon, the output polygon is also convex.
|
|
245
|
+
* * For non-convex input, the output polygon may have double-back edges along plane intersections. This is still a
|
|
246
|
+
* valid clip in a parity sense (overlapping regions cancel).
|
|
238
247
|
* @param xyz input points.
|
|
239
|
-
* @param work work buffer
|
|
240
|
-
* @param
|
|
248
|
+
* @param work optional work buffer
|
|
249
|
+
* @param inside whether the positive side of the plane survives (true, default), or negative side (false).
|
|
250
|
+
* @param tolerance distance tolerance for "on plane" decision. Default value is [[Geometry.smallMetricDistance]].
|
|
251
|
+
* @return the number of crossings. If this is larger than 2, the input polygon was non-convex.
|
|
252
|
+
* @see appendPolygonClip
|
|
241
253
|
*/
|
|
242
|
-
clipConvexPolygonInPlace(xyz: GrowableXYZArray, work
|
|
254
|
+
clipConvexPolygonInPlace(xyz: GrowableXYZArray, work?: GrowableXYZArray, inside?: boolean, tolerance?: number): number;
|
|
243
255
|
/**
|
|
244
256
|
* Multiply the ClipPlane's DPoint4d by matrix.
|
|
245
257
|
* @param matrix matrix to apply.
|
|
@@ -276,6 +288,7 @@ export declare class ClipPlane extends Plane3d implements Clipper, PolygonClippe
|
|
|
276
288
|
* @param outsideFragments Array to receive "outside" fragments. Each fragment is a GrowableXYZArray grabbed
|
|
277
289
|
* from the cache. This is NOT cleared.
|
|
278
290
|
* @param arrayCache cache for reusable GrowableXYZArray.
|
|
291
|
+
* @see clipConvexPolygonInPlace
|
|
279
292
|
*/
|
|
280
293
|
appendPolygonClip(xyz: IndexedXYZCollection, insideFragments: GrowableXYZArray[], outsideFragments: GrowableXYZArray[], arrayCache: GrowableXYZArrayCache): void;
|
|
281
294
|
/** Project a point in space to the plane. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipPlane.d.ts","sourceRoot":"","sources":["../../../src/clipping/ClipPlane.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,kCAAkC,EAAE,MAAM,yBAAyB,CAAC;AAE7E,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAW,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"ClipPl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236
|
return undefined;
|
|
237
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* Variant of [[createEdgeXY]] that computes the plane using the edge midpoint instead of its start point.
|
|
240
|
+
* * This is more stable for creating a pair of clip planes from a long edge and its reversal, as is commonly found
|
|
241
|
+
* in a [[UnionOfConvexClipPlaneSets]].
|
|
242
|
+
*/
|
|
243
|
+
static createMidPointEdgeXY(point0, point1, result) {
|
|
244
|
+
return ClipPlane.createNormalAndPointXYZXYZ(point0.y - point1.y, point1.x - point0.x, 0, 0.5 * (point0.x + point1.x), 0.5 * (point0.y + point1.y), 0, false, false, result);
|
|
245
|
+
}
|
|
238
246
|
/**
|
|
239
247
|
* Return the Plane3d form of the plane.
|
|
240
248
|
* * The plane origin is the point `distance * inwardNormal`
|
|
@@ -440,9 +448,15 @@ class ClipPlane extends Plane3d_1.Plane3d {
|
|
|
440
448
|
* Clip a polygon to the inside or outside of the plane.
|
|
441
449
|
* * Results with 2 or fewer points are ignored.
|
|
442
450
|
* * Other than ensuring capacity in the arrays, there are no object allocations during execution of this function.
|
|
451
|
+
* * For a convex input polygon, the output polygon is also convex.
|
|
452
|
+
* * For non-convex input, the output polygon may have double-back edges along plane intersections. This is still a
|
|
453
|
+
* valid clip in a parity sense (overlapping regions cancel).
|
|
443
454
|
* @param xyz input points.
|
|
444
|
-
* @param work work buffer
|
|
445
|
-
* @param
|
|
455
|
+
* @param work optional work buffer
|
|
456
|
+
* @param inside whether the positive side of the plane survives (true, default), or negative side (false).
|
|
457
|
+
* @param tolerance distance tolerance for "on plane" decision. Default value is [[Geometry.smallMetricDistance]].
|
|
458
|
+
* @return the number of crossings. If this is larger than 2, the input polygon was non-convex.
|
|
459
|
+
* @see appendPolygonClip
|
|
446
460
|
*/
|
|
447
461
|
clipConvexPolygonInPlace(xyz, work, inside = true, tolerance = Geometry_1.Geometry.smallMetricDistance) {
|
|
448
462
|
return PolygonOps_1.IndexedXYZCollectionPolygonOps.clipConvexPolygonInPlace(this, xyz, work, inside, tolerance);
|
|
@@ -553,6 +567,7 @@ class ClipPlane extends Plane3d_1.Plane3d {
|
|
|
553
567
|
* @param outsideFragments Array to receive "outside" fragments. Each fragment is a GrowableXYZArray grabbed
|
|
554
568
|
* from the cache. This is NOT cleared.
|
|
555
569
|
* @param arrayCache cache for reusable GrowableXYZArray.
|
|
570
|
+
* @see clipConvexPolygonInPlace
|
|
556
571
|
*/
|
|
557
572
|
appendPolygonClip(xyz, insideFragments, outsideFragments, arrayCache) {
|
|
558
573
|
const perpendicularRange = Range_1.Range1d.createNull();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipPlane.js","sourceRoot":"","sources":["../../../src/clipping/ClipPlane.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAQ/F,0CAAkD;AAElD,6EAA0E;AAC1E,qEAAkE;AAElE,qDAAkD;AAClD,mDAAgD;AAChD,6FAA0F;AAC1F,mEAAkE;AAClE,yDAA0E;AAC1E,+CAAuD;AAEvD,uDAAoD;AAGpD,mDAAgD;AAChD,yDAAwD;AACxD,2CAAqE;AAkBrE;;;;;;;;;;;;;;GAcG;AACH,MAAa,SAAU,SAAQ,iBAAO;IAC5B,aAAa,CAAW;IAChC;;;;OAIG;IACK,mBAAmB,CAAS;IAC5B,UAAU,CAAU;IACpB,SAAS,CAAU;IAE3B,YAAoB,MAAgB,EAAE,QAAgB,EAAE,SAAkB,EAAE,QAAiB;QAC3F,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC;QAC5B,IAAI,CAAC,mBAAmB,GAAG,QAAQ,CAAC;IACtC,CAAC;IACD;;;;;MAKE;IACF;;;OAGG;IACI,aAAa,CAAC,KAAgB;QACnC,OAAO,mBAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,CA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,MAAM,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtI,CAAC;;AA5jBH,8BA6jBC","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 CartesianGeometry\n */\n\nimport { Arc3d } from \"../curve/Arc3d\";\nimport { AnnounceNumberNumberCurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { AxisOrder, Geometry } from \"../Geometry\";\nimport { Angle } from \"../geometry3d/Angle\";\nimport { GrowableFloat64Array } from \"../geometry3d/GrowableFloat64Array\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\nimport { Plane3d } from \"../geometry3d/Plane3d\";\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { IndexedXYZCollectionPolygonOps } from \"../geometry3d/PolygonOps\";\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { XYZProps } from \"../geometry3d/XYZProps\";\nimport { Matrix4d } from \"../geometry4d/Matrix4d\";\nimport { Point4d } from \"../geometry4d/Point4d\";\nimport { AnalyticRoots } from \"../numerics/Polynomials\";\nimport { Clipper, ClipUtilities, PolygonClipper } from \"./ClipUtils\";\n\n/**\n * Wire format describing a [[ClipPlane]].\n * If either [[normal]] or [[dist]] are omitted, defaults to a normal of [[Vector3d.unitZ]] and a distance of zero.\n * @public\n */\nexport interface ClipPlaneProps {\n /** The plane's inward normal. */\n normal?: XYZProps;\n /** The plane's signed distance from the origin. */\n dist?: number;\n /** Defaults to `false`. Interpretation of this flag is algorithm-specific. */\n invisible?: boolean;\n /** Defaults to `false`. Interpretation of this flag is algorithm-specific. */\n interior?: boolean;\n}\n\n/**\n * A ClipPlane is a single plane represented as\n * * An inward unit normal (u,v,w)\n * * A signedDistance\n * More details can be found at docs/learning/geometry/Clipping.md\n *\n * Hence\n * * The halfspace function evaluation for \"point\" (x,y,z) is `(x,y,z) DOT (u,v,w) - signedDistance`.\n * * POSITIVE values of the halfspace function are \"inside\".\n * * ZERO value of the halfspace function is \"on\".\n * * NEGATIVE value of the halfspace function is \"outside\".\n * * A representative point on the plane is (signedDistance * u, signedDistance * v, signedDistance * w).\n * * Given a point on the plane and the inward normal of the plane, `signedDistance = point DOT normal`.\n * @public\n */\nexport class ClipPlane extends Plane3d implements Clipper, PolygonClipper {\n private _inwardNormal: Vector3d;\n /**\n * Construct a parallel plane through the origin.\n * * Move it to the actual position.\n * * _distanceFromOrigin is the distance it moved, with the (inward) normal direction as positive\n */\n private _distanceFromOrigin: number;\n private _invisible: boolean;\n private _interior: boolean;\n\n private constructor(normal: Vector3d, distance: number, invisible: boolean, interior: boolean) {\n super();\n this._invisible = invisible;\n this._interior = interior;\n this._inwardNormal = normal;\n this._distanceFromOrigin = distance;\n }\n /*\n private safeSetXYZDistance(nx: number, ny: number, nz: number, d: number) {\n this._inwardNormal.set(nx, ny, nz);\n this._distanceFromOrigin = d;\n }\n */\n /**\n * Return true if all members are almostEqual to corresponding members of other.\n * @param other clip plane to compare\n */\n public isAlmostEqual(other: ClipPlane): boolean {\n return Geometry.isSameCoordinate(this._distanceFromOrigin, other._distanceFromOrigin)\n && this._inwardNormal.isAlmostEqual(other._inwardNormal)\n && this._interior === other._interior\n && this._invisible === other._invisible;\n }\n /** Return a cloned plane */\n public clone(): ClipPlane {\n const result = new ClipPlane(this._inwardNormal.clone(), this._distanceFromOrigin, this._invisible, this._interior);\n return result;\n }\n /** Return a cloned plane with coordinate data negated. */\n public cloneNegated(): ClipPlane {\n const plane = new ClipPlane(this._inwardNormal.clone(), this._distanceFromOrigin, this._invisible, this._interior);\n plane.negateInPlace();\n return plane;\n }\n /** Create a ClipPlane from Plane3dByOriginAndUnitNormal. */\n public static createPlane(\n plane: Plane3dByOriginAndUnitNormal, invisible: boolean = false, interior: boolean = false, result?: ClipPlane,\n ): ClipPlane {\n const distance = plane.getNormalRef().dotProduct(plane.getOriginRef());\n if (result) {\n result._invisible = invisible;\n result._interior = interior;\n result._inwardNormal = plane.getNormalRef().clone();\n result._distanceFromOrigin = distance;\n return result;\n }\n return new ClipPlane(plane.getNormalRef().clone(), distance, invisible, interior);\n }\n /**\n * Create a ClipPlane with direct normal and signedDistance.\n * * The vector is normalized for storage.\n */\n public static createNormalAndDistance(\n normal: Vector3d, distance: number, invisible: boolean = false, interior: boolean = false, result?: ClipPlane,\n ): ClipPlane | undefined {\n const normalized = normal.normalize();\n if (normalized) {\n if (result) {\n result._invisible = invisible;\n result._interior = interior;\n result._inwardNormal = normalized;\n result._distanceFromOrigin = distance;\n }\n return new ClipPlane(normalized, distance, invisible, interior);\n }\n return undefined;\n }\n /**\n * Create a ClipPlane\n * * \"normal\" is the inward normal of the plane (it is internally normalized).\n * * \"point\" is any point of the plane.\n * * The stored distance for the plane is the dot product of the point with the normal (i.e. treat the point's xyz as\n * a vector from the origin.)\n */\n public static createNormalAndPoint(\n normal: Vector3d, point: Point3d, invisible: boolean = false, interior: boolean = false, result?: ClipPlane,\n ): ClipPlane | undefined {\n const normalized = normal.normalize();\n if (normalized) {\n const distance = normalized.dotProduct(point);\n if (result) {\n result._invisible = invisible;\n result._interior = interior;\n result._inwardNormal = normalized;\n result._distanceFromOrigin = distance;\n }\n return new ClipPlane(normalized, distance, invisible, interior);\n }\n return undefined;\n }\n /**\n * Create a clip plane\n * @param origin any point on the plane.\n * @param vectorA any vector in the plane\n * @param vectorB any vector in the plane\n * @return undefined if the vectors are not independent.\n * * The stored inward normal is vectorB.crossProduct(vectorA).\n * * That is, the vectors are considered as a right-handed pair when viewed from the outside.\n */\n public static createOriginAndVectors(\n origin: Point3d,\n vectorA: Vector3d,\n vectorB: Vector3d,\n invisible: boolean = false,\n interior: boolean = false,\n result?: ClipPlane,\n ): ClipPlane | undefined {\n const normalized = vectorB.crossProduct(vectorA);\n return this.createNormalAndPoint(normalized, origin, invisible, interior, result);\n }\n /**\n * Create a ClipPlane\n * * \"normal\" (normalX, normalY, normalZ) is the inward normal of the plane.\n * * \"point\" (originX,originY,originZ) is any point of the plane.\n * * The stored distance for the plane is the dot product of the point with the normal (i.e. treat the point's xyz\n * as a vector from the origin.)\n */\n public static createNormalAndPointXYZXYZ(\n normalX: number, normalY: number, normalZ: number,\n originX: number, originY: number, originZ: number,\n invisible: boolean = false, interior: boolean = false,\n result?: ClipPlane,\n ): ClipPlane | undefined {\n const q = Geometry.hypotenuseXYZ(normalX, normalY, normalZ);\n const r = Geometry.conditionalDivideFraction(1, q);\n if (r !== undefined) {\n if (result) {\n result._inwardNormal.set(normalX * r, normalY * r, normalZ * r);\n result._distanceFromOrigin = result._inwardNormal.dotProductXYZ(originX, originY, originZ);\n result._invisible = invisible;\n result._interior = interior;\n return result;\n }\n const normal = Vector3d.create(normalX * r, normalY * r, normalZ * r);\n return new ClipPlane(normal, normal.dotProductXYZ(originX, originY, originZ), invisible, interior);\n }\n return undefined;\n }\n /**\n * Return a json object of the form\n * `{\"normal\":[u,v,w],\"dist\":signedDistanceValue,\"interior\":true,\"invisible\":true}`\n */\n public toJSON(): ClipPlaneProps {\n const props: ClipPlaneProps = {\n normal: this.inwardNormalRef.toJSON(),\n dist: this.distance,\n };\n if (this.interior)\n props.interior = true;\n if (this.invisible)\n props.invisible = true;\n return props;\n }\n /** Parse json object to ClipPlane instance */\n public static fromJSON(json: ClipPlaneProps, result?: ClipPlane): ClipPlane | undefined {\n if (json && json.normal && undefined !== json.dist && Number.isFinite(json.dist))\n return ClipPlane.createNormalAndDistance(\n Vector3d.fromJSON(json.normal), json.dist, !!json.invisible, !!json.interior,\n );\n return ClipPlane.createNormalAndDistance(Vector3d.unitZ(), 0, false, false, result);\n }\n /** Set both the invisible and interior flags. */\n public setFlags(invisible: boolean, interior: boolean) {\n this._invisible = invisible;\n this._interior = interior;\n }\n /** Return the stored distanceFromOrigin property. */\n public get distance() {\n return this._distanceFromOrigin;\n }\n /** * Return the stored inward normal property. */\n public get inwardNormalRef(): Vector3d {\n return this._inwardNormal;\n }\n /** Return the \"interior\" property flag. Interpretation of this flag is algorithm-specific. */\n public get interior() {\n return this._interior;\n }\n /** Return the \"invisible\" property flag. Interpretation of this flag is algorithm-specific. */\n public get invisible() {\n return this._invisible;\n }\n /**\n * Create a plane defined by two points, an up vector, and a tilt angle relative to the up vector.\n * @param point0 start point of the edge\n * @param point1 end point of the edge\n * @param upVector vector perpendicular to the plane\n * @param tiltAngle angle to tilt the plane around the edge in the direction of the up vector.\n * @param result optional preallocated plane\n */\n public static createEdgeAndUpVector(\n point0: Point3d, point1: Point3d, upVector: Vector3d, tiltAngle?: Angle, result?: ClipPlane,\n ): ClipPlane | undefined {\n const edgeVector = Vector3d.createFrom(point1.minus(point0));\n let normal = (upVector.crossProduct(edgeVector)).normalize();\n\n if (normal) {\n if (tiltAngle !== undefined && !tiltAngle.isAlmostZero) {\n const tiltNormal = Vector3d.createRotateVectorAroundVector(normal, edgeVector, tiltAngle);\n if (tiltNormal) {\n normal = tiltNormal.clone();\n }\n }\n normal.negate(normal);\n return ClipPlane.createNormalAndPoint(normal, point0, false, false, result);\n }\n return undefined;\n }\n /** Create a plane perpendicular to the edge between the xy parts of point0 and point1. */\n public static createEdgeXY(point0: Point3d, point1: Point3d, result?: ClipPlane): ClipPlane | undefined {\n const normal = Vector3d.create(point0.y - point1.y, point1.x - point0.x);\n if (normal.normalizeInPlace())\n return ClipPlane.createNormalAndPoint(normal, point0, false, false, result);\n return undefined;\n }\n /**\n * Return the Plane3d form of the plane.\n * * The plane origin is the point `distance * inwardNormal`\n * * The plane normal is the inward normal of the ClipPlane.\n */\n public getPlane3d(): Plane3dByOriginAndUnitNormal {\n const d = this._distanceFromOrigin;\n // normal should be normalized, will not return undefined\n return Plane3dByOriginAndUnitNormal.create(\n Point3d.create(this._inwardNormal.x * d, this._inwardNormal.y * d, this._inwardNormal.z * d),\n this._inwardNormal,\n )!;\n }\n /**\n * Return the Point4d d form of the plane.\n * * The homogeneous xyz are the inward normal xyz.\n * * The homogeneous weight is the negated ClipPlane distance.\n */\n public getPlane4d(): Point4d {\n return Point4d.create(\n this._inwardNormal.x, this._inwardNormal.y, this._inwardNormal.z, - this._distanceFromOrigin,\n );\n }\n /**\n * Set the plane from DPoint4d style plane.\n * * The saved plane has its direction normalized.\n * * This preserves the plane itself as a zero set but make plane evaluations act as true distances (even if the\n * plane coefficients are scaled otherwise).\n * @param plane the DPoint4d style plane.\n */\n public setPlane4d(plane: Point4d) {\n const a = Math.sqrt(plane.x * plane.x + plane.y * plane.y + plane.z * plane.z);\n const r = a === 0.0 ? 1.0 : 1.0 / a;\n this._inwardNormal.x = r * plane.x;\n this._inwardNormal.y = r * plane.y;\n this._inwardNormal.z = r * plane.z;\n this._distanceFromOrigin = -r * plane.w;\n }\n /**\n * Evaluate the altitude in weighted space, i.e. (dot product with inward normal) minus distance, with point.w\n * scale applied to distance.\n * @param point space point to test.\n */\n public weightedAltitude(point: Point4d): number {\n return point.x * this._inwardNormal.x\n + point.y * this._inwardNormal.y\n + point.z * this._inwardNormal.z\n - point.w * this._distanceFromOrigin;\n }\n /**\n * Evaluate the distance from the plane to a point in space, i.e. (dot product with inward normal) minus distance.\n * @param point space point to test.\n */\n public altitude(point: Point3d): number {\n return point.x * this._inwardNormal.x\n + point.y * this._inwardNormal.y\n + point.z * this._inwardNormal.z\n - this._distanceFromOrigin;\n }\n /**\n * Evaluate the distance from the plane to a point in space with point given as x,y,z, i.e. (dot product with\n * inward normal) minus distance.\n * @param point space point to test.\n */\n public altitudeXYZ(x: number, y: number, z: number): number {\n return x * this._inwardNormal.x\n + y * this._inwardNormal.y\n + z * this._inwardNormal.z\n - this._distanceFromOrigin;\n }\n /** Return the x component of the normal used to evaluate altitude. */\n public normalX(): number {\n return this._inwardNormal.x;\n }\n /** Return the x component of the normal used to evaluate altitude. */\n public normalY(): number {\n return this._inwardNormal.y;\n }\n /** Return the z component of the normal used to evaluate altitude. */\n public normalZ(): number {\n return this._inwardNormal.z;\n }\n /** Return the dot product of the plane normal with the vector (NOT using the plane's distanceFromOrigin). */\n public velocity(vector: Vector3d): number {\n return vector.x * this._inwardNormal.x + vector.y * this._inwardNormal.y + vector.z * this._inwardNormal.z;\n }\n /**\n * Return the dot product of the plane normal with the x,yz, vector components (NOT using the plane's\n * distanceFromOrigin).\n */\n public velocityXYZ(x: number, y: number, z: number): number {\n return x * this._inwardNormal.x + y * this._inwardNormal.y + z * this._inwardNormal.z;\n }\n /**\n * Return the dot product of the plane normal with the point (treating the point xyz as a vector, and NOT\n * using the plane's distanceFromOrigin).\n */\n public dotProductPlaneNormalPoint(point: Point3d): number {\n return point.x * this._inwardNormal.x + point.y * this._inwardNormal.y + point.z * this._inwardNormal.z;\n }\n /**\n * Return true if spacePoint is inside or on the plane, with tolerance applied to \"on\".\n * @param spacePoint point to test.\n * @param tolerance tolerance for considering \"near plane\" to be \"on plane\"\n */\n public isPointOnOrInside(spacePoint: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\n let value = this.altitude(spacePoint);\n if (tolerance) { value += tolerance; }\n return value >= 0.0;\n }\n /**\n * Return true if spacePoint is strictly inside the halfspace, with tolerance applied to \"on\".\n * @param spacePoint point to test.\n * @param tolerance tolerance for considering \"near plane\" to be \"on plane\"\n */\n public isPointInside(point: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\n let value = this.altitude(point);\n if (tolerance) { value -= tolerance; }\n return value > 0.0;\n }\n /**\n * Return true if spacePoint is strictly on the plane, within tolerance\n * @param spacePoint point to test.\n * @param tolerance tolerance for considering \"near plane\" to be \"on plane\"\n */\n public isPointOn(point: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\n return Math.abs(this.altitude(point)) <= tolerance;\n }\n /**\n * Compute intersections of an (UNBOUNDED) arc with the plane. Append them (as radians) to a growing array.\n * @param arc arc to test. The angle limits of the arc are NOT considered.\n * @param intersectionRadians array to receive results\n */\n public appendIntersectionRadians(arc: Arc3d, intersectionRadians: GrowableFloat64Array) {\n const arcVectors = arc.toVectors();\n const alpha = this.altitude(arc.center);\n const beta = this.velocity(arcVectors.vector0);\n const gamma = this.velocity(arcVectors.vector90);\n AnalyticRoots.appendImplicitLineUnitCircleIntersections(\n alpha, beta, gamma, undefined, undefined, intersectionRadians,\n );\n }\n private static _clipArcFractionArray = new GrowableFloat64Array();\n /**\n * Announce fractional intervals of arc clip.\n * * Each call to `announce(fraction0, fraction1, arc)` announces one interval that is inside the clip plane.\n */\n public announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n const breaks = ClipPlane._clipArcFractionArray;\n breaks.clear();\n this.appendIntersectionRadians(arc, breaks);\n arc.sweep.radiansArrayToPositivePeriodicFractions(breaks);\n return ClipUtilities.selectIntervals01(arc, breaks, this, announce);\n }\n /**\n * Compute intersection of (unbounded) segment with the plane.\n * * If the ends are on the same side of the plane, return undefined.\n * * If the intersection is an endpoint or interior to the segment return the fraction.\n * * If both ends are on, return undefined.\n */\n public getBoundedSegmentSimpleIntersection(pointA: Point3d, pointB: Point3d): number | undefined {\n const h0 = this.altitude(pointA);\n const h1 = this.altitude(pointB);\n if (h0 * h1 > 0.0)\n return undefined;\n if (h0 === 0.0 && h1 === 0.0) {\n return undefined;\n }\n return - h0 / (h1 - h0);\n }\n /** Apply transform to the origin. Apply inverse transpose of the matrix part to th normal vector. */\n public transformInPlace(transform: Transform): boolean {\n const plane: Plane3dByOriginAndUnitNormal = this.getPlane3d();\n const matrix: Matrix3d = transform.matrix;\n const newPoint = transform.multiplyPoint3d(plane.getOriginRef());\n // Normal transforms as the inverse transpose of the matrix part\n // BTW: If the matrix is orthogonal, this is a long way to multiply by the matrix part (mumble grumble)\n const newNormal = matrix.multiplyInverseTranspose(plane.getNormalRef());\n if (!newNormal)\n return false;\n\n plane.set(newPoint, newNormal);\n const normalized = (plane.getNormalRef()).normalize();\n if (!normalized)\n return false;\n this._inwardNormal = normalized;\n this._distanceFromOrigin = this._inwardNormal.dotProduct(plane.getOriginRef());\n return true;\n }\n /** Set the invisible flag. Interpretation of this flag is algorithm-specific. */\n public setInvisible(invisible: boolean) {\n this._invisible = invisible;\n }\n /** Reverse the sign of all coefficients, so outside and inside reverse */\n public negateInPlace() {\n this._inwardNormal = this._inwardNormal.negate();\n this._distanceFromOrigin = - this._distanceFromOrigin;\n }\n /**\n * Move the plane INWARD by given distance\n * @param offset distance of shift inwards\n */\n public offsetDistance(offset: number) {\n this._distanceFromOrigin += offset;\n }\n /**\n * Clip a polygon to the inside or outside of the plane.\n * * Results with 2 or fewer points are ignored.\n * * Other than ensuring capacity in the arrays, there are no object allocations during execution of this function.\n * @param xyz input points.\n * @param work work buffer\n * @param tolerance tolerance for \"on plane\" decision.\n */\n public clipConvexPolygonInPlace(\n xyz: GrowableXYZArray,\n work: GrowableXYZArray,\n inside: boolean = true,\n tolerance: number = Geometry.smallMetricDistance,\n ) {\n return IndexedXYZCollectionPolygonOps.clipConvexPolygonInPlace(this, xyz, work, inside, tolerance);\n }\n /**\n * Multiply the ClipPlane's DPoint4d by matrix.\n * @param matrix matrix to apply.\n * @param invert if true, use in verse of the matrix.\n * @param transpose if true, use the transpose of the matrix (or inverse, per invert parameter)\n * @param matrix matrix to apply\n * @return false if unable to invert\n * * Note that if matrixA is applied to all of space, the matrix to send to this method to get a corresponding\n * effect on the plane is the inverse transpose of matrixA\n * * Callers that will apply the same matrix to many planes should pre-invert the matrix for efficiency.\n * * Both params default to true to get the full effect of transforming space.\n */\n public multiplyPlaneByMatrix4d(matrix: Matrix4d, invert: boolean = true, transpose: boolean = true): boolean {\n const plane: Point4d = this.getPlane4d();\n if (invert) {\n const inverse = matrix.createInverse();\n if (inverse)\n return this.multiplyPlaneByMatrix4d(inverse, false, transpose);\n return false;\n }\n if (transpose)\n matrix.multiplyTransposePoint4d(plane, plane);\n else\n matrix.multiplyPoint4d(plane, plane);\n this.setPlane4d(plane);\n return true;\n }\n /** Announce the interval (if any) where a line is within the clip plane half space. */\n public announceClippedSegmentIntervals(\n f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: (fraction0: number, fraction1: number) => void,\n ): boolean {\n if (f1 < f0)\n return false;\n const h0 = - this.altitude(pointA);\n const h1 = - this.altitude(pointB);\n const delta = h1 - h0;\n const f = Geometry.conditionalDivideFraction(-h0, delta);\n if (f === undefined) { // The segment is parallel to the plane.\n if (h0 <= 0.0) { if (announce) announce(f0, f1); return true; }\n return false;\n }\n if (delta > 0) { // segment aims OUT\n if (f < f1) f1 = f;\n } else {\n // segment aims IN\n if (f > f0)\n f0 = f;\n }\n if (f1 < f0)\n return false;\n if (announce) announce(f0, f1);\n return true;\n }\n /**\n * Return a coordinate frame with\n * * origin at closest point to global origin\n * * z axis points in\n * * x and y are \"in plane\"\n */\n public getFrame(): Transform {\n const d = this._distanceFromOrigin;\n const origin = Point3d.create(this._inwardNormal.x * d, this._inwardNormal.y * d, this._inwardNormal.z * d);\n const matrix = Matrix3d.createRigidHeadsUp(this._inwardNormal, AxisOrder.ZXY);\n return Transform.createOriginAndMatrix(origin, matrix);\n }\n /**\n * Return the intersection of the plane with a range cube.\n * @param range\n * @param xyzOut intersection polygon. This is convex.\n */\n public intersectRange(range: Range3d, addClosurePoint: boolean = false): GrowableXYZArray | undefined {\n if (range.isNull)\n return undefined;\n const corners = range.corners();\n const frameOnPlane = this.getFrame();\n frameOnPlane.multiplyInversePoint3dArrayInPlace(corners);\n const localRange = Range3d.createArray(corners);\n if (localRange.low.z * localRange.high.z > 0.0)\n return undefined;\n // oversized polygon on local z= 0\n const xyzOut = new GrowableXYZArray();\n xyzOut.pushXYZ(localRange.low.x, localRange.low.y, 0);\n xyzOut.pushXYZ(localRange.high.x, localRange.low.y, 0);\n xyzOut.pushXYZ(localRange.high.x, localRange.high.y, 0);\n xyzOut.pushXYZ(localRange.low.x, localRange.high.y, 0);\n xyzOut.multiplyTransformInPlace(frameOnPlane);\n IndexedXYZCollectionPolygonOps.intersectRangeConvexPolygonInPlace(range, xyzOut);\n if (xyzOut.length === 0)\n return undefined;\n if (addClosurePoint)\n xyzOut.pushWrap(1);\n return xyzOut;\n }\n /**\n * Implement appendPolygonClip, as defined in interface PolygonClipper.\n * @param xyz convex polygon. This is not changed.\n * @param insideFragments Array to receive \"inside\" fragments. Each fragment is a GrowableXYZArray grabbed\n * from the cache. This is NOT cleared.\n * @param outsideFragments Array to receive \"outside\" fragments. Each fragment is a GrowableXYZArray grabbed\n * from the cache. This is NOT cleared.\n * @param arrayCache cache for reusable GrowableXYZArray.\n */\n public appendPolygonClip(\n xyz: IndexedXYZCollection,\n insideFragments: GrowableXYZArray[],\n outsideFragments: GrowableXYZArray[],\n arrayCache: GrowableXYZArrayCache,\n ): void {\n const perpendicularRange = Range1d.createNull();\n const newInside = arrayCache.grabFromCache();\n const newOutside = arrayCache.grabFromCache();\n IndexedXYZCollectionPolygonOps.splitConvexPolygonInsideOutsidePlane(\n this, xyz, newInside, newOutside, perpendicularRange,\n );\n ClipUtilities.captureOrDrop(newInside, 3, insideFragments, arrayCache);\n ClipUtilities.captureOrDrop(newOutside, 3, outsideFragments, arrayCache);\n }\n /** Project a point in space to the plane. */\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\n return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);\n }\n /** Return the projection of (x,y,z) onto the plane. */\n public override projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d {\n const scale = -this.altitudeXYZ(x, y, z);\n return Point3d.create(x + scale * this._inwardNormal.x, y + scale * this._inwardNormal.y, z + scale * this._inwardNormal.z, result);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ClipPlane.js","sourceRoot":"","sources":["../../../src/clipping/ClipPlane.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAQ/F,0CAAkD;AAElD,6EAA0E;AAC1E,qEAAkE;AAElE,qDAAkD;AAClD,mDAAgD;AAChD,6FAA0F;AAC1F,mEAAkE;AAClE,yDAA0E;AAC1E,+CAAuD;AAEvD,uDAAoD;AAGpD,mDAAgD;AAChD,yDAAwD;AACxD,2CAAqE;AAkBrE;;;;;;;;;;;;;;GAcG;AACH,MAAa,SAAU,SAAQ,iBAAO;IAC5B,aAAa,CAAW;IAChC;;;;OAIG;IACK,mBAAmB,CAAS;IAC5B,UAAU,CAAU;IACpB,SAAS,CAAU;IAE3B,YAAoB,MAAgB,EAAE,QAAgB,EAAE,SAAkB,EAAE,QAAiB;QAC3F,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC;QAC5B,IAAI,CAAC,mBAAmB,GAAG,QAAQ,CAAC;IACtC,CAAC;IACD;;;;;MAKE;IACF;;;OAGG;IACI,aAAa,CAAC,KAAgB;QACnC,OAAO,mBAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,CAAC;eAChF,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC;eACrD,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS;eAClC,IAAI,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,CAAC;IAC5C,CAAC;IACD,4BAA4B;IACrB,KAAK;QACV,MAAM,MAAM,G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CAAC;IAClF,CAAC;IACD,uDAAuD;IACvC,iBAAiB,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,MAAgB;QACjF,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACzC,OAAO,yBAAO,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtI,CAAC;;AA/kBH,8BAglBC","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 CartesianGeometry\n */\n\nimport { Arc3d } from \"../curve/Arc3d\";\nimport { AnnounceNumberNumberCurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { AxisOrder, Geometry } from \"../Geometry\";\nimport { Angle } from \"../geometry3d/Angle\";\nimport { GrowableFloat64Array } from \"../geometry3d/GrowableFloat64Array\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\nimport { Plane3d } from \"../geometry3d/Plane3d\";\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { IndexedXYZCollectionPolygonOps } from \"../geometry3d/PolygonOps\";\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { XYAndZ, XYZProps } from \"../geometry3d/XYZProps\";\nimport { Matrix4d } from \"../geometry4d/Matrix4d\";\nimport { Point4d } from \"../geometry4d/Point4d\";\nimport { AnalyticRoots } from \"../numerics/Polynomials\";\nimport { Clipper, ClipUtilities, PolygonClipper } from \"./ClipUtils\";\n\n/**\n * Wire format describing a [[ClipPlane]].\n * If either [[normal]] or [[dist]] are omitted, defaults to a normal of [[Vector3d.unitZ]] and a distance of zero.\n * @public\n */\nexport interface ClipPlaneProps {\n /** The plane's inward normal. */\n normal?: XYZProps;\n /** The plane's signed distance from the origin. */\n dist?: number;\n /** Defaults to `false`. Interpretation of this flag is algorithm-specific. */\n invisible?: boolean;\n /** Defaults to `false`. Interpretation of this flag is algorithm-specific. */\n interior?: boolean;\n}\n\n/**\n * A ClipPlane is a single plane represented as\n * * An inward unit normal (u,v,w)\n * * A signedDistance\n * More details can be found at docs/learning/geometry/Clipping.md\n *\n * Hence\n * * The halfspace function evaluation for \"point\" (x,y,z) is `(x,y,z) DOT (u,v,w) - signedDistance`.\n * * POSITIVE values of the halfspace function are \"inside\".\n * * ZERO value of the halfspace function is \"on\".\n * * NEGATIVE value of the halfspace function is \"outside\".\n * * A representative point on the plane is (signedDistance * u, signedDistance * v, signedDistance * w).\n * * Given a point on the plane and the inward normal of the plane, `signedDistance = point DOT normal`.\n * @public\n */\nexport class ClipPlane extends Plane3d implements Clipper, PolygonClipper {\n private _inwardNormal: Vector3d;\n /**\n * Construct a parallel plane through the origin.\n * * Move it to the actual position.\n * * _distanceFromOrigin is the distance it moved, with the (inward) normal direction as positive\n */\n private _distanceFromOrigin: number;\n private _invisible: boolean;\n private _interior: boolean;\n\n private constructor(normal: Vector3d, distance: number, invisible: boolean, interior: boolean) {\n super();\n this._invisible = invisible;\n this._interior = interior;\n this._inwardNormal = normal;\n this._distanceFromOrigin = distance;\n }\n /*\n private safeSetXYZDistance(nx: number, ny: number, nz: number, d: number) {\n this._inwardNormal.set(nx, ny, nz);\n this._distanceFromOrigin = d;\n }\n */\n /**\n * Return true if all members are almostEqual to corresponding members of other.\n * @param other clip plane to compare\n */\n public isAlmostEqual(other: ClipPlane): boolean {\n return Geometry.isSameCoordinate(this._distanceFromOrigin, other._distanceFromOrigin)\n && this._inwardNormal.isAlmostEqual(other._inwardNormal)\n && this._interior === other._interior\n && this._invisible === other._invisible;\n }\n /** Return a cloned plane */\n public clone(): ClipPlane {\n const result = new ClipPlane(this._inwardNormal.clone(), this._distanceFromOrigin, this._invisible, this._interior);\n return result;\n }\n /** Return a cloned plane with coordinate data negated. */\n public cloneNegated(): ClipPlane {\n const plane = new ClipPlane(this._inwardNormal.clone(), this._distanceFromOrigin, this._invisible, this._interior);\n plane.negateInPlace();\n return plane;\n }\n /** Create a ClipPlane from Plane3dByOriginAndUnitNormal. */\n public static createPlane(\n plane: Plane3dByOriginAndUnitNormal, invisible: boolean = false, interior: boolean = false, result?: ClipPlane,\n ): ClipPlane {\n const distance = plane.getNormalRef().dotProduct(plane.getOriginRef());\n if (result) {\n result._invisible = invisible;\n result._interior = interior;\n result._inwardNormal = plane.getNormalRef().clone();\n result._distanceFromOrigin = distance;\n return result;\n }\n return new ClipPlane(plane.getNormalRef().clone(), distance, invisible, interior);\n }\n /**\n * Create a ClipPlane with direct normal and signedDistance.\n * * The vector is normalized for storage.\n */\n public static createNormalAndDistance(\n normal: Vector3d, distance: number, invisible: boolean = false, interior: boolean = false, result?: ClipPlane,\n ): ClipPlane | undefined {\n const normalized = normal.normalize();\n if (normalized) {\n if (result) {\n result._invisible = invisible;\n result._interior = interior;\n result._inwardNormal = normalized;\n result._distanceFromOrigin = distance;\n }\n return new ClipPlane(normalized, distance, invisible, interior);\n }\n return undefined;\n }\n /**\n * Create a ClipPlane\n * * \"normal\" is the inward normal of the plane (it is internally normalized).\n * * \"point\" is any point of the plane.\n * * The stored distance for the plane is the dot product of the point with the normal (i.e. treat the point's xyz as\n * a vector from the origin.)\n */\n public static createNormalAndPoint(\n normal: Vector3d, point: XYAndZ, invisible: boolean = false, interior: boolean = false, result?: ClipPlane,\n ): ClipPlane | undefined {\n const normalized = normal.normalize();\n if (normalized) {\n const distance = normalized.dotProduct(point);\n if (result) {\n result._invisible = invisible;\n result._interior = interior;\n result._inwardNormal = normalized;\n result._distanceFromOrigin = distance;\n }\n return new ClipPlane(normalized, distance, invisible, interior);\n }\n return undefined;\n }\n /**\n * Create a clip plane\n * @param origin any point on the plane.\n * @param vectorA any vector in the plane\n * @param vectorB any vector in the plane\n * @return undefined if the vectors are not independent.\n * * The stored inward normal is vectorB.crossProduct(vectorA).\n * * That is, the vectors are considered as a right-handed pair when viewed from the outside.\n */\n public static createOriginAndVectors(\n origin: Point3d,\n vectorA: Vector3d,\n vectorB: Vector3d,\n invisible: boolean = false,\n interior: boolean = false,\n result?: ClipPlane,\n ): ClipPlane | undefined {\n const normalized = vectorB.crossProduct(vectorA);\n return this.createNormalAndPoint(normalized, origin, invisible, interior, result);\n }\n /**\n * Create a ClipPlane\n * * \"normal\" (normalX, normalY, normalZ) is the inward normal of the plane.\n * * \"point\" (originX,originY,originZ) is any point of the plane.\n * * The stored distance for the plane is the dot product of the point with the normal (i.e. treat the point's xyz\n * as a vector from the origin.)\n */\n public static createNormalAndPointXYZXYZ(\n normalX: number, normalY: number, normalZ: number,\n originX: number, originY: number, originZ: number,\n invisible: boolean = false, interior: boolean = false,\n result?: ClipPlane,\n ): ClipPlane | undefined {\n const q = Geometry.hypotenuseXYZ(normalX, normalY, normalZ);\n const r = Geometry.conditionalDivideFraction(1, q);\n if (r !== undefined) {\n if (result) {\n result._inwardNormal.set(normalX * r, normalY * r, normalZ * r);\n result._distanceFromOrigin = result._inwardNormal.dotProductXYZ(originX, originY, originZ);\n result._invisible = invisible;\n result._interior = interior;\n return result;\n }\n const normal = Vector3d.create(normalX * r, normalY * r, normalZ * r);\n return new ClipPlane(normal, normal.dotProductXYZ(originX, originY, originZ), invisible, interior);\n }\n return undefined;\n }\n /**\n * Return a json object of the form\n * `{\"normal\":[u,v,w],\"dist\":signedDistanceValue,\"interior\":true,\"invisible\":true}`\n */\n public toJSON(): ClipPlaneProps {\n const props: ClipPlaneProps = {\n normal: this.inwardNormalRef.toJSON(),\n dist: this.distance,\n };\n if (this.interior)\n props.interior = true;\n if (this.invisible)\n props.invisible = true;\n return props;\n }\n /** Parse json object to ClipPlane instance */\n public static fromJSON(json: ClipPlaneProps, result?: ClipPlane): ClipPlane | undefined {\n if (json && json.normal && undefined !== json.dist && Number.isFinite(json.dist))\n return ClipPlane.createNormalAndDistance(\n Vector3d.fromJSON(json.normal), json.dist, !!json.invisible, !!json.interior,\n );\n return ClipPlane.createNormalAndDistance(Vector3d.unitZ(), 0, false, false, result);\n }\n /** Set both the invisible and interior flags. */\n public setFlags(invisible: boolean, interior: boolean) {\n this._invisible = invisible;\n this._interior = interior;\n }\n /** Return the stored distanceFromOrigin property. */\n public get distance() {\n return this._distanceFromOrigin;\n }\n /** * Return the stored inward normal property. */\n public get inwardNormalRef(): Vector3d {\n return this._inwardNormal;\n }\n /** Return the \"interior\" property flag. Interpretation of this flag is algorithm-specific. */\n public get interior() {\n return this._interior;\n }\n /** Return the \"invisible\" property flag. Interpretation of this flag is algorithm-specific. */\n public get invisible() {\n return this._invisible;\n }\n /**\n * Create a plane defined by two points, an up vector, and a tilt angle relative to the up vector.\n * @param point0 start point of the edge\n * @param point1 end point of the edge\n * @param upVector vector perpendicular to the plane\n * @param tiltAngle angle to tilt the plane around the edge in the direction of the up vector.\n * @param result optional preallocated plane\n */\n public static createEdgeAndUpVector(\n point0: Point3d, point1: Point3d, upVector: Vector3d, tiltAngle?: Angle, result?: ClipPlane,\n ): ClipPlane | undefined {\n const edgeVector = Vector3d.createFrom(point1.minus(point0));\n let normal = (upVector.crossProduct(edgeVector)).normalize();\n\n if (normal) {\n if (tiltAngle !== undefined && !tiltAngle.isAlmostZero) {\n const tiltNormal = Vector3d.createRotateVectorAroundVector(normal, edgeVector, tiltAngle);\n if (tiltNormal) {\n normal = tiltNormal.clone();\n }\n }\n normal.negate(normal);\n return ClipPlane.createNormalAndPoint(normal, point0, false, false, result);\n }\n return undefined;\n }\n /** Create a plane perpendicular to the edge between the xy parts of point0 and point1. */\n public static createEdgeXY(point0: XYAndZ, point1: XYAndZ, result?: ClipPlane): ClipPlane | undefined {\n const normal = Vector3d.create(point0.y - point1.y, point1.x - point0.x);\n if (normal.normalizeInPlace())\n return ClipPlane.createNormalAndPoint(normal, point0, false, false, result);\n return undefined;\n }\n /**\n * Variant of [[createEdgeXY]] that computes the plane using the edge midpoint instead of its start point.\n * * This is more stable for creating a pair of clip planes from a long edge and its reversal, as is commonly found\n * in a [[UnionOfConvexClipPlaneSets]].\n */\n public static createMidPointEdgeXY(point0: XYAndZ, point1: XYAndZ, result?: ClipPlane): ClipPlane | undefined {\n return ClipPlane.createNormalAndPointXYZXYZ(\n point0.y - point1.y, point1.x - point0.x, 0,\n 0.5 * (point0.x + point1.x), 0.5 * (point0.y + point1.y), 0,\n false, false, result,\n );\n }\n /**\n * Return the Plane3d form of the plane.\n * * The plane origin is the point `distance * inwardNormal`\n * * The plane normal is the inward normal of the ClipPlane.\n */\n public getPlane3d(): Plane3dByOriginAndUnitNormal {\n const d = this._distanceFromOrigin;\n // normal should be normalized, will not return undefined\n return Plane3dByOriginAndUnitNormal.create(\n Point3d.create(this._inwardNormal.x * d, this._inwardNormal.y * d, this._inwardNormal.z * d),\n this._inwardNormal,\n )!;\n }\n /**\n * Return the Point4d d form of the plane.\n * * The homogeneous xyz are the inward normal xyz.\n * * The homogeneous weight is the negated ClipPlane distance.\n */\n public getPlane4d(): Point4d {\n return Point4d.create(\n this._inwardNormal.x, this._inwardNormal.y, this._inwardNormal.z, - this._distanceFromOrigin,\n );\n }\n /**\n * Set the plane from DPoint4d style plane.\n * * The saved plane has its direction normalized.\n * * This preserves the plane itself as a zero set but make plane evaluations act as true distances (even if the\n * plane coefficients are scaled otherwise).\n * @param plane the DPoint4d style plane.\n */\n public setPlane4d(plane: Point4d) {\n const a = Math.sqrt(plane.x * plane.x + plane.y * plane.y + plane.z * plane.z);\n const r = a === 0.0 ? 1.0 : 1.0 / a;\n this._inwardNormal.x = r * plane.x;\n this._inwardNormal.y = r * plane.y;\n this._inwardNormal.z = r * plane.z;\n this._distanceFromOrigin = -r * plane.w;\n }\n /**\n * Evaluate the altitude in weighted space, i.e. (dot product with inward normal) minus distance, with point.w\n * scale applied to distance.\n * @param point space point to test.\n */\n public weightedAltitude(point: Point4d): number {\n return point.x * this._inwardNormal.x\n + point.y * this._inwardNormal.y\n + point.z * this._inwardNormal.z\n - point.w * this._distanceFromOrigin;\n }\n /**\n * Evaluate the distance from the plane to a point in space, i.e. (dot product with inward normal) minus distance.\n * @param point space point to test.\n */\n public altitude(point: Point3d): number {\n return point.x * this._inwardNormal.x\n + point.y * this._inwardNormal.y\n + point.z * this._inwardNormal.z\n - this._distanceFromOrigin;\n }\n /**\n * Evaluate the distance from the plane to a point in space with point given as x,y,z, i.e. (dot product with\n * inward normal) minus distance.\n * @param point space point to test.\n */\n public altitudeXYZ(x: number, y: number, z: number): number {\n return x * this._inwardNormal.x\n + y * this._inwardNormal.y\n + z * this._inwardNormal.z\n - this._distanceFromOrigin;\n }\n /** Return the x component of the normal used to evaluate altitude. */\n public normalX(): number {\n return this._inwardNormal.x;\n }\n /** Return the x component of the normal used to evaluate altitude. */\n public normalY(): number {\n return this._inwardNormal.y;\n }\n /** Return the z component of the normal used to evaluate altitude. */\n public normalZ(): number {\n return this._inwardNormal.z;\n }\n /** Return the dot product of the plane normal with the vector (NOT using the plane's distanceFromOrigin). */\n public velocity(vector: Vector3d): number {\n return vector.x * this._inwardNormal.x + vector.y * this._inwardNormal.y + vector.z * this._inwardNormal.z;\n }\n /**\n * Return the dot product of the plane normal with the x,yz, vector components (NOT using the plane's\n * distanceFromOrigin).\n */\n public velocityXYZ(x: number, y: number, z: number): number {\n return x * this._inwardNormal.x + y * this._inwardNormal.y + z * this._inwardNormal.z;\n }\n /**\n * Return the dot product of the plane normal with the point (treating the point xyz as a vector, and NOT\n * using the plane's distanceFromOrigin).\n */\n public dotProductPlaneNormalPoint(point: Point3d): number {\n return point.x * this._inwardNormal.x + point.y * this._inwardNormal.y + point.z * this._inwardNormal.z;\n }\n /**\n * Return true if spacePoint is inside or on the plane, with tolerance applied to \"on\".\n * @param spacePoint point to test.\n * @param tolerance tolerance for considering \"near plane\" to be \"on plane\"\n */\n public isPointOnOrInside(spacePoint: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\n let value = this.altitude(spacePoint);\n if (tolerance) { value += tolerance; }\n return value >= 0.0;\n }\n /**\n * Return true if spacePoint is strictly inside the halfspace, with tolerance applied to \"on\".\n * @param spacePoint point to test.\n * @param tolerance tolerance for considering \"near plane\" to be \"on plane\"\n */\n public isPointInside(point: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\n let value = this.altitude(point);\n if (tolerance) { value -= tolerance; }\n return value > 0.0;\n }\n /**\n * Return true if spacePoint is strictly on the plane, within tolerance\n * @param spacePoint point to test.\n * @param tolerance tolerance for considering \"near plane\" to be \"on plane\"\n */\n public isPointOn(point: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\n return Math.abs(this.altitude(point)) <= tolerance;\n }\n /**\n * Compute intersections of an (UNBOUNDED) arc with the plane. Append them (as radians) to a growing array.\n * @param arc arc to test. The angle limits of the arc are NOT considered.\n * @param intersectionRadians array to receive results\n */\n public appendIntersectionRadians(arc: Arc3d, intersectionRadians: GrowableFloat64Array) {\n const arcVectors = arc.toVectors();\n const alpha = this.altitude(arc.center);\n const beta = this.velocity(arcVectors.vector0);\n const gamma = this.velocity(arcVectors.vector90);\n AnalyticRoots.appendImplicitLineUnitCircleIntersections(\n alpha, beta, gamma, undefined, undefined, intersectionRadians,\n );\n }\n private static _clipArcFractionArray = new GrowableFloat64Array();\n /**\n * Announce fractional intervals of arc clip.\n * * Each call to `announce(fraction0, fraction1, arc)` announces one interval that is inside the clip plane.\n */\n public announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n const breaks = ClipPlane._clipArcFractionArray;\n breaks.clear();\n this.appendIntersectionRadians(arc, breaks);\n arc.sweep.radiansArrayToPositivePeriodicFractions(breaks);\n return ClipUtilities.selectIntervals01(arc, breaks, this, announce);\n }\n /**\n * Compute intersection of (unbounded) segment with the plane.\n * * If the ends are on the same side of the plane, return undefined.\n * * If the intersection is an endpoint or interior to the segment return the fraction.\n * * If both ends are on, return undefined.\n */\n public getBoundedSegmentSimpleIntersection(pointA: Point3d, pointB: Point3d): number | undefined {\n const h0 = this.altitude(pointA);\n const h1 = this.altitude(pointB);\n if (h0 * h1 > 0.0)\n return undefined;\n if (h0 === 0.0 && h1 === 0.0) {\n return undefined;\n }\n return - h0 / (h1 - h0);\n }\n /** Apply transform to the origin. Apply inverse transpose of the matrix part to th normal vector. */\n public transformInPlace(transform: Transform): boolean {\n const plane: Plane3dByOriginAndUnitNormal = this.getPlane3d();\n const matrix: Matrix3d = transform.matrix;\n const newPoint = transform.multiplyPoint3d(plane.getOriginRef());\n // Normal transforms as the inverse transpose of the matrix part\n // BTW: If the matrix is orthogonal, this is a long way to multiply by the matrix part (mumble grumble)\n const newNormal = matrix.multiplyInverseTranspose(plane.getNormalRef());\n if (!newNormal)\n return false;\n\n plane.set(newPoint, newNormal);\n const normalized = (plane.getNormalRef()).normalize();\n if (!normalized)\n return false;\n this._inwardNormal = normalized;\n this._distanceFromOrigin = this._inwardNormal.dotProduct(plane.getOriginRef());\n return true;\n }\n /** Set the invisible flag. Interpretation of this flag is algorithm-specific. */\n public setInvisible(invisible: boolean) {\n this._invisible = invisible;\n }\n /** Reverse the sign of all coefficients, so outside and inside reverse */\n public negateInPlace() {\n this._inwardNormal = this._inwardNormal.negate();\n this._distanceFromOrigin = - this._distanceFromOrigin;\n }\n /**\n * Move the plane INWARD by given distance\n * @param offset distance of shift inwards\n */\n public offsetDistance(offset: number) {\n this._distanceFromOrigin += offset;\n }\n /**\n * Clip a polygon to the inside or outside of the plane.\n * * Results with 2 or fewer points are ignored.\n * * Other than ensuring capacity in the arrays, there are no object allocations during execution of this function.\n * * For a convex input polygon, the output polygon is also convex.\n * * For non-convex input, the output polygon may have double-back edges along plane intersections. This is still a\n * valid clip in a parity sense (overlapping regions cancel).\n * @param xyz input points.\n * @param work optional work buffer\n * @param inside whether the positive side of the plane survives (true, default), or negative side (false).\n * @param tolerance distance tolerance for \"on plane\" decision. Default value is [[Geometry.smallMetricDistance]].\n * @return the number of crossings. If this is larger than 2, the input polygon was non-convex.\n * @see appendPolygonClip\n */\n public clipConvexPolygonInPlace(\n xyz: GrowableXYZArray,\n work?: GrowableXYZArray,\n inside: boolean = true,\n tolerance: number = Geometry.smallMetricDistance,\n ): number {\n return IndexedXYZCollectionPolygonOps.clipConvexPolygonInPlace(this, xyz, work, inside, tolerance);\n }\n /**\n * Multiply the ClipPlane's DPoint4d by matrix.\n * @param matrix matrix to apply.\n * @param invert if true, use in verse of the matrix.\n * @param transpose if true, use the transpose of the matrix (or inverse, per invert parameter)\n * @param matrix matrix to apply\n * @return false if unable to invert\n * * Note that if matrixA is applied to all of space, the matrix to send to this method to get a corresponding\n * effect on the plane is the inverse transpose of matrixA\n * * Callers that will apply the same matrix to many planes should pre-invert the matrix for efficiency.\n * * Both params default to true to get the full effect of transforming space.\n */\n public multiplyPlaneByMatrix4d(matrix: Matrix4d, invert: boolean = true, transpose: boolean = true): boolean {\n const plane: Point4d = this.getPlane4d();\n if (invert) {\n const inverse = matrix.createInverse();\n if (inverse)\n return this.multiplyPlaneByMatrix4d(inverse, false, transpose);\n return false;\n }\n if (transpose)\n matrix.multiplyTransposePoint4d(plane, plane);\n else\n matrix.multiplyPoint4d(plane, plane);\n this.setPlane4d(plane);\n return true;\n }\n /** Announce the interval (if any) where a line is within the clip plane half space. */\n public announceClippedSegmentIntervals(\n f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: (fraction0: number, fraction1: number) => void,\n ): boolean {\n if (f1 < f0)\n return false;\n const h0 = - this.altitude(pointA);\n const h1 = - this.altitude(pointB);\n const delta = h1 - h0;\n const f = Geometry.conditionalDivideFraction(-h0, delta);\n if (f === undefined) { // The segment is parallel to the plane.\n if (h0 <= 0.0) { if (announce) announce(f0, f1); return true; }\n return false;\n }\n if (delta > 0) { // segment aims OUT\n if (f < f1) f1 = f;\n } else {\n // segment aims IN\n if (f > f0)\n f0 = f;\n }\n if (f1 < f0)\n return false;\n if (announce) announce(f0, f1);\n return true;\n }\n /**\n * Return a coordinate frame with\n * * origin at closest point to global origin\n * * z axis points in\n * * x and y are \"in plane\"\n */\n public getFrame(): Transform {\n const d = this._distanceFromOrigin;\n const origin = Point3d.create(this._inwardNormal.x * d, this._inwardNormal.y * d, this._inwardNormal.z * d);\n const matrix = Matrix3d.createRigidHeadsUp(this._inwardNormal, AxisOrder.ZXY);\n return Transform.createOriginAndMatrix(origin, matrix);\n }\n /**\n * Return the intersection of the plane with a range cube.\n * @param range\n * @param xyzOut intersection polygon. This is convex.\n */\n public intersectRange(range: Range3d, addClosurePoint: boolean = false): GrowableXYZArray | undefined {\n if (range.isNull)\n return undefined;\n const corners = range.corners();\n const frameOnPlane = this.getFrame();\n frameOnPlane.multiplyInversePoint3dArrayInPlace(corners);\n const localRange = Range3d.createArray(corners);\n if (localRange.low.z * localRange.high.z > 0.0)\n return undefined;\n // oversized polygon on local z= 0\n const xyzOut = new GrowableXYZArray();\n xyzOut.pushXYZ(localRange.low.x, localRange.low.y, 0);\n xyzOut.pushXYZ(localRange.high.x, localRange.low.y, 0);\n xyzOut.pushXYZ(localRange.high.x, localRange.high.y, 0);\n xyzOut.pushXYZ(localRange.low.x, localRange.high.y, 0);\n xyzOut.multiplyTransformInPlace(frameOnPlane);\n IndexedXYZCollectionPolygonOps.intersectRangeConvexPolygonInPlace(range, xyzOut);\n if (xyzOut.length === 0)\n return undefined;\n if (addClosurePoint)\n xyzOut.pushWrap(1);\n return xyzOut;\n }\n /**\n * Implement appendPolygonClip, as defined in interface PolygonClipper.\n * @param xyz convex polygon. This is not changed.\n * @param insideFragments Array to receive \"inside\" fragments. Each fragment is a GrowableXYZArray grabbed\n * from the cache. This is NOT cleared.\n * @param outsideFragments Array to receive \"outside\" fragments. Each fragment is a GrowableXYZArray grabbed\n * from the cache. This is NOT cleared.\n * @param arrayCache cache for reusable GrowableXYZArray.\n * @see clipConvexPolygonInPlace\n */\n public appendPolygonClip(\n xyz: IndexedXYZCollection,\n insideFragments: GrowableXYZArray[],\n outsideFragments: GrowableXYZArray[],\n arrayCache: GrowableXYZArrayCache,\n ): void {\n const perpendicularRange = Range1d.createNull();\n const newInside = arrayCache.grabFromCache();\n const newOutside = arrayCache.grabFromCache();\n IndexedXYZCollectionPolygonOps.splitConvexPolygonInsideOutsidePlane(\n this, xyz, newInside, newOutside, perpendicularRange,\n );\n ClipUtilities.captureOrDrop(newInside, 3, insideFragments, arrayCache);\n ClipUtilities.captureOrDrop(newOutside, 3, outsideFragments, arrayCache);\n }\n /** Project a point in space to the plane. */\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\n return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);\n }\n /** Return the projection of (x,y,z) onto the plane. */\n public override projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d {\n const scale = -this.altitudeXYZ(x, y, z);\n return Point3d.create(x + scale * this._inwardNormal.x, y + scale * this._inwardNormal.y, z + scale * this._inwardNormal.z, result);\n }\n}\n"]}
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
* @module CartesianGeometry
|
|
3
3
|
*/
|
|
4
4
|
import { Arc3d } from "../curve/Arc3d";
|
|
5
|
+
import { CurveChain } from "../curve/CurveCollection";
|
|
5
6
|
import { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from "../curve/CurvePrimitive";
|
|
6
7
|
import { AnyCurve, AnyRegion } from "../curve/CurveTypes";
|
|
7
8
|
import { GeometryQuery } from "../curve/GeometryQuery";
|
|
9
|
+
import { StrokeOptions } from "../curve/StrokeOptions";
|
|
8
10
|
import { GrowableFloat64Array } from "../geometry3d/GrowableFloat64Array";
|
|
9
11
|
import { GrowableXYZArray } from "../geometry3d/GrowableXYZArray";
|
|
10
12
|
import { IndexedXYZCollection } from "../geometry3d/IndexedXYZCollection";
|
|
@@ -13,7 +15,7 @@ import { Point3d } from "../geometry3d/Point3dVector3d";
|
|
|
13
15
|
import { Range1d, Range3d } from "../geometry3d/Range";
|
|
14
16
|
import { GrowableXYZArrayCache } from "../geometry3d/ReusableObjectCache";
|
|
15
17
|
import { Transform } from "../geometry3d/Transform";
|
|
16
|
-
import { XAndY } from "../geometry3d/XYZProps";
|
|
18
|
+
import { LowAndHighXY, XAndY } from "../geometry3d/XYZProps";
|
|
17
19
|
import { ClipPlane } from "./ClipPlane";
|
|
18
20
|
import { ClipPrimitive } from "./ClipPrimitive";
|
|
19
21
|
import { ClipVector } from "./ClipVector";
|
|
@@ -403,6 +405,17 @@ export declare class ClipUtilities {
|
|
|
403
405
|
* abuts the outer volume of the neighbor faces.
|
|
404
406
|
*/
|
|
405
407
|
static createComplementaryClips(clipper: ConvexClipPlaneSet): UnionOfConvexClipPlaneSets;
|
|
408
|
+
/**
|
|
409
|
+
* Creates clippers for regions closest to the children of a curve chain.
|
|
410
|
+
* * For best results, each child should have length larger than `distanceTol`.
|
|
411
|
+
* @param curveChain A curve chain; xy-only (z-coordinate is ignored). Must have at least 2 children.
|
|
412
|
+
* @param strokeOptions Optional stroke options to control the sampling of the curve chain.
|
|
413
|
+
* @param distanceTol Optional distance tolerance to use when comparing points; default is [[Geometry.smallMetricDistance]].
|
|
414
|
+
* @param boundingBox Optional nominal xy-bounding box for the clipper regions; default is maximal clipper regions.
|
|
415
|
+
* @returns An ordered array of clippers, each of which represents the region closest to the corresponding primitive in the
|
|
416
|
+
* input chain, or undefined if the input is invalid.
|
|
417
|
+
*/
|
|
418
|
+
static createClippersForRegionsClosestToCurvePrimitivesXY(curveChain: CurveChain, strokeOptions?: StrokeOptions, distanceTol?: number, boundingBox?: LowAndHighXY): UnionOfConvexClipPlaneSets[] | undefined;
|
|
406
419
|
}
|
|
407
420
|
export {};
|
|
408
421
|
//# sourceMappingURL=ClipUtils.d.ts.map
|