@itwin/core-geometry 5.5.0-dev.4 → 5.5.0-dev.6

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 (611) hide show
  1. package/lib/cjs/Geometry.d.ts +7 -0
  2. package/lib/cjs/Geometry.d.ts.map +1 -1
  3. package/lib/cjs/Geometry.js +9 -0
  4. package/lib/cjs/Geometry.js.map +1 -1
  5. package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
  6. package/lib/cjs/bspline/BSplineCurve.js +2 -1
  7. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  8. package/lib/cjs/bspline/BSplineCurveOps.d.ts.map +1 -1
  9. package/lib/cjs/bspline/BSplineCurveOps.js +4 -1
  10. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  11. package/lib/cjs/bspline/BezierCurve3d.d.ts.map +1 -1
  12. package/lib/cjs/bspline/BezierCurve3d.js +14 -4
  13. package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
  14. package/lib/cjs/bspline/BezierCurve3dH.d.ts +2 -0
  15. package/lib/cjs/bspline/BezierCurve3dH.d.ts.map +1 -1
  16. package/lib/cjs/bspline/BezierCurve3dH.js +19 -3
  17. package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
  18. package/lib/cjs/bspline/BezierCurveBase.d.ts +8 -2
  19. package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
  20. package/lib/cjs/bspline/BezierCurveBase.js +10 -4
  21. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  22. package/lib/cjs/clipping/AlternatingConvexClipTree.js +4 -4
  23. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  24. package/lib/cjs/clipping/ClipPlane.d.ts +0 -3
  25. package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
  26. package/lib/cjs/clipping/ClipPlane.js +9 -2
  27. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  28. package/lib/cjs/clipping/ClipPrimitive.d.ts +59 -9
  29. package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
  30. package/lib/cjs/clipping/ClipPrimitive.js +124 -55
  31. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  32. package/lib/cjs/clipping/ClipUtils.js +1 -1
  33. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  34. package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
  35. package/lib/cjs/clipping/ClipVector.js +12 -8
  36. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  37. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +0 -2
  38. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  39. package/lib/cjs/clipping/ConvexClipPlaneSet.js +19 -18
  40. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  41. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +1 -1
  42. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
  43. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js +4 -5
  44. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  45. package/lib/cjs/core-geometry.d.ts +0 -1
  46. package/lib/cjs/core-geometry.d.ts.map +1 -1
  47. package/lib/cjs/core-geometry.js +0 -1
  48. package/lib/cjs/core-geometry.js.map +1 -1
  49. package/lib/cjs/curve/Arc3d.js +2 -2
  50. package/lib/cjs/curve/Arc3d.js.map +1 -1
  51. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +12 -4
  52. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  53. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +52 -33
  54. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  55. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  56. package/lib/cjs/curve/CurveCollection.js +13 -6
  57. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  58. package/lib/cjs/curve/CurveCurve.js +1 -1
  59. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  60. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  61. package/lib/cjs/curve/CurveFactory.js +13 -1
  62. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  63. package/lib/cjs/curve/CurveLocationDetail.d.ts +12 -4
  64. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  65. package/lib/cjs/curve/CurveLocationDetail.js +14 -5
  66. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  67. package/lib/cjs/curve/CurvePrimitive.d.ts +5 -4
  68. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  69. package/lib/cjs/curve/CurvePrimitive.js +7 -4
  70. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  71. package/lib/cjs/curve/LineString3d.d.ts +25 -16
  72. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  73. package/lib/cjs/curve/LineString3d.js +90 -72
  74. package/lib/cjs/curve/LineString3d.js.map +1 -1
  75. package/lib/cjs/curve/Path.d.ts +0 -3
  76. package/lib/cjs/curve/Path.d.ts.map +1 -1
  77. package/lib/cjs/curve/Path.js +9 -2
  78. package/lib/cjs/curve/Path.js.map +1 -1
  79. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  80. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  81. package/lib/cjs/curve/Query/PlanarSubdivision.js +25 -31
  82. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  83. package/lib/cjs/curve/Query/StrokeCountChain.d.ts +7 -1
  84. package/lib/cjs/curve/Query/StrokeCountChain.d.ts.map +1 -1
  85. package/lib/cjs/curve/Query/StrokeCountChain.js +27 -36
  86. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  87. package/lib/cjs/curve/RegionMomentsXY.d.ts.map +1 -1
  88. package/lib/cjs/curve/RegionMomentsXY.js +7 -1
  89. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  90. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  91. package/lib/cjs/curve/RegionOps.js +8 -5
  92. package/lib/cjs/curve/RegionOps.js.map +1 -1
  93. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  94. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +6 -6
  95. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  96. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.d.ts.map +1 -1
  97. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js +4 -1
  98. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  99. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
  100. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js +6 -1
  101. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  102. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +5 -21
  103. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  104. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +29 -73
  105. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  106. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +55 -13
  107. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  108. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +238 -110
  109. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  110. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +1 -1
  111. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  112. package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts +1 -4
  113. package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
  114. package/lib/cjs/curve/spiral/DirectSpiral3d.js +9 -9
  115. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  116. package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts +11 -14
  117. package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
  118. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +18 -18
  119. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  120. package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts +7 -1
  121. package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
  122. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  123. package/lib/cjs/geometry3d/Ellipsoid.d.ts +19 -7
  124. package/lib/cjs/geometry3d/Ellipsoid.d.ts.map +1 -1
  125. package/lib/cjs/geometry3d/Ellipsoid.js +26 -11
  126. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  127. package/lib/cjs/geometry3d/FrustumAnimation.d.ts.map +1 -1
  128. package/lib/cjs/geometry3d/FrustumAnimation.js +11 -1
  129. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  130. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts +5 -1
  131. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  132. package/lib/cjs/geometry3d/GrowableFloat64Array.js +11 -1
  133. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  134. package/lib/cjs/geometry3d/GrowableXYArray.d.ts +1 -1
  135. package/lib/cjs/geometry3d/GrowableXYArray.js +1 -1
  136. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  137. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +49 -8
  138. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  139. package/lib/cjs/geometry3d/GrowableXYZArray.js +90 -37
  140. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  141. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +100 -3
  142. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  143. package/lib/cjs/geometry3d/IndexedXYZCollection.js +125 -0
  144. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  145. package/lib/cjs/geometry3d/Matrix3d.d.ts +10 -1
  146. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  147. package/lib/cjs/geometry3d/Matrix3d.js +53 -34
  148. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  149. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +1 -1
  150. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  151. package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts +49 -2
  152. package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
  153. package/lib/cjs/geometry3d/Point3dArrayCarrier.js +67 -9
  154. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  155. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +1 -1
  156. package/lib/cjs/geometry3d/Point3dVector3d.js +1 -1
  157. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  158. package/lib/cjs/geometry3d/PointStreaming.js +1 -1
  159. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  160. package/lib/cjs/geometry3d/PolygonOps.d.ts +24 -32
  161. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  162. package/lib/cjs/geometry3d/PolygonOps.js +147 -180
  163. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  164. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +5 -5
  165. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  166. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  167. package/lib/cjs/geometry3d/PolylineOps.js +13 -3
  168. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  169. package/lib/cjs/geometry3d/Range.js.map +1 -1
  170. package/lib/cjs/geometry3d/Ray3d.d.ts +0 -3
  171. package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
  172. package/lib/cjs/geometry3d/Ray3d.js +5 -1
  173. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  174. package/lib/cjs/geometry3d/SortablePolygon.d.ts +2 -2
  175. package/lib/cjs/geometry3d/SortablePolygon.d.ts.map +1 -1
  176. package/lib/cjs/geometry3d/SortablePolygon.js +14 -18
  177. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  178. package/lib/cjs/geometry3d/Transform.d.ts +8 -0
  179. package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
  180. package/lib/cjs/geometry3d/Transform.js +15 -9
  181. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  182. package/lib/cjs/numerics/ClusterableArray.d.ts +4 -2
  183. package/lib/cjs/numerics/ClusterableArray.d.ts.map +1 -1
  184. package/lib/cjs/numerics/ClusterableArray.js +6 -4
  185. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  186. package/lib/cjs/numerics/Newton.d.ts +3 -1
  187. package/lib/cjs/numerics/Newton.d.ts.map +1 -1
  188. package/lib/cjs/numerics/Newton.js +5 -1
  189. package/lib/cjs/numerics/Newton.js.map +1 -1
  190. package/lib/cjs/polyface/AuxData.d.ts +1 -4
  191. package/lib/cjs/polyface/AuxData.d.ts.map +1 -1
  192. package/lib/cjs/polyface/AuxData.js +5 -1
  193. package/lib/cjs/polyface/AuxData.js.map +1 -1
  194. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js +3 -3
  195. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  196. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  197. package/lib/cjs/polyface/Polyface.js +14 -16
  198. package/lib/cjs/polyface/Polyface.js.map +1 -1
  199. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +84 -28
  200. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  201. package/lib/cjs/polyface/PolyfaceBuilder.js +277 -217
  202. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  203. package/lib/cjs/polyface/PolyfaceClip.d.ts +4 -3
  204. package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
  205. package/lib/cjs/polyface/PolyfaceClip.js +11 -4
  206. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  207. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  208. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  209. package/lib/cjs/polyface/PolyfaceQuery.js +9 -7
  210. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  211. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.d.ts.map +1 -1
  212. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js +3 -2
  213. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  214. package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +1 -1
  215. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +2 -2
  216. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  217. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -1
  218. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js +14 -12
  219. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  220. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.d.ts +1 -1
  221. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.d.ts.map +1 -1
  222. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js +10 -6
  223. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  224. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js +4 -3
  225. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  226. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  227. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +3 -5
  228. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  229. package/lib/cjs/polyface/multiclip/XYPointBuckets.d.ts +1 -1
  230. package/lib/cjs/polyface/multiclip/XYPointBuckets.d.ts.map +1 -1
  231. package/lib/cjs/polyface/multiclip/XYPointBuckets.js +4 -8
  232. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  233. package/lib/cjs/serialization/BGFBAccessors.d.ts.map +1 -1
  234. package/lib/cjs/serialization/BGFBAccessors.js +1 -0
  235. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  236. package/lib/cjs/serialization/BGFBReader.d.ts.map +1 -1
  237. package/lib/cjs/serialization/BGFBReader.js +37 -7
  238. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  239. package/lib/cjs/serialization/BGFBWriter.d.ts +4 -4
  240. package/lib/cjs/serialization/BGFBWriter.d.ts.map +1 -1
  241. package/lib/cjs/serialization/BGFBWriter.js +24 -40
  242. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  243. package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
  244. package/lib/cjs/serialization/IModelJsonSchema.js +9 -3
  245. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  246. package/lib/cjs/serialization/SerializationHelpers.d.ts +0 -3
  247. package/lib/cjs/serialization/SerializationHelpers.d.ts.map +1 -1
  248. package/lib/cjs/serialization/SerializationHelpers.js +16 -7
  249. package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
  250. package/lib/cjs/solid/Box.d.ts +2 -2
  251. package/lib/cjs/solid/Box.d.ts.map +1 -1
  252. package/lib/cjs/solid/Box.js.map +1 -1
  253. package/lib/cjs/solid/Cone.d.ts +3 -2
  254. package/lib/cjs/solid/Cone.d.ts.map +1 -1
  255. package/lib/cjs/solid/Cone.js +4 -1
  256. package/lib/cjs/solid/Cone.js.map +1 -1
  257. package/lib/cjs/solid/LinearSweep.d.ts +1 -1
  258. package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
  259. package/lib/cjs/solid/LinearSweep.js +1 -1
  260. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  261. package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
  262. package/lib/cjs/solid/RotationalSweep.js +1 -3
  263. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  264. package/lib/cjs/solid/TorusPipe.d.ts +4 -3
  265. package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
  266. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  267. package/lib/cjs/topology/ChainMerge.d.ts +4 -4
  268. package/lib/cjs/topology/ChainMerge.d.ts.map +1 -1
  269. package/lib/cjs/topology/ChainMerge.js +11 -1
  270. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  271. package/lib/cjs/topology/Graph.d.ts +2 -0
  272. package/lib/cjs/topology/Graph.d.ts.map +1 -1
  273. package/lib/cjs/topology/Graph.js +5 -0
  274. package/lib/cjs/topology/Graph.js.map +1 -1
  275. package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
  276. package/lib/cjs/topology/HalfEdgeGraphSearch.js +2 -0
  277. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  278. package/lib/cjs/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
  279. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js +23 -16
  280. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  281. package/lib/cjs/topology/HalfEdgePositionDetail.d.ts +20 -9
  282. package/lib/cjs/topology/HalfEdgePositionDetail.d.ts.map +1 -1
  283. package/lib/cjs/topology/HalfEdgePositionDetail.js +17 -13
  284. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  285. package/lib/cjs/topology/HalfEdgePriorityQueue.d.ts.map +1 -1
  286. package/lib/cjs/topology/HalfEdgePriorityQueue.js +3 -1
  287. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  288. package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts +6 -2
  289. package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
  290. package/lib/cjs/topology/InsertAndRetriangulateContext.js +41 -35
  291. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  292. package/lib/cjs/topology/MaskManager.d.ts +7 -3
  293. package/lib/cjs/topology/MaskManager.d.ts.map +1 -1
  294. package/lib/cjs/topology/MaskManager.js +10 -4
  295. package/lib/cjs/topology/MaskManager.js.map +1 -1
  296. package/lib/cjs/topology/RegularizeFace.d.ts.map +1 -1
  297. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  298. package/lib/cjs/topology/Triangulation.d.ts +2 -1
  299. package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
  300. package/lib/cjs/topology/Triangulation.js +12 -7
  301. package/lib/cjs/topology/Triangulation.js.map +1 -1
  302. package/lib/esm/Geometry.d.ts +7 -0
  303. package/lib/esm/Geometry.d.ts.map +1 -1
  304. package/lib/esm/Geometry.js +9 -0
  305. package/lib/esm/Geometry.js.map +1 -1
  306. package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
  307. package/lib/esm/bspline/BSplineCurve.js +2 -1
  308. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  309. package/lib/esm/bspline/BSplineCurveOps.d.ts.map +1 -1
  310. package/lib/esm/bspline/BSplineCurveOps.js +4 -1
  311. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  312. package/lib/esm/bspline/BezierCurve3d.d.ts.map +1 -1
  313. package/lib/esm/bspline/BezierCurve3d.js +14 -4
  314. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  315. package/lib/esm/bspline/BezierCurve3dH.d.ts +2 -0
  316. package/lib/esm/bspline/BezierCurve3dH.d.ts.map +1 -1
  317. package/lib/esm/bspline/BezierCurve3dH.js +19 -3
  318. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  319. package/lib/esm/bspline/BezierCurveBase.d.ts +8 -2
  320. package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
  321. package/lib/esm/bspline/BezierCurveBase.js +10 -4
  322. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  323. package/lib/esm/clipping/AlternatingConvexClipTree.js +4 -4
  324. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  325. package/lib/esm/clipping/ClipPlane.d.ts +0 -3
  326. package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
  327. package/lib/esm/clipping/ClipPlane.js +9 -2
  328. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  329. package/lib/esm/clipping/ClipPrimitive.d.ts +59 -9
  330. package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
  331. package/lib/esm/clipping/ClipPrimitive.js +124 -55
  332. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  333. package/lib/esm/clipping/ClipUtils.js +1 -1
  334. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  335. package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
  336. package/lib/esm/clipping/ClipVector.js +12 -8
  337. package/lib/esm/clipping/ClipVector.js.map +1 -1
  338. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +0 -2
  339. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  340. package/lib/esm/clipping/ConvexClipPlaneSet.js +20 -19
  341. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  342. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +1 -1
  343. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
  344. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js +4 -5
  345. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  346. package/lib/esm/core-geometry.d.ts +0 -1
  347. package/lib/esm/core-geometry.d.ts.map +1 -1
  348. package/lib/esm/core-geometry.js +0 -1
  349. package/lib/esm/core-geometry.js.map +1 -1
  350. package/lib/esm/curve/Arc3d.js +2 -2
  351. package/lib/esm/curve/Arc3d.js.map +1 -1
  352. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +12 -4
  353. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  354. package/lib/esm/curve/CurveChainWithDistanceIndex.js +53 -34
  355. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  356. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  357. package/lib/esm/curve/CurveCollection.js +13 -6
  358. package/lib/esm/curve/CurveCollection.js.map +1 -1
  359. package/lib/esm/curve/CurveCurve.js +1 -1
  360. package/lib/esm/curve/CurveCurve.js.map +1 -1
  361. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  362. package/lib/esm/curve/CurveFactory.js +13 -1
  363. package/lib/esm/curve/CurveFactory.js.map +1 -1
  364. package/lib/esm/curve/CurveLocationDetail.d.ts +12 -4
  365. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  366. package/lib/esm/curve/CurveLocationDetail.js +14 -5
  367. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  368. package/lib/esm/curve/CurvePrimitive.d.ts +5 -4
  369. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  370. package/lib/esm/curve/CurvePrimitive.js +7 -4
  371. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  372. package/lib/esm/curve/LineString3d.d.ts +25 -16
  373. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  374. package/lib/esm/curve/LineString3d.js +90 -72
  375. package/lib/esm/curve/LineString3d.js.map +1 -1
  376. package/lib/esm/curve/Path.d.ts +0 -3
  377. package/lib/esm/curve/Path.d.ts.map +1 -1
  378. package/lib/esm/curve/Path.js +9 -2
  379. package/lib/esm/curve/Path.js.map +1 -1
  380. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  381. package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  382. package/lib/esm/curve/Query/PlanarSubdivision.js +25 -31
  383. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  384. package/lib/esm/curve/Query/StrokeCountChain.d.ts +7 -1
  385. package/lib/esm/curve/Query/StrokeCountChain.d.ts.map +1 -1
  386. package/lib/esm/curve/Query/StrokeCountChain.js +27 -36
  387. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  388. package/lib/esm/curve/RegionMomentsXY.d.ts.map +1 -1
  389. package/lib/esm/curve/RegionMomentsXY.js +7 -1
  390. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  391. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  392. package/lib/esm/curve/RegionOps.js +8 -5
  393. package/lib/esm/curve/RegionOps.js.map +1 -1
  394. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  395. package/lib/esm/curve/RegionOpsClassificationSweeps.js +6 -6
  396. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  397. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.d.ts.map +1 -1
  398. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js +4 -1
  399. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  400. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
  401. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js +6 -1
  402. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  403. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +5 -21
  404. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  405. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +29 -73
  406. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  407. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +55 -13
  408. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  409. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +239 -111
  410. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  411. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +1 -1
  412. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  413. package/lib/esm/curve/spiral/DirectSpiral3d.d.ts +1 -4
  414. package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
  415. package/lib/esm/curve/spiral/DirectSpiral3d.js +9 -9
  416. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  417. package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts +11 -14
  418. package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
  419. package/lib/esm/curve/spiral/IntegratedSpiral3d.js +18 -18
  420. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  421. package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts +7 -1
  422. package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
  423. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  424. package/lib/esm/geometry3d/Ellipsoid.d.ts +19 -7
  425. package/lib/esm/geometry3d/Ellipsoid.d.ts.map +1 -1
  426. package/lib/esm/geometry3d/Ellipsoid.js +26 -11
  427. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  428. package/lib/esm/geometry3d/FrustumAnimation.d.ts.map +1 -1
  429. package/lib/esm/geometry3d/FrustumAnimation.js +11 -1
  430. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  431. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts +5 -1
  432. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  433. package/lib/esm/geometry3d/GrowableFloat64Array.js +11 -1
  434. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  435. package/lib/esm/geometry3d/GrowableXYArray.d.ts +1 -1
  436. package/lib/esm/geometry3d/GrowableXYArray.js +1 -1
  437. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  438. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +49 -8
  439. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  440. package/lib/esm/geometry3d/GrowableXYZArray.js +90 -37
  441. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  442. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +100 -3
  443. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  444. package/lib/esm/geometry3d/IndexedXYZCollection.js +125 -0
  445. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  446. package/lib/esm/geometry3d/Matrix3d.d.ts +10 -1
  447. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  448. package/lib/esm/geometry3d/Matrix3d.js +53 -34
  449. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  450. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +1 -1
  451. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  452. package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts +49 -2
  453. package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
  454. package/lib/esm/geometry3d/Point3dArrayCarrier.js +67 -9
  455. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  456. package/lib/esm/geometry3d/Point3dVector3d.d.ts +1 -1
  457. package/lib/esm/geometry3d/Point3dVector3d.js +1 -1
  458. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  459. package/lib/esm/geometry3d/PointStreaming.js +1 -1
  460. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  461. package/lib/esm/geometry3d/PolygonOps.d.ts +24 -32
  462. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  463. package/lib/esm/geometry3d/PolygonOps.js +147 -180
  464. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  465. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +5 -5
  466. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  467. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  468. package/lib/esm/geometry3d/PolylineOps.js +13 -3
  469. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  470. package/lib/esm/geometry3d/Range.js.map +1 -1
  471. package/lib/esm/geometry3d/Ray3d.d.ts +0 -3
  472. package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
  473. package/lib/esm/geometry3d/Ray3d.js +5 -1
  474. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  475. package/lib/esm/geometry3d/SortablePolygon.d.ts +2 -2
  476. package/lib/esm/geometry3d/SortablePolygon.d.ts.map +1 -1
  477. package/lib/esm/geometry3d/SortablePolygon.js +14 -18
  478. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  479. package/lib/esm/geometry3d/Transform.d.ts +8 -0
  480. package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
  481. package/lib/esm/geometry3d/Transform.js +15 -9
  482. package/lib/esm/geometry3d/Transform.js.map +1 -1
  483. package/lib/esm/numerics/ClusterableArray.d.ts +4 -2
  484. package/lib/esm/numerics/ClusterableArray.d.ts.map +1 -1
  485. package/lib/esm/numerics/ClusterableArray.js +6 -4
  486. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  487. package/lib/esm/numerics/Newton.d.ts +3 -1
  488. package/lib/esm/numerics/Newton.d.ts.map +1 -1
  489. package/lib/esm/numerics/Newton.js +5 -1
  490. package/lib/esm/numerics/Newton.js.map +1 -1
  491. package/lib/esm/polyface/AuxData.d.ts +1 -4
  492. package/lib/esm/polyface/AuxData.d.ts.map +1 -1
  493. package/lib/esm/polyface/AuxData.js +5 -1
  494. package/lib/esm/polyface/AuxData.js.map +1 -1
  495. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js +3 -3
  496. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  497. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  498. package/lib/esm/polyface/Polyface.js +14 -16
  499. package/lib/esm/polyface/Polyface.js.map +1 -1
  500. package/lib/esm/polyface/PolyfaceBuilder.d.ts +84 -28
  501. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  502. package/lib/esm/polyface/PolyfaceBuilder.js +277 -217
  503. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  504. package/lib/esm/polyface/PolyfaceClip.d.ts +4 -3
  505. package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
  506. package/lib/esm/polyface/PolyfaceClip.js +11 -4
  507. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  508. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  509. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  510. package/lib/esm/polyface/PolyfaceQuery.js +9 -7
  511. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  512. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.d.ts.map +1 -1
  513. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js +3 -2
  514. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  515. package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +1 -1
  516. package/lib/esm/polyface/RangeTree/RangeTreeNode.js +2 -2
  517. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  518. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -1
  519. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js +14 -12
  520. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  521. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.d.ts +1 -1
  522. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.d.ts.map +1 -1
  523. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js +10 -6
  524. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  525. package/lib/esm/polyface/multiclip/OffsetMeshContext.js +4 -3
  526. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  527. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  528. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +3 -5
  529. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  530. package/lib/esm/polyface/multiclip/XYPointBuckets.d.ts +1 -1
  531. package/lib/esm/polyface/multiclip/XYPointBuckets.d.ts.map +1 -1
  532. package/lib/esm/polyface/multiclip/XYPointBuckets.js +4 -8
  533. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  534. package/lib/esm/serialization/BGFBAccessors.d.ts.map +1 -1
  535. package/lib/esm/serialization/BGFBAccessors.js +1 -0
  536. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  537. package/lib/esm/serialization/BGFBReader.d.ts.map +1 -1
  538. package/lib/esm/serialization/BGFBReader.js +37 -7
  539. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  540. package/lib/esm/serialization/BGFBWriter.d.ts +4 -4
  541. package/lib/esm/serialization/BGFBWriter.d.ts.map +1 -1
  542. package/lib/esm/serialization/BGFBWriter.js +24 -40
  543. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  544. package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
  545. package/lib/esm/serialization/IModelJsonSchema.js +9 -3
  546. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  547. package/lib/esm/serialization/SerializationHelpers.d.ts +0 -3
  548. package/lib/esm/serialization/SerializationHelpers.d.ts.map +1 -1
  549. package/lib/esm/serialization/SerializationHelpers.js +16 -7
  550. package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
  551. package/lib/esm/solid/Box.d.ts +2 -2
  552. package/lib/esm/solid/Box.d.ts.map +1 -1
  553. package/lib/esm/solid/Box.js.map +1 -1
  554. package/lib/esm/solid/Cone.d.ts +3 -2
  555. package/lib/esm/solid/Cone.d.ts.map +1 -1
  556. package/lib/esm/solid/Cone.js +4 -1
  557. package/lib/esm/solid/Cone.js.map +1 -1
  558. package/lib/esm/solid/LinearSweep.d.ts +1 -1
  559. package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
  560. package/lib/esm/solid/LinearSweep.js +1 -1
  561. package/lib/esm/solid/LinearSweep.js.map +1 -1
  562. package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
  563. package/lib/esm/solid/RotationalSweep.js +1 -3
  564. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  565. package/lib/esm/solid/TorusPipe.d.ts +4 -3
  566. package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
  567. package/lib/esm/solid/TorusPipe.js.map +1 -1
  568. package/lib/esm/topology/ChainMerge.d.ts +4 -4
  569. package/lib/esm/topology/ChainMerge.d.ts.map +1 -1
  570. package/lib/esm/topology/ChainMerge.js +11 -1
  571. package/lib/esm/topology/ChainMerge.js.map +1 -1
  572. package/lib/esm/topology/Graph.d.ts +2 -0
  573. package/lib/esm/topology/Graph.d.ts.map +1 -1
  574. package/lib/esm/topology/Graph.js +5 -0
  575. package/lib/esm/topology/Graph.js.map +1 -1
  576. package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
  577. package/lib/esm/topology/HalfEdgeGraphSearch.js +2 -0
  578. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  579. package/lib/esm/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
  580. package/lib/esm/topology/HalfEdgePointInGraphSearch.js +23 -16
  581. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  582. package/lib/esm/topology/HalfEdgePositionDetail.d.ts +20 -9
  583. package/lib/esm/topology/HalfEdgePositionDetail.d.ts.map +1 -1
  584. package/lib/esm/topology/HalfEdgePositionDetail.js +17 -13
  585. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  586. package/lib/esm/topology/HalfEdgePriorityQueue.d.ts.map +1 -1
  587. package/lib/esm/topology/HalfEdgePriorityQueue.js +4 -2
  588. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  589. package/lib/esm/topology/InsertAndRetriangulateContext.d.ts +6 -2
  590. package/lib/esm/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
  591. package/lib/esm/topology/InsertAndRetriangulateContext.js +41 -35
  592. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  593. package/lib/esm/topology/MaskManager.d.ts +7 -3
  594. package/lib/esm/topology/MaskManager.d.ts.map +1 -1
  595. package/lib/esm/topology/MaskManager.js +10 -4
  596. package/lib/esm/topology/MaskManager.js.map +1 -1
  597. package/lib/esm/topology/RegularizeFace.d.ts.map +1 -1
  598. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  599. package/lib/esm/topology/Triangulation.d.ts +2 -1
  600. package/lib/esm/topology/Triangulation.d.ts.map +1 -1
  601. package/lib/esm/topology/Triangulation.js +12 -7
  602. package/lib/esm/topology/Triangulation.js.map +1 -1
  603. package/package.json +3 -3
  604. package/lib/cjs/serialization/GeometrySamples.d.ts +0 -705
  605. package/lib/cjs/serialization/GeometrySamples.d.ts.map +0 -1
  606. package/lib/cjs/serialization/GeometrySamples.js +0 -2433
  607. package/lib/cjs/serialization/GeometrySamples.js.map +0 -1
  608. package/lib/esm/serialization/GeometrySamples.d.ts +0 -705
  609. package/lib/esm/serialization/GeometrySamples.d.ts.map +0 -1
  610. package/lib/esm/serialization/GeometrySamples.js +0 -2428
  611. package/lib/esm/serialization/GeometrySamples.js.map +0 -1
@@ -143,7 +143,7 @@ export class PolygonLocationDetailPair {
143
143
  export class CutLoop {
144
144
  /* All points of the loop */
145
145
  xyz;
146
- /* ray within point of "on" edge */
146
+ /* ray within edge generated by clip */
147
147
  edge;
148
148
  sortCoordinate0;
149
149
  sortCoordinate1;
@@ -162,8 +162,11 @@ export class CutLoop {
162
162
  */
163
163
  static createCaptureWithReturnEdge(xyz) {
164
164
  const result = new CutLoop(xyz);
165
- if (xyz.length >= 2)
166
- result.edge = Ray3d.createStartEnd(xyz.front(), xyz.back());
165
+ if (xyz.length >= 2) {
166
+ const firstPoint = xyz.getPoint3dAtUncheckedPointIndex(0);
167
+ const lastPoint = xyz.getPoint3dAtUncheckedPointIndex(xyz.length - 1);
168
+ result.edge = Ray3d.createStartEnd(firstPoint, lastPoint);
169
+ }
167
170
  return result;
168
171
  }
169
172
  /**
@@ -173,6 +176,8 @@ export class CutLoop {
173
176
  * * Hence sorting on the coordinates puts loops in left-to-right order by the their edge vector leftmost point.
174
177
  */
175
178
  setSortCoordinates(ray) {
179
+ if (!this.edge)
180
+ return;
176
181
  this.sortDelta = this.edge.direction.dotProduct(ray.direction);
177
182
  const a = ray.dotProductToPoint(this.edge.origin);
178
183
  if (this.sortDelta >= 0) {
@@ -211,14 +216,6 @@ export class CutLoop {
211
216
  const q = loopA.sortCoordinate0 - loopB.sortCoordinate0;
212
217
  return q > 0 ? 1 : -1;
213
218
  }
214
- /** Return first point coordinates.
215
- * * For type checking, assume array is not empty.
216
- */
217
- front(result) { return this.xyz.front(result); }
218
- /** Return last point coordinates.
219
- * * For type checking, assume array is not empty.
220
- */
221
- back(result) { return this.xyz.back(result); }
222
219
  }
223
220
  /**
224
221
  * Context to hold an array of input loops and apply sort logic.
@@ -246,17 +243,19 @@ export class CutLoopMergeContext {
246
243
  resultPoint.setZero();
247
244
  let d;
248
245
  for (const loop of this.inputLoops) {
249
- loop.front(workPoint);
250
- d = workPoint.distanceSquared(point0);
251
- if (d > dMax) {
252
- dMax = d;
253
- resultPoint.setFromPoint3d(workPoint);
246
+ if (loop.xyz.front(workPoint)) {
247
+ d = workPoint.distanceSquared(point0);
248
+ if (d > dMax) {
249
+ dMax = d;
250
+ resultPoint.setFromPoint3d(workPoint);
251
+ }
254
252
  }
255
- loop.back(workPoint);
256
- d = workPoint.distanceSquared(point0);
257
- if (d > dMax) {
258
- dMax = d;
259
- resultPoint.setFromPoint3d(workPoint);
253
+ if (loop.xyz.back(workPoint)) {
254
+ d = workPoint.distanceSquared(point0);
255
+ if (d > dMax) {
256
+ dMax = d;
257
+ resultPoint.setFromPoint3d(workPoint);
258
+ }
260
259
  }
261
260
  }
262
261
  }
@@ -267,7 +266,7 @@ export class CutLoopMergeContext {
267
266
  */
268
267
  sortInputs() {
269
268
  if (this.inputLoops.length > 0 && this.inputLoops[0].xyz.length > 0) {
270
- const point0 = this.inputLoops[0].xyz.front();
269
+ const point0 = this.inputLoops[0].xyz.getPoint3dAtUncheckedPointIndex(0);
271
270
  const workPoint = Point3d.create();
272
271
  const point1 = Point3d.create();
273
272
  // point0 could be in the middle. Find the most distant point ...
@@ -534,9 +533,9 @@ export class PolygonOps {
534
533
  }
535
534
  const n = points.length;
536
535
  if (n === 3) {
537
- const normal = points.crossProductIndexIndexIndex(0, 1, 2, result?.direction);
536
+ const normal = points.crossProductUncheckedIndexIndexIndex(0, 1, 2, result?.direction);
538
537
  const a = 0.5 * normal.magnitude();
539
- const centroid = points.getPoint3dAtCheckedPointIndex(0, result?.origin);
538
+ const centroid = points.getPoint3dAtUncheckedPointIndex(0, result?.origin);
540
539
  points.accumulateScaledXYZ(1, 1.0, centroid);
541
540
  points.accumulateScaledXYZ(2, 1.0, centroid);
542
541
  centroid.scaleInPlace(1.0 / 3.0);
@@ -553,7 +552,7 @@ export class PolygonOps {
553
552
  points.accumulateCrossProductIndexIndexIndex(0, i - 1, i, areaNormal);
554
553
  }
555
554
  areaNormal.normalizeInPlace();
556
- const origin = points.getPoint3dAtCheckedPointIndex(0);
555
+ const origin = points.getPoint3dAtUncheckedPointIndex(0);
557
556
  const vector0 = Vector3d.create();
558
557
  const vector1 = Vector3d.create();
559
558
  points.vectorXYAndZIndex(origin, 1, vector0);
@@ -679,7 +678,7 @@ export class PolygonOps {
679
678
  const placement = PolygonOps._matrixA;
680
679
  const matrixAB = PolygonOps._matrixB;
681
680
  const matrixABC = PolygonOps._matrixC;
682
- const vectorOrigin = points.vectorXYAndZIndex(origin, 0, PolygonOps._vectorOrigin);
681
+ const vectorOrigin = points.vectorXYAndZUncheckedIndex(origin, 0, PolygonOps._vectorOrigin);
683
682
  const numPoints = points.length;
684
683
  let detJ = 0;
685
684
  for (let i2 = 2; i2 < numPoints; i2++) {
@@ -708,14 +707,14 @@ export class PolygonOps {
708
707
  /**
709
708
  * Compute the signed volume of the truncated prism between a facet and a plane.
710
709
  * * Useful for parallel algorithms.
711
- * @param facetPoints input 3D polygon; on return the points are projected onto the plane. Wraparound point is optional.
710
+ * @param facetPoints input 3D polygon, wraparound point optional. This array is mutated on return if `options.skipMoments === false`: each point is projected onto the plane.
712
711
  * @param plane infinite plane bounding volume between the facet and (virtual) side facets perpendicular to the plane (unmodified).
713
712
  * @param options optional flags and pre-allocated temporary storage.
714
- * @returns computed data for this facet:
715
- * * `volume6`: six times the signed volume of the truncated prism between the facet and the plane.
716
- * * `area2`: two times the signed area of the facet's projection onto the plane.
717
- * * `origin`: origin of the facet used to accumulate area moments.
718
- * * `products`: raw accumulated second moment area products of the facet's projection onto the plane.
713
+ * @returns computed data for this facet, or defaults if `facetPoints.length < 3`:
714
+ * * `volume6`: six times the signed volume of the truncated prism between the facet and the plane (default 0).
715
+ * * `area2`: two times the signed area of the facet's projection onto the plane (default 0).
716
+ * * `origin`: origin of the facet used to accumulate area moments (default `undefined`).
717
+ * * `products`: raw accumulated second moment area products of the facet's projection onto the plane (default `undefined`).
719
718
  * @see [[PolyfaceQuery.sumVolumeBetweenFacetsAndPlane]]
720
719
  */
721
720
  static volumeBetweenPolygonAndPlane(facetPoints, plane, options) {
@@ -723,20 +722,22 @@ export class PolygonOps {
723
722
  let products;
724
723
  let singleProjectedFacetAreaTimes2 = 0.0;
725
724
  let signedTruncatedPrismVolumeTimes6 = 0.0;
726
- const h0 = facetPoints.evaluateUncheckedIndexPlaneAltitude(0, plane);
727
- for (let i = 1; i + 1 < facetPoints.length; i++) {
728
- const triangleNormal = facetPoints.crossProductIndexIndexIndex(0, i, i + 1, options?.workVector);
729
- const hA = facetPoints.evaluateUncheckedIndexPlaneAltitude(i, plane);
730
- const hB = facetPoints.evaluateUncheckedIndexPlaneAltitude(i + 1, plane);
731
- const signedProjectedTriangleAreaTimes2 = triangleNormal.dotProductXYZ(plane.normalX(), plane.normalY(), plane.normalZ());
732
- singleProjectedFacetAreaTimes2 += signedProjectedTriangleAreaTimes2;
733
- signedTruncatedPrismVolumeTimes6 += signedProjectedTriangleAreaTimes2 * (h0 + hA + hB);
734
- }
735
- if (!options?.skipMoments) {
736
- origin = facetPoints.getPoint3dAtUncheckedPointIndex(0, options?.workPoint0);
737
- products = Matrix4d.createZero(options?.workMatrix);
738
- facetPoints.mapPoint((x, y, z) => plane.projectXYZToPlane(x, y, z, options?.workPoint1));
739
- PolygonOps.addSecondMomentAreaProducts(facetPoints, origin, products);
725
+ if (facetPoints.length >= 3) {
726
+ const h0 = facetPoints.evaluateUncheckedIndexPlaneAltitude(0, plane);
727
+ for (let i = 1; i + 1 < facetPoints.length; i++) {
728
+ const triangleNormal = facetPoints.crossProductUncheckedIndexIndexIndex(0, i, i + 1, options?.workVector);
729
+ const hA = facetPoints.evaluateUncheckedIndexPlaneAltitude(i, plane);
730
+ const hB = facetPoints.evaluateUncheckedIndexPlaneAltitude(i + 1, plane);
731
+ const signedProjectedTriangleAreaTimes2 = triangleNormal.dotProductXYZ(plane.normalX(), plane.normalY(), plane.normalZ());
732
+ singleProjectedFacetAreaTimes2 += signedProjectedTriangleAreaTimes2;
733
+ signedTruncatedPrismVolumeTimes6 += signedProjectedTriangleAreaTimes2 * (h0 + hA + hB);
734
+ }
735
+ if (!options?.skipMoments) {
736
+ origin = facetPoints.getPoint3dAtUncheckedPointIndex(0, options?.workPoint0);
737
+ products = Matrix4d.createZero(options?.workMatrix);
738
+ facetPoints.mapPoint((x, y, z) => plane.projectXYZToPlane(x, y, z, options?.workPoint1));
739
+ PolygonOps.addSecondMomentAreaProducts(facetPoints, origin, products);
740
+ }
740
741
  }
741
742
  return { volume6: signedTruncatedPrismVolumeTimes6, area2: singleProjectedFacetAreaTimes2, origin, products };
742
743
  }
@@ -967,7 +968,7 @@ export class PolygonOps {
967
968
  const distTol2 = distTol * distTol;
968
969
  let numPoints = polygon.length;
969
970
  while (numPoints > 1) {
970
- if (polygon.distanceSquaredIndexIndex(0, numPoints - 1) > distTol2)
971
+ if (polygon.distanceSquaredUncheckedIndexIndex(0, numPoints - 1) > distTol2)
971
972
  break;
972
973
  --numPoints; // ignore closure point
973
974
  }
@@ -995,10 +996,10 @@ export class PolygonOps {
995
996
  let iEdgeEnd = iEdgeStart + 1;
996
997
  if (iEdgeEnd === numPoints)
997
998
  iEdgeEnd = 0;
998
- uDotU = polygon.distanceSquaredIndexIndex(iEdgeStart, iEdgeEnd);
999
+ uDotU = polygon.distanceSquaredUncheckedIndexIndex(iEdgeStart, iEdgeEnd);
999
1000
  if (uDotU > distTol2) { // nontrivial edge
1000
- vDotV = polygon.distanceSquaredIndexXYAndZ(iEdgeStart, testPoint);
1001
- const uDotV = polygon.dotProductIndexIndexXYAndZ(iEdgeStart, iEdgeEnd, testPoint);
1001
+ vDotV = polygon.distanceSquaredUncheckedIndexXYAndZ(iEdgeStart, testPoint);
1002
+ const uDotV = polygon.dotProductUncheckedIndexIndexXYAndZ(iEdgeStart, iEdgeEnd, testPoint);
1002
1003
  edgeParam = uDotV / uDotU; // param of projection of testPoint onto edge [iEdgeStart, iEdgeEnd]
1003
1004
  isValid = true;
1004
1005
  }
@@ -1022,6 +1023,9 @@ export class PolygonOps {
1022
1023
  let iNext = iBase + 1;
1023
1024
  if (iNext === numPoints)
1024
1025
  iNext = 0;
1026
+ assert(() => iBase >= 0 && iBase < numPoints &&
1027
+ iPrev >= 0 && iPrev < numPoints &&
1028
+ iNext >= 0 && iNext < numPoints, "expect iBase, iPrev, iNext are valid indices");
1025
1029
  const projData = projectToEdge(iBase);
1026
1030
  if (!projData.isValid)
1027
1031
  continue; // ignore trivial polygon edge (keep iPrev, projBeyondPrevEdge)
@@ -1041,7 +1045,7 @@ export class PolygonOps {
1041
1045
  // update candidate (to edge start) only if testPoint projected beyond previous edge end
1042
1046
  polygon.getPoint3dAtUncheckedPointIndex(iBase, result.point);
1043
1047
  result.a = Math.sqrt(distToStart2);
1044
- polygon.crossProductIndexIndexIndex(iBase, iPrev, iNext, result.v);
1048
+ polygon.crossProductUncheckedIndexIndexIndex(iBase, iPrev, iNext, result.v);
1045
1049
  result.code = PolygonLocation.OnPolygonVertex;
1046
1050
  result.closestEdgeIndex = iBase;
1047
1051
  result.closestEdgeParam = 0.0;
@@ -1089,7 +1093,7 @@ export class PolygonOps {
1089
1093
  // update candidate
1090
1094
  polygon.interpolateIndexIndex(iBase, projData.edgeParam, iNext, result.point);
1091
1095
  result.a = Math.sqrt(projDist2);
1092
- polygon.crossProductIndexIndexXYAndZ(iBase, iNext, testPoint, result.v);
1096
+ polygon.crossProductUncheckedIndexIndexXYAndZ(iBase, iNext, testPoint, result.v);
1093
1097
  result.code = projData.edgeParam < 1.0 ? PolygonLocation.OnPolygonEdgeInterior : PolygonLocation.OnPolygonVertex;
1094
1098
  ;
1095
1099
  result.closestEdgeIndex = iBase;
@@ -1124,6 +1128,7 @@ export class PolygonOps {
1124
1128
  if (!this.unitNormal(polygon, this._normal))
1125
1129
  return PolygonLocationDetail.create(result); // invalid
1126
1130
  const polygonPlane = this._workPlane = Plane3dByOriginAndUnitNormal.createXYZUVW(polygon.getXAtUncheckedPointIndex(0), polygon.getYAtUncheckedPointIndex(0), polygon.getZAtUncheckedPointIndex(0), this._normal.x, this._normal.y, this._normal.z, this._workPlane);
1131
+ assert(polygonPlane !== undefined, "expect this._normal to be nonzero because unitNormal succeeded");
1127
1132
  const planePoint = this._workXYZ = polygonPlane.projectPointToPlane(testPoint, this._workXYZ);
1128
1133
  result = this.closestPointOnBoundary(polygon, planePoint, tolerance, result);
1129
1134
  if (result.isValid) {
@@ -1168,6 +1173,7 @@ export class PolygonOps {
1168
1173
  if (!this.unitNormal(polygon, this._normal))
1169
1174
  return PolygonLocationDetail.create(result); // invalid
1170
1175
  this._workPlane = Plane3dByOriginAndUnitNormal.createXYZUVW(polygon.getXAtUncheckedPointIndex(0), polygon.getYAtUncheckedPointIndex(0), polygon.getZAtUncheckedPointIndex(0), this._normal.x, this._normal.y, this._normal.z, this._workPlane);
1176
+ assert(this._workPlane !== undefined, "expect this._normal to be nonzero because unitNormal succeeded");
1171
1177
  const intersectionPoint = this._workXYZ = Point3d.createZero(this._workXYZ);
1172
1178
  const rayParam = ray.intersectionWithPlane(this._workPlane, intersectionPoint);
1173
1179
  if (undefined === rayParam)
@@ -1226,7 +1232,7 @@ export class PolygonOps {
1226
1232
  static computeEdgeDataXY(polygon, edgeStartVertexIndex, point, edgeOutwardUnitNormal, tolerance = Geometry.smallMetricDistance, result) {
1227
1233
  const i0 = edgeStartVertexIndex % polygon.length;
1228
1234
  const i1 = (i0 + 1) % polygon.length;
1229
- polygon.vectorIndexIndex(i0, i1, edgeOutwardUnitNormal).unitPerpendicularXY(edgeOutwardUnitNormal).negate(edgeOutwardUnitNormal); // z is zero
1235
+ polygon.vectorUncheckedIndexIndex(i0, i1, edgeOutwardUnitNormal).unitPerpendicularXY(edgeOutwardUnitNormal).negate(edgeOutwardUnitNormal); // z is zero
1230
1236
  const hypDeltaX = polygon.getXAtUncheckedPointIndex(i0) - point.x;
1231
1237
  const hypDeltaY = polygon.getYAtUncheckedPointIndex(i0) - point.y;
1232
1238
  let projDist = Geometry.dotProductXYXY(hypDeltaX, hypDeltaY, edgeOutwardUnitNormal.x, edgeOutwardUnitNormal.y);
@@ -1301,9 +1307,14 @@ export class PolygonOps {
1301
1307
  return undefined;
1302
1308
  const localToWorld = this._workMatrix3d = Matrix3d.createRigidHeadsUp(this._normal, AxisOrder.ZXY, this._workMatrix3d);
1303
1309
  const polygonXY = new GrowableXYZArray(n);
1304
- for (let i = 0; i < n; ++i)
1305
- polygonXY.push(localToWorld.multiplyInverseXYZAsPoint3d(polygon.getXAtUncheckedPointIndex(i), polygon.getYAtUncheckedPointIndex(i), polygon.getZAtUncheckedPointIndex(i), this._workXYZ));
1306
- const pointXY = this._workXYZ = localToWorld.multiplyInverseXYZAsPoint3d(point.x, point.y, point.z, this._workXYZ);
1310
+ for (let i = 0; i < n; ++i) {
1311
+ const pt = this._workXYZ = localToWorld.multiplyInverseXYZAsPoint3d(polygon.getXAtUncheckedPointIndex(i), polygon.getYAtUncheckedPointIndex(i), polygon.getZAtUncheckedPointIndex(i), this._workXYZ);
1312
+ assert(pt !== undefined, "expect localToWorld is nonsingular because this._normal is nonzero");
1313
+ polygonXY.push(pt);
1314
+ }
1315
+ assert(this._workXYZ !== undefined, "expect this._workXYZ is allocated because polygon is nonempty");
1316
+ const pointXY = localToWorld.multiplyInverseXYZAsPoint3d(point.x, point.y, point.z, this._workXYZ);
1317
+ assert(pointXY !== undefined, "expect localToWorld is nonsingular because this._normal is nonzero");
1307
1318
  // now we know polygon orientation is ccw, its last edge has positive length, and we can ignore z-coords
1308
1319
  let iPrev = n - 1;
1309
1320
  const outwardUnitNormalOfLastEdge = this._vector0;
@@ -1329,9 +1340,7 @@ export class PolygonOps {
1329
1340
  continue; // point is on subsequent colinear edge (ASSUMING interior point, convex polygon!); coords[i] = 0; keep previous edge data
1330
1341
  const areaOfNormalParallelogram = Math.abs(outwardUnitNormalOfPrevEdge.crossProductXY(outwardUnitNormalOfEdge));
1331
1342
  const coord = Geometry.conditionalDivideCoordinate(areaOfNormalParallelogram, projToPrevEdge.x * projToEdge.x, largestResult);
1332
- if (undefined === coord) {
1333
- assert(false, "unexpectedly small projection distance to an edge"); // shouldn't happen due to chopping in computeEdgeDataXY: area/(dist*dist) <= 1/tol^2 = largestResult
1334
- }
1343
+ assert(coord !== undefined, "unexpectedly small projection distance to an edge"); // shouldn't happen due to chopping in computeEdgeDataXY: area/(dist*dist) <= 1/tol^2 = largestResult
1335
1344
  coords[i] = coord;
1336
1345
  coordSum += coord;
1337
1346
  outwardUnitNormalOfPrevEdge.setFrom(outwardUnitNormalOfEdge);
@@ -1494,78 +1503,71 @@ export class IndexedXYZCollectionPolygonOps {
1494
1503
  }
1495
1504
  }
1496
1505
  /**
1497
- * Clip a polygon to one side of a plane.
1498
- * * Results with 2 or fewer points are ignored.
1499
- * * Other than ensuring capacity in the arrays, there are no object allocations during execution of this function.
1506
+ * Clip a polygon to one side of a plane in place.
1500
1507
  * * For a convex input polygon, the output polygon is also convex.
1501
1508
  * * For non-convex input, the output polygon may have double-back edges along plane intersections. This is still a
1502
1509
  * valid clip in a parity sense (overlapping regions cancel).
1503
- * * This method returns only the piece of the input polygon on one side of the clipper.
1504
- * See [[splitConvexPolygonInsideOutsidePlane]] for a method that returns both sides.
1505
- * @param plane any type that has `plane.altitude`
1506
- * @param xyz input polygon, clipped on output
1510
+ * * Output may also consist entirely of (colinear) polygon vertices that lie on the clip plane.
1511
+ * No attempt is made to filter such zero-area output.
1512
+ * * Other than ensuring capacity in the arrays, there are no object allocations during execution of this function.
1513
+ * @param plane altitude evaluator
1514
+ * @param xyz input polygon, clipped on output. Closure point, if present on input, is removed on output. Fewer than 3 input vertices results in empty output.
1507
1515
  * @param work optional work buffer
1508
1516
  * @param keepPositive whether the positive side of the plane survives (true, default), or negative side (false).
1509
1517
  * @param tolerance tolerance for "on plane" decision. This is a distance if `plane` has unit normal (e.g., [[ClipPlane]]).
1510
1518
  * Default value is [[Geometry.smallMetricDistance]].
1511
- * @return the number of crossings. If this is larger than 2, the input polygon was non-convex.
1512
- * @see splitConvexPolygonInsideOutsidePlane
1519
+ * @return the number of on-plane vertices and maximal vertex intervals. If this is larger than 2, the input polygon was non-convex.
1520
+ * @see [[splitConvexPolygonInsideOutsidePlane]] for a method that clips to both sides of the plane.
1513
1521
  */
1514
1522
  static clipConvexPolygonInPlace(plane, xyz, work, keepPositive = true, tolerance = Geometry.smallMetricDistance) {
1515
- if (!work)
1516
- work = new GrowableXYZArray();
1517
- work.clear();
1518
- const s = keepPositive ? 1.0 : -1.0;
1523
+ while (xyz.length > 1 && xyz.getPoint3dAtUncheckedPointIndex(0).isExactEqual(xyz.getPoint3dAtUncheckedPointIndex(xyz.length - 1)))
1524
+ xyz.pop(); // ignore closure point(s)
1519
1525
  const n = xyz.length;
1520
- let numNegative = 0;
1526
+ if (n < 3) { // swallow degenerate polygon
1527
+ xyz.clear();
1528
+ return 0;
1529
+ }
1530
+ const s = keepPositive ? 1.0 : -1.0;
1531
+ const computeAltitude = (i) => {
1532
+ const a = s * xyz.evaluateUncheckedIndexPlaneAltitude(i, plane);
1533
+ return (Math.abs(a) < tolerance) ? 0 : a;
1534
+ };
1521
1535
  const fractionTol = 1.0e-8;
1522
- const b = -tolerance;
1523
- let numCrossings = 0;
1524
- if (xyz.length > 1) { // > 2 ??
1525
- let a1;
1526
- let index0 = xyz.length - 1;
1527
- let a0 = s * xyz.evaluateUncheckedIndexPlaneAltitude(index0, plane);
1528
- if (Math.abs(a0) < tolerance)
1529
- a0 = 0;
1530
- // if (a0 >= 0.0)
1531
- // work.push_back (xyz0);
1532
- for (let index1 = 0; index1 < n; a0 = a1, index0 = index1++) {
1533
- a1 = s * xyz.evaluateUncheckedIndexPlaneAltitude(index1, plane);
1534
- if (Math.abs(a1) < tolerance)
1535
- a1 = 0;
1536
- if (a1 < 0)
1537
- numNegative++;
1538
- if (a0 * a1 < 0.0) {
1539
- // simple crossing . . .
1540
- const f = -a0 / (a1 - a0);
1541
- if (f > 1.0 - fractionTol && a1 >= 0.0) {
1542
- // the endpoint will be saved -- avoid the duplicate
1543
- }
1544
- else {
1545
- work.pushInterpolatedFromGrowableXYZArray(xyz, index0, f, index1);
1546
- if (a1 > 0)
1547
- numCrossings++; // "out to in"
1548
- }
1536
+ let numClippedVertices = 0;
1537
+ let numSimpleCrossings = 0; // # new surviving vertices, each at intersection of plane with polygon edge interior
1538
+ let numTangentRuns = 0; // # on-plane vertices (or maximal runs of such consecutive vertices) whose entrance/exit edges lie on same side of plane
1539
+ const surviving = work ? work : new GrowableXYZArray();
1540
+ surviving.clear();
1541
+ let a1, a0 = computeAltitude(n - 1);
1542
+ for (let index0 = n - 1, index1 = 0; index1 < n; a0 = a1, index0 = index1++) {
1543
+ a1 = computeAltitude(index1);
1544
+ if (a1 < 0)
1545
+ numClippedVertices++;
1546
+ if (a0 * a1 < 0.0) { // simple crossing
1547
+ const f = -a0 / (a1 - a0);
1548
+ if (f > 1.0 - fractionTol && a1 > 0.0) {
1549
+ // don't push end vertex of this edge; it will be pushed later
1549
1550
  }
1550
- if (a1 >= b) {
1551
- work.pushFromGrowableXYZArray(xyz, index1);
1552
- if (a0 < -b) {
1553
- numCrossings++; // "in to out"
1554
- }
1551
+ else {
1552
+ const crossing = xyz.interpolateUncheckedIndexIndex(index0, f, index1, this._xyz0Work);
1553
+ surviving.pushXYZ(crossing.x, crossing.y, crossing.z);
1554
+ numSimpleCrossings++;
1555
1555
  }
1556
- index0 = index1;
1557
- a0 = a1;
1558
1556
  }
1557
+ if (a1 >= 0) {
1558
+ surviving.pushXYZ(xyz.getXAtUncheckedPointIndex(index1), xyz.getYAtUncheckedPointIndex(index1), xyz.getZAtUncheckedPointIndex(index1));
1559
+ if (a1 === 0 && a0 !== 0)
1560
+ numTangentRuns++; // on-plane vertex, or start of on-plane interval
1561
+ }
1562
+ index0 = index1;
1563
+ a0 = a1;
1559
1564
  }
1560
- if (work.length <= 2) {
1561
- xyz.clear();
1562
- }
1563
- else if (numNegative > 0) {
1565
+ if (numClippedVertices > 0) {
1564
1566
  xyz.clear();
1565
- xyz.pushFromGrowableXYZArray(work);
1567
+ xyz.pushIndexedXYZCollection(surviving);
1566
1568
  }
1567
- work.clear();
1568
- return numCrossings;
1569
+ surviving.clear();
1570
+ return numSimpleCrossings + numTangentRuns;
1569
1571
  }
1570
1572
  /** Return an array containing
1571
1573
  * * All points that are exactly on the plane.
@@ -1638,38 +1640,42 @@ export class IndexedXYZCollectionPolygonOps {
1638
1640
  return result;
1639
1641
  }
1640
1642
  /**
1641
- * * Input the loops from `gatherCutLoopsFromClipPlane`
1643
+ * * Input the loops from [[gatherCutLoopsFromPlaneClip]].
1642
1644
  * * Consolidate loops for reentrant configurations.
1643
1645
  * * WARNING: The output reuses and modifies input loops whenever possible.
1644
1646
  * @internal
1645
1647
  */
1646
1648
  static reorderCutLoops(loops) {
1647
- // Simple case: all loops have common orientation
1648
- if (loops.inputLoops.length === 1)
1649
+ if (loops.inputLoops.length <= 1)
1649
1650
  return;
1650
1651
  // Simple cases: 2 loops . . .
1651
1652
  if (loops.inputLoops.length === 2) {
1652
- // if edges are in the same direction, it must be a pair of unrelated loop . . .
1653
- if (loops.inputLoops[0].edge.direction.dotProduct(loops.inputLoops[1].edge.direction) > 0) {
1654
- loops.outputLoops.push(loops.inputLoops[0]);
1655
- loops.outputLoops.push(loops.inputLoops[1]);
1656
- return;
1653
+ const edge0 = loops.inputLoops[0].edge;
1654
+ const edge1 = loops.inputLoops[1].edge;
1655
+ if (edge0 && edge1) {
1656
+ if (edge0.direction.dotProduct(edge1.direction) > 0) {
1657
+ // if edges are in the same direction, it must be a pair of unrelated loops
1658
+ loops.outputLoops.push(loops.inputLoops[0]);
1659
+ loops.outputLoops.push(loops.inputLoops[1]);
1660
+ }
1661
+ else {
1662
+ // 2 loops on opposite sides of the plane; twist into 1
1663
+ const source = loops.inputLoops[1].xyz;
1664
+ const dest = loops.inputLoops[0].xyz;
1665
+ dest.pushFromGrowableXYZArray(source);
1666
+ loops.outputLoops.push(loops.inputLoops[0]);
1667
+ }
1657
1668
  }
1658
- // twist the two loops into 1,
1659
- const source = loops.inputLoops[1].xyz;
1660
- const dest = loops.inputLoops[0].xyz;
1661
- dest.pushFromGrowableXYZArray(source);
1662
- loops.outputLoops.push(loops.inputLoops[0]);
1663
- return;
1664
1669
  }
1665
- // 3 or more loops.
1666
- loops.sortAndMergeLoops();
1667
- //
1670
+ else {
1671
+ // 3 or more loops.
1672
+ loops.sortAndMergeLoops();
1673
+ }
1668
1674
  }
1669
1675
  /**
1670
- * Return the intersection of the plane with a range cube.
1671
- * @param range
1672
- * @param xyzOut intersection polygon. This is convex.
1676
+ * Clip a convex polygon in place by a range box.
1677
+ * @param range six clipping planes
1678
+ * @param xyz convex polygon, clipped in place
1673
1679
  * @return reference to xyz if the polygon still has points; undefined if all points are clipped away.
1674
1680
  */
1675
1681
  static intersectRangeConvexPolygonInPlace(range, xyz) {
@@ -1709,9 +1715,6 @@ export class IndexedXYZCollectionPolygonOps {
1709
1715
  * @public
1710
1716
  */
1711
1717
  export class Point3dArrayPolygonOps {
1712
- static _xyz0Work = Point3d.create();
1713
- // private static _xyz1Work: Point3d = Point3d.create();
1714
- // private static _xyz2Work: Point3d = Point3d.create();
1715
1718
  /**
1716
1719
  * Split a (convex) polygon into 2 parts.
1717
1720
  * @param xyz original polygon
@@ -1734,53 +1737,17 @@ export class Point3dArrayPolygonOps {
1734
1737
  return IndexedXYZCollectionPolygonOps.polygonPlaneCrossings(plane, xyzSource, crossings);
1735
1738
  }
1736
1739
  /**
1737
- * Clip a polygon, returning the clip result in the same object.
1740
+ * Clip a polygon to one side of a plane in place.
1741
+ * @param plane altitude evaluator
1738
1742
  * @param xyz input/output polygon
1739
- * @param work scratch object
1743
+ * @param work optional scratch object
1740
1744
  * @param tolerance tolerance for on-plane decision.
1745
+ * @see [[IndexedXYZCollectionPolygonOps.clipConvexPolygonInPlace]]
1741
1746
  */
1742
1747
  static convexPolygonClipInPlace(plane, xyz, work, tolerance = Geometry.smallMetricDistance) {
1743
- if (work === undefined)
1744
- work = [];
1745
- work.length = 0;
1746
- let numNegative = 0;
1747
- const fractionTol = 1.0e-8;
1748
- const b = -tolerance;
1749
- if (xyz.length > 2) {
1750
- let xyz0 = xyz[xyz.length - 1];
1751
- let a0 = plane.altitude(xyz0);
1752
- // if (a0 >= 0.0)
1753
- // work.push_back (xyz0);
1754
- for (const xyz1 of xyz) {
1755
- const a1 = plane.altitude(xyz1);
1756
- if (a1 < 0)
1757
- numNegative++;
1758
- if (a0 * a1 < 0.0) {
1759
- // simple crossing . . .
1760
- const f = -a0 / (a1 - a0);
1761
- if (f > 1.0 - fractionTol && a1 >= 0.0) {
1762
- // the endpoint will be saved -- avoid the duplicate
1763
- }
1764
- else {
1765
- work.push(xyz0.interpolate(f, xyz1));
1766
- }
1767
- }
1768
- if (a1 >= b)
1769
- work.push(xyz1);
1770
- xyz0 = Point3d.createFrom(xyz1);
1771
- a0 = a1;
1772
- }
1773
- }
1774
- if (work.length <= 2) {
1775
- xyz.length = 0;
1776
- }
1777
- else if (numNegative > 0) {
1778
- xyz.length = 0;
1779
- for (const xyzI of work) {
1780
- xyz.push(xyzI);
1781
- }
1782
- work.length = 0;
1783
- }
1748
+ const xyzSource = new Point3dArrayCarrier(xyz);
1749
+ const workSource = work ? new Point3dArrayCarrier(work) : undefined;
1750
+ return IndexedXYZCollectionPolygonOps.clipConvexPolygonInPlace(plane, xyzSource, workSource, true, tolerance);
1784
1751
  }
1785
1752
  }
1786
1753
  //# sourceMappingURL=PolygonOps.js.map