@itwin/core-geometry 4.9.0-dev.8 → 4.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (336) hide show
  1. package/CHANGELOG.md +41 -1
  2. package/lib/cjs/Geometry.d.ts +57 -46
  3. package/lib/cjs/Geometry.d.ts.map +1 -1
  4. package/lib/cjs/Geometry.js +73 -53
  5. package/lib/cjs/Geometry.js.map +1 -1
  6. package/lib/cjs/curve/Arc3d.d.ts +141 -38
  7. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  8. package/lib/cjs/curve/Arc3d.js +219 -31
  9. package/lib/cjs/curve/Arc3d.js.map +1 -1
  10. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +11 -6
  11. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  12. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +12 -10
  13. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  14. package/lib/cjs/curve/CurveCollection.d.ts +2 -1
  15. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  16. package/lib/cjs/curve/CurveCollection.js +2 -1
  17. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  18. package/lib/cjs/curve/CurveCurve.d.ts +11 -9
  19. package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
  20. package/lib/cjs/curve/CurveCurve.js +11 -9
  21. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  22. package/lib/cjs/curve/CurveFactory.d.ts +4 -3
  23. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  24. package/lib/cjs/curve/CurveFactory.js +4 -3
  25. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  26. package/lib/cjs/curve/CurveLocationDetail.d.ts +19 -1
  27. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  28. package/lib/cjs/curve/CurveLocationDetail.js +39 -0
  29. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  30. package/lib/cjs/curve/CurveOps.d.ts +4 -4
  31. package/lib/cjs/curve/CurveOps.d.ts.map +1 -1
  32. package/lib/cjs/curve/CurveOps.js +6 -6
  33. package/lib/cjs/curve/CurveOps.js.map +1 -1
  34. package/lib/cjs/curve/CurvePrimitive.d.ts +1 -1
  35. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  36. package/lib/cjs/curve/LineString3d.d.ts +7 -5
  37. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  38. package/lib/cjs/curve/LineString3d.js +8 -6
  39. package/lib/cjs/curve/LineString3d.js.map +1 -1
  40. package/lib/cjs/curve/Loop.d.ts.map +1 -1
  41. package/lib/cjs/curve/Loop.js +6 -6
  42. package/lib/cjs/curve/Loop.js.map +1 -1
  43. package/lib/cjs/curve/OffsetOptions.d.ts +1 -1
  44. package/lib/cjs/curve/OffsetOptions.js +1 -1
  45. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  46. package/lib/cjs/curve/Path.d.ts.map +1 -1
  47. package/lib/cjs/curve/Path.js +5 -6
  48. package/lib/cjs/curve/Path.js.map +1 -1
  49. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
  50. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +3 -4
  51. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  52. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  53. package/lib/cjs/curve/RegionOps.d.ts +4 -3
  54. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  55. package/lib/cjs/curve/RegionOps.js +4 -3
  56. package/lib/cjs/curve/RegionOps.js.map +1 -1
  57. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +23 -7
  58. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  59. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +43 -35
  60. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  61. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +22 -8
  62. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  63. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +127 -52
  64. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  65. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts +211 -0
  66. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -0
  67. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +1000 -0
  68. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -0
  69. package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +11 -8
  70. package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
  71. package/lib/cjs/curve/internalContexts/MultiChainCollector.js +7 -4
  72. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  73. package/lib/cjs/geometry3d/Angle.d.ts +18 -5
  74. package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
  75. package/lib/cjs/geometry3d/Angle.js +23 -7
  76. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  77. package/lib/cjs/geometry3d/AngleSweep.d.ts +14 -1
  78. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  79. package/lib/cjs/geometry3d/AngleSweep.js +47 -12
  80. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  81. package/lib/cjs/geometry3d/FrameBuilder.d.ts +2 -1
  82. package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
  83. package/lib/cjs/geometry3d/FrameBuilder.js +12 -10
  84. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  85. package/lib/cjs/geometry3d/GeometryHandler.d.ts.map +1 -1
  86. package/lib/cjs/geometry3d/GeometryHandler.js +1 -7
  87. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  88. package/lib/cjs/geometry3d/Matrix3d.d.ts +6 -4
  89. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  90. package/lib/cjs/geometry3d/Matrix3d.js +6 -4
  91. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  92. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +5 -5
  93. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  94. package/lib/cjs/geometry3d/Point3dVector3d.js +5 -5
  95. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  96. package/lib/cjs/geometry3d/PointHelpers.d.ts +6 -5
  97. package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
  98. package/lib/cjs/geometry3d/PointHelpers.js +11 -10
  99. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  100. package/lib/cjs/geometry3d/PolygonOps.d.ts +4 -4
  101. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  102. package/lib/cjs/geometry3d/PolygonOps.js +7 -11
  103. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  104. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts +1 -1
  105. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
  106. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +3 -3
  107. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  108. package/lib/cjs/geometry3d/Range.d.ts +6 -1
  109. package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
  110. package/lib/cjs/geometry3d/Range.js +9 -3
  111. package/lib/cjs/geometry3d/Range.js.map +1 -1
  112. package/lib/cjs/geometry3d/Ray3d.d.ts +1 -1
  113. package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
  114. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  115. package/lib/cjs/geometry3d/Transform.d.ts +1 -1
  116. package/lib/cjs/geometry3d/Transform.js +1 -1
  117. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  118. package/lib/cjs/numerics/Newton.d.ts +3 -3
  119. package/lib/cjs/numerics/Newton.d.ts.map +1 -1
  120. package/lib/cjs/numerics/Newton.js +14 -16
  121. package/lib/cjs/numerics/Newton.js.map +1 -1
  122. package/lib/cjs/numerics/Polynomials.d.ts +2 -2
  123. package/lib/cjs/numerics/Polynomials.js +2 -2
  124. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  125. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +7 -4
  126. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  127. package/lib/cjs/polyface/PolyfaceBuilder.js +11 -6
  128. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  129. package/lib/cjs/polyface/PolyfaceClip.d.ts +13 -10
  130. package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
  131. package/lib/cjs/polyface/PolyfaceClip.js +17 -14
  132. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  133. package/lib/cjs/polyface/PolyfaceQuery.d.ts +11 -14
  134. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  135. package/lib/cjs/polyface/PolyfaceQuery.js +59 -52
  136. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  137. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  138. package/lib/cjs/serialization/BGFBWriter.js +2 -2
  139. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  140. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  141. package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
  142. package/lib/cjs/solid/SweepContour.js +0 -4
  143. package/lib/cjs/solid/SweepContour.js.map +1 -1
  144. package/lib/cjs/topology/Graph.d.ts +1 -1
  145. package/lib/cjs/topology/Graph.js +2 -2
  146. package/lib/cjs/topology/Graph.js.map +1 -1
  147. package/lib/cjs/topology/HalfEdgeNodeXYZUV.d.ts +1 -1
  148. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js +1 -1
  149. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  150. package/lib/cjs/topology/HalfEdgePointInGraphSearch.d.ts +57 -15
  151. package/lib/cjs/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
  152. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js +168 -127
  153. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  154. package/lib/cjs/topology/HalfEdgePositionDetail.d.ts +35 -35
  155. package/lib/cjs/topology/HalfEdgePositionDetail.d.ts.map +1 -1
  156. package/lib/cjs/topology/HalfEdgePositionDetail.js +63 -41
  157. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  158. package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts +64 -12
  159. package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
  160. package/lib/cjs/topology/InsertAndRetriangulateContext.js +174 -75
  161. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  162. package/lib/cjs/topology/Merging.d.ts +2 -2
  163. package/lib/cjs/topology/Merging.js +2 -2
  164. package/lib/cjs/topology/Merging.js.map +1 -1
  165. package/lib/cjs/topology/Triangulation.d.ts +16 -10
  166. package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
  167. package/lib/cjs/topology/Triangulation.js +23 -30
  168. package/lib/cjs/topology/Triangulation.js.map +1 -1
  169. package/lib/esm/Geometry.d.ts +57 -46
  170. package/lib/esm/Geometry.d.ts.map +1 -1
  171. package/lib/esm/Geometry.js +73 -53
  172. package/lib/esm/Geometry.js.map +1 -1
  173. package/lib/esm/curve/Arc3d.d.ts +141 -38
  174. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  175. package/lib/esm/curve/Arc3d.js +217 -30
  176. package/lib/esm/curve/Arc3d.js.map +1 -1
  177. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +11 -6
  178. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  179. package/lib/esm/curve/CurveChainWithDistanceIndex.js +12 -10
  180. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  181. package/lib/esm/curve/CurveCollection.d.ts +2 -1
  182. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  183. package/lib/esm/curve/CurveCollection.js +2 -1
  184. package/lib/esm/curve/CurveCollection.js.map +1 -1
  185. package/lib/esm/curve/CurveCurve.d.ts +11 -9
  186. package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
  187. package/lib/esm/curve/CurveCurve.js +11 -9
  188. package/lib/esm/curve/CurveCurve.js.map +1 -1
  189. package/lib/esm/curve/CurveFactory.d.ts +4 -3
  190. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  191. package/lib/esm/curve/CurveFactory.js +4 -3
  192. package/lib/esm/curve/CurveFactory.js.map +1 -1
  193. package/lib/esm/curve/CurveLocationDetail.d.ts +19 -1
  194. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  195. package/lib/esm/curve/CurveLocationDetail.js +39 -0
  196. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  197. package/lib/esm/curve/CurveOps.d.ts +4 -4
  198. package/lib/esm/curve/CurveOps.d.ts.map +1 -1
  199. package/lib/esm/curve/CurveOps.js +6 -6
  200. package/lib/esm/curve/CurveOps.js.map +1 -1
  201. package/lib/esm/curve/CurvePrimitive.d.ts +1 -1
  202. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  203. package/lib/esm/curve/LineString3d.d.ts +7 -5
  204. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  205. package/lib/esm/curve/LineString3d.js +8 -6
  206. package/lib/esm/curve/LineString3d.js.map +1 -1
  207. package/lib/esm/curve/Loop.d.ts.map +1 -1
  208. package/lib/esm/curve/Loop.js +6 -6
  209. package/lib/esm/curve/Loop.js.map +1 -1
  210. package/lib/esm/curve/OffsetOptions.d.ts +1 -1
  211. package/lib/esm/curve/OffsetOptions.js +1 -1
  212. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  213. package/lib/esm/curve/Path.d.ts.map +1 -1
  214. package/lib/esm/curve/Path.js +5 -6
  215. package/lib/esm/curve/Path.js.map +1 -1
  216. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
  217. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +3 -4
  218. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  219. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  220. package/lib/esm/curve/RegionOps.d.ts +4 -3
  221. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  222. package/lib/esm/curve/RegionOps.js +4 -3
  223. package/lib/esm/curve/RegionOps.js.map +1 -1
  224. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +23 -7
  225. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  226. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +43 -35
  227. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  228. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +22 -8
  229. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  230. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +127 -52
  231. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  232. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts +211 -0
  233. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -0
  234. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +995 -0
  235. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -0
  236. package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +11 -8
  237. package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
  238. package/lib/esm/curve/internalContexts/MultiChainCollector.js +7 -4
  239. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  240. package/lib/esm/geometry3d/Angle.d.ts +18 -5
  241. package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
  242. package/lib/esm/geometry3d/Angle.js +23 -7
  243. package/lib/esm/geometry3d/Angle.js.map +1 -1
  244. package/lib/esm/geometry3d/AngleSweep.d.ts +14 -1
  245. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  246. package/lib/esm/geometry3d/AngleSweep.js +47 -12
  247. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  248. package/lib/esm/geometry3d/FrameBuilder.d.ts +2 -1
  249. package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
  250. package/lib/esm/geometry3d/FrameBuilder.js +12 -10
  251. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  252. package/lib/esm/geometry3d/GeometryHandler.d.ts.map +1 -1
  253. package/lib/esm/geometry3d/GeometryHandler.js +1 -7
  254. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  255. package/lib/esm/geometry3d/Matrix3d.d.ts +6 -4
  256. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  257. package/lib/esm/geometry3d/Matrix3d.js +6 -4
  258. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  259. package/lib/esm/geometry3d/Point3dVector3d.d.ts +5 -5
  260. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  261. package/lib/esm/geometry3d/Point3dVector3d.js +5 -5
  262. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  263. package/lib/esm/geometry3d/PointHelpers.d.ts +6 -5
  264. package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
  265. package/lib/esm/geometry3d/PointHelpers.js +11 -10
  266. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  267. package/lib/esm/geometry3d/PolygonOps.d.ts +4 -4
  268. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  269. package/lib/esm/geometry3d/PolygonOps.js +7 -11
  270. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  271. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts +1 -1
  272. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
  273. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +3 -3
  274. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  275. package/lib/esm/geometry3d/Range.d.ts +6 -1
  276. package/lib/esm/geometry3d/Range.d.ts.map +1 -1
  277. package/lib/esm/geometry3d/Range.js +9 -3
  278. package/lib/esm/geometry3d/Range.js.map +1 -1
  279. package/lib/esm/geometry3d/Ray3d.d.ts +1 -1
  280. package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
  281. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  282. package/lib/esm/geometry3d/Transform.d.ts +1 -1
  283. package/lib/esm/geometry3d/Transform.js +1 -1
  284. package/lib/esm/geometry3d/Transform.js.map +1 -1
  285. package/lib/esm/numerics/Newton.d.ts +3 -3
  286. package/lib/esm/numerics/Newton.d.ts.map +1 -1
  287. package/lib/esm/numerics/Newton.js +14 -16
  288. package/lib/esm/numerics/Newton.js.map +1 -1
  289. package/lib/esm/numerics/Polynomials.d.ts +2 -2
  290. package/lib/esm/numerics/Polynomials.js +2 -2
  291. package/lib/esm/numerics/Polynomials.js.map +1 -1
  292. package/lib/esm/polyface/PolyfaceBuilder.d.ts +7 -4
  293. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  294. package/lib/esm/polyface/PolyfaceBuilder.js +11 -6
  295. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  296. package/lib/esm/polyface/PolyfaceClip.d.ts +13 -10
  297. package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
  298. package/lib/esm/polyface/PolyfaceClip.js +17 -14
  299. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  300. package/lib/esm/polyface/PolyfaceQuery.d.ts +11 -14
  301. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  302. package/lib/esm/polyface/PolyfaceQuery.js +59 -52
  303. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  304. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  305. package/lib/esm/serialization/BGFBWriter.js +2 -2
  306. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  307. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  308. package/lib/esm/solid/SweepContour.d.ts.map +1 -1
  309. package/lib/esm/solid/SweepContour.js +0 -4
  310. package/lib/esm/solid/SweepContour.js.map +1 -1
  311. package/lib/esm/topology/Graph.d.ts +1 -1
  312. package/lib/esm/topology/Graph.js +2 -2
  313. package/lib/esm/topology/Graph.js.map +1 -1
  314. package/lib/esm/topology/HalfEdgeNodeXYZUV.d.ts +1 -1
  315. package/lib/esm/topology/HalfEdgeNodeXYZUV.js +1 -1
  316. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  317. package/lib/esm/topology/HalfEdgePointInGraphSearch.d.ts +57 -15
  318. package/lib/esm/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
  319. package/lib/esm/topology/HalfEdgePointInGraphSearch.js +168 -127
  320. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  321. package/lib/esm/topology/HalfEdgePositionDetail.d.ts +35 -35
  322. package/lib/esm/topology/HalfEdgePositionDetail.d.ts.map +1 -1
  323. package/lib/esm/topology/HalfEdgePositionDetail.js +63 -41
  324. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  325. package/lib/esm/topology/InsertAndRetriangulateContext.d.ts +64 -12
  326. package/lib/esm/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
  327. package/lib/esm/topology/InsertAndRetriangulateContext.js +173 -74
  328. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  329. package/lib/esm/topology/Merging.d.ts +2 -2
  330. package/lib/esm/topology/Merging.js +2 -2
  331. package/lib/esm/topology/Merging.js.map +1 -1
  332. package/lib/esm/topology/Triangulation.d.ts +16 -10
  333. package/lib/esm/topology/Triangulation.d.ts.map +1 -1
  334. package/lib/esm/topology/Triangulation.js +24 -31
  335. package/lib/esm/topology/Triangulation.js.map +1 -1
  336. package/package.json +3 -3
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
+ import { Constant } from "../Constant";
5
6
  import { AxisOrder, Geometry } from "../Geometry";
6
7
  import { Angle } from "../geometry3d/Angle";
7
8
  import { AngleSweep } from "../geometry3d/AngleSweep";
@@ -15,24 +16,133 @@ import { CurveExtendMode, CurveExtendOptions } from "./CurveExtendMode";
15
16
  import { CurveIntervalRole, CurveLocationDetail, CurveSearchStatus } from "./CurveLocationDetail";
16
17
  import { CurvePrimitive } from "./CurvePrimitive";
17
18
  import { CurveOffsetXYHandler } from "./internalContexts/CurveOffsetXYHandler";
19
+ import { EllipticalArcApproximationContext } from "./internalContexts/EllipticalArcApproximationContext";
18
20
  import { PlaneAltitudeRangeContext } from "./internalContexts/PlaneAltitudeRangeContext";
21
+ import { LineSegment3d } from "./LineSegment3d";
19
22
  import { LineString3d } from "./LineString3d";
20
23
  import { OffsetOptions } from "./OffsetOptions";
24
+ import { Path } from "./Path";
21
25
  import { StrokeOptions } from "./StrokeOptions";
26
+ /**
27
+ * Enumeration of methods used to sample an elliptical arc in [[Arc3d.constructCircularArcChainApproximation]].
28
+ * * Because ellipses have two axes of symmetry, samples are computed for one quadrant and reflected across each
29
+ * axis to the other quadrants. Any samples that fall outside the arc sweep are filtered out.
30
+ * @public
31
+ */
32
+ export var EllipticalArcSampleMethod;
33
+ (function (EllipticalArcSampleMethod) {
34
+ /** Generate n samples uniformly interpolated between the min and max parameters of a full ellipse quadrant. */
35
+ EllipticalArcSampleMethod[EllipticalArcSampleMethod["UniformParameter"] = 0] = "UniformParameter";
36
+ /** Generate n samples uniformly interpolated between the min and max curvatures of a full ellipse quadrant. */
37
+ EllipticalArcSampleMethod[EllipticalArcSampleMethod["UniformCurvature"] = 1] = "UniformCurvature";
38
+ /**
39
+ * Generate n samples interpolated between the min and max curvatures of a full ellipse quadrant, using a
40
+ * [[FractionMapper]] callback to generate the interpolation weights.
41
+ */
42
+ EllipticalArcSampleMethod[EllipticalArcSampleMethod["NonUniformCurvature"] = 2] = "NonUniformCurvature";
43
+ /**
44
+ * Generate samples by subdividing parameter space until the approximation has less than a given max
45
+ * distance to the elliptical arc.
46
+ */
47
+ EllipticalArcSampleMethod[EllipticalArcSampleMethod["AdaptiveSubdivision"] = 3] = "AdaptiveSubdivision";
48
+ })(EllipticalArcSampleMethod || (EllipticalArcSampleMethod = {}));
49
+ /**
50
+ * Options for generating samples for the construction of an approximation to an elliptical arc.
51
+ * * Used by [[Arc3d.constructCircularArcChainApproximation]].
52
+ * @public
53
+ */
54
+ export class EllipticalArcApproximationOptions {
55
+ constructor(method, numSamplesInQuadrant, maxError, remapFunction, forcePath) {
56
+ this._sampleMethod = method;
57
+ this._numSamplesInQuadrant = numSamplesInQuadrant;
58
+ this._maxError = maxError;
59
+ this._remapFunction = remapFunction;
60
+ this._forcePath = forcePath;
61
+ }
62
+ /**
63
+ * Construct options with optional defaults.
64
+ * @param method sample method, default [[EllipticalArcSampleMethod.AdaptiveSubdivision]].
65
+ * @param numSamplesInQuadrant samples in each full quadrant for interpolation methods, default 4.
66
+ * @param maxError positive maximum distance to ellipse for the subdivision method, default 1cm.
67
+ * @param remapFunction optional callback to remap fraction space for [[EllipticalArcSampleMethod.NonUniformCurvature]],
68
+ * default quadratic. For best results, this function should be a bijection.
69
+ * @param forcePath whether to return a [[Path]] instead of a [[Loop]] when approximating a full elliptical arc,
70
+ * default false.
71
+ */
72
+ static create(method = EllipticalArcSampleMethod.AdaptiveSubdivision, numSamplesInQuadrant = 4, maxError = this.defaultMaxError, remapFunction = (x) => x * x, forcePath = false) {
73
+ if (numSamplesInQuadrant < 2)
74
+ numSamplesInQuadrant = 2;
75
+ if (maxError <= 0)
76
+ maxError = this.defaultMaxError;
77
+ return new EllipticalArcApproximationOptions(method, numSamplesInQuadrant, maxError, remapFunction, forcePath);
78
+ }
79
+ /** Clone the options. */
80
+ clone() {
81
+ return new EllipticalArcApproximationOptions(this.sampleMethod, this.numSamplesInQuadrant, this.maxError, this.remapFunction, this.forcePath);
82
+ }
83
+ /** Method used to sample the elliptical arc. */
84
+ get sampleMethod() {
85
+ return this._sampleMethod;
86
+ }
87
+ set sampleMethod(method) {
88
+ this._sampleMethod = method;
89
+ }
90
+ /**
91
+ * Number of samples to return in each full quadrant, including endpoint(s).
92
+ * * Used by interpolation sample methods.
93
+ * * In general, for n samples, the approximating [[Path]] consists of n-1 primitives,
94
+ * and the approximating [[Loop]] consists of n primitives.
95
+ * * Minimum value is 2.
96
+ */
97
+ get numSamplesInQuadrant() {
98
+ return this._numSamplesInQuadrant;
99
+ }
100
+ set numSamplesInQuadrant(numSamples) {
101
+ this._numSamplesInQuadrant = numSamples;
102
+ }
103
+ /**
104
+ * Maximum distance (in meters) of the computed approximation to the elliptical arc.
105
+ * * Used by [[EllipticalArcSampleMethod.AdaptiveSubdivision]].
106
+ */
107
+ get maxError() {
108
+ return this._maxError;
109
+ }
110
+ set maxError(error) {
111
+ this._maxError = error;
112
+ }
113
+ /**
114
+ * Callback function to remap fraction space to fraction space.
115
+ * * Used by [[EllipticalArcSampleMethod.NonUniformCurvature]].
116
+ */
117
+ get remapFunction() {
118
+ return this._remapFunction;
119
+ }
120
+ set remapFunction(f) {
121
+ this._remapFunction = f;
122
+ }
123
+ /** Whether to return a [[Path]] instead of a [[Loop]] when approximating a full (closed) ellipse. */
124
+ get forcePath() {
125
+ return this._forcePath;
126
+ }
127
+ set forcePath(value) {
128
+ this._forcePath = value;
129
+ }
130
+ }
131
+ /** Default error tolerance. */
132
+ EllipticalArcApproximationOptions.defaultMaxError = Constant.oneCentimeter;
22
133
  /**
23
134
  * Circular or elliptic arc.
24
135
  * * The angle to point equation is:
25
- * * `X = center + cos(theta) * vector0 + sin(theta) * vector90`
136
+ * * `X = center + cos(theta) * vector0 + sin(theta) * vector90`
26
137
  * * When the two vectors are perpendicular and have equal length, it is a true circle.
27
138
  * * Non-perpendicular vectors are always elliptic.
28
139
  * * Vectors of unequal length are always elliptic.
29
140
  * * To create an ellipse in the common "major and minor axis" form of an ellipse:
30
- * ** vector0 is the vector from the center to the major axis extreme.
31
- * ** vector90 is the vector from the center to the minor axis extreme.
32
- * ** note that constructing the vectors to the extreme points makes them perpendicular.
33
- * * The method toScaledMatrix3d() can be called to convert the unrestricted vector0,vector90 to perpendicular form.
34
- * * The unrestricted form is much easier to work with for common calculations -- stroking, projection to 2d,
35
- * intersection with plane.
141
+ * * vector0 is the vector from the center to the major axis extreme.
142
+ * * vector90 is the vector from the center to the minor axis extreme.
143
+ * * Note that constructing these vectors to the extreme points makes them perpendicular.
144
+ * * The method toScaledMatrix3d() can be called to convert the unrestricted vector0, vector90 to perpendicular form.
145
+ * * The unrestricted form is much easier to work with for common calculations: stroking, projection to 2d, intersection with plane.
36
146
  * @public
37
147
  */
38
148
  export class Arc3d extends CurvePrimitive {
@@ -167,7 +277,7 @@ export class Arc3d extends CurvePrimitive {
167
277
  * @param center arc center
168
278
  * @param vector0 vector to 0 degrees (commonly major axis)
169
279
  * @param vector90 vector to 90 degree point (commonly minor axis)
170
- * @param sweep sweep limits
280
+ * @param sweep sweep limits (default full sweep)
171
281
  * @param result optional preallocated result
172
282
  */
173
283
  static create(center, vector0, vector90, sweep, result) {
@@ -176,12 +286,12 @@ export class Arc3d extends CurvePrimitive {
176
286
  return Arc3d.createRefs(center !== undefined ? center.clone() : Point3d.create(0, 0, 0), matrix, sweep ? sweep.clone() : AngleSweep.create360(), result);
177
287
  }
178
288
  /**
179
- * Create an arc from three points on the ellipse: two points on an axis and one in between.
289
+ * Create an elliptical arc from three points on the ellipse: two points on an axis and one in between.
180
290
  * @param point0 start of arc, on an axis
181
291
  * @param point1 point on arc somewhere between `point0` and `point2`
182
292
  * @param point2 point on arc directly opposite `point0`
183
293
  * @param sweep angular sweep, measured from `point0` in the direction of `point1`.
184
- * For a semicircle from `point0` to `point2` passing through `point1`, pass `AngleSweep.createStartEndDegrees(0,180)`.
294
+ * For a half-ellipse from `point0` to `point2` passing through `point1`, pass `AngleSweep.createStartEndDegrees(0,180)`.
185
295
  * Default value is full sweep to create the entire ellipse.
186
296
  * @param result optional preallocated result
187
297
  * @returns elliptical arc, or undefined if construction impossible.
@@ -204,6 +314,68 @@ export class Arc3d extends CurvePrimitive {
204
314
  vector90.scaleInPlace(v90Len);
205
315
  return Arc3d.create(center, vector0, vector90, sweep, result);
206
316
  }
317
+ /**
318
+ * Create a circular arc defined by start point, tangent at start point, and end point.
319
+ * If tangent is parallel to line segment from start to end, return the line segment.
320
+ */
321
+ static createCircularStartTangentEnd(start, tangentAtStart, end, result) {
322
+ // To find the circle passing through start and end with tangentAtStart at start:
323
+ // - find line 1: the perpendicular bisector of the line from start to end.
324
+ // - find line 2: the perpendicular to the tangentAtStart.
325
+ // - intersection of the two lines would be the circle center.
326
+ const vector = Vector3d.createStartEnd(start, end);
327
+ const normal = tangentAtStart.crossProduct(vector).normalize();
328
+ if (normal) {
329
+ const vectorPerp = normal.crossProduct(vector);
330
+ const tangentPerp = normal.crossProduct(tangentAtStart);
331
+ const midPoint = start.plusScaled(vector, 0.5);
332
+ const lineSeg1 = LineSegment3d.create(start, start.plusScaled(tangentPerp, 1));
333
+ const lineSeg2 = LineSegment3d.create(midPoint, midPoint.plusScaled(vectorPerp, 1));
334
+ const intersection = LineSegment3d.closestApproach(lineSeg1, true, lineSeg2, true);
335
+ if (intersection) {
336
+ const center = intersection.detailA.point;
337
+ const vector0 = Vector3d.createStartEnd(center, start);
338
+ const vector90 = normal.crossProduct(vector0);
339
+ const endVector = Vector3d.createStartEnd(center, end);
340
+ const sweep = AngleSweep.create(vector0.signedAngleTo(endVector, normal));
341
+ return Arc3d.create(center, vector0, vector90, sweep, result);
342
+ }
343
+ }
344
+ return LineSegment3d.create(start, end);
345
+ }
346
+ /**
347
+ * Create a circular arc defined by start and end points and radius.
348
+ * @param start start point of the arc
349
+ * @param end end point of the arc
350
+ * @param helper a third point near the arc in its plane, or a vector in the direction of the arc normal
351
+ * @returns the constructed arc, or undefined if desired arc cannot be constructed
352
+ */
353
+ static createCircularStartEndRadius(start, end, radius, helper) {
354
+ // Construct a line segment from start to end. It is a chord of the circle,
355
+ // so the circle center is on its perpendicular bisector.
356
+ const semiChordLen2 = 0.25 * start.distanceSquared(end);
357
+ const radius2 = radius * radius;
358
+ if (radius2 < semiChordLen2)
359
+ return undefined;
360
+ const height = Math.sqrt(radius2 - semiChordLen2); // Pythagoras gives us distance from chord to center
361
+ const normal = Vector3d.createZero(this._workVectorU);
362
+ const vecToCenter = Vector3d.createZero(this._workVectorV);
363
+ // the helper gives us the circle normal
364
+ if (helper instanceof Point3d)
365
+ start.crossProductToPoints(helper, end, normal);
366
+ else
367
+ normal.setFrom(helper);
368
+ // the normal and chord direction give us the side of the chord on which the center resides
369
+ if (!normal.normalizeInPlace() || !normal.crossProductStartEnd(start, end, vecToCenter).scaleToLength(height, vecToCenter))
370
+ return undefined;
371
+ const center = Point3d.createZero();
372
+ start.interpolate(0.5, end, center).addInPlace(vecToCenter);
373
+ const vector0 = Vector3d.createStartEnd(center, start, this._workVectorW);
374
+ const endVector = Vector3d.createStartEnd(center, end, this._workVectorV); // reuse static
375
+ const sweep = AngleSweep.create(vector0.signedAngleTo(endVector, normal));
376
+ const vector90 = normal.crossProduct(vector0, this._workVectorV); // has length radius (reuse static)
377
+ return Arc3d.createRefs(center, Matrix3d.createColumns(vector0, vector90, normal), sweep);
378
+ }
207
379
  /**
208
380
  * Return a clone of this arc, projected to given z value.
209
381
  * * If `z` is omitted, the clone is at the z of the center.
@@ -247,10 +419,10 @@ export class Arc3d extends CurvePrimitive {
247
419
  const ac2 = vectorAC.magnitudeSquared();
248
420
  const normal = vectorAB.sizedCrossProduct(vectorAC, Math.sqrt(Math.sqrt(ab2 * ac2)));
249
421
  if (normal) {
250
- const vectorToCenter = SmallSystem.linearSystem3d(normal.x, normal.y, normal.z, vectorAB.x, vectorAB.y, vectorAB.z, vectorAC.x, vectorAC.y, vectorAC.z, 0, // vectorToCenter DOT normal = 0
251
- 0.5 * ab2, // vectorToCenter DOT vectorAB = 0.5 * vectorAB DOT vectorAB (Rayleigh quotient)
422
+ const vectorToCenter = SmallSystem.linearSystem3d(normal.x, normal.y, normal.z, vectorAB.x, vectorAB.y, vectorAB.z, vectorAC.x, vectorAC.y, vectorAC.z, 0, // vectorToCenter DOT normal = 0 (ensure normal is perp to the plane of the 3 points)
423
+ 0.5 * ab2, // vectorToCenter DOT vectorAB = ab2 / 2 (ensure the projection of vectorToCenter on AB bisects AB)
252
424
  0.5 * ac2);
253
- if (vectorToCenter) {
425
+ if (vectorToCenter) { // i.e., the negative of vectorX
254
426
  const center = Point3d.create(pointA.x, pointA.y, pointA.z).plus(vectorToCenter);
255
427
  const vectorX = Vector3d.createStartEnd(center, pointA);
256
428
  const vectorY = Vector3d.createRotateVectorAroundVector(vectorX, normal, Angle.createDegrees(90));
@@ -334,7 +506,7 @@ export class Arc3d extends CurvePrimitive {
334
506
  return result;
335
507
  }
336
508
  /**
337
- * Evaluate the point and derivative with respect to the angle (in radians)
509
+ * Evaluate the point with respect to the angle (in radians)
338
510
  * @param radians angular position
339
511
  * @param result optional preallocated ray.
340
512
  */
@@ -376,14 +548,14 @@ export class Arc3d extends CurvePrimitive {
376
548
  return result;
377
549
  }
378
550
  /**
379
- * Return the start point tof the arc.
551
+ * Return the start point of the arc.
380
552
  * @param result optional preallocated result
381
553
  */
382
554
  startPoint(result) {
383
555
  return this.fractionToPoint(0.0, result);
384
556
  }
385
557
  /**
386
- * Return the end point tof the arc.
558
+ * Return the end point of the arc.
387
559
  * @param result optional preallocated result
388
560
  */
389
561
  endPoint(result) {
@@ -471,19 +643,19 @@ export class Arc3d extends CurvePrimitive {
471
643
  return CurveLocationDetail.createConditionalMoveSignedDistance(allowExtension, this, startFraction, startFraction + signedFractionMove, signedDistance, result);
472
644
  }
473
645
  /**
474
- * Return all angles (in radians) where the ellipse tangent is perpendicular to the vector to a spacePoint.
646
+ * Return all radian angles where the ellipse tangent is perpendicular to the vector to a spacePoint.
475
647
  * @param spacePoint point of origin of vectors to the ellipse
476
- * @param _extend (NOT SUPPORTED -- ALWAYS ACTS AS "true")
477
- * @param _endpoints if true, force the end radians into the result.
648
+ * @param _extend always true. Sweep is ignored: perpendiculars for the full ellipse are returned.
649
+ * @param endpoints if true, force the end radians into the result.
478
650
  */
479
- allPerpendicularAngles(spacePoint, _extend = true, _endpoints = false) {
651
+ allPerpendicularAngles(spacePoint, _extend = true, endpoints = false) {
480
652
  const radians = [];
481
653
  const vectorQ = spacePoint.vectorTo(this.center);
482
654
  const uu = this._matrix.columnXMagnitudeSquared();
483
655
  const uv = this._matrix.columnXDotColumnY();
484
656
  const vv = this._matrix.columnYMagnitudeSquared();
485
657
  TrigPolynomial.solveUnitCircleImplicitQuadricIntersection(uv, vv - uu, -uv, this._matrix.dotColumnY(vectorQ), -this._matrix.dotColumnX(vectorQ), 0.0, radians);
486
- if (_endpoints) {
658
+ if (endpoints) {
487
659
  radians.push(this.sweep.startRadians);
488
660
  radians.push(this.sweep.endRadians);
489
661
  }
@@ -679,7 +851,7 @@ export class Arc3d extends CurvePrimitive {
679
851
  result.set(plane.altitude(this._center), plane.velocityXYZ(this._matrix.coffs[0], this._matrix.coffs[3], this._matrix.coffs[6]), plane.velocityXYZ(this._matrix.coffs[1], this._matrix.coffs[4], this._matrix.coffs[7]));
680
852
  return result;
681
853
  }
682
- /** Create a new arc which is a unit circle centered at the origin. */
854
+ /** Create a new arc which is a unit circle in the xy-plane centered at the origin. */
683
855
  static createUnitCircle() {
684
856
  return Arc3d.createRefs(Point3d.create(0, 0, 0), Matrix3d.createIdentity(), AngleSweep.create360());
685
857
  }
@@ -690,7 +862,7 @@ export class Arc3d extends CurvePrimitive {
690
862
  * @param sweep sweep limits. defaults to full circle.
691
863
  */
692
864
  static createXY(center, radius, sweep = AngleSweep.create360()) {
693
- return new Arc3d(center.clone(), Matrix3d.createScale(radius, radius, 1.0), sweep);
865
+ return new Arc3d(center.clone(), Matrix3d.createScale(radius, radius, 1.0), sweep.clone());
694
866
  }
695
867
  /**
696
868
  * Create a new arc which is parallel to the xy plane, with given center and x,y radii, and optional angle sweep
@@ -700,7 +872,7 @@ export class Arc3d extends CurvePrimitive {
700
872
  * @param sweep angle sweep
701
873
  */
702
874
  static createXYEllipse(center, radiusA, radiusB, sweep = AngleSweep.create360()) {
703
- return new Arc3d(center.clone(), Matrix3d.createScale(radiusA, radiusB, 1.0), sweep);
875
+ return new Arc3d(center.clone(), Matrix3d.createScale(radiusA, radiusB, 1.0), sweep.clone());
704
876
  }
705
877
  /**
706
878
  * Replace the arc's 0 and 90 degree vectors.
@@ -717,8 +889,8 @@ export class Arc3d extends CurvePrimitive {
717
889
  const vector90A = this._matrix.multiplyXY(-angleData.s, angleData.c);
718
890
  const axes = Matrix3d.createRigidFromColumns(vector0A, vector90A, AxisOrder.XYZ);
719
891
  return {
892
+ center: this._center.clone(),
720
893
  axes: (axes ? axes : Matrix3d.createIdentity()),
721
- center: this._center,
722
894
  r0: vector0A.magnitude(),
723
895
  r90: vector90A.magnitude(),
724
896
  sweep: this.sweep.cloneMinusRadians(angleData.radians),
@@ -727,10 +899,10 @@ export class Arc3d extends CurvePrimitive {
727
899
  /** Return the arc definition with center, two vectors, and angle sweep; */
728
900
  toVectors() {
729
901
  return {
730
- center: this.center,
902
+ center: this.center.clone(),
731
903
  vector0: this._matrix.columnX(),
732
904
  vector90: this._matrix.columnY(),
733
- sweep: this.sweep,
905
+ sweep: this.sweep.clone(),
734
906
  };
735
907
  }
736
908
  /** Return the arc definition with center, two vectors, and angle sweep, optionally transformed. */
@@ -739,13 +911,13 @@ export class Arc3d extends CurvePrimitive {
739
911
  center: transform.multiplyPoint3d(this._center),
740
912
  vector0: transform.multiplyVector(this._matrix.columnX()),
741
913
  vector90: transform.multiplyVector(this._matrix.columnY()),
742
- sweep: this.sweep,
914
+ sweep: this.sweep.clone(),
743
915
  }
744
916
  : {
745
917
  center: this._center.clone(),
746
918
  vector0: this._matrix.columnX(),
747
919
  vector90: this._matrix.columnY(),
748
- sweep: this.sweep,
920
+ sweep: this.sweep.clone(),
749
921
  };
750
922
  }
751
923
  /** Return the arc definition with center, two vectors, and angle sweep, transformed to 4d points. */
@@ -754,7 +926,7 @@ export class Arc3d extends CurvePrimitive {
754
926
  center: matrix.multiplyPoint3d(this._center, 1.0),
755
927
  vector0: matrix.multiplyPoint3d(this._matrix.columnX(), 0.0),
756
928
  vector90: matrix.multiplyPoint3d(this._matrix.columnY(), 0.0),
757
- sweep: this.sweep,
929
+ sweep: this.sweep.clone(),
758
930
  };
759
931
  }
760
932
  /**
@@ -994,12 +1166,27 @@ export class Arc3d extends CurvePrimitive {
994
1166
  projectedParameterRange(ray, lowHigh) {
995
1167
  return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
996
1168
  }
1169
+ /**
1170
+ * Construct a circular arc chain approximation to the instance elliptical arc.
1171
+ * @param options bundle of options for sampling an elliptical arc (use default options if undefined)
1172
+ * @returns the approximating curve chain, the circular instance, or undefined if construction fails.
1173
+ */
1174
+ constructCircularArcChainApproximation(options) {
1175
+ if (!options)
1176
+ options = EllipticalArcApproximationOptions.create();
1177
+ const context = EllipticalArcApproximationContext.create(this);
1178
+ const result = context.constructCircularArcChainApproximation(options);
1179
+ if (!result && this.isCircular)
1180
+ return (this.sweep.isFullCircle && options.forcePath) ? Path.create(this) : this;
1181
+ return result;
1182
+ }
997
1183
  }
998
1184
  Arc3d._workPointA = Point3d.create();
999
1185
  Arc3d._workPointB = Point3d.create();
1000
1186
  Arc3d._workPointC = Point3d.create();
1001
1187
  Arc3d._workVectorU = Vector3d.create();
1002
1188
  Arc3d._workVectorV = Vector3d.create();
1189
+ Arc3d._workVectorW = Vector3d.create();
1003
1190
  // !! misspelled Gauss in the published static !! Declare it ok.
1004
1191
  // cspell::word Guass
1005
1192
  /** Gauss point quadrature count for evaluating curve length. (The number of intervals is adjusted to the arc sweep) */