@itwin/core-geometry 5.5.0-dev.4 → 5.5.0-dev.6
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/lib/cjs/Geometry.d.ts +7 -0
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +9 -0
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +2 -1
- 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 +4 -1
- package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3d.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurve3d.js +14 -4
- package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3dH.d.ts +2 -0
- package/lib/cjs/bspline/BezierCurve3dH.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurve3dH.js +19 -3
- package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.d.ts +8 -2
- package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.js +10 -4
- package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js +4 -4
- package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +0 -3
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +9 -2
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.d.ts +59 -9
- package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +124 -55
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +1 -1
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipVector.js +12 -8
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +0 -2
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +19 -18
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js +4 -5
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +0 -1
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +0 -1
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.js +2 -2
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +12 -4
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +52 -33
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +13 -6
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.js +1 -1
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +13 -1
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +12 -4
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +14 -5
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +5 -4
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +7 -4
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +25 -16
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +90 -72
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Path.d.ts +0 -3
- package/lib/cjs/curve/Path.d.ts.map +1 -1
- package/lib/cjs/curve/Path.js +9 -2
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js +25 -31
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.d.ts +7 -1
- package/lib/cjs/curve/Query/StrokeCountChain.d.ts.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js +27 -36
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.d.ts.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js +7 -1
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +8 -5
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js +6 -6
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js +4 -1
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js +6 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +5 -21
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +29 -73
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +55 -13
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +238 -110
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts +1 -4
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js +9 -9
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts +11 -14
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +18 -18
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts +7 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.d.ts +19 -7
- package/lib/cjs/geometry3d/Ellipsoid.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js +26 -11
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/FrustumAnimation.d.ts.map +1 -1
- package/lib/cjs/geometry3d/FrustumAnimation.js +11 -1
- package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts +5 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js +11 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +49 -8
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +90 -37
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +100 -3
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +125 -0
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +10 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +53 -34
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts +49 -2
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js +67 -9
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +24 -32
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +147 -180
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +5 -5
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +13 -3
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts +0 -3
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +5 -1
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.d.ts +2 -2
- package/lib/cjs/geometry3d/SortablePolygon.d.ts.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js +14 -18
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +8 -0
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +15 -9
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/numerics/ClusterableArray.d.ts +4 -2
- package/lib/cjs/numerics/ClusterableArray.d.ts.map +1 -1
- package/lib/cjs/numerics/ClusterableArray.js +6 -4
- package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
- package/lib/cjs/numerics/Newton.d.ts +3 -1
- package/lib/cjs/numerics/Newton.d.ts.map +1 -1
- package/lib/cjs/numerics/Newton.js +5 -1
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/polyface/AuxData.d.ts +1 -4
- package/lib/cjs/polyface/AuxData.d.ts.map +1 -1
- package/lib/cjs/polyface/AuxData.js +5 -1
- package/lib/cjs/polyface/AuxData.js.map +1 -1
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js +3 -3
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +14 -16
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +84 -28
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +277 -217
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.d.ts +4 -3
- package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js +11 -4
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- 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 +9 -7
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js +3 -2
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +2 -2
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js +14 -12
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.d.ts +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js +10 -6
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js +4 -3
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +3 -5
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/XYPointBuckets.d.ts +1 -1
- package/lib/cjs/polyface/multiclip/XYPointBuckets.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/XYPointBuckets.js +4 -8
- package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.js +1 -0
- package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js +37 -7
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.d.ts +4 -4
- package/lib/cjs/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js +24 -40
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js +9 -3
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.d.ts +0 -3
- package/lib/cjs/serialization/SerializationHelpers.d.ts.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.js +16 -7
- package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
- package/lib/cjs/solid/Box.d.ts +2 -2
- package/lib/cjs/solid/Box.d.ts.map +1 -1
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.d.ts +3 -2
- package/lib/cjs/solid/Cone.d.ts.map +1 -1
- package/lib/cjs/solid/Cone.js +4 -1
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
- package/lib/cjs/solid/LinearSweep.js +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js +1 -3
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.d.ts +4 -3
- package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.d.ts +4 -4
- package/lib/cjs/topology/ChainMerge.d.ts.map +1 -1
- package/lib/cjs/topology/ChainMerge.js +11 -1
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts +2 -0
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +5 -0
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js +2 -0
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js +23 -16
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.d.ts +20 -9
- package/lib/cjs/topology/HalfEdgePositionDetail.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.js +17 -13
- package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js +3 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts +6 -2
- package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.js +41 -35
- package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/cjs/topology/MaskManager.d.ts +7 -3
- package/lib/cjs/topology/MaskManager.d.ts.map +1 -1
- package/lib/cjs/topology/MaskManager.js +10 -4
- package/lib/cjs/topology/MaskManager.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.d.ts.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/Triangulation.d.ts +2 -1
- package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
- package/lib/cjs/topology/Triangulation.js +12 -7
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/esm/Geometry.d.ts +7 -0
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +9 -0
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +2 -1
- 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 +4 -1
- package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3d.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurve3d.js +14 -4
- package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3dH.d.ts +2 -0
- package/lib/esm/bspline/BezierCurve3dH.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurve3dH.js +19 -3
- package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.d.ts +8 -2
- package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js +10 -4
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js +4 -4
- package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +0 -3
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +9 -2
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts +59 -9
- package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +124 -55
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +1 -1
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
- package/lib/esm/clipping/ClipVector.js +12 -8
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +0 -2
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +20 -19
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js +4 -5
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +0 -1
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +0 -1
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.js +2 -2
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +12 -4
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +53 -34
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +13 -6
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.js +1 -1
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +13 -1
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +12 -4
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +14 -5
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +5 -4
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +7 -4
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +25 -16
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +90 -72
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Path.d.ts +0 -3
- package/lib/esm/curve/Path.d.ts.map +1 -1
- package/lib/esm/curve/Path.js +9 -2
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/Query/InOutTests.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js +25 -31
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.d.ts +7 -1
- package/lib/esm/curve/Query/StrokeCountChain.d.ts.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js +27 -36
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.d.ts.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js +7 -1
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +8 -5
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js +6 -6
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js +4 -1
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js +6 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +5 -21
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +29 -73
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +55 -13
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +239 -111
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts +1 -4
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js +9 -9
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts +11 -14
- package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js +18 -18
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts +7 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.d.ts +19 -7
- package/lib/esm/geometry3d/Ellipsoid.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js +26 -11
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/FrustumAnimation.d.ts.map +1 -1
- package/lib/esm/geometry3d/FrustumAnimation.js +11 -1
- package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.d.ts +5 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js +11 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.d.ts +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts +49 -8
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +90 -37
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +100 -3
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +125 -0
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +10 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +53 -34
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts +49 -2
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js +67 -9
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js +1 -1
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +24 -32
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +147 -180
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +5 -5
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +13 -3
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts +0 -3
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +5 -1
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.d.ts +2 -2
- package/lib/esm/geometry3d/SortablePolygon.d.ts.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js +14 -18
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +8 -0
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +15 -9
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/numerics/ClusterableArray.d.ts +4 -2
- package/lib/esm/numerics/ClusterableArray.d.ts.map +1 -1
- package/lib/esm/numerics/ClusterableArray.js +6 -4
- package/lib/esm/numerics/ClusterableArray.js.map +1 -1
- package/lib/esm/numerics/Newton.d.ts +3 -1
- package/lib/esm/numerics/Newton.d.ts.map +1 -1
- package/lib/esm/numerics/Newton.js +5 -1
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/polyface/AuxData.d.ts +1 -4
- package/lib/esm/polyface/AuxData.d.ts.map +1 -1
- package/lib/esm/polyface/AuxData.js +5 -1
- package/lib/esm/polyface/AuxData.js.map +1 -1
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js +3 -3
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +14 -16
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +84 -28
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +277 -217
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.d.ts +4 -3
- package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js +11 -4
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- 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 +9 -7
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js +3 -2
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js +2 -2
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js +14 -12
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.d.ts +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js +10 -6
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js +4 -3
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +3 -5
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/XYPointBuckets.d.ts +1 -1
- package/lib/esm/polyface/multiclip/XYPointBuckets.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/XYPointBuckets.js +4 -8
- package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.js +1 -0
- package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBReader.js +37 -7
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.d.ts +4 -4
- package/lib/esm/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js +24 -40
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js +9 -3
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.d.ts +0 -3
- package/lib/esm/serialization/SerializationHelpers.d.ts.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.js +16 -7
- package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
- package/lib/esm/solid/Box.d.ts +2 -2
- package/lib/esm/solid/Box.d.ts.map +1 -1
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.d.ts +3 -2
- package/lib/esm/solid/Cone.d.ts.map +1 -1
- package/lib/esm/solid/Cone.js +4 -1
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.d.ts +1 -1
- package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
- package/lib/esm/solid/LinearSweep.js +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/esm/solid/RotationalSweep.js +1 -3
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/TorusPipe.d.ts +4 -3
- package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.d.ts +4 -4
- package/lib/esm/topology/ChainMerge.d.ts.map +1 -1
- package/lib/esm/topology/ChainMerge.js +11 -1
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +2 -0
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +5 -0
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js +2 -0
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js +23 -16
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.d.ts +20 -9
- package/lib/esm/topology/HalfEdgePositionDetail.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.js +17 -13
- package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js +4 -2
- package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.d.ts +6 -2
- package/lib/esm/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js +41 -35
- package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/esm/topology/MaskManager.d.ts +7 -3
- package/lib/esm/topology/MaskManager.d.ts.map +1 -1
- package/lib/esm/topology/MaskManager.js +10 -4
- package/lib/esm/topology/MaskManager.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.d.ts.map +1 -1
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/Triangulation.d.ts +2 -1
- package/lib/esm/topology/Triangulation.d.ts.map +1 -1
- package/lib/esm/topology/Triangulation.js +12 -7
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/package.json +3 -3
- package/lib/cjs/serialization/GeometrySamples.d.ts +0 -705
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +0 -1
- package/lib/cjs/serialization/GeometrySamples.js +0 -2433
- package/lib/cjs/serialization/GeometrySamples.js.map +0 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +0 -705
- package/lib/esm/serialization/GeometrySamples.d.ts.map +0 -1
- package/lib/esm/serialization/GeometrySamples.js +0 -2428
- package/lib/esm/serialization/GeometrySamples.js.map +0 -1
|
@@ -103,7 +103,7 @@ class Plane3dByOriginAndUnitNormal extends Plane3d_1.Plane3d {
|
|
|
103
103
|
*/
|
|
104
104
|
static createXYZUVW(ax, ay, az, ux, uy, uz, result) {
|
|
105
105
|
const magU = Geometry_1.Geometry.hypotenuseXYZ(ux, uy, uz);
|
|
106
|
-
if (magU
|
|
106
|
+
if (magU <= Geometry_1.Geometry.smallFraction) // cf. Vector3d.normalizeWithLength
|
|
107
107
|
return undefined;
|
|
108
108
|
if (result) {
|
|
109
109
|
result._origin.set(ax, ay, az);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plane3dByOriginAndUnitNormal.js","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndUnitNormal.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,0CAAmE;AACnE,uCAAoC;AAGpC,yCAAsC;AACtC,uDAAsD;AACtD,2CAAwC;AAGxC;;;;;GAKG;AACH,MAAa,4BAA6B,SAAQ,iBAAO;IAC/C,OAAO,CAAU;IACjB,OAAO,CAAW;IAC1B,sCAAsC;IACtC,YAAoB,MAAe,EAAE,MAAgB;QACnD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IACD,yEAAyE;IACjE,MAAM,CAAC,OAAO,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;QACrF,OAAO,IAAI,4BAA4B,CAAC,yBAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,0BAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7F,CAAC;IACD;;;OAGG;IACI,MAAM,CAAC,aAAa,CAAC,MAAgB;QAC1C,IAAI,MAAM;YACR,OAAO,4BAA4B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACrF,OAAO,4BAA4B,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAChE,CAAC;IACD;;;O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AE,CAAC,CAAC,CAAC;QACzE,OAAO,yBAAO,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACpH,CAAC;IACD;;;OAGG;IACa,cAAc,CAAC,UAAmB,EAAE,YAAoB,mBAAQ,CAAC,mBAAmB;QAClG,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;IACzC,CAAC;CACF;AA/UD,oEA+UC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\nimport { AxisOrder, BeJSONFunctions, Geometry } from \"../Geometry\";\r\nimport { Plane3d } from \"./Plane3d\";\r\nimport { Point4d } from \"../geometry4d/Point4d\";\r\nimport { Angle } from \"./Angle\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { Transform } from \"./Transform\";\r\nimport { XAndY } from \"./XYZProps\";\r\n\r\n/**\r\n * A plane defined by\r\n * * Any point on the plane.\r\n * * a unit normal.\r\n * @public\r\n */\r\nexport class Plane3dByOriginAndUnitNormal extends Plane3d implements BeJSONFunctions {\r\n private _origin: Point3d;\r\n private _normal: Vector3d;\r\n // constructor captures references !!!\r\n private constructor(origin: Point3d, normal: Vector3d) {\r\n super();\r\n this._origin = origin;\r\n this._normal = normal;\r\n }\r\n // This is private because it does not check validity of the unit vector.\r\n private static _create(x: number, y: number, z: number, u: number, v: number, w: number) {\r\n return new Plane3dByOriginAndUnitNormal(Point3d.create(x, y, z), Vector3d.create(u, v, w));\r\n }\r\n /**\r\n * Create a plane parallel to the XY plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createXYPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 0, 1);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 0, 1);\r\n }\r\n /**\r\n * Create a plane parallel to the YZ plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createYZPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 1, 0, 0);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 1, 0, 0);\r\n }\r\n /**\r\n * Create a plane parallel to the ZX plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createZXPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 1, 0);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 1, 0);\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal with given origin and normal.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if `normal.normalize()` returns undefined.\r\n */\r\n public static create(\r\n origin: Point3d, normal: Vector3d, result?: Plane3dByOriginAndUnitNormal,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n if (result) {\r\n if (normal.normalize(result._normal) === undefined)\r\n return undefined;\r\n origin.clone(result._origin);\r\n return result;\r\n }\r\n const normalized = normal.normalize();\r\n if (normalized === undefined)\r\n return undefined;\r\n return new Plane3dByOriginAndUnitNormal(origin.clone(), normalized);\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal from a variety of plane types.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if `source.getUnitNormal()` returns undefined.\r\n */\r\n public static createFrom(\r\n source: Plane3d, result?: Plane3dByOriginAndUnitNormal,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n if (source instanceof Plane3dByOriginAndUnitNormal)\r\n return source.clone(result);\r\n if (result) {\r\n if (source.getUnitNormal(result._normal) === undefined)\r\n return undefined;\r\n source.getAnyPointOnPlane(result._origin);\r\n return result;\r\n }\r\n const normal = source.getUnitNormal();\r\n if (normal === undefined)\r\n return undefined;\r\n const origin = source.getAnyPointOnPlane();\r\n return new Plane3dByOriginAndUnitNormal(origin, normal);\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal with direct coordinates of origin and normal.\r\n * * Returns undefined if the normal vector is all zeros.\r\n * * If unable to normalize return undefined. (And if result is given it is left unchanged)\r\n */\r\n public static createXYZUVW(\r\n ax: number, ay: number, az: number, ux: number, uy: number, uz: number, result?: Plane3dByOriginAndUnitNormal,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const magU = Geometry.hypotenuseXYZ(ux, uy, uz);\r\n if (magU < Geometry.smallMetricDistance)\r\n return undefined;\r\n if (result) {\r\n result._origin.set(ax, ay, az);\r\n result._normal.set(ux / magU, uy / magU, uz / magU);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(Point3d.create(ax, ay, az), Vector3d.create(ux / magU, uy / magU, uz / magU));\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal with unit normal (a) in the xy plane (b) perpendicular to the line\r\n * defined by xy parts of origin to target.\r\n * * origin and normal both have z = 0.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if the normal vector is all zeros.\r\n */\r\n public static createOriginAndTargetXY(\r\n origin: XAndY, target: XAndY, result?: Plane3dByOriginAndUnitNormal,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const ux = target.x - origin.x;\r\n const uy = target.y - origin.y;\r\n return this.createXYZUVW(origin.x, origin.y, 0.0, uy, -ux, 0.0, result);\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal with xy origin (at z=0) and normal angle in xy plane.\r\n * * Returns undefined if the normal vector is all zeros.\r\n */\r\n public static createXYAngle(\r\n x: number, y: number, normalAngleFromX: Angle, result?: Plane3dByOriginAndUnitNormal,\r\n ): Plane3dByOriginAndUnitNormal {\r\n if (result) {\r\n result._origin.set(x, y, 0.0);\r\n result._normal.set(normalAngleFromX.cos(), normalAngleFromX.sin(), 0.0);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(\r\n Point3d.create(x, y, 0), Vector3d.create(normalAngleFromX.cos(), normalAngleFromX.sin()),\r\n );\r\n }\r\n /**\r\n * Create a plane defined by two points and an in-plane vector.\r\n * @param pointA any point in the plane\r\n * @param pointB any other point in the plane\r\n * @param vector any vector in the plane but not parallel to the vector from pointA to pointB\r\n */\r\n public static createPointPointVectorInPlane(\r\n pointA: Point3d, pointB: Point3d, vector: Vector3d,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = vector.crossProductStartEnd(pointA, pointB);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n /**\r\n * Create a plane defined by three points.\r\n * @param pointA any point in the plane. This will be the origin.\r\n * @param pointB any other point in the plane\r\n * @param pointC any third point in the plane but not on the line of pointA and pointB\r\n */\r\n public static createOriginAndTargets(\r\n pointA: Point3d, pointB: Point3d, pointC: Point3d,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = pointA.crossProductToPoints(pointB, pointC);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n /**\r\n * Create a plane defined by a point and two vectors in the plane\r\n * @param pointA any point in the plane\r\n * @param vectorB any vector in the plane\r\n * @param vectorC any vector in the plane but not parallel to vectorB\r\n */\r\n public static createOriginAndVectors(\r\n pointA: Point3d, vectorB: Vector3d, vectorC: Vector3d,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = vectorB.crossProduct(vectorC);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n /** Test for (toleranced) equality with `other` */\r\n public isAlmostEqual(other: Plane3dByOriginAndUnitNormal): boolean {\r\n return this._origin.isAlmostEqual(other._origin) && this._normal.isAlmostEqual(other._normal);\r\n }\r\n /** Parse a json fragment `{origin: [x,y,z], normal: [ux,uy,uz]}` */\r\n public setFromJSON(json?: any): void {\r\n if (!json) {\r\n this._origin.set(0, 0, 0);\r\n this._normal.set(0, 0, 1);\r\n } else {\r\n this._origin.setFromJSON(json.origin);\r\n this._normal.setFromJSON(json.normal);\r\n }\r\n }\r\n /**\r\n * Convert to a JSON object.\r\n * @return {*} [origin,normal]\r\n */\r\n public toJSON(): any {\r\n return { origin: this._origin.toJSON(), normal: this._normal.toJSON() };\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal from json fragment.\r\n * * See `Plane3dByOriginAndUnitNormal.setFromJSON`\r\n */\r\n public static fromJSON(json?: any): Plane3dByOriginAndUnitNormal {\r\n const result = Plane3dByOriginAndUnitNormal.createXYPlane();\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Return a reference to the origin. */\r\n public getOriginRef(): Point3d {\r\n return this._origin;\r\n }\r\n /** Return a reference to the unit normal. */\r\n public getNormalRef(): Vector3d {\r\n return this._normal;\r\n }\r\n /**\r\n * Return coordinate axes (as a transform) with\r\n * * origin at plane origin\r\n * * z axis in direction of plane normal.\r\n * * x,y axes in plane.\r\n */\r\n public getLocalToWorld(): Transform {\r\n const axes = Matrix3d.createRigidHeadsUp(this._normal, AxisOrder.ZXY);\r\n return Transform.createRefs(this._origin.clone(), axes);\r\n }\r\n /** Return a (singular) transform which projects points to this plane. */\r\n public getProjectionToPlane(): Transform {\r\n const axes = Matrix3d.createIdentity();\r\n axes.addScaledOuterProductInPlace(this._normal, this._normal, -1.0);\r\n axes.markSingular();\r\n return Transform.createFixedPointAndMatrix(this._origin, axes);\r\n }\r\n /** Copy coordinates from the given origin and normal. */\r\n public set(origin: Point3d, normal: Vector3d): void {\r\n this._origin.setFrom(origin);\r\n this._normal.setFrom(normal);\r\n }\r\n /** Return a deep clone (point and normal cloned) */\r\n public clone(result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal {\r\n if (result) {\r\n result.set(this._origin, this._normal);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(this._origin.clone(), this._normal.clone());\r\n }\r\n /** Create a clone and return the transform of the clone. */\r\n public cloneTransformed(transform: Transform, inverse: boolean = false): Plane3dByOriginAndUnitNormal | undefined {\r\n const result = this.clone();\r\n if (inverse) {\r\n transform.multiplyInversePoint3d(result._origin, result._origin);\r\n if (transform.matrix.multiplyTransposeVector(result._normal, result._normal) !== undefined\r\n && result._normal.normalizeInPlace())\r\n return result;\r\n } else {\r\n transform.multiplyPoint3d(result._origin, result._origin);\r\n if (transform.matrix.multiplyInverseTranspose(result._normal, result._normal) !== undefined\r\n && result._normal.normalizeInPlace())\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n /** Copy data from the given plane. */\r\n public setFrom(source: Plane3dByOriginAndUnitNormal): void {\r\n this.set(source._origin, source._normal);\r\n }\r\n /** Return the altitude of spacePoint above or below the plane. (Below is negative) */\r\n public altitude(spacePoint: Point3d): number {\r\n return this._normal.dotProductStartEnd(this._origin, spacePoint);\r\n }\r\n /** Return the altitude of point (x,y) given xy parts using only the xy parts of origin and unit normal */\r\n public altitudeXY(x: number, y: number): number {\r\n return (x - this._origin.x) * this._normal.x + (y - this._origin.y) * this._normal.y;\r\n }\r\n /** Return the x component of the normal used to evaluate altitude. */\r\n public normalX(): number {\r\n return this._normal.x;\r\n }\r\n /** Return the x component of the normal used to evaluate altitude. */\r\n public normalY(): number {\r\n return this._normal.y;\r\n }\r\n /** Return the z component of the normal used to evaluate altitude. */\r\n public normalZ(): number {\r\n return this._normal.z;\r\n }\r\n /** Return (a clone of) the unit normal. */\r\n public override getUnitNormal(result?: Vector3d): Vector3d | undefined {\r\n return this._normal.clone(result);\r\n }\r\n /** Return (a clone of) the origin. */\r\n public override getAnyPointOnPlane(result?: Point3d): Point3d {\r\n // This function returns the plane origin. In general, a point x is on the plane if and only if (x-o).n = 0.\r\n return this._origin.clone(result);\r\n }\r\n /** Return the signed altitude of weighted spacePoint above or below the plane. (Below is negative) */\r\n public weightedAltitude(spacePoint: Point4d): number {\r\n return this._normal.dotProductStart3dEnd4d(this._origin, spacePoint);\r\n }\r\n /** Return any point at specified (signed) altitude. */\r\n public altitudeToPoint(altitude: number, result?: Point3d): Point3d {\r\n return this._origin.plusScaled(this._normal, altitude, result);\r\n }\r\n /**\r\n * Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\r\n * for a point moving at speed one along the spaceVector.\r\n */\r\n public velocityXYZ(x: number, y: number, z: number): number {\r\n return this._normal.dotProductXYZ(x, y, z);\r\n }\r\n /**\r\n * Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\r\n * for a point moving at speed one along the spaceVector.\r\n */\r\n public velocity(spaceVector: Vector3d): number {\r\n return this._normal.dotProduct(spaceVector);\r\n }\r\n /** Return the altitude of a point given as separate x,y,z components. */\r\n public altitudeXYZ(x: number, y: number, z: number): number {\r\n return this._normal.dotProductStartEndXYZ(this._origin, x, y, z);\r\n }\r\n /** Return the altitude of a point given as separate x,y,z,w components. */\r\n public altitudeXYZW(x: number, y: number, z: number, w: number): number {\r\n return this._normal.dotProductStartEndXYZW(this._origin, x, y, z, w);\r\n }\r\n /** Return the projection of spacePoint onto the plane. */\r\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\r\n return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);\r\n }\r\n /** Return the projection of (x,y,z) onto the plane. */\r\n public override projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d {\r\n const scale = -this._normal.dotProductStartEndXYZ(this._origin, x, y, z);\r\n return Point3d.create(x + scale * this._normal.x, y + scale * this._normal.y, z + scale * this._normal.z, result);\r\n }\r\n /**\r\n * Returns true if spacePoint is within distance tolerance of the plane.\r\n * * This logic is identical to the [[Plane3d]] method but avoids a level of function call.\r\n */\r\n public override isPointInPlane(spacePoint: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n const altitude = this._normal.dotProductStartEnd(this._origin, spacePoint);\r\n return Math.abs(altitude) <= tolerance;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Plane3dByOriginAndUnitNormal.js","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndUnitNormal.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,0CAAmE;AACnE,uCAAoC;AAGpC,yCAAsC;AACtC,uDAAsD;AACtD,2CAAwC;AAGxC;;;;;GAKG;AACH,MAAa,4BAA6B,SAAQ,iBAAO;IAC/C,OAAO,CAAU;IACjB,OAAO,CAAW;IAC1B,sCAAsC;IACtC,YAAoB,MAAe,EAAE,MAAgB;QACnD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IACD,yEAAyE;IACjE,MAAM,CAAC,OAAO,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;QACrF,OAAO,IAAI,4BAA4B,CAAC,yBAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,0BAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7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A0D;IACnD,mBAAmB,CAAC,UAAmB,EAAE,MAAgB;QAC9D,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAClF,CAAC;IACD,uDAAuD;IACvC,iBAAiB,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,MAAgB;QACjF,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACzE,OAAO,yBAAO,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACpH,CAAC;IACD;;;OAGG;IACa,cAAc,CAAC,UAAmB,EAAE,YAAoB,mBAAQ,CAAC,mBAAmB;QAClG,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;IACzC,CAAC;CACF;AA/UD,oEA+UC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\nimport { AxisOrder, BeJSONFunctions, Geometry } from \"../Geometry\";\r\nimport { Plane3d } from \"./Plane3d\";\r\nimport { Point4d } from \"../geometry4d/Point4d\";\r\nimport { Angle } from \"./Angle\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { Transform } from \"./Transform\";\r\nimport { XAndY } from \"./XYZProps\";\r\n\r\n/**\r\n * A plane defined by\r\n * * Any point on the plane.\r\n * * a unit normal.\r\n * @public\r\n */\r\nexport class Plane3dByOriginAndUnitNormal extends Plane3d implements BeJSONFunctions {\r\n private _origin: Point3d;\r\n private _normal: Vector3d;\r\n // constructor captures references !!!\r\n private constructor(origin: Point3d, normal: Vector3d) {\r\n super();\r\n this._origin = origin;\r\n this._normal = normal;\r\n }\r\n // This is private because it does not check validity of the unit vector.\r\n private static _create(x: number, y: number, z: number, u: number, v: number, w: number) {\r\n return new Plane3dByOriginAndUnitNormal(Point3d.create(x, y, z), Vector3d.create(u, v, w));\r\n }\r\n /**\r\n * Create a plane parallel to the XY plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createXYPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 0, 1);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 0, 1);\r\n }\r\n /**\r\n * Create a plane parallel to the YZ plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createYZPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 1, 0, 0);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 1, 0, 0);\r\n }\r\n /**\r\n * Create a plane parallel to the ZX plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createZXPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 1, 0);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 1, 0);\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal with given origin and normal.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if `normal.normalize()` returns undefined.\r\n */\r\n public static create(\r\n origin: Point3d, normal: Vector3d, result?: Plane3dByOriginAndUnitNormal,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n if (result) {\r\n if (normal.normalize(result._normal) === undefined)\r\n return undefined;\r\n origin.clone(result._origin);\r\n return result;\r\n }\r\n const normalized = normal.normalize();\r\n if (normalized === undefined)\r\n return undefined;\r\n return new Plane3dByOriginAndUnitNormal(origin.clone(), normalized);\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal from a variety of plane types.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if `source.getUnitNormal()` returns undefined.\r\n */\r\n public static createFrom(\r\n source: Plane3d, result?: Plane3dByOriginAndUnitNormal,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n if (source instanceof Plane3dByOriginAndUnitNormal)\r\n return source.clone(result);\r\n if (result) {\r\n if (source.getUnitNormal(result._normal) === undefined)\r\n return undefined;\r\n source.getAnyPointOnPlane(result._origin);\r\n return result;\r\n }\r\n const normal = source.getUnitNormal();\r\n if (normal === undefined)\r\n return undefined;\r\n const origin = source.getAnyPointOnPlane();\r\n return new Plane3dByOriginAndUnitNormal(origin, normal);\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal with direct coordinates of origin and normal.\r\n * * Returns undefined if the normal vector is all zeros.\r\n * * If unable to normalize return undefined. (And if result is given it is left unchanged)\r\n */\r\n public static createXYZUVW(\r\n ax: number, ay: number, az: number, ux: number, uy: number, uz: number, result?: Plane3dByOriginAndUnitNormal,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const magU = Geometry.hypotenuseXYZ(ux, uy, uz);\r\n if (magU <= Geometry.smallFraction) // cf. Vector3d.normalizeWithLength\r\n return undefined;\r\n if (result) {\r\n result._origin.set(ax, ay, az);\r\n result._normal.set(ux / magU, uy / magU, uz / magU);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(Point3d.create(ax, ay, az), Vector3d.create(ux / magU, uy / magU, uz / magU));\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal with unit normal (a) in the xy plane (b) perpendicular to the line\r\n * defined by xy parts of origin to target.\r\n * * origin and normal both have z = 0.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if the normal vector is all zeros.\r\n */\r\n public static createOriginAndTargetXY(\r\n origin: XAndY, target: XAndY, result?: Plane3dByOriginAndUnitNormal,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const ux = target.x - origin.x;\r\n const uy = target.y - origin.y;\r\n return this.createXYZUVW(origin.x, origin.y, 0.0, uy, -ux, 0.0, result);\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal with xy origin (at z=0) and normal angle in xy plane.\r\n * * Returns undefined if the normal vector is all zeros.\r\n */\r\n public static createXYAngle(\r\n x: number, y: number, normalAngleFromX: Angle, result?: Plane3dByOriginAndUnitNormal,\r\n ): Plane3dByOriginAndUnitNormal {\r\n if (result) {\r\n result._origin.set(x, y, 0.0);\r\n result._normal.set(normalAngleFromX.cos(), normalAngleFromX.sin(), 0.0);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(\r\n Point3d.create(x, y, 0), Vector3d.create(normalAngleFromX.cos(), normalAngleFromX.sin()),\r\n );\r\n }\r\n /**\r\n * Create a plane defined by two points and an in-plane vector.\r\n * @param pointA any point in the plane\r\n * @param pointB any other point in the plane\r\n * @param vector any vector in the plane but not parallel to the vector from pointA to pointB\r\n */\r\n public static createPointPointVectorInPlane(\r\n pointA: Point3d, pointB: Point3d, vector: Vector3d,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = vector.crossProductStartEnd(pointA, pointB);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n /**\r\n * Create a plane defined by three points.\r\n * @param pointA any point in the plane. This will be the origin.\r\n * @param pointB any other point in the plane\r\n * @param pointC any third point in the plane but not on the line of pointA and pointB\r\n */\r\n public static createOriginAndTargets(\r\n pointA: Point3d, pointB: Point3d, pointC: Point3d,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = pointA.crossProductToPoints(pointB, pointC);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n /**\r\n * Create a plane defined by a point and two vectors in the plane\r\n * @param pointA any point in the plane\r\n * @param vectorB any vector in the plane\r\n * @param vectorC any vector in the plane but not parallel to vectorB\r\n */\r\n public static createOriginAndVectors(\r\n pointA: Point3d, vectorB: Vector3d, vectorC: Vector3d,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = vectorB.crossProduct(vectorC);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n /** Test for (toleranced) equality with `other` */\r\n public isAlmostEqual(other: Plane3dByOriginAndUnitNormal): boolean {\r\n return this._origin.isAlmostEqual(other._origin) && this._normal.isAlmostEqual(other._normal);\r\n }\r\n /** Parse a json fragment `{origin: [x,y,z], normal: [ux,uy,uz]}` */\r\n public setFromJSON(json?: any): void {\r\n if (!json) {\r\n this._origin.set(0, 0, 0);\r\n this._normal.set(0, 0, 1);\r\n } else {\r\n this._origin.setFromJSON(json.origin);\r\n this._normal.setFromJSON(json.normal);\r\n }\r\n }\r\n /**\r\n * Convert to a JSON object.\r\n * @return {*} [origin,normal]\r\n */\r\n public toJSON(): any {\r\n return { origin: this._origin.toJSON(), normal: this._normal.toJSON() };\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal from json fragment.\r\n * * See `Plane3dByOriginAndUnitNormal.setFromJSON`\r\n */\r\n public static fromJSON(json?: any): Plane3dByOriginAndUnitNormal {\r\n const result = Plane3dByOriginAndUnitNormal.createXYPlane();\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Return a reference to the origin. */\r\n public getOriginRef(): Point3d {\r\n return this._origin;\r\n }\r\n /** Return a reference to the unit normal. */\r\n public getNormalRef(): Vector3d {\r\n return this._normal;\r\n }\r\n /**\r\n * Return coordinate axes (as a transform) with\r\n * * origin at plane origin\r\n * * z axis in direction of plane normal.\r\n * * x,y axes in plane.\r\n */\r\n public getLocalToWorld(): Transform {\r\n const axes = Matrix3d.createRigidHeadsUp(this._normal, AxisOrder.ZXY);\r\n return Transform.createRefs(this._origin.clone(), axes);\r\n }\r\n /** Return a (singular) transform which projects points to this plane. */\r\n public getProjectionToPlane(): Transform {\r\n const axes = Matrix3d.createIdentity();\r\n axes.addScaledOuterProductInPlace(this._normal, this._normal, -1.0);\r\n axes.markSingular();\r\n return Transform.createFixedPointAndMatrix(this._origin, axes);\r\n }\r\n /** Copy coordinates from the given origin and normal. */\r\n public set(origin: Point3d, normal: Vector3d): void {\r\n this._origin.setFrom(origin);\r\n this._normal.setFrom(normal);\r\n }\r\n /** Return a deep clone (point and normal cloned) */\r\n public clone(result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal {\r\n if (result) {\r\n result.set(this._origin, this._normal);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(this._origin.clone(), this._normal.clone());\r\n }\r\n /** Create a clone and return the transform of the clone. */\r\n public cloneTransformed(transform: Transform, inverse: boolean = false): Plane3dByOriginAndUnitNormal | undefined {\r\n const result = this.clone();\r\n if (inverse) {\r\n transform.multiplyInversePoint3d(result._origin, result._origin);\r\n if (transform.matrix.multiplyTransposeVector(result._normal, result._normal) !== undefined\r\n && result._normal.normalizeInPlace())\r\n return result;\r\n } else {\r\n transform.multiplyPoint3d(result._origin, result._origin);\r\n if (transform.matrix.multiplyInverseTranspose(result._normal, result._normal) !== undefined\r\n && result._normal.normalizeInPlace())\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n /** Copy data from the given plane. */\r\n public setFrom(source: Plane3dByOriginAndUnitNormal): void {\r\n this.set(source._origin, source._normal);\r\n }\r\n /** Return the altitude of spacePoint above or below the plane. (Below is negative) */\r\n public altitude(spacePoint: Point3d): number {\r\n return this._normal.dotProductStartEnd(this._origin, spacePoint);\r\n }\r\n /** Return the altitude of point (x,y) given xy parts using only the xy parts of origin and unit normal */\r\n public altitudeXY(x: number, y: number): number {\r\n return (x - this._origin.x) * this._normal.x + (y - this._origin.y) * this._normal.y;\r\n }\r\n /** Return the x component of the normal used to evaluate altitude. */\r\n public normalX(): number {\r\n return this._normal.x;\r\n }\r\n /** Return the x component of the normal used to evaluate altitude. */\r\n public normalY(): number {\r\n return this._normal.y;\r\n }\r\n /** Return the z component of the normal used to evaluate altitude. */\r\n public normalZ(): number {\r\n return this._normal.z;\r\n }\r\n /** Return (a clone of) the unit normal. */\r\n public override getUnitNormal(result?: Vector3d): Vector3d | undefined {\r\n return this._normal.clone(result);\r\n }\r\n /** Return (a clone of) the origin. */\r\n public override getAnyPointOnPlane(result?: Point3d): Point3d {\r\n // This function returns the plane origin. In general, a point x is on the plane if and only if (x-o).n = 0.\r\n return this._origin.clone(result);\r\n }\r\n /** Return the signed altitude of weighted spacePoint above or below the plane. (Below is negative) */\r\n public weightedAltitude(spacePoint: Point4d): number {\r\n return this._normal.dotProductStart3dEnd4d(this._origin, spacePoint);\r\n }\r\n /** Return any point at specified (signed) altitude. */\r\n public altitudeToPoint(altitude: number, result?: Point3d): Point3d {\r\n return this._origin.plusScaled(this._normal, altitude, result);\r\n }\r\n /**\r\n * Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\r\n * for a point moving at speed one along the spaceVector.\r\n */\r\n public velocityXYZ(x: number, y: number, z: number): number {\r\n return this._normal.dotProductXYZ(x, y, z);\r\n }\r\n /**\r\n * Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\r\n * for a point moving at speed one along the spaceVector.\r\n */\r\n public velocity(spaceVector: Vector3d): number {\r\n return this._normal.dotProduct(spaceVector);\r\n }\r\n /** Return the altitude of a point given as separate x,y,z components. */\r\n public altitudeXYZ(x: number, y: number, z: number): number {\r\n return this._normal.dotProductStartEndXYZ(this._origin, x, y, z);\r\n }\r\n /** Return the altitude of a point given as separate x,y,z,w components. */\r\n public altitudeXYZW(x: number, y: number, z: number, w: number): number {\r\n return this._normal.dotProductStartEndXYZW(this._origin, x, y, z, w);\r\n }\r\n /** Return the projection of spacePoint onto the plane. */\r\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\r\n return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);\r\n }\r\n /** Return the projection of (x,y,z) onto the plane. */\r\n public override projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d {\r\n const scale = -this._normal.dotProductStartEndXYZ(this._origin, x, y, z);\r\n return Point3d.create(x + scale * this._normal.x, y + scale * this._normal.y, z + scale * this._normal.z, result);\r\n }\r\n /**\r\n * Returns true if spacePoint is within distance tolerance of the plane.\r\n * * This logic is identical to the [[Plane3d]] method but avoids a level of function call.\r\n */\r\n public override isPointInPlane(spacePoint: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n const altitude = this._normal.dotProductStartEnd(this._origin, spacePoint);\r\n return Math.abs(altitude) <= tolerance;\r\n }\r\n}\r\n"]}
|
|
@@ -63,6 +63,14 @@ export declare class Point3dArrayCarrier extends IndexedReadWriteXYZCollection {
|
|
|
63
63
|
* @returns undefined if either index is out of bounds
|
|
64
64
|
*/
|
|
65
65
|
vectorIndexIndex(indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Return a vector from the point at indexA to the point at indexB
|
|
68
|
+
* * This method does not check for index validity. Use [[vectorIndexIndex]] to have validity test.
|
|
69
|
+
* @param indexA index of point within the array
|
|
70
|
+
* @param indexB index of point within the array
|
|
71
|
+
* @param result caller-allocated vector.
|
|
72
|
+
*/
|
|
73
|
+
vectorUncheckedIndexIndex(indexA: number, indexB: number, result?: Vector3d): Vector3d;
|
|
66
74
|
/**
|
|
67
75
|
* Return a vector from given origin to point at indexB
|
|
68
76
|
* @param origin origin for vector
|
|
@@ -71,6 +79,14 @@ export declare class Point3dArrayCarrier extends IndexedReadWriteXYZCollection {
|
|
|
71
79
|
* @returns undefined if index is out of bounds
|
|
72
80
|
*/
|
|
73
81
|
vectorXYAndZIndex(origin: XYAndZ, indexB: number, result?: Vector3d): Vector3d | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Return a vector from given origin to point at indexB
|
|
84
|
+
* * This method does not check for index validity. Use [[vectorXYAndZIndex]] to have validity test.
|
|
85
|
+
* @param origin origin for vector
|
|
86
|
+
* @param indexB index of point within the array
|
|
87
|
+
* @param result caller-allocated vector.
|
|
88
|
+
*/
|
|
89
|
+
vectorXYAndZUncheckedIndex(origin: XYAndZ, indexB: number, result?: Vector3d): Vector3d;
|
|
74
90
|
/**
|
|
75
91
|
* Return the cross product of vectors from origin to points at indexA and indexB
|
|
76
92
|
* @param origin origin for vector
|
|
@@ -90,12 +106,29 @@ export declare class Point3dArrayCarrier extends IndexedReadWriteXYZCollection {
|
|
|
90
106
|
*/
|
|
91
107
|
crossProductIndexIndexIndex(originIndex: number, indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;
|
|
92
108
|
/**
|
|
93
|
-
*
|
|
109
|
+
* Return the cross product of vectors from the point at `originIndex` to points at `indexA` and `indexB`.
|
|
110
|
+
* * This method does not check for index validity. Use [[crossProductIndexIndexIndex]] to have validity test.
|
|
111
|
+
* @param originIndex origin for vector
|
|
112
|
+
* @param indexA index of first target within the array
|
|
113
|
+
* @param indexB index of second target within the array
|
|
114
|
+
* @param result optional caller-allocated vector.
|
|
115
|
+
*/
|
|
116
|
+
crossProductUncheckedIndexIndexIndex(originIndex: number, indexA: number, indexB: number, result?: Vector3d): Vector3d;
|
|
117
|
+
/**
|
|
118
|
+
* Return the cross product of the vectors from `origin` to the point at `indexA` and to `targetB.
|
|
119
|
+
* * This method does not check for index validity. Use [[crossProductIndexIndexXYAndZ]] to have validity test.
|
|
120
|
+
* @param origin index of point within the array; origin of both vectors
|
|
121
|
+
* @param indexA index of point within the array; target of the first vector
|
|
122
|
+
* @param targetB target of second vector
|
|
123
|
+
* @param result optional caller-allocated result to fill and return
|
|
124
|
+
*/
|
|
125
|
+
crossProductUncheckedIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ, result?: Vector3d): Vector3d;
|
|
126
|
+
/**
|
|
127
|
+
* Compute the cross product of vectors from the point at `originIndex` to points at `indexA` and `indexB`, and add it to `result`.
|
|
94
128
|
* @param origin index of origin
|
|
95
129
|
* @param indexA index of first target within the array
|
|
96
130
|
* @param indexB index of second target within the array
|
|
97
131
|
* @param result caller-allocated vector.
|
|
98
|
-
* @returns return true if indexA, indexB both valid
|
|
99
132
|
*/
|
|
100
133
|
accumulateCrossProductIndexIndexIndex(originIndex: number, indexA: number, indexB: number, result: Vector3d): void;
|
|
101
134
|
/** Accumulate scale times the x,y,z values at index to the sum. No action if index is out of bounds */
|
|
@@ -130,12 +163,26 @@ export declare class Point3dArrayCarrier extends IndexedReadWriteXYZCollection {
|
|
|
130
163
|
* @param index1 second point index
|
|
131
164
|
*/
|
|
132
165
|
distanceSquaredIndexIndex(index0: number, index1: number): number | undefined;
|
|
166
|
+
/**
|
|
167
|
+
* Return distance squared between indicated points.
|
|
168
|
+
* * This method does not check for index validity. Use [[distanceSquaredIndexIndex]] to have validity test.
|
|
169
|
+
* @param index0 first point index
|
|
170
|
+
* @param index1 second point index
|
|
171
|
+
*/
|
|
172
|
+
distanceSquaredUncheckedIndexIndex(index0: number, index1: number): number;
|
|
133
173
|
/**
|
|
134
174
|
* Return distance between indicated points.
|
|
135
175
|
* @param index0 first point index
|
|
136
176
|
* @param index1 second point index
|
|
137
177
|
*/
|
|
138
178
|
distanceIndexIndex(index0: number, index1: number): number | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* Return distance between indicated points.
|
|
181
|
+
* * This method does not check for index validity. Use [[distanceIndexIndex]] to have validity test.
|
|
182
|
+
* @param index0 first point index
|
|
183
|
+
* @param index1 second point index
|
|
184
|
+
*/
|
|
185
|
+
distanceUncheckedIndexIndex(index0: number, index1: number): number;
|
|
139
186
|
/** Adjust index into range by modulo with the length. */
|
|
140
187
|
cyclicIndex(i: number): number;
|
|
141
188
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Point3dArrayCarrier.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/Point3dArrayCarrier.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC;;;;;;GAMG;AACH,qBAAa,mBAAoB,SAAQ,6BAA6B;IACpE,wCAAwC;IACjC,IAAI,EAAE,OAAO,EAAE,CAAC;IACvB,wCAAwC;gBACrB,IAAI,EAAE,OAAO,EAAE;IAIlC,uDAAuD;IAChD,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAG3C;;;;;;OAMG;IACI,6BAA6B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS;IAO1F;;;;;OAKG;IACI,+BAA+B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAIhF;;;;;OAKG;IACI,+BAA+B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS;IAO9F;;;OAGG;IACI,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAG5D;;;OAGG;IACI,yBAAyB,CAAC,UAAU,EAAE,M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C,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;CAG/C"}
|
|
@@ -96,9 +96,19 @@ class Point3dArrayCarrier extends IndexedXYZCollection_1.IndexedReadWriteXYZColl
|
|
|
96
96
|
*/
|
|
97
97
|
vectorIndexIndex(indexA, indexB, result) {
|
|
98
98
|
if (this.isValidIndex(indexA) && this.isValidIndex(indexB))
|
|
99
|
-
return
|
|
99
|
+
return this.vectorUncheckedIndexIndex(indexA, indexB, result);
|
|
100
100
|
return undefined;
|
|
101
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Return a vector from the point at indexA to the point at indexB
|
|
104
|
+
* * This method does not check for index validity. Use [[vectorIndexIndex]] to have validity test.
|
|
105
|
+
* @param indexA index of point within the array
|
|
106
|
+
* @param indexB index of point within the array
|
|
107
|
+
* @param result caller-allocated vector.
|
|
108
|
+
*/
|
|
109
|
+
vectorUncheckedIndexIndex(indexA, indexB, result) {
|
|
110
|
+
return Point3dVector3d_1.Vector3d.createStartEnd(this.data[indexA], this.data[indexB], result);
|
|
111
|
+
}
|
|
102
112
|
/**
|
|
103
113
|
* Return a vector from given origin to point at indexB
|
|
104
114
|
* @param origin origin for vector
|
|
@@ -108,9 +118,19 @@ class Point3dArrayCarrier extends IndexedXYZCollection_1.IndexedReadWriteXYZColl
|
|
|
108
118
|
*/
|
|
109
119
|
vectorXYAndZIndex(origin, indexB, result) {
|
|
110
120
|
if (this.isValidIndex(indexB))
|
|
111
|
-
return
|
|
121
|
+
return this.vectorXYAndZUncheckedIndex(origin, indexB, result);
|
|
112
122
|
return undefined;
|
|
113
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Return a vector from given origin to point at indexB
|
|
126
|
+
* * This method does not check for index validity. Use [[vectorXYAndZIndex]] to have validity test.
|
|
127
|
+
* @param origin origin for vector
|
|
128
|
+
* @param indexB index of point within the array
|
|
129
|
+
* @param result caller-allocated vector.
|
|
130
|
+
*/
|
|
131
|
+
vectorXYAndZUncheckedIndex(origin, indexB, result) {
|
|
132
|
+
return Point3dVector3d_1.Vector3d.createStartEnd(origin, this.data[indexB], result);
|
|
133
|
+
}
|
|
114
134
|
/**
|
|
115
135
|
* Return the cross product of vectors from origin to points at indexA and indexB
|
|
116
136
|
* @param origin origin for vector
|
|
@@ -134,16 +154,37 @@ class Point3dArrayCarrier extends IndexedXYZCollection_1.IndexedReadWriteXYZColl
|
|
|
134
154
|
*/
|
|
135
155
|
crossProductIndexIndexIndex(originIndex, indexA, indexB, result) {
|
|
136
156
|
if (this.isValidIndex(originIndex) && this.isValidIndex(indexA) && this.isValidIndex(indexB))
|
|
137
|
-
return
|
|
157
|
+
return this.crossProductUncheckedIndexIndexIndex(originIndex, indexA, indexB, result);
|
|
138
158
|
return undefined;
|
|
139
159
|
}
|
|
140
160
|
/**
|
|
141
|
-
*
|
|
161
|
+
* Return the cross product of vectors from the point at `originIndex` to points at `indexA` and `indexB`.
|
|
162
|
+
* * This method does not check for index validity. Use [[crossProductIndexIndexIndex]] to have validity test.
|
|
163
|
+
* @param originIndex origin for vector
|
|
164
|
+
* @param indexA index of first target within the array
|
|
165
|
+
* @param indexB index of second target within the array
|
|
166
|
+
* @param result optional caller-allocated vector.
|
|
167
|
+
*/
|
|
168
|
+
crossProductUncheckedIndexIndexIndex(originIndex, indexA, indexB, result) {
|
|
169
|
+
return Point3dVector3d_1.Vector3d.createCrossProductToPoints(this.data[originIndex], this.data[indexA], this.data[indexB], result);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Return the cross product of the vectors from `origin` to the point at `indexA` and to `targetB.
|
|
173
|
+
* * This method does not check for index validity. Use [[crossProductIndexIndexXYAndZ]] to have validity test.
|
|
174
|
+
* @param origin index of point within the array; origin of both vectors
|
|
175
|
+
* @param indexA index of point within the array; target of the first vector
|
|
176
|
+
* @param targetB target of second vector
|
|
177
|
+
* @param result optional caller-allocated result to fill and return
|
|
178
|
+
*/
|
|
179
|
+
crossProductUncheckedIndexIndexXYAndZ(origin, indexA, targetB, result) {
|
|
180
|
+
return Point3dVector3d_1.Vector3d.createCrossProductToPoints(this.data[origin], this.data[indexA], targetB, result);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Compute the cross product of vectors from the point at `originIndex` to points at `indexA` and `indexB`, and add it to `result`.
|
|
142
184
|
* @param origin index of origin
|
|
143
185
|
* @param indexA index of first target within the array
|
|
144
186
|
* @param indexB index of second target within the array
|
|
145
187
|
* @param result caller-allocated vector.
|
|
146
|
-
* @returns return true if indexA, indexB both valid
|
|
147
188
|
*/
|
|
148
189
|
accumulateCrossProductIndexIndexIndex(originIndex, indexA, indexB, result) {
|
|
149
190
|
const data = this.data;
|
|
@@ -213,11 +254,19 @@ class Point3dArrayCarrier extends IndexedXYZCollection_1.IndexedReadWriteXYZColl
|
|
|
213
254
|
*/
|
|
214
255
|
distanceSquaredIndexIndex(index0, index1) {
|
|
215
256
|
const n = this.data.length;
|
|
216
|
-
if (index0 >= 0 && index0 < n && index1 >= 0 && index1 < n)
|
|
217
|
-
return this.
|
|
218
|
-
}
|
|
257
|
+
if (index0 >= 0 && index0 < n && index1 >= 0 && index1 < n)
|
|
258
|
+
return this.distanceSquaredUncheckedIndexIndex(index0, index1);
|
|
219
259
|
return undefined;
|
|
220
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* Return distance squared between indicated points.
|
|
263
|
+
* * This method does not check for index validity. Use [[distanceSquaredIndexIndex]] to have validity test.
|
|
264
|
+
* @param index0 first point index
|
|
265
|
+
* @param index1 second point index
|
|
266
|
+
*/
|
|
267
|
+
distanceSquaredUncheckedIndexIndex(index0, index1) {
|
|
268
|
+
return this.data[index0].distanceSquared(this.data[index1]);
|
|
269
|
+
}
|
|
221
270
|
/**
|
|
222
271
|
* Return distance between indicated points.
|
|
223
272
|
* @param index0 first point index
|
|
@@ -226,10 +275,19 @@ class Point3dArrayCarrier extends IndexedXYZCollection_1.IndexedReadWriteXYZColl
|
|
|
226
275
|
distanceIndexIndex(index0, index1) {
|
|
227
276
|
const n = this.data.length;
|
|
228
277
|
if (index0 >= 0 && index0 < n && index1 >= 0 && index1 < n) {
|
|
229
|
-
return this.
|
|
278
|
+
return this.distanceUncheckedIndexIndex(index0, index1);
|
|
230
279
|
}
|
|
231
280
|
return undefined;
|
|
232
281
|
}
|
|
282
|
+
/**
|
|
283
|
+
* Return distance between indicated points.
|
|
284
|
+
* * This method does not check for index validity. Use [[distanceIndexIndex]] to have validity test.
|
|
285
|
+
* @param index0 first point index
|
|
286
|
+
* @param index1 second point index
|
|
287
|
+
*/
|
|
288
|
+
distanceUncheckedIndexIndex(index0, index1) {
|
|
289
|
+
return this.data[index0].distance(this.data[index1]);
|
|
290
|
+
}
|
|
233
291
|
/** Adjust index into range by modulo with the length. */
|
|
234
292
|
cyclicIndex(i) {
|
|
235
293
|
return (i % this.data.length);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Point3dArrayCarrier.js","sourceRoot":"","sources":["../../../src/geometry3d/Point3dArrayCarrier.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,iEAAuE;AACvE,uDAAsD;AAGtD;;;;;;GAMG;AACH,MAAa,mBAAoB,SAAQ,oDAA6B;IACpE,wCAAwC;IACjC,IAAI,CAAY;IACvB,wCAAwC;IACxC,YAAmB,IAAe;QAChC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IACD,uDAAuD;IAChD,YAAY,CAAC,KAAa;QAC/B,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IACD;;;;;;OAMG;IACI,6BAA6B,CAAC,KAAa,EAAE,MAAgB;QAClE,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAChC,OAAO,yBAAO,CAAC,MAAM,CAAC,MAAM,C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AC;IACvB,CAAC;IACD,kCAAkC;IAC3B,cAAc;QACnB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;IACtB,CAAC;IACD;;;;OAIG;IACI,yBAAyB,CAAC,MAAc,EAAE,MAAc;QAC7D,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;;;OAIG;IACI,kBAAkB,CAAC,MAAc,EAAE,MAAc;QACtD,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,yDAAyD;IACzC,WAAW,CAAC,CAAS;QACnC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;CACF;AAnOD,kDAmOC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ArraysAndInterfaces\r\n */\r\n\r\nimport { IndexedReadWriteXYZCollection } from \"./IndexedXYZCollection\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { XYAndZ } from \"./XYZProps\";\r\n\r\n/**\r\n * Helper object to access members of a Point3d[] in geometric calculations.\r\n * * The collection holds only a reference to the actual array.\r\n * * The actual array may be replaced by the user as needed.\r\n * * When replaced, there is no cached data to be updated.\r\n * @public\r\n */\r\nexport class Point3dArrayCarrier extends IndexedReadWriteXYZCollection {\r\n /** Reference to array being queried. */\r\n public data: Point3d[];\r\n /** CAPTURE caller supplied array ... */\r\n public constructor(data: Point3d[]) {\r\n super();\r\n this.data = data;\r\n }\r\n /** Test if `index` is a valid index into the array. */\r\n public isValidIndex(index: number): boolean {\r\n return this.isIndexValid(index);\r\n }\r\n /**\r\n * Access by index, returning strongly typed Point3d\r\n * * This returns the xyz value but NOT reference to the point in the \"carried\" array.\r\n * @param index index of point within the array\r\n * @param result caller-allocated destination\r\n * @returns undefined if the index is out of bounds\r\n */\r\n public getPoint3dAtCheckedPointIndex(index: number, result?: Point3d): Point3d | undefined {\r\n if (this.isValidIndex(index)) {\r\n const source = this.data[index];\r\n return Point3d.create(source.x, source.y, source.z, result);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Access by index, returning strongly typed Point3d\r\n * * This returns the xyz value but NOT reference to the point in the \"carried\" array.\r\n * @param index index of point within the array\r\n * @param result caller-allocated destination\r\n */\r\n public getPoint3dAtUncheckedPointIndex(index: number, result?: Point3d): Point3d {\r\n const source = this.data[index];\r\n return Point3d.create(source.x, source.y, source.z, result);\r\n }\r\n /**\r\n * Access by index, returning strongly typed Vector3d\r\n * @param index index of point within the array\r\n * @param result caller-allocated destination\r\n * @returns undefined if the index is out of bounds\r\n */\r\n public getVector3dAtCheckedVectorIndex(index: number, result?: Vector3d): Vector3d | undefined {\r\n if (this.isValidIndex(index)) {\r\n const source = this.data[index];\r\n return Vector3d.create(source.x, source.y, source.z, result);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Access x of indexed point\r\n * * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results\r\n */\r\n public getXAtUncheckedPointIndex(pointIndex: number): number {\r\n return this.data[pointIndex].x;\r\n }\r\n /**\r\n * Access y of indexed point\r\n * * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results\r\n */\r\n public getYAtUncheckedPointIndex(pointIndex: number): number {\r\n return this.data[pointIndex].y;\r\n }\r\n /**\r\n * Access z of indexed point\r\n * * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results\r\n */\r\n public getZAtUncheckedPointIndex(pointIndex: number): number {\r\n return this.data[pointIndex].z;\r\n }\r\n /**\r\n * Return a vector from the point at indexA to the point at indexB\r\n * @param indexA index of point within the array\r\n * @param indexB index of point within the array\r\n * @param result caller-allocated vector.\r\n * @returns undefined if either index is out of bounds\r\n */\r\n public vectorIndexIndex(indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined {\r\n if (this.isValidIndex(indexA) && this.isValidIndex(indexB))\r\n return Vector3d.createStartEnd(this.data[indexA], this.data[indexB], result);\r\n return undefined;\r\n }\r\n /**\r\n * Return a vector from given origin to point at indexB\r\n * @param origin origin for vector\r\n * @param indexB index of point within the array\r\n * @param result caller-allocated vector.\r\n * @returns undefined if index is out of bounds\r\n */\r\n public vectorXYAndZIndex(origin: XYAndZ, indexB: number, result?: Vector3d): Vector3d | undefined {\r\n if (this.isValidIndex(indexB))\r\n return Vector3d.createStartEnd(origin, this.data[indexB], result);\r\n return undefined;\r\n }\r\n /**\r\n * Return the cross product of vectors from origin to points at indexA and indexB\r\n * @param origin origin for vector\r\n * @param indexA index of first target within the array\r\n * @param indexB index of second target within the array\r\n * @param result caller-allocated vector.\r\n * @returns undefined if either index is out of bounds\r\n */\r\n public crossProductXYAndZIndexIndex(\r\n origin: XYAndZ, indexA: number, indexB: number, result?: Vector3d,\r\n ): Vector3d | undefined {\r\n if (this.isValidIndex(indexA) && this.isValidIndex(indexB))\r\n return Vector3d.createCrossProductToPoints(origin, this.data[indexA], this.data[indexB], result);\r\n return undefined;\r\n }\r\n /**\r\n * Return the cross product of vectors from point at originIndex to points at indexA and indexB\r\n * @param originIndex index of origin\r\n * @param indexA index of first target within the array\r\n * @param indexB index of second target within the array\r\n * @param result caller-allocated vector.\r\n * @returns return true if indexA, indexB both valid\r\n */\r\n public crossProductIndexIndexIndex(\r\n originIndex: number, indexA: number, indexB: number, result?: Vector3d,\r\n ): Vector3d | undefined {\r\n if (this.isValidIndex(originIndex) && this.isValidIndex(indexA) && this.isValidIndex(indexB))\r\n return Vector3d.createCrossProductToPoints(this.data[originIndex], this.data[indexA], this.data[indexB], result);\r\n return undefined;\r\n }\r\n /**\r\n * Compute the cross product of vectors from point at originIndex to points at indexA and indexB, and accumulate it to the result.\r\n * @param origin index of origin\r\n * @param indexA index of first target within the array\r\n * @param indexB index of second target within the array\r\n * @param result caller-allocated vector.\r\n * @returns return true if indexA, indexB both valid\r\n */\r\n public accumulateCrossProductIndexIndexIndex(originIndex: number, indexA: number, indexB: number, result: Vector3d): void {\r\n const data = this.data;\r\n if (this.isValidIndex(originIndex) && this.isValidIndex(indexA) && this.isValidIndex(indexB))\r\n result.addCrossProductToTargetsInPlace(\r\n data[originIndex].x, data[originIndex].y, data[originIndex].z,\r\n data[indexA].x, data[indexA].y, data[indexA].z,\r\n data[indexB].x, data[indexB].y, data[indexB].z,\r\n );\r\n }\r\n /** Accumulate scale times the x,y,z values at index to the sum. No action if index is out of bounds */\r\n public accumulateScaledXYZ(index: number, scale: number, sum: Point3d): void {\r\n if (this.isValidIndex(index)) {\r\n const point = this.data[index];\r\n sum.x += scale * point.x;\r\n sum.y += scale * point.y;\r\n sum.z += scale * point.z;\r\n }\r\n }\r\n /** Read-only property for number of XYZ in the collection */\r\n public get length(): number {\r\n return this.data.length;\r\n }\r\n /**\r\n * Push a (clone of) point onto the collection\r\n * * point itself is not pushed -- xyz data is extracted into the native form of the collection.\r\n */\r\n public push(data: Point3d): void {\r\n this.data.push(data.clone());\r\n }\r\n /**\r\n * Push a new point (given by coordinates) onto the collection\r\n * @param x x coordinate\r\n * @param y y coordinate\r\n * @param z z coordinate\r\n */\r\n public pushXYZ(x?: number, y?: number, z?: number): void {\r\n this.data.push(\r\n Point3d.create(x === undefined ? 0.0 : x, y === undefined ? 0.0 : y, z === undefined ? 0.0 : z),\r\n );\r\n }\r\n /** Extract (copy) the final point */\r\n public override back(result?: Point3d): Point3d | undefined {\r\n if (this.data.length > 0) {\r\n return this.data[this.data.length - 1].clone(result);\r\n }\r\n return undefined;\r\n }\r\n /** Extract (copy) the first point */\r\n public override front(result?: Point3d): Point3d | undefined {\r\n if (this.data.length > 0) {\r\n return this.data[0].clone(result);\r\n }\r\n return undefined;\r\n }\r\n /** Remove the final point. */\r\n public pop(): void {\r\n if (this.data.length > 0)\r\n this.data.pop();\r\n }\r\n /** Remove all points. */\r\n public clear(): void {\r\n this.data.length = 0;\r\n }\r\n /** Reverse the points in place */\r\n public reverseInPlace(): void {\r\n this.data.reverse();\r\n }\r\n /**\r\n * Return distance squared between indicated points.\r\n * @param index0 first point index\r\n * @param index1 second point index\r\n */\r\n public distanceSquaredIndexIndex(index0: number, index1: number): number | undefined {\r\n const n = this.data.length;\r\n if (index0 >= 0 && index0 < n && index1 >= 0 && index1 < n) {\r\n return this.data[index0].distanceSquared(this.data[index1]);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Return distance between indicated points.\r\n * @param index0 first point index\r\n * @param index1 second point index\r\n */\r\n public distanceIndexIndex(index0: number, index1: number): number | undefined {\r\n const n = this.data.length;\r\n if (index0 >= 0 && index0 < n && index1 >= 0 && index1 < n) {\r\n return this.data[index0].distance(this.data[index1]);\r\n }\r\n return undefined;\r\n }\r\n /** Adjust index into range by modulo with the length. */\r\n public override cyclicIndex(i: number): number {\r\n return (i % this.data.length);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Point3dArrayCarrier.js","sourceRoot":"","sources":["../../../src/geometry3d/Point3dArrayCarrier.ts"],"names":[],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C,CAAC;IACvD,CAAC;IACD,yDAAyD;IACzC,WAAW,CAAC,CAAS;QACnC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;CACF;AA7RD,kDA6RC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ArraysAndInterfaces\r\n */\r\n\r\nimport { IndexedReadWriteXYZCollection } from \"./IndexedXYZCollection\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { XYAndZ } from \"./XYZProps\";\r\n\r\n/**\r\n * Helper object to access members of a Point3d[] in geometric calculations.\r\n * * The collection holds only a reference to the actual array.\r\n * * The actual array may be replaced by the user as needed.\r\n * * When replaced, there is no cached data to be updated.\r\n * @public\r\n */\r\nexport class Point3dArrayCarrier extends IndexedReadWriteXYZCollection {\r\n /** Reference to array being queried. */\r\n public data: Point3d[];\r\n /** CAPTURE caller supplied array ... */\r\n public constructor(data: Point3d[]) {\r\n super();\r\n this.data = data;\r\n }\r\n /** Test if `index` is a valid index into the array. */\r\n public isValidIndex(index: number): boolean {\r\n return this.isIndexValid(index);\r\n }\r\n /**\r\n * Access by index, returning strongly typed Point3d\r\n * * This returns the xyz value but NOT reference to the point in the \"carried\" array.\r\n * @param index index of point within the array\r\n * @param result caller-allocated destination\r\n * @returns undefined if the index is out of bounds\r\n */\r\n public getPoint3dAtCheckedPointIndex(index: number, result?: Point3d): Point3d | undefined {\r\n if (this.isValidIndex(index)) {\r\n const source = this.data[index];\r\n return Point3d.create(source.x, source.y, source.z, result);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Access by index, returning strongly typed Point3d\r\n * * This returns the xyz value but NOT reference to the point in the \"carried\" array.\r\n * @param index index of point within the array\r\n * @param result caller-allocated destination\r\n */\r\n public getPoint3dAtUncheckedPointIndex(index: number, result?: Point3d): Point3d {\r\n const source = this.data[index];\r\n return Point3d.create(source.x, source.y, source.z, result);\r\n }\r\n /**\r\n * Access by index, returning strongly typed Vector3d\r\n * @param index index of point within the array\r\n * @param result caller-allocated destination\r\n * @returns undefined if the index is out of bounds\r\n */\r\n public getVector3dAtCheckedVectorIndex(index: number, result?: Vector3d): Vector3d | undefined {\r\n if (this.isValidIndex(index)) {\r\n const source = this.data[index];\r\n return Vector3d.create(source.x, source.y, source.z, result);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Access x of indexed point\r\n * * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results\r\n */\r\n public getXAtUncheckedPointIndex(pointIndex: number): number {\r\n return this.data[pointIndex].x;\r\n }\r\n /**\r\n * Access y of indexed point\r\n * * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results\r\n */\r\n public getYAtUncheckedPointIndex(pointIndex: number): number {\r\n return this.data[pointIndex].y;\r\n }\r\n /**\r\n * Access z of indexed point\r\n * * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results\r\n */\r\n public getZAtUncheckedPointIndex(pointIndex: number): number {\r\n return this.data[pointIndex].z;\r\n }\r\n /**\r\n * Return a vector from the point at indexA to the point at indexB\r\n * @param indexA index of point within the array\r\n * @param indexB index of point within the array\r\n * @param result caller-allocated vector.\r\n * @returns undefined if either index is out of bounds\r\n */\r\n public vectorIndexIndex(indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined {\r\n if (this.isValidIndex(indexA) && this.isValidIndex(indexB))\r\n return this.vectorUncheckedIndexIndex(indexA, indexB, result);\r\n return undefined;\r\n }\r\n /**\r\n * Return a vector from the point at indexA to the point at indexB\r\n * * This method does not check for index validity. Use [[vectorIndexIndex]] to have validity test.\r\n * @param indexA index of point within the array\r\n * @param indexB index of point within the array\r\n * @param result caller-allocated vector.\r\n */\r\n public override vectorUncheckedIndexIndex(indexA: number, indexB: number, result?: Vector3d): Vector3d {\r\n return Vector3d.createStartEnd(this.data[indexA], this.data[indexB], result);\r\n }\r\n /**\r\n * Return a vector from given origin to point at indexB\r\n * @param origin origin for vector\r\n * @param indexB index of point within the array\r\n * @param result caller-allocated vector.\r\n * @returns undefined if index is out of bounds\r\n */\r\n public vectorXYAndZIndex(origin: XYAndZ, indexB: number, result?: Vector3d): Vector3d | undefined {\r\n if (this.isValidIndex(indexB))\r\n return this.vectorXYAndZUncheckedIndex(origin, indexB, result);\r\n return undefined;\r\n }\r\n /**\r\n * Return a vector from given origin to point at indexB\r\n * * This method does not check for index validity. Use [[vectorXYAndZIndex]] to have validity test.\r\n * @param origin origin for vector\r\n * @param indexB index of point within the array\r\n * @param result caller-allocated vector.\r\n */\r\n public override vectorXYAndZUncheckedIndex(origin: XYAndZ, indexB: number, result?: Vector3d): Vector3d {\r\n return Vector3d.createStartEnd(origin, this.data[indexB], result);\r\n }\r\n /**\r\n * Return the cross product of vectors from origin to points at indexA and indexB\r\n * @param origin origin for vector\r\n * @param indexA index of first target within the array\r\n * @param indexB index of second target within the array\r\n * @param result caller-allocated vector.\r\n * @returns undefined if either index is out of bounds\r\n */\r\n public crossProductXYAndZIndexIndex(\r\n origin: XYAndZ, indexA: number, indexB: number, result?: Vector3d,\r\n ): Vector3d | undefined {\r\n if (this.isValidIndex(indexA) && this.isValidIndex(indexB))\r\n return Vector3d.createCrossProductToPoints(origin, this.data[indexA], this.data[indexB], result);\r\n return undefined;\r\n }\r\n /**\r\n * Return the cross product of vectors from point at originIndex to points at indexA and indexB\r\n * @param originIndex index of origin\r\n * @param indexA index of first target within the array\r\n * @param indexB index of second target within the array\r\n * @param result caller-allocated vector.\r\n * @returns return true if indexA, indexB both valid\r\n */\r\n public crossProductIndexIndexIndex(\r\n originIndex: number, indexA: number, indexB: number, result?: Vector3d,\r\n ): Vector3d | undefined {\r\n if (this.isValidIndex(originIndex) && this.isValidIndex(indexA) && this.isValidIndex(indexB))\r\n return this.crossProductUncheckedIndexIndexIndex(originIndex, indexA, indexB, result);\r\n return undefined;\r\n }\r\n /**\r\n * Return the cross product of vectors from the point at `originIndex` to points at `indexA` and `indexB`.\r\n * * This method does not check for index validity. Use [[crossProductIndexIndexIndex]] to have validity test.\r\n * @param originIndex origin for vector\r\n * @param indexA index of first target within the array\r\n * @param indexB index of second target within the array\r\n * @param result optional caller-allocated vector.\r\n */\r\n public override crossProductUncheckedIndexIndexIndex(originIndex: number, indexA: number, indexB: number, result?: Vector3d): Vector3d {\r\n return Vector3d.createCrossProductToPoints(this.data[originIndex], this.data[indexA], this.data[indexB], result);\r\n }\r\n /**\r\n * Return the cross product of the vectors from `origin` to the point at `indexA` and to `targetB.\r\n * * This method does not check for index validity. Use [[crossProductIndexIndexXYAndZ]] to have validity test.\r\n * @param origin index of point within the array; origin of both vectors\r\n * @param indexA index of point within the array; target of the first vector\r\n * @param targetB target of second vector\r\n * @param result optional caller-allocated result to fill and return\r\n */\r\n public override crossProductUncheckedIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ, result?: Vector3d): Vector3d {\r\n return Vector3d.createCrossProductToPoints(this.data[origin], this.data[indexA], targetB, result);\r\n }\r\n /**\r\n * Compute the cross product of vectors from the point at `originIndex` to points at `indexA` and `indexB`, and add it to `result`.\r\n * @param origin index of origin\r\n * @param indexA index of first target within the array\r\n * @param indexB index of second target within the array\r\n * @param result caller-allocated vector.\r\n */\r\n public accumulateCrossProductIndexIndexIndex(originIndex: number, indexA: number, indexB: number, result: Vector3d): void {\r\n const data = this.data;\r\n if (this.isValidIndex(originIndex) && this.isValidIndex(indexA) && this.isValidIndex(indexB))\r\n result.addCrossProductToTargetsInPlace(\r\n data[originIndex].x, data[originIndex].y, data[originIndex].z,\r\n data[indexA].x, data[indexA].y, data[indexA].z,\r\n data[indexB].x, data[indexB].y, data[indexB].z,\r\n );\r\n }\r\n /** Accumulate scale times the x,y,z values at index to the sum. No action if index is out of bounds */\r\n public accumulateScaledXYZ(index: number, scale: number, sum: Point3d): void {\r\n if (this.isValidIndex(index)) {\r\n const point = this.data[index];\r\n sum.x += scale * point.x;\r\n sum.y += scale * point.y;\r\n sum.z += scale * point.z;\r\n }\r\n }\r\n /** Read-only property for number of XYZ in the collection */\r\n public get length(): number {\r\n return this.data.length;\r\n }\r\n /**\r\n * Push a (clone of) point onto the collection\r\n * * point itself is not pushed -- xyz data is extracted into the native form of the collection.\r\n */\r\n public push(data: Point3d): void {\r\n this.data.push(data.clone());\r\n }\r\n /**\r\n * Push a new point (given by coordinates) onto the collection\r\n * @param x x coordinate\r\n * @param y y coordinate\r\n * @param z z coordinate\r\n */\r\n public pushXYZ(x?: number, y?: number, z?: number): void {\r\n this.data.push(\r\n Point3d.create(x === undefined ? 0.0 : x, y === undefined ? 0.0 : y, z === undefined ? 0.0 : z),\r\n );\r\n }\r\n /** Extract (copy) the final point */\r\n public override back(result?: Point3d): Point3d | undefined {\r\n if (this.data.length > 0) {\r\n return this.data[this.data.length - 1].clone(result);\r\n }\r\n return undefined;\r\n }\r\n /** Extract (copy) the first point */\r\n public override front(result?: Point3d): Point3d | undefined {\r\n if (this.data.length > 0) {\r\n return this.data[0].clone(result);\r\n }\r\n return undefined;\r\n }\r\n /** Remove the final point. */\r\n public pop(): void {\r\n if (this.data.length > 0)\r\n this.data.pop();\r\n }\r\n /** Remove all points. */\r\n public clear(): void {\r\n this.data.length = 0;\r\n }\r\n /** Reverse the points in place */\r\n public reverseInPlace(): void {\r\n this.data.reverse();\r\n }\r\n /**\r\n * Return distance squared between indicated points.\r\n * @param index0 first point index\r\n * @param index1 second point index\r\n */\r\n public distanceSquaredIndexIndex(index0: number, index1: number): number | undefined {\r\n const n = this.data.length;\r\n if (index0 >= 0 && index0 < n && index1 >= 0 && index1 < n)\r\n return this.distanceSquaredUncheckedIndexIndex(index0, index1);\r\n return undefined;\r\n }\r\n /**\r\n * Return distance squared between indicated points.\r\n * * This method does not check for index validity. Use [[distanceSquaredIndexIndex]] to have validity test.\r\n * @param index0 first point index\r\n * @param index1 second point index\r\n */\r\n public override distanceSquaredUncheckedIndexIndex(index0: number, index1: number): number {\r\n return this.data[index0].distanceSquared(this.data[index1]);\r\n }\r\n /**\r\n * Return distance between indicated points.\r\n * @param index0 first point index\r\n * @param index1 second point index\r\n */\r\n public distanceIndexIndex(index0: number, index1: number): number | undefined {\r\n const n = this.data.length;\r\n if (index0 >= 0 && index0 < n && index1 >= 0 && index1 < n) {\r\n return this.distanceUncheckedIndexIndex(index0, index1);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Return distance between indicated points.\r\n * * This method does not check for index validity. Use [[distanceIndexIndex]] to have validity test.\r\n * @param index0 first point index\r\n * @param index1 second point index\r\n */\r\n public override distanceUncheckedIndexIndex(index0: number, index1: number): number {\r\n return this.data[index0].distance(this.data[index1]);\r\n }\r\n /** Adjust index into range by modulo with the length. */\r\n public override cyclicIndex(i: number): number {\r\n return (i % this.data.length);\r\n }\r\n}\r\n"]}
|
|
@@ -591,7 +591,7 @@ export declare class Vector3d extends XYZ {
|
|
|
591
591
|
normalizeWithDefault(x: number, y: number, z: number, result?: Vector3d): Vector3d;
|
|
592
592
|
/**
|
|
593
593
|
* Try to normalize (divide by magnitude), storing the result in place.
|
|
594
|
-
* @param smallestMagnitude smallest magnitude allowed as divisor.
|
|
594
|
+
* @param smallestMagnitude smallest magnitude allowed as divisor. Default is [[Geometry.smallFraction]].
|
|
595
595
|
* @returns false if magnitude is too small. In this case the vector is unchanged.
|
|
596
596
|
*/
|
|
597
597
|
tryNormalizeInPlace(smallestMagnitude?: number): boolean;
|
|
@@ -1195,7 +1195,7 @@ class Vector3d extends XYZ {
|
|
|
1195
1195
|
}
|
|
1196
1196
|
/**
|
|
1197
1197
|
* Try to normalize (divide by magnitude), storing the result in place.
|
|
1198
|
-
* @param smallestMagnitude smallest magnitude allowed as divisor.
|
|
1198
|
+
* @param smallestMagnitude smallest magnitude allowed as divisor. Default is [[Geometry.smallFraction]].
|
|
1199
1199
|
* @returns false if magnitude is too small. In this case the vector is unchanged.
|
|
1200
1200
|
*/
|
|
1201
1201
|
tryNormalizeInPlace(smallestMagnitude = Geometry_1.Geometry.smallFraction) {
|