@itwin/core-geometry 5.0.0-dev.113 → 5.0.0-dev.115

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 (320) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/bspline/BSplineSurface.d.ts +2 -1
  3. package/lib/cjs/bspline/BSplineSurface.d.ts.map +1 -1
  4. package/lib/cjs/bspline/BSplineSurface.js +2 -1
  5. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  6. package/lib/cjs/clipping/ClipPlane.d.ts +7 -5
  7. package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
  8. package/lib/cjs/clipping/ClipPlane.js +9 -5
  9. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  10. package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
  11. package/lib/cjs/clipping/ClipUtils.js +5 -3
  12. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  13. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  14. package/lib/cjs/clipping/ConvexClipPlaneSet.js +12 -23
  15. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  16. package/lib/cjs/core-geometry.d.ts +1 -0
  17. package/lib/cjs/core-geometry.d.ts.map +1 -1
  18. package/lib/cjs/core-geometry.js +1 -0
  19. package/lib/cjs/core-geometry.js.map +1 -1
  20. package/lib/cjs/curve/Arc3d.d.ts +53 -31
  21. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  22. package/lib/cjs/curve/Arc3d.js +55 -36
  23. package/lib/cjs/curve/Arc3d.js.map +1 -1
  24. package/lib/cjs/curve/CurveCollection.d.ts +2 -0
  25. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  26. package/lib/cjs/curve/CurveCollection.js +14 -0
  27. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  28. package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
  29. package/lib/cjs/curve/LineSegment3d.js +1 -0
  30. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  31. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
  32. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +10 -5
  33. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  34. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  35. package/lib/cjs/curve/Query/PlanarSubdivision.js +7 -2
  36. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  37. package/lib/cjs/curve/RegionMomentsXY.d.ts +15 -21
  38. package/lib/cjs/curve/RegionMomentsXY.d.ts.map +1 -1
  39. package/lib/cjs/curve/RegionMomentsXY.js +38 -58
  40. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  41. package/lib/cjs/curve/RegionOps.d.ts +70 -38
  42. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  43. package/lib/cjs/curve/RegionOps.js +115 -45
  44. package/lib/cjs/curve/RegionOps.js.map +1 -1
  45. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +12 -13
  46. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  47. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +23 -23
  48. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  49. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  50. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +36 -12
  51. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  52. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.d.ts +14 -0
  53. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.d.ts.map +1 -0
  54. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js +34 -0
  55. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -0
  56. package/lib/cjs/geometry3d/AngleSweep.d.ts +24 -17
  57. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  58. package/lib/cjs/geometry3d/AngleSweep.js +31 -17
  59. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  60. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +7 -2
  61. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  62. package/lib/cjs/geometry3d/GrowableXYZArray.js +20 -2
  63. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  64. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +2 -1
  65. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  66. package/lib/cjs/geometry3d/IndexedXYZCollection.js +7 -3
  67. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  68. package/lib/cjs/geometry3d/Plane3d.d.ts +2 -0
  69. package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -1
  70. package/lib/cjs/geometry3d/Plane3d.js +6 -1
  71. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  72. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +2 -0
  73. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
  74. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +6 -1
  75. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  76. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts +8 -2
  77. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  78. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +18 -10
  79. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  80. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +4 -4
  81. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  82. package/lib/cjs/geometry3d/Point3dVector3d.js +6 -6
  83. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  84. package/lib/cjs/geometry3d/PointHelpers.d.ts +7 -7
  85. package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
  86. package/lib/cjs/geometry3d/PointHelpers.js +66 -26
  87. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  88. package/lib/cjs/geometry3d/PolygonOps.d.ts +57 -9
  89. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  90. package/lib/cjs/geometry3d/PolygonOps.js +57 -17
  91. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  92. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts +13 -6
  93. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
  94. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +16 -9
  95. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  96. package/lib/cjs/geometry3d/PolylineOps.d.ts +5 -4
  97. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  98. package/lib/cjs/geometry3d/PolylineOps.js +5 -4
  99. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  100. package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
  101. package/lib/cjs/geometry3d/Ray3d.js +11 -23
  102. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  103. package/lib/cjs/geometry3d/Transform.d.ts +21 -2
  104. package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
  105. package/lib/cjs/geometry3d/Transform.js +32 -13
  106. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  107. package/lib/cjs/geometry4d/Matrix4d.d.ts +7 -7
  108. package/lib/cjs/geometry4d/Matrix4d.d.ts.map +1 -1
  109. package/lib/cjs/geometry4d/Matrix4d.js +9 -9
  110. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  111. package/lib/cjs/geometry4d/MomentData.d.ts +32 -34
  112. package/lib/cjs/geometry4d/MomentData.d.ts.map +1 -1
  113. package/lib/cjs/geometry4d/MomentData.js +56 -57
  114. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  115. package/lib/cjs/geometry4d/Point4d.d.ts +7 -4
  116. package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
  117. package/lib/cjs/geometry4d/Point4d.js +26 -15
  118. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  119. package/lib/cjs/polyface/FacetOrientation.d.ts +1 -1
  120. package/lib/cjs/polyface/FacetOrientation.js +1 -1
  121. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  122. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +55 -40
  123. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  124. package/lib/cjs/polyface/IndexedEdgeMatcher.js +83 -75
  125. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  126. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +15 -14
  127. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  128. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +47 -38
  129. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  130. package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts +26 -19
  131. package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
  132. package/lib/cjs/polyface/IndexedPolyfaceWalker.js +47 -32
  133. package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
  134. package/lib/cjs/polyface/Polyface.d.ts +17 -3
  135. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  136. package/lib/cjs/polyface/Polyface.js +16 -0
  137. package/lib/cjs/polyface/Polyface.js.map +1 -1
  138. package/lib/cjs/polyface/PolyfaceBuilder.js +2 -2
  139. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  140. package/lib/cjs/polyface/PolyfaceClip.d.ts +19 -18
  141. package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
  142. package/lib/cjs/polyface/PolyfaceClip.js +39 -42
  143. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  144. package/lib/cjs/polyface/PolyfaceQuery.d.ts +116 -75
  145. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  146. package/lib/cjs/polyface/PolyfaceQuery.js +312 -228
  147. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  148. package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +3 -3
  149. package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
  150. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +3 -3
  151. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  152. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts +7 -6
  153. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  154. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +8 -9
  155. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  156. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  157. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  158. package/lib/cjs/topology/ChainMerge.d.ts +1 -1
  159. package/lib/cjs/topology/ChainMerge.js +1 -1
  160. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  161. package/lib/esm/bspline/BSplineSurface.d.ts +2 -1
  162. package/lib/esm/bspline/BSplineSurface.d.ts.map +1 -1
  163. package/lib/esm/bspline/BSplineSurface.js +2 -1
  164. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  165. package/lib/esm/clipping/ClipPlane.d.ts +7 -5
  166. package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
  167. package/lib/esm/clipping/ClipPlane.js +9 -5
  168. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  169. package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
  170. package/lib/esm/clipping/ClipUtils.js +5 -3
  171. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  172. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  173. package/lib/esm/clipping/ConvexClipPlaneSet.js +12 -23
  174. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  175. package/lib/esm/core-geometry.d.ts +1 -0
  176. package/lib/esm/core-geometry.d.ts.map +1 -1
  177. package/lib/esm/core-geometry.js +1 -0
  178. package/lib/esm/core-geometry.js.map +1 -1
  179. package/lib/esm/curve/Arc3d.d.ts +53 -31
  180. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  181. package/lib/esm/curve/Arc3d.js +55 -36
  182. package/lib/esm/curve/Arc3d.js.map +1 -1
  183. package/lib/esm/curve/CurveCollection.d.ts +2 -0
  184. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  185. package/lib/esm/curve/CurveCollection.js +14 -0
  186. package/lib/esm/curve/CurveCollection.js.map +1 -1
  187. package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
  188. package/lib/esm/curve/LineSegment3d.js +1 -0
  189. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  190. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
  191. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +10 -5
  192. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  193. package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  194. package/lib/esm/curve/Query/PlanarSubdivision.js +7 -2
  195. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  196. package/lib/esm/curve/RegionMomentsXY.d.ts +15 -21
  197. package/lib/esm/curve/RegionMomentsXY.d.ts.map +1 -1
  198. package/lib/esm/curve/RegionMomentsXY.js +38 -58
  199. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  200. package/lib/esm/curve/RegionOps.d.ts +70 -38
  201. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  202. package/lib/esm/curve/RegionOps.js +116 -46
  203. package/lib/esm/curve/RegionOps.js.map +1 -1
  204. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +12 -13
  205. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  206. package/lib/esm/curve/RegionOpsClassificationSweeps.js +23 -23
  207. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  208. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  209. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +36 -12
  210. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  211. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.d.ts +14 -0
  212. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.d.ts.map +1 -0
  213. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js +30 -0
  214. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -0
  215. package/lib/esm/geometry3d/AngleSweep.d.ts +24 -17
  216. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  217. package/lib/esm/geometry3d/AngleSweep.js +31 -17
  218. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  219. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +7 -2
  220. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  221. package/lib/esm/geometry3d/GrowableXYZArray.js +20 -2
  222. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  223. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +2 -1
  224. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  225. package/lib/esm/geometry3d/IndexedXYZCollection.js +7 -3
  226. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  227. package/lib/esm/geometry3d/Plane3d.d.ts +2 -0
  228. package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -1
  229. package/lib/esm/geometry3d/Plane3d.js +6 -1
  230. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  231. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +2 -0
  232. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
  233. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +6 -1
  234. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  235. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts +8 -2
  236. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  237. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +18 -10
  238. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  239. package/lib/esm/geometry3d/Point3dVector3d.d.ts +4 -4
  240. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  241. package/lib/esm/geometry3d/Point3dVector3d.js +6 -6
  242. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  243. package/lib/esm/geometry3d/PointHelpers.d.ts +7 -7
  244. package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
  245. package/lib/esm/geometry3d/PointHelpers.js +66 -26
  246. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  247. package/lib/esm/geometry3d/PolygonOps.d.ts +57 -9
  248. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  249. package/lib/esm/geometry3d/PolygonOps.js +57 -17
  250. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  251. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts +13 -6
  252. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
  253. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +16 -9
  254. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  255. package/lib/esm/geometry3d/PolylineOps.d.ts +5 -4
  256. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  257. package/lib/esm/geometry3d/PolylineOps.js +5 -4
  258. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  259. package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
  260. package/lib/esm/geometry3d/Ray3d.js +11 -23
  261. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  262. package/lib/esm/geometry3d/Transform.d.ts +21 -2
  263. package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
  264. package/lib/esm/geometry3d/Transform.js +32 -13
  265. package/lib/esm/geometry3d/Transform.js.map +1 -1
  266. package/lib/esm/geometry4d/Matrix4d.d.ts +7 -7
  267. package/lib/esm/geometry4d/Matrix4d.d.ts.map +1 -1
  268. package/lib/esm/geometry4d/Matrix4d.js +9 -9
  269. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  270. package/lib/esm/geometry4d/MomentData.d.ts +32 -34
  271. package/lib/esm/geometry4d/MomentData.d.ts.map +1 -1
  272. package/lib/esm/geometry4d/MomentData.js +56 -57
  273. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  274. package/lib/esm/geometry4d/Point4d.d.ts +7 -4
  275. package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
  276. package/lib/esm/geometry4d/Point4d.js +26 -15
  277. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  278. package/lib/esm/polyface/FacetOrientation.d.ts +1 -1
  279. package/lib/esm/polyface/FacetOrientation.js +1 -1
  280. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  281. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +55 -40
  282. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  283. package/lib/esm/polyface/IndexedEdgeMatcher.js +83 -75
  284. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  285. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +15 -14
  286. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  287. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +47 -38
  288. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  289. package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts +26 -19
  290. package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
  291. package/lib/esm/polyface/IndexedPolyfaceWalker.js +47 -32
  292. package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
  293. package/lib/esm/polyface/Polyface.d.ts +17 -3
  294. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  295. package/lib/esm/polyface/Polyface.js +16 -0
  296. package/lib/esm/polyface/Polyface.js.map +1 -1
  297. package/lib/esm/polyface/PolyfaceBuilder.js +2 -2
  298. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  299. package/lib/esm/polyface/PolyfaceClip.d.ts +19 -18
  300. package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
  301. package/lib/esm/polyface/PolyfaceClip.js +39 -42
  302. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  303. package/lib/esm/polyface/PolyfaceQuery.d.ts +116 -75
  304. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  305. package/lib/esm/polyface/PolyfaceQuery.js +313 -229
  306. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  307. package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +3 -3
  308. package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
  309. package/lib/esm/polyface/RangeTree/RangeTreeNode.js +3 -3
  310. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  311. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts +7 -6
  312. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  313. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +8 -9
  314. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  315. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  316. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  317. package/lib/esm/topology/ChainMerge.d.ts +1 -1
  318. package/lib/esm/topology/ChainMerge.js +1 -1
  319. package/lib/esm/topology/ChainMerge.js.map +1 -1
  320. 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,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAY,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAe,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;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,CAA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,MAAM,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,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAY,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAe,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;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;QA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AG,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 /**\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"]}
@@ -21,41 +21,35 @@ export declare class RegionMomentsXY extends NullGeometryHandler {
21
21
  private _activeMomentData?;
22
22
  private _point0;
23
23
  private _point1;
24
- /** Accumulate (independent) integrations over
25
- * * origin to chord of the arc.
26
- * * origin to the "cap" between the chord and arc.
24
+ /**
25
+ * Accumulate (independent) integrations over:
26
+ * * The area between the arc and the chord connecting its endpoints.
27
+ * * The triangle with vertices: origin, arc start, arc end.
27
28
  */
28
29
  handleArc3d(arc: Arc3d): void;
29
- /** Accumulate integrals over the (triangular) areas from the origin to each line segment */
30
+ /** Accumulate integrals over the (triangular) areas from the origin to each line segment. */
30
31
  handleLineString3d(ls: LineString3d): void;
31
- /** Accumulate integrals over the (triangular) area from the origin to this line segment */
32
+ /** Accumulate integrals over the (triangular) area from the origin to this line segment. */
32
33
  handleLineSegment3d(segment: LineSegment3d): void;
33
34
  /** Accumulate integrals from origin to all primitives in the chain. */
34
35
  handleLoop(loop: Loop): MomentData | undefined;
35
- /**
36
- * ASSUMPTIONS FOR ORIENTATION AND CONTAINMENT ISSUES
37
- * * Largest area is outer
38
- * * All others are interior (and not overlapping)
39
- * Hence
40
- * * Outer area sign must be positive -- negate all integrations as needed
41
- * * Outer area signs must be positive -- negate all integrations as needed
42
- * @param region
43
- */
36
+ private handleAnyRegion;
37
+ /** Accumulate integrals from origin to the components of the parity region. */
44
38
  handleParityRegion(region: ParityRegion): MomentData | undefined;
45
- /** Accumulate (as simple addition) products over each component of the union region. */
39
+ /** Accumulate integrals from origin to the components of the union region. */
46
40
  handleUnionRegion(region: UnionRegion): MomentData | undefined;
47
41
  private _strokeOptions?;
48
42
  private getStrokeOptions;
49
- /** Single curve primitive (not loop . . .).
50
- * * stroke the curve
51
- * * accumulate stroke array.
43
+ /**
44
+ * Handle a single curve primitive (not loop).
45
+ * * Stroke the curve and accumulate stroke array.
52
46
  */
53
47
  handleCurvePrimitive(cp: CurvePrimitive): void;
54
- /** handle strongly typed BSplineCurve3d as generic curve primitive */
48
+ /** Handle strongly typed BSplineCurve3d as generic curve primitive. */
55
49
  handleBSplineCurve3d(g: BSplineCurve3d): void;
56
- /** handle strongly typed BSplineCurve3dH as generic curve primitive */
50
+ /** Handle strongly typed BSplineCurve3dH as generic curve primitive. */
57
51
  handleBSplineCurve3dH(g: BSplineCurve3dH): void;
58
- /** handle strongly typed TransitionSpiral as generic curve primitive */
52
+ /** Handle strongly typed TransitionSpiral as generic curve primitive. */
59
53
  handleTransitionSpiral(g: TransitionSpiral3d): void;
60
54
  }
61
55
  //# sourceMappingURL=RegionMomentsXY.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RegionMomentsXY.d.ts","sourceRoot":"","sources":["../../../src/curve/RegionMomentsXY.ts"],"names":[],"mappings":"AAKA;;GAEG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,mBAAmB;IACtD,OAAO,CAAC,iBAAiB,CAAC,CAAa;IACvC,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,OAAO,CA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Data } from "../geometry4d/MomentData";
9
9
  import { LineString3d } from "./LineString3d";
10
10
  import { Loop } from "./Loop";
11
+ import { RegionBinaryOpType, RegionOps } from "./RegionOps";
11
12
  import { StrokeOptions } from "./StrokeOptions";
12
13
  /**
13
14
  * Implementation class for computing XY area moments.
@@ -17,15 +18,15 @@ export class RegionMomentsXY extends NullGeometryHandler {
17
18
  _activeMomentData;
18
19
  _point0 = Point3d.create();
19
20
  _point1 = Point3d.create();
20
- /** Accumulate (independent) integrations over
21
- * * origin to chord of the arc.
22
- * * origin to the "cap" between the chord and arc.
21
+ /**
22
+ * Accumulate (independent) integrations over:
23
+ * * The area between the arc and the chord connecting its endpoints.
24
+ * * The triangle with vertices: origin, arc start, arc end.
23
25
  */
24
26
  handleArc3d(arc) {
25
27
  const momentData = this._activeMomentData;
26
28
  const sweepRadians = arc.sweep.sweepRadians;
27
29
  const alphaRadians = sweepRadians * 0.5;
28
- // from https://apps.dtic.mil/dtic/tr/fulltext/u2/274936.pdf page 71 for radius = 1
29
30
  let s = Math.sin(alphaRadians);
30
31
  let c = Math.cos(alphaRadians);
31
32
  let s1 = Math.sin(sweepRadians);
@@ -52,12 +53,12 @@ export class RegionMomentsXY extends NullGeometryHandler {
52
53
  const pointC = arc.fractionToPoint(1.0);
53
54
  momentData.accumulateTriangleMomentsXY(undefined, pointB, pointC);
54
55
  }
55
- /** Accumulate integrals over the (triangular) areas from the origin to each line segment */
56
+ /** Accumulate integrals over the (triangular) areas from the origin to each line segment. */
56
57
  handleLineString3d(ls) {
57
58
  const momentData = this._activeMomentData;
58
59
  momentData.accumulateTriangleToLineStringMomentsXY(undefined, ls.packedPoints);
59
60
  }
60
- /** Accumulate integrals over the (triangular) area from the origin to this line segment */
61
+ /** Accumulate integrals over the (triangular) area from the origin to this line segment. */
61
62
  handleLineSegment3d(segment) {
62
63
  const momentData = this._activeMomentData;
63
64
  segment.startPoint(this._point0);
@@ -73,50 +74,15 @@ export class RegionMomentsXY extends NullGeometryHandler {
73
74
  this._activeMomentData = undefined;
74
75
  return momentData;
75
76
  }
76
- /**
77
- * ASSUMPTIONS FOR ORIENTATION AND CONTAINMENT ISSUES
78
- * * Largest area is outer
79
- * * All others are interior (and not overlapping)
80
- * Hence
81
- * * Outer area sign must be positive -- negate all integrations as needed
82
- * * Outer area signs must be positive -- negate all integrations as needed
83
- * @param region
84
- */
85
- handleParityRegion(region) {
86
- const allChildMoments = [];
87
- let maxAbsArea = 0.0;
88
- let largestChildMoments;
89
- for (const child of region.children) {
90
- if (child instanceof Loop) {
91
- const childMoments = this.handleLoop(child);
92
- if (childMoments) {
93
- allChildMoments.push(childMoments);
94
- const q = Math.abs(childMoments.quantitySum);
95
- if (q > maxAbsArea) {
96
- maxAbsArea = q;
97
- largestChildMoments = childMoments;
98
- }
99
- }
100
- }
101
- }
102
- if (largestChildMoments) {
103
- const summedMoments = MomentData.create();
104
- const sign0 = largestChildMoments.signFactor(1.0);
105
- summedMoments.accumulateProducts(largestChildMoments, sign0);
106
- for (const childMoments of allChildMoments) {
107
- if (childMoments !== largestChildMoments) {
108
- const sign1 = childMoments.signFactor(-1.0);
109
- summedMoments.accumulateProducts(childMoments, sign1);
110
- }
111
- }
112
- return summedMoments;
113
- }
114
- return undefined;
115
- }
116
- /** Accumulate (as simple addition) products over each component of the union region. */
117
- handleUnionRegion(region) {
77
+ handleAnyRegion(region) {
78
+ // guarantee there is no overlapping children
79
+ const merged = RegionOps.regionBooleanXY(region, undefined, RegionBinaryOpType.Union);
80
+ if (!merged)
81
+ return undefined;
82
+ if (merged instanceof Loop)
83
+ return this.handleLoop(merged);
118
84
  const summedMoments = MomentData.create();
119
- for (const child of region.children) {
85
+ for (const child of merged.children) {
120
86
  const childMoments = child.dispatchToGeometryHandler(this);
121
87
  if (childMoments) {
122
88
  const sign0 = childMoments.signFactor(1.0);
@@ -125,6 +91,14 @@ export class RegionMomentsXY extends NullGeometryHandler {
125
91
  }
126
92
  return summedMoments;
127
93
  }
94
+ /** Accumulate integrals from origin to the components of the parity region. */
95
+ handleParityRegion(region) {
96
+ return this.handleAnyRegion(region);
97
+ }
98
+ /** Accumulate integrals from origin to the components of the union region. */
99
+ handleUnionRegion(region) {
100
+ return this.handleAnyRegion(region);
101
+ }
128
102
  _strokeOptions;
129
103
  getStrokeOptions() {
130
104
  if (this._strokeOptions)
@@ -135,9 +109,9 @@ export class RegionMomentsXY extends NullGeometryHandler {
135
109
  this._strokeOptions = options;
136
110
  return options;
137
111
  }
138
- /** Single curve primitive (not loop . . .).
139
- * * stroke the curve
140
- * * accumulate stroke array.
112
+ /**
113
+ * Handle a single curve primitive (not loop).
114
+ * * Stroke the curve and accumulate stroke array.
141
115
  */
142
116
  handleCurvePrimitive(cp) {
143
117
  const strokes = LineString3d.create();
@@ -145,11 +119,17 @@ export class RegionMomentsXY extends NullGeometryHandler {
145
119
  cp.emitStrokes(strokes, options);
146
120
  this.handleLineString3d(strokes);
147
121
  }
148
- /** handle strongly typed BSplineCurve3d as generic curve primitive */
149
- handleBSplineCurve3d(g) { return this.handleCurvePrimitive(g); }
150
- /** handle strongly typed BSplineCurve3dH as generic curve primitive */
151
- handleBSplineCurve3dH(g) { return this.handleCurvePrimitive(g); }
152
- /** handle strongly typed TransitionSpiral as generic curve primitive */
153
- handleTransitionSpiral(g) { return this.handleCurvePrimitive(g); }
122
+ /** Handle strongly typed BSplineCurve3d as generic curve primitive. */
123
+ handleBSplineCurve3d(g) {
124
+ this.handleCurvePrimitive(g);
125
+ }
126
+ /** Handle strongly typed BSplineCurve3dH as generic curve primitive. */
127
+ handleBSplineCurve3dH(g) {
128
+ this.handleCurvePrimitive(g);
129
+ }
130
+ /** Handle strongly typed TransitionSpiral as generic curve primitive. */
131
+ handleTransitionSpiral(g) {
132
+ this.handleCurvePrimitive(g);
133
+ }
154
134
  }
155
135
  //# sourceMappingURL=RegionMomentsXY.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RegionMomentsXY.js","sourceRoot":"","sources":["../../../src/curve/RegionMomentsXY.ts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AAC;gBAC3C,aAAa,CAAC,kBAAkB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;QACD,OAAO,aAAa,CAAC;IACvB,CAAC;IAEO,cAAc,CAAiB;IAC/B,gBAAgB;QACtB,IAAI,IAAI,CAAC,cAAc;YACrB,OAAO,IAAI,CAAC,cAAc,CAAC;QAC7B,MAAM,OAAO,GAAG,aAAa,CAAC,eAAe,EAAE,CAAC;QAChD,gEAAgE;QAChE,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,OAAO,OAAO,CAAC;IACjB,CAAC;IACD;;;OAGG;IACI,oBAAoB,CAAC,EAAkB;QAC5C,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;QACtC,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxC,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IACD,wEAAwE;IACxD,oBAAoB,CAAC,CAAiB,IAAI,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChG,yEAAyE;IACzD,qBAAqB,CAAC,CAAkB,IAAI,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClG,0EAA0E;IAC1D,sBAAsB,CAAC,CAAqB,IAAI,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAEvG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\n// import { Geometry, Angle, AngleSweep } from \"../Geometry\";\n\nimport { BSplineCurve3d } from \"../bspline/BSplineCurve\";\nimport { BSplineCurve3dH } from \"../bspline/BSplineCurve3dH\";\nimport { Angle } from \"../geometry3d/Angle\";\nimport { NullGeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\nimport { MomentData } from \"../geometry4d/MomentData\";\nimport { Arc3d } from \"./Arc3d\";\nimport { CurvePrimitive } from \"./CurvePrimitive\";\nimport { LineSegment3d } from \"./LineSegment3d\";\nimport { LineString3d } from \"./LineString3d\";\nimport { Loop } from \"./Loop\";\nimport { ParityRegion } from \"./ParityRegion\";\nimport { StrokeOptions } from \"./StrokeOptions\";\nimport { TransitionSpiral3d } from \"./spiral/TransitionSpiral3d\";\nimport { UnionRegion } from \"./UnionRegion\";\n\n/**\n * Implementation class for computing XY area moments.\n * @internal\n */\nexport class RegionMomentsXY extends NullGeometryHandler {\n private _activeMomentData?: MomentData;\n private _point0 = Point3d.create();\n private _point1 = Point3d.create();\n\n /** Accumulate (independent) integrations over\n * * origin to chord of the arc.\n * * origin to the \"cap\" between the chord and arc.\n */\n public override handleArc3d(arc: Arc3d): void {\n const momentData = this._activeMomentData!;\n const sweepRadians = arc.sweep.sweepRadians;\n const alphaRadians = sweepRadians * 0.5;\n // from https://apps.dtic.mil/dtic/tr/fulltext/u2/274936.pdf page 71 for radius = 1\n let s = Math.sin(alphaRadians);\n let c = Math.cos(alphaRadians);\n let s1 = Math.sin(sweepRadians);\n if (Angle.isFullCircleRadians(sweepRadians)) {\n s = 0.0;\n c = -1.0;\n s1 = 0.0;\n }\n const q = 2 * s * s * s * c / (alphaRadians - s * c);\n const s3 = s * s * s;\n const s6 = s3 * s3;\n const area = 0.5 * (sweepRadians - s1);\n const inertiaXX = 0.25 * area * (1.0 - q / 3.0);\n const inertiaYY1 = 0.25 * area * (1.0 + q);\n const inertiaYY = inertiaYY1 - 4.0 * s6 / (9.0 * area);\n const productXX = inertiaYY;\n const productYY = inertiaXX;\n const centerToCentroid = 4.0 * s * s * s / (3.0 * (sweepRadians - s1));\n const midRadians = arc.sweep.fractionToRadians(0.5);\n const centralPlane = arc.radiansToRotatedBasis(midRadians);\n const centroid = centralPlane.origin.plusScaled(centralPlane.vectorU, centerToCentroid);\n momentData.accumulateXYProductsInCentroidalFrame(productXX, 0.0, productYY, area, centroid, centralPlane.vectorU, centralPlane.vectorV);\n const pointB = arc.fractionToPoint(0.0);\n const pointC = arc.fractionToPoint(1.0);\n momentData.accumulateTriangleMomentsXY(undefined, pointB, pointC);\n }\n\n /** Accumulate integrals over the (triangular) areas from the origin to each line segment */\n public override handleLineString3d(ls: LineString3d): void {\n const momentData = this._activeMomentData!;\n momentData.accumulateTriangleToLineStringMomentsXY(undefined, ls.packedPoints);\n }\n /** Accumulate integrals over the (triangular) area from the origin to this line segment */\n public override handleLineSegment3d(segment: LineSegment3d): void {\n const momentData = this._activeMomentData!;\n segment.startPoint(this._point0);\n segment.endPoint(this._point1);\n momentData.accumulateTriangleMomentsXY(undefined, this._point0, this._point1);\n }\n /** Accumulate integrals from origin to all primitives in the chain. */\n public override handleLoop(loop: Loop): MomentData | undefined {\n const momentData = this._activeMomentData = MomentData.create();\n momentData.needOrigin = false;\n for (const child of loop.children)\n child.dispatchToGeometryHandler(this);\n this._activeMomentData = undefined;\n return momentData;\n }\n /**\n * ASSUMPTIONS FOR ORIENTATION AND CONTAINMENT ISSUES\n * * Largest area is outer\n * * All others are interior (and not overlapping)\n * Hence\n * * Outer area sign must be positive -- negate all integrations as needed\n * * Outer area signs must be positive -- negate all integrations as needed\n * @param region\n */\n public override handleParityRegion(region: ParityRegion): MomentData | undefined {\n const allChildMoments: MomentData[] = [];\n let maxAbsArea = 0.0;\n let largestChildMoments: MomentData | undefined;\n for (const child of region.children) {\n if (child instanceof Loop) {\n const childMoments = this.handleLoop(child);\n if (childMoments) {\n allChildMoments.push(childMoments);\n const q = Math.abs(childMoments.quantitySum);\n if (q > maxAbsArea) {\n maxAbsArea = q;\n largestChildMoments = childMoments;\n }\n\n }\n }\n }\n if (largestChildMoments) {\n const summedMoments = MomentData.create();\n const sign0 = largestChildMoments.signFactor(1.0);\n summedMoments.accumulateProducts(largestChildMoments, sign0);\n for (const childMoments of allChildMoments) {\n if (childMoments !== largestChildMoments) {\n const sign1 = childMoments.signFactor(-1.0);\n summedMoments.accumulateProducts(childMoments, sign1);\n }\n }\n return summedMoments;\n }\n return undefined;\n }\n /** Accumulate (as simple addition) products over each component of the union region. */\n public override handleUnionRegion(region: UnionRegion): MomentData | undefined {\n const summedMoments = MomentData.create();\n for (const child of region.children) {\n const childMoments = child.dispatchToGeometryHandler(this);\n if (childMoments) {\n const sign0 = childMoments.signFactor(1.0);\n summedMoments.accumulateProducts(childMoments, sign0);\n }\n }\n return summedMoments;\n }\n\n private _strokeOptions?: StrokeOptions;\n private getStrokeOptions(): StrokeOptions {\n if (this._strokeOptions)\n return this._strokeOptions;\n const options = StrokeOptions.createForCurves();\n // this is unusually fine for stroking, but appropriate for sum.\n options.angleTol = Angle.createDegrees(5.0);\n this._strokeOptions = options;\n return options;\n }\n /** Single curve primitive (not loop . . .).\n * * stroke the curve\n * * accumulate stroke array.\n */\n public handleCurvePrimitive(cp: CurvePrimitive) {\n const strokes = LineString3d.create();\n const options = this.getStrokeOptions();\n cp.emitStrokes(strokes, options);\n this.handleLineString3d(strokes);\n }\n /** handle strongly typed BSplineCurve3d as generic curve primitive */\n public override handleBSplineCurve3d(g: BSplineCurve3d) { return this.handleCurvePrimitive(g); }\n /** handle strongly typed BSplineCurve3dH as generic curve primitive */\n public override handleBSplineCurve3dH(g: BSplineCurve3dH) { return this.handleCurvePrimitive(g); }\n /** handle strongly typed TransitionSpiral as generic curve primitive */\n public override handleTransitionSpiral(g: TransitionSpiral3d) { return this.handleCurvePrimitive(g); }\n\n}\n"]}
1
+ {"version":3,"file":"RegionMomentsXY.js","sourceRoot":"","sources":["../../../src/curve/RegionMomentsXY.ts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BAAkB,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IACD,yEAAyE;IACzD,oBAAoB,CAAC,CAAiB;QACpD,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IACD,0EAA0E;IAC1D,qBAAqB,CAAC,CAAkB;QACtD,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IACD,0EAA0E;IAC1D,sBAAsB,CAAC,CAAqB;QAC1D,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\n// import { Geometry, Angle, AngleSweep } from \"../Geometry\";\n\nimport { BSplineCurve3d } from \"../bspline/BSplineCurve\";\nimport { BSplineCurve3dH } from \"../bspline/BSplineCurve3dH\";\nimport { Angle } from \"../geometry3d/Angle\";\nimport { NullGeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\nimport { MomentData } from \"../geometry4d/MomentData\";\nimport { Arc3d } from \"./Arc3d\";\nimport { CurvePrimitive } from \"./CurvePrimitive\";\nimport { AnyRegion } from \"./CurveTypes\";\nimport { LineSegment3d } from \"./LineSegment3d\";\nimport { LineString3d } from \"./LineString3d\";\nimport { Loop } from \"./Loop\";\nimport { ParityRegion } from \"./ParityRegion\";\nimport { RegionBinaryOpType, RegionOps } from \"./RegionOps\";\nimport { TransitionSpiral3d } from \"./spiral/TransitionSpiral3d\";\nimport { StrokeOptions } from \"./StrokeOptions\";\nimport { UnionRegion } from \"./UnionRegion\";\n\n/**\n * Implementation class for computing XY area moments.\n * @internal\n */\nexport class RegionMomentsXY extends NullGeometryHandler {\n private _activeMomentData?: MomentData;\n private _point0 = Point3d.create();\n private _point1 = Point3d.create();\n /**\n * Accumulate (independent) integrations over:\n * * The area between the arc and the chord connecting its endpoints.\n * * The triangle with vertices: origin, arc start, arc end.\n */\n public override handleArc3d(arc: Arc3d): void {\n const momentData = this._activeMomentData!;\n const sweepRadians = arc.sweep.sweepRadians;\n const alphaRadians = sweepRadians * 0.5;\n let s = Math.sin(alphaRadians);\n let c = Math.cos(alphaRadians);\n let s1 = Math.sin(sweepRadians);\n if (Angle.isFullCircleRadians(sweepRadians)) {\n s = 0.0;\n c = -1.0;\n s1 = 0.0;\n }\n const q = 2 * s * s * s * c / (alphaRadians - s * c);\n const s3 = s * s * s;\n const s6 = s3 * s3;\n const area = 0.5 * (sweepRadians - s1);\n const inertiaXX = 0.25 * area * (1.0 - q / 3.0);\n const inertiaYY1 = 0.25 * area * (1.0 + q);\n const inertiaYY = inertiaYY1 - 4.0 * s6 / (9.0 * area);\n const productXX = inertiaYY;\n const productYY = inertiaXX;\n const centerToCentroid = 4.0 * s * s * s / (3.0 * (sweepRadians - s1));\n const midRadians = arc.sweep.fractionToRadians(0.5);\n const centralPlane = arc.radiansToRotatedBasis(midRadians);\n const centroid = centralPlane.origin.plusScaled(centralPlane.vectorU, centerToCentroid);\n momentData.accumulateXYProductsInCentroidalFrame(\n productXX, 0.0, productYY, area, centroid, centralPlane.vectorU, centralPlane.vectorV,\n );\n const pointB = arc.fractionToPoint(0.0);\n const pointC = arc.fractionToPoint(1.0);\n momentData.accumulateTriangleMomentsXY(undefined, pointB, pointC);\n }\n /** Accumulate integrals over the (triangular) areas from the origin to each line segment. */\n public override handleLineString3d(ls: LineString3d): void {\n const momentData = this._activeMomentData!;\n momentData.accumulateTriangleToLineStringMomentsXY(undefined, ls.packedPoints);\n }\n /** Accumulate integrals over the (triangular) area from the origin to this line segment. */\n public override handleLineSegment3d(segment: LineSegment3d): void {\n const momentData = this._activeMomentData!;\n segment.startPoint(this._point0);\n segment.endPoint(this._point1);\n momentData.accumulateTriangleMomentsXY(undefined, this._point0, this._point1);\n }\n /** Accumulate integrals from origin to all primitives in the chain. */\n public override handleLoop(loop: Loop): MomentData | undefined {\n const momentData = this._activeMomentData = MomentData.create();\n momentData.needOrigin = false;\n for (const child of loop.children)\n child.dispatchToGeometryHandler(this);\n this._activeMomentData = undefined;\n return momentData;\n }\n private handleAnyRegion(region: AnyRegion): MomentData | undefined {\n // guarantee there is no overlapping children\n const merged = RegionOps.regionBooleanXY(region, undefined, RegionBinaryOpType.Union);\n if (!merged)\n return undefined;\n if (merged instanceof Loop)\n return this.handleLoop(merged);\n const summedMoments = MomentData.create();\n for (const child of merged.children) {\n const childMoments = child.dispatchToGeometryHandler(this);\n if (childMoments) {\n const sign0 = childMoments.signFactor(1.0);\n summedMoments.accumulateProducts(childMoments, sign0);\n }\n }\n return summedMoments;\n }\n /** Accumulate integrals from origin to the components of the parity region. */\n public override handleParityRegion(region: ParityRegion): MomentData | undefined {\n return this.handleAnyRegion(region);\n }\n /** Accumulate integrals from origin to the components of the union region. */\n public override handleUnionRegion(region: UnionRegion): MomentData | undefined {\n return this.handleAnyRegion(region);\n }\n private _strokeOptions?: StrokeOptions;\n private getStrokeOptions(): StrokeOptions {\n if (this._strokeOptions)\n return this._strokeOptions;\n const options = StrokeOptions.createForCurves();\n // this is unusually fine for stroking, but appropriate for sum.\n options.angleTol = Angle.createDegrees(5.0);\n this._strokeOptions = options;\n return options;\n }\n /**\n * Handle a single curve primitive (not loop).\n * * Stroke the curve and accumulate stroke array.\n */\n public handleCurvePrimitive(cp: CurvePrimitive): void {\n const strokes = LineString3d.create();\n const options = this.getStrokeOptions();\n cp.emitStrokes(strokes, options);\n this.handleLineString3d(strokes);\n }\n /** Handle strongly typed BSplineCurve3d as generic curve primitive. */\n public override handleBSplineCurve3d(g: BSplineCurve3d): void {\n this.handleCurvePrimitive(g);\n }\n /** Handle strongly typed BSplineCurve3dH as generic curve primitive. */\n public override handleBSplineCurve3dH(g: BSplineCurve3dH): void {\n this.handleCurvePrimitive(g);\n }\n /** Handle strongly typed TransitionSpiral as generic curve primitive. */\n public override handleTransitionSpiral(g: TransitionSpiral3d): void {\n this.handleCurvePrimitive(g);\n }\n}\n"]}
@@ -2,6 +2,7 @@ import { GrowableXYZArray } from "../geometry3d/GrowableXYZArray";
2
2
  import { IndexedXYZCollection, MultiLineStringDataVariant } from "../geometry3d/IndexedXYZCollection";
3
3
  import { Point3d } from "../geometry3d/Point3dVector3d";
4
4
  import { Range3d } from "../geometry3d/Range";
5
+ import { Ray3d } from "../geometry3d/Ray3d";
5
6
  import { Transform } from "../geometry3d/Transform";
6
7
  import { MomentData } from "../geometry4d/MomentData";
7
8
  import { IndexedPolyface, Polyface } from "../polyface/Polyface";
@@ -35,42 +36,59 @@ export declare enum RegionBinaryOpType {
35
36
  }
36
37
  /**
37
38
  * Class `RegionOps` has static members for calculations on regions (areas).
38
- * * Regions are represented by these `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
- * * **NOTE:** Most of the methods in this class ignore z-coordinates, so callers should ensure that input geometry has
44
- * been rotated parallel to the xy-plane.
39
+ * * Regions are represented by these [[CurveCollection]] subclasses:
40
+ * * [[Loop]] -- a single loop
41
+ * * [[ParityRegion]] -- a collection of loops, interpreted by parity rules.
42
+ * The common "One outer loop and many inner loops" is a parity region.
43
+ * * [[UnionRegion]] -- a collection of `Loop` and `ParityRegion` objects understood as a (probably disjoint) union.
44
+ * * Most of the methods in this class:
45
+ * * Ignore z-coordinates, so callers should ensure that input geometry has been rotated parallel to the xy-plane.
46
+ * * Assume consistent Loop orientation: "solid" Loops are counterclockwise; "hole" Loops are clockwise.
45
47
  * @public
46
48
  */
47
49
  export declare class RegionOps {
48
50
  /**
49
51
  * Return moment sums for a loop, parity region, or union region.
52
+ * * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
50
53
  * * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
51
- * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
52
- * @param root any Loop, ParityRegion, or UnionRegion.
54
+ * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes(rawMomentData.origin, rawMomentData.sums);`
55
+ * * `rawMomentData.origin` is the centroid of `region`.
56
+ * * `rawMomentData.sums.weight()` is the signed area of `region`.
57
+ * @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
53
58
  */
54
- static computeXYAreaMoments(root: AnyRegion): MomentData | undefined;
59
+ static computeXYAreaMoments(region: AnyRegion): MomentData | undefined;
55
60
  /**
56
61
  * Return an area tolerance for a given xy-range and optional distance tolerance.
57
- * @param range range of planar region to tolerance
58
- * @param distanceTolerance optional absolute distance tolerance
62
+ * @param range range of planar region to tolerance.
63
+ * @param distanceTolerance optional absolute distance tolerance.
59
64
  */
60
65
  static computeXYAreaTolerance(range: Range3d, distanceTolerance?: number): number;
61
66
  /**
62
67
  * Return a (signed) xy area for a region.
68
+ * * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
63
69
  * * The area is negative if and only if the region is oriented clockwise with respect to the positive z-axis.
64
- * @param root any Loop, ParityRegion, or UnionRegion.
70
+ * @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
65
71
  */
66
- static computeXYArea(root: AnyRegion): number | undefined;
72
+ static computeXYArea(region: AnyRegion): number | undefined;
67
73
  /**
68
74
  * Return MomentData with the sums of wire moments.
75
+ * * The input curve should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
69
76
  * * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
70
- * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
71
- * @param root any CurveCollection or CurvePrimitive.
77
+ * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
78
+ * * `rawMomentData.origin` is the wire centroid of `curve`.
79
+ * * `rawMomentData.sums.weight()` is the signed length of `curve`.
80
+ * @param curve any [[CurveCollection]] or [[CurvePrimitive]].
72
81
  */
73
- static computeXYZWireMomentSums(root: AnyCurve): MomentData | undefined;
82
+ static computeXYZWireMomentSums(curve: AnyCurve): MomentData | undefined;
83
+ /**
84
+ * Return a [[Ray3d]] with:
85
+ * * `origin` is the centroid of the region,
86
+ * * `direction` is a unit vector perpendicular to the region plane,
87
+ * * `a` is the region area.
88
+ * @param region the region to process. Can lie in any plane.
89
+ * @param result optional pre-allocated result to populate and return.
90
+ */
91
+ static centroidAreaNormal(region: AnyRegion, result?: Ray3d): Ray3d | undefined;
74
92
  /**
75
93
  * Create loops in the graph.
76
94
  * @internal
@@ -119,12 +137,25 @@ export declare class RegionOps {
119
137
  * @param triangulate whether to triangulate the result
120
138
  */
121
139
  static polygonXYAreaDifferenceLoopsToPolyface(loopsA: MultiLineStringDataVariant, loopsB: MultiLineStringDataVariant, triangulate?: boolean): Polyface | undefined;
140
+ /**
141
+ * Simplify the type of the region by stripping redundant parent(s).
142
+ * * No Boolean operations are performed.
143
+ * * Invalid inputs (such as childless regions) are not corrected.
144
+ * @param region region to simplify
145
+ * @returns
146
+ * * For a [[UnionRegion]] with exactly one child, return it if it is a [[Loop]],
147
+ * or if it is a [[ParityRegion]] with multiple children, otherwise return the `ParityRegion`'s `Loop`.
148
+ * * For a `ParityRegion` with exactly one `Loop`, return it.
149
+ * * All other inputs returned unchanged.
150
+ */
151
+ static simplifyRegionType(region: AnyRegion): AnyRegion;
122
152
  /**
123
153
  * Return areas defined by a boolean operation.
124
- * * If there are multiple regions in loopsA, they are treated as a union.
125
- * * If there are multiple regions in loopsB, they are treated as a union.
126
- * @param loopsA first set of loops
127
- * @param loopsB second set of loops
154
+ * @note For best results, input regions should have correctly oriented loops. See [[sortOuterAndHoleLoopsXY]].
155
+ * @note A common use case of this method is to convert a region with overlapping children into one with
156
+ * non-overlapping children: `regionOut = RegionOps.regionBooleanXY(regionIn, undefined, RegionBinaryOpType.Union)`.
157
+ * @param loopsA first set of loops (treated as a union)
158
+ * @param loopsB second set of loops (treated as a union)
128
159
  * @param operation indicates Union, Intersection, Parity, AMinusB, or BMinusA
129
160
  * @param mergeTolerance absolute distance tolerance for merging loops
130
161
  * @returns a region resulting from merging input loops and the boolean operation. May contain bridge edges added
@@ -282,14 +313,15 @@ export declare class RegionOps {
282
313
  */
283
314
  static consolidateAdjacentPrimitives(curves: CurveCollection, options?: ConsolidateAdjacentCurvePrimitivesOptions): void;
284
315
  /**
285
- * Reverse and reorder loops in the xy-plane for consistency and containment.
286
- * @param loops multiple loops in any order and orientation, z-coordinates ignored
316
+ * Reverse and reorder loops in the xy-plane for consistent orientation and containment.
317
+ * @param loops multiple loops in any order and orientation, z-coordinates ignored.
318
+ * * For best results, all overlaps should be containments, i.e., loop boundaries can touch, but should not cross.
287
319
  * @returns a region that captures the input pointers. This region is a:
288
- * * `Loop` if there is exactly one input loop. It is oriented counterclockwise.
289
- * * `ParityRegion` if input consists of exactly one outer loop with at least one hole loop.
320
+ * * [[Loop]] if there is exactly one input loop. It is oriented counterclockwise.
321
+ * * [[ParityRegion]] if input consists of exactly one outer loop with at least one hole loop.
290
322
  * Its first child is an outer loop oriented counterclockwise; all subsequent children are holes oriented
291
323
  * clockwise.
292
- * * `UnionRegion` if any other input configuration. Its children are individually ordered/oriented as in
324
+ * * [[UnionRegion]] if any other input configuration. Its children are individually ordered/oriented as in
293
325
  * the above cases.
294
326
  * @see [[PolygonOps.sortOuterAndHoleLoopsXY]]
295
327
  */
@@ -298,14 +330,14 @@ export declare class RegionOps {
298
330
  * Find all xy-areas bounded by the unstructured, possibly intersecting curves.
299
331
  * * For best results, input curves should be parallel to the xy-plane, as z-coordinates are ignored.
300
332
  * * A common use case of this method is to assemble the bounding "exterior" loop (or loops) containing the
301
- * input curves.
333
+ * input curves. Note that "holes" implied by inputs are _not_ preserved in output.
302
334
  * * This method does not add bridge edges to connect outer loops to inner loops. Each disconnected loop,
303
335
  * regardless of its containment, is returned as its own SignedLoops object. Pre-process with [[regionBooleanXY]]
304
336
  * to add bridge edges so that [[constructAllXYRegionLoops]] will return outer and inner loops in the same
305
337
  * SignedLoops object.
306
338
  * @param curvesAndRegions Any collection of curves. Each Loop/ParityRegion/UnionRegion contributes its curve
307
- * primitives.
308
- * @param tolerance optional distance tolerance for coincidence
339
+ * primitives, stripped of parity context. This means holes are _not_ preserved in output.
340
+ * @param tolerance optional distance tolerance for coincidence.
309
341
  * @returns array of [[SignedLoops]], each entry of which describes the faces in a single connected component:
310
342
  * * `positiveAreaLoops` contains "interior" loops, _including holes in ParityRegion input_. These loops have
311
343
  * positive area and counterclockwise orientation.
@@ -357,12 +389,10 @@ export declare class RegionOps {
357
389
  private static triangulateRegionComponent;
358
390
  /**
359
391
  * Facet the region according to stroke options.
392
+ * @note For best results, [[UnionRegion]] input should consist of non-overlapping children. See [[regionBooleanXY]].
393
+ * @note For best results, [[ParityRegion]] input should be correctly oriented. See [[sortOuterAndHoleLoopsXY]].
360
394
  * @param region a closed xy-planar region, possibly with holes.
361
395
  * * The z-coordinates of the region are ignored. Caller is responsible for rotating the region into plane local coordinates beforehand, and reversing the rotation afterwards.
362
- * * For best results, `UnionRegion` input should consist of non-overlapping children.
363
- * Caller can ensure this by passing in `region = RegionOps.regionBooleanXY(unionRegion, undefined, RegionBinaryOpType.Union)`.
364
- * * For best results, `ParityRegion` input should be correctly oriented (holes have opposite orientation to their containing loop).
365
- * Caller can ensure this for non-intersecting loops by passing in `region = RegionOps.sortOuterAndHoleLoopsXY(loops)`.
366
396
  * @param options primarily how to stroke the region boundary, but also how to facet the region interior.
367
397
  * * By default, a triangulation is returned, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.
368
398
  * @returns facets for the region, or undefined if facetting failed
@@ -377,17 +407,19 @@ export declare class RegionOps {
377
407
  static convexDecomposePolygonXY(polygon: MultiLineStringDataVariant, maximize?: boolean): GrowableXYZArray[] | undefined;
378
408
  }
379
409
  /**
380
- * * Options to control method `RegionOps.consolidateAdjacentPrimitives`
410
+ * * Options to control method `RegionOps.consolidateAdjacentPrimitives`.
381
411
  * @public
382
412
  */
383
413
  export declare class ConsolidateAdjacentCurvePrimitivesOptions {
384
- /** True to consolidate adjacent linear geometry into a single LineString3d */
414
+ /** True to consolidate adjacent linear geometry into a single LineString3d. */
385
415
  consolidateLinearGeometry: boolean;
386
- /** True to consolidate contiguous compatible arcs into a single Arc3d */
416
+ /** True to consolidate contiguous compatible arcs into a single Arc3d. */
387
417
  consolidateCompatibleArcs: boolean;
388
- /** Tolerance for collapsing identical points */
418
+ /** Disable LineSegment3d and LineString3d point compression. */
419
+ disableLinearCompression?: boolean;
420
+ /** Tolerance for collapsing identical points (if `!disableLinearCompression`). */
389
421
  duplicatePointTolerance: number;
390
- /** Tolerance for removing interior colinear points. */
422
+ /** Tolerance for removing interior colinear points (if `!disableLinearCompression`). */
391
423
  colinearPointTolerance: number;
392
424
  }
393
425
  //# sourceMappingURL=RegionOps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RegionOps.d.ts","sourceRoot":"","sources":["../../../src/curve/RegionOps.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAC0B,oBAAoB,EAAyB,0BAA0B,EACvG,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAGxD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,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,E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