@itwin/core-geometry 5.0.0-dev.113 → 5.0.0-dev.114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/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/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 +53 -31
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +55 -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/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/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/RegionOps.d.ts +38 -28
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +38 -28
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts +14 -11
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +14 -11
- package/lib/cjs/geometry3d/AngleSweep.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/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 +3 -3
- package/lib/cjs/geometry3d/Point3dVector3d.js +3 -3
- 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/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/Point4d.d.ts +4 -2
- package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js +17 -13
- package/lib/cjs/geometry4d/Point4d.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 +47 -32
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/cjs/polyface/Polyface.d.ts +17 -3
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +16 -0
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +2 -2
- 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/PolyfaceQuery.d.ts +116 -75
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +312 -228
- 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.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.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/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/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 +53 -31
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +55 -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/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/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/RegionOps.d.ts +38 -28
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +38 -28
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts +14 -11
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +14 -11
- package/lib/esm/geometry3d/AngleSweep.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/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 +3 -3
- package/lib/esm/geometry3d/Point3dVector3d.js +3 -3
- 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/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/Point4d.d.ts +4 -2
- package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Point4d.js +17 -13
- package/lib/esm/geometry4d/Point4d.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 +47 -32
- package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/esm/polyface/Polyface.d.ts +17 -3
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +16 -0
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +2 -2
- 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/PolyfaceQuery.d.ts +116 -75
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +313 -229
- 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.map +1 -1
- package/lib/esm/serialization/GeometrySamples.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/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanarSubdivision.js","sourceRoot":"","sources":["../../../../src/curve/Query/PlanarSubdivision.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,6CAA0C;AAE1C,gDAA+D;AAC/D,4EAAyE;AACzE,oDAA4D;AAC5D,oCAAiC;AACjC,gEAAsF;AAEtF,oDAAiD;AACjD,kDAA+C;AAC/C,kCAAgE;AAChE,4CAAyC;AAEzC;;GAEG;AAEH,MAAM,+CAA+C;IAC5C,eAAe,GAAG,IAAI,GAAG,EAA6C,CAAC;IAC9E,mDAAmD;IAC5C,gBAAgB,GAAG,IAAI,GAAG,EAA0B,CAAC;IACpD,qBAAqB,GAAW,CAAC,CAAC;IACnC,oBAAoB,CAAC,SAAqC;QAC/D,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACnD,IAAI,KAAK,KAAK,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,GAAG,GAAG,KAAK,CAAC,4BAA4B,CAAC,QAAQ,CAAC,CAAC;IACzD,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,SAAS,kBAAkB,CAAC,IAA6B,EAAE,KAAqB;IAC9E,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,KAAK,KAAK;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC/B,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,KAAK,KAAK;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC/B,OAAO,SAAS,CAAC;AACnB,CAAC;AACD,SAAS,gBAAgB,CAAC,IAA6B,EAAE,KAAqB;IAC5E,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,KAAK,KAAK;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,KAAK,KAAK;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,OAAO,SAAS,CAAC;AACnB,CAAC","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*--------------------------------------------------------------------------------------------*/\nimport { Geometry } from \"../../Geometry\";\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\nimport { HalfEdge, HalfEdgeGraph } from \"../../topology/Graph\";\nimport { HalfEdgeGraphSearch } from \"../../topology/HalfEdgeGraphSearch\";\nimport { HalfEdgeGraphMerge } from \"../../topology/Merging\";\nimport { Arc3d } from \"../Arc3d\";\nimport { CurveLocationDetail, CurveLocationDetailPair } from \"../CurveLocationDetail\";\nimport { CurvePrimitive } from \"../CurvePrimitive\";\nimport { LineSegment3d } from \"../LineSegment3d\";\nimport { LineString3d } from \"../LineString3d\";\nimport { Loop, LoopCurveLoopCurve, SignedLoops } from \"../Loop\";\nimport { RegionOps } from \"../RegionOps\";\n\n/** @packageDocumentation\n * @module Curve\n */\n\nclass MapCurvePrimitiveToCurveLocationDetailPairArray {\n public primitiveToPair = new Map<CurvePrimitive, CurveLocationDetailPair[]>();\n // index assigned to this primitive (for debugging)\n public primitiveToIndex = new Map<CurvePrimitive, number>();\n private _numIndexedPrimitives: number = 0;\n public assignPrimitiveIndex(primitive: CurvePrimitive | undefined) {\n if (primitive !== undefined) {\n const index = this.primitiveToIndex.get(primitive);\n if (index === undefined) {\n this.primitiveToIndex.set(primitive, this._numIndexedPrimitives++);\n }\n }\n }\n public insertPrimitiveToPair(primitive: CurvePrimitive | undefined, pair: CurveLocationDetailPair) {\n if (primitive) {\n const priorPairs = this.primitiveToPair.get(primitive);\n this.assignPrimitiveIndex(primitive);\n if (!priorPairs) {\n this.primitiveToPair.set(primitive, [pair]);\n } else {\n priorPairs.push(pair);\n }\n }\n }\n public insertPair(pair: CurveLocationDetailPair) {\n const primitiveA = pair.detailA.curve;\n if (primitiveA)\n this.insertPrimitiveToPair(primitiveA, pair);\n const primitiveB = pair.detailB.curve;\n if (primitiveB)\n this.insertPrimitiveToPair(primitiveB, pair);\n }\n /** Split closed missing primitives in half and add new intersection pairs */\n public splitAndAppendMissingClosedPrimitives(primitives: CurvePrimitive[], tolerance: number = Geometry.smallMetricDistance) {\n for (const p of primitives) {\n let closedCurveSplitCandidate = false;\n if (p instanceof Arc3d)\n closedCurveSplitCandidate = p.sweep.isFullCircle;\n else if (!(p instanceof LineSegment3d) && !(p instanceof LineString3d))\n closedCurveSplitCandidate = p.startPoint().isAlmostEqualXY(p.endPoint(), tolerance);\n if (closedCurveSplitCandidate && !this.primitiveToPair.has(p)) {\n const p0 = p.clonePartialCurve(0.0, 0.5);\n const p1 = p.clonePartialCurve(0.5, 1.0);\n if (p0 && p1) {\n this.insertPair(CurveLocationDetailPair.createCapture(CurveLocationDetail.createCurveEvaluatedFraction(p0, 0.0), CurveLocationDetail.createCurveEvaluatedFraction(p1, 1.0)));\n this.insertPair(CurveLocationDetailPair.createCapture(CurveLocationDetail.createCurveEvaluatedFraction(p0, 1.0), CurveLocationDetail.createCurveEvaluatedFraction(p1, 0.0)));\n }\n }\n }\n }\n}\n\n/**\n * @internal\n */\nexport class PlanarSubdivision {\n /** Create a graph from an array of curves, and an array of the curves' precomputed intersections. Z-coordinates are ignored. */\n public static assembleHalfEdgeGraph(primitives: CurvePrimitive[], allPairs: CurveLocationDetailPair[], mergeTolerance: number = Geometry.smallMetricDistance): HalfEdgeGraph {\n const detailByPrimitive = new MapCurvePrimitiveToCurveLocationDetailPairArray(); // map from key CurvePrimitive to CurveLocationDetailPair.\n for (const pair of allPairs)\n detailByPrimitive.insertPair(pair);\n if (primitives.length > detailByPrimitive.primitiveToPair.size)\n detailByPrimitive.splitAndAppendMissingClosedPrimitives(primitives, mergeTolerance); // otherwise, these single-primitive loops are missing from the graph\n const graph = new HalfEdgeGraph();\n for (const entry of detailByPrimitive.primitiveToPair.entries()) {\n const p = entry[0];\n // convert each interval intersection into two isolated intersections\n const details = entry[1].reduce((accumulator: CurveLocationDetailPair[], detailPair) => {\n if (!detailPair.detailA.hasFraction1)\n return [...accumulator, detailPair];\n const detail = getDetailOnCurve(detailPair, p)!;\n const detail0 = CurveLocationDetail.createCurveFractionPoint(p, detail.fraction, detail.point);\n const detail1 = CurveLocationDetail.createCurveFractionPoint(p, detail.fraction1!, detail.point1!);\n return [...accumulator, CurveLocationDetailPair.createCapture(detail0, detail0), CurveLocationDetailPair.createCapture(detail1, detail1)];\n }, []);\n // lexical sort on p intersection fraction\n details.sort((pairA: CurveLocationDetailPair, pairB: CurveLocationDetailPair) => {\n const fractionA = getFractionOnCurve(pairA, p)!;\n const fractionB = getFractionOnCurve(pairB, p)!;\n return fractionA - fractionB;\n });\n let last = {point: p.startPoint(), fraction: 0.0};\n for (const detailPair of details) {\n const detail = getDetailOnCurve(detailPair, p)!;\n const detailFraction = Geometry.restrictToInterval(detail.fraction, 0, 1); // truncate fraction, but don't snap point; clustering happens later\n last = this.addHalfEdge(graph, p, last.point, last.fraction, detail.point, detailFraction, mergeTolerance);\n }\n this.addHalfEdge(graph, p, last.point, last.fraction, p.endPoint(), 1.0, mergeTolerance);\n }\n HalfEdgeGraphMerge.clusterAndMergeXYTheta(graph, (he: HalfEdge) => he.sortAngle!);\n return graph;\n }\n /**\n * Create a pair of mated half edges referencing an interval of a primitive\n * * no action if start and end points are identical.\n * @param graph containing graph.\n * @param p the curve\n * @param point0 start point\n * @param fraction0 starting fraction\n * @param point1 end point\n * @param fraction1 end fraction\n * @returns end point and fraction, or start point and fraction if no action\n */\n private static addHalfEdge(graph: HalfEdgeGraph, p: CurvePrimitive, point0: Point3d, fraction0: number, point1: Point3d, fraction1: number, mergeTolerance: number = Geometry.smallMetricDistance): {point: Point3d, fraction: number} {\n if (point0.isAlmostEqualXY(point1, mergeTolerance))\n return {point: point0, fraction: fraction0};\n const halfEdge = graph.createEdgeXYAndZ(point0, 0, point1, 0);\n const detail01 = CurveLocationDetail.createCurveEvaluatedFractionFraction(p, fraction0, fraction1);\n const mate = halfEdge.edgeMate;\n halfEdge.edgeTag = detail01;\n halfEdge.sortData = 1.0;\n mate.edgeTag = detail01;\n mate.sortData = -1.0;\n halfEdge.sortAngle = sortAngle(p, fraction0, false);\n mate.sortAngle = sortAngle(p, fraction1, true);\n return {point: point1, fraction: fraction1};\n }\n /**\n * Based on computed (and toleranced) area, push the loop (pointer) onto the appropriate array of positive, negative, or sliver loops.\n * @param zeroAreaTolerance absolute area tolerance for sliver face detection\n * @param isSliverFace whether the loop is known a priori (e.g., via topology) to have zero area\n * @returns the area (forced to zero if within tolerance)\n */\n public static collectSignedLoop(loop: Loop, outLoops: SignedLoops, zeroAreaTolerance: number = 1.0e-10, isSliverFace?: boolean): number{\n let area = isSliverFace ? 0.0 : RegionOps.computeXYArea(loop);\n if (area === undefined)\n area = 0;\n if (Math.abs(area) < zeroAreaTolerance)\n area = 0.0;\n (loop as any).computedAreaInPlanarSubdivision = area;\n if (area > 0)\n outLoops.positiveAreaLoops.push(loop);\n else if (area < 0)\n outLoops.negativeAreaLoops.push(loop);\n else\n outLoops.slivers.push(loop);\n return area;\n }\n public static createLoopInFace(faceSeed: HalfEdge,\n announce?: (he: HalfEdge, curve: CurvePrimitive, loop: Loop) => void): Loop {\n let he = faceSeed;\n const loop = Loop.create();\n do {\n const detail = he.edgeTag as CurveLocationDetail;\n if (detail) {\n let curve;\n if (he.sortData! > 0)\n curve = detail.curve!.clonePartialCurve(detail.fraction, detail.fraction1!);\n else\n curve = detail.curve!.clonePartialCurve(detail.fraction1!, detail.fraction);\n if (curve) {\n if (announce !== undefined)\n announce(he, curve, loop);\n loop.tryAddChild(curve);\n }\n }\n he = he.faceSuccessor;\n } while (he !== faceSeed);\n return loop;\n }\n // Return true if there are only two edges in the face loop, and their start curvatures are the same.\n private static isNullFace(he: HalfEdge): boolean {\n const faceHasTwoEdges = (he.faceSuccessor.faceSuccessor === he);\n let faceIsBanana = false;\n if (faceHasTwoEdges) {\n const c0 = HalfEdgeGraphMerge.curvatureSortKey(he);\n const c1 = HalfEdgeGraphMerge.curvatureSortKey(he.faceSuccessor.edgeMate);\n if (!Geometry.isSameCoordinate(c0, c1)) // default tol!\n faceIsBanana = true; // heuristic: we could also check end curvatures, and/or higher derivatives...\n }\n return faceHasTwoEdges && !faceIsBanana;\n }\n // Look across edge mates (possibly several) for a nonnull mate face.\n private static nonNullEdgeMate(_graph: HalfEdgeGraph, e: HalfEdge): HalfEdge | undefined {\n if (this.isNullFace (e))\n return undefined;\n let e1 = e.edgeMate;\n while (this.isNullFace(e1)){\n e1 = e1.faceSuccessor.edgeMate;\n if (e1 === e)\n return undefined;\n }\n return e1;\n }\n public static collectSignedLoopSetsInHalfEdgeGraph(graph: HalfEdgeGraph, zeroAreaTolerance: number = 1.0e-10): SignedLoops[] {\n const q = HalfEdgeGraphSearch.collectConnectedComponentsWithExteriorParityMasks(graph, undefined);\n const result: SignedLoops[] = [];\n const edgeMap = new Map<HalfEdge, LoopCurveLoopCurve>();\n for (const faceSeeds of q) {\n const componentAreas: SignedLoops = { positiveAreaLoops: [], negativeAreaLoops: [], slivers: [] };\n const edges: LoopCurveLoopCurve[] = [];\n for (const faceSeed of faceSeeds) {\n const isNullFace = this.isNullFace(faceSeed);\n const loop = this.createLoopInFace(faceSeed, (he: HalfEdge, curveC: CurvePrimitive, loopC: Loop) => {\n if (!isNullFace) {\n const mate = this.nonNullEdgeMate(graph, he);\n if (mate !== undefined) {\n const e = edgeMap.get(mate);\n if (e === undefined) {\n // Record this as loopA,edgeA of a shared edge to be completed later from the other side of the edge\n const e1 = new LoopCurveLoopCurve(loopC, curveC, undefined, undefined);\n edgeMap.set(he, e1);\n } else if (e instanceof LoopCurveLoopCurve) {\n e.setB(loopC, curveC);\n edges.push(e);\n edgeMap.delete(mate);\n }\n }\n }\n });\n this.collectSignedLoop(loop, componentAreas, zeroAreaTolerance, isNullFace);\n }\n componentAreas.edges = edges;\n result.push(componentAreas);\n edgeMap.clear();\n }\n return result;\n }\n}\n\nfunction sortAngle(curve: CurvePrimitive, fraction: number, reverse: boolean): number {\n const ray = curve.fractionToPointAndDerivative(fraction);\n const s = reverse ? -1.0 : 1.0;\n return Math.atan2(s * ray.direction.y, s * ray.direction.x);\n}\n\nfunction getFractionOnCurve(pair: CurveLocationDetailPair, curve: CurvePrimitive): number | undefined {\n if (pair.detailA.curve === curve)\n return pair.detailA.fraction;\n if (pair.detailB.curve === curve)\n return pair.detailB.fraction;\n return undefined;\n}\nfunction getDetailOnCurve(pair: CurveLocationDetailPair, curve: CurvePrimitive): CurveLocationDetail | undefined {\n if (pair.detailA.curve === curve)\n return pair.detailA;\n if (pair.detailB.curve === curve)\n return pair.detailB;\n return undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PlanarSubdivision.js","sourceRoot":"","sources":["../../../../src/curve/Query/PlanarSubdivision.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,6CAA0C;AAE1C,gDAA+D;AAC/D,4EAAyE;AACzE,oDAA4D;AAC5D,oCAAiC;AACjC,gEAAsF;AAEtF,oDAAiD;AACjD,kDAA+C;AAC/C,kCAAgE;AAChE,4CAAyC;AAEzC;;GAEG;AAEH,MAAM,+CAA+C;IAC5C,eAAe,GAAG,IAAI,GAAG,EAA6C,CAAC;IAC9E,mDAAmD;IAC5C,gBAAgB,GAAG,IAAI,GAAG,EAA0B,CAAC;IACpD,qBAAqB,GAAW,CAAC,CAAC;IACnC,oBAAoB,CAAC,SAAqC;QAC/D,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACnD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACxB,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;IACH,CAAC;IACM,qBAAqB,CAAC,SAAqC,EAAE,IAA6B;QAC/F,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACvD,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;YACrC,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChB,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;YAC9C,CAAC;iBAAM,CAAC;gBACN,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxB,CAAC;QACH,CAAC;IACH,CAAC;I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C/B,OAAO,SAAS,CAAC;AACnB,CAAC;AACD,SAAS,gBAAgB,CAAC,IAA6B,EAAE,KAAqB;IAC5E,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,KAAK,KAAK;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,KAAK,KAAK;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,OAAO,SAAS,CAAC;AACnB,CAAC","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*--------------------------------------------------------------------------------------------*/\nimport { Geometry } from \"../../Geometry\";\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\nimport { HalfEdge, HalfEdgeGraph } from \"../../topology/Graph\";\nimport { HalfEdgeGraphSearch } from \"../../topology/HalfEdgeGraphSearch\";\nimport { HalfEdgeGraphMerge } from \"../../topology/Merging\";\nimport { Arc3d } from \"../Arc3d\";\nimport { CurveLocationDetail, CurveLocationDetailPair } from \"../CurveLocationDetail\";\nimport { CurvePrimitive } from \"../CurvePrimitive\";\nimport { LineSegment3d } from \"../LineSegment3d\";\nimport { LineString3d } from \"../LineString3d\";\nimport { Loop, LoopCurveLoopCurve, SignedLoops } from \"../Loop\";\nimport { RegionOps } from \"../RegionOps\";\n\n/** @packageDocumentation\n * @module Curve\n */\n\nclass MapCurvePrimitiveToCurveLocationDetailPairArray {\n public primitiveToPair = new Map<CurvePrimitive, CurveLocationDetailPair[]>();\n // index assigned to this primitive (for debugging)\n public primitiveToIndex = new Map<CurvePrimitive, number>();\n private _numIndexedPrimitives: number = 0;\n public assignPrimitiveIndex(primitive: CurvePrimitive | undefined) {\n if (primitive !== undefined) {\n const index = this.primitiveToIndex.get(primitive);\n if (index === undefined) {\n this.primitiveToIndex.set(primitive, this._numIndexedPrimitives++);\n }\n }\n }\n public insertPrimitiveToPair(primitive: CurvePrimitive | undefined, pair: CurveLocationDetailPair) {\n if (primitive) {\n const priorPairs = this.primitiveToPair.get(primitive);\n this.assignPrimitiveIndex(primitive);\n if (!priorPairs) {\n this.primitiveToPair.set(primitive, [pair]);\n } else {\n priorPairs.push(pair);\n }\n }\n }\n public insertPair(pair: CurveLocationDetailPair) {\n const primitiveA = pair.detailA.curve;\n if (primitiveA)\n this.insertPrimitiveToPair(primitiveA, pair);\n const primitiveB = pair.detailB.curve;\n if (primitiveB)\n this.insertPrimitiveToPair(primitiveB, pair);\n }\n /**\n * Split closed missing primitives in half and add new intersection pairs.\n * * When bridge edges aren't included in the primitives array, a closed primitive with no intersections will not be\n * added to the graph because it isn't in the `primitiveToPair` map. By splitting such a missing primitive in two, we\n * introduce two intersections for each half, which allows the primitive to be represented in the map.\n */\n public splitAndAppendMissingClosedPrimitives(primitives: CurvePrimitive[], tolerance: number = Geometry.smallMetricDistance) {\n for (const p of primitives) {\n let closedCurveSplitCandidate = false;\n if (p instanceof Arc3d)\n closedCurveSplitCandidate = p.sweep.isFullCircle;\n else if (!(p instanceof LineSegment3d) && !(p instanceof LineString3d)) // TODO: probably should do this for all types. Lots of spline-type primitives can be closed.\n closedCurveSplitCandidate = p.startPoint().isAlmostEqualXY(p.endPoint(), tolerance);\n if (closedCurveSplitCandidate && !this.primitiveToPair.has(p)) {\n const p0 = p.clonePartialCurve(0.0, 0.5);\n const p1 = p.clonePartialCurve(0.5, 1.0);\n if (p0 && p1) {\n this.insertPair(CurveLocationDetailPair.createCapture(CurveLocationDetail.createCurveEvaluatedFraction(p0, 0.0), CurveLocationDetail.createCurveEvaluatedFraction(p1, 1.0)));\n this.insertPair(CurveLocationDetailPair.createCapture(CurveLocationDetail.createCurveEvaluatedFraction(p0, 1.0), CurveLocationDetail.createCurveEvaluatedFraction(p1, 0.0)));\n }\n }\n }\n }\n}\n\n/**\n * @internal\n */\nexport class PlanarSubdivision {\n /** Create a graph from an array of curves, and an array of the curves' precomputed intersections. Z-coordinates are ignored. */\n public static assembleHalfEdgeGraph(primitives: CurvePrimitive[], allPairs: CurveLocationDetailPair[], mergeTolerance: number = Geometry.smallMetricDistance): HalfEdgeGraph {\n const detailByPrimitive = new MapCurvePrimitiveToCurveLocationDetailPairArray(); // map from key CurvePrimitive to CurveLocationDetailPair.\n for (const pair of allPairs)\n detailByPrimitive.insertPair(pair);\n if (primitives.length > detailByPrimitive.primitiveToPair.size)\n detailByPrimitive.splitAndAppendMissingClosedPrimitives(primitives, mergeTolerance); // otherwise, these single-primitive loops are missing from the graph\n const graph = new HalfEdgeGraph();\n for (const entry of detailByPrimitive.primitiveToPair.entries()) {\n const p = entry[0];\n // convert each interval intersection into two isolated intersections\n const details = entry[1].reduce((accumulator: CurveLocationDetailPair[], detailPair) => {\n if (!detailPair.detailA.hasFraction1)\n return [...accumulator, detailPair];\n const detail = getDetailOnCurve(detailPair, p)!;\n const detail0 = CurveLocationDetail.createCurveFractionPoint(p, detail.fraction, detail.point);\n const detail1 = CurveLocationDetail.createCurveFractionPoint(p, detail.fraction1!, detail.point1!);\n return [...accumulator, CurveLocationDetailPair.createCapture(detail0, detail0), CurveLocationDetailPair.createCapture(detail1, detail1)];\n }, []);\n // lexical sort on p intersection fraction\n details.sort((pairA: CurveLocationDetailPair, pairB: CurveLocationDetailPair) => {\n const fractionA = getFractionOnCurve(pairA, p)!;\n const fractionB = getFractionOnCurve(pairB, p)!;\n return fractionA - fractionB;\n });\n let last = {point: p.startPoint(), fraction: 0.0};\n for (const detailPair of details) {\n const detail = getDetailOnCurve(detailPair, p)!;\n const detailFraction = Geometry.restrictToInterval(detail.fraction, 0, 1); // truncate fraction, but don't snap point; clustering happens later\n last = this.addHalfEdge(graph, p, last.point, last.fraction, detail.point, detailFraction, mergeTolerance);\n }\n this.addHalfEdge(graph, p, last.point, last.fraction, p.endPoint(), 1.0, mergeTolerance);\n }\n HalfEdgeGraphMerge.clusterAndMergeXYTheta(graph, (he: HalfEdge) => he.sortAngle!);\n return graph;\n }\n /**\n * Create a pair of mated half edges referencing an interval of a primitive\n * * no action if start and end points are identical.\n * @param graph containing graph.\n * @param p the curve\n * @param point0 start point\n * @param fraction0 starting fraction\n * @param point1 end point\n * @param fraction1 end fraction\n * @returns end point and fraction, or start point and fraction if no action\n */\n private static addHalfEdge(graph: HalfEdgeGraph, p: CurvePrimitive, point0: Point3d, fraction0: number, point1: Point3d, fraction1: number, mergeTolerance: number = Geometry.smallMetricDistance): {point: Point3d, fraction: number} {\n if (point0.isAlmostEqualXY(point1, mergeTolerance))\n return {point: point0, fraction: fraction0};\n const halfEdge = graph.createEdgeXYAndZ(point0, 0, point1, 0);\n const detail01 = CurveLocationDetail.createCurveEvaluatedFractionFraction(p, fraction0, fraction1);\n const mate = halfEdge.edgeMate;\n halfEdge.edgeTag = detail01;\n halfEdge.sortData = 1.0;\n mate.edgeTag = detail01;\n mate.sortData = -1.0;\n halfEdge.sortAngle = sortAngle(p, fraction0, false);\n mate.sortAngle = sortAngle(p, fraction1, true);\n return {point: point1, fraction: fraction1};\n }\n /**\n * Based on computed (and toleranced) area, push the loop (pointer) onto the appropriate array of positive, negative, or sliver loops.\n * @param zeroAreaTolerance absolute area tolerance for sliver face detection\n * @param isSliverFace whether the loop is known a priori (e.g., via topology) to have zero area\n * @returns the area (forced to zero if within tolerance)\n */\n public static collectSignedLoop(loop: Loop, outLoops: SignedLoops, zeroAreaTolerance: number = 1.0e-10, isSliverFace?: boolean): number{\n let area = isSliverFace ? 0.0 : RegionOps.computeXYArea(loop);\n if (area === undefined)\n area = 0;\n if (Math.abs(area) < zeroAreaTolerance)\n area = 0.0;\n (loop as any).computedAreaInPlanarSubdivision = area;\n if (area > 0)\n outLoops.positiveAreaLoops.push(loop);\n else if (area < 0)\n outLoops.negativeAreaLoops.push(loop);\n else\n outLoops.slivers.push(loop);\n return area;\n }\n public static createLoopInFace(faceSeed: HalfEdge,\n announce?: (he: HalfEdge, curve: CurvePrimitive, loop: Loop) => void): Loop {\n let he = faceSeed;\n const loop = Loop.create();\n do {\n const detail = he.edgeTag as CurveLocationDetail;\n if (detail) {\n let curve;\n if (he.sortData! > 0)\n curve = detail.curve!.clonePartialCurve(detail.fraction, detail.fraction1!);\n else\n curve = detail.curve!.clonePartialCurve(detail.fraction1!, detail.fraction);\n if (curve) {\n if (announce !== undefined)\n announce(he, curve, loop);\n loop.tryAddChild(curve);\n }\n }\n he = he.faceSuccessor;\n } while (he !== faceSeed);\n return loop;\n }\n // Return true if there are only two edges in the face loop, and their start curvatures are the same.\n private static isNullFace(he: HalfEdge): boolean {\n const faceHasTwoEdges = (he.faceSuccessor.faceSuccessor === he);\n let faceIsBanana = false;\n if (faceHasTwoEdges) {\n const c0 = HalfEdgeGraphMerge.curvatureSortKey(he);\n const c1 = HalfEdgeGraphMerge.curvatureSortKey(he.faceSuccessor.edgeMate);\n if (!Geometry.isSameCoordinate(c0, c1)) // default tol!\n faceIsBanana = true; // heuristic: we could also check end curvatures, and/or higher derivatives...\n }\n return faceHasTwoEdges && !faceIsBanana;\n }\n // Look across edge mates (possibly several) for a nonnull mate face.\n private static nonNullEdgeMate(_graph: HalfEdgeGraph, e: HalfEdge): HalfEdge | undefined {\n if (this.isNullFace (e))\n return undefined;\n let e1 = e.edgeMate;\n while (this.isNullFace(e1)){\n e1 = e1.faceSuccessor.edgeMate;\n if (e1 === e)\n return undefined;\n }\n return e1;\n }\n public static collectSignedLoopSetsInHalfEdgeGraph(graph: HalfEdgeGraph, zeroAreaTolerance: number = 1.0e-10): SignedLoops[] {\n const q = HalfEdgeGraphSearch.collectConnectedComponentsWithExteriorParityMasks(graph, undefined);\n const result: SignedLoops[] = [];\n const edgeMap = new Map<HalfEdge, LoopCurveLoopCurve>();\n for (const faceSeeds of q) {\n const componentAreas: SignedLoops = { positiveAreaLoops: [], negativeAreaLoops: [], slivers: [] };\n const edges: LoopCurveLoopCurve[] = [];\n for (const faceSeed of faceSeeds) {\n const isNullFace = this.isNullFace(faceSeed);\n const loop = this.createLoopInFace(faceSeed, (he: HalfEdge, curveC: CurvePrimitive, loopC: Loop) => {\n if (!isNullFace) {\n const mate = this.nonNullEdgeMate(graph, he);\n if (mate !== undefined) {\n const e = edgeMap.get(mate);\n if (e === undefined) {\n // Record this as loopA,edgeA of a shared edge to be completed later from the other side of the edge\n const e1 = new LoopCurveLoopCurve(loopC, curveC, undefined, undefined);\n edgeMap.set(he, e1);\n } else if (e instanceof LoopCurveLoopCurve) {\n e.setB(loopC, curveC);\n edges.push(e);\n edgeMap.delete(mate);\n }\n }\n }\n });\n this.collectSignedLoop(loop, componentAreas, zeroAreaTolerance, isNullFace);\n }\n componentAreas.edges = edges;\n result.push(componentAreas);\n edgeMap.clear();\n }\n return result;\n }\n}\n\nfunction sortAngle(curve: CurvePrimitive, fraction: number, reverse: boolean): number {\n const ray = curve.fractionToPointAndDerivative(fraction);\n const s = reverse ? -1.0 : 1.0;\n return Math.atan2(s * ray.direction.y, s * ray.direction.x);\n}\n\nfunction getFractionOnCurve(pair: CurveLocationDetailPair, curve: CurvePrimitive): number | undefined {\n if (pair.detailA.curve === curve)\n return pair.detailA.fraction;\n if (pair.detailB.curve === curve)\n return pair.detailB.fraction;\n return undefined;\n}\nfunction getDetailOnCurve(pair: CurveLocationDetailPair, curve: CurvePrimitive): CurveLocationDetail | undefined {\n if (pair.detailA.curve === curve)\n return pair.detailA;\n if (pair.detailB.curve === curve)\n return pair.detailB;\n return undefined;\n}\n"]}
|
|
@@ -35,13 +35,14 @@ export declare enum RegionBinaryOpType {
|
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* 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.
|
|
38
|
+
* * Regions are represented by these [[CurveCollection]] subclasses:
|
|
39
|
+
* * [[Loop]] -- a single loop
|
|
40
|
+
* * [[ParityRegion]] -- a collection of loops, interpreted by parity rules.
|
|
41
|
+
* The common "One outer loop and many inner loops" is a parity region.
|
|
42
|
+
* * [[UnionRegion]] -- a collection of `Loop` and `ParityRegion` objects understood as a (probably disjoint) union.
|
|
43
|
+
* * Most of the methods in this class:
|
|
44
|
+
* * Ignore z-coordinates, so callers should ensure that input geometry has been rotated parallel to the xy-plane.
|
|
45
|
+
* * Assume consistent Loop orientation: "solid" Loops are counterclockwise; "hole" Loops are clockwise.
|
|
45
46
|
* @public
|
|
46
47
|
*/
|
|
47
48
|
export declare class RegionOps {
|
|
@@ -60,8 +61,15 @@ export declare class RegionOps {
|
|
|
60
61
|
static computeXYAreaTolerance(range: Range3d, distanceTolerance?: number): number;
|
|
61
62
|
/**
|
|
62
63
|
* Return a (signed) xy area for a region.
|
|
64
|
+
<<<<<<< HEAD
|
|
63
65
|
* * The area is negative if and only if the region is oriented clockwise with respect to the positive z-axis.
|
|
64
66
|
* @param root any Loop, ParityRegion, or UnionRegion.
|
|
67
|
+
=======
|
|
68
|
+
* * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
69
|
+
* * For a non-self-intersecting Loop, the returned area is negative if and only if the Loop is oriented clockwise
|
|
70
|
+
* with respect to the positive z-axis.
|
|
71
|
+
* @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
|
|
72
|
+
>>>>>>> 168574b454 (Utilize `PolyfaceData.edgeMateIndex` to speed up some `Polyface` methods (#8095))
|
|
65
73
|
*/
|
|
66
74
|
static computeXYArea(root: AnyRegion): number | undefined;
|
|
67
75
|
/**
|
|
@@ -121,10 +129,11 @@ export declare class RegionOps {
|
|
|
121
129
|
static polygonXYAreaDifferenceLoopsToPolyface(loopsA: MultiLineStringDataVariant, loopsB: MultiLineStringDataVariant, triangulate?: boolean): Polyface | undefined;
|
|
122
130
|
/**
|
|
123
131
|
* Return areas defined by a boolean operation.
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* @param
|
|
132
|
+
* @note For best results, input regions should have correctly oriented loops. See [[sortOuterAndHoleLoopsXY]].
|
|
133
|
+
* @note A common use case of this method is to convert a region with overlapping children into one with
|
|
134
|
+
* non-overlapping children: `regionOut = RegionOps.regionBooleanXY(regionIn, undefined, RegionBinaryOpType.Union)`.
|
|
135
|
+
* @param loopsA first set of loops (treated as a union)
|
|
136
|
+
* @param loopsB second set of loops (treated as a union)
|
|
128
137
|
* @param operation indicates Union, Intersection, Parity, AMinusB, or BMinusA
|
|
129
138
|
* @param mergeTolerance absolute distance tolerance for merging loops
|
|
130
139
|
* @returns a region resulting from merging input loops and the boolean operation. May contain bridge edges added
|
|
@@ -282,14 +291,15 @@ export declare class RegionOps {
|
|
|
282
291
|
*/
|
|
283
292
|
static consolidateAdjacentPrimitives(curves: CurveCollection, options?: ConsolidateAdjacentCurvePrimitivesOptions): void;
|
|
284
293
|
/**
|
|
285
|
-
* Reverse and reorder loops in the xy-plane for
|
|
286
|
-
* @param loops multiple loops in any order and orientation, z-coordinates ignored
|
|
294
|
+
* Reverse and reorder loops in the xy-plane for consistent orientation and containment.
|
|
295
|
+
* @param loops multiple loops in any order and orientation, z-coordinates ignored.
|
|
296
|
+
* * For best results, all overlaps should be containments, i.e., loop boundaries can touch, but should not cross.
|
|
287
297
|
* @returns a region that captures the input pointers. This region is a:
|
|
288
|
-
* *
|
|
289
|
-
* *
|
|
298
|
+
* * [[Loop]] if there is exactly one input loop. It is oriented counterclockwise.
|
|
299
|
+
* * [[ParityRegion]] if input consists of exactly one outer loop with at least one hole loop.
|
|
290
300
|
* Its first child is an outer loop oriented counterclockwise; all subsequent children are holes oriented
|
|
291
301
|
* clockwise.
|
|
292
|
-
* *
|
|
302
|
+
* * [[UnionRegion]] if any other input configuration. Its children are individually ordered/oriented as in
|
|
293
303
|
* the above cases.
|
|
294
304
|
* @see [[PolygonOps.sortOuterAndHoleLoopsXY]]
|
|
295
305
|
*/
|
|
@@ -298,14 +308,14 @@ export declare class RegionOps {
|
|
|
298
308
|
* Find all xy-areas bounded by the unstructured, possibly intersecting curves.
|
|
299
309
|
* * For best results, input curves should be parallel to the xy-plane, as z-coordinates are ignored.
|
|
300
310
|
* * A common use case of this method is to assemble the bounding "exterior" loop (or loops) containing the
|
|
301
|
-
* input curves.
|
|
311
|
+
* input curves. Note that "holes" implied by inputs are _not_ preserved in output.
|
|
302
312
|
* * This method does not add bridge edges to connect outer loops to inner loops. Each disconnected loop,
|
|
303
313
|
* regardless of its containment, is returned as its own SignedLoops object. Pre-process with [[regionBooleanXY]]
|
|
304
314
|
* to add bridge edges so that [[constructAllXYRegionLoops]] will return outer and inner loops in the same
|
|
305
315
|
* SignedLoops object.
|
|
306
316
|
* @param curvesAndRegions Any collection of curves. Each Loop/ParityRegion/UnionRegion contributes its curve
|
|
307
|
-
* primitives.
|
|
308
|
-
* @param tolerance optional distance tolerance for coincidence
|
|
317
|
+
* primitives, stripped of parity context. This means holes are _not_ preserved in output.
|
|
318
|
+
* @param tolerance optional distance tolerance for coincidence.
|
|
309
319
|
* @returns array of [[SignedLoops]], each entry of which describes the faces in a single connected component:
|
|
310
320
|
* * `positiveAreaLoops` contains "interior" loops, _including holes in ParityRegion input_. These loops have
|
|
311
321
|
* positive area and counterclockwise orientation.
|
|
@@ -357,12 +367,10 @@ export declare class RegionOps {
|
|
|
357
367
|
private static triangulateRegionComponent;
|
|
358
368
|
/**
|
|
359
369
|
* Facet the region according to stroke options.
|
|
370
|
+
* @note For best results, [[UnionRegion]] input should consist of non-overlapping children. See [[regionBooleanXY]].
|
|
371
|
+
* @note For best results, [[ParityRegion]] input should be correctly oriented. See [[sortOuterAndHoleLoopsXY]].
|
|
360
372
|
* @param region a closed xy-planar region, possibly with holes.
|
|
361
373
|
* * 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
374
|
* @param options primarily how to stroke the region boundary, but also how to facet the region interior.
|
|
367
375
|
* * By default, a triangulation is returned, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.
|
|
368
376
|
* @returns facets for the region, or undefined if facetting failed
|
|
@@ -377,17 +385,19 @@ export declare class RegionOps {
|
|
|
377
385
|
static convexDecomposePolygonXY(polygon: MultiLineStringDataVariant, maximize?: boolean): GrowableXYZArray[] | undefined;
|
|
378
386
|
}
|
|
379
387
|
/**
|
|
380
|
-
* * Options to control method `RegionOps.consolidateAdjacentPrimitives
|
|
388
|
+
* * Options to control method `RegionOps.consolidateAdjacentPrimitives`.
|
|
381
389
|
* @public
|
|
382
390
|
*/
|
|
383
391
|
export declare class ConsolidateAdjacentCurvePrimitivesOptions {
|
|
384
|
-
/** True to consolidate adjacent linear geometry into a single LineString3d */
|
|
392
|
+
/** True to consolidate adjacent linear geometry into a single LineString3d. */
|
|
385
393
|
consolidateLinearGeometry: boolean;
|
|
386
|
-
/** True to consolidate contiguous compatible arcs into a single Arc3d */
|
|
394
|
+
/** True to consolidate contiguous compatible arcs into a single Arc3d. */
|
|
387
395
|
consolidateCompatibleArcs: boolean;
|
|
388
|
-
/**
|
|
396
|
+
/** Disable LineSegment3d and LineString3d point compression. */
|
|
397
|
+
disableLinearCompression?: boolean;
|
|
398
|
+
/** Tolerance for collapsing identical points (if `!disableLinearCompression`). */
|
|
389
399
|
duplicatePointTolerance: number;
|
|
390
|
-
/** Tolerance for removing interior colinear points. */
|
|
400
|
+
/** Tolerance for removing interior colinear points (if `!disableLinearCompression`). */
|
|
391
401
|
colinearPointTolerance: number;
|
|
392
402
|
}
|
|
393
403
|
//# sour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 +58,14 @@ var RegionBinaryOpType;
|
|
|
58
58
|
})(RegionBinaryOpType || (exports.RegionBinaryOpType = RegionBinaryOpType = {}));
|
|
59
59
|
/**
|
|
60
60
|
* Class `RegionOps` has static members for calculations on regions (areas).
|
|
61
|
-
* * Regions are represented by these
|
|
62
|
-
* *
|
|
63
|
-
* *
|
|
64
|
-
* The common "One outer loop and many
|
|
65
|
-
* *
|
|
66
|
-
* *
|
|
67
|
-
* 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.
|
|
68
69
|
* @public
|
|
69
70
|
*/
|
|
70
71
|
class RegionOps {
|
|
@@ -95,8 +96,15 @@ class RegionOps {
|
|
|
95
96
|
}
|
|
96
97
|
/**
|
|
97
98
|
* Return a (signed) xy area for a region.
|
|
99
|
+
<<<<<<< HEAD
|
|
98
100
|
* * The area is negative if and only if the region is oriented clockwise with respect to the positive z-axis.
|
|
99
101
|
* @param root any Loop, ParityRegion, or UnionRegion.
|
|
102
|
+
=======
|
|
103
|
+
* * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
104
|
+
* * For a non-self-intersecting Loop, the returned area is negative if and only if the Loop is oriented clockwise
|
|
105
|
+
* with respect to the positive z-axis.
|
|
106
|
+
* @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
|
|
107
|
+
>>>>>>> 168574b454 (Utilize `PolyfaceData.edgeMateIndex` to speed up some `Polyface` methods (#8095))
|
|
100
108
|
*/
|
|
101
109
|
static computeXYArea(root) {
|
|
102
110
|
const handler = new RegionMomentsXY_1.RegionMomentsXY();
|
|
@@ -238,10 +246,11 @@ class RegionOps {
|
|
|
238
246
|
}
|
|
239
247
|
/**
|
|
240
248
|
* Return areas defined by a boolean operation.
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
* @param
|
|
249
|
+
* @note For best results, input regions should have correctly oriented loops. See [[sortOuterAndHoleLoopsXY]].
|
|
250
|
+
* @note A common use case of this method is to convert a region with overlapping children into one with
|
|
251
|
+
* non-overlapping children: `regionOut = RegionOps.regionBooleanXY(regionIn, undefined, RegionBinaryOpType.Union)`.
|
|
252
|
+
* @param loopsA first set of loops (treated as a union)
|
|
253
|
+
* @param loopsB second set of loops (treated as a union)
|
|
245
254
|
* @param operation indicates Union, Intersection, Parity, AMinusB, or BMinusA
|
|
246
255
|
* @param mergeTolerance absolute distance tolerance for merging loops
|
|
247
256
|
* @returns a region resulting from merging input loops and the boolean operation. May contain bridge edges added
|
|
@@ -559,14 +568,15 @@ class RegionOps {
|
|
|
559
568
|
curves.dispatchToGeometryHandler(context);
|
|
560
569
|
}
|
|
561
570
|
/**
|
|
562
|
-
* Reverse and reorder loops in the xy-plane for
|
|
563
|
-
* @param loops multiple loops in any order and orientation, z-coordinates ignored
|
|
571
|
+
* Reverse and reorder loops in the xy-plane for consistent orientation and containment.
|
|
572
|
+
* @param loops multiple loops in any order and orientation, z-coordinates ignored.
|
|
573
|
+
* * For best results, all overlaps should be containments, i.e., loop boundaries can touch, but should not cross.
|
|
564
574
|
* @returns a region that captures the input pointers. This region is a:
|
|
565
|
-
* *
|
|
566
|
-
* *
|
|
575
|
+
* * [[Loop]] if there is exactly one input loop. It is oriented counterclockwise.
|
|
576
|
+
* * [[ParityRegion]] if input consists of exactly one outer loop with at least one hole loop.
|
|
567
577
|
* Its first child is an outer loop oriented counterclockwise; all subsequent children are holes oriented
|
|
568
578
|
* clockwise.
|
|
569
|
-
* *
|
|
579
|
+
* * [[UnionRegion]] if any other input configuration. Its children are individually ordered/oriented as in
|
|
570
580
|
* the above cases.
|
|
571
581
|
* @see [[PolygonOps.sortOuterAndHoleLoopsXY]]
|
|
572
582
|
*/
|
|
@@ -586,14 +596,14 @@ class RegionOps {
|
|
|
586
596
|
* Find all xy-areas bounded by the unstructured, possibly intersecting curves.
|
|
587
597
|
* * For best results, input curves should be parallel to the xy-plane, as z-coordinates are ignored.
|
|
588
598
|
* * A common use case of this method is to assemble the bounding "exterior" loop (or loops) containing the
|
|
589
|
-
* input curves.
|
|
599
|
+
* input curves. Note that "holes" implied by inputs are _not_ preserved in output.
|
|
590
600
|
* * This method does not add bridge edges to connect outer loops to inner loops. Each disconnected loop,
|
|
591
601
|
* regardless of its containment, is returned as its own SignedLoops object. Pre-process with [[regionBooleanXY]]
|
|
592
602
|
* to add bridge edges so that [[constructAllXYRegionLoops]] will return outer and inner loops in the same
|
|
593
603
|
* SignedLoops object.
|
|
594
604
|
* @param curvesAndRegions Any collection of curves. Each Loop/ParityRegion/UnionRegion contributes its curve
|
|
595
|
-
* primitives.
|
|
596
|
-
* @param tolerance optional distance tolerance for coincidence
|
|
605
|
+
* primitives, stripped of parity context. This means holes are _not_ preserved in output.
|
|
606
|
+
* @param tolerance optional distance tolerance for coincidence.
|
|
597
607
|
* @returns array of [[SignedLoops]], each entry of which describes the faces in a single connected component:
|
|
598
608
|
* * `positiveAreaLoops` contains "interior" loops, _including holes in ParityRegion input_. These loops have
|
|
599
609
|
* positive area and counterclockwise orientation.
|
|
@@ -756,12 +766,10 @@ class RegionOps {
|
|
|
756
766
|
}
|
|
757
767
|
/**
|
|
758
768
|
* Facet the region according to stroke options.
|
|
769
|
+
* @note For best results, [[UnionRegion]] input should consist of non-overlapping children. See [[regionBooleanXY]].
|
|
770
|
+
* @note For best results, [[ParityRegion]] input should be correctly oriented. See [[sortOuterAndHoleLoopsXY]].
|
|
759
771
|
* @param region a closed xy-planar region, possibly with holes.
|
|
760
772
|
* * 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.
|
|
761
|
-
* * For best results, `UnionRegion` input should consist of non-overlapping children.
|
|
762
|
-
* Caller can ensure this by passing in `region = RegionOps.regionBooleanXY(unionRegion, undefined, RegionBinaryOpType.Union)`.
|
|
763
|
-
* * For best results, `ParityRegion` input should be correctly oriented (holes have opposite orientation to their containing loop).
|
|
764
|
-
* Caller can ensure this for non-intersecting loops by passing in `region = RegionOps.sortOuterAndHoleLoopsXY(loops)`.
|
|
765
773
|
* @param options primarily how to stroke the region boundary, but also how to facet the region interior.
|
|
766
774
|
* * By default, a triangulation is returned, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.
|
|
767
775
|
* @returns facets for the region, or undefined if facetting failed
|
|
@@ -825,17 +833,19 @@ function pushToInOnOutArrays(curve, select, arrayNegative, array0, arrayPositive
|
|
|
825
833
|
array0.push(curve);
|
|
826
834
|
}
|
|
827
835
|
/**
|
|
828
|
-
* * Options to control method `RegionOps.consolidateAdjacentPrimitives
|
|
836
|
+
* * Options to control method `RegionOps.consolidateAdjacentPrimitives`.
|
|
829
837
|
* @public
|
|
830
838
|
*/
|
|
831
839
|
class ConsolidateAdjacentCurvePrimitivesOptions {
|
|
832
|
-
/** True to consolidate adjacent linear geometry into a single LineString3d */
|
|
840
|
+
/** True to consolidate adjacent linear geometry into a single LineString3d. */
|
|
833
841
|
consolidateLinearGeometry = true;
|
|
834
|
-
/** True to consolidate contiguous compatible arcs into a single Arc3d */
|
|
842
|
+
/** True to consolidate contiguous compatible arcs into a single Arc3d. */
|
|
835
843
|
consolidateCompatibleArcs = true;
|
|
836
|
-
/**
|
|
844
|
+
/** Disable LineSegment3d and LineString3d point compression. */
|
|
845
|
+
disableLinearCompression = false;
|
|
846
|
+
/** Tolerance for collapsing identical points (if `!disableLinearCompression`). */
|
|
837
847
|
duplicatePointTolerance = Geometry_1.Geometry.smallMetricDistance;
|
|
838
|
-
/** Tolerance for removing interior colinear points. */
|
|
848
|
+
/** Tolerance for removing interior colinear points (if `!disableLinearCompression`). */
|
|
839
849
|
colinearPointTolerance = Geometry_1.Geometry.smallMetricDistance;
|
|
840
850
|
}
|
|
841
851
|
exports.ConsolidateAdjacentCurvePrimitivesOptions = ConsolidateAdjacentCurvePrimitivesOptions;
|