@itwin/core-geometry 5.0.0-dev.99 → 5.0.0
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 +48 -1
- package/lib/cjs/Geometry.d.ts +15 -4
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +17 -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/BSplineSurface.d.ts +4 -3
- package/lib/cjs/bspline/BSplineSurface.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.js +6 -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.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +12 -23
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +1 -0
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +1 -0
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +56 -32
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +91 -36
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +2 -0
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +14 -0
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.d.ts +13 -5
- package/lib/cjs/curve/CurveExtendMode.d.ts.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.js +19 -15
- package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +67 -8
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +59 -6
- 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.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +1 -0
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +8 -7
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +25 -22
- 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 +10 -5
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js +7 -2
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.d.ts +15 -21
- package/lib/cjs/curve/RegionMomentsXY.d.ts.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js +38 -58
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +70 -38
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +115 -45
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +12 -13
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js +23 -23
- 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.d.ts +71 -0
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js +181 -0
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -0
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts +21 -5
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js +42 -17
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +36 -12
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.d.ts +5 -3
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js +5 -3
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.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 +39 -25
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.d.ts +15 -16
- package/lib/cjs/geometry3d/GeometryHandler.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.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 +7 -2
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +20 -2
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +2 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +7 -3
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +10 -11
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +11 -12
- package/lib/cjs/geometry3d/Matrix3d.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/Point3dVector3d.d.ts +4 -4
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +6 -6
- 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 +57 -9
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +57 -17
- 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/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +11 -23
- package/lib/cjs/geometry3d/Ray3d.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/Matrix4d.d.ts +7 -7
- package/lib/cjs/geometry4d/Matrix4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js +9 -9
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/geometry4d/MomentData.d.ts +32 -34
- package/lib/cjs/geometry4d/MomentData.d.ts.map +1 -1
- package/lib/cjs/geometry4d/MomentData.js +56 -57
- package/lib/cjs/geometry4d/MomentData.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/polyface/FacetOrientation.d.ts +1 -1
- package/lib/cjs/polyface/FacetOrientation.js +2 -2
- 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 +47 -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 +3 -3
- 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.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +3 -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/GeometrySamples.d.ts +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +1 -1
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts +3 -3
- package/lib/cjs/serialization/IModelJsonSchema.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/Triangulation.d.ts +3 -3
- package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
- package/lib/cjs/topology/Triangulation.js +7 -7
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/esm/Geometry.d.ts +15 -4
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +17 -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/BSplineSurface.d.ts +4 -3
- package/lib/esm/bspline/BSplineSurface.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineSurface.js +6 -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.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +12 -23
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +1 -0
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +1 -0
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +56 -32
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +91 -36
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +2 -0
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +14 -0
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveExtendMode.d.ts +13 -5
- package/lib/esm/curve/CurveExtendMode.d.ts.map +1 -1
- package/lib/esm/curve/CurveExtendMode.js +19 -15
- package/lib/esm/curve/CurveExtendMode.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +1 -1
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +67 -8
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +59 -6
- 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.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +1 -0
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +8 -7
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +25 -22
- 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 +10 -5
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js +7 -2
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.d.ts +15 -21
- package/lib/esm/curve/RegionMomentsXY.d.ts.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js +38 -58
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +70 -38
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +116 -46
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +12 -13
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js +23 -23
- 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.d.ts +71 -0
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js +177 -0
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -0
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts +21 -5
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js +42 -17
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +36 -12
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.d.ts +5 -3
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js +5 -3
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.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 +39 -25
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.d.ts +15 -16
- package/lib/esm/geometry3d/GeometryHandler.d.ts.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.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 +7 -2
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +20 -2
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +2 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +7 -3
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +10 -11
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +11 -12
- package/lib/esm/geometry3d/Matrix3d.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/Point3dVector3d.d.ts +4 -4
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +6 -6
- 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 +57 -9
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +57 -17
- 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/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +11 -23
- package/lib/esm/geometry3d/Ray3d.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/Matrix4d.d.ts +7 -7
- package/lib/esm/geometry4d/Matrix4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js +9 -9
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/geometry4d/MomentData.d.ts +32 -34
- package/lib/esm/geometry4d/MomentData.d.ts.map +1 -1
- package/lib/esm/geometry4d/MomentData.js +56 -57
- package/lib/esm/geometry4d/MomentData.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/polyface/FacetOrientation.d.ts +1 -1
- package/lib/esm/polyface/FacetOrientation.js +2 -2
- 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 +47 -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 +3 -3
- 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.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js +3 -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/GeometrySamples.d.ts +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +1 -1
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts +3 -3
- package/lib/esm/serialization/IModelJsonSchema.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/Triangulation.d.ts +3 -3
- package/lib/esm/topology/Triangulation.d.ts.map +1 -1
- package/lib/esm/topology/Triangulation.js +7 -7
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/package.json +3 -3
|
@@ -2,6 +2,7 @@ import { GrowableXYZArray } from "../geometry3d/GrowableXYZArray";
|
|
|
2
2
|
import { IndexedXYZCollection, MultiLineStringDataVariant } from "../geometry3d/IndexedXYZCollection";
|
|
3
3
|
import { Point3d } from "../geometry3d/Point3dVector3d";
|
|
4
4
|
import { Range3d } from "../geometry3d/Range";
|
|
5
|
+
import { Ray3d } from "../geometry3d/Ray3d";
|
|
5
6
|
import { Transform } from "../geometry3d/Transform";
|
|
6
7
|
import { MomentData } from "../geometry4d/MomentData";
|
|
7
8
|
import { IndexedPolyface, Polyface } from "../polyface/Polyface";
|
|
@@ -35,42 +36,59 @@ export declare enum RegionBinaryOpType {
|
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* Class `RegionOps` has static members for calculations on regions (areas).
|
|
38
|
-
* * Regions are represented by these
|
|
39
|
-
* *
|
|
40
|
-
* *
|
|
41
|
-
* The common "One outer loop and many
|
|
42
|
-
* *
|
|
43
|
-
* *
|
|
44
|
-
* been rotated parallel to the xy-plane.
|
|
39
|
+
* * Regions are represented by these [[CurveCollection]] subclasses:
|
|
40
|
+
* * [[Loop]] -- a single loop
|
|
41
|
+
* * [[ParityRegion]] -- a collection of loops, interpreted by parity rules.
|
|
42
|
+
* The common "One outer loop and many inner loops" is a parity region.
|
|
43
|
+
* * [[UnionRegion]] -- a collection of `Loop` and `ParityRegion` objects understood as a (probably disjoint) union.
|
|
44
|
+
* * Most of the methods in this class:
|
|
45
|
+
* * Ignore z-coordinates, so callers should ensure that input geometry has been rotated parallel to the xy-plane.
|
|
46
|
+
* * Assume consistent Loop orientation: "solid" Loops are counterclockwise; "hole" Loops are clockwise.
|
|
45
47
|
* @public
|
|
46
48
|
*/
|
|
47
49
|
export declare class RegionOps {
|
|
48
50
|
/**
|
|
49
51
|
* Return moment sums for a loop, parity region, or union region.
|
|
52
|
+
* * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
50
53
|
* * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
|
|
51
|
-
*
|
|
52
|
-
*
|
|
54
|
+
* call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes(rawMomentData.origin, rawMomentData.sums);`
|
|
55
|
+
* * `rawMomentData.origin` is the centroid of `region`.
|
|
56
|
+
* * `rawMomentData.sums.weight()` is the signed area of `region`.
|
|
57
|
+
* @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
|
|
53
58
|
*/
|
|
54
|
-
static computeXYAreaMoments(
|
|
59
|
+
static computeXYAreaMoments(region: AnyRegion): MomentData | undefined;
|
|
55
60
|
/**
|
|
56
61
|
* Return an area tolerance for a given xy-range and optional distance tolerance.
|
|
57
|
-
* @param range range of planar region to tolerance
|
|
58
|
-
* @param distanceTolerance optional absolute distance tolerance
|
|
62
|
+
* @param range range of planar region to tolerance.
|
|
63
|
+
* @param distanceTolerance optional absolute distance tolerance.
|
|
59
64
|
*/
|
|
60
65
|
static computeXYAreaTolerance(range: Range3d, distanceTolerance?: number): number;
|
|
61
66
|
/**
|
|
62
67
|
* Return a (signed) xy area for a region.
|
|
68
|
+
* * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
63
69
|
* * The area is negative if and only if the region is oriented clockwise with respect to the positive z-axis.
|
|
64
|
-
* @param
|
|
70
|
+
* @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
|
|
65
71
|
*/
|
|
66
|
-
static computeXYArea(
|
|
72
|
+
static computeXYArea(region: AnyRegion): number | undefined;
|
|
67
73
|
/**
|
|
68
74
|
* Return MomentData with the sums of wire moments.
|
|
75
|
+
* * The input curve should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
69
76
|
* * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
|
|
70
|
-
*
|
|
71
|
-
*
|
|
77
|
+
* call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
|
|
78
|
+
* * `rawMomentData.origin` is the wire centroid of `curve`.
|
|
79
|
+
* * `rawMomentData.sums.weight()` is the signed length of `curve`.
|
|
80
|
+
* @param curve any [[CurveCollection]] or [[CurvePrimitive]].
|
|
72
81
|
*/
|
|
73
|
-
static computeXYZWireMomentSums(
|
|
82
|
+
static computeXYZWireMomentSums(curve: AnyCurve): MomentData | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Return a [[Ray3d]] with:
|
|
85
|
+
* * `origin` is the centroid of the region,
|
|
86
|
+
* * `direction` is a unit vector perpendicular to the region plane,
|
|
87
|
+
* * `a` is the region area.
|
|
88
|
+
* @param region the region to process. Can lie in any plane.
|
|
89
|
+
* @param result optional pre-allocated result to populate and return.
|
|
90
|
+
*/
|
|
91
|
+
static centroidAreaNormal(region: AnyRegion, result?: Ray3d): Ray3d | undefined;
|
|
74
92
|
/**
|
|
75
93
|
* Create loops in the graph.
|
|
76
94
|
* @internal
|
|
@@ -119,12 +137,25 @@ export declare class RegionOps {
|
|
|
119
137
|
* @param triangulate whether to triangulate the result
|
|
120
138
|
*/
|
|
121
139
|
static polygonXYAreaDifferenceLoopsToPolyface(loopsA: MultiLineStringDataVariant, loopsB: MultiLineStringDataVariant, triangulate?: boolean): Polyface | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* Simplify the type of the region by stripping redundant parent(s).
|
|
142
|
+
* * No Boolean operations are performed.
|
|
143
|
+
* * Invalid inputs (such as childless regions) are not corrected.
|
|
144
|
+
* @param region region to simplify
|
|
145
|
+
* @returns
|
|
146
|
+
* * For a [[UnionRegion]] with exactly one child, return it if it is a [[Loop]],
|
|
147
|
+
* or if it is a [[ParityRegion]] with multiple children, otherwise return the `ParityRegion`'s `Loop`.
|
|
148
|
+
* * For a `ParityRegion` with exactly one `Loop`, return it.
|
|
149
|
+
* * All other inputs returned unchanged.
|
|
150
|
+
*/
|
|
151
|
+
static simplifyRegionType(region: AnyRegion): AnyRegion;
|
|
122
152
|
/**
|
|
123
153
|
* Return areas defined by a boolean operation.
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* @param
|
|
154
|
+
* @note For best results, input regions should have correctly oriented loops. See [[sortOuterAndHoleLoopsXY]].
|
|
155
|
+
* @note A common use case of this method is to convert a region with overlapping children into one with
|
|
156
|
+
* non-overlapping children: `regionOut = RegionOps.regionBooleanXY(regionIn, undefined, RegionBinaryOpType.Union)`.
|
|
157
|
+
* @param loopsA first set of loops (treated as a union)
|
|
158
|
+
* @param loopsB second set of loops (treated as a union)
|
|
128
159
|
* @param operation indicates Union, Intersection, Parity, AMinusB, or BMinusA
|
|
129
160
|
* @param mergeTolerance absolute distance tolerance for merging loops
|
|
130
161
|
* @returns a region resulting from merging input loops and the boolean operation. May contain bridge edges added
|
|
@@ -282,14 +313,15 @@ export declare class RegionOps {
|
|
|
282
313
|
*/
|
|
283
314
|
static consolidateAdjacentPrimitives(curves: CurveCollection, options?: ConsolidateAdjacentCurvePrimitivesOptions): void;
|
|
284
315
|
/**
|
|
285
|
-
* Reverse and reorder loops in the xy-plane for
|
|
286
|
-
* @param loops multiple loops in any order and orientation, z-coordinates ignored
|
|
316
|
+
* Reverse and reorder loops in the xy-plane for consistent orientation and containment.
|
|
317
|
+
* @param loops multiple loops in any order and orientation, z-coordinates ignored.
|
|
318
|
+
* * For best results, all overlaps should be containments, i.e., loop boundaries can touch, but should not cross.
|
|
287
319
|
* @returns a region that captures the input pointers. This region is a:
|
|
288
|
-
* *
|
|
289
|
-
* *
|
|
320
|
+
* * [[Loop]] if there is exactly one input loop. It is oriented counterclockwise.
|
|
321
|
+
* * [[ParityRegion]] if input consists of exactly one outer loop with at least one hole loop.
|
|
290
322
|
* Its first child is an outer loop oriented counterclockwise; all subsequent children are holes oriented
|
|
291
323
|
* clockwise.
|
|
292
|
-
* *
|
|
324
|
+
* * [[UnionRegion]] if any other input configuration. Its children are individually ordered/oriented as in
|
|
293
325
|
* the above cases.
|
|
294
326
|
* @see [[PolygonOps.sortOuterAndHoleLoopsXY]]
|
|
295
327
|
*/
|
|
@@ -298,14 +330,14 @@ export declare class RegionOps {
|
|
|
298
330
|
* Find all xy-areas bounded by the unstructured, possibly intersecting curves.
|
|
299
331
|
* * For best results, input curves should be parallel to the xy-plane, as z-coordinates are ignored.
|
|
300
332
|
* * A common use case of this method is to assemble the bounding "exterior" loop (or loops) containing the
|
|
301
|
-
* input curves.
|
|
333
|
+
* input curves. Note that "holes" implied by inputs are _not_ preserved in output.
|
|
302
334
|
* * This method does not add bridge edges to connect outer loops to inner loops. Each disconnected loop,
|
|
303
335
|
* regardless of its containment, is returned as its own SignedLoops object. Pre-process with [[regionBooleanXY]]
|
|
304
336
|
* to add bridge edges so that [[constructAllXYRegionLoops]] will return outer and inner loops in the same
|
|
305
337
|
* SignedLoops object.
|
|
306
338
|
* @param curvesAndRegions Any collection of curves. Each Loop/ParityRegion/UnionRegion contributes its curve
|
|
307
|
-
* primitives.
|
|
308
|
-
* @param tolerance optional distance tolerance for coincidence
|
|
339
|
+
* primitives, stripped of parity context. This means holes are _not_ preserved in output.
|
|
340
|
+
* @param tolerance optional distance tolerance for coincidence.
|
|
309
341
|
* @returns array of [[SignedLoops]], each entry of which describes the faces in a single connected component:
|
|
310
342
|
* * `positiveAreaLoops` contains "interior" loops, _including holes in ParityRegion input_. These loops have
|
|
311
343
|
* positive area and counterclockwise orientation.
|
|
@@ -357,12 +389,10 @@ export declare class RegionOps {
|
|
|
357
389
|
private static triangulateRegionComponent;
|
|
358
390
|
/**
|
|
359
391
|
* Facet the region according to stroke options.
|
|
392
|
+
* @note For best results, [[UnionRegion]] input should consist of non-overlapping children. See [[regionBooleanXY]].
|
|
393
|
+
* @note For best results, [[ParityRegion]] input should be correctly oriented. See [[sortOuterAndHoleLoopsXY]].
|
|
360
394
|
* @param region a closed xy-planar region, possibly with holes.
|
|
361
395
|
* * The z-coordinates of the region are ignored. Caller is responsible for rotating the region into plane local coordinates beforehand, and reversing the rotation afterwards.
|
|
362
|
-
* * For best results, `UnionRegion` input should consist of non-overlapping children.
|
|
363
|
-
* Caller can ensure this by passing in `region = RegionOps.regionBooleanXY(unionRegion, undefined, RegionBinaryOpType.Union)`.
|
|
364
|
-
* * For best results, `ParityRegion` input should be correctly oriented (holes have opposite orientation to their containing loop).
|
|
365
|
-
* Caller can ensure this for non-intersecting loops by passing in `region = RegionOps.sortOuterAndHoleLoopsXY(loops)`.
|
|
366
396
|
* @param options primarily how to stroke the region boundary, but also how to facet the region interior.
|
|
367
397
|
* * By default, a triangulation is returned, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.
|
|
368
398
|
* @returns facets for the region, or undefined if facetting failed
|
|
@@ -377,17 +407,19 @@ export declare class RegionOps {
|
|
|
377
407
|
static convexDecomposePolygonXY(polygon: MultiLineStringDataVariant, maximize?: boolean): GrowableXYZArray[] | undefined;
|
|
378
408
|
}
|
|
379
409
|
/**
|
|
380
|
-
* * Options to control method `RegionOps.consolidateAdjacentPrimitives
|
|
410
|
+
* * Options to control method `RegionOps.consolidateAdjacentPrimitives`.
|
|
381
411
|
* @public
|
|
382
412
|
*/
|
|
383
413
|
export declare class ConsolidateAdjacentCurvePrimitivesOptions {
|
|
384
|
-
/** True to consolidate adjacent linear geometry into a single LineString3d */
|
|
414
|
+
/** True to consolidate adjacent linear geometry into a single LineString3d. */
|
|
385
415
|
consolidateLinearGeometry: boolean;
|
|
386
|
-
/** True to consolidate contiguous compatible arcs into a single Arc3d */
|
|
416
|
+
/** True to consolidate contiguous compatible arcs into a single Arc3d. */
|
|
387
417
|
consolidateCompatibleArcs: boolean;
|
|
388
|
-
/**
|
|
418
|
+
/** Disable LineSegment3d and LineString3d point compression. */
|
|
419
|
+
disableLinearCompression?: boolean;
|
|
420
|
+
/** Tolerance for collapsing identical points (if `!disableLinearCompression`). */
|
|
389
421
|
duplicatePointTolerance: number;
|
|
390
|
-
/** Tolerance for removing interior colinear points. */
|
|
422
|
+
/** Tolerance for removing interior colinear points (if `!disableLinearCompression`). */
|
|
391
423
|
colinearPointTolerance: number;
|
|
392
424
|
}
|
|
393
425
|
//# sourceMappingURL=RegionOps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegionOps.d.ts","sourceRoot":"","sources":["../../../src/curve/RegionOps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RegionOps.d.ts","sourceRoot":"","sources":["../../../src/curve/RegionOps.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAC0B,oBAAoB,EAAyB,0BAA0B,EACvG,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAY,MAAM,+BAA+B,CAAC;AAGlE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,SAA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AE,EACjC,cAAc,CAAC,EAAE,cAAc,EAAE,EACjC,0BAA0B,GAAE,OAAe,EAC3C,kBAAkB,GAAE,OAAe,GAClC,cAAc,EAAE;IAanB;;;;;OAKG;WACW,iBAAiB,CAAC,UAAU,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE;IAe/E;;;;OAIG;WACW,eAAe,CAAC,IAAI,EAAE,GAAG,EAAE,YAAY,CAAC,EAAE,SAAS,GAAG,OAAO;IAkB3E;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,iCAAiC;IAqChD,oCAAoC;IACpC,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAepC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,0BAA0B;IAIzC;;;;;;;;;OASG;WACW,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,eAAe,GAAG,SAAS;IAyBpG;;;;;MAKE;WACY,wBAAwB,CAAC,OAAO,EAAE,0BAA0B,EAAE,QAAQ,GAAE,OAAc,GAAG,gBAAgB,EAAE,GAAG,SAAS;CActI;AAaD;;;GAGG;AACH,qBAAa,yCAAyC;IACpD,+EAA+E;IACxE,yBAAyB,EAAE,OAAO,CAAQ;IACjD,0EAA0E;IACnE,yBAAyB,EAAE,OAAO,CAAQ;IACjD,gEAAgE;IACzD,wBAAwB,CAAC,EAAE,OAAO,CAAS;IAClD,kFAAkF;IAC3E,uBAAuB,EAAE,MAAM,CAAgC;IACtE,wFAAwF;IACjF,sBAAsB,EAAE,MAAM,CAAgC;CACtE"}
|
|
@@ -6,13 +6,15 @@
|
|
|
6
6
|
* @module Curve
|
|
7
7
|
*/
|
|
8
8
|
import { Geometry } from "../Geometry";
|
|
9
|
+
import { FrameBuilder } from "../geometry3d/FrameBuilder";
|
|
9
10
|
import { GrowableXYZArray } from "../geometry3d/GrowableXYZArray";
|
|
10
11
|
import { IndexedReadWriteXYZCollection, IndexedXYZCollection, } from "../geometry3d/IndexedXYZCollection";
|
|
11
12
|
import { Point3dArrayCarrier } from "../geometry3d/Point3dArrayCarrier";
|
|
12
|
-
import { Point3d } from "../geometry3d/Point3dVector3d";
|
|
13
|
+
import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d";
|
|
13
14
|
import { PolygonOps } from "../geometry3d/PolygonOps";
|
|
14
15
|
import { PolylineCompressionContext } from "../geometry3d/PolylineCompressionByEdgeOffset";
|
|
15
16
|
import { Range3d } from "../geometry3d/Range";
|
|
17
|
+
import { Ray3d } from "../geometry3d/Ray3d";
|
|
16
18
|
import { SortablePolygon } from "../geometry3d/SortablePolygon";
|
|
17
19
|
import { Transform } from "../geometry3d/Transform";
|
|
18
20
|
import { MomentData } from "../geometry4d/MomentData";
|
|
@@ -29,6 +31,7 @@ import { CurveWireMomentsXYZ } from "./CurveWireMomentsXYZ";
|
|
|
29
31
|
import { GeometryQuery } from "./GeometryQuery";
|
|
30
32
|
import { ChainCollectorContext } from "./internalContexts/ChainCollectorContext";
|
|
31
33
|
import { PolygonWireOffsetContext } from "./internalContexts/PolygonOffsetContext";
|
|
34
|
+
import { TransferWithSplitArcs } from "./internalContexts/TransferWithSplitArcs";
|
|
32
35
|
import { LineString3d } from "./LineString3d";
|
|
33
36
|
import { Loop } from "./Loop";
|
|
34
37
|
import { OffsetOptions } from "./OffsetOptions";
|
|
@@ -55,25 +58,29 @@ export var RegionBinaryOpType;
|
|
|
55
58
|
})(RegionBinaryOpType || (RegionBinaryOpType = {}));
|
|
56
59
|
/**
|
|
57
60
|
* Class `RegionOps` has static members for calculations on regions (areas).
|
|
58
|
-
* * Regions are represented by these
|
|
59
|
-
* *
|
|
60
|
-
* *
|
|
61
|
-
* The common "One outer loop and many
|
|
62
|
-
* *
|
|
63
|
-
* *
|
|
64
|
-
* been rotated parallel to the xy-plane.
|
|
61
|
+
* * Regions are represented by these [[CurveCollection]] subclasses:
|
|
62
|
+
* * [[Loop]] -- a single loop
|
|
63
|
+
* * [[ParityRegion]] -- a collection of loops, interpreted by parity rules.
|
|
64
|
+
* The common "One outer loop and many inner loops" is a parity region.
|
|
65
|
+
* * [[UnionRegion]] -- a collection of `Loop` and `ParityRegion` objects understood as a (probably disjoint) union.
|
|
66
|
+
* * Most of the methods in this class:
|
|
67
|
+
* * Ignore z-coordinates, so callers should ensure that input geometry has been rotated parallel to the xy-plane.
|
|
68
|
+
* * Assume consistent Loop orientation: "solid" Loops are counterclockwise; "hole" Loops are clockwise.
|
|
65
69
|
* @public
|
|
66
70
|
*/
|
|
67
71
|
export class RegionOps {
|
|
68
72
|
/**
|
|
69
73
|
* Return moment sums for a loop, parity region, or union region.
|
|
74
|
+
* * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
70
75
|
* * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
|
|
71
|
-
*
|
|
72
|
-
*
|
|
76
|
+
* call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes(rawMomentData.origin, rawMomentData.sums);`
|
|
77
|
+
* * `rawMomentData.origin` is the centroid of `region`.
|
|
78
|
+
* * `rawMomentData.sums.weight()` is the signed area of `region`.
|
|
79
|
+
* @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
|
|
73
80
|
*/
|
|
74
|
-
static computeXYAreaMoments(
|
|
81
|
+
static computeXYAreaMoments(region) {
|
|
75
82
|
const handler = new RegionMomentsXY();
|
|
76
|
-
const result =
|
|
83
|
+
const result = region.dispatchToGeometryHandler(handler);
|
|
77
84
|
if (result instanceof MomentData) {
|
|
78
85
|
result.shiftOriginAndSumsToCentroidOfSums();
|
|
79
86
|
return result;
|
|
@@ -82,8 +89,8 @@ export class RegionOps {
|
|
|
82
89
|
}
|
|
83
90
|
/**
|
|
84
91
|
* Return an area tolerance for a given xy-range and optional distance tolerance.
|
|
85
|
-
* @param range range of planar region to tolerance
|
|
86
|
-
* @param distanceTolerance optional absolute distance tolerance
|
|
92
|
+
* @param range range of planar region to tolerance.
|
|
93
|
+
* @param distanceTolerance optional absolute distance tolerance.
|
|
87
94
|
*/
|
|
88
95
|
static computeXYAreaTolerance(range, distanceTolerance = Geometry.smallMetricDistance) {
|
|
89
96
|
// if A = bh and e is distance tolerance, then A' := (b+e/2)(h+e/2) = A + e/2(b+h+e/2), so A'-A = e/2(b+h+e/2).
|
|
@@ -92,12 +99,13 @@ export class RegionOps {
|
|
|
92
99
|
}
|
|
93
100
|
/**
|
|
94
101
|
* Return a (signed) xy area for a region.
|
|
102
|
+
* * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
95
103
|
* * The area is negative if and only if the region is oriented clockwise with respect to the positive z-axis.
|
|
96
|
-
* @param
|
|
104
|
+
* @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
|
|
97
105
|
*/
|
|
98
|
-
static computeXYArea(
|
|
106
|
+
static computeXYArea(region) {
|
|
99
107
|
const handler = new RegionMomentsXY();
|
|
100
|
-
const result =
|
|
108
|
+
const result = region.dispatchToGeometryHandler(handler);
|
|
101
109
|
if (result instanceof MomentData) {
|
|
102
110
|
return result.quantitySum;
|
|
103
111
|
}
|
|
@@ -105,17 +113,56 @@ export class RegionOps {
|
|
|
105
113
|
}
|
|
106
114
|
/**
|
|
107
115
|
* Return MomentData with the sums of wire moments.
|
|
116
|
+
* * The input curve should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
108
117
|
* * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
|
|
109
|
-
*
|
|
110
|
-
*
|
|
118
|
+
* call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
|
|
119
|
+
* * `rawMomentData.origin` is the wire centroid of `curve`.
|
|
120
|
+
* * `rawMomentData.sums.weight()` is the signed length of `curve`.
|
|
121
|
+
* @param curve any [[CurveCollection]] or [[CurvePrimitive]].
|
|
111
122
|
*/
|
|
112
|
-
static computeXYZWireMomentSums(
|
|
123
|
+
static computeXYZWireMomentSums(curve) {
|
|
113
124
|
const handler = new CurveWireMomentsXYZ();
|
|
114
|
-
handler.visitLeaves(
|
|
125
|
+
handler.visitLeaves(curve);
|
|
115
126
|
const result = handler.momentData;
|
|
116
127
|
result.shiftOriginAndSumsToCentroidOfSums();
|
|
117
128
|
return result;
|
|
118
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Return a [[Ray3d]] with:
|
|
132
|
+
* * `origin` is the centroid of the region,
|
|
133
|
+
* * `direction` is a unit vector perpendicular to the region plane,
|
|
134
|
+
* * `a` is the region area.
|
|
135
|
+
* @param region the region to process. Can lie in any plane.
|
|
136
|
+
* @param result optional pre-allocated result to populate and return.
|
|
137
|
+
*/
|
|
138
|
+
static centroidAreaNormal(region, result) {
|
|
139
|
+
const localToWorld = FrameBuilder.createRightHandedFrame(undefined, region);
|
|
140
|
+
if (!localToWorld)
|
|
141
|
+
return undefined;
|
|
142
|
+
const normal = localToWorld.matrix.columnZ(result?.direction);
|
|
143
|
+
const regionIsXY = normal.isParallelTo(Vector3d.unitZ(), true);
|
|
144
|
+
let regionXY = region;
|
|
145
|
+
if (!regionIsXY) { // rotate the region to be parallel to the xy-plane
|
|
146
|
+
regionXY = region.cloneTransformed(localToWorld.inverse());
|
|
147
|
+
if (!regionXY)
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
150
|
+
const momentData = RegionOps.computeXYAreaMoments(regionXY);
|
|
151
|
+
if (!momentData)
|
|
152
|
+
return undefined;
|
|
153
|
+
const centroid = momentData.origin.clone(result?.origin);
|
|
154
|
+
if (!regionIsXY) // rotate centroid back (area is unchanged)
|
|
155
|
+
localToWorld.multiplyPoint3d(centroid, centroid);
|
|
156
|
+
let area = momentData.sums.weight();
|
|
157
|
+
if (area < 0.0) {
|
|
158
|
+
area = -area;
|
|
159
|
+
normal.scale(-1.0, normal);
|
|
160
|
+
}
|
|
161
|
+
if (!result)
|
|
162
|
+
result = Ray3d.createCapture(centroid, normal);
|
|
163
|
+
result.a = area;
|
|
164
|
+
return result;
|
|
165
|
+
}
|
|
119
166
|
/**
|
|
120
167
|
* Create loops in the graph.
|
|
121
168
|
* @internal
|
|
@@ -233,20 +280,41 @@ export class RegionOps {
|
|
|
233
280
|
const graph = RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && !inB), this._graphCheckPointFunction);
|
|
234
281
|
return this.finishGraphToPolyface(graph, triangulate);
|
|
235
282
|
}
|
|
283
|
+
/**
|
|
284
|
+
* Simplify the type of the region by stripping redundant parent(s).
|
|
285
|
+
* * No Boolean operations are performed.
|
|
286
|
+
* * Invalid inputs (such as childless regions) are not corrected.
|
|
287
|
+
* @param region region to simplify
|
|
288
|
+
* @returns
|
|
289
|
+
* * For a [[UnionRegion]] with exactly one child, return it if it is a [[Loop]],
|
|
290
|
+
* or if it is a [[ParityRegion]] with multiple children, otherwise return the `ParityRegion`'s `Loop`.
|
|
291
|
+
* * For a `ParityRegion` with exactly one `Loop`, return it.
|
|
292
|
+
* * All other inputs returned unchanged.
|
|
293
|
+
*/
|
|
294
|
+
static simplifyRegionType(region) {
|
|
295
|
+
if (region instanceof UnionRegion) {
|
|
296
|
+
if (region.children.length === 1)
|
|
297
|
+
return this.simplifyRegionType(region.children[0]);
|
|
298
|
+
}
|
|
299
|
+
else if (region instanceof ParityRegion) {
|
|
300
|
+
if (region.children.length === 1)
|
|
301
|
+
return region.children[0];
|
|
302
|
+
}
|
|
303
|
+
return region;
|
|
304
|
+
}
|
|
236
305
|
/**
|
|
237
306
|
* Return areas defined by a boolean operation.
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
* @param
|
|
307
|
+
* @note For best results, input regions should have correctly oriented loops. See [[sortOuterAndHoleLoopsXY]].
|
|
308
|
+
* @note A common use case of this method is to convert a region with overlapping children into one with
|
|
309
|
+
* non-overlapping children: `regionOut = RegionOps.regionBooleanXY(regionIn, undefined, RegionBinaryOpType.Union)`.
|
|
310
|
+
* @param loopsA first set of loops (treated as a union)
|
|
311
|
+
* @param loopsB second set of loops (treated as a union)
|
|
242
312
|
* @param operation indicates Union, Intersection, Parity, AMinusB, or BMinusA
|
|
243
313
|
* @param mergeTolerance absolute distance tolerance for merging loops
|
|
244
314
|
* @returns a region resulting from merging input loops and the boolean operation. May contain bridge edges added
|
|
245
315
|
* to connect interior loops to exterior loops.
|
|
246
316
|
*/
|
|
247
317
|
static regionBooleanXY(loopsA, loopsB, operation, mergeTolerance = Geometry.smallMetricDistance) {
|
|
248
|
-
// Always return UnionRegion for now. But keep return type as AnyRegion:
|
|
249
|
-
// in the future, we might return the *simplest* region type.
|
|
250
318
|
const result = UnionRegion.create();
|
|
251
319
|
const context = RegionBooleanContext.create(RegionGroupOpType.Union, RegionGroupOpType.Union);
|
|
252
320
|
context.addMembers(loopsA, loopsB);
|
|
@@ -265,7 +333,7 @@ export class RegionOps {
|
|
|
265
333
|
result.tryAddChild(loop);
|
|
266
334
|
}
|
|
267
335
|
});
|
|
268
|
-
return result;
|
|
336
|
+
return result ? this.simplifyRegionType(result) : undefined;
|
|
269
337
|
}
|
|
270
338
|
/**
|
|
271
339
|
* Return a polyface whose facets are a boolean operation between the input regions.
|
|
@@ -556,14 +624,15 @@ export class RegionOps {
|
|
|
556
624
|
curves.dispatchToGeometryHandler(context);
|
|
557
625
|
}
|
|
558
626
|
/**
|
|
559
|
-
* Reverse and reorder loops in the xy-plane for
|
|
560
|
-
* @param loops multiple loops in any order and orientation, z-coordinates ignored
|
|
627
|
+
* Reverse and reorder loops in the xy-plane for consistent orientation and containment.
|
|
628
|
+
* @param loops multiple loops in any order and orientation, z-coordinates ignored.
|
|
629
|
+
* * For best results, all overlaps should be containments, i.e., loop boundaries can touch, but should not cross.
|
|
561
630
|
* @returns a region that captures the input pointers. This region is a:
|
|
562
|
-
* *
|
|
563
|
-
* *
|
|
631
|
+
* * [[Loop]] if there is exactly one input loop. It is oriented counterclockwise.
|
|
632
|
+
* * [[ParityRegion]] if input consists of exactly one outer loop with at least one hole loop.
|
|
564
633
|
* Its first child is an outer loop oriented counterclockwise; all subsequent children are holes oriented
|
|
565
634
|
* clockwise.
|
|
566
|
-
* *
|
|
635
|
+
* * [[UnionRegion]] if any other input configuration. Its children are individually ordered/oriented as in
|
|
567
636
|
* the above cases.
|
|
568
637
|
* @see [[PolygonOps.sortOuterAndHoleLoopsXY]]
|
|
569
638
|
*/
|
|
@@ -583,14 +652,14 @@ export class RegionOps {
|
|
|
583
652
|
* Find all xy-areas bounded by the unstructured, possibly intersecting curves.
|
|
584
653
|
* * For best results, input curves should be parallel to the xy-plane, as z-coordinates are ignored.
|
|
585
654
|
* * A common use case of this method is to assemble the bounding "exterior" loop (or loops) containing the
|
|
586
|
-
* input curves.
|
|
655
|
+
* input curves. Note that "holes" implied by inputs are _not_ preserved in output.
|
|
587
656
|
* * This method does not add bridge edges to connect outer loops to inner loops. Each disconnected loop,
|
|
588
657
|
* regardless of its containment, is returned as its own SignedLoops object. Pre-process with [[regionBooleanXY]]
|
|
589
658
|
* to add bridge edges so that [[constructAllXYRegionLoops]] will return outer and inner loops in the same
|
|
590
659
|
* SignedLoops object.
|
|
591
660
|
* @param curvesAndRegions Any collection of curves. Each Loop/ParityRegion/UnionRegion contributes its curve
|
|
592
|
-
* primitives.
|
|
593
|
-
* @param tolerance optional distance tolerance for coincidence
|
|
661
|
+
* primitives, stripped of parity context. This means holes are _not_ preserved in output.
|
|
662
|
+
* @param tolerance optional distance tolerance for coincidence.
|
|
594
663
|
* @returns array of [[SignedLoops]], each entry of which describes the faces in a single connected component:
|
|
595
664
|
* * `positiveAreaLoops` contains "interior" loops, _including holes in ParityRegion input_. These loops have
|
|
596
665
|
* positive area and counterclockwise orientation.
|
|
@@ -600,7 +669,8 @@ export class RegionOps {
|
|
|
600
669
|
* to the edge and a constituent curve in each.
|
|
601
670
|
*/
|
|
602
671
|
static constructAllXYRegionLoops(curvesAndRegions, tolerance = Geometry.smallMetricDistance) {
|
|
603
|
-
|
|
672
|
+
let primitives = RegionOps.collectCurvePrimitives(curvesAndRegions, undefined, true, true);
|
|
673
|
+
primitives = TransferWithSplitArcs.clone(BagOfCurves.create(...primitives)).children;
|
|
604
674
|
const range = this.curveArrayRange(primitives);
|
|
605
675
|
const areaTol = this.computeXYAreaTolerance(range, tolerance);
|
|
606
676
|
const intersections = CurveCurve.allIntersectionsAmongPrimitivesXY(primitives, tolerance);
|
|
@@ -753,12 +823,10 @@ export class RegionOps {
|
|
|
753
823
|
}
|
|
754
824
|
/**
|
|
755
825
|
* Facet the region according to stroke options.
|
|
826
|
+
* @note For best results, [[UnionRegion]] input should consist of non-overlapping children. See [[regionBooleanXY]].
|
|
827
|
+
* @note For best results, [[ParityRegion]] input should be correctly oriented. See [[sortOuterAndHoleLoopsXY]].
|
|
756
828
|
* @param region a closed xy-planar region, possibly with holes.
|
|
757
829
|
* * The z-coordinates of the region are ignored. Caller is responsible for rotating the region into plane local coordinates beforehand, and reversing the rotation afterwards.
|
|
758
|
-
* * For best results, `UnionRegion` input should consist of non-overlapping children.
|
|
759
|
-
* Caller can ensure this by passing in `region = RegionOps.regionBooleanXY(unionRegion, undefined, RegionBinaryOpType.Union)`.
|
|
760
|
-
* * For best results, `ParityRegion` input should be correctly oriented (holes have opposite orientation to their containing loop).
|
|
761
|
-
* Caller can ensure this for non-intersecting loops by passing in `region = RegionOps.sortOuterAndHoleLoopsXY(loops)`.
|
|
762
830
|
* @param options primarily how to stroke the region boundary, but also how to facet the region interior.
|
|
763
831
|
* * By default, a triangulation is returned, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.
|
|
764
832
|
* @returns facets for the region, or undefined if facetting failed
|
|
@@ -821,17 +889,19 @@ function pushToInOnOutArrays(curve, select, arrayNegative, array0, arrayPositive
|
|
|
821
889
|
array0.push(curve);
|
|
822
890
|
}
|
|
823
891
|
/**
|
|
824
|
-
* * Options to control method `RegionOps.consolidateAdjacentPrimitives
|
|
892
|
+
* * Options to control method `RegionOps.consolidateAdjacentPrimitives`.
|
|
825
893
|
* @public
|
|
826
894
|
*/
|
|
827
895
|
export class ConsolidateAdjacentCurvePrimitivesOptions {
|
|
828
|
-
/** True to consolidate adjacent linear geometry into a single LineString3d */
|
|
896
|
+
/** True to consolidate adjacent linear geometry into a single LineString3d. */
|
|
829
897
|
consolidateLinearGeometry = true;
|
|
830
|
-
/** True to consolidate contiguous compatible arcs into a single Arc3d */
|
|
898
|
+
/** True to consolidate contiguous compatible arcs into a single Arc3d. */
|
|
831
899
|
consolidateCompatibleArcs = true;
|
|
832
|
-
/**
|
|
900
|
+
/** Disable LineSegment3d and LineString3d point compression. */
|
|
901
|
+
disableLinearCompression = false;
|
|
902
|
+
/** Tolerance for collapsing identical points (if `!disableLinearCompression`). */
|
|
833
903
|
duplicatePointTolerance = Geometry.smallMetricDistance;
|
|
834
|
-
/** Tolerance for removing interior colinear points. */
|
|
904
|
+
/** Tolerance for removing interior colinear points (if `!disableLinearCompression`). */
|
|
835
905
|
colinearPointTolerance = Geometry.smallMetricDistance;
|
|
836
906
|
}
|
|
837
907
|
//# sourceMappingURL=RegionOps.js.map
|