@itwin/core-geometry 5.1.0-dev.9 → 5.2.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (598) hide show
  1. package/CHANGELOG.md +58 -1
  2. package/lib/cjs/Geometry.d.ts +18 -10
  3. package/lib/cjs/Geometry.d.ts.map +1 -1
  4. package/lib/cjs/Geometry.js +13 -3
  5. package/lib/cjs/Geometry.js.map +1 -1
  6. package/lib/cjs/bspline/BSpline1dNd.d.ts +1 -1
  7. package/lib/cjs/bspline/BSpline1dNd.js +1 -1
  8. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  9. package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
  10. package/lib/cjs/bspline/BSplineCurve.js +7 -1
  11. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  12. package/lib/cjs/bspline/BSplineSurface.d.ts +4 -3
  13. package/lib/cjs/bspline/BSplineSurface.d.ts.map +1 -1
  14. package/lib/cjs/bspline/BSplineSurface.js +4 -5
  15. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  16. package/lib/cjs/clipping/ClipPlane.d.ts +7 -5
  17. package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
  18. package/lib/cjs/clipping/ClipPlane.js +9 -5
  19. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  20. package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
  21. package/lib/cjs/clipping/ClipUtils.js +5 -3
  22. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  23. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +1 -2
  24. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  25. package/lib/cjs/clipping/ConvexClipPlaneSet.js +13 -25
  26. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  27. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +1 -2
  28. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  29. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +1 -2
  30. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  31. package/lib/cjs/core-geometry.d.ts +2 -0
  32. package/lib/cjs/core-geometry.d.ts.map +1 -1
  33. package/lib/cjs/core-geometry.js +2 -0
  34. package/lib/cjs/core-geometry.js.map +1 -1
  35. package/lib/cjs/curve/Arc3d.d.ts +54 -32
  36. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  37. package/lib/cjs/curve/Arc3d.js +56 -37
  38. package/lib/cjs/curve/Arc3d.js.map +1 -1
  39. package/lib/cjs/curve/CurveCollection.d.ts +40 -1
  40. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  41. package/lib/cjs/curve/CurveCollection.js +90 -0
  42. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  43. package/lib/cjs/curve/CurveFactory.d.ts +3 -2
  44. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  45. package/lib/cjs/curve/CurveFactory.js +6 -5
  46. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  47. package/lib/cjs/curve/CurveLocationDetail.d.ts +27 -25
  48. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  49. package/lib/cjs/curve/CurveLocationDetail.js +30 -25
  50. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  51. package/lib/cjs/curve/CurvePrimitive.d.ts +9 -2
  52. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  53. package/lib/cjs/curve/CurvePrimitive.js +11 -0
  54. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  55. package/lib/cjs/curve/CurveTypes.d.ts +1 -1
  56. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  57. package/lib/cjs/curve/LineSegment3d.d.ts +2 -0
  58. package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
  59. package/lib/cjs/curve/LineSegment3d.js +4 -0
  60. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  61. package/lib/cjs/curve/LineString3d.d.ts +7 -0
  62. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  63. package/lib/cjs/curve/LineString3d.js +15 -3
  64. package/lib/cjs/curve/LineString3d.js.map +1 -1
  65. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
  66. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +37 -8
  67. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  68. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +34 -8
  69. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  70. package/lib/cjs/curve/Query/PlanarSubdivision.js +129 -33
  71. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  72. package/lib/cjs/curve/Query/StrokeCountChain.d.ts +4 -3
  73. package/lib/cjs/curve/Query/StrokeCountChain.d.ts.map +1 -1
  74. package/lib/cjs/curve/Query/StrokeCountChain.js +20 -9
  75. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  76. package/lib/cjs/curve/RegionMomentsXY.d.ts +2 -1
  77. package/lib/cjs/curve/RegionMomentsXY.d.ts.map +1 -1
  78. package/lib/cjs/curve/RegionMomentsXY.js +26 -41
  79. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  80. package/lib/cjs/curve/RegionOps.d.ts +74 -39
  81. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  82. package/lib/cjs/curve/RegionOps.js +146 -46
  83. package/lib/cjs/curve/RegionOps.js.map +1 -1
  84. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +36 -27
  85. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  86. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +161 -55
  87. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  88. package/lib/cjs/curve/StrokeOptions.d.ts +1 -1
  89. package/lib/cjs/curve/StrokeOptions.js +1 -1
  90. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  91. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  92. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +2 -2
  93. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +6 -6
  94. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  95. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +0 -1
  96. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  97. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +58 -32
  98. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  99. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
  100. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +0 -1
  101. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  102. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.d.ts +14 -0
  103. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.d.ts.map +1 -0
  104. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js +34 -0
  105. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -0
  106. package/lib/cjs/geometry3d/AngleSweep.d.ts +25 -18
  107. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  108. package/lib/cjs/geometry3d/AngleSweep.js +32 -18
  109. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  110. package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts +8 -7
  111. package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
  112. package/lib/cjs/geometry3d/CoincidentGeometryOps.js +19 -25
  113. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  114. package/lib/cjs/geometry3d/Ellipsoid.js +1 -1
  115. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  116. package/lib/cjs/geometry3d/GrowableXYArray.d.ts +1 -1
  117. package/lib/cjs/geometry3d/GrowableXYArray.js +1 -1
  118. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  119. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +8 -3
  120. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  121. package/lib/cjs/geometry3d/GrowableXYZArray.js +21 -3
  122. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  123. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +11 -1
  124. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  125. package/lib/cjs/geometry3d/IndexedXYZCollection.js +21 -3
  126. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  127. package/lib/cjs/geometry3d/Plane3d.d.ts +2 -0
  128. package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -1
  129. package/lib/cjs/geometry3d/Plane3d.js +6 -1
  130. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  131. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +2 -0
  132. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
  133. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +6 -1
  134. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  135. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts +8 -2
  136. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  137. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +18 -10
  138. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  139. package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
  140. package/lib/cjs/geometry3d/Point2dVector2d.js +0 -2
  141. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  142. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +4 -4
  143. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  144. package/lib/cjs/geometry3d/Point3dVector3d.js +4 -5
  145. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  146. package/lib/cjs/geometry3d/PointHelpers.d.ts +7 -7
  147. package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
  148. package/lib/cjs/geometry3d/PointHelpers.js +66 -26
  149. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  150. package/lib/cjs/geometry3d/PolygonOps.d.ts +49 -2
  151. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  152. package/lib/cjs/geometry3d/PolygonOps.js +38 -2
  153. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  154. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts +13 -6
  155. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
  156. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +16 -9
  157. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  158. package/lib/cjs/geometry3d/PolylineOps.d.ts +5 -4
  159. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  160. package/lib/cjs/geometry3d/PolylineOps.js +5 -4
  161. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  162. package/lib/cjs/geometry3d/Range.d.ts +18 -10
  163. package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
  164. package/lib/cjs/geometry3d/Range.js +32 -10
  165. package/lib/cjs/geometry3d/Range.js.map +1 -1
  166. package/lib/cjs/geometry3d/Ray2d.d.ts.map +1 -1
  167. package/lib/cjs/geometry3d/Ray2d.js +0 -1
  168. package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
  169. package/lib/cjs/geometry3d/Ray3d.d.ts +7 -9
  170. package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
  171. package/lib/cjs/geometry3d/Ray3d.js +23 -45
  172. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  173. package/lib/cjs/geometry3d/ReusableObjectCache.d.ts +39 -29
  174. package/lib/cjs/geometry3d/ReusableObjectCache.d.ts.map +1 -1
  175. package/lib/cjs/geometry3d/ReusableObjectCache.js +49 -35
  176. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  177. package/lib/cjs/geometry3d/SortablePolygon.d.ts +1 -4
  178. package/lib/cjs/geometry3d/SortablePolygon.d.ts.map +1 -1
  179. package/lib/cjs/geometry3d/SortablePolygon.js +48 -43
  180. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  181. package/lib/cjs/geometry3d/Transform.d.ts +21 -2
  182. package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
  183. package/lib/cjs/geometry3d/Transform.js +32 -13
  184. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  185. package/lib/cjs/geometry4d/Point4d.d.ts +8 -5
  186. package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
  187. package/lib/cjs/geometry4d/Point4d.js +27 -16
  188. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  189. package/lib/cjs/numerics/BezierPolynomials.d.ts +2 -0
  190. package/lib/cjs/numerics/BezierPolynomials.d.ts.map +1 -1
  191. package/lib/cjs/numerics/BezierPolynomials.js +11 -0
  192. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  193. package/lib/cjs/numerics/SmallSystem.d.ts +77 -36
  194. package/lib/cjs/numerics/SmallSystem.d.ts.map +1 -1
  195. package/lib/cjs/numerics/SmallSystem.js +129 -73
  196. package/lib/cjs/numerics/SmallSystem.js.map +1 -1
  197. package/lib/cjs/polyface/FacetOrientation.d.ts +1 -1
  198. package/lib/cjs/polyface/FacetOrientation.js +1 -1
  199. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  200. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +55 -40
  201. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  202. package/lib/cjs/polyface/IndexedEdgeMatcher.js +83 -75
  203. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  204. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +15 -14
  205. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  206. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +47 -38
  207. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  208. package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts +26 -19
  209. package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
  210. package/lib/cjs/polyface/IndexedPolyfaceWalker.js +51 -32
  211. package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
  212. package/lib/cjs/polyface/Polyface.d.ts +19 -5
  213. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  214. package/lib/cjs/polyface/Polyface.js +18 -2
  215. package/lib/cjs/polyface/Polyface.js.map +1 -1
  216. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +1 -1
  217. package/lib/cjs/polyface/PolyfaceBuilder.js +6 -6
  218. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  219. package/lib/cjs/polyface/PolyfaceClip.d.ts +19 -18
  220. package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
  221. package/lib/cjs/polyface/PolyfaceClip.js +39 -42
  222. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  223. package/lib/cjs/polyface/PolyfaceData.d.ts +1 -1
  224. package/lib/cjs/polyface/PolyfaceData.js +1 -1
  225. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  226. package/lib/cjs/polyface/PolyfaceQuery.d.ts +119 -78
  227. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  228. package/lib/cjs/polyface/PolyfaceQuery.js +315 -231
  229. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  230. package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +3 -3
  231. package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
  232. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +3 -3
  233. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  234. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts +7 -6
  235. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  236. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +8 -9
  237. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  238. package/lib/cjs/serialization/BGFBReader.d.ts.map +1 -1
  239. package/lib/cjs/serialization/BGFBReader.js +2 -3
  240. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  241. package/lib/cjs/serialization/BGFBWriter.d.ts.map +1 -1
  242. package/lib/cjs/serialization/BGFBWriter.js +2 -4
  243. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  244. package/lib/cjs/serialization/GeometrySamples.d.ts +1 -1
  245. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  246. package/lib/cjs/serialization/GeometrySamples.js +3 -3
  247. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  248. package/lib/cjs/serialization/IModelJsonSchema.d.ts +3 -3
  249. package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
  250. package/lib/cjs/serialization/IModelJsonSchema.js +5 -5
  251. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  252. package/lib/cjs/solid/Box.d.ts.map +1 -1
  253. package/lib/cjs/solid/Box.js +7 -0
  254. package/lib/cjs/solid/Box.js.map +1 -1
  255. package/lib/cjs/solid/Cone.d.ts.map +1 -1
  256. package/lib/cjs/solid/Cone.js +6 -0
  257. package/lib/cjs/solid/Cone.js.map +1 -1
  258. package/lib/cjs/solid/LinearSweep.d.ts +2 -3
  259. package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
  260. package/lib/cjs/solid/LinearSweep.js +11 -7
  261. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  262. package/lib/cjs/solid/RotationalSweep.d.ts +2 -2
  263. package/lib/cjs/solid/RotationalSweep.js +2 -2
  264. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  265. package/lib/cjs/solid/RuledSweep.d.ts +1 -1
  266. package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
  267. package/lib/cjs/solid/RuledSweep.js +5 -1
  268. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  269. package/lib/cjs/solid/Sphere.d.ts.map +1 -1
  270. package/lib/cjs/solid/Sphere.js +6 -3
  271. package/lib/cjs/solid/Sphere.js.map +1 -1
  272. package/lib/cjs/solid/SweepContour.d.ts +1 -1
  273. package/lib/cjs/solid/SweepContour.js +1 -1
  274. package/lib/cjs/solid/SweepContour.js.map +1 -1
  275. package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
  276. package/lib/cjs/solid/TorusPipe.js +4 -0
  277. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  278. package/lib/cjs/topology/ChainMerge.d.ts +1 -1
  279. package/lib/cjs/topology/ChainMerge.js +1 -1
  280. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  281. package/lib/cjs/topology/Graph.d.ts +64 -14
  282. package/lib/cjs/topology/Graph.d.ts.map +1 -1
  283. package/lib/cjs/topology/Graph.js +149 -32
  284. package/lib/cjs/topology/Graph.js.map +1 -1
  285. package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts +3 -2
  286. package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
  287. package/lib/cjs/topology/HalfEdgeGraphSearch.js +3 -2
  288. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  289. package/lib/cjs/topology/Merging.d.ts +0 -1
  290. package/lib/cjs/topology/Merging.d.ts.map +1 -1
  291. package/lib/cjs/topology/Merging.js +49 -46
  292. package/lib/cjs/topology/Merging.js.map +1 -1
  293. package/lib/cjs/topology/RegularizeFace.d.ts.map +1 -1
  294. package/lib/cjs/topology/RegularizeFace.js +2 -1
  295. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  296. package/lib/cjs/topology/Triangulation.d.ts +9 -14
  297. package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
  298. package/lib/cjs/topology/Triangulation.js +29 -22
  299. package/lib/cjs/topology/Triangulation.js.map +1 -1
  300. package/lib/esm/Geometry.d.ts +18 -10
  301. package/lib/esm/Geometry.d.ts.map +1 -1
  302. package/lib/esm/Geometry.js +13 -3
  303. package/lib/esm/Geometry.js.map +1 -1
  304. package/lib/esm/bspline/BSpline1dNd.d.ts +1 -1
  305. package/lib/esm/bspline/BSpline1dNd.js +1 -1
  306. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  307. package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
  308. package/lib/esm/bspline/BSplineCurve.js +7 -1
  309. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  310. package/lib/esm/bspline/BSplineSurface.d.ts +4 -3
  311. package/lib/esm/bspline/BSplineSurface.d.ts.map +1 -1
  312. package/lib/esm/bspline/BSplineSurface.js +4 -5
  313. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  314. package/lib/esm/clipping/ClipPlane.d.ts +7 -5
  315. package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
  316. package/lib/esm/clipping/ClipPlane.js +9 -5
  317. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  318. package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
  319. package/lib/esm/clipping/ClipUtils.js +5 -3
  320. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  321. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +1 -2
  322. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  323. package/lib/esm/clipping/ConvexClipPlaneSet.js +13 -25
  324. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  325. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +1 -2
  326. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  327. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +1 -2
  328. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  329. package/lib/esm/core-geometry.d.ts +2 -0
  330. package/lib/esm/core-geometry.d.ts.map +1 -1
  331. package/lib/esm/core-geometry.js +2 -0
  332. package/lib/esm/core-geometry.js.map +1 -1
  333. package/lib/esm/curve/Arc3d.d.ts +54 -32
  334. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  335. package/lib/esm/curve/Arc3d.js +56 -37
  336. package/lib/esm/curve/Arc3d.js.map +1 -1
  337. package/lib/esm/curve/CurveCollection.d.ts +40 -1
  338. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  339. package/lib/esm/curve/CurveCollection.js +90 -0
  340. package/lib/esm/curve/CurveCollection.js.map +1 -1
  341. package/lib/esm/curve/CurveFactory.d.ts +3 -2
  342. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  343. package/lib/esm/curve/CurveFactory.js +6 -5
  344. package/lib/esm/curve/CurveFactory.js.map +1 -1
  345. package/lib/esm/curve/CurveLocationDetail.d.ts +27 -25
  346. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  347. package/lib/esm/curve/CurveLocationDetail.js +30 -25
  348. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  349. package/lib/esm/curve/CurvePrimitive.d.ts +9 -2
  350. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  351. package/lib/esm/curve/CurvePrimitive.js +11 -0
  352. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  353. package/lib/esm/curve/CurveTypes.d.ts +1 -1
  354. package/lib/esm/curve/CurveTypes.js.map +1 -1
  355. package/lib/esm/curve/LineSegment3d.d.ts +2 -0
  356. package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
  357. package/lib/esm/curve/LineSegment3d.js +4 -0
  358. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  359. package/lib/esm/curve/LineString3d.d.ts +7 -0
  360. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  361. package/lib/esm/curve/LineString3d.js +15 -3
  362. package/lib/esm/curve/LineString3d.js.map +1 -1
  363. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
  364. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +37 -8
  365. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  366. package/lib/esm/curve/Query/PlanarSubdivision.d.ts +34 -8
  367. package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  368. package/lib/esm/curve/Query/PlanarSubdivision.js +131 -35
  369. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  370. package/lib/esm/curve/Query/StrokeCountChain.d.ts +4 -3
  371. package/lib/esm/curve/Query/StrokeCountChain.d.ts.map +1 -1
  372. package/lib/esm/curve/Query/StrokeCountChain.js +20 -9
  373. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  374. package/lib/esm/curve/RegionMomentsXY.d.ts +2 -1
  375. package/lib/esm/curve/RegionMomentsXY.d.ts.map +1 -1
  376. package/lib/esm/curve/RegionMomentsXY.js +26 -41
  377. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  378. package/lib/esm/curve/RegionOps.d.ts +74 -39
  379. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  380. package/lib/esm/curve/RegionOps.js +146 -46
  381. package/lib/esm/curve/RegionOps.js.map +1 -1
  382. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +36 -27
  383. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  384. package/lib/esm/curve/RegionOpsClassificationSweeps.js +161 -56
  385. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  386. package/lib/esm/curve/StrokeOptions.d.ts +1 -1
  387. package/lib/esm/curve/StrokeOptions.js +1 -1
  388. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  389. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  390. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +2 -2
  391. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +6 -6
  392. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  393. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +0 -1
  394. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  395. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +58 -32
  396. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  397. package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
  398. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +0 -1
  399. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  400. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.d.ts +14 -0
  401. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.d.ts.map +1 -0
  402. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js +30 -0
  403. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -0
  404. package/lib/esm/geometry3d/AngleSweep.d.ts +25 -18
  405. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  406. package/lib/esm/geometry3d/AngleSweep.js +32 -18
  407. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  408. package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts +8 -7
  409. package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
  410. package/lib/esm/geometry3d/CoincidentGeometryOps.js +19 -25
  411. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  412. package/lib/esm/geometry3d/Ellipsoid.js +1 -1
  413. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  414. package/lib/esm/geometry3d/GrowableXYArray.d.ts +1 -1
  415. package/lib/esm/geometry3d/GrowableXYArray.js +1 -1
  416. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  417. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +8 -3
  418. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  419. package/lib/esm/geometry3d/GrowableXYZArray.js +21 -3
  420. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  421. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +11 -1
  422. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  423. package/lib/esm/geometry3d/IndexedXYZCollection.js +21 -3
  424. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  425. package/lib/esm/geometry3d/Plane3d.d.ts +2 -0
  426. package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -1
  427. package/lib/esm/geometry3d/Plane3d.js +6 -1
  428. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  429. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +2 -0
  430. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
  431. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +6 -1
  432. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  433. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts +8 -2
  434. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  435. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +18 -10
  436. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  437. package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
  438. package/lib/esm/geometry3d/Point2dVector2d.js +0 -2
  439. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  440. package/lib/esm/geometry3d/Point3dVector3d.d.ts +4 -4
  441. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  442. package/lib/esm/geometry3d/Point3dVector3d.js +4 -5
  443. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  444. package/lib/esm/geometry3d/PointHelpers.d.ts +7 -7
  445. package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
  446. package/lib/esm/geometry3d/PointHelpers.js +66 -26
  447. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  448. package/lib/esm/geometry3d/PolygonOps.d.ts +49 -2
  449. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  450. package/lib/esm/geometry3d/PolygonOps.js +38 -2
  451. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  452. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts +13 -6
  453. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
  454. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +16 -9
  455. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  456. package/lib/esm/geometry3d/PolylineOps.d.ts +5 -4
  457. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  458. package/lib/esm/geometry3d/PolylineOps.js +5 -4
  459. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  460. package/lib/esm/geometry3d/Range.d.ts +18 -10
  461. package/lib/esm/geometry3d/Range.d.ts.map +1 -1
  462. package/lib/esm/geometry3d/Range.js +32 -10
  463. package/lib/esm/geometry3d/Range.js.map +1 -1
  464. package/lib/esm/geometry3d/Ray2d.d.ts.map +1 -1
  465. package/lib/esm/geometry3d/Ray2d.js +0 -1
  466. package/lib/esm/geometry3d/Ray2d.js.map +1 -1
  467. package/lib/esm/geometry3d/Ray3d.d.ts +7 -9
  468. package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
  469. package/lib/esm/geometry3d/Ray3d.js +23 -45
  470. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  471. package/lib/esm/geometry3d/ReusableObjectCache.d.ts +39 -29
  472. package/lib/esm/geometry3d/ReusableObjectCache.d.ts.map +1 -1
  473. package/lib/esm/geometry3d/ReusableObjectCache.js +47 -33
  474. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  475. package/lib/esm/geometry3d/SortablePolygon.d.ts +1 -4
  476. package/lib/esm/geometry3d/SortablePolygon.d.ts.map +1 -1
  477. package/lib/esm/geometry3d/SortablePolygon.js +48 -43
  478. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  479. package/lib/esm/geometry3d/Transform.d.ts +21 -2
  480. package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
  481. package/lib/esm/geometry3d/Transform.js +32 -13
  482. package/lib/esm/geometry3d/Transform.js.map +1 -1
  483. package/lib/esm/geometry4d/Point4d.d.ts +8 -5
  484. package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
  485. package/lib/esm/geometry4d/Point4d.js +27 -16
  486. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  487. package/lib/esm/numerics/BezierPolynomials.d.ts +2 -0
  488. package/lib/esm/numerics/BezierPolynomials.d.ts.map +1 -1
  489. package/lib/esm/numerics/BezierPolynomials.js +11 -0
  490. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  491. package/lib/esm/numerics/SmallSystem.d.ts +77 -36
  492. package/lib/esm/numerics/SmallSystem.d.ts.map +1 -1
  493. package/lib/esm/numerics/SmallSystem.js +129 -73
  494. package/lib/esm/numerics/SmallSystem.js.map +1 -1
  495. package/lib/esm/polyface/FacetOrientation.d.ts +1 -1
  496. package/lib/esm/polyface/FacetOrientation.js +1 -1
  497. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  498. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +55 -40
  499. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  500. package/lib/esm/polyface/IndexedEdgeMatcher.js +83 -75
  501. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  502. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +15 -14
  503. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  504. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +47 -38
  505. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  506. package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts +26 -19
  507. package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
  508. package/lib/esm/polyface/IndexedPolyfaceWalker.js +51 -32
  509. package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
  510. package/lib/esm/polyface/Polyface.d.ts +19 -5
  511. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  512. package/lib/esm/polyface/Polyface.js +18 -2
  513. package/lib/esm/polyface/Polyface.js.map +1 -1
  514. package/lib/esm/polyface/PolyfaceBuilder.d.ts +1 -1
  515. package/lib/esm/polyface/PolyfaceBuilder.js +6 -6
  516. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  517. package/lib/esm/polyface/PolyfaceClip.d.ts +19 -18
  518. package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
  519. package/lib/esm/polyface/PolyfaceClip.js +39 -42
  520. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  521. package/lib/esm/polyface/PolyfaceData.d.ts +1 -1
  522. package/lib/esm/polyface/PolyfaceData.js +1 -1
  523. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  524. package/lib/esm/polyface/PolyfaceQuery.d.ts +119 -78
  525. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  526. package/lib/esm/polyface/PolyfaceQuery.js +316 -232
  527. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  528. package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +3 -3
  529. package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
  530. package/lib/esm/polyface/RangeTree/RangeTreeNode.js +3 -3
  531. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  532. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts +7 -6
  533. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  534. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +8 -9
  535. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  536. package/lib/esm/serialization/BGFBReader.d.ts.map +1 -1
  537. package/lib/esm/serialization/BGFBReader.js +2 -3
  538. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  539. package/lib/esm/serialization/BGFBWriter.d.ts.map +1 -1
  540. package/lib/esm/serialization/BGFBWriter.js +2 -4
  541. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  542. package/lib/esm/serialization/GeometrySamples.d.ts +1 -1
  543. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  544. package/lib/esm/serialization/GeometrySamples.js +3 -3
  545. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  546. package/lib/esm/serialization/IModelJsonSchema.d.ts +3 -3
  547. package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
  548. package/lib/esm/serialization/IModelJsonSchema.js +5 -5
  549. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  550. package/lib/esm/solid/Box.d.ts.map +1 -1
  551. package/lib/esm/solid/Box.js +7 -0
  552. package/lib/esm/solid/Box.js.map +1 -1
  553. package/lib/esm/solid/Cone.d.ts.map +1 -1
  554. package/lib/esm/solid/Cone.js +6 -0
  555. package/lib/esm/solid/Cone.js.map +1 -1
  556. package/lib/esm/solid/LinearSweep.d.ts +2 -3
  557. package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
  558. package/lib/esm/solid/LinearSweep.js +11 -7
  559. package/lib/esm/solid/LinearSweep.js.map +1 -1
  560. package/lib/esm/solid/RotationalSweep.d.ts +2 -2
  561. package/lib/esm/solid/RotationalSweep.js +2 -2
  562. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  563. package/lib/esm/solid/RuledSweep.d.ts +1 -1
  564. package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
  565. package/lib/esm/solid/RuledSweep.js +5 -1
  566. package/lib/esm/solid/RuledSweep.js.map +1 -1
  567. package/lib/esm/solid/Sphere.d.ts.map +1 -1
  568. package/lib/esm/solid/Sphere.js +6 -3
  569. package/lib/esm/solid/Sphere.js.map +1 -1
  570. package/lib/esm/solid/SweepContour.d.ts +1 -1
  571. package/lib/esm/solid/SweepContour.js +1 -1
  572. package/lib/esm/solid/SweepContour.js.map +1 -1
  573. package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
  574. package/lib/esm/solid/TorusPipe.js +4 -0
  575. package/lib/esm/solid/TorusPipe.js.map +1 -1
  576. package/lib/esm/topology/ChainMerge.d.ts +1 -1
  577. package/lib/esm/topology/ChainMerge.js +1 -1
  578. package/lib/esm/topology/ChainMerge.js.map +1 -1
  579. package/lib/esm/topology/Graph.d.ts +64 -14
  580. package/lib/esm/topology/Graph.d.ts.map +1 -1
  581. package/lib/esm/topology/Graph.js +149 -32
  582. package/lib/esm/topology/Graph.js.map +1 -1
  583. package/lib/esm/topology/HalfEdgeGraphSearch.d.ts +3 -2
  584. package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
  585. package/lib/esm/topology/HalfEdgeGraphSearch.js +3 -2
  586. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  587. package/lib/esm/topology/Merging.d.ts +0 -1
  588. package/lib/esm/topology/Merging.d.ts.map +1 -1
  589. package/lib/esm/topology/Merging.js +49 -46
  590. package/lib/esm/topology/Merging.js.map +1 -1
  591. package/lib/esm/topology/RegularizeFace.d.ts.map +1 -1
  592. package/lib/esm/topology/RegularizeFace.js +2 -1
  593. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  594. package/lib/esm/topology/Triangulation.d.ts +9 -14
  595. package/lib/esm/topology/Triangulation.d.ts.map +1 -1
  596. package/lib/esm/topology/Triangulation.js +29 -22
  597. package/lib/esm/topology/Triangulation.js.map +1 -1
  598. package/package.json +7 -6
@@ -36,13 +36,14 @@ export declare enum RegionBinaryOpType {
36
36
  }
37
37
  /**
38
38
  * Class `RegionOps` has static members for calculations on regions (areas).
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
- * * **NOTE:** Most of the methods in this class ignore z-coordinates, so callers should ensure that input geometry has
45
- * 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.
46
47
  * @public
47
48
  */
48
49
  export declare class RegionOps {
@@ -65,7 +66,8 @@ export declare class RegionOps {
65
66
  /**
66
67
  * Return a (signed) xy area for a region.
67
68
  * * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
68
- * * The area is negative if and only if the region is oriented clockwise with respect to the positive z-axis.
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.
69
71
  * @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
70
72
  */
71
73
  static computeXYArea(region: AnyRegion): number | undefined;
@@ -136,16 +138,38 @@ export declare class RegionOps {
136
138
  * @param triangulate whether to triangulate the result
137
139
  */
138
140
  static polygonXYAreaDifferenceLoopsToPolyface(loopsA: MultiLineStringDataVariant, loopsB: MultiLineStringDataVariant, triangulate?: boolean): Polyface | undefined;
141
+ /**
142
+ * Return the region's simplest representation by stripping redundant parent(s).
143
+ * * No Boolean operations are performed.
144
+ * @param region input region (unchanged). Assumed to have at least one child.
145
+ * @returns
146
+ * * For a [[UnionRegion]] with exactly one child, return the child 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 child, return the `Loop`.
149
+ * * All other inputs returned unchanged.
150
+ * @see [[simplifyRegion]]
151
+ */
152
+ static simplifyRegionType(region: AnyRegion): AnyRegion;
153
+ /**
154
+ * Simplify the region's parent/child hierarchy in place:
155
+ * * Regions with exactly one child are simplified as per [[simplifyRegionType]].
156
+ * * Regions without children are removed.
157
+ * * No Boolean operations are performed.
158
+ * @param region region to simplify in place
159
+ * @returns reference to the updated input region
160
+ * @see [[simplifyRegionType]]
161
+ */
162
+ static simplifyRegion(region: AnyRegion): AnyRegion | undefined;
139
163
  /**
140
164
  * Return areas defined by a boolean operation.
141
- * * If there are multiple regions in loopsA, they are treated as a union.
142
- * * If there are multiple regions in loopsB, they are treated as a union.
143
- * @param loopsA first set of loops
144
- * @param loopsB second set of loops
165
+ * @note For best results, input regions should have correctly oriented loops. See [[sortOuterAndHoleLoopsXY]].
166
+ * @note A common use case of this method is to convert a region with overlapping children into one with
167
+ * non-overlapping children: `regionOut = RegionOps.regionBooleanXY(regionIn, undefined, RegionBinaryOpType.Union)`.
168
+ * @param loopsA first set of loops (treated as a union)
169
+ * @param loopsB second set of loops (treated as a union)
145
170
  * @param operation indicates Union, Intersection, Parity, AMinusB, or BMinusA
146
171
  * @param mergeTolerance absolute distance tolerance for merging loops
147
- * @returns a region resulting from merging input loops and the boolean operation. May contain bridge edges added
148
- * to connect interior loops to exterior loops.
172
+ * @returns a region resulting from merging input loops and the boolean operation.
149
173
  */
150
174
  static regionBooleanXY(loopsA: AnyRegion | AnyRegion[] | undefined, loopsB: AnyRegion | AnyRegion[] | undefined, operation: RegionBinaryOpType, mergeTolerance?: number): AnyRegion | undefined;
151
175
  /**
@@ -299,31 +323,40 @@ export declare class RegionOps {
299
323
  */
300
324
  static consolidateAdjacentPrimitives(curves: CurveCollection, options?: ConsolidateAdjacentCurvePrimitivesOptions): void;
301
325
  /**
302
- * Reverse and reorder loops in the xy-plane for consistency and containment.
303
- * @param loops multiple loops in any order and orientation, z-coordinates ignored
326
+ * Reverse and reorder loops in the xy-plane for consistent orientation and containment.
327
+ * @param loops multiple loops in any order and orientation, z-coordinates ignored.
328
+ * * For best results, all overlaps should be containments, i.e., loop boundaries can touch, but should not cross.
304
329
  * @returns a region that captures the input pointers. This region is a:
305
- * * `Loop` if there is exactly one input loop. It is oriented counterclockwise.
306
- * * `ParityRegion` if input consists of exactly one outer loop with at least one hole loop.
330
+ * * [[Loop]] if there is exactly one input loop. It is oriented counterclockwise.
331
+ * * [[ParityRegion]] if input consists of exactly one outer loop with at least one hole loop.
307
332
  * Its first child is an outer loop oriented counterclockwise; all subsequent children are holes oriented
308
333
  * clockwise.
309
- * * `UnionRegion` if any other input configuration. Its children are individually ordered/oriented as in
334
+ * * [[UnionRegion]] if any other input configuration. Its children are individually ordered/oriented as in
310
335
  * the above cases.
311
336
  * @see [[PolygonOps.sortOuterAndHoleLoopsXY]]
312
337
  */
313
338
  static sortOuterAndHoleLoopsXY(loops: Array<Loop | IndexedXYZCollection>): AnyRegion;
339
+ /**
340
+ * Collect inputs that are nominally closed: regions, and physically closed curves.
341
+ * * Physically closed input curves are each returned wrapped in a Loop to facilitate xy-algorithms,
342
+ * but outside this limited context, these Loops only makes sense if they are planar.
343
+ */
344
+ private static collectRegionsAndClosedPrimitives;
314
345
  /**
315
346
  * Find all xy-areas bounded by the unstructured, possibly intersecting curves.
316
347
  * * For best results, input curves should be parallel to the xy-plane, as z-coordinates are ignored.
317
- * * A common use case of this method is to assemble the bounding "exterior" loop (or loops) containing the
318
- * input curves.
319
- * * This method does not add bridge edges to connect outer loops to inner loops. Each disconnected loop,
320
- * regardless of its containment, is returned as its own SignedLoops object. Pre-process with [[regionBooleanXY]]
321
- * to add bridge edges so that [[constructAllXYRegionLoops]] will return outer and inner loops in the same
322
- * SignedLoops object.
323
- * @param curvesAndRegions Any collection of curves. Each Loop/ParityRegion/UnionRegion contributes its curve
324
- * primitives.
325
- * @param tolerance optional distance tolerance for coincidence
326
- * @returns array of [[SignedLoops]], each entry of which describes the faces in a single connected component:
348
+ * * "Holes" implied/bounded by inputs are _not_ preserved/discovered in output; in particular [[ParityRegion]]
349
+ * hole loops are treated like any other positive area loops.
350
+ * * A common use case of this method is to assemble the bounding negative-area "exterior" loop for each connected
351
+ * component of input curves. Passing `addBridges = true` decreases the number of connected components for nested
352
+ * input [[Loop]]s, and thus increases the likelihood of returning exactly one exterior loop. (This is why the
353
+ * default value for `addBridges` is `true`.)
354
+ * @param curvesAndRegions Any collection of curves. Each [[AnyRegion]] contributes its children _stripped of
355
+ * parity context_.
356
+ * @param tolerance optional distance tolerance for coincidence.
357
+ * @param addBridges whether to add line segments to connect nested input [[Loop]]s (default is `true`). When `false`,
358
+ * no line segments are added to the input curves, but the number of output components may be greater than expected.
359
+ * @returns array of [[SignedLoops]], each entry of which describes the areas bounded by a single connected component:
327
360
  * * `positiveAreaLoops` contains "interior" loops, _including holes in ParityRegion input_. These loops have
328
361
  * positive area and counterclockwise orientation.
329
362
  * * `negativeAreaLoops` contains (probably just one) "exterior" loop which is ordered clockwise.
@@ -331,7 +364,7 @@ export declare class RegionOps {
331
364
  * * `edges` contains a [[LoopCurveLoopCurve]] object for each component edge, collecting both loops adjacent
332
365
  * to the edge and a constituent curve in each.
333
366
  */
334
- static constructAllXYRegionLoops(curvesAndRegions: AnyCurve | AnyCurve[], tolerance?: number): SignedLoops[];
367
+ static constructAllXYRegionLoops(curvesAndRegions: AnyCurve | AnyCurve[], tolerance?: number, addBridges?: boolean): SignedLoops[];
335
368
  /**
336
369
  * Collect all `CurvePrimitives` in loosely typed input.
337
370
  * * Always recurses into primitives within explicit collections (Path, Loop, ParityRegion, UnionRegion).
@@ -374,12 +407,10 @@ export declare class RegionOps {
374
407
  private static triangulateRegionComponent;
375
408
  /**
376
409
  * Facet the region according to stroke options.
410
+ * @note For best results, [[UnionRegion]] input should consist of non-overlapping children. See [[regionBooleanXY]].
411
+ * @note For best results, [[ParityRegion]] input should be correctly oriented. See [[sortOuterAndHoleLoopsXY]].
377
412
  * @param region a closed xy-planar region, possibly with holes.
378
413
  * * 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.
379
- * * For best results, `UnionRegion` input should consist of non-overlapping children.
380
- * Caller can ensure this by passing in `region = RegionOps.regionBooleanXY(unionRegion, undefined, RegionBinaryOpType.Union)`.
381
- * * For best results, `ParityRegion` input should be correctly oriented (holes have opposite orientation to their containing loop).
382
- * Caller can ensure this for non-intersecting loops by passing in `region = RegionOps.sortOuterAndHoleLoopsXY(loops)`.
383
414
  * @param options primarily how to stroke the region boundary, but also how to facet the region interior.
384
415
  * * By default, a triangulation is returned, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.
385
416
  * @returns facets for the region, or undefined if facetting failed
@@ -394,17 +425,21 @@ export declare class RegionOps {
394
425
  static convexDecomposePolygonXY(polygon: MultiLineStringDataVariant, maximize?: boolean): GrowableXYZArray[] | undefined;
395
426
  }
396
427
  /**
397
- * * Options to control method `RegionOps.consolidateAdjacentPrimitives`
428
+ * * Options to control method `RegionOps.consolidateAdjacentPrimitives`.
398
429
  * @public
399
430
  */
400
431
  export declare class ConsolidateAdjacentCurvePrimitivesOptions {
401
- /** True to consolidate adjacent linear geometry into a single LineString3d */
432
+ /** True to consolidate adjacent linear geometry into a single LineString3d. */
402
433
  consolidateLinearGeometry: boolean;
403
- /** True to consolidate contiguous compatible arcs into a single Arc3d */
434
+ /** True to consolidate contiguous compatible arcs into a single Arc3d. */
404
435
  consolidateCompatibleArcs: boolean;
405
- /** Tolerance for collapsing identical points */
436
+ /** True to consolidate the first and last primitives of a [[Loop]], allowing the start/end point to change. */
437
+ consolidateLoopSeam?: boolean;
438
+ /** Disable LineSegment3d and LineString3d point compression. */
439
+ disableLinearCompression?: boolean;
440
+ /** Tolerance for detecting identical points. */
406
441
  duplicatePointTolerance: number;
407
- /** Tolerance for removing interior colinear points. */
442
+ /** Tolerance for removing interior colinear points (if `!disableLinearCompression`). */
408
443
  colinearPointTolerance: number;
409
444
  }
410
445
  //# sourceMappingURL=RegionOps.d.ts.map
@@ -1 +1 @@
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,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAI1E,OAAO,EAAe,UAAU,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAG7E,OAAO,EAAE,cAAc,EAAE,MA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Ac,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,+GAA+G;IACxG,mBAAmB,CAAC,EAAE,OAAO,CAAS;IAC7C,gEAAgE;IACzD,wBAAwB,CAAC,EAAE,OAAO,CAAS;IAClD,gDAAgD;IACzC,uBAAuB,EAAE,MAAM,CAAgC;IACtE,wFAAwF;IACjF,sBAAsB,EAAE,MAAM,CAAgC;CACtE"}
@@ -5,6 +5,7 @@
5
5
  /** @packageDocumentation
6
6
  * @module Curve
7
7
  */
8
+ import { assert } from "@itwin/core-bentley";
8
9
  import { Geometry } from "../Geometry";
9
10
  import { FrameBuilder } from "../geometry3d/FrameBuilder";
10
11
  import { GrowableXYZArray } from "../geometry3d/GrowableXYZArray";
@@ -31,6 +32,8 @@ import { CurveWireMomentsXYZ } from "./CurveWireMomentsXYZ";
31
32
  import { GeometryQuery } from "./GeometryQuery";
32
33
  import { ChainCollectorContext } from "./internalContexts/ChainCollectorContext";
33
34
  import { PolygonWireOffsetContext } from "./internalContexts/PolygonOffsetContext";
35
+ import { TransferWithSplitArcs } from "./internalContexts/TransferWithSplitArcs";
36
+ import { LineSegment3d } from "./LineSegment3d";
34
37
  import { LineString3d } from "./LineString3d";
35
38
  import { Loop } from "./Loop";
36
39
  import { OffsetOptions } from "./OffsetOptions";
@@ -57,13 +60,14 @@ export var RegionBinaryOpType;
57
60
  })(RegionBinaryOpType || (RegionBinaryOpType = {}));
58
61
  /**
59
62
  * Class `RegionOps` has static members for calculations on regions (areas).
60
- * * Regions are represented by these `CurveCollection` subclasses:
61
- * * `Loop` -- a single loop
62
- * * `ParityRegion` -- a collection of loops, interpreted by parity rules.
63
- * The common "One outer loop and many Inner loops" is a parity region.
64
- * * `UnionRegion` -- a collection of `Loop` and `ParityRegion` objects understood as a (probably disjoint) union.
65
- * * **NOTE:** Most of the methods in this class ignore z-coordinates, so callers should ensure that input geometry has
66
- * been rotated parallel to the xy-plane.
63
+ * * Regions are represented by these [[CurveCollection]] subclasses:
64
+ * * [[Loop]] -- a single loop
65
+ * * [[ParityRegion]] -- a collection of loops, interpreted by parity rules.
66
+ * The common "One outer loop and many inner loops" is a parity region.
67
+ * * [[UnionRegion]] -- a collection of `Loop` and `ParityRegion` objects understood as a (probably disjoint) union.
68
+ * * Most of the methods in this class:
69
+ * * Ignore z-coordinates, so callers should ensure that input geometry has been rotated parallel to the xy-plane.
70
+ * * Assume consistent Loop orientation: "solid" Loops are counterclockwise; "hole" Loops are clockwise.
67
71
  * @public
68
72
  */
69
73
  export class RegionOps {
@@ -98,7 +102,8 @@ export class RegionOps {
98
102
  /**
99
103
  * Return a (signed) xy area for a region.
100
104
  * * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
101
- * * The area is negative if and only if the region is oriented clockwise with respect to the positive z-axis.
105
+ * * For a non-self-intersecting Loop, the returned area is negative if and only if the Loop is oriented clockwise
106
+ * with respect to the positive z-axis.
102
107
  * @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
103
108
  */
104
109
  static computeXYArea(region) {
@@ -278,26 +283,79 @@ export class RegionOps {
278
283
  const graph = RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && !inB), this._graphCheckPointFunction);
279
284
  return this.finishGraphToPolyface(graph, triangulate);
280
285
  }
286
+ /**
287
+ * Return the region's simplest representation by stripping redundant parent(s).
288
+ * * No Boolean operations are performed.
289
+ * @param region input region (unchanged). Assumed to have at least one child.
290
+ * @returns
291
+ * * For a [[UnionRegion]] with exactly one child, return the child if it is a [[Loop]],
292
+ * or if it is a [[ParityRegion]] with multiple children; otherwise return the `ParityRegion`'s `Loop`.
293
+ * * For a `ParityRegion` with exactly one child, return the `Loop`.
294
+ * * All other inputs returned unchanged.
295
+ * @see [[simplifyRegion]]
296
+ */
297
+ static simplifyRegionType(region) {
298
+ if (region instanceof UnionRegion) {
299
+ if (region.children.length === 1)
300
+ return this.simplifyRegionType(region.children[0]);
301
+ }
302
+ else if (region instanceof ParityRegion) {
303
+ if (region.children.length === 1)
304
+ return region.children[0];
305
+ }
306
+ return region;
307
+ }
308
+ /**
309
+ * Simplify the region's parent/child hierarchy in place:
310
+ * * Regions with exactly one child are simplified as per [[simplifyRegionType]].
311
+ * * Regions without children are removed.
312
+ * * No Boolean operations are performed.
313
+ * @param region region to simplify in place
314
+ * @returns reference to the updated input region
315
+ * @see [[simplifyRegionType]]
316
+ */
317
+ static simplifyRegion(region) {
318
+ if (region instanceof Loop)
319
+ return region.children.length > 0 ? region : undefined;
320
+ // remove childless Parity/UnionRegion
321
+ for (let i = 0; i < region.children.length; ++i) {
322
+ const child = region.children[i];
323
+ const newChild = this.simplifyRegion(child);
324
+ if (!newChild) {
325
+ region.children.splice(i--, 1);
326
+ }
327
+ else if (newChild !== child) {
328
+ assert(!(newChild instanceof UnionRegion));
329
+ region.children.splice(i--, 1, newChild);
330
+ }
331
+ }
332
+ if (region.children.length === 0)
333
+ return undefined;
334
+ // remove redundant Parity/UnionRegion parent
335
+ if (region.children.length === 1)
336
+ return region.children.splice(0, 1)[0];
337
+ return region;
338
+ }
281
339
  /**
282
340
  * Return areas defined by a boolean operation.
283
- * * If there are multiple regions in loopsA, they are treated as a union.
284
- * * If there are multiple regions in loopsB, they are treated as a union.
285
- * @param loopsA first set of loops
286
- * @param loopsB second set of loops
341
+ * @note For best results, input regions should have correctly oriented loops. See [[sortOuterAndHoleLoopsXY]].
342
+ * @note A common use case of this method is to convert a region with overlapping children into one with
343
+ * non-overlapping children: `regionOut = RegionOps.regionBooleanXY(regionIn, undefined, RegionBinaryOpType.Union)`.
344
+ * @param loopsA first set of loops (treated as a union)
345
+ * @param loopsB second set of loops (treated as a union)
287
346
  * @param operation indicates Union, Intersection, Parity, AMinusB, or BMinusA
288
347
  * @param mergeTolerance absolute distance tolerance for merging loops
289
- * @returns a region resulting from merging input loops and the boolean operation. May contain bridge edges added
290
- * to connect interior loops to exterior loops.
348
+ * @returns a region resulting from merging input loops and the boolean operation.
291
349
  */
292
350
  static regionBooleanXY(loopsA, loopsB, operation, mergeTolerance = Geometry.smallMetricDistance) {
293
- // Always return UnionRegion for now. But keep return type as AnyRegion:
294
- // in the future, we might return the *simplest* region type.
295
351
  const result = UnionRegion.create();
296
352
  const context = RegionBooleanContext.create(RegionGroupOpType.Union, RegionGroupOpType.Union);
297
353
  context.addMembers(loopsA, loopsB);
298
354
  context.annotateAndMergeCurvesInGraph(mergeTolerance);
355
+ const visitMask = context.graph.grabMask(false);
299
356
  const range = context.groupA.range().union(context.groupB.range());
300
357
  const areaTol = this.computeXYAreaTolerance(range, mergeTolerance);
358
+ const bridgeMask = HalfEdgeMask.BRIDGE_EDGE;
301
359
  context.runClassificationSweep(operation, (_graph, face, faceType, area) => {
302
360
  // ignore danglers and null faces, but not 2-edge "banana" faces with nonzero area
303
361
  if (face.countEdgesAroundFace() < 2)
@@ -305,12 +363,13 @@ export class RegionOps {
305
363
  if (Math.abs(area) < areaTol)
306
364
  return;
307
365
  if (faceType === 1) {
308
- const loop = PlanarSubdivision.createLoopInFace(face);
309
- if (loop)
310
- result.tryAddChild(loop);
366
+ const loopOrParityRegion = PlanarSubdivision.createLoopOrParityRegionInFace(face, bridgeMask, visitMask);
367
+ if (loopOrParityRegion)
368
+ result.tryAddChild(loopOrParityRegion);
311
369
  }
312
370
  });
313
- return result;
371
+ context.graph.dropMask(visitMask);
372
+ return this.simplifyRegion(result);
314
373
  }
315
374
  /**
316
375
  * Return a polyface whose facets are a boolean operation between the input regions.
@@ -601,14 +660,15 @@ export class RegionOps {
601
660
  curves.dispatchToGeometryHandler(context);
602
661
  }
603
662
  /**
604
- * Reverse and reorder loops in the xy-plane for consistency and containment.
605
- * @param loops multiple loops in any order and orientation, z-coordinates ignored
663
+ * Reverse and reorder loops in the xy-plane for consistent orientation and containment.
664
+ * @param loops multiple loops in any order and orientation, z-coordinates ignored.
665
+ * * For best results, all overlaps should be containments, i.e., loop boundaries can touch, but should not cross.
606
666
  * @returns a region that captures the input pointers. This region is a:
607
- * * `Loop` if there is exactly one input loop. It is oriented counterclockwise.
608
- * * `ParityRegion` if input consists of exactly one outer loop with at least one hole loop.
667
+ * * [[Loop]] if there is exactly one input loop. It is oriented counterclockwise.
668
+ * * [[ParityRegion]] if input consists of exactly one outer loop with at least one hole loop.
609
669
  * Its first child is an outer loop oriented counterclockwise; all subsequent children are holes oriented
610
670
  * clockwise.
611
- * * `UnionRegion` if any other input configuration. Its children are individually ordered/oriented as in
671
+ * * [[UnionRegion]] if any other input configuration. Its children are individually ordered/oriented as in
612
672
  * the above cases.
613
673
  * @see [[PolygonOps.sortOuterAndHoleLoopsXY]]
614
674
  */
@@ -624,19 +684,45 @@ export class RegionOps {
624
684
  }
625
685
  return SortablePolygon.sortAsAnyRegion(loopAndArea);
626
686
  }
687
+ /**
688
+ * Collect inputs that are nominally closed: regions, and physically closed curves.
689
+ * * Physically closed input curves are each returned wrapped in a Loop to facilitate xy-algorithms,
690
+ * but outside this limited context, these Loops only makes sense if they are planar.
691
+ */
692
+ static collectRegionsAndClosedPrimitives(curves, tolerance = Geometry.smallMetricDistance) {
693
+ const regions = [];
694
+ if (!Array.isArray(curves))
695
+ curves = [curves];
696
+ for (const curve of curves) {
697
+ if (curve instanceof Loop || curve instanceof ParityRegion || curve instanceof UnionRegion) {
698
+ regions.push(curve);
699
+ }
700
+ else if (curve instanceof Path) {
701
+ if (curve.isPhysicallyClosedCurve(tolerance))
702
+ regions.push(Loop.create(...curve.children));
703
+ }
704
+ else if (curve instanceof CurvePrimitive) {
705
+ if (curve.isPhysicallyClosedCurve(tolerance))
706
+ regions.push(Loop.create(curve));
707
+ }
708
+ }
709
+ return regions;
710
+ }
627
711
  /**
628
712
  * Find all xy-areas bounded by the unstructured, possibly intersecting curves.
629
713
  * * For best results, input curves should be parallel to the xy-plane, as z-coordinates are ignored.
630
- * * A common use case of this method is to assemble the bounding "exterior" loop (or loops) containing the
631
- * input curves.
632
- * * This method does not add bridge edges to connect outer loops to inner loops. Each disconnected loop,
633
- * regardless of its containment, is returned as its own SignedLoops object. Pre-process with [[regionBooleanXY]]
634
- * to add bridge edges so that [[constructAllXYRegionLoops]] will return outer and inner loops in the same
635
- * SignedLoops object.
636
- * @param curvesAndRegions Any collection of curves. Each Loop/ParityRegion/UnionRegion contributes its curve
637
- * primitives.
638
- * @param tolerance optional distance tolerance for coincidence
639
- * @returns array of [[SignedLoops]], each entry of which describes the faces in a single connected component:
714
+ * * "Holes" implied/bounded by inputs are _not_ preserved/discovered in output; in particular [[ParityRegion]]
715
+ * hole loops are treated like any other positive area loops.
716
+ * * A common use case of this method is to assemble the bounding negative-area "exterior" loop for each connected
717
+ * component of input curves. Passing `addBridges = true` decreases the number of connected components for nested
718
+ * input [[Loop]]s, and thus increases the likelihood of returning exactly one exterior loop. (This is why the
719
+ * default value for `addBridges` is `true`.)
720
+ * @param curvesAndRegions Any collection of curves. Each [[AnyRegion]] contributes its children _stripped of
721
+ * parity context_.
722
+ * @param tolerance optional distance tolerance for coincidence.
723
+ * @param addBridges whether to add line segments to connect nested input [[Loop]]s (default is `true`). When `false`,
724
+ * no line segments are added to the input curves, but the number of output components may be greater than expected.
725
+ * @returns array of [[SignedLoops]], each entry of which describes the areas bounded by a single connected component:
640
726
  * * `positiveAreaLoops` contains "interior" loops, _including holes in ParityRegion input_. These loops have
641
727
  * positive area and counterclockwise orientation.
642
728
  * * `negativeAreaLoops` contains (probably just one) "exterior" loop which is ordered clockwise.
@@ -644,10 +730,22 @@ export class RegionOps {
644
730
  * * `edges` contains a [[LoopCurveLoopCurve]] object for each component edge, collecting both loops adjacent
645
731
  * to the edge and a constituent curve in each.
646
732
  */
647
- static constructAllXYRegionLoops(curvesAndRegions, tolerance = Geometry.smallMetricDistance) {
648
- const primitives = RegionOps.collectCurvePrimitives(curvesAndRegions, undefined, true, true);
733
+ static constructAllXYRegionLoops(curvesAndRegions, tolerance = Geometry.smallMetricDistance, addBridges = true) {
734
+ let primitives = RegionOps.collectCurvePrimitives(curvesAndRegions, undefined, true, true);
735
+ primitives = TransferWithSplitArcs.clone(BagOfCurves.create(...primitives)).children;
649
736
  const range = this.curveArrayRange(primitives);
650
737
  const areaTol = this.computeXYAreaTolerance(range, tolerance);
738
+ if (addBridges) { // generate a temp graph to extract its bridge edges
739
+ const context = RegionBooleanContext.create(RegionGroupOpType.Union, RegionGroupOpType.Union);
740
+ const regions = this.collectRegionsAndClosedPrimitives(curvesAndRegions, tolerance);
741
+ context.addMembers(regions, undefined);
742
+ context.annotateAndMergeCurvesInGraph(tolerance);
743
+ context.graph.announceEdges((_graph, edge) => {
744
+ if (edge.isMaskSet(HalfEdgeMask.BRIDGE_EDGE))
745
+ primitives.push(LineSegment3d.create(edge.getPoint3d(), edge.faceSuccessor.getPoint3d()));
746
+ return true;
747
+ });
748
+ }
651
749
  const intersections = CurveCurve.allIntersectionsAmongPrimitivesXY(primitives, tolerance);
652
750
  const graph = PlanarSubdivision.assembleHalfEdgeGraph(primitives, intersections, tolerance);
653
751
  return PlanarSubdivision.collectSignedLoopSetsInHalfEdgeGraph(graph, areaTol);
@@ -798,12 +896,10 @@ export class RegionOps {
798
896
  }
799
897
  /**
800
898
  * Facet the region according to stroke options.
899
+ * @note For best results, [[UnionRegion]] input should consist of non-overlapping children. See [[regionBooleanXY]].
900
+ * @note For best results, [[ParityRegion]] input should be correctly oriented. See [[sortOuterAndHoleLoopsXY]].
801
901
  * @param region a closed xy-planar region, possibly with holes.
802
902
  * * 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.
803
- * * For best results, `UnionRegion` input should consist of non-overlapping children.
804
- * Caller can ensure this by passing in `region = RegionOps.regionBooleanXY(unionRegion, undefined, RegionBinaryOpType.Union)`.
805
- * * For best results, `ParityRegion` input should be correctly oriented (holes have opposite orientation to their containing loop).
806
- * Caller can ensure this for non-intersecting loops by passing in `region = RegionOps.sortOuterAndHoleLoopsXY(loops)`.
807
903
  * @param options primarily how to stroke the region boundary, but also how to facet the region interior.
808
904
  * * By default, a triangulation is returned, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.
809
905
  * @returns facets for the region, or undefined if facetting failed
@@ -866,17 +962,21 @@ function pushToInOnOutArrays(curve, select, arrayNegative, array0, arrayPositive
866
962
  array0.push(curve);
867
963
  }
868
964
  /**
869
- * * Options to control method `RegionOps.consolidateAdjacentPrimitives`
965
+ * * Options to control method `RegionOps.consolidateAdjacentPrimitives`.
870
966
  * @public
871
967
  */
872
968
  export class ConsolidateAdjacentCurvePrimitivesOptions {
873
- /** True to consolidate adjacent linear geometry into a single LineString3d */
969
+ /** True to consolidate adjacent linear geometry into a single LineString3d. */
874
970
  consolidateLinearGeometry = true;
875
- /** True to consolidate contiguous compatible arcs into a single Arc3d */
971
+ /** True to consolidate contiguous compatible arcs into a single Arc3d. */
876
972
  consolidateCompatibleArcs = true;
877
- /** Tolerance for collapsing identical points */
973
+ /** True to consolidate the first and last primitives of a [[Loop]], allowing the start/end point to change. */
974
+ consolidateLoopSeam = false;
975
+ /** Disable LineSegment3d and LineString3d point compression. */
976
+ disableLinearCompression = false;
977
+ /** Tolerance for detecting identical points. */
878
978
  duplicatePointTolerance = Geometry.smallMetricDistance;
879
- /** Tolerance for removing interior colinear points. */
979
+ /** Tolerance for removing interior colinear points (if `!disableLinearCompression`). */
880
980
  colinearPointTolerance = Geometry.smallMetricDistance;
881
981
  }
882
982
  //# sourceMappingURL=RegionOps.js.map