@itwin/core-geometry 4.3.0-dev.8 → 4.4.0-dev.1

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 +43 -1
  2. package/lib/cjs/Geometry.d.ts +14 -2
  3. package/lib/cjs/Geometry.d.ts.map +1 -1
  4. package/lib/cjs/Geometry.js +20 -9
  5. package/lib/cjs/Geometry.js.map +1 -1
  6. package/lib/cjs/bspline/BSpline1dNd.d.ts +12 -2
  7. package/lib/cjs/bspline/BSpline1dNd.d.ts.map +1 -1
  8. package/lib/cjs/bspline/BSpline1dNd.js +27 -17
  9. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  10. package/lib/cjs/bspline/BSplineCurve.d.ts +30 -16
  11. package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
  12. package/lib/cjs/bspline/BSplineCurve.js +68 -44
  13. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  14. package/lib/cjs/bspline/BSplineCurve3dH.d.ts +27 -20
  15. package/lib/cjs/bspline/BSplineCurve3dH.d.ts.map +1 -1
  16. package/lib/cjs/bspline/BSplineCurve3dH.js +136 -87
  17. package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
  18. package/lib/cjs/bspline/BSplineSurface.d.ts +138 -74
  19. package/lib/cjs/bspline/BSplineSurface.d.ts.map +1 -1
  20. package/lib/cjs/bspline/BSplineSurface.js +242 -119
  21. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  22. package/lib/cjs/bspline/Bezier1dNd.d.ts +18 -4
  23. package/lib/cjs/bspline/Bezier1dNd.d.ts.map +1 -1
  24. package/lib/cjs/bspline/Bezier1dNd.js +19 -5
  25. package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
  26. package/lib/cjs/bspline/BezierCurve3dH.d.ts.map +1 -1
  27. package/lib/cjs/bspline/BezierCurve3dH.js +2 -1
  28. package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
  29. package/lib/cjs/bspline/KnotVector.d.ts +30 -33
  30. package/lib/cjs/bspline/KnotVector.d.ts.map +1 -1
  31. package/lib/cjs/bspline/KnotVector.js +76 -69
  32. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  33. package/lib/cjs/clipping/ClipUtils.d.ts +32 -5
  34. package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
  35. package/lib/cjs/clipping/ClipUtils.js +92 -11
  36. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  37. package/lib/cjs/core-geometry.d.ts +0 -2
  38. package/lib/cjs/core-geometry.d.ts.map +1 -1
  39. package/lib/cjs/core-geometry.js +0 -2
  40. package/lib/cjs/core-geometry.js.map +1 -1
  41. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  42. package/lib/cjs/curve/Arc3d.js +5 -5
  43. package/lib/cjs/curve/Arc3d.js.map +1 -1
  44. package/lib/cjs/curve/CurveLocationDetail.d.ts +1 -4
  45. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  46. package/lib/cjs/curve/CurveLocationDetail.js +4 -10
  47. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  48. package/lib/cjs/curve/CurveOps.d.ts +4 -5
  49. package/lib/cjs/curve/CurveOps.d.ts.map +1 -1
  50. package/lib/cjs/curve/CurveOps.js +1 -1
  51. package/lib/cjs/curve/CurveOps.js.map +1 -1
  52. package/lib/cjs/curve/CurveTypes.d.ts +14 -2
  53. package/lib/cjs/curve/CurveTypes.d.ts.map +1 -1
  54. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  55. package/lib/cjs/curve/LineString3d.d.ts +3 -2
  56. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  57. package/lib/cjs/curve/LineString3d.js +1 -0
  58. package/lib/cjs/curve/LineString3d.js.map +1 -1
  59. package/lib/cjs/curve/PointString3d.d.ts +2 -1
  60. package/lib/cjs/curve/PointString3d.d.ts.map +1 -1
  61. package/lib/cjs/curve/PointString3d.js.map +1 -1
  62. package/lib/cjs/curve/RegionOps.d.ts +5 -11
  63. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  64. package/lib/cjs/curve/RegionOps.js.map +1 -1
  65. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +15 -9
  66. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  67. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +68 -56
  68. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  69. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +14 -16
  70. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  71. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +51 -69
  72. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  73. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
  74. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +3 -2
  75. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  76. package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +2 -3
  77. package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
  78. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  79. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts +4 -4
  80. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
  81. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +38 -36
  82. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  83. package/lib/cjs/geometry3d/Angle.d.ts +0 -1
  84. package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
  85. package/lib/cjs/geometry3d/Angle.js +0 -1
  86. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  87. package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts +21 -5
  88. package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
  89. package/lib/cjs/geometry3d/CoincidentGeometryOps.js +71 -45
  90. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  91. package/lib/cjs/geometry3d/Matrix3d.d.ts +20 -13
  92. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  93. package/lib/cjs/geometry3d/Matrix3d.js +28 -21
  94. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  95. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +11 -2
  96. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  97. package/lib/cjs/geometry3d/Point3dVector3d.js +16 -5
  98. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  99. package/lib/cjs/geometry3d/PointHelpers.d.ts +58 -20
  100. package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
  101. package/lib/cjs/geometry3d/PointHelpers.js +213 -62
  102. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  103. package/lib/cjs/geometry3d/Segment1d.d.ts +5 -1
  104. package/lib/cjs/geometry3d/Segment1d.d.ts.map +1 -1
  105. package/lib/cjs/geometry3d/Segment1d.js +11 -7
  106. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  107. package/lib/cjs/geometry3d/Transform.d.ts +4 -5
  108. package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
  109. package/lib/cjs/geometry3d/Transform.js +4 -5
  110. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  111. package/lib/cjs/geometry4d/Point4d.d.ts +13 -0
  112. package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
  113. package/lib/cjs/geometry4d/Point4d.js +21 -0
  114. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  115. package/lib/cjs/numerics/BezierPolynomials.d.ts +88 -64
  116. package/lib/cjs/numerics/BezierPolynomials.d.ts.map +1 -1
  117. package/lib/cjs/numerics/BezierPolynomials.js +92 -73
  118. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  119. package/lib/cjs/numerics/Newton.d.ts +143 -61
  120. package/lib/cjs/numerics/Newton.d.ts.map +1 -1
  121. package/lib/cjs/numerics/Newton.js +233 -66
  122. package/lib/cjs/numerics/Newton.js.map +1 -1
  123. package/lib/cjs/numerics/PascalCoefficients.d.ts +8 -12
  124. package/lib/cjs/numerics/PascalCoefficients.d.ts.map +1 -1
  125. package/lib/cjs/numerics/PascalCoefficients.js +10 -12
  126. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  127. package/lib/cjs/numerics/Polynomials.d.ts +6 -10
  128. package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
  129. package/lib/cjs/numerics/Polynomials.js +6 -10
  130. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  131. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +3 -0
  132. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  133. package/lib/cjs/polyface/PolyfaceBuilder.js +13 -2
  134. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  135. package/lib/cjs/polyface/PolyfaceData.d.ts +1 -1
  136. package/lib/cjs/polyface/PolyfaceData.js +1 -1
  137. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  138. package/lib/cjs/polyface/PolyfaceQuery.d.ts +38 -11
  139. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  140. package/lib/cjs/polyface/PolyfaceQuery.js +93 -16
  141. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  142. package/lib/cjs/serialization/BGFBReader.d.ts +10 -10
  143. package/lib/cjs/serialization/BGFBReader.d.ts.map +1 -1
  144. package/lib/cjs/serialization/BGFBReader.js +69 -42
  145. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  146. package/lib/cjs/serialization/BGFBWriter.d.ts +8 -8
  147. package/lib/cjs/serialization/BGFBWriter.d.ts.map +1 -1
  148. package/lib/cjs/serialization/BGFBWriter.js +80 -55
  149. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  150. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  151. package/lib/cjs/serialization/GeometrySamples.js +6 -8
  152. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  153. package/lib/cjs/serialization/IModelJsonSchema.d.ts +8 -14
  154. package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
  155. package/lib/cjs/serialization/IModelJsonSchema.js +85 -259
  156. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  157. package/lib/cjs/serialization/SerializationHelpers.d.ts +109 -0
  158. package/lib/cjs/serialization/SerializationHelpers.d.ts.map +1 -0
  159. package/lib/cjs/serialization/SerializationHelpers.js +591 -0
  160. package/lib/cjs/serialization/SerializationHelpers.js.map +1 -0
  161. package/lib/cjs/topology/Graph.d.ts +399 -366
  162. package/lib/cjs/topology/Graph.d.ts.map +1 -1
  163. package/lib/cjs/topology/Graph.js +531 -464
  164. package/lib/cjs/topology/Graph.js.map +1 -1
  165. package/lib/cjs/topology/MaskManager.d.ts +8 -9
  166. package/lib/cjs/topology/MaskManager.d.ts.map +1 -1
  167. package/lib/cjs/topology/MaskManager.js +11 -12
  168. package/lib/cjs/topology/MaskManager.js.map +1 -1
  169. package/lib/esm/Geometry.d.ts +14 -2
  170. package/lib/esm/Geometry.d.ts.map +1 -1
  171. package/lib/esm/Geometry.js +20 -9
  172. package/lib/esm/Geometry.js.map +1 -1
  173. package/lib/esm/bspline/BSpline1dNd.d.ts +12 -2
  174. package/lib/esm/bspline/BSpline1dNd.d.ts.map +1 -1
  175. package/lib/esm/bspline/BSpline1dNd.js +27 -17
  176. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  177. package/lib/esm/bspline/BSplineCurve.d.ts +30 -16
  178. package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
  179. package/lib/esm/bspline/BSplineCurve.js +68 -44
  180. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  181. package/lib/esm/bspline/BSplineCurve3dH.d.ts +27 -20
  182. package/lib/esm/bspline/BSplineCurve3dH.d.ts.map +1 -1
  183. package/lib/esm/bspline/BSplineCurve3dH.js +137 -88
  184. package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
  185. package/lib/esm/bspline/BSplineSurface.d.ts +138 -74
  186. package/lib/esm/bspline/BSplineSurface.d.ts.map +1 -1
  187. package/lib/esm/bspline/BSplineSurface.js +242 -119
  188. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  189. package/lib/esm/bspline/Bezier1dNd.d.ts +18 -4
  190. package/lib/esm/bspline/Bezier1dNd.d.ts.map +1 -1
  191. package/lib/esm/bspline/Bezier1dNd.js +19 -5
  192. package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
  193. package/lib/esm/bspline/BezierCurve3dH.d.ts.map +1 -1
  194. package/lib/esm/bspline/BezierCurve3dH.js +2 -1
  195. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  196. package/lib/esm/bspline/KnotVector.d.ts +30 -33
  197. package/lib/esm/bspline/KnotVector.d.ts.map +1 -1
  198. package/lib/esm/bspline/KnotVector.js +76 -69
  199. package/lib/esm/bspline/KnotVector.js.map +1 -1
  200. package/lib/esm/clipping/ClipUtils.d.ts +32 -5
  201. package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
  202. package/lib/esm/clipping/ClipUtils.js +92 -11
  203. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  204. package/lib/esm/core-geometry.d.ts +0 -2
  205. package/lib/esm/core-geometry.d.ts.map +1 -1
  206. package/lib/esm/core-geometry.js +0 -2
  207. package/lib/esm/core-geometry.js.map +1 -1
  208. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  209. package/lib/esm/curve/Arc3d.js +5 -5
  210. package/lib/esm/curve/Arc3d.js.map +1 -1
  211. package/lib/esm/curve/CurveLocationDetail.d.ts +1 -4
  212. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  213. package/lib/esm/curve/CurveLocationDetail.js +4 -10
  214. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  215. package/lib/esm/curve/CurveOps.d.ts +4 -5
  216. package/lib/esm/curve/CurveOps.d.ts.map +1 -1
  217. package/lib/esm/curve/CurveOps.js +1 -1
  218. package/lib/esm/curve/CurveOps.js.map +1 -1
  219. package/lib/esm/curve/CurveTypes.d.ts +14 -2
  220. package/lib/esm/curve/CurveTypes.d.ts.map +1 -1
  221. package/lib/esm/curve/CurveTypes.js.map +1 -1
  222. package/lib/esm/curve/LineString3d.d.ts +3 -2
  223. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  224. package/lib/esm/curve/LineString3d.js +1 -0
  225. package/lib/esm/curve/LineString3d.js.map +1 -1
  226. package/lib/esm/curve/PointString3d.d.ts +2 -1
  227. package/lib/esm/curve/PointString3d.d.ts.map +1 -1
  228. package/lib/esm/curve/PointString3d.js.map +1 -1
  229. package/lib/esm/curve/RegionOps.d.ts +5 -11
  230. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  231. package/lib/esm/curve/RegionOps.js.map +1 -1
  232. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +15 -9
  233. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  234. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +69 -57
  235. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  236. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +14 -16
  237. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  238. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +51 -68
  239. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  240. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
  241. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +3 -2
  242. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  243. package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +2 -3
  244. package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
  245. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  246. package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts +4 -4
  247. package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
  248. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +38 -36
  249. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  250. package/lib/esm/geometry3d/Angle.d.ts +0 -1
  251. package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
  252. package/lib/esm/geometry3d/Angle.js +0 -1
  253. package/lib/esm/geometry3d/Angle.js.map +1 -1
  254. package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts +21 -5
  255. package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
  256. package/lib/esm/geometry3d/CoincidentGeometryOps.js +71 -45
  257. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  258. package/lib/esm/geometry3d/Matrix3d.d.ts +20 -13
  259. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  260. package/lib/esm/geometry3d/Matrix3d.js +28 -21
  261. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  262. package/lib/esm/geometry3d/Point3dVector3d.d.ts +11 -2
  263. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  264. package/lib/esm/geometry3d/Point3dVector3d.js +16 -5
  265. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  266. package/lib/esm/geometry3d/PointHelpers.d.ts +58 -20
  267. package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
  268. package/lib/esm/geometry3d/PointHelpers.js +213 -62
  269. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  270. package/lib/esm/geometry3d/Segment1d.d.ts +5 -1
  271. package/lib/esm/geometry3d/Segment1d.d.ts.map +1 -1
  272. package/lib/esm/geometry3d/Segment1d.js +11 -7
  273. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  274. package/lib/esm/geometry3d/Transform.d.ts +4 -5
  275. package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
  276. package/lib/esm/geometry3d/Transform.js +4 -5
  277. package/lib/esm/geometry3d/Transform.js.map +1 -1
  278. package/lib/esm/geometry4d/Point4d.d.ts +13 -0
  279. package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
  280. package/lib/esm/geometry4d/Point4d.js +21 -0
  281. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  282. package/lib/esm/numerics/BezierPolynomials.d.ts +88 -64
  283. package/lib/esm/numerics/BezierPolynomials.d.ts.map +1 -1
  284. package/lib/esm/numerics/BezierPolynomials.js +92 -73
  285. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  286. package/lib/esm/numerics/Newton.d.ts +143 -61
  287. package/lib/esm/numerics/Newton.d.ts.map +1 -1
  288. package/lib/esm/numerics/Newton.js +229 -65
  289. package/lib/esm/numerics/Newton.js.map +1 -1
  290. package/lib/esm/numerics/PascalCoefficients.d.ts +8 -12
  291. package/lib/esm/numerics/PascalCoefficients.d.ts.map +1 -1
  292. package/lib/esm/numerics/PascalCoefficients.js +10 -12
  293. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  294. package/lib/esm/numerics/Polynomials.d.ts +6 -10
  295. package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
  296. package/lib/esm/numerics/Polynomials.js +6 -10
  297. package/lib/esm/numerics/Polynomials.js.map +1 -1
  298. package/lib/esm/polyface/PolyfaceBuilder.d.ts +3 -0
  299. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  300. package/lib/esm/polyface/PolyfaceBuilder.js +13 -2
  301. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  302. package/lib/esm/polyface/PolyfaceData.d.ts +1 -1
  303. package/lib/esm/polyface/PolyfaceData.js +1 -1
  304. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  305. package/lib/esm/polyface/PolyfaceQuery.d.ts +38 -11
  306. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  307. package/lib/esm/polyface/PolyfaceQuery.js +93 -16
  308. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  309. package/lib/esm/serialization/BGFBReader.d.ts +10 -10
  310. package/lib/esm/serialization/BGFBReader.d.ts.map +1 -1
  311. package/lib/esm/serialization/BGFBReader.js +69 -42
  312. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  313. package/lib/esm/serialization/BGFBWriter.d.ts +8 -8
  314. package/lib/esm/serialization/BGFBWriter.d.ts.map +1 -1
  315. package/lib/esm/serialization/BGFBWriter.js +80 -55
  316. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  317. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  318. package/lib/esm/serialization/GeometrySamples.js +7 -9
  319. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  320. package/lib/esm/serialization/IModelJsonSchema.d.ts +8 -14
  321. package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
  322. package/lib/esm/serialization/IModelJsonSchema.js +86 -260
  323. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  324. package/lib/esm/serialization/SerializationHelpers.d.ts +109 -0
  325. package/lib/esm/serialization/SerializationHelpers.d.ts.map +1 -0
  326. package/lib/esm/serialization/SerializationHelpers.js +588 -0
  327. package/lib/esm/serialization/SerializationHelpers.js.map +1 -0
  328. package/lib/esm/topology/Graph.d.ts +399 -366
  329. package/lib/esm/topology/Graph.d.ts.map +1 -1
  330. package/lib/esm/topology/Graph.js +531 -464
  331. package/lib/esm/topology/Graph.js.map +1 -1
  332. package/lib/esm/topology/MaskManager.d.ts +8 -9
  333. package/lib/esm/topology/MaskManager.d.ts.map +1 -1
  334. package/lib/esm/topology/MaskManager.js +11 -12
  335. package/lib/esm/topology/MaskManager.js.map +1 -1
  336. package/package.json +3 -4
@@ -11,39 +11,35 @@ exports.KnotVector = exports.BSplineWrapMode = void 0;
11
11
  const Geometry_1 = require("../Geometry");
12
12
  const PointHelpers_1 = require("../geometry3d/PointHelpers");
13
13
  /**
14
- * Enumeration of the possible ways of converting a "periodic" knot vector to an open knot vector.
15
- * None (0) ==> no wrap possible
16
- * OpenByAddingControlPoints (1) ==> wrapped by adding poles
17
- * OpenByRemovingKnots (2) ==> wrapped by deleting extreme knots.
14
+ * B-spline curve and surface types in this library are non-periodic. But they can be created from legacy periodic data.
15
+ * This enumeration lists the possible ways a B-spline object can have been created from legacy periodic data.
18
16
  * @public
19
17
  */
20
18
  var BSplineWrapMode;
21
19
  (function (BSplineWrapMode) {
22
- /** No conversion to periodic */
20
+ /** No conversion performed. */
23
21
  BSplineWrapMode[BSplineWrapMode["None"] = 0] = "None";
24
- /** Convert to periodic by removing control points. This is typical for closed bcurve constructed by control points with maximum continuity.
25
- * * Knots stay the same in open and periodic form.
26
- * * Periodic form omits {degree} control points.
22
+ /** The B-spline was opened up by adding degree wrap-around control points to the legacy periodic data.
23
+ * * This is typical of B-splines constructed with maximum (degree - 1) continuity.
24
+ * * Knots are unaffected by this conversion.
27
25
  */
28
26
  BSplineWrapMode[BSplineWrapMode["OpenByAddingControlPoints"] = 1] = "OpenByAddingControlPoints";
29
- /** Convert to periodic by adding special knots. This is typical of closed bcurve constructed as exact circular or elliptic arc
30
- * * 2 knots on each end are omitted in open form
31
- * * poles stay the same.
27
+ /** The B-spline was opened up by removing degree extreme knots from the legacy periodic data.
28
+ * * This is typical of rational B-spline curves representing full circles and ellipses.
29
+ * * Poles are unaffected by this conversion.
32
30
  */
33
31
  BSplineWrapMode[BSplineWrapMode["OpenByRemovingKnots"] = 2] = "OpenByRemovingKnots";
34
32
  })(BSplineWrapMode = exports.BSplineWrapMode || (exports.BSplineWrapMode = {}));
35
33
  /**
36
- * Array of non-decreasing numbers acting as a knot array for bsplines.
34
+ * Array of non-decreasing numbers acting as a knot array for B-splines.
37
35
  *
38
36
  * * Essential identity: numKnots = numPoles + order - 2 = numPoles + degree - 1
39
- * * Various bspline libraries have confusion over how many "end knots" are needed. "Many" libraries (including MicroStation)
40
- * incorrectly demand "order" knots at each end for clamping. But only "order - 1" are really needed.
41
- * * This class uses the "order-1" convention.
42
- * * This class provides queries to convert among spanIndex and knotIndex
37
+ * * Various B-spline libraries have confusion over how many "end knots" are needed. Many libraries (including MicroStation and Parasolid)
38
+ * demand order knots at each end for clamping. But only order-1 are really needed. This class uses the order-1 convention.
43
39
  * * A span is a single interval of the knots.
44
- * * The left knot of span {k} is knot {k+degree-1}
45
- * * This class provides queries to convert among spanFraction, fraction of knot range, and knot
46
- * * core computations (evaluateBasisFunctions) have leftKnotIndex and global knot value as inputs. Callers need to
40
+ * * The left knot of span {k} is knot {k+degree-1}.
41
+ * * This class provides queries to convert among spanIndex, knotIndex, spanFraction, fraction of knot range, and knot.
42
+ * * Core computations (evaluateBasisFunctions) have leftKnotIndex and global knot value as inputs. Callers need to
47
43
  * know their primary values (global knot, spanFraction).
48
44
  * @public
49
45
  */
@@ -56,7 +52,7 @@ class KnotVector {
56
52
  get leftKnotIndex() { return this.degree - 1; }
57
53
  /** Return the index of the rightmost knot of the active interval */
58
54
  get rightKnotIndex() { return this.knots.length - this.degree; }
59
- /** Whether the bspline was created by adding poles into "closed" structure. This is used by serialize/deserialize to mark knotVector's that were converted from periodic style. */
55
+ /** Whether this KnotVector was created by converting legacy periodic data during deserialization. The conversion used is specified by BSplineWrapMode, and is reversed at serialization time. */
60
56
  get wrappable() { return this._wrapMode === undefined ? BSplineWrapMode.None : this._wrapMode; }
61
57
  set wrappable(value) { this._wrapMode = value; }
62
58
  /** Return the number of bezier spans. Note that this includes zero-length spans if there are repeated knots. */
@@ -71,7 +67,7 @@ class KnotVector {
71
67
  constructor(knots, degree, wrapMode) {
72
68
  this.degree = degree;
73
69
  this._wrapMode = wrapMode;
74
- // default values to satisfy compiler -- real values hapn setupFixedValues or final else defers to user
70
+ // default values to satisfy compiler -- real values happen in setupFixedValues, or final else defers to user
75
71
  this._knot0 = 0.0;
76
72
  this._knot1 = 1.0;
77
73
  // satisfy the initialize checker ..
@@ -91,43 +87,43 @@ class KnotVector {
91
87
  /** copy degree and knots to a new KnotVector. */
92
88
  clone() { return new KnotVector(this.knots, this.degree, this.wrappable); }
93
89
  setupFixedValues() {
94
- // These should be read-only . ..
95
- this._knot0 = this.knots[this.degree - 1];
96
- this._knot1 = this.knots[this.knots.length - this.degree];
90
+ if (this.degree > 0 && this.knots.length > this.degree) {
91
+ this._knot0 = this.knots[this.degree - 1];
92
+ this._knot1 = this.knots[this.knots.length - this.degree];
93
+ }
97
94
  }
98
95
  /** Return the total knot distance from beginning to end. */
99
96
  get knotLength01() { return this._knot1 - this._knot0; }
100
97
  /**
101
- * Returns true if all numeric values have wraparound conditions for "closed" knotVector with specified wrap mode
102
- * @param mode optional test mode. If undefined, use the this.wrappable.
98
+ * Returns true if all numeric values have wraparound conditions that allow the knots to be closed with specified wrap mode.
99
+ * @param mode optional test mode. If undefined, use this.wrappable.
103
100
  */
104
101
  testClosable(mode) {
105
102
  if (mode === undefined)
106
103
  mode = this.wrappable;
104
+ const degree = this.degree;
107
105
  const leftKnotIndex = this.leftKnotIndex;
108
106
  const rightKnotIndex = this.rightKnotIndex;
109
- const period = this.rightKnot - this.leftKnot;
110
- const degree = this.degree;
111
- const indexDelta = rightKnotIndex - leftKnotIndex;
112
- // maximum continuity mode . . .
113
107
  if (mode === BSplineWrapMode.OpenByAddingControlPoints) {
114
- for (let k0 = leftKnotIndex - degree + 1; k0 < leftKnotIndex + degree - 1; k0++) {
108
+ // maximum continuity mode: we expect degree periodically extended knots at each end
109
+ const period = this.rightKnot - this.leftKnot;
110
+ const indexDelta = rightKnotIndex - leftKnotIndex;
111
+ for (let k0 = 0; k0 < leftKnotIndex + degree; k0++) {
115
112
  const k1 = k0 + indexDelta;
116
- if (!Geometry_1.Geometry.isSameCoordinate(this.knots[k0] + period, this.knots[k1]))
113
+ if (Math.abs(this.knots[k0] + period - this.knots[k1]) >= KnotVector.knotTolerance)
117
114
  return false;
118
115
  }
119
116
  return true;
120
117
  }
121
- // arc mode ...
122
118
  if (mode === BSplineWrapMode.OpenByRemovingKnots) {
123
- // we expect {degree} replicated knots at each end . . .
119
+ // legacy periodic mode: we expect multiplicity degree knots at each end
124
120
  const numRepeated = degree - 1;
125
- const leftKnot = this.knots[leftKnotIndex];
126
- const rightKnot = this.knots[rightKnotIndex];
121
+ const leftKnot = this.leftKnot;
122
+ const rightKnot = this.rightKnot;
127
123
  for (let i = 0; i < numRepeated; i++) {
128
- if (!Geometry_1.Geometry.isSameCoordinate(leftKnot, this.knots[leftKnotIndex - i - 1]))
124
+ if (Math.abs(leftKnot - this.knots[leftKnotIndex - i - 1]) >= KnotVector.knotTolerance)
129
125
  return false;
130
- if (!Geometry_1.Geometry.isSameCoordinate(rightKnot, this.knots[rightKnotIndex + i + 1]))
126
+ if (Math.abs(rightKnot - this.knots[rightKnotIndex + i + 1]) >= KnotVector.knotTolerance)
131
127
  return false;
132
128
  }
133
129
  return true;
@@ -209,7 +205,7 @@ class KnotVector {
209
205
  }
210
206
  this.setupFixedValues();
211
207
  }
212
- /** install knot values from an array, optionally ignoring first and last. */
208
+ /** Set knots to input array (CAPTURED) */
213
209
  setKnotsCapture(knots) {
214
210
  this.knots = knots;
215
211
  this.setupFixedValues();
@@ -303,19 +299,22 @@ class KnotVector {
303
299
  * Evaluate basis functions f[] at knot value u.
304
300
  *
305
301
  * @param u knot value for evaluation
306
- * @param f array of order basis function values
302
+ * @param f preallocated output array of order basis function values
303
+ * @returns true if and only if output array is sufficiently sized
307
304
  */
308
305
  evaluateBasisFunctions(knotIndex0, u, f) {
306
+ if (f.length < this.degree + 1)
307
+ return false;
309
308
  f[0] = 1.0;
310
309
  if (this.degree < 1)
311
- return;
310
+ return true;
312
311
  // direct compute for linear part ...
313
312
  const u0 = this.knots[knotIndex0];
314
313
  const u1 = this.knots[knotIndex0 + 1];
315
314
  f[1] = (u - u0) / (u1 - u0);
316
315
  f[0] = 1.0 - f[1];
317
316
  if (this.degree < 2)
318
- return;
317
+ return true;
319
318
  for (let depth = 1; depth < this.degree; depth++) {
320
319
  let kLeft = knotIndex0 - depth;
321
320
  let kRight = kLeft + depth + 1;
@@ -331,20 +330,28 @@ class KnotVector {
331
330
  }
332
331
  f[depth + 1] = gCarry;
333
332
  }
333
+ return true;
334
334
  }
335
335
  /**
336
336
  * Evaluate basis functions f[], derivatives df[], and optional second derivatives ddf[] at knot value u.
337
337
  *
338
338
  * @param u knot value for evaluation
339
- * @param f array of order basis function values
340
- * @param df array of order basis derivative values
341
- * @param ddf array of order basis second derivative values
339
+ * @param f preallocated output array of order basis function values
340
+ * @param df preallocated output array of order basis derivative values
341
+ * @param ddf optional preallocated output array of order basis second derivative values
342
+ * @returns true if and only if output arrays are sufficiently sized
342
343
  */
343
344
  evaluateBasisFunctions1(knotIndex0, u, f, df, ddf) {
345
+ if (f.length < this.degree + 1)
346
+ return false;
347
+ if (df.length < this.degree + 1)
348
+ return false;
349
+ if (ddf && ddf.length < this.degree + 1)
350
+ return false;
344
351
  f[0] = 1.0;
345
352
  df[0] = 0.0;
346
353
  if (this.degree < 1)
347
- return;
354
+ return true;
348
355
  // direct compute for linear part ...
349
356
  const u0 = this.knots[knotIndex0];
350
357
  const u1 = this.knots[knotIndex0 + 1];
@@ -360,7 +367,7 @@ class KnotVector {
360
367
  ddf[1] = 0.0;
361
368
  }
362
369
  if (this.degree < 2)
363
- return;
370
+ return true;
364
371
  for (let depth = 1; depth < this.degree; depth++) {
365
372
  let kLeft = knotIndex0 - depth;
366
373
  let kRight = kLeft + depth + 1;
@@ -402,6 +409,7 @@ class KnotVector {
402
409
  if (ddf)
403
410
  ddf[depth + 1] = ddgCarry;
404
411
  }
412
+ return true;
405
413
  }
406
414
  /** Find the knot span bracketing knots[i] <= u < knots[i+1] and return i.
407
415
  * * If u has no such bracket, return the smaller index of the closest nontrivial bracket.
@@ -453,38 +461,37 @@ class KnotVector {
453
461
  this.knots[i] = a + (b - this.knots[i]);
454
462
  this.knots.reverse();
455
463
  }
456
- /**
457
- * return a simple array form of the knots. optionally replicate the first and last
458
- * in classic over-clamped manner
459
- */
460
- copyKnots(includeExtraEndKnot) {
461
- const wrap = this.wrappable === BSplineWrapMode.OpenByAddingControlPoints && this.testClosable();
462
- const leftIndex = this.leftKnotIndex;
463
- const rightIndex = this.rightKnotIndex;
464
- const a0 = this.leftKnot;
465
- const a1 = this.rightKnot;
464
+ /** Return a simple array form of the knots. Optionally replicate the first and last in classic over-clamped manner. */
465
+ static copyKnots(knots, degree, includeExtraEndKnot, wrapMode) {
466
+ const isExtraEndKnotPeriodic = (includeExtraEndKnot && wrapMode === BSplineWrapMode.OpenByAddingControlPoints);
467
+ const leftIndex = degree - 1;
468
+ const rightIndex = knots.length - degree;
469
+ const a0 = knots[leftIndex];
470
+ const a1 = knots[rightIndex];
466
471
  const delta = a1 - a0;
467
- const degree = this.degree;
468
472
  const values = [];
469
473
  if (includeExtraEndKnot) {
470
- if (wrap) {
471
- values.push(this.knots[rightIndex - degree] - delta);
472
- }
473
- else {
474
- values.push(this.knots[0]);
475
- }
474
+ if (isExtraEndKnotPeriodic)
475
+ values.push(knots[rightIndex - degree] - delta);
476
+ else
477
+ values.push(knots[0]);
476
478
  }
477
- for (const u of this.knots)
479
+ for (const u of knots) {
478
480
  values.push(u);
481
+ }
479
482
  if (includeExtraEndKnot) {
480
- if (wrap) {
481
- values.push(this.knots[leftIndex + degree] + delta);
482
- }
483
+ if (isExtraEndKnotPeriodic)
484
+ values.push(knots[leftIndex + degree] + delta);
483
485
  else
484
- values.push(values[values.length - 1]);
486
+ values.push(knots[knots.length - 1]);
485
487
  }
486
488
  return values;
487
489
  }
490
+ /** Return a simple array form of the knots. Optionally replicate the first and last in classic over-clamped manner. */
491
+ copyKnots(includeExtraEndKnot) {
492
+ const wrapMode = (includeExtraEndKnot && this.testClosable()) ? this.wrappable : undefined;
493
+ return KnotVector.copyKnots(this.knots, this.degree, includeExtraEndKnot, wrapMode);
494
+ }
488
495
  }
489
496
  /** tolerance for considering two knots to be the same. */
490
497
  KnotVector.knotTolerance = 1.0e-9;
@@ -1 +1 @@
1
- {"version":3,"file":"KnotVector.js","sourceRoot":"","sources":["../../../src/bspline/KnotVector.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,0CAAuC;AACvC,6DAAyD;AAEzD;;;;;;GAMG;AACH,IAAY,eAaX;AAbD,WAAY,eAAe;IACzB,gCAAgC;IAChC,qDAAQ,CAAA;IACR;;;OAGG;IACH,+FAA6B,CAAA;IAC7B;;;OAGG;IACH,mFAAuB,CAAA;AACzB,CAAC,EAbW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAa1B;AACD;;;;;;;;;;;;;;GAcG;AACH,MAAa,UAAU;IAWrB,+FAA+F;IAC/F,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,gGAAgG;IAChG,IAAW,SAAS,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,mEAAmE;IACnE,IAAW,aAAa,KAAK,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACtD,oEAAoE;IACpE,IAAW,cAAc,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACvE,mLAAmL;IACnL,IAAW,SAAS,KAAK,OAAO,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IACvG,IAAW,SAAS,CAAC,KAAsB,IAAI,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CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;aACtD;iBAAM;gBACL,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;aAC5B;SACF;QACD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK;YAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3C,IAAI,mBAAmB,EAAE;YACvB,IAAI,IAAI,EAAE;gBACR,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;aACrD;;gBACC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;SAC1C;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;;AA7aD,0DAA0D;AACnC,wBAAa,GAAG,MAAM,CAAC;AAVnC,gCAAU","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Bspline\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\r\n\r\n/**\r\n * Enumeration of the possible ways of converting a \"periodic\" knot vector to an open knot vector.\r\n * None (0) ==> no wrap possible\r\n * OpenByAddingControlPoints (1) ==> wrapped by adding poles\r\n * OpenByRemovingKnots (2) ==> wrapped by deleting extreme knots.\r\n * @public\r\n */\r\nexport enum BSplineWrapMode {\r\n /** No conversion to periodic */\r\n None = 0,\r\n /** Convert to periodic by removing control points. This is typical for closed bcurve constructed by control points with maximum continuity.\r\n * * Knots stay the same in open and periodic form.\r\n * * Periodic form omits {degree} control points.\r\n */\r\n OpenByAddingControlPoints = 1,\r\n /** Convert to periodic by adding special knots. This is typical of closed bcurve constructed as exact circular or elliptic arc\r\n * * 2 knots on each end are omitted in open form\r\n * * poles stay the same.\r\n */\r\n OpenByRemovingKnots = 2,\r\n}\r\n/**\r\n * Array of non-decreasing numbers acting as a knot array for bsplines.\r\n *\r\n * * Essential identity: numKnots = numPoles + order - 2 = numPoles + degree - 1\r\n * * Various bspline libraries have confusion over how many \"end knots\" are needed. \"Many\" libraries (including MicroStation)\r\n * incorrectly demand \"order\" knots at each end for clamping. But only \"order - 1\" are really needed.\r\n * * This class uses the \"order-1\" convention.\r\n * * This class provides queries to convert among spanIndex and knotIndex\r\n * * A span is a single interval of the knots.\r\n * * The left knot of span {k} is knot {k+degree-1}\r\n * * This class provides queries to convert among spanFraction, fraction of knot range, and knot\r\n * * core computations (evaluateBasisFunctions) have leftKnotIndex and global knot value as inputs. Callers need to\r\n * know their primary values (global knot, spanFraction).\r\n * @public\r\n */\r\nexport class KnotVector {\r\n /** The simple array of knot values. */\r\n public knots: Float64Array;\r\n /** Return the degree of basis functions defined in these knots. */\r\n public degree: number;\r\n private _knot0: number;\r\n private _knot1: number;\r\n\r\n private _wrapMode?: BSplineWrapMode;\r\n /** tolerance for considering two knots to be the same. */\r\n public static readonly knotTolerance = 1.0e-9;\r\n /** Return the leftmost knot value (of the active interval, ignoring unclamped leading knots)*/\r\n public get leftKnot() { return this._knot0; }\r\n /** Return the rightmost knot value (of the active interval, ignoring unclamped leading knots)*/\r\n public get rightKnot() { return this._knot1; }\r\n /** Return the index of the leftmost knot of the active interval */\r\n public get leftKnotIndex() { return this.degree - 1; }\r\n /** Return the index of the rightmost knot of the active interval */\r\n public get rightKnotIndex() { return this.knots.length - this.degree; }\r\n /** Whether the bspline was created by adding poles into \"closed\" structure. This is used by serialize/deserialize to mark knotVector's that were converted from periodic style. */\r\n public get wrappable() { return this._wrapMode === undefined ? BSplineWrapMode.None : this._wrapMode; }\r\n public set wrappable(value: BSplineWrapMode) { this._wrapMode = value; }\r\n /** Return the number of bezier spans. Note that this includes zero-length spans if there are repeated knots. */\r\n public get numSpans() { return this.rightKnotIndex - this.leftKnotIndex; }\r\n /**\r\n *\r\n * * If knots is a number array or Float64Array, the those values become the local knot array.\r\n * * If knots is a simple number, the local knot array is allocated to that size but left as zeros.\r\n * @param knots\r\n * @param degree\r\n */\r\n private constructor(knots: number[] | Float64Array | number, degree: number, wrapMode?: BSplineWrapMode) {\r\n this.degree = degree;\r\n this._wrapMode = wrapMode;\r\n // default values to satisfy compiler -- real values hapn setupFixedValues or final else defers to user\r\n this._knot0 = 0.0;\r\n this._knot1 = 1.0;\r\n // satisfy the initialize checker ..\r\n if (Array.isArray(knots)) { // remark: This ctor is private. The callers (as of April 2019) do not use this path.\r\n this.knots = new Float64Array(knots.length);\r\n this.setKnots(knots);\r\n this.setupFixedValues();\r\n } else if (knots instanceof Float64Array) {\r\n this.knots = knots.slice();\r\n this.setupFixedValues();\r\n } else { // caller is responsible for filling array separately ...\r\n this.knots = new Float64Array(knots);\r\n }\r\n }\r\n /** copy degree and knots to a new KnotVector. */\r\n public clone(): KnotVector { return new KnotVector(this.knots, this.degree, this.wrappable); }\r\n private setupFixedValues() {\r\n // These should be read-only . ..\r\n this._knot0 = this.knots[this.degree - 1];\r\n this._knot1 = this.knots[this.knots.length - this.degree];\r\n }\r\n /** Return the total knot distance from beginning to end. */\r\n public get knotLength01(): number { return this._knot1 - this._knot0; }\r\n /**\r\n * Returns true if all numeric values have wraparound conditions for \"closed\" knotVector with specified wrap mode\r\n * @param mode optional test mode. If undefined, use the this.wrappable.\r\n */\r\n public testClosable(mode?: BSplineWrapMode): boolean {\r\n if (mode === undefined)\r\n mode = this.wrappable;\r\n const leftKnotIndex = this.leftKnotIndex;\r\n const rightKnotIndex = this.rightKnotIndex;\r\n const period = this.rightKnot - this.leftKnot;\r\n const degree = this.degree;\r\n const indexDelta = rightKnotIndex - leftKnotIndex;\r\n // maximum continuity mode . . .\r\n if (mode === BSplineWrapMode.OpenByAddingControlPoints) {\r\n for (let k0 = leftKnotIndex - degree + 1; k0 < leftKnotIndex + degree - 1; k0++) {\r\n const k1 = k0 + indexDelta;\r\n if (!Geometry.isSameCoordinate(this.knots[k0] + period, this.knots[k1]))\r\n return false;\r\n }\r\n return true;\r\n }\r\n // arc mode ...\r\n if (mode === BSplineWrapMode.OpenByRemovingKnots) {\r\n // we expect {degree} replicated knots at each end . . .\r\n const numRepeated = degree - 1;\r\n const leftKnot = this.knots[leftKnotIndex];\r\n const rightKnot = this.knots[rightKnotIndex];\r\n for (let i = 0; i < numRepeated; i++) {\r\n if (!Geometry.isSameCoordinate(leftKnot, this.knots[leftKnotIndex - i - 1]))\r\n return false;\r\n if (!Geometry.isSameCoordinate(rightKnot, this.knots[rightKnotIndex + i + 1]))\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n /** Test matching degree and knot values */\r\n public isAlmostEqual(other: KnotVector): boolean {\r\n if (this.degree !== other.degree) return false;\r\n return NumberArray.isAlmostEqual(this.knots, other.knots, KnotVector.knotTolerance);\r\n }\r\n\r\n /** Compute the multiplicity of the input knot, or zero if not a knot. */\r\n public getKnotMultiplicity(knot: number): number {\r\n let m = 0;\r\n for (const k of this.knots) {\r\n if (Math.abs(k - knot) < KnotVector.knotTolerance)\r\n ++m;\r\n else if (knot < k)\r\n break;\r\n }\r\n return m;\r\n }\r\n\r\n /** Compute the multiplicity of the knot at the given index. */\r\n public getKnotMultiplicityAtIndex(knotIndex: number): number {\r\n let m = 0;\r\n if (knotIndex >= 0 && knotIndex < this.knots.length) {\r\n const knot = this.knots[knotIndex];\r\n ++m; // count this knot\r\n for (let i = knotIndex - 1; i >= 0; --i) {\r\n const k = this.knots[i];\r\n if (Math.abs(k - knot) < KnotVector.knotTolerance)\r\n ++m; // found multiple to left of knot\r\n else if (knot > k)\r\n break;\r\n }\r\n for (let i = knotIndex + 1; i < this.knots.length; ++i) {\r\n const k = this.knots[i];\r\n if (Math.abs(k - knot) < KnotVector.knotTolerance)\r\n ++m; // found multiple to right of knot\r\n else if (knot < k)\r\n break;\r\n }\r\n }\r\n return m;\r\n }\r\n\r\n /** Transform knots to span [0,1].\r\n * @returns false if and only if this.knotLength01 is trivial\r\n */\r\n public normalize(): boolean {\r\n if (this.knotLength01 < KnotVector.knotTolerance)\r\n return false;\r\n const divisor = 1.0 / this.knotLength01;\r\n const leftKnot = this.leftKnot;\r\n for (let i = 0; i < this.knots.length; ++i)\r\n this.knots[i] = (this.knots[i] - leftKnot) * divisor;\r\n // explicitly set rightKnot and its multiples to 1.0 to avoid round-off\r\n for (let i = this.rightKnotIndex - 1; i > this.leftKnotIndex && (this.knots[i] === this.knots[this.rightKnotIndex]); --i) this.knots[i] = 1.0;\r\n for (let i = this.rightKnotIndex + 1; i < this.knots.length && (this.knots[i] === this.knots[this.rightKnotIndex]); ++i) this.knots[i] = 1.0;\r\n this.knots[this.rightKnotIndex] = 1.0;\r\n this.setupFixedValues();\r\n return true;\r\n }\r\n\r\n /** install knot values from an array, optionally ignoring first and last.\r\n */\r\n public setKnots(knots: number[] | Float64Array, skipFirstAndLast?: boolean) {\r\n const numAllocate = skipFirstAndLast ? knots.length - 2 : knots.length;\r\n if (numAllocate !== this.knots.length)\r\n this.knots = new Float64Array(numAllocate);\r\n if (skipFirstAndLast) {\r\n for (let i = 1; i + 1 < knots.length; i++)\r\n this.knots[i - 1] = knots[i];\r\n\r\n } else {\r\n for (let i = 0; i < knots.length; i++)\r\n this.knots[i] = knots[i];\r\n }\r\n this.setupFixedValues();\r\n }\r\n\r\n /** install knot values from an array, optionally ignoring first and last. */\r\n public setKnotsCapture(knots: Float64Array) {\r\n this.knots = knots;\r\n this.setupFixedValues();\r\n }\r\n\r\n /**\r\n * Create knot vector with {degree-1} replicated knots at start and end, and uniform knots between.\r\n * @param numPoles Number of poles\r\n * @param degree degree of polynomial\r\n * @param a0 left knot value for active interval\r\n * @param a1 right knot value for active interval\r\n */\r\n public static createUniformClamped(numPoles: number, degree: number, a0: number, a1: number): KnotVector {\r\n const knots = new KnotVector(numPoles + degree - 1, degree);\r\n let k = 0;\r\n for (let m = 0; m < degree; m++)knots.knots[k++] = a0;\r\n const du = 1.0 / (numPoles - degree);\r\n for (let i = 1; i + degree < numPoles; i++)\r\n knots.knots[k++] = a0 + i * du * (a1 - a0);\r\n for (let m = 0; m < degree; m++)knots.knots[k++] = a1;\r\n knots.setupFixedValues();\r\n return knots;\r\n }\r\n /**\r\n * Create knot vector with wraparound knots at start and end, and uniform knots between.\r\n * @param numInterval number of intervals in knot space. (NOT POLE COUNT)\r\n * @param degree degree of polynomial\r\n * @param a0 left knot value for active interval\r\n * @param a1 right knot value for active interval\r\n */\r\n public static createUniformWrapped(numInterval: number, degree: number, a0: number, a1: number): KnotVector {\r\n const knots = new KnotVector(numInterval + 2 * degree - 1, degree);\r\n const du = 1.0 / numInterval;\r\n for (let i = 1 - degree, k = 0; i < numInterval + degree; i++, k++) {\r\n knots.knots[k] = Geometry.interpolate(a0, i * du, a1);\r\n }\r\n knots.setupFixedValues();\r\n return knots;\r\n }\r\n\r\n /**\r\n * Create knot vector with given knot values and degree.\r\n * @param knotArray knot values\r\n * @param degree degree of polynomial\r\n * @param skipFirstAndLast true to skip copying the first and last knot values.\r\n */\r\n public static create(knotArray: number[] | Float64Array, degree: number, skipFirstAndLast?: boolean): KnotVector {\r\n const numAllocate = skipFirstAndLast ? knotArray.length - 2 : knotArray.length;\r\n const knots = new KnotVector(numAllocate, degree);\r\n knots.setKnots(knotArray, skipFirstAndLast);\r\n return knots;\r\n }\r\n\r\n /**\r\n * Return the average of degree consecutive knots beginning at knotIndex.\r\n */\r\n public grevilleKnot(knotIndex: number): number {\r\n if (knotIndex < 0) return this.leftKnot;\r\n if (knotIndex > this.rightKnotIndex) return this.rightKnot;\r\n let sum = 0.0;\r\n for (let i = knotIndex; i < knotIndex + this.degree; i++)\r\n sum += this.knots[i];\r\n return sum / this.degree;\r\n }\r\n /** Return an array sized for a set of the basis function values. */\r\n public createBasisArray(): Float64Array { return new Float64Array(this.degree + 1); }\r\n /** Convert localFraction within the interval following an indexed knot to a knot value. */\r\n public baseKnotFractionToKnot(knotIndex0: number, localFraction: number): number {\r\n const knot0 = this.knots[knotIndex0];\r\n localFraction = Geometry.clamp(localFraction, 0, 1);\r\n return knot0 + localFraction * (this.knots[knotIndex0 + 1] - knot0);\r\n }\r\n /** Convert localFraction within an indexed bezier span to a knot value. */\r\n public spanFractionToKnot(spanIndex: number, localFraction: number): number {\r\n const k = this.spanIndexToLeftKnotIndex(spanIndex);\r\n localFraction = Geometry.clamp(localFraction, 0, 1);\r\n return this.knots[k] + localFraction * (this.knots[k + 1] - this.knots[k]);\r\n }\r\n /** Convert localFraction within an indexed bezier span to fraction of active knot range. */\r\n public spanFractionToFraction(spanIndex: number, localFraction: number): number {\r\n const knot = this.spanFractionToKnot(spanIndex, localFraction);\r\n return (knot - this.leftKnot) / (this.rightKnot - this.leftKnot);\r\n }\r\n /** Return fraction of active knot range to knot value. */\r\n public fractionToKnot(fraction: number): number {\r\n fraction = Geometry.clamp(fraction, 0, 1); // B-splines are not extendable\r\n return Geometry.interpolate(this.knots[this.degree - 1], fraction, this.knots[this.knots.length - this.degree]);\r\n }\r\n /**\r\n * Evaluate basis functions f[] at knot value u.\r\n *\r\n * @param u knot value for evaluation\r\n * @param f array of order basis function values\r\n */\r\n public evaluateBasisFunctions(knotIndex0: number, u: number, f: Float64Array) {\r\n f[0] = 1.0;\r\n if (this.degree < 1) return;\r\n // direct compute for linear part ...\r\n const u0 = this.knots[knotIndex0];\r\n const u1 = this.knots[knotIndex0 + 1];\r\n f[1] = (u - u0) / (u1 - u0);\r\n f[0] = 1.0 - f[1];\r\n if (this.degree < 2) return;\r\n\r\n for (let depth = 1; depth < this.degree; depth++) {\r\n let kLeft = knotIndex0 - depth;\r\n let kRight = kLeft + depth + 1;\r\n let gCarry = 0.0;\r\n for (let step = 0; step <= depth; step++) {\r\n const tLeft = this.knots[kLeft++];\r\n const tRight = this.knots[kRight++];\r\n const fraction = (u - tLeft) / (tRight - tLeft);\r\n const g1 = f[step] * fraction;\r\n const g0 = f[step] * (1.0 - fraction);\r\n f[step] = gCarry + g0;\r\n gCarry = g1;\r\n }\r\n f[depth + 1] = gCarry;\r\n }\r\n }\r\n\r\n /**\r\n * Evaluate basis functions f[], derivatives df[], and optional second derivatives ddf[] at knot value u.\r\n *\r\n * @param u knot value for evaluation\r\n * @param f array of order basis function values\r\n * @param df array of order basis derivative values\r\n * @param ddf array of order basis second derivative values\r\n */\r\n public evaluateBasisFunctions1(knotIndex0: number, u: number, f: Float64Array, df: Float64Array, ddf?: Float64Array) {\r\n f[0] = 1.0; df[0] = 0.0;\r\n if (this.degree < 1) return;\r\n // direct compute for linear part ...\r\n const u0 = this.knots[knotIndex0];\r\n const u1 = this.knots[knotIndex0 + 1];\r\n // ah = 1/(u1-u0) is the derivative of fraction0\r\n // (-ah) is the derivative of fraction1.\r\n let ah = 1.0 / (u1 - u0);\r\n f[1] = (u - u0) * ah;\r\n f[0] = 1.0 - f[1];\r\n df[0] = -ah; df[1] = ah;\r\n if (ddf) { // first derivative started constant, second derivative started zero.\r\n ddf[0] = 0.0; ddf[1] = 0.0;\r\n }\r\n if (this.degree < 2) return;\r\n for (let depth = 1; depth < this.degree; depth++) {\r\n let kLeft = knotIndex0 - depth;\r\n let kRight = kLeft + depth + 1;\r\n let gCarry = 0.0;\r\n let dgCarry = 0.0;\r\n let ddgCarry = 0.0;\r\n // f, df, ddf, are each row vectors with product of `step` linear terms.\r\n // f is multiplied on the right by matrix V. Each row has 2 nonzero entries (which sum to 1) (0,0,1-fraction, fraction,0,0,0)\r\n // Each row of the derivative dV is two entries (0,0, -1/h, 1/h,0,0,0)\r\n // Hence fnew = f * V\r\n // dfnew = df * V + f * dV\r\n // ddfnew = ddf * V + df*dV + df * dV + f * ddV\r\n // but ddV is zero so\r\n // ddfnew = ddf * V + 2 * df * dV\r\n for (let step = 0; step <= depth; step++) {\r\n const tLeft = this.knots[kLeft++];\r\n const tRight = this.knots[kRight++];\r\n ah = 1.0 / (tRight - tLeft);\r\n const fraction = (u - tLeft) * ah;\r\n const fraction1 = 1.0 - fraction;\r\n const g1 = f[step] * fraction;\r\n const g0 = f[step] * fraction1;\r\n const dg1 = df[step] * fraction + f[step] * ah;\r\n const dg0 = df[step] * fraction1 - f[step] * ah;\r\n const dfSave = 2.0 * df[step] * ah;\r\n f[step] = gCarry + g0;\r\n df[step] = dgCarry + dg0;\r\n gCarry = g1;\r\n dgCarry = dg1;\r\n if (ddf) { // do the backward reference to df before rewriting df !!!\r\n const ddg1 = ddf[step] * fraction + dfSave;\r\n const ddg0 = ddf[step] * fraction1 - dfSave;\r\n ddf[step] = ddgCarry + ddg0;\r\n ddgCarry = ddg1;\r\n }\r\n }\r\n f[depth + 1] = gCarry;\r\n df[depth + 1] = dgCarry;\r\n if (ddf)\r\n ddf[depth + 1] = ddgCarry;\r\n }\r\n }\r\n /** Find the knot span bracketing knots[i] <= u < knots[i+1] and return i.\r\n * * If u has no such bracket, return the smaller index of the closest nontrivial bracket.\r\n * @param u value to bracket\r\n */\r\n public knotToLeftKnotIndex(u: number): number {\r\n for (let i = this.leftKnotIndex; i < this.rightKnotIndex; ++i) {\r\n if (u < this.knots[i + 1])\r\n return i;\r\n }\r\n // for u >= rightKnot, return left index of last nontrivial span\r\n for (let i = this.rightKnotIndex; i > this.leftKnotIndex; --i) {\r\n if (this.knots[i] - this.knots[i - 1] >= KnotVector.knotTolerance)\r\n return i - 1;\r\n }\r\n return this.rightKnotIndex - 1; // shouldn't get here\r\n }\r\n /**\r\n * Given a span index, return the index of the knot at its left.\r\n * @param spanIndex index of span\r\n */\r\n public spanIndexToLeftKnotIndex(spanIndex: number): number {\r\n const d = this.degree;\r\n if (spanIndex <= 0.0) return d - 1;\r\n return Math.min(spanIndex + d - 1, this.knots.length - d - 1);\r\n }\r\n /** Return the knot interval length of indexed bezier span. */\r\n public spanIndexToSpanLength(spanIndex: number): number {\r\n const k = this.spanIndexToLeftKnotIndex(spanIndex);\r\n return this.knots[k + 1] - this.knots[k];\r\n }\r\n /**\r\n * Given a span index, test if it is within range and has nonzero length.\r\n * * note that a false return does not imply there are no more spans. This may be a double knot (zero length span) followed by more real spans\r\n * @param spanIndex index of span to test.\r\n */\r\n public isIndexOfRealSpan(spanIndex: number): boolean {\r\n if (spanIndex >= 0 && spanIndex < this.numSpans)\r\n return !Geometry.isSmallMetricDistance(this.spanIndexToSpanLength(spanIndex));\r\n return false;\r\n }\r\n /** Reflect all knots so `leftKnot` and `rightKnot` are maintained but interval lengths reverse. */\r\n public reflectKnots() {\r\n const a = this.leftKnot;\r\n const b = this.rightKnot;\r\n const numKnots = this.knots.length;\r\n for (let i = 0; i < numKnots; i++)\r\n this.knots[i] = a + (b - this.knots[i]);\r\n this.knots.reverse();\r\n }\r\n /**\r\n * return a simple array form of the knots. optionally replicate the first and last\r\n * in classic over-clamped manner\r\n */\r\n public copyKnots(includeExtraEndKnot: boolean): number[] {\r\n const wrap = this.wrappable === BSplineWrapMode.OpenByAddingControlPoints && this.testClosable();\r\n const leftIndex = this.leftKnotIndex;\r\n const rightIndex = this.rightKnotIndex;\r\n const a0 = this.leftKnot;\r\n const a1 = this.rightKnot;\r\n const delta = a1 - a0;\r\n const degree = this.degree;\r\n const values: number[] = [];\r\n if (includeExtraEndKnot) {\r\n if (wrap) {\r\n values.push(this.knots[rightIndex - degree] - delta);\r\n } else {\r\n values.push(this.knots[0]);\r\n }\r\n }\r\n for (const u of this.knots) values.push(u);\r\n if (includeExtraEndKnot) {\r\n if (wrap) {\r\n values.push(this.knots[leftIndex + degree] + delta);\r\n } else\r\n values.push(values[values.length - 1]);\r\n }\r\n return values;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"KnotVector.js","sourceRoot":"","sources":["../../../src/bspline/KnotVector.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,0CAAuC;AACvC,6DAAyD;AAEzD;;;;GAIG;AAC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ACtB,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,IAAI,mBAAmB,EAAE;YACvB,IAAI,sBAAsB;gBACxB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;;gBAEhD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SACzB;QACD,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE;YACrB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAChB;QACD,IAAI,mBAAmB,EAAE;YACvB,IAAI,sBAAsB;gBACxB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;;gBAE/C,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;SACxC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,uHAAuH;IAChH,SAAS,CAAC,mBAA4B;QAC3C,MAAM,QAAQ,GAAG,CAAC,mBAAmB,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3F,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,mBAAmB,EAAE,QAAQ,CAAC,CAAC;IACtF,CAAC;;AA/bD,0DAA0D;AACnC,wBAAa,GAAG,MAAM,CAAC;AAVnC,gCAAU","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Bspline\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\r\n\r\n/**\r\n * B-spline curve and surface types in this library are non-periodic. But they can be created from legacy periodic data.\r\n * This enumeration lists the possible ways a B-spline object can have been created from legacy periodic data.\r\n * @public\r\n */\r\nexport enum BSplineWrapMode {\r\n /** No conversion performed. */\r\n None = 0,\r\n /** The B-spline was opened up by adding degree wrap-around control points to the legacy periodic data.\r\n * * This is typical of B-splines constructed with maximum (degree - 1) continuity.\r\n * * Knots are unaffected by this conversion.\r\n */\r\n OpenByAddingControlPoints = 1,\r\n /** The B-spline was opened up by removing degree extreme knots from the legacy periodic data.\r\n * * This is typical of rational B-spline curves representing full circles and ellipses.\r\n * * Poles are unaffected by this conversion.\r\n */\r\n OpenByRemovingKnots = 2,\r\n}\r\n/**\r\n * Array of non-decreasing numbers acting as a knot array for B-splines.\r\n *\r\n * * Essential identity: numKnots = numPoles + order - 2 = numPoles + degree - 1\r\n * * Various B-spline libraries have confusion over how many \"end knots\" are needed. Many libraries (including MicroStation and Parasolid)\r\n * demand order knots at each end for clamping. But only order-1 are really needed. This class uses the order-1 convention.\r\n * * A span is a single interval of the knots.\r\n * * The left knot of span {k} is knot {k+degree-1}.\r\n * * This class provides queries to convert among spanIndex, knotIndex, spanFraction, fraction of knot range, and knot.\r\n * * Core computations (evaluateBasisFunctions) have leftKnotIndex and global knot value as inputs. Callers need to\r\n * know their primary values (global knot, spanFraction).\r\n * @public\r\n */\r\nexport class KnotVector {\r\n /** The simple array of knot values. */\r\n public knots: Float64Array;\r\n /** Return the degree of basis functions defined in these knots. */\r\n public degree: number;\r\n private _knot0: number;\r\n private _knot1: number;\r\n\r\n private _wrapMode?: BSplineWrapMode;\r\n /** tolerance for considering two knots to be the same. */\r\n public static readonly knotTolerance = 1.0e-9;\r\n /** Return the leftmost knot value (of the active interval, ignoring unclamped leading knots)*/\r\n public get leftKnot() { return this._knot0; }\r\n /** Return the rightmost knot value (of the active interval, ignoring unclamped leading knots)*/\r\n public get rightKnot() { return this._knot1; }\r\n /** Return the index of the leftmost knot of the active interval */\r\n public get leftKnotIndex() { return this.degree - 1; }\r\n /** Return the index of the rightmost knot of the active interval */\r\n public get rightKnotIndex() { return this.knots.length - this.degree; }\r\n /** Whether this KnotVector was created by converting legacy periodic data during deserialization. The conversion used is specified by BSplineWrapMode, and is reversed at serialization time. */\r\n public get wrappable() { return this._wrapMode === undefined ? BSplineWrapMode.None : this._wrapMode; }\r\n public set wrappable(value: BSplineWrapMode) { this._wrapMode = value; }\r\n /** Return the number of bezier spans. Note that this includes zero-length spans if there are repeated knots. */\r\n public get numSpans() { return this.rightKnotIndex - this.leftKnotIndex; }\r\n /**\r\n *\r\n * * If knots is a number array or Float64Array, the those values become the local knot array.\r\n * * If knots is a simple number, the local knot array is allocated to that size but left as zeros.\r\n * @param knots\r\n * @param degree\r\n */\r\n private constructor(knots: number[] | Float64Array | number, degree: number, wrapMode?: BSplineWrapMode) {\r\n this.degree = degree;\r\n this._wrapMode = wrapMode;\r\n // default values to satisfy compiler -- real values happen in setupFixedValues, or final else defers to user\r\n this._knot0 = 0.0;\r\n this._knot1 = 1.0;\r\n // satisfy the initialize checker ..\r\n if (Array.isArray(knots)) { // remark: This ctor is private. The callers (as of April 2019) do not use this path.\r\n this.knots = new Float64Array(knots.length);\r\n this.setKnots(knots);\r\n this.setupFixedValues();\r\n } else if (knots instanceof Float64Array) {\r\n this.knots = knots.slice();\r\n this.setupFixedValues();\r\n } else { // caller is responsible for filling array separately ...\r\n this.knots = new Float64Array(knots);\r\n }\r\n }\r\n /** copy degree and knots to a new KnotVector. */\r\n public clone(): KnotVector { return new KnotVector(this.knots, this.degree, this.wrappable); }\r\n private setupFixedValues() {\r\n if (this.degree > 0 && this.knots.length > this.degree) {\r\n this._knot0 = this.knots[this.degree - 1];\r\n this._knot1 = this.knots[this.knots.length - this.degree];\r\n }\r\n }\r\n /** Return the total knot distance from beginning to end. */\r\n public get knotLength01(): number { return this._knot1 - this._knot0; }\r\n /**\r\n * Returns true if all numeric values have wraparound conditions that allow the knots to be closed with specified wrap mode.\r\n * @param mode optional test mode. If undefined, use this.wrappable.\r\n */\r\n public testClosable(mode?: BSplineWrapMode): boolean {\r\n if (mode === undefined)\r\n mode = this.wrappable;\r\n const degree = this.degree;\r\n const leftKnotIndex = this.leftKnotIndex;\r\n const rightKnotIndex = this.rightKnotIndex;\r\n if (mode === BSplineWrapMode.OpenByAddingControlPoints) {\r\n // maximum continuity mode: we expect degree periodically extended knots at each end\r\n const period = this.rightKnot - this.leftKnot;\r\n const indexDelta = rightKnotIndex - leftKnotIndex;\r\n for (let k0 = 0; k0 < leftKnotIndex + degree; k0++) {\r\n const k1 = k0 + indexDelta;\r\n if (Math.abs(this.knots[k0] + period - this.knots[k1]) >= KnotVector.knotTolerance)\r\n return false;\r\n }\r\n return true;\r\n }\r\n if (mode === BSplineWrapMode.OpenByRemovingKnots) {\r\n // legacy periodic mode: we expect multiplicity degree knots at each end\r\n const numRepeated = degree - 1;\r\n const leftKnot = this.leftKnot;\r\n const rightKnot = this.rightKnot;\r\n for (let i = 0; i < numRepeated; i++) {\r\n if (Math.abs(leftKnot - this.knots[leftKnotIndex - i - 1]) >= KnotVector.knotTolerance)\r\n return false;\r\n if (Math.abs(rightKnot - this.knots[rightKnotIndex + i + 1]) >= KnotVector.knotTolerance)\r\n return false;\r\n }\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** Test matching degree and knot values */\r\n public isAlmostEqual(other: KnotVector): boolean {\r\n if (this.degree !== other.degree) return false;\r\n return NumberArray.isAlmostEqual(this.knots, other.knots, KnotVector.knotTolerance);\r\n }\r\n\r\n /** Compute the multiplicity of the input knot, or zero if not a knot. */\r\n public getKnotMultiplicity(knot: number): number {\r\n let m = 0;\r\n for (const k of this.knots) {\r\n if (Math.abs(k - knot) < KnotVector.knotTolerance)\r\n ++m;\r\n else if (knot < k)\r\n break;\r\n }\r\n return m;\r\n }\r\n\r\n /** Compute the multiplicity of the knot at the given index. */\r\n public getKnotMultiplicityAtIndex(knotIndex: number): number {\r\n let m = 0;\r\n if (knotIndex >= 0 && knotIndex < this.knots.length) {\r\n const knot = this.knots[knotIndex];\r\n ++m; // count this knot\r\n for (let i = knotIndex - 1; i >= 0; --i) {\r\n const k = this.knots[i];\r\n if (Math.abs(k - knot) < KnotVector.knotTolerance)\r\n ++m; // found multiple to left of knot\r\n else if (knot > k)\r\n break;\r\n }\r\n for (let i = knotIndex + 1; i < this.knots.length; ++i) {\r\n const k = this.knots[i];\r\n if (Math.abs(k - knot) < KnotVector.knotTolerance)\r\n ++m; // found multiple to right of knot\r\n else if (knot < k)\r\n break;\r\n }\r\n }\r\n return m;\r\n }\r\n\r\n /** Transform knots to span [0,1].\r\n * @returns false if and only if this.knotLength01 is trivial\r\n */\r\n public normalize(): boolean {\r\n if (this.knotLength01 < KnotVector.knotTolerance)\r\n return false;\r\n const divisor = 1.0 / this.knotLength01;\r\n const leftKnot = this.leftKnot;\r\n for (let i = 0; i < this.knots.length; ++i)\r\n this.knots[i] = (this.knots[i] - leftKnot) * divisor;\r\n // explicitly set rightKnot and its multiples to 1.0 to avoid round-off\r\n for (let i = this.rightKnotIndex - 1; i > this.leftKnotIndex && (this.knots[i] === this.knots[this.rightKnotIndex]); --i) this.knots[i] = 1.0;\r\n for (let i = this.rightKnotIndex + 1; i < this.knots.length && (this.knots[i] === this.knots[this.rightKnotIndex]); ++i) this.knots[i] = 1.0;\r\n this.knots[this.rightKnotIndex] = 1.0;\r\n this.setupFixedValues();\r\n return true;\r\n }\r\n\r\n /** install knot values from an array, optionally ignoring first and last.\r\n */\r\n public setKnots(knots: number[] | Float64Array, skipFirstAndLast?: boolean) {\r\n const numAllocate = skipFirstAndLast ? knots.length - 2 : knots.length;\r\n if (numAllocate !== this.knots.length)\r\n this.knots = new Float64Array(numAllocate);\r\n if (skipFirstAndLast) {\r\n for (let i = 1; i + 1 < knots.length; i++)\r\n this.knots[i - 1] = knots[i];\r\n\r\n } else {\r\n for (let i = 0; i < knots.length; i++)\r\n this.knots[i] = knots[i];\r\n }\r\n this.setupFixedValues();\r\n }\r\n\r\n /** Set knots to input array (CAPTURED) */\r\n public setKnotsCapture(knots: Float64Array) {\r\n this.knots = knots;\r\n this.setupFixedValues();\r\n }\r\n\r\n /**\r\n * Create knot vector with {degree-1} replicated knots at start and end, and uniform knots between.\r\n * @param numPoles Number of poles\r\n * @param degree degree of polynomial\r\n * @param a0 left knot value for active interval\r\n * @param a1 right knot value for active interval\r\n */\r\n public static createUniformClamped(numPoles: number, degree: number, a0: number, a1: number): KnotVector {\r\n const knots = new KnotVector(numPoles + degree - 1, degree);\r\n let k = 0;\r\n for (let m = 0; m < degree; m++)knots.knots[k++] = a0;\r\n const du = 1.0 / (numPoles - degree);\r\n for (let i = 1; i + degree < numPoles; i++)\r\n knots.knots[k++] = a0 + i * du * (a1 - a0);\r\n for (let m = 0; m < degree; m++)knots.knots[k++] = a1;\r\n knots.setupFixedValues();\r\n return knots;\r\n }\r\n /**\r\n * Create knot vector with wraparound knots at start and end, and uniform knots between.\r\n * @param numInterval number of intervals in knot space. (NOT POLE COUNT)\r\n * @param degree degree of polynomial\r\n * @param a0 left knot value for active interval\r\n * @param a1 right knot value for active interval\r\n */\r\n public static createUniformWrapped(numInterval: number, degree: number, a0: number, a1: number): KnotVector {\r\n const knots = new KnotVector(numInterval + 2 * degree - 1, degree);\r\n const du = 1.0 / numInterval;\r\n for (let i = 1 - degree, k = 0; i < numInterval + degree; i++, k++) {\r\n knots.knots[k] = Geometry.interpolate(a0, i * du, a1);\r\n }\r\n knots.setupFixedValues();\r\n return knots;\r\n }\r\n\r\n /**\r\n * Create knot vector with given knot values and degree.\r\n * @param knotArray knot values\r\n * @param degree degree of polynomial\r\n * @param skipFirstAndLast true to skip copying the first and last knot values.\r\n */\r\n public static create(knotArray: number[] | Float64Array, degree: number, skipFirstAndLast?: boolean): KnotVector {\r\n const numAllocate = skipFirstAndLast ? knotArray.length - 2 : knotArray.length;\r\n const knots = new KnotVector(numAllocate, degree);\r\n knots.setKnots(knotArray, skipFirstAndLast);\r\n return knots;\r\n }\r\n\r\n /**\r\n * Return the average of degree consecutive knots beginning at knotIndex.\r\n */\r\n public grevilleKnot(knotIndex: number): number {\r\n if (knotIndex < 0) return this.leftKnot;\r\n if (knotIndex > this.rightKnotIndex) return this.rightKnot;\r\n let sum = 0.0;\r\n for (let i = knotIndex; i < knotIndex + this.degree; i++)\r\n sum += this.knots[i];\r\n return sum / this.degree;\r\n }\r\n /** Return an array sized for a set of the basis function values. */\r\n public createBasisArray(): Float64Array { return new Float64Array(this.degree + 1); }\r\n /** Convert localFraction within the interval following an indexed knot to a knot value. */\r\n public baseKnotFractionToKnot(knotIndex0: number, localFraction: number): number {\r\n const knot0 = this.knots[knotIndex0];\r\n localFraction = Geometry.clamp(localFraction, 0, 1);\r\n return knot0 + localFraction * (this.knots[knotIndex0 + 1] - knot0);\r\n }\r\n /** Convert localFraction within an indexed bezier span to a knot value. */\r\n public spanFractionToKnot(spanIndex: number, localFraction: number): number {\r\n const k = this.spanIndexToLeftKnotIndex(spanIndex);\r\n localFraction = Geometry.clamp(localFraction, 0, 1);\r\n return this.knots[k] + localFraction * (this.knots[k + 1] - this.knots[k]);\r\n }\r\n /** Convert localFraction within an indexed bezier span to fraction of active knot range. */\r\n public spanFractionToFraction(spanIndex: number, localFraction: number): number {\r\n const knot = this.spanFractionToKnot(spanIndex, localFraction);\r\n return (knot - this.leftKnot) / (this.rightKnot - this.leftKnot);\r\n }\r\n /** Return fraction of active knot range to knot value. */\r\n public fractionToKnot(fraction: number): number {\r\n fraction = Geometry.clamp(fraction, 0, 1); // B-splines are not extendable\r\n return Geometry.interpolate(this.knots[this.degree - 1], fraction, this.knots[this.knots.length - this.degree]);\r\n }\r\n /**\r\n * Evaluate basis functions f[] at knot value u.\r\n *\r\n * @param u knot value for evaluation\r\n * @param f preallocated output array of order basis function values\r\n * @returns true if and only if output array is sufficiently sized\r\n */\r\n public evaluateBasisFunctions(knotIndex0: number, u: number, f: Float64Array): boolean {\r\n if (f.length < this.degree + 1)\r\n return false;\r\n f[0] = 1.0;\r\n if (this.degree < 1)\r\n return true;\r\n // direct compute for linear part ...\r\n const u0 = this.knots[knotIndex0];\r\n const u1 = this.knots[knotIndex0 + 1];\r\n f[1] = (u - u0) / (u1 - u0);\r\n f[0] = 1.0 - f[1];\r\n if (this.degree < 2)\r\n return true;\r\n for (let depth = 1; depth < this.degree; depth++) {\r\n let kLeft = knotIndex0 - depth;\r\n let kRight = kLeft + depth + 1;\r\n let gCarry = 0.0;\r\n for (let step = 0; step <= depth; step++) {\r\n const tLeft = this.knots[kLeft++];\r\n const tRight = this.knots[kRight++];\r\n const fraction = (u - tLeft) / (tRight - tLeft);\r\n const g1 = f[step] * fraction;\r\n const g0 = f[step] * (1.0 - fraction);\r\n f[step] = gCarry + g0;\r\n gCarry = g1;\r\n }\r\n f[depth + 1] = gCarry;\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * Evaluate basis functions f[], derivatives df[], and optional second derivatives ddf[] at knot value u.\r\n *\r\n * @param u knot value for evaluation\r\n * @param f preallocated output array of order basis function values\r\n * @param df preallocated output array of order basis derivative values\r\n * @param ddf optional preallocated output array of order basis second derivative values\r\n * @returns true if and only if output arrays are sufficiently sized\r\n */\r\n public evaluateBasisFunctions1(knotIndex0: number, u: number, f: Float64Array, df: Float64Array, ddf?: Float64Array): boolean {\r\n if (f.length < this.degree + 1)\r\n return false;\r\n if (df.length < this.degree + 1)\r\n return false;\r\n if (ddf && ddf.length < this.degree + 1)\r\n return false;\r\n f[0] = 1.0; df[0] = 0.0;\r\n if (this.degree < 1)\r\n return true;\r\n // direct compute for linear part ...\r\n const u0 = this.knots[knotIndex0];\r\n const u1 = this.knots[knotIndex0 + 1];\r\n // ah = 1/(u1-u0) is the derivative of fraction0\r\n // (-ah) is the derivative of fraction1.\r\n let ah = 1.0 / (u1 - u0);\r\n f[1] = (u - u0) * ah;\r\n f[0] = 1.0 - f[1];\r\n df[0] = -ah; df[1] = ah;\r\n if (ddf) { // first derivative started constant, second derivative started zero.\r\n ddf[0] = 0.0; ddf[1] = 0.0;\r\n }\r\n if (this.degree < 2)\r\n return true;\r\n for (let depth = 1; depth < this.degree; depth++) {\r\n let kLeft = knotIndex0 - depth;\r\n let kRight = kLeft + depth + 1;\r\n let gCarry = 0.0;\r\n let dgCarry = 0.0;\r\n let ddgCarry = 0.0;\r\n // f, df, ddf, are each row vectors with product of `step` linear terms.\r\n // f is multiplied on the right by matrix V. Each row has 2 nonzero entries (which sum to 1) (0,0,1-fraction, fraction,0,0,0)\r\n // Each row of the derivative dV is two entries (0,0, -1/h, 1/h,0,0,0)\r\n // Hence fnew = f * V\r\n // dfnew = df * V + f * dV\r\n // ddfnew = ddf * V + df*dV + df * dV + f * ddV\r\n // but ddV is zero so\r\n // ddfnew = ddf * V + 2 * df * dV\r\n for (let step = 0; step <= depth; step++) {\r\n const tLeft = this.knots[kLeft++];\r\n const tRight = this.knots[kRight++];\r\n ah = 1.0 / (tRight - tLeft);\r\n const fraction = (u - tLeft) * ah;\r\n const fraction1 = 1.0 - fraction;\r\n const g1 = f[step] * fraction;\r\n const g0 = f[step] * fraction1;\r\n const dg1 = df[step] * fraction + f[step] * ah;\r\n const dg0 = df[step] * fraction1 - f[step] * ah;\r\n const dfSave = 2.0 * df[step] * ah;\r\n f[step] = gCarry + g0;\r\n df[step] = dgCarry + dg0;\r\n gCarry = g1;\r\n dgCarry = dg1;\r\n if (ddf) { // do the backward reference to df before rewriting df !!!\r\n const ddg1 = ddf[step] * fraction + dfSave;\r\n const ddg0 = ddf[step] * fraction1 - dfSave;\r\n ddf[step] = ddgCarry + ddg0;\r\n ddgCarry = ddg1;\r\n }\r\n }\r\n f[depth + 1] = gCarry;\r\n df[depth + 1] = dgCarry;\r\n if (ddf)\r\n ddf[depth + 1] = ddgCarry;\r\n }\r\n return true;\r\n }\r\n /** Find the knot span bracketing knots[i] <= u < knots[i+1] and return i.\r\n * * If u has no such bracket, return the smaller index of the closest nontrivial bracket.\r\n * @param u value to bracket\r\n */\r\n public knotToLeftKnotIndex(u: number): number {\r\n for (let i = this.leftKnotIndex; i < this.rightKnotIndex; ++i) {\r\n if (u < this.knots[i + 1])\r\n return i;\r\n }\r\n // for u >= rightKnot, return left index of last nontrivial span\r\n for (let i = this.rightKnotIndex; i > this.leftKnotIndex; --i) {\r\n if (this.knots[i] - this.knots[i - 1] >= KnotVector.knotTolerance)\r\n return i - 1;\r\n }\r\n return this.rightKnotIndex - 1; // shouldn't get here\r\n }\r\n /**\r\n * Given a span index, return the index of the knot at its left.\r\n * @param spanIndex index of span\r\n */\r\n public spanIndexToLeftKnotIndex(spanIndex: number): number {\r\n const d = this.degree;\r\n if (spanIndex <= 0.0) return d - 1;\r\n return Math.min(spanIndex + d - 1, this.knots.length - d - 1);\r\n }\r\n /** Return the knot interval length of indexed bezier span. */\r\n public spanIndexToSpanLength(spanIndex: number): number {\r\n const k = this.spanIndexToLeftKnotIndex(spanIndex);\r\n return this.knots[k + 1] - this.knots[k];\r\n }\r\n /**\r\n * Given a span index, test if it is within range and has nonzero length.\r\n * * note that a false return does not imply there are no more spans. This may be a double knot (zero length span) followed by more real spans\r\n * @param spanIndex index of span to test.\r\n */\r\n public isIndexOfRealSpan(spanIndex: number): boolean {\r\n if (spanIndex >= 0 && spanIndex < this.numSpans)\r\n return !Geometry.isSmallMetricDistance(this.spanIndexToSpanLength(spanIndex));\r\n return false;\r\n }\r\n /** Reflect all knots so `leftKnot` and `rightKnot` are maintained but interval lengths reverse. */\r\n public reflectKnots() {\r\n const a = this.leftKnot;\r\n const b = this.rightKnot;\r\n const numKnots = this.knots.length;\r\n for (let i = 0; i < numKnots; i++)\r\n this.knots[i] = a + (b - this.knots[i]);\r\n this.knots.reverse();\r\n }\r\n\r\n /** Return a simple array form of the knots. Optionally replicate the first and last in classic over-clamped manner. */\r\n public static copyKnots(knots: number[] | Float64Array, degree: number, includeExtraEndKnot?: boolean, wrapMode?: BSplineWrapMode): number[] {\r\n const isExtraEndKnotPeriodic = (includeExtraEndKnot && wrapMode === BSplineWrapMode.OpenByAddingControlPoints);\r\n const leftIndex = degree - 1;\r\n const rightIndex = knots.length - degree;\r\n const a0 = knots[leftIndex];\r\n const a1 = knots[rightIndex];\r\n const delta = a1 - a0;\r\n const values: number[] = [];\r\n if (includeExtraEndKnot) {\r\n if (isExtraEndKnotPeriodic)\r\n values.push(knots[rightIndex - degree] - delta);\r\n else\r\n values.push(knots[0]);\r\n }\r\n for (const u of knots) {\r\n values.push(u);\r\n }\r\n if (includeExtraEndKnot) {\r\n if (isExtraEndKnotPeriodic)\r\n values.push(knots[leftIndex + degree] + delta);\r\n else\r\n values.push(knots[knots.length - 1]);\r\n }\r\n return values;\r\n }\r\n\r\n /** Return a simple array form of the knots. Optionally replicate the first and last in classic over-clamped manner. */\r\n public copyKnots(includeExtraEndKnot: boolean): number[] {\r\n const wrapMode = (includeExtraEndKnot && this.testClosable()) ? this.wrappable : undefined;\r\n return KnotVector.copyKnots(this.knots, this.degree, includeExtraEndKnot, wrapMode);\r\n }\r\n}\r\n"]}
@@ -2,8 +2,8 @@
2
2
  * @module CartesianGeometry
3
3
  */
4
4
  import { Arc3d } from "../curve/Arc3d";
5
- import { AnyCurve, AnyRegion } from "../curve/CurveTypes";
6
5
  import { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from "../curve/CurvePrimitive";
6
+ import { AnyCurve, AnyRegion } from "../curve/CurveTypes";
7
7
  import { GeometryQuery } from "../curve/GeometryQuery";
8
8
  import { GrowableFloat64Array } from "../geometry3d/GrowableFloat64Array";
9
9
  import { GrowableXYZArray } from "../geometry3d/GrowableXYZArray";
@@ -238,17 +238,44 @@ export declare class ClipUtilities {
238
238
  * @param ignoreInvisiblePlanes if true, do NOT compute a facet for convex set faces marked invisible.
239
239
  */
240
240
  static doesConvexClipPlaneSetIntersectRange(convexSet: ConvexClipPlaneSet, range: Range3d, includeConvexSetFaces?: boolean, includeRangeFaces?: boolean, ignoreInvisiblePlanes?: boolean): boolean;
241
+ /**
242
+ * Create a clipper from the transformed range.
243
+ * @param range input range to create clipper from
244
+ * @param transform how to transform the range (NOTE: applied to the range faces without swelling the range volume)
245
+ * @param degeneratePoints optionally populated with the 1 or 2 points defining the transformed range if it is degenerate (all points colinear/coincident); otherwise untouched
246
+ * @returns newly constructed clipper. If no clip planes could be computed, fill `degeneratePoints` and return undefined.
247
+ */
248
+ private static createClipperFromTransformedRange3d;
249
+ /**
250
+ * Handle pathological cases of range-range intersection, where one of the ranges defines no area or volume (is a line segment or single point).
251
+ * @param range local range to intersect with the point/segment
252
+ * @param points isolated local point, or local segment's start and end
253
+ * @param localToWorld optional transform for output range
254
+ * @param intersection optional range of the intersection, in world coordinates, or null range if no intersection.
255
+ * @returns whether the point/segment intersects the range
256
+ */
257
+ private static rangeIntersectPointOrSegment;
241
258
  /**
242
259
  * Test for intersection of two ranges in different local coordinates.
243
260
  * * Useful for clash detection of elements in iModels, using their stored (tight) local ranges and placement transforms.
244
- * @param range0 range in local coordinates of first geometry
245
- * @param local0ToWorld placement transform for first geometry
246
- * @param range1 range in local coordinates of second geometry
247
- * @param local1ToWorld placement transform for second geometry. Assumed to be invertible.
261
+ * @param range0 first range in local coordinates
262
+ * @param local0ToWorld placement transform for first range
263
+ * @param range1 second range in local coordinates
264
+ * @param local1ToWorld placement transform for second range. Assumed to be invertible.
248
265
  * @param range1Margin optional signed local distance to expand/contract the second range before intersection. Positive expands.
249
266
  * @return whether the local ranges are adjacent or intersect. Also returns false if local1ToWorld is singular.
250
267
  */
251
268
  static doLocalRangesIntersect(range0: Range3d, local0ToWorld: Transform, range1: Range3d, local1ToWorld: Transform, range1Margin?: number): boolean;
269
+ /**
270
+ * Compute the range of the intersection between two local (e.g., element-aligned) ranges.
271
+ * @param range0 first range in local coordinates
272
+ * @param local0ToWorld placement transform for first range
273
+ * @param range1 second range in local coordinates
274
+ * @param local1ToWorld placement transform for second range. Assumed to be invertible.
275
+ * @param result optional pre-allocated range to fill and return
276
+ * @return range of the intersection (aligned to world axes). Returns null range if local1ToWorld is singular.
277
+ */
278
+ static rangeOfIntersectionOfLocalRanges(range0: Range3d, local0ToWorld: Transform, range1: Range3d, local1ToWorld: Transform, result?: Range3d): Range3d;
252
279
  /**
253
280
  * Test if `obj` is a `Clipper` object.
254
281
  * * This is implemented by testing for each of the methods in the `Clipper` interface.
@@ -1 +1 @@
1
- {"version":3,"file":"ClipUtils.d.ts","sourceRoot":"","sources":["../../../src/clipping/ClipUtils.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,EAAE,oBAAoB,EAAE,kCAAkC,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACnH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAQvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAE1F,OAAO,EAAE,OAAO,EAAY,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAA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