@itwin/core-geometry 5.1.0-dev.9 → 5.2.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -1
- package/lib/cjs/Geometry.d.ts +18 -10
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +13 -3
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.d.ts +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +7 -1
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.d.ts +4 -3
- package/lib/cjs/bspline/BSplineSurface.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.js +4 -5
- package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +7 -5
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +9 -5
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +5 -3
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +1 -2
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +13 -25
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +1 -2
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +1 -2
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +2 -0
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +2 -0
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +54 -32
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +56 -37
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +40 -1
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +90 -0
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +3 -2
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +6 -5
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +27 -25
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +30 -25
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +9 -2
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +11 -0
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/CurveTypes.d.ts +1 -1
- package/lib/cjs/curve/CurveTypes.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.d.ts +2 -0
- package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +4 -0
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +7 -0
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +15 -3
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +37 -8
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +34 -8
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js +129 -33
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.d.ts +4 -3
- package/lib/cjs/curve/Query/StrokeCountChain.d.ts.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js +20 -9
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.d.ts +2 -1
- package/lib/cjs/curve/RegionMomentsXY.d.ts.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js +26 -41
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +74 -39
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +146 -46
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +36 -27
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js +161 -55
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts +1 -1
- package/lib/cjs/curve/StrokeOptions.js +1 -1
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +2 -2
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +6 -6
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +0 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +58 -32
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +0 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.d.ts +14 -0
- package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js +34 -0
- package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -0
- package/lib/cjs/geometry3d/AngleSweep.d.ts +25 -18
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +32 -18
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts +8 -7
- package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js +19 -25
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.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 +8 -3
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +21 -3
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +11 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +21 -3
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.d.ts +2 -0
- package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js +6 -1
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +2 -0
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +6 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts +8 -2
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +18 -10
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +0 -2
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +4 -4
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +4 -5
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts +7 -7
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +66 -26
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +49 -2
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +38 -2
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts +13 -6
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +16 -9
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts +5 -4
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +5 -4
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts +18 -10
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +32 -10
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.js +0 -1
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts +7 -9
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +23 -45
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.d.ts +39 -29
- package/lib/cjs/geometry3d/ReusableObjectCache.d.ts.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js +49 -35
- package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.d.ts +1 -4
- package/lib/cjs/geometry3d/SortablePolygon.d.ts.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js +48 -43
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +21 -2
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +32 -13
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.d.ts +8 -5
- package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js +27 -16
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.d.ts +2 -0
- package/lib/cjs/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js +11 -0
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/SmallSystem.d.ts +77 -36
- package/lib/cjs/numerics/SmallSystem.d.ts.map +1 -1
- package/lib/cjs/numerics/SmallSystem.js +129 -73
- package/lib/cjs/numerics/SmallSystem.js.map +1 -1
- package/lib/cjs/polyface/FacetOrientation.d.ts +1 -1
- package/lib/cjs/polyface/FacetOrientation.js +1 -1
- package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +55 -40
- package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js +83 -75
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +15 -14
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +47 -38
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts +26 -19
- package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js +51 -32
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/cjs/polyface/Polyface.d.ts +19 -5
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +18 -2
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +6 -6
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.d.ts +19 -18
- package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js +39 -42
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +1 -1
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +119 -78
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +315 -231
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +3 -3
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +3 -3
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts +7 -6
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +8 -9
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js +2 -3
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js +2 -4
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +3 -3
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts +3 -3
- package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js +5 -5
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/solid/Box.d.ts.map +1 -1
- package/lib/cjs/solid/Box.js +7 -0
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.d.ts.map +1 -1
- package/lib/cjs/solid/Cone.js +6 -0
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts +2 -3
- package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
- package/lib/cjs/solid/LinearSweep.js +11 -7
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts +2 -2
- package/lib/cjs/solid/RotationalSweep.js +2 -2
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RuledSweep.js +5 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/Sphere.d.ts.map +1 -1
- package/lib/cjs/solid/Sphere.js +6 -3
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.d.ts +1 -1
- package/lib/cjs/solid/SweepContour.js +1 -1
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
- package/lib/cjs/solid/TorusPipe.js +4 -0
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.d.ts +1 -1
- package/lib/cjs/topology/ChainMerge.js +1 -1
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts +64 -14
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +149 -32
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts +3 -2
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js +3 -2
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/Merging.d.ts +0 -1
- package/lib/cjs/topology/Merging.d.ts.map +1 -1
- package/lib/cjs/topology/Merging.js +49 -46
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.d.ts.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js +2 -1
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/Triangulation.d.ts +9 -14
- package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
- package/lib/cjs/topology/Triangulation.js +29 -22
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/esm/Geometry.d.ts +18 -10
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +13 -3
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.d.ts +1 -1
- package/lib/esm/bspline/BSpline1dNd.js +1 -1
- package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +7 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineSurface.d.ts +4 -3
- package/lib/esm/bspline/BSplineSurface.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineSurface.js +4 -5
- package/lib/esm/bspline/BSplineSurface.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +7 -5
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +9 -5
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +5 -3
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +1 -2
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +13 -25
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +1 -2
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +1 -2
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +2 -0
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +2 -0
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +54 -32
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +56 -37
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +40 -1
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +90 -0
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +3 -2
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +6 -5
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +27 -25
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +30 -25
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +9 -2
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +11 -0
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/CurveTypes.d.ts +1 -1
- package/lib/esm/curve/CurveTypes.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.d.ts +2 -0
- package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +4 -0
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +7 -0
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +15 -3
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +37 -8
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts +34 -8
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js +131 -35
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.d.ts +4 -3
- package/lib/esm/curve/Query/StrokeCountChain.d.ts.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js +20 -9
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.d.ts +2 -1
- package/lib/esm/curve/RegionMomentsXY.d.ts.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js +26 -41
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +74 -39
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +146 -46
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +36 -27
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js +161 -56
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts +1 -1
- package/lib/esm/curve/StrokeOptions.js +1 -1
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +2 -2
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +6 -6
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +0 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +58 -32
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +0 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransferWithSplitArcs.d.ts +14 -0
- package/lib/esm/curve/internalContexts/TransferWithSplitArcs.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js +30 -0
- package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -0
- package/lib/esm/geometry3d/AngleSweep.d.ts +25 -18
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +32 -18
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts +8 -7
- package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.js +19 -25
- package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js +1 -1
- package/lib/esm/geometry3d/Ellipsoid.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 +8 -3
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +21 -3
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +11 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +21 -3
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.d.ts +2 -0
- package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js +6 -1
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +2 -0
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +6 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts +8 -2
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +18 -10
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +0 -2
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +4 -4
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +4 -5
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts +7 -7
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +66 -26
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +49 -2
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +38 -2
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts +13 -6
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +16 -9
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts +5 -4
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +5 -4
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts +18 -10
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +32 -10
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray2d.js +0 -1
- package/lib/esm/geometry3d/Ray2d.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts +7 -9
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +23 -45
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.d.ts +39 -29
- package/lib/esm/geometry3d/ReusableObjectCache.d.ts.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js +47 -33
- package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.d.ts +1 -4
- package/lib/esm/geometry3d/SortablePolygon.d.ts.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js +48 -43
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +21 -2
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +32 -13
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.d.ts +8 -5
- package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Point4d.js +27 -16
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.d.ts +2 -0
- package/lib/esm/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js +11 -0
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/SmallSystem.d.ts +77 -36
- package/lib/esm/numerics/SmallSystem.d.ts.map +1 -1
- package/lib/esm/numerics/SmallSystem.js +129 -73
- package/lib/esm/numerics/SmallSystem.js.map +1 -1
- package/lib/esm/polyface/FacetOrientation.d.ts +1 -1
- package/lib/esm/polyface/FacetOrientation.js +1 -1
- package/lib/esm/polyface/FacetOrientation.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +55 -40
- package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js +83 -75
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +15 -14
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js +47 -38
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts +26 -19
- package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.js +51 -32
- package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/esm/polyface/Polyface.d.ts +19 -5
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +18 -2
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +6 -6
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.d.ts +19 -18
- package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js +39 -42
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +1 -1
- package/lib/esm/polyface/PolyfaceData.js +1 -1
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +119 -78
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +316 -232
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +3 -3
- package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js +3 -3
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts +7 -6
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +8 -9
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBReader.js +2 -3
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js +2 -4
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +3 -3
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts +3 -3
- package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js +5 -5
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/solid/Box.d.ts.map +1 -1
- package/lib/esm/solid/Box.js +7 -0
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.d.ts.map +1 -1
- package/lib/esm/solid/Cone.js +6 -0
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.d.ts +2 -3
- package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
- package/lib/esm/solid/LinearSweep.js +11 -7
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts +2 -2
- package/lib/esm/solid/RotationalSweep.js +2 -2
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.d.ts +1 -1
- package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
- package/lib/esm/solid/RuledSweep.js +5 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/Sphere.d.ts.map +1 -1
- package/lib/esm/solid/Sphere.js +6 -3
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.d.ts +1 -1
- package/lib/esm/solid/SweepContour.js +1 -1
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
- package/lib/esm/solid/TorusPipe.js +4 -0
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.d.ts +1 -1
- package/lib/esm/topology/ChainMerge.js +1 -1
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +64 -14
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +149 -32
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts +3 -2
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js +3 -2
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/Merging.d.ts +0 -1
- package/lib/esm/topology/Merging.d.ts.map +1 -1
- package/lib/esm/topology/Merging.js +49 -46
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.d.ts.map +1 -1
- package/lib/esm/topology/RegularizeFace.js +2 -1
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/Triangulation.d.ts +9 -14
- package/lib/esm/topology/Triangulation.d.ts.map +1 -1
- package/lib/esm/topology/Triangulation.js +29 -22
- package/lib/esm/topology/Triangulation.js.map +1 -1
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,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;IAC5H,CAAC;CACF;AACD;;;GAGG;AACH,MAAM,OAAgB,6BAA8B,SAAQ,oBAAoB;CAkB/E","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module ArraysAndInterfaces\n */\n\nimport { Geometry } from \"../Geometry\";\nimport { Point3d, Vector3d, XYZ } from \"./Point3dVector3d\";\nimport { Range3d } from \"./Range\";\nimport { XAndY, XYAndZ } from \"./XYZProps\";\n\nclass PointsIterator implements Iterator<Point3d>, Iterable<Point3d> {\n private readonly _collection: IndexedXYZCollection;\n private _curIndex = -1;\n\n public constructor(collection: IndexedXYZCollection) {\n this._collection = collection;\n }\n\n public next(): IteratorResult<Point3d> {\n if (++this._curIndex >= this._collection.length) {\n // The ECMAScript spec states that value=undefined is valid if done=true. The TypeScript interface violates the spec hence the cast to any and back below.\n return { done: true } as any as IteratorResult<Point3d>;\n }\n\n return {\n value: this._collection.getPoint3dAtUncheckedPointIndex(this._curIndex),\n done: false,\n };\n }\n\n public [Symbol.iterator](): Iterator<Point3d> { return this; }\n}\n/**\n * abstract base class for read-only access to XYZ data with indexed reference.\n * * This allows algorithms to work with Point3d[] or GrowableXYZ.\n * * GrowableXYZArray implements these for its data.\n * * Point3dArrayCarrier carries a (reference to) a Point3d[] and implements the methods with calls on that array reference.\n * * In addition to \"point by point\" accessors, other abstract members compute commonly useful vector data \"between points\".\n * * Methods that create vectors among multiple indices allow callers to avoid creating temporaries.\n * @public\n */\nexport abstract class IndexedXYZCollection {\n /**\n * Return the point at `index` as a strongly typed Point3d.\n * @param index index of point within the array\n * @param result caller-allocated destination\n * @returns undefined if the index is out of bounds\n */\n public abstract getPoint3dAtCheckedPointIndex(index: number, result?: Point3d): Point3d | undefined;\n /**\n * Return the point at `index` as a strongly typed Point3d, without checking the point index validity.\n * @param index index of point within the array\n * @param result caller-allocated destination\n * @returns undefined if the index is out of bounds\n */\n public abstract getPoint3dAtUncheckedPointIndex(index: number, result?: Point3d): Point3d;\n /**\n * Get from `index` as a strongly typed Vector3d.\n * @param index index of point within the array\n * @param result caller-allocated destination\n * @returns undefined if the index is out of bounds\n */\n public abstract getVector3dAtCheckedVectorIndex(index: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return a vector from the point at `indexA` to the point at `indexB`\n * @param indexA index of point within the array\n * @param indexB index of point within the array\n * @param result caller-allocated vector.\n * @returns undefined if either index is out of bounds\n */\n public abstract vectorIndexIndex(indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return a vector from `origin` to the point at `indexB`\n * @param origin origin for vector\n * @param indexB index of point within the array\n * @param result caller-allocated vector.\n * @returns undefined if index is out of bounds\n */\n public abstract vectorXYAndZIndex(origin: XYAndZ, indexB: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return a vector from the point at `indexA` to `target`\n * @param indexA index of point within the array\n * @param target target for vector\n * @param result caller-allocated vector.\n * @returns undefined if index is out of bounds\n */\n public vectorIndexXYAndZ(indexA: number, target: XYAndZ, result?: Vector3d): Vector3d | undefined {\n const reversed = this.vectorXYAndZIndex(target, indexA, result);\n return reversed?.negate(reversed);\n }\n /**\n * Return the dot product of the vectors from the point at `origin` to the points at `indexA` and `indexB`.\n * @param origin index of point within the array; origin of both vectors\n * @param indexA index of point within the array; target of the first vector\n * @param indexA index of point within the array; target of the second vector\n * @returns undefined if index is out of bounds\n */\n public dotProductIndexIndexIndex(origin: number, indexA: number, indexB: number): number | undefined {\n if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length || indexB < 0 || indexB >= this.length)\n return undefined;\n const x0 = this.getXAtUncheckedPointIndex(origin);\n const y0 = this.getYAtUncheckedPointIndex(origin);\n const z0 = this.getZAtUncheckedPointIndex(origin);\n return (this.getXAtUncheckedPointIndex(indexA) - x0) * (this.getXAtUncheckedPointIndex(indexB) - x0) +\n (this.getYAtUncheckedPointIndex(indexA) - y0) * (this.getYAtUncheckedPointIndex(indexB) - y0) +\n (this.getZAtUncheckedPointIndex(indexA) - z0) * (this.getZAtUncheckedPointIndex(indexB) - z0);\n }\n /**\n * Return the dot product of the vectors from the point at `origin` to the point at `indexA` and to `targetB`.\n * @param origin index of point within the array; origin of both vectors\n * @param indexA index of point within the array; target of the first vector\n * @param targetB target for second vector\n * @returns undefined if index is out of bounds\n */\n public dotProductIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ): number | undefined {\n if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length)\n return undefined;\n const x0 = this.getXAtUncheckedPointIndex(origin);\n const y0 = this.getYAtUncheckedPointIndex(origin);\n const z0 = this.getZAtUncheckedPointIndex(origin);\n return (this.getXAtUncheckedPointIndex(indexA) - x0) * (targetB.x - x0) +\n (this.getYAtUncheckedPointIndex(indexA) - y0) * (targetB.y - y0) +\n (this.getZAtUncheckedPointIndex(indexA) - z0) * (targetB.z - z0);\n }\n /**\n * Return the cross product of the vectors from `origin` to points at `indexA` and `indexB`\n * @param origin origin for vector\n * @param indexA index of first target within the array\n * @param indexB index of second target within the array\n * @param result caller-allocated vector.\n * @returns undefined if either index is out of bounds\n */\n public abstract crossProductXYAndZIndexIndex(origin: XYAndZ, indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return the cross product of the vectors from `origin` to the point at `indexA` and to `targetB`\n * @param origin index of point within the array; origin of both vectors\n * @param indexA index of point within the array; target of the first vector\n * @param targetB target of second vector\n * @param result optional caller-allocated result to fill and return\n * @returns undefined if an index is out of bounds\n */\n public crossProductIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ, result?: Vector3d): Vector3d | undefined {\n if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length)\n return undefined;\n const x0 = this.getXAtUncheckedPointIndex(origin);\n const y0 = this.getYAtUncheckedPointIndex(origin);\n const z0 = this.getZAtUncheckedPointIndex(origin);\n return Vector3d.createCrossProduct(this.getXAtUncheckedPointIndex(indexA) - x0,\n this.getYAtUncheckedPointIndex(indexA) - y0,\n this.getZAtUncheckedPointIndex(indexA) - z0,\n targetB.x - x0,\n targetB.y - y0,\n targetB.z - z0, result);\n }\n /**\n * Return the cross product of vectors from `origin` to points at `indexA` and `indexB`\n * @param origin origin for vector\n * @param indexA index of first target within the array\n * @param indexB index of second target within the array\n * @param result optional caller-allocated vector.\n * @returns undefined if either index is out of bounds\n */\n public abstract crossProductIndexIndexIndex(origin: number, indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return the cross product of vectors from origin point at `indexA` to target points at `indexB` and `indexC`\n * @param origin index of origin\n * @param indexA index of first target within the array\n * @param indexB index of second target within the array\n * @param result caller-allocated vector.\n * @returns return true if indexA, indexB both valid\n */\n public abstract accumulateCrossProductIndexIndexIndex(origin: number, indexA: number, indexB: number, result: Vector3d): void;\n\n /**\n * read-only property for number of XYZ in the collection.\n */\n public abstract get length(): number;\n /**\n * Return distance squared between indicated points.\n * @param index0 first point index\n * @param index1 second point index\n */\n public abstract distanceSquaredIndexIndex(index0: number, index1: number): number | undefined;\n /**\n * Return distance squared between the point at index0 and target.\n * @param index0 first point index\n * @param target second point\n */\n public distanceSquaredIndexXYAndZ(index0: number, target: XYAndZ): number | undefined {\n if (index0 < 0 || index0 >= this.length)\n return undefined;\n return Geometry.hypotenuseSquaredXYZ(\n target.x - this.getXAtUncheckedPointIndex(index0),\n target.y - this.getYAtUncheckedPointIndex(index0),\n target.z - this.getZAtUncheckedPointIndex(index0));\n }\n /**\n * Return distance between indicated points.\n * @param index0 first point index\n * @param index1 second point index\n */\n public abstract distanceIndexIndex(index0: number, index1: number): number | undefined;\n /**\n * Test if index is valid for an xyz within this array.\n * @param index xyz index to test.\n */\n public isIndexValid(index: number): boolean {\n return index >= 0 && index < this.length;\n }\n /** Adjust index into range by modulo with the length. */\n public cyclicIndex(i: number): number {\n return (i % this.length);\n }\n /** Return the range of the points. */\n public getRange(): Range3d {\n const range = Range3d.createNull();\n const n = this.length;\n const point = Point3d.create();\n for (let i = 0; i < n; i++) {\n this.getPoint3dAtUncheckedPointIndex(i, point);\n range.extendPoint(point);\n }\n return range;\n }\n\n /**\n * For each subset of `k` successive points within tolerance of the first point in the subset, return the indices of\n * the last `k-1` duplicates.\n * * Index `0` is never returned.\n * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]])\n * @param preserveLast if the last `k < this.length` points of the instance are duplicates, whether to return the\n * indices of the *first* `k-1` duplicates for this last run. If true, index `this.length - 1` is not returned\n * unless all points are duplicates, in which case all indices but `0` are returned. Default value is false.\n * @return ordered array of 0-based indices of duplicate points\n */\n public findOrderedDuplicates(tolerance: number = Geometry.smallMetricDistance, preserveLast: boolean = false): number[] {\n const indices: number[] = [];\n if (this.length > 1) {\n for (let i = 0; i < this.length - 1;) {\n let j = i + 1;\n for (; this.almostEqualIndexIndex(i, j, tolerance); ++j)\n indices.push(j);\n i = j; // found next unique point\n }\n if (preserveLast && indices.length > 0 && indices.length < this.length - 1) { // not all points are duplicate\n let numLastRun = 0;\n for (; numLastRun <= indices.length - 1 && indices[indices.length - 1 - numLastRun] === this.length - 1 - numLastRun; ++numLastRun);\n for (let i = 0; i < numLastRun; ++i)\n indices[indices.length - 1 - i] -= 1; // decrement the indices of the last run so that the last point is preserved\n }\n }\n return indices;\n }\n\n /** Accumulate scale times the x,y,z values at index.\n * * No action if index is out of bounds.\n */\n public abstract accumulateScaledXYZ(index: number, scale: number, sum: Point3d): void;\n\n /** Compute the linear combination s of the indexed p_i and given scales s_i.\n * @param scales array of scales. For best results, scales should have same length as the instance.\n * @param result optional pre-allocated object to fill and return\n * @return s = sum(p_i * s_i), where i ranges from 0 to min(this.length, scales.length).\n */\n public linearCombination(scales: number[], result?: Point3d | Vector3d): XYZ {\n const n = Math.min(this.length, scales.length);\n const sum = (result instanceof Vector3d) ? Vector3d.createZero(result) : Point3d.createZero(result);\n for (let i = 0; i < n; ++i) {\n sum.x += scales[i] * this.getXAtUncheckedPointIndex(i);\n sum.y += scales[i] * this.getYAtUncheckedPointIndex(i);\n sum.z += scales[i] * this.getZAtUncheckedPointIndex(i);\n }\n return sum;\n }\n\n /**\n * Interpolate the points at the given indices.\n * @param index0 index of point p0 within the array\n * @param fraction fraction f such that returned point is p0 + f * (p1 - p0)\n * @param index1 index of point p1 within the array\n * @param result optional caller-allocated result to fill and return\n * @returns undefined if an index is out of bounds\n */\n public interpolateIndexIndex(index0: number, fraction: number, index1: number, result?: Point3d): Point3d | undefined {\n if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)\n return undefined;\n return Point3d.create(Geometry.interpolate(this.getXAtUncheckedPointIndex(index0), fraction, this.getXAtUncheckedPointIndex(index1)),\n Geometry.interpolate(this.getYAtUncheckedPointIndex(index0), fraction, this.getYAtUncheckedPointIndex(index1)),\n Geometry.interpolate(this.getZAtUncheckedPointIndex(index0), fraction, this.getZAtUncheckedPointIndex(index1)), result);\n }\n\n /** access x of indexed point */\n public abstract getXAtUncheckedPointIndex(pointIndex: number): number;\n\n /** access y of indexed point */\n public abstract getYAtUncheckedPointIndex(pointIndex: number): number;\n\n /** access z of indexed point */\n public abstract getZAtUncheckedPointIndex(pointIndex: number): number;\n\n /** Return iterator over the points in this collection. Usage:\n * ```ts\n * for (const point: Point3d of collection.points) { ... }\n * ```\n */\n public get points(): Iterable<Point3d> {\n return new PointsIterator(this);\n }\n /** convert to Point3d[] */\n public getArray(): Point3d[] {\n const result = [];\n for (const p of this.points)\n result.push(p);\n return result;\n }\n /** Return the first point, or undefined if the array is empty. */\n public front(result?: Point3d): Point3d | undefined {\n if (this.length === 0)\n return undefined;\n return this.getPoint3dAtUncheckedPointIndex(0, result);\n }\n /** Return the last point, or undefined if the array is empty. */\n public back(result?: Point3d): Point3d | undefined {\n if (this.length === 0)\n return undefined;\n return this.getPoint3dAtUncheckedPointIndex(this.length - 1, result);\n }\n /**\n * Test whether the indexed points are equal within tolerance.\n * @param index0 index of first point\n * @param index1 index of second point\n * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.\n */\n public almostEqualIndexIndex(index0: number, index1: number, tolerance = Geometry.smallMetricDistance): boolean | undefined {\n if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)\n return undefined;\n return Geometry.isSameCoordinate(this.getXAtUncheckedPointIndex(index0), this.getXAtUncheckedPointIndex(index1), tolerance)\n && Geometry.isSameCoordinate(this.getYAtUncheckedPointIndex(index0), this.getYAtUncheckedPointIndex(index1), tolerance)\n && Geometry.isSameCoordinate(this.getZAtUncheckedPointIndex(index0), this.getZAtUncheckedPointIndex(index1), tolerance);\n }\n}\n/**\n * abstract base class extends IndexedXYZCollection, adding methods to push, peek, and pop, and rewrite.\n * @public\n */\nexport abstract class IndexedReadWriteXYZCollection extends IndexedXYZCollection {\n /** push a (clone of) point onto the collection\n * * point itself is not pushed -- xyz data is extracted into the native form of the collection.\n */\n public abstract push(data: XYAndZ): void;\n /**\n * push a new point (given by coordinates) onto the collection\n * @param x x coordinate\n * @param y y coordinate\n * @param z z coordinate\n */\n public abstract pushXYZ(x?: number, y?: number, z?: number): void;\n /** remove the final point. */\n public abstract pop(): void;\n /** clear all entries */\n public abstract clear(): void;\n /** reverse the points in place. */\n public abstract reverseInPlace(): void;\n}\n\n/**\n * Type for use as signature for xyz data of a single linestring appearing in a parameter list.\n * @public\n */\nexport type LineStringDataVariant = IndexedXYZCollection | XYAndZ[] | XAndY[] | number[][];\n\n/**\n * Type for use as signature for multiple xyz data of multiple linestrings appearing in a parameter list.\n * @public\n */\nexport type MultiLineStringDataVariant = LineStringDataVariant | LineStringDataVariant[];\n"]}
|
|
1
|
+
{"version":3,"file":"IndexedXYZCollection.js","sourceRoot":"","sources":["../../../src/geometry3d/IndexedXYZCollection.ts"],"names":[],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,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,QAAQ,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,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;eACtH,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;IAC5H,CAAC;CACF;AACD;;;GAGG;AACH,MAAM,OAAgB,6BAA8B,SAAQ,oBAAoB;CAkB/E","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module ArraysAndInterfaces\n */\n\nimport { Geometry } from \"../Geometry\";\nimport { Point3d, Vector3d, XYZ } from \"./Point3dVector3d\";\nimport { Range3d } from \"./Range\";\nimport { Transform } from \"./Transform\";\nimport { XAndY, XYAndZ } from \"./XYZProps\";\n\nclass PointsIterator implements Iterator<Point3d>, Iterable<Point3d> {\n private readonly _collection: IndexedXYZCollection;\n private _curIndex = -1;\n\n public constructor(collection: IndexedXYZCollection) {\n this._collection = collection;\n }\n\n public next(): IteratorResult<Point3d> {\n if (++this._curIndex >= this._collection.length) {\n // The ECMAScript spec states that value=undefined is valid if done=true. The TypeScript interface violates the spec hence the cast to any and back below.\n return { done: true } as any as IteratorResult<Point3d>;\n }\n\n return {\n value: this._collection.getPoint3dAtUncheckedPointIndex(this._curIndex),\n done: false,\n };\n }\n\n public [Symbol.iterator](): Iterator<Point3d> { return this; }\n}\n/**\n * abstract base class for read-only access to XYZ data with indexed reference.\n * * This allows algorithms to work with Point3d[] or GrowableXYZ.\n * * GrowableXYZArray implements these for its data.\n * * Point3dArrayCarrier carries a (reference to) a Point3d[] and implements the methods with calls on that array reference.\n * * In addition to \"point by point\" accessors, other abstract members compute commonly useful vector data \"between points\".\n * * Methods that create vectors among multiple indices allow callers to avoid creating temporaries.\n * @public\n */\nexport abstract class IndexedXYZCollection {\n /**\n * Return the point at `index` as a strongly typed Point3d.\n * @param index index of point within the array\n * @param result caller-allocated destination\n * @returns undefined if the index is out of bounds\n */\n public abstract getPoint3dAtCheckedPointIndex(index: number, result?: Point3d): Point3d | undefined;\n /**\n * Return the point at `index` as a strongly typed Point3d, without checking the point index validity.\n * @param index index of point within the array\n * @param result caller-allocated destination\n * @returns undefined if the index is out of bounds\n */\n public abstract getPoint3dAtUncheckedPointIndex(index: number, result?: Point3d): Point3d;\n /**\n * Get from `index` as a strongly typed Vector3d.\n * @param index index of point within the array\n * @param result caller-allocated destination\n * @returns undefined if the index is out of bounds\n */\n public abstract getVector3dAtCheckedVectorIndex(index: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return a vector from the point at `indexA` to the point at `indexB`\n * @param indexA index of point within the array\n * @param indexB index of point within the array\n * @param result caller-allocated vector.\n * @returns undefined if either index is out of bounds\n */\n public abstract vectorIndexIndex(indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return a vector from `origin` to the point at `indexB`\n * @param origin origin for vector\n * @param indexB index of point within the array\n * @param result caller-allocated vector.\n * @returns undefined if index is out of bounds\n */\n public abstract vectorXYAndZIndex(origin: XYAndZ, indexB: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return a vector from the point at `indexA` to `target`\n * @param indexA index of point within the array\n * @param target target for vector\n * @param result caller-allocated vector.\n * @returns undefined if index is out of bounds\n */\n public vectorIndexXYAndZ(indexA: number, target: XYAndZ, result?: Vector3d): Vector3d | undefined {\n const reversed = this.vectorXYAndZIndex(target, indexA, result);\n return reversed?.negate(reversed);\n }\n /**\n * Return the dot product of the vectors from the point at `origin` to the points at `indexA` and `indexB`.\n * @param origin index of point within the array; origin of both vectors\n * @param indexA index of point within the array; target of the first vector\n * @param indexA index of point within the array; target of the second vector\n * @returns undefined if index is out of bounds\n */\n public dotProductIndexIndexIndex(origin: number, indexA: number, indexB: number): number | undefined {\n if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length || indexB < 0 || indexB >= this.length)\n return undefined;\n const x0 = this.getXAtUncheckedPointIndex(origin);\n const y0 = this.getYAtUncheckedPointIndex(origin);\n const z0 = this.getZAtUncheckedPointIndex(origin);\n return (this.getXAtUncheckedPointIndex(indexA) - x0) * (this.getXAtUncheckedPointIndex(indexB) - x0) +\n (this.getYAtUncheckedPointIndex(indexA) - y0) * (this.getYAtUncheckedPointIndex(indexB) - y0) +\n (this.getZAtUncheckedPointIndex(indexA) - z0) * (this.getZAtUncheckedPointIndex(indexB) - z0);\n }\n /**\n * Return the dot product of the vectors from the point at `origin` to the point at `indexA` and to `targetB`.\n * @param origin index of point within the array; origin of both vectors\n * @param indexA index of point within the array; target of the first vector\n * @param targetB target for second vector\n * @returns undefined if index is out of bounds\n */\n public dotProductIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ): number | undefined {\n if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length)\n return undefined;\n const x0 = this.getXAtUncheckedPointIndex(origin);\n const y0 = this.getYAtUncheckedPointIndex(origin);\n const z0 = this.getZAtUncheckedPointIndex(origin);\n return (this.getXAtUncheckedPointIndex(indexA) - x0) * (targetB.x - x0) +\n (this.getYAtUncheckedPointIndex(indexA) - y0) * (targetB.y - y0) +\n (this.getZAtUncheckedPointIndex(indexA) - z0) * (targetB.z - z0);\n }\n /**\n * Return the cross product of the vectors from `origin` to points at `indexA` and `indexB`\n * @param origin origin for vector\n * @param indexA index of first target within the array\n * @param indexB index of second target within the array\n * @param result caller-allocated vector.\n * @returns undefined if either index is out of bounds\n */\n public abstract crossProductXYAndZIndexIndex(origin: XYAndZ, indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return the cross product of the vectors from `origin` to the point at `indexA` and to `targetB`\n * @param origin index of point within the array; origin of both vectors\n * @param indexA index of point within the array; target of the first vector\n * @param targetB target of second vector\n * @param result optional caller-allocated result to fill and return\n * @returns undefined if an index is out of bounds\n */\n public crossProductIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ, result?: Vector3d): Vector3d | undefined {\n if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length)\n return undefined;\n const x0 = this.getXAtUncheckedPointIndex(origin);\n const y0 = this.getYAtUncheckedPointIndex(origin);\n const z0 = this.getZAtUncheckedPointIndex(origin);\n return Vector3d.createCrossProduct(this.getXAtUncheckedPointIndex(indexA) - x0,\n this.getYAtUncheckedPointIndex(indexA) - y0,\n this.getZAtUncheckedPointIndex(indexA) - z0,\n targetB.x - x0,\n targetB.y - y0,\n targetB.z - z0, result);\n }\n /**\n * Return the cross product of vectors from `origin` to points at `indexA` and `indexB`\n * @param origin origin for vector\n * @param indexA index of first target within the array\n * @param indexB index of second target within the array\n * @param result optional caller-allocated vector.\n * @returns undefined if either index is out of bounds\n */\n public abstract crossProductIndexIndexIndex(origin: number, indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return the cross product of vectors from origin point at `indexA` to target points at `indexB` and `indexC`\n * @param origin index of origin\n * @param indexA index of first target within the array\n * @param indexB index of second target within the array\n * @param result caller-allocated vector.\n * @returns return true if indexA, indexB both valid\n */\n public abstract accumulateCrossProductIndexIndexIndex(origin: number, indexA: number, indexB: number, result: Vector3d): void;\n\n /**\n * read-only property for number of XYZ in the collection.\n */\n public abstract get length(): number;\n /**\n * Return distance squared between indicated points.\n * @param index0 first point index\n * @param index1 second point index\n */\n public abstract distanceSquaredIndexIndex(index0: number, index1: number): number | undefined;\n /**\n * Return distance squared between the point at index0 and target.\n * @param index0 first point index\n * @param target second point\n */\n public distanceSquaredIndexXYAndZ(index0: number, target: XYAndZ): number | undefined {\n if (index0 < 0 || index0 >= this.length)\n return undefined;\n return Geometry.hypotenuseSquaredXYZ(\n target.x - this.getXAtUncheckedPointIndex(index0),\n target.y - this.getYAtUncheckedPointIndex(index0),\n target.z - this.getZAtUncheckedPointIndex(index0));\n }\n /**\n * Return distance between indicated points.\n * @param index0 first point index\n * @param index1 second point index\n */\n public abstract distanceIndexIndex(index0: number, index1: number): number | undefined;\n /**\n * Test if index is valid for an xyz within this array.\n * @param index xyz index to test.\n */\n public isIndexValid(index: number): boolean {\n return index >= 0 && index < this.length;\n }\n /** Adjust index into range by modulo with the length. */\n public cyclicIndex(i: number): number {\n return (i % this.length);\n }\n /** Return the range of the points. */\n public getRange(transform?: Transform, result?: Range3d): Range3d {\n let range = result;\n if (range)\n range.setNull();\n else\n range = Range3d.createNull();\n const n = this.length;\n const point = Point3d.create();\n for (let i = 0; i < n; i++) {\n this.getPoint3dAtUncheckedPointIndex(i, point);\n range.extendPoint(point, transform);\n }\n return range;\n }\n\n /**\n * For each subset of `k` successive points within tolerance of the first point in the subset, return the indices of\n * the last `k-1` duplicates.\n * * Index `0` is never returned.\n * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]])\n * @param preserveLast if the last `k < this.length` points of the instance are duplicates, whether to return the\n * indices of the *first* `k-1` duplicates for this last run. If true, index `this.length - 1` is not returned\n * unless all points are duplicates, in which case all indices but `0` are returned. Default value is false.\n * @return ordered array of 0-based indices of duplicate points\n */\n public findOrderedDuplicates(tolerance: number = Geometry.smallMetricDistance, preserveLast: boolean = false): number[] {\n const indices: number[] = [];\n if (this.length > 1) {\n for (let i = 0; i < this.length - 1;) {\n let j = i + 1;\n for (; this.almostEqualIndexIndex(i, j, tolerance); ++j)\n indices.push(j);\n i = j; // found next unique point\n }\n if (preserveLast && indices.length > 0 && indices.length < this.length - 1) { // not all points are duplicate\n let numLastRun = 0;\n for (; numLastRun <= indices.length - 1 && indices[indices.length - 1 - numLastRun] === this.length - 1 - numLastRun; ++numLastRun);\n for (let i = 0; i < numLastRun; ++i)\n indices[indices.length - 1 - i] -= 1; // decrement the indices of the last run so that the last point is preserved\n }\n }\n return indices;\n }\n\n /** Accumulate scale times the x,y,z values at index.\n * * No action if index is out of bounds.\n */\n public abstract accumulateScaledXYZ(index: number, scale: number, sum: Point3d): void;\n\n /** Compute the linear combination s of the indexed p_i and given scales s_i.\n * @param scales array of scales. For best results, scales should have same length as the instance.\n * @param result optional pre-allocated object to fill and return\n * @return s = sum(p_i * s_i), where i ranges from 0 to min(this.length, scales.length).\n */\n public linearCombination(scales: number[], result?: Point3d | Vector3d): XYZ {\n const n = Math.min(this.length, scales.length);\n const sum = (result instanceof Vector3d) ? Vector3d.createZero(result) : Point3d.createZero(result);\n for (let i = 0; i < n; ++i) {\n sum.x += scales[i] * this.getXAtUncheckedPointIndex(i);\n sum.y += scales[i] * this.getYAtUncheckedPointIndex(i);\n sum.z += scales[i] * this.getZAtUncheckedPointIndex(i);\n }\n return sum;\n }\n\n /**\n * Interpolate the points at the given indices.\n * @param index0 index of point p0 within the array\n * @param fraction fraction f such that returned point is p0 + f * (p1 - p0)\n * @param index1 index of point p1 within the array\n * @param result optional caller-allocated result to fill and return\n * @returns undefined if an index is out of bounds\n */\n public interpolateIndexIndex(index0: number, fraction: number, index1: number, result?: Point3d): Point3d | undefined {\n if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)\n return undefined;\n return Point3d.create(Geometry.interpolate(this.getXAtUncheckedPointIndex(index0), fraction, this.getXAtUncheckedPointIndex(index1)),\n Geometry.interpolate(this.getYAtUncheckedPointIndex(index0), fraction, this.getYAtUncheckedPointIndex(index1)),\n Geometry.interpolate(this.getZAtUncheckedPointIndex(index0), fraction, this.getZAtUncheckedPointIndex(index1)), result);\n }\n\n /** access x of indexed point */\n public abstract getXAtUncheckedPointIndex(pointIndex: number): number;\n\n /** access y of indexed point */\n public abstract getYAtUncheckedPointIndex(pointIndex: number): number;\n\n /** access z of indexed point */\n public abstract getZAtUncheckedPointIndex(pointIndex: number): number;\n\n /** Return iterator over the points in this collection. Usage:\n * ```ts\n * for (const point: Point3d of collection.points) { ... }\n * ```\n */\n public get points(): Iterable<Point3d> {\n return new PointsIterator(this);\n }\n /** convert to Point3d[] */\n public getArray(): Point3d[] {\n const result = [];\n for (const p of this.points)\n result.push(p);\n return result;\n }\n /** Return the first point, or undefined if the array is empty. */\n public front(result?: Point3d): Point3d | undefined {\n if (this.length === 0)\n return undefined;\n return this.getPoint3dAtUncheckedPointIndex(0, result);\n }\n /** Return the last point, or undefined if the array is empty. */\n public back(result?: Point3d): Point3d | undefined {\n if (this.length === 0)\n return undefined;\n return this.getPoint3dAtUncheckedPointIndex(this.length - 1, result);\n }\n /**\n * Test whether the indexed points are equal within tolerance.\n * @param index0 index of first point\n * @param index1 index of second point\n * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.\n * @returns whether the points are equal within tolerance, or `undefined` if either index is invalid.\n */\n public almostEqualIndexIndex(index0: number, index1: number, tolerance = Geometry.smallMetricDistance): boolean | undefined {\n if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)\n return undefined;\n return Geometry.isSameCoordinate(this.getXAtUncheckedPointIndex(index0), this.getXAtUncheckedPointIndex(index1), tolerance)\n && Geometry.isSameCoordinate(this.getYAtUncheckedPointIndex(index0), this.getYAtUncheckedPointIndex(index1), tolerance)\n && Geometry.isSameCoordinate(this.getZAtUncheckedPointIndex(index0), this.getZAtUncheckedPointIndex(index1), tolerance);\n }\n /**\n * Test whether the xy-coordinates of the indexed points are equal within tolerance. The z-coordinates are ignored.\n * @param index0 index of first point\n * @param index1 index of second point\n * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.\n * @returns whether the xy-coordinates of the points are equal within tolerance, or `undefined` if either index is invalid.\n */\n public almostEqualXYIndexIndex(index0: number, index1: number, tolerance = Geometry.smallMetricDistance): boolean | undefined {\n if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)\n return undefined;\n return Geometry.isSameCoordinate(this.getXAtUncheckedPointIndex(index0), this.getXAtUncheckedPointIndex(index1), tolerance)\n && Geometry.isSameCoordinate(this.getYAtUncheckedPointIndex(index0), this.getYAtUncheckedPointIndex(index1), tolerance);\n }\n}\n/**\n * abstract base class extends IndexedXYZCollection, adding methods to push, peek, and pop, and rewrite.\n * @public\n */\nexport abstract class IndexedReadWriteXYZCollection extends IndexedXYZCollection {\n /** push a (clone of) point onto the collection\n * * point itself is not pushed -- xyz data is extracted into the native form of the collection.\n */\n public abstract push(data: XYAndZ): void;\n /**\n * push a new point (given by coordinates) onto the collection\n * @param x x coordinate\n * @param y y coordinate\n * @param z z coordinate\n */\n public abstract pushXYZ(x?: number, y?: number, z?: number): void;\n /** remove the final point. */\n public abstract pop(): void;\n /** clear all entries */\n public abstract clear(): void;\n /** reverse the points in place. */\n public abstract reverseInPlace(): void;\n}\n\n/**\n * Type for use as signature for xyz data of a single linestring appearing in a parameter list.\n * @public\n */\nexport type LineStringDataVariant = IndexedXYZCollection | XYAndZ[] | XAndY[] | number[][];\n\n/**\n * Type for use as signature for multiple xyz data of multiple linestrings appearing in a parameter list.\n * @public\n */\nexport type MultiLineStringDataVariant = LineStringDataVariant | LineStringDataVariant[];\n"]}
|
|
@@ -131,5 +131,7 @@ export declare abstract class Plane3d implements PlaneAltitudeEvaluator {
|
|
|
131
131
|
* * MUST BE IMPLEMENTED BY DERIVED CLASSES
|
|
132
132
|
*/
|
|
133
133
|
abstract projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d;
|
|
134
|
+
/** Return the projection of (x,y,z) onto the plane. */
|
|
135
|
+
projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d;
|
|
134
136
|
}
|
|
135
137
|
//# sourceMappingURL=Plane3d.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plane3d.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/Plane3d.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAY,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,8BAAsB,OAAQ,YAAW,sBAAsB;IAC7D;;;OAGG;aACa,QAAQ,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM;IACrD,4EAA4E;IACrE,cAAc,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAE,MAAqC,GAAG,OAAO;IAGrG;;;;OAIG;IACI,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,GAAE,MAAqC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAGrG;;;;OAIG;IACI,mBAAmB,CACxB,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,GAAE,MAAqC,GAChF,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAGb;;;;OAIG;aACa,OAAO,IAAI,MAAM;IACjC;;;;OAIG;aACa,OAAO,IAAI,MAAM;IACjC;;;;OAIG;aACa,OAAO,IAAI,MAAM;IACjC;;;;;;OAMG;IACI,aAAa,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS;IAG7D;;;;;OAKG;IACI,kBAAkB,CAAC,MAAM,CAAC,EAAE,OAAO,GAA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F,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAGb;;;;OAIG;aACa,OAAO,IAAI,MAAM;IACjC;;;;OAIG;aACa,OAAO,IAAI,MAAM;IACjC;;;;OAIG;aACa,OAAO,IAAI,MAAM;IACjC;;;;;;OAMG;IACI,aAAa,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS;IAG7D;;;;;OAKG;IACI,kBAAkB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAGpD;;;;OAIG;aACa,gBAAgB,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM;IAC7D;;;;;OAKG;aACa,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IACpE;;;;;OAKG;aACa,QAAQ,CAAC,WAAW,EAAE,QAAQ,GAAG,MAAM;IACvD;;;;OAIG;aACa,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IACpE;;;OAGG;aACa,mBAAmB,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IACnF,uDAAuD;IAChD,iBAAiB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;CAIrF"}
|
|
@@ -88,7 +88,12 @@ export class Plane3d {
|
|
|
88
88
|
* * Classes with a purely implicit equation of their plane can accept the default implementation
|
|
89
89
|
*/
|
|
90
90
|
getAnyPointOnPlane(result) {
|
|
91
|
-
return this.
|
|
91
|
+
return this.projectXYZToPlane(0, 0, 0, result);
|
|
92
|
+
}
|
|
93
|
+
/** Return the projection of (x,y,z) onto the plane. */
|
|
94
|
+
projectXYZToPlane(x, y, z, result) {
|
|
95
|
+
const point = Point3d.create(x, y, z, result);
|
|
96
|
+
return this.projectPointToPlane(point, point);
|
|
92
97
|
}
|
|
93
98
|
}
|
|
94
99
|
//# sourceMappingURL=Plane3d.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plane3d.js","sourceRoot":"","sources":["../../../src/geometry3d/Plane3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAA0B,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,OAAgB,OAAO;IAM3B,4EAA4E;IACrE,cAAc,CAAC,UAAmB,EAAE,YAAoB,QAAQ,CAAC,mBAAmB;QACzF,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,IAAI,SAAS,CAAC;IAC1D,CAAC;IACD;;;;OAIG;IACI,gBAAgB,CAAC,KAAc,EAAE,YAAoB,QAAQ,CAAC,mBAAmB;QACtF,OAAO,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;IAC/D,CAAC;IACD;;;;OAIG;IACI,mBAAmB,CACxB,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,YAAoB,QAAQ,CAAC,mBAAmB;QAEjF,OAAO,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IACpE,CAAC;IAmBD;;;;;;OAMG;IACI,aAAa,CAAC,MAAiB;QACpC,OAAO,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;IAC3F,CAAC;IACD;;;;;OAKG;IACI,kBAAkB,CAAC,MAAgB;QACxC,OAAO,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACnE,CAAC;CAgCF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\nimport { Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { Point4d } from \"../geometry4d/Point4d\";\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\n\n/**\n * Plane3d is the abstract base class for multiple 3d plane representations:\n * * [[Plane3dByOriginAndUnitNormal]] -- plane defined by origin and normal, with no preferred in-plane directions\n * * [[Plane3dByOriginAndVectors]] -- plane defined by origin and 2 vectors in the plane, with normal implied by the vectors' cross product\n * * [[Point4d]] -- homogeneous form of xyzw plane.\n * * [[ClipPlane]] -- implicit plane with additional markup as used by compound clip structures such as [[ConvexClipPlaneSet]] and [[UnionOfConvexClipPlaneSets]]\n *\n * As an abstract base class, Plane3d demands that its derived classes implement queries to answer questions\n * about the plane's normal and the altitude of points above or below the plane. (Altitude is measured perpendicular to the plane.)\n * These abstract methods are:\n * * altitude(Point3d), altitudeXYZ(x,y,z), and altitudeXYZW(Point4d) -- evaluate altitude\n * * normalX(), normalY(), normalZ() -- return components of the plane's normal vector.\n * * velocity(Vector3d), velocityXYZ(x,y,z) -- return dot product of the input vector with the plane normal.\n * * projectPointToPlane (spacePoint: Point3d) -- return projection of spacePoint into the plane.\n *\n * The Plane3d base class also provides implementations of several queries which it can implement by calling the abstract queries.\n * * Derived classes may choose to override these default implementations using private knowledge of what they have stored.\n * * isPointInPlane(spacePoint, tolerance?) -- test if spacePoint is in the plane with tolerance. Default tolerance is small metric distance\n * * classifyAltitude (spacePoint, tolerance?), classifyAltitudeXYZ (x,y,z,tolerance?) -- return -1,0,1 indicating if spacePoint's altitude\n * is negative, near zero, or positive.\n *\n * Notes about scaling and signs in methods that compute altitudes, normal components and velocities:\n * * The term \"altitude\" indicates a _signed_ distance from the plane.\n * * altitude zero is _on_ the plane\n * * positive altitudes are on one side\n * * negatives are on the other.\n * * Altitude values and normal components are not strictly required to be true cartesian distance. If the calling code happens to use \"distance scaled by 1000X\" it\n * understands that it can be OK for its plane implementation to have that scaling.\n * * By convention, derived classes whose definitions (normals and vectors in plane) are simple cartesian are expected\n * to return true distances. This applies to:\n * * [[Plane3dByOriginAndUnitNormal]] and [[ClipPlane]]\n * * These maintain a stored unit normal so the altitude calculations are inherently true cartesian distance.\n * * [[Plane3dByOriginAndVectors]] -- this is a bit expensive because\n * * the normal is the cross product of the defining vectors.\n * * that cross product is not typically unit\n * * normalization adds to the cost of computing off-plane distances\n * * Since a main purpose of using this class is often to navigate a skewed, non-unit grid, occasional off-plane queries are not likely to be important.\n * * \"4 dimensional\" (homogeneous coordinate planes) ([[Point4d]] and [[PlaneByOriginAndVectors4d]])\n * * typically do _not_ force their coefficients to any distance-based normalization\n * * are typically used for calculations in spaces with skewing effects do to perspective, and true distances are not required.\n * * In all classes, the `weightedAltitude` method is free to be scaled distance.\n * @public\n */\nexport abstract class Plane3d implements PlaneAltitudeEvaluator {\n /**\n * Return the altitude of spacePoint above or below the plane. (Below is negative)\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n */\n public abstract altitude(spacePoint: Point3d): number;\n /** Returns true if spacePoint is within distance tolerance of the plane. */\n public isPointInPlane(spacePoint: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\n return Math.abs(this.altitude(spacePoint)) <= tolerance;\n }\n /**\n * Return a value -1, 0, 1 giving a signed indicator of whether the toleranced altitude of the point is\n * negative, near zero, or positive.\n *\n */\n public classifyAltitude(point: Point3d, tolerance: number = Geometry.smallMetricDistance): -1 | 0 | 1 {\n return Geometry.split3Way01(this.altitude(point), tolerance);\n }\n /**\n * Return a value -1, 0, 1 giving a signed indicator of whether the toleranced altitude of x,y,z is\n * negative, near zero, or positive.\n *\n */\n public classifyAltitudeXYZ(\n x: number, y: number, z: number, tolerance: number = Geometry.smallMetricDistance,\n ): -1 | 0 | 1 {\n return Geometry.split3Way01(this.altitudeXYZ(x, y, z), tolerance);\n }\n /**\n * Return the x component of the normal used to evaluate altitude.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract normalX(): number;\n /**\n * Return the y component of the normal used to evaluate altitude.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract normalY(): number;\n /**\n * Return the z component of the normal used to evaluate altitude.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract normalZ(): number;\n /**\n * Return the unit normal for the plane.\n * * The abstract base class implementation assembles the normal from normalX, normalY, normalZ calls.\n * * Derived classes should (but are not required to) override for maximum efficiency if the separate normal calls\n * cause repeated normalization.\n * @param result\n */\n public getUnitNormal(result?: Vector3d): Vector3d | undefined {\n return Vector3d.createNormalized(this.normalX(), this.normalY(), this.normalZ(), result);\n }\n /**\n * Return any point on the plane.\n * * Default implementation projects the origin (0,0,0) to the plane.\n * * Classes that have a preferred origin for their plane should override.\n * * Classes with a purely implicit equation of their plane can accept the default implementation\n */\n public getAnyPointOnPlane(result?: Point3d): Point3d {\n return this.projectPointToPlane(Point3d.create(0, 0, 0), result);\n }\n /**\n * Return the altitude of weighted spacePoint above or below the plane. (Below is negative)\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract weightedAltitude(spacePoint: Point4d): number;\n /**\n * Return the dot product of spaceVector (x,y,z) with the plane's unit normal. This tells the rate of change of\n * altitude for a point moving at speed one along the spaceVector.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract velocityXYZ(x: number, y: number, z: number): number;\n /**\n * Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\n * for a point moving at speed one along the spaceVector.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract velocity(spaceVector: Vector3d): number;\n /**\n * Return the altitude of a point given as separate x,y,z components.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract altitudeXYZ(x: number, y: number, z: number): number;\n /**\n * Return the projection of spacePoint onto the plane.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n */\n public abstract projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Plane3d.js","sourceRoot":"","sources":["../../../src/geometry3d/Plane3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAA0B,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,OAAgB,OAAO;IAM3B,4EAA4E;IACrE,cAAc,CAAC,UAAmB,EAAE,YAAoB,QAAQ,CAAC,mBAAmB;QACzF,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,IAAI,SAAS,CAAC;IAC1D,CAAC;IACD;;;;OAIG;IACI,gBAAgB,CAAC,KAAc,EAAE,YAAoB,QAAQ,CAAC,mBAAmB;QACtF,OAAO,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;IAC/D,CAAC;IACD;;;;OAIG;IACI,mBAAmB,CACxB,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,YAAoB,QAAQ,CAAC,mBAAmB;QAEjF,OAAO,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IACpE,CAAC;IAmBD;;;;;;OAMG;IACI,aAAa,CAAC,MAAiB;QACpC,OAAO,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;IAC3F,CAAC;IACD;;;;;OAKG;IACI,kBAAkB,CAAC,MAAgB;QACxC,OAAO,IAAI,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC;IAgCD,uDAAuD;IAChD,iBAAiB,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,MAAgB;QACxE,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\nimport { Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { Point4d } from \"../geometry4d/Point4d\";\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\n\n/**\n * Plane3d is the abstract base class for multiple 3d plane representations:\n * * [[Plane3dByOriginAndUnitNormal]] -- plane defined by origin and normal, with no preferred in-plane directions\n * * [[Plane3dByOriginAndVectors]] -- plane defined by origin and 2 vectors in the plane, with normal implied by the vectors' cross product\n * * [[Point4d]] -- homogeneous form of xyzw plane.\n * * [[ClipPlane]] -- implicit plane with additional markup as used by compound clip structures such as [[ConvexClipPlaneSet]] and [[UnionOfConvexClipPlaneSets]]\n *\n * As an abstract base class, Plane3d demands that its derived classes implement queries to answer questions\n * about the plane's normal and the altitude of points above or below the plane. (Altitude is measured perpendicular to the plane.)\n * These abstract methods are:\n * * altitude(Point3d), altitudeXYZ(x,y,z), and altitudeXYZW(Point4d) -- evaluate altitude\n * * normalX(), normalY(), normalZ() -- return components of the plane's normal vector.\n * * velocity(Vector3d), velocityXYZ(x,y,z) -- return dot product of the input vector with the plane normal.\n * * projectPointToPlane (spacePoint: Point3d) -- return projection of spacePoint into the plane.\n *\n * The Plane3d base class also provides implementations of several queries which it can implement by calling the abstract queries.\n * * Derived classes may choose to override these default implementations using private knowledge of what they have stored.\n * * isPointInPlane(spacePoint, tolerance?) -- test if spacePoint is in the plane with tolerance. Default tolerance is small metric distance\n * * classifyAltitude (spacePoint, tolerance?), classifyAltitudeXYZ (x,y,z,tolerance?) -- return -1,0,1 indicating if spacePoint's altitude\n * is negative, near zero, or positive.\n *\n * Notes about scaling and signs in methods that compute altitudes, normal components and velocities:\n * * The term \"altitude\" indicates a _signed_ distance from the plane.\n * * altitude zero is _on_ the plane\n * * positive altitudes are on one side\n * * negatives are on the other.\n * * Altitude values and normal components are not strictly required to be true cartesian distance. If the calling code happens to use \"distance scaled by 1000X\" it\n * understands that it can be OK for its plane implementation to have that scaling.\n * * By convention, derived classes whose definitions (normals and vectors in plane) are simple cartesian are expected\n * to return true distances. This applies to:\n * * [[Plane3dByOriginAndUnitNormal]] and [[ClipPlane]]\n * * These maintain a stored unit normal so the altitude calculations are inherently true cartesian distance.\n * * [[Plane3dByOriginAndVectors]] -- this is a bit expensive because\n * * the normal is the cross product of the defining vectors.\n * * that cross product is not typically unit\n * * normalization adds to the cost of computing off-plane distances\n * * Since a main purpose of using this class is often to navigate a skewed, non-unit grid, occasional off-plane queries are not likely to be important.\n * * \"4 dimensional\" (homogeneous coordinate planes) ([[Point4d]] and [[PlaneByOriginAndVectors4d]])\n * * typically do _not_ force their coefficients to any distance-based normalization\n * * are typically used for calculations in spaces with skewing effects do to perspective, and true distances are not required.\n * * In all classes, the `weightedAltitude` method is free to be scaled distance.\n * @public\n */\nexport abstract class Plane3d implements PlaneAltitudeEvaluator {\n /**\n * Return the altitude of spacePoint above or below the plane. (Below is negative)\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n */\n public abstract altitude(spacePoint: Point3d): number;\n /** Returns true if spacePoint is within distance tolerance of the plane. */\n public isPointInPlane(spacePoint: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\n return Math.abs(this.altitude(spacePoint)) <= tolerance;\n }\n /**\n * Return a value -1, 0, 1 giving a signed indicator of whether the toleranced altitude of the point is\n * negative, near zero, or positive.\n *\n */\n public classifyAltitude(point: Point3d, tolerance: number = Geometry.smallMetricDistance): -1 | 0 | 1 {\n return Geometry.split3Way01(this.altitude(point), tolerance);\n }\n /**\n * Return a value -1, 0, 1 giving a signed indicator of whether the toleranced altitude of x,y,z is\n * negative, near zero, or positive.\n *\n */\n public classifyAltitudeXYZ(\n x: number, y: number, z: number, tolerance: number = Geometry.smallMetricDistance,\n ): -1 | 0 | 1 {\n return Geometry.split3Way01(this.altitudeXYZ(x, y, z), tolerance);\n }\n /**\n * Return the x component of the normal used to evaluate altitude.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract normalX(): number;\n /**\n * Return the y component of the normal used to evaluate altitude.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract normalY(): number;\n /**\n * Return the z component of the normal used to evaluate altitude.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract normalZ(): number;\n /**\n * Return the unit normal for the plane.\n * * The abstract base class implementation assembles the normal from normalX, normalY, normalZ calls.\n * * Derived classes should (but are not required to) override for maximum efficiency if the separate normal calls\n * cause repeated normalization.\n * @param result\n */\n public getUnitNormal(result?: Vector3d): Vector3d | undefined {\n return Vector3d.createNormalized(this.normalX(), this.normalY(), this.normalZ(), result);\n }\n /**\n * Return any point on the plane.\n * * Default implementation projects the origin (0,0,0) to the plane.\n * * Classes that have a preferred origin for their plane should override.\n * * Classes with a purely implicit equation of their plane can accept the default implementation\n */\n public getAnyPointOnPlane(result?: Point3d): Point3d {\n return this.projectXYZToPlane(0, 0, 0, result);\n }\n /**\n * Return the altitude of weighted spacePoint above or below the plane. (Below is negative)\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract weightedAltitude(spacePoint: Point4d): number;\n /**\n * Return the dot product of spaceVector (x,y,z) with the plane's unit normal. This tells the rate of change of\n * altitude for a point moving at speed one along the spaceVector.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract velocityXYZ(x: number, y: number, z: number): number;\n /**\n * Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\n * for a point moving at speed one along the spaceVector.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract velocity(spaceVector: Vector3d): number;\n /**\n * Return the altitude of a point given as separate x,y,z components.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract altitudeXYZ(x: number, y: number, z: number): number;\n /**\n * Return the projection of spacePoint onto the plane.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n */\n public abstract projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d;\n /** Return the projection of (x,y,z) onto the plane. */\n public projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d {\n const point = Point3d.create(x, y, z, result);\n return this.projectPointToPlane(point, point);\n }\n}\n"]}
|
|
@@ -155,6 +155,8 @@ export declare class Plane3dByOriginAndUnitNormal extends Plane3d implements BeJ
|
|
|
155
155
|
altitudeXYZW(x: number, y: number, z: number, w: number): number;
|
|
156
156
|
/** Return the projection of spacePoint onto the plane. */
|
|
157
157
|
projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d;
|
|
158
|
+
/** Return the projection of (x,y,z) onto the plane. */
|
|
159
|
+
projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d;
|
|
158
160
|
/**
|
|
159
161
|
* Returns true if spacePoint is within distance tolerance of the plane.
|
|
160
162
|
* * This logic is identical to the [[Plane3d]] method but avoids a level of function call.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plane3dByOriginAndUnitNormal.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndUnitNormal.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAa,eAAe,EAAY,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;GAKG;AACH,qBAAa,4BAA6B,SAAQ,OAAQ,YAAW,eAAe;IAClF,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,OAAO,CAAW;IAE1B,OAAO;IAMP,OAAO,CAAC,MAAM,CAAC,OAAO;IAGtB;;;OAGG;WACW,aAAa,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,4BAA4B;IAK3E;;;OAGG;WACW,aAAa,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,4BAA4B;IAK3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
|
|
321
321
|
/** Return the projection of spacePoint onto the plane. */
|
|
322
322
|
projectPointToPlane(spacePoint, result) {
|
|
323
|
-
return
|
|
323
|
+
return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);
|
|
324
|
+
}
|
|
325
|
+
/** Return the projection of (x,y,z) onto the plane. */
|
|
326
|
+
projectXYZToPlane(x, y, z, result) {
|
|
327
|
+
const scale = -this._normal.dotProductStartEndXYZ(this._origin, x, y, z);
|
|
328
|
+
return Point3d.create(x + scale * this._normal.x, y + scale * this._normal.y, z + scale * this._normal.z, result);
|
|
324
329
|
}
|
|
325
330
|
/**
|
|
326
331
|
* Returns true if spacePoint is within distance tolerance of the plane.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plane3dByOriginAndUnitNormal.js","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndUnitNormal.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,SAAS,EAAmB,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;;;GAKG;AACH,MAAM,OAAO,4BAA6B,SAAQ,OAAO;IAC/C,OAAO,CAAU;IACjB,OAAO,CAAW;IAC1B,sCAAsC;IACtC,YAAoB,MAAe,EAAE,MAAgB;QACnD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IACD,yEAAyE;IACjE,MAAM,CAAC,OAAO,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS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S,EAAE,CAAS;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACvE,CAAC;IACD,0DAA0D;IACnD,mBAAmB,CAAC,UAAmB,EAAE,MAAgB;QAC9D,OAAO,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;IACjH,CAAC;IACD;;;OAGG;IACa,cAAc,CAAC,UAAmB,EAAE,YAAoB,QAAQ,CAAC,mBAAmB;QAClG,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;IACzC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\nimport { AxisOrder, BeJSONFunctions, Geometry } from \"../Geometry\";\nimport { Plane3d } from \"./Plane3d\";\nimport { Point4d } from \"../geometry4d/Point4d\";\nimport { Angle } from \"./Angle\";\nimport { Matrix3d } from \"./Matrix3d\";\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\nimport { Transform } from \"./Transform\";\nimport { XAndY } from \"./XYZProps\";\n\n/**\n * A plane defined by\n * * Any point on the plane.\n * * a unit normal.\n * @public\n */\nexport class Plane3dByOriginAndUnitNormal extends Plane3d implements BeJSONFunctions {\n private _origin: Point3d;\n private _normal: Vector3d;\n // constructor captures references !!!\n private constructor(origin: Point3d, normal: Vector3d) {\n super();\n this._origin = origin;\n this._normal = normal;\n }\n // This is private because it does not check validity of the unit vector.\n private static _create(x: number, y: number, z: number, u: number, v: number, w: number) {\n return new Plane3dByOriginAndUnitNormal(Point3d.create(x, y, z), Vector3d.create(u, v, w));\n }\n /**\n * Create a plane parallel to the XY plane\n * @param origin optional plane origin. If omitted, the origin is placed at 000\n */\n public static createXYPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\n if (origin)\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 0, 1);\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 0, 1);\n }\n /**\n * Create a plane parallel to the YZ plane\n * @param origin optional plane origin. If omitted, the origin is placed at 000\n */\n public static createYZPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\n if (origin)\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 1, 0, 0);\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 1, 0, 0);\n }\n /**\n * Create a plane parallel to the ZX plane\n * @param origin optional plane origin. If omitted, the origin is placed at 000\n */\n public static createZXPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\n if (origin)\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 1, 0);\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 1, 0);\n }\n /**\n * Create a new Plane3dByOriginAndUnitNormal with given origin and normal.\n * * The inputs are NOT captured.\n * * Returns undefined if `normal.normalize()` returns undefined.\n */\n public static create(\n origin: Point3d, normal: Vector3d, result?: Plane3dByOriginAndUnitNormal,\n ): Plane3dByOriginAndUnitNormal | undefined {\n if (result) {\n if (normal.normalize(result._normal) === undefined)\n return undefined;\n origin.clone(result._origin);\n return result;\n }\n const normalized = normal.normalize();\n if (normalized === undefined)\n return undefined;\n return new Plane3dByOriginAndUnitNormal(origin.clone(), normalized);\n }\n /**\n * Create a new Plane3dByOriginAndUnitNormal from a variety of plane types.\n * * The inputs are NOT captured.\n * * Returns undefined if `source.getUnitNormal()` returns undefined.\n */\n public static createFrom(\n source: Plane3d, result?: Plane3dByOriginAndUnitNormal,\n ): Plane3dByOriginAndUnitNormal | undefined {\n if (source instanceof Plane3dByOriginAndUnitNormal)\n return source.clone(result);\n if (result) {\n if (source.getUnitNormal(result._normal) === undefined)\n return undefined;\n source.getAnyPointOnPlane(result._origin);\n return result;\n }\n const normal = source.getUnitNormal();\n if (normal === undefined)\n return undefined;\n const origin = source.getAnyPointOnPlane();\n return new Plane3dByOriginAndUnitNormal(origin, normal);\n }\n /**\n * Create a new Plane3dByOriginAndUnitNormal with direct coordinates of origin and normal.\n * * Returns undefined if the normal vector is all zeros.\n * * If unable to normalize return undefined. (And if result is given it is left unchanged)\n */\n public static createXYZUVW(\n ax: number, ay: number, az: number, ux: number, uy: number, uz: number, result?: Plane3dByOriginAndUnitNormal,\n ): Plane3dByOriginAndUnitNormal | undefined {\n const magU = Geometry.hypotenuseXYZ(ux, uy, uz);\n if (magU < Geometry.smallMetricDistance)\n return undefined;\n if (result) {\n result._origin.set(ax, ay, az);\n result._normal.set(ux / magU, uy / magU, uz / magU);\n return result;\n }\n return new Plane3dByOriginAndUnitNormal(Point3d.create(ax, ay, az), Vector3d.create(ux / magU, uy / magU, uz / magU));\n }\n /**\n * Create a new Plane3dByOriginAndUnitNormal with unit normal (a) in the xy plane (b) perpendicular to the line\n * defined by xy parts of origin to target.\n * * origin and normal both have z = 0.\n * * The inputs are NOT captured.\n * * Returns undefined if the normal vector is all zeros.\n */\n public static createOriginAndTargetXY(\n origin: XAndY, target: XAndY, result?: Plane3dByOriginAndUnitNormal,\n ): Plane3dByOriginAndUnitNormal | undefined {\n const ux = target.x - origin.x;\n const uy = target.y - origin.y;\n return this.createXYZUVW(origin.x, origin.y, 0.0, uy, -ux, 0.0, result);\n }\n /**\n * Create a new Plane3dByOriginAndUnitNormal with xy origin (at z=0) and normal angle in xy plane.\n * * Returns undefined if the normal vector is all zeros.\n */\n public static createXYAngle(\n x: number, y: number, normalAngleFromX: Angle, result?: Plane3dByOriginAndUnitNormal,\n ): Plane3dByOriginAndUnitNormal {\n if (result) {\n result._origin.set(x, y, 0.0);\n result._normal.set(normalAngleFromX.cos(), normalAngleFromX.sin(), 0.0);\n return result;\n }\n return new Plane3dByOriginAndUnitNormal(\n Point3d.create(x, y, 0), Vector3d.create(normalAngleFromX.cos(), normalAngleFromX.sin()),\n );\n }\n /**\n * Create a plane defined by two points and an in-plane vector.\n * @param pointA any point in the plane\n * @param pointB any other point in the plane\n * @param vector any vector in the plane but not parallel to the vector from pointA to pointB\n */\n public static createPointPointVectorInPlane(\n pointA: Point3d, pointB: Point3d, vector: Vector3d,\n ): Plane3dByOriginAndUnitNormal | undefined {\n const cross = vector.crossProductStartEnd(pointA, pointB);\n if (cross.tryNormalizeInPlace())\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\n return undefined;\n }\n /**\n * Create a plane defined by three points.\n * @param pointA any point in the plane. This will be the origin.\n * @param pointB any other point in the plane\n * @param pointC any third point in the plane but not on the line of pointA and pointB\n */\n public static createOriginAndTargets(\n pointA: Point3d, pointB: Point3d, pointC: Point3d,\n ): Plane3dByOriginAndUnitNormal | undefined {\n const cross = pointA.crossProductToPoints(pointB, pointC);\n if (cross.tryNormalizeInPlace())\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\n return undefined;\n }\n /**\n * Create a plane defined by a point and two vectors in the plane\n * @param pointA any point in the plane\n * @param vectorB any vector in the plane\n * @param vectorC any vector in the plane but not parallel to vectorB\n */\n public static createOriginAndVectors(\n pointA: Point3d, vectorB: Vector3d, vectorC: Vector3d,\n ): Plane3dByOriginAndUnitNormal | undefined {\n const cross = vectorB.crossProduct(vectorC);\n if (cross.tryNormalizeInPlace())\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\n return undefined;\n }\n /** Test for (toleranced) equality with `other` */\n public isAlmostEqual(other: Plane3dByOriginAndUnitNormal): boolean {\n return this._origin.isAlmostEqual(other._origin) && this._normal.isAlmostEqual(other._normal);\n }\n /** Parse a json fragment `{origin: [x,y,z], normal: [ux,uy,uz]}` */\n public setFromJSON(json?: any): void {\n if (!json) {\n this._origin.set(0, 0, 0);\n this._normal.set(0, 0, 1);\n } else {\n this._origin.setFromJSON(json.origin);\n this._normal.setFromJSON(json.normal);\n }\n }\n /**\n * Convert to a JSON object.\n * @return {*} [origin,normal]\n */\n public toJSON(): any {\n return { origin: this._origin.toJSON(), normal: this._normal.toJSON() };\n }\n /**\n * Create a new Plane3dByOriginAndUnitNormal from json fragment.\n * * See `Plane3dByOriginAndUnitNormal.setFromJSON`\n */\n public static fromJSON(json?: any): Plane3dByOriginAndUnitNormal {\n const result = Plane3dByOriginAndUnitNormal.createXYPlane();\n result.setFromJSON(json);\n return result;\n }\n /** Return a reference to the origin. */\n public getOriginRef(): Point3d {\n return this._origin;\n }\n /** Return a reference to the unit normal. */\n public getNormalRef(): Vector3d {\n return this._normal;\n }\n /**\n * Return coordinate axes (as a transform) with\n * * origin at plane origin\n * * z axis in direction of plane normal.\n * * x,y axes in plane.\n */\n public getLocalToWorld(): Transform {\n const axes = Matrix3d.createRigidHeadsUp(this._normal, AxisOrder.ZXY);\n return Transform.createRefs(this._origin.clone(), axes);\n }\n /** Return a (singular) transform which projects points to this plane. */\n public getProjectionToPlane(): Transform {\n const axes = Matrix3d.createIdentity();\n axes.addScaledOuterProductInPlace(this._normal, this._normal, -1.0);\n axes.markSingular();\n return Transform.createFixedPointAndMatrix(this._origin, axes);\n }\n /** Copy coordinates from the given origin and normal. */\n public set(origin: Point3d, normal: Vector3d): void {\n this._origin.setFrom(origin);\n this._normal.setFrom(normal);\n }\n /** Return a deep clone (point and normal cloned) */\n public clone(result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal {\n if (result) {\n result.set(this._origin, this._normal);\n return result;\n }\n return new Plane3dByOriginAndUnitNormal(this._origin.clone(), this._normal.clone());\n }\n /** Create a clone and return the transform of the clone. */\n public cloneTransformed(transform: Transform, inverse: boolean = false): Plane3dByOriginAndUnitNormal | undefined {\n const result = this.clone();\n if (inverse) {\n transform.multiplyInversePoint3d(result._origin, result._origin);\n if (transform.matrix.multiplyTransposeVector(result._normal, result._normal) !== undefined\n && result._normal.normalizeInPlace())\n return result;\n } else {\n transform.multiplyPoint3d(result._origin, result._origin);\n if (transform.matrix.multiplyInverseTranspose(result._normal, result._normal) !== undefined\n && result._normal.normalizeInPlace())\n return result;\n }\n return undefined;\n }\n /** Copy data from the given plane. */\n public setFrom(source: Plane3dByOriginAndUnitNormal): void {\n this.set(source._origin, source._normal);\n }\n /** Return the altitude of spacePoint above or below the plane. (Below is negative) */\n public altitude(spacePoint: Point3d): number {\n return this._normal.dotProductStartEnd(this._origin, spacePoint);\n }\n /** Return the altitude of point (x,y) given xy parts using only the xy parts of origin and unit normal */\n public altitudeXY(x: number, y: number): number {\n return (x - this._origin.x) * this._normal.x + (y - this._origin.y) * this._normal.y;\n }\n /** Return the x component of the normal used to evaluate altitude. */\n public normalX(): number {\n return this._normal.x;\n }\n /** Return the x component of the normal used to evaluate altitude. */\n public normalY(): number {\n return this._normal.y;\n }\n /** Return the z component of the normal used to evaluate altitude. */\n public normalZ(): number {\n return this._normal.z;\n }\n /** Return (a clone of) the unit normal. */\n public override getUnitNormal(result?: Vector3d): Vector3d | undefined {\n return this._normal.clone(result);\n }\n /** Return (a clone of) the origin. */\n public override getAnyPointOnPlane(result?: Point3d): Point3d {\n // This function returns the plane origin. In general, a point x is on the plane if and only if (x-o).n = 0.\n return this._origin.clone(result);\n }\n /** Return the signed altitude of weighted spacePoint above or below the plane. (Below is negative) */\n public weightedAltitude(spacePoint: Point4d): number {\n return this._normal.dotProductStart3dEnd4d(this._origin, spacePoint);\n }\n /** Return any point at specified (signed) altitude. */\n public altitudeToPoint(altitude: number, result?: Point3d): Point3d {\n return this._origin.plusScaled(this._normal, altitude, result);\n }\n /**\n * Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\n * for a point moving at speed one along the spaceVector.\n */\n public velocityXYZ(x: number, y: number, z: number): number {\n return this._normal.dotProductXYZ(x, y, z);\n }\n /**\n * Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\n * for a point moving at speed one along the spaceVector.\n */\n public velocity(spaceVector: Vector3d): number {\n return this._normal.dotProduct(spaceVector);\n }\n /** Return the altitude of a point given as separate x,y,z components. */\n public altitudeXYZ(x: number, y: number, z: number): number {\n return this._normal.dotProductStartEndXYZ(this._origin, x, y, z);\n }\n /** Return the altitude of a point given as separate x,y,z,w components. */\n public altitudeXYZW(x: number, y: number, z: number, w: number): number {\n return this._normal.dotProductStartEndXYZW(this._origin, x, y, z, w);\n }\n /** Return the projection of spacePoint onto the plane. */\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\n return spacePoint.plusScaled(this._normal, -this._normal.dotProductStartEnd(this._origin, spacePoint), result);\n }\n /**\n * Returns true if spacePoint is within distance tolerance of the plane.\n * * This logic is identical to the [[Plane3d]] method but avoids a level of function call.\n */\n public override isPointInPlane(spacePoint: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\n const altitude = this._normal.dotProductStartEnd(this._origin, spacePoint);\n return Math.abs(altitude) <= tolerance;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Plane3dByOriginAndUnitNormal.js","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndUnitNormal.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,SAAS,EAAmB,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;;;GAKG;AACH,MAAM,OAAO,4BAA6B,SAAQ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AO,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;IACzC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\nimport { AxisOrder, BeJSONFunctions, Geometry } from \"../Geometry\";\nimport { Plane3d } from \"./Plane3d\";\nimport { Point4d } from \"../geometry4d/Point4d\";\nimport { Angle } from \"./Angle\";\nimport { Matrix3d } from \"./Matrix3d\";\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\nimport { Transform } from \"./Transform\";\nimport { XAndY } from \"./XYZProps\";\n\n/**\n * A plane defined by\n * * Any point on the plane.\n * * a unit normal.\n * @public\n */\nexport class Plane3dByOriginAndUnitNormal extends Plane3d implements BeJSONFunctions {\n private _origin: Point3d;\n private _normal: Vector3d;\n // constructor captures references !!!\n private constructor(origin: Point3d, normal: Vector3d) {\n super();\n this._origin = origin;\n this._normal = normal;\n }\n // This is private because it does not check validity of the unit vector.\n private static _create(x: number, y: number, z: number, u: number, v: number, w: number) {\n return new Plane3dByOriginAndUnitNormal(Point3d.create(x, y, z), Vector3d.create(u, v, w));\n }\n /**\n * Create a plane parallel to the XY plane\n * @param origin optional plane origin. If omitted, the origin is placed at 000\n */\n public static createXYPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\n if (origin)\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 0, 1);\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 0, 1);\n }\n /**\n * Create a plane parallel to the YZ plane\n * @param origin optional plane origin. If omitted, the origin is placed at 000\n */\n public static createYZPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\n if (origin)\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 1, 0, 0);\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 1, 0, 0);\n }\n /**\n * Create a plane parallel to the ZX plane\n * @param origin optional plane origin. If omitted, the origin is placed at 000\n */\n public static createZXPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\n if (origin)\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 1, 0);\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 1, 0);\n }\n /**\n * Create a new Plane3dByOriginAndUnitNormal with given origin and normal.\n * * The inputs are NOT captured.\n * * Returns undefined if `normal.normalize()` returns undefined.\n */\n public static create(\n origin: Point3d, normal: Vector3d, result?: Plane3dByOriginAndUnitNormal,\n ): Plane3dByOriginAndUnitNormal | undefined {\n if (result) {\n if (normal.normalize(result._normal) === undefined)\n return undefined;\n origin.clone(result._origin);\n return result;\n }\n const normalized = normal.normalize();\n if (normalized === undefined)\n return undefined;\n return new Plane3dByOriginAndUnitNormal(origin.clone(), normalized);\n }\n /**\n * Create a new Plane3dByOriginAndUnitNormal from a variety of plane types.\n * * The inputs are NOT captured.\n * * Returns undefined if `source.getUnitNormal()` returns undefined.\n */\n public static createFrom(\n source: Plane3d, result?: Plane3dByOriginAndUnitNormal,\n ): Plane3dByOriginAndUnitNormal | undefined {\n if (source instanceof Plane3dByOriginAndUnitNormal)\n return source.clone(result);\n if (result) {\n if (source.getUnitNormal(result._normal) === undefined)\n return undefined;\n source.getAnyPointOnPlane(result._origin);\n return result;\n }\n const normal = source.getUnitNormal();\n if (normal === undefined)\n return undefined;\n const origin = source.getAnyPointOnPlane();\n return new Plane3dByOriginAndUnitNormal(origin, normal);\n }\n /**\n * Create a new Plane3dByOriginAndUnitNormal with direct coordinates of origin and normal.\n * * Returns undefined if the normal vector is all zeros.\n * * If unable to normalize return undefined. (And if result is given it is left unchanged)\n */\n public static createXYZUVW(\n ax: number, ay: number, az: number, ux: number, uy: number, uz: number, result?: Plane3dByOriginAndUnitNormal,\n ): Plane3dByOriginAndUnitNormal | undefined {\n const magU = Geometry.hypotenuseXYZ(ux, uy, uz);\n if (magU < Geometry.smallMetricDistance)\n return undefined;\n if (result) {\n result._origin.set(ax, ay, az);\n result._normal.set(ux / magU, uy / magU, uz / magU);\n return result;\n }\n return new Plane3dByOriginAndUnitNormal(Point3d.create(ax, ay, az), Vector3d.create(ux / magU, uy / magU, uz / magU));\n }\n /**\n * Create a new Plane3dByOriginAndUnitNormal with unit normal (a) in the xy plane (b) perpendicular to the line\n * defined by xy parts of origin to target.\n * * origin and normal both have z = 0.\n * * The inputs are NOT captured.\n * * Returns undefined if the normal vector is all zeros.\n */\n public static createOriginAndTargetXY(\n origin: XAndY, target: XAndY, result?: Plane3dByOriginAndUnitNormal,\n ): Plane3dByOriginAndUnitNormal | undefined {\n const ux = target.x - origin.x;\n const uy = target.y - origin.y;\n return this.createXYZUVW(origin.x, origin.y, 0.0, uy, -ux, 0.0, result);\n }\n /**\n * Create a new Plane3dByOriginAndUnitNormal with xy origin (at z=0) and normal angle in xy plane.\n * * Returns undefined if the normal vector is all zeros.\n */\n public static createXYAngle(\n x: number, y: number, normalAngleFromX: Angle, result?: Plane3dByOriginAndUnitNormal,\n ): Plane3dByOriginAndUnitNormal {\n if (result) {\n result._origin.set(x, y, 0.0);\n result._normal.set(normalAngleFromX.cos(), normalAngleFromX.sin(), 0.0);\n return result;\n }\n return new Plane3dByOriginAndUnitNormal(\n Point3d.create(x, y, 0), Vector3d.create(normalAngleFromX.cos(), normalAngleFromX.sin()),\n );\n }\n /**\n * Create a plane defined by two points and an in-plane vector.\n * @param pointA any point in the plane\n * @param pointB any other point in the plane\n * @param vector any vector in the plane but not parallel to the vector from pointA to pointB\n */\n public static createPointPointVectorInPlane(\n pointA: Point3d, pointB: Point3d, vector: Vector3d,\n ): Plane3dByOriginAndUnitNormal | undefined {\n const cross = vector.crossProductStartEnd(pointA, pointB);\n if (cross.tryNormalizeInPlace())\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\n return undefined;\n }\n /**\n * Create a plane defined by three points.\n * @param pointA any point in the plane. This will be the origin.\n * @param pointB any other point in the plane\n * @param pointC any third point in the plane but not on the line of pointA and pointB\n */\n public static createOriginAndTargets(\n pointA: Point3d, pointB: Point3d, pointC: Point3d,\n ): Plane3dByOriginAndUnitNormal | undefined {\n const cross = pointA.crossProductToPoints(pointB, pointC);\n if (cross.tryNormalizeInPlace())\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\n return undefined;\n }\n /**\n * Create a plane defined by a point and two vectors in the plane\n * @param pointA any point in the plane\n * @param vectorB any vector in the plane\n * @param vectorC any vector in the plane but not parallel to vectorB\n */\n public static createOriginAndVectors(\n pointA: Point3d, vectorB: Vector3d, vectorC: Vector3d,\n ): Plane3dByOriginAndUnitNormal | undefined {\n const cross = vectorB.crossProduct(vectorC);\n if (cross.tryNormalizeInPlace())\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\n return undefined;\n }\n /** Test for (toleranced) equality with `other` */\n public isAlmostEqual(other: Plane3dByOriginAndUnitNormal): boolean {\n return this._origin.isAlmostEqual(other._origin) && this._normal.isAlmostEqual(other._normal);\n }\n /** Parse a json fragment `{origin: [x,y,z], normal: [ux,uy,uz]}` */\n public setFromJSON(json?: any): void {\n if (!json) {\n this._origin.set(0, 0, 0);\n this._normal.set(0, 0, 1);\n } else {\n this._origin.setFromJSON(json.origin);\n this._normal.setFromJSON(json.normal);\n }\n }\n /**\n * Convert to a JSON object.\n * @return {*} [origin,normal]\n */\n public toJSON(): any {\n return { origin: this._origin.toJSON(), normal: this._normal.toJSON() };\n }\n /**\n * Create a new Plane3dByOriginAndUnitNormal from json fragment.\n * * See `Plane3dByOriginAndUnitNormal.setFromJSON`\n */\n public static fromJSON(json?: any): Plane3dByOriginAndUnitNormal {\n const result = Plane3dByOriginAndUnitNormal.createXYPlane();\n result.setFromJSON(json);\n return result;\n }\n /** Return a reference to the origin. */\n public getOriginRef(): Point3d {\n return this._origin;\n }\n /** Return a reference to the unit normal. */\n public getNormalRef(): Vector3d {\n return this._normal;\n }\n /**\n * Return coordinate axes (as a transform) with\n * * origin at plane origin\n * * z axis in direction of plane normal.\n * * x,y axes in plane.\n */\n public getLocalToWorld(): Transform {\n const axes = Matrix3d.createRigidHeadsUp(this._normal, AxisOrder.ZXY);\n return Transform.createRefs(this._origin.clone(), axes);\n }\n /** Return a (singular) transform which projects points to this plane. */\n public getProjectionToPlane(): Transform {\n const axes = Matrix3d.createIdentity();\n axes.addScaledOuterProductInPlace(this._normal, this._normal, -1.0);\n axes.markSingular();\n return Transform.createFixedPointAndMatrix(this._origin, axes);\n }\n /** Copy coordinates from the given origin and normal. */\n public set(origin: Point3d, normal: Vector3d): void {\n this._origin.setFrom(origin);\n this._normal.setFrom(normal);\n }\n /** Return a deep clone (point and normal cloned) */\n public clone(result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal {\n if (result) {\n result.set(this._origin, this._normal);\n return result;\n }\n return new Plane3dByOriginAndUnitNormal(this._origin.clone(), this._normal.clone());\n }\n /** Create a clone and return the transform of the clone. */\n public cloneTransformed(transform: Transform, inverse: boolean = false): Plane3dByOriginAndUnitNormal | undefined {\n const result = this.clone();\n if (inverse) {\n transform.multiplyInversePoint3d(result._origin, result._origin);\n if (transform.matrix.multiplyTransposeVector(result._normal, result._normal) !== undefined\n && result._normal.normalizeInPlace())\n return result;\n } else {\n transform.multiplyPoint3d(result._origin, result._origin);\n if (transform.matrix.multiplyInverseTranspose(result._normal, result._normal) !== undefined\n && result._normal.normalizeInPlace())\n return result;\n }\n return undefined;\n }\n /** Copy data from the given plane. */\n public setFrom(source: Plane3dByOriginAndUnitNormal): void {\n this.set(source._origin, source._normal);\n }\n /** Return the altitude of spacePoint above or below the plane. (Below is negative) */\n public altitude(spacePoint: Point3d): number {\n return this._normal.dotProductStartEnd(this._origin, spacePoint);\n }\n /** Return the altitude of point (x,y) given xy parts using only the xy parts of origin and unit normal */\n public altitudeXY(x: number, y: number): number {\n return (x - this._origin.x) * this._normal.x + (y - this._origin.y) * this._normal.y;\n }\n /** Return the x component of the normal used to evaluate altitude. */\n public normalX(): number {\n return this._normal.x;\n }\n /** Return the x component of the normal used to evaluate altitude. */\n public normalY(): number {\n return this._normal.y;\n }\n /** Return the z component of the normal used to evaluate altitude. */\n public normalZ(): number {\n return this._normal.z;\n }\n /** Return (a clone of) the unit normal. */\n public override getUnitNormal(result?: Vector3d): Vector3d | undefined {\n return this._normal.clone(result);\n }\n /** Return (a clone of) the origin. */\n public override getAnyPointOnPlane(result?: Point3d): Point3d {\n // This function returns the plane origin. In general, a point x is on the plane if and only if (x-o).n = 0.\n return this._origin.clone(result);\n }\n /** Return the signed altitude of weighted spacePoint above or below the plane. (Below is negative) */\n public weightedAltitude(spacePoint: Point4d): number {\n return this._normal.dotProductStart3dEnd4d(this._origin, spacePoint);\n }\n /** Return any point at specified (signed) altitude. */\n public altitudeToPoint(altitude: number, result?: Point3d): Point3d {\n return this._origin.plusScaled(this._normal, altitude, result);\n }\n /**\n * Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\n * for a point moving at speed one along the spaceVector.\n */\n public velocityXYZ(x: number, y: number, z: number): number {\n return this._normal.dotProductXYZ(x, y, z);\n }\n /**\n * Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\n * for a point moving at speed one along the spaceVector.\n */\n public velocity(spaceVector: Vector3d): number {\n return this._normal.dotProduct(spaceVector);\n }\n /** Return the altitude of a point given as separate x,y,z components. */\n public altitudeXYZ(x: number, y: number, z: number): number {\n return this._normal.dotProductStartEndXYZ(this._origin, x, y, z);\n }\n /** Return the altitude of a point given as separate x,y,z,w components. */\n public altitudeXYZW(x: number, y: number, z: number, w: number): number {\n return this._normal.dotProductStartEndXYZW(this._origin, x, y, z, w);\n }\n /** Return the projection of spacePoint onto the plane. */\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\n return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);\n }\n /** Return the projection of (x,y,z) onto the plane. */\n public override projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d {\n const scale = -this._normal.dotProductStartEndXYZ(this._origin, x, y, z);\n return Point3d.create(x + scale * this._normal.x, y + scale * this._normal.y, z + scale * this._normal.z, result);\n }\n /**\n * Returns true if spacePoint is within distance tolerance of the plane.\n * * This logic is identical to the [[Plane3d]] method but avoids a level of function call.\n */\n public override isPointInPlane(spacePoint: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\n const altitude = this._normal.dotProductStartEnd(this._origin, spacePoint);\n return Math.abs(altitude) <= tolerance;\n }\n}\n"]}
|
|
@@ -169,9 +169,15 @@ export declare class Plane3dByOriginAndVectors extends Plane3d implements BeJSON
|
|
|
169
169
|
weightedAltitude(xyzw: Point4d): number;
|
|
170
170
|
/**
|
|
171
171
|
* Return the projection of spacePoint onto the plane.
|
|
172
|
-
* If the plane is degenerate to a ray, project to the ray.
|
|
173
|
-
* If the plane is degenerate to its origin, return the point
|
|
172
|
+
* * If the plane is degenerate to a ray, project to the ray.
|
|
173
|
+
* * If the plane is degenerate to its origin, return the point.
|
|
174
174
|
*/
|
|
175
175
|
projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d;
|
|
176
|
+
/**
|
|
177
|
+
* Return the projection of (x,y,z) onto the plane.
|
|
178
|
+
* * If the plane is degenerate to a ray, project to the ray.
|
|
179
|
+
* * If the plane is degenerate to its origin, return the point.
|
|
180
|
+
*/
|
|
181
|
+
projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d;
|
|
176
182
|
}
|
|
177
183
|
//# sourceMappingURL=Plane3dByOriginAndVectors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plane3dByOriginAndVectors.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndVectors.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO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,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAK7D,OAAO,CAAC,MAAM,CAAC,WAAW,CAAW;IACrC,oGAAoG;IAC7F,aAAa,CAAC,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,SAAS;IAQvD;;;;;;;OAOG;IACI,YAAY,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS;IAG9D,6DAA6D;IACtD,gBAAgB,CAAC,SAAS,EAAE,SAAS;IAK5C;;;OAGG;IACI,OAAO,IAAI,MAAM;IAIxB;;;OAGG;IACI,OAAO,IAAI,MAAM;IAIxB;;;OAGG;IACI,OAAO,IAAI,MAAM;IAIxB,qHAAqH;IAC9G,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAQpC,qHAAqH;IAC9G,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAQ3D,0HAA0H;IACnH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAQ1C,0HAA0H;IACnH,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAQ3D;;;;OAIG;IACI,gBAAgB,CAAC,IAAI,EAAE,OAAO;IAOrC;;;;OAIG;IACI,mBAAmB,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAG1E;;;;OAIG;IACa,iBAAiB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;CAuB9F"}
|
|
@@ -349,30 +349,38 @@ export class Plane3dByOriginAndVectors extends Plane3d {
|
|
|
349
349
|
}
|
|
350
350
|
/**
|
|
351
351
|
* Return the projection of spacePoint onto the plane.
|
|
352
|
-
* If the plane is degenerate to a ray, project to the ray.
|
|
353
|
-
* If the plane is degenerate to its origin, return the point
|
|
352
|
+
* * If the plane is degenerate to a ray, project to the ray.
|
|
353
|
+
* * If the plane is degenerate to its origin, return the point.
|
|
354
354
|
*/
|
|
355
355
|
projectPointToPlane(spacePoint, result) {
|
|
356
|
+
return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Return the projection of (x,y,z) onto the plane.
|
|
360
|
+
* * If the plane is degenerate to a ray, project to the ray.
|
|
361
|
+
* * If the plane is degenerate to its origin, return the point.
|
|
362
|
+
*/
|
|
363
|
+
projectXYZToPlane(x, y, z, result) {
|
|
356
364
|
const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
|
|
357
365
|
if (unitNormal !== undefined) {
|
|
358
|
-
const
|
|
359
|
-
return
|
|
366
|
+
const scale = -unitNormal.dotProductStartEndXYZ(this.origin, x, y, z);
|
|
367
|
+
return Point3d.create(x + scale * unitNormal.x, y + scale * unitNormal.y, z + scale * unitNormal.z, result);
|
|
360
368
|
}
|
|
361
|
-
//
|
|
362
|
-
//
|
|
369
|
+
// vectorU and vectorV are colinear or zero.
|
|
370
|
+
// Project to ray defined by the longer one, or just to origin.
|
|
363
371
|
const dotUU = this.vectorU.magnitudeSquared();
|
|
364
372
|
const dotVV = this.vectorV.magnitudeSquared();
|
|
365
373
|
if (dotUU >= dotVV) {
|
|
366
|
-
const dotUW = this.vectorU.
|
|
374
|
+
const dotUW = this.vectorU.dotProductStartEndXYZ(this.origin, x, y, z);
|
|
367
375
|
const f = Geometry.conditionalDivideCoordinate(dotUW, dotUU, 0.0);
|
|
368
376
|
if (f !== undefined)
|
|
369
|
-
return
|
|
377
|
+
return Point3d.create(x + f * this.vectorU.x, y + f * this.vectorU.y, z + f * this.vectorU.z, result);
|
|
370
378
|
}
|
|
371
379
|
else {
|
|
372
|
-
const dotVW = this.vectorV.
|
|
380
|
+
const dotVW = this.vectorV.dotProductStartEndXYZ(this.origin, x, y, z);
|
|
373
381
|
const f = Geometry.conditionalDivideCoordinate(dotVW, dotVV, 0.0);
|
|
374
382
|
if (f !== undefined)
|
|
375
|
-
return
|
|
383
|
+
return Point3d.create(x + f * this.vectorV.x, y + f * this.vectorV.y, z + f * this.vectorV.z, result);
|
|
376
384
|
}
|
|
377
385
|
return this.origin.clone(result);
|
|
378
386
|
}
|