@itwin/core-geometry 5.5.0-dev.4 → 5.5.0-dev.5
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
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module ArraysAndInterfaces
|
|
3
|
+
*/
|
|
4
|
+
import { PlaneAltitudeEvaluator } from "../Geometry";
|
|
1
5
|
import { Point3d, Vector3d, XYZ } from "./Point3dVector3d";
|
|
2
6
|
import { Range3d } from "./Range";
|
|
3
7
|
import { Transform } from "./Transform";
|
|
@@ -21,9 +25,9 @@ export declare abstract class IndexedXYZCollection {
|
|
|
21
25
|
abstract getPoint3dAtCheckedPointIndex(index: number, result?: Point3d): Point3d | undefined;
|
|
22
26
|
/**
|
|
23
27
|
* Return the point at `index` as a strongly typed Point3d, without checking the point index validity.
|
|
28
|
+
* * Use [[getPoint3dAtCheckedPointIndex]] to have index validity test.
|
|
24
29
|
* @param index index of point within the array.
|
|
25
30
|
* @param result caller-allocated destination.
|
|
26
|
-
* @returns undefined if the index is out of bounds.
|
|
27
31
|
*/
|
|
28
32
|
abstract getPoint3dAtUncheckedPointIndex(index: number, result?: Point3d): Point3d;
|
|
29
33
|
/**
|
|
@@ -41,6 +45,14 @@ export declare abstract class IndexedXYZCollection {
|
|
|
41
45
|
* @returns undefined if either index is out of bounds.
|
|
42
46
|
*/
|
|
43
47
|
abstract vectorIndexIndex(indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Return a vector from the point at `indexA` to the point at `indexB`.
|
|
50
|
+
* * This method does not check for index validity. Use [[vectorIndexIndex]] to have validity test.
|
|
51
|
+
* @param indexA index of point within the array.
|
|
52
|
+
* @param indexB index of point within the array.
|
|
53
|
+
* @param result caller-allocated vector.
|
|
54
|
+
*/
|
|
55
|
+
vectorUncheckedIndexIndex(indexA: number, indexB: number, result?: Vector3d): Vector3d;
|
|
44
56
|
/**
|
|
45
57
|
* Return a vector from `origin` to the point at `indexB`.
|
|
46
58
|
* @param origin origin for vector.
|
|
@@ -49,6 +61,14 @@ export declare abstract class IndexedXYZCollection {
|
|
|
49
61
|
* @returns undefined if index is out of bounds.
|
|
50
62
|
*/
|
|
51
63
|
abstract vectorXYAndZIndex(origin: XYAndZ, indexB: number, result?: Vector3d): Vector3d | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Return a vector from `origin` to the point at `indexB`.
|
|
66
|
+
* * This method does not check for index validity. Use [[vectorXYAndZIndex]] to have validity test.
|
|
67
|
+
* @param origin origin for vector.
|
|
68
|
+
* @param indexB index of point within the array.
|
|
69
|
+
* @param result caller-allocated vector.
|
|
70
|
+
*/
|
|
71
|
+
vectorXYAndZUncheckedIndex(origin: XYAndZ, indexB: number, result?: Vector3d): Vector3d;
|
|
52
72
|
/**
|
|
53
73
|
* Return a vector from the point at `indexA` to `target`.
|
|
54
74
|
* @param indexA index of point within the array.
|
|
@@ -73,6 +93,14 @@ export declare abstract class IndexedXYZCollection {
|
|
|
73
93
|
* @returns undefined if index is out of bounds.
|
|
74
94
|
*/
|
|
75
95
|
dotProductIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ): number | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* Return the dot product of the vectors from the point at `origin` to the point at `indexA` and to `targetB`.
|
|
98
|
+
* * This method does not check for index validity. Use [[dotProductIndexIndexXYAndZ]] to have validity test.
|
|
99
|
+
* @param origin index of point within the array; origin of both vectors.
|
|
100
|
+
* @param indexA index of point within the array; target of the first vector.
|
|
101
|
+
* @param targetB target for second vector.
|
|
102
|
+
*/
|
|
103
|
+
dotProductUncheckedIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ): number;
|
|
76
104
|
/**
|
|
77
105
|
* Return the cross product of the vectors from `origin` to points at `indexA` and `indexB`.
|
|
78
106
|
* @param origin origin for vector.
|
|
@@ -91,6 +119,15 @@ export declare abstract class IndexedXYZCollection {
|
|
|
91
119
|
* @returns undefined if an index is out of bounds.
|
|
92
120
|
*/
|
|
93
121
|
crossProductIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ, result?: Vector3d): Vector3d | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* Return the cross product of the vectors from `origin` to the point at `indexA` and to `targetB.
|
|
124
|
+
* * This method does not check for index validity. Use [[crossProductIndexIndexXYAndZ]] to have validity test.
|
|
125
|
+
* @param origin index of point within the array; origin of both vectors.
|
|
126
|
+
* @param indexA index of point within the array; target of the first vector.
|
|
127
|
+
* @param targetB target of second vector.
|
|
128
|
+
* @param result optional caller-allocated result to fill and return.
|
|
129
|
+
*/
|
|
130
|
+
crossProductUncheckedIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ, result?: Vector3d): Vector3d;
|
|
94
131
|
/**
|
|
95
132
|
* Return the cross product of vectors from `origin` to points at `indexA` and `indexB`.
|
|
96
133
|
* @param origin origin for vector.
|
|
@@ -101,12 +138,20 @@ export declare abstract class IndexedXYZCollection {
|
|
|
101
138
|
*/
|
|
102
139
|
abstract crossProductIndexIndexIndex(origin: number, indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;
|
|
103
140
|
/**
|
|
104
|
-
* Return the cross product of vectors from
|
|
141
|
+
* Return the cross product of vectors from the point at `origin` to points at `indexA` and `indexB`.
|
|
142
|
+
* * This method does not check for index validity. Use [[crossProductIndexIndexIndex]] to have validity test.
|
|
143
|
+
* @param origin origin for vector.
|
|
144
|
+
* @param indexA index of first target within the array.
|
|
145
|
+
* @param indexB index of second target within the array.
|
|
146
|
+
* @param result optional caller-allocated vector.
|
|
147
|
+
*/
|
|
148
|
+
crossProductUncheckedIndexIndexIndex(origin: number, indexA: number, indexB: number, result?: Vector3d): Vector3d;
|
|
149
|
+
/**
|
|
150
|
+
* Compute the cross product from indexed `origin` to targets at indices `indexA` and `indexB`, and add it to `result`.
|
|
105
151
|
* @param origin index of origin.
|
|
106
152
|
* @param indexA index of first target within the array.
|
|
107
153
|
* @param indexB index of second target within the array.
|
|
108
154
|
* @param result caller-allocated vector.
|
|
109
|
-
* @returns return true if indexA, indexB both valid.
|
|
110
155
|
*/
|
|
111
156
|
abstract accumulateCrossProductIndexIndexIndex(origin: number, indexA: number, indexB: number, result: Vector3d): void;
|
|
112
157
|
/** Read-only property for number of XYZ in the collection. */
|
|
@@ -117,18 +162,39 @@ export declare abstract class IndexedXYZCollection {
|
|
|
117
162
|
* @param index1 second point index.
|
|
118
163
|
*/
|
|
119
164
|
abstract distanceSquaredIndexIndex(index0: number, index1: number): number | undefined;
|
|
165
|
+
/**
|
|
166
|
+
* Return distance squared between indicated points.
|
|
167
|
+
* * This method does not check for index validity. Use [[distanceSquaredIndexIndex]] to have validity test.
|
|
168
|
+
* @param index0 first point index.
|
|
169
|
+
* @param index1 second point index.
|
|
170
|
+
*/
|
|
171
|
+
distanceSquaredUncheckedIndexIndex(index0: number, index1: number): number;
|
|
120
172
|
/**
|
|
121
173
|
* Return distance squared between the point at index0 and target.
|
|
122
174
|
* @param index0 first point index.
|
|
123
175
|
* @param target second point.
|
|
124
176
|
*/
|
|
125
177
|
distanceSquaredIndexXYAndZ(index0: number, target: XYAndZ): number | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* Return distance squared between the point at index0 and target.
|
|
180
|
+
* * This method does not check for index validity. Use [[distanceSquaredIndexXYAndZ]] to have validity test.
|
|
181
|
+
* @param index0 first point index.
|
|
182
|
+
* @param target second point.
|
|
183
|
+
*/
|
|
184
|
+
distanceSquaredUncheckedIndexXYAndZ(index0: number, target: XYAndZ): number;
|
|
126
185
|
/**
|
|
127
186
|
* Return distance between indicated points.
|
|
128
187
|
* @param index0 first point index.
|
|
129
188
|
* @param index1 second point index.
|
|
130
189
|
*/
|
|
131
190
|
abstract distanceIndexIndex(index0: number, index1: number): number | undefined;
|
|
191
|
+
/**
|
|
192
|
+
* Return distance between indicated points.
|
|
193
|
+
* * This method does not check for index validity. Use [[distanceIndexIndex]] to have validity test.
|
|
194
|
+
* @param index0 first point index.
|
|
195
|
+
* @param index1 second point index.
|
|
196
|
+
*/
|
|
197
|
+
distanceUncheckedIndexIndex(index0: number, index1: number): number;
|
|
132
198
|
/**
|
|
133
199
|
* Test if index is valid for an xyz within this array.
|
|
134
200
|
* @param index xyz index to test.
|
|
@@ -170,6 +236,15 @@ export declare abstract class IndexedXYZCollection {
|
|
|
170
236
|
* @returns undefined if an index is out of bounds.
|
|
171
237
|
*/
|
|
172
238
|
interpolateIndexIndex(index0: number, fraction: number, index1: number, result?: Point3d): Point3d | undefined;
|
|
239
|
+
/**
|
|
240
|
+
* Interpolate the points at the given indices.
|
|
241
|
+
* * This method does not check for index validity. Use [[interpolateIndexIndex]] to have validity test.
|
|
242
|
+
* @param index0 index of point p0 within the array.
|
|
243
|
+
* @param fraction fraction f such that returned point is p0 + f * (p1 - p0).
|
|
244
|
+
* @param index1 index of point p1 within the array.
|
|
245
|
+
* @param result optional caller-allocated result to fill and return.
|
|
246
|
+
*/
|
|
247
|
+
interpolateUncheckedIndexIndex(index0: number, fraction: number, index1: number, result?: Point3d): Point3d;
|
|
173
248
|
/** Access x of indexed point. */
|
|
174
249
|
abstract getXAtUncheckedPointIndex(pointIndex: number): number;
|
|
175
250
|
/** Access y of indexed point. */
|
|
@@ -197,6 +272,15 @@ export declare abstract class IndexedXYZCollection {
|
|
|
197
272
|
* @returns whether the points are equal within tolerance, or `undefined` if either index is invalid.
|
|
198
273
|
*/
|
|
199
274
|
almostEqualIndexIndex(index0: number, index1: number, tolerance?: number): boolean | undefined;
|
|
275
|
+
/**
|
|
276
|
+
* Test whether the indexed points are equal within tolerance.
|
|
277
|
+
* * This method does not check for index validity. Use [[almostEqualIndexIndex]] to have validity test.
|
|
278
|
+
* @param index0 index of first point.
|
|
279
|
+
* @param index1 index of second point.
|
|
280
|
+
* @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.
|
|
281
|
+
* @returns whether the points are equal within tolerance.
|
|
282
|
+
*/
|
|
283
|
+
almostEqualUncheckedIndexIndex(index0: number, index1: number, tolerance?: number): boolean;
|
|
200
284
|
/**
|
|
201
285
|
* Test whether the xy-coordinates of the indexed points are equal within tolerance. The z-coordinates are ignored.
|
|
202
286
|
* @param index0 index of first point.
|
|
@@ -205,6 +289,17 @@ export declare abstract class IndexedXYZCollection {
|
|
|
205
289
|
* @returns whether the xy-coordinates of the points are equal within tolerance, or `undefined` if either index is invalid.
|
|
206
290
|
*/
|
|
207
291
|
almostEqualXYIndexIndex(index0: number, index1: number, tolerance?: number): boolean | undefined;
|
|
292
|
+
/**
|
|
293
|
+
* Test whether the xy-coordinates of the indexed points are equal within tolerance. The z-coordinates are ignored.
|
|
294
|
+
* * This method does not check for index validity. Use [[almostEqualXYIndexIndex]] to have validity test.
|
|
295
|
+
* @param index0 index of first point.
|
|
296
|
+
* @param index1 index of second point.
|
|
297
|
+
* @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.
|
|
298
|
+
* @returns whether the xy-coordinates of the points are equal within tolerance.
|
|
299
|
+
*/
|
|
300
|
+
almostEqualXYUncheckedIndexIndex(index0: number, index1: number, tolerance?: number): boolean;
|
|
301
|
+
/** Return the altitude of the indexed point from the plane. */
|
|
302
|
+
evaluateUncheckedIndexPlaneAltitude(pointIndex: number, plane: PlaneAltitudeEvaluator): number;
|
|
208
303
|
}
|
|
209
304
|
/**
|
|
210
305
|
* Abstract base class extends [[IndexedXYZCollection]] with methods that modify the collection.
|
|
@@ -221,6 +316,8 @@ export declare abstract class IndexedReadWriteXYZCollection extends IndexedXYZCo
|
|
|
221
316
|
abstract clear(): void;
|
|
222
317
|
/** Reverse the points in place. */
|
|
223
318
|
abstract reverseInPlace(): void;
|
|
319
|
+
/** Push points from the source array to the end of this array and return the number of points pushed. */
|
|
320
|
+
pushIndexedXYZCollection(source: IndexedXYZCollection): number;
|
|
224
321
|
}
|
|
225
322
|
/**
|
|
226
323
|
* Type for use as signature for xyz data of a single linestring appearing in a parameter list.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IndexedXYZCollection.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/IndexedXYZCollection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IndexedXYZCollection.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/IndexedXYZCollection.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAY,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAA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E,SAAS,SAA+B,GAAG,OAAO;IAI1H,+DAA+D;IACxD,mCAAmC,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,sBAAsB,GAAG,MAAM;CAGtG;AAED;;;GAGG;AACH,8BAAsB,6BAA8B,SAAQ,oBAAoB;IAC9E,mDAAmD;aACnC,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IACzC,uEAAuE;aACvD,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IACjE,8BAA8B;aACd,GAAG,IAAI,IAAI;IAC3B,0BAA0B;aACV,KAAK,IAAI,IAAI;IAC7B,mCAAmC;aACnB,cAAc,IAAI,IAAI;IACtC,yGAAyG;IAClG,wBAAwB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM;CAKtE;AAED;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,GAAG,MAAM,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC;AAE3F;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG,qBAAqB,GAAG,qBAAqB,EAAE,CAAC"}
|
|
@@ -40,6 +40,26 @@ class PointsIterator {
|
|
|
40
40
|
* @public
|
|
41
41
|
*/
|
|
42
42
|
class IndexedXYZCollection {
|
|
43
|
+
/**
|
|
44
|
+
* Return a vector from the point at `indexA` to the point at `indexB`.
|
|
45
|
+
* * This method does not check for index validity. Use [[vectorIndexIndex]] to have validity test.
|
|
46
|
+
* @param indexA index of point within the array.
|
|
47
|
+
* @param indexB index of point within the array.
|
|
48
|
+
* @param result caller-allocated vector.
|
|
49
|
+
*/
|
|
50
|
+
vectorUncheckedIndexIndex(indexA, indexB, result) {
|
|
51
|
+
return Point3dVector3d_1.Vector3d.createStartEndXYZXYZ(this.getXAtUncheckedPointIndex(indexA), this.getYAtUncheckedPointIndex(indexA), this.getZAtUncheckedPointIndex(indexA), this.getXAtUncheckedPointIndex(indexB), this.getYAtUncheckedPointIndex(indexB), this.getZAtUncheckedPointIndex(indexB), result);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Return a vector from `origin` to the point at `indexB`.
|
|
55
|
+
* * This method does not check for index validity. Use [[vectorXYAndZIndex]] to have validity test.
|
|
56
|
+
* @param origin origin for vector.
|
|
57
|
+
* @param indexB index of point within the array.
|
|
58
|
+
* @param result caller-allocated vector.
|
|
59
|
+
*/
|
|
60
|
+
vectorXYAndZUncheckedIndex(origin, indexB, result) {
|
|
61
|
+
return Point3dVector3d_1.Vector3d.createStartEndXYZXYZ(origin.x, origin.y, origin.z, this.getXAtUncheckedPointIndex(indexB), this.getYAtUncheckedPointIndex(indexB), this.getZAtUncheckedPointIndex(indexB), result);
|
|
62
|
+
}
|
|
43
63
|
/**
|
|
44
64
|
* Return a vector from the point at `indexA` to `target`.
|
|
45
65
|
* @param indexA index of point within the array.
|
|
@@ -78,6 +98,16 @@ class IndexedXYZCollection {
|
|
|
78
98
|
dotProductIndexIndexXYAndZ(origin, indexA, targetB) {
|
|
79
99
|
if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length)
|
|
80
100
|
return undefined;
|
|
101
|
+
return this.dotProductUncheckedIndexIndexXYAndZ(origin, indexA, targetB);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Return the dot product of the vectors from the point at `origin` to the point at `indexA` and to `targetB`.
|
|
105
|
+
* * This method does not check for index validity. Use [[dotProductIndexIndexXYAndZ]] to have validity test.
|
|
106
|
+
* @param origin index of point within the array; origin of both vectors.
|
|
107
|
+
* @param indexA index of point within the array; target of the first vector.
|
|
108
|
+
* @param targetB target for second vector.
|
|
109
|
+
*/
|
|
110
|
+
dotProductUncheckedIndexIndexXYAndZ(origin, indexA, targetB) {
|
|
81
111
|
const x0 = this.getXAtUncheckedPointIndex(origin);
|
|
82
112
|
const y0 = this.getYAtUncheckedPointIndex(origin);
|
|
83
113
|
const z0 = this.getZAtUncheckedPointIndex(origin);
|
|
@@ -96,11 +126,45 @@ class IndexedXYZCollection {
|
|
|
96
126
|
crossProductIndexIndexXYAndZ(origin, indexA, targetB, result) {
|
|
97
127
|
if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length)
|
|
98
128
|
return undefined;
|
|
129
|
+
return this.crossProductUncheckedIndexIndexXYAndZ(origin, indexA, targetB, result);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Return the cross product of the vectors from `origin` to the point at `indexA` and to `targetB.
|
|
133
|
+
* * This method does not check for index validity. Use [[crossProductIndexIndexXYAndZ]] to have validity test.
|
|
134
|
+
* @param origin index of point within the array; origin of both vectors.
|
|
135
|
+
* @param indexA index of point within the array; target of the first vector.
|
|
136
|
+
* @param targetB target of second vector.
|
|
137
|
+
* @param result optional caller-allocated result to fill and return.
|
|
138
|
+
*/
|
|
139
|
+
crossProductUncheckedIndexIndexXYAndZ(origin, indexA, targetB, result) {
|
|
99
140
|
const x0 = this.getXAtUncheckedPointIndex(origin);
|
|
100
141
|
const y0 = this.getYAtUncheckedPointIndex(origin);
|
|
101
142
|
const z0 = this.getZAtUncheckedPointIndex(origin);
|
|
102
143
|
return Point3dVector3d_1.Vector3d.createCrossProduct(this.getXAtUncheckedPointIndex(indexA) - x0, this.getYAtUncheckedPointIndex(indexA) - y0, this.getZAtUncheckedPointIndex(indexA) - z0, targetB.x - x0, targetB.y - y0, targetB.z - z0, result);
|
|
103
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Return the cross product of vectors from the point at `origin` to points at `indexA` and `indexB`.
|
|
147
|
+
* * This method does not check for index validity. Use [[crossProductIndexIndexIndex]] to have validity test.
|
|
148
|
+
* @param origin origin for vector.
|
|
149
|
+
* @param indexA index of first target within the array.
|
|
150
|
+
* @param indexB index of second target within the array.
|
|
151
|
+
* @param result optional caller-allocated vector.
|
|
152
|
+
*/
|
|
153
|
+
crossProductUncheckedIndexIndexIndex(origin, indexA, indexB, result) {
|
|
154
|
+
const x0 = this.getXAtUncheckedPointIndex(origin);
|
|
155
|
+
const y0 = this.getYAtUncheckedPointIndex(origin);
|
|
156
|
+
const z0 = this.getZAtUncheckedPointIndex(origin);
|
|
157
|
+
return Point3dVector3d_1.Vector3d.createCrossProduct(this.getXAtUncheckedPointIndex(indexA) - x0, this.getYAtUncheckedPointIndex(indexA) - y0, this.getZAtUncheckedPointIndex(indexA) - z0, this.getXAtUncheckedPointIndex(indexB) - x0, this.getYAtUncheckedPointIndex(indexB) - y0, this.getZAtUncheckedPointIndex(indexB) - z0, result);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Return distance squared between indicated points.
|
|
161
|
+
* * This method does not check for index validity. Use [[distanceSquaredIndexIndex]] to have validity test.
|
|
162
|
+
* @param index0 first point index.
|
|
163
|
+
* @param index1 second point index.
|
|
164
|
+
*/
|
|
165
|
+
distanceSquaredUncheckedIndexIndex(index0, index1) {
|
|
166
|
+
return Geometry_1.Geometry.hypotenuseSquaredXYZ(this.getXAtUncheckedPointIndex(index1) - this.getXAtUncheckedPointIndex(index0), this.getYAtUncheckedPointIndex(index1) - this.getYAtUncheckedPointIndex(index0), this.getZAtUncheckedPointIndex(index1) - this.getZAtUncheckedPointIndex(index0));
|
|
167
|
+
}
|
|
104
168
|
/**
|
|
105
169
|
* Return distance squared between the point at index0 and target.
|
|
106
170
|
* @param index0 first point index.
|
|
@@ -109,8 +173,26 @@ class IndexedXYZCollection {
|
|
|
109
173
|
distanceSquaredIndexXYAndZ(index0, target) {
|
|
110
174
|
if (index0 < 0 || index0 >= this.length)
|
|
111
175
|
return undefined;
|
|
176
|
+
return this.distanceSquaredUncheckedIndexXYAndZ(index0, target);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Return distance squared between the point at index0 and target.
|
|
180
|
+
* * This method does not check for index validity. Use [[distanceSquaredIndexXYAndZ]] to have validity test.
|
|
181
|
+
* @param index0 first point index.
|
|
182
|
+
* @param target second point.
|
|
183
|
+
*/
|
|
184
|
+
distanceSquaredUncheckedIndexXYAndZ(index0, target) {
|
|
112
185
|
return Geometry_1.Geometry.hypotenuseSquaredXYZ(target.x - this.getXAtUncheckedPointIndex(index0), target.y - this.getYAtUncheckedPointIndex(index0), target.z - this.getZAtUncheckedPointIndex(index0));
|
|
113
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Return distance between indicated points.
|
|
189
|
+
* * This method does not check for index validity. Use [[distanceIndexIndex]] to have validity test.
|
|
190
|
+
* @param index0 first point index.
|
|
191
|
+
* @param index1 second point index.
|
|
192
|
+
*/
|
|
193
|
+
distanceUncheckedIndexIndex(index0, index1) {
|
|
194
|
+
return Geometry_1.Geometry.hypotenuseXYZ(this.getXAtUncheckedPointIndex(index1) - this.getXAtUncheckedPointIndex(index0), this.getYAtUncheckedPointIndex(index1) - this.getYAtUncheckedPointIndex(index0), this.getZAtUncheckedPointIndex(index1) - this.getZAtUncheckedPointIndex(index0));
|
|
195
|
+
}
|
|
114
196
|
/**
|
|
115
197
|
* Test if index is valid for an xyz within this array.
|
|
116
198
|
* @param index xyz index to test.
|
|
@@ -193,6 +275,17 @@ class IndexedXYZCollection {
|
|
|
193
275
|
interpolateIndexIndex(index0, fraction, index1, result) {
|
|
194
276
|
if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)
|
|
195
277
|
return undefined;
|
|
278
|
+
return this.interpolateUncheckedIndexIndex(index0, fraction, index1, result);
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Interpolate the points at the given indices.
|
|
282
|
+
* * This method does not check for index validity. Use [[interpolateIndexIndex]] to have validity test.
|
|
283
|
+
* @param index0 index of point p0 within the array.
|
|
284
|
+
* @param fraction fraction f such that returned point is p0 + f * (p1 - p0).
|
|
285
|
+
* @param index1 index of point p1 within the array.
|
|
286
|
+
* @param result optional caller-allocated result to fill and return.
|
|
287
|
+
*/
|
|
288
|
+
interpolateUncheckedIndexIndex(index0, fraction, index1, result) {
|
|
196
289
|
return Point3dVector3d_1.Point3d.create(Geometry_1.Geometry.interpolate(this.getXAtUncheckedPointIndex(index0), fraction, this.getXAtUncheckedPointIndex(index1)), Geometry_1.Geometry.interpolate(this.getYAtUncheckedPointIndex(index0), fraction, this.getYAtUncheckedPointIndex(index1)), Geometry_1.Geometry.interpolate(this.getZAtUncheckedPointIndex(index0), fraction, this.getZAtUncheckedPointIndex(index1)), result);
|
|
197
290
|
}
|
|
198
291
|
/**
|
|
@@ -233,6 +326,17 @@ class IndexedXYZCollection {
|
|
|
233
326
|
almostEqualIndexIndex(index0, index1, tolerance = Geometry_1.Geometry.smallMetricDistance) {
|
|
234
327
|
if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)
|
|
235
328
|
return undefined;
|
|
329
|
+
return this.almostEqualUncheckedIndexIndex(index0, index1, tolerance);
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Test whether the indexed points are equal within tolerance.
|
|
333
|
+
* * This method does not check for index validity. Use [[almostEqualIndexIndex]] to have validity test.
|
|
334
|
+
* @param index0 index of first point.
|
|
335
|
+
* @param index1 index of second point.
|
|
336
|
+
* @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.
|
|
337
|
+
* @returns whether the points are equal within tolerance.
|
|
338
|
+
*/
|
|
339
|
+
almostEqualUncheckedIndexIndex(index0, index1, tolerance = Geometry_1.Geometry.smallMetricDistance) {
|
|
236
340
|
return Geometry_1.Geometry.isSameCoordinate(this.getXAtUncheckedPointIndex(index0), this.getXAtUncheckedPointIndex(index1), tolerance)
|
|
237
341
|
&& Geometry_1.Geometry.isSameCoordinate(this.getYAtUncheckedPointIndex(index0), this.getYAtUncheckedPointIndex(index1), tolerance)
|
|
238
342
|
&& Geometry_1.Geometry.isSameCoordinate(this.getZAtUncheckedPointIndex(index0), this.getZAtUncheckedPointIndex(index1), tolerance);
|
|
@@ -247,9 +351,24 @@ class IndexedXYZCollection {
|
|
|
247
351
|
almostEqualXYIndexIndex(index0, index1, tolerance = Geometry_1.Geometry.smallMetricDistance) {
|
|
248
352
|
if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)
|
|
249
353
|
return undefined;
|
|
354
|
+
return this.almostEqualXYUncheckedIndexIndex(index0, index1, tolerance);
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Test whether the xy-coordinates of the indexed points are equal within tolerance. The z-coordinates are ignored.
|
|
358
|
+
* * This method does not check for index validity. Use [[almostEqualXYIndexIndex]] to have validity test.
|
|
359
|
+
* @param index0 index of first point.
|
|
360
|
+
* @param index1 index of second point.
|
|
361
|
+
* @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.
|
|
362
|
+
* @returns whether the xy-coordinates of the points are equal within tolerance.
|
|
363
|
+
*/
|
|
364
|
+
almostEqualXYUncheckedIndexIndex(index0, index1, tolerance = Geometry_1.Geometry.smallMetricDistance) {
|
|
250
365
|
return Geometry_1.Geometry.isSameCoordinate(this.getXAtUncheckedPointIndex(index0), this.getXAtUncheckedPointIndex(index1), tolerance)
|
|
251
366
|
&& Geometry_1.Geometry.isSameCoordinate(this.getYAtUncheckedPointIndex(index0), this.getYAtUncheckedPointIndex(index1), tolerance);
|
|
252
367
|
}
|
|
368
|
+
/** Return the altitude of the indexed point from the plane. */
|
|
369
|
+
evaluateUncheckedIndexPlaneAltitude(pointIndex, plane) {
|
|
370
|
+
return plane.altitudeXYZ(this.getXAtUncheckedPointIndex(pointIndex), this.getYAtUncheckedPointIndex(pointIndex), this.getZAtUncheckedPointIndex(pointIndex));
|
|
371
|
+
}
|
|
253
372
|
}
|
|
254
373
|
exports.IndexedXYZCollection = IndexedXYZCollection;
|
|
255
374
|
/**
|
|
@@ -257,6 +376,12 @@ exports.IndexedXYZCollection = IndexedXYZCollection;
|
|
|
257
376
|
* @public
|
|
258
377
|
*/
|
|
259
378
|
class IndexedReadWriteXYZCollection extends IndexedXYZCollection {
|
|
379
|
+
/** Push points from the source array to the end of this array and return the number of points pushed. */
|
|
380
|
+
pushIndexedXYZCollection(source) {
|
|
381
|
+
for (let i = 0; i < source.length; i++)
|
|
382
|
+
this.pushXYZ(source.getXAtUncheckedPointIndex(i), source.getYAtUncheckedPointIndex(i), source.getZAtUncheckedPointIndex(i));
|
|
383
|
+
return source.length;
|
|
384
|
+
}
|
|
260
385
|
}
|
|
261
386
|
exports.IndexedReadWriteXYZCollection = IndexedReadWriteXYZCollection;
|
|
262
387
|
//# sourceMappingURL=IndexedXYZCollection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IndexedXYZCollection.js","sourceRoot":"","sources":["../../../src/geometry3d/IndexedXYZCollection.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAAuC;AACvC,uDAA2D;AAC3D,mCAAkC;AAIlC,MAAM,cAAc;IACD,WAAW,CAAuB;IAC3C,SAAS,GAAG,CAAC,CAAC,CAAC;IACvB,YAAmB,UAAgC;QACjD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IACM,IAAI;QACT,IAAI,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;YAChD,wEAAwE;YACxE,kFAAkF;YAClF,OAAO,EAAE,IAAI,EAAE,IAAI,EAAoC,CAAC;QAC1D,CAAC;QACD,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,+BAA+B,CAAC,IAAI,CAAC,SAAS,CAAC;YACvE,IAAI,EAAE,KAAK;SACZ,CAAC;IACJ,CAAC;IACM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAwB,OAAO,IAAI,CAAC,CAAC,CAAC;CAC/D;AACD;;;;;;;;GAQG;AACH,MAAsB,oBAAoB;IAsCxC;;;;;;OAMG;IACI,iBAAiB,CAAC,MAAc,EAAE,MAAc,EAAE,MAAi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AAM,IAAI,IAAI,CAAC,MAAM;YAC5E,OAAO,SAAS,CAAC;QACnB,OAAO,mBAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;eACtH,mBAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;eACpH,mBAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;IAC5H,CAAC;IACD;;;;;;OAMG;IACI,uBAAuB,CAAC,MAAc,EAAE,MAAc,EAAE,SAAS,GAAG,mBAAQ,CAAC,mBAAmB;QACrG,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,IAAI,CAAC,MAAM;YAC5E,OAAO,SAAS,CAAC;QACnB,OAAO,mBAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;eACtH,mBAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;IAC5H,CAAC;CACF;AAzTD,oDAyTC;AAED;;;GAGG;AACH,MAAsB,6BAA8B,SAAQ,oBAAoB;CAW/E;AAXD,sEAWC","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 ArraysAndInterfaces\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Point3d, Vector3d, XYZ } from \"./Point3dVector3d\";\r\nimport { Range3d } from \"./Range\";\r\nimport { Transform } from \"./Transform\";\r\nimport { XAndY, XYAndZ } from \"./XYZProps\";\r\n\r\nclass PointsIterator implements Iterator<Point3d>, Iterable<Point3d> {\r\n private readonly _collection: IndexedXYZCollection;\r\n private _curIndex = -1;\r\n public constructor(collection: IndexedXYZCollection) {\r\n this._collection = collection;\r\n }\r\n public next(): IteratorResult<Point3d> {\r\n if (++this._curIndex >= this._collection.length) {\r\n // the ECMAScript spec states that value=undefined is valid if done=true\r\n // the TypeScript interface violates the spec hence the cast to any and back below\r\n return { done: true } as any as IteratorResult<Point3d>;\r\n }\r\n return {\r\n value: this._collection.getPoint3dAtUncheckedPointIndex(this._curIndex),\r\n done: false,\r\n };\r\n }\r\n public [Symbol.iterator](): Iterator<Point3d> { return this; }\r\n}\r\n/**\r\n * Abstract base class for read-only access to XYZ data with indexed reference.\r\n * * This allows algorithms to work with Point3d[] or [[GrowableXYZArray]].\r\n * * GrowableXYZArray implements these for its data.\r\n * * Point3dArrayCarrier carries a (reference to) a Point3d[] and implements the methods with calls on that array reference.\r\n * * In addition to \"point by point\" accessors, other abstract members compute commonly useful vector data \"between points\".\r\n * * Methods that create vectors among multiple indices allow callers to avoid creating temporaries.\r\n * @public\r\n */\r\nexport abstract class IndexedXYZCollection {\r\n /**\r\n * Return the point at `index` as a strongly typed Point3d.\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 abstract getPoint3dAtCheckedPointIndex(index: number, result?: Point3d): Point3d | undefined;\r\n /**\r\n * Return the point at `index` as a strongly typed Point3d, without checking the point index validity.\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 abstract getPoint3dAtUncheckedPointIndex(index: number, result?: Point3d): Point3d;\r\n /**\r\n * Get from `index` as a 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 abstract getVector3dAtCheckedVectorIndex(index: number, result?: Vector3d): Vector3d | undefined;\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 abstract vectorIndexIndex(indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;\r\n /**\r\n * Return a vector from `origin` to the 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 abstract vectorXYAndZIndex(origin: XYAndZ, indexB: number, result?: Vector3d): Vector3d | undefined;\r\n /**\r\n * Return a vector from the point at `indexA` to `target`.\r\n * @param indexA index of point within the array.\r\n * @param target target for vector.\r\n * @param result caller-allocated vector.\r\n * @returns undefined if index is out of bounds.\r\n */\r\n public vectorIndexXYAndZ(indexA: number, target: XYAndZ, result?: Vector3d): Vector3d | undefined {\r\n const reversed = this.vectorXYAndZIndex(target, indexA, result);\r\n return reversed?.negate(reversed);\r\n }\r\n /**\r\n * Return the dot product of the vectors from the point at `origin` to the points at `indexA` and `indexB`.\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 indexB index of point within the array; target of the second vector.\r\n * @returns undefined if index is out of bounds.\r\n */\r\n public dotProductIndexIndexIndex(origin: number, indexA: number, indexB: number): number | undefined {\r\n if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length || indexB < 0 || indexB >= this.length)\r\n return undefined;\r\n const x0 = this.getXAtUncheckedPointIndex(origin);\r\n const y0 = this.getYAtUncheckedPointIndex(origin);\r\n const z0 = this.getZAtUncheckedPointIndex(origin);\r\n return (this.getXAtUncheckedPointIndex(indexA) - x0) * (this.getXAtUncheckedPointIndex(indexB) - x0) +\r\n (this.getYAtUncheckedPointIndex(indexA) - y0) * (this.getYAtUncheckedPointIndex(indexB) - y0) +\r\n (this.getZAtUncheckedPointIndex(indexA) - z0) * (this.getZAtUncheckedPointIndex(indexB) - z0);\r\n }\r\n /**\r\n * Return the dot product of the vectors from the point at `origin` to the point at `indexA` and to `targetB`.\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 for second vector.\r\n * @returns undefined if index is out of bounds.\r\n */\r\n public dotProductIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ): number | undefined {\r\n if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length)\r\n return undefined;\r\n const x0 = this.getXAtUncheckedPointIndex(origin);\r\n const y0 = this.getYAtUncheckedPointIndex(origin);\r\n const z0 = this.getZAtUncheckedPointIndex(origin);\r\n return (this.getXAtUncheckedPointIndex(indexA) - x0) * (targetB.x - x0) +\r\n (this.getYAtUncheckedPointIndex(indexA) - y0) * (targetB.y - y0) +\r\n (this.getZAtUncheckedPointIndex(indexA) - z0) * (targetB.z - z0);\r\n }\r\n /**\r\n * Return the cross product of the 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 abstract crossProductXYAndZIndexIndex(origin: XYAndZ, indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;\r\n /**\r\n * Return the cross product of the vectors from `origin` to the point at `indexA` and to `targetB`.\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 * @returns undefined if an index is out of bounds.\r\n */\r\n public crossProductIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ, result?: Vector3d): Vector3d | undefined {\r\n if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length)\r\n return undefined;\r\n const x0 = this.getXAtUncheckedPointIndex(origin);\r\n const y0 = this.getYAtUncheckedPointIndex(origin);\r\n const z0 = this.getZAtUncheckedPointIndex(origin);\r\n return Vector3d.createCrossProduct(\r\n this.getXAtUncheckedPointIndex(indexA) - x0,\r\n this.getYAtUncheckedPointIndex(indexA) - y0,\r\n this.getZAtUncheckedPointIndex(indexA) - z0,\r\n targetB.x - x0,\r\n targetB.y - y0,\r\n targetB.z - z0,\r\n result,\r\n );\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 optional caller-allocated vector.\r\n * @returns undefined if either index is out of bounds.\r\n */\r\n public abstract crossProductIndexIndexIndex(origin: number, indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;\r\n /**\r\n * Return the cross product of vectors from origin point at `indexA` to target points at `indexB` and `indexC`.\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 abstract accumulateCrossProductIndexIndexIndex(origin: number, indexA: number, indexB: number, result: Vector3d): void;\r\n /** Read-only property for number of XYZ in the collection. */\r\n public abstract get length(): number;\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 abstract distanceSquaredIndexIndex(index0: number, index1: number): number | undefined;\r\n /**\r\n * Return distance squared between the point at index0 and target.\r\n * @param index0 first point index.\r\n * @param target second point.\r\n */\r\n public distanceSquaredIndexXYAndZ(index0: number, target: XYAndZ): number | undefined {\r\n if (index0 < 0 || index0 >= this.length)\r\n return undefined;\r\n return Geometry.hypotenuseSquaredXYZ(\r\n target.x - this.getXAtUncheckedPointIndex(index0),\r\n target.y - this.getYAtUncheckedPointIndex(index0),\r\n target.z - this.getZAtUncheckedPointIndex(index0),\r\n );\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 abstract distanceIndexIndex(index0: number, index1: number): number | undefined;\r\n /**\r\n * Test if index is valid for an xyz within this array.\r\n * @param index xyz index to test.\r\n */\r\n public isIndexValid(index: number): boolean {\r\n return index >= 0 && index < this.length;\r\n }\r\n /** Adjust index into range by modulo with the length. */\r\n public cyclicIndex(i: number): number {\r\n return (i % this.length);\r\n }\r\n /** Return the range of the points. */\r\n public getRange(transform?: Transform, result?: Range3d): Range3d {\r\n let range = result;\r\n if (range)\r\n range.setNull();\r\n else\r\n range = Range3d.createNull();\r\n const n = this.length;\r\n const point = Point3d.create();\r\n for (let i = 0; i < n; i++) {\r\n this.getPoint3dAtUncheckedPointIndex(i, point);\r\n range.extendPoint(point, transform);\r\n }\r\n return range;\r\n }\r\n /**\r\n * For each subset of `k` successive points within tolerance of the first point in the subset, return the indices of\r\n * the last `k-1` duplicates.\r\n * * Index `0` is never returned.\r\n * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]]).\r\n * @param preserveLast if the last `k < this.length` points of the instance are duplicates, whether to return the\r\n * indices of the *first* `k-1` duplicates for this last run. If true, index `this.length - 1` is not returned.\r\n * unless all points are duplicates, in which case all indices but `0` are returned. Default value is false.\r\n * @return ordered array of 0-based indices of duplicate points\r\n */\r\n public findOrderedDuplicates(tolerance: number = Geometry.smallMetricDistance, preserveLast: boolean = false): number[] {\r\n const indices: number[] = [];\r\n if (this.length > 1) {\r\n for (let i = 0; i < this.length - 1;) {\r\n let j = i + 1;\r\n for (; this.almostEqualIndexIndex(i, j, tolerance); ++j)\r\n indices.push(j);\r\n i = j; // found next unique point\r\n }\r\n if (preserveLast && indices.length > 0 && indices.length < this.length - 1) { // not all points are duplicate\r\n let numLastRun = 0;\r\n for (; numLastRun <= indices.length - 1 && indices[indices.length - 1 - numLastRun] === this.length - 1 - numLastRun; ++numLastRun);\r\n for (let i = 0; i < numLastRun; ++i)\r\n indices[indices.length - 1 - i] -= 1; // decrement the indices of the last run so that the last point is preserved\r\n }\r\n }\r\n return indices;\r\n }\r\n /**\r\n * Accumulate scale times the x,y,z values at index.\r\n * * No action if index is out of bounds.\r\n */\r\n public abstract accumulateScaledXYZ(index: number, scale: number, sum: Point3d): void;\r\n /**\r\n * Compute the linear combination s of the indexed p_i and given scales s_i.\r\n * @param scales array of scales. For best results, scales should have same length as the instance.\r\n * @param result optional pre-allocated object to fill and return\r\n * @return s = sum(p_i * s_i), where i ranges from 0 to min(this.length, scales.length).\r\n */\r\n public linearCombination(scales: number[], result?: Point3d | Vector3d): XYZ {\r\n const n = Math.min(this.length, scales.length);\r\n const sum = (result instanceof Vector3d) ? Vector3d.createZero(result) : Point3d.createZero(result);\r\n for (let i = 0; i < n; ++i) {\r\n sum.x += scales[i] * this.getXAtUncheckedPointIndex(i);\r\n sum.y += scales[i] * this.getYAtUncheckedPointIndex(i);\r\n sum.z += scales[i] * this.getZAtUncheckedPointIndex(i);\r\n }\r\n return sum;\r\n }\r\n /**\r\n * Interpolate the points at the given indices.\r\n * @param index0 index of point p0 within the array.\r\n * @param fraction fraction f such that returned point is p0 + f * (p1 - p0).\r\n * @param index1 index of point p1 within the array.\r\n * @param result optional caller-allocated result to fill and return.\r\n * @returns undefined if an index is out of bounds.\r\n */\r\n public interpolateIndexIndex(index0: number, fraction: number, index1: number, result?: Point3d): Point3d | undefined {\r\n if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)\r\n return undefined;\r\n return Point3d.create(Geometry.interpolate(this.getXAtUncheckedPointIndex(index0), fraction, this.getXAtUncheckedPointIndex(index1)),\r\n Geometry.interpolate(this.getYAtUncheckedPointIndex(index0), fraction, this.getYAtUncheckedPointIndex(index1)),\r\n Geometry.interpolate(this.getZAtUncheckedPointIndex(index0), fraction, this.getZAtUncheckedPointIndex(index1)), result);\r\n }\r\n /** Access x of indexed point. */\r\n public abstract getXAtUncheckedPointIndex(pointIndex: number): number;\r\n /** Access y of indexed point. */\r\n public abstract getYAtUncheckedPointIndex(pointIndex: number): number;\r\n /** Access z of indexed point. */\r\n public abstract getZAtUncheckedPointIndex(pointIndex: number): number;\r\n /**\r\n * Return iterator over the points in this collection. Usage:\r\n * ```ts\r\n * for (const point: Point3d of collection.points) { ... }\r\n * ```\r\n */\r\n public get points(): Iterable<Point3d> {\r\n return new PointsIterator(this);\r\n }\r\n /** Convert to Point3d[]. */\r\n public getArray(): Point3d[] {\r\n const result = [];\r\n for (const p of this.points)\r\n result.push(p);\r\n return result;\r\n }\r\n /** Return the first point, or undefined if the array is empty. */\r\n public front(result?: Point3d): Point3d | undefined {\r\n if (this.length === 0)\r\n return undefined;\r\n return this.getPoint3dAtUncheckedPointIndex(0, result);\r\n }\r\n /** Return the last point, or undefined if the array is empty. */\r\n public back(result?: Point3d): Point3d | undefined {\r\n if (this.length === 0)\r\n return undefined;\r\n return this.getPoint3dAtUncheckedPointIndex(this.length - 1, result);\r\n }\r\n /**\r\n * Test whether the indexed points are equal within tolerance.\r\n * @param index0 index of first point.\r\n * @param index1 index of second point.\r\n * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.\r\n * @returns whether the points are equal within tolerance, or `undefined` if either index is invalid.\r\n */\r\n public almostEqualIndexIndex(index0: number, index1: number, tolerance = Geometry.smallMetricDistance): boolean | undefined {\r\n if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)\r\n return undefined;\r\n return Geometry.isSameCoordinate(this.getXAtUncheckedPointIndex(index0), this.getXAtUncheckedPointIndex(index1), tolerance)\r\n && Geometry.isSameCoordinate(this.getYAtUncheckedPointIndex(index0), this.getYAtUncheckedPointIndex(index1), tolerance)\r\n && Geometry.isSameCoordinate(this.getZAtUncheckedPointIndex(index0), this.getZAtUncheckedPointIndex(index1), tolerance);\r\n }\r\n /**\r\n * Test whether the xy-coordinates of the indexed points are equal within tolerance. The z-coordinates are ignored.\r\n * @param index0 index of first point.\r\n * @param index1 index of second point.\r\n * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.\r\n * @returns whether the xy-coordinates of the points are equal within tolerance, or `undefined` if either index is invalid.\r\n */\r\n public almostEqualXYIndexIndex(index0: number, index1: number, tolerance = Geometry.smallMetricDistance): boolean | undefined {\r\n if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)\r\n return undefined;\r\n return Geometry.isSameCoordinate(this.getXAtUncheckedPointIndex(index0), this.getXAtUncheckedPointIndex(index1), tolerance)\r\n && Geometry.isSameCoordinate(this.getYAtUncheckedPointIndex(index0), this.getYAtUncheckedPointIndex(index1), tolerance);\r\n }\r\n}\r\n\r\n/**\r\n * Abstract base class extends [[IndexedXYZCollection]] with methods that modify the collection.\r\n * @public\r\n */\r\nexport abstract class IndexedReadWriteXYZCollection extends IndexedXYZCollection {\r\n /** Push a (clone of) point onto the collection. */\r\n public abstract push(point: XYAndZ): void;\r\n /** Push a new point (given by xyz coordinates) onto the collection. */\r\n public abstract pushXYZ(x?: number, y?: number, z?: number): void;\r\n /** Remove the final point. */\r\n public abstract pop(): void;\r\n /** Remove all entries. */\r\n public abstract clear(): void;\r\n /** Reverse the points in place. */\r\n public abstract reverseInPlace(): void;\r\n}\r\n\r\n/**\r\n * Type for use as signature for xyz data of a single linestring appearing in a parameter list.\r\n * @public\r\n */\r\nexport type LineStringDataVariant = IndexedXYZCollection | XYAndZ[] | XAndY[] | number[][];\r\n\r\n/**\r\n * Type for use as signature for multiple xyz data of multiple linestrings appearing in a parameter list.\r\n * @public\r\n */\r\nexport type MultiLineStringDataVariant = LineStringDataVariant | LineStringDataVariant[];\r\n"]}
|
|
1
|
+
{"version":3,"file":"IndexedXYZCollection.js","sourceRoot":"","sources":["../../../src/geometry3d/IndexedXYZCollection.ts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,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;IAC5H,CAAC;IACD,+DAA+D;IACxD,mCAAmC,CAAC,UAAkB,EAAE,KAA6B;QAC1F,OAAO,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,yBAAyB,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,yBAAyB,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,yBAAyB,CAAC,UAAU,CAAC,CAAC,CAAC;IAC/J,CAAC;CACF;AA/cD,oDA+cC;AAED;;;GAGG;AACH,MAAsB,6BAA8B,SAAQ,oBAAoB;IAW9E,yGAAyG;IAClG,wBAAwB,CAAC,MAA4B;QAC1D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE;YACpC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9H,OAAO,MAAM,CAAC,MAAM,CAAC;IACvB,CAAC;CACF;AAjBD,sEAiBC","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 ArraysAndInterfaces\r\n */\r\n\r\nimport { Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\r\nimport { Point3d, Vector3d, XYZ } from \"./Point3dVector3d\";\r\nimport { Range3d } from \"./Range\";\r\nimport { Transform } from \"./Transform\";\r\nimport { XAndY, XYAndZ } from \"./XYZProps\";\r\n\r\nclass PointsIterator implements Iterator<Point3d>, Iterable<Point3d> {\r\n private readonly _collection: IndexedXYZCollection;\r\n private _curIndex = -1;\r\n public constructor(collection: IndexedXYZCollection) {\r\n this._collection = collection;\r\n }\r\n public next(): IteratorResult<Point3d> {\r\n if (++this._curIndex >= this._collection.length) {\r\n // the ECMAScript spec states that value=undefined is valid if done=true\r\n // the TypeScript interface violates the spec hence the cast to any and back below\r\n return { done: true } as any as IteratorResult<Point3d>;\r\n }\r\n return {\r\n value: this._collection.getPoint3dAtUncheckedPointIndex(this._curIndex),\r\n done: false,\r\n };\r\n }\r\n public [Symbol.iterator](): Iterator<Point3d> { return this; }\r\n}\r\n/**\r\n * Abstract base class for read-only access to XYZ data with indexed reference.\r\n * * This allows algorithms to work with Point3d[] or [[GrowableXYZArray]].\r\n * * GrowableXYZArray implements these for its data.\r\n * * Point3dArrayCarrier carries a (reference to) a Point3d[] and implements the methods with calls on that array reference.\r\n * * In addition to \"point by point\" accessors, other abstract members compute commonly useful vector data \"between points\".\r\n * * Methods that create vectors among multiple indices allow callers to avoid creating temporaries.\r\n * @public\r\n */\r\nexport abstract class IndexedXYZCollection {\r\n /**\r\n * Return the point at `index` as a strongly typed Point3d.\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 abstract getPoint3dAtCheckedPointIndex(index: number, result?: Point3d): Point3d | undefined;\r\n /**\r\n * Return the point at `index` as a strongly typed Point3d, without checking the point index validity.\r\n * * Use [[getPoint3dAtCheckedPointIndex]] to have index validity test.\r\n * @param index index of point within the array.\r\n * @param result caller-allocated destination.\r\n */\r\n public abstract getPoint3dAtUncheckedPointIndex(index: number, result?: Point3d): Point3d;\r\n /**\r\n * Get from `index` as a 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 abstract getVector3dAtCheckedVectorIndex(index: number, result?: Vector3d): Vector3d | undefined;\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 abstract vectorIndexIndex(indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;\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 vectorUncheckedIndexIndex(indexA: number, indexB: number, result?: Vector3d): Vector3d {\r\n return Vector3d.createStartEndXYZXYZ(\r\n this.getXAtUncheckedPointIndex(indexA),\r\n this.getYAtUncheckedPointIndex(indexA),\r\n this.getZAtUncheckedPointIndex(indexA),\r\n this.getXAtUncheckedPointIndex(indexB),\r\n this.getYAtUncheckedPointIndex(indexB),\r\n this.getZAtUncheckedPointIndex(indexB),\r\n result,\r\n );\r\n }\r\n /**\r\n * Return a vector from `origin` to the 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 abstract vectorXYAndZIndex(origin: XYAndZ, indexB: number, result?: Vector3d): Vector3d | undefined;\r\n /**\r\n * Return a vector from `origin` to the 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 vectorXYAndZUncheckedIndex(origin: XYAndZ, indexB: number, result?: Vector3d): Vector3d {\r\n return Vector3d.createStartEndXYZXYZ(\r\n origin.x,\r\n origin.y,\r\n origin.z,\r\n this.getXAtUncheckedPointIndex(indexB),\r\n this.getYAtUncheckedPointIndex(indexB),\r\n this.getZAtUncheckedPointIndex(indexB),\r\n result,\r\n );\r\n }\r\n /**\r\n * Return a vector from the point at `indexA` to `target`.\r\n * @param indexA index of point within the array.\r\n * @param target target for vector.\r\n * @param result caller-allocated vector.\r\n * @returns undefined if index is out of bounds.\r\n */\r\n public vectorIndexXYAndZ(indexA: number, target: XYAndZ, result?: Vector3d): Vector3d | undefined {\r\n const reversed = this.vectorXYAndZIndex(target, indexA, result);\r\n return reversed?.negate(reversed);\r\n }\r\n /**\r\n * Return the dot product of the vectors from the point at `origin` to the points at `indexA` and `indexB`.\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 indexB index of point within the array; target of the second vector.\r\n * @returns undefined if index is out of bounds.\r\n */\r\n public dotProductIndexIndexIndex(origin: number, indexA: number, indexB: number): number | undefined {\r\n if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length || indexB < 0 || indexB >= this.length)\r\n return undefined;\r\n const x0 = this.getXAtUncheckedPointIndex(origin);\r\n const y0 = this.getYAtUncheckedPointIndex(origin);\r\n const z0 = this.getZAtUncheckedPointIndex(origin);\r\n return (this.getXAtUncheckedPointIndex(indexA) - x0) * (this.getXAtUncheckedPointIndex(indexB) - x0) +\r\n (this.getYAtUncheckedPointIndex(indexA) - y0) * (this.getYAtUncheckedPointIndex(indexB) - y0) +\r\n (this.getZAtUncheckedPointIndex(indexA) - z0) * (this.getZAtUncheckedPointIndex(indexB) - z0);\r\n }\r\n /**\r\n * Return the dot product of the vectors from the point at `origin` to the point at `indexA` and to `targetB`.\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 for second vector.\r\n * @returns undefined if index is out of bounds.\r\n */\r\n public dotProductIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ): number | undefined {\r\n if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length)\r\n return undefined;\r\n return this.dotProductUncheckedIndexIndexXYAndZ(origin, indexA, targetB);\r\n }\r\n /**\r\n * Return the dot product of the vectors from the point at `origin` to the point at `indexA` and to `targetB`.\r\n * * This method does not check for index validity. Use [[dotProductIndexIndexXYAndZ]] 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 for second vector.\r\n */\r\n public dotProductUncheckedIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ): number {\r\n const x0 = this.getXAtUncheckedPointIndex(origin);\r\n const y0 = this.getYAtUncheckedPointIndex(origin);\r\n const z0 = this.getZAtUncheckedPointIndex(origin);\r\n return (this.getXAtUncheckedPointIndex(indexA) - x0) * (targetB.x - x0) +\r\n (this.getYAtUncheckedPointIndex(indexA) - y0) * (targetB.y - y0) +\r\n (this.getZAtUncheckedPointIndex(indexA) - z0) * (targetB.z - z0);\r\n }\r\n /**\r\n * Return the cross product of the 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 abstract crossProductXYAndZIndexIndex(origin: XYAndZ, indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;\r\n /**\r\n * Return the cross product of the vectors from `origin` to the point at `indexA` and to `targetB`.\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 * @returns undefined if an index is out of bounds.\r\n */\r\n public crossProductIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ, result?: Vector3d): Vector3d | undefined {\r\n if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length)\r\n return undefined;\r\n return this.crossProductUncheckedIndexIndexXYAndZ(origin, indexA, targetB, 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 crossProductUncheckedIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ, result?: Vector3d): Vector3d {\r\n const x0 = this.getXAtUncheckedPointIndex(origin);\r\n const y0 = this.getYAtUncheckedPointIndex(origin);\r\n const z0 = this.getZAtUncheckedPointIndex(origin);\r\n return Vector3d.createCrossProduct(\r\n this.getXAtUncheckedPointIndex(indexA) - x0,\r\n this.getYAtUncheckedPointIndex(indexA) - y0,\r\n this.getZAtUncheckedPointIndex(indexA) - z0,\r\n targetB.x - x0,\r\n targetB.y - y0,\r\n targetB.z - z0,\r\n result,\r\n );\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 optional caller-allocated vector.\r\n * @returns undefined if either index is out of bounds.\r\n */\r\n public abstract crossProductIndexIndexIndex(origin: number, indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;\r\n /**\r\n * Return the cross product of vectors from the point at `origin` 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 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 optional caller-allocated vector.\r\n */\r\n public crossProductUncheckedIndexIndexIndex(origin: number, indexA: number, indexB: number, result?: Vector3d): Vector3d {\r\n const x0 = this.getXAtUncheckedPointIndex(origin);\r\n const y0 = this.getYAtUncheckedPointIndex(origin);\r\n const z0 = this.getZAtUncheckedPointIndex(origin);\r\n return Vector3d.createCrossProduct(\r\n this.getXAtUncheckedPointIndex(indexA) - x0,\r\n this.getYAtUncheckedPointIndex(indexA) - y0,\r\n this.getZAtUncheckedPointIndex(indexA) - z0,\r\n this.getXAtUncheckedPointIndex(indexB) - x0,\r\n this.getYAtUncheckedPointIndex(indexB) - y0,\r\n this.getZAtUncheckedPointIndex(indexB) - z0,\r\n result,\r\n );\r\n }\r\n /**\r\n * Compute the cross product from indexed `origin` to targets at indices `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 abstract accumulateCrossProductIndexIndexIndex(origin: number, indexA: number, indexB: number, result: Vector3d): void;\r\n /** Read-only property for number of XYZ in the collection. */\r\n public abstract get length(): number;\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 abstract distanceSquaredIndexIndex(index0: number, index1: number): number | undefined;\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 distanceSquaredUncheckedIndexIndex(index0: number, index1: number): number {\r\n return Geometry.hypotenuseSquaredXYZ(\r\n this.getXAtUncheckedPointIndex(index1) - this.getXAtUncheckedPointIndex(index0),\r\n this.getYAtUncheckedPointIndex(index1) - this.getYAtUncheckedPointIndex(index0),\r\n this.getZAtUncheckedPointIndex(index1) - this.getZAtUncheckedPointIndex(index0),\r\n );\r\n }\r\n /**\r\n * Return distance squared between the point at index0 and target.\r\n * @param index0 first point index.\r\n * @param target second point.\r\n */\r\n public distanceSquaredIndexXYAndZ(index0: number, target: XYAndZ): number | undefined {\r\n if (index0 < 0 || index0 >= this.length)\r\n return undefined;\r\n return this.distanceSquaredUncheckedIndexXYAndZ(index0, target);\r\n }\r\n /**\r\n * Return distance squared between the point at index0 and target.\r\n * * This method does not check for index validity. Use [[distanceSquaredIndexXYAndZ]] to have validity test.\r\n * @param index0 first point index.\r\n * @param target second point.\r\n */\r\n public distanceSquaredUncheckedIndexXYAndZ(index0: number, target: XYAndZ): number {\r\n return Geometry.hypotenuseSquaredXYZ(\r\n target.x - this.getXAtUncheckedPointIndex(index0),\r\n target.y - this.getYAtUncheckedPointIndex(index0),\r\n target.z - this.getZAtUncheckedPointIndex(index0),\r\n );\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 abstract distanceIndexIndex(index0: number, index1: number): number | undefined;\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 distanceUncheckedIndexIndex(index0: number, index1: number): number {\r\n return Geometry.hypotenuseXYZ(\r\n this.getXAtUncheckedPointIndex(index1) - this.getXAtUncheckedPointIndex(index0),\r\n this.getYAtUncheckedPointIndex(index1) - this.getYAtUncheckedPointIndex(index0),\r\n this.getZAtUncheckedPointIndex(index1) - this.getZAtUncheckedPointIndex(index0),\r\n );\r\n }\r\n /**\r\n * Test if index is valid for an xyz within this array.\r\n * @param index xyz index to test.\r\n */\r\n public isIndexValid(index: number): boolean {\r\n return index >= 0 && index < this.length;\r\n }\r\n /** Adjust index into range by modulo with the length. */\r\n public cyclicIndex(i: number): number {\r\n return (i % this.length);\r\n }\r\n /** Return the range of the points. */\r\n public getRange(transform?: Transform, result?: Range3d): Range3d {\r\n let range = result;\r\n if (range)\r\n range.setNull();\r\n else\r\n range = Range3d.createNull();\r\n const n = this.length;\r\n const point = Point3d.create();\r\n for (let i = 0; i < n; i++) {\r\n this.getPoint3dAtUncheckedPointIndex(i, point);\r\n range.extendPoint(point, transform);\r\n }\r\n return range;\r\n }\r\n /**\r\n * For each subset of `k` successive points within tolerance of the first point in the subset, return the indices of\r\n * the last `k-1` duplicates.\r\n * * Index `0` is never returned.\r\n * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]]).\r\n * @param preserveLast if the last `k < this.length` points of the instance are duplicates, whether to return the\r\n * indices of the *first* `k-1` duplicates for this last run. If true, index `this.length - 1` is not returned.\r\n * unless all points are duplicates, in which case all indices but `0` are returned. Default value is false.\r\n * @return ordered array of 0-based indices of duplicate points\r\n */\r\n public findOrderedDuplicates(tolerance: number = Geometry.smallMetricDistance, preserveLast: boolean = false): number[] {\r\n const indices: number[] = [];\r\n if (this.length > 1) {\r\n for (let i = 0; i < this.length - 1;) {\r\n let j = i + 1;\r\n for (; this.almostEqualIndexIndex(i, j, tolerance); ++j)\r\n indices.push(j);\r\n i = j; // found next unique point\r\n }\r\n if (preserveLast && indices.length > 0 && indices.length < this.length - 1) { // not all points are duplicate\r\n let numLastRun = 0;\r\n for (; numLastRun <= indices.length - 1 && indices[indices.length - 1 - numLastRun] === this.length - 1 - numLastRun; ++numLastRun);\r\n for (let i = 0; i < numLastRun; ++i)\r\n indices[indices.length - 1 - i] -= 1; // decrement the indices of the last run so that the last point is preserved\r\n }\r\n }\r\n return indices;\r\n }\r\n /**\r\n * Accumulate scale times the x,y,z values at index.\r\n * * No action if index is out of bounds.\r\n */\r\n public abstract accumulateScaledXYZ(index: number, scale: number, sum: Point3d): void;\r\n /**\r\n * Compute the linear combination s of the indexed p_i and given scales s_i.\r\n * @param scales array of scales. For best results, scales should have same length as the instance.\r\n * @param result optional pre-allocated object to fill and return\r\n * @return s = sum(p_i * s_i), where i ranges from 0 to min(this.length, scales.length).\r\n */\r\n public linearCombination(scales: number[], result?: Point3d | Vector3d): XYZ {\r\n const n = Math.min(this.length, scales.length);\r\n const sum = (result instanceof Vector3d) ? Vector3d.createZero(result) : Point3d.createZero(result);\r\n for (let i = 0; i < n; ++i) {\r\n sum.x += scales[i] * this.getXAtUncheckedPointIndex(i);\r\n sum.y += scales[i] * this.getYAtUncheckedPointIndex(i);\r\n sum.z += scales[i] * this.getZAtUncheckedPointIndex(i);\r\n }\r\n return sum;\r\n }\r\n /**\r\n * Interpolate the points at the given indices.\r\n * @param index0 index of point p0 within the array.\r\n * @param fraction fraction f such that returned point is p0 + f * (p1 - p0).\r\n * @param index1 index of point p1 within the array.\r\n * @param result optional caller-allocated result to fill and return.\r\n * @returns undefined if an index is out of bounds.\r\n */\r\n public interpolateIndexIndex(index0: number, fraction: number, index1: number, result?: Point3d): Point3d | undefined {\r\n if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)\r\n return undefined;\r\n return this.interpolateUncheckedIndexIndex(index0, fraction, index1, result);\r\n }\r\n /**\r\n * Interpolate the points at the given indices.\r\n * * This method does not check for index validity. Use [[interpolateIndexIndex]] to have validity test.\r\n * @param index0 index of point p0 within the array.\r\n * @param fraction fraction f such that returned point is p0 + f * (p1 - p0).\r\n * @param index1 index of point p1 within the array.\r\n * @param result optional caller-allocated result to fill and return.\r\n */\r\n public interpolateUncheckedIndexIndex(index0: number, fraction: number, index1: number, result?: Point3d): Point3d {\r\n return Point3d.create(Geometry.interpolate(this.getXAtUncheckedPointIndex(index0), fraction, this.getXAtUncheckedPointIndex(index1)),\r\n Geometry.interpolate(this.getYAtUncheckedPointIndex(index0), fraction, this.getYAtUncheckedPointIndex(index1)),\r\n Geometry.interpolate(this.getZAtUncheckedPointIndex(index0), fraction, this.getZAtUncheckedPointIndex(index1)), result);\r\n }\r\n /** Access x of indexed point. */\r\n public abstract getXAtUncheckedPointIndex(pointIndex: number): number;\r\n /** Access y of indexed point. */\r\n public abstract getYAtUncheckedPointIndex(pointIndex: number): number;\r\n /** Access z of indexed point. */\r\n public abstract getZAtUncheckedPointIndex(pointIndex: number): number;\r\n /**\r\n * Return iterator over the points in this collection. Usage:\r\n * ```ts\r\n * for (const point: Point3d of collection.points) { ... }\r\n * ```\r\n */\r\n public get points(): Iterable<Point3d> {\r\n return new PointsIterator(this);\r\n }\r\n /** Convert to Point3d[]. */\r\n public getArray(): Point3d[] {\r\n const result = [];\r\n for (const p of this.points)\r\n result.push(p);\r\n return result;\r\n }\r\n /** Return the first point, or undefined if the array is empty. */\r\n public front(result?: Point3d): Point3d | undefined {\r\n if (this.length === 0)\r\n return undefined;\r\n return this.getPoint3dAtUncheckedPointIndex(0, result);\r\n }\r\n /** Return the last point, or undefined if the array is empty. */\r\n public back(result?: Point3d): Point3d | undefined {\r\n if (this.length === 0)\r\n return undefined;\r\n return this.getPoint3dAtUncheckedPointIndex(this.length - 1, result);\r\n }\r\n /**\r\n * Test whether the indexed points are equal within tolerance.\r\n * @param index0 index of first point.\r\n * @param index1 index of second point.\r\n * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.\r\n * @returns whether the points are equal within tolerance, or `undefined` if either index is invalid.\r\n */\r\n public almostEqualIndexIndex(index0: number, index1: number, tolerance = Geometry.smallMetricDistance): boolean | undefined {\r\n if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)\r\n return undefined;\r\n return this.almostEqualUncheckedIndexIndex(index0, index1, tolerance);\r\n }\r\n /**\r\n * Test whether the indexed points are equal within tolerance.\r\n * * This method does not check for index validity. Use [[almostEqualIndexIndex]] to have validity test.\r\n * @param index0 index of first point.\r\n * @param index1 index of second point.\r\n * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.\r\n * @returns whether the points are equal within tolerance.\r\n */\r\n public almostEqualUncheckedIndexIndex(index0: number, index1: number, tolerance = Geometry.smallMetricDistance): boolean {\r\n return Geometry.isSameCoordinate(this.getXAtUncheckedPointIndex(index0), this.getXAtUncheckedPointIndex(index1), tolerance)\r\n && Geometry.isSameCoordinate(this.getYAtUncheckedPointIndex(index0), this.getYAtUncheckedPointIndex(index1), tolerance)\r\n && Geometry.isSameCoordinate(this.getZAtUncheckedPointIndex(index0), this.getZAtUncheckedPointIndex(index1), tolerance);\r\n }\r\n /**\r\n * Test whether the xy-coordinates of the indexed points are equal within tolerance. The z-coordinates are ignored.\r\n * @param index0 index of first point.\r\n * @param index1 index of second point.\r\n * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.\r\n * @returns whether the xy-coordinates of the points are equal within tolerance, or `undefined` if either index is invalid.\r\n */\r\n public almostEqualXYIndexIndex(index0: number, index1: number, tolerance = Geometry.smallMetricDistance): boolean | undefined {\r\n if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)\r\n return undefined;\r\n return this.almostEqualXYUncheckedIndexIndex(index0, index1, tolerance);\r\n }\r\n /**\r\n * Test whether the xy-coordinates of the indexed points are equal within tolerance. The z-coordinates are ignored.\r\n * * This method does not check for index validity. Use [[almostEqualXYIndexIndex]] to have validity test.\r\n * @param index0 index of first point.\r\n * @param index1 index of second point.\r\n * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.\r\n * @returns whether the xy-coordinates of the points are equal within tolerance.\r\n */\r\n public almostEqualXYUncheckedIndexIndex(index0: number, index1: number, tolerance = Geometry.smallMetricDistance): boolean {\r\n return Geometry.isSameCoordinate(this.getXAtUncheckedPointIndex(index0), this.getXAtUncheckedPointIndex(index1), tolerance)\r\n && Geometry.isSameCoordinate(this.getYAtUncheckedPointIndex(index0), this.getYAtUncheckedPointIndex(index1), tolerance);\r\n }\r\n /** Return the altitude of the indexed point from the plane. */\r\n public evaluateUncheckedIndexPlaneAltitude(pointIndex: number, plane: PlaneAltitudeEvaluator): number {\r\n return plane.altitudeXYZ(this.getXAtUncheckedPointIndex(pointIndex), this.getYAtUncheckedPointIndex(pointIndex), this.getZAtUncheckedPointIndex(pointIndex));\r\n }\r\n}\r\n\r\n/**\r\n * Abstract base class extends [[IndexedXYZCollection]] with methods that modify the collection.\r\n * @public\r\n */\r\nexport abstract class IndexedReadWriteXYZCollection extends IndexedXYZCollection {\r\n /** Push a (clone of) point onto the collection. */\r\n public abstract push(point: XYAndZ): void;\r\n /** Push a new point (given by xyz coordinates) onto the collection. */\r\n public abstract pushXYZ(x?: number, y?: number, z?: number): void;\r\n /** Remove the final point. */\r\n public abstract pop(): void;\r\n /** Remove all entries. */\r\n public abstract clear(): void;\r\n /** Reverse the points in place. */\r\n public abstract reverseInPlace(): void;\r\n /** Push points from the source array to the end of this array and return the number of points pushed. */\r\n public pushIndexedXYZCollection(source: IndexedXYZCollection): number {\r\n for (let i = 0; i < source.length; i++)\r\n this.pushXYZ(source.getXAtUncheckedPointIndex(i), source.getYAtUncheckedPointIndex(i), source.getZAtUncheckedPointIndex(i));\r\n return source.length;\r\n }\r\n}\r\n\r\n/**\r\n * Type for use as signature for xyz data of a single linestring appearing in a parameter list.\r\n * @public\r\n */\r\nexport type LineStringDataVariant = IndexedXYZCollection | XYAndZ[] | XAndY[] | number[][];\r\n\r\n/**\r\n * Type for use as signature for multiple xyz data of multiple linestrings appearing in a parameter list.\r\n * @public\r\n */\r\nexport type MultiLineStringDataVariant = LineStringDataVariant | LineStringDataVariant[];\r\n"]}
|
|
@@ -886,6 +886,13 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
886
886
|
* @return result as a Point3d or `undefined` (if the matrix is singular).
|
|
887
887
|
*/
|
|
888
888
|
multiplyInverseXYZAsPoint3d(x: number, y: number, z: number, result?: Point3d): Point3d | undefined;
|
|
889
|
+
/**
|
|
890
|
+
* Multiply the point by the inverse matrix, and return its xy-coordinates.
|
|
891
|
+
* @param result optional pre-allocated result to populate and return
|
|
892
|
+
* @returns xy-coordinates of the transformed point, or `undefined` if the instance is singular.
|
|
893
|
+
* @see [[multiplyInverseXYZAsPoint3d]]
|
|
894
|
+
*/
|
|
895
|
+
multiplyInverseXYZAsPoint2d(x: number, y: number, z: number, result?: Point2d): Point2d | undefined;
|
|
889
896
|
/**
|
|
890
897
|
* Invoke a given matrix*matrix operation to compute the inverse matrix and set this.inverseCoffs
|
|
891
898
|
* * If either input coffA or coffB is `undefined`, set state to `InverseMatrixState.unknown` but
|
|
@@ -1025,7 +1032,9 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
1025
1032
|
* recompute the inverse.
|
|
1026
1033
|
* @returns return `true` if the inverse is computed. Return `false` if matrix is singular.
|
|
1027
1034
|
*/
|
|
1028
|
-
computeCachedInverse(useCacheIfAvailable: boolean):
|
|
1035
|
+
computeCachedInverse(useCacheIfAvailable: boolean): this is {
|
|
1036
|
+
inverseCoffs: Float64Array;
|
|
1037
|
+
};
|
|
1029
1038
|
/**
|
|
1030
1039
|
* Convert a (row,column) index pair to the single index within flattened array of 9 numbers in row-major-order
|
|
1031
1040
|
* * **Note:** Out of range row/column is interpreted cyclically.
|