@itwin/core-geometry 5.0.0-dev.4 → 5.0.0-dev.40

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 (434) hide show
  1. package/CHANGELOG.md +29 -1
  2. package/lib/cjs/Constant.js +17 -17
  3. package/lib/cjs/Constant.js.map +1 -1
  4. package/lib/cjs/Geometry.js +35 -35
  5. package/lib/cjs/Geometry.js.map +1 -1
  6. package/lib/cjs/bspline/BSplineCurveOps.d.ts.map +1 -1
  7. package/lib/cjs/bspline/BSplineCurveOps.js +18 -21
  8. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  9. package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
  10. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  11. package/lib/cjs/bspline/KnotVector.js +2 -2
  12. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  13. package/lib/cjs/clipping/AlternatingConvexClipTree.js +2 -2
  14. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  15. package/lib/cjs/clipping/ClipPlane.js +1 -1
  16. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  17. package/lib/cjs/clipping/ClipUtils.js +1 -1
  18. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  19. package/lib/cjs/clipping/ClipVector.js +1 -1
  20. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  21. package/lib/cjs/clipping/ConvexClipPlaneSet.js +3 -3
  22. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  23. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +1 -1
  24. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  25. package/lib/cjs/curve/Arc3d.d.ts +40 -8
  26. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  27. package/lib/cjs/curve/Arc3d.js +80 -22
  28. package/lib/cjs/curve/Arc3d.js.map +1 -1
  29. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +4 -4
  30. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  31. package/lib/cjs/curve/CurveCollection.d.ts +16 -2
  32. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  33. package/lib/cjs/curve/CurveCollection.js +33 -2
  34. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  35. package/lib/cjs/curve/CurveFactory.d.ts +87 -53
  36. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  37. package/lib/cjs/curve/CurveFactory.js +213 -135
  38. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  39. package/lib/cjs/curve/LineString3d.d.ts +12 -8
  40. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  41. package/lib/cjs/curve/LineString3d.js +34 -13
  42. package/lib/cjs/curve/LineString3d.js.map +1 -1
  43. package/lib/cjs/curve/Loop.d.ts +12 -6
  44. package/lib/cjs/curve/Loop.d.ts.map +1 -1
  45. package/lib/cjs/curve/Loop.js +12 -6
  46. package/lib/cjs/curve/Loop.js.map +1 -1
  47. package/lib/cjs/curve/Query/CylindricalRange.d.ts +8 -6
  48. package/lib/cjs/curve/Query/CylindricalRange.d.ts.map +1 -1
  49. package/lib/cjs/curve/Query/CylindricalRange.js +13 -9
  50. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  51. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +1 -1
  52. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  53. package/lib/cjs/curve/StrokeOptions.d.ts +4 -4
  54. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  55. package/lib/cjs/curve/StrokeOptions.js +1 -1
  56. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  57. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +5 -5
  58. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  59. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +13 -13
  60. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  61. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +5 -5
  62. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  63. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  64. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +29 -23
  65. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  66. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +4 -4
  67. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  68. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +2 -2
  69. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  70. package/lib/cjs/geometry3d/Angle.js +16 -16
  71. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  72. package/lib/cjs/geometry3d/AngleSweep.d.ts +1 -1
  73. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  74. package/lib/cjs/geometry3d/AngleSweep.js +1 -1
  75. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  76. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +14 -8
  77. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  78. package/lib/cjs/geometry3d/BarycentricTriangle.js +17 -8
  79. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  80. package/lib/cjs/geometry3d/FrameBuilder.js +4 -4
  81. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  82. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts +2 -0
  83. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  84. package/lib/cjs/geometry3d/GrowableFloat64Array.js +4 -0
  85. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  86. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +32 -10
  87. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  88. package/lib/cjs/geometry3d/GrowableXYZArray.js +54 -16
  89. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  90. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +13 -2
  91. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  92. package/lib/cjs/geometry3d/IndexedXYZCollection.js +24 -10
  93. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  94. package/lib/cjs/geometry3d/Matrix3d.d.ts +11 -8
  95. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  96. package/lib/cjs/geometry3d/Matrix3d.js +36 -34
  97. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  98. package/lib/cjs/geometry3d/OrderedRotationAngles.js +2 -2
  99. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  100. package/lib/cjs/geometry3d/Point3dArrayCarrier.js +1 -1
  101. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  102. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +6 -6
  103. package/lib/cjs/geometry3d/Point3dVector3d.js +6 -6
  104. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  105. package/lib/cjs/geometry3d/PointHelpers.js +5 -5
  106. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  107. package/lib/cjs/geometry3d/PolygonOps.d.ts +12 -6
  108. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  109. package/lib/cjs/geometry3d/PolygonOps.js +117 -70
  110. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  111. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +3 -3
  112. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  113. package/lib/cjs/geometry3d/PolylineOps.d.ts +9 -5
  114. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  115. package/lib/cjs/geometry3d/PolylineOps.js +9 -5
  116. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  117. package/lib/cjs/geometry3d/Range.js +4 -4
  118. package/lib/cjs/geometry3d/Range.js.map +1 -1
  119. package/lib/cjs/geometry4d/MomentData.d.ts +72 -73
  120. package/lib/cjs/geometry4d/MomentData.d.ts.map +1 -1
  121. package/lib/cjs/geometry4d/MomentData.js +62 -64
  122. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  123. package/lib/cjs/numerics/ClusterableArray.js +13 -13
  124. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  125. package/lib/cjs/numerics/PascalCoefficients.js +1 -1
  126. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  127. package/lib/cjs/numerics/PolarData.js +1 -1
  128. package/lib/cjs/numerics/PolarData.js.map +1 -1
  129. package/lib/cjs/numerics/Polynomials.d.ts +5 -5
  130. package/lib/cjs/numerics/Polynomials.js +32 -32
  131. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  132. package/lib/cjs/numerics/Quadrature.js +20 -20
  133. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  134. package/lib/cjs/polyface/AuxData.d.ts +2 -2
  135. package/lib/cjs/polyface/AuxData.d.ts.map +1 -1
  136. package/lib/cjs/polyface/AuxData.js +11 -3
  137. package/lib/cjs/polyface/AuxData.js.map +1 -1
  138. package/lib/cjs/polyface/BoxTopology.js +67 -67
  139. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  140. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js +2 -2
  141. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  142. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +27 -20
  143. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  144. package/lib/cjs/polyface/IndexedEdgeMatcher.js +56 -30
  145. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  146. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +2 -1
  147. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  148. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +2 -1
  149. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  150. package/lib/cjs/polyface/Polyface.d.ts +3 -5
  151. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  152. package/lib/cjs/polyface/Polyface.js +6 -13
  153. package/lib/cjs/polyface/Polyface.js.map +1 -1
  154. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +14 -7
  155. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  156. package/lib/cjs/polyface/PolyfaceBuilder.js +59 -64
  157. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  158. package/lib/cjs/polyface/PolyfaceData.d.ts +13 -3
  159. package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
  160. package/lib/cjs/polyface/PolyfaceData.js +26 -9
  161. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  162. package/lib/cjs/polyface/PolyfaceQuery.d.ts +2 -2
  163. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  164. package/lib/cjs/polyface/PolyfaceQuery.js +11 -10
  165. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  166. package/lib/cjs/polyface/multiclip/RangeSearch.js +5 -5
  167. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  168. package/lib/cjs/serialization/BGFBReader.js +22 -22
  169. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  170. package/lib/cjs/serialization/GeometrySamples.d.ts +5 -5
  171. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  172. package/lib/cjs/serialization/GeometrySamples.js +112 -112
  173. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  174. package/lib/cjs/solid/Box.d.ts +9 -3
  175. package/lib/cjs/solid/Box.d.ts.map +1 -1
  176. package/lib/cjs/solid/Box.js +10 -5
  177. package/lib/cjs/solid/Box.js.map +1 -1
  178. package/lib/cjs/solid/Cone.d.ts +3 -2
  179. package/lib/cjs/solid/Cone.d.ts.map +1 -1
  180. package/lib/cjs/solid/Cone.js +3 -3
  181. package/lib/cjs/solid/Cone.js.map +1 -1
  182. package/lib/cjs/solid/LinearSweep.d.ts +9 -3
  183. package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
  184. package/lib/cjs/solid/LinearSweep.js +9 -4
  185. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  186. package/lib/cjs/solid/RotationalSweep.d.ts +15 -4
  187. package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
  188. package/lib/cjs/solid/RotationalSweep.js +20 -7
  189. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  190. package/lib/cjs/solid/RuledSweep.d.ts +35 -26
  191. package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
  192. package/lib/cjs/solid/RuledSweep.js +41 -28
  193. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  194. package/lib/cjs/solid/SolidPrimitive.d.ts +12 -11
  195. package/lib/cjs/solid/SolidPrimitive.d.ts.map +1 -1
  196. package/lib/cjs/solid/SolidPrimitive.js +8 -5
  197. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  198. package/lib/cjs/solid/Sphere.d.ts +17 -7
  199. package/lib/cjs/solid/Sphere.d.ts.map +1 -1
  200. package/lib/cjs/solid/Sphere.js +22 -16
  201. package/lib/cjs/solid/Sphere.js.map +1 -1
  202. package/lib/cjs/solid/SweepContour.d.ts +25 -16
  203. package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
  204. package/lib/cjs/solid/SweepContour.js +25 -16
  205. package/lib/cjs/solid/SweepContour.js.map +1 -1
  206. package/lib/cjs/solid/TorusPipe.d.ts +8 -2
  207. package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
  208. package/lib/cjs/solid/TorusPipe.js +9 -5
  209. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  210. package/lib/cjs/topology/ChainMerge.js +4 -4
  211. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  212. package/lib/cjs/topology/Graph.js +5 -5
  213. package/lib/cjs/topology/Graph.js.map +1 -1
  214. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js +2 -2
  215. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  216. package/lib/cjs/topology/Triangulation.js +11 -11
  217. package/lib/cjs/topology/Triangulation.js.map +1 -1
  218. package/lib/esm/Constant.js +17 -17
  219. package/lib/esm/Constant.js.map +1 -1
  220. package/lib/esm/Geometry.js +35 -35
  221. package/lib/esm/Geometry.js.map +1 -1
  222. package/lib/esm/bspline/BSplineCurveOps.d.ts.map +1 -1
  223. package/lib/esm/bspline/BSplineCurveOps.js +18 -21
  224. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  225. package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
  226. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  227. package/lib/esm/bspline/KnotVector.js +2 -2
  228. package/lib/esm/bspline/KnotVector.js.map +1 -1
  229. package/lib/esm/clipping/AlternatingConvexClipTree.js +2 -2
  230. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  231. package/lib/esm/clipping/ClipPlane.js +1 -1
  232. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  233. package/lib/esm/clipping/ClipUtils.js +1 -1
  234. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  235. package/lib/esm/clipping/ClipVector.js +1 -1
  236. package/lib/esm/clipping/ClipVector.js.map +1 -1
  237. package/lib/esm/clipping/ConvexClipPlaneSet.js +3 -3
  238. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  239. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +1 -1
  240. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  241. package/lib/esm/curve/Arc3d.d.ts +40 -8
  242. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  243. package/lib/esm/curve/Arc3d.js +80 -22
  244. package/lib/esm/curve/Arc3d.js.map +1 -1
  245. package/lib/esm/curve/CurveChainWithDistanceIndex.js +4 -4
  246. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  247. package/lib/esm/curve/CurveCollection.d.ts +16 -2
  248. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  249. package/lib/esm/curve/CurveCollection.js +33 -2
  250. package/lib/esm/curve/CurveCollection.js.map +1 -1
  251. package/lib/esm/curve/CurveFactory.d.ts +87 -53
  252. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  253. package/lib/esm/curve/CurveFactory.js +213 -135
  254. package/lib/esm/curve/CurveFactory.js.map +1 -1
  255. package/lib/esm/curve/LineString3d.d.ts +12 -8
  256. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  257. package/lib/esm/curve/LineString3d.js +34 -13
  258. package/lib/esm/curve/LineString3d.js.map +1 -1
  259. package/lib/esm/curve/Loop.d.ts +12 -6
  260. package/lib/esm/curve/Loop.d.ts.map +1 -1
  261. package/lib/esm/curve/Loop.js +12 -6
  262. package/lib/esm/curve/Loop.js.map +1 -1
  263. package/lib/esm/curve/Query/CylindricalRange.d.ts +8 -6
  264. package/lib/esm/curve/Query/CylindricalRange.d.ts.map +1 -1
  265. package/lib/esm/curve/Query/CylindricalRange.js +13 -9
  266. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  267. package/lib/esm/curve/RegionOpsClassificationSweeps.js +1 -1
  268. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  269. package/lib/esm/curve/StrokeOptions.d.ts +4 -4
  270. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  271. package/lib/esm/curve/StrokeOptions.js +1 -1
  272. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  273. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +5 -5
  274. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  275. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +13 -13
  276. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  277. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +5 -5
  278. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  279. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  280. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +29 -23
  281. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  282. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +4 -4
  283. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  284. package/lib/esm/curve/spiral/IntegratedSpiral3d.js +2 -2
  285. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  286. package/lib/esm/geometry3d/Angle.js +16 -16
  287. package/lib/esm/geometry3d/Angle.js.map +1 -1
  288. package/lib/esm/geometry3d/AngleSweep.d.ts +1 -1
  289. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  290. package/lib/esm/geometry3d/AngleSweep.js +1 -1
  291. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  292. package/lib/esm/geometry3d/BarycentricTriangle.d.ts +14 -8
  293. package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  294. package/lib/esm/geometry3d/BarycentricTriangle.js +17 -8
  295. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  296. package/lib/esm/geometry3d/FrameBuilder.js +4 -4
  297. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  298. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts +2 -0
  299. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  300. package/lib/esm/geometry3d/GrowableFloat64Array.js +4 -0
  301. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  302. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +32 -10
  303. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  304. package/lib/esm/geometry3d/GrowableXYZArray.js +54 -16
  305. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  306. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +13 -2
  307. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  308. package/lib/esm/geometry3d/IndexedXYZCollection.js +24 -10
  309. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  310. package/lib/esm/geometry3d/Matrix3d.d.ts +11 -8
  311. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  312. package/lib/esm/geometry3d/Matrix3d.js +36 -34
  313. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  314. package/lib/esm/geometry3d/OrderedRotationAngles.js +2 -2
  315. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  316. package/lib/esm/geometry3d/Point3dArrayCarrier.js +1 -1
  317. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  318. package/lib/esm/geometry3d/Point3dVector3d.d.ts +6 -6
  319. package/lib/esm/geometry3d/Point3dVector3d.js +6 -6
  320. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  321. package/lib/esm/geometry3d/PointHelpers.js +5 -5
  322. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  323. package/lib/esm/geometry3d/PolygonOps.d.ts +12 -6
  324. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  325. package/lib/esm/geometry3d/PolygonOps.js +117 -70
  326. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  327. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +3 -3
  328. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  329. package/lib/esm/geometry3d/PolylineOps.d.ts +9 -5
  330. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  331. package/lib/esm/geometry3d/PolylineOps.js +9 -5
  332. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  333. package/lib/esm/geometry3d/Range.js +4 -4
  334. package/lib/esm/geometry3d/Range.js.map +1 -1
  335. package/lib/esm/geometry4d/MomentData.d.ts +72 -73
  336. package/lib/esm/geometry4d/MomentData.d.ts.map +1 -1
  337. package/lib/esm/geometry4d/MomentData.js +62 -64
  338. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  339. package/lib/esm/numerics/ClusterableArray.js +13 -13
  340. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  341. package/lib/esm/numerics/PascalCoefficients.js +1 -1
  342. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  343. package/lib/esm/numerics/PolarData.js +1 -1
  344. package/lib/esm/numerics/PolarData.js.map +1 -1
  345. package/lib/esm/numerics/Polynomials.d.ts +5 -5
  346. package/lib/esm/numerics/Polynomials.js +32 -32
  347. package/lib/esm/numerics/Polynomials.js.map +1 -1
  348. package/lib/esm/numerics/Quadrature.js +20 -20
  349. package/lib/esm/numerics/Quadrature.js.map +1 -1
  350. package/lib/esm/polyface/AuxData.d.ts +2 -2
  351. package/lib/esm/polyface/AuxData.d.ts.map +1 -1
  352. package/lib/esm/polyface/AuxData.js +11 -3
  353. package/lib/esm/polyface/AuxData.js.map +1 -1
  354. package/lib/esm/polyface/BoxTopology.js +67 -67
  355. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  356. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js +2 -2
  357. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  358. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +27 -20
  359. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  360. package/lib/esm/polyface/IndexedEdgeMatcher.js +56 -30
  361. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  362. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +2 -1
  363. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  364. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +2 -1
  365. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  366. package/lib/esm/polyface/Polyface.d.ts +3 -5
  367. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  368. package/lib/esm/polyface/Polyface.js +6 -13
  369. package/lib/esm/polyface/Polyface.js.map +1 -1
  370. package/lib/esm/polyface/PolyfaceBuilder.d.ts +14 -7
  371. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  372. package/lib/esm/polyface/PolyfaceBuilder.js +60 -65
  373. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  374. package/lib/esm/polyface/PolyfaceData.d.ts +13 -3
  375. package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
  376. package/lib/esm/polyface/PolyfaceData.js +26 -9
  377. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  378. package/lib/esm/polyface/PolyfaceQuery.d.ts +2 -2
  379. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  380. package/lib/esm/polyface/PolyfaceQuery.js +11 -10
  381. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  382. package/lib/esm/polyface/multiclip/RangeSearch.js +5 -5
  383. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  384. package/lib/esm/serialization/BGFBReader.js +22 -22
  385. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  386. package/lib/esm/serialization/GeometrySamples.d.ts +5 -5
  387. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  388. package/lib/esm/serialization/GeometrySamples.js +112 -112
  389. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  390. package/lib/esm/solid/Box.d.ts +9 -3
  391. package/lib/esm/solid/Box.d.ts.map +1 -1
  392. package/lib/esm/solid/Box.js +10 -5
  393. package/lib/esm/solid/Box.js.map +1 -1
  394. package/lib/esm/solid/Cone.d.ts +3 -2
  395. package/lib/esm/solid/Cone.d.ts.map +1 -1
  396. package/lib/esm/solid/Cone.js +3 -3
  397. package/lib/esm/solid/Cone.js.map +1 -1
  398. package/lib/esm/solid/LinearSweep.d.ts +9 -3
  399. package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
  400. package/lib/esm/solid/LinearSweep.js +9 -4
  401. package/lib/esm/solid/LinearSweep.js.map +1 -1
  402. package/lib/esm/solid/RotationalSweep.d.ts +15 -4
  403. package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
  404. package/lib/esm/solid/RotationalSweep.js +20 -7
  405. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  406. package/lib/esm/solid/RuledSweep.d.ts +35 -26
  407. package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
  408. package/lib/esm/solid/RuledSweep.js +41 -28
  409. package/lib/esm/solid/RuledSweep.js.map +1 -1
  410. package/lib/esm/solid/SolidPrimitive.d.ts +12 -11
  411. package/lib/esm/solid/SolidPrimitive.d.ts.map +1 -1
  412. package/lib/esm/solid/SolidPrimitive.js +8 -5
  413. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  414. package/lib/esm/solid/Sphere.d.ts +17 -7
  415. package/lib/esm/solid/Sphere.d.ts.map +1 -1
  416. package/lib/esm/solid/Sphere.js +22 -16
  417. package/lib/esm/solid/Sphere.js.map +1 -1
  418. package/lib/esm/solid/SweepContour.d.ts +25 -16
  419. package/lib/esm/solid/SweepContour.d.ts.map +1 -1
  420. package/lib/esm/solid/SweepContour.js +25 -16
  421. package/lib/esm/solid/SweepContour.js.map +1 -1
  422. package/lib/esm/solid/TorusPipe.d.ts +8 -2
  423. package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
  424. package/lib/esm/solid/TorusPipe.js +9 -5
  425. package/lib/esm/solid/TorusPipe.js.map +1 -1
  426. package/lib/esm/topology/ChainMerge.js +4 -4
  427. package/lib/esm/topology/ChainMerge.js.map +1 -1
  428. package/lib/esm/topology/Graph.js +5 -5
  429. package/lib/esm/topology/Graph.js.map +1 -1
  430. package/lib/esm/topology/HalfEdgeGraphSpineContext.js +2 -2
  431. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  432. package/lib/esm/topology/Triangulation.js +11 -11
  433. package/lib/esm/topology/Triangulation.js.map +1 -1
  434. package/package.json +5 -5
@@ -15,26 +15,27 @@ export declare class SortableEdge extends Float64Array {
15
15
  get vertexIndexB(): number;
16
16
  /** Return the facet index. */
17
17
  get facetIndex(): number;
18
- /** return true if vertexIndexA is less than vertexIndexB */
18
+ /** return true if vertexIndexA is less than vertexIndexB. */
19
19
  get isLowHigh(): boolean;
20
- /** Return the vertex index with lower numeric value */
20
+ /** Return the vertex index with lower numeric value. */
21
21
  get lowVertexIndex(): number;
22
- /** Return the vertex index with higher numeric value */
22
+ /** Return the vertex index with higher numeric value. */
23
23
  get highVertexIndex(): number;
24
- /** Return true if the vertices edgeA and edgeB are the same vertex indices in opposite order */
24
+ /** Return true if the vertices edgeA and edgeB are the same vertex indices in opposite order. */
25
25
  static areDirectedPartners(edgeA: SortableEdge, edgeB: SortableEdge): boolean;
26
- /** Return true if the vertices edgeA and edgeB are the same vertex indices with no consideration of order */
26
+ /** Return true if the vertices edgeA and edgeB are the same vertex indices with no consideration of order. */
27
27
  static areUndirectedPartners(edgeA: SortableEdge, edgeB: SortableEdge): boolean;
28
- /** Return numeric relationship of edgeA and edgeB:
29
- * * 1 if they share start and end in the same order
30
- * * -1 if they share start and end in reversed order
28
+ /**
29
+ * Return numeric relationship of edgeA and edgeB:
30
+ * * 1 if they share start and end in the same order.
31
+ * * -1 if they share start and end in reversed order.
31
32
  * * 0 otherwise.
32
33
  */
33
34
  static relativeOrientation(edgeA: SortableEdge, edgeB: SortableEdge): number;
34
35
  get isNullEdge(): boolean;
35
36
  /**
36
- * lexical comparison of two edges.
37
- * * If the edges have the same vertex pair (in same or opposite order) they will end up adjacent in a sort
37
+ * Lexical comparison of two edges.
38
+ * * If the edges have the same vertex pair (in same or opposite order) they will end up adjacent in a sort.
38
39
  * * If the edges have 0 or 1 shared vertex indices, the one with lowest low comes first.
39
40
  * @param edgeA first edge
40
41
  * @param edgeB second edge
@@ -47,23 +48,25 @@ export declare class SortableEdge extends Float64Array {
47
48
  }
48
49
  export type SortableEdgeCluster = SortableEdge | SortableEdge[];
49
50
  /**
50
- * An IndexedEdgeMatcher carries an array (`edges`) of edges start & end indices for sorting and subsequent analyses (such as testing for closed mesh)
51
+ * An IndexedEdgeMatcher carries an array (`edges`) of edges start & end indices for sorting and subsequent analyses
52
+ * (such as testing for closed mesh).
51
53
  */
52
54
  export declare class IndexedEdgeMatcher {
53
55
  edges: SortableEdge[];
54
56
  constructor();
55
57
  /**
56
- * push a new edge.
57
- * @returns the edge (as emplaced at the back of the sortableEdge array)
58
+ * Push a new edge.
58
59
  * @param vertexA start vertex
59
60
  * @param vertexB end vertex
60
61
  * @param facetIndex facet index
62
+ * @returns the edge (as emplaced at the back of the sortableEdge array)
61
63
  */
62
64
  addEdge(vertexA: number, vertexB: number, facetIndex: number): SortableEdge;
63
65
  /**
64
- * Push edges all around a facet, returning to vertexArray[0]
66
+ * Push edges all around a facet, returning to vertexArray[0].
65
67
  * @param vertexArray array of vertex indices around facet
66
- * @param facetIndex
68
+ * @param facetIndex facet index
69
+ * @param closeLoop true to add an edge from last to first vertex.
67
70
  */
68
71
  addPath(vertexArray: number[], facetIndex: number, closeLoop?: boolean): void;
69
72
  /** Sort the edge index array. */
@@ -71,16 +74,20 @@ export declare class IndexedEdgeMatcher {
71
74
  /** Create a single or compound SortableEdgeCluster in dest. */
72
75
  private collectSortableEdgeCluster;
73
76
  /**
74
- * sort the edges, and look for three categories of paired edges:
77
+ * Sort the edges, and look for three categories of paired edges:
75
78
  * * caller must allocate all result arrays of interest.
76
79
  * * Any combination of the result arrays may be `undefined`, indicating that category is to be ignored.
77
- * * Any combination of the result arrays may be aliased as the same target, in which case those to categories are merged into the target.
78
- * * For instance, to ignore manifold pairs and collect all others (singleton, null, and other) as a single array `allOther`, create `const allOther = []` as an empty array and call
80
+ * * Any combination of the result arrays may be aliased as the same target, in which case those to categories are
81
+ * merged into the target.
82
+ * * For instance, to ignore manifold pairs and collect all others (singleton, null, and other) as a single array
83
+ * `allOther`, create `const allOther = []` as an empty array and call
79
84
  * `sortAndCollectClusters (undefined, allOther, allOther, allOther);`
80
- * @param manifoldPairs optional array to receive pairs of properly mated SortableEdgePairs, i.e. simple interior edges adjacent to two facets in opposing directions.
85
+ * @param manifoldPairs optional array to receive pairs of properly mated SortableEdgePairs, i.e. simple interior
86
+ * edges adjacent to two facets in opposing directions.
81
87
  * @param singletons optional array to receive edges that are simple boundary edges.
82
88
  * @param nullEdges optional array to receive arrays of null edges (same start and end vertex)
83
- * @param allOtherClusters optional array to receive arrays in which all the edges are partners in an undirected sense but not a simple directed pair.
89
+ * @param allOtherClusters optional array to receive arrays in which all the edges are partners in an undirected sense
90
+ * but not a simple directed pair.
84
91
  */
85
92
  sortAndCollectClusters(manifoldPairs: SortableEdgeCluster[] | undefined, singletons?: SortableEdgeCluster[], nullEdges?: SortableEdgeCluster[], allOtherClusters?: SortableEdgeCluster[]): void;
86
93
  }
@@ -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,CAAoB;IACrD,wEAAwE;IACxE,IAAW,YAAY,IAAI,MAAM,CAAoB;IACrD,+BAA+B;IAC/B,IAAW,UAAU,IAAI,MAAM,CAAoB;IACnD,4DAA4D;IAC5D,IAAW,SAAS,IAAI,OAAO,CAA8B;IAC7D,uDAAuD;IACvD,IAAW,cAAc,IAAI,MAAM,CAAkD;IACr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,EAAE,YAAY,EAAE,CAAC;;IAK7B;;;;;;OAMG;IACI,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,YAAY;IAKlF;;;;;OAKG;IACI,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,GAAE,OAAc;IASnF,iCAAiC;IAC1B,IAAI;IAGX,+DAA+D;IAC/D,OAAO,CAAC,0BAA0B;IAYlC;;;;;;;;;;;;;;;OAeG;IACI,sBAAsB,CAC3B,aAAa,EAAE,mBAAmB,EAAE,GAAG,SAAS,EAChD,UAAU,CAAC,EAAE,mBAAmB,EAAE,EAClC,SAAS,CAAC,EAAE,mBAAmB,EAAE,EACjC,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,GACvC,IAAI;CA0BR"}
@@ -17,26 +17,41 @@ exports.IndexedEdgeMatcher = exports.SortableEdge = void 0;
17
17
  */
18
18
  class SortableEdge extends Float64Array {
19
19
  /** Return the vertex index that appears first in the order stored. */
20
- get vertexIndexA() { return this[0]; }
20
+ get vertexIndexA() {
21
+ return this[0];
22
+ }
21
23
  /** Return the vertex index that appears second in the order stored. */
22
- get vertexIndexB() { return this[1]; }
24
+ get vertexIndexB() {
25
+ return this[1];
26
+ }
23
27
  /** Return the facet index. */
24
- get facetIndex() { return this[2]; }
25
- /** return true if vertexIndexA is less than vertexIndexB */
26
- get isLowHigh() { return this[0] < this[1]; }
27
- /** Return the vertex index with lower numeric value */
28
- get lowVertexIndex() { return this[0] < this[1] ? this[0] : this[1]; }
29
- /** Return the vertex index with higher numeric value */
30
- get highVertexIndex() { return this[0] > this[1] ? this[0] : this[1]; }
31
- /** Return true if the vertices edgeA and edgeB are the same vertex indices in opposite order */
32
- static areDirectedPartners(edgeA, edgeB) { return edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0]; }
33
- /** Return true if the vertices edgeA and edgeB are the same vertex indices with no consideration of order */
28
+ get facetIndex() {
29
+ return this[2];
30
+ }
31
+ /** return true if vertexIndexA is less than vertexIndexB. */
32
+ get isLowHigh() {
33
+ return this[0] < this[1];
34
+ }
35
+ /** Return the vertex index with lower numeric value. */
36
+ get lowVertexIndex() {
37
+ return this[0] < this[1] ? this[0] : this[1];
38
+ }
39
+ /** Return the vertex index with higher numeric value. */
40
+ get highVertexIndex() {
41
+ return this[0] > this[1] ? this[0] : this[1];
42
+ }
43
+ /** Return true if the vertices edgeA and edgeB are the same vertex indices in opposite order. */
44
+ static areDirectedPartners(edgeA, edgeB) {
45
+ return edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0];
46
+ }
47
+ /** Return true if the vertices edgeA and edgeB are the same vertex indices with no consideration of order. */
34
48
  static areUndirectedPartners(edgeA, edgeB) {
35
49
  return (edgeA[0] === edgeB[0] && edgeA[1] === edgeB[1]) || ((edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0]));
36
50
  }
37
- /** Return numeric relationship of edgeA and edgeB:
38
- * * 1 if they share start and end in the same order
39
- * * -1 if they share start and end in reversed order
51
+ /**
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.
40
55
  * * 0 otherwise.
41
56
  */
42
57
  static relativeOrientation(edgeA, edgeB) {
@@ -46,10 +61,12 @@ class SortableEdge extends Float64Array {
46
61
  return -1;
47
62
  return 0;
48
63
  }
49
- get isNullEdge() { return this[0] === this[1]; }
64
+ get isNullEdge() {
65
+ return this[0] === this[1];
66
+ }
50
67
  /**
51
- * lexical comparison of two edges.
52
- * * If the edges have the same vertex pair (in same or opposite order) they will end up adjacent in a sort
68
+ * 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.
53
70
  * * If the edges have 0 or 1 shared vertex indices, the one with lowest low comes first.
54
71
  * @param edgeA first edge
55
72
  * @param edgeB second edge
@@ -77,7 +94,9 @@ class SortableEdge extends Float64Array {
77
94
  this[1] = vertexB;
78
95
  this[2] = facetIndex;
79
96
  }
80
- toJSON() { return [this[0], this[1], this[2]]; }
97
+ toJSON() {
98
+ return [this[0], this[1], this[2]];
99
+ }
81
100
  static clusterToJSON(data) {
82
101
  if (data instanceof SortableEdge)
83
102
  return data.toJSON();
@@ -94,18 +113,19 @@ class SortableEdge extends Float64Array {
94
113
  }
95
114
  exports.SortableEdge = SortableEdge;
96
115
  /**
97
- * An IndexedEdgeMatcher carries an array (`edges`) of edges start & end indices for sorting and subsequent analyses (such as testing for closed mesh)
116
+ * An IndexedEdgeMatcher carries an array (`edges`) of edges start & end indices for sorting and subsequent analyses
117
+ * (such as testing for closed mesh).
98
118
  */
99
119
  class IndexedEdgeMatcher {
100
120
  constructor() {
101
121
  this.edges = [];
102
122
  }
103
123
  /**
104
- * push a new edge.
105
- * @returns the edge (as emplaced at the back of the sortableEdge array)
124
+ * Push a new edge.
106
125
  * @param vertexA start vertex
107
126
  * @param vertexB end vertex
108
127
  * @param facetIndex facet index
128
+ * @returns the edge (as emplaced at the back of the sortableEdge array)
109
129
  */
110
130
  addEdge(vertexA, vertexB, facetIndex) {
111
131
  const edge = new SortableEdge(vertexA, vertexB, facetIndex);
@@ -113,9 +133,10 @@ class IndexedEdgeMatcher {
113
133
  return edge;
114
134
  }
115
135
  /**
116
- * Push edges all around a facet, returning to vertexArray[0]
136
+ * Push edges all around a facet, returning to vertexArray[0].
117
137
  * @param vertexArray array of vertex indices around facet
118
- * @param facetIndex
138
+ * @param facetIndex facet index
139
+ * @param closeLoop true to add an edge from last to first vertex.
119
140
  */
120
141
  addPath(vertexArray, facetIndex, closeLoop = true) {
121
142
  if (vertexArray.length === 0)
@@ -146,16 +167,20 @@ class IndexedEdgeMatcher {
146
167
  }
147
168
  }
148
169
  /**
149
- * sort the edges, and look for three categories of paired edges:
170
+ * Sort the edges, and look for three categories of paired edges:
150
171
  * * caller must allocate all result arrays of interest.
151
172
  * * Any combination of the result arrays may be `undefined`, indicating that category is to be ignored.
152
- * * Any combination of the result arrays may be aliased as the same target, in which case those to categories are merged into the target.
153
- * * For instance, to ignore manifold pairs and collect all others (singleton, null, and other) as a single array `allOther`, create `const allOther = []` as an empty array and call
173
+ * * Any combination of the result arrays may be aliased as the same target, in which case those to categories are
174
+ * 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
154
177
  * `sortAndCollectClusters (undefined, allOther, allOther, allOther);`
155
- * @param manifoldPairs optional array to receive pairs of properly mated SortableEdgePairs, i.e. simple interior edges adjacent to two facets in opposing directions.
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.
156
180
  * @param singletons optional array to receive edges that are simple boundary edges.
157
181
  * @param nullEdges optional array to receive arrays of null edges (same start and end vertex)
158
- * @param allOtherClusters optional array to receive arrays in which all the edges are partners in an undirected sense but not a simple directed pair.
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.
159
184
  */
160
185
  sortAndCollectClusters(manifoldPairs, singletons, nullEdges, allOtherClusters) {
161
186
  this.sort();
@@ -172,7 +197,8 @@ class IndexedEdgeMatcher {
172
197
  for (let index0 = 0; index0 < n; index0 += clusterLength) {
173
198
  const baseEdge = this.edges[index0];
174
199
  clusterLength = 1;
175
- for (let index1 = index0 + 1; index1 < n && SortableEdge.areUndirectedPartners(baseEdge, this.edges[index1]); index1++) {
200
+ for (let index1 = index0 + 1; index1 < n &&
201
+ SortableEdge.areUndirectedPartners(baseEdge, this.edges[index1]); index1++) {
176
202
  clusterLength++;
177
203
  }
178
204
  if (this.edges[index0].isNullEdge) {
@@ -1 +1 @@
1
- {"version":3,"file":"IndexedEdgeMatcher.js","sourceRoot":"","sources":["../../../src/polyface/IndexedEdgeMatcher.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH;;;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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;AAvFD,gDAuFC","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.\n */\nexport class SortableEdge extends Float64Array {\n /** Return the vertex index that appears first in the order stored. */\n public get vertexIndexA(): number { return this[0]; }\n /** Return the vertex index that appears second in the order stored. */\n public get vertexIndexB(): number { return this[1]; }\n /** Return the facet index. */\n public get facetIndex(): number { return this[2]; }\n /** return true if vertexIndexA is less than vertexIndexB */\n public get isLowHigh(): boolean { return this[0] < this[1]; }\n /** Return the vertex index with lower numeric value */\n public get lowVertexIndex(): number { return this[0] < this[1] ? this[0] : this[1]; }\n /** Return the vertex index with higher numeric value */\n public get highVertexIndex(): number { return this[0] > this[1] ? this[0] : this[1]; }\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 { return edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0]; }\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 /** 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 { return this[0] === this[1]; }\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 { return [this[0], this[1], this[2]]; }\n public static clusterToJSON(data: SortableEdgeCluster): any {\n if (data instanceof SortableEdge)\n return data.toJSON();\n\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}\n\nexport type SortableEdgeCluster = SortableEdge | SortableEdge[];\n/**\n * An IndexedEdgeMatcher carries an array (`edges`) of edges start & end indices for sorting and subsequent analyses (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 * @returns the edge (as emplaced at the back of the sortableEdge array)\n * @param vertexA start vertex\n * @param vertexB end vertex\n * @param facetIndex facet index\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\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 /**\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 merged into the target.\n * * For instance, to ignore manifold pairs and collect all others (singleton, null, and other) as a single array `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 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 but not a simple directed pair.\n */\n public sortAndCollectClusters(manifoldPairs: SortableEdgeCluster[] | undefined, singletons?: SortableEdgeCluster[], nullEdges?: SortableEdgeCluster[], allOtherClusters?: SortableEdgeCluster[]) {\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 && 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":"IndexedEdgeMatcher.js","sourceRoot":"","sources":["../../../src/polyface/IndexedEdgeMatcher.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH;;;;;;GAMG;AACH,MAAa,YAAa,SAAQ,YAAY;IAC5C,uEAAuE;IACvE,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IACD,wEAAwE;IACxE,IAAW,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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;AAjGD,gDAiGC","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.\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 /** Return the facet index. */\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 (`edges`) of edges 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 facet index\n * @returns the edge (as emplaced at the back of the sortableEdge 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 facet index\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"]}
@@ -95,7 +95,8 @@ export declare class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor
95
95
  static createSubsetVisitor(polyface: IndexedPolyface, activeFacetIndices: number[], numWrap?: number): IndexedPolyfaceSubsetVisitor;
96
96
  /**
97
97
  * 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 the client polyface.
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.
99
100
  * @return whether the iterator was successfully moved.
100
101
  */
101
102
  moveToReadIndex(activeIndex: number): boolean;
@@ -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;IAYhE,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,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,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AAQ,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,MAAU,GAC3E,4BAA4B;IAG/B;;;;;OAKG;IACa,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAQ7D;;;OAGG;IACa,eAAe,IAAI,OAAO;IAM1C,qGAAqG;IACrF,KAAK,IAAI,IAAI;IAI7B;;;;OAIG;IACI,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAKjE,iEAAiE;IACjD,sBAAsB,IAAI,MAAM;IAGhD;;;;;;;;;;;;MAYE;WACY,sBAAsB,CAClC,IAAI,EAAE,eAAe,GAAG,sBAAsB,EAC9C,aAAa,GAAE,QAA2B,EAC1C,SAAS,GAAE,KAAgC,EAC3C,OAAO,GAAE,MAAU,GAClB,4BAA4B;CAiBhC"}
@@ -209,7 +209,8 @@ class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor {
209
209
  }
210
210
  /**
211
211
  * Advance the iterator to a particular facet in the subset of client polyface facets.
212
- * @param activeIndex the index of the facet within the subset, not to be confused with the index of the facet within the client polyface.
212
+ * @param activeIndex the index of the facet within the subset, not to be confused with the index of the facet within
213
+ * the client polyface.
213
214
  * @return whether the iterator was successfully moved.
214
215
  */
215
216
  moveToReadIndex(activeIndex) {
@@ -1 +1 @@
1
- {"version":3,"file":"IndexedPolyfaceVisitor.js","sourceRoot":"","sources":["../../../src/polyface/IndexedPolyfaceVisitor.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAAuC;AACvC,+CAA4C;AAE5C,mEAAyD;AACzD,yDAAsD;AACtD,yCAA8D;AAC9D,iDAA8C;AAE9C;;;;GAIG;AACH,MAAa,sBAAuB,SAAQ,2BAAY;IAMtD,sEAAsE;IACtE,YAAsB,QAAyB,EAAE,OAAe;QAC9D,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,E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IACjD,sBAAsB;QACpC,OAAO,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACxE,CAAC;IACD;;;;;;;;;;;;MAYE;IACK,MAAM,CAAC,sBAAsB,CAAC,IAA8C,EAAE,gBAA0B,0BAAQ,CAAC,KAAK,EAAE,EAAE,YAAmB,aAAK,CAAC,gBAAgB,EAAE,EAAE,UAAkB,CAAC;QAC/L,IAAI,IAAI,YAAY,0BAAe;YACjC,OAAO,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAC9F,MAAM,OAAO,GAAG,IAAI,CAAC;QACrB,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,MAAM,WAAW,GAAG,0BAAQ,CAAC,UAAU,EAAE,CAAC;QAC1C,KAAK,OAAO,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,eAAe,EAAE,GAAI,CAAC;YAClD,IAAI,CAAC,uBAAU,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,WAAW,CAAC;gBACpD,SAAS,CAAC,mBAAmB;YAC/B,IAAI,WAAW,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,GAAG;gBAC7C,SAAS,CAAC,uCAAuC;YACnD,IAAI,WAAW,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,0BAA0B,CAAC,SAAS,CAAC;gBACzF,SAAS,CAAC,oBAAoB;YAChC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,4BAA4B,CAAC,mBAAmB,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACrG,CAAC;CACF;AA/FD,oEA+FC","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\nimport { Geometry } from \"../Geometry\";\nimport { Angle } from \"../geometry3d/Angle\";\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\nimport { Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { PolygonOps } from \"../geometry3d/PolygonOps\";\nimport { IndexedPolyface, PolyfaceVisitor } from \"./Polyface\";\nimport { PolyfaceData } from \"./PolyfaceData\";\n\n/**\n * An `IndexedPolyfaceVisitor` is an iterator-like object that \"visits\" facets of a mesh.\n * * The visitor extends `PolyfaceData`, so it can at any time hold all the data of a single facet.\n * @public\n */\nexport class IndexedPolyfaceVisitor extends PolyfaceData implements PolyfaceVisitor {\n private _currentFacetIndex: number;\n private _nextFacetIndex: number;\n private _numWrap: number;\n private _numEdges: number;\n private _polyface: IndexedPolyface;\n // to be called from static factory method that validates the polyface\n protected constructor(polyface: IndexedPolyface, numWrap: number) {\n super(polyface.data.normalCount > 0, polyface.data.paramCount > 0, polyface.data.colorCount > 0, polyface.twoSided);\n this._polyface = polyface;\n this._numWrap = numWrap;\n if (polyface.data.auxData)\n this.auxData = polyface.data.auxData.createForVisitor();\n this.reset();\n this._numEdges = 0;\n this._nextFacetIndex = 0;\n this._currentFacetIndex = -1;\n\n }\n /** Return the client polyface object. */\n public clientPolyface(): IndexedPolyface {\n return this._polyface;\n }\n /** Return the number of facets this visitor is able to visit. */\n public getVisitableFacetCount(): number {\n return this._polyface.facetCount;\n }\n /**\n * Set the number of vertices replicated in visitor arrays (both data and index arrays).\n * * 0,1,2 are the most common as numWrap.\n * * Example: suppose `[6,7,8]` is the pointIndex array representing a triangle. First edge would be `6,7`. Second\n * edge is `7,8`. Third edge is `8,6`. To access `6` for the third edge, we have to go back to the start of array.\n * Therefore, it is useful to store `6` at the end of pointIndex array, i.e., `[6,7,8,6]` meaning `numWrap = 1`.\n * Continuing this example, `numWrap = 2` (i.e., `[6,7,8,6,7]`) is useful when each vertex visit requires the next\n * two points, e.g., to form two adjacent vectors for a cross product.\n */\n public setNumWrap(numWrap: number) {\n this._numWrap = numWrap;\n }\n /**\n * Return the number of edges in the current facet.\n * * If `numWrap > 0` for this visitor, the number of edges is smaller than the number of points.\n */\n public get numEdgesThisFacet(): number {\n return this._numEdges;\n }\n /** Create a visitor for iterating the facets of `polyface`. */\n public static create(polyface: IndexedPolyface, numWrap: number): IndexedPolyfaceVisitor {\n return new IndexedPolyfaceVisitor(polyface, numWrap);\n }\n /** Advance the iterator to a particular facet in the client polyface. */\n public moveToReadIndex(facetIndex: number): boolean {\n if (!this._polyface.isValidFacetIndex(facetIndex))\n return false;\n this._currentFacetIndex = facetIndex;\n this._nextFacetIndex = facetIndex + 1;\n this._numEdges = this._polyface.numEdgeInFacet(facetIndex);\n this.resizeAllArrays(this._numEdges + this._numWrap);\n this.gatherIndexedData(\n this._polyface.data,\n this._polyface.facetIndex0(this._currentFacetIndex),\n this._polyface.facetIndex1(this._currentFacetIndex),\n this._numWrap,\n );\n return true;\n }\n /** Advance the iterator to a the 'next' facet in the client polyface. */\n public moveToNextFacet(): boolean {\n if (this._nextFacetIndex !== this._currentFacetIndex)\n return this.moveToReadIndex(this._nextFacetIndex);\n this._nextFacetIndex++;\n return true;\n }\n /** Reset the iterator to start at the first facet of the polyface. */\n public reset(): void {\n this.moveToReadIndex(0);\n this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here.\n }\n /**\n * Attempts to extract the distance parameter for the given vertex `index` on the current facet.\n * Returns the distance parameter as a point. Returns `undefined` on failure.\n */\n public tryGetDistanceParameter(index: number, result?: Point2d): Point2d | undefined {\n if (index < 0 || index >= this.numEdgesThisFacet)\n return undefined;\n if (this.param === undefined || this._polyface.data.face.length === 0)\n return undefined;\n const faceData = this._polyface.tryGetFaceData(this._currentFacetIndex);\n if (!faceData)\n return undefined;\n return faceData.convertParamXYToDistance(\n this.param.getXAtUncheckedPointIndex(index),\n this.param.getYAtUncheckedPointIndex(index),\n result,\n );\n }\n /**\n * Attempts to extract the normalized parameter (0,1) for the given vertex `index` on the current facet.\n * Returns the normalized parameter as a point. Returns `undefined` on failure.\n */\n public tryGetNormalizedParameter(index: number, result?: Point2d): Point2d | undefined {\n if (index < 0 || index >= this.numEdgesThisFacet)\n return undefined;\n if (this.param === undefined || this._polyface.data.face.length === 0)\n return undefined;\n const faceData = this._polyface.tryGetFaceData(this._currentFacetIndex);\n if (!faceData)\n return undefined;\n return faceData.convertParamXYToNormalized(\n this.param.getXAtUncheckedPointIndex(index),\n this.param.getYAtUncheckedPointIndex(index),\n result,\n );\n }\n /** Return the index (in the client polyface) of the current facet. */\n public currentReadIndex(): number {\n return this._currentFacetIndex;\n }\n /** Return the point index of vertex `i` within the currently loaded facet. */\n public clientPointIndex(i: number): number {\n return this.pointIndex[i];\n }\n /** Return the param index of vertex `i` within the currently loaded facet. */\n public clientParamIndex(i: number): number {\n return this.paramIndex ? this.paramIndex[i] : -1;\n }\n /** Return the normal index of vertex `i` within the currently loaded facet. */\n public clientNormalIndex(i: number): number {\n return this.normalIndex ? this.normalIndex[i] : -1;\n }\n /** Return the color index of vertex `i` within the currently loaded facet. */\n public clientColorIndex(i: number): number {\n return this.colorIndex ? this.colorIndex[i] : -1;\n }\n /** Return the aux data index of vertex `i` within the currently loaded facet. */\n public clientAuxIndex(i: number): number {\n return this.auxData ? this.auxData.indices[i] : -1;\n }\n /** Clear the contents of all arrays. */\n public clearArrays(): void {\n this.point.length = 0;\n this.edgeVisible.length = 0;\n if (this.param !== undefined)\n this.param.length = 0;\n if (this.normal !== undefined)\n this.normal.length = 0;\n if (this.color !== undefined)\n this.color.length = 0;\n // TODO: indices? auxData? taggedNumericData?\n }\n /** Transfer data from a specified `index` of the `other` visitor as new data in this visitor. */\n public pushDataFrom(other: PolyfaceVisitor, index: number): void {\n this.point.pushFromGrowableXYZArray(other.point, index);\n this.edgeVisible.push(other.edgeVisible[index]);\n if (this.param && other.param && index < other.param.length)\n this.param.pushFromGrowableXYArray(other.param, index);\n if (this.normal && other.normal && index < other.normal.length)\n this.normal.pushFromGrowableXYZArray(other.normal, index);\n if (this.color && other.color && index < other.color.length)\n this.color.push(other.color[index]);\n // TODO: indices? auxData? taggedNumericData?\n }\n /**\n * Transfer interpolated data from the other visitor.\n * * All data values are interpolated at `fraction` between `other` values at `index0` and `index1`.\n */\n public pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void {\n if (index0 > index1)\n this.pushInterpolatedDataFrom(other, index1, 1.0 - fraction, index0);\n this.point.pushInterpolatedFromGrowableXYZArray(other.point, index0, fraction, index1);\n const newVisibility = (((index0 + 1) % other.edgeVisible.length) === index1) ? other.edgeVisible[index0] : false;\n this.edgeVisible.push(newVisibility); // interpolation along an edge preserves visibility of original edge\n if (this.param && other.param && index0 < other.param.length && index1 < other.param.length)\n this.param.pushInterpolatedFromGrowableXYArray(other.param, index0, fraction, index1);\n if (this.normal && other.normal && index0 < other.normal.length && index1 < other.normal.length)\n this.normal.pushInterpolatedFromGrowableXYZArray(other.normal, index0, fraction, index1);\n if (this.color && other.color && index0 < other.color.length && index1 < other.color.length)\n this.color.push(Geometry.interpolateColor(other.color[index0], fraction, other.color[index1]));\n // TODO: auxData? taggedNumericData?\n }\n}\n/**\n * An `IndexedPolyfaceSubsetVisitor` is an `IndexedPolyfaceVisitor` which only visits a subset of facets in the polyface.\n * * The subset is defined by an array of facet indices provided when this visitor is created.\n * * Input indices (e.g., for `moveToReadIndex`) are understood to be indices into the subset array.\n * @public\n */\nexport class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor {\n private _parentFacetIndices?: number[]; // only undefined during super constructor!\n private _currentActiveIndex: number; // index within _parentFacetIndices, or -1 after construction\n private _nextActiveIndex: number; // index within _parentFacetIndices\n\n private constructor(polyface: IndexedPolyface, activeFacetIndices: number[], numWrap: number) {\n super(polyface, numWrap);\n this._parentFacetIndices = activeFacetIndices.slice();\n this._currentActiveIndex = -1;\n this._nextActiveIndex = 0;\n }\n private isValidSubsetIndex(index: number): boolean {\n return (undefined !== this._parentFacetIndices) && index >= 0 && index < this._parentFacetIndices.length;\n }\n /**\n * Create a visitor for iterating a subset of the facets of `polyface`.\n * @param polyface reference to the client polyface, supplying facets\n * @param activeFacetIndices array of indices of facets in the client polyface to visit. This array is cloned.\n * @param numWrap number of vertices replicated in the visitor arrays to facilitate simpler caller code. Default is zero.\n */\n public static createSubsetVisitor(polyface: IndexedPolyface, activeFacetIndices: number[], numWrap: number = 0): IndexedPolyfaceSubsetVisitor {\n return new IndexedPolyfaceSubsetVisitor(polyface, activeFacetIndices, numWrap);\n }\n /**\n * Advance the iterator to a particular facet in the subset of client polyface facets.\n * @param activeIndex the index of the facet within the subset, not to be confused with the index of the facet within the client polyface.\n * @return whether the iterator was successfully moved.\n */\n public override moveToReadIndex(activeIndex: number): boolean {\n if (this.isValidSubsetIndex(activeIndex)) {\n this._currentActiveIndex = activeIndex;\n this._nextActiveIndex = activeIndex + 1;\n return super.moveToReadIndex(this._parentFacetIndices![activeIndex]);\n }\n return false;\n }\n /**\n * Advance the iterator to the next facet in the subset of client polyface facets.\n * @return whether the iterator was successfully moved.\n */\n public override moveToNextFacet(): boolean {\n if (this._nextActiveIndex !== this._currentActiveIndex)\n return this.moveToReadIndex(this._nextActiveIndex);\n this._nextActiveIndex++;\n return true;\n }\n /** Reset the iterator to start at the first active facet in the subset of client polyface facets. */\n public override reset(): void {\n this.moveToReadIndex(0);\n this._nextActiveIndex = 0; // so immediate moveToNextFacet stays here.\n }\n /**\n * Return the parent facet index of the indicated index within the subset of client polyface facets.\n * @param activeIndex index of the facet within the subset. Default is the active facet.\n * @return valid client polyface facet index, or `undefined` if invalid input index.\n */\n public parentFacetIndex(activeIndex?: number): number | undefined {\n if (undefined === activeIndex)\n activeIndex = this._currentActiveIndex;\n return this.isValidSubsetIndex(activeIndex) ? this._parentFacetIndices![activeIndex] : undefined;\n }\n /** Return the number of facets this visitor is able to visit. */\n public override getVisitableFacetCount(): number {\n return this._parentFacetIndices ? this._parentFacetIndices.length : 0;\n }\n /**\n * Create a visitor for those mesh facets with normal in the same half-space as the given vector.\n * * For example, to visit the top facets of a tiled terrain mesh but skip the \"skirt\" facets, pass\n * `compareVector = Vector3d.unitZ()` and a suitable `sideAngle` tolerance. Note that this will also\n * filter out *interior* facets that are nearly vertical, not just the \"skirt\" facets on the boundary.\n * @param mesh the mesh from which to select facets\n * @param compareVector vector to which to compare facet normals. The visitor will visit only those facets\n * with normals in the same half-space as this vector. Default is 001.\n * @param sideAngle optional angular tolerance to filter the facets near the border between half-spaces.\n * The visitor will *not* visit facets whose normals are nearly perpendicular to `compareVector`.\n * Default is [[Geometry.smallAngleRadians]].\n * @param numWrap optional number of entries replicated in visitor arrays. Default is 0.\n */\n public static createNormalComparison(mesh: IndexedPolyface | IndexedPolyfaceVisitor, compareVector: Vector3d = Vector3d.unitZ(), sideAngle: Angle = Angle.createSmallAngle(), numWrap: number = 0): IndexedPolyfaceSubsetVisitor {\n if (mesh instanceof IndexedPolyface)\n return this.createNormalComparison(mesh.createVisitor(), compareVector, sideAngle, numWrap);\n const visitor = mesh;\n const facets: number[] = [];\n const facetNormal = Vector3d.createZero();\n for (visitor.reset(); visitor.moveToNextFacet(); ) {\n if (!PolygonOps.unitNormal(visitor.point, facetNormal))\n continue; // degenerate facet\n if (facetNormal.dotProduct(compareVector) < 0.0)\n continue; // ignore facet facing other half-space\n if (facetNormal.angleFromPerpendicular(compareVector).isMagnitudeLessThanOrEqual(sideAngle))\n continue; // ignore side facet\n facets.push(visitor.currentReadIndex());\n }\n return IndexedPolyfaceSubsetVisitor.createSubsetVisitor(visitor.clientPolyface(), facets, numWrap);\n }\n}\n"]}
1
+ {"version":3,"file":"IndexedPolyfaceVisitor.js","sourceRoot":"","sources":["../../../src/polyface/IndexedPolyfaceVisitor.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AA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AAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,4BAA4B,CAAC,mBAAmB,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACrG,CAAC;CACF;AAvGD,oEAuGC","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\nimport { Geometry } from \"../Geometry\";\nimport { Angle } from \"../geometry3d/Angle\";\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\nimport { Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { PolygonOps } from \"../geometry3d/PolygonOps\";\nimport { IndexedPolyface, PolyfaceVisitor } from \"./Polyface\";\nimport { PolyfaceData } from \"./PolyfaceData\";\n\n/**\n * An `IndexedPolyfaceVisitor` is an iterator-like object that \"visits\" facets of a mesh.\n * * The visitor extends `PolyfaceData`, so it can at any time hold all the data of a single facet.\n * @public\n */\nexport class IndexedPolyfaceVisitor extends PolyfaceData implements PolyfaceVisitor {\n private _currentFacetIndex: number;\n private _nextFacetIndex: number;\n private _numWrap: number;\n private _numEdges: number;\n private _polyface: IndexedPolyface;\n // to be called from static factory method that validates the polyface\n protected constructor(polyface: IndexedPolyface, numWrap: number) {\n super(polyface.data.normalCount > 0, polyface.data.paramCount > 0, polyface.data.colorCount > 0, polyface.twoSided);\n this._polyface = polyface;\n this._numWrap = numWrap;\n if (polyface.data.auxData)\n this.auxData = polyface.data.auxData.createForVisitor();\n this.reset();\n this._numEdges = 0;\n this._nextFacetIndex = 0;\n this._currentFacetIndex = -1;\n\n }\n /** Return the client polyface object. */\n public clientPolyface(): IndexedPolyface {\n return this._polyface;\n }\n /** Return the number of facets this visitor is able to visit. */\n public getVisitableFacetCount(): number {\n return this._polyface.facetCount;\n }\n /**\n * Set the number of vertices replicated in visitor arrays (both data and index arrays).\n * * 0,1,2 are the most common as numWrap.\n * * Example: suppose `[6,7,8]` is the pointIndex array representing a triangle. First edge would be `6,7`. Second\n * edge is `7,8`. Third edge is `8,6`. To access `6` for the third edge, we have to go back to the start of array.\n * Therefore, it is useful to store `6` at the end of pointIndex array, i.e., `[6,7,8,6]` meaning `numWrap = 1`.\n * Continuing this example, `numWrap = 2` (i.e., `[6,7,8,6,7]`) is useful when each vertex visit requires the next\n * two points, e.g., to form two adjacent vectors for a cross product.\n */\n public setNumWrap(numWrap: number) {\n this._numWrap = numWrap;\n }\n /**\n * Return the number of edges in the current facet.\n * * If `numWrap > 0` for this visitor, the number of edges is smaller than the number of points.\n */\n public get numEdgesThisFacet(): number {\n return this._numEdges;\n }\n /** Create a visitor for iterating the facets of `polyface`. */\n public static create(polyface: IndexedPolyface, numWrap: number): IndexedPolyfaceVisitor {\n return new IndexedPolyfaceVisitor(polyface, numWrap);\n }\n /** Advance the iterator to a particular facet in the client polyface. */\n public moveToReadIndex(facetIndex: number): boolean {\n if (!this._polyface.isValidFacetIndex(facetIndex))\n return false;\n this._currentFacetIndex = facetIndex;\n this._nextFacetIndex = facetIndex + 1;\n this._numEdges = this._polyface.numEdgeInFacet(facetIndex);\n this.resizeAllArrays(this._numEdges + this._numWrap);\n this.gatherIndexedData(\n this._polyface.data,\n this._polyface.facetIndex0(this._currentFacetIndex),\n this._polyface.facetIndex1(this._currentFacetIndex),\n this._numWrap,\n );\n return true;\n }\n /** Advance the iterator to a the 'next' facet in the client polyface. */\n public moveToNextFacet(): boolean {\n if (this._nextFacetIndex !== this._currentFacetIndex)\n return this.moveToReadIndex(this._nextFacetIndex);\n this._nextFacetIndex++;\n return true;\n }\n /** Reset the iterator to start at the first facet of the polyface. */\n public reset(): void {\n this.moveToReadIndex(0);\n this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here.\n }\n /**\n * Attempts to extract the distance parameter for the given vertex `index` on the current facet.\n * Returns the distance parameter as a point. Returns `undefined` on failure.\n */\n public tryGetDistanceParameter(index: number, result?: Point2d): Point2d | undefined {\n if (index < 0 || index >= this.numEdgesThisFacet)\n return undefined;\n if (this.param === undefined || this._polyface.data.face.length === 0)\n return undefined;\n const faceData = this._polyface.tryGetFaceData(this._currentFacetIndex);\n if (!faceData)\n return undefined;\n return faceData.convertParamXYToDistance(\n this.param.getXAtUncheckedPointIndex(index),\n this.param.getYAtUncheckedPointIndex(index),\n result,\n );\n }\n /**\n * Attempts to extract the normalized parameter (0,1) for the given vertex `index` on the current facet.\n * Returns the normalized parameter as a point. Returns `undefined` on failure.\n */\n public tryGetNormalizedParameter(index: number, result?: Point2d): Point2d | undefined {\n if (index < 0 || index >= this.numEdgesThisFacet)\n return undefined;\n if (this.param === undefined || this._polyface.data.face.length === 0)\n return undefined;\n const faceData = this._polyface.tryGetFaceData(this._currentFacetIndex);\n if (!faceData)\n return undefined;\n return faceData.convertParamXYToNormalized(\n this.param.getXAtUncheckedPointIndex(index),\n this.param.getYAtUncheckedPointIndex(index),\n result,\n );\n }\n /** Return the index (in the client polyface) of the current facet. */\n public currentReadIndex(): number {\n return this._currentFacetIndex;\n }\n /** Return the point index of vertex `i` within the currently loaded facet. */\n public clientPointIndex(i: number): number {\n return this.pointIndex[i];\n }\n /** Return the param index of vertex `i` within the currently loaded facet. */\n public clientParamIndex(i: number): number {\n return this.paramIndex ? this.paramIndex[i] : -1;\n }\n /** Return the normal index of vertex `i` within the currently loaded facet. */\n public clientNormalIndex(i: number): number {\n return this.normalIndex ? this.normalIndex[i] : -1;\n }\n /** Return the color index of vertex `i` within the currently loaded facet. */\n public clientColorIndex(i: number): number {\n return this.colorIndex ? this.colorIndex[i] : -1;\n }\n /** Return the aux data index of vertex `i` within the currently loaded facet. */\n public clientAuxIndex(i: number): number {\n return this.auxData ? this.auxData.indices[i] : -1;\n }\n /** Clear the contents of all arrays. */\n public clearArrays(): void {\n this.point.length = 0;\n this.edgeVisible.length = 0;\n if (this.param !== undefined)\n this.param.length = 0;\n if (this.normal !== undefined)\n this.normal.length = 0;\n if (this.color !== undefined)\n this.color.length = 0;\n // TODO: indices? auxData? taggedNumericData?\n }\n /** Transfer data from a specified `index` of the `other` visitor as new data in this visitor. */\n public pushDataFrom(other: PolyfaceVisitor, index: number): void {\n this.point.pushFromGrowableXYZArray(other.point, index);\n this.edgeVisible.push(other.edgeVisible[index]);\n if (this.param && other.param && index < other.param.length)\n this.param.pushFromGrowableXYArray(other.param, index);\n if (this.normal && other.normal && index < other.normal.length)\n this.normal.pushFromGrowableXYZArray(other.normal, index);\n if (this.color && other.color && index < other.color.length)\n this.color.push(other.color[index]);\n // TODO: indices? auxData? taggedNumericData?\n }\n /**\n * Transfer interpolated data from the other visitor.\n * * All data values are interpolated at `fraction` between `other` values at `index0` and `index1`.\n */\n public pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void {\n if (index0 > index1)\n this.pushInterpolatedDataFrom(other, index1, 1.0 - fraction, index0);\n this.point.pushInterpolatedFromGrowableXYZArray(other.point, index0, fraction, index1);\n const newVisibility = (((index0 + 1) % other.edgeVisible.length) === index1) ? other.edgeVisible[index0] : false;\n this.edgeVisible.push(newVisibility); // interpolation along an edge preserves visibility of original edge\n if (this.param && other.param && index0 < other.param.length && index1 < other.param.length)\n this.param.pushInterpolatedFromGrowableXYArray(other.param, index0, fraction, index1);\n if (this.normal && other.normal && index0 < other.normal.length && index1 < other.normal.length)\n this.normal.pushInterpolatedFromGrowableXYZArray(other.normal, index0, fraction, index1);\n if (this.color && other.color && index0 < other.color.length && index1 < other.color.length)\n this.color.push(Geometry.interpolateColor(other.color[index0], fraction, other.color[index1]));\n // TODO: auxData? taggedNumericData?\n }\n}\n/**\n * An `IndexedPolyfaceSubsetVisitor` is an `IndexedPolyfaceVisitor` which only visits a subset of facets in the polyface.\n * * The subset is defined by an array of facet indices provided when this visitor is created.\n * * Input indices (e.g., for `moveToReadIndex`) are understood to be indices into the subset array.\n * @public\n */\nexport class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor {\n private _parentFacetIndices?: number[]; // only undefined during super constructor!\n private _currentActiveIndex: number; // index within _parentFacetIndices, or -1 after construction\n private _nextActiveIndex: number; // index within _parentFacetIndices\n\n private constructor(polyface: IndexedPolyface, activeFacetIndices: number[], numWrap: number) {\n super(polyface, numWrap);\n this._parentFacetIndices = activeFacetIndices.slice();\n this._currentActiveIndex = -1;\n this._nextActiveIndex = 0;\n }\n private isValidSubsetIndex(index: number): boolean {\n return (undefined !== this._parentFacetIndices) && index >= 0 && index < this._parentFacetIndices.length;\n }\n /**\n * Create a visitor for iterating a subset of the facets of `polyface`.\n * @param polyface reference to the client polyface, supplying facets\n * @param activeFacetIndices array of indices of facets in the client polyface to visit. This array is cloned.\n * @param numWrap number of vertices replicated in the visitor arrays to facilitate simpler caller code. Default is zero.\n */\n public static createSubsetVisitor(\n polyface: IndexedPolyface, activeFacetIndices: number[], numWrap: number = 0,\n ): IndexedPolyfaceSubsetVisitor {\n return new IndexedPolyfaceSubsetVisitor(polyface, activeFacetIndices, numWrap);\n }\n /**\n * Advance the iterator to a particular facet in the subset of client polyface facets.\n * @param activeIndex the index of the facet within the subset, not to be confused with the index of the facet within\n * the client polyface.\n * @return whether the iterator was successfully moved.\n */\n public override moveToReadIndex(activeIndex: number): boolean {\n if (this.isValidSubsetIndex(activeIndex)) {\n this._currentActiveIndex = activeIndex;\n this._nextActiveIndex = activeIndex + 1;\n return super.moveToReadIndex(this._parentFacetIndices![activeIndex]);\n }\n return false;\n }\n /**\n * Advance the iterator to the next facet in the subset of client polyface facets.\n * @return whether the iterator was successfully moved.\n */\n public override moveToNextFacet(): boolean {\n if (this._nextActiveIndex !== this._currentActiveIndex)\n return this.moveToReadIndex(this._nextActiveIndex);\n this._nextActiveIndex++;\n return true;\n }\n /** Reset the iterator to start at the first active facet in the subset of client polyface facets. */\n public override reset(): void {\n this.moveToReadIndex(0);\n this._nextActiveIndex = 0; // so immediate moveToNextFacet stays here.\n }\n /**\n * Return the parent facet index of the indicated index within the subset of client polyface facets.\n * @param activeIndex index of the facet within the subset. Default is the active facet.\n * @return valid client polyface facet index, or `undefined` if invalid input index.\n */\n public parentFacetIndex(activeIndex?: number): number | undefined {\n if (undefined === activeIndex)\n activeIndex = this._currentActiveIndex;\n return this.isValidSubsetIndex(activeIndex) ? this._parentFacetIndices![activeIndex] : undefined;\n }\n /** Return the number of facets this visitor is able to visit. */\n public override getVisitableFacetCount(): number {\n return this._parentFacetIndices ? this._parentFacetIndices.length : 0;\n }\n /**\n * Create a visitor for those mesh facets with normal in the same half-space as the given vector.\n * * For example, to visit the top facets of a tiled terrain mesh but skip the \"skirt\" facets, pass\n * `compareVector = Vector3d.unitZ()` and a suitable `sideAngle` tolerance. Note that this will also\n * filter out *interior* facets that are nearly vertical, not just the \"skirt\" facets on the boundary.\n * @param mesh the mesh from which to select facets\n * @param compareVector vector to which to compare facet normals. The visitor will visit only those facets\n * with normals in the same half-space as this vector. Default is 001.\n * @param sideAngle optional angular tolerance to filter the facets near the border between half-spaces.\n * The visitor will *not* visit facets whose normals are nearly perpendicular to `compareVector`.\n * Default is [[Geometry.smallAngleRadians]].\n * @param numWrap optional number of entries replicated in visitor arrays. Default is 0.\n */\n public static createNormalComparison(\n mesh: IndexedPolyface | IndexedPolyfaceVisitor,\n compareVector: Vector3d = Vector3d.unitZ(),\n sideAngle: Angle = Angle.createSmallAngle(),\n numWrap: number = 0,\n ): IndexedPolyfaceSubsetVisitor {\n if (mesh instanceof IndexedPolyface)\n return this.createNormalComparison(mesh.createVisitor(), compareVector, sideAngle, numWrap);\n const visitor = mesh;\n const facets: number[] = [];\n const facetNormal = Vector3d.createZero();\n for (visitor.reset(); visitor.moveToNextFacet();) {\n if (!PolygonOps.unitNormal(visitor.point, facetNormal))\n continue; // degenerate facet\n if (facetNormal.dotProduct(compareVector) < 0.0)\n continue; // ignore facet facing other half-space\n if (facetNormal.angleFromPerpendicular(compareVector).isMagnitudeLessThanOrEqual(sideAngle))\n continue; // ignore side facet\n facets.push(visitor.currentReadIndex());\n }\n return IndexedPolyfaceSubsetVisitor.createSubsetVisitor(visitor.clientPolyface(), facets, numWrap);\n }\n}\n"]}
@@ -89,11 +89,9 @@ export declare class IndexedPolyface extends Polyface {
89
89
  get isEmpty(): boolean;
90
90
  /**
91
91
  * Transform the mesh.
92
- * * Apply the transform to points.
93
- * * Apply the (inverse transpose of the) matrix part to normals.
94
- * * If determinant of the transform matrix is negative, also
95
- * * negate normals
96
- * * reverse index order around each facet.
92
+ * * If `transform` is a mirror, also reverse the index order around each facet.
93
+ * * Note that this method always returns true. If transforming the normals fails (due to singular matrix or zero
94
+ * normal), the original normal(s) are left unchanged.
97
95
  */
98
96
  tryTransformInPlace(transform: Transform): boolean;
99
97
  /** Reverse indices for a single facet. */
@@ -1 +1 @@
1
- {"version":3,"file":"Polyface.d.ts","sourceRoot":"","sources":["../../../src/polyface/Polyface.ts"],"names":[],"mappings":"AAKA;;GAEG;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;GAIG;AACH,8BAAsB,QAAS,SAAQ,aAAa;IAClD,wCAAwC;IACxC,SAAgB,gBAAgB,cAAc;IAC9C,gCAAgC;IACzB,IAAI,EAAE,YAAY,CA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126
126
  * Transform the mesh.
127
- * * Apply the transform to points.
128
- * * Apply the (inverse transpose of the) matrix part to normals.
129
- * * If determinant of the transform matrix is negative, also
130
- * * negate normals
131
- * * reverse index order around each facet.
127
+ * * If `transform` is a mirror, also reverse the index order around each facet.
128
+ * * Note that this method always returns true. If transforming the normals fails (due to singular matrix or zero
129
+ * normal), the original normal(s) are left unchanged.
132
130
  */
133
131
  tryTransformInPlace(transform) {
134
- if (!this.data.tryTransformInPlace(transform))
135
- return false;
136
- const determinant = transform.matrix.determinant();
137
- if (determinant < 0) {
132
+ this.data.tryTransformInPlace(transform);
133
+ if (transform.matrix.determinant() < 0)
138
134
  this.reverseIndices();
139
- this.reverseNormals();
140
- }
141
135
  return true;
142
136
  }
143
137
  /** Reverse indices for a single facet. */
@@ -146,8 +140,7 @@ class IndexedPolyface extends Polyface {
146
140
  }
147
141
  /** Return a deep clone. */
148
142
  clone() {
149
- const result = new IndexedPolyface(this.data.clone(), this._facetStart.slice(), this._facetToFaceData.slice());
150
- return result;
143
+ return new IndexedPolyface(this.data.clone(), this._facetStart.slice(), this._facetToFaceData.slice());
151
144
  }
152
145
  /**
153
146
  * Return a deep clone with transformed points and normals.