@itwin/core-geometry 4.0.0-dev.59 → 4.0.0-dev.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/Constant.js.map +1 -1
- package/lib/cjs/Geometry.d.ts +13 -5
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +13 -0
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
- package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/cjs/bspline/KnotVector.js.map +1 -1
- package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +15 -2
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +22 -1
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.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.js.map +1 -1
- package/lib/cjs/curve/ChainCollectorContext.js.map +1 -1
- package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
- package/lib/cjs/curve/CurveChain.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/CurveProcessor.js.map +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/cjs/curve/GeometryQuery.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/PointString3d.js.map +1 -1
- package/lib/cjs/curve/ProxyCurve.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.d.ts +126 -0
- package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -0
- package/lib/cjs/geometry3d/Plane3d.js +95 -0
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -0
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +34 -6
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +59 -5
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts +58 -4
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +134 -4
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +13 -0
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +20 -0
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts +8 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +19 -1
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/geometry4d/Map4d.js.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/geometry4d/MomentData.js.map +1 -1
- package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.d.ts +14 -2
- package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js +25 -12
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/BandedSystem.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
- package/lib/cjs/numerics/Complex.js.map +1 -1
- package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
- package/lib/cjs/numerics/PolarData.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/numerics/Quadrature.js.map +1 -1
- package/lib/cjs/numerics/Range1dArray.js.map +1 -1
- package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/cjs/numerics/UnionFind.js.map +1 -1
- package/lib/cjs/numerics/UsageSums.js.map +1 -1
- package/lib/cjs/polyface/AuxData.js.map +1 -1
- package/lib/cjs/polyface/BoxTopology.js.map +1 -1
- package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
- package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
- package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
- package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/cjs/serialization/DeepCompare.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/cjs/topology/MaskManager.js.map +1 -1
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
- package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
- package/lib/esm/Constant.js.map +1 -1
- package/lib/esm/Geometry.d.ts +13 -5
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +13 -0
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/esm/bspline/BSplineSurface.js.map +1 -1
- package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/esm/bspline/KnotVector.js.map +1 -1
- package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +15 -2
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +22 -1
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.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.js.map +1 -1
- package/lib/esm/curve/ChainCollectorContext.js.map +1 -1
- package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
- package/lib/esm/curve/CurveChain.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/CurveExtendMode.js.map +1 -1
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/CurveProcessor.js.map +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/esm/curve/GeometryQuery.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/PointString3d.js.map +1 -1
- package/lib/esm/curve/ProxyCurve.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/esm/curve/Query/InOutTests.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.d.ts +126 -0
- package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -0
- package/lib/esm/geometry3d/Plane3d.js +91 -0
- package/lib/esm/geometry3d/Plane3d.js.map +1 -0
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +34 -6
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +59 -5
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts +58 -4
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +134 -4
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +13 -0
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +20 -0
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts +8 -1
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +19 -1
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/esm/geometry3d/Segment1d.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/esm/geometry3d/XYZProps.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/geometry4d/Map4d.js.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/geometry4d/MomentData.js.map +1 -1
- package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.d.ts +14 -2
- package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Point4d.js +25 -12
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/BandedSystem.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/ClusterableArray.js.map +1 -1
- package/lib/esm/numerics/Complex.js.map +1 -1
- package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
- package/lib/esm/numerics/PolarData.js.map +1 -1
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/numerics/Quadrature.js.map +1 -1
- package/lib/esm/numerics/Range1dArray.js.map +1 -1
- package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/esm/numerics/UnionFind.js.map +1 -1
- package/lib/esm/numerics/UsageSums.js.map +1 -1
- package/lib/esm/polyface/AuxData.js.map +1 -1
- package/lib/esm/polyface/BoxTopology.js.map +1 -1
- package/lib/esm/polyface/FacetFaceData.js.map +1 -1
- package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/esm/polyface/FacetOrientation.js.map +1 -1
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeLengthData.js.map +1 -1
- package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
- package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/esm/serialization/DeepCompare.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SolidPrimitive.js.map +1 -1
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/esm/topology/MaskManager.js.map +1 -1
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/SignedDataSummary.js.map +1 -1
- package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderedRotationAngles.js","sourceRoot":"","sources":["../../../src/geometry3d/OrderedRotationAngles.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,wFAAwF;AAExF;;;;;;;;;;GAUG;AACH,MAAa,qBAAqB;IAWhC,kBAAkB;IAClB,YAAoB,CAAQ,EAAE,CAAQ,EAAE,CAAQ,EAAE,SAAoB;QACpE,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IAC1B,CAAC;IACD,0FAA0F;IAC1F,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,gFAAgF;IAChF,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IACzB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,GAAG,EAAE,EACrB,CAAC,EAAE,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,CAC7C,CAAC;SACH;aAAM;YACL,GAAG,CAAC,WAAW,EAAE,CAAC;SACnB;QACD,yEAAyE;QACzE,IAAI,CAAC,qBAAqB,CAAC,qBAAqB;YAC9C,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAEzB,OAAO,GAAG,CAAC;IACb,CAAC;;AA9UD,sCAAsC;AACvB,6CAAuB,GAAY,KAAK,CAAC;SAV7C,qBAAqB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\nimport { AxisOrder, Geometry } from \"../Geometry\";\r\nimport { Angle } from \"./Angle\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\n\r\n/* cspell:word cxcz, cxsz, cxcy, cxsy, sxcz, sxsz, sxcy, sxsy, cycz, cysz, sycz, sysz */\r\n\r\n/**\r\n * Represents a non-trivial rotation using three simple axis rotation angles and an order in which to apply them.\r\n * * This class accommodates application-specific interpretation of \"multiplying 3 rotation matrices\" with regard to\r\n * * Whether a \"vector\" is a \"row\" or a \"column\"\r\n * * The order in which the X,Y,Z rotations are applied.\r\n * * This class bakes in angle rotation directions via create functions (i.e., createRadians, createDegrees, and\r\n * createAngles) so you can define each of the 3 rotations to be clockwise or counterclockwise. The default\r\n * rotation is counterclockwise.\r\n * * Within the imodel geometry library, the preferred rotation order is encapsulated in `YawPitchRollAngles`.\r\n * @alpha\r\n */\r\nexport class OrderedRotationAngles {\r\n /** rotation around x */\r\n private _x: Angle;\r\n /** rotation around y */\r\n private _y: Angle;\r\n /** rotation around z */\r\n private _z: Angle;\r\n /** rotation order. For example XYZ means to rotate around x axis first, then y axis, and finally Z axis */\r\n private _order: AxisOrder;\r\n /** treat vectors as matrix columns */\r\n private static _sTreatVectorsAsColumns: boolean = false;\r\n /** constructor */\r\n private constructor(x: Angle, y: Angle, z: Angle, axisOrder: AxisOrder) {\r\n this._x = x;\r\n this._y = y;\r\n this._z = z;\r\n this._order = axisOrder;\r\n }\r\n /** (Property accessor) Return the `AxisOrder` controlling matrix multiplication order. */\r\n public get order(): AxisOrder {\r\n return this._order;\r\n }\r\n /** (Property accessor) Return the strongly typed angle of rotation around x. */\r\n public get xAngle(): Angle {\r\n return this._x.clone();\r\n }\r\n /** (Property accessor) Return the strongly typed angle of rotation around y. */\r\n public get yAngle(): Angle {\r\n return this._y.clone();\r\n }\r\n /** (Property accessor) Return the strongly typed angle of rotation around z. */\r\n public get zAngle(): Angle {\r\n return this._z.clone();\r\n }\r\n /** (Property accessor) Return the angle of rotation around x, in degrees */\r\n public get xDegrees(): number {\r\n return this._x.degrees;\r\n }\r\n /** (Property accessor) Return the angle of rotation around y, in degrees */\r\n public get xRadians(): number {\r\n return this._x.radians;\r\n }\r\n /** (Property accessor) Return the angle of rotation around z, in degrees */\r\n public get yDegrees(): number {\r\n return this._y.degrees;\r\n }\r\n /** (Property accessor) Return the angle of rotation around x, in radians */\r\n public get yRadians(): number {\r\n return this._y.radians;\r\n }\r\n /** (Property accessor) Return the angle of rotation around y, in radians */\r\n public get zDegrees(): number {\r\n return this._z.degrees;\r\n }\r\n /** (Property accessor) Return the angle of rotation around z, in radians */\r\n public get zRadians(): number {\r\n return this._z.radians;\r\n }\r\n /** The flag controlling whether vectors are treated as rows or as columns */\r\n public static get treatVectorsAsColumns(): boolean {\r\n return OrderedRotationAngles._sTreatVectorsAsColumns;\r\n }\r\n public static set treatVectorsAsColumns(value: boolean) {\r\n OrderedRotationAngles._sTreatVectorsAsColumns = value;\r\n }\r\n /**\r\n * Create an OrderedRotationAngles from three angles (in radians), an ordering in which to apply them when\r\n * rotating, and a flag triple controlling whether direction of x,y,z is clockwise or counterclockwise.\r\n * @param xRadians rotation around x\r\n * @param yRadians rotation around y\r\n * @param zRadians rotation around z\r\n * @param order left to right order of axis names identifies the order that rotations are applied.\r\n * For example XYZ means to rotate around x axis first, then y axis, and finally Z axis.\r\n * * Note that rotation order is reverse of rotation matrix multiplication so for XYZ the rotation\r\n * matrix multiplication would be zRot*yRot*xRot\r\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeRotationAroundStandardAxes\r\n * @param xyzRotationIsClockwise the flags controlling whether direction of x,y,z is clockwise or counterclockwise.\r\n * rotation direction of x,y,z: true ---> clockwise - false ---> counterclockwise.\r\n * * if xyzRotationIsClockwise is undefined it's set to [false, false, false].\r\n * @param result caller-allocated OrderedRotationAngles\r\n */\r\n public static createRadians(xRadians: number, yRadians: number, zRadians: number, order: AxisOrder,\r\n xyzRotationIsClockwise?: [boolean, boolean, boolean], result?: OrderedRotationAngles): OrderedRotationAngles {\r\n if (!xyzRotationIsClockwise) {\r\n xyzRotationIsClockwise = [false, false, false];\r\n }\r\n const xRadian = xyzRotationIsClockwise[0] ? -xRadians : xRadians;\r\n const yRadian = xyzRotationIsClockwise[1] ? -yRadians : yRadians;\r\n const zRadian = xyzRotationIsClockwise[2] ? -zRadians : zRadians;\r\n if (result) {\r\n result._x.setRadians(xRadian);\r\n result._y.setRadians(yRadian);\r\n result._z.setRadians(zRadian);\r\n result._order = order;\r\n return result;\r\n }\r\n return new OrderedRotationAngles(\r\n Angle.createRadians(xRadian),\r\n Angle.createRadians(yRadian),\r\n Angle.createRadians(zRadian),\r\n order\r\n );\r\n }\r\n /**\r\n * Create an OrderedRotationAngles from three angles (in degrees) and an ordering in which to apply\r\n * them when rotating.\r\n * @param xDegrees rotation around x\r\n * @param yDegrees rotation around y\r\n * @param zDegrees rotation around z\r\n * @param order left to right order of axis names identifies the order that rotations are applied.\r\n * For example XYZ means to rotate around x axis first, then y axis, and finally Z axis.\r\n * * Note that rotation order is reverse of rotation matrix multiplication so for XYZ the rotation\r\n * matrix multiplication would be zRot*yRot*xRot\r\n * @param xyzRotationIsClockwise the flags controlling whether direction of x,y,z is clockwise or counterclockwise.\r\n * rotation direction of x,y,z: true ---> clockwise - false ---> counterclockwise.\r\n * * if xyzRotationIsClockwise is undefined it's set to [false, false, false].\r\n * @param result caller-allocated OrderedRotationAngles\r\n */\r\n public static createDegrees(xDegrees: number, yDegrees: number, zDegrees: number, order: AxisOrder,\r\n xyzRotationIsClockwise?: [boolean, boolean, boolean], result?: OrderedRotationAngles): OrderedRotationAngles {\r\n return OrderedRotationAngles.createRadians(\r\n Angle.degreesToRadians(xDegrees),\r\n Angle.degreesToRadians(yDegrees),\r\n Angle.degreesToRadians(zDegrees),\r\n order,\r\n xyzRotationIsClockwise,\r\n result\r\n );\r\n }\r\n /**\r\n * Create an OrderedRotationAngles from three angles, an ordering in which to apply them when rotating,\r\n * and a flag triple controlling whether direction of x,y,z is clockwise or counterclockwise.\r\n * @param xRotation rotation around x\r\n * @param yRotation rotation around y\r\n * @param zRotation rotation around z\r\n * @param order left to right order of axis names identifies the order that rotations are applied\r\n * For example XYZ means to rotate around x axis first, then y axis, and finally Z axis.\r\n * * Note that rotation order is reverse of rotation matrix multiplication so for XYZ the rotation\r\n * matrix multiplication would be zRot*yRot*xRot\r\n * @param xyzRotationIsClockwise the flags controlling whether direction of x,y,z is clockwise or counterclockwise.\r\n * rotation direction of x,y,z: true ---> clockwise - false ---> counterclockwise.\r\n * * if xyzRotationIsClockwise is undefined it's set to [false, false, false].\r\n * @param result caller-allocated OrderedRotationAngles\r\n */\r\n public static createAngles(xRotation: Angle, yRotation: Angle, zRotation: Angle, order: AxisOrder,\r\n xyzRotationIsClockwise?: [boolean, boolean, boolean], result?: OrderedRotationAngles): OrderedRotationAngles {\r\n return OrderedRotationAngles.createRadians(\r\n xRotation.radians,\r\n yRotation.radians,\r\n zRotation.radians,\r\n order,\r\n xyzRotationIsClockwise,\r\n result\r\n );\r\n }\r\n /**\r\n * Create an OrderedRotationAngles from a 3x3 rotational matrix, given the ordering of axis rotations\r\n * that the matrix derives from.\r\n * * This function creates an OrderedRotationAngles with default angle rotation directions, i.e.,\r\n * it assumes all x, y, and z rotations are counterclockwise.\r\n * * In the failure case the method's return value is `undefined`.\r\n * * In the failure case, if the optional result was supplied, that result will nonetheless be filled with\r\n * a set of angles.\r\n */\r\n public static createFromMatrix3d(matrix: Matrix3d, order: AxisOrder, result?: OrderedRotationAngles):\r\n OrderedRotationAngles | undefined {\r\n // treat vector as columns\r\n let m11 = matrix.coffs[0], m12 = matrix.coffs[1], m13 = matrix.coffs[2];\r\n let m21 = matrix.coffs[3], m22 = matrix.coffs[4], m23 = matrix.coffs[5];\r\n let m31 = matrix.coffs[6], m32 = matrix.coffs[7], m33 = matrix.coffs[8];\r\n // treat vector as rows\r\n if (!OrderedRotationAngles.treatVectorsAsColumns) {\r\n m11 = matrix.coffs[0], m12 = matrix.coffs[3], m13 = matrix.coffs[6];\r\n m21 = matrix.coffs[1], m22 = matrix.coffs[4], m23 = matrix.coffs[7];\r\n m31 = matrix.coffs[2], m32 = matrix.coffs[5], m33 = matrix.coffs[8];\r\n }\r\n\r\n let xRad: number;\r\n let yRad: number;\r\n let zRad: number;\r\n\r\n switch (order) {\r\n case AxisOrder.XYZ: {\r\n yRad = Math.asin(Math.max(-1, Math.min(1, -m31))); // limit asin domain to [-1,1]\r\n\r\n if (Math.abs(m31) < 0.99999) {\r\n xRad = Math.atan2(m32, m33);\r\n zRad = Math.atan2(m21, m11);\r\n } else {\r\n /**\r\n * If Math.abs(m31) = 1 then yRad = +-90 degrees and therefore, we have a gimbal lock.\r\n * This means xRad and zRad can be anything as long as their sum xRad + zRad is constant.\r\n * so we can pick zRad = 0 and calculate xRad (or pick xRad = 0 and calculate zRad).\r\n * Therefore, rotation matrix becomes\r\n * Matrix3d.createRowValues(\r\n * 0, +-sx, +-cx,\r\n * 0, cx, -sx,\r\n * -+1, 0, 0\r\n * );\r\n * Math details can be found\r\n * https://en.wikipedia.org/wiki/Gimbal_lock#Loss_of_a_degree_of_freedom_with_Euler_angles\r\n */\r\n xRad = Math.atan2(-m23, m22);\r\n zRad = 0;\r\n }\r\n break;\r\n } case AxisOrder.YXZ: {\r\n xRad = Math.asin(Math.max(-1, Math.min(1, m32))); // limit asin domain to [-1,1]\r\n\r\n if (Math.abs(m32) < 0.99999) {\r\n yRad = Math.atan2(-m31, m33);\r\n zRad = Math.atan2(-m12, m22);\r\n } else {\r\n yRad = Math.atan2(m13, m11);\r\n zRad = 0;\r\n }\r\n break;\r\n } case AxisOrder.ZXY: {\r\n xRad = Math.asin(Math.max(-1, Math.min(1, -m23))); // limit asin domain to [-1,1]\r\n\r\n if (Math.abs(m23) < 0.99999) {\r\n yRad = Math.atan2(m13, m33);\r\n zRad = Math.atan2(m21, m22);\r\n } else {\r\n yRad = 0;\r\n zRad = Math.atan2(-m12, m11);\r\n }\r\n break;\r\n } case AxisOrder.ZYX: {\r\n yRad = Math.asin(Math.max(-1, Math.min(1, m13))); // limit asin domain to [-1,1]\r\n\r\n if (Math.abs(m13) < 0.99999) {\r\n xRad = Math.atan2(-m23, m33);\r\n zRad = Math.atan2(-m12, m11);\r\n } else {\r\n xRad = 0;\r\n zRad = Math.atan2(m21, m22);\r\n }\r\n break;\r\n } case AxisOrder.YZX: {\r\n zRad = Math.asin(Math.max(-1, Math.min(1, -m12))); // limit asin domain to [-1,1]\r\n\r\n if (Math.abs(m12) < 0.99999) {\r\n xRad = Math.atan2(m32, m22);\r\n yRad = Math.atan2(m13, m11);\r\n } else {\r\n xRad = 0;\r\n yRad = Math.atan2(-m31, m33);\r\n }\r\n break;\r\n } case AxisOrder.XZY: {\r\n zRad = Math.asin(Math.max(-1, Math.min(1, m21))); // limit asin domain to [-1,1]\r\n\r\n if (Math.abs(m21) < 0.99999) {\r\n xRad = Math.atan2(-m23, m22);\r\n yRad = Math.atan2(-m31, m11);\r\n } else {\r\n xRad = Math.atan2(m32, m33);\r\n yRad = 0;\r\n }\r\n break;\r\n } default: {\r\n xRad = yRad = zRad = 0;\r\n }\r\n }\r\n const xyzRotationIsClockwise: [boolean, boolean, boolean] = [false, false, false];\r\n const angles = OrderedRotationAngles.createRadians(xRad, yRad, zRad, order, xyzRotationIsClockwise, result);\r\n // sanity check\r\n const matrix1 = angles.toMatrix3d();\r\n /**\r\n * Below tolerance loosened to allow sanity check to pass for\r\n *\r\n * OrderedRotationAngles.createFromMatrix3d(\r\n * OrderedRotationAngles.createDegrees(0, 89.999, 0.001, AxisOrder.XYZ).toMatrix3d(),\r\n * AxisOrder.XYZ\r\n * );\r\n *\r\n * with treatVectorsAsColumns = true.\r\n */\r\n return (matrix.maxDiff(matrix1) < 10 * Geometry.smallFraction) ? angles : undefined;\r\n }\r\n /**\r\n * Create a 3x3 rotational matrix from this OrderedRotationAngles.\r\n ** math details can be found at docs/learning/geometry/Angle.md\r\n **/\r\n public toMatrix3d(result?: Matrix3d): Matrix3d {\r\n const rot = (result !== undefined) ? result : new Matrix3d();\r\n const axisOrder = this.order;\r\n const x = this.xAngle, y = this.yAngle, z = this.zAngle;\r\n\r\n const cx = x.cos(), sx = x.sin();\r\n const cy = y.cos(), sy = y.sin();\r\n const cz = z.cos(), sz = z.sin();\r\n\r\n const cxcz = cx * cz, cxsz = cx * sz, cxcy = cx * cy, cxsy = cx * sy;\r\n const sxcz = sx * cz, sxsz = sx * sz, sxcy = sx * cy, sxsy = sx * sy;\r\n const cycz = cy * cz, cysz = cy * sz, sycz = sy * cz, sysz = sy * sz;\r\n\r\n // the rotation matrix we build below is created using column-based base rotation matrixes\r\n if (axisOrder === AxisOrder.XYZ) {\r\n rot.setRowValues(\r\n cy * cz, sxcz * sy - cxsz, cxcz * sy + sxsz,\r\n cy * sz, cxcz + sxsz * sy, cxsz * sy - sxcz,\r\n -sy, sx * cy, cx * cy,\r\n );\r\n } else if (axisOrder === AxisOrder.YXZ) {\r\n rot.setRowValues(\r\n cycz - sysz * sx, -cx * sz, cysz * sx + sycz,\r\n sycz * sx + cysz, cx * cz, sysz - cycz * sx,\r\n -cx * sy, sx, cx * cy,\r\n );\r\n } else if (axisOrder === AxisOrder.ZXY) {\r\n rot.setRowValues(\r\n cycz + sysz * sx, sycz * sx - cysz, cx * sy,\r\n cx * sz, cx * cz, -sx,\r\n cysz * sx - sycz, cycz * sx + sysz, cx * cy,\r\n );\r\n } else if (axisOrder === AxisOrder.ZYX) {\r\n rot.setRowValues(\r\n cy * cz, -cy * sz, sy,\r\n sxcz * sy + cxsz, cxcz - sxsz * sy, -sx * cy,\r\n sxsz - cxcz * sy, sxcz + cxsz * sy, cx * cy,\r\n );\r\n } else if (axisOrder === AxisOrder.YZX) {\r\n rot.setRowValues(\r\n cy * cz, -sz, sy * cz,\r\n sxsy + cxcy * sz, cx * cz, cxsy * sz - sxcy,\r\n sxcy * sz - cxsy, sx * cz, cxcy + sxsy * sz,\r\n );\r\n } else if (axisOrder === AxisOrder.XZY) {\r\n rot.setRowValues(\r\n cy * cz, sxsy - cxcy * sz, cxsy + sxcy * sz,\r\n sz, cx * cz, -sx * cz,\r\n -sy * cz, sxcy + cxsy * sz, cxcy - sxsy * sz,\r\n );\r\n } else {\r\n rot.setIdentity();\r\n }\r\n // if we need row-based rotation matrix, we transpose the rotation matrix\r\n if (!OrderedRotationAngles.treatVectorsAsColumns)\r\n rot.transposeInPlace();\r\n\r\n return rot;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"OrderedRotationAngles.js","sourceRoot":"","sources":["../../../src/geometry3d/OrderedRotationAngles.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,wFAAwF;AAExF;;;;;;;;;;GAUG;AACH,MAAa,qBAAqB;IAWhC,kBAAkB;IAClB,Y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EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,GAAG,EAAE,GAAG,IAAI,EAC3C,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,CAC5C,CAAC;SACH;aAAM,IAAI,SAAS,KAAK,SAAS,CAAC,GAAG,EAAE;YACtC,GAAG,CAAC,YAAY,CACd,EAAE,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,EAC3C,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,EACrB,CAAC,EAAE,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,CAC7C,CAAC;SACH;aAAM;YACL,GAAG,CAAC,WAAW,EAAE,CAAC;SACnB;QACD,yEAAyE;QACzE,IAAI,CAAC,qBAAqB,CAAC,qBAAqB;YAC9C,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAEzB,OAAO,GAAG,CAAC;IACb,CAAC;;AA9UD,sCAAsC;AACvB,6CAAuB,GAAY,KAAK,CAAC;SAV7C,qBAAqB","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, Geometry } from \"../Geometry\";\nimport { Angle } from \"./Angle\";\nimport { Matrix3d } from \"./Matrix3d\";\n\n/* cspell:word cxcz, cxsz, cxcy, cxsy, sxcz, sxsz, sxcy, sxsy, cycz, cysz, sycz, sysz */\n\n/**\n * Represents a non-trivial rotation using three simple axis rotation angles and an order in which to apply them.\n * * This class accommodates application-specific interpretation of \"multiplying 3 rotation matrices\" with regard to\n * * Whether a \"vector\" is a \"row\" or a \"column\"\n * * The order in which the X,Y,Z rotations are applied.\n * * This class bakes in angle rotation directions via create functions (i.e., createRadians, createDegrees, and\n * createAngles) so you can define each of the 3 rotations to be clockwise or counterclockwise. The default\n * rotation is counterclockwise.\n * * Within the imodel geometry library, the preferred rotation order is encapsulated in `YawPitchRollAngles`.\n * @alpha\n */\nexport class OrderedRotationAngles {\n /** rotation around x */\n private _x: Angle;\n /** rotation around y */\n private _y: Angle;\n /** rotation around z */\n private _z: Angle;\n /** rotation order. For example XYZ means to rotate around x axis first, then y axis, and finally Z axis */\n private _order: AxisOrder;\n /** treat vectors as matrix columns */\n private static _sTreatVectorsAsColumns: boolean = false;\n /** constructor */\n private constructor(x: Angle, y: Angle, z: Angle, axisOrder: AxisOrder) {\n this._x = x;\n this._y = y;\n this._z = z;\n this._order = axisOrder;\n }\n /** (Property accessor) Return the `AxisOrder` controlling matrix multiplication order. */\n public get order(): AxisOrder {\n return this._order;\n }\n /** (Property accessor) Return the strongly typed angle of rotation around x. */\n public get xAngle(): Angle {\n return this._x.clone();\n }\n /** (Property accessor) Return the strongly typed angle of rotation around y. */\n public get yAngle(): Angle {\n return this._y.clone();\n }\n /** (Property accessor) Return the strongly typed angle of rotation around z. */\n public get zAngle(): Angle {\n return this._z.clone();\n }\n /** (Property accessor) Return the angle of rotation around x, in degrees */\n public get xDegrees(): number {\n return this._x.degrees;\n }\n /** (Property accessor) Return the angle of rotation around y, in degrees */\n public get xRadians(): number {\n return this._x.radians;\n }\n /** (Property accessor) Return the angle of rotation around z, in degrees */\n public get yDegrees(): number {\n return this._y.degrees;\n }\n /** (Property accessor) Return the angle of rotation around x, in radians */\n public get yRadians(): number {\n return this._y.radians;\n }\n /** (Property accessor) Return the angle of rotation around y, in radians */\n public get zDegrees(): number {\n return this._z.degrees;\n }\n /** (Property accessor) Return the angle of rotation around z, in radians */\n public get zRadians(): number {\n return this._z.radians;\n }\n /** The flag controlling whether vectors are treated as rows or as columns */\n public static get treatVectorsAsColumns(): boolean {\n return OrderedRotationAngles._sTreatVectorsAsColumns;\n }\n public static set treatVectorsAsColumns(value: boolean) {\n OrderedRotationAngles._sTreatVectorsAsColumns = value;\n }\n /**\n * Create an OrderedRotationAngles from three angles (in radians), an ordering in which to apply them when\n * rotating, and a flag triple controlling whether direction of x,y,z is clockwise or counterclockwise.\n * @param xRadians rotation around x\n * @param yRadians rotation around y\n * @param zRadians rotation around z\n * @param order left to right order of axis names identifies the order that rotations are applied.\n * For example XYZ means to rotate around x axis first, then y axis, and finally Z axis.\n * * Note that rotation order is reverse of rotation matrix multiplication so for XYZ the rotation\n * matrix multiplication would be zRot*yRot*xRot\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeRotationAroundStandardAxes\n * @param xyzRotationIsClockwise the flags controlling whether direction of x,y,z is clockwise or counterclockwise.\n * rotation direction of x,y,z: true ---> clockwise - false ---> counterclockwise.\n * * if xyzRotationIsClockwise is undefined it's set to [false, false, false].\n * @param result caller-allocated OrderedRotationAngles\n */\n public static createRadians(xRadians: number, yRadians: number, zRadians: number, order: AxisOrder,\n xyzRotationIsClockwise?: [boolean, boolean, boolean], result?: OrderedRotationAngles): OrderedRotationAngles {\n if (!xyzRotationIsClockwise) {\n xyzRotationIsClockwise = [false, false, false];\n }\n const xRadian = xyzRotationIsClockwise[0] ? -xRadians : xRadians;\n const yRadian = xyzRotationIsClockwise[1] ? -yRadians : yRadians;\n const zRadian = xyzRotationIsClockwise[2] ? -zRadians : zRadians;\n if (result) {\n result._x.setRadians(xRadian);\n result._y.setRadians(yRadian);\n result._z.setRadians(zRadian);\n result._order = order;\n return result;\n }\n return new OrderedRotationAngles(\n Angle.createRadians(xRadian),\n Angle.createRadians(yRadian),\n Angle.createRadians(zRadian),\n order\n );\n }\n /**\n * Create an OrderedRotationAngles from three angles (in degrees) and an ordering in which to apply\n * them when rotating.\n * @param xDegrees rotation around x\n * @param yDegrees rotation around y\n * @param zDegrees rotation around z\n * @param order left to right order of axis names identifies the order that rotations are applied.\n * For example XYZ means to rotate around x axis first, then y axis, and finally Z axis.\n * * Note that rotation order is reverse of rotation matrix multiplication so for XYZ the rotation\n * matrix multiplication would be zRot*yRot*xRot\n * @param xyzRotationIsClockwise the flags controlling whether direction of x,y,z is clockwise or counterclockwise.\n * rotation direction of x,y,z: true ---> clockwise - false ---> counterclockwise.\n * * if xyzRotationIsClockwise is undefined it's set to [false, false, false].\n * @param result caller-allocated OrderedRotationAngles\n */\n public static createDegrees(xDegrees: number, yDegrees: number, zDegrees: number, order: AxisOrder,\n xyzRotationIsClockwise?: [boolean, boolean, boolean], result?: OrderedRotationAngles): OrderedRotationAngles {\n return OrderedRotationAngles.createRadians(\n Angle.degreesToRadians(xDegrees),\n Angle.degreesToRadians(yDegrees),\n Angle.degreesToRadians(zDegrees),\n order,\n xyzRotationIsClockwise,\n result\n );\n }\n /**\n * Create an OrderedRotationAngles from three angles, an ordering in which to apply them when rotating,\n * and a flag triple controlling whether direction of x,y,z is clockwise or counterclockwise.\n * @param xRotation rotation around x\n * @param yRotation rotation around y\n * @param zRotation rotation around z\n * @param order left to right order of axis names identifies the order that rotations are applied\n * For example XYZ means to rotate around x axis first, then y axis, and finally Z axis.\n * * Note that rotation order is reverse of rotation matrix multiplication so for XYZ the rotation\n * matrix multiplication would be zRot*yRot*xRot\n * @param xyzRotationIsClockwise the flags controlling whether direction of x,y,z is clockwise or counterclockwise.\n * rotation direction of x,y,z: true ---> clockwise - false ---> counterclockwise.\n * * if xyzRotationIsClockwise is undefined it's set to [false, false, false].\n * @param result caller-allocated OrderedRotationAngles\n */\n public static createAngles(xRotation: Angle, yRotation: Angle, zRotation: Angle, order: AxisOrder,\n xyzRotationIsClockwise?: [boolean, boolean, boolean], result?: OrderedRotationAngles): OrderedRotationAngles {\n return OrderedRotationAngles.createRadians(\n xRotation.radians,\n yRotation.radians,\n zRotation.radians,\n order,\n xyzRotationIsClockwise,\n result\n );\n }\n /**\n * Create an OrderedRotationAngles from a 3x3 rotational matrix, given the ordering of axis rotations\n * that the matrix derives from.\n * * This function creates an OrderedRotationAngles with default angle rotation directions, i.e.,\n * it assumes all x, y, and z rotations are counterclockwise.\n * * In the failure case the method's return value is `undefined`.\n * * In the failure case, if the optional result was supplied, that result will nonetheless be filled with\n * a set of angles.\n */\n public static createFromMatrix3d(matrix: Matrix3d, order: AxisOrder, result?: OrderedRotationAngles):\n OrderedRotationAngles | undefined {\n // treat vector as columns\n let m11 = matrix.coffs[0], m12 = matrix.coffs[1], m13 = matrix.coffs[2];\n let m21 = matrix.coffs[3], m22 = matrix.coffs[4], m23 = matrix.coffs[5];\n let m31 = matrix.coffs[6], m32 = matrix.coffs[7], m33 = matrix.coffs[8];\n // treat vector as rows\n if (!OrderedRotationAngles.treatVectorsAsColumns) {\n m11 = matrix.coffs[0], m12 = matrix.coffs[3], m13 = matrix.coffs[6];\n m21 = matrix.coffs[1], m22 = matrix.coffs[4], m23 = matrix.coffs[7];\n m31 = matrix.coffs[2], m32 = matrix.coffs[5], m33 = matrix.coffs[8];\n }\n\n let xRad: number;\n let yRad: number;\n let zRad: number;\n\n switch (order) {\n case AxisOrder.XYZ: {\n yRad = Math.asin(Math.max(-1, Math.min(1, -m31))); // limit asin domain to [-1,1]\n\n if (Math.abs(m31) < 0.99999) {\n xRad = Math.atan2(m32, m33);\n zRad = Math.atan2(m21, m11);\n } else {\n /**\n * If Math.abs(m31) = 1 then yRad = +-90 degrees and therefore, we have a gimbal lock.\n * This means xRad and zRad can be anything as long as their sum xRad + zRad is constant.\n * so we can pick zRad = 0 and calculate xRad (or pick xRad = 0 and calculate zRad).\n * Therefore, rotation matrix becomes\n * Matrix3d.createRowValues(\n * 0, +-sx, +-cx,\n * 0, cx, -sx,\n * -+1, 0, 0\n * );\n * Math details can be found\n * https://en.wikipedia.org/wiki/Gimbal_lock#Loss_of_a_degree_of_freedom_with_Euler_angles\n */\n xRad = Math.atan2(-m23, m22);\n zRad = 0;\n }\n break;\n } case AxisOrder.YXZ: {\n xRad = Math.asin(Math.max(-1, Math.min(1, m32))); // limit asin domain to [-1,1]\n\n if (Math.abs(m32) < 0.99999) {\n yRad = Math.atan2(-m31, m33);\n zRad = Math.atan2(-m12, m22);\n } else {\n yRad = Math.atan2(m13, m11);\n zRad = 0;\n }\n break;\n } case AxisOrder.ZXY: {\n xRad = Math.asin(Math.max(-1, Math.min(1, -m23))); // limit asin domain to [-1,1]\n\n if (Math.abs(m23) < 0.99999) {\n yRad = Math.atan2(m13, m33);\n zRad = Math.atan2(m21, m22);\n } else {\n yRad = 0;\n zRad = Math.atan2(-m12, m11);\n }\n break;\n } case AxisOrder.ZYX: {\n yRad = Math.asin(Math.max(-1, Math.min(1, m13))); // limit asin domain to [-1,1]\n\n if (Math.abs(m13) < 0.99999) {\n xRad = Math.atan2(-m23, m33);\n zRad = Math.atan2(-m12, m11);\n } else {\n xRad = 0;\n zRad = Math.atan2(m21, m22);\n }\n break;\n } case AxisOrder.YZX: {\n zRad = Math.asin(Math.max(-1, Math.min(1, -m12))); // limit asin domain to [-1,1]\n\n if (Math.abs(m12) < 0.99999) {\n xRad = Math.atan2(m32, m22);\n yRad = Math.atan2(m13, m11);\n } else {\n xRad = 0;\n yRad = Math.atan2(-m31, m33);\n }\n break;\n } case AxisOrder.XZY: {\n zRad = Math.asin(Math.max(-1, Math.min(1, m21))); // limit asin domain to [-1,1]\n\n if (Math.abs(m21) < 0.99999) {\n xRad = Math.atan2(-m23, m22);\n yRad = Math.atan2(-m31, m11);\n } else {\n xRad = Math.atan2(m32, m33);\n yRad = 0;\n }\n break;\n } default: {\n xRad = yRad = zRad = 0;\n }\n }\n const xyzRotationIsClockwise: [boolean, boolean, boolean] = [false, false, false];\n const angles = OrderedRotationAngles.createRadians(xRad, yRad, zRad, order, xyzRotationIsClockwise, result);\n // sanity check\n const matrix1 = angles.toMatrix3d();\n /**\n * Below tolerance loosened to allow sanity check to pass for\n *\n * OrderedRotationAngles.createFromMatrix3d(\n * OrderedRotationAngles.createDegrees(0, 89.999, 0.001, AxisOrder.XYZ).toMatrix3d(),\n * AxisOrder.XYZ\n * );\n *\n * with treatVectorsAsColumns = true.\n */\n return (matrix.maxDiff(matrix1) < 10 * Geometry.smallFraction) ? angles : undefined;\n }\n /**\n * Create a 3x3 rotational matrix from this OrderedRotationAngles.\n ** math details can be found at docs/learning/geometry/Angle.md\n **/\n public toMatrix3d(result?: Matrix3d): Matrix3d {\n const rot = (result !== undefined) ? result : new Matrix3d();\n const axisOrder = this.order;\n const x = this.xAngle, y = this.yAngle, z = this.zAngle;\n\n const cx = x.cos(), sx = x.sin();\n const cy = y.cos(), sy = y.sin();\n const cz = z.cos(), sz = z.sin();\n\n const cxcz = cx * cz, cxsz = cx * sz, cxcy = cx * cy, cxsy = cx * sy;\n const sxcz = sx * cz, sxsz = sx * sz, sxcy = sx * cy, sxsy = sx * sy;\n const cycz = cy * cz, cysz = cy * sz, sycz = sy * cz, sysz = sy * sz;\n\n // the rotation matrix we build below is created using column-based base rotation matrixes\n if (axisOrder === AxisOrder.XYZ) {\n rot.setRowValues(\n cy * cz, sxcz * sy - cxsz, cxcz * sy + sxsz,\n cy * sz, cxcz + sxsz * sy, cxsz * sy - sxcz,\n -sy, sx * cy, cx * cy,\n );\n } else if (axisOrder === AxisOrder.YXZ) {\n rot.setRowValues(\n cycz - sysz * sx, -cx * sz, cysz * sx + sycz,\n sycz * sx + cysz, cx * cz, sysz - cycz * sx,\n -cx * sy, sx, cx * cy,\n );\n } else if (axisOrder === AxisOrder.ZXY) {\n rot.setRowValues(\n cycz + sysz * sx, sycz * sx - cysz, cx * sy,\n cx * sz, cx * cz, -sx,\n cysz * sx - sycz, cycz * sx + sysz, cx * cy,\n );\n } else if (axisOrder === AxisOrder.ZYX) {\n rot.setRowValues(\n cy * cz, -cy * sz, sy,\n sxcz * sy + cxsz, cxcz - sxsz * sy, -sx * cy,\n sxsz - cxcz * sy, sxcz + cxsz * sy, cx * cy,\n );\n } else if (axisOrder === AxisOrder.YZX) {\n rot.setRowValues(\n cy * cz, -sz, sy * cz,\n sxsy + cxcy * sz, cx * cz, cxsy * sz - sxcy,\n sxcy * sz - cxsy, sx * cz, cxcy + sxsy * sz,\n );\n } else if (axisOrder === AxisOrder.XZY) {\n rot.setRowValues(\n cy * cz, sxsy - cxcy * sz, cxsy + sxcy * sz,\n sz, cx * cz, -sx * cz,\n -sy * cz, sxcy + cxsy * sz, cxcy - sxsy * sz,\n );\n } else {\n rot.setIdentity();\n }\n // if we need row-based rotation matrix, we transpose the rotation matrix\n if (!OrderedRotationAngles.treatVectorsAsColumns)\n rot.transposeInPlace();\n\n return rot;\n }\n}\n"]}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module CartesianGeometry
|
|
3
|
+
*/
|
|
4
|
+
import { PlaneAltitudeEvaluator } from "../Geometry";
|
|
5
|
+
import { Point4d } from "../geometry4d/Point4d";
|
|
6
|
+
import { Point3d, Vector3d } from "./Point3dVector3d";
|
|
7
|
+
/**
|
|
8
|
+
* Plane3d is the abstract base class for multiple 3d plane representations:
|
|
9
|
+
* * [[Plane3dByOriginAndUnitNormal]] -- plane defined by origin and normal, with no preferred in-plane directions
|
|
10
|
+
* * [[Plane3dByOriginAndVectors]] -- plane defined by origin and 2 vectors in the plane, with normal implied by the vectors' cross product
|
|
11
|
+
* * [[Point4d]] -- homogeneous form of xyzw plane.
|
|
12
|
+
* * [[ClipPlane]] -- implicit plane with additional markup as used by compound clip structures such as [[ConvexClipPlaneSet]] and [[UnionOfConvexClipPlaneSets]]
|
|
13
|
+
*
|
|
14
|
+
* As an abstract base class, Plane3d demands that its derived classes implement queries to answer questions
|
|
15
|
+
* about the plane's normal and the altitude of points above or below the plane. (Altitude is measured perpendicular to the plane.)
|
|
16
|
+
* These abstract methods are:
|
|
17
|
+
* * altitude(Point3d), altitudeXYZ(x,y,z), and altitudeXYZW(Point4d) -- evaluate altitude
|
|
18
|
+
* * normalX(), normalY(), normalZ() -- return components of the plane's normal vector.
|
|
19
|
+
* * velocity(Vector3d), velocityXYZ(x,y,z) -- return dot product of the input vector with the plane normal.
|
|
20
|
+
* * projectPointToPlane (spacePoint: Point3d) -- return projection of spacePoint into the plane.
|
|
21
|
+
*
|
|
22
|
+
* The Plane3d base class also provides implementations of several queries which it can implement by calling the abstract queries.
|
|
23
|
+
* * Derived classes may choose to override these default implementations using private knowledge of what they have stored.
|
|
24
|
+
* * isPointInPlane(spacePoint, tolerance?) -- test if spacePoint is in the plane with tolerance. Default tolerance is small metric distance
|
|
25
|
+
* * classifyAltitude (spacePoint, tolerance?), classifyAltitudeXYZ (x,y,z,tolerance?) -- return -1,0,1 indicating if spacePoint's altitude
|
|
26
|
+
* is negative, near zero, or positive.
|
|
27
|
+
*
|
|
28
|
+
* Notes about scaling and signs in methods that compute altitudes, normal components and velocities:
|
|
29
|
+
* * The term "altitude" indicates a _signed_ distance from the plane.
|
|
30
|
+
* * altitude zero is _on_ the plane
|
|
31
|
+
* * positive altitudes are on one side
|
|
32
|
+
* * negatives are on the other.
|
|
33
|
+
* * 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
|
|
34
|
+
* understands that it can be OK for its plane implementation to have that scaling.
|
|
35
|
+
* * By convention, derived classes whose definitions (normals and vectors in plane) are simple cartesian are expected
|
|
36
|
+
* to return true distances. This applies to:
|
|
37
|
+
* * [[Plane3dByOriginAndUnitNormal]] and [[ClipPlane]]
|
|
38
|
+
* * These maintain a stored unit normal so the altitude calculations are inherently true cartesian distance.
|
|
39
|
+
* * [[Plane3dByOriginAndVectors]] -- this is a bit expensive because
|
|
40
|
+
* * the normal is the cross product of the defining vectors.
|
|
41
|
+
* * that cross product is not typically unit
|
|
42
|
+
* * normalization adds to the cost of computing off-plane distances
|
|
43
|
+
* * 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.
|
|
44
|
+
* * "4 dimensional" (homogeneous coordinate planes) ([[Point4d]] and [[PlaneByOriginAndVectors4d]])
|
|
45
|
+
* * typically do _not_ force their coefficients to any distance-based normalization
|
|
46
|
+
* * are typically used for calculations in spaces with skewing effects do to perspective, and true distances are not required.
|
|
47
|
+
* * In all classes, the `weightedAltitude` method is free to be scaled distance.
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
export declare abstract class Plane3d implements PlaneAltitudeEvaluator {
|
|
51
|
+
/** Return the altitude of spacePoint above or below the plane. (Below is negative)
|
|
52
|
+
* * MUST BE IMPLEMENTED BY DERIVED CLASSES
|
|
53
|
+
*/
|
|
54
|
+
abstract altitude(spacePoint: Point3d): number;
|
|
55
|
+
/** Returns true if spacePoint is within distance tolerance of the plane. */
|
|
56
|
+
isPointInPlane(spacePoint: Point3d, tolerance?: number): boolean;
|
|
57
|
+
/** return a value -1, 0, 1 giving a signed indicator of whether the toleranced altitude of the point is
|
|
58
|
+
* negative, near zero, or positive.
|
|
59
|
+
*
|
|
60
|
+
*/
|
|
61
|
+
classifyAltitude(point: Point3d, tolerance?: number): -1 | 0 | 1;
|
|
62
|
+
/** return a value -1, 0, 1 giving a signed indicator of whether the toleranced altitude of x,y,z is
|
|
63
|
+
* negative, near zero, or positive.
|
|
64
|
+
*
|
|
65
|
+
*/
|
|
66
|
+
classifyAltitudeXYZ(x: number, y: number, z: number, tolerance?: number): -1 | 0 | 1;
|
|
67
|
+
/**
|
|
68
|
+
* Return the x component of the normal used to evaluate altitude.
|
|
69
|
+
* * MUST BE IMPLEMENTED BY DERIVED CLASSES
|
|
70
|
+
* * See [[Plane3d]] note about scaling.
|
|
71
|
+
*/
|
|
72
|
+
abstract normalX(): number;
|
|
73
|
+
/**
|
|
74
|
+
* Return the y component of the normal used to evaluate altitude.
|
|
75
|
+
* * MUST BE IMPLEMENTED BY DERIVED CLASSES
|
|
76
|
+
* * See [[Plane3d]] note about scaling.
|
|
77
|
+
*/
|
|
78
|
+
abstract normalY(): number;
|
|
79
|
+
/**
|
|
80
|
+
* Return the z component of the normal used to evaluate altitude.
|
|
81
|
+
* * MUST BE IMPLEMENTED BY DERIVED CLASSES
|
|
82
|
+
* * See [[Plane3d]] note about scaling.
|
|
83
|
+
*/
|
|
84
|
+
abstract normalZ(): number;
|
|
85
|
+
/**
|
|
86
|
+
* Return the unit normal for the plane.
|
|
87
|
+
* * The abstract base class implementation assembles the normal from normalX, normalY, normalZ calls.
|
|
88
|
+
* * Derived classes should (but are not required to) override for maximum efficiency if the separate normal calls cause repeated normalization.
|
|
89
|
+
* @param result
|
|
90
|
+
*/
|
|
91
|
+
getUnitNormal(result?: Vector3d): Vector3d | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* Return any point on the plane.
|
|
94
|
+
* * Default implementation projects the origin (0,0,0) to the plane.
|
|
95
|
+
* * Classes that have a preferred origin for their plane should override.
|
|
96
|
+
* * Classes with a purely implicit equation of their plane can accept the default implementation
|
|
97
|
+
* */
|
|
98
|
+
getAnyPointOnPlane(result?: Point3d): Point3d;
|
|
99
|
+
/** Return the altitude of weighted spacePoint above or below the plane. (Below is negative)
|
|
100
|
+
* * MUST BE IMPLEMENTED BY DERIVED CLASSES
|
|
101
|
+
* * See [[Plane3d]] note about scaling.
|
|
102
|
+
*/
|
|
103
|
+
abstract weightedAltitude(spacePoint: Point4d): number;
|
|
104
|
+
/** Return the dot product of spaceVector (x,y,z) with the plane's unit normal. This tells the rate of change of altitude
|
|
105
|
+
* for a point moving at speed one along the spaceVector.
|
|
106
|
+
* * MUST BE IMPLEMENTED BY DERIVED CLASSES
|
|
107
|
+
* * See [[Plane3d]] note about scaling.
|
|
108
|
+
*/
|
|
109
|
+
abstract velocityXYZ(x: number, y: number, z: number): number;
|
|
110
|
+
/** Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude
|
|
111
|
+
* for a point moving at speed one along the spaceVector.
|
|
112
|
+
* * MUST BE IMPLEMENTED BY DERIVED CLASSES
|
|
113
|
+
* * See [[Plane3d]] note about scaling.
|
|
114
|
+
*/
|
|
115
|
+
abstract velocity(spaceVector: Vector3d): number;
|
|
116
|
+
/** Return the altitude of a point given as separate x,y,z components.
|
|
117
|
+
* * MUST BE IMPLEMENTED BY DERIVED CLASSES
|
|
118
|
+
* * See [[Plane3d]] note about scaling.
|
|
119
|
+
*/
|
|
120
|
+
abstract altitudeXYZ(x: number, y: number, z: number): number;
|
|
121
|
+
/** Return the projection of spacePoint onto the plane.
|
|
122
|
+
* * MUST BE IMPLEMENTED BY DERIVED CLASSES
|
|
123
|
+
*/
|
|
124
|
+
abstract projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d;
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=Plane3d.d.ts.map
|
|
@@ -0,0 +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;;MAEE;aACc,QAAQ,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM;IAErD,4EAA4E;IACrE,cAAc,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAE,MAAqC,GAAG,OAAO;IAGrG;;;MAGE;IACK,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,GAAE,MAAqC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAGrG;;;MAGE;IACK,mBAAmB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,GAAE,MAAqC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAGzH;;;;QAII;aACY,OAAO,IAAI,MAAM;IACjC;;;;OAIG;aACa,OAAO,IAAI,MAAM;IACjC;;;;OAIG;aACa,OAAO,IAAI,MAAM;IACjC;;;;;OAKG;IACI,aAAa,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS;IAG7D;;;;;SAKK;IACE,kBAAkB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAGpD;;;MAGE;aACc,gBAAgB,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM;IAE7D;;;;OAIG;aACa,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IACpE;;;;OAIG;aACa,QAAQ,CAAC,WAAW,EAAE,QAAQ,GAAG,MAAM;IACvD;;;MAGE;aACc,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAEpE;;MAEE;aACc,mBAAmB,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;CACpF"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module CartesianGeometry
|
|
7
|
+
*/
|
|
8
|
+
import { Geometry } from "../Geometry";
|
|
9
|
+
import { Point3d, Vector3d } from "./Point3dVector3d";
|
|
10
|
+
/**
|
|
11
|
+
* Plane3d is the abstract base class for multiple 3d plane representations:
|
|
12
|
+
* * [[Plane3dByOriginAndUnitNormal]] -- plane defined by origin and normal, with no preferred in-plane directions
|
|
13
|
+
* * [[Plane3dByOriginAndVectors]] -- plane defined by origin and 2 vectors in the plane, with normal implied by the vectors' cross product
|
|
14
|
+
* * [[Point4d]] -- homogeneous form of xyzw plane.
|
|
15
|
+
* * [[ClipPlane]] -- implicit plane with additional markup as used by compound clip structures such as [[ConvexClipPlaneSet]] and [[UnionOfConvexClipPlaneSets]]
|
|
16
|
+
*
|
|
17
|
+
* As an abstract base class, Plane3d demands that its derived classes implement queries to answer questions
|
|
18
|
+
* about the plane's normal and the altitude of points above or below the plane. (Altitude is measured perpendicular to the plane.)
|
|
19
|
+
* These abstract methods are:
|
|
20
|
+
* * altitude(Point3d), altitudeXYZ(x,y,z), and altitudeXYZW(Point4d) -- evaluate altitude
|
|
21
|
+
* * normalX(), normalY(), normalZ() -- return components of the plane's normal vector.
|
|
22
|
+
* * velocity(Vector3d), velocityXYZ(x,y,z) -- return dot product of the input vector with the plane normal.
|
|
23
|
+
* * projectPointToPlane (spacePoint: Point3d) -- return projection of spacePoint into the plane.
|
|
24
|
+
*
|
|
25
|
+
* The Plane3d base class also provides implementations of several queries which it can implement by calling the abstract queries.
|
|
26
|
+
* * Derived classes may choose to override these default implementations using private knowledge of what they have stored.
|
|
27
|
+
* * isPointInPlane(spacePoint, tolerance?) -- test if spacePoint is in the plane with tolerance. Default tolerance is small metric distance
|
|
28
|
+
* * classifyAltitude (spacePoint, tolerance?), classifyAltitudeXYZ (x,y,z,tolerance?) -- return -1,0,1 indicating if spacePoint's altitude
|
|
29
|
+
* is negative, near zero, or positive.
|
|
30
|
+
*
|
|
31
|
+
* Notes about scaling and signs in methods that compute altitudes, normal components and velocities:
|
|
32
|
+
* * The term "altitude" indicates a _signed_ distance from the plane.
|
|
33
|
+
* * altitude zero is _on_ the plane
|
|
34
|
+
* * positive altitudes are on one side
|
|
35
|
+
* * negatives are on the other.
|
|
36
|
+
* * 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
|
|
37
|
+
* understands that it can be OK for its plane implementation to have that scaling.
|
|
38
|
+
* * By convention, derived classes whose definitions (normals and vectors in plane) are simple cartesian are expected
|
|
39
|
+
* to return true distances. This applies to:
|
|
40
|
+
* * [[Plane3dByOriginAndUnitNormal]] and [[ClipPlane]]
|
|
41
|
+
* * These maintain a stored unit normal so the altitude calculations are inherently true cartesian distance.
|
|
42
|
+
* * [[Plane3dByOriginAndVectors]] -- this is a bit expensive because
|
|
43
|
+
* * the normal is the cross product of the defining vectors.
|
|
44
|
+
* * that cross product is not typically unit
|
|
45
|
+
* * normalization adds to the cost of computing off-plane distances
|
|
46
|
+
* * 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.
|
|
47
|
+
* * "4 dimensional" (homogeneous coordinate planes) ([[Point4d]] and [[PlaneByOriginAndVectors4d]])
|
|
48
|
+
* * typically do _not_ force their coefficients to any distance-based normalization
|
|
49
|
+
* * are typically used for calculations in spaces with skewing effects do to perspective, and true distances are not required.
|
|
50
|
+
* * In all classes, the `weightedAltitude` method is free to be scaled distance.
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
export class Plane3d {
|
|
54
|
+
/** Returns true if spacePoint is within distance tolerance of the plane. */
|
|
55
|
+
isPointInPlane(spacePoint, tolerance = Geometry.smallMetricDistance) {
|
|
56
|
+
return Math.abs(this.altitude(spacePoint)) <= tolerance;
|
|
57
|
+
}
|
|
58
|
+
/** return a value -1, 0, 1 giving a signed indicator of whether the toleranced altitude of the point is
|
|
59
|
+
* negative, near zero, or positive.
|
|
60
|
+
*
|
|
61
|
+
*/
|
|
62
|
+
classifyAltitude(point, tolerance = Geometry.smallMetricDistance) {
|
|
63
|
+
return Geometry.split3Way01(this.altitude(point), tolerance);
|
|
64
|
+
}
|
|
65
|
+
/** return a value -1, 0, 1 giving a signed indicator of whether the toleranced altitude of x,y,z is
|
|
66
|
+
* negative, near zero, or positive.
|
|
67
|
+
*
|
|
68
|
+
*/
|
|
69
|
+
classifyAltitudeXYZ(x, y, z, tolerance = Geometry.smallMetricDistance) {
|
|
70
|
+
return Geometry.split3Way01(this.altitudeXYZ(x, y, z), tolerance);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Return the unit normal for the plane.
|
|
74
|
+
* * The abstract base class implementation assembles the normal from normalX, normalY, normalZ calls.
|
|
75
|
+
* * Derived classes should (but are not required to) override for maximum efficiency if the separate normal calls cause repeated normalization.
|
|
76
|
+
* @param result
|
|
77
|
+
*/
|
|
78
|
+
getUnitNormal(result) {
|
|
79
|
+
return Vector3d.createNormalized(this.normalX(), this.normalY(), this.normalZ(), result);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Return any point on the plane.
|
|
83
|
+
* * Default implementation projects the origin (0,0,0) to the plane.
|
|
84
|
+
* * Classes that have a preferred origin for their plane should override.
|
|
85
|
+
* * Classes with a purely implicit equation of their plane can accept the default implementation
|
|
86
|
+
* */
|
|
87
|
+
getAnyPointOnPlane(result) {
|
|
88
|
+
return this.projectPointToPlane(Point3d.create(0, 0, 0), result);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=Plane3d.js.map
|
|
@@ -0,0 +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;;;MAGE;IACK,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;;;MAGE;IACK,mBAAmB,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,YAAoB,QAAQ,CAAC,mBAAmB;QAC1G,OAAO,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IACpE,CAAC;IAmBD;;;;;OAKG;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;;;;;SAKK;IACE,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;CA6BF","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 /** 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\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 /** 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 /** 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(x: number, y: number, z: number, tolerance: number = Geometry.smallMetricDistance): -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 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 /** 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 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 velocityXYZ(x: number, y: number, z: number): number;\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 /** 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,7 +1,8 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module CartesianGeometry
|
|
3
3
|
*/
|
|
4
|
-
import { BeJSONFunctions
|
|
4
|
+
import { BeJSONFunctions } from "../Geometry";
|
|
5
|
+
import { Plane3d } from "./Plane3d";
|
|
5
6
|
import { Point4d } from "../geometry4d/Point4d";
|
|
6
7
|
import { Angle } from "./Angle";
|
|
7
8
|
import { Point3d, Vector3d } from "./Point3dVector3d";
|
|
@@ -13,7 +14,7 @@ import { XAndY } from "./XYZProps";
|
|
|
13
14
|
* * a unit normal.
|
|
14
15
|
* @public
|
|
15
16
|
*/
|
|
16
|
-
export declare class Plane3dByOriginAndUnitNormal implements BeJSONFunctions
|
|
17
|
+
export declare class Plane3dByOriginAndUnitNormal extends Plane3d implements BeJSONFunctions {
|
|
17
18
|
private _origin;
|
|
18
19
|
private _normal;
|
|
19
20
|
private constructor();
|
|
@@ -38,6 +39,11 @@ export declare class Plane3dByOriginAndUnitNormal implements BeJSONFunctions, Pl
|
|
|
38
39
|
* * Returns undefined if the normal vector is all zeros.
|
|
39
40
|
*/
|
|
40
41
|
static create(origin: Point3d, normal: Vector3d, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined;
|
|
42
|
+
/** create a new Plane3dByOriginAndUnitNormal from a variety of plane types.
|
|
43
|
+
* * The inputs are NOT captured.
|
|
44
|
+
* * Returns undefined if the normal vector is all zeros.
|
|
45
|
+
*/
|
|
46
|
+
static createFrom(source: Plane3d, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined;
|
|
41
47
|
/** create a new Plane3dByOriginAndUnitNormal with direct coordinates of origin and normal.
|
|
42
48
|
* * Returns undefined if the normal vector is all zeros.
|
|
43
49
|
* * If unable to normalize return undefined. (And if result is given it is left unchanged)
|
|
@@ -59,6 +65,18 @@ export declare class Plane3dByOriginAndUnitNormal implements BeJSONFunctions, Pl
|
|
|
59
65
|
* @param vector any vector in the plane but not parallel to the vector from pointA to pointB
|
|
60
66
|
*/
|
|
61
67
|
static createPointPointVectorInPlane(pointA: Point3d, pointB: Point3d, vector: Vector3d): Plane3dByOriginAndUnitNormal | undefined;
|
|
68
|
+
/** Create a plane defined by three points.
|
|
69
|
+
* @param pointA any point in the plane. This will be the origin.
|
|
70
|
+
* @param pointB any other point in the plane
|
|
71
|
+
* @param pointC any third point in the plane but not on the line of pointA and pointB
|
|
72
|
+
*/
|
|
73
|
+
static createOriginAndTargets(pointA: Point3d, pointB: Point3d, pointC: Point3d): Plane3dByOriginAndUnitNormal | undefined;
|
|
74
|
+
/** Create a plane defined by a point and two vectors in the plane
|
|
75
|
+
* @param pointA any point in the plane
|
|
76
|
+
* @param vectorB any vector in the plane
|
|
77
|
+
* @param vectorC any vector in the plane but not parallel to vectorB
|
|
78
|
+
*/
|
|
79
|
+
static createOriginAndVectors(pointA: Point3d, vectorB: Vector3d, vectorC: Vector3d): Plane3dByOriginAndUnitNormal | undefined;
|
|
62
80
|
/** test for (toleranced) equality with `other` */
|
|
63
81
|
isAlmostEqual(other: Plane3dByOriginAndUnitNormal): boolean;
|
|
64
82
|
/** Parse a json fragment `{origin: [x,y,z], normal: [ux,uy,uz]}` */
|
|
@@ -109,9 +127,17 @@ export declare class Plane3dByOriginAndUnitNormal implements BeJSONFunctions, Pl
|
|
|
109
127
|
* Return the z component of the normal used to evaluate altitude.
|
|
110
128
|
*/
|
|
111
129
|
normalZ(): number;
|
|
112
|
-
/**
|
|
130
|
+
/**
|
|
131
|
+
* Return (a clone of) the unit normal.
|
|
132
|
+
*/
|
|
133
|
+
getUnitNormal(result?: Vector3d): Vector3d | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* Return (a clone of) the origin.
|
|
136
|
+
*/
|
|
137
|
+
getAnyPointOnPlane(result?: Point3d): Point3d;
|
|
138
|
+
/** Return the signed altitude of weighted spacePoint above or below the plane. (Below is negative) */
|
|
113
139
|
weightedAltitude(spacePoint: Point4d): number;
|
|
114
|
-
/** return
|
|
140
|
+
/** return any point at specified (signed) altitude. */
|
|
115
141
|
altitudeToPoint(altitude: number, result?: Point3d): Point3d;
|
|
116
142
|
/** Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude
|
|
117
143
|
* for a point moving at speed one along the spaceVector.
|
|
@@ -127,7 +153,9 @@ export declare class Plane3dByOriginAndUnitNormal implements BeJSONFunctions, Pl
|
|
|
127
153
|
altitudeXYZW(x: number, y: number, z: number, w: number): number;
|
|
128
154
|
/** Return the projection of spacePoint onto the plane. */
|
|
129
155
|
projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d;
|
|
130
|
-
/** Returns true
|
|
131
|
-
|
|
156
|
+
/** Returns true if spacePoint is within distance tolerance of the plane.
|
|
157
|
+
* * This logic is identical to the [[Plane3d]] method but avoids a level of function call.
|
|
158
|
+
*/
|
|
159
|
+
isPointInPlane(spacePoint: Point3d, tolerance?: number): boolean;
|
|
132
160
|
}
|
|
133
161
|
//# sourceMappingURL=Plane3dByOriginAndUnitNormal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plane3dByOriginAndUnitNormal.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndUnitNormal.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAa,eAAe,EAAY,
|
|
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,CAA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AM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS;IAGtE;;OAEG;IACa,kBAAkB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAG7D,uGAAuG;IAChG,gBAAgB,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM;IAIpD,uDAAuD;IAChD,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAGnE;;OAEG;IACI,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAC3D;;OAEG;IACI,QAAQ,CAAC,WAAW,EAAE,QAAQ,GAAG,MAAM;IAC9C,yEAAyE;IAClE,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAG3D,2EAA2E;IACpE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAGvE,0DAA0D;IACnD,mBAAmB,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAG1E;;MAEE;IACc,cAAc,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAE,MAAqC,GAAG,OAAO;CAI/G"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* @module CartesianGeometry
|
|
7
7
|
*/
|
|
8
8
|
import { AxisOrder, Geometry } from "../Geometry";
|
|
9
|
+
import { Plane3d } from "./Plane3d";
|
|
9
10
|
import { Matrix3d } from "./Matrix3d";
|
|
10
11
|
import { Point3d, Vector3d } from "./Point3dVector3d";
|
|
11
12
|
import { Transform } from "./Transform";
|
|
@@ -15,9 +16,10 @@ import { Transform } from "./Transform";
|
|
|
15
16
|
* * a unit normal.
|
|
16
17
|
* @public
|
|
17
18
|
*/
|
|
18
|
-
export class Plane3dByOriginAndUnitNormal {
|
|
19
|
+
export class Plane3dByOriginAndUnitNormal extends Plane3d {
|
|
19
20
|
// constructor captures references !!!
|
|
20
21
|
constructor(origin, normal) {
|
|
22
|
+
super();
|
|
21
23
|
this._origin = origin;
|
|
22
24
|
this._normal = normal;
|
|
23
25
|
}
|
|
@@ -66,6 +68,19 @@ export class Plane3dByOriginAndUnitNormal {
|
|
|
66
68
|
}
|
|
67
69
|
return new Plane3dByOriginAndUnitNormal(origin.clone(), normalized);
|
|
68
70
|
}
|
|
71
|
+
/** create a new Plane3dByOriginAndUnitNormal from a variety of plane types.
|
|
72
|
+
* * The inputs are NOT captured.
|
|
73
|
+
* * Returns undefined if the normal vector is all zeros.
|
|
74
|
+
*/
|
|
75
|
+
static createFrom(source, result) {
|
|
76
|
+
if (source instanceof Plane3dByOriginAndUnitNormal)
|
|
77
|
+
return source.clone(result);
|
|
78
|
+
const normal = source.getUnitNormal();
|
|
79
|
+
if (normal === undefined)
|
|
80
|
+
return undefined;
|
|
81
|
+
const origin = source.getAnyPointOnPlane();
|
|
82
|
+
return this.create(origin, normal, result);
|
|
83
|
+
}
|
|
69
84
|
/** create a new Plane3dByOriginAndUnitNormal with direct coordinates of origin and normal.
|
|
70
85
|
* * Returns undefined if the normal vector is all zeros.
|
|
71
86
|
* * If unable to normalize return undefined. (And if result is given it is left unchanged)
|
|
@@ -113,6 +128,28 @@ export class Plane3dByOriginAndUnitNormal {
|
|
|
113
128
|
return new Plane3dByOriginAndUnitNormal(pointA, cross);
|
|
114
129
|
return undefined;
|
|
115
130
|
}
|
|
131
|
+
/** Create a plane defined by three points.
|
|
132
|
+
* @param pointA any point in the plane. This will be the origin.
|
|
133
|
+
* @param pointB any other point in the plane
|
|
134
|
+
* @param pointC any third point in the plane but not on the line of pointA and pointB
|
|
135
|
+
*/
|
|
136
|
+
static createOriginAndTargets(pointA, pointB, pointC) {
|
|
137
|
+
const cross = pointA.crossProductToPoints(pointB, pointC);
|
|
138
|
+
if (cross.tryNormalizeInPlace())
|
|
139
|
+
return new Plane3dByOriginAndUnitNormal(pointA, cross);
|
|
140
|
+
return undefined;
|
|
141
|
+
}
|
|
142
|
+
/** Create a plane defined by a point and two vectors in the plane
|
|
143
|
+
* @param pointA any point in the plane
|
|
144
|
+
* @param vectorB any vector in the plane
|
|
145
|
+
* @param vectorC any vector in the plane but not parallel to vectorB
|
|
146
|
+
*/
|
|
147
|
+
static createOriginAndVectors(pointA, vectorB, vectorC) {
|
|
148
|
+
const cross = vectorB.crossProduct(vectorC);
|
|
149
|
+
if (cross.tryNormalizeInPlace())
|
|
150
|
+
return new Plane3dByOriginAndUnitNormal(pointA, cross);
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
116
153
|
/** test for (toleranced) equality with `other` */
|
|
117
154
|
isAlmostEqual(other) {
|
|
118
155
|
return this._origin.isAlmostEqual(other._origin) && this._normal.isAlmostEqual(other._normal);
|
|
@@ -214,11 +251,23 @@ export class Plane3dByOriginAndUnitNormal {
|
|
|
214
251
|
* Return the z component of the normal used to evaluate altitude.
|
|
215
252
|
*/
|
|
216
253
|
normalZ() { return this._normal.z; }
|
|
217
|
-
/**
|
|
254
|
+
/**
|
|
255
|
+
* Return (a clone of) the unit normal.
|
|
256
|
+
*/
|
|
257
|
+
getUnitNormal(result) {
|
|
258
|
+
return this._normal.clone(result);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Return (a clone of) the origin.
|
|
262
|
+
*/
|
|
263
|
+
getAnyPointOnPlane(result) {
|
|
264
|
+
return this._origin.clone(result);
|
|
265
|
+
}
|
|
266
|
+
/** Return the signed altitude of weighted spacePoint above or below the plane. (Below is negative) */
|
|
218
267
|
weightedAltitude(spacePoint) {
|
|
219
268
|
return this._normal.dotProductStart3dEnd4d(this._origin, spacePoint);
|
|
220
269
|
}
|
|
221
|
-
/** return
|
|
270
|
+
/** return any point at specified (signed) altitude. */
|
|
222
271
|
altitudeToPoint(altitude, result) {
|
|
223
272
|
return this._origin.plusScaled(this._normal, altitude, result);
|
|
224
273
|
}
|
|
@@ -242,7 +291,12 @@ export class Plane3dByOriginAndUnitNormal {
|
|
|
242
291
|
projectPointToPlane(spacePoint, result) {
|
|
243
292
|
return spacePoint.plusScaled(this._normal, -this._normal.dotProductStartEnd(this._origin, spacePoint), result);
|
|
244
293
|
}
|
|
245
|
-
/** Returns true
|
|
246
|
-
|
|
294
|
+
/** Returns true if spacePoint is within distance tolerance of the plane.
|
|
295
|
+
* * This logic is identical to the [[Plane3d]] method but avoids a level of function call.
|
|
296
|
+
*/
|
|
297
|
+
isPointInPlane(spacePoint, tolerance = Geometry.smallMetricDistance) {
|
|
298
|
+
const altitude = this._normal.dotProductStartEnd(this._origin, spacePoint);
|
|
299
|
+
return Math.abs(altitude) <= tolerance;
|
|
300
|
+
}
|
|
247
301
|
}
|
|
248
302
|
//# sourceMappingURL=Plane3dByOriginAndUnitNormal.js.map
|