@itwin/core-geometry 5.1.0-dev.17 → 5.1.0-dev.18

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 (277) hide show
  1. package/lib/cjs/clipping/ClipPlane.d.ts +7 -5
  2. package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
  3. package/lib/cjs/clipping/ClipPlane.js +9 -5
  4. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  5. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  6. package/lib/cjs/clipping/ConvexClipPlaneSet.js +12 -23
  7. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  8. package/lib/cjs/core-geometry.d.ts +1 -0
  9. package/lib/cjs/core-geometry.d.ts.map +1 -1
  10. package/lib/cjs/core-geometry.js +1 -0
  11. package/lib/cjs/core-geometry.js.map +1 -1
  12. package/lib/cjs/curve/Arc3d.d.ts +53 -31
  13. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  14. package/lib/cjs/curve/Arc3d.js +55 -36
  15. package/lib/cjs/curve/Arc3d.js.map +1 -1
  16. package/lib/cjs/curve/CurveCollection.d.ts +2 -0
  17. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  18. package/lib/cjs/curve/CurveCollection.js +14 -0
  19. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  20. package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
  21. package/lib/cjs/curve/LineSegment3d.js +1 -0
  22. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  23. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
  24. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +10 -5
  25. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  26. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  27. package/lib/cjs/curve/Query/PlanarSubdivision.js +7 -2
  28. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  29. package/lib/cjs/curve/RegionMomentsXY.d.ts.map +1 -1
  30. package/lib/cjs/curve/RegionMomentsXY.js +1 -1
  31. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  32. package/lib/cjs/curve/RegionOps.d.ts +32 -28
  33. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  34. package/lib/cjs/curve/RegionOps.js +32 -28
  35. package/lib/cjs/curve/RegionOps.js.map +1 -1
  36. package/lib/cjs/geometry3d/AngleSweep.d.ts +14 -11
  37. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  38. package/lib/cjs/geometry3d/AngleSweep.js +14 -11
  39. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  40. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +7 -2
  41. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  42. package/lib/cjs/geometry3d/GrowableXYZArray.js +20 -2
  43. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  44. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +2 -1
  45. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  46. package/lib/cjs/geometry3d/IndexedXYZCollection.js +7 -3
  47. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  48. package/lib/cjs/geometry3d/Plane3d.d.ts +2 -0
  49. package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -1
  50. package/lib/cjs/geometry3d/Plane3d.js +6 -1
  51. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  52. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +2 -0
  53. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
  54. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +6 -1
  55. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  56. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts +8 -2
  57. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  58. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +18 -10
  59. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  60. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +3 -3
  61. package/lib/cjs/geometry3d/Point3dVector3d.js +3 -3
  62. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  63. package/lib/cjs/geometry3d/PointHelpers.d.ts +7 -7
  64. package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
  65. package/lib/cjs/geometry3d/PointHelpers.js +66 -26
  66. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  67. package/lib/cjs/geometry3d/PolygonOps.d.ts +49 -2
  68. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  69. package/lib/cjs/geometry3d/PolygonOps.js +38 -2
  70. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  71. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts +13 -6
  72. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
  73. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +16 -9
  74. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  75. package/lib/cjs/geometry3d/PolylineOps.d.ts +5 -4
  76. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  77. package/lib/cjs/geometry3d/PolylineOps.js +5 -4
  78. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  79. package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
  80. package/lib/cjs/geometry3d/Ray3d.js +11 -23
  81. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  82. package/lib/cjs/geometry3d/Transform.d.ts +21 -2
  83. package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
  84. package/lib/cjs/geometry3d/Transform.js +32 -13
  85. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  86. package/lib/cjs/geometry4d/Point4d.d.ts +4 -2
  87. package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
  88. package/lib/cjs/geometry4d/Point4d.js +17 -13
  89. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  90. package/lib/cjs/polyface/FacetOrientation.d.ts +1 -1
  91. package/lib/cjs/polyface/FacetOrientation.js +1 -1
  92. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  93. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +55 -40
  94. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  95. package/lib/cjs/polyface/IndexedEdgeMatcher.js +83 -75
  96. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  97. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +15 -14
  98. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  99. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +47 -38
  100. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  101. package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts +26 -19
  102. package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
  103. package/lib/cjs/polyface/IndexedPolyfaceWalker.js +47 -32
  104. package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
  105. package/lib/cjs/polyface/Polyface.d.ts +17 -3
  106. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  107. package/lib/cjs/polyface/Polyface.js +16 -0
  108. package/lib/cjs/polyface/Polyface.js.map +1 -1
  109. package/lib/cjs/polyface/PolyfaceBuilder.js +2 -2
  110. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  111. package/lib/cjs/polyface/PolyfaceClip.d.ts +19 -18
  112. package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
  113. package/lib/cjs/polyface/PolyfaceClip.js +39 -42
  114. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  115. package/lib/cjs/polyface/PolyfaceQuery.d.ts +116 -75
  116. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  117. package/lib/cjs/polyface/PolyfaceQuery.js +312 -228
  118. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  119. package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +3 -3
  120. package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
  121. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +3 -3
  122. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  123. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts +7 -6
  124. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  125. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +8 -9
  126. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  127. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  128. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  129. package/lib/cjs/solid/LinearSweep.d.ts +2 -3
  130. package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
  131. package/lib/cjs/solid/LinearSweep.js +2 -3
  132. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  133. package/lib/cjs/solid/RotationalSweep.d.ts +2 -2
  134. package/lib/cjs/solid/RotationalSweep.js +2 -2
  135. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  136. package/lib/cjs/topology/ChainMerge.d.ts +1 -1
  137. package/lib/cjs/topology/ChainMerge.js +1 -1
  138. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  139. package/lib/esm/clipping/ClipPlane.d.ts +7 -5
  140. package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
  141. package/lib/esm/clipping/ClipPlane.js +9 -5
  142. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  143. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  144. package/lib/esm/clipping/ConvexClipPlaneSet.js +12 -23
  145. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  146. package/lib/esm/core-geometry.d.ts +1 -0
  147. package/lib/esm/core-geometry.d.ts.map +1 -1
  148. package/lib/esm/core-geometry.js +1 -0
  149. package/lib/esm/core-geometry.js.map +1 -1
  150. package/lib/esm/curve/Arc3d.d.ts +53 -31
  151. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  152. package/lib/esm/curve/Arc3d.js +55 -36
  153. package/lib/esm/curve/Arc3d.js.map +1 -1
  154. package/lib/esm/curve/CurveCollection.d.ts +2 -0
  155. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  156. package/lib/esm/curve/CurveCollection.js +14 -0
  157. package/lib/esm/curve/CurveCollection.js.map +1 -1
  158. package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
  159. package/lib/esm/curve/LineSegment3d.js +1 -0
  160. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  161. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
  162. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +10 -5
  163. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  164. package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  165. package/lib/esm/curve/Query/PlanarSubdivision.js +7 -2
  166. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  167. package/lib/esm/curve/RegionMomentsXY.d.ts.map +1 -1
  168. package/lib/esm/curve/RegionMomentsXY.js +1 -1
  169. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  170. package/lib/esm/curve/RegionOps.d.ts +32 -28
  171. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  172. package/lib/esm/curve/RegionOps.js +32 -28
  173. package/lib/esm/curve/RegionOps.js.map +1 -1
  174. package/lib/esm/geometry3d/AngleSweep.d.ts +14 -11
  175. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  176. package/lib/esm/geometry3d/AngleSweep.js +14 -11
  177. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  178. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +7 -2
  179. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  180. package/lib/esm/geometry3d/GrowableXYZArray.js +20 -2
  181. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  182. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +2 -1
  183. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  184. package/lib/esm/geometry3d/IndexedXYZCollection.js +7 -3
  185. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  186. package/lib/esm/geometry3d/Plane3d.d.ts +2 -0
  187. package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -1
  188. package/lib/esm/geometry3d/Plane3d.js +6 -1
  189. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  190. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +2 -0
  191. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
  192. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +6 -1
  193. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  194. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts +8 -2
  195. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  196. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +18 -10
  197. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  198. package/lib/esm/geometry3d/Point3dVector3d.d.ts +3 -3
  199. package/lib/esm/geometry3d/Point3dVector3d.js +3 -3
  200. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  201. package/lib/esm/geometry3d/PointHelpers.d.ts +7 -7
  202. package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
  203. package/lib/esm/geometry3d/PointHelpers.js +66 -26
  204. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  205. package/lib/esm/geometry3d/PolygonOps.d.ts +49 -2
  206. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  207. package/lib/esm/geometry3d/PolygonOps.js +38 -2
  208. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  209. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts +13 -6
  210. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
  211. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +16 -9
  212. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  213. package/lib/esm/geometry3d/PolylineOps.d.ts +5 -4
  214. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  215. package/lib/esm/geometry3d/PolylineOps.js +5 -4
  216. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  217. package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
  218. package/lib/esm/geometry3d/Ray3d.js +11 -23
  219. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  220. package/lib/esm/geometry3d/Transform.d.ts +21 -2
  221. package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
  222. package/lib/esm/geometry3d/Transform.js +32 -13
  223. package/lib/esm/geometry3d/Transform.js.map +1 -1
  224. package/lib/esm/geometry4d/Point4d.d.ts +4 -2
  225. package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
  226. package/lib/esm/geometry4d/Point4d.js +17 -13
  227. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  228. package/lib/esm/polyface/FacetOrientation.d.ts +1 -1
  229. package/lib/esm/polyface/FacetOrientation.js +1 -1
  230. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  231. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +55 -40
  232. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  233. package/lib/esm/polyface/IndexedEdgeMatcher.js +83 -75
  234. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  235. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +15 -14
  236. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  237. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +47 -38
  238. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  239. package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts +26 -19
  240. package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
  241. package/lib/esm/polyface/IndexedPolyfaceWalker.js +47 -32
  242. package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
  243. package/lib/esm/polyface/Polyface.d.ts +17 -3
  244. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  245. package/lib/esm/polyface/Polyface.js +16 -0
  246. package/lib/esm/polyface/Polyface.js.map +1 -1
  247. package/lib/esm/polyface/PolyfaceBuilder.js +2 -2
  248. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  249. package/lib/esm/polyface/PolyfaceClip.d.ts +19 -18
  250. package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
  251. package/lib/esm/polyface/PolyfaceClip.js +39 -42
  252. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  253. package/lib/esm/polyface/PolyfaceQuery.d.ts +116 -75
  254. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  255. package/lib/esm/polyface/PolyfaceQuery.js +313 -229
  256. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  257. package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +3 -3
  258. package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
  259. package/lib/esm/polyface/RangeTree/RangeTreeNode.js +3 -3
  260. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  261. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts +7 -6
  262. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  263. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +8 -9
  264. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  265. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  266. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  267. package/lib/esm/solid/LinearSweep.d.ts +2 -3
  268. package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
  269. package/lib/esm/solid/LinearSweep.js +2 -3
  270. package/lib/esm/solid/LinearSweep.js.map +1 -1
  271. package/lib/esm/solid/RotationalSweep.d.ts +2 -2
  272. package/lib/esm/solid/RotationalSweep.js +2 -2
  273. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  274. package/lib/esm/topology/ChainMerge.d.ts +1 -1
  275. package/lib/esm/topology/ChainMerge.js +1 -1
  276. package/lib/esm/topology/ChainMerge.js.map +1 -1
  277. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"PlanarSubdivision.js","sourceRoot":"","sources":["../../../../src/curve/Query/PlanarSubdivision.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,6CAA0C;AAE1C,gDAA+D;AAC/D,4EAAyE;AACzE,oDAA4D;AAC5D,oCAAiC;AACjC,gEAAsF;AAEtF,oDAAiD;AACjD,kDAA+C;AAC/C,kCAAgE;AAChE,4CAAyC;AAEzC;;GAEG;AAEH,MAAM,+CAA+C;IAC5C,eAAe,GAAG,IAAI,GAAG,EAA6C,CAAC;IAC9E,mDAAmD;IAC5C,gBAAgB,GAAG,IAAI,GAAG,EAA0B,CAAC;IACpD,qBAAqB,GAAW,CAAC,CAAC;IACnC,oBAAoB,CAAC,SA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KAAK,EAAE,CAAC;QAClB,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAnKD,8CAmKC;AAED,SAAS,SAAS,CAAC,KAAqB,EAAE,QAAgB,EAAE,OAAgB;IAC1E,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,6CAA0C;AAE1C,gDAA+D;AAC/D,4EAAyE;AACzE,oDAA4D;AAC5D,oCAAiC;AACjC,gEAAsF;AAEtF,oDAAiD;AACjD,kDAA+C;AAC/C,kCAAgE;AAChE,4CAAyC;AAEzC;;GAEG;AAEH,MAAM,+CAA+C;IAC5C,eAAe,GAAG,IAAI,GAAG,EAA6C,CAAC;IAC9E,mDAAmD;IAC5C,gBAAgB,GAAG,IAAI,GAAG,EAA0B,CAAC;IACpD,qBAAqB,GAAW,CAAC,CAAC;IACnC,oBAAoB,CAAC,SAAqC;QAC/D,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACnD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACxB,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;IACH,CAAC;IACM,qBAAqB,CAAC,SAAqC,EAAE,IAA6B;QAC/F,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACvD,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;YACrC,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChB,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,SAAS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,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"]}
@@ -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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O,EAAE,aAAa,GAAG,IAAI;IAMjE,uEAAuE;IACvD,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,UAAU,GAAG,SAAS;IAQ9D,OAAO,CAAC,eAAe;IAiBvB,+EAA+E;IAC/D,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,UAAU,GAAG,SAAS;IAGhF,8EAA8E;IAC9D,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,UAAU,GAAG,SAAS;IAI9E,OAAO,CAAC,cAAc,CAAC,CAAgB;IACvC,OAAO,CAAC,gBAAgB;IASxB;;;OAGG;IACI,oBAAoB,CAAC,EAAE,EAAE,cAAc;IAM9C,yEAAyE;IACzD,oBAAoB,CAAC,CAAC,EAAE,cAAc;IAGtD,0EAA0E;IAC1D,qBAAqB,CAAC,CAAC,EAAE,eAAe;IAGxD,0EAA0E;IAC1D,sBAAsB,CAAC,CAAC,EAAE,kBAAkB;CAG7D"}
@@ -102,7 +102,7 @@ class RegionMomentsXY extends GeometryHandler_1.NullGeometryHandler {
102
102
  handleUnionRegion(region) {
103
103
  return this.handleAnyRegion(region);
104
104
  }
105
- _strokeOptions;
105
+ _strokeOptions; // TODO: expose to callers in RegionOps
106
106
  getStrokeOptions() {
107
107
  if (this._strokeOptions)
108
108
  return this._strokeOptions;
@@ -1 +1 @@
1
- {"version":3,"file":"RegionMomentsXY.js","sourceRoot":"","sources":["../../../src/curve/RegionMomentsXY.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAU/F,+CAA4C;AAC5C,mEAAoE;AACpE,mEAAwD;AACxD,yDAAsD;AAKtD,iDAA8C;AAG9C,2CAA4D;AAE5D,mDAAgD;AAGhD;;;GAGG;AACH,MAAa,eAAgB,SAAQ,qCAAmB;IAC9C,iBAAiB,CAAc;IAC/B,OAAO,GAAG,yBAAO,CAAC,MAAM,EAAE,CAAC;IAC3B,OAAO,GAAG,yBAAO,CAAC,MAAM,EAAE,CAAC;IACnC;;;;OAIG;IACa,WAAW,CAA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B,gBAAgB;QACtB,IAAI,IAAI,CAAC,cAAc;YACrB,OAAO,IAAI,CAAC,cAAc,CAAC;QAC7B,MAAM,OAAO,GAAG,6BAAa,CAAC,eAAe,EAAE,CAAC;QAChD,gEAAgE;QAChE,OAAO,CAAC,QAAQ,GAAG,aAAK,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,2BAAY,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,yEAAyE;IACzD,oBAAoB,CAAC,CAAiB;QACpD,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC;IACD,0EAA0E;IAC1D,qBAAqB,CAAC,CAAkB;QACtD,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC;IACD,0EAA0E;IAC1D,sBAAsB,CAAC,CAAqB;QAC1D,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC;CACF;AAvHD,0CAuHC","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 const summedMoments = MomentData.create();\n // guarantee there is no overlapping children\n const merged = RegionOps.regionBooleanXY(region, undefined, RegionBinaryOpType.Union);\n if (merged) {\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 } else {\n return undefined;\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) {\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) {\n return this.handleCurvePrimitive(g);\n }\n /** Handle strongly typed BSplineCurve3dH as generic curve primitive. */\n public override handleBSplineCurve3dH(g: BSplineCurve3dH) {\n return this.handleCurvePrimitive(g);\n }\n /** Handle strongly typed TransitionSpiral as generic curve primitive. */\n public override handleTransitionSpiral(g: TransitionSpiral3d) {\n return this.handleCurvePrimitive(g);\n }\n}\n"]}
1
+ {"version":3,"file":"RegionMomentsXY.js","sourceRoot":"","sources":["../../../src/curve/RegionMomentsXY.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAU/F,+CAA4C;AAC5C,mEAAoE;AACpE,mEAAwD;AACxD,yDAAsD;AAKtD,iDAA8C;AAG9C,2CAA4D;AAE5D,mDAAgD;AAGhD;;;GAGG;AACH,MAAa,eAAgB,SAAQ,qCAAmB;IAC9C,iBAAiB,CAAc;IAC/B,OAAO,GAAG,yBAAO,CAAC,MAAM,EAAE,CAAC;IAC3B,OAAO,GAAG,yBAAO,CAAC,MAAM,EAAE,CAAC;IACnC;;;;OAIG;IACa,WAAW,CAAC,GAAU;QACpC,MAAM,UAAU,GAAG,IAAI,CAAC,iBAAkB,CAAC;QAC3C,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC;QAC5C,MAAM,YAAY,GAAG,YAAY,GAAG,GAAG,CAAC;QACxC,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AAC,QAAQ,GAAG,aAAK,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,2BAAY,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,yEAAyE;IACzD,oBAAoB,CAAC,CAAiB;QACpD,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC;IACD,0EAA0E;IAC1D,qBAAqB,CAAC,CAAkB;QACtD,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC;IACD,0EAA0E;IAC1D,sBAAsB,CAAC,CAAqB;QAC1D,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC;CACF;AAxHD,0CAwHC","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 const summedMoments = MomentData.create();\n // guarantee there is no overlapping children\n const merged = RegionOps.regionBooleanXY(region, undefined, RegionBinaryOpType.Union);\n if (merged) {\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 } else {\n return undefined;\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\n private _strokeOptions?: StrokeOptions; // TODO: expose to callers in RegionOps\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) {\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) {\n return this.handleCurvePrimitive(g);\n }\n /** Handle strongly typed BSplineCurve3dH as generic curve primitive. */\n public override handleBSplineCurve3dH(g: BSplineCurve3dH) {\n return this.handleCurvePrimitive(g);\n }\n /** Handle strongly typed TransitionSpiral as generic curve primitive. */\n public override handleTransitionSpiral(g: TransitionSpiral3d) {\n return this.handleCurvePrimitive(g);\n }\n}\n"]}
@@ -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;
@@ -138,10 +140,11 @@ export declare class RegionOps {
138
140
  static polygonXYAreaDifferenceLoopsToPolyface(loopsA: MultiLineStringDataVariant, loopsB: MultiLineStringDataVariant, triangulate?: boolean): Polyface | undefined;
139
141
  /**
140
142
  * 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
143
+ * @note For best results, input regions should have correctly oriented loops. See [[sortOuterAndHoleLoopsXY]].
144
+ * @note A common use case of this method is to convert a region with overlapping children into one with
145
+ * non-overlapping children: `regionOut = RegionOps.regionBooleanXY(regionIn, undefined, RegionBinaryOpType.Union)`.
146
+ * @param loopsA first set of loops (treated as a union)
147
+ * @param loopsB second set of loops (treated as a union)
145
148
  * @param operation indicates Union, Intersection, Parity, AMinusB, or BMinusA
146
149
  * @param mergeTolerance absolute distance tolerance for merging loops
147
150
  * @returns a region resulting from merging input loops and the boolean operation. May contain bridge edges added
@@ -299,14 +302,15 @@ export declare class RegionOps {
299
302
  */
300
303
  static consolidateAdjacentPrimitives(curves: CurveCollection, options?: ConsolidateAdjacentCurvePrimitivesOptions): void;
301
304
  /**
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
305
+ * Reverse and reorder loops in the xy-plane for consistent orientation and containment.
306
+ * @param loops multiple loops in any order and orientation, z-coordinates ignored.
307
+ * * For best results, all overlaps should be containments, i.e., loop boundaries can touch, but should not cross.
304
308
  * @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.
309
+ * * [[Loop]] if there is exactly one input loop. It is oriented counterclockwise.
310
+ * * [[ParityRegion]] if input consists of exactly one outer loop with at least one hole loop.
307
311
  * Its first child is an outer loop oriented counterclockwise; all subsequent children are holes oriented
308
312
  * clockwise.
309
- * * `UnionRegion` if any other input configuration. Its children are individually ordered/oriented as in
313
+ * * [[UnionRegion]] if any other input configuration. Its children are individually ordered/oriented as in
310
314
  * the above cases.
311
315
  * @see [[PolygonOps.sortOuterAndHoleLoopsXY]]
312
316
  */
@@ -315,13 +319,13 @@ export declare class RegionOps {
315
319
  * Find all xy-areas bounded by the unstructured, possibly intersecting curves.
316
320
  * * For best results, input curves should be parallel to the xy-plane, as z-coordinates are ignored.
317
321
  * * A common use case of this method is to assemble the bounding "exterior" loop (or loops) containing the
318
- * input curves.
322
+ * input curves. Note that "holes" implied by inputs are _not_ preserved in output.
319
323
  * * This method does not add bridge edges to connect outer loops to inner loops. Each disconnected loop,
320
324
  * regardless of its containment, is returned as its own SignedLoops object. Pre-process with [[regionBooleanXY]]
321
325
  * to add bridge edges so that [[constructAllXYRegionLoops]] will return outer and inner loops in the same
322
326
  * SignedLoops object.
323
327
  * @param curvesAndRegions Any collection of curves. Each Loop/ParityRegion/UnionRegion contributes its curve
324
- * primitives.
328
+ * primitives, stripped of parity context. This means holes are _not_ preserved in output.
325
329
  * @param tolerance optional distance tolerance for coincidence.
326
330
  * @returns array of [[SignedLoops]], each entry of which describes the faces in a single connected component:
327
331
  * * `positiveAreaLoops` contains "interior" loops, _including holes in ParityRegion input_. These loops have
@@ -374,12 +378,10 @@ export declare class RegionOps {
374
378
  private static triangulateRegionComponent;
375
379
  /**
376
380
  * Facet the region according to stroke options.
381
+ * @note For best results, [[UnionRegion]] input should consist of non-overlapping children. See [[regionBooleanXY]].
382
+ * @note For best results, [[ParityRegion]] input should be correctly oriented. See [[sortOuterAndHoleLoopsXY]].
377
383
  * @param region a closed xy-planar region, possibly with holes.
378
384
  * * 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
385
  * @param options primarily how to stroke the region boundary, but also how to facet the region interior.
384
386
  * * By default, a triangulation is returned, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.
385
387
  * @returns facets for the region, or undefined if facetting failed
@@ -394,17 +396,19 @@ export declare class RegionOps {
394
396
  static convexDecomposePolygonXY(polygon: MultiLineStringDataVariant, maximize?: boolean): GrowableXYZArray[] | undefined;
395
397
  }
396
398
  /**
397
- * * Options to control method `RegionOps.consolidateAdjacentPrimitives`
399
+ * * Options to control method `RegionOps.consolidateAdjacentPrimitives`.
398
400
  * @public
399
401
  */
400
402
  export declare class ConsolidateAdjacentCurvePrimitivesOptions {
401
- /** True to consolidate adjacent linear geometry into a single LineString3d */
403
+ /** True to consolidate adjacent linear geometry into a single LineString3d. */
402
404
  consolidateLinearGeometry: boolean;
403
- /** True to consolidate contiguous compatible arcs into a single Arc3d */
405
+ /** True to consolidate contiguous compatible arcs into a single Arc3d. */
404
406
  consolidateCompatibleArcs: boolean;
405
- /** Tolerance for collapsing identical points */
407
+ /** Disable LineSegment3d and LineString3d point compression. */
408
+ disableLinearCompression?: boolean;
409
+ /** Tolerance for collapsing identical points (if `!disableLinearCompression`). */
406
410
  duplicatePointTolerance: number;
407
- /** Tolerance for removing interior colinear points. */
411
+ /** Tolerance for removing interior colinear points (if `!disableLinearCompression`). */
408
412
  colinearPointTolerance: number;
409
413
  }
410
414
  //# 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,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAO7D,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAO9B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD;;;;;;;GAOG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,aAA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CAAC,EAAE,OAAO,CAAS;IAClD,kFAAkF;IAC3E,uBAAuB,EAAE,MAAM,CAAgC;IACtE,wFAAwF;IACjF,sBAAsB,EAAE,MAAM,CAAgC;CACtE"}
@@ -61,13 +61,14 @@ var RegionBinaryOpType;
61
61
  })(RegionBinaryOpType || (exports.RegionBinaryOpType = RegionBinaryOpType = {}));
62
62
  /**
63
63
  * Class `RegionOps` has static members for calculations on regions (areas).
64
- * * Regions are represented by these `CurveCollection` subclasses:
65
- * * `Loop` -- a single loop
66
- * * `ParityRegion` -- a collection of loops, interpreted by parity rules.
67
- * The common "One outer loop and many Inner loops" is a parity region.
68
- * * `UnionRegion` -- a collection of `Loop` and `ParityRegion` objects understood as a (probably disjoint) union.
69
- * * **NOTE:** Most of the methods in this class ignore z-coordinates, so callers should ensure that input geometry has
70
- * been rotated parallel to the xy-plane.
64
+ * * Regions are represented by these [[CurveCollection]] subclasses:
65
+ * * [[Loop]] -- a single loop
66
+ * * [[ParityRegion]] -- a collection of loops, interpreted by parity rules.
67
+ * The common "One outer loop and many inner loops" is a parity region.
68
+ * * [[UnionRegion]] -- a collection of `Loop` and `ParityRegion` objects understood as a (probably disjoint) union.
69
+ * * Most of the methods in this class:
70
+ * * Ignore z-coordinates, so callers should ensure that input geometry has been rotated parallel to the xy-plane.
71
+ * * Assume consistent Loop orientation: "solid" Loops are counterclockwise; "hole" Loops are clockwise.
71
72
  * @public
72
73
  */
73
74
  class RegionOps {
@@ -102,7 +103,8 @@ class RegionOps {
102
103
  /**
103
104
  * Return a (signed) xy area for a region.
104
105
  * * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
105
- * * The area is negative if and only if the region is oriented clockwise with respect to the positive z-axis.
106
+ * * For a non-self-intersecting Loop, the returned area is negative if and only if the Loop is oriented clockwise
107
+ * with respect to the positive z-axis.
106
108
  * @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
107
109
  */
108
110
  static computeXYArea(region) {
@@ -284,10 +286,11 @@ class RegionOps {
284
286
  }
285
287
  /**
286
288
  * Return areas defined by a boolean operation.
287
- * * If there are multiple regions in loopsA, they are treated as a union.
288
- * * If there are multiple regions in loopsB, they are treated as a union.
289
- * @param loopsA first set of loops
290
- * @param loopsB second set of loops
289
+ * @note For best results, input regions should have correctly oriented loops. See [[sortOuterAndHoleLoopsXY]].
290
+ * @note A common use case of this method is to convert a region with overlapping children into one with
291
+ * non-overlapping children: `regionOut = RegionOps.regionBooleanXY(regionIn, undefined, RegionBinaryOpType.Union)`.
292
+ * @param loopsA first set of loops (treated as a union)
293
+ * @param loopsB second set of loops (treated as a union)
291
294
  * @param operation indicates Union, Intersection, Parity, AMinusB, or BMinusA
292
295
  * @param mergeTolerance absolute distance tolerance for merging loops
293
296
  * @returns a region resulting from merging input loops and the boolean operation. May contain bridge edges added
@@ -605,14 +608,15 @@ class RegionOps {
605
608
  curves.dispatchToGeometryHandler(context);
606
609
  }
607
610
  /**
608
- * Reverse and reorder loops in the xy-plane for consistency and containment.
609
- * @param loops multiple loops in any order and orientation, z-coordinates ignored
611
+ * Reverse and reorder loops in the xy-plane for consistent orientation and containment.
612
+ * @param loops multiple loops in any order and orientation, z-coordinates ignored.
613
+ * * For best results, all overlaps should be containments, i.e., loop boundaries can touch, but should not cross.
610
614
  * @returns a region that captures the input pointers. This region is a:
611
- * * `Loop` if there is exactly one input loop. It is oriented counterclockwise.
612
- * * `ParityRegion` if input consists of exactly one outer loop with at least one hole loop.
615
+ * * [[Loop]] if there is exactly one input loop. It is oriented counterclockwise.
616
+ * * [[ParityRegion]] if input consists of exactly one outer loop with at least one hole loop.
613
617
  * Its first child is an outer loop oriented counterclockwise; all subsequent children are holes oriented
614
618
  * clockwise.
615
- * * `UnionRegion` if any other input configuration. Its children are individually ordered/oriented as in
619
+ * * [[UnionRegion]] if any other input configuration. Its children are individually ordered/oriented as in
616
620
  * the above cases.
617
621
  * @see [[PolygonOps.sortOuterAndHoleLoopsXY]]
618
622
  */
@@ -632,13 +636,13 @@ class RegionOps {
632
636
  * Find all xy-areas bounded by the unstructured, possibly intersecting curves.
633
637
  * * For best results, input curves should be parallel to the xy-plane, as z-coordinates are ignored.
634
638
  * * A common use case of this method is to assemble the bounding "exterior" loop (or loops) containing the
635
- * input curves.
639
+ * input curves. Note that "holes" implied by inputs are _not_ preserved in output.
636
640
  * * This method does not add bridge edges to connect outer loops to inner loops. Each disconnected loop,
637
641
  * regardless of its containment, is returned as its own SignedLoops object. Pre-process with [[regionBooleanXY]]
638
642
  * to add bridge edges so that [[constructAllXYRegionLoops]] will return outer and inner loops in the same
639
643
  * SignedLoops object.
640
644
  * @param curvesAndRegions Any collection of curves. Each Loop/ParityRegion/UnionRegion contributes its curve
641
- * primitives.
645
+ * primitives, stripped of parity context. This means holes are _not_ preserved in output.
642
646
  * @param tolerance optional distance tolerance for coincidence.
643
647
  * @returns array of [[SignedLoops]], each entry of which describes the faces in a single connected component:
644
648
  * * `positiveAreaLoops` contains "interior" loops, _including holes in ParityRegion input_. These loops have
@@ -803,12 +807,10 @@ class RegionOps {
803
807
  }
804
808
  /**
805
809
  * Facet the region according to stroke options.
810
+ * @note For best results, [[UnionRegion]] input should consist of non-overlapping children. See [[regionBooleanXY]].
811
+ * @note For best results, [[ParityRegion]] input should be correctly oriented. See [[sortOuterAndHoleLoopsXY]].
806
812
  * @param region a closed xy-planar region, possibly with holes.
807
813
  * * 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.
808
- * * For best results, `UnionRegion` input should consist of non-overlapping children.
809
- * Caller can ensure this by passing in `region = RegionOps.regionBooleanXY(unionRegion, undefined, RegionBinaryOpType.Union)`.
810
- * * For best results, `ParityRegion` input should be correctly oriented (holes have opposite orientation to their containing loop).
811
- * Caller can ensure this for non-intersecting loops by passing in `region = RegionOps.sortOuterAndHoleLoopsXY(loops)`.
812
814
  * @param options primarily how to stroke the region boundary, but also how to facet the region interior.
813
815
  * * By default, a triangulation is returned, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.
814
816
  * @returns facets for the region, or undefined if facetting failed
@@ -872,17 +874,19 @@ function pushToInOnOutArrays(curve, select, arrayNegative, array0, arrayPositive
872
874
  array0.push(curve);
873
875
  }
874
876
  /**
875
- * * Options to control method `RegionOps.consolidateAdjacentPrimitives`
877
+ * * Options to control method `RegionOps.consolidateAdjacentPrimitives`.
876
878
  * @public
877
879
  */
878
880
  class ConsolidateAdjacentCurvePrimitivesOptions {
879
- /** True to consolidate adjacent linear geometry into a single LineString3d */
881
+ /** True to consolidate adjacent linear geometry into a single LineString3d. */
880
882
  consolidateLinearGeometry = true;
881
- /** True to consolidate contiguous compatible arcs into a single Arc3d */
883
+ /** True to consolidate contiguous compatible arcs into a single Arc3d. */
882
884
  consolidateCompatibleArcs = true;
883
- /** Tolerance for collapsing identical points */
885
+ /** Disable LineSegment3d and LineString3d point compression. */
886
+ disableLinearCompression = false;
887
+ /** Tolerance for collapsing identical points (if `!disableLinearCompression`). */
884
888
  duplicatePointTolerance = Geometry_1.Geometry.smallMetricDistance;
885
- /** Tolerance for removing interior colinear points. */
889
+ /** Tolerance for removing interior colinear points (if `!disableLinearCompression`). */
886
890
  colinearPointTolerance = Geometry_1.Geometry.smallMetricDistance;
887
891
  }
888
892
  exports.ConsolidateAdjacentCurvePrimitivesOptions = ConsolidateAdjacentCurvePrimitivesOptions;