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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (598) hide show
  1. package/CHANGELOG.md +63 -1
  2. package/lib/cjs/Geometry.d.ts +18 -10
  3. package/lib/cjs/Geometry.d.ts.map +1 -1
  4. package/lib/cjs/Geometry.js +13 -3
  5. package/lib/cjs/Geometry.js.map +1 -1
  6. package/lib/cjs/bspline/BSpline1dNd.d.ts +1 -1
  7. package/lib/cjs/bspline/BSpline1dNd.js +1 -1
  8. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  9. package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
  10. package/lib/cjs/bspline/BSplineCurve.js +7 -1
  11. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  12. package/lib/cjs/bspline/BSplineSurface.d.ts +4 -3
  13. package/lib/cjs/bspline/BSplineSurface.d.ts.map +1 -1
  14. package/lib/cjs/bspline/BSplineSurface.js +4 -5
  15. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  16. package/lib/cjs/clipping/ClipPlane.d.ts +7 -5
  17. package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
  18. package/lib/cjs/clipping/ClipPlane.js +9 -5
  19. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  20. package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
  21. package/lib/cjs/clipping/ClipUtils.js +5 -3
  22. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  23. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +1 -2
  24. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  25. package/lib/cjs/clipping/ConvexClipPlaneSet.js +13 -25
  26. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  27. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +1 -2
  28. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  29. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +1 -2
  30. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  31. package/lib/cjs/core-geometry.d.ts +2 -0
  32. package/lib/cjs/core-geometry.d.ts.map +1 -1
  33. package/lib/cjs/core-geometry.js +2 -0
  34. package/lib/cjs/core-geometry.js.map +1 -1
  35. package/lib/cjs/curve/Arc3d.d.ts +54 -32
  36. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  37. package/lib/cjs/curve/Arc3d.js +56 -37
  38. package/lib/cjs/curve/Arc3d.js.map +1 -1
  39. package/lib/cjs/curve/CurveCollection.d.ts +40 -1
  40. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  41. package/lib/cjs/curve/CurveCollection.js +90 -0
  42. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  43. package/lib/cjs/curve/CurveFactory.d.ts +3 -2
  44. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  45. package/lib/cjs/curve/CurveFactory.js +6 -5
  46. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  47. package/lib/cjs/curve/CurveLocationDetail.d.ts +27 -25
  48. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  49. package/lib/cjs/curve/CurveLocationDetail.js +30 -25
  50. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  51. package/lib/cjs/curve/CurvePrimitive.d.ts +9 -2
  52. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  53. package/lib/cjs/curve/CurvePrimitive.js +11 -0
  54. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  55. package/lib/cjs/curve/CurveTypes.d.ts +1 -1
  56. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  57. package/lib/cjs/curve/LineSegment3d.d.ts +2 -0
  58. package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
  59. package/lib/cjs/curve/LineSegment3d.js +4 -0
  60. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  61. package/lib/cjs/curve/LineString3d.d.ts +7 -0
  62. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  63. package/lib/cjs/curve/LineString3d.js +15 -3
  64. package/lib/cjs/curve/LineString3d.js.map +1 -1
  65. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
  66. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +37 -8
  67. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  68. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +34 -8
  69. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  70. package/lib/cjs/curve/Query/PlanarSubdivision.js +129 -33
  71. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  72. package/lib/cjs/curve/Query/StrokeCountChain.d.ts +4 -3
  73. package/lib/cjs/curve/Query/StrokeCountChain.d.ts.map +1 -1
  74. package/lib/cjs/curve/Query/StrokeCountChain.js +20 -9
  75. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  76. package/lib/cjs/curve/RegionMomentsXY.d.ts +2 -1
  77. package/lib/cjs/curve/RegionMomentsXY.d.ts.map +1 -1
  78. package/lib/cjs/curve/RegionMomentsXY.js +26 -41
  79. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  80. package/lib/cjs/curve/RegionOps.d.ts +74 -39
  81. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  82. package/lib/cjs/curve/RegionOps.js +146 -46
  83. package/lib/cjs/curve/RegionOps.js.map +1 -1
  84. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +36 -27
  85. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  86. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +161 -55
  87. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  88. package/lib/cjs/curve/StrokeOptions.d.ts +1 -1
  89. package/lib/cjs/curve/StrokeOptions.js +1 -1
  90. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  91. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  92. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +2 -2
  93. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +6 -6
  94. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  95. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +0 -1
  96. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  97. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +58 -32
  98. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  99. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
  100. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +0 -1
  101. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  102. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.d.ts +14 -0
  103. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.d.ts.map +1 -0
  104. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js +34 -0
  105. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -0
  106. package/lib/cjs/geometry3d/AngleSweep.d.ts +25 -18
  107. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  108. package/lib/cjs/geometry3d/AngleSweep.js +32 -18
  109. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  110. package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts +8 -7
  111. package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
  112. package/lib/cjs/geometry3d/CoincidentGeometryOps.js +19 -25
  113. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  114. package/lib/cjs/geometry3d/Ellipsoid.js +1 -1
  115. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  116. package/lib/cjs/geometry3d/GrowableXYArray.d.ts +1 -1
  117. package/lib/cjs/geometry3d/GrowableXYArray.js +1 -1
  118. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  119. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +8 -3
  120. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  121. package/lib/cjs/geometry3d/GrowableXYZArray.js +21 -3
  122. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  123. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +11 -1
  124. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  125. package/lib/cjs/geometry3d/IndexedXYZCollection.js +21 -3
  126. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  127. package/lib/cjs/geometry3d/Plane3d.d.ts +2 -0
  128. package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -1
  129. package/lib/cjs/geometry3d/Plane3d.js +6 -1
  130. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  131. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +2 -0
  132. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
  133. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +6 -1
  134. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  135. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts +8 -2
  136. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  137. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +18 -10
  138. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  139. package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
  140. package/lib/cjs/geometry3d/Point2dVector2d.js +0 -2
  141. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  142. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +4 -4
  143. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  144. package/lib/cjs/geometry3d/Point3dVector3d.js +4 -5
  145. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  146. package/lib/cjs/geometry3d/PointHelpers.d.ts +7 -7
  147. package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
  148. package/lib/cjs/geometry3d/PointHelpers.js +66 -26
  149. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  150. package/lib/cjs/geometry3d/PolygonOps.d.ts +49 -2
  151. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  152. package/lib/cjs/geometry3d/PolygonOps.js +38 -2
  153. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  154. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts +13 -6
  155. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
  156. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +16 -9
  157. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  158. package/lib/cjs/geometry3d/PolylineOps.d.ts +5 -4
  159. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  160. package/lib/cjs/geometry3d/PolylineOps.js +5 -4
  161. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  162. package/lib/cjs/geometry3d/Range.d.ts +18 -10
  163. package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
  164. package/lib/cjs/geometry3d/Range.js +32 -10
  165. package/lib/cjs/geometry3d/Range.js.map +1 -1
  166. package/lib/cjs/geometry3d/Ray2d.d.ts.map +1 -1
  167. package/lib/cjs/geometry3d/Ray2d.js +0 -1
  168. package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
  169. package/lib/cjs/geometry3d/Ray3d.d.ts +7 -9
  170. package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
  171. package/lib/cjs/geometry3d/Ray3d.js +23 -45
  172. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  173. package/lib/cjs/geometry3d/ReusableObjectCache.d.ts +39 -29
  174. package/lib/cjs/geometry3d/ReusableObjectCache.d.ts.map +1 -1
  175. package/lib/cjs/geometry3d/ReusableObjectCache.js +49 -35
  176. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  177. package/lib/cjs/geometry3d/SortablePolygon.d.ts +1 -4
  178. package/lib/cjs/geometry3d/SortablePolygon.d.ts.map +1 -1
  179. package/lib/cjs/geometry3d/SortablePolygon.js +48 -43
  180. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  181. package/lib/cjs/geometry3d/Transform.d.ts +21 -2
  182. package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
  183. package/lib/cjs/geometry3d/Transform.js +32 -13
  184. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  185. package/lib/cjs/geometry4d/Point4d.d.ts +8 -5
  186. package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
  187. package/lib/cjs/geometry4d/Point4d.js +27 -16
  188. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  189. package/lib/cjs/numerics/BezierPolynomials.d.ts +2 -0
  190. package/lib/cjs/numerics/BezierPolynomials.d.ts.map +1 -1
  191. package/lib/cjs/numerics/BezierPolynomials.js +11 -0
  192. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  193. package/lib/cjs/numerics/SmallSystem.d.ts +77 -36
  194. package/lib/cjs/numerics/SmallSystem.d.ts.map +1 -1
  195. package/lib/cjs/numerics/SmallSystem.js +129 -73
  196. package/lib/cjs/numerics/SmallSystem.js.map +1 -1
  197. package/lib/cjs/polyface/FacetOrientation.d.ts +1 -1
  198. package/lib/cjs/polyface/FacetOrientation.js +1 -1
  199. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  200. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +55 -40
  201. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  202. package/lib/cjs/polyface/IndexedEdgeMatcher.js +83 -75
  203. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  204. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +15 -14
  205. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  206. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +47 -38
  207. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  208. package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts +26 -19
  209. package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
  210. package/lib/cjs/polyface/IndexedPolyfaceWalker.js +51 -32
  211. package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
  212. package/lib/cjs/polyface/Polyface.d.ts +19 -5
  213. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  214. package/lib/cjs/polyface/Polyface.js +18 -2
  215. package/lib/cjs/polyface/Polyface.js.map +1 -1
  216. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +1 -1
  217. package/lib/cjs/polyface/PolyfaceBuilder.js +6 -6
  218. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  219. package/lib/cjs/polyface/PolyfaceClip.d.ts +19 -18
  220. package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
  221. package/lib/cjs/polyface/PolyfaceClip.js +39 -42
  222. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  223. package/lib/cjs/polyface/PolyfaceData.d.ts +1 -1
  224. package/lib/cjs/polyface/PolyfaceData.js +1 -1
  225. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  226. package/lib/cjs/polyface/PolyfaceQuery.d.ts +119 -78
  227. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  228. package/lib/cjs/polyface/PolyfaceQuery.js +315 -231
  229. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  230. package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +3 -3
  231. package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
  232. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +3 -3
  233. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  234. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts +7 -6
  235. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  236. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +8 -9
  237. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  238. package/lib/cjs/serialization/BGFBReader.d.ts.map +1 -1
  239. package/lib/cjs/serialization/BGFBReader.js +2 -3
  240. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  241. package/lib/cjs/serialization/BGFBWriter.d.ts.map +1 -1
  242. package/lib/cjs/serialization/BGFBWriter.js +2 -4
  243. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  244. package/lib/cjs/serialization/GeometrySamples.d.ts +1 -1
  245. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  246. package/lib/cjs/serialization/GeometrySamples.js +3 -3
  247. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  248. package/lib/cjs/serialization/IModelJsonSchema.d.ts +3 -3
  249. package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
  250. package/lib/cjs/serialization/IModelJsonSchema.js +5 -5
  251. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  252. package/lib/cjs/solid/Box.d.ts.map +1 -1
  253. package/lib/cjs/solid/Box.js +7 -0
  254. package/lib/cjs/solid/Box.js.map +1 -1
  255. package/lib/cjs/solid/Cone.d.ts.map +1 -1
  256. package/lib/cjs/solid/Cone.js +6 -0
  257. package/lib/cjs/solid/Cone.js.map +1 -1
  258. package/lib/cjs/solid/LinearSweep.d.ts +2 -3
  259. package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
  260. package/lib/cjs/solid/LinearSweep.js +11 -7
  261. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  262. package/lib/cjs/solid/RotationalSweep.d.ts +2 -2
  263. package/lib/cjs/solid/RotationalSweep.js +2 -2
  264. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  265. package/lib/cjs/solid/RuledSweep.d.ts +1 -1
  266. package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
  267. package/lib/cjs/solid/RuledSweep.js +5 -1
  268. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  269. package/lib/cjs/solid/Sphere.d.ts.map +1 -1
  270. package/lib/cjs/solid/Sphere.js +6 -3
  271. package/lib/cjs/solid/Sphere.js.map +1 -1
  272. package/lib/cjs/solid/SweepContour.d.ts +1 -1
  273. package/lib/cjs/solid/SweepContour.js +1 -1
  274. package/lib/cjs/solid/SweepContour.js.map +1 -1
  275. package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
  276. package/lib/cjs/solid/TorusPipe.js +4 -0
  277. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  278. package/lib/cjs/topology/ChainMerge.d.ts +1 -1
  279. package/lib/cjs/topology/ChainMerge.js +1 -1
  280. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  281. package/lib/cjs/topology/Graph.d.ts +64 -14
  282. package/lib/cjs/topology/Graph.d.ts.map +1 -1
  283. package/lib/cjs/topology/Graph.js +149 -32
  284. package/lib/cjs/topology/Graph.js.map +1 -1
  285. package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts +3 -2
  286. package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
  287. package/lib/cjs/topology/HalfEdgeGraphSearch.js +3 -2
  288. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  289. package/lib/cjs/topology/Merging.d.ts +0 -1
  290. package/lib/cjs/topology/Merging.d.ts.map +1 -1
  291. package/lib/cjs/topology/Merging.js +49 -46
  292. package/lib/cjs/topology/Merging.js.map +1 -1
  293. package/lib/cjs/topology/RegularizeFace.d.ts.map +1 -1
  294. package/lib/cjs/topology/RegularizeFace.js +2 -1
  295. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  296. package/lib/cjs/topology/Triangulation.d.ts +9 -14
  297. package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
  298. package/lib/cjs/topology/Triangulation.js +29 -22
  299. package/lib/cjs/topology/Triangulation.js.map +1 -1
  300. package/lib/esm/Geometry.d.ts +18 -10
  301. package/lib/esm/Geometry.d.ts.map +1 -1
  302. package/lib/esm/Geometry.js +13 -3
  303. package/lib/esm/Geometry.js.map +1 -1
  304. package/lib/esm/bspline/BSpline1dNd.d.ts +1 -1
  305. package/lib/esm/bspline/BSpline1dNd.js +1 -1
  306. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  307. package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
  308. package/lib/esm/bspline/BSplineCurve.js +7 -1
  309. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  310. package/lib/esm/bspline/BSplineSurface.d.ts +4 -3
  311. package/lib/esm/bspline/BSplineSurface.d.ts.map +1 -1
  312. package/lib/esm/bspline/BSplineSurface.js +4 -5
  313. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  314. package/lib/esm/clipping/ClipPlane.d.ts +7 -5
  315. package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
  316. package/lib/esm/clipping/ClipPlane.js +9 -5
  317. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  318. package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
  319. package/lib/esm/clipping/ClipUtils.js +5 -3
  320. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  321. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +1 -2
  322. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  323. package/lib/esm/clipping/ConvexClipPlaneSet.js +13 -25
  324. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  325. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +1 -2
  326. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  327. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +1 -2
  328. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  329. package/lib/esm/core-geometry.d.ts +2 -0
  330. package/lib/esm/core-geometry.d.ts.map +1 -1
  331. package/lib/esm/core-geometry.js +2 -0
  332. package/lib/esm/core-geometry.js.map +1 -1
  333. package/lib/esm/curve/Arc3d.d.ts +54 -32
  334. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  335. package/lib/esm/curve/Arc3d.js +56 -37
  336. package/lib/esm/curve/Arc3d.js.map +1 -1
  337. package/lib/esm/curve/CurveCollection.d.ts +40 -1
  338. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  339. package/lib/esm/curve/CurveCollection.js +90 -0
  340. package/lib/esm/curve/CurveCollection.js.map +1 -1
  341. package/lib/esm/curve/CurveFactory.d.ts +3 -2
  342. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  343. package/lib/esm/curve/CurveFactory.js +6 -5
  344. package/lib/esm/curve/CurveFactory.js.map +1 -1
  345. package/lib/esm/curve/CurveLocationDetail.d.ts +27 -25
  346. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  347. package/lib/esm/curve/CurveLocationDetail.js +30 -25
  348. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  349. package/lib/esm/curve/CurvePrimitive.d.ts +9 -2
  350. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  351. package/lib/esm/curve/CurvePrimitive.js +11 -0
  352. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  353. package/lib/esm/curve/CurveTypes.d.ts +1 -1
  354. package/lib/esm/curve/CurveTypes.js.map +1 -1
  355. package/lib/esm/curve/LineSegment3d.d.ts +2 -0
  356. package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
  357. package/lib/esm/curve/LineSegment3d.js +4 -0
  358. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  359. package/lib/esm/curve/LineString3d.d.ts +7 -0
  360. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  361. package/lib/esm/curve/LineString3d.js +15 -3
  362. package/lib/esm/curve/LineString3d.js.map +1 -1
  363. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
  364. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +37 -8
  365. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  366. package/lib/esm/curve/Query/PlanarSubdivision.d.ts +34 -8
  367. package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  368. package/lib/esm/curve/Query/PlanarSubdivision.js +131 -35
  369. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  370. package/lib/esm/curve/Query/StrokeCountChain.d.ts +4 -3
  371. package/lib/esm/curve/Query/StrokeCountChain.d.ts.map +1 -1
  372. package/lib/esm/curve/Query/StrokeCountChain.js +20 -9
  373. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  374. package/lib/esm/curve/RegionMomentsXY.d.ts +2 -1
  375. package/lib/esm/curve/RegionMomentsXY.d.ts.map +1 -1
  376. package/lib/esm/curve/RegionMomentsXY.js +26 -41
  377. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  378. package/lib/esm/curve/RegionOps.d.ts +74 -39
  379. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  380. package/lib/esm/curve/RegionOps.js +146 -46
  381. package/lib/esm/curve/RegionOps.js.map +1 -1
  382. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +36 -27
  383. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  384. package/lib/esm/curve/RegionOpsClassificationSweeps.js +161 -56
  385. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  386. package/lib/esm/curve/StrokeOptions.d.ts +1 -1
  387. package/lib/esm/curve/StrokeOptions.js +1 -1
  388. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  389. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  390. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +2 -2
  391. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +6 -6
  392. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  393. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +0 -1
  394. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  395. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +58 -32
  396. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  397. package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
  398. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +0 -1
  399. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  400. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.d.ts +14 -0
  401. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.d.ts.map +1 -0
  402. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js +30 -0
  403. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -0
  404. package/lib/esm/geometry3d/AngleSweep.d.ts +25 -18
  405. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  406. package/lib/esm/geometry3d/AngleSweep.js +32 -18
  407. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  408. package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts +8 -7
  409. package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
  410. package/lib/esm/geometry3d/CoincidentGeometryOps.js +19 -25
  411. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  412. package/lib/esm/geometry3d/Ellipsoid.js +1 -1
  413. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  414. package/lib/esm/geometry3d/GrowableXYArray.d.ts +1 -1
  415. package/lib/esm/geometry3d/GrowableXYArray.js +1 -1
  416. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  417. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +8 -3
  418. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  419. package/lib/esm/geometry3d/GrowableXYZArray.js +21 -3
  420. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  421. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +11 -1
  422. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  423. package/lib/esm/geometry3d/IndexedXYZCollection.js +21 -3
  424. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  425. package/lib/esm/geometry3d/Plane3d.d.ts +2 -0
  426. package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -1
  427. package/lib/esm/geometry3d/Plane3d.js +6 -1
  428. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  429. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +2 -0
  430. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
  431. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +6 -1
  432. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  433. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts +8 -2
  434. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  435. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +18 -10
  436. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  437. package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
  438. package/lib/esm/geometry3d/Point2dVector2d.js +0 -2
  439. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  440. package/lib/esm/geometry3d/Point3dVector3d.d.ts +4 -4
  441. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  442. package/lib/esm/geometry3d/Point3dVector3d.js +4 -5
  443. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  444. package/lib/esm/geometry3d/PointHelpers.d.ts +7 -7
  445. package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
  446. package/lib/esm/geometry3d/PointHelpers.js +66 -26
  447. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  448. package/lib/esm/geometry3d/PolygonOps.d.ts +49 -2
  449. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  450. package/lib/esm/geometry3d/PolygonOps.js +38 -2
  451. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  452. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts +13 -6
  453. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
  454. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +16 -9
  455. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  456. package/lib/esm/geometry3d/PolylineOps.d.ts +5 -4
  457. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  458. package/lib/esm/geometry3d/PolylineOps.js +5 -4
  459. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  460. package/lib/esm/geometry3d/Range.d.ts +18 -10
  461. package/lib/esm/geometry3d/Range.d.ts.map +1 -1
  462. package/lib/esm/geometry3d/Range.js +32 -10
  463. package/lib/esm/geometry3d/Range.js.map +1 -1
  464. package/lib/esm/geometry3d/Ray2d.d.ts.map +1 -1
  465. package/lib/esm/geometry3d/Ray2d.js +0 -1
  466. package/lib/esm/geometry3d/Ray2d.js.map +1 -1
  467. package/lib/esm/geometry3d/Ray3d.d.ts +7 -9
  468. package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
  469. package/lib/esm/geometry3d/Ray3d.js +23 -45
  470. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  471. package/lib/esm/geometry3d/ReusableObjectCache.d.ts +39 -29
  472. package/lib/esm/geometry3d/ReusableObjectCache.d.ts.map +1 -1
  473. package/lib/esm/geometry3d/ReusableObjectCache.js +47 -33
  474. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  475. package/lib/esm/geometry3d/SortablePolygon.d.ts +1 -4
  476. package/lib/esm/geometry3d/SortablePolygon.d.ts.map +1 -1
  477. package/lib/esm/geometry3d/SortablePolygon.js +48 -43
  478. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  479. package/lib/esm/geometry3d/Transform.d.ts +21 -2
  480. package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
  481. package/lib/esm/geometry3d/Transform.js +32 -13
  482. package/lib/esm/geometry3d/Transform.js.map +1 -1
  483. package/lib/esm/geometry4d/Point4d.d.ts +8 -5
  484. package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
  485. package/lib/esm/geometry4d/Point4d.js +27 -16
  486. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  487. package/lib/esm/numerics/BezierPolynomials.d.ts +2 -0
  488. package/lib/esm/numerics/BezierPolynomials.d.ts.map +1 -1
  489. package/lib/esm/numerics/BezierPolynomials.js +11 -0
  490. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  491. package/lib/esm/numerics/SmallSystem.d.ts +77 -36
  492. package/lib/esm/numerics/SmallSystem.d.ts.map +1 -1
  493. package/lib/esm/numerics/SmallSystem.js +129 -73
  494. package/lib/esm/numerics/SmallSystem.js.map +1 -1
  495. package/lib/esm/polyface/FacetOrientation.d.ts +1 -1
  496. package/lib/esm/polyface/FacetOrientation.js +1 -1
  497. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  498. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +55 -40
  499. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  500. package/lib/esm/polyface/IndexedEdgeMatcher.js +83 -75
  501. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  502. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +15 -14
  503. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  504. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +47 -38
  505. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  506. package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts +26 -19
  507. package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
  508. package/lib/esm/polyface/IndexedPolyfaceWalker.js +51 -32
  509. package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
  510. package/lib/esm/polyface/Polyface.d.ts +19 -5
  511. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  512. package/lib/esm/polyface/Polyface.js +18 -2
  513. package/lib/esm/polyface/Polyface.js.map +1 -1
  514. package/lib/esm/polyface/PolyfaceBuilder.d.ts +1 -1
  515. package/lib/esm/polyface/PolyfaceBuilder.js +6 -6
  516. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  517. package/lib/esm/polyface/PolyfaceClip.d.ts +19 -18
  518. package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
  519. package/lib/esm/polyface/PolyfaceClip.js +39 -42
  520. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  521. package/lib/esm/polyface/PolyfaceData.d.ts +1 -1
  522. package/lib/esm/polyface/PolyfaceData.js +1 -1
  523. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  524. package/lib/esm/polyface/PolyfaceQuery.d.ts +119 -78
  525. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  526. package/lib/esm/polyface/PolyfaceQuery.js +316 -232
  527. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  528. package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +3 -3
  529. package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
  530. package/lib/esm/polyface/RangeTree/RangeTreeNode.js +3 -3
  531. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  532. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts +7 -6
  533. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  534. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +8 -9
  535. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  536. package/lib/esm/serialization/BGFBReader.d.ts.map +1 -1
  537. package/lib/esm/serialization/BGFBReader.js +2 -3
  538. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  539. package/lib/esm/serialization/BGFBWriter.d.ts.map +1 -1
  540. package/lib/esm/serialization/BGFBWriter.js +2 -4
  541. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  542. package/lib/esm/serialization/GeometrySamples.d.ts +1 -1
  543. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  544. package/lib/esm/serialization/GeometrySamples.js +3 -3
  545. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  546. package/lib/esm/serialization/IModelJsonSchema.d.ts +3 -3
  547. package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
  548. package/lib/esm/serialization/IModelJsonSchema.js +5 -5
  549. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  550. package/lib/esm/solid/Box.d.ts.map +1 -1
  551. package/lib/esm/solid/Box.js +7 -0
  552. package/lib/esm/solid/Box.js.map +1 -1
  553. package/lib/esm/solid/Cone.d.ts.map +1 -1
  554. package/lib/esm/solid/Cone.js +6 -0
  555. package/lib/esm/solid/Cone.js.map +1 -1
  556. package/lib/esm/solid/LinearSweep.d.ts +2 -3
  557. package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
  558. package/lib/esm/solid/LinearSweep.js +11 -7
  559. package/lib/esm/solid/LinearSweep.js.map +1 -1
  560. package/lib/esm/solid/RotationalSweep.d.ts +2 -2
  561. package/lib/esm/solid/RotationalSweep.js +2 -2
  562. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  563. package/lib/esm/solid/RuledSweep.d.ts +1 -1
  564. package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
  565. package/lib/esm/solid/RuledSweep.js +5 -1
  566. package/lib/esm/solid/RuledSweep.js.map +1 -1
  567. package/lib/esm/solid/Sphere.d.ts.map +1 -1
  568. package/lib/esm/solid/Sphere.js +6 -3
  569. package/lib/esm/solid/Sphere.js.map +1 -1
  570. package/lib/esm/solid/SweepContour.d.ts +1 -1
  571. package/lib/esm/solid/SweepContour.js +1 -1
  572. package/lib/esm/solid/SweepContour.js.map +1 -1
  573. package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
  574. package/lib/esm/solid/TorusPipe.js +4 -0
  575. package/lib/esm/solid/TorusPipe.js.map +1 -1
  576. package/lib/esm/topology/ChainMerge.d.ts +1 -1
  577. package/lib/esm/topology/ChainMerge.js +1 -1
  578. package/lib/esm/topology/ChainMerge.js.map +1 -1
  579. package/lib/esm/topology/Graph.d.ts +64 -14
  580. package/lib/esm/topology/Graph.d.ts.map +1 -1
  581. package/lib/esm/topology/Graph.js +149 -32
  582. package/lib/esm/topology/Graph.js.map +1 -1
  583. package/lib/esm/topology/HalfEdgeGraphSearch.d.ts +3 -2
  584. package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
  585. package/lib/esm/topology/HalfEdgeGraphSearch.js +3 -2
  586. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  587. package/lib/esm/topology/Merging.d.ts +0 -1
  588. package/lib/esm/topology/Merging.d.ts.map +1 -1
  589. package/lib/esm/topology/Merging.js +49 -46
  590. package/lib/esm/topology/Merging.js.map +1 -1
  591. package/lib/esm/topology/RegularizeFace.d.ts.map +1 -1
  592. package/lib/esm/topology/RegularizeFace.js +2 -1
  593. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  594. package/lib/esm/topology/Triangulation.d.ts +9 -14
  595. package/lib/esm/topology/Triangulation.d.ts.map +1 -1
  596. package/lib/esm/topology/Triangulation.js +29 -22
  597. package/lib/esm/topology/Triangulation.js.map +1 -1
  598. package/package.json +7 -6
@@ -2,60 +2,76 @@
2
2
  * @module Polyface
3
3
  */
4
4
  /**
5
- * * For boundary sorting, an edge is a (packed!) Float64Array.
6
- * * Fixed entry positions are:
7
- * * [0] is start vertex index (in CCW order around its facet)
8
- * * [1] is end vertex index (in CCW order around its facet)
9
- * * [2] is facet index (or another number to associate with this edge).
5
+ * Represent an [[IndexedPolyface]] edge as:
6
+ * * vertex start index and vertex end index (CCW order around its facet)
7
+ * * an additional number to associate with the edge (e.g., facet index)
8
+ * @public
10
9
  */
11
- export declare class SortableEdge extends Float64Array {
10
+ export declare class SortableEdge {
11
+ private _v;
12
+ private _a;
13
+ /** Constructor. */
14
+ constructor(startVertex: number, endVertex: number, facetIndex: number);
15
+ /** Clone the edge. */
16
+ clone(): SortableEdge;
12
17
  /** Return the vertex index that appears first in the order stored. */
13
- get vertexIndexA(): number;
18
+ get startVertex(): number;
14
19
  /** Return the vertex index that appears second in the order stored. */
15
- get vertexIndexB(): number;
20
+ get endVertex(): number;
16
21
  /**
17
22
  * Return the facet index.
18
23
  * * This value is carried along during matching. Typically it is a facet index, but it does not have to be.
19
24
  */
20
25
  get facetIndex(): number;
21
- /** return true if vertexIndexA is less than vertexIndexB. */
26
+ /** return true if `startVertex` is less than `endVertex`. */
22
27
  get isLowHigh(): boolean;
23
28
  /** Return the vertex index with lower numeric value. */
24
- get lowVertexIndex(): number;
29
+ get lowVertex(): number;
25
30
  /** Return the vertex index with higher numeric value. */
26
- get highVertexIndex(): number;
27
- /** Return true if the vertices edgeA and edgeB are the same vertex indices in opposite order. */
31
+ get highVertex(): number;
32
+ /** Return true if edgeA and edgeB traverse the same edge in the same direction. */
33
+ private static areSameEdge;
34
+ /** Return true if edgeA and edgeB traverse the same edge in opposite directions. */
28
35
  static areDirectedPartners(edgeA: SortableEdge, edgeB: SortableEdge): boolean;
29
- /** Return true if the vertices edgeA and edgeB are the same vertex indices with no consideration of order. */
36
+ /** Return true if edgeA and edgeB traverse the same edge in the same or opposite directions. */
30
37
  static areUndirectedPartners(edgeA: SortableEdge, edgeB: SortableEdge): boolean;
31
38
  /**
32
- * Return numeric relationship of edgeA and edgeB:
33
- * * 1 if they share start and end in the same order.
34
- * * -1 if they share start and end in reversed order.
39
+ * Return numeric identifier for the relationship between edgeA and edgeB:
40
+ * * 1 if they share start and end vertex indices in the same order.
41
+ * * -1 if they share start and end vertex indices in reversed order.
35
42
  * * 0 otherwise.
36
43
  */
37
44
  static relativeOrientation(edgeA: SortableEdge, edgeB: SortableEdge): number;
45
+ /** Whether the start and end vertex indices are equal. */
38
46
  get isNullEdge(): boolean;
39
47
  /**
40
48
  * Lexical comparison of two edges.
41
- * * If the edges have the same vertex pair (in same or opposite order) they will end up adjacent in a sort.
42
- * * If the edges have 0 or 1 shared vertex indices, the one with lowest low comes first.
49
+ * * If the edges have the same vertex index pair (in same or opposite order) they will end up adjacent in a sort.
43
50
  * @param edgeA first edge
44
51
  * @param edgeB second edge
45
52
  */
46
53
  static lessThan(edgeA: SortableEdge, edgeB: SortableEdge): number;
47
- constructor(vertexA: number, vertexB: number, facetIndex: number);
54
+ /** Return the edge data as a JSON array. */
48
55
  toJSON(): any;
56
+ /** Return the edge cluster in JSON format. */
49
57
  static clusterToJSON(data: SortableEdgeCluster): any;
58
+ /** Return the edge cluster array in JSON format. */
50
59
  static clusterArrayToJSON(data: SortableEdgeCluster[]): any[];
51
60
  }
61
+ /**
62
+ * Union type for a single [[SortableEdge]] or a (matched) array of them.
63
+ * @public
64
+ */
52
65
  export type SortableEdgeCluster = SortableEdge | SortableEdge[];
53
66
  /**
54
- * An IndexedEdgeMatcher carries an array of edge start & end indices for sorting and subsequent analyses
55
- * (such as testing for closed mesh).
67
+ * An IndexedEdgeMatcher carries an array of edge start and end indices for sorting and subsequent analyses,
68
+ * such as testing for closed mesh.
69
+ * @public
56
70
  */
57
71
  export declare class IndexedEdgeMatcher {
72
+ /** The array of edges to be sorted. */
58
73
  edges: SortableEdge[];
74
+ /** Constructor. Call [[addEdge]] or [[addPath]] to populate `edges`. */
59
75
  constructor();
60
76
  /**
61
77
  * Push a new edge.
@@ -66,32 +82,31 @@ export declare class IndexedEdgeMatcher {
66
82
  */
67
83
  addEdge(vertexA: number, vertexB: number, facetIndex: number): SortableEdge;
68
84
  /**
69
- * Push edges all around a facet, returning to vertexArray[0].
70
- * @param vertexArray array of vertex indices around facet
71
- * @param facetIndex value to carry along during matching
85
+ * Push edges along a path.
86
+ * * Typically used to add edges around a facet.
87
+ * @param vertexIndices array of vertex indices along an open or closed path.
88
+ * @param facetIndex value to set on each edge pushed.
72
89
  * @param closeLoop true to add an edge from last to first vertex.
73
90
  */
74
- addPath(vertexArray: number[], facetIndex: number, closeLoop?: boolean): void;
75
- /** Sort the edge index array. */
91
+ addPath(vertexIndices: number[], facetIndex: number, closeLoop: boolean): void;
92
+ /** Sort the edges. */
76
93
  sort(): void;
77
94
  /** Create a single or compound SortableEdgeCluster in dest. */
78
95
  private collectSortableEdgeCluster;
79
96
  /**
80
- * Sort the edges, and look for three categories of paired edges:
81
- * * caller must allocate all result arrays of interest.
82
- * * Any combination of the result arrays may be `undefined`, indicating that category is to be ignored.
83
- * * Any combination of the result arrays may be aliased as the same target, in which case those to categories are
97
+ * Sort the edges, and collect up to four categories of edges: manifold pairs, singletons, null edges,
98
+ * and everything else.
99
+ * * Caller should allocate arrays of interest.
100
+ * * Any combination of the arrays may be `undefined`, indicating that category is to be ignored.
101
+ * * Any combination of the arrays may be aliased as the same target, in which case the aliased categories are
84
102
  * merged into the target.
85
- * * For instance, to ignore manifold pairs and collect all others (singleton, null, and other) as a single array
86
- * `allOther`, create `const allOther = []` as an empty array and call
87
- * `sortAndCollectClusters (undefined, allOther, allOther, allOther);`
88
- * @param manifoldPairs optional array to receive pairs of properly mated SortableEdgePairs, i.e. simple interior
89
- * edges adjacent to two facets in opposing directions.
90
- * @param singletons optional array to receive edges that are simple boundary edges.
91
- * @param nullEdges optional array to receive arrays of null edges (same start and end vertex)
92
- * @param allOtherClusters optional array to receive arrays in which all the edges are partners in an undirected sense
93
- * but not a simple directed pair.
103
+ * * For instance, to ignore manifold pairs and collect all other edges in a single array:
104
+ * `const foo = []; matcher.sortAndCollectClusters(undefined, foo, foo, foo);`
105
+ * @param manifoldPairs array to receive pairs of properly mated edges, i.e. mesh interior edges.
106
+ * @param singletons array to receive edges that have no partner, i.e., mesh boundary edges.
107
+ * @param nullEdges array to receive arrays of matched null edges, for which start === end vertex index.
108
+ * @param allOtherClusters array to receive arrays of edges that are partners in an undirected, non-manifold sense.
94
109
  */
95
- sortAndCollectClusters(manifoldPairs: SortableEdgeCluster[] | undefined, singletons?: SortableEdgeCluster[], nullEdges?: SortableEdgeCluster[], allOtherClusters?: SortableEdgeCluster[]): void;
110
+ sortAndCollectClusters(manifoldPairs?: SortableEdgeCluster[], singletons?: SortableEdgeCluster[], nullEdges?: SortableEdgeCluster[], allOtherClusters?: SortableEdgeCluster[]): void;
96
111
  }
97
112
  //# sourceMappingURL=IndexedEdgeMatcher.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IndexedEdgeMatcher.d.ts","sourceRoot":"","sources":["../../../src/polyface/IndexedEdgeMatcher.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;;;;;GAMG;AACH,qBAAa,YAAa,SAAQ,YAAY;IAC5C,uEAAuE;IACvE,IAAW,YAAY,IAAI,MAAM,CAEhC;IACD,wEAAwE;IACxE,IAAW,YAAY,IAAI,MAAM,CAEhC;IACD;;;OAGG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;IACD,6DAA6D;IAC7D,IAAW,SAAS,IAAI,OAAO,CAE9B;IACD,w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AA4C;IACrC,MAAM,IAAI,GAAG;IAGpB,+CAA+C;WACjC,aAAa,CAAC,IAAI,EAAE,mBAAmB,GAAG,GAAG;IAO3D,oDAAoD;WACtC,kBAAkB,CAAC,IAAI,EAAE,mBAAmB,EAAE;CAM7D;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,YAAY,EAAE,CAAC;AAEhE;;;;GAIG;AACH,qBAAa,kBAAkB;IAC7B,uCAAuC;IAChC,KAAK,EAAE,YAAY,EAAE,CAAC;IAC7B,wEAAwE;;IAIxE;;;;;;OAMG;IACI,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,YAAY;IAKlF;;;;;;OAMG;IACI,OAAO,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO;IAS9E,sBAAsB;IACf,IAAI;IAGX,+DAA+D;IAC/D,OAAO,CAAC,0BAA0B;IAYlC;;;;;;;;;;;;;OAaG;IACI,sBAAsB,CAC3B,aAAa,CAAC,EAAE,mBAAmB,EAAE,EACrC,UAAU,CAAC,EAAE,mBAAmB,EAAE,EAClC,SAAS,CAAC,EAAE,mBAAmB,EAAE,EACjC,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,GACvC,IAAI;CA6BR"}
@@ -6,97 +6,107 @@
6
6
  * @module Polyface
7
7
  */
8
8
  /**
9
- * * For boundary sorting, an edge is a (packed!) Float64Array.
10
- * * Fixed entry positions are:
11
- * * [0] is start vertex index (in CCW order around its facet)
12
- * * [1] is end vertex index (in CCW order around its facet)
13
- * * [2] is facet index (or another number to associate with this edge).
9
+ * Represent an [[IndexedPolyface]] edge as:
10
+ * * vertex start index and vertex end index (CCW order around its facet)
11
+ * * an additional number to associate with the edge (e.g., facet index)
12
+ * @public
14
13
  */
15
- export class SortableEdge extends Float64Array {
14
+ export class SortableEdge {
15
+ _v;
16
+ _a;
17
+ /** Constructor. */
18
+ constructor(startVertex, endVertex, facetIndex) {
19
+ this._v = [startVertex, endVertex];
20
+ this._a = facetIndex;
21
+ }
22
+ /** Clone the edge. */
23
+ clone() {
24
+ return new SortableEdge(this._v[0], this._v[1], this._a);
25
+ }
16
26
  /** Return the vertex index that appears first in the order stored. */
17
- get vertexIndexA() {
18
- return this[0];
27
+ get startVertex() {
28
+ return this._v[0];
19
29
  }
20
30
  /** Return the vertex index that appears second in the order stored. */
21
- get vertexIndexB() {
22
- return this[1];
31
+ get endVertex() {
32
+ return this._v[1];
23
33
  }
24
34
  /**
25
35
  * Return the facet index.
26
36
  * * This value is carried along during matching. Typically it is a facet index, but it does not have to be.
27
37
  */
28
38
  get facetIndex() {
29
- return this[2];
39
+ return this._a;
30
40
  }
31
- /** return true if vertexIndexA is less than vertexIndexB. */
41
+ /** return true if `startVertex` is less than `endVertex`. */
32
42
  get isLowHigh() {
33
- return this[0] < this[1];
43
+ return this._v[0] < this._v[1];
34
44
  }
35
45
  /** Return the vertex index with lower numeric value. */
36
- get lowVertexIndex() {
37
- return this[0] < this[1] ? this[0] : this[1];
46
+ get lowVertex() {
47
+ return this.isLowHigh ? this._v[0] : this._v[1];
38
48
  }
39
49
  /** Return the vertex index with higher numeric value. */
40
- get highVertexIndex() {
41
- return this[0] > this[1] ? this[0] : this[1];
50
+ get highVertex() {
51
+ return this.isLowHigh ? this._v[1] : this._v[0];
52
+ }
53
+ /** Return true if edgeA and edgeB traverse the same edge in the same direction. */
54
+ static areSameEdge(edgeA, edgeB) {
55
+ return edgeA._v[0] === edgeB._v[0] && edgeA._v[1] === edgeB._v[1];
42
56
  }
43
- /** Return true if the vertices edgeA and edgeB are the same vertex indices in opposite order. */
57
+ /** Return true if edgeA and edgeB traverse the same edge in opposite directions. */
44
58
  static areDirectedPartners(edgeA, edgeB) {
45
- return edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0];
59
+ return edgeA._v[0] === edgeB._v[1] && edgeA._v[1] === edgeB._v[0];
46
60
  }
47
- /** Return true if the vertices edgeA and edgeB are the same vertex indices with no consideration of order. */
61
+ /** Return true if edgeA and edgeB traverse the same edge in the same or opposite directions. */
48
62
  static areUndirectedPartners(edgeA, edgeB) {
49
- return (edgeA[0] === edgeB[0] && edgeA[1] === edgeB[1]) || ((edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0]));
63
+ return this.areSameEdge(edgeA, edgeB) || this.areDirectedPartners(edgeA, edgeB);
50
64
  }
51
65
  /**
52
- * Return numeric relationship of edgeA and edgeB:
53
- * * 1 if they share start and end in the same order.
54
- * * -1 if they share start and end in reversed order.
66
+ * Return numeric identifier for the relationship between edgeA and edgeB:
67
+ * * 1 if they share start and end vertex indices in the same order.
68
+ * * -1 if they share start and end vertex indices in reversed order.
55
69
  * * 0 otherwise.
56
70
  */
57
71
  static relativeOrientation(edgeA, edgeB) {
58
- if (edgeA[0] === edgeB[0] && edgeA[1] === edgeB[1])
72
+ if (this.areSameEdge(edgeA, edgeB))
59
73
  return 1;
60
- if (edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0])
74
+ if (this.areDirectedPartners(edgeA, edgeB))
61
75
  return -1;
62
76
  return 0;
63
77
  }
78
+ /** Whether the start and end vertex indices are equal. */
64
79
  get isNullEdge() {
65
- return this[0] === this[1];
80
+ return this._v[0] === this._v[1];
66
81
  }
67
82
  /**
68
83
  * Lexical comparison of two edges.
69
- * * If the edges have the same vertex pair (in same or opposite order) they will end up adjacent in a sort.
70
- * * If the edges have 0 or 1 shared vertex indices, the one with lowest low comes first.
84
+ * * If the edges have the same vertex index pair (in same or opposite order) they will end up adjacent in a sort.
71
85
  * @param edgeA first edge
72
86
  * @param edgeB second edge
73
87
  */
74
88
  static lessThan(edgeA, edgeB) {
75
89
  // primary compare is based on indirect indices
76
- const lowA = edgeA.lowVertexIndex;
77
- const lowB = edgeB.lowVertexIndex;
90
+ const lowA = edgeA.lowVertex;
91
+ const lowB = edgeB.lowVertex;
78
92
  if (lowA < lowB)
79
93
  return -1;
80
94
  if (lowB < lowA)
81
95
  return 1;
82
- const highA = edgeA.highVertexIndex;
83
- const highB = edgeB.highVertexIndex;
96
+ const highA = edgeA.highVertex;
97
+ const highB = edgeB.highVertex;
84
98
  if (highA < highB)
85
99
  return -1;
86
100
  if (highB < highA)
87
101
  return 1;
88
102
  // undirected indices match ... use directed vertexIndexA
89
- return edgeA.vertexIndexA - edgeB.vertexIndexA;
90
- }
91
- constructor(vertexA, vertexB, facetIndex) {
92
- super(3);
93
- this[0] = vertexA;
94
- this[1] = vertexB;
95
- this[2] = facetIndex;
103
+ return edgeA.startVertex - edgeB.startVertex;
96
104
  }
105
+ /** Return the edge data as a JSON array. */
97
106
  toJSON() {
98
- return [this[0], this[1], this[2]];
107
+ return [this._v[0], this._v[1], this._a];
99
108
  }
109
+ /** Return the edge cluster in JSON format. */
100
110
  static clusterToJSON(data) {
101
111
  if (data instanceof SortableEdge)
102
112
  return data.toJSON();
@@ -104,6 +114,7 @@ export class SortableEdge extends Float64Array {
104
114
  for (const edge of data)
105
115
  result.push(edge.toJSON());
106
116
  }
117
+ /** Return the edge cluster array in JSON format. */
107
118
  static clusterArrayToJSON(data) {
108
119
  const result = [];
109
120
  for (const cluster of data)
@@ -112,11 +123,14 @@ export class SortableEdge extends Float64Array {
112
123
  }
113
124
  }
114
125
  /**
115
- * An IndexedEdgeMatcher carries an array of edge start & end indices for sorting and subsequent analyses
116
- * (such as testing for closed mesh).
126
+ * An IndexedEdgeMatcher carries an array of edge start and end indices for sorting and subsequent analyses,
127
+ * such as testing for closed mesh.
128
+ * @public
117
129
  */
118
130
  export class IndexedEdgeMatcher {
131
+ /** The array of edges to be sorted. */
119
132
  edges;
133
+ /** Constructor. Call [[addEdge]] or [[addPath]] to populate `edges`. */
120
134
  constructor() {
121
135
  this.edges = [];
122
136
  }
@@ -133,22 +147,22 @@ export class IndexedEdgeMatcher {
133
147
  return edge;
134
148
  }
135
149
  /**
136
- * Push edges all around a facet, returning to vertexArray[0].
137
- * @param vertexArray array of vertex indices around facet
138
- * @param facetIndex value to carry along during matching
150
+ * Push edges along a path.
151
+ * * Typically used to add edges around a facet.
152
+ * @param vertexIndices array of vertex indices along an open or closed path.
153
+ * @param facetIndex value to set on each edge pushed.
139
154
  * @param closeLoop true to add an edge from last to first vertex.
140
155
  */
141
- addPath(vertexArray, facetIndex, closeLoop = true) {
142
- if (vertexArray.length === 0)
156
+ addPath(vertexIndices, facetIndex, closeLoop) {
157
+ if (vertexIndices.length === 0)
143
158
  return;
144
- const m = vertexArray.length - 1;
145
- for (let i = 0; i < m; i++) {
146
- this.addEdge(vertexArray[i], vertexArray[i + 1], facetIndex);
147
- }
159
+ const m = vertexIndices.length - 1;
160
+ for (let i = 0; i < m; i++)
161
+ this.addEdge(vertexIndices[i], vertexIndices[i + 1], facetIndex);
148
162
  if (closeLoop)
149
- this.addEdge(vertexArray[m], vertexArray[0], facetIndex);
163
+ this.addEdge(vertexIndices[m], vertexIndices[0], facetIndex);
150
164
  }
151
- /** Sort the edge index array. */
165
+ /** Sort the edges. */
152
166
  sort() {
153
167
  this.edges.sort((edgeA, edgeB) => SortableEdge.lessThan(edgeA, edgeB));
154
168
  }
@@ -167,20 +181,18 @@ export class IndexedEdgeMatcher {
167
181
  }
168
182
  }
169
183
  /**
170
- * Sort the edges, and look for three categories of paired edges:
171
- * * caller must allocate all result arrays of interest.
172
- * * Any combination of the result arrays may be `undefined`, indicating that category is to be ignored.
173
- * * Any combination of the result arrays may be aliased as the same target, in which case those to categories are
184
+ * Sort the edges, and collect up to four categories of edges: manifold pairs, singletons, null edges,
185
+ * and everything else.
186
+ * * Caller should allocate arrays of interest.
187
+ * * Any combination of the arrays may be `undefined`, indicating that category is to be ignored.
188
+ * * Any combination of the arrays may be aliased as the same target, in which case the aliased categories are
174
189
  * merged into the target.
175
- * * For instance, to ignore manifold pairs and collect all others (singleton, null, and other) as a single array
176
- * `allOther`, create `const allOther = []` as an empty array and call
177
- * `sortAndCollectClusters (undefined, allOther, allOther, allOther);`
178
- * @param manifoldPairs optional array to receive pairs of properly mated SortableEdgePairs, i.e. simple interior
179
- * edges adjacent to two facets in opposing directions.
180
- * @param singletons optional array to receive edges that are simple boundary edges.
181
- * @param nullEdges optional array to receive arrays of null edges (same start and end vertex)
182
- * @param allOtherClusters optional array to receive arrays in which all the edges are partners in an undirected sense
183
- * but not a simple directed pair.
190
+ * * For instance, to ignore manifold pairs and collect all other edges in a single array:
191
+ * `const foo = []; matcher.sortAndCollectClusters(undefined, foo, foo, foo);`
192
+ * @param manifoldPairs array to receive pairs of properly mated edges, i.e. mesh interior edges.
193
+ * @param singletons array to receive edges that have no partner, i.e., mesh boundary edges.
194
+ * @param nullEdges array to receive arrays of matched null edges, for which start === end vertex index.
195
+ * @param allOtherClusters array to receive arrays of edges that are partners in an undirected, non-manifold sense.
184
196
  */
185
197
  sortAndCollectClusters(manifoldPairs, singletons, nullEdges, allOtherClusters) {
186
198
  this.sort();
@@ -201,18 +213,14 @@ export class IndexedEdgeMatcher {
201
213
  SortableEdge.areUndirectedPartners(baseEdge, this.edges[index1]); index1++) {
202
214
  clusterLength++;
203
215
  }
204
- if (this.edges[index0].isNullEdge) {
216
+ if (this.edges[index0].isNullEdge)
205
217
  this.collectSortableEdgeCluster(index0, index0 + clusterLength, nullEdges);
206
- }
207
- else if (clusterLength === 2 && SortableEdge.areDirectedPartners(baseEdge, this.edges[index0 + 1])) {
218
+ else if (clusterLength === 2 && SortableEdge.areDirectedPartners(baseEdge, this.edges[index0 + 1]))
208
219
  this.collectSortableEdgeCluster(index0, index0 + clusterLength, manifoldPairs);
209
- }
210
- else if (clusterLength === 1) {
220
+ else if (clusterLength === 1)
211
221
  this.collectSortableEdgeCluster(index0, index0 + 1, singletons);
212
- }
213
- else {
222
+ else
214
223
  this.collectSortableEdgeCluster(index0, index0 + clusterLength, allOtherClusters);
215
- }
216
224
  }
217
225
  }
218
226
  }
@@ -1 +1 @@
1
- {"version":3,"file":"IndexedEdgeMatcher.js","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AS,CAAC,CAAC;YAC7E,CAAC;iBAAM,IAAI,aAAa,KAAK,CAAC,IAAI,YAAY,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBACrG,IAAI,CAAC,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,EAAE,aAAa,CAAC,CAAC;YACjF,CAAC;iBAAM,IAAI,aAAa,KAAK,CAAC,EAAE,CAAC;gBAC/B,IAAI,CAAC,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,UAAU,CAAC,CAAC;YAClE,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,EAAE,gBAAgB,CAAC,CAAC;YACpF,CAAC;QACH,CAAC;IACH,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 Polyface\n */\n\n/**\n * * For boundary sorting, an edge is a (packed!) Float64Array.\n * * Fixed entry positions are:\n * * [0] is start vertex index (in CCW order around its facet)\n * * [1] is end vertex index (in CCW order around its facet)\n * * [2] is facet index (or another number to associate with this edge).\n */\nexport class SortableEdge extends Float64Array {\n /** Return the vertex index that appears first in the order stored. */\n public get vertexIndexA(): number {\n return this[0];\n }\n /** Return the vertex index that appears second in the order stored. */\n public get vertexIndexB(): number {\n return this[1];\n }\n /**\n * Return the facet index.\n * * This value is carried along during matching. Typically it is a facet index, but it does not have to be.\n */\n public get facetIndex(): number {\n return this[2];\n }\n /** return true if vertexIndexA is less than vertexIndexB. */\n public get isLowHigh(): boolean {\n return this[0] < this[1];\n }\n /** Return the vertex index with lower numeric value. */\n public get lowVertexIndex(): number {\n return this[0] < this[1] ? this[0] : this[1];\n }\n /** Return the vertex index with higher numeric value. */\n public get highVertexIndex(): number {\n return this[0] > this[1] ? this[0] : this[1];\n }\n /** Return true if the vertices edgeA and edgeB are the same vertex indices in opposite order. */\n public static areDirectedPartners(edgeA: SortableEdge, edgeB: SortableEdge): boolean {\n return edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0];\n }\n /** Return true if the vertices edgeA and edgeB are the same vertex indices with no consideration of order. */\n public static areUndirectedPartners(edgeA: SortableEdge, edgeB: SortableEdge): boolean {\n return (edgeA[0] === edgeB[0] && edgeA[1] === edgeB[1]) || ((edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0]));\n }\n /**\n * Return numeric relationship of edgeA and edgeB:\n * * 1 if they share start and end in the same order.\n * * -1 if they share start and end in reversed order.\n * * 0 otherwise.\n */\n public static relativeOrientation(edgeA: SortableEdge, edgeB: SortableEdge): number {\n if (edgeA[0] === edgeB[0] && edgeA[1] === edgeB[1]) return 1;\n if (edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0]) return -1;\n return 0;\n }\n\n public get isNullEdge(): boolean {\n return this[0] === this[1];\n }\n /**\n * Lexical comparison of two edges.\n * * If the edges have the same vertex pair (in same or opposite order) they will end up adjacent in a sort.\n * * If the edges have 0 or 1 shared vertex indices, the one with lowest low comes first.\n * @param edgeA first edge\n * @param edgeB second edge\n */\n public static lessThan(edgeA: SortableEdge, edgeB: SortableEdge): number {\n // primary compare is based on indirect indices\n const lowA = edgeA.lowVertexIndex;\n const lowB = edgeB.lowVertexIndex;\n if (lowA < lowB)\n return -1;\n if (lowB < lowA)\n return 1;\n const highA = edgeA.highVertexIndex;\n const highB = edgeB.highVertexIndex;\n if (highA < highB)\n return -1;\n if (highB < highA)\n return 1;\n // undirected indices match ... use directed vertexIndexA\n return edgeA.vertexIndexA - edgeB.vertexIndexA;\n }\n public constructor(vertexA: number, vertexB: number, facetIndex: number) {\n super(3);\n this[0] = vertexA;\n this[1] = vertexB;\n this[2] = facetIndex;\n }\n public toJSON(): any {\n return [this[0], this[1], this[2]];\n }\n public static clusterToJSON(data: SortableEdgeCluster): any {\n if (data instanceof SortableEdge)\n return data.toJSON();\n const result = [];\n for (const edge of data) result.push(edge.toJSON());\n }\n public static clusterArrayToJSON(data: SortableEdgeCluster[]) {\n const result = [];\n for (const cluster of data)\n result.push(SortableEdge.clusterToJSON(cluster));\n return result;\n }\n}\nexport type SortableEdgeCluster = SortableEdge | SortableEdge[];\n/**\n * An IndexedEdgeMatcher carries an array of edge start & end indices for sorting and subsequent analyses\n * (such as testing for closed mesh).\n */\nexport class IndexedEdgeMatcher {\n public edges: SortableEdge[];\n\n constructor() {\n this.edges = [];\n }\n /**\n * Push a new edge.\n * @param vertexA start vertex\n * @param vertexB end vertex\n * @param facetIndex value to carry along during matching\n * @returns the edge pushed onto the `edges` array\n */\n public addEdge(vertexA: number, vertexB: number, facetIndex: number): SortableEdge {\n const edge = new SortableEdge(vertexA, vertexB, facetIndex);\n this.edges.push(edge);\n return edge;\n }\n /**\n * Push edges all around a facet, returning to vertexArray[0].\n * @param vertexArray array of vertex indices around facet\n * @param facetIndex value to carry along during matching\n * @param closeLoop true to add an edge from last to first vertex.\n */\n public addPath(vertexArray: number[], facetIndex: number, closeLoop: boolean = true) {\n if (vertexArray.length === 0) return;\n const m = vertexArray.length - 1;\n for (let i = 0; i < m; i++) {\n this.addEdge(vertexArray[i], vertexArray[i + 1], facetIndex);\n }\n if (closeLoop)\n this.addEdge(vertexArray[m], vertexArray[0], facetIndex);\n }\n /** Sort the edge index array. */\n public sort() {\n this.edges.sort((edgeA, edgeB) => SortableEdge.lessThan(edgeA, edgeB));\n }\n /** Create a single or compound SortableEdgeCluster in dest. */\n private collectSortableEdgeCluster(index0: number, index1: number, dest: SortableEdgeCluster[] | undefined) {\n if (dest !== undefined && index1 > index0) {\n if (index1 === index0 + 1) {\n dest.push(this.edges[index0]);\n } else {\n const cluster = [];\n for (let i = index0; i < index1; i++)\n cluster.push(this.edges[i]);\n dest.push(cluster);\n }\n }\n }\n /**\n * Sort the edges, and look for three categories of paired edges:\n * * caller must allocate all result arrays of interest.\n * * Any combination of the result arrays may be `undefined`, indicating that category is to be ignored.\n * * Any combination of the result arrays may be aliased as the same target, in which case those to categories are\n * merged into the target.\n * * For instance, to ignore manifold pairs and collect all others (singleton, null, and other) as a single array\n * `allOther`, create `const allOther = []` as an empty array and call\n * `sortAndCollectClusters (undefined, allOther, allOther, allOther);`\n * @param manifoldPairs optional array to receive pairs of properly mated SortableEdgePairs, i.e. simple interior\n * edges adjacent to two facets in opposing directions.\n * @param singletons optional array to receive edges that are simple boundary edges.\n * @param nullEdges optional array to receive arrays of null edges (same start and end vertex)\n * @param allOtherClusters optional array to receive arrays in which all the edges are partners in an undirected sense\n * but not a simple directed pair.\n */\n public sortAndCollectClusters(\n manifoldPairs: SortableEdgeCluster[] | undefined,\n singletons?: SortableEdgeCluster[],\n nullEdges?: SortableEdgeCluster[],\n allOtherClusters?: SortableEdgeCluster[],\n ): void {\n this.sort();\n if (manifoldPairs) manifoldPairs.length = 0;\n if (singletons) singletons.length = 0;\n if (nullEdges) nullEdges.length = 0;\n if (allOtherClusters) allOtherClusters.length = 0;\n const n = this.edges.length;\n let clusterLength;\n for (let index0 = 0; index0 < n; index0 += clusterLength) {\n const baseEdge = this.edges[index0];\n clusterLength = 1;\n for (let index1 = index0 + 1; index1 < n &&\n SortableEdge.areUndirectedPartners(baseEdge, this.edges[index1]); index1++) {\n clusterLength++;\n }\n if (this.edges[index0].isNullEdge) {\n this.collectSortableEdgeCluster(index0, index0 + clusterLength, nullEdges);\n } else if (clusterLength === 2 && SortableEdge.areDirectedPartners(baseEdge, this.edges[index0 + 1])) {\n this.collectSortableEdgeCluster(index0, index0 + clusterLength, manifoldPairs);\n } else if (clusterLength === 1) {\n this.collectSortableEdgeCluster(index0, index0 + 1, singletons);\n } else {\n this.collectSortableEdgeCluster(index0, index0 + clusterLength, allOtherClusters);\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":"IndexedEdgeMatc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qB,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;gBAC7E,aAAa,EAAE,CAAC;YAClB,CAAC;YACD,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,UAAU;gBAC/B,IAAI,CAAC,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,EAAE,SAAS,CAAC,CAAC;iBACxE,IAAI,aAAa,KAAK,CAAC,IAAI,YAAY,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;gBAChG,IAAI,CAAC,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,EAAE,aAAa,CAAC,CAAC;iBAC5E,IAAI,aAAa,KAAK,CAAC;gBAC1B,IAAI,CAAC,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,UAAU,CAAC,CAAC;;gBAEhE,IAAI,CAAC,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,EAAE,gBAAgB,CAAC,CAAC;QACtF,CAAC;IACH,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 Polyface\n */\n\n/**\n * Represent an [[IndexedPolyface]] edge as:\n * * vertex start index and vertex end index (CCW order around its facet)\n * * an additional number to associate with the edge (e.g., facet index)\n * @public\n */\nexport class SortableEdge {\n private _v: number[];\n private _a: number;\n\n /** Constructor. */\n public constructor(startVertex: number, endVertex: number, facetIndex: number) {\n this._v = [startVertex, endVertex];\n this._a = facetIndex;\n }\n /** Clone the edge. */\n public clone(): SortableEdge {\n return new SortableEdge(this._v[0], this._v[1], this._a);\n }\n /** Return the vertex index that appears first in the order stored. */\n public get startVertex(): number {\n return this._v[0];\n }\n /** Return the vertex index that appears second in the order stored. */\n public get endVertex(): number {\n return this._v[1];\n }\n /**\n * Return the facet index.\n * * This value is carried along during matching. Typically it is a facet index, but it does not have to be.\n */\n public get facetIndex(): number {\n return this._a;\n }\n /** return true if `startVertex` is less than `endVertex`. */\n public get isLowHigh(): boolean {\n return this._v[0] < this._v[1];\n }\n /** Return the vertex index with lower numeric value. */\n public get lowVertex(): number {\n return this.isLowHigh ? this._v[0] : this._v[1];\n }\n /** Return the vertex index with higher numeric value. */\n public get highVertex(): number {\n return this.isLowHigh ? this._v[1] : this._v[0];\n }\n /** Return true if edgeA and edgeB traverse the same edge in the same direction. */\n private static areSameEdge(edgeA: SortableEdge, edgeB: SortableEdge): boolean {\n return edgeA._v[0] === edgeB._v[0] && edgeA._v[1] === edgeB._v[1];\n }\n /** Return true if edgeA and edgeB traverse the same edge in opposite directions. */\n public static areDirectedPartners(edgeA: SortableEdge, edgeB: SortableEdge): boolean {\n return edgeA._v[0] === edgeB._v[1] && edgeA._v[1] === edgeB._v[0];\n }\n /** Return true if edgeA and edgeB traverse the same edge in the same or opposite directions. */\n public static areUndirectedPartners(edgeA: SortableEdge, edgeB: SortableEdge): boolean {\n return this.areSameEdge(edgeA, edgeB) || this.areDirectedPartners(edgeA, edgeB);\n }\n /**\n * Return numeric identifier for the relationship between edgeA and edgeB:\n * * 1 if they share start and end vertex indices in the same order.\n * * -1 if they share start and end vertex indices in reversed order.\n * * 0 otherwise.\n */\n public static relativeOrientation(edgeA: SortableEdge, edgeB: SortableEdge): number {\n if (this.areSameEdge(edgeA, edgeB))\n return 1;\n if (this.areDirectedPartners(edgeA, edgeB))\n return -1;\n return 0;\n }\n /** Whether the start and end vertex indices are equal. */\n public get isNullEdge(): boolean {\n return this._v[0] === this._v[1];\n }\n /**\n * Lexical comparison of two edges.\n * * If the edges have the same vertex index pair (in same or opposite order) they will end up adjacent in a sort.\n * @param edgeA first edge\n * @param edgeB second edge\n */\n public static lessThan(edgeA: SortableEdge, edgeB: SortableEdge): number {\n // primary compare is based on indirect indices\n const lowA = edgeA.lowVertex;\n const lowB = edgeB.lowVertex;\n if (lowA < lowB)\n return -1;\n if (lowB < lowA)\n return 1;\n const highA = edgeA.highVertex;\n const highB = edgeB.highVertex;\n if (highA < highB)\n return -1;\n if (highB < highA)\n return 1;\n // undirected indices match ... use directed vertexIndexA\n return edgeA.startVertex - edgeB.startVertex;\n }\n /** Return the edge data as a JSON array. */\n public toJSON(): any {\n return [this._v[0], this._v[1], this._a];\n }\n /** Return the edge cluster in JSON format. */\n public static clusterToJSON(data: SortableEdgeCluster): any {\n if (data instanceof SortableEdge)\n return data.toJSON();\n const result = [];\n for (const edge of data)\n result.push(edge.toJSON());\n }\n /** Return the edge cluster array in JSON format. */\n public static clusterArrayToJSON(data: SortableEdgeCluster[]) {\n const result = [];\n for (const cluster of data)\n result.push(SortableEdge.clusterToJSON(cluster));\n return result;\n }\n}\n\n/**\n * Union type for a single [[SortableEdge]] or a (matched) array of them.\n * @public\n */\nexport type SortableEdgeCluster = SortableEdge | SortableEdge[];\n\n/**\n * An IndexedEdgeMatcher carries an array of edge start and end indices for sorting and subsequent analyses,\n * such as testing for closed mesh.\n * @public\n */\nexport class IndexedEdgeMatcher {\n /** The array of edges to be sorted. */\n public edges: SortableEdge[];\n /** Constructor. Call [[addEdge]] or [[addPath]] to populate `edges`. */\n public constructor() {\n this.edges = [];\n }\n /**\n * Push a new edge.\n * @param vertexA start vertex\n * @param vertexB end vertex\n * @param facetIndex value to carry along during matching\n * @returns the edge pushed onto the `edges` array\n */\n public addEdge(vertexA: number, vertexB: number, facetIndex: number): SortableEdge {\n const edge = new SortableEdge(vertexA, vertexB, facetIndex);\n this.edges.push(edge);\n return edge;\n }\n /**\n * Push edges along a path.\n * * Typically used to add edges around a facet.\n * @param vertexIndices array of vertex indices along an open or closed path.\n * @param facetIndex value to set on each edge pushed.\n * @param closeLoop true to add an edge from last to first vertex.\n */\n public addPath(vertexIndices: number[], facetIndex: number, closeLoop: boolean) {\n if (vertexIndices.length === 0)\n return;\n const m = vertexIndices.length - 1;\n for (let i = 0; i < m; i++)\n this.addEdge(vertexIndices[i], vertexIndices[i + 1], facetIndex);\n if (closeLoop)\n this.addEdge(vertexIndices[m], vertexIndices[0], facetIndex);\n }\n /** Sort the edges. */\n public sort() {\n this.edges.sort((edgeA, edgeB) => SortableEdge.lessThan(edgeA, edgeB));\n }\n /** Create a single or compound SortableEdgeCluster in dest. */\n private collectSortableEdgeCluster(index0: number, index1: number, dest: SortableEdgeCluster[] | undefined) {\n if (dest !== undefined && index1 > index0) {\n if (index1 === index0 + 1) {\n dest.push(this.edges[index0]);\n } else {\n const cluster = [];\n for (let i = index0; i < index1; i++)\n cluster.push(this.edges[i]);\n dest.push(cluster);\n }\n }\n }\n /**\n * Sort the edges, and collect up to four categories of edges: manifold pairs, singletons, null edges,\n * and everything else.\n * * Caller should allocate arrays of interest.\n * * Any combination of the arrays may be `undefined`, indicating that category is to be ignored.\n * * Any combination of the arrays may be aliased as the same target, in which case the aliased categories are\n * merged into the target.\n * * For instance, to ignore manifold pairs and collect all other edges in a single array:\n * `const foo = []; matcher.sortAndCollectClusters(undefined, foo, foo, foo);`\n * @param manifoldPairs array to receive pairs of properly mated edges, i.e. mesh interior edges.\n * @param singletons array to receive edges that have no partner, i.e., mesh boundary edges.\n * @param nullEdges array to receive arrays of matched null edges, for which start === end vertex index.\n * @param allOtherClusters array to receive arrays of edges that are partners in an undirected, non-manifold sense.\n */\n public sortAndCollectClusters(\n manifoldPairs?: SortableEdgeCluster[],\n singletons?: SortableEdgeCluster[],\n nullEdges?: SortableEdgeCluster[],\n allOtherClusters?: SortableEdgeCluster[],\n ): void {\n this.sort();\n if (manifoldPairs)\n manifoldPairs.length = 0;\n if (singletons)\n singletons.length = 0;\n if (nullEdges)\n nullEdges.length = 0;\n if (allOtherClusters)\n allOtherClusters.length = 0;\n const n = this.edges.length;\n let clusterLength;\n for (let index0 = 0; index0 < n; index0 += clusterLength) {\n const baseEdge = this.edges[index0];\n clusterLength = 1;\n for (let index1 = index0 + 1; index1 < n &&\n SortableEdge.areUndirectedPartners(baseEdge, this.edges[index1]); index1++) {\n clusterLength++;\n }\n if (this.edges[index0].isNullEdge)\n this.collectSortableEdgeCluster(index0, index0 + clusterLength, nullEdges);\n else if (clusterLength === 2 && SortableEdge.areDirectedPartners(baseEdge, this.edges[index0 + 1]))\n this.collectSortableEdgeCluster(index0, index0 + clusterLength, manifoldPairs);\n else if (clusterLength === 1)\n this.collectSortableEdgeCluster(index0, index0 + 1, singletons);\n else\n this.collectSortableEdgeCluster(index0, index0 + clusterLength, allOtherClusters);\n }\n }\n}\n"]}
@@ -40,7 +40,7 @@ export declare class IndexedPolyfaceVisitor extends PolyfaceData implements Poly
40
40
  moveToReadIndex(facetIndex: number): boolean;
41
41
  /** Advance the iterator to a the 'next' facet in the client polyface. */
42
42
  moveToNextFacet(): boolean;
43
- /** Reset the iterator to start at the first facet of the polyface. */
43
+ /** Restart the visitor at the first facet. */
44
44
  reset(): void;
45
45
  /**
46
46
  * Attempts to extract the distance parameter for the given vertex `index` on the current facet.
@@ -73,6 +73,8 @@ export declare class IndexedPolyfaceVisitor extends PolyfaceData implements Poly
73
73
  * * All data values are interpolated at `fraction` between `other` values at `index0` and `index1`.
74
74
  */
75
75
  pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void;
76
+ /** Create a visitor for a subset of the facets visitable by the instance. */
77
+ createSubsetVisitor(facetIndices: number[], numWrap?: number): IndexedPolyfaceSubsetVisitor;
76
78
  }
77
79
  /**
78
80
  * An `IndexedPolyfaceSubsetVisitor` is an `IndexedPolyfaceVisitor` which only visits a subset of facets in the polyface.
@@ -81,38 +83,37 @@ export declare class IndexedPolyfaceVisitor extends PolyfaceData implements Poly
81
83
  * @public
82
84
  */
83
85
  export declare class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor {
84
- private _parentFacetIndices?;
85
- private _currentActiveIndex;
86
- private _nextActiveIndex;
86
+ private _facetIndices;
87
+ private _currentSubsetIndex;
88
+ private _nextSubsetIndex;
87
89
  private constructor();
88
90
  private isValidSubsetIndex;
89
91
  /**
90
92
  * Create a visitor for iterating a subset of the facets of `polyface`.
91
93
  * @param polyface reference to the client polyface, supplying facets
92
- * @param activeFacetIndices array of indices of facets in the client polyface to visit. This array is cloned.
94
+ * @param facetIndices array of indices of facets in the client polyface to visit. This array is cloned.
93
95
  * @param numWrap number of vertices replicated in the visitor arrays to facilitate simpler caller code. Default is zero.
94
96
  */
95
- static createSubsetVisitor(polyface: IndexedPolyface, activeFacetIndices: number[], numWrap?: number): IndexedPolyfaceSubsetVisitor;
97
+ static createSubsetVisitor(polyface: IndexedPolyface, facetIndices: number[], numWrap?: number): IndexedPolyfaceSubsetVisitor;
96
98
  /**
97
99
  * Advance the iterator to a particular facet in the subset of client polyface facets.
98
- * @param activeIndex the index of the facet within the subset, not to be confused with the index of the facet within
99
- * the client polyface.
100
+ * @param subsetIndex index into the subset array, not to be confused with the client facet index.
100
101
  * @return whether the iterator was successfully moved.
101
102
  */
102
- moveToReadIndex(activeIndex: number): boolean;
103
+ moveToReadIndex(subsetIndex: number): boolean;
103
104
  /**
104
105
  * Advance the iterator to the next facet in the subset of client polyface facets.
105
106
  * @return whether the iterator was successfully moved.
106
107
  */
107
108
  moveToNextFacet(): boolean;
108
- /** Reset the iterator to start at the first active facet in the subset of client polyface facets. */
109
+ /** Restart the visitor at the first facet. */
109
110
  reset(): void;
110
111
  /**
111
- * Return the parent facet index of the indicated index within the subset of client polyface facets.
112
- * @param activeIndex index of the facet within the subset. Default is the active facet.
113
- * @return valid client polyface facet index, or `undefined` if invalid input index.
112
+ * Return the client polyface facet index (aka "readIndex") for the given subset index.
113
+ * @param subsetIndex index into the subset array. Default is the subset index of the currently visited facet.
114
+ * @return valid client polyface facet index, or `undefined` if invalid subset index.
114
115
  */
115
- parentFacetIndex(activeIndex?: number): number | undefined;
116
+ parentFacetIndex(subsetIndex?: number): number | undefined;
116
117
  /** Return the number of facets this visitor is able to visit. */
117
118
  getVisitableFacetCount(): number;
118
119
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"IndexedPolyfaceVisitor.d.ts","sourceRoot":"","sources":["../../../src/polyface/IndexedPolyfaceVisitor.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,YAAa,YAAW,eAAe;IACjF,OAAO,CAAC,kBAAkB,CAAS;IACnC,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,SAAS,CAAkB;IAEnC,SAAS,aAAa,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM;IAchE,yCAAyC;IAClC,cAAc,IAAI,eAAe;IAGxC,iEAAiE;IAC1D,sBAAsB,IAAI,MAAM;IAGvC;;;;;;;;OAQG;IACI,UAAU,CAAC,OAAO,EAAE,MAAM;IAGjC;;;OAGG;IACH,IAAW,iBAAiB,IAAI,MAAM,CAErC;IACD,+DAA+D;WACjD,MAAM,CAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,GAAG,sBAAsB;IAGxF,yEAAyE;IAClE,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAenD,yEAAyE;IAClE,eAAe,IAAI,OAAO;IAMjC,sEAAsE;IAC/D,KAAK,IAAI,IAAI;IAIpB;;;OAGG;IACI,uBAAuB,CAAC,KAAK,EAAE,MAAM,E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