@itwin/core-geometry 4.0.0-dev.4 → 4.0.0-dev.41

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 (344) hide show
  1. package/CHANGELOG.md +17 -3
  2. package/lib/cjs/Geometry.d.ts +56 -16
  3. package/lib/cjs/Geometry.d.ts.map +1 -1
  4. package/lib/cjs/Geometry.js +87 -30
  5. package/lib/cjs/Geometry.js.map +1 -1
  6. package/lib/cjs/bspline/BSplineCurveOps.js +4 -5
  7. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  8. package/lib/cjs/bspline/InterpolationCurve3d.js +7 -10
  9. package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
  10. package/lib/cjs/clipping/ClipPrimitive.js +2 -2
  11. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  12. package/lib/cjs/clipping/ClipUtils.js +4 -4
  13. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  14. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js +2 -2
  15. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  16. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  17. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +20 -13
  18. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  19. package/lib/cjs/curve/CurveCollection.js +1 -1
  20. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  21. package/lib/cjs/curve/CurveCurve.d.ts +11 -8
  22. package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
  23. package/lib/cjs/curve/CurveCurve.js +16 -12
  24. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  25. package/lib/cjs/curve/CurveCurveIntersectXY.d.ts +5 -1
  26. package/lib/cjs/curve/CurveCurveIntersectXY.d.ts.map +1 -1
  27. package/lib/cjs/curve/CurveCurveIntersectXY.js +11 -10
  28. package/lib/cjs/curve/CurveCurveIntersectXY.js.map +1 -1
  29. package/lib/cjs/curve/Loop.d.ts +2 -2
  30. package/lib/cjs/curve/Loop.d.ts.map +1 -1
  31. package/lib/cjs/curve/Loop.js +6 -0
  32. package/lib/cjs/curve/Loop.js.map +1 -1
  33. package/lib/cjs/curve/RegionOps.d.ts +10 -10
  34. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  35. package/lib/cjs/curve/RegionOps.js +11 -11
  36. package/lib/cjs/curve/RegionOps.js.map +1 -1
  37. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +2 -1
  38. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  39. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +5 -2
  40. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  41. package/lib/cjs/curve/StrokeOptions.js +1 -2
  42. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  43. package/lib/cjs/curve/spiral/DirectSpiral3d.js +1 -2
  44. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  45. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +1 -2
  46. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  47. package/lib/cjs/geometry3d/Angle.d.ts +19 -0
  48. package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
  49. package/lib/cjs/geometry3d/Angle.js +39 -0
  50. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  51. package/lib/cjs/geometry3d/AngleSweep.d.ts +1 -0
  52. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  53. package/lib/cjs/geometry3d/AngleSweep.js +1 -0
  54. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  55. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +195 -8
  56. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  57. package/lib/cjs/geometry3d/BarycentricTriangle.js +459 -11
  58. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  59. package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts +1 -0
  60. package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
  61. package/lib/cjs/geometry3d/CoincidentGeometryOps.js +3 -0
  62. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  63. package/lib/cjs/geometry3d/GrowableFloat64Array.js +2 -2
  64. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  65. package/lib/cjs/geometry3d/GrowableXYArray.d.ts +1 -1
  66. package/lib/cjs/geometry3d/GrowableXYArray.d.ts.map +1 -1
  67. package/lib/cjs/geometry3d/GrowableXYArray.js +2 -2
  68. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  69. package/lib/cjs/geometry3d/GrowableXYZArray.js +1 -1
  70. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  71. package/lib/cjs/geometry3d/IndexedXYCollection.d.ts +22 -7
  72. package/lib/cjs/geometry3d/IndexedXYCollection.d.ts.map +1 -1
  73. package/lib/cjs/geometry3d/IndexedXYCollection.js +41 -5
  74. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  75. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +58 -4
  76. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  77. package/lib/cjs/geometry3d/IndexedXYZCollection.js +102 -4
  78. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  79. package/lib/cjs/geometry3d/Matrix3d.d.ts +479 -265
  80. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  81. package/lib/cjs/geometry3d/Matrix3d.js +996 -784
  82. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  83. package/lib/cjs/geometry3d/OrderedRotationAngles.d.ts +1 -0
  84. package/lib/cjs/geometry3d/OrderedRotationAngles.d.ts.map +1 -1
  85. package/lib/cjs/geometry3d/OrderedRotationAngles.js +1 -0
  86. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  87. package/lib/cjs/geometry3d/Point2dArrayCarrier.d.ts +10 -0
  88. package/lib/cjs/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
  89. package/lib/cjs/geometry3d/Point2dArrayCarrier.js +14 -0
  90. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  91. package/lib/cjs/geometry3d/Point2dVector2d.js +4 -6
  92. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  93. package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts +0 -6
  94. package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
  95. package/lib/cjs/geometry3d/Point3dArrayCarrier.js +0 -6
  96. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  97. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +57 -57
  98. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  99. package/lib/cjs/geometry3d/Point3dVector3d.js +63 -65
  100. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  101. package/lib/cjs/geometry3d/PointHelpers.d.ts +14 -1
  102. package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
  103. package/lib/cjs/geometry3d/PointHelpers.js +33 -1
  104. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  105. package/lib/cjs/geometry3d/PolygonOps.d.ts +127 -19
  106. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  107. package/lib/cjs/geometry3d/PolygonOps.js +420 -22
  108. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  109. package/lib/cjs/geometry3d/Ray3d.js +1 -1
  110. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  111. package/lib/cjs/geometry3d/Segment1d.d.ts +1 -1
  112. package/lib/cjs/geometry3d/Segment1d.js +1 -1
  113. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  114. package/lib/cjs/numerics/Polynomials.d.ts +12 -0
  115. package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
  116. package/lib/cjs/numerics/Polynomials.js +14 -0
  117. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  118. package/lib/cjs/polyface/AuxData.js +1 -1
  119. package/lib/cjs/polyface/AuxData.js.map +1 -1
  120. package/lib/cjs/polyface/FacetLocationDetail.d.ts +264 -0
  121. package/lib/cjs/polyface/FacetLocationDetail.d.ts.map +1 -0
  122. package/lib/cjs/polyface/FacetLocationDetail.js +376 -0
  123. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -0
  124. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +2 -5
  125. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  126. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +5 -2
  127. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  128. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +24 -14
  129. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  130. package/lib/cjs/polyface/PolyfaceBuilder.js +74 -23
  131. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  132. package/lib/cjs/polyface/PolyfaceClip.js +6 -7
  133. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  134. package/lib/cjs/polyface/PolyfaceData.d.ts +1 -1
  135. package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
  136. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  137. package/lib/cjs/polyface/PolyfaceQuery.d.ts +76 -1
  138. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  139. package/lib/cjs/polyface/PolyfaceQuery.js +123 -3
  140. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  141. package/lib/cjs/polyface/multiclip/OffsetMeshContext.d.ts +202 -0
  142. package/lib/cjs/polyface/multiclip/OffsetMeshContext.d.ts.map +1 -0
  143. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js +1038 -0
  144. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -0
  145. package/lib/cjs/serialization/BGFBReader.js +4 -4
  146. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  147. package/lib/cjs/serialization/GeometrySamples.d.ts +8 -6
  148. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  149. package/lib/cjs/serialization/GeometrySamples.js +26 -19
  150. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  151. package/lib/cjs/serialization/IModelJsonSchema.js +1 -2
  152. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  153. package/lib/cjs/solid/Sphere.d.ts +5 -5
  154. package/lib/cjs/solid/Sphere.js +5 -5
  155. package/lib/cjs/solid/Sphere.js.map +1 -1
  156. package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
  157. package/lib/cjs/solid/SweepContour.js +8 -1
  158. package/lib/cjs/solid/SweepContour.js.map +1 -1
  159. package/lib/cjs/topology/Graph.d.ts +113 -7
  160. package/lib/cjs/topology/Graph.d.ts.map +1 -1
  161. package/lib/cjs/topology/Graph.js +185 -7
  162. package/lib/cjs/topology/Graph.js.map +1 -1
  163. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +38 -0
  164. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts.map +1 -0
  165. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js +82 -0
  166. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -0
  167. package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts +2 -1
  168. package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
  169. package/lib/cjs/topology/HalfEdgeGraphSearch.js +1 -0
  170. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  171. package/lib/cjs/topology/Triangulation.js +1 -1
  172. package/lib/cjs/topology/Triangulation.js.map +1 -1
  173. package/lib/esm/Geometry.d.ts +56 -16
  174. package/lib/esm/Geometry.d.ts.map +1 -1
  175. package/lib/esm/Geometry.js +86 -29
  176. package/lib/esm/Geometry.js.map +1 -1
  177. package/lib/esm/bspline/BSplineCurveOps.js +4 -5
  178. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  179. package/lib/esm/bspline/InterpolationCurve3d.js +7 -10
  180. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  181. package/lib/esm/clipping/ClipPrimitive.js +2 -2
  182. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  183. package/lib/esm/clipping/ClipUtils.js +4 -4
  184. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  185. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js +2 -2
  186. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  187. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  188. package/lib/esm/curve/CurveChainWithDistanceIndex.js +21 -14
  189. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  190. package/lib/esm/curve/CurveCollection.js +1 -1
  191. package/lib/esm/curve/CurveCollection.js.map +1 -1
  192. package/lib/esm/curve/CurveCurve.d.ts +11 -8
  193. package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
  194. package/lib/esm/curve/CurveCurve.js +16 -12
  195. package/lib/esm/curve/CurveCurve.js.map +1 -1
  196. package/lib/esm/curve/CurveCurveIntersectXY.d.ts +5 -1
  197. package/lib/esm/curve/CurveCurveIntersectXY.d.ts.map +1 -1
  198. package/lib/esm/curve/CurveCurveIntersectXY.js +11 -10
  199. package/lib/esm/curve/CurveCurveIntersectXY.js.map +1 -1
  200. package/lib/esm/curve/Loop.d.ts +2 -2
  201. package/lib/esm/curve/Loop.d.ts.map +1 -1
  202. package/lib/esm/curve/Loop.js +6 -0
  203. package/lib/esm/curve/Loop.js.map +1 -1
  204. package/lib/esm/curve/RegionOps.d.ts +10 -10
  205. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  206. package/lib/esm/curve/RegionOps.js +11 -11
  207. package/lib/esm/curve/RegionOps.js.map +1 -1
  208. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +2 -1
  209. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  210. package/lib/esm/curve/RegionOpsClassificationSweeps.js +5 -2
  211. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  212. package/lib/esm/curve/StrokeOptions.js +1 -2
  213. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  214. package/lib/esm/curve/spiral/DirectSpiral3d.js +1 -2
  215. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  216. package/lib/esm/curve/spiral/IntegratedSpiral3d.js +1 -2
  217. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  218. package/lib/esm/geometry3d/Angle.d.ts +19 -0
  219. package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
  220. package/lib/esm/geometry3d/Angle.js +39 -0
  221. package/lib/esm/geometry3d/Angle.js.map +1 -1
  222. package/lib/esm/geometry3d/AngleSweep.d.ts +1 -0
  223. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  224. package/lib/esm/geometry3d/AngleSweep.js +1 -0
  225. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  226. package/lib/esm/geometry3d/BarycentricTriangle.d.ts +195 -8
  227. package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  228. package/lib/esm/geometry3d/BarycentricTriangle.js +459 -12
  229. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  230. package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts +1 -0
  231. package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
  232. package/lib/esm/geometry3d/CoincidentGeometryOps.js +3 -0
  233. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  234. package/lib/esm/geometry3d/GrowableFloat64Array.js +2 -2
  235. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  236. package/lib/esm/geometry3d/GrowableXYArray.d.ts +1 -1
  237. package/lib/esm/geometry3d/GrowableXYArray.d.ts.map +1 -1
  238. package/lib/esm/geometry3d/GrowableXYArray.js +2 -2
  239. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  240. package/lib/esm/geometry3d/GrowableXYZArray.js +1 -1
  241. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  242. package/lib/esm/geometry3d/IndexedXYCollection.d.ts +22 -7
  243. package/lib/esm/geometry3d/IndexedXYCollection.d.ts.map +1 -1
  244. package/lib/esm/geometry3d/IndexedXYCollection.js +41 -5
  245. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  246. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +58 -4
  247. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  248. package/lib/esm/geometry3d/IndexedXYZCollection.js +103 -5
  249. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  250. package/lib/esm/geometry3d/Matrix3d.d.ts +479 -265
  251. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  252. package/lib/esm/geometry3d/Matrix3d.js +996 -784
  253. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  254. package/lib/esm/geometry3d/OrderedRotationAngles.d.ts +1 -0
  255. package/lib/esm/geometry3d/OrderedRotationAngles.d.ts.map +1 -1
  256. package/lib/esm/geometry3d/OrderedRotationAngles.js +1 -0
  257. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  258. package/lib/esm/geometry3d/Point2dArrayCarrier.d.ts +10 -0
  259. package/lib/esm/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
  260. package/lib/esm/geometry3d/Point2dArrayCarrier.js +14 -0
  261. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  262. package/lib/esm/geometry3d/Point2dVector2d.js +4 -6
  263. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  264. package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts +0 -6
  265. package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
  266. package/lib/esm/geometry3d/Point3dArrayCarrier.js +0 -6
  267. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  268. package/lib/esm/geometry3d/Point3dVector3d.d.ts +57 -57
  269. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  270. package/lib/esm/geometry3d/Point3dVector3d.js +63 -65
  271. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  272. package/lib/esm/geometry3d/PointHelpers.d.ts +14 -1
  273. package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
  274. package/lib/esm/geometry3d/PointHelpers.js +33 -1
  275. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  276. package/lib/esm/geometry3d/PolygonOps.d.ts +127 -19
  277. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  278. package/lib/esm/geometry3d/PolygonOps.js +419 -22
  279. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  280. package/lib/esm/geometry3d/Ray3d.js +1 -1
  281. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  282. package/lib/esm/geometry3d/Segment1d.d.ts +1 -1
  283. package/lib/esm/geometry3d/Segment1d.js +1 -1
  284. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  285. package/lib/esm/numerics/Polynomials.d.ts +12 -0
  286. package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
  287. package/lib/esm/numerics/Polynomials.js +14 -0
  288. package/lib/esm/numerics/Polynomials.js.map +1 -1
  289. package/lib/esm/polyface/AuxData.js +1 -1
  290. package/lib/esm/polyface/AuxData.js.map +1 -1
  291. package/lib/esm/polyface/FacetLocationDetail.d.ts +264 -0
  292. package/lib/esm/polyface/FacetLocationDetail.d.ts.map +1 -0
  293. package/lib/esm/polyface/FacetLocationDetail.js +369 -0
  294. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -0
  295. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +2 -5
  296. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  297. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +5 -2
  298. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  299. package/lib/esm/polyface/PolyfaceBuilder.d.ts +24 -14
  300. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  301. package/lib/esm/polyface/PolyfaceBuilder.js +74 -23
  302. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  303. package/lib/esm/polyface/PolyfaceClip.js +6 -7
  304. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  305. package/lib/esm/polyface/PolyfaceData.d.ts +1 -1
  306. package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
  307. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  308. package/lib/esm/polyface/PolyfaceQuery.d.ts +76 -1
  309. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  310. package/lib/esm/polyface/PolyfaceQuery.js +121 -2
  311. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  312. package/lib/esm/polyface/multiclip/OffsetMeshContext.d.ts +202 -0
  313. package/lib/esm/polyface/multiclip/OffsetMeshContext.d.ts.map +1 -0
  314. package/lib/esm/polyface/multiclip/OffsetMeshContext.js +1032 -0
  315. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -0
  316. package/lib/esm/serialization/BGFBReader.js +4 -4
  317. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  318. package/lib/esm/serialization/GeometrySamples.d.ts +8 -6
  319. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  320. package/lib/esm/serialization/GeometrySamples.js +26 -19
  321. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  322. package/lib/esm/serialization/IModelJsonSchema.js +1 -2
  323. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  324. package/lib/esm/solid/Sphere.d.ts +5 -5
  325. package/lib/esm/solid/Sphere.js +5 -5
  326. package/lib/esm/solid/Sphere.js.map +1 -1
  327. package/lib/esm/solid/SweepContour.d.ts.map +1 -1
  328. package/lib/esm/solid/SweepContour.js +8 -1
  329. package/lib/esm/solid/SweepContour.js.map +1 -1
  330. package/lib/esm/topology/Graph.d.ts +113 -7
  331. package/lib/esm/topology/Graph.d.ts.map +1 -1
  332. package/lib/esm/topology/Graph.js +185 -7
  333. package/lib/esm/topology/Graph.js.map +1 -1
  334. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +38 -0
  335. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts.map +1 -0
  336. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js +78 -0
  337. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -0
  338. package/lib/esm/topology/HalfEdgeGraphSearch.d.ts +2 -1
  339. package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
  340. package/lib/esm/topology/HalfEdgeGraphSearch.js +1 -0
  341. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  342. package/lib/esm/topology/Triangulation.js +1 -1
  343. package/lib/esm/topology/Triangulation.js.map +1 -1
  344. package/package.json +5 -5
@@ -204,7 +204,7 @@ class PolyfaceAuxData {
204
204
  break;
205
205
  }
206
206
  case AuxChannelDataType.Normal: {
207
- inverseRot = inverseRot !== null && inverseRot !== void 0 ? inverseRot : rot.inverse();
207
+ inverseRot = inverseRot ?? rot.inverse();
208
208
  if (!inverseRot)
209
209
  return false;
210
210
  transformPoints(data.values, (point) => inverseRot.multiplyTransposeVectorInPlace(point));
@@ -1 +1 @@
1
- {"version":3,"file":"AuxData.js","sourceRoot":"","sources":["../../../src/polyface/AuxData.ts"],"names":[],"mapp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AG,IAAI,yBAAO,EAAE,CAAC;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;QACzC,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;KACzB;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 /** Construct a new [[AuxChannelData]] from input value and vertex values. */\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 /** Create a [[AuxChannel]] */\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 [[entriesPerValue]] is `1`. */\r\n public get isScalar(): boolean {\r\n return this.dataType === AuxChannelDataType.Distance || this.dataType === AuxChannelDataType.Scalar;\r\n }\r\n\r\n /** The number of values in `data.values` per entry - 1 for scalar and distance types, 3 for normal and vector types. */\r\n public get entriesPerValue(): number {\r\n return this.isScalar ? 1 : 3;\r\n }\r\n\r\n /** The number of entries in `data.values`. */\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/** 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: the vertex position, normal\r\n * and possibly texture parameter. `PolyfaceAuxData` provides supplemental data that is generally computed\r\n * in an analysis program or other external data source. This can be scalar data used to either override the vertex colors through, or\r\n * XYZ data used to deform the mesh by adjusting the vertex positions and/or normals.\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 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;;;AAU/F,mEAAwD;AACxD,6DAAyD;AACzD,yCAAyC;AACzC,+CAAuD;AAEvD;;;GAGG;AACH,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,GAAlB,0BAAkB,KAAlB,0BAAkB,QAiB7B;AAED;;EAEE;AACF,MAAa,cAAc;IAMzB,6EAA6E;IAC7E,YAAY,KAAa,EAAE,MAA+B;QACxD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,MAAM,YAAY,YAAY,EAAE;YAClC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;YACjB,KAAK,MAAM,CAAC,IAAI,MAAM;gBAAE,IAAI,CAAC,M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ACD,KAAK,kBAAkB,CAAC,MAAM,CAAC,CAAC;wBAC9B,UAAU,GAAG,UAAU,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;wBACzC,IAAI,CAAC,UAAU;4BACX,OAAO,KAAK,CAAC;wBAEjB,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,UAAW,CAAC,8BAA8B,CAAC,KAAK,CAAC,CAAC,CAAC;wBAC3F,MAAM;qBACP;oBACD,KAAK,kBAAkB,CAAC,MAAM,CAAC,CAAC;wBAC9B,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC;wBAC1E,MAAM;qBACP;iBACF;aACF;SACF;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA/FD,0CA+FC;AAED,SAAS,eAAe,CAAC,MAAgB,EAAE,SAAmC;IAC5E,MAAM,KAAK,GAAG,IAAI,yBAAO,EAAE,CAAC;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;QACzC,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;KACzB;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 /** Construct a new [[AuxChannelData]] from input value and vertex values. */\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 /** Create a [[AuxChannel]] */\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 [[entriesPerValue]] is `1`. */\r\n public get isScalar(): boolean {\r\n return this.dataType === AuxChannelDataType.Distance || this.dataType === AuxChannelDataType.Scalar;\r\n }\r\n\r\n /** The number of values in `data.values` per entry - 1 for scalar and distance types, 3 for normal and vector types. */\r\n public get entriesPerValue(): number {\r\n return this.isScalar ? 1 : 3;\r\n }\r\n\r\n /** The number of entries in `data.values`. */\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/** 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: the vertex position, normal\r\n * and possibly texture parameter. `PolyfaceAuxData` provides supplemental data that is generally computed\r\n * in an analysis program or other external data source. This can be scalar data used to either override the vertex colors through, or\r\n * XYZ data used to deform the mesh by adjusting the vertex positions and/or normals.\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 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"]}
@@ -0,0 +1,264 @@
1
+ /** @packageDocumentation
2
+ * @module Polyface
3
+ */
4
+ import { Point2d } from "../geometry3d/Point2dVector2d";
5
+ import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d";
6
+ import { TriangleLocationDetail } from "../geometry3d/BarycentricTriangle";
7
+ import { PolygonLocation } from "../Geometry";
8
+ import { PolyfaceVisitor } from "./Polyface";
9
+ import { PolygonLocationDetail } from "../geometry3d/PolygonOps";
10
+ import { IndexedXYZCollection } from "../geometry3d/IndexedXYZCollection";
11
+ import { IndexedXYCollection } from "../geometry3d/IndexedXYCollection";
12
+ /** Callback for processing the detail for an intersected facet.
13
+ * @param detail reference to the intersection data, with `detail.IsInsideOn === true`. Note that `detail` is owned by the caller; to persist, use `detail.clone`.
14
+ * @param visitor at currently intersected facet
15
+ * @returns true to accept this intersection and stop processing; false to continue to the next facet
16
+ */
17
+ export declare type FacetIntersectCallback = (detail: FacetLocationDetail, visitor: PolyfaceVisitor) => boolean;
18
+ /** Options for computing and processing facet intersection methods.
19
+ * @see PolyfaceQuery.intersectRay3d
20
+ */
21
+ export declare class FacetIntersectOptions {
22
+ /** distance tolerance for testing coincidence with facet boundary */
23
+ distanceTolerance: number;
24
+ /** fractional tolerance for snapping barycentric coordinates to a triangular facet edge */
25
+ parameterTolerance: number;
26
+ /** whether to compute the normal at the intersection point */
27
+ needNormal?: boolean;
28
+ /** whether to compute the uv parameter at the intersection point */
29
+ needParam?: boolean;
30
+ /** whether to compute the color at the intersection point */
31
+ needColor?: boolean;
32
+ /** whether to compute the barycentric coordinates of the point for a convex facet */
33
+ needBarycentricCoordinates?: boolean;
34
+ /** optional callback to accept an intersected facet */
35
+ acceptIntersection?: FacetIntersectCallback;
36
+ /** constructor with defaults */
37
+ constructor();
38
+ }
39
+ /**
40
+ * Carries data about a point in the plane of a facet of a mesh.
41
+ * @see PolyfaceQuery.intersectRay3d
42
+ * @public
43
+ */
44
+ export interface FacetLocationDetail {
45
+ /** Get the index of the referenced facet. */
46
+ get facetIndex(): number;
47
+ /** Get the number of edges of this facet. */
48
+ get edgeCount(): number;
49
+ /** Get the world coordinates of the point. */
50
+ get point(): Point3d;
51
+ /** Get the application-specific number. */
52
+ get a(): number;
53
+ /** Get the projection of the point onto the closest facet edge. */
54
+ get closestEdge(): {
55
+ startVertexIndex: number;
56
+ edgeParam: number;
57
+ };
58
+ /** Whether this instance specifies a valid location. */
59
+ get isValid(): boolean;
60
+ /** Whether the facet is convex. */
61
+ get isConvex(): boolean;
62
+ /** Whether the point is inside or on the facet. */
63
+ get isInsideOrOn(): boolean;
64
+ /** Get the code that classifies the location of the point with respect to the facet. */
65
+ get classify(): PolygonLocation;
66
+ /** Clone the instance */
67
+ clone(): FacetLocationDetail;
68
+ /** Set the instance contents from the other detail */
69
+ copyContentsFrom(other: FacetLocationDetail): void;
70
+ /** Get reference to cached normal interpolated from facet data. Inputs may be used to compute the cache. */
71
+ getNormal(facetNormals?: IndexedXYZCollection, facetVertices?: IndexedXYZCollection, distanceTolerance?: number): Vector3d | undefined;
72
+ /** Get reference to cached uv parameter interpolated from facet data. Inputs may be used to compute the cache. */
73
+ getParam(facetParams?: IndexedXYCollection, facetVertices?: IndexedXYZCollection, distanceTolerance?: number): Point2d | undefined;
74
+ /** Get cached color interpolated from facet data. Inputs may be used to compute the cache. */
75
+ getColor(facetColors?: number[], facetVertices?: IndexedXYZCollection, distanceTolerance?: number): number | undefined;
76
+ /** Get reference to cached barycentric coordinates of the point. Inputs may be used to compute the cache. */
77
+ getBarycentricCoordinates(facetVertices?: IndexedXYZCollection, distanceTolerance?: number): number[] | undefined;
78
+ }
79
+ /**
80
+ * Implementation of `FacetLocationDetail` for a triangular facet.
81
+ * @public
82
+ */
83
+ export declare class TriangularFacetLocationDetail implements FacetLocationDetail {
84
+ private _facetIndex;
85
+ private _detail;
86
+ private _normal?;
87
+ private _param?;
88
+ private _color?;
89
+ /** captures the detail if provided */
90
+ private constructor();
91
+ /** Invalidate this detail. */
92
+ invalidate(deep?: boolean): void;
93
+ /** Create a detail.
94
+ * @param result optional pre-allocated object to fill and return
95
+ */
96
+ static create(facetIndex: number, detail?: TriangleLocationDetail, result?: TriangularFacetLocationDetail): TriangularFacetLocationDetail;
97
+ /** Get the facet index. */
98
+ get facetIndex(): number;
99
+ /** Get the edge count of this facet. */
100
+ get edgeCount(): number;
101
+ /** Get the world coordinates of the point. */
102
+ get point(): Point3d;
103
+ /** Get the application-specific number. */
104
+ get a(): number;
105
+ /** Get the projection of the point onto the closest facet edge. */
106
+ get closestEdge(): {
107
+ startVertexIndex: number;
108
+ edgeParam: number;
109
+ };
110
+ /** Test validity of fields other than _detail. */
111
+ private get _isValid();
112
+ /** Whether this instance specifies a valid location. */
113
+ get isValid(): boolean;
114
+ /** Whether the facet is convex. */
115
+ get isConvex(): boolean;
116
+ /** Whether the point is inside or on the polygon. */
117
+ get isInsideOrOn(): boolean;
118
+ /** Get the code that classifies the location of the point with respect to the facet. */
119
+ get classify(): PolygonLocation;
120
+ /** Clone the instance */
121
+ clone(): TriangularFacetLocationDetail;
122
+ /** Set the instance contents from the other detail.
123
+ * @param other detail to clone
124
+ */
125
+ copyContentsFrom(other: TriangularFacetLocationDetail): void;
126
+ /** Get normal interpolated from facet data.
127
+ * @param facetNormals used to compute the normal cache
128
+ * @returns reference to cached normal
129
+ */
130
+ getNormal(facetNormals?: IndexedXYZCollection): Vector3d | undefined;
131
+ /** Get uv parameter interpolated from facet data.
132
+ * @param facetParams used to compute the uv parameter cache
133
+ * @returns reference to cached uv parameter
134
+ */
135
+ getParam(facetParams?: IndexedXYCollection): Point2d | undefined;
136
+ /** Get color interpolated from facet data.
137
+ * * Assumes barycentric coordinates are already computed in the TriangleLocationDetail member.
138
+ * @param facetColors used to compute the color cache
139
+ * @returns cached color
140
+ */
141
+ getColor(facetColors?: number[]): number | undefined;
142
+ /** Get the barycentric coordinates of this location.
143
+ * @returns cached barycentric coordinates
144
+ */
145
+ getBarycentricCoordinates(): number[];
146
+ }
147
+ /**
148
+ * Implementation of `FacetLocationDetail` for a non-convex facet.
149
+ * * Facet vertex data interpolation is not available.
150
+ * @public
151
+ */
152
+ export declare class NonConvexFacetLocationDetail implements FacetLocationDetail {
153
+ private _facetIndex;
154
+ private _edgeCount;
155
+ protected _detail: PolygonLocationDetail;
156
+ /** captures the detail if provided */
157
+ protected constructor(facetIndex?: number, edgeCount?: number, detail?: PolygonLocationDetail);
158
+ /** Invalidate this detail. */
159
+ invalidate(deep?: boolean): void;
160
+ /** Create a detail.
161
+ * @param result optional pre-allocated object to fill and return
162
+ */
163
+ static create(facetIndex: number, edgeCount: number, detail?: PolygonLocationDetail, result?: NonConvexFacetLocationDetail): NonConvexFacetLocationDetail;
164
+ /** Get the facet index. */
165
+ get facetIndex(): number;
166
+ /** Get the edge count of this facet. */
167
+ get edgeCount(): number;
168
+ /** Get the world coordinates of the point. */
169
+ get point(): Point3d;
170
+ /** Get the application-specific number. */
171
+ get a(): number;
172
+ /** Get the projection of the point onto the closest facet edge. */
173
+ get closestEdge(): {
174
+ startVertexIndex: number;
175
+ edgeParam: number;
176
+ };
177
+ /** Test validity of fields other than _detail. */
178
+ private get _isValid();
179
+ /** Whether this instance specifies a valid location. */
180
+ get isValid(): boolean;
181
+ /** Whether the facet is convex. */
182
+ get isConvex(): boolean;
183
+ /** Whether the point is inside or on the polygon. */
184
+ get isInsideOrOn(): boolean;
185
+ /** Get the code that classifies the location of the point with respect to the facet. */
186
+ get classify(): PolygonLocation;
187
+ /** Clone the instance */
188
+ clone(): NonConvexFacetLocationDetail;
189
+ /** Set the instance contents from the other detail.
190
+ * @param other detail to clone
191
+ */
192
+ copyContentsFrom(other: NonConvexFacetLocationDetail): void;
193
+ /** Interpolated data is not defined for a non-convex facet.
194
+ * @returns undefined
195
+ */
196
+ getNormal(): Vector3d | undefined;
197
+ /** Interpolated data is not defined for a non-convex facet.
198
+ * @returns undefined
199
+ */
200
+ getParam(): Point2d | undefined;
201
+ /** Interpolated data is not defined for a non-convex facet.
202
+ * @returns undefined
203
+ */
204
+ getColor(): number | undefined;
205
+ /** Barycentric coordinates are not defined for a non-convex facet.
206
+ * @returns undefined
207
+ */
208
+ getBarycentricCoordinates(): number[] | undefined;
209
+ }
210
+ /**
211
+ * Implementation of `FacetLocationDetail` for a convex facet.
212
+ * * If `edgeCount` is 3, `TriangularFacetLocationDetail` is more efficient.
213
+ * @public
214
+ */
215
+ export declare class ConvexFacetLocationDetail extends NonConvexFacetLocationDetail {
216
+ private _normal?;
217
+ private _param?;
218
+ private _color?;
219
+ private _barycentricCoordinates?;
220
+ /** captures the detail if provided */
221
+ private constructor();
222
+ /** Invalidate this detail. */
223
+ invalidate(deep?: boolean): void;
224
+ /** Create a detail.
225
+ * @param result optional pre-allocated object to fill and return
226
+ */
227
+ static create(facetIndex: number, edgeCount: number, detail?: PolygonLocationDetail, result?: ConvexFacetLocationDetail): ConvexFacetLocationDetail;
228
+ /** Whether the facet is convex. */
229
+ get isConvex(): boolean;
230
+ /** Clone the instance */
231
+ clone(): ConvexFacetLocationDetail;
232
+ /** Set the instance contents from the other detail.
233
+ * @param other detail to clone
234
+ */
235
+ copyContentsFrom(other: ConvexFacetLocationDetail): void;
236
+ /** Get normal interpolated from facet data.
237
+ * @param facetNormals used to compute the normal cache
238
+ * @param facetVertices used to compute the barycentric coordinate cache
239
+ * @param distanceTolerance used to compute the barycentric coordinate cache
240
+ * @returns reference to cached normal
241
+ */
242
+ getNormal(facetNormals?: IndexedXYZCollection, facetVertices?: IndexedXYZCollection, distanceTolerance?: number): Vector3d | undefined;
243
+ /** Get uv parameter interpolated from facet data.
244
+ * @param facetParams used to compute the uv parameter cache
245
+ * @param facetVertices used to compute the barycentric coordinate cache
246
+ * @param distanceTolerance used to compute the barycentric coordinate cache
247
+ * @returns reference to cached uv parameter
248
+ */
249
+ getParam(facetParams?: IndexedXYCollection, facetVertices?: IndexedXYZCollection, distanceTolerance?: number): Point2d | undefined;
250
+ /** Get color interpolated from facet data.
251
+ * @param facetColors used to compute the color cache
252
+ * @param facetVertices used to compute the barycentric coordinate cache
253
+ * @param distanceTolerance used to compute the barycentric coordinate cache
254
+ * @returns cached color
255
+ */
256
+ getColor(facetColors?: number[], facetVertices?: IndexedXYZCollection, distanceTolerance?: number): number | undefined;
257
+ /** Get the barycentric coordinates of this location, if they have been computed.
258
+ * @param facetVertices used to compute the barycentric coordinate cache
259
+ * @param distanceTolerance used to compute the barycentric coordinate cache
260
+ * @returns cached barycentric coordinates
261
+ */
262
+ getBarycentricCoordinates(facetVertices?: IndexedXYZCollection, distanceTolerance?: number): number[] | undefined;
263
+ }
264
+ //# sourceMappingURL=FacetLocationDetail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FacetLocationDetail.d.ts","sourceRoot":"","sources":["../../../src/polyface/FacetLocationDetail.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAY,eAAe,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAc,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAGxE;;;;GAIG;AACH,oBAAY,sBAAsB,GAAG,CAAC,MAAM,EAAE,mBAAmB,EAAE,OAAO,EAAE,eAAe,KAAK,OAAO,CAAC;AAExG;;GAEG;AACH,qBAAa,qBAAqB;IAChC,qEAAqE;IAC9D,iBAAiB,EAAE,MAAM,CAAC;IACjC,2FAA2F;IACpF,kBAAkB,EAAE,MAAM,CAAC;IAClC,8DAA8D;IACvD,UAAU,CAAC,EAAE,OAAO,CAAC;IAC5B,oEAAoE;IAC7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