@itwin/core-geometry 4.2.0-dev.3 → 4.2.0-dev.30
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 +59 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts +4 -3
- package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.d.ts +4 -3
- package/lib/cjs/clipping/BooleanClipNode.d.ts.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +12 -8
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +5 -3
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.d.ts +20 -8
- package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +77 -2
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.d.ts +6 -5
- package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipVector.js +1 -1
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +6 -4
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +3 -2
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +4 -3
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +2 -2
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +1 -3
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +1 -3
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +4 -4
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CoordinateXYZ.d.ts +15 -15
- package/lib/cjs/curve/CoordinateXYZ.d.ts.map +1 -1
- package/lib/cjs/curve/CoordinateXYZ.js +15 -15
- package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +4 -17
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +3 -22
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.d.ts +41 -26
- package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurve.js +73 -40
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +1 -1
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +12 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +13 -2
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveOps.d.ts +1 -1
- package/lib/cjs/curve/CurveOps.js.map +1 -1
- package/lib/cjs/curve/CurveProcessor.d.ts +1 -1
- package/lib/cjs/curve/CurveProcessor.js.map +1 -1
- package/lib/cjs/curve/CurveTypes.d.ts +19 -0
- package/lib/cjs/curve/CurveTypes.d.ts.map +1 -0
- package/lib/cjs/curve/{CurveChain.js → CurveTypes.js} +1 -1
- package/lib/cjs/curve/CurveTypes.js.map +1 -0
- package/lib/cjs/curve/CurveWireMomentsXYZ.d.ts +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/cjs/curve/ParityRegion.d.ts +1 -1
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.d.ts +1 -1
- package/lib/cjs/curve/Path.d.ts.map +1 -1
- package/lib/cjs/curve/Path.js +1 -1
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts +3 -2
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +2 -2
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/CurveSplitContext.d.ts +1 -1
- package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.d.ts +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/cjs/curve/Query/InOutTests.d.ts +1 -1
- package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.d.ts +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +16 -2
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +18 -1
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.d.ts +1 -1
- package/lib/cjs/curve/UnionRegion.js +1 -1
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +225 -0
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -0
- package/lib/cjs/curve/{CurveCurveCloseApproachXY.js → internalContexts/CurveCurveCloseApproachXY.js} +249 -189
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -0
- package/lib/{esm/curve → cjs/curve/internalContexts}/CurveCurveIntersectXY.d.ts +14 -27
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -0
- package/lib/cjs/curve/{CurveCurveIntersectXY.js → internalContexts/CurveCurveIntersectXY.js} +31 -42
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -0
- package/lib/cjs/curve/{CurveCurveIntersectXYZ.d.ts → internalContexts/CurveCurveIntersectXYZ.d.ts} +11 -12
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -0
- package/lib/cjs/curve/{CurveCurveIntersectXYZ.js → internalContexts/CurveCurveIntersectXYZ.js} +12 -14
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -0
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +1 -0
- package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js +1 -0
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.d.ts +57 -36
- package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js +99 -74
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +0 -8
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +0 -16
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +4 -4
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +12 -0
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +0 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +0 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts +3 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +4 -3
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.d.ts +2 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.d.ts.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.d.ts +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.d.ts +2 -2
- package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/Polynomials.js +2 -2
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts +1 -1
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SweepContour.d.ts +1 -1
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.d.ts +4 -3
- package/lib/esm/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.d.ts +4 -3
- package/lib/esm/clipping/BooleanClipNode.d.ts.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +12 -8
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +5 -3
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.d.ts +20 -8
- package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +77 -2
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.d.ts +6 -5
- package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
- package/lib/esm/clipping/ClipVector.js +1 -1
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +6 -4
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +3 -2
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +4 -3
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +2 -2
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +1 -3
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +1 -3
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +4 -4
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CoordinateXYZ.d.ts +15 -15
- package/lib/esm/curve/CoordinateXYZ.d.ts.map +1 -1
- package/lib/esm/curve/CoordinateXYZ.js +15 -15
- package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +4 -17
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +2 -20
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.d.ts +41 -26
- package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurve.js +73 -40
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +1 -1
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +12 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +11 -1
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveOps.d.ts +1 -1
- package/lib/esm/curve/CurveOps.js.map +1 -1
- package/lib/esm/curve/CurveProcessor.d.ts +1 -1
- package/lib/esm/curve/CurveProcessor.js.map +1 -1
- package/lib/esm/curve/CurveTypes.d.ts +19 -0
- package/lib/esm/curve/CurveTypes.d.ts.map +1 -0
- package/lib/esm/curve/{CurveChain.js → CurveTypes.js} +1 -1
- package/lib/esm/curve/CurveTypes.js.map +1 -0
- package/lib/esm/curve/CurveWireMomentsXYZ.d.ts +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/esm/curve/ParityRegion.d.ts +1 -1
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.d.ts +1 -1
- package/lib/esm/curve/Path.d.ts.map +1 -1
- package/lib/esm/curve/Path.js +1 -1
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts +3 -2
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/CurveSplitContext.d.ts +1 -1
- package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/esm/curve/Query/CylindricalRange.d.ts +1 -1
- package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/esm/curve/Query/InOutTests.d.ts +1 -1
- package/lib/esm/curve/Query/InOutTests.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.d.ts +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +16 -2
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +16 -0
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/UnionRegion.d.ts +1 -1
- package/lib/esm/curve/UnionRegion.js +1 -1
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +225 -0
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -0
- package/lib/esm/curve/{CurveCurveCloseApproachXY.js → internalContexts/CurveCurveCloseApproachXY.js} +249 -189
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -0
- package/lib/{cjs/curve → esm/curve/internalContexts}/CurveCurveIntersectXY.d.ts +14 -27
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -0
- package/lib/esm/curve/{CurveCurveIntersectXY.js → internalContexts/CurveCurveIntersectXY.js} +30 -40
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -0
- package/lib/esm/curve/{CurveCurveIntersectXYZ.d.ts → internalContexts/CurveCurveIntersectXYZ.d.ts} +11 -12
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -0
- package/lib/esm/curve/{CurveCurveIntersectXYZ.js → internalContexts/CurveCurveIntersectXYZ.js} +11 -13
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -0
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.d.ts +1 -0
- package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js +1 -0
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.d.ts +57 -36
- package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js +99 -74
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts +0 -8
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +0 -16
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +4 -4
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +12 -0
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +0 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +0 -1
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts +3 -1
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +4 -3
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.d.ts +2 -1
- package/lib/esm/geometry3d/ReusableObjectCache.d.ts.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.d.ts +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/numerics/Polynomials.d.ts +2 -2
- package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
- package/lib/esm/numerics/Polynomials.js +2 -2
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/solid/LinearSweep.d.ts +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts +1 -1
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.d.ts +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SweepContour.d.ts +1 -1
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/package.json +3 -3
- package/lib/cjs/curve/CurveChain.d.ts +0 -17
- package/lib/cjs/curve/CurveChain.d.ts.map +0 -1
- package/lib/cjs/curve/CurveChain.js.map +0 -1
- package/lib/cjs/curve/CurveCurveCloseApproachXY.d.ts +0 -164
- package/lib/cjs/curve/CurveCurveCloseApproachXY.d.ts.map +0 -1
- package/lib/cjs/curve/CurveCurveCloseApproachXY.js.map +0 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.d.ts.map +0 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.js.map +0 -1
- package/lib/cjs/curve/CurveCurveIntersectXYZ.d.ts.map +0 -1
- package/lib/cjs/curve/CurveCurveIntersectXYZ.js.map +0 -1
- package/lib/esm/curve/CurveChain.d.ts +0 -17
- package/lib/esm/curve/CurveChain.d.ts.map +0 -1
- package/lib/esm/curve/CurveChain.js.map +0 -1
- package/lib/esm/curve/CurveCurveCloseApproachXY.d.ts +0 -164
- package/lib/esm/curve/CurveCurveCloseApproachXY.d.ts.map +0 -1
- package/lib/esm/curve/CurveCurveCloseApproachXY.js.map +0 -1
- package/lib/esm/curve/CurveCurveIntersectXY.d.ts.map +0 -1
- package/lib/esm/curve/CurveCurveIntersectXY.js.map +0 -1
- package/lib/esm/curve/CurveCurveIntersectXYZ.d.ts.map +0 -1
- package/lib/esm/curve/CurveCurveIntersectXYZ.js.map +0 -1
|
@@ -16,7 +16,6 @@ const CurveCollection_1 = require("../curve/CurveCollection");
|
|
|
16
16
|
const CurvePrimitive_1 = require("../curve/CurvePrimitive");
|
|
17
17
|
const LineSegment3d_1 = require("../curve/LineSegment3d");
|
|
18
18
|
const LineString3d_1 = require("../curve/LineString3d");
|
|
19
|
-
/* eslint-disable @typescript-eslint/naming-convention, no-empty */
|
|
20
19
|
const Geometry_1 = require("../Geometry");
|
|
21
20
|
const GrowableXYZArray_1 = require("./GrowableXYZArray");
|
|
22
21
|
const Matrix3d_1 = require("./Matrix3d");
|
|
@@ -24,6 +23,7 @@ const Point3dVector3d_1 = require("./Point3dVector3d");
|
|
|
24
23
|
const PointHelpers_1 = require("./PointHelpers");
|
|
25
24
|
const PolygonOps_1 = require("./PolygonOps");
|
|
26
25
|
const Transform_1 = require("./Transform");
|
|
26
|
+
/* eslint-disable @typescript-eslint/naming-convention, no-empty */
|
|
27
27
|
/**
|
|
28
28
|
* Helper class to accumulate points and vectors until there is enough data to define a coordinate system.
|
|
29
29
|
*
|
|
@@ -31,10 +31,10 @@ const Transform_1 = require("./Transform");
|
|
|
31
31
|
* * create the FrameBuilder and make calls to announcePoint and announceVector.
|
|
32
32
|
* * the frame will be fully determined by an origin and two vectors.
|
|
33
33
|
* * the first call to announcePoint will set the origin.
|
|
34
|
-
* *
|
|
35
|
-
* *
|
|
34
|
+
* * additional calls to announcePoint will produce announceVector call with the vector from the origin.
|
|
35
|
+
* * after each announcement, call getValidatedFrame(false)
|
|
36
36
|
* * getValidatedFrame will succeed when it has two independent vectors.
|
|
37
|
-
* *
|
|
37
|
+
* * To build a left handed frame,
|
|
38
38
|
* * an origin and 3 independent vectors are required.
|
|
39
39
|
* * announce as above, but query with getValidatedFrame (true).
|
|
40
40
|
* * this will use the third vector to select right or left handed frame.
|
|
@@ -49,29 +49,39 @@ class FrameBuilder {
|
|
|
49
49
|
}
|
|
50
50
|
return false;
|
|
51
51
|
}
|
|
52
|
-
/**
|
|
53
|
-
clear() {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
/** Clear all accumulated point and vector data */
|
|
53
|
+
clear() {
|
|
54
|
+
this._origin = undefined;
|
|
55
|
+
this._vector0 = undefined;
|
|
56
|
+
this._vector1 = undefined;
|
|
57
|
+
this._vector2 = undefined;
|
|
58
|
+
}
|
|
59
|
+
constructor() {
|
|
60
|
+
this.clear();
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Try to assemble the data into a non-singular transform.
|
|
57
64
|
* * If allowLeftHanded is false, vector0 and vector1 determine a right handed coordinate system.
|
|
58
65
|
* * if allowLeftHanded is true, the z vector of the right handed system can be flipped to agree with vector2 direction.
|
|
59
66
|
*/
|
|
60
|
-
getValidatedFrame(allowLeftHanded = false) {
|
|
67
|
+
getValidatedFrame(allowLeftHanded = false, result) {
|
|
61
68
|
if (this._origin && this._vector0 && this._vector1) {
|
|
69
|
+
const createRigidMatrix = (v0, v1) => {
|
|
70
|
+
return FrameBuilder._workMatrix = Matrix3d_1.Matrix3d.createRigidFromColumns(v0, v1, Geometry_1.AxisOrder.XYZ, FrameBuilder._workMatrix);
|
|
71
|
+
};
|
|
62
72
|
if (!allowLeftHanded) {
|
|
63
|
-
const matrix =
|
|
73
|
+
const matrix = createRigidMatrix(this._vector0, this._vector1);
|
|
64
74
|
if (matrix)
|
|
65
|
-
return Transform_1.Transform.createOriginAndMatrix(this._origin, matrix);
|
|
75
|
+
return Transform_1.Transform.createOriginAndMatrix(this._origin, matrix, result);
|
|
66
76
|
// uh oh -- vector1 was not really independent. clear everything after vector0.
|
|
67
77
|
this._vector1 = this._vector2 = undefined;
|
|
68
78
|
}
|
|
69
79
|
else if (this._vector2) {
|
|
70
|
-
const matrix =
|
|
80
|
+
const matrix = createRigidMatrix(this._vector0, this._vector1);
|
|
71
81
|
if (matrix) {
|
|
72
82
|
if (this._vector0.tripleProduct(this._vector1, this._vector2) < 0)
|
|
73
83
|
matrix.scaleColumns(1.0, 1.0, -1.0);
|
|
74
|
-
return Transform_1.Transform.createOriginAndMatrix(this._origin, matrix);
|
|
84
|
+
return Transform_1.Transform.createOriginAndMatrix(this._origin, matrix, result);
|
|
75
85
|
}
|
|
76
86
|
// uh oh again -- clear vector1 and vector2, re-announce vector2 as possible vector1??
|
|
77
87
|
const vector2 = this._vector2;
|
|
@@ -88,8 +98,11 @@ class FrameBuilder {
|
|
|
88
98
|
}
|
|
89
99
|
}
|
|
90
100
|
/** Ask if there is a defined origin for the evolving frame */
|
|
91
|
-
get hasOrigin() {
|
|
92
|
-
|
|
101
|
+
get hasOrigin() {
|
|
102
|
+
return this._origin !== undefined;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Return the number of vectors saved. Because the save process checks numerics, this should be the rank of the system.
|
|
93
106
|
*/
|
|
94
107
|
savedVectorCount() {
|
|
95
108
|
if (!this._vector0)
|
|
@@ -100,7 +113,9 @@ class FrameBuilder {
|
|
|
100
113
|
return 2;
|
|
101
114
|
return 3;
|
|
102
115
|
}
|
|
103
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* Announce a new point. If this point is different from the origin, also compute and announce the vector from the origin.
|
|
118
|
+
*/
|
|
104
119
|
announcePoint(point) {
|
|
105
120
|
if (!this._origin) {
|
|
106
121
|
this._origin = point.clone();
|
|
@@ -111,7 +126,7 @@ class FrameBuilder {
|
|
|
111
126
|
return this.savedVectorCount();
|
|
112
127
|
return this.announceVector(this._origin.vectorTo(point));
|
|
113
128
|
}
|
|
114
|
-
/**
|
|
129
|
+
/** Announce a new vector. */
|
|
115
130
|
announceVector(vector) {
|
|
116
131
|
if (vector.isAlmostZero)
|
|
117
132
|
return this.savedVectorCount();
|
|
@@ -138,12 +153,15 @@ class FrameBuilder {
|
|
|
138
153
|
// fall through if prior vectors are all there -- no need for the new one.
|
|
139
154
|
return 3;
|
|
140
155
|
}
|
|
141
|
-
/**
|
|
142
|
-
*
|
|
156
|
+
/**
|
|
157
|
+
* Inspect the content of the data. Announce points and vectors. Return when savedVectorCount becomes sufficient
|
|
158
|
+
* for a coordinate system.
|
|
143
159
|
*/
|
|
144
160
|
announce(data) {
|
|
145
161
|
if (this.savedVectorCount() > 1)
|
|
146
162
|
return;
|
|
163
|
+
if (data === undefined)
|
|
164
|
+
return;
|
|
147
165
|
if (data instanceof Point3dVector3d_1.Point3d)
|
|
148
166
|
this.announcePoint(data);
|
|
149
167
|
else if (data instanceof Point3dVector3d_1.Vector3d)
|
|
@@ -220,108 +238,113 @@ class FrameBuilder {
|
|
|
220
238
|
}
|
|
221
239
|
}
|
|
222
240
|
}
|
|
223
|
-
/**
|
|
224
|
-
*
|
|
225
|
-
* *
|
|
226
|
-
* *
|
|
227
|
-
* *
|
|
241
|
+
/**
|
|
242
|
+
* Create a localToWorld frame for the given data.
|
|
243
|
+
* * origin is at first point.
|
|
244
|
+
* * x axis in direction of first nonzero vector present or implied by the input.
|
|
245
|
+
* * y axis is perpendicular to x and contains (in positive side) the next vector present or implied by the input.
|
|
246
|
+
* * The calculation favors the first points found. It does not try to get a "best" plane.
|
|
247
|
+
* @param defaultUpVector optional vector to cross with vector0 to create vector1 when it is unknown
|
|
248
|
+
* @param params any number of geometric objects to examine in [[announce]] for point/vector data sufficient to construct a frame.
|
|
249
|
+
* If the last argument is a `Transform`, it is populated with the computed frame and returned.
|
|
250
|
+
* @returns computed localToWorld frame, or undefined if insufficient data.
|
|
228
251
|
*/
|
|
229
252
|
static createRightHandedFrame(defaultUpVector, ...params) {
|
|
253
|
+
// if last arg is a Transform, remove it from the array and use for the return value
|
|
254
|
+
let frame = (params.length > 0 && params[params.length - 1] instanceof Transform_1.Transform) ? params.pop() : undefined;
|
|
230
255
|
const builder = new FrameBuilder();
|
|
231
256
|
for (const data of params) {
|
|
232
257
|
builder.announce(data);
|
|
233
258
|
builder.applyDefaultUpVector(defaultUpVector);
|
|
234
|
-
|
|
235
|
-
if (result !== undefined) {
|
|
259
|
+
if (frame = builder.getValidatedFrame(false, frame)) {
|
|
236
260
|
if (defaultUpVector) {
|
|
237
|
-
if (
|
|
238
|
-
|
|
261
|
+
if (frame.matrix.dotColumnZ(defaultUpVector) < 0.0)
|
|
262
|
+
frame.matrix.scaleColumnsInPlace(1, -1, -1);
|
|
239
263
|
}
|
|
240
|
-
return
|
|
264
|
+
return frame;
|
|
241
265
|
}
|
|
242
266
|
}
|
|
243
|
-
const evaluatePrimitiveFrame = (curve) => {
|
|
244
|
-
return curve.fractionToFrenetFrame(0.0);
|
|
267
|
+
const evaluatePrimitiveFrame = (curve, result) => {
|
|
268
|
+
return curve.fractionToFrenetFrame(0.0, result);
|
|
245
269
|
};
|
|
246
270
|
// try direct evaluation of curve primitives using the above lambda
|
|
247
271
|
for (const data of params) {
|
|
248
272
|
if (data instanceof CurvePrimitive_1.CurvePrimitive) {
|
|
249
|
-
return evaluatePrimitiveFrame(data);
|
|
273
|
+
return evaluatePrimitiveFrame(data, frame);
|
|
250
274
|
}
|
|
251
275
|
else if (data instanceof CurveCollection_1.CurveCollection) {
|
|
252
276
|
const children = data.collectCurvePrimitives();
|
|
253
277
|
for (const curve of children) {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
return frenetFrame;
|
|
278
|
+
if (frame = evaluatePrimitiveFrame(curve, frame))
|
|
279
|
+
return frame;
|
|
257
280
|
}
|
|
258
281
|
}
|
|
259
282
|
}
|
|
260
283
|
return undefined;
|
|
261
284
|
}
|
|
262
|
-
/**
|
|
285
|
+
/**
|
|
286
|
+
* Create a transform containing points or vectors in the given data.
|
|
263
287
|
* * The xy columns of the transform contain the first points or vectors of the data.
|
|
264
288
|
* * The z column is perpendicular to that xy plane.
|
|
265
|
-
* * The calculation favors the first points found.
|
|
289
|
+
* * The calculation favors the first points found. It does not try to get a "best" plane.
|
|
290
|
+
* @param params any number of geometric objects to examine in [[announce]] for point/vector data sufficient to construct a frame.
|
|
291
|
+
* If the last argument is a `Transform`, it is populated with the computed frame and returned.
|
|
292
|
+
* @returns computed localToWorld frame, or undefined if insufficient data.
|
|
266
293
|
*/
|
|
267
294
|
static createRightHandedLocalToWorld(...params) {
|
|
268
|
-
|
|
269
|
-
for (const data of params) {
|
|
270
|
-
builder.announce(data);
|
|
271
|
-
const localToWorld = builder.getValidatedFrame(false);
|
|
272
|
-
if (localToWorld !== undefined)
|
|
273
|
-
return localToWorld;
|
|
274
|
-
}
|
|
275
|
-
return undefined;
|
|
295
|
+
return this.createRightHandedFrame(undefined, params);
|
|
276
296
|
}
|
|
277
297
|
/**
|
|
278
|
-
*
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
* point most distant from that line.
|
|
298
|
+
* Try to create a frame whose xy plane is through points.
|
|
299
|
+
* * If 3 or more distinct points are present, the x axis is from the first point to the most distant, and y
|
|
300
|
+
* direction is toward the point most distant from that line.
|
|
282
301
|
* @param points array of points
|
|
302
|
+
* @param result optional pre-allocated Transform to populate and return
|
|
303
|
+
* @returns localToWorld frame for the points, or undefined if insufficient data
|
|
283
304
|
*/
|
|
284
|
-
static createFrameToDistantPoints(points) {
|
|
305
|
+
static createFrameToDistantPoints(points, result) {
|
|
285
306
|
if (points.length > 2) {
|
|
286
|
-
const origin = points[0]
|
|
287
|
-
const vector01 = Point3dVector3d_1.Vector3d.create();
|
|
307
|
+
const origin = points[0];
|
|
308
|
+
const vector01 = FrameBuilder._workVector0 ?? Point3dVector3d_1.Vector3d.create();
|
|
288
309
|
PointHelpers_1.Point3dArray.indexOfMostDistantPoint(points, points[0], vector01);
|
|
289
|
-
const vector02 = Point3dVector3d_1.Vector3d.create();
|
|
310
|
+
const vector02 = FrameBuilder._workVector1 ?? Point3dVector3d_1.Vector3d.create();
|
|
290
311
|
PointHelpers_1.Point3dArray.indexOfPointWithMaxCrossProductMagnitude(points, origin, vector01, vector02);
|
|
291
|
-
const matrix = Matrix3d_1.Matrix3d.createRigidFromColumns(vector01, vector02, Geometry_1.AxisOrder.XYZ);
|
|
312
|
+
const matrix = FrameBuilder._workMatrix = Matrix3d_1.Matrix3d.createRigidFromColumns(vector01, vector02, Geometry_1.AxisOrder.XYZ, FrameBuilder._workMatrix);
|
|
292
313
|
if (matrix)
|
|
293
|
-
return Transform_1.Transform.
|
|
314
|
+
return Transform_1.Transform.createOriginAndMatrix(origin, matrix, result);
|
|
294
315
|
}
|
|
295
316
|
return undefined;
|
|
296
317
|
}
|
|
297
318
|
/**
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
* point most distant from that line.
|
|
319
|
+
* Try to create a frame whose xy plane is through points, with the points appearing CCW in the local frame.
|
|
320
|
+
* * If 3 or more distinct points are present, the x axis is from the first point to the most distant, and y
|
|
321
|
+
* direction is toward the point most distant from that line.
|
|
302
322
|
* @param points array of points
|
|
323
|
+
* @param result optional pre-allocated Transform to populate and return
|
|
324
|
+
* @returns localToWorld frame for the points, or undefined if insufficient data
|
|
303
325
|
*/
|
|
304
|
-
static createFrameWithCCWPolygon(points) {
|
|
326
|
+
static createFrameWithCCWPolygon(points, result) {
|
|
305
327
|
if (points.length > 2) {
|
|
306
|
-
const ray = PolygonOps_1.PolygonOps.centroidAreaNormal(points);
|
|
307
|
-
if (ray)
|
|
308
|
-
return ray.toRigidZFrame();
|
|
309
|
-
}
|
|
328
|
+
const ray = PolygonOps_1.PolygonOps.centroidAreaNormal(points); // can't pass pre-allocated ray...
|
|
329
|
+
if (ray)
|
|
330
|
+
return ray.toRigidZFrame(result);
|
|
310
331
|
}
|
|
311
332
|
return undefined;
|
|
312
333
|
}
|
|
313
334
|
/**
|
|
314
335
|
* Create the localToWorld transform from a range to axes of its parent coordinate system.
|
|
315
|
-
* @param range
|
|
316
|
-
* @param
|
|
317
|
-
* @param
|
|
318
|
-
* @param
|
|
319
|
-
* @param
|
|
320
|
-
* @param defaultAxisLength
|
|
336
|
+
* @param range range to inspect
|
|
337
|
+
* @param scaleSelect selects size of localToWorld axes.
|
|
338
|
+
* @param fractionX fractional coordinate of frame origin x
|
|
339
|
+
* @param fractionY fractional coordinate of frame origin y
|
|
340
|
+
* @param fractionZ fractional coordinate of frame origin z
|
|
341
|
+
* @param defaultAxisLength if true and any axis length is 0, that axis vector takes this physical length.
|
|
342
|
+
* @param result optional pre-allocated Transform to populate and return
|
|
343
|
+
* @returns localToWorld frame for the range
|
|
321
344
|
*/
|
|
322
|
-
static createLocalToWorldTransformInRange(range, scaleSelect = Geometry_1.AxisScaleSelect.NonUniformRangeContainment, fractionX = 0, fractionY = 0, fractionZ = 0, defaultAxisLength = 1.0) {
|
|
345
|
+
static createLocalToWorldTransformInRange(range, scaleSelect = Geometry_1.AxisScaleSelect.NonUniformRangeContainment, fractionX = 0, fractionY = 0, fractionZ = 0, defaultAxisLength = 1.0, result) {
|
|
323
346
|
if (range.isNull)
|
|
324
|
-
return Transform_1.Transform.createIdentity();
|
|
347
|
+
return Transform_1.Transform.createIdentity(result);
|
|
325
348
|
let a = 1.0;
|
|
326
349
|
let b = 1.0;
|
|
327
350
|
let c = 1.0;
|
|
@@ -333,7 +356,9 @@ class FrameBuilder {
|
|
|
333
356
|
b = Geometry_1.Geometry.correctSmallMetricDistance(range.yLength(), defaultAxisLength) * Geometry_1.Geometry.maxAbsDiff(fractionY, 0, 1);
|
|
334
357
|
c = Geometry_1.Geometry.correctSmallMetricDistance(range.zLength(), defaultAxisLength) * Geometry_1.Geometry.maxAbsDiff(fractionZ, 0, 1);
|
|
335
358
|
}
|
|
336
|
-
|
|
359
|
+
const origin = FrameBuilder._workPoint = range.fractionToPoint(fractionX, fractionY, fractionZ, FrameBuilder._workPoint);
|
|
360
|
+
const matrix = FrameBuilder._workMatrix = Matrix3d_1.Matrix3d.createScale(a, b, c, FrameBuilder._workMatrix);
|
|
361
|
+
return Transform_1.Transform.createOriginAndMatrix(origin, matrix, result);
|
|
337
362
|
}
|
|
338
363
|
}
|
|
339
364
|
exports.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Ae,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,mBAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACrH,CAAC;CAEF;AArSD,oCAqSC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\n// import { Point2d } from \"./Geometry2d\";\r\nimport { BSplineCurve3d } from \"../bspline/BSplineCurve\";\r\nimport { InterpolationCurve3d } from \"../bspline/InterpolationCurve3d\";\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { CurveCollection } from \"../curve/CurveCollection\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { LineSegment3d } from \"../curve/LineSegment3d\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\n/* eslint-disable @typescript-eslint/naming-convention, no-empty */\r\nimport { AxisOrder, AxisScaleSelect, Geometry } from \"../Geometry\";\r\nimport { GrowableXYZArray } from \"./GrowableXYZArray\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { Point3dArray } from \"./PointHelpers\";\r\nimport { PolygonOps } from \"./PolygonOps\";\r\nimport { Range3d } from \"./Range\";\r\nimport { Transform } from \"./Transform\";\r\n\r\n/**\r\n * Helper class to accumulate points and vectors until there is enough data to define a coordinate system.\r\n *\r\n * * For the common case of building a right handed frame:\r\n * * create the FrameBuilder and make calls to announcePoint and announceVector.\r\n * * the frame will be fully determined by an origin and two vectors.\r\n * * the first call to announcePoint will set the origin.\r\n * * additional calls to announcePoint will produce announceVector call with the vector from the origin.\r\n * * After each announcement, call getValidatedFrame(false)\r\n * * getValidatedFrame will succeed when it has two independent vectors.\r\n * * to build a left handed frame,\r\n * * an origin and 3 independent vectors are required.\r\n * * announce as above, but query with getValidatedFrame (true).\r\n * * this will use the third vector to select right or left handed frame.\r\n * @public\r\n */\r\nexport class FrameBuilder {\r\n private _origin: undefined | Point3d;\r\n private _vector0: undefined | Vector3d;\r\n private _vector1: undefined | Vector3d;\r\n private _vector2: undefined | Vector3d;\r\n // test if both vectors are defined and have significant angle between.\r\n private areStronglyIndependentVectors(vector0: Vector3d, vector1: Vector3d, radiansTolerance: number = Geometry.smallAngleRadians): boolean {\r\n if (vector0 !== undefined && vector1 !== undefined) {\r\n const q = vector0.smallerUnorientedRadiansTo(vector1);\r\n return q > radiansTolerance;\r\n }\r\n return false;\r\n }\r\n /** clear all accumulated point and vector data */\r\n public clear() { this._origin = undefined; this._vector0 = undefined; this._vector1 = undefined; this._vector2 = undefined; }\r\n constructor() { this.clear(); }\r\n /** Try to assemble the data into a non-singular transform.\r\n *\r\n * * If allowLeftHanded is false, vector0 and vector1 determine a right handed coordinate system.\r\n * * if allowLeftHanded is true, the z vector of the right handed system can be flipped to agree with vector2 direction.\r\n */\r\n public getValidatedFrame(allowLeftHanded: boolean = false): Transform | undefined {\r\n if (this._origin && this._vector0 && this._vector1) {\r\n if (!allowLeftHanded) {\r\n const matrix = Matrix3d.createRigidFromColumns(this._vector0, this._vector1, AxisOrder.XYZ);\r\n if (matrix)\r\n return Transform.createOriginAndMatrix(this._origin, matrix);\r\n // uh oh -- vector1 was not really independent. clear everything after vector0.\r\n this._vector1 = this._vector2 = undefined;\r\n } else if (this._vector2) {\r\n const matrix = Matrix3d.createRigidFromColumns(this._vector0, this._vector1, AxisOrder.XYZ);\r\n if (matrix) {\r\n if (this._vector0.tripleProduct(this._vector1, this._vector2) < 0)\r\n matrix.scaleColumns(1.0, 1.0, -1.0);\r\n return Transform.createOriginAndMatrix(this._origin, matrix);\r\n }\r\n // uh oh again -- clear vector1 and vector2, re-announce vector2 as possible vector1??\r\n const vector2 = this._vector2;\r\n this._vector1 = this._vector2 = undefined;\r\n this.announceVector(vector2);\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** If vector0 is known but vector1 is not, make vector1 the cross of the up-vector and vector0 */\r\n public applyDefaultUpVector(vector?: Vector3d) {\r\n if (vector && this._vector0 && !this._vector1 && !vector.isParallelTo(this._vector0)) {\r\n this._vector1 = vector.crossProduct(this._vector0);\r\n }\r\n }\r\n /** Ask if there is a defined origin for the evolving frame */\r\n public get hasOrigin(): boolean { return this._origin !== undefined; }\r\n /** Return the number of vectors saved. Because the save process checks numerics, this should be the rank of the system.\r\n */\r\n public savedVectorCount(): number {\r\n if (!this._vector0)\r\n return 0;\r\n if (!this._vector1)\r\n return 1;\r\n if (!this._vector2)\r\n return 2;\r\n return 3;\r\n }\r\n /** announce a new point. If this point is different from the origin, also compute and announce the vector from the origin.*/\r\n public announcePoint(point: Point3d): number {\r\n if (!this._origin) {\r\n this._origin = point.clone();\r\n return this.savedVectorCount();\r\n }\r\n // the new point may provide an additional vector\r\n if (this._origin.isAlmostEqual(point))\r\n return this.savedVectorCount();\r\n return this.announceVector(this._origin.vectorTo(point));\r\n }\r\n /** announce a new vector. */\r\n public announceVector(vector: Vector3d): number {\r\n if (vector.isAlmostZero)\r\n return this.savedVectorCount();\r\n\r\n if (!this._vector0) { this._vector0 = vector.clone(this._vector0); return 1; }\r\n\r\n if (!this._vector1) {\r\n if (this.areStronglyIndependentVectors(vector, this._vector0, 1.0e-5)) {\r\n this._vector1 = vector.clone(this._vector1);\r\n return 2;\r\n }\r\n return 1;\r\n }\r\n\r\n // vector0 and vector1 are independent.\r\n if (!this._vector2) {\r\n const unitPerpendicular = this._vector0.unitCrossProduct(this._vector1);\r\n if (unitPerpendicular && !Geometry.isSameCoordinate(0, unitPerpendicular.dotProduct(vector))) {\r\n this._vector2 = vector.clone(this._vector2);\r\n return 3;\r\n }\r\n return 2;\r\n }\r\n // fall through if prior vectors are all there -- no need for the new one.\r\n return 3;\r\n }\r\n /** Inspect the content of the data. Announce points and vectors. Return when savedVectorCount becomes\r\n * sufficient for a coordinate system.\r\n */\r\n public announce(data: any) {\r\n if (this.savedVectorCount() > 1) return;\r\n if (data instanceof Point3d)\r\n this.announcePoint(data);\r\n else if (data instanceof Vector3d)\r\n this.announceVector(data);\r\n else if (Array.isArray(data)) {\r\n for (const child of data) {\r\n if (this.savedVectorCount() > 1)\r\n break;\r\n this.announce(child);\r\n }\r\n } else if (data instanceof CurvePrimitive) {\r\n if (data instanceof LineSegment3d) {\r\n this.announcePoint(data.startPoint());\r\n this.announcePoint(data.endPoint());\r\n } else if (data instanceof Arc3d) {\r\n const ray = data.fractionToPointAndDerivative(0.0);\r\n this.announcePoint(ray.origin);\r\n this.announceVector(ray.direction);\r\n this.announceVector(data.matrixRef.columnZCrossVector(ray.direction));\r\n } else if (data instanceof LineString3d) {\r\n for (const point of data.points) {\r\n this.announcePoint(point);\r\n if (this.savedVectorCount() > 1)\r\n break;\r\n }\r\n } else if (data instanceof BSplineCurve3d) {\r\n const point = Point3d.create();\r\n for (let i = 0; this.savedVectorCount() < 2; i++) {\r\n if (data.getPolePoint3d(i, point) instanceof Point3d)\r\n this.announcePoint(point);\r\n else break;\r\n }\r\n } else if (data instanceof InterpolationCurve3d) {\r\n const point = Point3d.create();\r\n for (let i = 0; this.savedVectorCount() < 2; i++) {\r\n if (i < data.options.fitPoints.length) {\r\n point.setFrom(data.options.fitPoints[i]);\r\n this.announcePoint(point);\r\n } else break;\r\n }\r\n } else { // unimplemented CurvePrimitive type\r\n const frame = data.fractionToFrenetFrame(0.0);\r\n if (undefined !== frame) {\r\n this.announcePoint(frame.getOrigin());\r\n this.announceVector(frame.matrix.getColumn(0));\r\n this.announceVector(frame.matrix.getColumn(1));\r\n }\r\n }\r\n } else if (data instanceof CurveCollection) {\r\n if (data.children)\r\n for (const child of data.children) {\r\n this.announce(child);\r\n if (this.savedVectorCount() > 1)\r\n break;\r\n }\r\n } else if (data instanceof GrowableXYZArray) {\r\n const point = Point3d.create();\r\n for (let i = 0; this.savedVectorCount() < 2; i++) {\r\n if (data.getPoint3dAtCheckedPointIndex(i, point) instanceof Point3d)\r\n this.announcePoint(point);\r\n else break;\r\n }\r\n }\r\n }\r\n /** create a localToWorld frame for the given data.\r\n *\r\n * * origin is at first point\r\n * * x axis in direction of first nonzero vector present or implied by the input.\r\n * * y axis is perpendicular to x and contains (in positive side) the next vector present or implied by the input.\r\n */\r\n public static createRightHandedFrame(defaultUpVector: Vector3d | undefined, ...params: any[]): Transform | undefined {\r\n const builder = new FrameBuilder();\r\n for (const data of params) {\r\n builder.announce(data);\r\n builder.applyDefaultUpVector(defaultUpVector);\r\n const result = builder.getValidatedFrame(false);\r\n if (result !== undefined) {\r\n if (defaultUpVector) {\r\n if (result.matrix.dotColumnZ(defaultUpVector) < 0.0)\r\n result.matrix.scaleColumnsInPlace(1, -1, -1);\r\n }\r\n return result;\r\n }\r\n }\r\n\r\n const evaluatePrimitiveFrame = (curve: CurvePrimitive): Transform | undefined => {\r\n return curve.fractionToFrenetFrame(0.0);\r\n };\r\n\r\n // try direct evaluation of curve primitives using the above lambda\r\n for (const data of params) {\r\n if (data instanceof CurvePrimitive) {\r\n return evaluatePrimitiveFrame(data);\r\n } else if (data instanceof CurveCollection) {\r\n const children = data.collectCurvePrimitives();\r\n for (const curve of children) {\r\n const frenetFrame = evaluatePrimitiveFrame(curve);\r\n if (frenetFrame)\r\n return frenetFrame;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** create a transform containing points or vectors in the given data.\r\n * * The xy columns of the transform contain the first points or vectors of the data.\r\n * * The z column is perpendicular to that xy plane.\r\n * * The calculation favors the first points found. It does not try to get a \"best\" plane.\r\n */\r\n public static createRightHandedLocalToWorld(...params: any[]): Transform | undefined {\r\n const builder = new FrameBuilder();\r\n for (const data of params) {\r\n builder.announce(data);\r\n const localToWorld = builder.getValidatedFrame(false);\r\n if (localToWorld !== undefined)\r\n return localToWorld;\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * try to create a frame whose xy plane is through points.\r\n *\r\n * * if 3 or more distinct points are present, the x axis is from the first point to the most distance, and y direction is toward the\r\n * point most distant from that line.\r\n * @param points array of points\r\n */\r\n public static createFrameToDistantPoints(points: Point3d[]): Transform | undefined {\r\n if (points.length > 2) {\r\n const origin = points[0].clone();\r\n const vector01 = Vector3d.create();\r\n Point3dArray.indexOfMostDistantPoint(points, points[0], vector01);\r\n const vector02 = Vector3d.create();\r\n Point3dArray.indexOfPointWithMaxCrossProductMagnitude(points, origin, vector01, vector02);\r\n const matrix = Matrix3d.createRigidFromColumns(vector01, vector02, AxisOrder.XYZ);\r\n if (matrix)\r\n return Transform.createRefs(origin, matrix);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * try to create a frame whose xy plane is through points, with the points appearing CCW in the local frame.\r\n *\r\n * * if 3 or more distinct points are present, the x axis is from the first point to the most distance, and y direction is toward the\r\n * point most distant from that line.\r\n * @param points array of points\r\n */\r\n public static createFrameWithCCWPolygon(points: Point3d[]): Transform | undefined {\r\n if (points.length > 2) {\r\n const ray = PolygonOps.centroidAreaNormal(points);\r\n if (ray) {\r\n return ray.toRigidZFrame();\r\n }\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Create the localToWorld transform from a range to axes of its parent coordinate system.\r\n * @param range [in] range to inspect\r\n * @param fractionX [in] fractional coordinate of frame origin x\r\n * @param fractionY [in] fractional coordinate of frame origin y\r\n * @param fractionZ [in] fractional coordinate of frame origin z\r\n * @param scaleSelect [in] selects size of localToWorld axes.\r\n * @param defaultAxisLength [in] if true and any axis length is 0, that axis vector takes this physical length.\r\n */\r\n public static createLocalToWorldTransformInRange(\r\n range: Range3d,\r\n scaleSelect: AxisScaleSelect = AxisScaleSelect.NonUniformRangeContainment,\r\n fractionX: number = 0,\r\n fractionY: number = 0,\r\n fractionZ: number = 0,\r\n defaultAxisLength: number = 1.0): Transform {\r\n if (range.isNull)\r\n return Transform.createIdentity();\r\n let a = 1.0;\r\n let b = 1.0;\r\n let c = 1.0;\r\n if (scaleSelect === AxisScaleSelect.LongestRangeDirection) {\r\n a = b = c = Geometry.correctSmallMetricDistance(range.maxLength(), defaultAxisLength);\r\n } else if (scaleSelect === AxisScaleSelect.NonUniformRangeContainment) {\r\n a = Geometry.correctSmallMetricDistance(range.xLength(), defaultAxisLength) * Geometry.maxAbsDiff(fractionX, 0, 1);\r\n b = Geometry.correctSmallMetricDistance(range.yLength(), defaultAxisLength) * Geometry.maxAbsDiff(fractionY, 0, 1);\r\n c = Geometry.correctSmallMetricDistance(range.zLength(), defaultAxisLength) * Geometry.maxAbsDiff(fractionZ, 0, 1);\r\n }\r\n return Transform.createRefs(range.fractionToPoint(fractionX, fractionY, fractionZ), Matrix3d.createScale(a, b, c));\r\n }\r\n\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"FrameBuilder.js","sourceRoot":"","sources":["../../../src/geometry3d/FrameBuilder.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAA0C;AAC1C,0DAAyD;AACzD,0EAAuE;AACvE,0CAAuC;AACvC,8DAA2D;AAC3D,4DAAyD;AACzD,0DAAuD;AACvD,wDAAqD;AACrD,0CAAmE;AACnE,yDAAsD;AACtD,yCAAsC;AACtC,uDAAsD;AACtD,iDAA8C;AAC9C,6CAA0C;AAE1C,2CAAwC;AAExC,mEAAmE;AAEnE;;;;;;;;;;;;;;;GAeG;AACH,MAAa,YAAY;IASvB,uEAAuE;IAC/D,6BAA6B,CACnC,OAAiB,EAAE,OAAiB,EAAE,mBAA2B,mBAAQ,CAAC,iBAAiB;QAE3F,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,EAAE;YAClD,MAAM,CAAC,GAAG,OAAO,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC;YACtD,OAAO,CAAC,GAAG,gBAAgB,CAAC;SAC7B;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,kDAAkD;IAC3C,KAAK;QACV,IAAI,CAAC,OAAO,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,IAAI,CAAC,GAAG,GAAG,CAAC;QACZ,IAAI,WAAW,KAAK,0BAAe,CAAC,qBAAqB,EAAE;YACzD,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,mBAAQ,CAAC,0BAA0B,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,iBAAiB,CAAC,CAAC;SACvF;aAAM,IAAI,WAAW,KAAK,0BAAe,CAAC,0BAA0B,EAAE;YACrE,CAAC,GAAG,mBAAQ,CAAC,0BAA0B,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,iBAAiB,CAAC,GAAG,mBAAQ,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YACnH,CAAC,GAAG,mBAAQ,CAAC,0BAA0B,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,iBAAiB,CAAC,GAAG,mBAAQ,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YACnH,CAAC,GAAG,mBAAQ,CAAC,0BAA0B,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,iBAAiB,CAAC,GAAG,mBAAQ,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;SACpH;QACD,MAAM,MAAM,GAAG,YAAY,CAAC,UAAU,GAAG,KAAK,CAAC,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;QACzH,MAAM,MAAM,GAAG,YAAY,CAAC,WAAW,GAAG,mBAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;QAClG,OAAO,qBAAS,CAAC,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACjE,CAAC;CACF;AApUD,oCAoUC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\n// import { Point2d } from \"./Geometry2d\";\r\nimport { BSplineCurve3d } from \"../bspline/BSplineCurve\";\r\nimport { InterpolationCurve3d } from \"../bspline/InterpolationCurve3d\";\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { CurveCollection } from \"../curve/CurveCollection\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { LineSegment3d } from \"../curve/LineSegment3d\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { AxisOrder, AxisScaleSelect, Geometry } from \"../Geometry\";\r\nimport { GrowableXYZArray } from \"./GrowableXYZArray\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { Point3dArray } from \"./PointHelpers\";\r\nimport { PolygonOps } from \"./PolygonOps\";\r\nimport { Range3d } from \"./Range\";\r\nimport { Transform } from \"./Transform\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention, no-empty */\r\n\r\n/**\r\n * Helper class to accumulate points and vectors until there is enough data to define a coordinate system.\r\n *\r\n * * For the common case of building a right handed frame:\r\n * * create the FrameBuilder and make calls to announcePoint and announceVector.\r\n * * the frame will be fully determined by an origin and two vectors.\r\n * * the first call to announcePoint will set the origin.\r\n * * additional calls to announcePoint will produce announceVector call with the vector from the origin.\r\n * * after each announcement, call getValidatedFrame(false)\r\n * * getValidatedFrame will succeed when it has two independent vectors.\r\n * * To build a left handed frame,\r\n * * an origin and 3 independent vectors are required.\r\n * * announce as above, but query with getValidatedFrame (true).\r\n * * this will use the third vector to select right or left handed frame.\r\n * @public\r\n */\r\nexport class FrameBuilder {\r\n private _origin: undefined | Point3d;\r\n private _vector0: undefined | Vector3d;\r\n private _vector1: undefined | Vector3d;\r\n private _vector2: undefined | Vector3d;\r\n private static _workMatrix?: Matrix3d;\r\n private static _workVector0?: Vector3d;\r\n private static _workVector1?: Vector3d;\r\n private static _workPoint?: Point3d;\r\n // test if both vectors are defined and have significant angle between.\r\n private areStronglyIndependentVectors(\r\n vector0: Vector3d, vector1: Vector3d, radiansTolerance: number = Geometry.smallAngleRadians,\r\n ): boolean {\r\n if (vector0 !== undefined && vector1 !== undefined) {\r\n const q = vector0.smallerUnorientedRadiansTo(vector1);\r\n return q > radiansTolerance;\r\n }\r\n return false;\r\n }\r\n /** Clear all accumulated point and vector data */\r\n public clear() {\r\n this._origin = undefined;\r\n this._vector0 = undefined;\r\n this._vector1 = undefined;\r\n this._vector2 = undefined;\r\n }\r\n constructor() {\r\n this.clear();\r\n }\r\n /**\r\n * Try to assemble the data into a non-singular transform.\r\n * * If allowLeftHanded is false, vector0 and vector1 determine a right handed coordinate system.\r\n * * if allowLeftHanded is true, the z vector of the right handed system can be flipped to agree with vector2 direction.\r\n */\r\n public getValidatedFrame(allowLeftHanded: boolean = false, result?: Transform): Transform | undefined {\r\n if (this._origin && this._vector0 && this._vector1) {\r\n const createRigidMatrix = (v0: Vector3d, v1: Vector3d): Matrix3d | undefined => {\r\n return FrameBuilder._workMatrix = Matrix3d.createRigidFromColumns(v0, v1, AxisOrder.XYZ, FrameBuilder._workMatrix);\r\n };\r\n if (!allowLeftHanded) {\r\n const matrix = createRigidMatrix(this._vector0, this._vector1);\r\n if (matrix)\r\n return Transform.createOriginAndMatrix(this._origin, matrix, result);\r\n // uh oh -- vector1 was not really independent. clear everything after vector0.\r\n this._vector1 = this._vector2 = undefined;\r\n } else if (this._vector2) {\r\n const matrix = createRigidMatrix(this._vector0, this._vector1);\r\n if (matrix) {\r\n if (this._vector0.tripleProduct(this._vector1, this._vector2) < 0)\r\n matrix.scaleColumns(1.0, 1.0, -1.0);\r\n return Transform.createOriginAndMatrix(this._origin, matrix, result);\r\n }\r\n // uh oh again -- clear vector1 and vector2, re-announce vector2 as possible vector1??\r\n const vector2 = this._vector2;\r\n this._vector1 = this._vector2 = undefined;\r\n this.announceVector(vector2);\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** If vector0 is known but vector1 is not, make vector1 the cross of the up-vector and vector0 */\r\n public applyDefaultUpVector(vector?: Vector3d) {\r\n if (vector && this._vector0 && !this._vector1 && !vector.isParallelTo(this._vector0)) {\r\n this._vector1 = vector.crossProduct(this._vector0);\r\n }\r\n }\r\n /** Ask if there is a defined origin for the evolving frame */\r\n public get hasOrigin(): boolean {\r\n return this._origin !== undefined;\r\n }\r\n /**\r\n * Return the number of vectors saved. Because the save process checks numerics, this should be the rank of the system.\r\n */\r\n public savedVectorCount(): number {\r\n if (!this._vector0)\r\n return 0;\r\n if (!this._vector1)\r\n return 1;\r\n if (!this._vector2)\r\n return 2;\r\n return 3;\r\n }\r\n /**\r\n * Announce a new point. If this point is different from the origin, also compute and announce the vector from the origin.\r\n */\r\n public announcePoint(point: Point3d): number {\r\n if (!this._origin) {\r\n this._origin = point.clone();\r\n return this.savedVectorCount();\r\n }\r\n // the new point may provide an additional vector\r\n if (this._origin.isAlmostEqual(point))\r\n return this.savedVectorCount();\r\n return this.announceVector(this._origin.vectorTo(point));\r\n }\r\n /** Announce a new vector. */\r\n public announceVector(vector: Vector3d): number {\r\n if (vector.isAlmostZero)\r\n return this.savedVectorCount();\r\n if (!this._vector0) {\r\n this._vector0 = vector.clone(this._vector0);\r\n return 1;\r\n }\r\n if (!this._vector1) {\r\n if (this.areStronglyIndependentVectors(vector, this._vector0, 1.0e-5)) {\r\n this._vector1 = vector.clone(this._vector1);\r\n return 2;\r\n }\r\n return 1;\r\n }\r\n // vector0 and vector1 are independent.\r\n if (!this._vector2) {\r\n const unitPerpendicular = this._vector0.unitCrossProduct(this._vector1);\r\n if (unitPerpendicular && !Geometry.isSameCoordinate(0, unitPerpendicular.dotProduct(vector))) {\r\n this._vector2 = vector.clone(this._vector2);\r\n return 3;\r\n }\r\n return 2;\r\n }\r\n // fall through if prior vectors are all there -- no need for the new one.\r\n return 3;\r\n }\r\n /**\r\n * Inspect the content of the data. Announce points and vectors. Return when savedVectorCount becomes sufficient\r\n * for a coordinate system.\r\n */\r\n public announce(data: any) {\r\n if (this.savedVectorCount() > 1)\r\n return;\r\n if (data === undefined)\r\n return;\r\n if (data instanceof Point3d)\r\n this.announcePoint(data);\r\n else if (data instanceof Vector3d)\r\n this.announceVector(data);\r\n else if (Array.isArray(data)) {\r\n for (const child of data) {\r\n if (this.savedVectorCount() > 1)\r\n break;\r\n this.announce(child);\r\n }\r\n } else if (data instanceof CurvePrimitive) {\r\n if (data instanceof LineSegment3d) {\r\n this.announcePoint(data.startPoint());\r\n this.announcePoint(data.endPoint());\r\n } else if (data instanceof Arc3d) {\r\n const ray = data.fractionToPointAndDerivative(0.0);\r\n this.announcePoint(ray.origin);\r\n this.announceVector(ray.direction);\r\n this.announceVector(data.matrixRef.columnZCrossVector(ray.direction));\r\n } else if (data instanceof LineString3d) {\r\n for (const point of data.points) {\r\n this.announcePoint(point);\r\n if (this.savedVectorCount() > 1)\r\n break;\r\n }\r\n } else if (data instanceof BSplineCurve3d) {\r\n const point = Point3d.create();\r\n for (let i = 0; this.savedVectorCount() < 2; i++) {\r\n if (data.getPolePoint3d(i, point) instanceof Point3d)\r\n this.announcePoint(point);\r\n else break;\r\n }\r\n } else if (data instanceof InterpolationCurve3d) {\r\n const point = Point3d.create();\r\n for (let i = 0; this.savedVectorCount() < 2; i++) {\r\n if (i < data.options.fitPoints.length) {\r\n point.setFrom(data.options.fitPoints[i]);\r\n this.announcePoint(point);\r\n } else break;\r\n }\r\n } else { // unimplemented CurvePrimitive type\r\n const frame = data.fractionToFrenetFrame(0.0);\r\n if (undefined !== frame) {\r\n this.announcePoint(frame.getOrigin());\r\n this.announceVector(frame.matrix.getColumn(0));\r\n this.announceVector(frame.matrix.getColumn(1));\r\n }\r\n }\r\n } else if (data instanceof CurveCollection) {\r\n if (data.children)\r\n for (const child of data.children) {\r\n this.announce(child);\r\n if (this.savedVectorCount() > 1)\r\n break;\r\n }\r\n } else if (data instanceof GrowableXYZArray) {\r\n const point = Point3d.create();\r\n for (let i = 0; this.savedVectorCount() < 2; i++) {\r\n if (data.getPoint3dAtCheckedPointIndex(i, point) instanceof Point3d)\r\n this.announcePoint(point);\r\n else break;\r\n }\r\n }\r\n }\r\n /**\r\n * Create a localToWorld frame for the given data.\r\n * * origin is at first point.\r\n * * x axis in direction of first nonzero vector present or implied by the input.\r\n * * y axis is perpendicular to x and contains (in positive side) the next vector present or implied by the input.\r\n * * The calculation favors the first points found. It does not try to get a \"best\" plane.\r\n * @param defaultUpVector optional vector to cross with vector0 to create vector1 when it is unknown\r\n * @param params any number of geometric objects to examine in [[announce]] for point/vector data sufficient to construct a frame.\r\n * If the last argument is a `Transform`, it is populated with the computed frame and returned.\r\n * @returns computed localToWorld frame, or undefined if insufficient data.\r\n */\r\n public static createRightHandedFrame(defaultUpVector: Vector3d | undefined, ...params: any[]): Transform | undefined {\r\n // if last arg is a Transform, remove it from the array and use for the return value\r\n let frame = (params.length > 0 && params[params.length - 1] instanceof Transform) ? params.pop() as Transform : undefined;\r\n const builder = new FrameBuilder();\r\n for (const data of params) {\r\n builder.announce(data);\r\n builder.applyDefaultUpVector(defaultUpVector);\r\n if (frame = builder.getValidatedFrame(false, frame)) {\r\n if (defaultUpVector) {\r\n if (frame.matrix.dotColumnZ(defaultUpVector) < 0.0)\r\n frame.matrix.scaleColumnsInPlace(1, -1, -1);\r\n }\r\n return frame;\r\n }\r\n }\r\n const evaluatePrimitiveFrame = (curve: CurvePrimitive, result?: Transform): Transform | undefined => {\r\n return curve.fractionToFrenetFrame(0.0, result);\r\n };\r\n // try direct evaluation of curve primitives using the above lambda\r\n for (const data of params) {\r\n if (data instanceof CurvePrimitive) {\r\n return evaluatePrimitiveFrame(data, frame);\r\n } else if (data instanceof CurveCollection) {\r\n const children = data.collectCurvePrimitives();\r\n for (const curve of children) {\r\n if (frame = evaluatePrimitiveFrame(curve, frame))\r\n return frame;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Create a transform containing points or vectors in the given data.\r\n * * The xy columns of the transform contain the first points or vectors of the data.\r\n * * The z column is perpendicular to that xy plane.\r\n * * The calculation favors the first points found. It does not try to get a \"best\" plane.\r\n * @param params any number of geometric objects to examine in [[announce]] for point/vector data sufficient to construct a frame.\r\n * If the last argument is a `Transform`, it is populated with the computed frame and returned.\r\n * @returns computed localToWorld frame, or undefined if insufficient data.\r\n */\r\n public static createRightHandedLocalToWorld(...params: any[]): Transform | undefined {\r\n return this.createRightHandedFrame(undefined, params);\r\n }\r\n\r\n /**\r\n * Try to create a frame whose xy plane is through points.\r\n * * If 3 or more distinct points are present, the x axis is from the first point to the most distant, and y\r\n * direction is toward the point most distant from that line.\r\n * @param points array of points\r\n * @param result optional pre-allocated Transform to populate and return\r\n * @returns localToWorld frame for the points, or undefined if insufficient data\r\n */\r\n public static createFrameToDistantPoints(points: Point3d[], result?: Transform): Transform | undefined {\r\n if (points.length > 2) {\r\n const origin = points[0];\r\n const vector01 = FrameBuilder._workVector0 ?? Vector3d.create();\r\n Point3dArray.indexOfMostDistantPoint(points, points[0], vector01);\r\n const vector02 = FrameBuilder._workVector1 ?? Vector3d.create();\r\n Point3dArray.indexOfPointWithMaxCrossProductMagnitude(points, origin, vector01, vector02);\r\n const matrix = FrameBuilder._workMatrix = Matrix3d.createRigidFromColumns(vector01, vector02, AxisOrder.XYZ, FrameBuilder._workMatrix);\r\n if (matrix)\r\n return Transform.createOriginAndMatrix(origin, matrix, result);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Try to create a frame whose xy plane is through points, with the points appearing CCW in the local frame.\r\n * * If 3 or more distinct points are present, the x axis is from the first point to the most distant, and y\r\n * direction is toward the point most distant from that line.\r\n * @param points array of points\r\n * @param result optional pre-allocated Transform to populate and return\r\n * @returns localToWorld frame for the points, or undefined if insufficient data\r\n */\r\n public static createFrameWithCCWPolygon(points: Point3d[], result?: Transform): Transform | undefined {\r\n if (points.length > 2) {\r\n const ray = PolygonOps.centroidAreaNormal(points); // can't pass pre-allocated ray...\r\n if (ray)\r\n return ray.toRigidZFrame(result);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Create the localToWorld transform from a range to axes of its parent coordinate system.\r\n * @param range range to inspect\r\n * @param scaleSelect selects size of localToWorld axes.\r\n * @param fractionX fractional coordinate of frame origin x\r\n * @param fractionY fractional coordinate of frame origin y\r\n * @param fractionZ fractional coordinate of frame origin z\r\n * @param defaultAxisLength if true and any axis length is 0, that axis vector takes this physical length.\r\n * @param result optional pre-allocated Transform to populate and return\r\n * @returns localToWorld frame for the range\r\n */\r\n public static createLocalToWorldTransformInRange(\r\n range: Range3d,\r\n scaleSelect: AxisScaleSelect = AxisScaleSelect.NonUniformRangeContainment,\r\n fractionX: number = 0,\r\n fractionY: number = 0,\r\n fractionZ: number = 0,\r\n defaultAxisLength: number = 1.0,\r\n result?: Transform,\r\n ): Transform {\r\n if (range.isNull)\r\n return Transform.createIdentity(result);\r\n let a = 1.0;\r\n let b = 1.0;\r\n let c = 1.0;\r\n if (scaleSelect === AxisScaleSelect.LongestRangeDirection) {\r\n a = b = c = Geometry.correctSmallMetricDistance(range.maxLength(), defaultAxisLength);\r\n } else if (scaleSelect === AxisScaleSelect.NonUniformRangeContainment) {\r\n a = Geometry.correctSmallMetricDistance(range.xLength(), defaultAxisLength) * Geometry.maxAbsDiff(fractionX, 0, 1);\r\n b = Geometry.correctSmallMetricDistance(range.yLength(), defaultAxisLength) * Geometry.maxAbsDiff(fractionY, 0, 1);\r\n c = Geometry.correctSmallMetricDistance(range.zLength(), defaultAxisLength) * Geometry.maxAbsDiff(fractionZ, 0, 1);\r\n }\r\n const origin = FrameBuilder._workPoint = range.fractionToPoint(fractionX, fractionY, fractionZ, FrameBuilder._workPoint);\r\n const matrix = FrameBuilder._workMatrix = Matrix3d.createScale(a, b, c, FrameBuilder._workMatrix);\r\n return Transform.createOriginAndMatrix(origin, matrix, result);\r\n }\r\n}\r\n"]}
|
|
@@ -181,14 +181,6 @@ export declare class GrowableXYZArray extends IndexedReadWriteXYZCollection {
|
|
|
181
181
|
* @returns number of points pushed.
|
|
182
182
|
*/
|
|
183
183
|
pushFromGrowableXYZArray(source: GrowableXYZArray, sourceIndex?: number): number;
|
|
184
|
-
/**
|
|
185
|
-
* Return the first point, or undefined if the array is empty.
|
|
186
|
-
*/
|
|
187
|
-
front(result?: Point3d): Point3d | undefined;
|
|
188
|
-
/**
|
|
189
|
-
* Return the last point, or undefined if the array is empty.
|
|
190
|
-
*/
|
|
191
|
-
back(result?: Point3d): Point3d | undefined;
|
|
192
184
|
/**
|
|
193
185
|
* Set the coordinates of a single point.
|
|
194
186
|
* @param pointIndex index of point to set
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GrowableXYZArray.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/GrowableXYZArray.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAY,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAwB,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,6BAA6B;IACjE;;OA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;;;OAMG;IACI,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS;IAuB3I;;;;OAIG;IACI,YAAY,CAAC,cAAc,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM;CAQjG"}
|
|
@@ -383,22 +383,6 @@ class GrowableXYZArray extends IndexedXYZCollection_1.IndexedReadWriteXYZCollect
|
|
|
383
383
|
}
|
|
384
384
|
return 0;
|
|
385
385
|
}
|
|
386
|
-
/**
|
|
387
|
-
* Return the first point, or undefined if the array is empty.
|
|
388
|
-
*/
|
|
389
|
-
front(result) {
|
|
390
|
-
if (this._xyzInUse === 0)
|
|
391
|
-
return undefined;
|
|
392
|
-
return this.getPoint3dAtUncheckedPointIndex(0, result);
|
|
393
|
-
}
|
|
394
|
-
/**
|
|
395
|
-
* Return the last point, or undefined if the array is empty.
|
|
396
|
-
*/
|
|
397
|
-
back(result) {
|
|
398
|
-
if (this._xyzInUse < 1)
|
|
399
|
-
return undefined;
|
|
400
|
-
return this.getPoint3dAtUncheckedPointIndex(this._xyzInUse - 1, result);
|
|
401
|
-
}
|
|
402
386
|
/**
|
|
403
387
|
* Set the coordinates of a single point.
|
|
404
388
|
* @param pointIndex index of point to set
|