@itwin/core-geometry 5.0.0-dev.2 → 5.0.0-dev.20

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 (278) hide show
  1. package/CHANGELOG.md +19 -1
  2. package/lib/cjs/bspline/BSplineCurveOps.d.ts.map +1 -1
  3. package/lib/cjs/bspline/BSplineCurveOps.js +18 -21
  4. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  5. package/lib/cjs/curve/Arc3d.d.ts +30 -7
  6. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  7. package/lib/cjs/curve/Arc3d.js +53 -7
  8. package/lib/cjs/curve/Arc3d.js.map +1 -1
  9. package/lib/cjs/curve/CurveCollection.d.ts +16 -2
  10. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  11. package/lib/cjs/curve/CurveCollection.js +33 -2
  12. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  13. package/lib/cjs/curve/CurveFactory.d.ts +81 -53
  14. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  15. package/lib/cjs/curve/CurveFactory.js +190 -103
  16. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  17. package/lib/cjs/curve/LineString3d.d.ts +12 -8
  18. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  19. package/lib/cjs/curve/LineString3d.js +29 -8
  20. package/lib/cjs/curve/LineString3d.js.map +1 -1
  21. package/lib/cjs/curve/Loop.d.ts +12 -6
  22. package/lib/cjs/curve/Loop.d.ts.map +1 -1
  23. package/lib/cjs/curve/Loop.js +12 -6
  24. package/lib/cjs/curve/Loop.js.map +1 -1
  25. package/lib/cjs/curve/Query/CylindricalRange.d.ts +8 -6
  26. package/lib/cjs/curve/Query/CylindricalRange.d.ts.map +1 -1
  27. package/lib/cjs/curve/Query/CylindricalRange.js +13 -9
  28. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  29. package/lib/cjs/curve/StrokeOptions.d.ts +1 -1
  30. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  31. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  32. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  33. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +24 -18
  34. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  35. package/lib/cjs/geometry3d/AngleSweep.d.ts +1 -1
  36. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  37. package/lib/cjs/geometry3d/AngleSweep.js +1 -1
  38. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  39. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +14 -8
  40. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  41. package/lib/cjs/geometry3d/BarycentricTriangle.js +17 -8
  42. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  43. package/lib/cjs/geometry3d/FrameBuilder.js +4 -4
  44. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  45. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts +2 -0
  46. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  47. package/lib/cjs/geometry3d/GrowableFloat64Array.js +4 -0
  48. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  49. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +32 -10
  50. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  51. package/lib/cjs/geometry3d/GrowableXYZArray.js +54 -16
  52. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  53. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +13 -2
  54. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  55. package/lib/cjs/geometry3d/IndexedXYZCollection.js +24 -10
  56. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  57. package/lib/cjs/geometry3d/Matrix3d.d.ts +11 -8
  58. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  59. package/lib/cjs/geometry3d/Matrix3d.js +28 -26
  60. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  61. package/lib/cjs/geometry3d/Point3dArrayCarrier.js +1 -1
  62. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  63. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +6 -6
  64. package/lib/cjs/geometry3d/Point3dVector3d.js +6 -6
  65. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  66. package/lib/cjs/geometry3d/PolygonOps.d.ts +12 -6
  67. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  68. package/lib/cjs/geometry3d/PolygonOps.js +94 -47
  69. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  70. package/lib/cjs/geometry3d/PolylineOps.d.ts +7 -4
  71. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  72. package/lib/cjs/geometry3d/PolylineOps.js +7 -4
  73. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  74. package/lib/cjs/geometry4d/MomentData.d.ts +72 -73
  75. package/lib/cjs/geometry4d/MomentData.d.ts.map +1 -1
  76. package/lib/cjs/geometry4d/MomentData.js +62 -64
  77. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  78. package/lib/cjs/numerics/Polynomials.d.ts +5 -5
  79. package/lib/cjs/numerics/Polynomials.js +6 -6
  80. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  81. package/lib/cjs/polyface/AuxData.d.ts +2 -2
  82. package/lib/cjs/polyface/AuxData.d.ts.map +1 -1
  83. package/lib/cjs/polyface/AuxData.js +11 -3
  84. package/lib/cjs/polyface/AuxData.js.map +1 -1
  85. package/lib/cjs/polyface/Polyface.d.ts +3 -5
  86. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  87. package/lib/cjs/polyface/Polyface.js +6 -13
  88. package/lib/cjs/polyface/Polyface.js.map +1 -1
  89. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +13 -6
  90. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  91. package/lib/cjs/polyface/PolyfaceBuilder.js +65 -38
  92. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  93. package/lib/cjs/polyface/PolyfaceData.d.ts +13 -3
  94. package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
  95. package/lib/cjs/polyface/PolyfaceData.js +21 -4
  96. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  97. package/lib/cjs/polyface/PolyfaceQuery.d.ts +2 -2
  98. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  99. package/lib/cjs/polyface/PolyfaceQuery.js +4 -3
  100. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  101. package/lib/cjs/serialization/GeometrySamples.d.ts +5 -5
  102. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  103. package/lib/cjs/serialization/GeometrySamples.js +5 -5
  104. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  105. package/lib/cjs/solid/Box.d.ts +9 -3
  106. package/lib/cjs/solid/Box.d.ts.map +1 -1
  107. package/lib/cjs/solid/Box.js +10 -5
  108. package/lib/cjs/solid/Box.js.map +1 -1
  109. package/lib/cjs/solid/Cone.d.ts +3 -2
  110. package/lib/cjs/solid/Cone.d.ts.map +1 -1
  111. package/lib/cjs/solid/Cone.js +3 -3
  112. package/lib/cjs/solid/Cone.js.map +1 -1
  113. package/lib/cjs/solid/LinearSweep.d.ts +9 -3
  114. package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
  115. package/lib/cjs/solid/LinearSweep.js +9 -4
  116. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  117. package/lib/cjs/solid/RotationalSweep.d.ts +15 -4
  118. package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
  119. package/lib/cjs/solid/RotationalSweep.js +20 -7
  120. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  121. package/lib/cjs/solid/RuledSweep.d.ts +35 -26
  122. package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
  123. package/lib/cjs/solid/RuledSweep.js +41 -28
  124. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  125. package/lib/cjs/solid/SolidPrimitive.d.ts +12 -11
  126. package/lib/cjs/solid/SolidPrimitive.d.ts.map +1 -1
  127. package/lib/cjs/solid/SolidPrimitive.js +8 -5
  128. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  129. package/lib/cjs/solid/Sphere.d.ts +17 -7
  130. package/lib/cjs/solid/Sphere.d.ts.map +1 -1
  131. package/lib/cjs/solid/Sphere.js +22 -16
  132. package/lib/cjs/solid/Sphere.js.map +1 -1
  133. package/lib/cjs/solid/SweepContour.d.ts +1 -1
  134. package/lib/cjs/solid/SweepContour.js +1 -1
  135. package/lib/cjs/solid/SweepContour.js.map +1 -1
  136. package/lib/cjs/solid/TorusPipe.d.ts +8 -2
  137. package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
  138. package/lib/cjs/solid/TorusPipe.js +9 -5
  139. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  140. package/lib/esm/bspline/BSplineCurveOps.d.ts.map +1 -1
  141. package/lib/esm/bspline/BSplineCurveOps.js +18 -21
  142. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  143. package/lib/esm/curve/Arc3d.d.ts +30 -7
  144. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  145. package/lib/esm/curve/Arc3d.js +53 -7
  146. package/lib/esm/curve/Arc3d.js.map +1 -1
  147. package/lib/esm/curve/CurveCollection.d.ts +16 -2
  148. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  149. package/lib/esm/curve/CurveCollection.js +33 -2
  150. package/lib/esm/curve/CurveCollection.js.map +1 -1
  151. package/lib/esm/curve/CurveFactory.d.ts +81 -53
  152. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  153. package/lib/esm/curve/CurveFactory.js +190 -103
  154. package/lib/esm/curve/CurveFactory.js.map +1 -1
  155. package/lib/esm/curve/LineString3d.d.ts +12 -8
  156. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  157. package/lib/esm/curve/LineString3d.js +29 -8
  158. package/lib/esm/curve/LineString3d.js.map +1 -1
  159. package/lib/esm/curve/Loop.d.ts +12 -6
  160. package/lib/esm/curve/Loop.d.ts.map +1 -1
  161. package/lib/esm/curve/Loop.js +12 -6
  162. package/lib/esm/curve/Loop.js.map +1 -1
  163. package/lib/esm/curve/Query/CylindricalRange.d.ts +8 -6
  164. package/lib/esm/curve/Query/CylindricalRange.d.ts.map +1 -1
  165. package/lib/esm/curve/Query/CylindricalRange.js +13 -9
  166. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  167. package/lib/esm/curve/StrokeOptions.d.ts +1 -1
  168. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  169. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  170. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  171. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +24 -18
  172. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  173. package/lib/esm/geometry3d/AngleSweep.d.ts +1 -1
  174. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  175. package/lib/esm/geometry3d/AngleSweep.js +1 -1
  176. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  177. package/lib/esm/geometry3d/BarycentricTriangle.d.ts +14 -8
  178. package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  179. package/lib/esm/geometry3d/BarycentricTriangle.js +17 -8
  180. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  181. package/lib/esm/geometry3d/FrameBuilder.js +4 -4
  182. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  183. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts +2 -0
  184. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  185. package/lib/esm/geometry3d/GrowableFloat64Array.js +4 -0
  186. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  187. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +32 -10
  188. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  189. package/lib/esm/geometry3d/GrowableXYZArray.js +54 -16
  190. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  191. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +13 -2
  192. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  193. package/lib/esm/geometry3d/IndexedXYZCollection.js +24 -10
  194. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  195. package/lib/esm/geometry3d/Matrix3d.d.ts +11 -8
  196. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  197. package/lib/esm/geometry3d/Matrix3d.js +28 -26
  198. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  199. package/lib/esm/geometry3d/Point3dArrayCarrier.js +1 -1
  200. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  201. package/lib/esm/geometry3d/Point3dVector3d.d.ts +6 -6
  202. package/lib/esm/geometry3d/Point3dVector3d.js +6 -6
  203. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  204. package/lib/esm/geometry3d/PolygonOps.d.ts +12 -6
  205. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  206. package/lib/esm/geometry3d/PolygonOps.js +94 -47
  207. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  208. package/lib/esm/geometry3d/PolylineOps.d.ts +7 -4
  209. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  210. package/lib/esm/geometry3d/PolylineOps.js +7 -4
  211. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  212. package/lib/esm/geometry4d/MomentData.d.ts +72 -73
  213. package/lib/esm/geometry4d/MomentData.d.ts.map +1 -1
  214. package/lib/esm/geometry4d/MomentData.js +62 -64
  215. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  216. package/lib/esm/numerics/Polynomials.d.ts +5 -5
  217. package/lib/esm/numerics/Polynomials.js +6 -6
  218. package/lib/esm/numerics/Polynomials.js.map +1 -1
  219. package/lib/esm/polyface/AuxData.d.ts +2 -2
  220. package/lib/esm/polyface/AuxData.d.ts.map +1 -1
  221. package/lib/esm/polyface/AuxData.js +11 -3
  222. package/lib/esm/polyface/AuxData.js.map +1 -1
  223. package/lib/esm/polyface/Polyface.d.ts +3 -5
  224. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  225. package/lib/esm/polyface/Polyface.js +6 -13
  226. package/lib/esm/polyface/Polyface.js.map +1 -1
  227. package/lib/esm/polyface/PolyfaceBuilder.d.ts +13 -6
  228. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  229. package/lib/esm/polyface/PolyfaceBuilder.js +65 -38
  230. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  231. package/lib/esm/polyface/PolyfaceData.d.ts +13 -3
  232. package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
  233. package/lib/esm/polyface/PolyfaceData.js +21 -4
  234. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  235. package/lib/esm/polyface/PolyfaceQuery.d.ts +2 -2
  236. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  237. package/lib/esm/polyface/PolyfaceQuery.js +4 -3
  238. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  239. package/lib/esm/serialization/GeometrySamples.d.ts +5 -5
  240. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  241. package/lib/esm/serialization/GeometrySamples.js +5 -5
  242. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  243. package/lib/esm/solid/Box.d.ts +9 -3
  244. package/lib/esm/solid/Box.d.ts.map +1 -1
  245. package/lib/esm/solid/Box.js +10 -5
  246. package/lib/esm/solid/Box.js.map +1 -1
  247. package/lib/esm/solid/Cone.d.ts +3 -2
  248. package/lib/esm/solid/Cone.d.ts.map +1 -1
  249. package/lib/esm/solid/Cone.js +3 -3
  250. package/lib/esm/solid/Cone.js.map +1 -1
  251. package/lib/esm/solid/LinearSweep.d.ts +9 -3
  252. package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
  253. package/lib/esm/solid/LinearSweep.js +9 -4
  254. package/lib/esm/solid/LinearSweep.js.map +1 -1
  255. package/lib/esm/solid/RotationalSweep.d.ts +15 -4
  256. package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
  257. package/lib/esm/solid/RotationalSweep.js +20 -7
  258. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  259. package/lib/esm/solid/RuledSweep.d.ts +35 -26
  260. package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
  261. package/lib/esm/solid/RuledSweep.js +41 -28
  262. package/lib/esm/solid/RuledSweep.js.map +1 -1
  263. package/lib/esm/solid/SolidPrimitive.d.ts +12 -11
  264. package/lib/esm/solid/SolidPrimitive.d.ts.map +1 -1
  265. package/lib/esm/solid/SolidPrimitive.js +8 -5
  266. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  267. package/lib/esm/solid/Sphere.d.ts +17 -7
  268. package/lib/esm/solid/Sphere.d.ts.map +1 -1
  269. package/lib/esm/solid/Sphere.js +22 -16
  270. package/lib/esm/solid/Sphere.js.map +1 -1
  271. package/lib/esm/solid/SweepContour.d.ts +1 -1
  272. package/lib/esm/solid/SweepContour.js +1 -1
  273. package/lib/esm/solid/SweepContour.js.map +1 -1
  274. package/lib/esm/solid/TorusPipe.d.ts +8 -2
  275. package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
  276. package/lib/esm/solid/TorusPipe.js +9 -5
  277. package/lib/esm/solid/TorusPipe.js.map +1 -1
  278. package/package.json +4 -4
@@ -30,6 +30,7 @@ export declare class PolylineOps {
30
30
  * * This is a local search, with a single pass over the data.
31
31
  * @param source input points
32
32
  * @param maxEdgeLength
33
+ * @see [[GrowableXYZArray.cloneCompressed]]
33
34
  */
34
35
  static compressShortEdges(source: Point3d[] | IndexedXYZCollection, maxEdgeLength: number): Point3d[];
35
36
  /**
@@ -77,13 +78,15 @@ export declare class PolylineOps {
77
78
  static removeClosurePoint(data: Point3d[] | Point3d[][]): void;
78
79
  /** Create an array of planes.
79
80
  * * First plane has origin at first centerline point, with unit normal directed at the next point.
80
- * * Intermediate planes have origin at intermediate points, with unit normals computed from the average of unit vectors along the incoming and outgoing segments.
81
+ * * Intermediate planes have origin at intermediate points, with unit normals computed from the average of unit vectors
82
+ * along the incoming and outgoing segments.
81
83
  * * Last plane has origin at last centerline point, with unit normal directed from previous point.
82
84
  * * All sets of adjacent coincident points are reduced to a single point.
83
85
  * * Hence the output array may have fewer points than the centerline.
84
- * * If there are one or fewer distinct input points, the return is undefined
85
- * @param centerline points to reside in output planes
86
- * @param wrapIfPhysicallyClosed if true and the first and last centerline points are the same, then the first and last output planes are averaged and equated (cloned).
86
+ * * If there are one or fewer distinct input points, the return is undefined.
87
+ * @param centerline points to reside in output planes.
88
+ * @param wrapIfPhysicallyClosed if true and the first and last centerline points are the same, then the first and last
89
+ * output planes are averaged and equated (cloned). Default false.
87
90
  */
88
91
  static createBisectorPlanesForDistinctPoints(centerline: IndexedXYZCollection | Point3d[], wrapIfPhysicallyClosed?: boolean): Plane3dByOriginAndUnitNormal[] | undefined;
89
92
  private static _workSegmentA?;
@@ -1 +1 @@
1
- {"version":3,"file":"PolylineOps.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/PolylineOps.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAuC,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC5G,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAKvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,w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ass over the data.
48
48
  * @param source input points
49
49
  * @param maxEdgeLength
50
+ * @see [[GrowableXYZArray.cloneCompressed]]
50
51
  */
51
52
  static compressShortEdges(source, maxEdgeLength) {
52
53
  const dest = GrowableXYZArray.create(source);
@@ -218,13 +219,15 @@ export class PolylineOps {
218
219
  }
219
220
  /** Create an array of planes.
220
221
  * * First plane has origin at first centerline point, with unit normal directed at the next point.
221
- * * Intermediate planes have origin at intermediate points, with unit normals computed from the average of unit vectors along the incoming and outgoing segments.
222
+ * * Intermediate planes have origin at intermediate points, with unit normals computed from the average of unit vectors
223
+ * along the incoming and outgoing segments.
222
224
  * * Last plane has origin at last centerline point, with unit normal directed from previous point.
223
225
  * * All sets of adjacent coincident points are reduced to a single point.
224
226
  * * Hence the output array may have fewer points than the centerline.
225
- * * If there are one or fewer distinct input points, the return is undefined
226
- * @param centerline points to reside in output planes
227
- * @param wrapIfPhysicallyClosed if true and the first and last centerline points are the same, then the first and last output planes are averaged and equated (cloned).
227
+ * * If there are one or fewer distinct input points, the return is undefined.
228
+ * @param centerline points to reside in output planes.
229
+ * @param wrapIfPhysicallyClosed if true and the first and last centerline points are the same, then the first and last
230
+ * output planes are averaged and equated (cloned). Default false.
228
231
  */
229
232
  static createBisectorPlanesForDistinctPoints(centerline, wrapIfPhysicallyClosed = false) {
230
233
  const packedPoints = PolylineOps.compressShortEdges(centerline, 2.0 * Geometry.smallMetricDistance); // double the tolerance to ensure normalized vectors exist.
@@ -1 +1 @@
1
- {"version":3,"file":"PolylineOps.js","sourceRoot":"","sources":["../../../src/geometry3d/PolylineOps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAA+B,MAAM,0BAA0B,CAAC;AAE5G,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,aA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AAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,4BAA4B;wBAC9E,YAAY,CAAC,0BAA0B,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;wBACtG,YAAY,CAAC,0BAA0B,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;wBACtG,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW;4BAC1D,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,uCAAuC;wBAC1H,IAAI,GAAG,CAAC,CAAC;wBACT,QAAQ,GAAG,IAAI,CAAC;oBAClB,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACvC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { CurveExtendMode, CurveExtendOptions, VariantCurveExtendParameter } from \"../curve/CurveExtendMode\";\r\nimport { CurveLocationDetailPair } from \"../curve/CurveLocationDetail\";\r\nimport { LineSegment3d } from \"../curve/LineSegment3d\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GrowableXYZArray } from \"./GrowableXYZArray\";\r\nimport { IndexedXYZCollection } from \"./IndexedXYZCollection\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"./Plane3dByOriginAndUnitNormal\";\r\nimport { Point3dArrayCarrier } from \"./Point3dArrayCarrier\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { PolylineCompressionContext } from \"./PolylineCompressionByEdgeOffset\";\r\nimport { Range1d } from \"./Range\";\r\n\r\n// cspell:word Puecker\r\n/**\r\n * PolylineOps is a collection of static methods operating on polylines.\r\n * @public\r\n */\r\nexport class PolylineOps {\r\n /**\r\n * Return a Range1d with the shortest and longest edge lengths of the polyline.\r\n * @param points points to examine.\r\n */\r\n public static edgeLengthRange(points: Point3d[]): Range1d {\r\n const range = Range1d.createNull();\r\n for (let i = 1; i < points.length; i++) {\r\n range.extendX(points[i - 1].distance(points[i]));\r\n }\r\n return range;\r\n }\r\n /**\r\n * Return a simplified subset of given points.\r\n * * Points are removed by the Douglas-Puecker algorithm, viz https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm\r\n * * This is a global search, with multiple passes over the data.\r\n * @param source\r\n * @param chordTolerance\r\n */\r\n public static compressByChordError(source: Point3d[], chordTolerance: number): Point3d[] {\r\n return PolylineCompressionContext.compressPoint3dArrayByChordError(source, chordTolerance);\r\n }\r\n /**\r\n * Return a simplified subset of given points, omitting points if very close to their neighbors.\r\n * * This is a local search, with a single pass over the data.\r\n * @param source input points\r\n * @param maxEdgeLength\r\n */\r\n public static compressShortEdges(source: Point3d[] | IndexedXYZCollection, maxEdgeLength: number): Point3d[] {\r\n const dest = GrowableXYZArray.create(source);\r\n PolylineCompressionContext.compressInPlaceByShortEdgeLength(dest, maxEdgeLength);\r\n return dest.getPoint3dArray();\r\n }\r\n /**\r\n * Return a simplified subset of given points, omitting points of the triangle with adjacent points is small.\r\n * * This is a local search, with a single pass over the data.\r\n * @param source input points\r\n * @param maxEdgeLength\r\n */\r\n public static compressSmallTriangles(source: Point3d[], maxTriangleArea: number): Point3d[] {\r\n const dest = GrowableXYZArray.create(source);\r\n PolylineCompressionContext.compressInPlaceBySmallTriangleArea(dest, maxTriangleArea);\r\n return dest.getPoint3dArray();\r\n }\r\n\r\n /**\r\n * Return a simplified subset of given points, omitting points if close to the edge between neighboring points before and after\r\n * * This is a local search, with a single pass over the data for each pass.\r\n * @param source input points\r\n * @param maxDistance omit points if this close to edge between points before and after\r\n * @param numPass max number of times to run the filter. numPass=2 is observed to behave well.\r\n *\r\n */\r\n public static compressByPerpendicularDistance(source: Point3d[], maxDistance: number, numPass: number = 2): Point3d[] {\r\n const dest = GrowableXYZArray.create(source);\r\n let num0 = dest.length;\r\n for (let pass = 0; pass < numPass; pass++) {\r\n PolylineCompressionContext.compressInPlaceByPerpendicularDistance(dest, maxDistance);\r\n const num1 = dest.length;\r\n if (num1 === num0)\r\n break;\r\n num0 = num1;\r\n }\r\n return dest.getPoint3dArray();\r\n }\r\n private static squaredDistanceToInterpolatedPoint(pointQ: Point3d, point0: Point3d, fraction: number, point1: Point3d): number {\r\n const g = 1.0 - fraction;\r\n const dx = pointQ.x - (g * point0.x + fraction * point1.x);\r\n const dy = pointQ.y - (g * point0.y + fraction * point1.y);\r\n const dz = pointQ.z - (g * point0.z + fraction * point1.z);\r\n return dx * dx + dy * dy + dz * dz;\r\n }\r\n /**\r\n * test if either\r\n * * points[indexA] matches pointQ\r\n * * line from points[indexA] to points[indexB] overlaps points[indexA] to pointQ\r\n * @param points\r\n * @param pointQ\r\n * @param tolerance\r\n */\r\n private static isDanglerConfiguration(points: Point3d[], indexA: number, indexB: number, pointQ: Point3d, squaredDistanceTolerance: number): boolean {\r\n if (indexA < 0 || indexA >= points.length)\r\n return false;\r\n const pointA = points[indexA];\r\n // simple point match ...\r\n const d2Q = pointA.distanceSquared(pointQ);\r\n if (d2Q <= squaredDistanceTolerance)\r\n return true;\r\n if (indexB < 0 || indexB >= points.length)\r\n return false;\r\n const pointB = points[indexB];\r\n // The expensive test .. does newPoint double back to an interior or extrapolation of the final dest segment?\r\n //\r\n // or pointQ\r\n const dot = pointA.dotVectorsToTargets(pointB, pointQ);\r\n // simple case -- pointB..pointA..pointQ continues forward\r\n if (dot <= 0.0)\r\n return false;\r\n const d2B = pointA.distanceSquared(pointB);\r\n let distanceSquared;\r\n if (d2Q >= d2B) {\r\n // pointB----------------------------------->>>>>>> pointA\r\n // pointQ<<<<---------------------------------------------------------\r\n const fraction = dot / d2Q; // safe to divide because of earlier d2Q test.\r\n distanceSquared = this.squaredDistanceToInterpolatedPoint(pointB, pointA, fraction, pointQ);\r\n } else {\r\n // pointB----------------------------------->>>>>>> pointA\r\n // pointQ<<<<----------------------\r\n const fraction = dot / d2B;\r\n distanceSquared = this.squaredDistanceToInterpolatedPoint(pointQ, pointA, fraction, pointB);\r\n }\r\n return distanceSquared < squaredDistanceTolerance;\r\n }\r\n /**\r\n * Return a simplified subset of given points, omitting points on \"danglers\" that depart and return on a single path.\r\n * @param source input points\r\n * @param closed if true, an edge returning to point 0 is implied even if final point does not match.\r\n * @param tolerance tolerance for near-zero distance.\r\n */\r\n public static compressDanglers(source: Point3d[], closed: boolean = false, tolerance: number = Geometry.smallMetricDistance): Point3d[] {\r\n let n = source.length;\r\n const squaredDistanceTolerance = tolerance * tolerance;\r\n if (closed)\r\n while (n > 1 && source[n - 1].distanceSquared(source[0]) <= squaredDistanceTolerance)\r\n n--;\r\n const dest = [];\r\n dest.push(source[0].clone());\r\n for (let i = 1; i < n; i++) {\r\n const newPoint = source[i];\r\n while (this.isDanglerConfiguration(dest, dest.length - 1, dest.length - 2, newPoint, squaredDistanceTolerance))\r\n dest.pop();\r\n dest.push(newPoint.clone());\r\n }\r\n if (closed) {\r\n // No purge moving backwards. Last point\r\n let leftIndex = 0;\r\n let rightIndex = dest.length - 1;\r\n while (rightIndex > leftIndex + 2) {\r\n if (this.isDanglerConfiguration(dest, leftIndex, leftIndex + 1, dest[rightIndex], squaredDistanceTolerance)) {\r\n leftIndex++;\r\n } else if (this.isDanglerConfiguration(dest, rightIndex, rightIndex - 1, dest[leftIndex], squaredDistanceTolerance)) {\r\n rightIndex--;\r\n } else {\r\n break;\r\n }\r\n }\r\n if (rightIndex + 1 < dest.length)\r\n dest.length = rightIndex + 1;\r\n if (leftIndex > 0) {\r\n dest.splice(0, leftIndex);\r\n }\r\n }\r\n return dest;\r\n }\r\n /**\r\n * Add closure points to a polyline or array of polylines\r\n * @param data points.\r\n */\r\n public static addClosurePoint(data: Point3d[] | Point3d[][]) {\r\n if (data.length === 0)\r\n return;\r\n const q0 = data[0];\r\n if (Array.isArray(q0)) {\r\n for (const child of data) {\r\n if (Array.isArray(child))\r\n this.addClosurePoint(child);\r\n }\r\n return;\r\n }\r\n const q1 = data[data.length - 1];\r\n if (q0 instanceof Point3d && q1 instanceof Point3d && !q0.isAlmostEqual(q1)) {\r\n (data as Point3d[]).push(q0.clone());\r\n }\r\n }\r\n /**\r\n * Remove closure points of a polyline or array of polylines\r\n * @param data points.\r\n */\r\n public static removeClosurePoint(data: Point3d[] | Point3d[][]) {\r\n if (data.length === 0)\r\n return;\r\n const q0 = data[0];\r\n if (Array.isArray(q0)) {\r\n for (const child of data) {\r\n if (Array.isArray(child))\r\n this.removeClosurePoint(child);\r\n }\r\n return;\r\n }\r\n const q1 = data[data.length - 1];\r\n if (q0 instanceof Point3d && q1 instanceof Point3d && q0.isAlmostEqual(q1)) {\r\n (data as Point3d[]).pop();\r\n }\r\n }\r\n /** Create an array of planes.\r\n * * First plane has origin at first centerline point, with unit normal directed at the next point.\r\n * * Intermediate planes have origin at intermediate points, with unit normals computed from the average of unit vectors along the incoming and outgoing segments.\r\n * * Last plane has origin at last centerline point, with unit normal directed from previous point.\r\n * * All sets of adjacent coincident points are reduced to a single point.\r\n * * Hence the output array may have fewer points than the centerline.\r\n * * If there are one or fewer distinct input points, the return is undefined\r\n * @param centerline points to reside in output planes\r\n * @param wrapIfPhysicallyClosed if true and the first and last centerline points are the same, then the first and last output planes are averaged and equated (cloned).\r\n */\r\n public static createBisectorPlanesForDistinctPoints(centerline: IndexedXYZCollection | Point3d[], wrapIfPhysicallyClosed: boolean = false): Plane3dByOriginAndUnitNormal[] | undefined {\r\n const packedPoints = PolylineOps.compressShortEdges(centerline, 2.0 * Geometry.smallMetricDistance); // double the tolerance to ensure normalized vectors exist.\r\n if (packedPoints.length < 2)\r\n return undefined;\r\n const bisectorPlanes: Plane3dByOriginAndUnitNormal[] = [];\r\n const point0 = packedPoints[0];\r\n const point1 = packedPoints[1];\r\n const unit01 = Vector3d.createNormalizedStartEnd(point0, point1)!;\r\n const perpendicular0 = Plane3dByOriginAndUnitNormal.create(point0, unit01)!;\r\n const perpendicular1 = Plane3dByOriginAndUnitNormal.createXYPlane();\r\n // FIRST point gets simple perpendicular\r\n bisectorPlanes.push(perpendicular0.clone());\r\n // Each intermediate point gets average of adjacent perpendiculars\r\n for (let i = 1; i + 1 < packedPoints.length; i++) {\r\n Vector3d.createNormalizedStartEnd(packedPoints[i], packedPoints[i + 1], unit01);\r\n // remark: the prior pack should ensure the normalization is ok. But if it fails, we ignore this point...\r\n if (undefined !== Plane3dByOriginAndUnitNormal.create(packedPoints[i], unit01, perpendicular1)) {\r\n const newBisectorNormal = perpendicular0.getNormalRef().interpolate(0.5, perpendicular1.getNormalRef());\r\n const newBisectorPlane = Plane3dByOriginAndUnitNormal.create(packedPoints[i], newBisectorNormal);\r\n if (undefined !== newBisectorPlane)\r\n bisectorPlanes.push(newBisectorPlane);\r\n perpendicular0.setFrom(perpendicular1);\r\n }\r\n }\r\n // LAST point gets simple perpendicular inherited from last pass\r\n bisectorPlanes.push(Plane3dByOriginAndUnitNormal.create(packedPoints[packedPoints.length - 1], perpendicular0.getNormalRef())!);\r\n // reset end planes to their average plane, but leave them alone if the closure point is a cusp\r\n const lastIndex = bisectorPlanes.length - 1;\r\n if (lastIndex > 0 && wrapIfPhysicallyClosed) {\r\n const firstPlane = bisectorPlanes[0];\r\n const lastPlane = bisectorPlanes[lastIndex];\r\n if (Geometry.isSamePoint3d(firstPlane.getOriginRef(), lastPlane.getOriginRef())) {\r\n const newBisectorNormal = firstPlane.getNormalRef().plus(lastPlane.getNormalRef()); // could be zero vector at a cusp\r\n const newBisectorPlane = Plane3dByOriginAndUnitNormal.create(firstPlane.getOriginRef(), newBisectorNormal);\r\n if (undefined !== newBisectorPlane) {\r\n bisectorPlanes[0] = newBisectorPlane;\r\n bisectorPlanes[lastIndex] = Plane3dByOriginAndUnitNormal.create(lastPlane.getOriginRef(), newBisectorNormal)!;\r\n }\r\n }\r\n }\r\n return bisectorPlanes.length > 1 ? bisectorPlanes : undefined;\r\n }\r\n\r\n private static _workSegmentA?: LineSegment3d;\r\n private static _workSegmentB?: LineSegment3d;\r\n private static _workLocalDetailPair?: CurveLocationDetailPair;\r\n /**\r\n * Find smallest distance between polylines.\r\n * * For polylines with many points, it is more efficient to use [[LineString3dRangeTreeContext.searchForClosestApproach]].\r\n * @param pointsA first polyline\r\n * @param extendA how to extend polylineA forward/backward\r\n * @param pointsB second polyline\r\n * @param extendB how to extend polylineB forward/backward\r\n * @param dMax largest approach distance to consider\r\n * @param result optional pre-allocated object to populate and return\r\n * @returns pair of details, one for each polyline, with field values:\r\n * * `a` is the closest approach distance\r\n * * `point` is the point of closest approach\r\n * * `fraction` is the global polyline fraction\r\n * * `childDetail.a` is the segment index\r\n * * `childDetail.fraction` is the local segment fraction\r\n */\r\n public static closestApproach(\r\n pointsA: Point3d[] | IndexedXYZCollection,\r\n extendA: VariantCurveExtendParameter,\r\n pointsB: Point3d[] | IndexedXYZCollection,\r\n extendB: VariantCurveExtendParameter,\r\n dMax: number = Number.MAX_VALUE,\r\n result?: CurveLocationDetailPair,\r\n ): CurveLocationDetailPair | undefined {\r\n if (Array.isArray(pointsA))\r\n pointsA = new Point3dArrayCarrier(pointsA);\r\n if (Array.isArray(pointsB))\r\n pointsB = new Point3dArrayCarrier(pointsB);\r\n let dMin = dMax;\r\n let foundMin = false;\r\n const numSegmentA = pointsA.length - 1;\r\n const numSegmentB = pointsB.length - 1;\r\n const extendSegA = [CurveExtendMode.None, CurveExtendMode.None];\r\n const extendSegB = [CurveExtendMode.None, CurveExtendMode.None];\r\n // lambda to set extension for first and last segment of a polyline\r\n const convertExtend = (extendOut: CurveExtendMode[], extendIn: VariantCurveExtendParameter, segmentIndex: number, numSegments: number) => {\r\n extendOut[0] = extendOut[1] = CurveExtendMode.None;\r\n if (segmentIndex === 0)\r\n extendOut[0] = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendIn, 0);\r\n else if (segmentIndex === numSegments - 1)\r\n extendOut[1] = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendIn, 1);\r\n };\r\n // lambda to extract LineSegment3d from polyline\r\n const fillSegment = (points: IndexedXYZCollection, index: number, segment: LineSegment3d | undefined): LineSegment3d => {\r\n if (segment === undefined)\r\n return LineSegment3d.createCapture(points.getPoint3dAtUncheckedPointIndex(index), points.getPoint3dAtUncheckedPointIndex(index + 1));\r\n points.getPoint3dAtUncheckedPointIndex(index, segment.point0Ref);\r\n points.getPoint3dAtUncheckedPointIndex(index + 1, segment.point1Ref);\r\n return segment;\r\n };\r\n // just test the segments\r\n for (let indexA = 0; indexA < numSegmentA; indexA++) {\r\n this._workSegmentA = fillSegment(pointsA, indexA, this._workSegmentA);\r\n convertExtend(extendSegA, extendA, indexA, numSegmentA);\r\n for (let indexB = 0; indexB < numSegmentB; indexB++) {\r\n this._workSegmentB = fillSegment(pointsB, indexB, this._workSegmentB);\r\n convertExtend(extendSegB, extendB, indexB, numSegmentB);\r\n if (undefined !== (this._workLocalDetailPair = LineSegment3d.closestApproach(this._workSegmentA, extendSegA, this._workSegmentB, extendSegB, this._workLocalDetailPair))) {\r\n const d = this._workLocalDetailPair.detailA.a;\r\n if (d < dMin) {\r\n const childDetailA = result?.detailA.childDetail; // save and reuse\r\n const childDetailB = result?.detailB.childDetail;\r\n result = this._workLocalDetailPair.clone(result); // overwrite previous result\r\n LineString3d.convertLocalToGlobalDetail(result.detailA, indexA, numSegmentA, undefined, childDetailA);\r\n LineString3d.convertLocalToGlobalDetail(result.detailB, indexB, numSegmentB, undefined, childDetailB);\r\n if (result.detailA.childDetail && result.detailB.childDetail)\r\n result.detailA.childDetail.curve = result.detailB.childDetail.curve = undefined; // no CurvePrimitives survive in output\r\n dMin = d;\r\n foundMin = true;\r\n }\r\n }\r\n }\r\n }\r\n return foundMin ? result : undefined;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"PolylineOps.js","sourceRoot":"","sources":["../../../src/geometry3d/PolylineOps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAA+B,MAAM,0BAA0B,CAAC;AAE5G,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,sBAAsB;AACtB;;;GAGG;AACH,MAAM,OAAO,WAAW;IACtB;;;OAGG;IACI,MAAM,CAAC,eAAe,CAAC,MAAiB;QAC7C,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;Q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------------------------------------------------------------------------\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 CartesianGeometry\r\n */\r\n\r\nimport { CurveExtendMode, CurveExtendOptions, VariantCurveExtendParameter } from \"../curve/CurveExtendMode\";\r\nimport { CurveLocationDetailPair } from \"../curve/CurveLocationDetail\";\r\nimport { LineSegment3d } from \"../curve/LineSegment3d\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GrowableXYZArray } from \"./GrowableXYZArray\";\r\nimport { IndexedXYZCollection } from \"./IndexedXYZCollection\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"./Plane3dByOriginAndUnitNormal\";\r\nimport { Point3dArrayCarrier } from \"./Point3dArrayCarrier\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { PolylineCompressionContext } from \"./PolylineCompressionByEdgeOffset\";\r\nimport { Range1d } from \"./Range\";\r\n\r\n// cspell:word Puecker\r\n/**\r\n * PolylineOps is a collection of static methods operating on polylines.\r\n * @public\r\n */\r\nexport class PolylineOps {\r\n /**\r\n * Return a Range1d with the shortest and longest edge lengths of the polyline.\r\n * @param points points to examine.\r\n */\r\n public static edgeLengthRange(points: Point3d[]): Range1d {\r\n const range = Range1d.createNull();\r\n for (let i = 1; i < points.length; i++) {\r\n range.extendX(points[i - 1].distance(points[i]));\r\n }\r\n return range;\r\n }\r\n /**\r\n * Return a simplified subset of given points.\r\n * * Points are removed by the Douglas-Puecker algorithm, viz https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm\r\n * * This is a global search, with multiple passes over the data.\r\n * @param source\r\n * @param chordTolerance\r\n */\r\n public static compressByChordError(source: Point3d[], chordTolerance: number): Point3d[] {\r\n return PolylineCompressionContext.compressPoint3dArrayByChordError(source, chordTolerance);\r\n }\r\n /**\r\n * Return a simplified subset of given points, omitting points if very close to their neighbors.\r\n * * This is a local search, with a single pass over the data.\r\n * @param source input points\r\n * @param maxEdgeLength\r\n * @see [[GrowableXYZArray.cloneCompressed]]\r\n */\r\n public static compressShortEdges(source: Point3d[] | IndexedXYZCollection, maxEdgeLength: number): Point3d[] {\r\n const dest = GrowableXYZArray.create(source);\r\n PolylineCompressionContext.compressInPlaceByShortEdgeLength(dest, maxEdgeLength);\r\n return dest.getPoint3dArray();\r\n }\r\n /**\r\n * Return a simplified subset of given points, omitting points of the triangle with adjacent points is small.\r\n * * This is a local search, with a single pass over the data.\r\n * @param source input points\r\n * @param maxEdgeLength\r\n */\r\n public static compressSmallTriangles(source: Point3d[], maxTriangleArea: number): Point3d[] {\r\n const dest = GrowableXYZArray.create(source);\r\n PolylineCompressionContext.compressInPlaceBySmallTriangleArea(dest, maxTriangleArea);\r\n return dest.getPoint3dArray();\r\n }\r\n\r\n /**\r\n * Return a simplified subset of given points, omitting points if close to the edge between neighboring points before and after\r\n * * This is a local search, with a single pass over the data for each pass.\r\n * @param source input points\r\n * @param maxDistance omit points if this close to edge between points before and after\r\n * @param numPass max number of times to run the filter. numPass=2 is observed to behave well.\r\n *\r\n */\r\n public static compressByPerpendicularDistance(source: Point3d[], maxDistance: number, numPass: number = 2): Point3d[] {\r\n const dest = GrowableXYZArray.create(source);\r\n let num0 = dest.length;\r\n for (let pass = 0; pass < numPass; pass++) {\r\n PolylineCompressionContext.compressInPlaceByPerpendicularDistance(dest, maxDistance);\r\n const num1 = dest.length;\r\n if (num1 === num0)\r\n break;\r\n num0 = num1;\r\n }\r\n return dest.getPoint3dArray();\r\n }\r\n private static squaredDistanceToInterpolatedPoint(pointQ: Point3d, point0: Point3d, fraction: number, point1: Point3d): number {\r\n const g = 1.0 - fraction;\r\n const dx = pointQ.x - (g * point0.x + fraction * point1.x);\r\n const dy = pointQ.y - (g * point0.y + fraction * point1.y);\r\n const dz = pointQ.z - (g * point0.z + fraction * point1.z);\r\n return dx * dx + dy * dy + dz * dz;\r\n }\r\n /**\r\n * test if either\r\n * * points[indexA] matches pointQ\r\n * * line from points[indexA] to points[indexB] overlaps points[indexA] to pointQ\r\n * @param points\r\n * @param pointQ\r\n * @param tolerance\r\n */\r\n private static isDanglerConfiguration(points: Point3d[], indexA: number, indexB: number, pointQ: Point3d, squaredDistanceTolerance: number): boolean {\r\n if (indexA < 0 || indexA >= points.length)\r\n return false;\r\n const pointA = points[indexA];\r\n // simple point match ...\r\n const d2Q = pointA.distanceSquared(pointQ);\r\n if (d2Q <= squaredDistanceTolerance)\r\n return true;\r\n if (indexB < 0 || indexB >= points.length)\r\n return false;\r\n const pointB = points[indexB];\r\n // The expensive test .. does newPoint double back to an interior or extrapolation of the final dest segment?\r\n //\r\n // or pointQ\r\n const dot = pointA.dotVectorsToTargets(pointB, pointQ);\r\n // simple case -- pointB..pointA..pointQ continues forward\r\n if (dot <= 0.0)\r\n return false;\r\n const d2B = pointA.distanceSquared(pointB);\r\n let distanceSquared;\r\n if (d2Q >= d2B) {\r\n // pointB----------------------------------->>>>>>> pointA\r\n // pointQ<<<<---------------------------------------------------------\r\n const fraction = dot / d2Q; // safe to divide because of earlier d2Q test.\r\n distanceSquared = this.squaredDistanceToInterpolatedPoint(pointB, pointA, fraction, pointQ);\r\n } else {\r\n // pointB----------------------------------->>>>>>> pointA\r\n // pointQ<<<<----------------------\r\n const fraction = dot / d2B;\r\n distanceSquared = this.squaredDistanceToInterpolatedPoint(pointQ, pointA, fraction, pointB);\r\n }\r\n return distanceSquared < squaredDistanceTolerance;\r\n }\r\n /**\r\n * Return a simplified subset of given points, omitting points on \"danglers\" that depart and return on a single path.\r\n * @param source input points\r\n * @param closed if true, an edge returning to point 0 is implied even if final point does not match.\r\n * @param tolerance tolerance for near-zero distance.\r\n */\r\n public static compressDanglers(source: Point3d[], closed: boolean = false, tolerance: number = Geometry.smallMetricDistance): Point3d[] {\r\n let n = source.length;\r\n const squaredDistanceTolerance = tolerance * tolerance;\r\n if (closed)\r\n while (n > 1 && source[n - 1].distanceSquared(source[0]) <= squaredDistanceTolerance)\r\n n--;\r\n const dest = [];\r\n dest.push(source[0].clone());\r\n for (let i = 1; i < n; i++) {\r\n const newPoint = source[i];\r\n while (this.isDanglerConfiguration(dest, dest.length - 1, dest.length - 2, newPoint, squaredDistanceTolerance))\r\n dest.pop();\r\n dest.push(newPoint.clone());\r\n }\r\n if (closed) {\r\n // No purge moving backwards. Last point\r\n let leftIndex = 0;\r\n let rightIndex = dest.length - 1;\r\n while (rightIndex > leftIndex + 2) {\r\n if (this.isDanglerConfiguration(dest, leftIndex, leftIndex + 1, dest[rightIndex], squaredDistanceTolerance)) {\r\n leftIndex++;\r\n } else if (this.isDanglerConfiguration(dest, rightIndex, rightIndex - 1, dest[leftIndex], squaredDistanceTolerance)) {\r\n rightIndex--;\r\n } else {\r\n break;\r\n }\r\n }\r\n if (rightIndex + 1 < dest.length)\r\n dest.length = rightIndex + 1;\r\n if (leftIndex > 0) {\r\n dest.splice(0, leftIndex);\r\n }\r\n }\r\n return dest;\r\n }\r\n /**\r\n * Add closure points to a polyline or array of polylines\r\n * @param data points.\r\n */\r\n public static addClosurePoint(data: Point3d[] | Point3d[][]) {\r\n if (data.length === 0)\r\n return;\r\n const q0 = data[0];\r\n if (Array.isArray(q0)) {\r\n for (const child of data) {\r\n if (Array.isArray(child))\r\n this.addClosurePoint(child);\r\n }\r\n return;\r\n }\r\n const q1 = data[data.length - 1];\r\n if (q0 instanceof Point3d && q1 instanceof Point3d && !q0.isAlmostEqual(q1)) {\r\n (data as Point3d[]).push(q0.clone());\r\n }\r\n }\r\n /**\r\n * Remove closure points of a polyline or array of polylines\r\n * @param data points.\r\n */\r\n public static removeClosurePoint(data: Point3d[] | Point3d[][]) {\r\n if (data.length === 0)\r\n return;\r\n const q0 = data[0];\r\n if (Array.isArray(q0)) {\r\n for (const child of data) {\r\n if (Array.isArray(child))\r\n this.removeClosurePoint(child);\r\n }\r\n return;\r\n }\r\n const q1 = data[data.length - 1];\r\n if (q0 instanceof Point3d && q1 instanceof Point3d && q0.isAlmostEqual(q1)) {\r\n (data as Point3d[]).pop();\r\n }\r\n }\r\n /** Create an array of planes.\r\n * * First plane has origin at first centerline point, with unit normal directed at the next point.\r\n * * Intermediate planes have origin at intermediate points, with unit normals computed from the average of unit vectors\r\n * along the incoming and outgoing segments.\r\n * * Last plane has origin at last centerline point, with unit normal directed from previous point.\r\n * * All sets of adjacent coincident points are reduced to a single point.\r\n * * Hence the output array may have fewer points than the centerline.\r\n * * If there are one or fewer distinct input points, the return is undefined.\r\n * @param centerline points to reside in output planes.\r\n * @param wrapIfPhysicallyClosed if true and the first and last centerline points are the same, then the first and last\r\n * output planes are averaged and equated (cloned). Default false.\r\n */\r\n public static createBisectorPlanesForDistinctPoints(\r\n centerline: IndexedXYZCollection | Point3d[], wrapIfPhysicallyClosed: boolean = false,\r\n ): Plane3dByOriginAndUnitNormal[] | undefined {\r\n const packedPoints = PolylineOps.compressShortEdges(centerline, 2.0 * Geometry.smallMetricDistance); // double the tolerance to ensure normalized vectors exist.\r\n if (packedPoints.length < 2)\r\n return undefined;\r\n const bisectorPlanes: Plane3dByOriginAndUnitNormal[] = [];\r\n const point0 = packedPoints[0];\r\n const point1 = packedPoints[1];\r\n const unit01 = Vector3d.createNormalizedStartEnd(point0, point1)!;\r\n const perpendicular0 = Plane3dByOriginAndUnitNormal.create(point0, unit01)!;\r\n const perpendicular1 = Plane3dByOriginAndUnitNormal.createXYPlane();\r\n // FIRST point gets simple perpendicular\r\n bisectorPlanes.push(perpendicular0.clone());\r\n // Each intermediate point gets average of adjacent perpendiculars\r\n for (let i = 1; i + 1 < packedPoints.length; i++) {\r\n Vector3d.createNormalizedStartEnd(packedPoints[i], packedPoints[i + 1], unit01);\r\n // remark: the prior pack should ensure the normalization is ok. But if it fails, we ignore this point...\r\n if (undefined !== Plane3dByOriginAndUnitNormal.create(packedPoints[i], unit01, perpendicular1)) {\r\n const newBisectorNormal = perpendicular0.getNormalRef().interpolate(0.5, perpendicular1.getNormalRef());\r\n const newBisectorPlane = Plane3dByOriginAndUnitNormal.create(packedPoints[i], newBisectorNormal);\r\n if (undefined !== newBisectorPlane)\r\n bisectorPlanes.push(newBisectorPlane);\r\n perpendicular0.setFrom(perpendicular1);\r\n }\r\n }\r\n // LAST point gets simple perpendicular inherited from last pass\r\n bisectorPlanes.push(Plane3dByOriginAndUnitNormal.create(packedPoints[packedPoints.length - 1], perpendicular0.getNormalRef())!);\r\n // reset end planes to their average plane, but leave them alone if the closure point is a cusp\r\n const lastIndex = bisectorPlanes.length - 1;\r\n if (lastIndex > 0 && wrapIfPhysicallyClosed) {\r\n const firstPlane = bisectorPlanes[0];\r\n const lastPlane = bisectorPlanes[lastIndex];\r\n if (Geometry.isSamePoint3d(firstPlane.getOriginRef(), lastPlane.getOriginRef())) {\r\n const newBisectorNormal = firstPlane.getNormalRef().plus(lastPlane.getNormalRef()); // could be zero vector at a cusp\r\n const newBisectorPlane = Plane3dByOriginAndUnitNormal.create(firstPlane.getOriginRef(), newBisectorNormal);\r\n if (undefined !== newBisectorPlane) {\r\n bisectorPlanes[0] = newBisectorPlane;\r\n bisectorPlanes[lastIndex] = Plane3dByOriginAndUnitNormal.create(lastPlane.getOriginRef(), newBisectorNormal)!;\r\n }\r\n }\r\n }\r\n return bisectorPlanes.length > 1 ? bisectorPlanes : undefined;\r\n }\r\n\r\n private static _workSegmentA?: LineSegment3d;\r\n private static _workSegmentB?: LineSegment3d;\r\n private static _workLocalDetailPair?: CurveLocationDetailPair;\r\n /**\r\n * Find smallest distance between polylines.\r\n * * For polylines with many points, it is more efficient to use [[LineString3dRangeTreeContext.searchForClosestApproach]].\r\n * @param pointsA first polyline\r\n * @param extendA how to extend polylineA forward/backward\r\n * @param pointsB second polyline\r\n * @param extendB how to extend polylineB forward/backward\r\n * @param dMax largest approach distance to consider\r\n * @param result optional pre-allocated object to populate and return\r\n * @returns pair of details, one for each polyline, with field values:\r\n * * `a` is the closest approach distance\r\n * * `point` is the point of closest approach\r\n * * `fraction` is the global polyline fraction\r\n * * `childDetail.a` is the segment index\r\n * * `childDetail.fraction` is the local segment fraction\r\n */\r\n public static closestApproach(\r\n pointsA: Point3d[] | IndexedXYZCollection,\r\n extendA: VariantCurveExtendParameter,\r\n pointsB: Point3d[] | IndexedXYZCollection,\r\n extendB: VariantCurveExtendParameter,\r\n dMax: number = Number.MAX_VALUE,\r\n result?: CurveLocationDetailPair,\r\n ): CurveLocationDetailPair | undefined {\r\n if (Array.isArray(pointsA))\r\n pointsA = new Point3dArrayCarrier(pointsA);\r\n if (Array.isArray(pointsB))\r\n pointsB = new Point3dArrayCarrier(pointsB);\r\n let dMin = dMax;\r\n let foundMin = false;\r\n const numSegmentA = pointsA.length - 1;\r\n const numSegmentB = pointsB.length - 1;\r\n const extendSegA = [CurveExtendMode.None, CurveExtendMode.None];\r\n const extendSegB = [CurveExtendMode.None, CurveExtendMode.None];\r\n // lambda to set extension for first and last segment of a polyline\r\n const convertExtend = (extendOut: CurveExtendMode[], extendIn: VariantCurveExtendParameter, segmentIndex: number, numSegments: number) => {\r\n extendOut[0] = extendOut[1] = CurveExtendMode.None;\r\n if (segmentIndex === 0)\r\n extendOut[0] = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendIn, 0);\r\n else if (segmentIndex === numSegments - 1)\r\n extendOut[1] = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendIn, 1);\r\n };\r\n // lambda to extract LineSegment3d from polyline\r\n const fillSegment = (points: IndexedXYZCollection, index: number, segment: LineSegment3d | undefined): LineSegment3d => {\r\n if (segment === undefined)\r\n return LineSegment3d.createCapture(points.getPoint3dAtUncheckedPointIndex(index), points.getPoint3dAtUncheckedPointIndex(index + 1));\r\n points.getPoint3dAtUncheckedPointIndex(index, segment.point0Ref);\r\n points.getPoint3dAtUncheckedPointIndex(index + 1, segment.point1Ref);\r\n return segment;\r\n };\r\n // just test the segments\r\n for (let indexA = 0; indexA < numSegmentA; indexA++) {\r\n this._workSegmentA = fillSegment(pointsA, indexA, this._workSegmentA);\r\n convertExtend(extendSegA, extendA, indexA, numSegmentA);\r\n for (let indexB = 0; indexB < numSegmentB; indexB++) {\r\n this._workSegmentB = fillSegment(pointsB, indexB, this._workSegmentB);\r\n convertExtend(extendSegB, extendB, indexB, numSegmentB);\r\n if (undefined !== (this._workLocalDetailPair = LineSegment3d.closestApproach(this._workSegmentA, extendSegA, this._workSegmentB, extendSegB, this._workLocalDetailPair))) {\r\n const d = this._workLocalDetailPair.detailA.a;\r\n if (d < dMin) {\r\n const childDetailA = result?.detailA.childDetail; // save and reuse\r\n const childDetailB = result?.detailB.childDetail;\r\n result = this._workLocalDetailPair.clone(result); // overwrite previous result\r\n LineString3d.convertLocalToGlobalDetail(result.detailA, indexA, numSegmentA, undefined, childDetailA);\r\n LineString3d.convertLocalToGlobalDetail(result.detailB, indexB, numSegmentB, undefined, childDetailB);\r\n if (result.detailA.childDetail && result.detailB.childDetail)\r\n result.detailA.childDetail.curve = result.detailB.childDetail.curve = undefined; // no CurvePrimitives survive in output\r\n dMin = d;\r\n foundMin = true;\r\n }\r\n }\r\n }\r\n }\r\n return foundMin ? result : undefined;\r\n }\r\n}\r\n"]}
@@ -10,135 +10,137 @@ import { Matrix4d } from "./Matrix4d";
10
10
  * * origin = local origin used as moments are summed.
11
11
  * * sums = array of summed moments.
12
12
  * * The [i,j] entry of the sums is a summed or integrated moment for product of axis i and j.
13
- * * axes 0,1,2 are x,y,z
13
+ * * axes 0,1,2 are x,y,z.
14
14
  * * e.g. entry [0,1] is summed product xy
15
15
  * * axis 3 is "w", which is 1 in sums.
16
- * * e.g. entry 03 is summed x
17
- * * In this level,
16
+ * * e.g. entry 03 is summed x.
17
+ * * In this level:
18
18
  * * the `absoluteQuantity` member is undefined.
19
19
  * * the `localToWorldMap` and `radiiOfGyration` are created by have undefined contents.
20
- * * Second level: after a call to inertiaProductsToPrincipalAxes, the `localToWorldMap`, `absoluteQuantity` and `radiiOfGyration` are filled in.
20
+ * * Second level: after a call to inertiaProductsToPrincipalAxes, the `localToWorldMap`, `absoluteQuantity` and
21
+ * `radiiOfGyration` are filled in.
21
22
  * @public
22
23
  */
23
24
  export declare class MomentData {
24
25
  /** Origin used for sums. */
25
26
  origin: Point3d;
26
- /** flag to request deferred origin setup. */
27
+ /** Flag to request deferred origin setup. */
27
28
  needOrigin: boolean;
28
- /** Moment sums.
29
+ /**
30
+ * Moment sums.
29
31
  * * Set to zero at initialization and if requested later.
30
32
  * * Accumulated during data entry phase.
31
33
  */
32
34
  sums: Matrix4d;
33
- /** the mapping between principal and world system.
35
+ /**
36
+ * The mapping between principal and world system.
34
37
  * * This set up with its inverse already constructed.
35
38
  */
36
39
  localToWorldMap: Transform;
37
- /** Return the lower-right (3,3) entry in the sums.
38
- * * This is the quantity (i.e. length, area, or volume) summed
40
+ private static _vectorA?;
41
+ private static _vectorB?;
42
+ private static _vectorC?;
43
+ private _point0;
44
+ private _point1;
45
+ /**
46
+ * Return the lower-right (3,3) entry in the sums.
47
+ * * This is the quantity (i.e. length, area, or volume) summed.
39
48
  */
40
49
  get quantitySum(): number;
41
- /** Return a scale factor to make these sums match the target orientation sign.
50
+ /**
51
+ * Return a scale factor to make these sums match the target orientation sign.
42
52
  * * 1.0 if `this.quantitySum` has the same sign as `targetSign`.
43
53
  * * -1.0 if `this.quantitySum` has the opposite sign from `targetSign`
44
54
  */
45
55
  signFactor(targetSign: number): number;
46
- /**
47
- * If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag.
48
- *
49
- */
56
+ /** If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag. */
50
57
  setOriginIfNeeded(origin: Point3d): void;
51
- /**
52
- * If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag.
53
- *
54
- */
58
+ /** If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag. */
55
59
  setOriginFromGrowableXYZArrayIfNeeded(points: GrowableXYZArray): void;
56
- /**
57
- * If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag.
58
- *
59
- */
60
+ /** If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag. */
60
61
  setOriginXYZIfNeeded(x: number, y: number, z: number): void;
61
- /** radii of gyration (square roots of principal second moments)
62
- */
62
+ /** Radii of gyration (square roots of principal second moments). */
63
63
  radiusOfGyration: Vector3d;
64
- /** principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by
65
- *
64
+ /**
65
+ * Principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by
66
+ * inertiaProductsToPrincipalAxes.
66
67
  */
67
68
  absoluteQuantity?: number;
69
+ /** Constructor. */
68
70
  private constructor();
69
- /** Create moments with optional origin.
70
- * * origin and needOrigin are quirky.
71
+ /**
72
+ * Create moments with optional origin.
73
+ * * Origin and needOrigin are quirky.
71
74
  * * (undefined, true) sets up to use first incoming point as origin.
72
- * * (origin) sets up to use that durable origin, set needsOrigin flag false
73
- * * (origin, true) the "true" is meaningless
74
- * * (undefined, false) makes 000 the durable origin
75
+ * * (origin) sets up to use that durable origin, set needsOrigin flag false.
76
+ * * (origin, true) the "true" is meaningless.
77
+ * * (undefined, false) makes 000 the durable origin.
75
78
  */
76
79
  static create(origin?: Point3d | undefined, needOrigin?: boolean): MomentData;
77
80
  /**
78
- * Return the formal tensor of integrated values `[yy+zz,xy,xz][yx,xx+zz,yz][zx,xy,xx+yy]`
79
- * @param products matrix of (integrated) `[xx,xy,xz][yx,yy,yz][zx,xy,zz]`
81
+ * Return the formal tensor of integrated values `[yy+zz,xy,xz][yx,xx+zz,yz][zx,xy,xx+yy]`.
82
+ * @param products matrix of (integrated) `[xx,xy,xz][yx,yy,yz][zx,xy,zz]`.
80
83
  */
81
84
  static momentTensorFromInertiaProducts(products: Matrix3d): Matrix3d;
82
85
  /** Sort the columns of the matrix for increasing moments. */
83
86
  static sortColumnsForIncreasingMoments(axes: Matrix3d, moments: Vector3d): void;
84
87
  /**
85
88
  * Return the principal moment data for an array of points.
86
- * @param points array of points
89
+ * @param points array of points.
87
90
  */
88
91
  static pointsToPrincipalAxes(points: Point3d[]): MomentData | undefined;
89
92
  /**
90
- * Compute principal axes from inertial products
91
- * * The radii of gyration are sorted smallest to largest
92
- * * Hence x axis is long direction
93
- * * Hence planar data generates large moment as Z
93
+ * Compute principal axes from inertial products.
94
+ * * The radii of gyration are sorted smallest to largest.
95
+ * * Hence x axis is long direction.
96
+ * * Hence planar data generates large moment as Z.
94
97
  * @param origin The origin used for the inertia products.
95
- * @param inertiaProducts The inertia products -- sums or integrals of [xx,xy,xz,xw; yx,yy, yz,yw; zx,zy,zz,zw; wx,wy,wz,w]
98
+ * @param inertiaProducts The inertia products: sums or integrals of [xx,xy,xz,xw; yx,yy, yz,yw; zx,zy,zz,zw; wx,wy,wz,w].
96
99
  */
97
100
  static inertiaProductsToPrincipalAxes(origin: XYZ, inertiaProducts: Matrix4d): MomentData | undefined;
98
101
  /**
99
- * Test for match among selected members as they exist after `inertiaProductsToPrincipalAxes`
100
- * * The members considered are
101
- * * origin of local to world map (i.e. centroid)
102
- * * radius of gyration
102
+ * Test for match among selected members as they exist after `inertiaProductsToPrincipalAxes`.
103
+ * * The members considered are:
104
+ * * origin of local to world map (i.e. centroid),
105
+ * * radius of gyration,
103
106
  * * axes of localToWorldMap.
104
107
  * * Axis direction tests allow these quirks:
105
108
  * * opposite orientation is considered matched.
106
109
  * * Full xyz symmetry: If x,y,z radii are matched, axes are not tested.
107
- * * Symmetry in xy plane: If x and y radii are matched, the x and y axes area allowed to spin freely. Only Z direction is tested.
110
+ * * Symmetry in xy plane: If x and y radii are matched, the x and y axes area allowed to spin freely. Only Z direction
111
+ * is tested.
108
112
  * * If either or both are undefined, returns false.
109
- * @param dataA first set of moments
110
- * @param dataB second set of moments
113
+ * @param dataA first set of moments.
114
+ * @param dataB second set of moments.
111
115
  */
112
116
  static areEquivalentPrincipalAxes(dataA: MomentData | undefined, dataB: MomentData | undefined): boolean;
113
117
  /** Clear the MomentData sums to zero, and establish a new origin. */
114
118
  clearSums(origin?: Point3d): void;
115
119
  /** Accumulate products-of-components for given points. */
116
120
  accumulatePointMomentsFromOrigin(points: Point3d[]): void;
117
- /** revise the accumulated sums to be "around the centroid" */
121
+ /** Revise the accumulated sums to be "around the centroid". */
118
122
  shiftOriginAndSumsToCentroidOfSums(): boolean;
119
- /** revise the accumulated sums
123
+ /**
124
+ * Revise the accumulated sums.
120
125
  * * add ax,ay,ax to the origin coordinates.
121
126
  * * apply the negative translation to the sums.
122
127
  */
123
128
  shiftOriginAndSumsByXYZ(ax: number, ay: number, az: number): void;
124
- /** revise the accumulated sums so they are based at a specified origin. */
129
+ /** Revise the accumulated sums so they are based at a specified origin. */
125
130
  shiftOriginAndSumsToNewOrigin(newOrigin: XYAndZ): void;
126
- private static _vectorA?;
127
- private static _vectorB?;
128
- private static _vectorC?;
129
- /** compute moments of a triangle from the origin to the given line.
131
+ /**
132
+ * Compute moments of a triangle from the origin to the given line.
130
133
  * Accumulate them to this.sums.
131
134
  * * If `pointA` is undefined, use `this.origin` as pointA.
132
135
  * * If `this.needOrigin` is set, pointB is used
133
136
  */
134
137
  accumulateTriangleMomentsXY(pointA: XAndY | undefined, pointB: XAndY, pointC: XAndY): void;
135
- /** add scaled outer product of (4d, unit weight) point to this.sums */
138
+ /** Add scaled outer product of (4d, unit weight) point to this.sums. */
136
139
  accumulateScaledOuterProduct(point: XYAndZ, scaleFactor: number): void;
137
140
  /** Accumulate wire moment integral from pointA to pointB */
138
141
  accumulateLineMomentsXYZ(pointA: Point3d, pointB: Point3d): void;
139
- private _point0;
140
- private _point1;
141
- /** compute moments of triangles from a base point to the given linestring.
142
+ /**
143
+ * Compute moments of triangles from a base point to the given linestring.
142
144
  * Accumulate them to this.sums.
143
145
  * * If `pointA` is undefined, use `this.origin` as pointA.
144
146
  * * If `this.needOrigin` is set, the first point of the array is captured as local origin for subsequent sums.
@@ -147,34 +149,31 @@ export declare class MomentData {
147
149
  accumulateTriangleToLineStringMomentsXY(sweepBase: XAndY | undefined, points: GrowableXYZArray): void;
148
150
  /**
149
151
  * * Assemble XX, YY, XY products into a full matrix form [xx,xy,0,0; xy,yy,0,0;0,0,0,0;0,0,0,1].
150
- * * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin]. (Column weights 0001) (only xy parts of vectors)
152
+ * * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin]. (Column weights 0001) (only xy
153
+ * parts of vectors).
151
154
  * * scale by detJ for the xy-only determinant of the vectors.
152
155
  * @param productXX
153
156
  * @param productXY
154
157
  * @param productYY
155
- * @param area Area in caller's system
156
- * @param origin Caller's origin
157
- * @param vectorU Caller's U axis (not necessarily unit)
158
- * @param vectorV Caller's V axis (not necessarily unit)
158
+ * @param area Area in caller's system.
159
+ * @param origin Caller's origin.
160
+ * @param vectorU Caller's U axis (not necessarily unit).
161
+ * @param vectorV Caller's V axis (not necessarily unit).
159
162
  */
160
163
  accumulateXYProductsInCentroidalFrame(productXX: number, productXY: number, productYY: number, area: number, origin: XAndY, vectorU: XAndY, vectorV: XAndY): void;
161
164
  /**
162
165
  * Accumulate sums from other moments.
163
- * * scale by given scaleFactor (e.g. sign to correct orientation)
164
- * * pull the origin from `other` if `this` needs an origin.
165
- * *
166
+ * * Scale by given scaleFactor (e.g. sign to correct orientation).
167
+ * * Pull the origin from `other` if `this` needs an origin.
166
168
  */
167
169
  accumulateProducts(other: MomentData, scale: number): void;
168
170
  /**
169
- * Accumulate sums from Matrix4d and origin.
170
- * * scale by given scaleFactor (e.g. sign to correct orientation)
171
- * * trap the origin if `this` needs an origin.
172
- * *
173
- */
174
- accumulateProductsFromOrigin(origin: Point3d, products: Matrix4d, scale: number): void;
175
- /**
176
- * Convert to a json data object with:
171
+ * Accumulate sums from Matrix4d and origin.
172
+ * * Scale by given scaleFactor (e.g. sign to correct orientation).
173
+ * * Trap the origin if `this` needs an origin.
177
174
  */
175
+ accumulateProductsFromOrigin(origin: Point3d, products: Matrix4d, scale: number): void;
176
+ /** Convert to a json data object. */
178
177
  toJSON(): any;
179
178
  }
180
179
  //# sourceMappingURL=MomentData.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MomentData.d.ts","sourceRoot":"","sources":["../../../src/geometry4d/MomentData.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,UAAU;IACrB,4BAA4B;IACrB,MAAM,EAAE,OAAO,CAAC;IACvB,6CAA6C;IACtC,UAAU,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACI,IAAI,EAAE,QAAQ,CAAC;IACtB;;OAEG;IACI,eAAe,EAAE,SAAS,CAAC;IAClC;;OAEG;IACH,IAAW,WAAW,IAAI,MAAM,CAAiC;IACjE;;;OAGG;IACI,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAI7C;;;OAGG;IACI,iBAAiB,CAAC,MAAM,EAAE,OAAO;IAMxC;;;OAGG;IACI,qCAAqC,CAAC,MAAM,EAAE,gBAAgB;IAOrE;;;OAGG;IACI,oBAAoB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAO3D;OACG;IACI,gBAAgB,EAAE,QAAQ,CAAC;IAClC;;OAEG;IACI,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAEjC,OAAO;IASP;;;;;;MAME;WACY,MAAM,CAAC,MAAM,CAAC,EAAE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