@itwin/core-geometry 5.1.0-dev.9 → 5.2.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -1
- package/lib/cjs/Geometry.d.ts +18 -10
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +13 -3
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.d.ts +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +7 -1
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.d.ts +4 -3
- package/lib/cjs/bspline/BSplineSurface.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.js +4 -5
- package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +7 -5
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +9 -5
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +5 -3
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +1 -2
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +13 -25
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +1 -2
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +1 -2
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +2 -0
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +2 -0
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +54 -32
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +56 -37
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +40 -1
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +90 -0
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +3 -2
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +6 -5
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +27 -25
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +30 -25
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +9 -2
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +11 -0
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/CurveTypes.d.ts +1 -1
- package/lib/cjs/curve/CurveTypes.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.d.ts +2 -0
- package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +4 -0
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +7 -0
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +15 -3
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +37 -8
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +34 -8
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js +129 -33
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.d.ts +4 -3
- package/lib/cjs/curve/Query/StrokeCountChain.d.ts.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js +20 -9
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.d.ts +2 -1
- package/lib/cjs/curve/RegionMomentsXY.d.ts.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js +26 -41
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +74 -39
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +146 -46
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +36 -27
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js +161 -55
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts +1 -1
- package/lib/cjs/curve/StrokeOptions.js +1 -1
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +2 -2
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +6 -6
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +0 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +58 -32
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +0 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.d.ts +14 -0
- package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js +34 -0
- package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -0
- package/lib/cjs/geometry3d/AngleSweep.d.ts +25 -18
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +32 -18
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts +8 -7
- package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js +19 -25
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +8 -3
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +21 -3
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +11 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +21 -3
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.d.ts +2 -0
- package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js +6 -1
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +2 -0
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +6 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts +8 -2
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +18 -10
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +0 -2
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +4 -4
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +4 -5
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts +7 -7
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +66 -26
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +49 -2
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +38 -2
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts +13 -6
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +16 -9
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts +5 -4
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +5 -4
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts +18 -10
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +32 -10
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.js +0 -1
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts +7 -9
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +23 -45
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.d.ts +39 -29
- package/lib/cjs/geometry3d/ReusableObjectCache.d.ts.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js +49 -35
- package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.d.ts +1 -4
- package/lib/cjs/geometry3d/SortablePolygon.d.ts.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js +48 -43
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +21 -2
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +32 -13
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.d.ts +8 -5
- package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js +27 -16
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.d.ts +2 -0
- package/lib/cjs/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js +11 -0
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/SmallSystem.d.ts +77 -36
- package/lib/cjs/numerics/SmallSystem.d.ts.map +1 -1
- package/lib/cjs/numerics/SmallSystem.js +129 -73
- package/lib/cjs/numerics/SmallSystem.js.map +1 -1
- package/lib/cjs/polyface/FacetOrientation.d.ts +1 -1
- package/lib/cjs/polyface/FacetOrientation.js +1 -1
- package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +55 -40
- package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js +83 -75
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +15 -14
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +47 -38
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts +26 -19
- package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js +51 -32
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/cjs/polyface/Polyface.d.ts +19 -5
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +18 -2
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +6 -6
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.d.ts +19 -18
- package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js +39 -42
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +1 -1
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +119 -78
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +315 -231
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +3 -3
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +3 -3
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts +7 -6
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +8 -9
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js +2 -3
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js +2 -4
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +3 -3
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts +3 -3
- package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js +5 -5
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/solid/Box.d.ts.map +1 -1
- package/lib/cjs/solid/Box.js +7 -0
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.d.ts.map +1 -1
- package/lib/cjs/solid/Cone.js +6 -0
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts +2 -3
- package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
- package/lib/cjs/solid/LinearSweep.js +11 -7
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts +2 -2
- package/lib/cjs/solid/RotationalSweep.js +2 -2
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RuledSweep.js +5 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/Sphere.d.ts.map +1 -1
- package/lib/cjs/solid/Sphere.js +6 -3
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.d.ts +1 -1
- package/lib/cjs/solid/SweepContour.js +1 -1
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
- package/lib/cjs/solid/TorusPipe.js +4 -0
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.d.ts +1 -1
- package/lib/cjs/topology/ChainMerge.js +1 -1
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts +64 -14
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +149 -32
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts +3 -2
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js +3 -2
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/Merging.d.ts +0 -1
- package/lib/cjs/topology/Merging.d.ts.map +1 -1
- package/lib/cjs/topology/Merging.js +49 -46
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.d.ts.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js +2 -1
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/Triangulation.d.ts +9 -14
- package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
- package/lib/cjs/topology/Triangulation.js +29 -22
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/esm/Geometry.d.ts +18 -10
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +13 -3
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.d.ts +1 -1
- package/lib/esm/bspline/BSpline1dNd.js +1 -1
- package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +7 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineSurface.d.ts +4 -3
- package/lib/esm/bspline/BSplineSurface.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineSurface.js +4 -5
- package/lib/esm/bspline/BSplineSurface.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +7 -5
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +9 -5
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +5 -3
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +1 -2
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +13 -25
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +1 -2
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +1 -2
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +2 -0
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +2 -0
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +54 -32
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +56 -37
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +40 -1
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +90 -0
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +3 -2
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +6 -5
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +27 -25
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +30 -25
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +9 -2
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +11 -0
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/CurveTypes.d.ts +1 -1
- package/lib/esm/curve/CurveTypes.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.d.ts +2 -0
- package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +4 -0
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +7 -0
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +15 -3
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +37 -8
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts +34 -8
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js +131 -35
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.d.ts +4 -3
- package/lib/esm/curve/Query/StrokeCountChain.d.ts.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js +20 -9
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.d.ts +2 -1
- package/lib/esm/curve/RegionMomentsXY.d.ts.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js +26 -41
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +74 -39
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +146 -46
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +36 -27
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js +161 -56
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts +1 -1
- package/lib/esm/curve/StrokeOptions.js +1 -1
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +2 -2
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +6 -6
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +0 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +58 -32
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +0 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransferWithSplitArcs.d.ts +14 -0
- package/lib/esm/curve/internalContexts/TransferWithSplitArcs.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js +30 -0
- package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -0
- package/lib/esm/geometry3d/AngleSweep.d.ts +25 -18
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +32 -18
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts +8 -7
- package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.js +19 -25
- package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.d.ts +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts +8 -3
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +21 -3
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +11 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +21 -3
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.d.ts +2 -0
- package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js +6 -1
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +2 -0
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +6 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts +8 -2
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +18 -10
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +0 -2
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +4 -4
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +4 -5
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts +7 -7
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +66 -26
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +49 -2
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +38 -2
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts +13 -6
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +16 -9
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts +5 -4
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +5 -4
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts +18 -10
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +32 -10
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray2d.js +0 -1
- package/lib/esm/geometry3d/Ray2d.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts +7 -9
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +23 -45
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.d.ts +39 -29
- package/lib/esm/geometry3d/ReusableObjectCache.d.ts.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js +47 -33
- package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.d.ts +1 -4
- package/lib/esm/geometry3d/SortablePolygon.d.ts.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js +48 -43
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +21 -2
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +32 -13
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.d.ts +8 -5
- package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Point4d.js +27 -16
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.d.ts +2 -0
- package/lib/esm/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js +11 -0
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/SmallSystem.d.ts +77 -36
- package/lib/esm/numerics/SmallSystem.d.ts.map +1 -1
- package/lib/esm/numerics/SmallSystem.js +129 -73
- package/lib/esm/numerics/SmallSystem.js.map +1 -1
- package/lib/esm/polyface/FacetOrientation.d.ts +1 -1
- package/lib/esm/polyface/FacetOrientation.js +1 -1
- package/lib/esm/polyface/FacetOrientation.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +55 -40
- package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js +83 -75
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +15 -14
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js +47 -38
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts +26 -19
- package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.js +51 -32
- package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/esm/polyface/Polyface.d.ts +19 -5
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +18 -2
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +6 -6
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.d.ts +19 -18
- package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js +39 -42
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +1 -1
- package/lib/esm/polyface/PolyfaceData.js +1 -1
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +119 -78
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +316 -232
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +3 -3
- package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js +3 -3
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts +7 -6
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +8 -9
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBReader.js +2 -3
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js +2 -4
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +3 -3
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts +3 -3
- package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js +5 -5
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/solid/Box.d.ts.map +1 -1
- package/lib/esm/solid/Box.js +7 -0
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.d.ts.map +1 -1
- package/lib/esm/solid/Cone.js +6 -0
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.d.ts +2 -3
- package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
- package/lib/esm/solid/LinearSweep.js +11 -7
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts +2 -2
- package/lib/esm/solid/RotationalSweep.js +2 -2
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.d.ts +1 -1
- package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
- package/lib/esm/solid/RuledSweep.js +5 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/Sphere.d.ts.map +1 -1
- package/lib/esm/solid/Sphere.js +6 -3
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.d.ts +1 -1
- package/lib/esm/solid/SweepContour.js +1 -1
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
- package/lib/esm/solid/TorusPipe.js +4 -0
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.d.ts +1 -1
- package/lib/esm/topology/ChainMerge.js +1 -1
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +64 -14
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +149 -32
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts +3 -2
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js +3 -2
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/Merging.d.ts +0 -1
- package/lib/esm/topology/Merging.d.ts.map +1 -1
- package/lib/esm/topology/Merging.js +49 -46
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.d.ts.map +1 -1
- package/lib/esm/topology/RegularizeFace.js +2 -1
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/Triangulation.d.ts +9 -14
- package/lib/esm/topology/Triangulation.d.ts.map +1 -1
- package/lib/esm/topology/Triangulation.js +29 -22
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/package.json +7 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../src/solid/Box.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;;;;;GASG;AACH,qBAAa,GAAI,SAAQ,cAAc;IACrC,wCAAwC;IACxC,SAAgB,kBAAkB,SAAS;IAE3C,OAAO,CAAC,aAAa,CAAY;IACjC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,KAAK,CAAS;IAEtB,SAAS,aAAa,GAAG,EAAE,SAAS,EAClC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;IAQ3E,qBAAqB;IACd,KAAK,IAAI,GAAG;IAInB;;;;;OAKG;IACI,oBAAoB,IAAI,SAAS,GAAG,SAAS;IAGpD;;;;OAIG;IACI,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../src/solid/Box.ts"],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ACI,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe;IAI3D,uDAAuD;IAChD,WAAW,CAAC,aAAa,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,IAAI;IA0BvE;;OAEG;IACH,IAAW,cAAc,IAAI,OAAO,CAEnC;CACF"}
|
package/lib/esm/solid/Box.js
CHANGED
|
@@ -56,6 +56,13 @@ export class Box extends SolidPrimitive {
|
|
|
56
56
|
if (transform.matrix.isSingular())
|
|
57
57
|
return false;
|
|
58
58
|
transform.multiplyTransformTransform(this._localToWorld, this._localToWorld);
|
|
59
|
+
if (transform.matrix.determinant() < 0.0) {
|
|
60
|
+
// if mirror, reverse z-axis (origin and direction) to preserve outward normals
|
|
61
|
+
this._localToWorld.origin.addInPlace(this._localToWorld.matrix.columnZ());
|
|
62
|
+
this._localToWorld.matrix.scaleColumnsInPlace(1, 1, -1);
|
|
63
|
+
[this._baseX, this._topX] = [this._topX, this._baseX];
|
|
64
|
+
[this._baseY, this._topY] = [this._topY, this._baseY];
|
|
65
|
+
}
|
|
59
66
|
return true;
|
|
60
67
|
}
|
|
61
68
|
/**
|
package/lib/esm/solid/Box.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.js","sourceRoot":"","sources":["../../../src/solid/Box.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAQ/F,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;;;;;GASG;AACH,MAAM,OAAO,GAAI,SAAQ,cAAc;IACrC,w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CAAC;YAC9E,aAAa,CAAC,6BAA6B,CAAC,SAAS,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC/E,aAAa,CAAC,6BAA6B,CAAC,SAAS,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;YAC/E,aAAa,CAAC,6BAA6B,CAAC,SAAS,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QAClF,CAAC;aAAM,CAAC;YACN,aAAa,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC1D,aAAa,CAAC,oBAAoB,CAAC,YAAY,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC3D,aAAa,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;YAC3D,aAAa,CAAC,oBAAoB,CAAC,YAAY,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;YAC5D,aAAa,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC1D,aAAa,CAAC,oBAAoB,CAAC,YAAY,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC3D,aAAa,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;YAC3D,aAAa,CAAC,oBAAoB,CAAC,YAAY,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;IACD;;OAEG;IACH,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Solid\n */\n\nimport { CurveCollection } from \"../curve/CurveCollection\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { LineString3d } from \"../curve/LineString3d\";\nimport { Loop } from \"../curve/Loop\";\nimport { Geometry } from \"../Geometry\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range3d } from \"../geometry3d/Range\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { SolidPrimitive } from \"./SolidPrimitive\";\n\n/**\n * A box-like solid defined by\n * * A local coordinate frame\n * * (0,0,0) is left lower rear corner of box (considering \"left\" to reference x, \"lower\" to reference y, \"rear and front\" to reference z=0 and z=1)\n * * (0,0,1) is left lower front corner.\n * * (baseX,baseY,z) is right upper corner at z\n * * note that the frame x and y columns are usually unit vectors in local space, but z is full rear to front vector\n * * The separate values for base and top x and y allow the box to be a \"view frustum\" with parallel back and front planes but independent x and y bellows effects.\n * @public\n */\nexport class Box extends SolidPrimitive {\n /** String name for schema properties */\n public readonly solidPrimitiveType = \"box\";\n\n private _localToWorld: Transform;\n private _baseX: number;\n private _baseY: number;\n private _topX: number;\n private _topY: number;\n\n protected constructor(map: Transform,\n baseX: number, baseY: number, topX: number, topY: number, capped: boolean) {\n super(capped);\n this._localToWorld = map;\n this._baseX = baseX;\n this._baseY = baseY;\n this._topX = topX;\n this._topY = topY;\n }\n /** Return a clone */\n public clone(): Box {\n return new Box(this._localToWorld.clone(), this._baseX, this._baseY, this._topX, this._topY, this.capped);\n }\n\n /** Return a coordinate frame (right handed unit vectors)\n * * origin lower left of box\n * * x direction on base rectangle x edge\n * * y direction in base rectangle\n * * z direction perpendicular\n */\n public getConstructiveFrame(): Transform | undefined {\n return this._localToWorld.cloneRigid();\n }\n /**\n * Apply the transform to the box's `localToWorld` frame.\n * * Note that this may make the frame nonrigid.\n * * This fails if the transformation is singular.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n if (transform.matrix.isSingular())\n return false;\n transform.multiplyTransformTransform(this._localToWorld, this._localToWorld);\n return true;\n }\n /**\n * Clone the box and immediately apply `transform` to the local frame of the clone.\n * * Note that this may make the frame nonrigid.\n * * This fails if the transformation is singular.\n */\n public cloneTransformed(transform: Transform): Box | undefined {\n const result = this.clone();\n return result.tryTransformInPlace(transform) ? result : undefined;\n }\n\n /**\n * Create a new box from vector and size daa.\n * @param origin Origin of base rectangle\n * @param vectorX Direction for base rectangle\n * @param vectorY Direction for base rectangle\n * @param topOrigin origin of top rectangle\n * @param baseX size factor for base rectangle (multiplies vectorX)\n * @param baseY size factor for base rectangle (multiplies vectorY)\n * @param topX size factor for top rectangle (multiplies vectorX)\n * @param topY size factor for top rectangle (multiplies vectorY)\n * @param capped true to define top and bottom closure caps\n */\n public static createDgnBox(origin: Point3d, vectorX: Vector3d, vectorY: Vector3d,\n topOrigin: Point3d,\n baseX: number, baseY: number, topX: number, topY: number,\n capped: boolean): Box | undefined {\n const vectorZ = origin.vectorTo(topOrigin);\n const localToWorld = Transform.createOriginAndMatrixColumns(origin, vectorX, vectorY, vectorZ);\n return new Box(localToWorld, baseX, baseY, topX, topY, capped);\n }\n\n /**\n * Create a new box with xy directions taken from columns of the `axes` matrix.\n * @param origin Origin of base rectangle\n * @param axes Direction for base rectangle\n * @param topOrigin origin of top rectangle\n * @param baseX size factor for base rectangle (multiplies vectorX)\n * @param baseY size factor for base rectangle (multiplies vectorY)\n * @param topX size factor for top rectangle (multiplies vectorX)\n * @param topY size factor for top rectangle (multiplies vectorY)\n * @param capped true to define top and bottom closure caps\n */\n public static createDgnBoxWithAxes(origin: Point3d, axes: Matrix3d,\n topOrigin: Point3d,\n baseX: number, baseY: number, topX: number, topY: number,\n capped: boolean): Box | undefined {\n return Box.createDgnBox(origin, axes.columnX(), axes.columnY(), topOrigin,\n baseX, baseY, topX, topY, capped);\n }\n\n /**\n * Create an axis-aligned `Box` primitive for a range.\n * @param range range low point is origin of base rectangle, range extents are box extents\n * @param capped true to define top and bottom closure caps\n */\n public static createRange(range: Range3d, capped: boolean): Box | undefined {\n if (!range.isNull) {\n const lowPoint = range.low;\n const xSize = range.xLength();\n const ySize = range.yLength();\n const zPoint = range.low.clone();\n zPoint.z = zPoint.z + range.zLength();\n return Box.createDgnBox(\n lowPoint,\n Vector3d.unitX(), Vector3d.unitY(),\n zPoint,\n xSize, ySize, xSize, ySize, capped);\n }\n return undefined;\n }\n /** (property accessor) return the x length at z = 0 */\n public getBaseX(): number { return this._baseX; }\n /** (property accessor) return the y length at z = 0 */\n public getBaseY(): number { return this._baseY; }\n /** (property accessor) return the x length at z = 1 */\n public getTopX(): number { return this._topX; }\n /** (property accessor) return the x length at z = 1 */\n public getTopY(): number { return this._topY; }\n /** (property accessor) return the local coordinates point (0,0,0) to world */\n public getBaseOrigin(): Point3d { return this._localToWorld.multiplyXYZ(0, 0, 0); }\n /** (property accessor) return the local coordinates point (0,0,1) to world */\n public getTopOrigin(): Point3d { return this._localToWorld.multiplyXYZ(0, 0, 1); }\n /** (property accessor) return the local coordinate frame x vector */\n public getVectorX(): Vector3d { return this._localToWorld.matrix.columnX(); }\n /** (property accessor) return the local coordinate frame y vector */\n public getVectorY(): Vector3d { return this._localToWorld.matrix.columnY(); }\n /** (property accessor) return the local coordinate frame z vector */\n public getVectorZ(): Vector3d { return this._localToWorld.matrix.columnZ(); }\n /** Test of `other` is also of class `Box` */\n public isSameGeometryClass(other: any): boolean { return other instanceof Box; }\n /** test for near equality */\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof Box) {\n if (this.capped !== other.capped) return false;\n if (!this._localToWorld.isAlmostEqual(other._localToWorld)) return false;\n return Geometry.isSameCoordinate(this._baseX, other._baseX)\n && Geometry.isSameCoordinate(this._baseY, other._baseY)\n && Geometry.isSameCoordinate(this._topX, other._topX)\n && Geometry.isSameCoordinate(this._topY, other._topY);\n }\n return false;\n }\n /** Second step of double dispatch: call `handler.handleBox(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleBox(this);\n }\n /** Return strokes of the cross-section rectangle at local z coordinate */\n public strokeConstantVSection(zFraction: number): LineString3d {\n const ax = Geometry.interpolate(this._baseX, zFraction, this._topX);\n const ay = Geometry.interpolate(this._baseY, zFraction, this._topY);\n const result = LineString3d.create();\n const transform = this._localToWorld;\n const workPoint = Point3d.create();\n transform.multiplyXYZ(0, 0, zFraction, workPoint);\n result.addPoint(workPoint);\n transform.multiplyXYZ(ax, 0, zFraction, workPoint);\n result.addPoint(workPoint);\n transform.multiplyXYZ(ax, ay, zFraction, workPoint);\n result.addPoint(workPoint);\n transform.multiplyXYZ(0, ay, zFraction, workPoint);\n result.addPoint(workPoint);\n transform.multiplyXYZ(0, 0, zFraction, workPoint);\n result.addPoint(workPoint);\n return result;\n }\n /**\n * Returns the 8 corners in x fastest, then y, finally z lexical order.\n */\n public getCorners(): Point3d[] {\n const transform = this._localToWorld;\n const ax = this._baseX;\n const ay = this._baseY;\n const bx = this._topX;\n const by = this._topY;\n return [\n transform.multiplyXYZ(0, 0, 0),\n transform.multiplyXYZ(ax, 0, 0),\n transform.multiplyXYZ(0, ay, 0),\n transform.multiplyXYZ(ax, ay, 0),\n transform.multiplyXYZ(0, 0, 1),\n transform.multiplyXYZ(bx, 0, 1),\n transform.multiplyXYZ(0, by, 1),\n transform.multiplyXYZ(bx, by, 1),\n ];\n }\n\n /**\n * Consider the box sides (not top and bottom) as a (u,v) surface with\n * * v = 0 as the z=0 local plane\n * * v = 1 as the z=1 local plane\n * Return the (rectangular) section at fractional v\n */\n public constantVSection(zFraction: number): CurveCollection {\n const ls = this.strokeConstantVSection(zFraction);\n return Loop.create(ls);\n }\n /** Extend `rangeToExtend` by each of the 8 corners */\n public extendRange(rangeToExtend: Range3d, transform?: Transform): void {\n const boxTransform = this._localToWorld;\n const ax = this._baseX;\n const ay = this._baseY;\n const bx = this._topX;\n const by = this._topY;\n if (transform) {\n rangeToExtend.extendTransformTransformedXYZ(transform, boxTransform, 0, 0, 0);\n rangeToExtend.extendTransformTransformedXYZ(transform, boxTransform, ax, 0, 0);\n rangeToExtend.extendTransformTransformedXYZ(transform, boxTransform, 0, ay, 0);\n rangeToExtend.extendTransformTransformedXYZ(transform, boxTransform, ax, ay, 0);\n rangeToExtend.extendTransformTransformedXYZ(transform, boxTransform, 0, 0, 1);\n rangeToExtend.extendTransformTransformedXYZ(transform, boxTransform, bx, 0, 1);\n rangeToExtend.extendTransformTransformedXYZ(transform, boxTransform, 0, by, 1);\n rangeToExtend.extendTransformTransformedXYZ(transform, boxTransform, bx, by, 1);\n } else {\n rangeToExtend.extendTransformedXYZ(boxTransform, 0, 0, 0);\n rangeToExtend.extendTransformedXYZ(boxTransform, ax, 0, 0);\n rangeToExtend.extendTransformedXYZ(boxTransform, 0, ay, 0);\n rangeToExtend.extendTransformedXYZ(boxTransform, ax, ay, 0);\n rangeToExtend.extendTransformedXYZ(boxTransform, 0, 0, 1);\n rangeToExtend.extendTransformedXYZ(boxTransform, bx, 0, 1);\n rangeToExtend.extendTransformedXYZ(boxTransform, 0, by, 1);\n rangeToExtend.extendTransformedXYZ(boxTransform, bx, by, 1);\n }\n }\n /**\n * @return true if this is a closed volume.\n */\n public get isClosedVolume(): boolean {\n return this.capped;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Box.js","sourceRoot":"","sources":["../../../src/solid/Box.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAQ/F,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OA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EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;YAC3D,aAAa,CAAC,oBAAoB,CAAC,YAAY,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;YAC5D,aAAa,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC1D,aAAa,CAAC,oBAAoB,CAAC,YAAY,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC3D,aAAa,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;YAC3D,aAAa,CAAC,oBAAoB,CAAC,YAAY,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;IACD;;OAEG;IACH,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Solid\n */\n\nimport { CurveCollection } from \"../curve/CurveCollection\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { LineString3d } from \"../curve/LineString3d\";\nimport { Loop } from \"../curve/Loop\";\nimport { Geometry } from \"../Geometry\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range3d } from \"../geometry3d/Range\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { SolidPrimitive } from \"./SolidPrimitive\";\n\n/**\n * A box-like solid defined by\n * * A local coordinate frame\n * * (0,0,0) is left lower rear corner of box (considering \"left\" to reference x, \"lower\" to reference y, \"rear and front\" to reference z=0 and z=1)\n * * (0,0,1) is left lower front corner.\n * * (baseX,baseY,z) is right upper corner at z\n * * note that the frame x and y columns are usually unit vectors in local space, but z is full rear to front vector\n * * The separate values for base and top x and y allow the box to be a \"view frustum\" with parallel back and front planes but independent x and y bellows effects.\n * @public\n */\nexport class Box extends SolidPrimitive {\n /** String name for schema properties */\n public readonly solidPrimitiveType = \"box\";\n\n private _localToWorld: Transform;\n private _baseX: number;\n private _baseY: number;\n private _topX: number;\n private _topY: number;\n\n protected constructor(map: Transform,\n baseX: number, baseY: number, topX: number, topY: number, capped: boolean) {\n super(capped);\n this._localToWorld = map;\n this._baseX = baseX;\n this._baseY = baseY;\n this._topX = topX;\n this._topY = topY;\n }\n /** Return a clone */\n public clone(): Box {\n return new Box(this._localToWorld.clone(), this._baseX, this._baseY, this._topX, this._topY, this.capped);\n }\n\n /** Return a coordinate frame (right handed unit vectors)\n * * origin lower left of box\n * * x direction on base rectangle x edge\n * * y direction in base rectangle\n * * z direction perpendicular\n */\n public getConstructiveFrame(): Transform | undefined {\n return this._localToWorld.cloneRigid();\n }\n /**\n * Apply the transform to the box's `localToWorld` frame.\n * * Note that this may make the frame nonrigid.\n * * This fails if the transformation is singular.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n if (transform.matrix.isSingular())\n return false;\n transform.multiplyTransformTransform(this._localToWorld, this._localToWorld);\n if (transform.matrix.determinant() < 0.0) {\n // if mirror, reverse z-axis (origin and direction) to preserve outward normals\n this._localToWorld.origin.addInPlace(this._localToWorld.matrix.columnZ());\n this._localToWorld.matrix.scaleColumnsInPlace(1, 1, -1);\n [this._baseX, this._topX] = [this._topX, this._baseX];\n [this._baseY, this._topY] = [this._topY, this._baseY];\n }\n return true;\n }\n /**\n * Clone the box and immediately apply `transform` to the local frame of the clone.\n * * Note that this may make the frame nonrigid.\n * * This fails if the transformation is singular.\n */\n public cloneTransformed(transform: Transform): Box | undefined {\n const result = this.clone();\n return result.tryTransformInPlace(transform) ? result : undefined;\n }\n\n /**\n * Create a new box from vector and size daa.\n * @param origin Origin of base rectangle\n * @param vectorX Direction for base rectangle\n * @param vectorY Direction for base rectangle\n * @param topOrigin origin of top rectangle\n * @param baseX size factor for base rectangle (multiplies vectorX)\n * @param baseY size factor for base rectangle (multiplies vectorY)\n * @param topX size factor for top rectangle (multiplies vectorX)\n * @param topY size factor for top rectangle (multiplies vectorY)\n * @param capped true to define top and bottom closure caps\n */\n public static createDgnBox(origin: Point3d, vectorX: Vector3d, vectorY: Vector3d,\n topOrigin: Point3d,\n baseX: number, baseY: number, topX: number, topY: number,\n capped: boolean): Box | undefined {\n const vectorZ = origin.vectorTo(topOrigin);\n const localToWorld = Transform.createOriginAndMatrixColumns(origin, vectorX, vectorY, vectorZ);\n return new Box(localToWorld, baseX, baseY, topX, topY, capped);\n }\n\n /**\n * Create a new box with xy directions taken from columns of the `axes` matrix.\n * @param origin Origin of base rectangle\n * @param axes Direction for base rectangle\n * @param topOrigin origin of top rectangle\n * @param baseX size factor for base rectangle (multiplies vectorX)\n * @param baseY size factor for base rectangle (multiplies vectorY)\n * @param topX size factor for top rectangle (multiplies vectorX)\n * @param topY size factor for top rectangle (multiplies vectorY)\n * @param capped true to define top and bottom closure caps\n */\n public static createDgnBoxWithAxes(origin: Point3d, axes: Matrix3d,\n topOrigin: Point3d,\n baseX: number, baseY: number, topX: number, topY: number,\n capped: boolean): Box | undefined {\n return Box.createDgnBox(origin, axes.columnX(), axes.columnY(), topOrigin,\n baseX, baseY, topX, topY, capped);\n }\n\n /**\n * Create an axis-aligned `Box` primitive for a range.\n * @param range range low point is origin of base rectangle, range extents are box extents\n * @param capped true to define top and bottom closure caps\n */\n public static createRange(range: Range3d, capped: boolean): Box | undefined {\n if (!range.isNull) {\n const lowPoint = range.low;\n const xSize = range.xLength();\n const ySize = range.yLength();\n const zPoint = range.low.clone();\n zPoint.z = zPoint.z + range.zLength();\n return Box.createDgnBox(\n lowPoint,\n Vector3d.unitX(), Vector3d.unitY(),\n zPoint,\n xSize, ySize, xSize, ySize, capped);\n }\n return undefined;\n }\n /** (property accessor) return the x length at z = 0 */\n public getBaseX(): number { return this._baseX; }\n /** (property accessor) return the y length at z = 0 */\n public getBaseY(): number { return this._baseY; }\n /** (property accessor) return the x length at z = 1 */\n public getTopX(): number { return this._topX; }\n /** (property accessor) return the x length at z = 1 */\n public getTopY(): number { return this._topY; }\n /** (property accessor) return the local coordinates point (0,0,0) to world */\n public getBaseOrigin(): Point3d { return this._localToWorld.multiplyXYZ(0, 0, 0); }\n /** (property accessor) return the local coordinates point (0,0,1) to world */\n public getTopOrigin(): Point3d { return this._localToWorld.multiplyXYZ(0, 0, 1); }\n /** (property accessor) return the local coordinate frame x vector */\n public getVectorX(): Vector3d { return this._localToWorld.matrix.columnX(); }\n /** (property accessor) return the local coordinate frame y vector */\n public getVectorY(): Vector3d { return this._localToWorld.matrix.columnY(); }\n /** (property accessor) return the local coordinate frame z vector */\n public getVectorZ(): Vector3d { return this._localToWorld.matrix.columnZ(); }\n /** Test of `other` is also of class `Box` */\n public isSameGeometryClass(other: any): boolean { return other instanceof Box; }\n /** test for near equality */\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof Box) {\n if (this.capped !== other.capped) return false;\n if (!this._localToWorld.isAlmostEqual(other._localToWorld)) return false;\n return Geometry.isSameCoordinate(this._baseX, other._baseX)\n && Geometry.isSameCoordinate(this._baseY, other._baseY)\n && Geometry.isSameCoordinate(this._topX, other._topX)\n && Geometry.isSameCoordinate(this._topY, other._topY);\n }\n return false;\n }\n /** Second step of double dispatch: call `handler.handleBox(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleBox(this);\n }\n /** Return strokes of the cross-section rectangle at local z coordinate */\n public strokeConstantVSection(zFraction: number): LineString3d {\n const ax = Geometry.interpolate(this._baseX, zFraction, this._topX);\n const ay = Geometry.interpolate(this._baseY, zFraction, this._topY);\n const result = LineString3d.create();\n const transform = this._localToWorld;\n const workPoint = Point3d.create();\n transform.multiplyXYZ(0, 0, zFraction, workPoint);\n result.addPoint(workPoint);\n transform.multiplyXYZ(ax, 0, zFraction, workPoint);\n result.addPoint(workPoint);\n transform.multiplyXYZ(ax, ay, zFraction, workPoint);\n result.addPoint(workPoint);\n transform.multiplyXYZ(0, ay, zFraction, workPoint);\n result.addPoint(workPoint);\n transform.multiplyXYZ(0, 0, zFraction, workPoint);\n result.addPoint(workPoint);\n return result;\n }\n /**\n * Returns the 8 corners in x fastest, then y, finally z lexical order.\n */\n public getCorners(): Point3d[] {\n const transform = this._localToWorld;\n const ax = this._baseX;\n const ay = this._baseY;\n const bx = this._topX;\n const by = this._topY;\n return [\n transform.multiplyXYZ(0, 0, 0),\n transform.multiplyXYZ(ax, 0, 0),\n transform.multiplyXYZ(0, ay, 0),\n transform.multiplyXYZ(ax, ay, 0),\n transform.multiplyXYZ(0, 0, 1),\n transform.multiplyXYZ(bx, 0, 1),\n transform.multiplyXYZ(0, by, 1),\n transform.multiplyXYZ(bx, by, 1),\n ];\n }\n\n /**\n * Consider the box sides (not top and bottom) as a (u,v) surface with\n * * v = 0 as the z=0 local plane\n * * v = 1 as the z=1 local plane\n * Return the (rectangular) section at fractional v\n */\n public constantVSection(zFraction: number): CurveCollection {\n const ls = this.strokeConstantVSection(zFraction);\n return Loop.create(ls);\n }\n /** Extend `rangeToExtend` by each of the 8 corners */\n public extendRange(rangeToExtend: Range3d, transform?: Transform): void {\n const boxTransform = this._localToWorld;\n const ax = this._baseX;\n const ay = this._baseY;\n const bx = this._topX;\n const by = this._topY;\n if (transform) {\n rangeToExtend.extendTransformTransformedXYZ(transform, boxTransform, 0, 0, 0);\n rangeToExtend.extendTransformTransformedXYZ(transform, boxTransform, ax, 0, 0);\n rangeToExtend.extendTransformTransformedXYZ(transform, boxTransform, 0, ay, 0);\n rangeToExtend.extendTransformTransformedXYZ(transform, boxTransform, ax, ay, 0);\n rangeToExtend.extendTransformTransformedXYZ(transform, boxTransform, 0, 0, 1);\n rangeToExtend.extendTransformTransformedXYZ(transform, boxTransform, bx, 0, 1);\n rangeToExtend.extendTransformTransformedXYZ(transform, boxTransform, 0, by, 1);\n rangeToExtend.extendTransformTransformedXYZ(transform, boxTransform, bx, by, 1);\n } else {\n rangeToExtend.extendTransformedXYZ(boxTransform, 0, 0, 0);\n rangeToExtend.extendTransformedXYZ(boxTransform, ax, 0, 0);\n rangeToExtend.extendTransformedXYZ(boxTransform, 0, ay, 0);\n rangeToExtend.extendTransformedXYZ(boxTransform, ax, ay, 0);\n rangeToExtend.extendTransformedXYZ(boxTransform, 0, 0, 1);\n rangeToExtend.extendTransformedXYZ(boxTransform, bx, 0, 1);\n rangeToExtend.extendTransformedXYZ(boxTransform, 0, by, 1);\n rangeToExtend.extendTransformedXYZ(boxTransform, bx, by, 1);\n }\n }\n /**\n * @return true if this is a closed volume.\n */\n public get isClosedVolume(): boolean {\n return this.capped;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cone.d.ts","sourceRoot":"","sources":["../../../src/solid/Cone.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAE3G,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC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AaxI;;OAEG;IACH,IAAW,cAAc,IAAI,OAAO,CAEnC;IACD;;;;OAIG;IACI,wBAAwB,IAAI,QAAQ;CAY5C"}
|
package/lib/esm/solid/Cone.js
CHANGED
|
@@ -68,6 +68,12 @@ export class Cone extends SolidPrimitive {
|
|
|
68
68
|
if (transform.matrix.isSingular())
|
|
69
69
|
return false;
|
|
70
70
|
transform.multiplyTransformTransform(this._localToWorld, this._localToWorld);
|
|
71
|
+
if (transform.matrix.determinant() < 0.0) {
|
|
72
|
+
// if mirror, reverse z-axis (origin and direction) to preserve outward normals
|
|
73
|
+
this._localToWorld.origin.addInPlace(this._localToWorld.matrix.columnZ());
|
|
74
|
+
this._localToWorld.matrix.scaleColumnsInPlace(1, 1, -1);
|
|
75
|
+
[this._radiusA, this._radiusB] = [this._radiusB, this._radiusA];
|
|
76
|
+
}
|
|
71
77
|
return true;
|
|
72
78
|
}
|
|
73
79
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cone.js","sourceRoot":"","sources":["../../../src/solid/Cone.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,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CAAC,CAAC,GAAG,QAAQ,GAAG,MAAM,EAAE,CAAC,GAAG,QAAQ,GAAG,MAAM,EAAE,CAAC,CAAC,EACtF,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,IAAI,GAAG,QAAQ,EAAE,IAAI,GAAG,QAAQ,EAAE,GAAG,CAAC,EAC3E,MAAM,CAAC,CAAC;IACZ,CAAC;IACD;;OAEG;IACH,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IACD;;;;OAIG;IACI,wBAAwB;QAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpD,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpD,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAEpD,MAAM,QAAQ,GAAG,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAE,CAAC;QACpD,MAAM,EAAE,GAAG,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACxC,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACrD,MAAM,aAAa,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC;QAChD,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,EACzE,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC;IACxF,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Solid\n */\n\nimport { Arc3d } from \"../curve/Arc3d\";\nimport { CurveCollection } from \"../curve/CurveCollection\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { LineString3d } from \"../curve/LineString3d\";\nimport { Loop } from \"../curve/Loop\";\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\nimport { AxisOrder, Geometry } from \"../Geometry\";\nimport { GeometryHandler, UVSurface, UVSurfaceIsoParametricDistance } from \"../geometry3d/GeometryHandler\";\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range3d } from \"../geometry3d/Range\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { SolidPrimitive } from \"./SolidPrimitive\";\n\n/**\n * A cone with axis along the z-axis of a (possibly skewed) local coordinate system.\n * * The curved surface of the cone `C` with axis `vectorZ = centerB - centerA` is parameterized over (u,v) in [0,1]x[0,1] by\n * `C(u,v) = centerA + vFractionToRadius(v) * (cos(u * 2pi) * vectorX + sin(u * 2pi) * vectorY) + v * vectorZ`.\n * * Either radius may be zero, but they may not both be zero.\n * * Cross section size is determined by the lengths of `vectorX`, `vectorY`, and the radii.\n * * If `vectorX` and `vectorY` are orthonormal, the cross sections are circular, with sections at v = 0 and v = 1 having radius\n * `radiusA` and `radiusB`, respectively; otherwise, the cross sections are elliptical.\n * * The stored matrix encapsulates `vectorX`, `vectorY`, and `vectorZ` in the respective columns. Typically the first two columns\n * are orthogonal and unit length, and the last is full length.\n * * Creating a Cone without orthogonal xy-axes of equal length is possible, but not recommended, for the resulting geometry\n * lacks portability; for example, such a Cone cannot be represented as a DGN element (see [[createDgnCone]]).\n * @public\n */\nexport class Cone extends SolidPrimitive implements UVSurface, UVSurfaceIsoParametricDistance {\n /** String name for schema properties */\n public readonly solidPrimitiveType = \"cone\";\n\n /** Local to world transform. Axes may have any nonzero length and may be non-perpendicular. */\n private _localToWorld: Transform;\n /** Nominal cross sectional radius at z=0 (scales the cone's xy-axes). */\n private _radiusA: number;\n /** Nominal cross sectional radius at z=1 (scales the cone's xy-axes). */\n private _radiusB: number;\n /** Maximum of _radiusA and _radiusB. */\n private _maxRadius: number;\n\n /** Constructor, inputs CONSUMED. */\n protected constructor(map: Transform, radiusA: number, radiusB: number, capped: boolean) {\n super(capped);\n this._localToWorld = map;\n this._radiusA = radiusA;\n this._radiusB = radiusB;\n this._maxRadius = Math.max(this._radiusA, this._radiusB); // um... should resolve elliptical sections\n }\n /** Return a clone of this Cone. */\n public clone(): Cone {\n return new Cone(this._localToWorld.clone(), this._radiusA, this._radiusB, this.capped);\n }\n /** Return a coordinate frame (right handed unit vectors)\n * * origin at center of the base circle.\n * * base circle in the xy plane\n * * z axis by right hand rule.\n */\n public getConstructiveFrame(): Transform | undefined {\n return this._localToWorld.cloneRigid();\n }\n /** Apply the transform to this cone's local to world coordinates.\n * * Note that the radii are not changed. Scaling is absorbed into the frame.\n * * This fails if the transformation is singular.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n if (transform.matrix.isSingular())\n return false;\n transform.multiplyTransformTransform(this._localToWorld, this._localToWorld);\n return true;\n }\n /**\n * Create a clone and immediately transform the clone.\n * * This fails if the transformation is singular.\n */\n public cloneTransformed(transform: Transform): Cone | undefined {\n const result = this.clone();\n return result.tryTransformInPlace(transform) ? result : undefined;\n }\n /**\n * Create a right circular cylinder or cone from the given base centers and radii.\n * * The circular cross sections are perpendicular to the axis line between the centers.\n * * Both radii must be of the same sign, and at least one radius must be nonzero.\n * * Negative radii are accepted to create an interior surface, however the downstream effects of this, combined with capping, may be problematic.\n */\n public static createAxisPoints(centerA: Point3d, centerB: Point3d, radiusA: number, radiusB: number, capped?: boolean): Cone | undefined {\n const zDirection = centerA.vectorTo(centerB);\n const a = zDirection.magnitude();\n if (Geometry.isSmallMetricDistance(a)) return undefined;\n // force near-zero radii to true zero\n radiusA = Geometry.correctSmallMetricDistance(radiusA);\n radiusB = Geometry.correctSmallMetricDistance(radiusB);\n // cone tip may not be \"within\" the z range.\n if (radiusA * radiusB < 0.0) return undefined;\n // at least one must be nonzero.\n if (radiusA + radiusB === 0.0) return undefined;\n const matrix = Matrix3d.createRigidHeadsUp(zDirection);\n matrix.scaleColumns(1.0, 1.0, a, matrix);\n const localToWorld = Transform.createOriginAndMatrix(centerA, matrix);\n return new Cone(localToWorld, radiusA, radiusB, capped ?? false);\n }\n /**\n * Create a general cone from cross sections parallel to the plane spanned by the given vectors.\n * * Circular cross sections are indicated by perpendicular vectors of the same length.\n * * Elliptical cross sections are indicated by non-perpendicular vectors, or vectors of different lengths.\n * * Cross sectional planes do not have to be perpendicular to the axis line between centers.\n * * Cross section size is affected both by the given vector lengths and radii. To avoid unexpected scaling,\n * pass orthonormal vectors for circular cross sections, or unit radii for elliptical cross sections.\n * * There is no validation of the input radii. For best results, they should be nonnegative, and at least one should be nonzero.\n */\n public static createBaseAndTarget(centerA: Point3d, centerB: Point3d, vectorX: Vector3d, vectorY: Vector3d, radiusA: number, radiusB: number, capped?: boolean): Cone {\n radiusA = Math.abs(Geometry.correctSmallMetricDistance(radiusA));\n radiusB = Math.abs(Geometry.correctSmallMetricDistance(radiusB));\n const vectorZ = centerA.vectorTo(centerB);\n const localToWorld = Transform.createOriginAndMatrixColumns(centerA, vectorX, vectorY, vectorZ);\n return new Cone(localToWorld, radiusA, radiusB, capped ?? false);\n }\n\n /**\n * Create a circular cone from the typical parameters of the DGN file.\n * * This method calls [[createBaseAndTarget]] with normalized vectors, `vectorY` squared against `vectorX`, and\n * `radiusA` and `radiusB` scaled by the original length of `vectorX`.\n * * These restrictions allow the cone to be represented by an element in the DGN file.\n */\n public static createDgnCone(centerA: Point3d, centerB: Point3d, vectorX: Vector3d, vectorY: Vector3d, radiusA: number, radiusB: number, capped?: boolean): Cone | undefined {\n const rigidMatrix = Matrix3d.createRigidFromColumns(vectorX, vectorY, AxisOrder.XYZ);\n if (rigidMatrix) {\n const vectorXMag = vectorX.magnitude();\n return this.createBaseAndTarget(centerA, centerB, rigidMatrix.columnX(), rigidMatrix.columnY(), radiusA * vectorXMag, radiusB * vectorXMag, capped);\n }\n return undefined;\n }\n\n /** (Property accessor) Return the center point at the base plane */\n public getCenterA(): Point3d { return this._localToWorld.multiplyXYZ(0, 0, 0); }\n /** (Property accessor) */\n public getCenterB(): Point3d { return this._localToWorld.multiplyXYZ(0, 0, 1); }\n /** (Property accessor) Return the x vector in the local frame */\n public getVectorX(): Vector3d { return this._localToWorld.matrix.columnX(); }\n /** (Property accessor) Return the y vector in the local frame */\n public getVectorY(): Vector3d { return this._localToWorld.matrix.columnY(); }\n /** (Property accessor) return the radius at the base plane */\n public getRadiusA(): number { return this._radiusA; }\n /** (Property accessor) return the radius at the top plane */\n public getRadiusB(): number { return this._radiusB; }\n /** (Property accessor) return the larger of radiusA and radiusB */\n public getMaxRadius(): number { return this._maxRadius; }\n /** (Property accessor) return the radius at fraction `v` along the axis */\n public vFractionToRadius(v: number): number { return Geometry.interpolate(this._radiusA, v, this._radiusB); }\n /** (Property accessor) test if `other` is an instance of `Cone` */\n public isSameGeometryClass(other: any): boolean { return other instanceof Cone; }\n /** (Property accessor) Test for nearly equal coordinate data. */\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof Cone) {\n if (this.capped !== other.capped) return false;\n if (!this._localToWorld.isAlmostEqualAllowZRotation(other._localToWorld)) return false;\n return Geometry.isSameCoordinate(this._radiusA, other._radiusA)\n && Geometry.isSameCoordinate(this._radiusB, other._radiusB);\n }\n return false;\n }\n /** Second step of double dispatch: call `handler.handleCone(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleCone(this);\n }\n\n /**\n * return strokes for a cross-section (elliptic arc) at specified fraction v along the axis.\n * * fixedStrokeCount takes priority over stroke options.\n * * The linestring is created by LineString3d.createForStrokes (fixedStrokeCount, options), which sets up property according to the options:\n * * optional fractions member\n * * optional uvParams. uvParams are installed as full-scale distance parameters.\n * * optional derivatives.\n * @param v fractional position along the cone axis\n * @param fixedStrokeCount optional stroke count.\n * @param options optional stroke options.\n */\n public strokeConstantVSection(v: number, fixedStrokeCount?: number, options?: StrokeOptions): LineString3d {\n let strokeCount = 16;\n if (fixedStrokeCount !== undefined)\n strokeCount = fixedStrokeCount;\n else if (options !== undefined)\n strokeCount = options.defaultCircleStrokes; // NEEDS WORK -- get circle stroke count with this.maxRadius !!!\n else {\n // accept the local default\n }\n strokeCount = Geometry.clampToStartEnd(strokeCount, 4, 64);\n const r = this.vFractionToRadius(v);\n const result = LineString3d.createForStrokes(fixedStrokeCount, options);\n const twoPi = Math.PI * 2.0;\n const deltaRadians = twoPi / strokeCount;\n let radians = 0;\n const fractions = result.fractions; // possibly undefined !!!\n const derivatives = result.packedDerivatives; // possibly undefined !!!\n const uvParams = result.packedUVParams; // possibly undefined !!\n const surfaceNormals = result.packedSurfaceNormals;\n const xyz = Point3d.create();\n const dXdu = Vector3d.create();\n const dXdv = Vector3d.create();\n const normal = Vector3d.create();\n const transform = this._localToWorld;\n let rc, rs, cc, ss;\n for (let i = 0; i <= strokeCount; i++) {\n if (i * 2 <= strokeCount)\n radians = i * deltaRadians;\n else\n radians = (i - strokeCount) * deltaRadians;\n cc = Math.cos(radians);\n ss = Math.sin(radians);\n rc = r * cc;\n rs = r * ss;\n\n transform.multiplyXYZ(rc, rs, v, xyz);\n result.addPoint(xyz);\n if (fractions)\n fractions.push(i / strokeCount);\n if (derivatives) {\n transform.matrix.multiplyXYZ(-rs * twoPi, rc * twoPi, 0.0, dXdu);\n derivatives.push(dXdu);\n }\n if (surfaceNormals) {\n // the along-hoop vector does not need to be scaled by radius -- just need the direction for a cross product.\n transform.matrix.multiplyXYZ(-ss, cc, 0.0, dXdu);\n transform.matrix.multiplyXYZ(0, 0, 1, dXdv);\n dXdu.unitCrossProduct(dXdv, normal);\n surfaceNormals.push(normal);\n }\n if (uvParams) {\n uvParams.pushXY(i / strokeCount, v);\n }\n }\n return result;\n }\n /**\n * Return the Arc3d section at vFraction\n * @param vFraction fractional position along the sweep direction\n */\n public constantVSection(vFraction: number): CurveCollection | undefined {\n const r = this.vFractionToRadius(vFraction);\n const transform = this._localToWorld;\n const center = transform.multiplyXYZ(0, 0, vFraction);\n const vector0 = transform.matrix.multiplyXYZ(r, 0, 0);\n const vector90 = transform.matrix.multiplyXYZ(0, r, 0);\n return Loop.create(Arc3d.create(center, vector0, vector90));\n }\n /** Extend `rangeToExtend` so it includes this `Cone` instance. */\n public extendRange(rangeToExtend: Range3d, transform?: Transform): void {\n const arc0 = this.constantVSection(0.0)!;\n const arc1 = this.constantVSection(1.0)!;\n arc0.extendRange(rangeToExtend, transform);\n arc1.extendRange(rangeToExtend, transform);\n }\n /** Evaluate a point on the Cone surfaces, with\n * * v = 0 is the base plane.\n * * v = 1 is the top plane\n * * u = 0 to u = 1 wraps the angular range.\n */\n public uvFractionToPoint(uFraction: number, vFraction: number, result?: Point3d): Point3d {\n const theta = uFraction * Math.PI * 2.0;\n const r = Geometry.interpolate(this._radiusA, vFraction, this._radiusB);\n const cosTheta = Math.cos(theta);\n const sinTheta = Math.sin(theta);\n return this._localToWorld.multiplyXYZ(r * cosTheta, r * sinTheta, vFraction, result);\n }\n /** Evaluate a point tangent plane on the Cone surfaces, with\n * * v = 0 is the base plane.\n * * v = 1 is the top plane\n * * u = 0 to u = 1 wraps the angular range.\n */\n public uvFractionToPointAndTangents(uFraction: number, vFraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n const theta = uFraction * Math.PI * 2.0;\n const r = Geometry.interpolate(this._radiusA, vFraction, this._radiusB);\n const drdv = this._radiusB - this._radiusA;\n const cosTheta = Math.cos(theta);\n const sinTheta = Math.sin(theta);\n const fTheta = 2.0 * Math.PI;\n return Plane3dByOriginAndVectors.createOriginAndVectors(\n this._localToWorld.multiplyXYZ(r * cosTheta, r * sinTheta, vFraction),\n this._localToWorld.multiplyVectorXYZ(-r * sinTheta * fTheta, r * cosTheta * fTheta, 0),\n this._localToWorld.multiplyVectorXYZ(drdv * cosTheta, drdv * sinTheta, 1.0),\n result);\n }\n /**\n * @return true if this is a closed volume.\n */\n public get isClosedVolume(): boolean {\n return this.capped;\n }\n /**\n * Directional distance query\n * * u direction is around longitude circle at maximum distance from axis.\n * * v direction is on a line of longitude between the latitude limits.\n */\n public maxIsoParametricDistance(): Vector2d {\n const vectorX = this._localToWorld.matrix.columnX();\n const vectorY = this._localToWorld.matrix.columnY();\n const columnZ = this._localToWorld.matrix.columnZ();\n\n const xyNormal = vectorX.unitCrossProduct(vectorY)!;\n const hZ = xyNormal.dotProduct(columnZ);\n const zSkewVector = columnZ.plusScaled(xyNormal, hZ);\n const zSkewDistance = zSkewVector.magnitudeXY();\n return Vector2d.create(Math.PI * 2 * Math.max(this._radiusA, this._radiusB),\n Geometry.hypotenuseXY(Math.abs(this._radiusB - this._radiusA) + zSkewDistance, hZ));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Cone.js","sourceRoot":"","sources":["../../../src/solid/Cone.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAA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E,GAAG,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACxC,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACrD,MAAM,aAAa,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC;QAChD,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,EACzE,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC;IACxF,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Solid\n */\n\nimport { Arc3d } from \"../curve/Arc3d\";\nimport { CurveCollection } from \"../curve/CurveCollection\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { LineString3d } from \"../curve/LineString3d\";\nimport { Loop } from \"../curve/Loop\";\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\nimport { AxisOrder, Geometry } from \"../Geometry\";\nimport { GeometryHandler, UVSurface, UVSurfaceIsoParametricDistance } from \"../geometry3d/GeometryHandler\";\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range3d } from \"../geometry3d/Range\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { SolidPrimitive } from \"./SolidPrimitive\";\n\n/**\n * A cone with axis along the z-axis of a (possibly skewed) local coordinate system.\n * * The curved surface of the cone `C` with axis `vectorZ = centerB - centerA` is parameterized over (u,v) in [0,1]x[0,1] by\n * `C(u,v) = centerA + vFractionToRadius(v) * (cos(u * 2pi) * vectorX + sin(u * 2pi) * vectorY) + v * vectorZ`.\n * * Either radius may be zero, but they may not both be zero.\n * * Cross section size is determined by the lengths of `vectorX`, `vectorY`, and the radii.\n * * If `vectorX` and `vectorY` are orthonormal, the cross sections are circular, with sections at v = 0 and v = 1 having radius\n * `radiusA` and `radiusB`, respectively; otherwise, the cross sections are elliptical.\n * * The stored matrix encapsulates `vectorX`, `vectorY`, and `vectorZ` in the respective columns. Typically the first two columns\n * are orthogonal and unit length, and the last is full length.\n * * Creating a Cone without orthogonal xy-axes of equal length is possible, but not recommended, for the resulting geometry\n * lacks portability; for example, such a Cone cannot be represented as a DGN element (see [[createDgnCone]]).\n * @public\n */\nexport class Cone extends SolidPrimitive implements UVSurface, UVSurfaceIsoParametricDistance {\n /** String name for schema properties */\n public readonly solidPrimitiveType = \"cone\";\n\n /** Local to world transform. Axes may have any nonzero length and may be non-perpendicular. */\n private _localToWorld: Transform;\n /** Nominal cross sectional radius at z=0 (scales the cone's xy-axes). */\n private _radiusA: number;\n /** Nominal cross sectional radius at z=1 (scales the cone's xy-axes). */\n private _radiusB: number;\n /** Maximum of _radiusA and _radiusB. */\n private _maxRadius: number;\n\n /** Constructor, inputs CONSUMED. */\n protected constructor(map: Transform, radiusA: number, radiusB: number, capped: boolean) {\n super(capped);\n this._localToWorld = map;\n this._radiusA = radiusA;\n this._radiusB = radiusB;\n this._maxRadius = Math.max(this._radiusA, this._radiusB); // um... should resolve elliptical sections\n }\n /** Return a clone of this Cone. */\n public clone(): Cone {\n return new Cone(this._localToWorld.clone(), this._radiusA, this._radiusB, this.capped);\n }\n /** Return a coordinate frame (right handed unit vectors)\n * * origin at center of the base circle.\n * * base circle in the xy plane\n * * z axis by right hand rule.\n */\n public getConstructiveFrame(): Transform | undefined {\n return this._localToWorld.cloneRigid();\n }\n /** Apply the transform to this cone's local to world coordinates.\n * * Note that the radii are not changed. Scaling is absorbed into the frame.\n * * This fails if the transformation is singular.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n if (transform.matrix.isSingular())\n return false;\n transform.multiplyTransformTransform(this._localToWorld, this._localToWorld);\n if (transform.matrix.determinant() < 0.0) {\n // if mirror, reverse z-axis (origin and direction) to preserve outward normals\n this._localToWorld.origin.addInPlace(this._localToWorld.matrix.columnZ());\n this._localToWorld.matrix.scaleColumnsInPlace(1, 1, -1);\n [this._radiusA, this._radiusB] = [this._radiusB, this._radiusA];\n }\n return true;\n }\n /**\n * Create a clone and immediately transform the clone.\n * * This fails if the transformation is singular.\n */\n public cloneTransformed(transform: Transform): Cone | undefined {\n const result = this.clone();\n return result.tryTransformInPlace(transform) ? result : undefined;\n }\n /**\n * Create a right circular cylinder or cone from the given base centers and radii.\n * * The circular cross sections are perpendicular to the axis line between the centers.\n * * Both radii must be of the same sign, and at least one radius must be nonzero.\n * * Negative radii are accepted to create an interior surface, however the downstream effects of this, combined with capping, may be problematic.\n */\n public static createAxisPoints(centerA: Point3d, centerB: Point3d, radiusA: number, radiusB: number, capped?: boolean): Cone | undefined {\n const zDirection = centerA.vectorTo(centerB);\n const a = zDirection.magnitude();\n if (Geometry.isSmallMetricDistance(a)) return undefined;\n // force near-zero radii to true zero\n radiusA = Geometry.correctSmallMetricDistance(radiusA);\n radiusB = Geometry.correctSmallMetricDistance(radiusB);\n // cone tip may not be \"within\" the z range.\n if (radiusA * radiusB < 0.0) return undefined;\n // at least one must be nonzero.\n if (radiusA + radiusB === 0.0) return undefined;\n const matrix = Matrix3d.createRigidHeadsUp(zDirection);\n matrix.scaleColumns(1.0, 1.0, a, matrix);\n const localToWorld = Transform.createOriginAndMatrix(centerA, matrix);\n return new Cone(localToWorld, radiusA, radiusB, capped ?? false);\n }\n /**\n * Create a general cone from cross sections parallel to the plane spanned by the given vectors.\n * * Circular cross sections are indicated by perpendicular vectors of the same length.\n * * Elliptical cross sections are indicated by non-perpendicular vectors, or vectors of different lengths.\n * * Cross sectional planes do not have to be perpendicular to the axis line between centers.\n * * Cross section size is affected both by the given vector lengths and radii. To avoid unexpected scaling,\n * pass orthonormal vectors for circular cross sections, or unit radii for elliptical cross sections.\n * * There is no validation of the input radii. For best results, they should be nonnegative, and at least one should be nonzero.\n */\n public static createBaseAndTarget(centerA: Point3d, centerB: Point3d, vectorX: Vector3d, vectorY: Vector3d, radiusA: number, radiusB: number, capped?: boolean): Cone {\n radiusA = Math.abs(Geometry.correctSmallMetricDistance(radiusA));\n radiusB = Math.abs(Geometry.correctSmallMetricDistance(radiusB));\n const vectorZ = centerA.vectorTo(centerB);\n const localToWorld = Transform.createOriginAndMatrixColumns(centerA, vectorX, vectorY, vectorZ);\n return new Cone(localToWorld, radiusA, radiusB, capped ?? false);\n }\n\n /**\n * Create a circular cone from the typical parameters of the DGN file.\n * * This method calls [[createBaseAndTarget]] with normalized vectors, `vectorY` squared against `vectorX`, and\n * `radiusA` and `radiusB` scaled by the original length of `vectorX`.\n * * These restrictions allow the cone to be represented by an element in the DGN file.\n */\n public static createDgnCone(centerA: Point3d, centerB: Point3d, vectorX: Vector3d, vectorY: Vector3d, radiusA: number, radiusB: number, capped?: boolean): Cone | undefined {\n const rigidMatrix = Matrix3d.createRigidFromColumns(vectorX, vectorY, AxisOrder.XYZ);\n if (rigidMatrix) {\n const vectorXMag = vectorX.magnitude();\n return this.createBaseAndTarget(centerA, centerB, rigidMatrix.columnX(), rigidMatrix.columnY(), radiusA * vectorXMag, radiusB * vectorXMag, capped);\n }\n return undefined;\n }\n\n /** (Property accessor) Return the center point at the base plane */\n public getCenterA(): Point3d { return this._localToWorld.multiplyXYZ(0, 0, 0); }\n /** (Property accessor) */\n public getCenterB(): Point3d { return this._localToWorld.multiplyXYZ(0, 0, 1); }\n /** (Property accessor) Return the x vector in the local frame */\n public getVectorX(): Vector3d { return this._localToWorld.matrix.columnX(); }\n /** (Property accessor) Return the y vector in the local frame */\n public getVectorY(): Vector3d { return this._localToWorld.matrix.columnY(); }\n /** (Property accessor) return the radius at the base plane */\n public getRadiusA(): number { return this._radiusA; }\n /** (Property accessor) return the radius at the top plane */\n public getRadiusB(): number { return this._radiusB; }\n /** (Property accessor) return the larger of radiusA and radiusB */\n public getMaxRadius(): number { return this._maxRadius; }\n /** (Property accessor) return the radius at fraction `v` along the axis */\n public vFractionToRadius(v: number): number { return Geometry.interpolate(this._radiusA, v, this._radiusB); }\n /** (Property accessor) test if `other` is an instance of `Cone` */\n public isSameGeometryClass(other: any): boolean { return other instanceof Cone; }\n /** (Property accessor) Test for nearly equal coordinate data. */\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof Cone) {\n if (this.capped !== other.capped) return false;\n if (!this._localToWorld.isAlmostEqualAllowZRotation(other._localToWorld)) return false;\n return Geometry.isSameCoordinate(this._radiusA, other._radiusA)\n && Geometry.isSameCoordinate(this._radiusB, other._radiusB);\n }\n return false;\n }\n /** Second step of double dispatch: call `handler.handleCone(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleCone(this);\n }\n\n /**\n * return strokes for a cross-section (elliptic arc) at specified fraction v along the axis.\n * * fixedStrokeCount takes priority over stroke options.\n * * The linestring is created by LineString3d.createForStrokes (fixedStrokeCount, options), which sets up property according to the options:\n * * optional fractions member\n * * optional uvParams. uvParams are installed as full-scale distance parameters.\n * * optional derivatives.\n * @param v fractional position along the cone axis\n * @param fixedStrokeCount optional stroke count.\n * @param options optional stroke options.\n */\n public strokeConstantVSection(v: number, fixedStrokeCount?: number, options?: StrokeOptions): LineString3d {\n let strokeCount = 16;\n if (fixedStrokeCount !== undefined)\n strokeCount = fixedStrokeCount;\n else if (options !== undefined)\n strokeCount = options.defaultCircleStrokes; // NEEDS WORK -- get circle stroke count with this.maxRadius !!!\n else {\n // accept the local default\n }\n strokeCount = Geometry.clampToStartEnd(strokeCount, 4, 64);\n const r = this.vFractionToRadius(v);\n const result = LineString3d.createForStrokes(fixedStrokeCount, options);\n const twoPi = Math.PI * 2.0;\n const deltaRadians = twoPi / strokeCount;\n let radians = 0;\n const fractions = result.fractions; // possibly undefined !!!\n const derivatives = result.packedDerivatives; // possibly undefined !!!\n const uvParams = result.packedUVParams; // possibly undefined !!\n const surfaceNormals = result.packedSurfaceNormals;\n const xyz = Point3d.create();\n const dXdu = Vector3d.create();\n const dXdv = Vector3d.create();\n const normal = Vector3d.create();\n const transform = this._localToWorld;\n let rc, rs, cc, ss;\n for (let i = 0; i <= strokeCount; i++) {\n if (i * 2 <= strokeCount)\n radians = i * deltaRadians;\n else\n radians = (i - strokeCount) * deltaRadians;\n cc = Math.cos(radians);\n ss = Math.sin(radians);\n rc = r * cc;\n rs = r * ss;\n\n transform.multiplyXYZ(rc, rs, v, xyz);\n result.addPoint(xyz);\n if (fractions)\n fractions.push(i / strokeCount);\n if (derivatives) {\n transform.matrix.multiplyXYZ(-rs * twoPi, rc * twoPi, 0.0, dXdu);\n derivatives.push(dXdu);\n }\n if (surfaceNormals) {\n // the along-hoop vector does not need to be scaled by radius -- just need the direction for a cross product.\n transform.matrix.multiplyXYZ(-ss, cc, 0.0, dXdu);\n transform.matrix.multiplyXYZ(0, 0, 1, dXdv);\n dXdu.unitCrossProduct(dXdv, normal);\n surfaceNormals.push(normal);\n }\n if (uvParams) {\n uvParams.pushXY(i / strokeCount, v);\n }\n }\n return result;\n }\n /**\n * Return the Arc3d section at vFraction\n * @param vFraction fractional position along the sweep direction\n */\n public constantVSection(vFraction: number): CurveCollection | undefined {\n const r = this.vFractionToRadius(vFraction);\n const transform = this._localToWorld;\n const center = transform.multiplyXYZ(0, 0, vFraction);\n const vector0 = transform.matrix.multiplyXYZ(r, 0, 0);\n const vector90 = transform.matrix.multiplyXYZ(0, r, 0);\n return Loop.create(Arc3d.create(center, vector0, vector90));\n }\n /** Extend `rangeToExtend` so it includes this `Cone` instance. */\n public extendRange(rangeToExtend: Range3d, transform?: Transform): void {\n const arc0 = this.constantVSection(0.0)!;\n const arc1 = this.constantVSection(1.0)!;\n arc0.extendRange(rangeToExtend, transform);\n arc1.extendRange(rangeToExtend, transform);\n }\n /** Evaluate a point on the Cone surfaces, with\n * * v = 0 is the base plane.\n * * v = 1 is the top plane\n * * u = 0 to u = 1 wraps the angular range.\n */\n public uvFractionToPoint(uFraction: number, vFraction: number, result?: Point3d): Point3d {\n const theta = uFraction * Math.PI * 2.0;\n const r = Geometry.interpolate(this._radiusA, vFraction, this._radiusB);\n const cosTheta = Math.cos(theta);\n const sinTheta = Math.sin(theta);\n return this._localToWorld.multiplyXYZ(r * cosTheta, r * sinTheta, vFraction, result);\n }\n /** Evaluate a point tangent plane on the Cone surfaces, with\n * * v = 0 is the base plane.\n * * v = 1 is the top plane\n * * u = 0 to u = 1 wraps the angular range.\n */\n public uvFractionToPointAndTangents(uFraction: number, vFraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n const theta = uFraction * Math.PI * 2.0;\n const r = Geometry.interpolate(this._radiusA, vFraction, this._radiusB);\n const drdv = this._radiusB - this._radiusA;\n const cosTheta = Math.cos(theta);\n const sinTheta = Math.sin(theta);\n const fTheta = 2.0 * Math.PI;\n return Plane3dByOriginAndVectors.createOriginAndVectors(\n this._localToWorld.multiplyXYZ(r * cosTheta, r * sinTheta, vFraction),\n this._localToWorld.multiplyVectorXYZ(-r * sinTheta * fTheta, r * cosTheta * fTheta, 0),\n this._localToWorld.multiplyVectorXYZ(drdv * cosTheta, drdv * sinTheta, 1.0),\n result);\n }\n /**\n * @return true if this is a closed volume.\n */\n public get isClosedVolume(): boolean {\n return this.capped;\n }\n /**\n * Directional distance query\n * * u direction is around longitude circle at maximum distance from axis.\n * * v direction is on a line of longitude between the latitude limits.\n */\n public maxIsoParametricDistance(): Vector2d {\n const vectorX = this._localToWorld.matrix.columnX();\n const vectorY = this._localToWorld.matrix.columnY();\n const columnZ = this._localToWorld.matrix.columnZ();\n\n const xyNormal = vectorX.unitCrossProduct(vectorY)!;\n const hZ = xyNormal.dotProduct(columnZ);\n const zSkewVector = columnZ.plusScaled(xyNormal, hZ);\n const zSkewDistance = zSkewVector.magnitudeXY();\n return Vector2d.create(Math.PI * 2 * Math.max(this._radiusA, this._radiusB),\n Geometry.hypotenuseXY(Math.abs(this._radiusB - this._radiusA) + zSkewDistance, hZ));\n }\n}\n"]}
|
|
@@ -12,10 +12,9 @@ import { XAndY } from "../geometry3d/XYZProps";
|
|
|
12
12
|
import { SolidPrimitive } from "./SolidPrimitive";
|
|
13
13
|
import { SweepContour } from "./SweepContour";
|
|
14
14
|
/**
|
|
15
|
-
* A LinearSweep is a `SolidPrimitive` defined by
|
|
16
|
-
* * A set of curves (any Loop, Path, or parityRegion)
|
|
15
|
+
* A LinearSweep is a `SolidPrimitive` defined by:
|
|
16
|
+
* * A set of curves (any Loop, Path, or parityRegion). If the object is "capped", the curves must be planar.
|
|
17
17
|
* * A sweep vector
|
|
18
|
-
* If the object is "capped", the curves must be planar.
|
|
19
18
|
* @public
|
|
20
19
|
*/
|
|
21
20
|
export declare class LinearSweep extends SolidPrimitive {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinearSweep.d.ts","sourceRoot":"","sources":["../../../src/solid/LinearSweep.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIvD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;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C,6EAA6E;IACtE,kBAAkB,IAAI,YAAY;IACzC,yCAAyC;IAClC,gBAAgB,IAAI,QAAQ;IACnC,2DAA2D;IACpD,mBAAmB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO;IAC/C,0BAA0B;IACnB,KAAK,IAAI,WAAW;IAG3B;;;OAGG;IACI,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO;IAezD;;;;OAIG;IACI,oBAAoB,IAAI,SAAS,GAAG,SAAS;IAGpD;;;OAGG;IACI,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS;IAItE,uDAAuD;IACvC,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;IAQ5D,8DAA8D;IACvD,yBAAyB,CAAC,OAAO,EAAE,eAAe,GAAG,GAAG;IAG/D;;;OAGG;IACI,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAMvE,uDAAuD;IAChD,WAAW,CAAC,aAAa,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS;IAahE;;OAEG;IACH,IAAW,cAAc,IAAI,OAAO,CAEnC;CACF"}
|
|
@@ -11,10 +11,9 @@ import { Transform } from "../geometry3d/Transform";
|
|
|
11
11
|
import { SolidPrimitive } from "./SolidPrimitive";
|
|
12
12
|
import { SweepContour } from "./SweepContour";
|
|
13
13
|
/**
|
|
14
|
-
* A LinearSweep is a `SolidPrimitive` defined by
|
|
15
|
-
* * A set of curves (any Loop, Path, or parityRegion)
|
|
14
|
+
* A LinearSweep is a `SolidPrimitive` defined by:
|
|
15
|
+
* * A set of curves (any Loop, Path, or parityRegion). If the object is "capped", the curves must be planar.
|
|
16
16
|
* * A sweep vector
|
|
17
|
-
* If the object is "capped", the curves must be planar.
|
|
18
17
|
* @public
|
|
19
18
|
*/
|
|
20
19
|
export class LinearSweep extends SolidPrimitive {
|
|
@@ -80,11 +79,16 @@ export class LinearSweep extends SolidPrimitive {
|
|
|
80
79
|
tryTransformInPlace(transform) {
|
|
81
80
|
if (transform.matrix.isSingular())
|
|
82
81
|
return false;
|
|
83
|
-
if (this._contour.tryTransformInPlace(transform))
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
if (!this._contour.tryTransformInPlace(transform))
|
|
83
|
+
return false;
|
|
84
|
+
transform.multiplyVector(this._direction, this._direction);
|
|
85
|
+
if (transform.matrix.determinant() < 0.0) {
|
|
86
|
+
// if mirror, reverse the sweep (origin and direction) to preserve outward normals
|
|
87
|
+
if (!this._contour.tryTransformInPlace(Transform.createTranslation(this._direction)))
|
|
88
|
+
return false;
|
|
89
|
+
this._direction.scaleInPlace(-1.0);
|
|
86
90
|
}
|
|
87
|
-
return
|
|
91
|
+
return true;
|
|
88
92
|
}
|
|
89
93
|
/** Return a coordinate frame (right handed unit vectors)
|
|
90
94
|
* * origin on base contour
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinearSweep.js","sourceRoot":"","sources":["../../../src/solid/LinearSweep.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAS/F,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,OAAO,WAAY,SAAQ,cAAc;IAC7C,wCAAwC;IACxB,kBAAkB,GAAG,aAAa,CAAC;IAE3C,QAAQ,CAAe;IACvB,UAAU,CAAW;IAE7B,YAAoB,OAAqB,EAA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AC,IAAI,CAAC,UAAU,CAAC,CAAC;QAChD,CAAC;QACD,aAAa,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAC1C,CAAC;IACD;;OAEG;IACH,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC;IAC7D,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Solid\n */\n\nimport { AnyCurve } from \"../curve/CurveTypes\";\nimport { CurveCollection } from \"../curve/CurveCollection\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { LineString3d } from \"../curve/LineString3d\";\nimport { Loop } from \"../curve/Loop\";\nimport { Path } from \"../curve/Path\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { PolygonOps } from \"../geometry3d/PolygonOps\";\nimport { Range3d } from \"../geometry3d/Range\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { XAndY } from \"../geometry3d/XYZProps\";\nimport { SolidPrimitive } from \"./SolidPrimitive\";\nimport { SweepContour } from \"./SweepContour\";\n\n/**\n * A LinearSweep is a `SolidPrimitive` defined by\n * * A set of curves (any Loop, Path, or parityRegion)\n * * A sweep vector\n * If the object is \"capped\", the curves must be planar.\n * @public\n */\nexport class LinearSweep extends SolidPrimitive {\n /** String name for schema properties */\n public readonly solidPrimitiveType = \"linearSweep\";\n\n private _contour: SweepContour;\n private _direction: Vector3d;\n\n private constructor(contour: SweepContour, direction: Vector3d, capped: boolean) {\n super(capped);\n this._contour = contour;\n this._direction = direction;\n }\n /**\n * Create a sweep of a starting contour.\n * @param contour contour to be swept, CAPTURED\n * @param direction sweep vector. The contour is swept the full length of the vector.\n * @param capped true to include end caps\n */\n public static create(contour: AnyCurve, direction: Vector3d, capped: boolean): LinearSweep | undefined {\n const sweepable = SweepContour.createForLinearSweep(contour, direction);\n if (!sweepable)\n return undefined;\n return new LinearSweep(sweepable, direction, capped);\n }\n /** Create a z-direction sweep of the polyline or polygon given as xy linestring values.\n * * If not capped, the xyPoints array is always used unchanged.\n * * If capped but the xyPoints array does not close, exact closure will be enforced by one of these:\n * * * If the final point is almost equal to the first, it is replaced by the exact first point.\n * * * if the final point is not close to the first an extra point is added.\n * * If capped, the point order will be reversed if necessary to produce positive volume.\n * @param xyPoints array of xy coordinates\n * @param z z value to be used for all coordinates\n * @param zSweep the sweep distance in the z direction.\n * @param capped true if caps are to be added.\n */\n public static createZSweep(xyPoints: XAndY[], z: number, zSweep: number, capped: boolean): LinearSweep | undefined {\n const xyz = LineString3d.createXY(xyPoints, z, capped);\n if (capped) {\n xyz.addClosurePoint();\n const area = PolygonOps.areaXY(xyz.points);\n if (area * zSweep < 0.0)\n xyz.points.reverse();\n }\n const contour: CurveCollection = capped ? Loop.create(xyz) : Path.create(xyz);\n return LinearSweep.create(contour, Vector3d.create(0, 0, zSweep), capped);\n }\n /** get a reference to the swept curves */\n public getCurvesRef(): CurveCollection { return this._contour.curves; }\n /** Get a reference to the `SweepContour` carrying the plane of the curves */\n public getSweepContourRef(): SweepContour { return this._contour; }\n /** return a clone of the sweep vector */\n public cloneSweepVector(): Vector3d { return this._direction.clone(); }\n /** Test if `other` is also an instance of `LinearSweep` */\n public isSameGeometryClass(other: any): boolean { return other instanceof LinearSweep; }\n /** Return a deep clone */\n public clone(): LinearSweep {\n return new LinearSweep(this._contour.clone(), this._direction.clone(), this.capped);\n }\n /**\n * Apply a transform to the curves and sweep vector\n * * This fails if the transformation is singular.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n if (transform.matrix.isSingular())\n return false;\n if (this._contour.tryTransformInPlace(transform)) {\n transform.multiplyVector(this._direction, this._direction);\n return true;\n }\n return false;\n }\n\n /** Return a coordinate frame (right handed unit vectors)\n * * origin on base contour\n * * x, y directions from base contour.\n * * z direction perpendicular\n */\n public getConstructiveFrame(): Transform | undefined {\n return this._contour.localToWorld.cloneRigid();\n }\n /**\n * Return a transformed clone.\n * * This fails if the transformation is singular.\n */\n public cloneTransformed(transform: Transform): LinearSweep | undefined {\n const result = this.clone();\n return result.tryTransformInPlace(transform) ? result : undefined;\n }\n /** Test for near-equality of coordinates in `other` */\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof LinearSweep) {\n return this._contour.isAlmostEqual(other._contour)\n && this._direction.isAlmostEqual(other._direction)\n && this.capped === other.capped;\n }\n return false;\n }\n /** Invoke strongly typed `handler.handleLinearSweep(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleLinearSweep(this);\n }\n /**\n * Return the curves at a fraction along the sweep direction.\n * @param vFraction fractional position along the sweep direction\n */\n public constantVSection(vFraction: number): CurveCollection | undefined {\n const section = this._contour.curves.clone();\n if (section && vFraction !== 0.0)\n section.tryTransformInPlace(Transform.createTranslation(this._direction.scale(vFraction)));\n return section;\n }\n /** Extend `rangeToExtend` to include this geometry. */\n public extendRange(rangeToExtend: Range3d, transform?: Transform) {\n const contourRange = this._contour.curves.range(transform);\n rangeToExtend.extendRange(contourRange);\n if (transform) {\n const transformedDirection = transform.multiplyVector(this._direction);\n contourRange.low.addInPlace(transformedDirection);\n contourRange.high.addInPlace(transformedDirection);\n } else {\n contourRange.low.addInPlace(this._direction);\n contourRange.high.addInPlace(this._direction);\n }\n rangeToExtend.extendRange(contourRange);\n }\n /**\n * @return true if this is a closed volume.\n */\n public get isClosedVolume(): boolean {\n return this.capped && this._contour.curves.isAnyRegionType;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"LinearSweep.js","sourceRoot":"","sources":["../../../src/solid/LinearSweep.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAS/F,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAA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,KAAK,EAAE,CAAC;QAC7C,IAAI,OAAO,IAAI,SAAS,KAAK,GAAG;YAC9B,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC7F,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,uDAAuD;IAChD,WAAW,CAAC,aAAsB,EAAE,SAAqB;QAC9D,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC3D,aAAa,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QACxC,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,oBAAoB,GAAG,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YACvE,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;YAClD,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;QACrD,CAAC;aAAM,CAAC;YACN,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC7C,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAChD,CAAC;QACD,aAAa,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAC1C,CAAC;IACD;;OAEG;IACH,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC;IAC7D,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Solid\n */\n\nimport { AnyCurve } from \"../curve/CurveTypes\";\nimport { CurveCollection } from \"../curve/CurveCollection\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { LineString3d } from \"../curve/LineString3d\";\nimport { Loop } from \"../curve/Loop\";\nimport { Path } from \"../curve/Path\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { PolygonOps } from \"../geometry3d/PolygonOps\";\nimport { Range3d } from \"../geometry3d/Range\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { XAndY } from \"../geometry3d/XYZProps\";\nimport { SolidPrimitive } from \"./SolidPrimitive\";\nimport { SweepContour } from \"./SweepContour\";\n\n/**\n * A LinearSweep is a `SolidPrimitive` defined by:\n * * A set of curves (any Loop, Path, or parityRegion). If the object is \"capped\", the curves must be planar.\n * * A sweep vector\n * @public\n */\nexport class LinearSweep extends SolidPrimitive {\n /** String name for schema properties */\n public readonly solidPrimitiveType = \"linearSweep\";\n\n private _contour: SweepContour;\n private _direction: Vector3d;\n\n private constructor(contour: SweepContour, direction: Vector3d, capped: boolean) {\n super(capped);\n this._contour = contour;\n this._direction = direction;\n }\n /**\n * Create a sweep of a starting contour.\n * @param contour contour to be swept, CAPTURED\n * @param direction sweep vector. The contour is swept the full length of the vector.\n * @param capped true to include end caps\n */\n public static create(contour: AnyCurve, direction: Vector3d, capped: boolean): LinearSweep | undefined {\n const sweepable = SweepContour.createForLinearSweep(contour, direction);\n if (!sweepable)\n return undefined;\n return new LinearSweep(sweepable, direction, capped);\n }\n /** Create a z-direction sweep of the polyline or polygon given as xy linestring values.\n * * If not capped, the xyPoints array is always used unchanged.\n * * If capped but the xyPoints array does not close, exact closure will be enforced by one of these:\n * * * If the final point is almost equal to the first, it is replaced by the exact first point.\n * * * if the final point is not close to the first an extra point is added.\n * * If capped, the point order will be reversed if necessary to produce positive volume.\n * @param xyPoints array of xy coordinates\n * @param z z value to be used for all coordinates\n * @param zSweep the sweep distance in the z direction.\n * @param capped true if caps are to be added.\n */\n public static createZSweep(xyPoints: XAndY[], z: number, zSweep: number, capped: boolean): LinearSweep | undefined {\n const xyz = LineString3d.createXY(xyPoints, z, capped);\n if (capped) {\n xyz.addClosurePoint();\n const area = PolygonOps.areaXY(xyz.points);\n if (area * zSweep < 0.0)\n xyz.points.reverse();\n }\n const contour: CurveCollection = capped ? Loop.create(xyz) : Path.create(xyz);\n return LinearSweep.create(contour, Vector3d.create(0, 0, zSweep), capped);\n }\n /** get a reference to the swept curves */\n public getCurvesRef(): CurveCollection { return this._contour.curves; }\n /** Get a reference to the `SweepContour` carrying the plane of the curves */\n public getSweepContourRef(): SweepContour { return this._contour; }\n /** return a clone of the sweep vector */\n public cloneSweepVector(): Vector3d { return this._direction.clone(); }\n /** Test if `other` is also an instance of `LinearSweep` */\n public isSameGeometryClass(other: any): boolean { return other instanceof LinearSweep; }\n /** Return a deep clone */\n public clone(): LinearSweep {\n return new LinearSweep(this._contour.clone(), this._direction.clone(), this.capped);\n }\n /**\n * Apply a transform to the curves and sweep vector\n * * This fails if the transformation is singular.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n if (transform.matrix.isSingular())\n return false;\n if (!this._contour.tryTransformInPlace(transform))\n return false;\n transform.multiplyVector(this._direction, this._direction);\n if (transform.matrix.determinant() < 0.0) {\n // if mirror, reverse the sweep (origin and direction) to preserve outward normals\n if (!this._contour.tryTransformInPlace(Transform.createTranslation(this._direction)))\n return false;\n this._direction.scaleInPlace(-1.0);\n }\n return true;\n }\n\n /** Return a coordinate frame (right handed unit vectors)\n * * origin on base contour\n * * x, y directions from base contour.\n * * z direction perpendicular\n */\n public getConstructiveFrame(): Transform | undefined {\n return this._contour.localToWorld.cloneRigid();\n }\n /**\n * Return a transformed clone.\n * * This fails if the transformation is singular.\n */\n public cloneTransformed(transform: Transform): LinearSweep | undefined {\n const result = this.clone();\n return result.tryTransformInPlace(transform) ? result : undefined;\n }\n /** Test for near-equality of coordinates in `other` */\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof LinearSweep) {\n return this._contour.isAlmostEqual(other._contour)\n && this._direction.isAlmostEqual(other._direction)\n && this.capped === other.capped;\n }\n return false;\n }\n /** Invoke strongly typed `handler.handleLinearSweep(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleLinearSweep(this);\n }\n /**\n * Return the curves at a fraction along the sweep direction.\n * @param vFraction fractional position along the sweep direction\n */\n public constantVSection(vFraction: number): CurveCollection | undefined {\n const section = this._contour.curves.clone();\n if (section && vFraction !== 0.0)\n section.tryTransformInPlace(Transform.createTranslation(this._direction.scale(vFraction)));\n return section;\n }\n /** Extend `rangeToExtend` to include this geometry. */\n public extendRange(rangeToExtend: Range3d, transform?: Transform) {\n const contourRange = this._contour.curves.range(transform);\n rangeToExtend.extendRange(contourRange);\n if (transform) {\n const transformedDirection = transform.multiplyVector(this._direction);\n contourRange.low.addInPlace(transformedDirection);\n contourRange.high.addInPlace(transformedDirection);\n } else {\n contourRange.low.addInPlace(this._direction);\n contourRange.high.addInPlace(this._direction);\n }\n rangeToExtend.extendRange(contourRange);\n }\n /**\n * @return true if this is a closed volume.\n */\n public get isClosedVolume(): boolean {\n return this.capped && this._contour.curves.isAnyRegionType;\n }\n}\n"]}
|
|
@@ -12,8 +12,8 @@ import { Transform } from "../geometry3d/Transform";
|
|
|
12
12
|
import { SolidPrimitive } from "./SolidPrimitive";
|
|
13
13
|
import { SweepContour } from "./SweepContour";
|
|
14
14
|
/**
|
|
15
|
-
* A RotationalSweep is
|
|
16
|
-
* * A planar contour (any Loop, Path, or parityRegion)
|
|
15
|
+
* A RotationalSweep is:
|
|
16
|
+
* * A planar contour (any Loop, Path, or parityRegion)
|
|
17
17
|
* * An axis vector.
|
|
18
18
|
* * The planar contour is expected to be in the plane of the axis vector.
|
|
19
19
|
* * The contour may have points and/or lines that are on the axis, but otherwise is entirely on one side of the axis.
|
|
@@ -10,8 +10,8 @@ import { Transform } from "../geometry3d/Transform";
|
|
|
10
10
|
import { SolidPrimitive } from "./SolidPrimitive";
|
|
11
11
|
import { SweepContour } from "./SweepContour";
|
|
12
12
|
/**
|
|
13
|
-
* A RotationalSweep is
|
|
14
|
-
* * A planar contour (any Loop, Path, or parityRegion)
|
|
13
|
+
* A RotationalSweep is:
|
|
14
|
+
* * A planar contour (any Loop, Path, or parityRegion)
|
|
15
15
|
* * An axis vector.
|
|
16
16
|
* * The planar contour is expected to be in the plane of the axis vector.
|
|
17
17
|
* * The contour may have points and/or lines that are on the axis, but otherwise is entirely on one side of the axis.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RotationalSweep.js","sourceRoot":"","sources":["../../../src/solid/RotationalSweep.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAS/F,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,OAAO,eAAgB,SAAQ,cAAc;IACjD,wCAAwC;IACxB,kBAAkB,GAAG,iBAAiB,CAAC;IAE/C,QAAQ,CAAe;IACvB,eAAe,CAAQ;IACvB,WAAW,CAAQ;IAC3B,YAAoB,OAAqB,EAAE,cAAqB,EAAE,UAAiB,EAAE,MAAe;QAClG,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;QACtC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IACD;;;;;;OAMG;IACI,M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AAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC3D,MAAM,OAAO,GAAG,QAAQ,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAChF,MAAM,aAAa,GAAG,SAAS,CAAC,cAAc,EAAE,CAAC;QACjD,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,kBAAkB,GAAG,SAAS,CAAC,cAAc,EAAE,CAAC;YACtD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC;gBAClC,SAAS,CAAC,0BAA0B,CAClC,IAAI,CAAC,8BAA8B,CAAC,CAAC,GAAG,OAAO,EAAE,aAAa,CAAC,EAAE,kBAAkB,CACpF,CAAC;gBACF,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;YACjD,CAAC;QACH,CAAC;aAAM,CAAC;YACN,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,OAAO,EAAE,CAAC,EAAE;gBAC/B,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,8BAA8B,CAAC,CAAC,GAAG,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;QAChG,CAAC;IACH,CAAC;IACD,kDAAkD;IAClD,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC;IACtD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Solid\n */\n\nimport { AnyCurve } from \"../curve/CurveTypes\";\nimport { CurveCollection } from \"../curve/CurveCollection\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\nimport { AxisOrder, Geometry } from \"../Geometry\";\nimport { Angle } from \"../geometry3d/Angle\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\nimport { Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { SolidPrimitive } from \"./SolidPrimitive\";\nimport { SweepContour } from \"./SweepContour\";\n\n/**\n * A RotationalSweep is\n * * A planar contour (any Loop, Path, or parityRegion).\n * * An axis vector.\n * * The planar contour is expected to be in the plane of the axis vector.\n * * The contour may have points and/or lines that are on the axis, but otherwise is entirely on one side of the axis.\n * * A sweep angle.\n * @public\n */\nexport class RotationalSweep extends SolidPrimitive {\n /** String name for schema properties */\n public readonly solidPrimitiveType = \"rotationalSweep\";\n\n private _contour: SweepContour;\n private _normalizedAxis: Ray3d;\n private _sweepAngle: Angle;\n private constructor(contour: SweepContour, normalizedAxis: Ray3d, sweepAngle: Angle, capped: boolean) {\n super(capped);\n this._contour = contour;\n this._normalizedAxis = normalizedAxis;\n this._sweepAngle = sweepAngle;\n }\n /**\n * Create a rotational sweep.\n * @param contour profile to sweep, coplanar with axis (CAPTURED).\n * @param axis rotation axis.\n * @param sweepAngle signed angular sweep.\n * @param capped whether to cap the surface to make a solid.\n */\n public static create(contour: AnyCurve, axis: Ray3d, sweepAngle: Angle, capped: boolean): RotationalSweep | undefined {\n if (!axis.direction.normalizeInPlace())\n return undefined;\n const sweepable = SweepContour.createForRotation(contour, axis);\n if (!sweepable)\n return undefined;\n return new RotationalSweep(sweepable, axis, sweepAngle.clone(), capped);\n }\n /**\n * Return a coordinate frame (right handed unit vectors).\n * * origin at origin of rotation ray.\n * * z direction along the rotation ray.\n * * y direction perpendicular to the base contour plane.\n */\n public getConstructiveFrame(): Transform | undefined {\n const contourPerpendicular = this._contour.localToWorld.matrix.columnZ();\n const axes = Matrix3d.createRigidFromColumns(contourPerpendicular, this._normalizedAxis.direction, AxisOrder.YZX);\n if (axes) {\n return Transform.createOriginAndMatrix(this._normalizedAxis.origin, axes);\n }\n return undefined;\n }\n /** Return clone of (not reference to) the axis vector. */\n public cloneAxisRay(): Ray3d {\n return this._normalizedAxis.clone();\n }\n /** Return (REFERENCE TO) the swept curves. */\n public getCurves(): CurveCollection {\n return this._contour.curves;\n }\n /** Return (REFERENCE TO) the swept curves with containing plane markup. */\n public getSweepContourRef(): SweepContour {\n return this._contour;\n }\n /** Return the sweep angle. */\n public getSweep(): Angle {\n return this._sweepAngle.clone();\n }\n /** Test if `other` is a `RotationalSweep` */\n public isSameGeometryClass(other: any): boolean {\n return other instanceof RotationalSweep;\n }\n /** Test for same axis, capping, and swept geometry. */\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof RotationalSweep) {\n return this._contour.isAlmostEqual(other._contour)\n && this._normalizedAxis.isAlmostEqual(other._normalizedAxis)\n && this._sweepAngle.isAlmostEqual(other._sweepAngle)\n && this.capped === other.capped;\n }\n return false;\n }\n /** Return a deep clone */\n public clone(): RotationalSweep {\n return new RotationalSweep(this._contour.clone(), this._normalizedAxis.clone(), this._sweepAngle.clone(), this.capped);\n }\n /**\n * Transform the contour and axis.\n * * This fails if the transformation is singular.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n if (transform.matrix.isSingular())\n return false;\n if (this._contour.tryTransformInPlace(transform)) {\n this._normalizedAxis.transformInPlace(transform);\n if (transform.matrix.determinant() < 0.0)\n this._sweepAngle.setRadians(-this._sweepAngle.radians);\n return this._normalizedAxis.direction.normalizeInPlace();\n }\n return false;\n }\n /**\n * Return a transformed clone.\n * * This fails if the transformation is singular.\n */\n public cloneTransformed(transform: Transform): RotationalSweep | undefined {\n const result = this.clone();\n return result.tryTransformInPlace(transform) ? result : undefined;\n }\n /** Dispatch to strongly typed handler `handler.handleRotationalSweep(this)`. */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleRotationalSweep(this);\n }\n /** Return a transform that rotates around the rotational axis by a fraction of the total sweep. */\n public getFractionalRotationTransform(vFraction: number, result?: Transform): Transform {\n const radians = this._sweepAngle.radians * vFraction;\n const rotation = Transform.createFixedPointAndMatrix(this._normalizedAxis.origin,\n Matrix3d.createRotationAroundVector(this._normalizedAxis.direction, Angle.createRadians(radians),\n result ? result.matrix : undefined) as Matrix3d);\n return rotation;\n }\n /**\n * Return the curves of a constant-v section of the solid.\n * @param vFraction fractional position along the sweep direction\n */\n public constantVSection(vFraction: number): CurveCollection | undefined {\n const section = this._contour.curves.clone();\n if (section) {\n section.tryTransformInPlace(this.getFractionalRotationTransform(vFraction));\n }\n return section;\n }\n /** Extend range using sampled points on the surface. */\n public extendRange(range: Range3d, transform?: Transform) {\n const degreeStep = 360 / 32;\n const options = StrokeOptions.createForCurves();\n options.angleTol = Angle.createDegrees(degreeStep);\n const strokes = this._contour.curves.cloneStroked(options);\n const numStep = Geometry.stepCount(degreeStep, this._sweepAngle.degrees, 4, 32);\n const stepTransform = Transform.createIdentity();\n if (transform) {\n const compositeTransform = Transform.createIdentity();\n for (let i = 0; i <= numStep; i++) {\n transform.multiplyTransformTransform(\n this.getFractionalRotationTransform(i / numStep, stepTransform), compositeTransform,\n );\n strokes.extendRange(range, compositeTransform);\n }\n } else {\n for (let i = 0; i <= numStep; i++)\n strokes.extendRange(range, this.getFractionalRotationTransform(i / numStep, stepTransform));\n }\n }\n /** Specify if the sweep forms a closed volume. */\n public get isClosedVolume(): boolean {\n return this.capped || this._sweepAngle.isFullCircle;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"RotationalSweep.js","sourceRoot":"","sources":["../../../src/solid/RotationalSweep.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAS/F,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAA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AAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;YACjD,CAAC;QACH,CAAC;aAAM,CAAC;YACN,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,OAAO,EAAE,CAAC,EAAE;gBAC/B,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,8BAA8B,CAAC,CAAC,GAAG,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;QAChG,CAAC;IACH,CAAC;IACD,kDAAkD;IAClD,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC;IACtD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Solid\n */\n\nimport { AnyCurve } from \"../curve/CurveTypes\";\nimport { CurveCollection } from \"../curve/CurveCollection\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\nimport { AxisOrder, Geometry } from \"../Geometry\";\nimport { Angle } from \"../geometry3d/Angle\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\nimport { Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { SolidPrimitive } from \"./SolidPrimitive\";\nimport { SweepContour } from \"./SweepContour\";\n\n/**\n * A RotationalSweep is:\n * * A planar contour (any Loop, Path, or parityRegion)\n * * An axis vector.\n * * The planar contour is expected to be in the plane of the axis vector.\n * * The contour may have points and/or lines that are on the axis, but otherwise is entirely on one side of the axis.\n * * A sweep angle.\n * @public\n */\nexport class RotationalSweep extends SolidPrimitive {\n /** String name for schema properties */\n public readonly solidPrimitiveType = \"rotationalSweep\";\n\n private _contour: SweepContour;\n private _normalizedAxis: Ray3d;\n private _sweepAngle: Angle;\n private constructor(contour: SweepContour, normalizedAxis: Ray3d, sweepAngle: Angle, capped: boolean) {\n super(capped);\n this._contour = contour;\n this._normalizedAxis = normalizedAxis;\n this._sweepAngle = sweepAngle;\n }\n /**\n * Create a rotational sweep.\n * @param contour profile to sweep, coplanar with axis (CAPTURED).\n * @param axis rotation axis.\n * @param sweepAngle signed angular sweep.\n * @param capped whether to cap the surface to make a solid.\n */\n public static create(contour: AnyCurve, axis: Ray3d, sweepAngle: Angle, capped: boolean): RotationalSweep | undefined {\n if (!axis.direction.normalizeInPlace())\n return undefined;\n const sweepable = SweepContour.createForRotation(contour, axis);\n if (!sweepable)\n return undefined;\n return new RotationalSweep(sweepable, axis, sweepAngle.clone(), capped);\n }\n /**\n * Return a coordinate frame (right handed unit vectors).\n * * origin at origin of rotation ray.\n * * z direction along the rotation ray.\n * * y direction perpendicular to the base contour plane.\n */\n public getConstructiveFrame(): Transform | undefined {\n const contourPerpendicular = this._contour.localToWorld.matrix.columnZ();\n const axes = Matrix3d.createRigidFromColumns(contourPerpendicular, this._normalizedAxis.direction, AxisOrder.YZX);\n if (axes) {\n return Transform.createOriginAndMatrix(this._normalizedAxis.origin, axes);\n }\n return undefined;\n }\n /** Return clone of (not reference to) the axis vector. */\n public cloneAxisRay(): Ray3d {\n return this._normalizedAxis.clone();\n }\n /** Return (REFERENCE TO) the swept curves. */\n public getCurves(): CurveCollection {\n return this._contour.curves;\n }\n /** Return (REFERENCE TO) the swept curves with containing plane markup. */\n public getSweepContourRef(): SweepContour {\n return this._contour;\n }\n /** Return the sweep angle. */\n public getSweep(): Angle {\n return this._sweepAngle.clone();\n }\n /** Test if `other` is a `RotationalSweep` */\n public isSameGeometryClass(other: any): boolean {\n return other instanceof RotationalSweep;\n }\n /** Test for same axis, capping, and swept geometry. */\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof RotationalSweep) {\n return this._contour.isAlmostEqual(other._contour)\n && this._normalizedAxis.isAlmostEqual(other._normalizedAxis)\n && this._sweepAngle.isAlmostEqual(other._sweepAngle)\n && this.capped === other.capped;\n }\n return false;\n }\n /** Return a deep clone */\n public clone(): RotationalSweep {\n return new RotationalSweep(this._contour.clone(), this._normalizedAxis.clone(), this._sweepAngle.clone(), this.capped);\n }\n /**\n * Transform the contour and axis.\n * * This fails if the transformation is singular.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n if (transform.matrix.isSingular())\n return false;\n if (this._contour.tryTransformInPlace(transform)) {\n this._normalizedAxis.transformInPlace(transform);\n if (transform.matrix.determinant() < 0.0)\n this._sweepAngle.setRadians(-this._sweepAngle.radians);\n return this._normalizedAxis.direction.normalizeInPlace();\n }\n return false;\n }\n /**\n * Return a transformed clone.\n * * This fails if the transformation is singular.\n */\n public cloneTransformed(transform: Transform): RotationalSweep | undefined {\n const result = this.clone();\n return result.tryTransformInPlace(transform) ? result : undefined;\n }\n /** Dispatch to strongly typed handler `handler.handleRotationalSweep(this)`. */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleRotationalSweep(this);\n }\n /** Return a transform that rotates around the rotational axis by a fraction of the total sweep. */\n public getFractionalRotationTransform(vFraction: number, result?: Transform): Transform {\n const radians = this._sweepAngle.radians * vFraction;\n const rotation = Transform.createFixedPointAndMatrix(this._normalizedAxis.origin,\n Matrix3d.createRotationAroundVector(this._normalizedAxis.direction, Angle.createRadians(radians),\n result ? result.matrix : undefined) as Matrix3d);\n return rotation;\n }\n /**\n * Return the curves of a constant-v section of the solid.\n * @param vFraction fractional position along the sweep direction\n */\n public constantVSection(vFraction: number): CurveCollection | undefined {\n const section = this._contour.curves.clone();\n if (section) {\n section.tryTransformInPlace(this.getFractionalRotationTransform(vFraction));\n }\n return section;\n }\n /** Extend range using sampled points on the surface. */\n public extendRange(range: Range3d, transform?: Transform) {\n const degreeStep = 360 / 32;\n const options = StrokeOptions.createForCurves();\n options.angleTol = Angle.createDegrees(degreeStep);\n const strokes = this._contour.curves.cloneStroked(options);\n const numStep = Geometry.stepCount(degreeStep, this._sweepAngle.degrees, 4, 32);\n const stepTransform = Transform.createIdentity();\n if (transform) {\n const compositeTransform = Transform.createIdentity();\n for (let i = 0; i <= numStep; i++) {\n transform.multiplyTransformTransform(\n this.getFractionalRotationTransform(i / numStep, stepTransform), compositeTransform,\n );\n strokes.extendRange(range, compositeTransform);\n }\n } else {\n for (let i = 0; i <= numStep; i++)\n strokes.extendRange(range, this.getFractionalRotationTransform(i / numStep, stepTransform));\n }\n }\n /** Specify if the sweep forms a closed volume. */\n public get isClosedVolume(): boolean {\n return this.capped || this._sweepAngle.isFullCircle;\n }\n}\n"]}
|
|
@@ -15,7 +15,7 @@ import { SweepContour } from "./SweepContour";
|
|
|
15
15
|
export type CurvePrimitiveMutator = (primitiveA: CurvePrimitive, primitiveB: CurvePrimitive) => CurvePrimitive | undefined;
|
|
16
16
|
/**
|
|
17
17
|
* A ruled sweep (surface) is a collection of 2 or more contours.
|
|
18
|
-
* * All contours must have identical number and type of geometry
|
|
18
|
+
* * All contours must have identical number and type of geometry: (paths, loops, parity regions, lines, arcs, other curves).
|
|
19
19
|
* @public
|
|
20
20
|
*/
|
|
21
21
|
export declare class RuledSweep extends SolidPrimitive {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuledSweep.d.ts","sourceRoot":"","sources":["../../../src/solid/RuledSweep.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAc,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS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E,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,qBAAqB,GAClG,eAAe,GAAG,SAAS;IA6C9B;;OAEG;IACH,IAAW,cAAc,IAAI,OAAO,CAGnC;CACF"}
|
|
@@ -13,7 +13,7 @@ import { SolidPrimitive } from "./SolidPrimitive";
|
|
|
13
13
|
import { SweepContour } from "./SweepContour";
|
|
14
14
|
/**
|
|
15
15
|
* A ruled sweep (surface) is a collection of 2 or more contours.
|
|
16
|
-
* * All contours must have identical number and type of geometry
|
|
16
|
+
* * All contours must have identical number and type of geometry: (paths, loops, parity regions, lines, arcs, other curves).
|
|
17
17
|
* @public
|
|
18
18
|
*/
|
|
19
19
|
export class RuledSweep extends SolidPrimitive {
|
|
@@ -79,6 +79,10 @@ export class RuledSweep extends SolidPrimitive {
|
|
|
79
79
|
if (!contour.tryTransformInPlace(transform))
|
|
80
80
|
return false;
|
|
81
81
|
}
|
|
82
|
+
if (transform.matrix.determinant() < 0.0) {
|
|
83
|
+
// if mirror, reverse the sweep order to preserve outward normals
|
|
84
|
+
this._contours.reverse();
|
|
85
|
+
}
|
|
82
86
|
return true;
|
|
83
87
|
}
|
|
84
88
|
/**
|