@itwin/core-geometry 4.10.0-dev.9 → 5.0.0-dev.0

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 (338) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/lib/cjs/Geometry.js +2 -2
  3. package/lib/cjs/Geometry.js.map +1 -1
  4. package/lib/cjs/bspline/BSpline1dNd.d.ts.map +1 -1
  5. package/lib/cjs/bspline/BSpline1dNd.js +0 -1
  6. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  7. package/lib/cjs/bspline/BSplineCurve.d.ts +5 -3
  8. package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
  9. package/lib/cjs/bspline/BSplineCurve.js +5 -4
  10. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  11. package/lib/cjs/clipping/ClipVector.js +1 -1
  12. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  13. package/lib/cjs/core-geometry.d.ts +1 -1
  14. package/lib/cjs/core-geometry.d.ts.map +1 -1
  15. package/lib/cjs/core-geometry.js +1 -1
  16. package/lib/cjs/core-geometry.js.map +1 -1
  17. package/lib/cjs/curve/Arc3d.d.ts +136 -128
  18. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  19. package/lib/cjs/curve/Arc3d.js +177 -152
  20. package/lib/cjs/curve/Arc3d.js.map +1 -1
  21. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +7 -5
  22. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  23. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +9 -7
  24. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  25. package/lib/cjs/curve/CurveCollection.d.ts +21 -2
  26. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  27. package/lib/cjs/curve/CurveCollection.js +45 -10
  28. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  29. package/lib/cjs/curve/CurveExtendMode.d.ts +18 -15
  30. package/lib/cjs/curve/CurveExtendMode.d.ts.map +1 -1
  31. package/lib/cjs/curve/CurveExtendMode.js +18 -17
  32. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  33. package/lib/cjs/curve/CurveFactory.d.ts +11 -13
  34. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  35. package/lib/cjs/curve/CurveFactory.js +19 -46
  36. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  37. package/lib/cjs/curve/CurvePrimitive.d.ts +9 -5
  38. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  39. package/lib/cjs/curve/CurvePrimitive.js +9 -5
  40. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  41. package/lib/cjs/curve/CurveProcessor.d.ts.map +1 -1
  42. package/lib/cjs/curve/CurveProcessor.js +0 -1
  43. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  44. package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
  45. package/lib/cjs/curve/LineSegment3d.js +2 -3
  46. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  47. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  48. package/lib/cjs/curve/OffsetOptions.d.ts.map +1 -1
  49. package/lib/cjs/curve/OffsetOptions.js +4 -4
  50. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  51. package/lib/cjs/curve/Path.d.ts +14 -0
  52. package/lib/cjs/curve/Path.d.ts.map +1 -1
  53. package/lib/cjs/curve/Path.js +27 -0
  54. package/lib/cjs/curve/Path.js.map +1 -1
  55. package/lib/cjs/curve/PointString3d.d.ts.map +1 -1
  56. package/lib/cjs/curve/PointString3d.js +0 -1
  57. package/lib/cjs/curve/PointString3d.js.map +1 -1
  58. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  59. package/lib/cjs/curve/StrokeOptions.js +0 -1
  60. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  61. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  62. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +5 -6
  63. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  64. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  65. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +10 -10
  66. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  67. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
  68. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +4 -4
  69. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  70. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts +18 -18
  71. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  72. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +46 -42
  73. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  74. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +5 -4
  75. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  76. package/lib/cjs/geometry3d/AngleSweep.d.ts +10 -6
  77. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  78. package/lib/cjs/geometry3d/AngleSweep.js +15 -12
  79. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  80. package/lib/cjs/geometry3d/BilinearPatch.js +4 -4
  81. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  82. package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
  83. package/lib/cjs/geometry3d/FrameBuilder.js +0 -1
  84. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  85. package/lib/cjs/geometry3d/IndexedXYCollection.d.ts.map +1 -1
  86. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  87. package/lib/cjs/geometry3d/Matrix3d.d.ts +28 -17
  88. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  89. package/lib/cjs/geometry3d/Matrix3d.js +36 -17
  90. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  91. package/lib/cjs/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
  92. package/lib/cjs/geometry3d/Point2dArrayCarrier.js +2 -3
  93. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  94. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +6 -5
  95. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  96. package/lib/cjs/geometry3d/Point3dVector3d.js +6 -5
  97. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  98. package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
  99. package/lib/cjs/geometry3d/PointHelpers.js +0 -1
  100. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  101. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  102. package/lib/cjs/geometry3d/PolygonOps.js +2 -4
  103. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  104. package/lib/cjs/geometry3d/Ray3d.js +2 -2
  105. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  106. package/lib/cjs/geometry3d/YawPitchRollAngles.d.ts.map +1 -1
  107. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  108. package/lib/cjs/geometry4d/Map4d.d.ts +5 -5
  109. package/lib/cjs/geometry4d/Map4d.js +5 -5
  110. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  111. package/lib/cjs/geometry4d/Matrix4d.d.ts +4 -7
  112. package/lib/cjs/geometry4d/Matrix4d.d.ts.map +1 -1
  113. package/lib/cjs/geometry4d/Matrix4d.js +4 -7
  114. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  115. package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
  116. package/lib/cjs/geometry4d/Point4d.js +2 -1
  117. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  118. package/lib/cjs/numerics/BezierPolynomials.d.ts.map +1 -1
  119. package/lib/cjs/numerics/BezierPolynomials.js +0 -1
  120. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  121. package/lib/cjs/numerics/Newton.d.ts +3 -0
  122. package/lib/cjs/numerics/Newton.d.ts.map +1 -1
  123. package/lib/cjs/numerics/Newton.js +2 -5
  124. package/lib/cjs/numerics/Newton.js.map +1 -1
  125. package/lib/cjs/numerics/Polynomials.d.ts +46 -201
  126. package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
  127. package/lib/cjs/numerics/Polynomials.js +132 -445
  128. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  129. package/lib/cjs/numerics/Range1dArray.js +2 -2
  130. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  131. package/lib/cjs/numerics/SmallSystem.d.ts +164 -0
  132. package/lib/cjs/numerics/SmallSystem.d.ts.map +1 -0
  133. package/lib/cjs/numerics/SmallSystem.js +321 -0
  134. package/lib/cjs/numerics/SmallSystem.js.map +1 -0
  135. package/lib/cjs/polyface/AuxData.d.ts.map +1 -1
  136. package/lib/cjs/polyface/AuxData.js.map +1 -1
  137. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  138. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +0 -1
  139. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  140. package/lib/cjs/polyface/Polyface.d.ts +2 -2
  141. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  142. package/lib/cjs/polyface/Polyface.js +0 -1
  143. package/lib/cjs/polyface/Polyface.js.map +1 -1
  144. package/lib/cjs/polyface/PolyfaceBuilder.js +1 -1
  145. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  146. package/lib/cjs/polyface/PolyfaceClip.d.ts +3 -3
  147. package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
  148. package/lib/cjs/polyface/PolyfaceClip.js +1 -2
  149. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  150. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  151. package/lib/cjs/polyface/PolyfaceQuery.js +0 -1
  152. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  153. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  154. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  155. package/lib/cjs/polyface/multiclip/OffsetMeshContext.d.ts +1 -1
  156. package/lib/cjs/polyface/multiclip/OffsetMeshContext.d.ts.map +1 -1
  157. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js +7 -7
  158. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  159. package/lib/cjs/serialization/DeepCompare.d.ts.map +1 -1
  160. package/lib/cjs/serialization/DeepCompare.js +0 -1
  161. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  162. package/lib/cjs/topology/Graph.d.ts.map +1 -1
  163. package/lib/cjs/topology/Graph.js +2 -2
  164. package/lib/cjs/topology/Graph.js.map +1 -1
  165. package/lib/cjs/topology/InsertAndRetriangulateContext.js +2 -2
  166. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  167. package/lib/cjs/topology/Merging.d.ts +1 -1
  168. package/lib/cjs/topology/Merging.d.ts.map +1 -1
  169. package/lib/cjs/topology/Merging.js +2 -2
  170. package/lib/cjs/topology/Merging.js.map +1 -1
  171. package/lib/esm/Geometry.js +2 -2
  172. package/lib/esm/Geometry.js.map +1 -1
  173. package/lib/esm/bspline/BSpline1dNd.d.ts.map +1 -1
  174. package/lib/esm/bspline/BSpline1dNd.js +0 -1
  175. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  176. package/lib/esm/bspline/BSplineCurve.d.ts +5 -3
  177. package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
  178. package/lib/esm/bspline/BSplineCurve.js +5 -4
  179. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  180. package/lib/esm/clipping/ClipVector.js +1 -1
  181. package/lib/esm/clipping/ClipVector.js.map +1 -1
  182. package/lib/esm/core-geometry.d.ts +1 -1
  183. package/lib/esm/core-geometry.d.ts.map +1 -1
  184. package/lib/esm/core-geometry.js +1 -1
  185. package/lib/esm/core-geometry.js.map +1 -1
  186. package/lib/esm/curve/Arc3d.d.ts +136 -128
  187. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  188. package/lib/esm/curve/Arc3d.js +177 -152
  189. package/lib/esm/curve/Arc3d.js.map +1 -1
  190. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +7 -5
  191. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  192. package/lib/esm/curve/CurveChainWithDistanceIndex.js +9 -7
  193. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  194. package/lib/esm/curve/CurveCollection.d.ts +21 -2
  195. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  196. package/lib/esm/curve/CurveCollection.js +45 -10
  197. package/lib/esm/curve/CurveCollection.js.map +1 -1
  198. package/lib/esm/curve/CurveExtendMode.d.ts +18 -15
  199. package/lib/esm/curve/CurveExtendMode.d.ts.map +1 -1
  200. package/lib/esm/curve/CurveExtendMode.js +18 -17
  201. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  202. package/lib/esm/curve/CurveFactory.d.ts +11 -13
  203. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  204. package/lib/esm/curve/CurveFactory.js +17 -44
  205. package/lib/esm/curve/CurveFactory.js.map +1 -1
  206. package/lib/esm/curve/CurvePrimitive.d.ts +9 -5
  207. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  208. package/lib/esm/curve/CurvePrimitive.js +9 -5
  209. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  210. package/lib/esm/curve/CurveProcessor.d.ts.map +1 -1
  211. package/lib/esm/curve/CurveProcessor.js +0 -1
  212. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  213. package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
  214. package/lib/esm/curve/LineSegment3d.js +1 -2
  215. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  216. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  217. package/lib/esm/curve/OffsetOptions.d.ts.map +1 -1
  218. package/lib/esm/curve/OffsetOptions.js +4 -4
  219. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  220. package/lib/esm/curve/Path.d.ts +14 -0
  221. package/lib/esm/curve/Path.d.ts.map +1 -1
  222. package/lib/esm/curve/Path.js +27 -0
  223. package/lib/esm/curve/Path.js.map +1 -1
  224. package/lib/esm/curve/PointString3d.d.ts.map +1 -1
  225. package/lib/esm/curve/PointString3d.js +0 -1
  226. package/lib/esm/curve/PointString3d.js.map +1 -1
  227. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  228. package/lib/esm/curve/StrokeOptions.js +0 -1
  229. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  230. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  231. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +4 -5
  232. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  233. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  234. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +5 -5
  235. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  236. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
  237. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +3 -3
  238. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  239. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts +18 -18
  240. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  241. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +46 -42
  242. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  243. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +5 -4
  244. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  245. package/lib/esm/geometry3d/AngleSweep.d.ts +10 -6
  246. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  247. package/lib/esm/geometry3d/AngleSweep.js +15 -12
  248. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  249. package/lib/esm/geometry3d/BilinearPatch.js +1 -1
  250. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  251. package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
  252. package/lib/esm/geometry3d/FrameBuilder.js +0 -1
  253. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  254. package/lib/esm/geometry3d/IndexedXYCollection.d.ts.map +1 -1
  255. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  256. package/lib/esm/geometry3d/Matrix3d.d.ts +28 -17
  257. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  258. package/lib/esm/geometry3d/Matrix3d.js +36 -17
  259. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  260. package/lib/esm/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
  261. package/lib/esm/geometry3d/Point2dArrayCarrier.js +0 -1
  262. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  263. package/lib/esm/geometry3d/Point3dVector3d.d.ts +6 -5
  264. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  265. package/lib/esm/geometry3d/Point3dVector3d.js +6 -5
  266. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  267. package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
  268. package/lib/esm/geometry3d/PointHelpers.js +0 -1
  269. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  270. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  271. package/lib/esm/geometry3d/PolygonOps.js +2 -4
  272. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  273. package/lib/esm/geometry3d/Ray3d.js +1 -1
  274. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  275. package/lib/esm/geometry3d/YawPitchRollAngles.d.ts.map +1 -1
  276. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  277. package/lib/esm/geometry4d/Map4d.d.ts +5 -5
  278. package/lib/esm/geometry4d/Map4d.js +5 -5
  279. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  280. package/lib/esm/geometry4d/Matrix4d.d.ts +4 -7
  281. package/lib/esm/geometry4d/Matrix4d.d.ts.map +1 -1
  282. package/lib/esm/geometry4d/Matrix4d.js +4 -7
  283. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  284. package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
  285. package/lib/esm/geometry4d/Point4d.js +2 -1
  286. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  287. package/lib/esm/numerics/BezierPolynomials.d.ts.map +1 -1
  288. package/lib/esm/numerics/BezierPolynomials.js +0 -1
  289. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  290. package/lib/esm/numerics/Newton.d.ts +3 -0
  291. package/lib/esm/numerics/Newton.d.ts.map +1 -1
  292. package/lib/esm/numerics/Newton.js +1 -4
  293. package/lib/esm/numerics/Newton.js.map +1 -1
  294. package/lib/esm/numerics/Polynomials.d.ts +46 -201
  295. package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
  296. package/lib/esm/numerics/Polynomials.js +132 -444
  297. package/lib/esm/numerics/Polynomials.js.map +1 -1
  298. package/lib/esm/numerics/SmallSystem.d.ts +164 -0
  299. package/lib/esm/numerics/SmallSystem.d.ts.map +1 -0
  300. package/lib/esm/numerics/SmallSystem.js +317 -0
  301. package/lib/esm/numerics/SmallSystem.js.map +1 -0
  302. package/lib/esm/polyface/AuxData.d.ts.map +1 -1
  303. package/lib/esm/polyface/AuxData.js.map +1 -1
  304. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  305. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +0 -1
  306. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  307. package/lib/esm/polyface/Polyface.d.ts +2 -2
  308. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  309. package/lib/esm/polyface/Polyface.js +0 -1
  310. package/lib/esm/polyface/Polyface.js.map +1 -1
  311. package/lib/esm/polyface/PolyfaceBuilder.js +1 -1
  312. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  313. package/lib/esm/polyface/PolyfaceClip.d.ts +3 -3
  314. package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
  315. package/lib/esm/polyface/PolyfaceClip.js +1 -2
  316. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  317. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  318. package/lib/esm/polyface/PolyfaceQuery.js +0 -1
  319. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  320. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  321. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  322. package/lib/esm/polyface/multiclip/OffsetMeshContext.d.ts +1 -1
  323. package/lib/esm/polyface/multiclip/OffsetMeshContext.d.ts.map +1 -1
  324. package/lib/esm/polyface/multiclip/OffsetMeshContext.js +4 -4
  325. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  326. package/lib/esm/serialization/DeepCompare.d.ts.map +1 -1
  327. package/lib/esm/serialization/DeepCompare.js +0 -1
  328. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  329. package/lib/esm/topology/Graph.d.ts.map +1 -1
  330. package/lib/esm/topology/Graph.js +1 -1
  331. package/lib/esm/topology/Graph.js.map +1 -1
  332. package/lib/esm/topology/InsertAndRetriangulateContext.js +1 -1
  333. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  334. package/lib/esm/topology/Merging.d.ts +1 -1
  335. package/lib/esm/topology/Merging.d.ts.map +1 -1
  336. package/lib/esm/topology/Merging.js +1 -1
  337. package/lib/esm/topology/Merging.js.map +1 -1
  338. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"AuxData.js","sourceRoot":"","sources":["../../../src/polyface/AuxData.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAU/F,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,yCAAyC;AACzC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;GAGG;AACH,MAAM,CAAN,IAAY,kBAiBX;AAjBD,WAAY,kBAAkB;IAC5B;;OAEG;IACH,+DAAU,CAAA;IACV;;OAEG;IACH,mEAAY,CAAA;IACZ;;OAEG;IACH,+DAAU,CAAA;IACV;;OAEG;IACH,+DAAU,CAAA;AACZ,CAAC,EAjBW,kBAAkB,KAAlB,kBAAkB,QAiB7B;AAED;;EAEE;AACF,MAAM,OAAO,cAAc;IAMzB,mEAAmE;IACnE,YAAY,KAAa,EAAE,MAA+B;QACxD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,MAAM,YAAY,YAAY,EAAE,CAAC;YACnC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;YACjB,KAAK,MAAM,CAAC,IAAI,MAAM;gBAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9C,CAAC;;YACC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,sIAAsI;IAC/H,UAAU,CAAC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CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;QACxB,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Polyface\r\n */\r\n\r\n// import { Point2d } from \"./Geometry2d\";\r\n/* eslint-disable @typescript-eslint/naming-convention, no-empty */\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\r\n// import { Geometry } from \"./Geometry\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\n\r\n/** The types of data that can be represented by an [[AuxChannelData]]. Each type of data contributes differently to the\r\n * animation applied by an [AnalysisStyle]($common) and responds differently when the host [[PolyfaceAuxData]] is transformed.\r\n * @public\r\n */\r\nexport enum AuxChannelDataType {\r\n /** General-purpose scalar values like stress, temperature, etc., used to recolor the [[Polyface]]'s vertices.\r\n * When the host Polyface is transformed, scalar values remain unmodified.\r\n */\r\n Scalar = 0,\r\n /** Distances in meters used to recolor the [[Polyface]]'s vertices.\r\n * When the host [[Polyface]] is transformed the [[Transform]]'s scale is applied to the distances.\r\n */\r\n Distance = 1,\r\n /** (X, Y, Z) displacement vectors added to the [[Polyface]]'s vertex positions resulting in deformation of the mesh.\r\n * When the host Polyface is transformed the displacements are rotated and scaled accordingly.\r\n */\r\n Vector = 2,\r\n /** (X, Y, Z) normal vectors that replace the host [[Polyface]]'s own normals.\r\n * When the Polyface is transformed the normals are rotated accordingly.\r\n */\r\n Normal = 3,\r\n}\r\n\r\n/** Represents the [[AuxChannel]] data at a single input value.\r\n * @public\r\n*/\r\nexport class AuxChannelData {\r\n /** The input value for this data. */\r\n public input: number;\r\n /** The vertex values for this data. A single value per vertex for scalar and distance types and 3 values (x,y,z) for normal or vector channels. */\r\n public values: number[];\r\n\r\n /** Constructor. If `values` is a number array, it is captured. */\r\n constructor(input: number, values: number[] | Float64Array) {\r\n this.input = input;\r\n if (values instanceof Float64Array) {\r\n this.values = [];\r\n for (const v of values) this.values.push(v);\r\n } else\r\n this.values = values;\r\n }\r\n\r\n /** Copy blocks of size `blockSize` from (blocked index) `thisIndex` in this AuxChannelData to (blockIndex) `otherIndex` of `other` */\r\n public copyValues(other: AuxChannelData, thisIndex: number, otherIndex: number, blockSize: number): void {\r\n for (let i = 0; i < blockSize; i++)\r\n this.values[thisIndex * blockSize + i] = other.values[otherIndex * blockSize + i];\r\n }\r\n\r\n /** return a deep copy */\r\n public clone(): AuxChannelData {\r\n return new AuxChannelData(this.input, this.values.slice());\r\n }\r\n\r\n /** toleranced comparison of the `input` and `value` fields.\r\n * * Default tolerance is 1.0e-8\r\n */\r\n public isAlmostEqual(other: AuxChannelData, tol?: number): boolean {\r\n const tolerance = tol ? tol : 1.0E-8;\r\n return Math.abs(this.input - other.input) < tolerance && NumberArray.isAlmostEqual(this.values, other.values, tolerance);\r\n }\r\n}\r\n\r\n/** Represents a single [[PolyfaceAuxData]] channel.\r\n * @public\r\n*/\r\nexport class AuxChannel {\r\n /** An array of [[AuxChannelData]] that represents the vertex data at one or more input values. */\r\n public data: AuxChannelData[];\r\n /** The type of data stored in this channel. */\r\n public dataType: AuxChannelDataType;\r\n /** The channel name. This is used to present the [[AuxChannel]] to the user and also to select the [[AuxChannel]] for display from AnalysisStyle */\r\n public name?: string;\r\n /** The input name. */\r\n public inputName?: string;\r\n\r\n /** Constructor with CAPTURED inputs. */\r\n public constructor(data: AuxChannelData[], dataType: AuxChannelDataType, name?: string, inputName?: string) {\r\n this.data = data;\r\n this.dataType = dataType;\r\n this.name = name;\r\n this.inputName = inputName;\r\n }\r\n\r\n /** Return a deep copy. */\r\n public clone(): AuxChannel {\r\n const clonedData = [];\r\n for (const data of this.data) clonedData.push(data.clone());\r\n return new AuxChannel(clonedData, this.dataType, this.name, this.inputName);\r\n }\r\n\r\n /** Toleranced comparison of contents. */\r\n public isAlmostEqual(other: AuxChannel, tol?: number): boolean {\r\n if (this.dataType !== other.dataType ||\r\n this.name !== other.name ||\r\n this.inputName !== other.inputName ||\r\n this.data.length !== other.data.length)\r\n return false;\r\n\r\n for (let i = 0; i < this.data.length; i++)\r\n if (!this.data[i].isAlmostEqual(other.data[i], tol))\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n /** True if the data type is 1-dimensional. */\r\n public static isScalar(dataType: AuxChannelDataType): boolean {\r\n return dataType === AuxChannelDataType.Distance || dataType === AuxChannelDataType.Scalar;\r\n }\r\n\r\n /** True if the data stored in this AuxChannel is 1-dimensional. */\r\n public get isScalar(): boolean {\r\n return AuxChannel.isScalar(this.dataType);\r\n }\r\n\r\n /** The dimension (1D or 3D) of each datum of an AuxChannel of the given type. */\r\n public static entriesPerValue(dataType: AuxChannelDataType): number {\r\n return this.isScalar(dataType) ? 1 : 3;\r\n }\r\n\r\n /** The dimension (1D or 3D) of each datum in the data arrays of this AuxChannel. */\r\n public get entriesPerValue(): number {\r\n return AuxChannel.entriesPerValue(this.dataType);\r\n }\r\n\r\n /** The number of data stored in each data array of this AuxChannel, equal to the length of the array divided by `entriesPerValue`. */\r\n public get valueCount(): number {\r\n return 0 === this.data.length ? 0 : this.data[0].values.length / this.entriesPerValue;\r\n }\r\n\r\n /** The minimum and maximum values in `data.values`, or `undefined` if [[isScalar]] is false. */\r\n public get scalarRange(): Range1d | undefined {\r\n if (!this.isScalar)\r\n return undefined;\r\n\r\n const range = Range1d.createNull();\r\n for (const data of this.data)\r\n range.extendArray(data.values);\r\n\r\n return range;\r\n }\r\n\r\n /** Compute the range of this channel's displacement values, if [[dataType]] is [[AuxChannelDataType.Vector]].\r\n * @param scale Scale by which to multiply each displacement.\r\n * @param result Preallocated object in which to store result.\r\n * @returns The range encompassing all this channel's displacements scaled by `scale`; or a null range if this channel does not contain displacements.\r\n */\r\n public computeDisplacementRange(scale = 1, result?: Range3d): Range3d {\r\n result = Range3d.createNull(result);\r\n\r\n if (AuxChannelDataType.Vector === this.dataType) {\r\n for (const data of this.data) {\r\n const v = data.values;\r\n for (let i = 0; i < v.length; i += 3)\r\n result.extendXYZ(v[i] * scale, v[i + 1] * scale, v[i + 2] * scale);\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n\r\n/**\r\n * The `PolyfaceAuxData` structure contains one or more analytical data channels for each vertex of a [[Polyface]], allowing the polyface to be styled\r\n * using an [AnalysisStyle]($common).\r\n * Typically a polyface will contain only vertex data required for its basic display: vertex position, normal, texture parameter, color.\r\n * `PolyfaceAuxData` provides supplemental per-vertex data that is generally computed in an analysis program or other external data source.\r\n * This supplemental data can be either 1D (e.g., height, override color) or 3D (e.g., displacement vector, override normal); see [[AuxChannel.entriesPerValue]], [[AuxChannel.dataType]].\r\n * All data channels are indexed by the same indices, which must have the same length and structure as the other Polyface indices.\r\n * This means that if a facet's face loop is found at index range [i0,i1] in the Polyface vertex index array, then the same index range [i0,i1]\r\n * locates the data for this facet in all the other Polyface index arrays, including the `PolyfaceAuxData` indices.\r\n * @see [[PolyfaceData.auxData]] to associate auxiliary data with a polyface.\r\n * @public\r\n */\r\nexport class PolyfaceAuxData {\r\n /** Array with one or more channels of auxiliary data for the associated polyface. */\r\n public channels: AuxChannel[];\r\n /** The indices (shared by all data in all channels) mapping the data to the mesh facets. */\r\n public indices: number[];\r\n\r\n /** Constructor with CAPTURED inputs. */\r\n public constructor(channels: AuxChannel[], indices: number[]) {\r\n this.channels = channels;\r\n this.indices = indices;\r\n }\r\n\r\n /** Return a deep copy. */\r\n public clone(): PolyfaceAuxData {\r\n const clonedChannels = this.channels.map((x) => x.clone());\r\n return new PolyfaceAuxData(clonedChannels, this.indices.slice());\r\n }\r\n\r\n /** Returns true if `this` is equivalent to `other` within `tolerance`.\r\n * The indices are compared for exact equality. The data in the channels are compared using `tolerance`, which defaults to 1.0e-8.\r\n */\r\n public isAlmostEqual(other: PolyfaceAuxData, tolerance?: number): boolean {\r\n if (!NumberArray.isExactEqual(this.indices, other.indices) || this.channels.length !== other.channels.length)\r\n return false;\r\n\r\n for (let i = 0; i < this.channels.length; i++)\r\n if (!this.channels[i].isAlmostEqual(other.channels[i], tolerance))\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n /** Returns true if both `left` and `right` are undefined, or both are defined and equivalent within `tolerance` (default: 1.0e-8). */\r\n public static isAlmostEqual(left: PolyfaceAuxData | undefined, right: PolyfaceAuxData | undefined, tol?: number): boolean {\r\n if (left === right) // This catches double undefined !!!\r\n return true;\r\n if (left && right)\r\n return left.isAlmostEqual(right, tol);\r\n return false;\r\n }\r\n\r\n /** Create a PolyfaceAuxData for use by a [[PolyfaceVisitor]]. */\r\n public createForVisitor(): PolyfaceAuxData {\r\n const visitorChannels: AuxChannel[] = [];\r\n\r\n for (const parentChannel of this.channels) {\r\n const visitorChannelData: AuxChannelData[] = [];\r\n for (const parentChannelData of parentChannel.data)\r\n visitorChannelData.push(new AuxChannelData(parentChannelData.input, []));\r\n\r\n visitorChannels.push(new AuxChannel(visitorChannelData, parentChannel.dataType, parentChannel.name, parentChannel.inputName));\r\n }\r\n\r\n return new PolyfaceAuxData(visitorChannels, []);\r\n }\r\n\r\n /** Apply `transform` to the data in each channel.\r\n * @see [[AuxChannelDataType]] for details regarding how each data type is affected by the transform.\r\n * @note This method may fail if a channel of [[AuxChannelDataType.Normal]] exists and `transform.matrix` is non-invertible.\r\n * @returns true if the channels were all successfully transformed.\r\n */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n let inverseRot: Matrix3d | undefined;\r\n const rot = transform.matrix;\r\n const det = rot.determinant();\r\n const scale = Math.pow(Math.abs(det), 1 / 3) * (det >= 0 ? 1 : -1);\r\n\r\n for (const channel of this.channels) {\r\n for (const data of channel.data) {\r\n switch (channel.dataType) {\r\n case AuxChannelDataType.Scalar:\r\n continue;\r\n case AuxChannelDataType.Distance: {\r\n for (let i = 0; i < data.values.length; i++)\r\n data.values[i] *= scale;\r\n\r\n break;\r\n }\r\n case AuxChannelDataType.Normal: {\r\n inverseRot = inverseRot ?? rot.inverse();\r\n if (!inverseRot)\r\n return false;\r\n\r\n transformPoints(data.values, (point) => inverseRot!.multiplyTransposeVectorInPlace(point));\r\n break;\r\n }\r\n case AuxChannelDataType.Vector: {\r\n transformPoints(data.values, (point) => rot.multiplyVectorInPlace(point));\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n\r\nfunction transformPoints(coords: number[], transform: (point: Point3d) => void): void {\r\n const point = new Point3d();\r\n for (let i = 0; i < coords.length; i += 3) {\r\n point.set(coords[i], coords[i + 1], coords[i + 2]);\r\n transform(point);\r\n coords[i] = point.x;\r\n coords[i + 1] = point.y;\r\n coords[i + 2] = point.z;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"AuxData.js","sourceRoot":"","sources":["../../../src/polyface/AuxData.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAS/F,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,yCAAyC;AACzC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;GAGG;AACH,MAAM,CAAN,IAAY,kBAiBX;AAjBD,WAAY,kBAAkB;IAC5B;;OAEG;IACH,+DAAU,CAAA;IACV;;OAEG;IACH,mEAAY,CAAA;IACZ;;OAEG;IACH,+DAAU,CAAA;IACV;;OAEG;IACH,+DAAU,CAAA;AACZ,CAAC,EAjBW,kBAAkB,KAAlB,kBAAkB,QAiB7B;AAED;;EAEE;AACF,MAAM,OAAO,cAAc;IAMzB,mEAAmE;IACnE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AAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1C,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACnD,SAAS,CAAC,KAAK,CAAC,CAAC;QACjB,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;QACpB,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;QACxB,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Polyface\r\n */\r\n\r\n// import { Point2d } from \"./Geometry2d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\r\n// import { Geometry } from \"./Geometry\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\n\r\n/** The types of data that can be represented by an [[AuxChannelData]]. Each type of data contributes differently to the\r\n * animation applied by an [AnalysisStyle]($common) and responds differently when the host [[PolyfaceAuxData]] is transformed.\r\n * @public\r\n */\r\nexport enum AuxChannelDataType {\r\n /** General-purpose scalar values like stress, temperature, etc., used to recolor the [[Polyface]]'s vertices.\r\n * When the host Polyface is transformed, scalar values remain unmodified.\r\n */\r\n Scalar = 0,\r\n /** Distances in meters used to recolor the [[Polyface]]'s vertices.\r\n * When the host [[Polyface]] is transformed the [[Transform]]'s scale is applied to the distances.\r\n */\r\n Distance = 1,\r\n /** (X, Y, Z) displacement vectors added to the [[Polyface]]'s vertex positions resulting in deformation of the mesh.\r\n * When the host Polyface is transformed the displacements are rotated and scaled accordingly.\r\n */\r\n Vector = 2,\r\n /** (X, Y, Z) normal vectors that replace the host [[Polyface]]'s own normals.\r\n * When the Polyface is transformed the normals are rotated accordingly.\r\n */\r\n Normal = 3,\r\n}\r\n\r\n/** Represents the [[AuxChannel]] data at a single input value.\r\n * @public\r\n*/\r\nexport class AuxChannelData {\r\n /** The input value for this data. */\r\n public input: number;\r\n /** The vertex values for this data. A single value per vertex for scalar and distance types and 3 values (x,y,z) for normal or vector channels. */\r\n public values: number[];\r\n\r\n /** Constructor. If `values` is a number array, it is captured. */\r\n constructor(input: number, values: number[] | Float64Array) {\r\n this.input = input;\r\n if (values instanceof Float64Array) {\r\n this.values = [];\r\n for (const v of values) this.values.push(v);\r\n } else\r\n this.values = values;\r\n }\r\n\r\n /** Copy blocks of size `blockSize` from (blocked index) `thisIndex` in this AuxChannelData to (blockIndex) `otherIndex` of `other` */\r\n public copyValues(other: AuxChannelData, thisIndex: number, otherIndex: number, blockSize: number): void {\r\n for (let i = 0; i < blockSize; i++)\r\n this.values[thisIndex * blockSize + i] = other.values[otherIndex * blockSize + i];\r\n }\r\n\r\n /** return a deep copy */\r\n public clone(): AuxChannelData {\r\n return new AuxChannelData(this.input, this.values.slice());\r\n }\r\n\r\n /** toleranced comparison of the `input` and `value` fields.\r\n * * Default tolerance is 1.0e-8\r\n */\r\n public isAlmostEqual(other: AuxChannelData, tol?: number): boolean {\r\n const tolerance = tol ? tol : 1.0E-8;\r\n return Math.abs(this.input - other.input) < tolerance && NumberArray.isAlmostEqual(this.values, other.values, tolerance);\r\n }\r\n}\r\n\r\n/** Represents a single [[PolyfaceAuxData]] channel.\r\n * @public\r\n*/\r\nexport class AuxChannel {\r\n /** An array of [[AuxChannelData]] that represents the vertex data at one or more input values. */\r\n public data: AuxChannelData[];\r\n /** The type of data stored in this channel. */\r\n public dataType: AuxChannelDataType;\r\n /** The channel name. This is used to present the [[AuxChannel]] to the user and also to select the [[AuxChannel]] for display from AnalysisStyle */\r\n public name?: string;\r\n /** The input name. */\r\n public inputName?: string;\r\n\r\n /** Constructor with CAPTURED inputs. */\r\n public constructor(data: AuxChannelData[], dataType: AuxChannelDataType, name?: string, inputName?: string) {\r\n this.data = data;\r\n this.dataType = dataType;\r\n this.name = name;\r\n this.inputName = inputName;\r\n }\r\n\r\n /** Return a deep copy. */\r\n public clone(): AuxChannel {\r\n const clonedData = [];\r\n for (const data of this.data) clonedData.push(data.clone());\r\n return new AuxChannel(clonedData, this.dataType, this.name, this.inputName);\r\n }\r\n\r\n /** Toleranced comparison of contents. */\r\n public isAlmostEqual(other: AuxChannel, tol?: number): boolean {\r\n if (this.dataType !== other.dataType ||\r\n this.name !== other.name ||\r\n this.inputName !== other.inputName ||\r\n this.data.length !== other.data.length)\r\n return false;\r\n\r\n for (let i = 0; i < this.data.length; i++)\r\n if (!this.data[i].isAlmostEqual(other.data[i], tol))\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n /** True if the data type is 1-dimensional. */\r\n public static isScalar(dataType: AuxChannelDataType): boolean {\r\n return dataType === AuxChannelDataType.Distance || dataType === AuxChannelDataType.Scalar;\r\n }\r\n\r\n /** True if the data stored in this AuxChannel is 1-dimensional. */\r\n public get isScalar(): boolean {\r\n return AuxChannel.isScalar(this.dataType);\r\n }\r\n\r\n /** The dimension (1D or 3D) of each datum of an AuxChannel of the given type. */\r\n public static entriesPerValue(dataType: AuxChannelDataType): number {\r\n return this.isScalar(dataType) ? 1 : 3;\r\n }\r\n\r\n /** The dimension (1D or 3D) of each datum in the data arrays of this AuxChannel. */\r\n public get entriesPerValue(): number {\r\n return AuxChannel.entriesPerValue(this.dataType);\r\n }\r\n\r\n /** The number of data stored in each data array of this AuxChannel, equal to the length of the array divided by `entriesPerValue`. */\r\n public get valueCount(): number {\r\n return 0 === this.data.length ? 0 : this.data[0].values.length / this.entriesPerValue;\r\n }\r\n\r\n /** The minimum and maximum values in `data.values`, or `undefined` if [[isScalar]] is false. */\r\n public get scalarRange(): Range1d | undefined {\r\n if (!this.isScalar)\r\n return undefined;\r\n\r\n const range = Range1d.createNull();\r\n for (const data of this.data)\r\n range.extendArray(data.values);\r\n\r\n return range;\r\n }\r\n\r\n /** Compute the range of this channel's displacement values, if [[dataType]] is [[AuxChannelDataType.Vector]].\r\n * @param scale Scale by which to multiply each displacement.\r\n * @param result Preallocated object in which to store result.\r\n * @returns The range encompassing all this channel's displacements scaled by `scale`; or a null range if this channel does not contain displacements.\r\n */\r\n public computeDisplacementRange(scale = 1, result?: Range3d): Range3d {\r\n result = Range3d.createNull(result);\r\n\r\n if (AuxChannelDataType.Vector === this.dataType) {\r\n for (const data of this.data) {\r\n const v = data.values;\r\n for (let i = 0; i < v.length; i += 3)\r\n result.extendXYZ(v[i] * scale, v[i + 1] * scale, v[i + 2] * scale);\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n\r\n/**\r\n * The `PolyfaceAuxData` structure contains one or more analytical data channels for each vertex of a [[Polyface]], allowing the polyface to be styled\r\n * using an [AnalysisStyle]($common).\r\n * Typically a polyface will contain only vertex data required for its basic display: vertex position, normal, texture parameter, color.\r\n * `PolyfaceAuxData` provides supplemental per-vertex data that is generally computed in an analysis program or other external data source.\r\n * This supplemental data can be either 1D (e.g., height, override color) or 3D (e.g., displacement vector, override normal); see [[AuxChannel.entriesPerValue]], [[AuxChannel.dataType]].\r\n * All data channels are indexed by the same indices, which must have the same length and structure as the other Polyface indices.\r\n * This means that if a facet's face loop is found at index range [i0,i1] in the Polyface vertex index array, then the same index range [i0,i1]\r\n * locates the data for this facet in all the other Polyface index arrays, including the `PolyfaceAuxData` indices.\r\n * @see [[PolyfaceData.auxData]] to associate auxiliary data with a polyface.\r\n * @public\r\n */\r\nexport class PolyfaceAuxData {\r\n /** Array with one or more channels of auxiliary data for the associated polyface. */\r\n public channels: AuxChannel[];\r\n /** The indices (shared by all data in all channels) mapping the data to the mesh facets. */\r\n public indices: number[];\r\n\r\n /** Constructor with CAPTURED inputs. */\r\n public constructor(channels: AuxChannel[], indices: number[]) {\r\n this.channels = channels;\r\n this.indices = indices;\r\n }\r\n\r\n /** Return a deep copy. */\r\n public clone(): PolyfaceAuxData {\r\n const clonedChannels = this.channels.map((x) => x.clone());\r\n return new PolyfaceAuxData(clonedChannels, this.indices.slice());\r\n }\r\n\r\n /** Returns true if `this` is equivalent to `other` within `tolerance`.\r\n * The indices are compared for exact equality. The data in the channels are compared using `tolerance`, which defaults to 1.0e-8.\r\n */\r\n public isAlmostEqual(other: PolyfaceAuxData, tolerance?: number): boolean {\r\n if (!NumberArray.isExactEqual(this.indices, other.indices) || this.channels.length !== other.channels.length)\r\n return false;\r\n\r\n for (let i = 0; i < this.channels.length; i++)\r\n if (!this.channels[i].isAlmostEqual(other.channels[i], tolerance))\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n /** Returns true if both `left` and `right` are undefined, or both are defined and equivalent within `tolerance` (default: 1.0e-8). */\r\n public static isAlmostEqual(left: PolyfaceAuxData | undefined, right: PolyfaceAuxData | undefined, tol?: number): boolean {\r\n if (left === right) // This catches double undefined !!!\r\n return true;\r\n if (left && right)\r\n return left.isAlmostEqual(right, tol);\r\n return false;\r\n }\r\n\r\n /** Create a PolyfaceAuxData for use by a [[PolyfaceVisitor]]. */\r\n public createForVisitor(): PolyfaceAuxData {\r\n const visitorChannels: AuxChannel[] = [];\r\n\r\n for (const parentChannel of this.channels) {\r\n const visitorChannelData: AuxChannelData[] = [];\r\n for (const parentChannelData of parentChannel.data)\r\n visitorChannelData.push(new AuxChannelData(parentChannelData.input, []));\r\n\r\n visitorChannels.push(new AuxChannel(visitorChannelData, parentChannel.dataType, parentChannel.name, parentChannel.inputName));\r\n }\r\n\r\n return new PolyfaceAuxData(visitorChannels, []);\r\n }\r\n\r\n /** Apply `transform` to the data in each channel.\r\n * @see [[AuxChannelDataType]] for details regarding how each data type is affected by the transform.\r\n * @note This method may fail if a channel of [[AuxChannelDataType.Normal]] exists and `transform.matrix` is non-invertible.\r\n * @returns true if the channels were all successfully transformed.\r\n */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n let inverseRot: Matrix3d | undefined;\r\n const rot = transform.matrix;\r\n const det = rot.determinant();\r\n const scale = Math.pow(Math.abs(det), 1 / 3) * (det >= 0 ? 1 : -1);\r\n\r\n for (const channel of this.channels) {\r\n for (const data of channel.data) {\r\n switch (channel.dataType) {\r\n case AuxChannelDataType.Scalar:\r\n continue;\r\n case AuxChannelDataType.Distance: {\r\n for (let i = 0; i < data.values.length; i++)\r\n data.values[i] *= scale;\r\n\r\n break;\r\n }\r\n case AuxChannelDataType.Normal: {\r\n inverseRot = inverseRot ?? rot.inverse();\r\n if (!inverseRot)\r\n return false;\r\n\r\n transformPoints(data.values, (point) => inverseRot!.multiplyTransposeVectorInPlace(point));\r\n break;\r\n }\r\n case AuxChannelDataType.Vector: {\r\n transformPoints(data.values, (point) => rot.multiplyVectorInPlace(point));\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n\r\nfunction transformPoints(coords: number[], transform: (point: Point3d) => void): void {\r\n const point = new Point3d();\r\n for (let i = 0; i < coords.length; i += 3) {\r\n point.set(coords[i], coords[i + 1], coords[i + 2]);\r\n transform(point);\r\n coords[i] = point.x;\r\n coords[i + 1] = point.y;\r\n coords[i + 2] = point.z;\r\n }\r\n}\r\n"]}
@@ -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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,GAAG,SAAS;IAKjE,iEAAiE;IACjD,sBAAsB,IAAI,MAAM;IAGhD;;;;;;;;;;;;MAYE;WACY,sBAAsB,CAAC,IAAI,EAAE,eAAe,GAAG,sBAAsB,EAAE,aAAa,GAAE,QAA2B,EAAE,SAAS,GAAE,KAAgC,EAAE,OAAO,GAAE,MAAU,GAAG,4BAA4B;CAiBjO"}
@@ -11,7 +11,6 @@ import { Vector3d } from "../geometry3d/Point3dVector3d";
11
11
  import { PolygonOps } from "../geometry3d/PolygonOps";
12
12
  import { IndexedPolyface } from "./Polyface";
13
13
  import { PolyfaceData } from "./PolyfaceData";
14
- /* eslint-disable @itwin/prefer-get */
15
14
  /**
16
15
  * An `IndexedPolyfaceVisitor` is an iterator-like object that "visits" facets of a mesh.
17
16
  * * The visitor extends `PolyfaceData`, so it can at any time hold all the data of a single facet.
@@ -1 +1 @@
1
- {"version":3,"file":"IndexedPolyfaceVisitor.js","sourceRoot":"","sources":["../../../src/polyface/IndexedPolyfaceVisitor.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAmB,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,sCAAsC;AAEtC;;;;GAIG;AACH,MAAM,OAAO,sBAAuB,SAAQ,YAAY;IAMtD,sEAAsE;IACtE,YAAsB,QAAyB,EAAE,OAAe;QAC9D,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,QAAQ,CAAC,IAAI,C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,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACxE,CAAC;IACD;;;;;;;;;;;;MAYE;IACK,MAAM,CAAC,sBAAsB,CAAC,IAA8C,EAAE,gBAA0B,QAAQ,CAAC,KAAK,EAAE,EAAE,YAAmB,KAAK,CAAC,gBAAgB,EAAE,EAAE,UAAkB,CAAC;QAC/L,IAAI,IAAI,YAAY,eAAe;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,QAAQ,CAAC,UAAU,EAAE,CAAC;QAC1C,KAAK,OAAO,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,eAAe,EAAE,GAAI,CAAC;YAClD,IAAI,CAAC,UAAU,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","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Polyface\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { PolygonOps } from \"../geometry3d/PolygonOps\";\r\nimport { IndexedPolyface, PolyfaceVisitor } from \"./Polyface\";\r\nimport { PolyfaceData } from \"./PolyfaceData\";\r\n\r\n/* eslint-disable @itwin/prefer-get */\r\n\r\n/**\r\n * An `IndexedPolyfaceVisitor` is an iterator-like object that \"visits\" facets of a mesh.\r\n * * The visitor extends `PolyfaceData`, so it can at any time hold all the data of a single facet.\r\n * @public\r\n */\r\nexport class IndexedPolyfaceVisitor extends PolyfaceData implements PolyfaceVisitor {\r\n private _currentFacetIndex: number;\r\n private _nextFacetIndex: number;\r\n private _numWrap: number;\r\n private _numEdges: number;\r\n private _polyface: IndexedPolyface;\r\n // to be called from static factory method that validates the polyface\r\n protected constructor(polyface: IndexedPolyface, numWrap: number) {\r\n super(polyface.data.normalCount > 0, polyface.data.paramCount > 0, polyface.data.colorCount > 0, polyface.twoSided);\r\n this._polyface = polyface;\r\n this._numWrap = numWrap;\r\n if (polyface.data.auxData)\r\n this.auxData = polyface.data.auxData.createForVisitor();\r\n this.reset();\r\n this._numEdges = 0;\r\n this._nextFacetIndex = 0;\r\n this._currentFacetIndex = -1;\r\n\r\n }\r\n /** Return the client polyface object. */\r\n public clientPolyface(): IndexedPolyface {\r\n return this._polyface;\r\n }\r\n /** Return the number of facets this visitor is able to visit. */\r\n public getVisitableFacetCount(): number {\r\n return this._polyface.facetCount;\r\n }\r\n /**\r\n * Set the number of vertices replicated in visitor arrays (both data and index arrays).\r\n * * 0,1,2 are the most common as numWrap.\r\n * * Example: suppose `[6,7,8]` is the pointIndex array representing a triangle. First edge would be `6,7`. Second\r\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.\r\n * Therefore, it is useful to store `6` at the end of pointIndex array, i.e., `[6,7,8,6]` meaning `numWrap = 1`.\r\n * Continuing this example, `numWrap = 2` (i.e., `[6,7,8,6,7]`) is useful when each vertex visit requires the next\r\n * two points, e.g., to form two adjacent vectors for a cross product.\r\n */\r\n public setNumWrap(numWrap: number) {\r\n this._numWrap = numWrap;\r\n }\r\n /**\r\n * Return the number of edges in the current facet.\r\n * * If `numWrap > 0` for this visitor, the number of edges is smaller than the number of points.\r\n */\r\n public get numEdgesThisFacet(): number {\r\n return this._numEdges;\r\n }\r\n /** Create a visitor for iterating the facets of `polyface`. */\r\n public static create(polyface: IndexedPolyface, numWrap: number): IndexedPolyfaceVisitor {\r\n return new IndexedPolyfaceVisitor(polyface, numWrap);\r\n }\r\n /** Advance the iterator to a particular facet in the client polyface. */\r\n public moveToReadIndex(facetIndex: number): boolean {\r\n if (!this._polyface.isValidFacetIndex(facetIndex))\r\n return false;\r\n this._currentFacetIndex = facetIndex;\r\n this._nextFacetIndex = facetIndex + 1;\r\n this._numEdges = this._polyface.numEdgeInFacet(facetIndex);\r\n this.resizeAllArrays(this._numEdges + this._numWrap);\r\n this.gatherIndexedData(\r\n this._polyface.data,\r\n this._polyface.facetIndex0(this._currentFacetIndex),\r\n this._polyface.facetIndex1(this._currentFacetIndex),\r\n this._numWrap,\r\n );\r\n return true;\r\n }\r\n /** Advance the iterator to a the 'next' facet in the client polyface. */\r\n public moveToNextFacet(): boolean {\r\n if (this._nextFacetIndex !== this._currentFacetIndex)\r\n return this.moveToReadIndex(this._nextFacetIndex);\r\n this._nextFacetIndex++;\r\n return true;\r\n }\r\n /** Reset the iterator to start at the first facet of the polyface. */\r\n public reset(): void {\r\n this.moveToReadIndex(0);\r\n this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here.\r\n }\r\n /**\r\n * Attempts to extract the distance parameter for the given vertex `index` on the current facet.\r\n * Returns the distance parameter as a point. Returns `undefined` on failure.\r\n */\r\n public tryGetDistanceParameter(index: number, result?: Point2d): Point2d | undefined {\r\n if (index < 0 || index >= this.numEdgesThisFacet)\r\n return undefined;\r\n if (this.param === undefined || this._polyface.data.face.length === 0)\r\n return undefined;\r\n const faceData = this._polyface.tryGetFaceData(this._currentFacetIndex);\r\n if (!faceData)\r\n return undefined;\r\n return faceData.convertParamXYToDistance(\r\n this.param.getXAtUncheckedPointIndex(index),\r\n this.param.getYAtUncheckedPointIndex(index),\r\n result,\r\n );\r\n }\r\n /**\r\n * Attempts to extract the normalized parameter (0,1) for the given vertex `index` on the current facet.\r\n * Returns the normalized parameter as a point. Returns `undefined` on failure.\r\n */\r\n public tryGetNormalizedParameter(index: number, result?: Point2d): Point2d | undefined {\r\n if (index < 0 || index >= this.numEdgesThisFacet)\r\n return undefined;\r\n if (this.param === undefined || this._polyface.data.face.length === 0)\r\n return undefined;\r\n const faceData = this._polyface.tryGetFaceData(this._currentFacetIndex);\r\n if (!faceData)\r\n return undefined;\r\n return faceData.convertParamXYToNormalized(\r\n this.param.getXAtUncheckedPointIndex(index),\r\n this.param.getYAtUncheckedPointIndex(index),\r\n result,\r\n );\r\n }\r\n /** Return the index (in the client polyface) of the current facet. */\r\n public currentReadIndex(): number {\r\n return this._currentFacetIndex;\r\n }\r\n /** Return the point index of vertex `i` within the currently loaded facet. */\r\n public clientPointIndex(i: number): number {\r\n return this.pointIndex[i];\r\n }\r\n /** Return the param index of vertex `i` within the currently loaded facet. */\r\n public clientParamIndex(i: number): number {\r\n return this.paramIndex ? this.paramIndex[i] : -1;\r\n }\r\n /** Return the normal index of vertex `i` within the currently loaded facet. */\r\n public clientNormalIndex(i: number): number {\r\n return this.normalIndex ? this.normalIndex[i] : -1;\r\n }\r\n /** Return the color index of vertex `i` within the currently loaded facet. */\r\n public clientColorIndex(i: number): number {\r\n return this.colorIndex ? this.colorIndex[i] : -1;\r\n }\r\n /** Return the aux data index of vertex `i` within the currently loaded facet. */\r\n public clientAuxIndex(i: number): number {\r\n return this.auxData ? this.auxData.indices[i] : -1;\r\n }\r\n /** Clear the contents of all arrays. */\r\n public clearArrays(): void {\r\n this.point.length = 0;\r\n this.edgeVisible.length = 0;\r\n if (this.param !== undefined)\r\n this.param.length = 0;\r\n if (this.normal !== undefined)\r\n this.normal.length = 0;\r\n if (this.color !== undefined)\r\n this.color.length = 0;\r\n // TODO: indices? auxData? taggedNumericData?\r\n }\r\n /** Transfer data from a specified `index` of the `other` visitor as new data in this visitor. */\r\n public pushDataFrom(other: PolyfaceVisitor, index: number): void {\r\n this.point.pushFromGrowableXYZArray(other.point, index);\r\n this.edgeVisible.push(other.edgeVisible[index]);\r\n if (this.param && other.param && index < other.param.length)\r\n this.param.pushFromGrowableXYArray(other.param, index);\r\n if (this.normal && other.normal && index < other.normal.length)\r\n this.normal.pushFromGrowableXYZArray(other.normal, index);\r\n if (this.color && other.color && index < other.color.length)\r\n this.color.push(other.color[index]);\r\n // TODO: indices? auxData? taggedNumericData?\r\n }\r\n /**\r\n * Transfer interpolated data from the other visitor.\r\n * * All data values are interpolated at `fraction` between `other` values at `index0` and `index1`.\r\n */\r\n public pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void {\r\n if (index0 > index1)\r\n this.pushInterpolatedDataFrom(other, index1, 1.0 - fraction, index0);\r\n this.point.pushInterpolatedFromGrowableXYZArray(other.point, index0, fraction, index1);\r\n const newVisibility = (((index0 + 1) % other.edgeVisible.length) === index1) ? other.edgeVisible[index0] : false;\r\n this.edgeVisible.push(newVisibility); // interpolation along an edge preserves visibility of original edge\r\n if (this.param && other.param && index0 < other.param.length && index1 < other.param.length)\r\n this.param.pushInterpolatedFromGrowableXYArray(other.param, index0, fraction, index1);\r\n if (this.normal && other.normal && index0 < other.normal.length && index1 < other.normal.length)\r\n this.normal.pushInterpolatedFromGrowableXYZArray(other.normal, index0, fraction, index1);\r\n if (this.color && other.color && index0 < other.color.length && index1 < other.color.length)\r\n this.color.push(Geometry.interpolateColor(other.color[index0], fraction, other.color[index1]));\r\n // TODO: auxData? taggedNumericData?\r\n }\r\n}\r\n/**\r\n * An `IndexedPolyfaceSubsetVisitor` is an `IndexedPolyfaceVisitor` which only visits a subset of facets in the polyface.\r\n * * The subset is defined by an array of facet indices provided when this visitor is created.\r\n * * Input indices (e.g., for `moveToReadIndex`) are understood to be indices into the subset array.\r\n * @public\r\n */\r\nexport class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor {\r\n private _parentFacetIndices?: number[]; // only undefined during super constructor!\r\n private _currentActiveIndex: number; // index within _parentFacetIndices, or -1 after construction\r\n private _nextActiveIndex: number; // index within _parentFacetIndices\r\n\r\n private constructor(polyface: IndexedPolyface, activeFacetIndices: number[], numWrap: number) {\r\n super(polyface, numWrap);\r\n this._parentFacetIndices = activeFacetIndices.slice();\r\n this._currentActiveIndex = -1;\r\n this._nextActiveIndex = 0;\r\n }\r\n private isValidSubsetIndex(index: number): boolean {\r\n return (undefined !== this._parentFacetIndices) && index >= 0 && index < this._parentFacetIndices.length;\r\n }\r\n /**\r\n * Create a visitor for iterating a subset of the facets of `polyface`.\r\n * @param polyface reference to the client polyface, supplying facets\r\n * @param activeFacetIndices array of indices of facets in the client polyface to visit. This array is cloned.\r\n * @param numWrap number of vertices replicated in the visitor arrays to facilitate simpler caller code. Default is zero.\r\n */\r\n public static createSubsetVisitor(polyface: IndexedPolyface, activeFacetIndices: number[], numWrap: number = 0): IndexedPolyfaceSubsetVisitor {\r\n return new IndexedPolyfaceSubsetVisitor(polyface, activeFacetIndices, numWrap);\r\n }\r\n /**\r\n * Advance the iterator to a particular facet in the subset of client polyface facets.\r\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.\r\n * @return whether the iterator was successfully moved.\r\n */\r\n public override moveToReadIndex(activeIndex: number): boolean {\r\n if (this.isValidSubsetIndex(activeIndex)) {\r\n this._currentActiveIndex = activeIndex;\r\n this._nextActiveIndex = activeIndex + 1;\r\n return super.moveToReadIndex(this._parentFacetIndices![activeIndex]);\r\n }\r\n return false;\r\n }\r\n /**\r\n * Advance the iterator to the next facet in the subset of client polyface facets.\r\n * @return whether the iterator was successfully moved.\r\n */\r\n public override moveToNextFacet(): boolean {\r\n if (this._nextActiveIndex !== this._currentActiveIndex)\r\n return this.moveToReadIndex(this._nextActiveIndex);\r\n this._nextActiveIndex++;\r\n return true;\r\n }\r\n /** Reset the iterator to start at the first active facet in the subset of client polyface facets. */\r\n public override reset(): void {\r\n this.moveToReadIndex(0);\r\n this._nextActiveIndex = 0; // so immediate moveToNextFacet stays here.\r\n }\r\n /**\r\n * Return the parent facet index of the indicated index within the subset of client polyface facets.\r\n * @param activeIndex index of the facet within the subset. Default is the active facet.\r\n * @return valid client polyface facet index, or `undefined` if invalid input index.\r\n */\r\n public parentFacetIndex(activeIndex?: number): number | undefined {\r\n if (undefined === activeIndex)\r\n activeIndex = this._currentActiveIndex;\r\n return this.isValidSubsetIndex(activeIndex) ? this._parentFacetIndices![activeIndex] : undefined;\r\n }\r\n /** Return the number of facets this visitor is able to visit. */\r\n public override getVisitableFacetCount(): number {\r\n return this._parentFacetIndices ? this._parentFacetIndices.length : 0;\r\n }\r\n /**\r\n * Create a visitor for those mesh facets with normal in the same half-space as the given vector.\r\n * * For example, to visit the top facets of a tiled terrain mesh but skip the \"skirt\" facets, pass\r\n * `compareVector = Vector3d.unitZ()` and a suitable `sideAngle` tolerance. Note that this will also\r\n * filter out *interior* facets that are nearly vertical, not just the \"skirt\" facets on the boundary.\r\n * @param mesh the mesh from which to select facets\r\n * @param compareVector vector to which to compare facet normals. The visitor will visit only those facets\r\n * with normals in the same half-space as this vector. Default is 001.\r\n * @param sideAngle optional angular tolerance to filter the facets near the border between half-spaces.\r\n * The visitor will *not* visit facets whose normals are nearly perpendicular to `compareVector`.\r\n * Default is [[Geometry.smallAngleRadians]].\r\n * @param numWrap optional number of entries replicated in visitor arrays. Default is 0.\r\n */\r\n public static createNormalComparison(mesh: IndexedPolyface | IndexedPolyfaceVisitor, compareVector: Vector3d = Vector3d.unitZ(), sideAngle: Angle = Angle.createSmallAngle(), numWrap: number = 0): IndexedPolyfaceSubsetVisitor {\r\n if (mesh instanceof IndexedPolyface)\r\n return this.createNormalComparison(mesh.createVisitor(), compareVector, sideAngle, numWrap);\r\n const visitor = mesh;\r\n const facets: number[] = [];\r\n const facetNormal = Vector3d.createZero();\r\n for (visitor.reset(); visitor.moveToNextFacet(); ) {\r\n if (!PolygonOps.unitNormal(visitor.point, facetNormal))\r\n continue; // degenerate facet\r\n if (facetNormal.dotProduct(compareVector) < 0.0)\r\n continue; // ignore facet facing other half-space\r\n if (facetNormal.angleFromPerpendicular(compareVector).isMagnitudeLessThanOrEqual(sideAngle))\r\n continue; // ignore side facet\r\n facets.push(visitor.currentReadIndex());\r\n }\r\n return IndexedPolyfaceSubsetVisitor.createSubsetVisitor(visitor.clientPolyface(), facets, numWrap);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"IndexedPolyfaceVisitor.js","sourceRoot":"","sources":["../../../src/polyface/IndexedPolyfaceVisitor.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAmB,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;GAIG;AACH,MAAM,OAAO,sBAAuB,SAAQ,YAAY;IAMtD,sEAAsE;IACtE,YAAsB,QAAyB,EAAE,OAAe;QAC9D,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,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C,CAAC,CAAC;IACxE,CAAC;IACD;;;;;;;;;;;;MAYE;IACK,MAAM,CAAC,sBAAsB,CAAC,IAA8C,EAAE,gBAA0B,QAAQ,CAAC,KAAK,EAAE,EAAE,YAAmB,KAAK,CAAC,gBAAgB,EAAE,EAAE,UAAkB,CAAC;QAC/L,IAAI,IAAI,YAAY,eAAe;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,QAAQ,CAAC,UAAU,EAAE,CAAC;QAC1C,KAAK,OAAO,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,eAAe,EAAE,GAAI,CAAC;YAClD,IAAI,CAAC,UAAU,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","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Polyface\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { PolygonOps } from \"../geometry3d/PolygonOps\";\r\nimport { IndexedPolyface, PolyfaceVisitor } from \"./Polyface\";\r\nimport { PolyfaceData } from \"./PolyfaceData\";\r\n\r\n/**\r\n * An `IndexedPolyfaceVisitor` is an iterator-like object that \"visits\" facets of a mesh.\r\n * * The visitor extends `PolyfaceData`, so it can at any time hold all the data of a single facet.\r\n * @public\r\n */\r\nexport class IndexedPolyfaceVisitor extends PolyfaceData implements PolyfaceVisitor {\r\n private _currentFacetIndex: number;\r\n private _nextFacetIndex: number;\r\n private _numWrap: number;\r\n private _numEdges: number;\r\n private _polyface: IndexedPolyface;\r\n // to be called from static factory method that validates the polyface\r\n protected constructor(polyface: IndexedPolyface, numWrap: number) {\r\n super(polyface.data.normalCount > 0, polyface.data.paramCount > 0, polyface.data.colorCount > 0, polyface.twoSided);\r\n this._polyface = polyface;\r\n this._numWrap = numWrap;\r\n if (polyface.data.auxData)\r\n this.auxData = polyface.data.auxData.createForVisitor();\r\n this.reset();\r\n this._numEdges = 0;\r\n this._nextFacetIndex = 0;\r\n this._currentFacetIndex = -1;\r\n\r\n }\r\n /** Return the client polyface object. */\r\n public clientPolyface(): IndexedPolyface {\r\n return this._polyface;\r\n }\r\n /** Return the number of facets this visitor is able to visit. */\r\n public getVisitableFacetCount(): number {\r\n return this._polyface.facetCount;\r\n }\r\n /**\r\n * Set the number of vertices replicated in visitor arrays (both data and index arrays).\r\n * * 0,1,2 are the most common as numWrap.\r\n * * Example: suppose `[6,7,8]` is the pointIndex array representing a triangle. First edge would be `6,7`. Second\r\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.\r\n * Therefore, it is useful to store `6` at the end of pointIndex array, i.e., `[6,7,8,6]` meaning `numWrap = 1`.\r\n * Continuing this example, `numWrap = 2` (i.e., `[6,7,8,6,7]`) is useful when each vertex visit requires the next\r\n * two points, e.g., to form two adjacent vectors for a cross product.\r\n */\r\n public setNumWrap(numWrap: number) {\r\n this._numWrap = numWrap;\r\n }\r\n /**\r\n * Return the number of edges in the current facet.\r\n * * If `numWrap > 0` for this visitor, the number of edges is smaller than the number of points.\r\n */\r\n public get numEdgesThisFacet(): number {\r\n return this._numEdges;\r\n }\r\n /** Create a visitor for iterating the facets of `polyface`. */\r\n public static create(polyface: IndexedPolyface, numWrap: number): IndexedPolyfaceVisitor {\r\n return new IndexedPolyfaceVisitor(polyface, numWrap);\r\n }\r\n /** Advance the iterator to a particular facet in the client polyface. */\r\n public moveToReadIndex(facetIndex: number): boolean {\r\n if (!this._polyface.isValidFacetIndex(facetIndex))\r\n return false;\r\n this._currentFacetIndex = facetIndex;\r\n this._nextFacetIndex = facetIndex + 1;\r\n this._numEdges = this._polyface.numEdgeInFacet(facetIndex);\r\n this.resizeAllArrays(this._numEdges + this._numWrap);\r\n this.gatherIndexedData(\r\n this._polyface.data,\r\n this._polyface.facetIndex0(this._currentFacetIndex),\r\n this._polyface.facetIndex1(this._currentFacetIndex),\r\n this._numWrap,\r\n );\r\n return true;\r\n }\r\n /** Advance the iterator to a the 'next' facet in the client polyface. */\r\n public moveToNextFacet(): boolean {\r\n if (this._nextFacetIndex !== this._currentFacetIndex)\r\n return this.moveToReadIndex(this._nextFacetIndex);\r\n this._nextFacetIndex++;\r\n return true;\r\n }\r\n /** Reset the iterator to start at the first facet of the polyface. */\r\n public reset(): void {\r\n this.moveToReadIndex(0);\r\n this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here.\r\n }\r\n /**\r\n * Attempts to extract the distance parameter for the given vertex `index` on the current facet.\r\n * Returns the distance parameter as a point. Returns `undefined` on failure.\r\n */\r\n public tryGetDistanceParameter(index: number, result?: Point2d): Point2d | undefined {\r\n if (index < 0 || index >= this.numEdgesThisFacet)\r\n return undefined;\r\n if (this.param === undefined || this._polyface.data.face.length === 0)\r\n return undefined;\r\n const faceData = this._polyface.tryGetFaceData(this._currentFacetIndex);\r\n if (!faceData)\r\n return undefined;\r\n return faceData.convertParamXYToDistance(\r\n this.param.getXAtUncheckedPointIndex(index),\r\n this.param.getYAtUncheckedPointIndex(index),\r\n result,\r\n );\r\n }\r\n /**\r\n * Attempts to extract the normalized parameter (0,1) for the given vertex `index` on the current facet.\r\n * Returns the normalized parameter as a point. Returns `undefined` on failure.\r\n */\r\n public tryGetNormalizedParameter(index: number, result?: Point2d): Point2d | undefined {\r\n if (index < 0 || index >= this.numEdgesThisFacet)\r\n return undefined;\r\n if (this.param === undefined || this._polyface.data.face.length === 0)\r\n return undefined;\r\n const faceData = this._polyface.tryGetFaceData(this._currentFacetIndex);\r\n if (!faceData)\r\n return undefined;\r\n return faceData.convertParamXYToNormalized(\r\n this.param.getXAtUncheckedPointIndex(index),\r\n this.param.getYAtUncheckedPointIndex(index),\r\n result,\r\n );\r\n }\r\n /** Return the index (in the client polyface) of the current facet. */\r\n public currentReadIndex(): number {\r\n return this._currentFacetIndex;\r\n }\r\n /** Return the point index of vertex `i` within the currently loaded facet. */\r\n public clientPointIndex(i: number): number {\r\n return this.pointIndex[i];\r\n }\r\n /** Return the param index of vertex `i` within the currently loaded facet. */\r\n public clientParamIndex(i: number): number {\r\n return this.paramIndex ? this.paramIndex[i] : -1;\r\n }\r\n /** Return the normal index of vertex `i` within the currently loaded facet. */\r\n public clientNormalIndex(i: number): number {\r\n return this.normalIndex ? this.normalIndex[i] : -1;\r\n }\r\n /** Return the color index of vertex `i` within the currently loaded facet. */\r\n public clientColorIndex(i: number): number {\r\n return this.colorIndex ? this.colorIndex[i] : -1;\r\n }\r\n /** Return the aux data index of vertex `i` within the currently loaded facet. */\r\n public clientAuxIndex(i: number): number {\r\n return this.auxData ? this.auxData.indices[i] : -1;\r\n }\r\n /** Clear the contents of all arrays. */\r\n public clearArrays(): void {\r\n this.point.length = 0;\r\n this.edgeVisible.length = 0;\r\n if (this.param !== undefined)\r\n this.param.length = 0;\r\n if (this.normal !== undefined)\r\n this.normal.length = 0;\r\n if (this.color !== undefined)\r\n this.color.length = 0;\r\n // TODO: indices? auxData? taggedNumericData?\r\n }\r\n /** Transfer data from a specified `index` of the `other` visitor as new data in this visitor. */\r\n public pushDataFrom(other: PolyfaceVisitor, index: number): void {\r\n this.point.pushFromGrowableXYZArray(other.point, index);\r\n this.edgeVisible.push(other.edgeVisible[index]);\r\n if (this.param && other.param && index < other.param.length)\r\n this.param.pushFromGrowableXYArray(other.param, index);\r\n if (this.normal && other.normal && index < other.normal.length)\r\n this.normal.pushFromGrowableXYZArray(other.normal, index);\r\n if (this.color && other.color && index < other.color.length)\r\n this.color.push(other.color[index]);\r\n // TODO: indices? auxData? taggedNumericData?\r\n }\r\n /**\r\n * Transfer interpolated data from the other visitor.\r\n * * All data values are interpolated at `fraction` between `other` values at `index0` and `index1`.\r\n */\r\n public pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void {\r\n if (index0 > index1)\r\n this.pushInterpolatedDataFrom(other, index1, 1.0 - fraction, index0);\r\n this.point.pushInterpolatedFromGrowableXYZArray(other.point, index0, fraction, index1);\r\n const newVisibility = (((index0 + 1) % other.edgeVisible.length) === index1) ? other.edgeVisible[index0] : false;\r\n this.edgeVisible.push(newVisibility); // interpolation along an edge preserves visibility of original edge\r\n if (this.param && other.param && index0 < other.param.length && index1 < other.param.length)\r\n this.param.pushInterpolatedFromGrowableXYArray(other.param, index0, fraction, index1);\r\n if (this.normal && other.normal && index0 < other.normal.length && index1 < other.normal.length)\r\n this.normal.pushInterpolatedFromGrowableXYZArray(other.normal, index0, fraction, index1);\r\n if (this.color && other.color && index0 < other.color.length && index1 < other.color.length)\r\n this.color.push(Geometry.interpolateColor(other.color[index0], fraction, other.color[index1]));\r\n // TODO: auxData? taggedNumericData?\r\n }\r\n}\r\n/**\r\n * An `IndexedPolyfaceSubsetVisitor` is an `IndexedPolyfaceVisitor` which only visits a subset of facets in the polyface.\r\n * * The subset is defined by an array of facet indices provided when this visitor is created.\r\n * * Input indices (e.g., for `moveToReadIndex`) are understood to be indices into the subset array.\r\n * @public\r\n */\r\nexport class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor {\r\n private _parentFacetIndices?: number[]; // only undefined during super constructor!\r\n private _currentActiveIndex: number; // index within _parentFacetIndices, or -1 after construction\r\n private _nextActiveIndex: number; // index within _parentFacetIndices\r\n\r\n private constructor(polyface: IndexedPolyface, activeFacetIndices: number[], numWrap: number) {\r\n super(polyface, numWrap);\r\n this._parentFacetIndices = activeFacetIndices.slice();\r\n this._currentActiveIndex = -1;\r\n this._nextActiveIndex = 0;\r\n }\r\n private isValidSubsetIndex(index: number): boolean {\r\n return (undefined !== this._parentFacetIndices) && index >= 0 && index < this._parentFacetIndices.length;\r\n }\r\n /**\r\n * Create a visitor for iterating a subset of the facets of `polyface`.\r\n * @param polyface reference to the client polyface, supplying facets\r\n * @param activeFacetIndices array of indices of facets in the client polyface to visit. This array is cloned.\r\n * @param numWrap number of vertices replicated in the visitor arrays to facilitate simpler caller code. Default is zero.\r\n */\r\n public static createSubsetVisitor(polyface: IndexedPolyface, activeFacetIndices: number[], numWrap: number = 0): IndexedPolyfaceSubsetVisitor {\r\n return new IndexedPolyfaceSubsetVisitor(polyface, activeFacetIndices, numWrap);\r\n }\r\n /**\r\n * Advance the iterator to a particular facet in the subset of client polyface facets.\r\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.\r\n * @return whether the iterator was successfully moved.\r\n */\r\n public override moveToReadIndex(activeIndex: number): boolean {\r\n if (this.isValidSubsetIndex(activeIndex)) {\r\n this._currentActiveIndex = activeIndex;\r\n this._nextActiveIndex = activeIndex + 1;\r\n return super.moveToReadIndex(this._parentFacetIndices![activeIndex]);\r\n }\r\n return false;\r\n }\r\n /**\r\n * Advance the iterator to the next facet in the subset of client polyface facets.\r\n * @return whether the iterator was successfully moved.\r\n */\r\n public override moveToNextFacet(): boolean {\r\n if (this._nextActiveIndex !== this._currentActiveIndex)\r\n return this.moveToReadIndex(this._nextActiveIndex);\r\n this._nextActiveIndex++;\r\n return true;\r\n }\r\n /** Reset the iterator to start at the first active facet in the subset of client polyface facets. */\r\n public override reset(): void {\r\n this.moveToReadIndex(0);\r\n this._nextActiveIndex = 0; // so immediate moveToNextFacet stays here.\r\n }\r\n /**\r\n * Return the parent facet index of the indicated index within the subset of client polyface facets.\r\n * @param activeIndex index of the facet within the subset. Default is the active facet.\r\n * @return valid client polyface facet index, or `undefined` if invalid input index.\r\n */\r\n public parentFacetIndex(activeIndex?: number): number | undefined {\r\n if (undefined === activeIndex)\r\n activeIndex = this._currentActiveIndex;\r\n return this.isValidSubsetIndex(activeIndex) ? this._parentFacetIndices![activeIndex] : undefined;\r\n }\r\n /** Return the number of facets this visitor is able to visit. */\r\n public override getVisitableFacetCount(): number {\r\n return this._parentFacetIndices ? this._parentFacetIndices.length : 0;\r\n }\r\n /**\r\n * Create a visitor for those mesh facets with normal in the same half-space as the given vector.\r\n * * For example, to visit the top facets of a tiled terrain mesh but skip the \"skirt\" facets, pass\r\n * `compareVector = Vector3d.unitZ()` and a suitable `sideAngle` tolerance. Note that this will also\r\n * filter out *interior* facets that are nearly vertical, not just the \"skirt\" facets on the boundary.\r\n * @param mesh the mesh from which to select facets\r\n * @param compareVector vector to which to compare facet normals. The visitor will visit only those facets\r\n * with normals in the same half-space as this vector. Default is 001.\r\n * @param sideAngle optional angular tolerance to filter the facets near the border between half-spaces.\r\n * The visitor will *not* visit facets whose normals are nearly perpendicular to `compareVector`.\r\n * Default is [[Geometry.smallAngleRadians]].\r\n * @param numWrap optional number of entries replicated in visitor arrays. Default is 0.\r\n */\r\n public static createNormalComparison(mesh: IndexedPolyface | IndexedPolyfaceVisitor, compareVector: Vector3d = Vector3d.unitZ(), sideAngle: Angle = Angle.createSmallAngle(), numWrap: number = 0): IndexedPolyfaceSubsetVisitor {\r\n if (mesh instanceof IndexedPolyface)\r\n return this.createNormalComparison(mesh.createVisitor(), compareVector, sideAngle, numWrap);\r\n const visitor = mesh;\r\n const facets: number[] = [];\r\n const facetNormal = Vector3d.createZero();\r\n for (visitor.reset(); visitor.moveToNextFacet(); ) {\r\n if (!PolygonOps.unitNormal(visitor.point, facetNormal))\r\n continue; // degenerate facet\r\n if (facetNormal.dotProduct(compareVector) < 0.0)\r\n continue; // ignore facet facing other half-space\r\n if (facetNormal.angleFromPerpendicular(compareVector).isMagnitudeLessThanOrEqual(sideAngle))\r\n continue; // ignore side facet\r\n facets.push(visitor.currentReadIndex());\r\n }\r\n return IndexedPolyfaceSubsetVisitor.createSubsetVisitor(visitor.clientPolyface(), facets, numWrap);\r\n }\r\n}\r\n"]}
@@ -211,7 +211,7 @@ export declare class IndexedPolyface extends Polyface {
211
211
  * @param errors optional array appended with error message(s) if invalid indices are encountered
212
212
  * @return whether the indices are valid
213
213
  */
214
- validateAllIndices(index0?: number, errors?: String[]): boolean;
214
+ validateAllIndices(index0?: number, errors?: string[]): boolean;
215
215
  /**
216
216
  * Announce the end of construction of a facet.
217
217
  * * Optionally check for:
@@ -220,7 +220,7 @@ export declare class IndexedPolyface extends Polyface {
220
220
  * * In error cases, all index arrays are trimmed back to the size when previous facet was terminated.
221
221
  * * A return value of `undefined` is normal. Otherwise, a string array of error messages is returned.
222
222
  */
223
- terminateFacet(validateAllIndices?: boolean): String[] | undefined;
223
+ terminateFacet(validateAllIndices?: boolean): string[] | undefined;
224
224
  /** Number of facets (read-only property). */
225
225
  get facetCount(): number;
226
226
  /** Number of faces (read-only property). */
@@ -1 +1 @@
1
- {"version":3,"file":"Polyface.d.ts","sourceRoot":"","sources":["../../../src/polyface/Polyface.ts"],"names":[],"mappings":"AAKA;;GAEG;AAKH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,EAAE,OAAO,EAAE,MAAM,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AQG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,mGAAmG;IACnG,WAAW,IAAI,IAAI,CAAC;IACpB,6FAA6F;IAC7F,YAAY,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1D;;;OAGG;IACH,wBAAwB,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACzG;;;OAGG;IACH,sBAAsB,CAAC,IAAI,MAAM,CAAC;CACnC"}
@@ -5,7 +5,6 @@
5
5
  /** @packageDocumentation
6
6
  * @module Polyface
7
7
  */
8
- /* eslint-disable @typescript-eslint/naming-convention, no-empty */
9
8
  // cspell:word internaldocs
10
9
  import { GeometryQuery } from "../curve/GeometryQuery";
11
10
  import { Geometry } from "../Geometry";
@@ -1 +1 @@
1
- {"version":3,"file":"Polyface.js","sourceRoot":"","sources":["../../../src/polyface/Polyface.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,mEAAmE;AACnE,2BAA2B;AAE3B,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,OAAO,EAAY,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAGzD,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,MAAM,OAAgB,QA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CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC;QACnD,MAAM,aAAa,GAAY,QAAQ,CAAC,UAAU,CAAC,MAAM,IAAI,YAAY,CAAC;QAC1E,GAAG,CAAC;YACF,IAAI,aAAa,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;gBAC9C,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QACnD,CAAC,QAAQ,OAAO,CAAC,eAAe,EAAE,IAAI,OAAO,CAAC,gBAAgB,EAAE,GAAG,aAAa,EAAE;QAClF,IAAI,YAAY,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAM,CAAC,MAAM,KAAK,CAAC,CAAC,IAAI,QAAQ,CAAC,kBAAkB,CAAC,MAAM;YACxF,QAAQ,CAAC,oCAAoC,CAAC,IAAI,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;QACjF,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9B,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChD,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,GAAG,aAAa,EAAE,CAAC,EAAE;YAC/D,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC;IACd,CAAC;IACD,kFAAkF;IAC3E,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Polyface\r\n */\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention, no-empty */\r\n// cspell:word internaldocs\r\n\r\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { GrowableXYArray } from \"../geometry3d/GrowableXYArray\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\r\nimport { Range3d } from \"../geometry3d/Range\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { FacetFaceData } from \"./FacetFaceData\";\r\nimport { IndexedPolyfaceVisitor } from \"./IndexedPolyfaceVisitor\";\r\nimport { PolyfaceData } from \"./PolyfaceData\";\r\n\r\n/**\r\n * A Polyface is an abstract mesh structure (of unspecified implementation) that provides a PolyfaceVisitor\r\n * to iterate over its facets.\r\n * @public\r\n */\r\nexport abstract class Polyface extends GeometryQuery {\r\n /** String name for schema properties */\r\n public readonly geometryCategory = \"polyface\";\r\n /** Underlying polyface data. */\r\n public data: PolyfaceData;\r\n /** Constructor */\r\n protected constructor(data: PolyfaceData) {\r\n super();\r\n this.data = data;\r\n }\r\n /**\r\n * Create and return a visitor for this concrete polyface.\r\n * @param numWrap the number of vertices to replicate in visitor arrays.\r\n */\r\n public abstract createVisitor(numWrap: number): PolyfaceVisitor;\r\n /** Flag indicating if the mesh display must assume both sides are visible. */\r\n public get twoSided() {\r\n return this.data.twoSided;\r\n }\r\n public set twoSided(value: boolean) {\r\n this.data.twoSided = value;\r\n }\r\n /**\r\n * Flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2).\r\n * * A boundary edge of a mesh is defined as an edge with only one connected facet.\r\n * * Closed solid is a mesh with no boundary edge. Open sheet is a mesh that has boundary edge(s).\r\n */\r\n public get expectedClosure(): number {\r\n return this.data.expectedClosure;\r\n }\r\n public set expectedClosure(value: number) {\r\n this.data.expectedClosure = value;\r\n }\r\n /**\r\n * Check validity of indices into a data array.\r\n * * It is valid to have both indices and data undefined.\r\n * * It is NOT valid for just one to be defined.\r\n * * Index values at indices[indexPositionA <= i < indexPositionB] must be valid indices to the data array.\r\n * @param indices array of indices.\r\n * @param indexPositionA first index to test.\r\n * @param indexPositionB one past final index to test.\r\n * @param data data array.\r\n * @param dataLength length of data array.\r\n */\r\n public static areIndicesValid(\r\n indices: number[] | undefined,\r\n indexPositionA: number,\r\n indexPositionB: number,\r\n data: any,\r\n dataLength: number,\r\n ): boolean {\r\n if (indices === undefined && data === undefined)\r\n return true;\r\n if (indices === undefined || data === undefined)\r\n return false;\r\n if (indexPositionA < 0 || indexPositionA >= indices.length)\r\n return false;\r\n if (indexPositionB <= indexPositionA || indexPositionB > indices.length)\r\n return false;\r\n for (let i = indexPositionA; i < indexPositionB; i++)\r\n if (indices[i] < 0 || indices[i] >= dataLength)\r\n return false;\r\n return true;\r\n }\r\n /** Returns true if this polyface has no facets. */\r\n public abstract get isEmpty(): boolean;\r\n /** Returns the number of facets of this polyface. Subclasses should override. */\r\n public get facetCount(): number | undefined {\r\n return undefined;\r\n }\r\n}\r\n\r\n/**\r\n * An `IndexedPolyface` is a set of facets which can have normal, param, and color arrays with independent point,\r\n * normal, param, and color indices.\r\n * @public\r\n */\r\nexport class IndexedPolyface extends Polyface { // more info can be found at geometry/internaldocs/Polyface.md\r\n /**\r\n * Start indices of all facets of the polyface.\r\n * * Each element is an index to the `this.data.pointIndex` array entry for a specific facet.\r\n * * The facet count is `_facetStart.length - 1`.\r\n * * The face loop for the i_th facet consists of the entries in `this.data.pointIndex` at indices `_facetStart[i]`\r\n * up to (but not including) `_facetStart[i + 1]`.\r\n * * Note the array is initialized with one entry (value 0).\r\n */\r\n protected _facetStart: number[];\r\n /**\r\n * Index to the `this.data.face` array entry for a specific facet.\r\n * * `_facetToFaceData` has one entry per facet.\r\n */\r\n protected _facetToFaceData: number[];\r\n /**\r\n * Constructor for a new polyface.\r\n * @param data PolyfaceData arrays to capture.\r\n * @param facetStart optional array of facet start indices (e.g. known during clone)\r\n * @param facetToFacetData optional array of face identifiers (e.g. known during clone)\r\n */\r\n protected constructor(data: PolyfaceData, facetStart?: number[], facetToFaceData?: number[]) {\r\n super(data);\r\n if (facetStart)\r\n this._facetStart = facetStart.slice(); // deep copy\r\n else {\r\n this._facetStart = [];\r\n this._facetStart.push(0);\r\n }\r\n if (facetToFaceData)\r\n this._facetToFaceData = facetToFaceData.slice(); // deep copy\r\n else\r\n this._facetToFaceData = [];\r\n }\r\n /** Test if other is an instance of `IndexedPolyface` */\r\n public isSameGeometryClass(other: any): boolean {\r\n return other instanceof IndexedPolyface;\r\n }\r\n /** Tests for equivalence between two IndexedPolyfaces. */\r\n public override isAlmostEqual(other: any): boolean {\r\n if (other instanceof IndexedPolyface) {\r\n return this.data.isAlmostEqual(other.data) &&\r\n NumberArray.isExactEqual(this._facetStart, other._facetStart) &&\r\n NumberArray.isExactEqual(this._facetToFaceData, other._facetToFaceData);\r\n }\r\n return false;\r\n }\r\n /** Returns true if either the point array or the point index array is empty. */\r\n public get isEmpty(): boolean {\r\n return this.data.pointCount === 0 || this.data.pointIndex.length === 0;\r\n }\r\n /**\r\n * Transform the mesh.\r\n * * Apply the transform to points.\r\n * * Apply the (inverse transpose of the) matrix part to normals.\r\n * * If determinant of the transform matrix is negative, also\r\n * * negate normals\r\n * * reverse index order around each facet.\r\n */\r\n public tryTransformInPlace(transform: Transform) {\r\n if (!this.data.tryTransformInPlace(transform))\r\n return false;\r\n const determinant = transform.matrix.determinant();\r\n if (determinant < 0) {\r\n this.reverseIndices();\r\n this.reverseNormals();\r\n }\r\n return true;\r\n }\r\n /** Reverse indices for a single facet. */\r\n public reverseSingleFacet(facetId: number) {\r\n this.data.reverseIndicesSingleFacet(facetId, this._facetStart);\r\n }\r\n /** Return a deep clone. */\r\n public clone(): IndexedPolyface {\r\n const result = new IndexedPolyface(this.data.clone(), this._facetStart.slice(), this._facetToFaceData.slice());\r\n return result;\r\n }\r\n /**\r\n * Return a deep clone with transformed points and normals.\r\n * @see [[IndexedPolyface.tryTransformInPlace]] for details of how transform is done.\r\n */\r\n public cloneTransformed(transform: Transform): IndexedPolyface {\r\n const result = this.clone();\r\n result.tryTransformInPlace(transform);\r\n return result;\r\n }\r\n /** Reverse the order of indices around all facets. */\r\n public reverseIndices() {\r\n this.data.reverseIndices(this._facetStart);\r\n }\r\n /** Reverse the direction of all normal vectors. */\r\n public reverseNormals() {\r\n this.data.reverseNormals();\r\n }\r\n /**\r\n * Return face data using a facet index.\r\n * * Returns `undefined` if none found.\r\n * * This is the REFERENCE to the FacetFaceData not a copy.\r\n */\r\n public tryGetFaceData(i: number): FacetFaceData | undefined {\r\n if (i < 0 || i >= this._facetToFaceData.length)\r\n return undefined;\r\n const faceIndex = this._facetToFaceData[i];\r\n if (faceIndex < 0 || faceIndex >= this.data.face.length)\r\n return undefined;\r\n return this.data.face[faceIndex];\r\n }\r\n /**\r\n * Add facets from `source` to `this` polyface.\r\n * * Optionally reverse facet indices as per `PolyfaceData.reverseIndicesSingleFacet()` with `preserveStart = false` and\r\n * invert source normals.\r\n * * Optionally apply a `transform` to points and normals.\r\n * * Will only copy param, normal, color, and face data if we are already tracking them AND/OR the source contains them.\r\n */\r\n public addIndexedPolyface(source: IndexedPolyface, reversed: boolean, transform: Transform | undefined) {\r\n const numSourceFacets = source.facetCount;\r\n // add point, point index, and edge visibility data\r\n // note that there is no need to build an intermediate index map since all points are added\r\n const startOfNewPoints = this.data.point.length;\r\n const xyz = Point3d.create();\r\n for (let i = 0; i < source.data.point.length; i++) {\r\n source.data.point.getPoint3dAtUncheckedPointIndex(i, xyz);\r\n if (transform) {\r\n transform.multiplyPoint3d(xyz, xyz);\r\n this.addPoint(xyz);\r\n } else\r\n this.addPoint(xyz);\r\n }\r\n for (let i = 0; i < numSourceFacets; i++) {\r\n const i0 = source._facetStart[i];\r\n const i1 = source._facetStart[i + 1];\r\n if (reversed) {\r\n for (let j = i1; j-- > i0;) { // visibility is transferred from far vertex, e.g., -abc-d => dc-b-a\r\n this.addPointIndex(\r\n startOfNewPoints + source.data.pointIndex[j],\r\n source.data.edgeVisible[j > i0 ? j - 1 : i1 - 1],\r\n );\r\n }\r\n } else {\r\n for (let j = i0; j < i1; j++) {\r\n this.addPointIndex(\r\n startOfNewPoints + source.data.pointIndex[j],\r\n source.data.edgeVisible[j],\r\n );\r\n }\r\n }\r\n this.terminateFacet(false);\r\n }\r\n // add param and param index data\r\n if (undefined !== this.data.param && undefined !== source.data.param && undefined !== source.data.paramIndex) {\r\n const startOfNewParams = this.data.param.length;\r\n this.data.param.pushFromGrowableXYArray(source.data.param);\r\n for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals\r\n const i0 = source._facetStart[i];\r\n const i1 = source._facetStart[i + 1];\r\n if (reversed) {\r\n for (let j = i1; j-- > i0;)\r\n this.addParamIndex(startOfNewParams + source.data.paramIndex[j]);\r\n } else {\r\n for (let j = i0; j < i1; j++)\r\n this.addParamIndex(startOfNewParams + source.data.paramIndex[j]);\r\n }\r\n }\r\n }\r\n // add normal and normal index data\r\n if (undefined !== this.data.normal && undefined !== source.data.normal && undefined !== source.data.normalIndex) {\r\n const startOfNewNormals = this.data.normal.length;\r\n for (let i = 0; i < source.data.normal.length; i++) {\r\n const sourceNormal = source.data.normal.getVector3dAtCheckedVectorIndex(i)!;\r\n if (transform)\r\n transform.multiplyVector(sourceNormal, sourceNormal);\r\n if (reversed)\r\n sourceNormal.scaleInPlace(-1.0);\r\n this.addNormal(sourceNormal);\r\n }\r\n for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals\r\n const i0 = source._facetStart[i];\r\n const i1 = source._facetStart[i + 1];\r\n if (reversed) {\r\n for (let j = i1; j-- > i0;)\r\n this.addNormalIndex(startOfNewNormals + source.data.normalIndex[j]);\r\n } else {\r\n for (let j = i0; j < i1; j++)\r\n this.addNormalIndex(startOfNewNormals + source.data.normalIndex[j]);\r\n }\r\n }\r\n }\r\n // add color and color index data\r\n if (undefined !== this.data.color && undefined !== source.data.color && undefined !== source.data.colorIndex) {\r\n const startOfNewColors = this.data.color.length;\r\n for (const sourceColor of source.data.color)\r\n this.addColor(sourceColor);\r\n for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match colors\r\n const i0 = source._facetStart[i];\r\n const i1 = source._facetStart[i + 1];\r\n if (reversed) {\r\n for (let j = i1; j-- > i0;)\r\n this.addColorIndex(startOfNewColors + source.data.colorIndex[j]);\r\n } else {\r\n for (let j = i0; j < i1; j++)\r\n this.addColorIndex(startOfNewColors + source.data.colorIndex[j]);\r\n }\r\n }\r\n }\r\n // add face and facetToFace index data\r\n if (source.data.face.length !== 0) {\r\n const startOfNewFaceData = this.data.face.length;\r\n for (const face of source.data.face) {\r\n const sourceFaceData = face.clone();\r\n this.data.face.push(sourceFaceData);\r\n }\r\n for (const facetToFaceIdx of source._facetToFaceData) {\r\n this._facetToFaceData.push(startOfNewFaceData + facetToFaceIdx);\r\n }\r\n }\r\n }\r\n /**\r\n * Return the total number of indices in zero-terminated style, which includes\r\n * * all the indices in the packed zero-based table.\r\n * * one additional index for the zero-terminator of each facet.\r\n * @note Note that all index arrays (pointIndex, normalIndex, paramIndex, colorIndex) have the same counts, so there\r\n * is not a separate query for each of them.\r\n */\r\n public get zeroTerminatedIndexCount(): number {\r\n return this.data.pointIndex.length + this._facetStart.length - 1;\r\n }\r\n /**\r\n * Create an empty facet set with coordinate and index data to be supplied later.\r\n * @param needNormals `true` to allocate empty normal data and index arrays; `false` (default) to leave undefined.\r\n * @param needParams `true` to allocate empty uv parameter data and index arrays; `false` (default) to leave undefined.\r\n * @param needColors `true` to allocate empty color data and index arrays; `false` (default) to leave undefined.\r\n * @param twoSided `true` if the facets are to be considered viewable from the back; `false` (default) if not.\r\n */\r\n public static create(\r\n needNormals: boolean = false,\r\n needParams: boolean = false,\r\n needColors: boolean = false,\r\n twoSided: boolean = false,\r\n ): IndexedPolyface {\r\n return new IndexedPolyface(new PolyfaceData(needNormals, needParams, needColors, twoSided));\r\n }\r\n /**\r\n * Add (a clone of) a point to point array.\r\n * @param point the point.\r\n * @param priorIndex (optional) index of prior point to check for possible duplicate value.\r\n * @returns the zero-based index of the added or duplicate point.\r\n */\r\n public addPoint(point: Point3d, priorIndex?: number): number {\r\n if (priorIndex !== undefined) {\r\n const distance = this.data.point.distanceIndexToPoint(priorIndex, point);\r\n if (distance !== undefined && Geometry.isSmallMetricDistance(distance))\r\n return priorIndex;\r\n }\r\n this.data.point.pushXYZ(point.x, point.y, point.z);\r\n return this.data.point.length - 1;\r\n }\r\n /**\r\n * Add a point to point array.\r\n * @param x the x coordinate of point.\r\n * @param y the y coordinate of point.\r\n * @param z the z coordinate of point.\r\n * @returns the zero-based index of the added point.\r\n */\r\n public addPointXYZ(x: number, y: number, z: number): number {\r\n this.data.point.pushXYZ(x, y, z);\r\n return this.data.point.length - 1;\r\n }\r\n /**\r\n * Add (a clone of) a uv parameter to the parameter array.\r\n * @param param the parameter.\r\n * @returns zero-based index of the added param.\r\n */\r\n public addParam(param: Point2d): number {\r\n if (!this.data.param)\r\n this.data.param = new GrowableXYArray();\r\n this.data.param.push(param);\r\n return this.data.param.length - 1;\r\n }\r\n /**\r\n * Add a uv parameter to the parameter array.\r\n * @param u the u part of parameter.\r\n * @param v the v part of parameter.\r\n * @param priorIndexA first index to check for possible duplicate value.\r\n * @param priorIndexB second index to check for possible duplicate value.\r\n * @returns zero-based index of the added or duplicate parameter.\r\n */\r\n public addParamUV(u: number, v: number, priorIndexA?: number, priorIndexB?: number): number {\r\n if (!this.data.param)\r\n this.data.param = new GrowableXYArray();\r\n if (priorIndexA !== undefined && this.data.isAlmostEqualParamIndexUV(priorIndexA, u, v))\r\n return priorIndexA;\r\n if (priorIndexB !== undefined && this.data.isAlmostEqualParamIndexUV(priorIndexB, u, v))\r\n return priorIndexB;\r\n this.data.param.pushXY(u, v);\r\n return this.data.param.length - 1;\r\n }\r\n /**\r\n * Add (a clone of) a normal vector to the normal array.\r\n * @param normal the normal vector.\r\n * @param priorIndexA first index to check for possible duplicate value.\r\n * @param priorIndexB second index to check for possible duplicate value.\r\n * @returns zero-based index of the added or duplicate normal.\r\n */\r\n public addNormal(normal: Vector3d, priorIndexA?: number, priorIndexB?: number): number {\r\n // check if `normal` is duplicate of `dataNormal` at index `i`\r\n const normalIsDuplicate = (i: number) => {\r\n const distance = this.data.normal!.distanceIndexToPoint(i, normal);\r\n return distance !== undefined && Geometry.isSmallMetricDistance(distance);\r\n };\r\n if (this.data.normal !== undefined) {\r\n if (priorIndexA !== undefined && normalIsDuplicate(priorIndexA))\r\n return priorIndexA;\r\n if (priorIndexB !== undefined && normalIsDuplicate(priorIndexB))\r\n return priorIndexB;\r\n // check the tail index for possible duplicate\r\n if (priorIndexA !== undefined || priorIndexB !== undefined) {\r\n const tailIndex = this.data.normal.length - 1;\r\n if (normalIsDuplicate(tailIndex))\r\n return tailIndex;\r\n }\r\n }\r\n return this.addNormalXYZ(normal.x, normal.y, normal.z);\r\n }\r\n /**\r\n * Add a normal vector to the normal array.\r\n * @param x the x coordinate of normal.\r\n * @param y the y coordinate of normal.\r\n * @param z the z coordinate of normal.\r\n * @returns zero-based index of the added normal vector.\r\n */\r\n public addNormalXYZ(x: number, y: number, z: number): number {\r\n if (!this.data.normal)\r\n this.data.normal = new GrowableXYZArray();\r\n this.data.normal.pushXYZ(x, y, z);\r\n return this.data.normal.length - 1;\r\n }\r\n /**\r\n * Add a color to the color array\r\n * @param color the color.\r\n * @returns zero-based index of the added color.\r\n */\r\n public addColor(color: number): number {\r\n if (!this.data.color)\r\n this.data.color = [];\r\n this.data.color.push(color);\r\n return this.data.color.length - 1;\r\n }\r\n /** Add a point index with edge visibility flag. */\r\n public addPointIndex(index: number, visible: boolean = true): void {\r\n this.data.pointIndex.push(index);\r\n this.data.edgeVisible.push(visible);\r\n }\r\n /** Add a normal index. */\r\n public addNormalIndex(index: number): void {\r\n if (!this.data.normalIndex)\r\n this.data.normalIndex = [];\r\n this.data.normalIndex.push(index);\r\n }\r\n /** Add a param index. */\r\n public addParamIndex(index: number): void {\r\n if (!this.data.paramIndex)\r\n this.data.paramIndex = [];\r\n this.data.paramIndex.push(index);\r\n }\r\n /** Add a color index. */\r\n public addColorIndex(index: number): void {\r\n if (!this.data.colorIndex)\r\n this.data.colorIndex = [];\r\n this.data.colorIndex.push(index);\r\n }\r\n /**\r\n * Clean up the open facet.\r\n * @deprecated in 4.x to remove nebulous \"open facet\" concept from the API. Call [[PolyfaceData.trimAllIndexArrays]]\r\n * instead.\r\n */\r\n public cleanupOpenFacet(): void {\r\n this.data.trimAllIndexArrays(this.data.pointIndex.length);\r\n }\r\n\r\n /**\r\n * Validate (the tail of) the active index arrays: point, normal, param, color.\r\n * @param index0 optional offset into the index arrays at which to start validating indices. Default 0.\r\n * @param errors optional array appended with error message(s) if invalid indices are encountered\r\n * @return whether the indices are valid\r\n */\r\n public validateAllIndices(index0: number = 0, errors?: String[]): boolean {\r\n const numPointIndices = this.data.pointIndex.length;\r\n const messages = errors ?? [];\r\n if (this.data.normalIndex && this.data.normalIndex.length !== numPointIndices)\r\n messages.push(\"normalIndex count must match pointIndex count\");\r\n if (this.data.paramIndex && this.data.paramIndex.length !== numPointIndices)\r\n messages.push(\"paramIndex count must equal pointIndex count\");\r\n if (this.data.colorIndex && this.data.colorIndex.length !== numPointIndices)\r\n messages.push(\"colorIndex count must equal pointIndex count\");\r\n if (this.data.edgeVisible.length !== numPointIndices)\r\n messages.push(\"visibleIndex count must equal pointIndex count\");\r\n if (!Polyface.areIndicesValid(this.data.pointIndex, index0, numPointIndices, this.data.point, this.data.point ? this.data.point.length : 0))\r\n messages.push(\"invalid point indices in the last facet\");\r\n if (!Polyface.areIndicesValid(this.data.normalIndex, index0, numPointIndices, this.data.normal, this.data.normal ? this.data.normal.length : 0))\r\n messages.push(\"invalid normal indices in the last facet\");\r\n if (!Polyface.areIndicesValid(this.data.paramIndex, index0, numPointIndices, this.data.param, this.data.param ? this.data.param.length : 0))\r\n messages.push(\"invalid param indices in the last facet\");\r\n if (!Polyface.areIndicesValid(this.data.colorIndex, index0, numPointIndices, this.data.color, this.data.color ? this.data.color.length : 0))\r\n messages.push(\"invalid color indices in the last facet\");\r\n return 0 === messages.length;\r\n }\r\n\r\n /**\r\n * Announce the end of construction of a facet.\r\n * * Optionally check for:\r\n * * Same number of indices among all active index arrays -- point, normal, param, color\r\n * * All indices for the latest facet are within bounds of the respective data arrays.\r\n * * In error cases, all index arrays are trimmed back to the size when previous facet was terminated.\r\n * * A return value of `undefined` is normal. Otherwise, a string array of error messages is returned.\r\n */\r\n public terminateFacet(validateAllIndices: boolean = true): String[] | undefined {\r\n const numFacets = this._facetStart.length - 1;\r\n // number of indices in accepted facets\r\n const lengthA = this._facetStart[numFacets];\r\n // number of indices in all facets (accepted facet plus the last facet to be accepted)\r\n const lengthB = this.data.pointIndex.length;\r\n if (validateAllIndices) {\r\n const messages: String[] = [];\r\n if (lengthB < lengthA + 2)\r\n messages.push(\"Less than 3 indices in the last facet\");\r\n this.validateAllIndices(lengthA, messages);\r\n if (messages.length > 0) {\r\n this.data.trimAllIndexArrays(lengthA);\r\n return messages;\r\n }\r\n }\r\n this._facetStart.push(lengthB); // append start index of the future facet\r\n return undefined;\r\n }\r\n /** Number of facets (read-only property). */\r\n public override get facetCount(): number {\r\n return this._facetStart.length - 1;\r\n }\r\n /** Number of faces (read-only property). */\r\n public get faceCount(): number {\r\n return this.data.faceCount;\r\n }\r\n /** Number of points (read-only property). */\r\n public get pointCount(): number {\r\n return this.data.pointCount;\r\n }\r\n /** Number of colors (read-only property). */\r\n public get colorCount(): number {\r\n return this.data.colorCount;\r\n }\r\n /** Number of parameters (read-only property). */\r\n public get paramCount(): number {\r\n return this.data.paramCount;\r\n }\r\n /** Number of normals (read-only property). */\r\n public get normalCount(): number {\r\n return this.data.normalCount;\r\n }\r\n /** Test if `index` is a valid facet index. */\r\n public isValidFacetIndex(index: number): boolean {\r\n return index >= 0 && index < this.facetCount;\r\n }\r\n /** Return the number of edges in a particular facet. */\r\n public numEdgeInFacet(facetIndex: number): number {\r\n if (this.isValidFacetIndex(facetIndex))\r\n return this._facetStart[facetIndex + 1] - this._facetStart[facetIndex];\r\n return 0;\r\n }\r\n /** ASSUME valid facet index. Return start index of facet in pointIndex arrays. */\r\n public facetIndex0(index: number): number {\r\n return this._facetStart[index];\r\n }\r\n /** ASSUME valid facet index. Return one past end index of facet in pointIndex arrays. */\r\n public facetIndex1(index: number): number {\r\n return this._facetStart[index + 1];\r\n }\r\n /** Create a visitor for this polyface */\r\n public createVisitor(numWrap: number = 0): IndexedPolyfaceVisitor {\r\n return IndexedPolyfaceVisitor.create(this, numWrap);\r\n }\r\n /** Return the range of (optionally transformed) points in this mesh. */\r\n public override range(transform?: Transform, result?: Range3d): Range3d {\r\n return this.data.range(result, transform);\r\n }\r\n /** Extend `range` with coordinates from this mesh. */\r\n public extendRange(range: Range3d, transform?: Transform): void {\r\n this.data.range(range, transform);\r\n }\r\n /**\r\n * Given the index of a facet, return the data pertaining to the face it is a part of.\r\n * @deprecated in 4.x. Use [[IndexedPolyface.tryGetFaceData]], which verifies the index is in range.\r\n */\r\n public getFaceDataByFacetIndex(facetIndex: number): FacetFaceData {\r\n return this.data.face[this._facetToFaceData[facetIndex]];\r\n }\r\n /**\r\n * Set new FacetFaceData.\r\n * * All terminated facets since the last face declaration will be mapped to a single new FacetFaceData object using\r\n * facetToFaceData[]. FacetFaceData holds the 2D range of the face. Returns `true` if successful, `false` otherwise.\r\n */\r\n public setNewFaceData(endFacetIndex: number = 0): boolean {\r\n const facetStart = this._facetToFaceData.length;\r\n if (facetStart >= this._facetStart.length)\r\n return false;\r\n if (0 === endFacetIndex) // the default for endFacetIndex is really the last facet\r\n endFacetIndex = this._facetStart.length; // last facet index corresponds to the future facet\r\n const faceData = FacetFaceData.createNull();\r\n const visitor = IndexedPolyfaceVisitor.create(this, 0);\r\n if (!visitor.moveToReadIndex(facetStart)) { // move visitor to first facet of new face\r\n return false;\r\n }\r\n // if parameter range is provided (by the polyface planeSet clipper) then use it\r\n const paramDefined = this.data.param !== undefined;\r\n const setParamRange: boolean = faceData.paramRange.isNull && paramDefined;\r\n do {\r\n if (setParamRange && visitor.param !== undefined)\r\n visitor.param.extendRange(faceData.paramRange);\r\n } while (visitor.moveToNextFacet() && visitor.currentReadIndex() < endFacetIndex);\r\n if (paramDefined && !(this.data.param!.length === 0) && faceData.paramDistanceRange.isNull)\r\n faceData.setParamDistanceRangeFromNewFaceData(this, facetStart, endFacetIndex);\r\n this.data.face.push(faceData);\r\n const faceDataIndex = this.data.face.length - 1;\r\n for (let i = this._facetToFaceData.length; i < endFacetIndex; i++)\r\n this._facetToFaceData.push(0 === this._facetStart[i] ? 0 : faceDataIndex);\r\n return true;\r\n }\r\n /** Second step of double dispatch: call `handler.handleIndexedPolyface(this)`. */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleIndexedPolyface(this);\r\n }\r\n}\r\n\r\n/**\r\n * A PolyfaceVisitor manages data while walking through facets.\r\n * * The polyface visitor holds data for one facet at a time.\r\n * * The caller can request the position in the addressed polyfaceData as a \"readIndex\".\r\n * * The readIndex values (as numbers) are not promised to be sequential (i.e., it might be a simple facet count\r\n * or might have \"gaps\" at the whim of the particular PolyfaceVisitor implementation).\r\n * @public\r\n */\r\nexport interface PolyfaceVisitor extends PolyfaceData {\r\n /** Load data for the facet with given index. */\r\n moveToReadIndex(index: number): boolean;\r\n /** Return the readIndex of the currently loaded facet. */\r\n currentReadIndex(): number;\r\n /** Load data for the next facet. */\r\n moveToNextFacet(): boolean;\r\n /** Reset to initial state for reading all facets sequentially with moveToNextFacet. */\r\n reset(): void;\r\n /** Return the point index of vertex i within the currently loaded facet. */\r\n clientPointIndex(i: number): number;\r\n /** Return the param index of vertex i within the currently loaded facet. */\r\n clientParamIndex(i: number): number;\r\n /** Return the normal index of vertex i within the currently loaded facet. */\r\n clientNormalIndex(i: number): number;\r\n /** Return the color index of vertex i within the currently loaded facet. */\r\n clientColorIndex(i: number): number;\r\n /** Return the aux data index of vertex i within the currently loaded facet. */\r\n clientAuxIndex(i: number): number;\r\n /** Return the client polyface. */\r\n clientPolyface(): Polyface | undefined;\r\n /**\r\n * Set the number of vertices replicated in visitor arrays (both data and index arrays).\r\n * * 0,1,2 are the most common as numWrap.\r\n * * Example: suppose `[6,7,8]` is the pointIndex array representing a triangle. First edge would be `6,7`. Second\r\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.\r\n * Therefore, it is useful to store `6` at the end of pointIndex array, i.e., `[6,7,8,6]` meaning `numWrap = 1`.\r\n * * Continuing this example, `numWrap = 2` (i.e., `[6,7,8,6,7]`) is useful when each vertex visit requires\r\n * the next two points, e.g., to form two adjacent vectors for a cross product.\r\n */\r\n setNumWrap(numWrap: number): void;\r\n /** Clear the contents of all arrays. Use this along with `pushDataFrom` to build up new facets. */\r\n clearArrays(): void;\r\n /** Transfer data from a specified index of the other visitor as new data in this visitor. */\r\n pushDataFrom(other: PolyfaceVisitor, index: number): void;\r\n /**\r\n * Transfer interpolated data from the other visitor.\r\n * * All data values are interpolated at `fraction` between `other` values at `index0` and `index1`.\r\n */\r\n pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void;\r\n /**\r\n * Return the number of facets this visitor is able to visit.\r\n * * Allows implementers to improve the efficiency of e.g., [[PolyfaceQuery.visitorClientFacetCount]].\r\n */\r\n getVisitableFacetCount?(): number;\r\n}\r\n"]}
1
+ {"version":3,"file":"Polyface.js","sourceRoot":"","sources":["../../../src/polyface/Polyface.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,2BA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QAChD,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,GAAG,aAAa,EAAE,CAAC,EAAE;YAC/D,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC;IACd,CAAC;IACD,kFAAkF;IAC3E,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Polyface\r\n */\r\n\r\n// cspell:word internaldocs\r\n\r\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { GrowableXYArray } from \"../geometry3d/GrowableXYArray\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\r\nimport { Range3d } from \"../geometry3d/Range\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { FacetFaceData } from \"./FacetFaceData\";\r\nimport { IndexedPolyfaceVisitor } from \"./IndexedPolyfaceVisitor\";\r\nimport { PolyfaceData } from \"./PolyfaceData\";\r\n\r\n/**\r\n * A Polyface is an abstract mesh structure (of unspecified implementation) that provides a PolyfaceVisitor\r\n * to iterate over its facets.\r\n * @public\r\n */\r\nexport abstract class Polyface extends GeometryQuery {\r\n /** String name for schema properties */\r\n public readonly geometryCategory = \"polyface\";\r\n /** Underlying polyface data. */\r\n public data: PolyfaceData;\r\n /** Constructor */\r\n protected constructor(data: PolyfaceData) {\r\n super();\r\n this.data = data;\r\n }\r\n /**\r\n * Create and return a visitor for this concrete polyface.\r\n * @param numWrap the number of vertices to replicate in visitor arrays.\r\n */\r\n public abstract createVisitor(numWrap: number): PolyfaceVisitor;\r\n /** Flag indicating if the mesh display must assume both sides are visible. */\r\n public get twoSided() {\r\n return this.data.twoSided;\r\n }\r\n public set twoSided(value: boolean) {\r\n this.data.twoSided = value;\r\n }\r\n /**\r\n * Flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2).\r\n * * A boundary edge of a mesh is defined as an edge with only one connected facet.\r\n * * Closed solid is a mesh with no boundary edge. Open sheet is a mesh that has boundary edge(s).\r\n */\r\n public get expectedClosure(): number {\r\n return this.data.expectedClosure;\r\n }\r\n public set expectedClosure(value: number) {\r\n this.data.expectedClosure = value;\r\n }\r\n /**\r\n * Check validity of indices into a data array.\r\n * * It is valid to have both indices and data undefined.\r\n * * It is NOT valid for just one to be defined.\r\n * * Index values at indices[indexPositionA <= i < indexPositionB] must be valid indices to the data array.\r\n * @param indices array of indices.\r\n * @param indexPositionA first index to test.\r\n * @param indexPositionB one past final index to test.\r\n * @param data data array.\r\n * @param dataLength length of data array.\r\n */\r\n public static areIndicesValid(\r\n indices: number[] | undefined,\r\n indexPositionA: number,\r\n indexPositionB: number,\r\n data: any,\r\n dataLength: number,\r\n ): boolean {\r\n if (indices === undefined && data === undefined)\r\n return true;\r\n if (indices === undefined || data === undefined)\r\n return false;\r\n if (indexPositionA < 0 || indexPositionA >= indices.length)\r\n return false;\r\n if (indexPositionB <= indexPositionA || indexPositionB > indices.length)\r\n return false;\r\n for (let i = indexPositionA; i < indexPositionB; i++)\r\n if (indices[i] < 0 || indices[i] >= dataLength)\r\n return false;\r\n return true;\r\n }\r\n /** Returns true if this polyface has no facets. */\r\n public abstract get isEmpty(): boolean;\r\n /** Returns the number of facets of this polyface. Subclasses should override. */\r\n public get facetCount(): number | undefined {\r\n return undefined;\r\n }\r\n}\r\n\r\n/**\r\n * An `IndexedPolyface` is a set of facets which can have normal, param, and color arrays with independent point,\r\n * normal, param, and color indices.\r\n * @public\r\n */\r\nexport class IndexedPolyface extends Polyface { // more info can be found at geometry/internaldocs/Polyface.md\r\n /**\r\n * Start indices of all facets of the polyface.\r\n * * Each element is an index to the `this.data.pointIndex` array entry for a specific facet.\r\n * * The facet count is `_facetStart.length - 1`.\r\n * * The face loop for the i_th facet consists of the entries in `this.data.pointIndex` at indices `_facetStart[i]`\r\n * up to (but not including) `_facetStart[i + 1]`.\r\n * * Note the array is initialized with one entry (value 0).\r\n */\r\n protected _facetStart: number[];\r\n /**\r\n * Index to the `this.data.face` array entry for a specific facet.\r\n * * `_facetToFaceData` has one entry per facet.\r\n */\r\n protected _facetToFaceData: number[];\r\n /**\r\n * Constructor for a new polyface.\r\n * @param data PolyfaceData arrays to capture.\r\n * @param facetStart optional array of facet start indices (e.g. known during clone)\r\n * @param facetToFacetData optional array of face identifiers (e.g. known during clone)\r\n */\r\n protected constructor(data: PolyfaceData, facetStart?: number[], facetToFaceData?: number[]) {\r\n super(data);\r\n if (facetStart)\r\n this._facetStart = facetStart.slice(); // deep copy\r\n else {\r\n this._facetStart = [];\r\n this._facetStart.push(0);\r\n }\r\n if (facetToFaceData)\r\n this._facetToFaceData = facetToFaceData.slice(); // deep copy\r\n else\r\n this._facetToFaceData = [];\r\n }\r\n /** Test if other is an instance of `IndexedPolyface` */\r\n public isSameGeometryClass(other: any): boolean {\r\n return other instanceof IndexedPolyface;\r\n }\r\n /** Tests for equivalence between two IndexedPolyfaces. */\r\n public override isAlmostEqual(other: any): boolean {\r\n if (other instanceof IndexedPolyface) {\r\n return this.data.isAlmostEqual(other.data) &&\r\n NumberArray.isExactEqual(this._facetStart, other._facetStart) &&\r\n NumberArray.isExactEqual(this._facetToFaceData, other._facetToFaceData);\r\n }\r\n return false;\r\n }\r\n /** Returns true if either the point array or the point index array is empty. */\r\n public get isEmpty(): boolean {\r\n return this.data.pointCount === 0 || this.data.pointIndex.length === 0;\r\n }\r\n /**\r\n * Transform the mesh.\r\n * * Apply the transform to points.\r\n * * Apply the (inverse transpose of the) matrix part to normals.\r\n * * If determinant of the transform matrix is negative, also\r\n * * negate normals\r\n * * reverse index order around each facet.\r\n */\r\n public tryTransformInPlace(transform: Transform) {\r\n if (!this.data.tryTransformInPlace(transform))\r\n return false;\r\n const determinant = transform.matrix.determinant();\r\n if (determinant < 0) {\r\n this.reverseIndices();\r\n this.reverseNormals();\r\n }\r\n return true;\r\n }\r\n /** Reverse indices for a single facet. */\r\n public reverseSingleFacet(facetId: number) {\r\n this.data.reverseIndicesSingleFacet(facetId, this._facetStart);\r\n }\r\n /** Return a deep clone. */\r\n public clone(): IndexedPolyface {\r\n const result = new IndexedPolyface(this.data.clone(), this._facetStart.slice(), this._facetToFaceData.slice());\r\n return result;\r\n }\r\n /**\r\n * Return a deep clone with transformed points and normals.\r\n * @see [[IndexedPolyface.tryTransformInPlace]] for details of how transform is done.\r\n */\r\n public cloneTransformed(transform: Transform): IndexedPolyface {\r\n const result = this.clone();\r\n result.tryTransformInPlace(transform);\r\n return result;\r\n }\r\n /** Reverse the order of indices around all facets. */\r\n public reverseIndices() {\r\n this.data.reverseIndices(this._facetStart);\r\n }\r\n /** Reverse the direction of all normal vectors. */\r\n public reverseNormals() {\r\n this.data.reverseNormals();\r\n }\r\n /**\r\n * Return face data using a facet index.\r\n * * Returns `undefined` if none found.\r\n * * This is the REFERENCE to the FacetFaceData not a copy.\r\n */\r\n public tryGetFaceData(i: number): FacetFaceData | undefined {\r\n if (i < 0 || i >= this._facetToFaceData.length)\r\n return undefined;\r\n const faceIndex = this._facetToFaceData[i];\r\n if (faceIndex < 0 || faceIndex >= this.data.face.length)\r\n return undefined;\r\n return this.data.face[faceIndex];\r\n }\r\n /**\r\n * Add facets from `source` to `this` polyface.\r\n * * Optionally reverse facet indices as per `PolyfaceData.reverseIndicesSingleFacet()` with `preserveStart = false` and\r\n * invert source normals.\r\n * * Optionally apply a `transform` to points and normals.\r\n * * Will only copy param, normal, color, and face data if we are already tracking them AND/OR the source contains them.\r\n */\r\n public addIndexedPolyface(source: IndexedPolyface, reversed: boolean, transform: Transform | undefined) {\r\n const numSourceFacets = source.facetCount;\r\n // add point, point index, and edge visibility data\r\n // note that there is no need to build an intermediate index map since all points are added\r\n const startOfNewPoints = this.data.point.length;\r\n const xyz = Point3d.create();\r\n for (let i = 0; i < source.data.point.length; i++) {\r\n source.data.point.getPoint3dAtUncheckedPointIndex(i, xyz);\r\n if (transform) {\r\n transform.multiplyPoint3d(xyz, xyz);\r\n this.addPoint(xyz);\r\n } else\r\n this.addPoint(xyz);\r\n }\r\n for (let i = 0; i < numSourceFacets; i++) {\r\n const i0 = source._facetStart[i];\r\n const i1 = source._facetStart[i + 1];\r\n if (reversed) {\r\n for (let j = i1; j-- > i0;) { // visibility is transferred from far vertex, e.g., -abc-d => dc-b-a\r\n this.addPointIndex(\r\n startOfNewPoints + source.data.pointIndex[j],\r\n source.data.edgeVisible[j > i0 ? j - 1 : i1 - 1],\r\n );\r\n }\r\n } else {\r\n for (let j = i0; j < i1; j++) {\r\n this.addPointIndex(\r\n startOfNewPoints + source.data.pointIndex[j],\r\n source.data.edgeVisible[j],\r\n );\r\n }\r\n }\r\n this.terminateFacet(false);\r\n }\r\n // add param and param index data\r\n if (undefined !== this.data.param && undefined !== source.data.param && undefined !== source.data.paramIndex) {\r\n const startOfNewParams = this.data.param.length;\r\n this.data.param.pushFromGrowableXYArray(source.data.param);\r\n for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals\r\n const i0 = source._facetStart[i];\r\n const i1 = source._facetStart[i + 1];\r\n if (reversed) {\r\n for (let j = i1; j-- > i0;)\r\n this.addParamIndex(startOfNewParams + source.data.paramIndex[j]);\r\n } else {\r\n for (let j = i0; j < i1; j++)\r\n this.addParamIndex(startOfNewParams + source.data.paramIndex[j]);\r\n }\r\n }\r\n }\r\n // add normal and normal index data\r\n if (undefined !== this.data.normal && undefined !== source.data.normal && undefined !== source.data.normalIndex) {\r\n const startOfNewNormals = this.data.normal.length;\r\n for (let i = 0; i < source.data.normal.length; i++) {\r\n const sourceNormal = source.data.normal.getVector3dAtCheckedVectorIndex(i)!;\r\n if (transform)\r\n transform.multiplyVector(sourceNormal, sourceNormal);\r\n if (reversed)\r\n sourceNormal.scaleInPlace(-1.0);\r\n this.addNormal(sourceNormal);\r\n }\r\n for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals\r\n const i0 = source._facetStart[i];\r\n const i1 = source._facetStart[i + 1];\r\n if (reversed) {\r\n for (let j = i1; j-- > i0;)\r\n this.addNormalIndex(startOfNewNormals + source.data.normalIndex[j]);\r\n } else {\r\n for (let j = i0; j < i1; j++)\r\n this.addNormalIndex(startOfNewNormals + source.data.normalIndex[j]);\r\n }\r\n }\r\n }\r\n // add color and color index data\r\n if (undefined !== this.data.color && undefined !== source.data.color && undefined !== source.data.colorIndex) {\r\n const startOfNewColors = this.data.color.length;\r\n for (const sourceColor of source.data.color)\r\n this.addColor(sourceColor);\r\n for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match colors\r\n const i0 = source._facetStart[i];\r\n const i1 = source._facetStart[i + 1];\r\n if (reversed) {\r\n for (let j = i1; j-- > i0;)\r\n this.addColorIndex(startOfNewColors + source.data.colorIndex[j]);\r\n } else {\r\n for (let j = i0; j < i1; j++)\r\n this.addColorIndex(startOfNewColors + source.data.colorIndex[j]);\r\n }\r\n }\r\n }\r\n // add face and facetToFace index data\r\n if (source.data.face.length !== 0) {\r\n const startOfNewFaceData = this.data.face.length;\r\n for (const face of source.data.face) {\r\n const sourceFaceData = face.clone();\r\n this.data.face.push(sourceFaceData);\r\n }\r\n for (const facetToFaceIdx of source._facetToFaceData) {\r\n this._facetToFaceData.push(startOfNewFaceData + facetToFaceIdx);\r\n }\r\n }\r\n }\r\n /**\r\n * Return the total number of indices in zero-terminated style, which includes\r\n * * all the indices in the packed zero-based table.\r\n * * one additional index for the zero-terminator of each facet.\r\n * @note Note that all index arrays (pointIndex, normalIndex, paramIndex, colorIndex) have the same counts, so there\r\n * is not a separate query for each of them.\r\n */\r\n public get zeroTerminatedIndexCount(): number {\r\n return this.data.pointIndex.length + this._facetStart.length - 1;\r\n }\r\n /**\r\n * Create an empty facet set with coordinate and index data to be supplied later.\r\n * @param needNormals `true` to allocate empty normal data and index arrays; `false` (default) to leave undefined.\r\n * @param needParams `true` to allocate empty uv parameter data and index arrays; `false` (default) to leave undefined.\r\n * @param needColors `true` to allocate empty color data and index arrays; `false` (default) to leave undefined.\r\n * @param twoSided `true` if the facets are to be considered viewable from the back; `false` (default) if not.\r\n */\r\n public static create(\r\n needNormals: boolean = false,\r\n needParams: boolean = false,\r\n needColors: boolean = false,\r\n twoSided: boolean = false,\r\n ): IndexedPolyface {\r\n return new IndexedPolyface(new PolyfaceData(needNormals, needParams, needColors, twoSided));\r\n }\r\n /**\r\n * Add (a clone of) a point to point array.\r\n * @param point the point.\r\n * @param priorIndex (optional) index of prior point to check for possible duplicate value.\r\n * @returns the zero-based index of the added or duplicate point.\r\n */\r\n public addPoint(point: Point3d, priorIndex?: number): number {\r\n if (priorIndex !== undefined) {\r\n const distance = this.data.point.distanceIndexToPoint(priorIndex, point);\r\n if (distance !== undefined && Geometry.isSmallMetricDistance(distance))\r\n return priorIndex;\r\n }\r\n this.data.point.pushXYZ(point.x, point.y, point.z);\r\n return this.data.point.length - 1;\r\n }\r\n /**\r\n * Add a point to point array.\r\n * @param x the x coordinate of point.\r\n * @param y the y coordinate of point.\r\n * @param z the z coordinate of point.\r\n * @returns the zero-based index of the added point.\r\n */\r\n public addPointXYZ(x: number, y: number, z: number): number {\r\n this.data.point.pushXYZ(x, y, z);\r\n return this.data.point.length - 1;\r\n }\r\n /**\r\n * Add (a clone of) a uv parameter to the parameter array.\r\n * @param param the parameter.\r\n * @returns zero-based index of the added param.\r\n */\r\n public addParam(param: Point2d): number {\r\n if (!this.data.param)\r\n this.data.param = new GrowableXYArray();\r\n this.data.param.push(param);\r\n return this.data.param.length - 1;\r\n }\r\n /**\r\n * Add a uv parameter to the parameter array.\r\n * @param u the u part of parameter.\r\n * @param v the v part of parameter.\r\n * @param priorIndexA first index to check for possible duplicate value.\r\n * @param priorIndexB second index to check for possible duplicate value.\r\n * @returns zero-based index of the added or duplicate parameter.\r\n */\r\n public addParamUV(u: number, v: number, priorIndexA?: number, priorIndexB?: number): number {\r\n if (!this.data.param)\r\n this.data.param = new GrowableXYArray();\r\n if (priorIndexA !== undefined && this.data.isAlmostEqualParamIndexUV(priorIndexA, u, v))\r\n return priorIndexA;\r\n if (priorIndexB !== undefined && this.data.isAlmostEqualParamIndexUV(priorIndexB, u, v))\r\n return priorIndexB;\r\n this.data.param.pushXY(u, v);\r\n return this.data.param.length - 1;\r\n }\r\n /**\r\n * Add (a clone of) a normal vector to the normal array.\r\n * @param normal the normal vector.\r\n * @param priorIndexA first index to check for possible duplicate value.\r\n * @param priorIndexB second index to check for possible duplicate value.\r\n * @returns zero-based index of the added or duplicate normal.\r\n */\r\n public addNormal(normal: Vector3d, priorIndexA?: number, priorIndexB?: number): number {\r\n // check if `normal` is duplicate of `dataNormal` at index `i`\r\n const normalIsDuplicate = (i: number) => {\r\n const distance = this.data.normal!.distanceIndexToPoint(i, normal);\r\n return distance !== undefined && Geometry.isSmallMetricDistance(distance);\r\n };\r\n if (this.data.normal !== undefined) {\r\n if (priorIndexA !== undefined && normalIsDuplicate(priorIndexA))\r\n return priorIndexA;\r\n if (priorIndexB !== undefined && normalIsDuplicate(priorIndexB))\r\n return priorIndexB;\r\n // check the tail index for possible duplicate\r\n if (priorIndexA !== undefined || priorIndexB !== undefined) {\r\n const tailIndex = this.data.normal.length - 1;\r\n if (normalIsDuplicate(tailIndex))\r\n return tailIndex;\r\n }\r\n }\r\n return this.addNormalXYZ(normal.x, normal.y, normal.z);\r\n }\r\n /**\r\n * Add a normal vector to the normal array.\r\n * @param x the x coordinate of normal.\r\n * @param y the y coordinate of normal.\r\n * @param z the z coordinate of normal.\r\n * @returns zero-based index of the added normal vector.\r\n */\r\n public addNormalXYZ(x: number, y: number, z: number): number {\r\n if (!this.data.normal)\r\n this.data.normal = new GrowableXYZArray();\r\n this.data.normal.pushXYZ(x, y, z);\r\n return this.data.normal.length - 1;\r\n }\r\n /**\r\n * Add a color to the color array\r\n * @param color the color.\r\n * @returns zero-based index of the added color.\r\n */\r\n public addColor(color: number): number {\r\n if (!this.data.color)\r\n this.data.color = [];\r\n this.data.color.push(color);\r\n return this.data.color.length - 1;\r\n }\r\n /** Add a point index with edge visibility flag. */\r\n public addPointIndex(index: number, visible: boolean = true): void {\r\n this.data.pointIndex.push(index);\r\n this.data.edgeVisible.push(visible);\r\n }\r\n /** Add a normal index. */\r\n public addNormalIndex(index: number): void {\r\n if (!this.data.normalIndex)\r\n this.data.normalIndex = [];\r\n this.data.normalIndex.push(index);\r\n }\r\n /** Add a param index. */\r\n public addParamIndex(index: number): void {\r\n if (!this.data.paramIndex)\r\n this.data.paramIndex = [];\r\n this.data.paramIndex.push(index);\r\n }\r\n /** Add a color index. */\r\n public addColorIndex(index: number): void {\r\n if (!this.data.colorIndex)\r\n this.data.colorIndex = [];\r\n this.data.colorIndex.push(index);\r\n }\r\n /**\r\n * Clean up the open facet.\r\n * @deprecated in 4.x to remove nebulous \"open facet\" concept from the API. Call [[PolyfaceData.trimAllIndexArrays]]\r\n * instead.\r\n */\r\n public cleanupOpenFacet(): void {\r\n this.data.trimAllIndexArrays(this.data.pointIndex.length);\r\n }\r\n\r\n /**\r\n * Validate (the tail of) the active index arrays: point, normal, param, color.\r\n * @param index0 optional offset into the index arrays at which to start validating indices. Default 0.\r\n * @param errors optional array appended with error message(s) if invalid indices are encountered\r\n * @return whether the indices are valid\r\n */\r\n public validateAllIndices(index0: number = 0, errors?: string[]): boolean {\r\n const numPointIndices = this.data.pointIndex.length;\r\n const messages = errors ?? [];\r\n if (this.data.normalIndex && this.data.normalIndex.length !== numPointIndices)\r\n messages.push(\"normalIndex count must match pointIndex count\");\r\n if (this.data.paramIndex && this.data.paramIndex.length !== numPointIndices)\r\n messages.push(\"paramIndex count must equal pointIndex count\");\r\n if (this.data.colorIndex && this.data.colorIndex.length !== numPointIndices)\r\n messages.push(\"colorIndex count must equal pointIndex count\");\r\n if (this.data.edgeVisible.length !== numPointIndices)\r\n messages.push(\"visibleIndex count must equal pointIndex count\");\r\n if (!Polyface.areIndicesValid(this.data.pointIndex, index0, numPointIndices, this.data.point, this.data.point ? this.data.point.length : 0))\r\n messages.push(\"invalid point indices in the last facet\");\r\n if (!Polyface.areIndicesValid(this.data.normalIndex, index0, numPointIndices, this.data.normal, this.data.normal ? this.data.normal.length : 0))\r\n messages.push(\"invalid normal indices in the last facet\");\r\n if (!Polyface.areIndicesValid(this.data.paramIndex, index0, numPointIndices, this.data.param, this.data.param ? this.data.param.length : 0))\r\n messages.push(\"invalid param indices in the last facet\");\r\n if (!Polyface.areIndicesValid(this.data.colorIndex, index0, numPointIndices, this.data.color, this.data.color ? this.data.color.length : 0))\r\n messages.push(\"invalid color indices in the last facet\");\r\n return 0 === messages.length;\r\n }\r\n\r\n /**\r\n * Announce the end of construction of a facet.\r\n * * Optionally check for:\r\n * * Same number of indices among all active index arrays -- point, normal, param, color\r\n * * All indices for the latest facet are within bounds of the respective data arrays.\r\n * * In error cases, all index arrays are trimmed back to the size when previous facet was terminated.\r\n * * A return value of `undefined` is normal. Otherwise, a string array of error messages is returned.\r\n */\r\n public terminateFacet(validateAllIndices: boolean = true): string[] | undefined {\r\n const numFacets = this._facetStart.length - 1;\r\n // number of indices in accepted facets\r\n const lengthA = this._facetStart[numFacets];\r\n // number of indices in all facets (accepted facet plus the last facet to be accepted)\r\n const lengthB = this.data.pointIndex.length;\r\n if (validateAllIndices) {\r\n const messages: string[] = [];\r\n if (lengthB < lengthA + 2)\r\n messages.push(\"Less than 3 indices in the last facet\");\r\n this.validateAllIndices(lengthA, messages);\r\n if (messages.length > 0) {\r\n this.data.trimAllIndexArrays(lengthA);\r\n return messages;\r\n }\r\n }\r\n this._facetStart.push(lengthB); // append start index of the future facet\r\n return undefined;\r\n }\r\n /** Number of facets (read-only property). */\r\n public override get facetCount(): number {\r\n return this._facetStart.length - 1;\r\n }\r\n /** Number of faces (read-only property). */\r\n public get faceCount(): number {\r\n return this.data.faceCount;\r\n }\r\n /** Number of points (read-only property). */\r\n public get pointCount(): number {\r\n return this.data.pointCount;\r\n }\r\n /** Number of colors (read-only property). */\r\n public get colorCount(): number {\r\n return this.data.colorCount;\r\n }\r\n /** Number of parameters (read-only property). */\r\n public get paramCount(): number {\r\n return this.data.paramCount;\r\n }\r\n /** Number of normals (read-only property). */\r\n public get normalCount(): number {\r\n return this.data.normalCount;\r\n }\r\n /** Test if `index` is a valid facet index. */\r\n public isValidFacetIndex(index: number): boolean {\r\n return index >= 0 && index < this.facetCount;\r\n }\r\n /** Return the number of edges in a particular facet. */\r\n public numEdgeInFacet(facetIndex: number): number {\r\n if (this.isValidFacetIndex(facetIndex))\r\n return this._facetStart[facetIndex + 1] - this._facetStart[facetIndex];\r\n return 0;\r\n }\r\n /** ASSUME valid facet index. Return start index of facet in pointIndex arrays. */\r\n public facetIndex0(index: number): number {\r\n return this._facetStart[index];\r\n }\r\n /** ASSUME valid facet index. Return one past end index of facet in pointIndex arrays. */\r\n public facetIndex1(index: number): number {\r\n return this._facetStart[index + 1];\r\n }\r\n /** Create a visitor for this polyface */\r\n public createVisitor(numWrap: number = 0): IndexedPolyfaceVisitor {\r\n return IndexedPolyfaceVisitor.create(this, numWrap);\r\n }\r\n /** Return the range of (optionally transformed) points in this mesh. */\r\n public override range(transform?: Transform, result?: Range3d): Range3d {\r\n return this.data.range(result, transform);\r\n }\r\n /** Extend `range` with coordinates from this mesh. */\r\n public extendRange(range: Range3d, transform?: Transform): void {\r\n this.data.range(range, transform);\r\n }\r\n /**\r\n * Given the index of a facet, return the data pertaining to the face it is a part of.\r\n * @deprecated in 4.x. Use [[IndexedPolyface.tryGetFaceData]], which verifies the index is in range.\r\n */\r\n public getFaceDataByFacetIndex(facetIndex: number): FacetFaceData {\r\n return this.data.face[this._facetToFaceData[facetIndex]];\r\n }\r\n /**\r\n * Set new FacetFaceData.\r\n * * All terminated facets since the last face declaration will be mapped to a single new FacetFaceData object using\r\n * facetToFaceData[]. FacetFaceData holds the 2D range of the face. Returns `true` if successful, `false` otherwise.\r\n */\r\n public setNewFaceData(endFacetIndex: number = 0): boolean {\r\n const facetStart = this._facetToFaceData.length;\r\n if (facetStart >= this._facetStart.length)\r\n return false;\r\n if (0 === endFacetIndex) // the default for endFacetIndex is really the last facet\r\n endFacetIndex = this._facetStart.length; // last facet index corresponds to the future facet\r\n const faceData = FacetFaceData.createNull();\r\n const visitor = IndexedPolyfaceVisitor.create(this, 0);\r\n if (!visitor.moveToReadIndex(facetStart)) { // move visitor to first facet of new face\r\n return false;\r\n }\r\n // if parameter range is provided (by the polyface planeSet clipper) then use it\r\n const paramDefined = this.data.param !== undefined;\r\n const setParamRange: boolean = faceData.paramRange.isNull && paramDefined;\r\n do {\r\n if (setParamRange && visitor.param !== undefined)\r\n visitor.param.extendRange(faceData.paramRange);\r\n } while (visitor.moveToNextFacet() && visitor.currentReadIndex() < endFacetIndex);\r\n if (paramDefined && !(this.data.param!.length === 0) && faceData.paramDistanceRange.isNull)\r\n faceData.setParamDistanceRangeFromNewFaceData(this, facetStart, endFacetIndex);\r\n this.data.face.push(faceData);\r\n const faceDataIndex = this.data.face.length - 1;\r\n for (let i = this._facetToFaceData.length; i < endFacetIndex; i++)\r\n this._facetToFaceData.push(0 === this._facetStart[i] ? 0 : faceDataIndex);\r\n return true;\r\n }\r\n /** Second step of double dispatch: call `handler.handleIndexedPolyface(this)`. */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleIndexedPolyface(this);\r\n }\r\n}\r\n\r\n/**\r\n * A PolyfaceVisitor manages data while walking through facets.\r\n * * The polyface visitor holds data for one facet at a time.\r\n * * The caller can request the position in the addressed polyfaceData as a \"readIndex\".\r\n * * The readIndex values (as numbers) are not promised to be sequential (i.e., it might be a simple facet count\r\n * or might have \"gaps\" at the whim of the particular PolyfaceVisitor implementation).\r\n * @public\r\n */\r\nexport interface PolyfaceVisitor extends PolyfaceData {\r\n /** Load data for the facet with given index. */\r\n moveToReadIndex(index: number): boolean;\r\n /** Return the readIndex of the currently loaded facet. */\r\n currentReadIndex(): number;\r\n /** Load data for the next facet. */\r\n moveToNextFacet(): boolean;\r\n /** Reset to initial state for reading all facets sequentially with moveToNextFacet. */\r\n reset(): void;\r\n /** Return the point index of vertex i within the currently loaded facet. */\r\n clientPointIndex(i: number): number;\r\n /** Return the param index of vertex i within the currently loaded facet. */\r\n clientParamIndex(i: number): number;\r\n /** Return the normal index of vertex i within the currently loaded facet. */\r\n clientNormalIndex(i: number): number;\r\n /** Return the color index of vertex i within the currently loaded facet. */\r\n clientColorIndex(i: number): number;\r\n /** Return the aux data index of vertex i within the currently loaded facet. */\r\n clientAuxIndex(i: number): number;\r\n /** Return the client polyface. */\r\n clientPolyface(): Polyface | undefined;\r\n /**\r\n * Set the number of vertices replicated in visitor arrays (both data and index arrays).\r\n * * 0,1,2 are the most common as numWrap.\r\n * * Example: suppose `[6,7,8]` is the pointIndex array representing a triangle. First edge would be `6,7`. Second\r\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.\r\n * Therefore, it is useful to store `6` at the end of pointIndex array, i.e., `[6,7,8,6]` meaning `numWrap = 1`.\r\n * * Continuing this example, `numWrap = 2` (i.e., `[6,7,8,6,7]`) is useful when each vertex visit requires\r\n * the next two points, e.g., to form two adjacent vectors for a cross product.\r\n */\r\n setNumWrap(numWrap: number): void;\r\n /** Clear the contents of all arrays. Use this along with `pushDataFrom` to build up new facets. */\r\n clearArrays(): void;\r\n /** Transfer data from a specified index of the other visitor as new data in this visitor. */\r\n pushDataFrom(other: PolyfaceVisitor, index: number): void;\r\n /**\r\n * Transfer interpolated data from the other visitor.\r\n * * All data values are interpolated at `fraction` between `other` values at `index0` and `index1`.\r\n */\r\n pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void;\r\n /**\r\n * Return the number of facets this visitor is able to visit.\r\n * * Allows implementers to improve the efficiency of e.g., [[PolyfaceQuery.visitorClientFacetCount]].\r\n */\r\n getVisitableFacetCount?(): number;\r\n}\r\n"]}
@@ -1123,7 +1123,7 @@ export class PolyfaceBuilder extends NullGeometryHandler {
1123
1123
  const children = data.children;
1124
1124
  if (children)
1125
1125
  for (const child of children)
1126
- // eslint-disable-next-line deprecation/deprecation
1126
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
1127
1127
  this.applyStrokeCountsToCurvePrimitives(child);
1128
1128
  }
1129
1129
  }