@itwin/core-geometry 5.11.0-dev.9 → 5.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/CHANGELOG.md +25 -1
  2. package/lib/cjs/Geometry.d.ts +4 -4
  3. package/lib/cjs/Geometry.js +3 -3
  4. package/lib/cjs/Geometry.js.map +1 -1
  5. package/lib/cjs/bspline/BSpline1dNd.d.ts +1 -1
  6. package/lib/cjs/bspline/BSpline1dNd.js +1 -1
  7. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  8. package/lib/cjs/bspline/BSplineSurface.d.ts +2 -2
  9. package/lib/cjs/bspline/BSplineSurface.js +2 -2
  10. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  11. package/lib/cjs/curve/Arc3d.d.ts +1 -1
  12. package/lib/cjs/curve/Arc3d.js +1 -1
  13. package/lib/cjs/curve/Arc3d.js.map +1 -1
  14. package/lib/cjs/curve/CurveFactory.d.ts +38 -7
  15. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  16. package/lib/cjs/curve/CurveFactory.js +45 -23
  17. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  18. package/lib/cjs/curve/CurveLocationDetail.d.ts +1 -1
  19. package/lib/cjs/curve/CurveLocationDetail.js +1 -1
  20. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  21. package/lib/cjs/curve/CurveTypes.d.ts +1 -1
  22. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  23. package/lib/cjs/curve/LineSegment3d.d.ts +1 -2
  24. package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
  25. package/lib/cjs/curve/LineSegment3d.js +1 -2
  26. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  27. package/lib/cjs/curve/RegionOps.d.ts +3 -3
  28. package/lib/cjs/curve/RegionOps.js +3 -3
  29. package/lib/cjs/curve/RegionOps.js.map +1 -1
  30. package/lib/cjs/curve/StrokeOptions.d.ts +1 -1
  31. package/lib/cjs/curve/StrokeOptions.js +1 -1
  32. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  33. package/lib/cjs/geometry3d/BilinearPatch.d.ts +1 -2
  34. package/lib/cjs/geometry3d/BilinearPatch.d.ts.map +1 -1
  35. package/lib/cjs/geometry3d/BilinearPatch.js +1 -2
  36. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  37. package/lib/cjs/geometry3d/GrowableXYArray.d.ts +1 -1
  38. package/lib/cjs/geometry3d/GrowableXYArray.js +1 -1
  39. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  40. package/lib/cjs/geometry3d/IndexedXYZCollection.js +1 -1
  41. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  42. package/lib/cjs/geometry3d/Matrix3d.d.ts +29 -54
  43. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  44. package/lib/cjs/geometry3d/Matrix3d.js +30 -55
  45. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  46. package/lib/cjs/geometry3d/Transform.d.ts +2 -4
  47. package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
  48. package/lib/cjs/geometry3d/Transform.js +2 -4
  49. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  50. package/lib/cjs/geometry4d/Point4d.d.ts +1 -1
  51. package/lib/cjs/geometry4d/Point4d.js +1 -1
  52. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  53. package/lib/cjs/polyface/Polyface.d.ts +2 -2
  54. package/lib/cjs/polyface/Polyface.js +2 -2
  55. package/lib/cjs/polyface/Polyface.js.map +1 -1
  56. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +1 -1
  57. package/lib/cjs/polyface/PolyfaceBuilder.js +1 -1
  58. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  59. package/lib/cjs/polyface/PolyfaceData.d.ts +1 -1
  60. package/lib/cjs/polyface/PolyfaceData.js +1 -1
  61. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  62. package/lib/cjs/polyface/PolyfaceQuery.d.ts +3 -3
  63. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  64. package/lib/cjs/polyface/PolyfaceQuery.js +3 -3
  65. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  66. package/lib/cjs/serialization/IModelJsonSchema.d.ts +3 -3
  67. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  68. package/lib/esm/Geometry.d.ts +4 -4
  69. package/lib/esm/Geometry.js +3 -3
  70. package/lib/esm/Geometry.js.map +1 -1
  71. package/lib/esm/bspline/BSpline1dNd.d.ts +1 -1
  72. package/lib/esm/bspline/BSpline1dNd.js +1 -1
  73. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  74. package/lib/esm/bspline/BSplineSurface.d.ts +2 -2
  75. package/lib/esm/bspline/BSplineSurface.js +2 -2
  76. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  77. package/lib/esm/curve/Arc3d.d.ts +1 -1
  78. package/lib/esm/curve/Arc3d.js +1 -1
  79. package/lib/esm/curve/Arc3d.js.map +1 -1
  80. package/lib/esm/curve/CurveFactory.d.ts +38 -7
  81. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  82. package/lib/esm/curve/CurveFactory.js +45 -23
  83. package/lib/esm/curve/CurveFactory.js.map +1 -1
  84. package/lib/esm/curve/CurveLocationDetail.d.ts +1 -1
  85. package/lib/esm/curve/CurveLocationDetail.js +1 -1
  86. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  87. package/lib/esm/curve/CurveTypes.d.ts +1 -1
  88. package/lib/esm/curve/CurveTypes.js.map +1 -1
  89. package/lib/esm/curve/LineSegment3d.d.ts +1 -2
  90. package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
  91. package/lib/esm/curve/LineSegment3d.js +1 -2
  92. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  93. package/lib/esm/curve/RegionOps.d.ts +3 -3
  94. package/lib/esm/curve/RegionOps.js +3 -3
  95. package/lib/esm/curve/RegionOps.js.map +1 -1
  96. package/lib/esm/curve/StrokeOptions.d.ts +1 -1
  97. package/lib/esm/curve/StrokeOptions.js +1 -1
  98. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  99. package/lib/esm/geometry3d/BilinearPatch.d.ts +1 -2
  100. package/lib/esm/geometry3d/BilinearPatch.d.ts.map +1 -1
  101. package/lib/esm/geometry3d/BilinearPatch.js +1 -2
  102. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  103. package/lib/esm/geometry3d/GrowableXYArray.d.ts +1 -1
  104. package/lib/esm/geometry3d/GrowableXYArray.js +1 -1
  105. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  106. package/lib/esm/geometry3d/IndexedXYZCollection.js +1 -1
  107. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  108. package/lib/esm/geometry3d/Matrix3d.d.ts +29 -54
  109. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  110. package/lib/esm/geometry3d/Matrix3d.js +30 -55
  111. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  112. package/lib/esm/geometry3d/Transform.d.ts +2 -4
  113. package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
  114. package/lib/esm/geometry3d/Transform.js +2 -4
  115. package/lib/esm/geometry3d/Transform.js.map +1 -1
  116. package/lib/esm/geometry4d/Point4d.d.ts +1 -1
  117. package/lib/esm/geometry4d/Point4d.js +1 -1
  118. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  119. package/lib/esm/polyface/Polyface.d.ts +2 -2
  120. package/lib/esm/polyface/Polyface.js +2 -2
  121. package/lib/esm/polyface/Polyface.js.map +1 -1
  122. package/lib/esm/polyface/PolyfaceBuilder.d.ts +1 -1
  123. package/lib/esm/polyface/PolyfaceBuilder.js +1 -1
  124. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  125. package/lib/esm/polyface/PolyfaceData.d.ts +1 -1
  126. package/lib/esm/polyface/PolyfaceData.js +1 -1
  127. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  128. package/lib/esm/polyface/PolyfaceQuery.d.ts +3 -3
  129. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  130. package/lib/esm/polyface/PolyfaceQuery.js +3 -3
  131. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  132. package/lib/esm/serialization/IModelJsonSchema.d.ts +3 -3
  133. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  134. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"BilinearPatch.js","sourceRoot":"","sources":["../../../src/geometry3d/BilinearPatch.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,4EAA0G;AAC1G,sEAAmE;AACnE,0CAAuC;AACvC,yDAAsD;AAEtD,2EAAwE;AACxE,uDAA4C;AAK5C,kCAAkC;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAa,aAAa;IACxB,4CAA4C;IACrC,OAAO,CAAU;IACxB,4CAA4C;IACrC,OAAO,CAAU;IACxB,4CAA4C;IACrC,OAAO,CAAU;IACxB,4CAA4C;IACrC,OAAO,CAAU;IACxB;;;;;;OAMG;IACH,YAAmB,OAAgB,EAAE,OAAgB,EAAE,OAAgB,EAAE,OAAgB;QACvF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IACD;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,OAAgB,EAAE,OAAgB,EAAE,OAAgB,EAAE,OAAgB;QACzF,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,OAAO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,CAAC,CAAC,CAAC;gBACrC,MAAM,CAAC,IAAI,CAAC,IAAI,qDAA6B,CAC3C,yCAAmB,CAAC,sBAAsB,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,EACzD,+CAAuB,CAAC,oBAAoB,CAAC,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,CAC/D,CAAC;YACJ,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,yEAAyE;IAClE,cAAc;QACnB,OAAO,mBAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;IACD,yEAAyE;IAClE,cAAc;QACnB,OAAO,mBAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;CACF;AAlMD,sCAkMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Solid\n */\n\nimport { CurveAndSurfaceLocationDetail, UVSurfaceLocationDetail } from \"../bspline/SurfaceLocationDetail\";\nimport { CurveLocationDetail } from \"../curve/CurveLocationDetail\";\nimport { Geometry } from \"../Geometry\";\nimport { SmallSystem } from \"../numerics/SmallSystem\";\nimport { UVSurface } from \"./GeometryHandler\";\nimport { Plane3dByOriginAndVectors } from \"./Plane3dByOriginAndVectors\";\nimport { Point3d } from \"./Point3dVector3d\";\nimport { Range3d } from \"./Range\";\nimport { Ray3d } from \"./Ray3d\";\nimport { Transform } from \"./Transform\";\n\n// cspell:word uparrow, rightarrow\n\n/**\n * A bilinear patch is a surface defined by its 4 corner points.\n * * The corner points do not have to be coplanar, but if they are, the quadrilateral should be convex to avoid a self-intersecting surface.\n * ```\n * equation\n * \\begin{matrix}\n * v\\text{-direction}\\\\\n * \\uparrow\\\\\n * \\text{point01} &\\cdots &\\text{A1} &\\cdots &\\text{point11}\\\\\n * \\vdots &&\\vdots &&\\vdots\\\\\n * \\text{B0} &\\cdots &\\text{X} &\\cdots &\\text{B1}\\\\\n * \\vdots &&\\vdots &&\\vdots\\\\\n * \\text{point00} &\\cdots &\\text{A0} &\\cdots &\\text{point10} &\\rightarrow~u\\text{-direction}\n * \\end{matrix}\n * ```\n * * To evaluate the point at (u,v), the following are equivalent:\n * * interpolate first with u then with v:\n * * A0 = interpolate between point00 and point10 at fraction u\n * * A1 = interpolate between point01 and point11 at fraction u\n * * X = interpolate between A0 and A1 at fraction v\n * * interpolate first with v then with u:\n * * B0 = interpolate between point00 and point01 at fraction v\n * * B1 = interpolate between point10 and point11 at fraction v\n * * X = interpolate between B0 and B1 at fraction u\n * * sum all at once:\n * * X = (1-u)(1-v)point00 + (1-u)(v)point01 + (u)(1-v)point10 + (u)(v)point11\n * @public\n */\nexport class BilinearPatch implements UVSurface {\n /** corner at parametric coordinate (0,0) */\n public point00: Point3d;\n /** corner at parametric coordinate (1,0) */\n public point10: Point3d;\n /** corner at parametric coordinate (0,1) */\n public point01: Point3d;\n /** corner at parametric coordinate (1,1) */\n public point11: Point3d;\n /**\n * Capture (not clone) corners to create a new BilinearPatch.\n * @param point00 Point at uv=0,0\n * @param point10 Point at uv=1,0\n * @param point10 Point at uv=0,1\n * @param point11 Point at uv=1,1\n */\n public constructor(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\n this.point00 = point00;\n this.point10 = point10;\n this.point01 = point01;\n this.point11 = point11;\n }\n /**\n * Clone (not capture) corners to create a new BilinearPatch.\n * @param point00 Point at uv=0,0\n * @param point10 Point at uv=1,0\n * @param point10 Point at uv=0,1\n * @param point11 Point at uv=1,1\n */\n public static create(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\n return new BilinearPatch(point00.clone(), point10.clone(), point01.clone(), point11.clone());\n }\n /** Create a patch from xyz values of the 4 corners. */\n public static createXYZ(\n x00: number, y00: number, z00: number,\n x10: number, y10: number, z10: number,\n x01: number, y01: number, z01: number,\n x11: number, y11: number, z11: number,\n ) {\n return new BilinearPatch(\n Point3d.create(x00, y00, z00),\n Point3d.create(x10, y10, z10),\n Point3d.create(x01, y01, z01),\n Point3d.create(x11, y11, z11),\n );\n }\n /** Return a cloned patch. */\n public clone(): BilinearPatch {\n return new BilinearPatch(\n this.point00.clone(),\n this.point10.clone(),\n this.point01.clone(),\n this.point11.clone(),\n );\n }\n /** Test equality of the 4 points. */\n public isAlmostEqual(other: BilinearPatch): boolean {\n return this.point00.isAlmostEqual(other.point00)\n && this.point10.isAlmostEqual(other.point10)\n && this.point01.isAlmostEqual(other.point01)\n && this.point11.isAlmostEqual(other.point11);\n }\n /** Apply the transform to each point. */\n public tryTransformInPlace(transform: Transform): boolean {\n transform.multiplyPoint3d(this.point00, this.point00);\n transform.multiplyPoint3d(this.point10, this.point10);\n transform.multiplyPoint3d(this.point01, this.point01);\n transform.multiplyPoint3d(this.point11, this.point11);\n return true;\n }\n /** Return a cloned and transformed patch. */\n public cloneTransformed(transform: Transform): BilinearPatch | undefined {\n const result = this.clone();\n result.tryTransformInPlace(transform);\n return result;\n }\n /** Extend a range by the range of the (optionally transformed) patch. */\n public extendRange(range: Range3d, transform?: Transform) {\n if (transform) {\n range.extendTransformedPoint(transform, this.point00);\n range.extendTransformedPoint(transform, this.point10);\n range.extendTransformedPoint(transform, this.point01);\n range.extendTransformedPoint(transform, this.point11);\n } else {\n range.extendPoint(this.point00);\n range.extendPoint(this.point10);\n range.extendPoint(this.point01);\n range.extendPoint(this.point11);\n }\n }\n /**\n * Convert fractional u and v coordinates to surface point\n * @param u fractional coordinate in u direction\n * @param v fractional coordinate in v direction\n * @param result optional pre-allocated point\n */\n public uvFractionToPoint(u: number, v: number, result?: Point3d): Point3d {\n const f00 = (1.0 - u) * (1.0 - v);\n const f10 = u * (1.0 - v);\n const f01 = (1.0 - u) * v;\n const f11 = u * v;\n return Point3d.create(\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\n result,\n );\n }\n /** Evaluate as a uv surface, returning point and two derivative vectors.\n * @param u fractional coordinate in u direction\n * @param v fractional coordinate in v direction\n * @param result optional pre-allocated carrier for point and vectors\n */\n public uvFractionToPointAndTangents(u: number, v: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n const u0 = 1.0 - u;\n const v0 = 1.0 - v;\n const f00 = u0 * v0;\n const f10 = u * v0;\n const f01 = u0 * v;\n const f11 = u * v;\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\n // u derivative ..\n v0 * (this.point10.x - this.point00.x) + v * (this.point11.x - this.point01.x),\n v0 * (this.point10.y - this.point00.y) + v * (this.point11.y - this.point01.y),\n v0 * (this.point10.z - this.point00.z) + v * (this.point11.z - this.point01.z),\n // v derivative ..\n u0 * (this.point01.x - this.point00.x) + u * (this.point11.x - this.point10.x),\n u0 * (this.point01.y - this.point00.y) + u * (this.point11.y - this.point10.y),\n u0 * (this.point01.z - this.point00.z) + u * (this.point11.z - this.point10.z),\n result,\n );\n }\n /** If data[iB][pivotColumn] is larger in absolute value than data[iA][pivotColumn], then swap rows iA and iB. */\n private static conditionalPivot(pivotColumn: number, data: Float64Array[], iA: number, iB: number) {\n if (Math.abs(data[iB][pivotColumn]) > Math.abs(data[iA][pivotColumn])) {\n const q = data[iA];\n data[iA] = data[iB];\n data[iB] = q;\n }\n }\n /**\n * Compute the points of intersection with a ray.\n * @param ray ray in space\n * @returns 1 or 2 points if there are intersections, undefined if no intersections\n */\n public intersectRay(ray: Ray3d): CurveAndSurfaceLocationDetail[] | undefined {\n const vectorU = this.point10.minus(this.point00);\n const vectorV = this.point01.minus(this.point00);\n const vectorW = this.point11.minus(this.point10);\n vectorW.subtractInPlace(vectorV);\n // We seek t, u, v such that:\n // `ray.origin + t*ray.direction = point00 + u*vectorU + v*vectorV + u*v*vectorW`\n // For typical direction as x, the scalar equation with coefficient order for arrays is:\n // `0 = -t*ray.direction.x + (point00.x - ray.origin.x) + u*vectorU.x + v*vectorV.x + u*v*vectorW.x`\n // and this particular equation is invoked to compute t when u and v are known.\n const coffs = [\n new Float64Array([-ray.direction.x, this.point00.x - ray.origin.x, vectorU.x, vectorV.x, vectorW.x]),\n new Float64Array([-ray.direction.y, this.point00.y - ray.origin.y, vectorU.y, vectorV.y, vectorW.y]),\n new Float64Array([-ray.direction.z, this.point00.z - ray.origin.z, vectorU.z, vectorV.z, vectorW.z]),\n ];\n // swap rows so that the equation with largest ray.direction coefficient is first.\n BilinearPatch.conditionalPivot(0, coffs, 0, 1);\n BilinearPatch.conditionalPivot(0, coffs, 0, 2);\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[1], -1.0);\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[2], -1.0);\n const uvArray = SmallSystem.solveBilinearPair(\n coffs[1][1], coffs[1][2], coffs[1][3], coffs[1][4],\n coffs[2][1], coffs[2][2], coffs[2][3], coffs[2][4],\n );\n if (uvArray) {\n const result: CurveAndSurfaceLocationDetail[] = [];\n for (const uv of uvArray) {\n const t = -(coffs[0][1] + coffs[0][2] * uv.x + (coffs[0][3] + coffs[0][4] * uv.x) * uv.y) / coffs[0][0];\n const point = ray.fractionToPoint(t);\n result.push(new CurveAndSurfaceLocationDetail(\n CurveLocationDetail.createRayFractionPoint(ray, t, point),\n UVSurfaceLocationDetail.createSurfaceUVPoint(this, uv, point)),\n );\n }\n return result;\n }\n return undefined;\n }\n /** Returns the larger of the u-direction edge lengths at v=0 and v=1. */\n public maxUEdgeLength(): number {\n return Geometry.maxXY(this.point00.distance(this.point10), this.point01.distance(this.point11));\n }\n /** Returns the larger of the v-direction edge lengths at u=0 and u=1. */\n public maxVEdgeLength(): number {\n return Geometry.maxXY(this.point00.distance(this.point01), this.point10.distance(this.point11));\n }\n}\n"]}
1
+ {"version":3,"file":"BilinearPatch.js","sourceRoot":"","sources":["../../../src/geometry3d/BilinearPatch.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,4EAA0G;AAC1G,sEAAmE;AACnE,0CAAuC;AACvC,yDAAsD;AAEtD,2EAAwE;AACxE,uDAA4C;AAK5C,kCAAkC;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAa,aAAa;IACxB,4CAA4C;IACrC,OAAO,CAAU;IACxB,4CAA4C;IACrC,OAAO,CAAU;IACxB,4CAA4C;IACrC,OAAO,CAAU;IACxB,4CAA4C;IACrC,OAAO,CAAU;IACxB;;;;;;OAMG;IACH,YAAmB,OAAgB,EAAE,OAAgB,EAAE,OAAgB,EAAE,OAAgB;QACvF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IACD;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,OAAgB,EAAE,OAAgB,EAAE,OAAgB,EAAE,OAAgB;QACzF,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,KAAK,EAA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G,MAAM,KAAK,GAAG,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;gBACrC,MAAM,CAAC,IAAI,CAAC,IAAI,qDAA6B,CAC3C,yCAAmB,CAAC,sBAAsB,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,EACzD,+CAAuB,CAAC,oBAAoB,CAAC,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,CAC/D,CAAC;YACJ,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,yEAAyE;IAClE,cAAc;QACnB,OAAO,mBAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;IACD,yEAAyE;IAClE,cAAc;QACnB,OAAO,mBAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;CACF;AAlMD,sCAkMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Solid\n */\n\nimport { CurveAndSurfaceLocationDetail, UVSurfaceLocationDetail } from \"../bspline/SurfaceLocationDetail\";\nimport { CurveLocationDetail } from \"../curve/CurveLocationDetail\";\nimport { Geometry } from \"../Geometry\";\nimport { SmallSystem } from \"../numerics/SmallSystem\";\nimport { UVSurface } from \"./GeometryHandler\";\nimport { Plane3dByOriginAndVectors } from \"./Plane3dByOriginAndVectors\";\nimport { Point3d } from \"./Point3dVector3d\";\nimport { Range3d } from \"./Range\";\nimport { Ray3d } from \"./Ray3d\";\nimport { Transform } from \"./Transform\";\n\n// cspell:word uparrow, rightarrow\n\n/**\n * A bilinear patch is a surface defined by its 4 corner points.\n * * The corner points do not have to be coplanar, but if they are, the quadrilateral should be convex to avoid a self-intersecting surface.\n * ```equation\n * \\begin{matrix}\n * v\\text{-direction}\\\\\n * \\uparrow\\\\\n * \\text{point01} &\\cdots &\\text{A1} &\\cdots &\\text{point11}\\\\\n * \\vdots &&\\vdots &&\\vdots\\\\\n * \\text{B0} &\\cdots &\\text{X} &\\cdots &\\text{B1}\\\\\n * \\vdots &&\\vdots &&\\vdots\\\\\n * \\text{point00} &\\cdots &\\text{A0} &\\cdots &\\text{point10} &\\rightarrow~u\\text{-direction}\n * \\end{matrix}\n * ```\n * * To evaluate the point at (u,v), the following are equivalent:\n * * interpolate first with u then with v:\n * * A0 = interpolate between point00 and point10 at fraction u\n * * A1 = interpolate between point01 and point11 at fraction u\n * * X = interpolate between A0 and A1 at fraction v\n * * interpolate first with v then with u:\n * * B0 = interpolate between point00 and point01 at fraction v\n * * B1 = interpolate between point10 and point11 at fraction v\n * * X = interpolate between B0 and B1 at fraction u\n * * sum all at once:\n * * X = (1-u)(1-v)point00 + (1-u)(v)point01 + (u)(1-v)point10 + (u)(v)point11\n * @public\n */\nexport class BilinearPatch implements UVSurface {\n /** corner at parametric coordinate (0,0) */\n public point00: Point3d;\n /** corner at parametric coordinate (1,0) */\n public point10: Point3d;\n /** corner at parametric coordinate (0,1) */\n public point01: Point3d;\n /** corner at parametric coordinate (1,1) */\n public point11: Point3d;\n /**\n * Capture (not clone) corners to create a new BilinearPatch.\n * @param point00 Point at uv=0,0\n * @param point10 Point at uv=1,0\n * @param point10 Point at uv=0,1\n * @param point11 Point at uv=1,1\n */\n public constructor(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\n this.point00 = point00;\n this.point10 = point10;\n this.point01 = point01;\n this.point11 = point11;\n }\n /**\n * Clone (not capture) corners to create a new BilinearPatch.\n * @param point00 Point at uv=0,0\n * @param point10 Point at uv=1,0\n * @param point10 Point at uv=0,1\n * @param point11 Point at uv=1,1\n */\n public static create(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\n return new BilinearPatch(point00.clone(), point10.clone(), point01.clone(), point11.clone());\n }\n /** Create a patch from xyz values of the 4 corners. */\n public static createXYZ(\n x00: number, y00: number, z00: number,\n x10: number, y10: number, z10: number,\n x01: number, y01: number, z01: number,\n x11: number, y11: number, z11: number,\n ) {\n return new BilinearPatch(\n Point3d.create(x00, y00, z00),\n Point3d.create(x10, y10, z10),\n Point3d.create(x01, y01, z01),\n Point3d.create(x11, y11, z11),\n );\n }\n /** Return a cloned patch. */\n public clone(): BilinearPatch {\n return new BilinearPatch(\n this.point00.clone(),\n this.point10.clone(),\n this.point01.clone(),\n this.point11.clone(),\n );\n }\n /** Test equality of the 4 points. */\n public isAlmostEqual(other: BilinearPatch): boolean {\n return this.point00.isAlmostEqual(other.point00)\n && this.point10.isAlmostEqual(other.point10)\n && this.point01.isAlmostEqual(other.point01)\n && this.point11.isAlmostEqual(other.point11);\n }\n /** Apply the transform to each point. */\n public tryTransformInPlace(transform: Transform): boolean {\n transform.multiplyPoint3d(this.point00, this.point00);\n transform.multiplyPoint3d(this.point10, this.point10);\n transform.multiplyPoint3d(this.point01, this.point01);\n transform.multiplyPoint3d(this.point11, this.point11);\n return true;\n }\n /** Return a cloned and transformed patch. */\n public cloneTransformed(transform: Transform): BilinearPatch | undefined {\n const result = this.clone();\n result.tryTransformInPlace(transform);\n return result;\n }\n /** Extend a range by the range of the (optionally transformed) patch. */\n public extendRange(range: Range3d, transform?: Transform) {\n if (transform) {\n range.extendTransformedPoint(transform, this.point00);\n range.extendTransformedPoint(transform, this.point10);\n range.extendTransformedPoint(transform, this.point01);\n range.extendTransformedPoint(transform, this.point11);\n } else {\n range.extendPoint(this.point00);\n range.extendPoint(this.point10);\n range.extendPoint(this.point01);\n range.extendPoint(this.point11);\n }\n }\n /**\n * Convert fractional u and v coordinates to surface point\n * @param u fractional coordinate in u direction\n * @param v fractional coordinate in v direction\n * @param result optional pre-allocated point\n */\n public uvFractionToPoint(u: number, v: number, result?: Point3d): Point3d {\n const f00 = (1.0 - u) * (1.0 - v);\n const f10 = u * (1.0 - v);\n const f01 = (1.0 - u) * v;\n const f11 = u * v;\n return Point3d.create(\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\n result,\n );\n }\n /** Evaluate as a uv surface, returning point and two derivative vectors.\n * @param u fractional coordinate in u direction\n * @param v fractional coordinate in v direction\n * @param result optional pre-allocated carrier for point and vectors\n */\n public uvFractionToPointAndTangents(u: number, v: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n const u0 = 1.0 - u;\n const v0 = 1.0 - v;\n const f00 = u0 * v0;\n const f10 = u * v0;\n const f01 = u0 * v;\n const f11 = u * v;\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\n // u derivative ..\n v0 * (this.point10.x - this.point00.x) + v * (this.point11.x - this.point01.x),\n v0 * (this.point10.y - this.point00.y) + v * (this.point11.y - this.point01.y),\n v0 * (this.point10.z - this.point00.z) + v * (this.point11.z - this.point01.z),\n // v derivative ..\n u0 * (this.point01.x - this.point00.x) + u * (this.point11.x - this.point10.x),\n u0 * (this.point01.y - this.point00.y) + u * (this.point11.y - this.point10.y),\n u0 * (this.point01.z - this.point00.z) + u * (this.point11.z - this.point10.z),\n result,\n );\n }\n /** If data[iB][pivotColumn] is larger in absolute value than data[iA][pivotColumn], then swap rows iA and iB. */\n private static conditionalPivot(pivotColumn: number, data: Float64Array[], iA: number, iB: number) {\n if (Math.abs(data[iB][pivotColumn]) > Math.abs(data[iA][pivotColumn])) {\n const q = data[iA];\n data[iA] = data[iB];\n data[iB] = q;\n }\n }\n /**\n * Compute the points of intersection with a ray.\n * @param ray ray in space\n * @returns 1 or 2 points if there are intersections, undefined if no intersections\n */\n public intersectRay(ray: Ray3d): CurveAndSurfaceLocationDetail[] | undefined {\n const vectorU = this.point10.minus(this.point00);\n const vectorV = this.point01.minus(this.point00);\n const vectorW = this.point11.minus(this.point10);\n vectorW.subtractInPlace(vectorV);\n // We seek t, u, v such that:\n // `ray.origin + t*ray.direction = point00 + u*vectorU + v*vectorV + u*v*vectorW`\n // For typical direction as x, the scalar equation with coefficient order for arrays is:\n // `0 = -t*ray.direction.x + (point00.x - ray.origin.x) + u*vectorU.x + v*vectorV.x + u*v*vectorW.x`\n // and this particular equation is invoked to compute t when u and v are known.\n const coffs = [\n new Float64Array([-ray.direction.x, this.point00.x - ray.origin.x, vectorU.x, vectorV.x, vectorW.x]),\n new Float64Array([-ray.direction.y, this.point00.y - ray.origin.y, vectorU.y, vectorV.y, vectorW.y]),\n new Float64Array([-ray.direction.z, this.point00.z - ray.origin.z, vectorU.z, vectorV.z, vectorW.z]),\n ];\n // swap rows so that the equation with largest ray.direction coefficient is first.\n BilinearPatch.conditionalPivot(0, coffs, 0, 1);\n BilinearPatch.conditionalPivot(0, coffs, 0, 2);\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[1], -1.0);\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[2], -1.0);\n const uvArray = SmallSystem.solveBilinearPair(\n coffs[1][1], coffs[1][2], coffs[1][3], coffs[1][4],\n coffs[2][1], coffs[2][2], coffs[2][3], coffs[2][4],\n );\n if (uvArray) {\n const result: CurveAndSurfaceLocationDetail[] = [];\n for (const uv of uvArray) {\n const t = -(coffs[0][1] + coffs[0][2] * uv.x + (coffs[0][3] + coffs[0][4] * uv.x) * uv.y) / coffs[0][0];\n const point = ray.fractionToPoint(t);\n result.push(new CurveAndSurfaceLocationDetail(\n CurveLocationDetail.createRayFractionPoint(ray, t, point),\n UVSurfaceLocationDetail.createSurfaceUVPoint(this, uv, point)),\n );\n }\n return result;\n }\n return undefined;\n }\n /** Returns the larger of the u-direction edge lengths at v=0 and v=1. */\n public maxUEdgeLength(): number {\n return Geometry.maxXY(this.point00.distance(this.point10), this.point01.distance(this.point11));\n }\n /** Returns the larger of the v-direction edge lengths at u=0 and u=1. */\n public maxVEdgeLength(): number {\n return Geometry.maxXY(this.point00.distance(this.point01), this.point10.distance(this.point11));\n }\n}\n"]}
@@ -89,7 +89,7 @@ export declare class GrowableXYArray extends IndexedReadWriteXYCollection {
89
89
  static createCapture(data: Float64Array): GrowableXYArray;
90
90
  /**
91
91
  * Restructure MultiLineStringDataVariant as array of GrowableXYZArray
92
- * @deprecated in 4.2.0 - will not be removed until after 2026-06-13. Moved to GrowableXYZArray class.
92
+ * @deprecated in 4.2.0 - might be removed in next major version. Moved to GrowableXYZArray class.
93
93
  */
94
94
  static createArrayOfGrowableXYZArray(data: MultiLineStringDataVariant): GrowableXYZArray[] | undefined;
95
95
  /** Push a point to the end of the array. */
@@ -176,7 +176,7 @@ class GrowableXYArray extends IndexedXYCollection_1.IndexedReadWriteXYCollection
176
176
  }
177
177
  /**
178
178
  * Restructure MultiLineStringDataVariant as array of GrowableXYZArray
179
- * @deprecated in 4.2.0 - will not be removed until after 2026-06-13. Moved to GrowableXYZArray class.
179
+ * @deprecated in 4.2.0 - might be removed in next major version. Moved to GrowableXYZArray class.
180
180
  */
181
181
  static createArrayOfGrowableXYZArray(data) {
182
182
  return GrowableXYZArray_1.GrowableXYZArray.createArrayOfGrowableXYZArray(data);
@@ -1 +1 @@
1
- {"version":3,"file":"GrowableXYArray.js","sourceRoot":"","sources":["../../../src/geometry3d/GrowableXYArray.ts"],"names":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AO,CAAC,CAAC,CAAC;QACd,CAAC;QACD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,mDAAmD;IACrE,CAAC;IACD,mFAAmF;IAC5E,SAAS,CAAC,UAAkB,EAAE,cAAsB;QACzD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,UAAU,GAAG,cAAc,CAAC,CAAC;IACrD,CAAC;IACD,gCAAgC;IACzB,aAAa,CAAC,KAAsB,EAAE,YAAoB,mBAAQ,CAAC,mBAAmB;QAC3F,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC5B,IAAI,KAAK,CAAC,QAAQ,KAAK,KAAK;YAC1B,OAAO,KAAK,CAAC;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YACnC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS;gBAC3C,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AArsBD,0CAqsBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module ArraysAndInterfaces\n */\n\nimport { Geometry } from \"../Geometry\";\nimport { GrowableXYZArray } from \"./GrowableXYZArray\";\nimport { IndexedReadWriteXYCollection, IndexedXYCollection } from \"./IndexedXYCollection\";\nimport { MultiLineStringDataVariant } from \"./IndexedXYZCollection\";\nimport { Matrix3d } from \"./Matrix3d\";\nimport { Point2d, Vector2d } from \"./Point2dVector2d\";\nimport { Point3d } from \"./Point3dVector3d\";\nimport { Range2d } from \"./Range\";\nimport { Transform } from \"./Transform\";\nimport { XAndY, XYAndZ } from \"./XYZProps\";\n\n/**\n * `GrowableXYArray` manages a (possibly growing) Float64Array to pack xy coordinates.\n * @public\n */\nexport class GrowableXYArray extends IndexedReadWriteXYCollection {\n /** Array of packed xy xy xy components. */\n private _data: Float64Array;\n /** Number of xy tuples (not floats) in the array. */\n private _xyInUse: number;\n /** Capacity in xy tuples (not floats). */\n private _xyCapacity: number;\n /** Multiplier used by [[ensureCapacity]] to expand requested reallocation size. */\n private _growthFactor: number;\n /**\n * Construct a new growable array.\n * @param numPoints initial capacity in xy tuples. Default value is 8.\n * @param growthFactor used by [[ensureCapacity]] to expand requested reallocation size. Default value is 1.5.\n * For no expansion, use 1.\n * @param data optional array to serve as the point source. If `data` is supplied, `numPoints` is reinterpreted as\n * the initial point count, defaulting to and bounded above by the array's point capacity. If a subsequent [[push]]\n * would exceed the array's capacity, a new Float64Array of the same buffer type is allocated and filled.\n */\n public constructor(numPoints?: number, growthFactor?: number, data?: Float64Array) {\n super();\n if (data) {\n this._xyCapacity = data.length / 2;\n this._xyInUse = Math.min(numPoints ?? Infinity, this._xyCapacity);\n this._data = data;\n } else {\n this._xyCapacity = numPoints ?? 8;\n this._xyInUse = 0;\n this._data = new Float64Array(2 * this._xyCapacity); // 2 values per point\n }\n this._growthFactor = (undefined !== growthFactor && growthFactor >= 1.0) ? growthFactor : 1.5;\n }\n /**\n * Copy xy points from source array. Does not reallocate or change active point count.\n * @param source array to copy from.\n * @param sourceCount copy the first sourceCount points; all points if undefined.\n * @param destOffset copy to instance array starting at this point index; zero if undefined.\n * @return count and offset of points copied.\n */\n protected copyData(\n source: Float64Array | number[], sourceCount?: number, destOffset?: number,\n ): { count: number, offset: number } {\n // validate inputs and convert from points to entries\n let myOffset = (undefined !== destOffset) ? destOffset * 2 : 0;\n if (myOffset < 0)\n myOffset = 0;\n if (myOffset >= this._data.length)\n return { count: 0, offset: 0 };\n let myCount = (undefined !== sourceCount) ? sourceCount * 2 : source.length;\n if (myCount > 0) {\n if (myCount > source.length)\n myCount = source.length;\n if (myOffset + myCount > this._data.length)\n myCount = this._data.length - myOffset;\n if (myCount % 2 !== 0)\n myCount -= myCount % 2;\n }\n if (myCount <= 0)\n return { count: 0, offset: 0 };\n if (myCount === source.length)\n this._data.set(source, myOffset);\n else if (source instanceof Float64Array)\n this._data.set(source.subarray(0, myCount), myOffset);\n else\n this._data.set(source.slice(0, myCount), myOffset);\n return { count: myCount / 2, offset: myOffset / 2 };\n }\n /** The number of points in use. When the length is increased, the array is padded with zeroes. */\n public override get length() {\n return this._xyInUse;\n }\n public set length(newLength: number) {\n this.resize(newLength, true);\n }\n /** Return the number of float64 in use. */\n public get float64Length() {\n return this._xyInUse * 2;\n }\n /**\n * Return the raw packed data.\n * * Note that the length of the returned Float64Array is a count of doubles, and includes the excess capacity\n */\n public float64Data(): Float64Array {\n return this._data;\n }\n /** If necessary, increase the capacity to a new pointCount. Current coordinates and point count (length) are unchanged. */\n public ensureCapacity(pointCapacity: number, applyGrowthFactor: boolean = true) {\n if (pointCapacity > this._xyCapacity) {\n if (applyGrowthFactor)\n pointCapacity = Math.trunc(pointCapacity * this._growthFactor);\n const prevData = this._data;\n if (this._data.buffer instanceof ArrayBuffer)\n this._data = new Float64Array(new ArrayBuffer(pointCapacity * 2 * this._data.BYTES_PER_ELEMENT));\n else\n this._data = new Float64Array(new SharedArrayBuffer(pointCapacity * 2 * this._data.BYTES_PER_ELEMENT));\n this.copyData(prevData, this._xyInUse);\n this._xyCapacity = pointCapacity;\n }\n }\n /**\n * Resize the internal storage to hold a new number of points.\n * * If pointCount is less than current length, just reset current length to pointCount, effectively trimming active\n * points but preserving original capacity.\n * * If pointCount is greater than current length, reallocate to exactly pointCount, copy existing points, and\n * optionally pad excess with zero.\n * @param pointCount new number of active points in array.\n * @param padWithZero when increasing point count, whether to zero out new points (default false).\n */\n public resize(pointCount: number, padWithZero?: boolean): void {\n if (pointCount >= 0 && pointCount < this._xyInUse)\n this._xyInUse = pointCount;\n else if (pointCount > this._xyInUse) {\n this.ensureCapacity(pointCount, false);\n if (padWithZero ?? false)\n this._data.fill(0, this._xyInUse * 2);\n this._xyInUse = pointCount;\n }\n }\n /** Make a copy of the (active) points in this array (the clone does NOT get excess capacity). */\n public clone(): GrowableXYArray {\n const newPoints = new GrowableXYArray(this.length);\n newPoints.copyData(this._data, this.length);\n newPoints._xyInUse = this.length;\n return newPoints;\n }\n /**\n * Create an array by copying data from various point formats.\n * Valid inputs are:\n * * Point2d\n * * Point3d\n * * An array of 2 doubles\n * * An array of 3 doubles\n * * A GrowableXYZArray\n * * A GrowableXYArray\n * * Any json object satisfying Point3d.isXAndY\n * * A Float64Array of doubles, interpreted as xyxy\n * * An array of any of the above.\n * @param data source points.\n * @param result optional pre-allocated GrowableXYArray to clear and fill.\n */\n public static create(data: any, result?: GrowableXYArray): GrowableXYArray {\n if (result) {\n result.clear();\n } else {\n const pointCount = typeof data[0] === \"number\" ? data.length / 2 : data.length;\n result = new GrowableXYArray(pointCount);\n }\n result.pushFrom(data);\n return result;\n }\n /**\n * Create a new GrowableXYArray capturing the provided data. The data is not copied, just referenced.\n * @param data source data to capture.\n * @returns a new GrowableXYArray object that references the provided data.\n */\n public static createCapture(data: Float64Array): GrowableXYArray {\n return new GrowableXYArray(0, undefined, data);\n }\n /**\n * Restructure MultiLineStringDataVariant as array of GrowableXYZArray\n * @deprecated in 4.2.0 - will not be removed until after 2026-06-13. Moved to GrowableXYZArray class.\n */\n public static createArrayOfGrowableXYZArray(data: MultiLineStringDataVariant): GrowableXYZArray[] | undefined {\n return GrowableXYZArray.createArrayOfGrowableXYZArray(data);\n }\n /** Push a point to the end of the array. */\n public push(toPush: XAndY): void {\n this.pushXY(toPush.x, toPush.y);\n }\n /** Push all points of an array. */\n public pushAll(points: XAndY[]): void {\n this.ensureCapacity(this._xyInUse + points.length, false);\n for (const p of points)\n this.push(p);\n }\n /** Push all points of an array. */\n public pushAllXYAndZ(points: XYAndZ[] | GrowableXYZArray): void {\n this.ensureCapacity(this._xyInUse + points.length, false);\n if (points instanceof GrowableXYZArray) {\n const xyzBuffer = points.float64Data();\n const n = points.length * 3;\n for (let i = 0; i + 2 < n; i += 3)\n this.pushXY(xyzBuffer[i], xyzBuffer[i + 1]);\n } else {\n for (const p of points) this.pushXY(p.x, p.y);\n }\n }\n /**\n * Push copies of points from variant sources.\n * Valid inputs are:\n * * Point2d\n * * Point3d\n * * An array of 2 doubles\n * * A GrowableXYArray\n * * A GrowableXYZArray\n * * Any json object satisfying Point3d.isXAndY\n * * A Float64Array of doubles, interpreted as xyxy\n * * An array of any of the above.\n */\n public pushFrom(p: any): void {\n if (p instanceof Point3d) {\n this.pushXY(p.x, p.y);\n } else if (p instanceof GrowableXYZArray) {\n this.pushAllXYAndZ(p);\n } else if (p instanceof Point2d) {\n this.pushXY(p.x, p.y);\n } else if (Geometry.isNumberArray(p, 3) || p instanceof Float64Array) {\n const xyToAdd = Math.trunc(p.length / 2);\n this.ensureCapacity(this._xyInUse + xyToAdd, false);\n this.copyData(p, xyToAdd, this._xyInUse);\n this._xyInUse += xyToAdd;\n } else if (Geometry.isNumberArray(p, 2)) {\n this.pushXY(p[0], p[1]);\n } else if (Array.isArray(p)) {\n // direct recursion re-wraps p and goes infinite; unroll here.\n for (const q of p)\n this.pushFrom(q);\n } else if (Point3d.isXAndY(p)) {\n this.pushXY(p.x, p.y);\n } else if (p instanceof IndexedXYCollection) {\n const n = p.length;\n this.ensureCapacity(this._xyInUse + n, false);\n for (let i = 0; i < n; i++)\n this.pushXY(p.getXAtUncheckedPointIndex(i), p.getYAtUncheckedPointIndex(i));\n }\n }\n /**\n * Replicate numWrap xy values from the front of the array as new values at the end.\n * @param numWrap number of xy values to replicate.\n */\n public pushWrap(numWrap: number): void {\n if (this._xyInUse >= numWrap) {\n this.ensureCapacity(this._xyInUse + numWrap, false);\n for (let i = 0; i < numWrap; i++) {\n const k = 2 * i;\n this.pushXY(this._data[k], this._data[k + 1]);\n }\n }\n }\n /** push a point given by x,y coordinates */\n public pushXY(x: number, y: number): void {\n this.ensureCapacity(this._xyInUse + 1);\n const index = this._xyInUse * 2;\n this._data[index] = x;\n this._data[index + 1] = y;\n this._xyInUse++;\n }\n /**\n * Remove one point from the back.\n * * NOTE that (in the manner of std::vector native) this is \"just\" removing the point -- no point is NOT returned.\n * * Use `back ()` to get the last x,y assembled into a `Point2d`.\n */\n public pop(): void {\n if (this._xyInUse > 0)\n this._xyInUse--;\n }\n /**\n * Test if index is valid for an xy (point or vector) within this array.\n * @param index xy index to test.\n */\n public isIndexValid(index: number): boolean {\n if (index >= this._xyInUse || index < 0)\n return false;\n return true;\n }\n /** Clear all xy data, but leave capacity unchanged. */\n public clear() {\n this._xyInUse = 0;\n }\n /**\n * Get a point by index, strongly typed as a `Point2d`. This is unchecked. Use [[getPoint2dAtCheckedPointIndex]] to have validity test.\n * @param pointIndex index to access.\n * @param result optional result.\n */\n public getPoint2dAtUncheckedPointIndex(pointIndex: number, result?: Point2d): Point2d {\n const index = 2 * pointIndex;\n return Point2d.create(this._data[index], this._data[index + 1], result);\n }\n /**\n * Get x coordinate by point index, with no index checking.\n * @param pointIndex index to access.\n */\n public override getXAtUncheckedPointIndex(pointIndex: number): number {\n return this._data[2 * pointIndex];\n }\n /**\n * Get y coordinate by point index, with no index checking.\n * @param pointIndex index to access.\n */\n public override getYAtUncheckedPointIndex(pointIndex: number): number {\n return this._data[2 * pointIndex + 1];\n }\n /** Gather all points as a Point2d[]. */\n public getPoint2dArray(): Point2d[] {\n const n = 2 * this._xyInUse;\n const result = [];\n const data = this._data;\n for (let i = 0; i < n; i += 2)\n result.push(Point2d.create(data[i], data[i + 1]));\n return result;\n }\n /** Copy xy into strongly typed Point2d. */\n public override getPoint2dAtCheckedPointIndex(pointIndex: number, result?: Point2d): Point2d | undefined {\n if (this.isIndexValid(pointIndex)) {\n const index = 2 * pointIndex;\n return Point2d.create(this._data[index], this._data[index + 1], result);\n }\n return undefined;\n }\n /** Copy xy into strongly typed Vector2d. */\n public override getVector2dAtCheckedVectorIndex(vectorIndex: number, result?: Vector2d): Vector2d | undefined {\n if (this.isIndexValid(vectorIndex)) {\n const index = 2 * vectorIndex;\n return Vector2d.create(this._data[index], this._data[index + 1], result);\n }\n return undefined;\n }\n /**\n * Read coordinates from source array, place them at index within this array.\n * @param destIndex point index where coordinates are to be placed in this array.\n * @param source source array.\n * @param sourceIndex point index in source array.\n * @returns true if destIndex and sourceIndex are both valid.\n */\n public transferFromGrowableXYArray(destIndex: number, source: GrowableXYArray, sourceIndex: number): boolean {\n if (this.isIndexValid(destIndex) && source.isIndexValid(sourceIndex)) {\n const i = destIndex * 2;\n const j = sourceIndex * 2;\n this._data[i] = source._data[j];\n this._data[i + 1] = source._data[j + 1];\n return true;\n }\n return false;\n }\n /**\n * Push coordinates from the source array to the end of this array.\n * @param source source array.\n * @param sourceIndex xy index within the source. If undefined, push entire contents of source.\n * @returns number of points pushed.\n */\n public pushFromGrowableXYArray(source: GrowableXYArray, sourceIndex?: number): number {\n // full array push\n if (sourceIndex === undefined) {\n const numXYAdd = source.length;\n this.ensureCapacity(this.length + numXYAdd, false);\n this.copyData(source._data, numXYAdd, this.length);\n this._xyInUse += numXYAdd;\n return numXYAdd;\n }\n // single point push\n if (source.isIndexValid(sourceIndex)) {\n const j = sourceIndex * 2;\n this.pushXY(source._data[j], source._data[j + 1]);\n return 1;\n }\n return 0;\n }\n /**\n * * Compute a point at fractional coordinate between points i and j of source.\n * * Push onto this array.\n */\n public pushInterpolatedFromGrowableXYArray(source: GrowableXYArray, i: number, fraction: number, j: number): void {\n if (source.isIndexValid(i) && source.isIndexValid(j)) {\n const fraction0 = 1.0 - fraction;\n const data = source._data;\n i = 2 * i;\n j = 2 * j;\n this.pushXY(\n fraction0 * data[i] + fraction * data[j],\n fraction0 * data[i + 1] + fraction * data[j + 1],\n );\n }\n }\n /**\n * Create an array of xy points from source xyz points.\n * @param source source array of xyz.\n * @param transform optional transform to apply to xyz points.\n * @param dest optional result.\n */\n public static createFromGrowableXYZArray(source: GrowableXYZArray, transform?: Transform, dest?: GrowableXYArray): GrowableXYArray {\n const numPoints = source.length;\n if (!dest)\n dest = new GrowableXYArray(numPoints);\n else {\n dest.ensureCapacity(numPoints, false);\n dest.clear();\n }\n if (transform) {\n const packedXYZ = source.float64Data();\n const nDouble = 3 * numPoints;\n let x, y, z;\n for (let i = 0; i < nDouble; i += 3) {\n x = packedXYZ[i];\n y = packedXYZ[i + 1];\n z = packedXYZ[i + 2];\n dest.pushXY(transform.multiplyComponentXYZ(0, x, y, z), transform.multiplyComponentXYZ(1, x, y, z));\n }\n } else {\n dest.pushAllXYAndZ(source);\n }\n return dest;\n }\n /** Return the first point, or undefined if the array is empty. */\n public front(result?: Point2d): Point2d | undefined {\n if (this._xyInUse === 0) return undefined;\n return this.getPoint2dAtUncheckedPointIndex(0, result);\n }\n /** Return the last point, or undefined if the array is empty. */\n public back(result?: Point2d): Point2d | undefined {\n if (this._xyInUse < 1) return undefined;\n return this.getPoint2dAtUncheckedPointIndex(this._xyInUse - 1, result);\n }\n /**\n * Set the coordinates of a single point.\n * @param pointIndex index of point to set.\n * @param value coordinates to set.\n */\n public setAtCheckedPointIndex(pointIndex: number, value: XAndY): boolean {\n if (!this.isIndexValid(pointIndex))\n return false;\n const index = pointIndex * 2;\n this._data[index] = value.x;\n this._data[index + 1] = value.y;\n return true;\n }\n /**\n * Set the coordinates of a single point given as coordinates.\n * @param pointIndex index of point to set.\n * @param x x coordinate.\n * @param y y coordinate.\n */\n public setXYAtCheckedPointIndex(pointIndex: number, x: number, y: number): boolean {\n if (!this.isIndexValid(pointIndex))\n return false;\n const index = pointIndex * 2;\n this._data[index] = x;\n this._data[index + 1] = y;\n return true;\n }\n /** Copy all points into a simple array of Point3d with given z. */\n public getPoint3dArray(z: number = 0): Point3d[] {\n const n = 2 * this._xyInUse;\n const result = [];\n const data = this._data;\n for (let i = 0; i < n; i += 2)\n result.push(Point3d.create(data[i], data[i + 1], z));\n return result;\n }\n /** Reverse the order of points. */\n public reverseInPlace(): void {\n const n = this.length;\n let j0, j1;\n let a;\n const data = this._data;\n for (let i0 = 0, i1 = n - 1; i0 < i1; i0++, i1--) {\n j0 = 2 * i0;\n j1 = 2 * i1;\n a = data[j0]; data[j0] = data[j1]; data[j1] = a;\n j0++;\n j1++;\n a = data[j0]; data[j0] = data[j1]; data[j1] = a;\n }\n }\n /** Multiply each point by the transform, replace values. */\n public multiplyTransformInPlace(transform: Transform): void {\n const data = this._data;\n const nDouble = this.float64Length;\n const coffs = transform.matrix.coffs;\n const origin = transform.origin;\n const x0 = origin.x;\n const y0 = origin.y;\n let x = 0;\n let y = 0;\n for (let i = 0; i + 1 < nDouble; i += 2) {\n x = data[i];\n y = data[i + 1];\n data[i] = coffs[0] * x + coffs[1] * y + x0;\n data[i + 1] = coffs[3] * x + coffs[4] * y + y0;\n }\n }\n /** Multiply each xy (as a vector) by matrix, replace values. */\n public multiplyMatrix3dInPlace(matrix: Matrix3d): void {\n const data = this._data;\n const nDouble = this.float64Length;\n const coffs = matrix.coffs;\n let x = 0;\n let y = 0;\n for (let i = 0; i + 1 < nDouble; i += 2) {\n x = data[i];\n y = data[i + 1];\n data[i] = coffs[0] * x + coffs[1] * y;\n data[i + 1] = coffs[3] * x + coffs[4] * y;\n }\n }\n /** Multiply each point by the transform, replace values. */\n public tryTransformInverseInPlace(transform: Transform): boolean {\n const data = this._data;\n const nDouble = this.float64Length;\n const matrix = transform.matrix;\n matrix.computeCachedInverse(true);\n const coffs = matrix.inverseCoffs;\n if (!coffs)\n return false;\n const origin = transform.origin;\n const x0 = origin.x;\n const y0 = origin.y;\n let x = 0;\n let y = 0;\n for (let i = 0; i + 1 < nDouble; i += 2) {\n x = data[i] - x0;\n y = data[i + 1] - y0;\n data[i] = coffs[0] * x + coffs[1] * y;\n data[i + 1] = coffs[3] * x + coffs[4] * y;\n }\n return true;\n }\n /** Extend a `Range2d`, optionally transforming the points. */\n public extendRange(rangeToExtend: Range2d, transform?: Transform): void {\n const numDouble = this.float64Length;\n const data = this._data;\n if (transform) {\n for (let i = 0; i + 1 < numDouble; i += 2)\n rangeToExtend.extendTransformedXY(transform, data[i], data[i + 1]);\n } else {\n for (let i = 0; i + 1 < numDouble; i += 2)\n rangeToExtend.extendXY(data[i], data[i + 1]);\n }\n }\n /** Sum the lengths of segments between points. */\n public sumLengths(): number {\n let sum = 0.0;\n const n = 2 * (this._xyInUse - 1); // Length already takes into account what specifically is in use\n const data = this._data;\n for (let i = 0; i < n; i += 2) sum += Geometry.hypotenuseXY(\n data[i + 2] - data[i],\n data[i + 3] - data[i + 1]);\n return sum;\n }\n /**\n * Multiply each x,y by the scale factor.\n * @param factor scale factor.\n */\n public scaleInPlace(factor: number): void {\n if (this._data) {\n const numFloat = this.float64Length;\n for (let i = 0; i < numFloat; i++)\n this._data[i] = this._data[i] * factor;\n }\n }\n /** Compute a point at fractional coordinate between points i and j. */\n public interpolate(i: number, fraction: number, j: number, result?: Point2d): Point2d | undefined {\n if (this.isIndexValid(i) && this.isIndexValid(j)) {\n const fraction0 = 1.0 - fraction;\n const data = this._data;\n i = 2 * i;\n j = 2 * j;\n return Point2d.create(\n fraction0 * data[i] + fraction * data[j],\n fraction0 * data[i + 1] + fraction * data[j + 1], result);\n }\n return undefined;\n }\n /** Sum the signed areas of the projection to xy plane. */\n public areaXY(): number {\n let area = 0.0;\n const n = 2 * this._xyInUse; // float count\n if (n > 4) {\n const x0 = this._data[n - 2];\n const y0 = this._data[n - 1];\n let dx1 = this._data[0] - x0;\n let dy1 = this._data[1] - y0;\n let dx2 = 0;\n let dy2 = 0;\n for (let i = 2; i < n; i += 2, dx1 = dx2, dy1 = dy2) {\n dx2 = this._data[i] - x0;\n dy2 = this._data[i + 1] - y0;\n area += Geometry.crossProductXYXY(dx1, dy1, dx2, dy2);\n }\n }\n return 0.5 * area;\n }\n /** Compute a vector from index origin i to indexed target j. */\n public override vectorIndexIndex(i: number, j: number, result?: Vector2d): Vector2d | undefined {\n if (!this.isIndexValid(i) || !this.isIndexValid(j))\n return undefined;\n const data = this._data;\n i = 2 * i;\n j = 2 * j;\n return Vector2d.create(data[j] - data[i], data[j + 1] - data[i + 1], result);\n }\n /** Compute a vector from origin to indexed target j. */\n public override vectorXAndYIndex(origin: XAndY, j: number, result?: Vector2d): Vector2d | undefined {\n if (this.isIndexValid(j)) {\n const data = this._data;\n j = 2 * j;\n return Vector2d.create(\n data[j] - origin.x,\n data[j + 1] - origin.y, result);\n }\n return undefined;\n }\n /** Compute the cross product of vectors from from indexed origin to indexed targets i and j. */\n public override crossProductIndexIndexIndex(\n originIndex: number, targetAIndex: number, targetBIndex: number,\n ): number | undefined {\n if (this.isIndexValid(originIndex) && this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {\n const i = originIndex * 2;\n const j = targetAIndex * 2;\n const k = targetBIndex * 2;\n const data = this._data;\n return Geometry.crossProductXYXY(\n data[j] - data[i], data[j + 1] - data[i + 1],\n data[k] - data[i], data[k + 1] - data[i + 1]);\n }\n return undefined;\n }\n /** Compute the cross product of vectors from from origin to indexed targets i and j. */\n public override crossProductXAndYIndexIndex(origin: XAndY, targetAIndex: number, targetBIndex: number): number | undefined {\n if (this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {\n const j = targetAIndex * 2;\n const k = targetBIndex * 2;\n const data = this._data;\n return Geometry.crossProductXYXY(\n data[j] - origin.x, data[j + 1] - origin.y,\n data[k] - origin.x, data[k + 1] - origin.y,\n );\n }\n return undefined;\n }\n /** Return the distance between two points in the array. */\n public distance(i: number, j: number): number | undefined {\n if (this.isIndexValid(i) && this.isIndexValid(j)) {\n const i0 = 2 * i;\n const j0 = 2 * j;\n return Geometry.hypotenuseXY(\n this._data[j0] - this._data[i0],\n this._data[j0 + 1] - this._data[i0 + 1],\n );\n }\n return undefined;\n }\n /** Return the distance between an array point and the input point. */\n public distanceIndexToPoint(i: number, spacePoint: Point2d): number | undefined {\n if (this.isIndexValid(i)) {\n const i0 = 2 * i;\n return Geometry.hypotenuseXY(\n spacePoint.x - this._data[i0],\n spacePoint.y - this._data[i0 + 1],\n );\n }\n return undefined;\n }\n /** Test for nearly equal arrays. */\n public static isAlmostEqual(dataA: GrowableXYArray | undefined, dataB: GrowableXYArray | undefined): boolean {\n if (dataA && dataB) {\n if (dataA.length !== dataB.length)\n return false;\n for (let i = 0; i < dataA.length; i++)\n if (!dataA.getPoint2dAtUncheckedPointIndex(i).isAlmostEqual(dataB.getPoint2dAtUncheckedPointIndex(i)))\n return false;\n return true;\n }\n // if both are null it is equal, otherwise unequal\n return (!dataA && !dataB);\n }\n /** Return an array of block indices sorted per compareLexicalBlock function. */\n public sortIndicesLexical(): Uint32Array {\n const n = this._xyInUse;\n // let numCompare = 0;\n const result = new Uint32Array(n);\n for (let i = 0; i < n; i++) result[i] = i;\n result.sort(\n (blockIndexA: number, blockIndexB: number) => {\n // numCompare++;\n return this.compareLexicalBlock(blockIndexA, blockIndexB);\n });\n // console.log (n, numCompare);\n return result;\n }\n /** compare two blocks in simple lexical order. */\n public compareLexicalBlock(ia: number, ib: number): number {\n let ax = 0;\n let bx = 0;\n for (let i = 0; i < 2; i++) {\n ax = this._data[ia * 2 + i];\n bx = this._data[ib * 2 + i];\n if (ax > bx)\n return 1;\n if (ax < bx)\n return -1;\n }\n return ia - ib; // so original order is maintained among duplicates\n }\n /** Access a single double at offset within a block. This has no index checking. */\n public component(pointIndex: number, componentIndex: number): number {\n return this._data[2 * pointIndex + componentIndex];\n }\n /** Toleranced equality test. */\n public isAlmostEqual(other: GrowableXYArray, tolerance: number = Geometry.smallMetricDistance): boolean {\n const numXY = this._xyInUse;\n if (other._xyInUse !== numXY)\n return false;\n const dataA = this._data;\n const dataB = other._data;\n for (let i = 0; i < 2 * numXY; i++) {\n if (Math.abs(dataA[i] - dataB[i]) > tolerance)\n return false;\n }\n return true;\n }\n}\n"]}
1
+ {"version":3,"file":"GrowableXYArray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O,CAAC,CAAC;YACX,IAAI,EAAE,GAAG,EAAE;gBACT,OAAO,CAAC,CAAC,CAAC;QACd,CAAC;QACD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,mDAAmD;IACrE,CAAC;IACD,mFAAmF;IAC5E,SAAS,CAAC,UAAkB,EAAE,cAAsB;QACzD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,UAAU,GAAG,cAAc,CAAC,CAAC;IACrD,CAAC;IACD,gCAAgC;IACzB,aAAa,CAAC,KAAsB,EAAE,YAAoB,mBAAQ,CAAC,mBAAmB;QAC3F,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC5B,IAAI,KAAK,CAAC,QAAQ,KAAK,KAAK;YAC1B,OAAO,KAAK,CAAC;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YACnC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS;gBAC3C,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AArsBD,0CAqsBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module ArraysAndInterfaces\n */\n\nimport { Geometry } from \"../Geometry\";\nimport { GrowableXYZArray } from \"./GrowableXYZArray\";\nimport { IndexedReadWriteXYCollection, IndexedXYCollection } from \"./IndexedXYCollection\";\nimport { MultiLineStringDataVariant } from \"./IndexedXYZCollection\";\nimport { Matrix3d } from \"./Matrix3d\";\nimport { Point2d, Vector2d } from \"./Point2dVector2d\";\nimport { Point3d } from \"./Point3dVector3d\";\nimport { Range2d } from \"./Range\";\nimport { Transform } from \"./Transform\";\nimport { XAndY, XYAndZ } from \"./XYZProps\";\n\n/**\n * `GrowableXYArray` manages a (possibly growing) Float64Array to pack xy coordinates.\n * @public\n */\nexport class GrowableXYArray extends IndexedReadWriteXYCollection {\n /** Array of packed xy xy xy components. */\n private _data: Float64Array;\n /** Number of xy tuples (not floats) in the array. */\n private _xyInUse: number;\n /** Capacity in xy tuples (not floats). */\n private _xyCapacity: number;\n /** Multiplier used by [[ensureCapacity]] to expand requested reallocation size. */\n private _growthFactor: number;\n /**\n * Construct a new growable array.\n * @param numPoints initial capacity in xy tuples. Default value is 8.\n * @param growthFactor used by [[ensureCapacity]] to expand requested reallocation size. Default value is 1.5.\n * For no expansion, use 1.\n * @param data optional array to serve as the point source. If `data` is supplied, `numPoints` is reinterpreted as\n * the initial point count, defaulting to and bounded above by the array's point capacity. If a subsequent [[push]]\n * would exceed the array's capacity, a new Float64Array of the same buffer type is allocated and filled.\n */\n public constructor(numPoints?: number, growthFactor?: number, data?: Float64Array) {\n super();\n if (data) {\n this._xyCapacity = data.length / 2;\n this._xyInUse = Math.min(numPoints ?? Infinity, this._xyCapacity);\n this._data = data;\n } else {\n this._xyCapacity = numPoints ?? 8;\n this._xyInUse = 0;\n this._data = new Float64Array(2 * this._xyCapacity); // 2 values per point\n }\n this._growthFactor = (undefined !== growthFactor && growthFactor >= 1.0) ? growthFactor : 1.5;\n }\n /**\n * Copy xy points from source array. Does not reallocate or change active point count.\n * @param source array to copy from.\n * @param sourceCount copy the first sourceCount points; all points if undefined.\n * @param destOffset copy to instance array starting at this point index; zero if undefined.\n * @return count and offset of points copied.\n */\n protected copyData(\n source: Float64Array | number[], sourceCount?: number, destOffset?: number,\n ): { count: number, offset: number } {\n // validate inputs and convert from points to entries\n let myOffset = (undefined !== destOffset) ? destOffset * 2 : 0;\n if (myOffset < 0)\n myOffset = 0;\n if (myOffset >= this._data.length)\n return { count: 0, offset: 0 };\n let myCount = (undefined !== sourceCount) ? sourceCount * 2 : source.length;\n if (myCount > 0) {\n if (myCount > source.length)\n myCount = source.length;\n if (myOffset + myCount > this._data.length)\n myCount = this._data.length - myOffset;\n if (myCount % 2 !== 0)\n myCount -= myCount % 2;\n }\n if (myCount <= 0)\n return { count: 0, offset: 0 };\n if (myCount === source.length)\n this._data.set(source, myOffset);\n else if (source instanceof Float64Array)\n this._data.set(source.subarray(0, myCount), myOffset);\n else\n this._data.set(source.slice(0, myCount), myOffset);\n return { count: myCount / 2, offset: myOffset / 2 };\n }\n /** The number of points in use. When the length is increased, the array is padded with zeroes. */\n public override get length() {\n return this._xyInUse;\n }\n public set length(newLength: number) {\n this.resize(newLength, true);\n }\n /** Return the number of float64 in use. */\n public get float64Length() {\n return this._xyInUse * 2;\n }\n /**\n * Return the raw packed data.\n * * Note that the length of the returned Float64Array is a count of doubles, and includes the excess capacity\n */\n public float64Data(): Float64Array {\n return this._data;\n }\n /** If necessary, increase the capacity to a new pointCount. Current coordinates and point count (length) are unchanged. */\n public ensureCapacity(pointCapacity: number, applyGrowthFactor: boolean = true) {\n if (pointCapacity > this._xyCapacity) {\n if (applyGrowthFactor)\n pointCapacity = Math.trunc(pointCapacity * this._growthFactor);\n const prevData = this._data;\n if (this._data.buffer instanceof ArrayBuffer)\n this._data = new Float64Array(new ArrayBuffer(pointCapacity * 2 * this._data.BYTES_PER_ELEMENT));\n else\n this._data = new Float64Array(new SharedArrayBuffer(pointCapacity * 2 * this._data.BYTES_PER_ELEMENT));\n this.copyData(prevData, this._xyInUse);\n this._xyCapacity = pointCapacity;\n }\n }\n /**\n * Resize the internal storage to hold a new number of points.\n * * If pointCount is less than current length, just reset current length to pointCount, effectively trimming active\n * points but preserving original capacity.\n * * If pointCount is greater than current length, reallocate to exactly pointCount, copy existing points, and\n * optionally pad excess with zero.\n * @param pointCount new number of active points in array.\n * @param padWithZero when increasing point count, whether to zero out new points (default false).\n */\n public resize(pointCount: number, padWithZero?: boolean): void {\n if (pointCount >= 0 && pointCount < this._xyInUse)\n this._xyInUse = pointCount;\n else if (pointCount > this._xyInUse) {\n this.ensureCapacity(pointCount, false);\n if (padWithZero ?? false)\n this._data.fill(0, this._xyInUse * 2);\n this._xyInUse = pointCount;\n }\n }\n /** Make a copy of the (active) points in this array (the clone does NOT get excess capacity). */\n public clone(): GrowableXYArray {\n const newPoints = new GrowableXYArray(this.length);\n newPoints.copyData(this._data, this.length);\n newPoints._xyInUse = this.length;\n return newPoints;\n }\n /**\n * Create an array by copying data from various point formats.\n * Valid inputs are:\n * * Point2d\n * * Point3d\n * * An array of 2 doubles\n * * An array of 3 doubles\n * * A GrowableXYZArray\n * * A GrowableXYArray\n * * Any json object satisfying Point3d.isXAndY\n * * A Float64Array of doubles, interpreted as xyxy\n * * An array of any of the above.\n * @param data source points.\n * @param result optional pre-allocated GrowableXYArray to clear and fill.\n */\n public static create(data: any, result?: GrowableXYArray): GrowableXYArray {\n if (result) {\n result.clear();\n } else {\n const pointCount = typeof data[0] === \"number\" ? data.length / 2 : data.length;\n result = new GrowableXYArray(pointCount);\n }\n result.pushFrom(data);\n return result;\n }\n /**\n * Create a new GrowableXYArray capturing the provided data. The data is not copied, just referenced.\n * @param data source data to capture.\n * @returns a new GrowableXYArray object that references the provided data.\n */\n public static createCapture(data: Float64Array): GrowableXYArray {\n return new GrowableXYArray(0, undefined, data);\n }\n /**\n * Restructure MultiLineStringDataVariant as array of GrowableXYZArray\n * @deprecated in 4.2.0 - might be removed in next major version. Moved to GrowableXYZArray class.\n */\n public static createArrayOfGrowableXYZArray(data: MultiLineStringDataVariant): GrowableXYZArray[] | undefined {\n return GrowableXYZArray.createArrayOfGrowableXYZArray(data);\n }\n /** Push a point to the end of the array. */\n public push(toPush: XAndY): void {\n this.pushXY(toPush.x, toPush.y);\n }\n /** Push all points of an array. */\n public pushAll(points: XAndY[]): void {\n this.ensureCapacity(this._xyInUse + points.length, false);\n for (const p of points)\n this.push(p);\n }\n /** Push all points of an array. */\n public pushAllXYAndZ(points: XYAndZ[] | GrowableXYZArray): void {\n this.ensureCapacity(this._xyInUse + points.length, false);\n if (points instanceof GrowableXYZArray) {\n const xyzBuffer = points.float64Data();\n const n = points.length * 3;\n for (let i = 0; i + 2 < n; i += 3)\n this.pushXY(xyzBuffer[i], xyzBuffer[i + 1]);\n } else {\n for (const p of points) this.pushXY(p.x, p.y);\n }\n }\n /**\n * Push copies of points from variant sources.\n * Valid inputs are:\n * * Point2d\n * * Point3d\n * * An array of 2 doubles\n * * A GrowableXYArray\n * * A GrowableXYZArray\n * * Any json object satisfying Point3d.isXAndY\n * * A Float64Array of doubles, interpreted as xyxy\n * * An array of any of the above.\n */\n public pushFrom(p: any): void {\n if (p instanceof Point3d) {\n this.pushXY(p.x, p.y);\n } else if (p instanceof GrowableXYZArray) {\n this.pushAllXYAndZ(p);\n } else if (p instanceof Point2d) {\n this.pushXY(p.x, p.y);\n } else if (Geometry.isNumberArray(p, 3) || p instanceof Float64Array) {\n const xyToAdd = Math.trunc(p.length / 2);\n this.ensureCapacity(this._xyInUse + xyToAdd, false);\n this.copyData(p, xyToAdd, this._xyInUse);\n this._xyInUse += xyToAdd;\n } else if (Geometry.isNumberArray(p, 2)) {\n this.pushXY(p[0], p[1]);\n } else if (Array.isArray(p)) {\n // direct recursion re-wraps p and goes infinite; unroll here.\n for (const q of p)\n this.pushFrom(q);\n } else if (Point3d.isXAndY(p)) {\n this.pushXY(p.x, p.y);\n } else if (p instanceof IndexedXYCollection) {\n const n = p.length;\n this.ensureCapacity(this._xyInUse + n, false);\n for (let i = 0; i < n; i++)\n this.pushXY(p.getXAtUncheckedPointIndex(i), p.getYAtUncheckedPointIndex(i));\n }\n }\n /**\n * Replicate numWrap xy values from the front of the array as new values at the end.\n * @param numWrap number of xy values to replicate.\n */\n public pushWrap(numWrap: number): void {\n if (this._xyInUse >= numWrap) {\n this.ensureCapacity(this._xyInUse + numWrap, false);\n for (let i = 0; i < numWrap; i++) {\n const k = 2 * i;\n this.pushXY(this._data[k], this._data[k + 1]);\n }\n }\n }\n /** push a point given by x,y coordinates */\n public pushXY(x: number, y: number): void {\n this.ensureCapacity(this._xyInUse + 1);\n const index = this._xyInUse * 2;\n this._data[index] = x;\n this._data[index + 1] = y;\n this._xyInUse++;\n }\n /**\n * Remove one point from the back.\n * * NOTE that (in the manner of std::vector native) this is \"just\" removing the point -- no point is NOT returned.\n * * Use `back ()` to get the last x,y assembled into a `Point2d`.\n */\n public pop(): void {\n if (this._xyInUse > 0)\n this._xyInUse--;\n }\n /**\n * Test if index is valid for an xy (point or vector) within this array.\n * @param index xy index to test.\n */\n public isIndexValid(index: number): boolean {\n if (index >= this._xyInUse || index < 0)\n return false;\n return true;\n }\n /** Clear all xy data, but leave capacity unchanged. */\n public clear() {\n this._xyInUse = 0;\n }\n /**\n * Get a point by index, strongly typed as a `Point2d`. This is unchecked. Use [[getPoint2dAtCheckedPointIndex]] to have validity test.\n * @param pointIndex index to access.\n * @param result optional result.\n */\n public getPoint2dAtUncheckedPointIndex(pointIndex: number, result?: Point2d): Point2d {\n const index = 2 * pointIndex;\n return Point2d.create(this._data[index], this._data[index + 1], result);\n }\n /**\n * Get x coordinate by point index, with no index checking.\n * @param pointIndex index to access.\n */\n public override getXAtUncheckedPointIndex(pointIndex: number): number {\n return this._data[2 * pointIndex];\n }\n /**\n * Get y coordinate by point index, with no index checking.\n * @param pointIndex index to access.\n */\n public override getYAtUncheckedPointIndex(pointIndex: number): number {\n return this._data[2 * pointIndex + 1];\n }\n /** Gather all points as a Point2d[]. */\n public getPoint2dArray(): Point2d[] {\n const n = 2 * this._xyInUse;\n const result = [];\n const data = this._data;\n for (let i = 0; i < n; i += 2)\n result.push(Point2d.create(data[i], data[i + 1]));\n return result;\n }\n /** Copy xy into strongly typed Point2d. */\n public override getPoint2dAtCheckedPointIndex(pointIndex: number, result?: Point2d): Point2d | undefined {\n if (this.isIndexValid(pointIndex)) {\n const index = 2 * pointIndex;\n return Point2d.create(this._data[index], this._data[index + 1], result);\n }\n return undefined;\n }\n /** Copy xy into strongly typed Vector2d. */\n public override getVector2dAtCheckedVectorIndex(vectorIndex: number, result?: Vector2d): Vector2d | undefined {\n if (this.isIndexValid(vectorIndex)) {\n const index = 2 * vectorIndex;\n return Vector2d.create(this._data[index], this._data[index + 1], result);\n }\n return undefined;\n }\n /**\n * Read coordinates from source array, place them at index within this array.\n * @param destIndex point index where coordinates are to be placed in this array.\n * @param source source array.\n * @param sourceIndex point index in source array.\n * @returns true if destIndex and sourceIndex are both valid.\n */\n public transferFromGrowableXYArray(destIndex: number, source: GrowableXYArray, sourceIndex: number): boolean {\n if (this.isIndexValid(destIndex) && source.isIndexValid(sourceIndex)) {\n const i = destIndex * 2;\n const j = sourceIndex * 2;\n this._data[i] = source._data[j];\n this._data[i + 1] = source._data[j + 1];\n return true;\n }\n return false;\n }\n /**\n * Push coordinates from the source array to the end of this array.\n * @param source source array.\n * @param sourceIndex xy index within the source. If undefined, push entire contents of source.\n * @returns number of points pushed.\n */\n public pushFromGrowableXYArray(source: GrowableXYArray, sourceIndex?: number): number {\n // full array push\n if (sourceIndex === undefined) {\n const numXYAdd = source.length;\n this.ensureCapacity(this.length + numXYAdd, false);\n this.copyData(source._data, numXYAdd, this.length);\n this._xyInUse += numXYAdd;\n return numXYAdd;\n }\n // single point push\n if (source.isIndexValid(sourceIndex)) {\n const j = sourceIndex * 2;\n this.pushXY(source._data[j], source._data[j + 1]);\n return 1;\n }\n return 0;\n }\n /**\n * * Compute a point at fractional coordinate between points i and j of source.\n * * Push onto this array.\n */\n public pushInterpolatedFromGrowableXYArray(source: GrowableXYArray, i: number, fraction: number, j: number): void {\n if (source.isIndexValid(i) && source.isIndexValid(j)) {\n const fraction0 = 1.0 - fraction;\n const data = source._data;\n i = 2 * i;\n j = 2 * j;\n this.pushXY(\n fraction0 * data[i] + fraction * data[j],\n fraction0 * data[i + 1] + fraction * data[j + 1],\n );\n }\n }\n /**\n * Create an array of xy points from source xyz points.\n * @param source source array of xyz.\n * @param transform optional transform to apply to xyz points.\n * @param dest optional result.\n */\n public static createFromGrowableXYZArray(source: GrowableXYZArray, transform?: Transform, dest?: GrowableXYArray): GrowableXYArray {\n const numPoints = source.length;\n if (!dest)\n dest = new GrowableXYArray(numPoints);\n else {\n dest.ensureCapacity(numPoints, false);\n dest.clear();\n }\n if (transform) {\n const packedXYZ = source.float64Data();\n const nDouble = 3 * numPoints;\n let x, y, z;\n for (let i = 0; i < nDouble; i += 3) {\n x = packedXYZ[i];\n y = packedXYZ[i + 1];\n z = packedXYZ[i + 2];\n dest.pushXY(transform.multiplyComponentXYZ(0, x, y, z), transform.multiplyComponentXYZ(1, x, y, z));\n }\n } else {\n dest.pushAllXYAndZ(source);\n }\n return dest;\n }\n /** Return the first point, or undefined if the array is empty. */\n public front(result?: Point2d): Point2d | undefined {\n if (this._xyInUse === 0) return undefined;\n return this.getPoint2dAtUncheckedPointIndex(0, result);\n }\n /** Return the last point, or undefined if the array is empty. */\n public back(result?: Point2d): Point2d | undefined {\n if (this._xyInUse < 1) return undefined;\n return this.getPoint2dAtUncheckedPointIndex(this._xyInUse - 1, result);\n }\n /**\n * Set the coordinates of a single point.\n * @param pointIndex index of point to set.\n * @param value coordinates to set.\n */\n public setAtCheckedPointIndex(pointIndex: number, value: XAndY): boolean {\n if (!this.isIndexValid(pointIndex))\n return false;\n const index = pointIndex * 2;\n this._data[index] = value.x;\n this._data[index + 1] = value.y;\n return true;\n }\n /**\n * Set the coordinates of a single point given as coordinates.\n * @param pointIndex index of point to set.\n * @param x x coordinate.\n * @param y y coordinate.\n */\n public setXYAtCheckedPointIndex(pointIndex: number, x: number, y: number): boolean {\n if (!this.isIndexValid(pointIndex))\n return false;\n const index = pointIndex * 2;\n this._data[index] = x;\n this._data[index + 1] = y;\n return true;\n }\n /** Copy all points into a simple array of Point3d with given z. */\n public getPoint3dArray(z: number = 0): Point3d[] {\n const n = 2 * this._xyInUse;\n const result = [];\n const data = this._data;\n for (let i = 0; i < n; i += 2)\n result.push(Point3d.create(data[i], data[i + 1], z));\n return result;\n }\n /** Reverse the order of points. */\n public reverseInPlace(): void {\n const n = this.length;\n let j0, j1;\n let a;\n const data = this._data;\n for (let i0 = 0, i1 = n - 1; i0 < i1; i0++, i1--) {\n j0 = 2 * i0;\n j1 = 2 * i1;\n a = data[j0]; data[j0] = data[j1]; data[j1] = a;\n j0++;\n j1++;\n a = data[j0]; data[j0] = data[j1]; data[j1] = a;\n }\n }\n /** Multiply each point by the transform, replace values. */\n public multiplyTransformInPlace(transform: Transform): void {\n const data = this._data;\n const nDouble = this.float64Length;\n const coffs = transform.matrix.coffs;\n const origin = transform.origin;\n const x0 = origin.x;\n const y0 = origin.y;\n let x = 0;\n let y = 0;\n for (let i = 0; i + 1 < nDouble; i += 2) {\n x = data[i];\n y = data[i + 1];\n data[i] = coffs[0] * x + coffs[1] * y + x0;\n data[i + 1] = coffs[3] * x + coffs[4] * y + y0;\n }\n }\n /** Multiply each xy (as a vector) by matrix, replace values. */\n public multiplyMatrix3dInPlace(matrix: Matrix3d): void {\n const data = this._data;\n const nDouble = this.float64Length;\n const coffs = matrix.coffs;\n let x = 0;\n let y = 0;\n for (let i = 0; i + 1 < nDouble; i += 2) {\n x = data[i];\n y = data[i + 1];\n data[i] = coffs[0] * x + coffs[1] * y;\n data[i + 1] = coffs[3] * x + coffs[4] * y;\n }\n }\n /** Multiply each point by the transform, replace values. */\n public tryTransformInverseInPlace(transform: Transform): boolean {\n const data = this._data;\n const nDouble = this.float64Length;\n const matrix = transform.matrix;\n matrix.computeCachedInverse(true);\n const coffs = matrix.inverseCoffs;\n if (!coffs)\n return false;\n const origin = transform.origin;\n const x0 = origin.x;\n const y0 = origin.y;\n let x = 0;\n let y = 0;\n for (let i = 0; i + 1 < nDouble; i += 2) {\n x = data[i] - x0;\n y = data[i + 1] - y0;\n data[i] = coffs[0] * x + coffs[1] * y;\n data[i + 1] = coffs[3] * x + coffs[4] * y;\n }\n return true;\n }\n /** Extend a `Range2d`, optionally transforming the points. */\n public extendRange(rangeToExtend: Range2d, transform?: Transform): void {\n const numDouble = this.float64Length;\n const data = this._data;\n if (transform) {\n for (let i = 0; i + 1 < numDouble; i += 2)\n rangeToExtend.extendTransformedXY(transform, data[i], data[i + 1]);\n } else {\n for (let i = 0; i + 1 < numDouble; i += 2)\n rangeToExtend.extendXY(data[i], data[i + 1]);\n }\n }\n /** Sum the lengths of segments between points. */\n public sumLengths(): number {\n let sum = 0.0;\n const n = 2 * (this._xyInUse - 1); // Length already takes into account what specifically is in use\n const data = this._data;\n for (let i = 0; i < n; i += 2) sum += Geometry.hypotenuseXY(\n data[i + 2] - data[i],\n data[i + 3] - data[i + 1]);\n return sum;\n }\n /**\n * Multiply each x,y by the scale factor.\n * @param factor scale factor.\n */\n public scaleInPlace(factor: number): void {\n if (this._data) {\n const numFloat = this.float64Length;\n for (let i = 0; i < numFloat; i++)\n this._data[i] = this._data[i] * factor;\n }\n }\n /** Compute a point at fractional coordinate between points i and j. */\n public interpolate(i: number, fraction: number, j: number, result?: Point2d): Point2d | undefined {\n if (this.isIndexValid(i) && this.isIndexValid(j)) {\n const fraction0 = 1.0 - fraction;\n const data = this._data;\n i = 2 * i;\n j = 2 * j;\n return Point2d.create(\n fraction0 * data[i] + fraction * data[j],\n fraction0 * data[i + 1] + fraction * data[j + 1], result);\n }\n return undefined;\n }\n /** Sum the signed areas of the projection to xy plane. */\n public areaXY(): number {\n let area = 0.0;\n const n = 2 * this._xyInUse; // float count\n if (n > 4) {\n const x0 = this._data[n - 2];\n const y0 = this._data[n - 1];\n let dx1 = this._data[0] - x0;\n let dy1 = this._data[1] - y0;\n let dx2 = 0;\n let dy2 = 0;\n for (let i = 2; i < n; i += 2, dx1 = dx2, dy1 = dy2) {\n dx2 = this._data[i] - x0;\n dy2 = this._data[i + 1] - y0;\n area += Geometry.crossProductXYXY(dx1, dy1, dx2, dy2);\n }\n }\n return 0.5 * area;\n }\n /** Compute a vector from index origin i to indexed target j. */\n public override vectorIndexIndex(i: number, j: number, result?: Vector2d): Vector2d | undefined {\n if (!this.isIndexValid(i) || !this.isIndexValid(j))\n return undefined;\n const data = this._data;\n i = 2 * i;\n j = 2 * j;\n return Vector2d.create(data[j] - data[i], data[j + 1] - data[i + 1], result);\n }\n /** Compute a vector from origin to indexed target j. */\n public override vectorXAndYIndex(origin: XAndY, j: number, result?: Vector2d): Vector2d | undefined {\n if (this.isIndexValid(j)) {\n const data = this._data;\n j = 2 * j;\n return Vector2d.create(\n data[j] - origin.x,\n data[j + 1] - origin.y, result);\n }\n return undefined;\n }\n /** Compute the cross product of vectors from from indexed origin to indexed targets i and j. */\n public override crossProductIndexIndexIndex(\n originIndex: number, targetAIndex: number, targetBIndex: number,\n ): number | undefined {\n if (this.isIndexValid(originIndex) && this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {\n const i = originIndex * 2;\n const j = targetAIndex * 2;\n const k = targetBIndex * 2;\n const data = this._data;\n return Geometry.crossProductXYXY(\n data[j] - data[i], data[j + 1] - data[i + 1],\n data[k] - data[i], data[k + 1] - data[i + 1]);\n }\n return undefined;\n }\n /** Compute the cross product of vectors from from origin to indexed targets i and j. */\n public override crossProductXAndYIndexIndex(origin: XAndY, targetAIndex: number, targetBIndex: number): number | undefined {\n if (this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {\n const j = targetAIndex * 2;\n const k = targetBIndex * 2;\n const data = this._data;\n return Geometry.crossProductXYXY(\n data[j] - origin.x, data[j + 1] - origin.y,\n data[k] - origin.x, data[k + 1] - origin.y,\n );\n }\n return undefined;\n }\n /** Return the distance between two points in the array. */\n public distance(i: number, j: number): number | undefined {\n if (this.isIndexValid(i) && this.isIndexValid(j)) {\n const i0 = 2 * i;\n const j0 = 2 * j;\n return Geometry.hypotenuseXY(\n this._data[j0] - this._data[i0],\n this._data[j0 + 1] - this._data[i0 + 1],\n );\n }\n return undefined;\n }\n /** Return the distance between an array point and the input point. */\n public distanceIndexToPoint(i: number, spacePoint: Point2d): number | undefined {\n if (this.isIndexValid(i)) {\n const i0 = 2 * i;\n return Geometry.hypotenuseXY(\n spacePoint.x - this._data[i0],\n spacePoint.y - this._data[i0 + 1],\n );\n }\n return undefined;\n }\n /** Test for nearly equal arrays. */\n public static isAlmostEqual(dataA: GrowableXYArray | undefined, dataB: GrowableXYArray | undefined): boolean {\n if (dataA && dataB) {\n if (dataA.length !== dataB.length)\n return false;\n for (let i = 0; i < dataA.length; i++)\n if (!dataA.getPoint2dAtUncheckedPointIndex(i).isAlmostEqual(dataB.getPoint2dAtUncheckedPointIndex(i)))\n return false;\n return true;\n }\n // if both are null it is equal, otherwise unequal\n return (!dataA && !dataB);\n }\n /** Return an array of block indices sorted per compareLexicalBlock function. */\n public sortIndicesLexical(): Uint32Array {\n const n = this._xyInUse;\n // let numCompare = 0;\n const result = new Uint32Array(n);\n for (let i = 0; i < n; i++) result[i] = i;\n result.sort(\n (blockIndexA: number, blockIndexB: number) => {\n // numCompare++;\n return this.compareLexicalBlock(blockIndexA, blockIndexB);\n });\n // console.log (n, numCompare);\n return result;\n }\n /** compare two blocks in simple lexical order. */\n public compareLexicalBlock(ia: number, ib: number): number {\n let ax = 0;\n let bx = 0;\n for (let i = 0; i < 2; i++) {\n ax = this._data[ia * 2 + i];\n bx = this._data[ib * 2 + i];\n if (ax > bx)\n return 1;\n if (ax < bx)\n return -1;\n }\n return ia - ib; // so original order is maintained among duplicates\n }\n /** Access a single double at offset within a block. This has no index checking. */\n public component(pointIndex: number, componentIndex: number): number {\n return this._data[2 * pointIndex + componentIndex];\n }\n /** Toleranced equality test. */\n public isAlmostEqual(other: GrowableXYArray, tolerance: number = Geometry.smallMetricDistance): boolean {\n const numXY = this._xyInUse;\n if (other._xyInUse !== numXY)\n return false;\n const dataA = this._data;\n const dataB = other._data;\n for (let i = 0; i < 2 * numXY; i++) {\n if (Math.abs(dataA[i] - dataB[i]) > tolerance)\n return false;\n }\n return true;\n }\n}\n"]}
@@ -202,7 +202,7 @@ class IndexedXYZCollection {
202
202
  }
203
203
  /** Adjust index into range by modulo with the length. */
204
204
  cyclicIndex(i) {
205
- return (i % this.length);
205
+ return Geometry_1.Geometry.modulo(i, this.length);
206
206
  }
207
207
  /** Return the range of the points. */
208
208
  getRange(transform, result) {
@@ -1 +1 @@
1
- {"version":3,"file":"IndexedXYZCollection.js","sourceRoot":"","sources":["../../../src/geometry3d/IndexedXYZCollection.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAA+D;AAC/D,uDAA2D;AAC3D,mCAAkC;AAIlC,MAAM,cAAc;IACD,WAAW,CAAuB;IAC3C,SAAS,GAAG,CAAC,CAAC,CAAC;IACvB,YAAmB,UAAgC;QACjD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IACM,IAAI;QACT,IAAI,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;YAChD,wEAAwE;YACxE,kFAAkF;YAClF,OAAO,EAAE,IAAI,EAAE,IAAI,EAAoC,CAAC;QAC1D,CAAC;QACD,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,+BAA+B,CAAC,IAAI,CAAC,SAAS,CAAC;YACvE,IAAI,EAAE,KAAK;SACZ,CAAC;IACJ,CAAC;IACM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAwB,OAAO,IAAI,CAAC,CAAC,CAAC;CAC/D;AACD;;;;;;;;GAQG;AACH,MAAsB,oBAAoB;IA8BxC;;;;;;OAMG;IACI,yBAAyB,CAAC,MAAc,EAAE,MAAc,EAAE,MAAiB;QAChF,OAAO,0BAAQ,CAAC,oBAAoB,CAClC,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EACtC,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EACtC,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EACtC,I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AAC,CAAC;IAC1E,CAAC;IACD;;;;;;;OAOG;IACI,gCAAgC,CAAC,MAAc,EAAE,MAAc,EAAE,SAAS,GAAG,mBAAQ,CAAC,mBAAmB;QAC9G,OAAO,mBAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;eACtH,mBAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;IAC5H,CAAC;IACD,+DAA+D;IACxD,mCAAmC,CAAC,UAAkB,EAAE,KAA6B;QAC1F,OAAO,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,yBAAyB,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,yBAAyB,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,yBAAyB,CAAC,UAAU,CAAC,CAAC,CAAC;IAC/J,CAAC;CACF;AA/cD,oDA+cC;AAED;;;GAGG;AACH,MAAsB,6BAA8B,SAAQ,oBAAoB;IAW9E,yGAAyG;IAClG,wBAAwB,CAAC,MAA4B;QAC1D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE;YACpC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9H,OAAO,MAAM,CAAC,MAAM,CAAC;IACvB,CAAC;CACF;AAjBD,sEAiBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module ArraysAndInterfaces\n */\n\nimport { Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { Point3d, Vector3d, XYZ } from \"./Point3dVector3d\";\nimport { Range3d } from \"./Range\";\nimport { Transform } from \"./Transform\";\nimport { XAndY, XYAndZ } from \"./XYZProps\";\n\nclass PointsIterator implements Iterator<Point3d>, Iterable<Point3d> {\n private readonly _collection: IndexedXYZCollection;\n private _curIndex = -1;\n public constructor(collection: IndexedXYZCollection) {\n this._collection = collection;\n }\n public next(): IteratorResult<Point3d> {\n if (++this._curIndex >= this._collection.length) {\n // the ECMAScript spec states that value=undefined is valid if done=true\n // the TypeScript interface violates the spec hence the cast to any and back below\n return { done: true } as any as IteratorResult<Point3d>;\n }\n return {\n value: this._collection.getPoint3dAtUncheckedPointIndex(this._curIndex),\n done: false,\n };\n }\n public [Symbol.iterator](): Iterator<Point3d> { return this; }\n}\n/**\n * Abstract base class for read-only access to XYZ data with indexed reference.\n * * This allows algorithms to work with Point3d[] or [[GrowableXYZArray]].\n * * GrowableXYZArray implements these for its data.\n * * Point3dArrayCarrier carries a (reference to) a Point3d[] and implements the methods with calls on that array reference.\n * * In addition to \"point by point\" accessors, other abstract members compute commonly useful vector data \"between points\".\n * * Methods that create vectors among multiple indices allow callers to avoid creating temporaries.\n * @public\n */\nexport abstract class IndexedXYZCollection {\n /**\n * Return the point at `index` as a strongly typed Point3d.\n * @param index index of point within the array.\n * @param result caller-allocated destination.\n * @returns undefined if the index is out of bounds.\n */\n public abstract getPoint3dAtCheckedPointIndex(index: number, result?: Point3d): Point3d | undefined;\n /**\n * Return the point at `index` as a strongly typed Point3d, without checking the point index validity.\n * * Use [[getPoint3dAtCheckedPointIndex]] to have index validity test.\n * @param index index of point within the array.\n * @param result caller-allocated destination.\n */\n public abstract getPoint3dAtUncheckedPointIndex(index: number, result?: Point3d): Point3d;\n /**\n * Get from `index` as a strongly typed Vector3d.\n * @param index index of point within the array.\n * @param result caller-allocated destination.\n * @returns undefined if the index is out of bounds.\n */\n public abstract getVector3dAtCheckedVectorIndex(index: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return a vector from the point at `indexA` to the point at `indexB`.\n * @param indexA index of point within the array.\n * @param indexB index of point within the array.\n * @param result caller-allocated vector.\n * @returns undefined if either index is out of bounds.\n */\n public abstract vectorIndexIndex(indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return a vector from the point at `indexA` to the point at `indexB`.\n * * This method does not check for index validity. Use [[vectorIndexIndex]] to have validity test.\n * @param indexA index of point within the array.\n * @param indexB index of point within the array.\n * @param result caller-allocated vector.\n */\n public vectorUncheckedIndexIndex(indexA: number, indexB: number, result?: Vector3d): Vector3d {\n return Vector3d.createStartEndXYZXYZ(\n this.getXAtUncheckedPointIndex(indexA),\n this.getYAtUncheckedPointIndex(indexA),\n this.getZAtUncheckedPointIndex(indexA),\n this.getXAtUncheckedPointIndex(indexB),\n this.getYAtUncheckedPointIndex(indexB),\n this.getZAtUncheckedPointIndex(indexB),\n result,\n );\n }\n /**\n * Return a vector from `origin` to the point at `indexB`.\n * @param origin origin for vector.\n * @param indexB index of point within the array.\n * @param result caller-allocated vector.\n * @returns undefined if index is out of bounds.\n */\n public abstract vectorXYAndZIndex(origin: XYAndZ, indexB: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return a vector from `origin` to the point at `indexB`.\n * * This method does not check for index validity. Use [[vectorXYAndZIndex]] to have validity test.\n * @param origin origin for vector.\n * @param indexB index of point within the array.\n * @param result caller-allocated vector.\n */\n public vectorXYAndZUncheckedIndex(origin: XYAndZ, indexB: number, result?: Vector3d): Vector3d {\n return Vector3d.createStartEndXYZXYZ(\n origin.x,\n origin.y,\n origin.z,\n this.getXAtUncheckedPointIndex(indexB),\n this.getYAtUncheckedPointIndex(indexB),\n this.getZAtUncheckedPointIndex(indexB),\n result,\n );\n }\n /**\n * Return a vector from the point at `indexA` to `target`.\n * @param indexA index of point within the array.\n * @param target target for vector.\n * @param result caller-allocated vector.\n * @returns undefined if index is out of bounds.\n */\n public vectorIndexXYAndZ(indexA: number, target: XYAndZ, result?: Vector3d): Vector3d | undefined {\n const reversed = this.vectorXYAndZIndex(target, indexA, result);\n return reversed?.negate(reversed);\n }\n /**\n * Return the dot product of the vectors from the point at `origin` to the points at `indexA` and `indexB`.\n * @param origin index of point within the array; origin of both vectors.\n * @param indexA index of point within the array; target of the first vector.\n * @param indexB index of point within the array; target of the second vector.\n * @returns undefined if index is out of bounds.\n */\n public dotProductIndexIndexIndex(origin: number, indexA: number, indexB: number): number | undefined {\n if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length || indexB < 0 || indexB >= this.length)\n return undefined;\n const x0 = this.getXAtUncheckedPointIndex(origin);\n const y0 = this.getYAtUncheckedPointIndex(origin);\n const z0 = this.getZAtUncheckedPointIndex(origin);\n return (this.getXAtUncheckedPointIndex(indexA) - x0) * (this.getXAtUncheckedPointIndex(indexB) - x0) +\n (this.getYAtUncheckedPointIndex(indexA) - y0) * (this.getYAtUncheckedPointIndex(indexB) - y0) +\n (this.getZAtUncheckedPointIndex(indexA) - z0) * (this.getZAtUncheckedPointIndex(indexB) - z0);\n }\n /**\n * Return the dot product of the vectors from the point at `origin` to the point at `indexA` and to `targetB`.\n * @param origin index of point within the array; origin of both vectors.\n * @param indexA index of point within the array; target of the first vector.\n * @param targetB target for second vector.\n * @returns undefined if index is out of bounds.\n */\n public dotProductIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ): number | undefined {\n if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length)\n return undefined;\n return this.dotProductUncheckedIndexIndexXYAndZ(origin, indexA, targetB);\n }\n /**\n * Return the dot product of the vectors from the point at `origin` to the point at `indexA` and to `targetB`.\n * * This method does not check for index validity. Use [[dotProductIndexIndexXYAndZ]] to have validity test.\n * @param origin index of point within the array; origin of both vectors.\n * @param indexA index of point within the array; target of the first vector.\n * @param targetB target for second vector.\n */\n public dotProductUncheckedIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ): number {\n const x0 = this.getXAtUncheckedPointIndex(origin);\n const y0 = this.getYAtUncheckedPointIndex(origin);\n const z0 = this.getZAtUncheckedPointIndex(origin);\n return (this.getXAtUncheckedPointIndex(indexA) - x0) * (targetB.x - x0) +\n (this.getYAtUncheckedPointIndex(indexA) - y0) * (targetB.y - y0) +\n (this.getZAtUncheckedPointIndex(indexA) - z0) * (targetB.z - z0);\n }\n /**\n * Return the cross product of the vectors from `origin` to points at `indexA` and `indexB`.\n * @param origin origin for vector.\n * @param indexA index of first target within the array.\n * @param indexB index of second target within the array.\n * @param result caller-allocated vector.\n * @returns undefined if either index is out of bounds.\n */\n public abstract crossProductXYAndZIndexIndex(origin: XYAndZ, indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return the cross product of the vectors from `origin` to the point at `indexA` and to `targetB`.\n * @param origin index of point within the array; origin of both vectors.\n * @param indexA index of point within the array; target of the first vector.\n * @param targetB target of second vector.\n * @param result optional caller-allocated result to fill and return.\n * @returns undefined if an index is out of bounds.\n */\n public crossProductIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ, result?: Vector3d): Vector3d | undefined {\n if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length)\n return undefined;\n return this.crossProductUncheckedIndexIndexXYAndZ(origin, indexA, targetB, result);\n }\n /**\n * Return the cross product of the vectors from `origin` to the point at `indexA` and to `targetB.\n * * This method does not check for index validity. Use [[crossProductIndexIndexXYAndZ]] to have validity test.\n * @param origin index of point within the array; origin of both vectors.\n * @param indexA index of point within the array; target of the first vector.\n * @param targetB target of second vector.\n * @param result optional caller-allocated result to fill and return.\n */\n public crossProductUncheckedIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ, result?: Vector3d): Vector3d {\n const x0 = this.getXAtUncheckedPointIndex(origin);\n const y0 = this.getYAtUncheckedPointIndex(origin);\n const z0 = this.getZAtUncheckedPointIndex(origin);\n return Vector3d.createCrossProduct(\n this.getXAtUncheckedPointIndex(indexA) - x0,\n this.getYAtUncheckedPointIndex(indexA) - y0,\n this.getZAtUncheckedPointIndex(indexA) - z0,\n targetB.x - x0,\n targetB.y - y0,\n targetB.z - z0,\n result,\n );\n }\n /**\n * Return the cross product of vectors from `origin` to points at `indexA` and `indexB`.\n * @param origin origin for vector.\n * @param indexA index of first target within the array.\n * @param indexB index of second target within the array.\n * @param result optional caller-allocated vector.\n * @returns undefined if either index is out of bounds.\n */\n public abstract crossProductIndexIndexIndex(origin: number, indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return the cross product of vectors from the point at `origin` to points at `indexA` and `indexB`.\n * * This method does not check for index validity. Use [[crossProductIndexIndexIndex]] to have validity test.\n * @param origin origin for vector.\n * @param indexA index of first target within the array.\n * @param indexB index of second target within the array.\n * @param result optional caller-allocated vector.\n */\n public crossProductUncheckedIndexIndexIndex(origin: number, indexA: number, indexB: number, result?: Vector3d): Vector3d {\n const x0 = this.getXAtUncheckedPointIndex(origin);\n const y0 = this.getYAtUncheckedPointIndex(origin);\n const z0 = this.getZAtUncheckedPointIndex(origin);\n return Vector3d.createCrossProduct(\n this.getXAtUncheckedPointIndex(indexA) - x0,\n this.getYAtUncheckedPointIndex(indexA) - y0,\n this.getZAtUncheckedPointIndex(indexA) - z0,\n this.getXAtUncheckedPointIndex(indexB) - x0,\n this.getYAtUncheckedPointIndex(indexB) - y0,\n this.getZAtUncheckedPointIndex(indexB) - z0,\n result,\n );\n }\n /**\n * Compute the cross product from indexed `origin` to targets at indices `indexA` and `indexB`, and add it to `result`.\n * @param origin index of origin.\n * @param indexA index of first target within the array.\n * @param indexB index of second target within the array.\n * @param result caller-allocated vector.\n */\n public abstract accumulateCrossProductIndexIndexIndex(origin: number, indexA: number, indexB: number, result: Vector3d): void;\n /** Read-only property for number of XYZ in the collection. */\n public abstract get length(): number;\n /**\n * Return distance squared between indicated points.\n * @param index0 first point index.\n * @param index1 second point index.\n */\n public abstract distanceSquaredIndexIndex(index0: number, index1: number): number | undefined;\n /**\n * Return distance squared between indicated points.\n * * This method does not check for index validity. Use [[distanceSquaredIndexIndex]] to have validity test.\n * @param index0 first point index.\n * @param index1 second point index.\n */\n public distanceSquaredUncheckedIndexIndex(index0: number, index1: number): number {\n return Geometry.hypotenuseSquaredXYZ(\n this.getXAtUncheckedPointIndex(index1) - this.getXAtUncheckedPointIndex(index0),\n this.getYAtUncheckedPointIndex(index1) - this.getYAtUncheckedPointIndex(index0),\n this.getZAtUncheckedPointIndex(index1) - this.getZAtUncheckedPointIndex(index0),\n );\n }\n /**\n * Return distance squared between the point at index0 and target.\n * @param index0 first point index.\n * @param target second point.\n */\n public distanceSquaredIndexXYAndZ(index0: number, target: XYAndZ): number | undefined {\n if (index0 < 0 || index0 >= this.length)\n return undefined;\n return this.distanceSquaredUncheckedIndexXYAndZ(index0, target);\n }\n /**\n * Return distance squared between the point at index0 and target.\n * * This method does not check for index validity. Use [[distanceSquaredIndexXYAndZ]] to have validity test.\n * @param index0 first point index.\n * @param target second point.\n */\n public distanceSquaredUncheckedIndexXYAndZ(index0: number, target: XYAndZ): number {\n return Geometry.hypotenuseSquaredXYZ(\n target.x - this.getXAtUncheckedPointIndex(index0),\n target.y - this.getYAtUncheckedPointIndex(index0),\n target.z - this.getZAtUncheckedPointIndex(index0),\n );\n }\n /**\n * Return distance between indicated points.\n * @param index0 first point index.\n * @param index1 second point index.\n */\n public abstract distanceIndexIndex(index0: number, index1: number): number | undefined;\n /**\n * Return distance between indicated points.\n * * This method does not check for index validity. Use [[distanceIndexIndex]] to have validity test.\n * @param index0 first point index.\n * @param index1 second point index.\n */\n public distanceUncheckedIndexIndex(index0: number, index1: number): number {\n return Geometry.hypotenuseXYZ(\n this.getXAtUncheckedPointIndex(index1) - this.getXAtUncheckedPointIndex(index0),\n this.getYAtUncheckedPointIndex(index1) - this.getYAtUncheckedPointIndex(index0),\n this.getZAtUncheckedPointIndex(index1) - this.getZAtUncheckedPointIndex(index0),\n );\n }\n /**\n * Test if index is valid for an xyz within this array.\n * @param index xyz index to test.\n */\n public isIndexValid(index: number): boolean {\n return index >= 0 && index < this.length;\n }\n /** Adjust index into range by modulo with the length. */\n public cyclicIndex(i: number): number {\n return (i % this.length);\n }\n /** Return the range of the points. */\n public getRange(transform?: Transform, result?: Range3d): Range3d {\n let range = result;\n if (range)\n range.setNull();\n else\n range = Range3d.createNull();\n const n = this.length;\n const point = Point3d.create();\n for (let i = 0; i < n; i++) {\n this.getPoint3dAtUncheckedPointIndex(i, point);\n range.extendPoint(point, transform);\n }\n return range;\n }\n /**\n * For each subset of `k` successive points within tolerance of the first point in the subset, return the indices of\n * the last `k-1` duplicates.\n * * Index `0` is never returned.\n * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]]).\n * @param preserveLast if the last `k < this.length` points of the instance are duplicates, whether to return the\n * indices of the *first* `k-1` duplicates for this last run. If true, index `this.length - 1` is not returned.\n * unless all points are duplicates, in which case all indices but `0` are returned. Default value is false.\n * @return ordered array of 0-based indices of duplicate points\n */\n public findOrderedDuplicates(tolerance: number = Geometry.smallMetricDistance, preserveLast: boolean = false): number[] {\n const indices: number[] = [];\n if (this.length > 1) {\n for (let i = 0; i < this.length - 1;) {\n let j = i + 1;\n for (; this.almostEqualIndexIndex(i, j, tolerance); ++j)\n indices.push(j);\n i = j; // found next unique point\n }\n if (preserveLast && indices.length > 0 && indices.length < this.length - 1) { // not all points are duplicate\n let numLastRun = 0;\n for (; numLastRun <= indices.length - 1 && indices[indices.length - 1 - numLastRun] === this.length - 1 - numLastRun; ++numLastRun);\n for (let i = 0; i < numLastRun; ++i)\n indices[indices.length - 1 - i] -= 1; // decrement the indices of the last run so that the last point is preserved\n }\n }\n return indices;\n }\n /**\n * Accumulate scale times the x,y,z values at index.\n * * No action if index is out of bounds.\n */\n public abstract accumulateScaledXYZ(index: number, scale: number, sum: Point3d): void;\n /**\n * Compute the linear combination s of the indexed p_i and given scales s_i.\n * @param scales array of scales. For best results, scales should have same length as the instance.\n * @param result optional pre-allocated object to fill and return\n * @return s = sum(p_i * s_i), where i ranges from 0 to min(this.length, scales.length).\n */\n public linearCombination(scales: number[], result?: Point3d | Vector3d): XYZ {\n const n = Math.min(this.length, scales.length);\n const sum = (result instanceof Vector3d) ? Vector3d.createZero(result) : Point3d.createZero(result);\n for (let i = 0; i < n; ++i) {\n sum.x += scales[i] * this.getXAtUncheckedPointIndex(i);\n sum.y += scales[i] * this.getYAtUncheckedPointIndex(i);\n sum.z += scales[i] * this.getZAtUncheckedPointIndex(i);\n }\n return sum;\n }\n /**\n * Interpolate the points at the given indices.\n * @param index0 index of point p0 within the array.\n * @param fraction fraction f such that returned point is p0 + f * (p1 - p0).\n * @param index1 index of point p1 within the array.\n * @param result optional caller-allocated result to fill and return.\n * @returns undefined if an index is out of bounds.\n */\n public interpolateIndexIndex(index0: number, fraction: number, index1: number, result?: Point3d): Point3d | undefined {\n if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)\n return undefined;\n return this.interpolateUncheckedIndexIndex(index0, fraction, index1, result);\n }\n /**\n * Interpolate the points at the given indices.\n * * This method does not check for index validity. Use [[interpolateIndexIndex]] to have validity test.\n * @param index0 index of point p0 within the array.\n * @param fraction fraction f such that returned point is p0 + f * (p1 - p0).\n * @param index1 index of point p1 within the array.\n * @param result optional caller-allocated result to fill and return.\n */\n public interpolateUncheckedIndexIndex(index0: number, fraction: number, index1: number, result?: Point3d): Point3d {\n return Point3d.create(Geometry.interpolate(this.getXAtUncheckedPointIndex(index0), fraction, this.getXAtUncheckedPointIndex(index1)),\n Geometry.interpolate(this.getYAtUncheckedPointIndex(index0), fraction, this.getYAtUncheckedPointIndex(index1)),\n Geometry.interpolate(this.getZAtUncheckedPointIndex(index0), fraction, this.getZAtUncheckedPointIndex(index1)), result);\n }\n /** Access x of indexed point. */\n public abstract getXAtUncheckedPointIndex(pointIndex: number): number;\n /** Access y of indexed point. */\n public abstract getYAtUncheckedPointIndex(pointIndex: number): number;\n /** Access z of indexed point. */\n public abstract getZAtUncheckedPointIndex(pointIndex: number): number;\n /**\n * Return iterator over the points in this collection. Usage:\n * ```ts\n * for (const point: Point3d of collection.points) { ... }\n * ```\n */\n public get points(): Iterable<Point3d> {\n return new PointsIterator(this);\n }\n /** Convert to Point3d[]. */\n public getArray(): Point3d[] {\n const result = [];\n for (const p of this.points)\n result.push(p);\n return result;\n }\n /** Return the first point, or undefined if the array is empty. */\n public front(result?: Point3d): Point3d | undefined {\n if (this.length === 0)\n return undefined;\n return this.getPoint3dAtUncheckedPointIndex(0, result);\n }\n /** Return the last point, or undefined if the array is empty. */\n public back(result?: Point3d): Point3d | undefined {\n if (this.length === 0)\n return undefined;\n return this.getPoint3dAtUncheckedPointIndex(this.length - 1, result);\n }\n /**\n * Test whether the indexed points are equal within tolerance.\n * @param index0 index of first point.\n * @param index1 index of second point.\n * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.\n * @returns whether the points are equal within tolerance, or `undefined` if either index is invalid.\n */\n public almostEqualIndexIndex(index0: number, index1: number, tolerance = Geometry.smallMetricDistance): boolean | undefined {\n if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)\n return undefined;\n return this.almostEqualUncheckedIndexIndex(index0, index1, tolerance);\n }\n /**\n * Test whether the indexed points are equal within tolerance.\n * * This method does not check for index validity. Use [[almostEqualIndexIndex]] to have validity test.\n * @param index0 index of first point.\n * @param index1 index of second point.\n * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.\n * @returns whether the points are equal within tolerance.\n */\n public almostEqualUncheckedIndexIndex(index0: number, index1: number, tolerance = Geometry.smallMetricDistance): boolean {\n return Geometry.isSameCoordinate(this.getXAtUncheckedPointIndex(index0), this.getXAtUncheckedPointIndex(index1), tolerance)\n && Geometry.isSameCoordinate(this.getYAtUncheckedPointIndex(index0), this.getYAtUncheckedPointIndex(index1), tolerance)\n && Geometry.isSameCoordinate(this.getZAtUncheckedPointIndex(index0), this.getZAtUncheckedPointIndex(index1), tolerance);\n }\n /**\n * Test whether the xy-coordinates of the indexed points are equal within tolerance. The z-coordinates are ignored.\n * @param index0 index of first point.\n * @param index1 index of second point.\n * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.\n * @returns whether the xy-coordinates of the points are equal within tolerance, or `undefined` if either index is invalid.\n */\n public almostEqualXYIndexIndex(index0: number, index1: number, tolerance = Geometry.smallMetricDistance): boolean | undefined {\n if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)\n return undefined;\n return this.almostEqualXYUncheckedIndexIndex(index0, index1, tolerance);\n }\n /**\n * Test whether the xy-coordinates of the indexed points are equal within tolerance. The z-coordinates are ignored.\n * * This method does not check for index validity. Use [[almostEqualXYIndexIndex]] to have validity test.\n * @param index0 index of first point.\n * @param index1 index of second point.\n * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.\n * @returns whether the xy-coordinates of the points are equal within tolerance.\n */\n public almostEqualXYUncheckedIndexIndex(index0: number, index1: number, tolerance = Geometry.smallMetricDistance): boolean {\n return Geometry.isSameCoordinate(this.getXAtUncheckedPointIndex(index0), this.getXAtUncheckedPointIndex(index1), tolerance)\n && Geometry.isSameCoordinate(this.getYAtUncheckedPointIndex(index0), this.getYAtUncheckedPointIndex(index1), tolerance);\n }\n /** Return the altitude of the indexed point from the plane. */\n public evaluateUncheckedIndexPlaneAltitude(pointIndex: number, plane: PlaneAltitudeEvaluator): number {\n return plane.altitudeXYZ(this.getXAtUncheckedPointIndex(pointIndex), this.getYAtUncheckedPointIndex(pointIndex), this.getZAtUncheckedPointIndex(pointIndex));\n }\n}\n\n/**\n * Abstract base class extends [[IndexedXYZCollection]] with methods that modify the collection.\n * @public\n */\nexport abstract class IndexedReadWriteXYZCollection extends IndexedXYZCollection {\n /** Push a (clone of) point onto the collection. */\n public abstract push(point: XYAndZ): void;\n /** Push a new point (given by xyz coordinates) onto the collection. */\n public abstract pushXYZ(x?: number, y?: number, z?: number): void;\n /** Remove the final point. */\n public abstract pop(): void;\n /** Remove all entries. */\n public abstract clear(): void;\n /** Reverse the points in place. */\n public abstract reverseInPlace(): void;\n /** Push points from the source array to the end of this array and return the number of points pushed. */\n public pushIndexedXYZCollection(source: IndexedXYZCollection): number {\n for (let i = 0; i < source.length; i++)\n this.pushXYZ(source.getXAtUncheckedPointIndex(i), source.getYAtUncheckedPointIndex(i), source.getZAtUncheckedPointIndex(i));\n return source.length;\n }\n}\n\n/**\n * Type for use as signature for xyz data of a single linestring appearing in a parameter list.\n * @public\n */\nexport type LineStringDataVariant = IndexedXYZCollection | XYAndZ[] | XAndY[] | number[][];\n\n/**\n * Type for use as signature for multiple xyz data of multiple linestrings appearing in a parameter list.\n * @public\n */\nexport type MultiLineStringDataVariant = LineStringDataVariant | LineStringDataVariant[];\n"]}
1
+ {"version":3,"file":"IndexedXYZCollection.js","sourceRoot":"","sources":["../../../src/geometry3d/IndexedXYZCollection.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAA+D;AAC/D,uDAA2D;AAC3D,mCAAkC;AAIlC,MAAM,cAAc;IACD,WAAW,CAAuB;IAC3C,SAAS,GAAG,CAAC,CAAC,CAAC;IACvB,YAAmB,UAAgC;QACjD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IACM,IAAI;QACT,IAAI,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;YAChD,wEAAwE;YACxE,kFAAkF;YAClF,OAAO,EAAE,IAAI,EAAE,IAAI,EAAoC,CAAC;QAC1D,CAAC;QACD,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,+BAA+B,CAAC,IAAI,CAAC,SAAS,CAAC;YACvE,IAAI,EAAE,KAAK;SACZ,CAAC;IACJ,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AC,MAAM,EAAE,CAAC,EAAE;YACpC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9H,OAAO,MAAM,CAAC,MAAM,CAAC;IACvB,CAAC;CACF;AAjBD,sEAiBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module ArraysAndInterfaces\n */\n\nimport { Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { Point3d, Vector3d, XYZ } from \"./Point3dVector3d\";\nimport { Range3d } from \"./Range\";\nimport { Transform } from \"./Transform\";\nimport { XAndY, XYAndZ } from \"./XYZProps\";\n\nclass PointsIterator implements Iterator<Point3d>, Iterable<Point3d> {\n private readonly _collection: IndexedXYZCollection;\n private _curIndex = -1;\n public constructor(collection: IndexedXYZCollection) {\n this._collection = collection;\n }\n public next(): IteratorResult<Point3d> {\n if (++this._curIndex >= this._collection.length) {\n // the ECMAScript spec states that value=undefined is valid if done=true\n // the TypeScript interface violates the spec hence the cast to any and back below\n return { done: true } as any as IteratorResult<Point3d>;\n }\n return {\n value: this._collection.getPoint3dAtUncheckedPointIndex(this._curIndex),\n done: false,\n };\n }\n public [Symbol.iterator](): Iterator<Point3d> { return this; }\n}\n/**\n * Abstract base class for read-only access to XYZ data with indexed reference.\n * * This allows algorithms to work with Point3d[] or [[GrowableXYZArray]].\n * * GrowableXYZArray implements these for its data.\n * * Point3dArrayCarrier carries a (reference to) a Point3d[] and implements the methods with calls on that array reference.\n * * In addition to \"point by point\" accessors, other abstract members compute commonly useful vector data \"between points\".\n * * Methods that create vectors among multiple indices allow callers to avoid creating temporaries.\n * @public\n */\nexport abstract class IndexedXYZCollection {\n /**\n * Return the point at `index` as a strongly typed Point3d.\n * @param index index of point within the array.\n * @param result caller-allocated destination.\n * @returns undefined if the index is out of bounds.\n */\n public abstract getPoint3dAtCheckedPointIndex(index: number, result?: Point3d): Point3d | undefined;\n /**\n * Return the point at `index` as a strongly typed Point3d, without checking the point index validity.\n * * Use [[getPoint3dAtCheckedPointIndex]] to have index validity test.\n * @param index index of point within the array.\n * @param result caller-allocated destination.\n */\n public abstract getPoint3dAtUncheckedPointIndex(index: number, result?: Point3d): Point3d;\n /**\n * Get from `index` as a strongly typed Vector3d.\n * @param index index of point within the array.\n * @param result caller-allocated destination.\n * @returns undefined if the index is out of bounds.\n */\n public abstract getVector3dAtCheckedVectorIndex(index: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return a vector from the point at `indexA` to the point at `indexB`.\n * @param indexA index of point within the array.\n * @param indexB index of point within the array.\n * @param result caller-allocated vector.\n * @returns undefined if either index is out of bounds.\n */\n public abstract vectorIndexIndex(indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return a vector from the point at `indexA` to the point at `indexB`.\n * * This method does not check for index validity. Use [[vectorIndexIndex]] to have validity test.\n * @param indexA index of point within the array.\n * @param indexB index of point within the array.\n * @param result caller-allocated vector.\n */\n public vectorUncheckedIndexIndex(indexA: number, indexB: number, result?: Vector3d): Vector3d {\n return Vector3d.createStartEndXYZXYZ(\n this.getXAtUncheckedPointIndex(indexA),\n this.getYAtUncheckedPointIndex(indexA),\n this.getZAtUncheckedPointIndex(indexA),\n this.getXAtUncheckedPointIndex(indexB),\n this.getYAtUncheckedPointIndex(indexB),\n this.getZAtUncheckedPointIndex(indexB),\n result,\n );\n }\n /**\n * Return a vector from `origin` to the point at `indexB`.\n * @param origin origin for vector.\n * @param indexB index of point within the array.\n * @param result caller-allocated vector.\n * @returns undefined if index is out of bounds.\n */\n public abstract vectorXYAndZIndex(origin: XYAndZ, indexB: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return a vector from `origin` to the point at `indexB`.\n * * This method does not check for index validity. Use [[vectorXYAndZIndex]] to have validity test.\n * @param origin origin for vector.\n * @param indexB index of point within the array.\n * @param result caller-allocated vector.\n */\n public vectorXYAndZUncheckedIndex(origin: XYAndZ, indexB: number, result?: Vector3d): Vector3d {\n return Vector3d.createStartEndXYZXYZ(\n origin.x,\n origin.y,\n origin.z,\n this.getXAtUncheckedPointIndex(indexB),\n this.getYAtUncheckedPointIndex(indexB),\n this.getZAtUncheckedPointIndex(indexB),\n result,\n );\n }\n /**\n * Return a vector from the point at `indexA` to `target`.\n * @param indexA index of point within the array.\n * @param target target for vector.\n * @param result caller-allocated vector.\n * @returns undefined if index is out of bounds.\n */\n public vectorIndexXYAndZ(indexA: number, target: XYAndZ, result?: Vector3d): Vector3d | undefined {\n const reversed = this.vectorXYAndZIndex(target, indexA, result);\n return reversed?.negate(reversed);\n }\n /**\n * Return the dot product of the vectors from the point at `origin` to the points at `indexA` and `indexB`.\n * @param origin index of point within the array; origin of both vectors.\n * @param indexA index of point within the array; target of the first vector.\n * @param indexB index of point within the array; target of the second vector.\n * @returns undefined if index is out of bounds.\n */\n public dotProductIndexIndexIndex(origin: number, indexA: number, indexB: number): number | undefined {\n if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length || indexB < 0 || indexB >= this.length)\n return undefined;\n const x0 = this.getXAtUncheckedPointIndex(origin);\n const y0 = this.getYAtUncheckedPointIndex(origin);\n const z0 = this.getZAtUncheckedPointIndex(origin);\n return (this.getXAtUncheckedPointIndex(indexA) - x0) * (this.getXAtUncheckedPointIndex(indexB) - x0) +\n (this.getYAtUncheckedPointIndex(indexA) - y0) * (this.getYAtUncheckedPointIndex(indexB) - y0) +\n (this.getZAtUncheckedPointIndex(indexA) - z0) * (this.getZAtUncheckedPointIndex(indexB) - z0);\n }\n /**\n * Return the dot product of the vectors from the point at `origin` to the point at `indexA` and to `targetB`.\n * @param origin index of point within the array; origin of both vectors.\n * @param indexA index of point within the array; target of the first vector.\n * @param targetB target for second vector.\n * @returns undefined if index is out of bounds.\n */\n public dotProductIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ): number | undefined {\n if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length)\n return undefined;\n return this.dotProductUncheckedIndexIndexXYAndZ(origin, indexA, targetB);\n }\n /**\n * Return the dot product of the vectors from the point at `origin` to the point at `indexA` and to `targetB`.\n * * This method does not check for index validity. Use [[dotProductIndexIndexXYAndZ]] to have validity test.\n * @param origin index of point within the array; origin of both vectors.\n * @param indexA index of point within the array; target of the first vector.\n * @param targetB target for second vector.\n */\n public dotProductUncheckedIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ): number {\n const x0 = this.getXAtUncheckedPointIndex(origin);\n const y0 = this.getYAtUncheckedPointIndex(origin);\n const z0 = this.getZAtUncheckedPointIndex(origin);\n return (this.getXAtUncheckedPointIndex(indexA) - x0) * (targetB.x - x0) +\n (this.getYAtUncheckedPointIndex(indexA) - y0) * (targetB.y - y0) +\n (this.getZAtUncheckedPointIndex(indexA) - z0) * (targetB.z - z0);\n }\n /**\n * Return the cross product of the vectors from `origin` to points at `indexA` and `indexB`.\n * @param origin origin for vector.\n * @param indexA index of first target within the array.\n * @param indexB index of second target within the array.\n * @param result caller-allocated vector.\n * @returns undefined if either index is out of bounds.\n */\n public abstract crossProductXYAndZIndexIndex(origin: XYAndZ, indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return the cross product of the vectors from `origin` to the point at `indexA` and to `targetB`.\n * @param origin index of point within the array; origin of both vectors.\n * @param indexA index of point within the array; target of the first vector.\n * @param targetB target of second vector.\n * @param result optional caller-allocated result to fill and return.\n * @returns undefined if an index is out of bounds.\n */\n public crossProductIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ, result?: Vector3d): Vector3d | undefined {\n if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length)\n return undefined;\n return this.crossProductUncheckedIndexIndexXYAndZ(origin, indexA, targetB, result);\n }\n /**\n * Return the cross product of the vectors from `origin` to the point at `indexA` and to `targetB.\n * * This method does not check for index validity. Use [[crossProductIndexIndexXYAndZ]] to have validity test.\n * @param origin index of point within the array; origin of both vectors.\n * @param indexA index of point within the array; target of the first vector.\n * @param targetB target of second vector.\n * @param result optional caller-allocated result to fill and return.\n */\n public crossProductUncheckedIndexIndexXYAndZ(origin: number, indexA: number, targetB: XYAndZ, result?: Vector3d): Vector3d {\n const x0 = this.getXAtUncheckedPointIndex(origin);\n const y0 = this.getYAtUncheckedPointIndex(origin);\n const z0 = this.getZAtUncheckedPointIndex(origin);\n return Vector3d.createCrossProduct(\n this.getXAtUncheckedPointIndex(indexA) - x0,\n this.getYAtUncheckedPointIndex(indexA) - y0,\n this.getZAtUncheckedPointIndex(indexA) - z0,\n targetB.x - x0,\n targetB.y - y0,\n targetB.z - z0,\n result,\n );\n }\n /**\n * Return the cross product of vectors from `origin` to points at `indexA` and `indexB`.\n * @param origin origin for vector.\n * @param indexA index of first target within the array.\n * @param indexB index of second target within the array.\n * @param result optional caller-allocated vector.\n * @returns undefined if either index is out of bounds.\n */\n public abstract crossProductIndexIndexIndex(origin: number, indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined;\n /**\n * Return the cross product of vectors from the point at `origin` to points at `indexA` and `indexB`.\n * * This method does not check for index validity. Use [[crossProductIndexIndexIndex]] to have validity test.\n * @param origin origin for vector.\n * @param indexA index of first target within the array.\n * @param indexB index of second target within the array.\n * @param result optional caller-allocated vector.\n */\n public crossProductUncheckedIndexIndexIndex(origin: number, indexA: number, indexB: number, result?: Vector3d): Vector3d {\n const x0 = this.getXAtUncheckedPointIndex(origin);\n const y0 = this.getYAtUncheckedPointIndex(origin);\n const z0 = this.getZAtUncheckedPointIndex(origin);\n return Vector3d.createCrossProduct(\n this.getXAtUncheckedPointIndex(indexA) - x0,\n this.getYAtUncheckedPointIndex(indexA) - y0,\n this.getZAtUncheckedPointIndex(indexA) - z0,\n this.getXAtUncheckedPointIndex(indexB) - x0,\n this.getYAtUncheckedPointIndex(indexB) - y0,\n this.getZAtUncheckedPointIndex(indexB) - z0,\n result,\n );\n }\n /**\n * Compute the cross product from indexed `origin` to targets at indices `indexA` and `indexB`, and add it to `result`.\n * @param origin index of origin.\n * @param indexA index of first target within the array.\n * @param indexB index of second target within the array.\n * @param result caller-allocated vector.\n */\n public abstract accumulateCrossProductIndexIndexIndex(origin: number, indexA: number, indexB: number, result: Vector3d): void;\n /** Read-only property for number of XYZ in the collection. */\n public abstract get length(): number;\n /**\n * Return distance squared between indicated points.\n * @param index0 first point index.\n * @param index1 second point index.\n */\n public abstract distanceSquaredIndexIndex(index0: number, index1: number): number | undefined;\n /**\n * Return distance squared between indicated points.\n * * This method does not check for index validity. Use [[distanceSquaredIndexIndex]] to have validity test.\n * @param index0 first point index.\n * @param index1 second point index.\n */\n public distanceSquaredUncheckedIndexIndex(index0: number, index1: number): number {\n return Geometry.hypotenuseSquaredXYZ(\n this.getXAtUncheckedPointIndex(index1) - this.getXAtUncheckedPointIndex(index0),\n this.getYAtUncheckedPointIndex(index1) - this.getYAtUncheckedPointIndex(index0),\n this.getZAtUncheckedPointIndex(index1) - this.getZAtUncheckedPointIndex(index0),\n );\n }\n /**\n * Return distance squared between the point at index0 and target.\n * @param index0 first point index.\n * @param target second point.\n */\n public distanceSquaredIndexXYAndZ(index0: number, target: XYAndZ): number | undefined {\n if (index0 < 0 || index0 >= this.length)\n return undefined;\n return this.distanceSquaredUncheckedIndexXYAndZ(index0, target);\n }\n /**\n * Return distance squared between the point at index0 and target.\n * * This method does not check for index validity. Use [[distanceSquaredIndexXYAndZ]] to have validity test.\n * @param index0 first point index.\n * @param target second point.\n */\n public distanceSquaredUncheckedIndexXYAndZ(index0: number, target: XYAndZ): number {\n return Geometry.hypotenuseSquaredXYZ(\n target.x - this.getXAtUncheckedPointIndex(index0),\n target.y - this.getYAtUncheckedPointIndex(index0),\n target.z - this.getZAtUncheckedPointIndex(index0),\n );\n }\n /**\n * Return distance between indicated points.\n * @param index0 first point index.\n * @param index1 second point index.\n */\n public abstract distanceIndexIndex(index0: number, index1: number): number | undefined;\n /**\n * Return distance between indicated points.\n * * This method does not check for index validity. Use [[distanceIndexIndex]] to have validity test.\n * @param index0 first point index.\n * @param index1 second point index.\n */\n public distanceUncheckedIndexIndex(index0: number, index1: number): number {\n return Geometry.hypotenuseXYZ(\n this.getXAtUncheckedPointIndex(index1) - this.getXAtUncheckedPointIndex(index0),\n this.getYAtUncheckedPointIndex(index1) - this.getYAtUncheckedPointIndex(index0),\n this.getZAtUncheckedPointIndex(index1) - this.getZAtUncheckedPointIndex(index0),\n );\n }\n /**\n * Test if index is valid for an xyz within this array.\n * @param index xyz index to test.\n */\n public isIndexValid(index: number): boolean {\n return index >= 0 && index < this.length;\n }\n /** Adjust index into range by modulo with the length. */\n public cyclicIndex(i: number): number {\n return Geometry.modulo(i, this.length);\n }\n /** Return the range of the points. */\n public getRange(transform?: Transform, result?: Range3d): Range3d {\n let range = result;\n if (range)\n range.setNull();\n else\n range = Range3d.createNull();\n const n = this.length;\n const point = Point3d.create();\n for (let i = 0; i < n; i++) {\n this.getPoint3dAtUncheckedPointIndex(i, point);\n range.extendPoint(point, transform);\n }\n return range;\n }\n /**\n * For each subset of `k` successive points within tolerance of the first point in the subset, return the indices of\n * the last `k-1` duplicates.\n * * Index `0` is never returned.\n * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]]).\n * @param preserveLast if the last `k < this.length` points of the instance are duplicates, whether to return the\n * indices of the *first* `k-1` duplicates for this last run. If true, index `this.length - 1` is not returned.\n * unless all points are duplicates, in which case all indices but `0` are returned. Default value is false.\n * @return ordered array of 0-based indices of duplicate points\n */\n public findOrderedDuplicates(tolerance: number = Geometry.smallMetricDistance, preserveLast: boolean = false): number[] {\n const indices: number[] = [];\n if (this.length > 1) {\n for (let i = 0; i < this.length - 1;) {\n let j = i + 1;\n for (; this.almostEqualIndexIndex(i, j, tolerance); ++j)\n indices.push(j);\n i = j; // found next unique point\n }\n if (preserveLast && indices.length > 0 && indices.length < this.length - 1) { // not all points are duplicate\n let numLastRun = 0;\n for (; numLastRun <= indices.length - 1 && indices[indices.length - 1 - numLastRun] === this.length - 1 - numLastRun; ++numLastRun);\n for (let i = 0; i < numLastRun; ++i)\n indices[indices.length - 1 - i] -= 1; // decrement the indices of the last run so that the last point is preserved\n }\n }\n return indices;\n }\n /**\n * Accumulate scale times the x,y,z values at index.\n * * No action if index is out of bounds.\n */\n public abstract accumulateScaledXYZ(index: number, scale: number, sum: Point3d): void;\n /**\n * Compute the linear combination s of the indexed p_i and given scales s_i.\n * @param scales array of scales. For best results, scales should have same length as the instance.\n * @param result optional pre-allocated object to fill and return\n * @return s = sum(p_i * s_i), where i ranges from 0 to min(this.length, scales.length).\n */\n public linearCombination(scales: number[], result?: Point3d | Vector3d): XYZ {\n const n = Math.min(this.length, scales.length);\n const sum = (result instanceof Vector3d) ? Vector3d.createZero(result) : Point3d.createZero(result);\n for (let i = 0; i < n; ++i) {\n sum.x += scales[i] * this.getXAtUncheckedPointIndex(i);\n sum.y += scales[i] * this.getYAtUncheckedPointIndex(i);\n sum.z += scales[i] * this.getZAtUncheckedPointIndex(i);\n }\n return sum;\n }\n /**\n * Interpolate the points at the given indices.\n * @param index0 index of point p0 within the array.\n * @param fraction fraction f such that returned point is p0 + f * (p1 - p0).\n * @param index1 index of point p1 within the array.\n * @param result optional caller-allocated result to fill and return.\n * @returns undefined if an index is out of bounds.\n */\n public interpolateIndexIndex(index0: number, fraction: number, index1: number, result?: Point3d): Point3d | undefined {\n if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)\n return undefined;\n return this.interpolateUncheckedIndexIndex(index0, fraction, index1, result);\n }\n /**\n * Interpolate the points at the given indices.\n * * This method does not check for index validity. Use [[interpolateIndexIndex]] to have validity test.\n * @param index0 index of point p0 within the array.\n * @param fraction fraction f such that returned point is p0 + f * (p1 - p0).\n * @param index1 index of point p1 within the array.\n * @param result optional caller-allocated result to fill and return.\n */\n public interpolateUncheckedIndexIndex(index0: number, fraction: number, index1: number, result?: Point3d): Point3d {\n return Point3d.create(Geometry.interpolate(this.getXAtUncheckedPointIndex(index0), fraction, this.getXAtUncheckedPointIndex(index1)),\n Geometry.interpolate(this.getYAtUncheckedPointIndex(index0), fraction, this.getYAtUncheckedPointIndex(index1)),\n Geometry.interpolate(this.getZAtUncheckedPointIndex(index0), fraction, this.getZAtUncheckedPointIndex(index1)), result);\n }\n /** Access x of indexed point. */\n public abstract getXAtUncheckedPointIndex(pointIndex: number): number;\n /** Access y of indexed point. */\n public abstract getYAtUncheckedPointIndex(pointIndex: number): number;\n /** Access z of indexed point. */\n public abstract getZAtUncheckedPointIndex(pointIndex: number): number;\n /**\n * Return iterator over the points in this collection. Usage:\n * ```ts\n * for (const point: Point3d of collection.points) { ... }\n * ```\n */\n public get points(): Iterable<Point3d> {\n return new PointsIterator(this);\n }\n /** Convert to Point3d[]. */\n public getArray(): Point3d[] {\n const result = [];\n for (const p of this.points)\n result.push(p);\n return result;\n }\n /** Return the first point, or undefined if the array is empty. */\n public front(result?: Point3d): Point3d | undefined {\n if (this.length === 0)\n return undefined;\n return this.getPoint3dAtUncheckedPointIndex(0, result);\n }\n /** Return the last point, or undefined if the array is empty. */\n public back(result?: Point3d): Point3d | undefined {\n if (this.length === 0)\n return undefined;\n return this.getPoint3dAtUncheckedPointIndex(this.length - 1, result);\n }\n /**\n * Test whether the indexed points are equal within tolerance.\n * @param index0 index of first point.\n * @param index1 index of second point.\n * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.\n * @returns whether the points are equal within tolerance, or `undefined` if either index is invalid.\n */\n public almostEqualIndexIndex(index0: number, index1: number, tolerance = Geometry.smallMetricDistance): boolean | undefined {\n if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)\n return undefined;\n return this.almostEqualUncheckedIndexIndex(index0, index1, tolerance);\n }\n /**\n * Test whether the indexed points are equal within tolerance.\n * * This method does not check for index validity. Use [[almostEqualIndexIndex]] to have validity test.\n * @param index0 index of first point.\n * @param index1 index of second point.\n * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.\n * @returns whether the points are equal within tolerance.\n */\n public almostEqualUncheckedIndexIndex(index0: number, index1: number, tolerance = Geometry.smallMetricDistance): boolean {\n return Geometry.isSameCoordinate(this.getXAtUncheckedPointIndex(index0), this.getXAtUncheckedPointIndex(index1), tolerance)\n && Geometry.isSameCoordinate(this.getYAtUncheckedPointIndex(index0), this.getYAtUncheckedPointIndex(index1), tolerance)\n && Geometry.isSameCoordinate(this.getZAtUncheckedPointIndex(index0), this.getZAtUncheckedPointIndex(index1), tolerance);\n }\n /**\n * Test whether the xy-coordinates of the indexed points are equal within tolerance. The z-coordinates are ignored.\n * @param index0 index of first point.\n * @param index1 index of second point.\n * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.\n * @returns whether the xy-coordinates of the points are equal within tolerance, or `undefined` if either index is invalid.\n */\n public almostEqualXYIndexIndex(index0: number, index1: number, tolerance = Geometry.smallMetricDistance): boolean | undefined {\n if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)\n return undefined;\n return this.almostEqualXYUncheckedIndexIndex(index0, index1, tolerance);\n }\n /**\n * Test whether the xy-coordinates of the indexed points are equal within tolerance. The z-coordinates are ignored.\n * * This method does not check for index validity. Use [[almostEqualXYIndexIndex]] to have validity test.\n * @param index0 index of first point.\n * @param index1 index of second point.\n * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.\n * @returns whether the xy-coordinates of the points are equal within tolerance.\n */\n public almostEqualXYUncheckedIndexIndex(index0: number, index1: number, tolerance = Geometry.smallMetricDistance): boolean {\n return Geometry.isSameCoordinate(this.getXAtUncheckedPointIndex(index0), this.getXAtUncheckedPointIndex(index1), tolerance)\n && Geometry.isSameCoordinate(this.getYAtUncheckedPointIndex(index0), this.getYAtUncheckedPointIndex(index1), tolerance);\n }\n /** Return the altitude of the indexed point from the plane. */\n public evaluateUncheckedIndexPlaneAltitude(pointIndex: number, plane: PlaneAltitudeEvaluator): number {\n return plane.altitudeXYZ(this.getXAtUncheckedPointIndex(pointIndex), this.getYAtUncheckedPointIndex(pointIndex), this.getZAtUncheckedPointIndex(pointIndex));\n }\n}\n\n/**\n * Abstract base class extends [[IndexedXYZCollection]] with methods that modify the collection.\n * @public\n */\nexport abstract class IndexedReadWriteXYZCollection extends IndexedXYZCollection {\n /** Push a (clone of) point onto the collection. */\n public abstract push(point: XYAndZ): void;\n /** Push a new point (given by xyz coordinates) onto the collection. */\n public abstract pushXYZ(x?: number, y?: number, z?: number): void;\n /** Remove the final point. */\n public abstract pop(): void;\n /** Remove all entries. */\n public abstract clear(): void;\n /** Reverse the points in place. */\n public abstract reverseInPlace(): void;\n /** Push points from the source array to the end of this array and return the number of points pushed. */\n public pushIndexedXYZCollection(source: IndexedXYZCollection): number {\n for (let i = 0; i < source.length; i++)\n this.pushXYZ(source.getXAtUncheckedPointIndex(i), source.getYAtUncheckedPointIndex(i), source.getZAtUncheckedPointIndex(i));\n return source.length;\n }\n}\n\n/**\n * Type for use as signature for xyz data of a single linestring appearing in a parameter list.\n * @public\n */\nexport type LineStringDataVariant = IndexedXYZCollection | XYAndZ[] | XAndY[] | number[][];\n\n/**\n * Type for use as signature for multiple xyz data of multiple linestrings appearing in a parameter list.\n * @public\n */\nexport type MultiLineStringDataVariant = LineStringDataVariant | LineStringDataVariant[];\n"]}