@itwin/core-geometry 5.1.0-dev.37 → 5.1.0-dev.39

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 (93) hide show
  1. package/lib/cjs/Geometry.d.ts +4 -4
  2. package/lib/cjs/Geometry.js +3 -3
  3. package/lib/cjs/Geometry.js.map +1 -1
  4. package/lib/cjs/bspline/BSpline1dNd.d.ts +1 -1
  5. package/lib/cjs/bspline/BSpline1dNd.js +1 -1
  6. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  7. package/lib/cjs/bspline/BSplineSurface.d.ts +2 -2
  8. package/lib/cjs/bspline/BSplineSurface.js +4 -4
  9. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  10. package/lib/cjs/curve/CurveLocationDetail.d.ts +1 -1
  11. package/lib/cjs/curve/CurveLocationDetail.js +1 -1
  12. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  13. package/lib/cjs/curve/CurveTypes.d.ts +1 -1
  14. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  15. package/lib/cjs/curve/StrokeOptions.d.ts +1 -1
  16. package/lib/cjs/curve/StrokeOptions.js +1 -1
  17. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  18. package/lib/cjs/geometry3d/GrowableXYArray.d.ts +1 -1
  19. package/lib/cjs/geometry3d/GrowableXYArray.js +1 -1
  20. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  21. package/lib/cjs/geometry4d/Point4d.d.ts +1 -1
  22. package/lib/cjs/geometry4d/Point4d.js +1 -1
  23. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  24. package/lib/cjs/polyface/Polyface.d.ts +2 -2
  25. package/lib/cjs/polyface/Polyface.js +2 -2
  26. package/lib/cjs/polyface/Polyface.js.map +1 -1
  27. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +1 -1
  28. package/lib/cjs/polyface/PolyfaceBuilder.js +1 -1
  29. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  30. package/lib/cjs/polyface/PolyfaceData.d.ts +1 -1
  31. package/lib/cjs/polyface/PolyfaceData.js +1 -1
  32. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  33. package/lib/cjs/polyface/PolyfaceQuery.d.ts +3 -3
  34. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  35. package/lib/cjs/polyface/PolyfaceQuery.js +3 -3
  36. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  37. package/lib/cjs/serialization/GeometrySamples.d.ts +1 -1
  38. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  39. package/lib/cjs/serialization/GeometrySamples.js +1 -1
  40. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  41. package/lib/cjs/serialization/IModelJsonSchema.d.ts +3 -3
  42. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  43. package/lib/cjs/topology/Triangulation.d.ts +9 -14
  44. package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
  45. package/lib/cjs/topology/Triangulation.js +29 -22
  46. package/lib/cjs/topology/Triangulation.js.map +1 -1
  47. package/lib/esm/Geometry.d.ts +4 -4
  48. package/lib/esm/Geometry.js +3 -3
  49. package/lib/esm/Geometry.js.map +1 -1
  50. package/lib/esm/bspline/BSpline1dNd.d.ts +1 -1
  51. package/lib/esm/bspline/BSpline1dNd.js +1 -1
  52. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  53. package/lib/esm/bspline/BSplineSurface.d.ts +2 -2
  54. package/lib/esm/bspline/BSplineSurface.js +4 -4
  55. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  56. package/lib/esm/curve/CurveLocationDetail.d.ts +1 -1
  57. package/lib/esm/curve/CurveLocationDetail.js +1 -1
  58. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  59. package/lib/esm/curve/CurveTypes.d.ts +1 -1
  60. package/lib/esm/curve/CurveTypes.js.map +1 -1
  61. package/lib/esm/curve/StrokeOptions.d.ts +1 -1
  62. package/lib/esm/curve/StrokeOptions.js +1 -1
  63. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  64. package/lib/esm/geometry3d/GrowableXYArray.d.ts +1 -1
  65. package/lib/esm/geometry3d/GrowableXYArray.js +1 -1
  66. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  67. package/lib/esm/geometry4d/Point4d.d.ts +1 -1
  68. package/lib/esm/geometry4d/Point4d.js +1 -1
  69. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  70. package/lib/esm/polyface/Polyface.d.ts +2 -2
  71. package/lib/esm/polyface/Polyface.js +2 -2
  72. package/lib/esm/polyface/Polyface.js.map +1 -1
  73. package/lib/esm/polyface/PolyfaceBuilder.d.ts +1 -1
  74. package/lib/esm/polyface/PolyfaceBuilder.js +1 -1
  75. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  76. package/lib/esm/polyface/PolyfaceData.d.ts +1 -1
  77. package/lib/esm/polyface/PolyfaceData.js +1 -1
  78. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  79. package/lib/esm/polyface/PolyfaceQuery.d.ts +3 -3
  80. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  81. package/lib/esm/polyface/PolyfaceQuery.js +3 -3
  82. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  83. package/lib/esm/serialization/GeometrySamples.d.ts +1 -1
  84. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  85. package/lib/esm/serialization/GeometrySamples.js +1 -1
  86. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  87. package/lib/esm/serialization/IModelJsonSchema.d.ts +3 -3
  88. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  89. package/lib/esm/topology/Triangulation.d.ts +9 -14
  90. package/lib/esm/topology/Triangulation.d.ts.map +1 -1
  91. package/lib/esm/topology/Triangulation.js +29 -22
  92. package/lib/esm/topology/Triangulation.js.map +1 -1
  93.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AM,CAAC;IAChB,CAAC;IACD;;OAEG;IACI,oBAAoB,CAAC,KAAc;QACxC,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QAClC,MAAM,IAAI,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;QACnC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAE,+BAA+B;QACpE,MAAM,GAAG,GAAG,QAAQ,CAAC,yBAAyB,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC;QACjE,IAAI,GAAG,KAAK,SAAS;YACnB,OAAO,SAAS,CAAC;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;CACF","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 Numerics\n */\nimport { BeJSONFunctions, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { Plane3d } from \"../geometry3d/Plane3d\";\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { XAndY, XYAndZ } from \"../geometry3d/XYZProps\";\n\n/**\n * 4d point packed in an array of 4 numbers.\n * @public\n */\nexport type Point4dProps = number[];\n/**\n *\n * @param ddg numerator second derivative\n * @param dh denominator derivative\n * @param ddh denominator second derivative\n * @param f primary function (g/h)\n * @param df derivative of (g/h)\n * @param divH = (1/h)\n * @internal\n */\nfunction quotientDerivative2(ddg: number, dh: number, ddh: number,\n f: number, df: number, divH: number): number {\n return divH * (ddg - 2.0 * df * dh - f * ddh);\n}\n\n/** 4 Dimensional point (x,y,z,w) used in perspective calculations.\n * * the coordinates are stored in a Float64Array of length 4.\n * * properties `x`, `y`, `z`, `w` access array members.\n * *\n * * The coordinates are physically stored as a single Float64Array with 4 entries. (w last)\n * *\n * @public\n */\nexport class Point4d extends Plane3d implements BeJSONFunctions {\n /** x,y,z,w are packed into a Float64Array */\n public xyzw: Float64Array;\n /** Set x,y,z,w of this point. */\n public set(x: number = 0, y: number = 0, z: number = 0, w: number = 0): Point4d {\n this.xyzw[0] = x;\n this.xyzw[1] = y;\n this.xyzw[2] = z;\n this.xyzw[3] = w;\n return this;\n }\n /** Set a component by index.\n * * No change if index is out of range.\n */\n public setComponent(index: number, value: number) {\n if (index >= 0 && index < 4) {\n this.xyzw[index] = value;\n }\n }\n /** The x component. */\n public get x() { return this.xyzw[0]; }\n public set x(val: number) { this.xyzw[0] = val; }\n /** The y component. */\n public get y() { return this.xyzw[1]; }\n public set y(val: number) { this.xyzw[1] = val; }\n /** The z component. */\n public get z() { return this.xyzw[2]; }\n public set z(val: number) { this.xyzw[2] = val; }\n /** The w component of this point. */\n public get w() { return this.xyzw[3]; }\n public set w(val: number) { this.xyzw[3] = val; }\n /** Construct from coordinates. */\n protected constructor(x: number = 0, y: number = 0, z: number = 0, w: number = 0) {\n super();\n this.xyzw = new Float64Array(4);\n this.xyzw[0] = x;\n this.xyzw[1] = y;\n this.xyzw[2] = z;\n this.xyzw[3] = w;\n }\n /** Return a Point4d with specified x,y,z,w */\n public static create(x: number = 0, y: number = 0, z: number = 0, w: number = 0, result?: Point4d): Point4d {\n return result ? result.set(x, y, z, w) : new Point4d(x, y, z, w);\n }\n /**\n * Create a \"Point4d as a plane\" from \"any\" other [[PlaneAltitudeEvaluator]] type.\n * @param source\n * @returns\n */\n public static createPlaneFrom(source: PlaneAltitudeEvaluator): Point4d | undefined {\n return new Point4d(source.normalX(), source.normalY(), source.normalZ(), source.altitudeXYZ(0, 0, 0));\n }\n /** Copy coordinates from `other`. */\n public setFrom(other: Point4d): Point4d {\n this.xyzw[0] = other.xyzw[0];\n this.xyzw[1] = other.xyzw[1];\n this.xyzw[2] = other.xyzw[2];\n this.xyzw[3] = other.xyzw[3];\n return this;\n }\n /** Clone this point */\n public clone(result?: Point4d): Point4d {\n return result ? result.setFrom(this) : new Point4d(this.xyzw[0], this.xyzw[1], this.xyzw[2], this.xyzw[3]);\n }\n /** Set this point's xyzw from a json array `[x,y,z,w]` */\n public setFromJSON(json?: Point4dProps) {\n if (Geometry.isNumberArray(json, 4))\n this.set(json[0], json[1], json[2], json[3]);\n else\n this.set(0, 0, 0, 0);\n }\n\n /** Create a new point with coordinates from a json array `[x,y,z,w]` */\n public static fromJSON(json?: Point4dProps): Point4d {\n const result = new Point4d();\n result.setFromJSON(json);\n return result;\n }\n /** Near-equality test, using `Geometry.isSameCoordinate` on all 4 x,y,z,w */\n public isAlmostEqual(other: Point4d, tolerance: number = Geometry.smallMetricDistance): boolean {\n return Geometry.isSameCoordinate(this.x, other.x, tolerance)\n && Geometry.isSameCoordinate(this.y, other.y, tolerance)\n && Geometry.isSameCoordinate(this.z, other.z, tolerance)\n && Geometry.isSameCoordinate(this.w, other.w, tolerance);\n }\n /**\n * Test for same coordinate by direct x,y,z,w args\n * @param x x to test\n * @param y y to test\n * @param z z to test\n * @param w w to test\n */\n public isAlmostEqualXYZW(x: number, y: number, z: number, w: number, tolerance: number = Geometry.smallMetricDistance): boolean {\n return Geometry.isSameCoordinate(this.x, x, tolerance)\n && Geometry.isSameCoordinate(this.y, y, tolerance)\n && Geometry.isSameCoordinate(this.z, z, tolerance)\n && Geometry.isSameCoordinate(this.w, w, tolerance);\n }\n\n /**\n * Convert an Angle to a JSON object.\n * @return {*} [x,y,z,w]\n */\n public toJSON(): Point4dProps {\n return [this.xyzw[0], this.xyzw[1], this.xyzw[2], this.xyzw[3]];\n }\n /** Return the 4d distance from this point to other, with all 4 components squared into the hypotenuse.\n * * x,y,z,w all participate without normalization.\n */\n public distanceXYZW(other: Point4d): number {\n return Geometry.hypotenuseXYZW(other.xyzw[0] - this.xyzw[0], other.xyzw[1] - this.xyzw[1], other.xyzw[2] - this.xyzw[2], other.xyzw[3] - this.xyzw[3]);\n }\n /** Return the squared 4d distance from this point to other, with all 4 components squared into the hypotenuse.\n * * x,y,z,w all participate without normalization.\n */\n public distanceSquaredXYZW(other: Point4d): number {\n return Geometry.hypotenuseSquaredXYZW(other.xyzw[0] - this.xyzw[0], other.xyzw[1] - this.xyzw[1], other.xyzw[2] - this.xyzw[2], other.xyzw[3] - this.xyzw[3]);\n }\n /** Return the xy distance between the instance and `other` after normalizing by weights */\n public realDistanceXY(other: Point4d): number | undefined {\n const wA = this.w;\n const wB = other.w;\n if (Geometry.isSmallMetricDistance(wA) || Geometry.isSmallMetricDistance(wB))\n return undefined;\n return Geometry.hypotenuseXY(other.xyzw[0] / wB - this.xyzw[0] / wA, other.xyzw[1] / wB - this.xyzw[1] / wA);\n }\n /** Return the xy squared distance between the instance and `other` after normalizing by weights */\n public realDistanceSquaredXY(other: Point4d): number | undefined {\n const wA = this.w;\n const wB = other.w;\n if (Geometry.isSmallMetricDistance(wA) || Geometry.isSmallMetricDistance(wB))\n return undefined;\n return Geometry.hypotenuseSquaredXY(other.xyzw[0] / wB - this.xyzw[0] / wA, other.xyzw[1] / wB - this.xyzw[1] / wA);\n }\n /** Return the largest absolute distance between corresponding components\n * * x,y,z,w all participate without normalization.\n */\n public maxDiff(other: Point4d): number {\n return Math.max(Math.abs(other.xyzw[0] - this.xyzw[0]), Math.abs(other.xyzw[1] - this.xyzw[1]), Math.abs(other.xyzw[2] - this.xyzw[2]), Math.abs(other.xyzw[3] - this.xyzw[3]));\n }\n /** Return the largest absolute entry of all 4 components x,y,z,w */\n public maxAbs(): number {\n return Math.max(Math.abs(this.xyzw[0]), Math.abs(this.xyzw[1]), Math.abs(this.xyzw[2]), Math.abs(this.xyzw[3]));\n }\n /** Returns the magnitude including all 4 components x,y,z,w */\n public magnitudeXYZW(): number {\n return Geometry.hypotenuseXYZW(this.xyzw[0], this.xyzw[1], this.xyzw[2], this.xyzw[3]);\n }\n /** Returns the magnitude of the leading xyz components. w is ignored. (i.e. the leading xyz are NOT divided by w.) */\n public magnitudeSquaredXYZ(): number {\n return Geometry.hypotenuseSquaredXYZ(this.xyzw[0], this.xyzw[1], this.xyzw[2]);\n }\n\n /** Return the difference (this-other) using all 4 components x,y,z,w */\n public minus(other: Point4d, result?: Point4d): Point4d {\n return Point4d.create(this.xyzw[0] - other.xyzw[0], this.xyzw[1] - other.xyzw[1], this.xyzw[2] - other.xyzw[2], this.xyzw[3] - other.xyzw[3], result);\n }\n /** Return `((other.w * this) - (this.w * other))` */\n public crossWeightedMinus(other: Point4d, result?: Vector3d): Vector3d {\n const wa = this.xyzw[3];\n const wb = other.xyzw[3];\n return Vector3d.create(wb * this.xyzw[0] - wa * other.xyzw[0], wb * this.xyzw[1] - wa * other.xyzw[1], wb * this.xyzw[2] - wa * other.xyzw[2], result);\n }\n /** Return `((other.w * this) - (this.w * other))`, with other.w known to be 1 */\n public crossWeightedMinusPoint3d(other: Point3d, result?: Vector3d): Vector3d {\n const wa = this.xyzw[3];\n return Vector3d.create(this.xyzw[0] - wa * other.x, this.xyzw[1] - wa * other.y, this.xyzw[2] - wa * other.z, result);\n }\n /** Return the sum of this and other, using all 4 components x,y,z,w */\n public plus(other: Point4d, result?: Point4d): Point4d {\n return Point4d.create(this.xyzw[0] + other.xyzw[0], this.xyzw[1] + other.xyzw[1], this.xyzw[2] + other.xyzw[2], this.xyzw[3] + other.xyzw[3], result);\n }\n /** Test if all components are nearly zero. */\n public get isAlmostZero(): boolean {\n return Geometry.isSmallMetricDistance(this.maxAbs());\n }\n /** Create a point with zero in all coordinates. */\n public static createZero(): Point4d { return new Point4d(0, 0, 0, 0); }\n /**\n * Create plane coefficients for the plane containing pointA, pointB, and 0010.\n * @param pointA first point\n * @param pointB second point\n */\n public static createPlanePointPointZ(pointA: Point4d, pointB: Point4d, result?: Point4d) {\n return Point4d.create(pointA.y * pointB.w - pointA.w * pointB.y, pointA.w * pointB.x - pointA.x * pointB.w, 0.0, pointA.x * pointB.y - pointA.y * pointB.x, result);\n }\n /**\n * extract 3 consecutive numbers from a Float64Array into the xyz values of a Point4d with w = 1.\n * @param data buffer of numbers\n * @param xIndex first index for x,y,z sequence\n */\n public static createFromPackedXYZ(data: Float64Array, xIndex: number = 0, result?: Point4d): Point4d | undefined {\n if (xIndex >= 0 && xIndex + 2 < data.length)\n return Point4d.create(data[xIndex], data[xIndex + 1], data[xIndex + 2], 1.0, result);\n return undefined;\n }\n /**\n * extract 4 consecutive numbers from a Float64Array into a Point4d.\n * @param data buffer of numbers\n * @param xIndex first index for x,y,z,w sequence\n */\n public static createFromPacked(data: Float64Array, xIndex: number = 0, result?: Point4d): Point4d | undefined {\n if (xIndex >= 0 && xIndex + 3 < data.length)\n return Point4d.create(data[xIndex], data[xIndex + 1], data[xIndex + 2], data[xIndex + 3], result);\n return undefined;\n }\n /**\n * extract 4 consecutive numbers from a Float64Array into a Point4d.\n * @param data buffer of numbers\n * @param xIndex first index for x,y,z,w sequence. Assumed to be a valid index!\n * @deprecated in 4.x. Use createFromPacked instead.\n */\n public static createFromPackedXYZW(data: Float64Array, xIndex: number = 0, result?: Point4d): Point4d {\n return Point4d.create(data[xIndex], data[xIndex + 1], data[xIndex + 2], data[xIndex + 3], result);\n }\n /** Create a `Point4d` with x,y,z from an `XYAndZ` input, and w from a separate number. */\n public static createFromPointAndWeight(xyz: XYAndZ, w: number): Point4d {\n return new Point4d(xyz.x, xyz.y, xyz.z, w);\n }\n /** Create a `Point4d` from\n * * Point2d, Point3d, or Point4d\n * * other structure with members x,y and optional z,w\n * * array of numbers\n * * default z is 0.0\n * * default w is 1.0 (array[3] can replace)\n */\n public static createFromPoint(point: XAndY | XYAndZ | Point4d | number[]): Point4d {\n if (point instanceof Point2d)\n return new Point4d(point.x, point.y, 0, 1);\n if (point instanceof Point3d)\n return new Point4d(point.x, point.y, point.z, 1);\n if (point instanceof Point4d)\n return point.clone();\n // hm ... some flavor of x,y,z subset ...\n if (Array.isArray(point)) {\n const x1 = point.length > 0 ? point[0] : 0.0;\n const y1 = point.length > 1 ? point[1] : 0.0;\n const z1 = point.length > 2 ? point[2] : 0.0;\n const w1 = point.length > 3 ? point[3] : 1.0;\n return new Point4d(x1, y1, z1, w1);\n }\n const x = point.x;\n const y = point.y;\n const z = point.hasOwnProperty(\"z\") ? (point as any).z : 0.0;\n const w = point.hasOwnProperty(\"w\") ? (point as any).w : 1.0;\n return new Point4d(x, y, z, w);\n\n }\n /** Return `point + vector * scalar` */\n public plusScaled(vector: Point4d, scaleFactor: number, result?: Point4d): Point4d {\n return Point4d.create(this.xyzw[0] + vector.xyzw[0] * scaleFactor, this.xyzw[1] + vector.xyzw[1] * scaleFactor, this.xyzw[2] + vector.xyzw[2] * scaleFactor, this.xyzw[3] + vector.xyzw[3] * scaleFactor, result);\n }\n /** Return interpolation between instance and pointB at fraction\n */\n public interpolate(fraction: number, pointB: Point4d, result?: Point4d): Point4d {\n const v = 1.0 - fraction;\n return Point4d.create(this.xyzw[0] * v + pointB.xyzw[0] * fraction, this.xyzw[1] * v + pointB.xyzw[1] * fraction, this.xyzw[2] * v + pointB.xyzw[2] * fraction, this.xyzw[3] * v + pointB.xyzw[3] * fraction, result);\n }\n /** Return `point + vectorA * scalarA + vectorB * scalarB` */\n public plus2Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, result?: Point4d): Point4d {\n return Point4d.create(this.xyzw[0] + vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB, this.xyzw[1] + vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB, this.xyzw[2] + vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB, this.xyzw[3] + vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB, result);\n }\n /** Return `point + vectorA * scalarA + vectorB * scalarB + vectorC * scalarC` */\n public plus3Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, vectorC: Point4d, scalarC: number, result?: Point4d): Point4d {\n return Point4d.create(this.xyzw[0] + vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB + vectorC.xyzw[0] * scalarC, this.xyzw[1] + vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB + vectorC.xyzw[1] * scalarC, this.xyzw[2] + vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB + vectorC.xyzw[2] * scalarC, this.xyzw[3] + vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB + vectorC.xyzw[3] * scalarC, result);\n }\n /** Return `point + vectorA * scalarA + vectorB * scalarB` */\n public static createAdd2Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, result?: Point4d): Point4d {\n return Point4d.create(vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB, vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB, vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB, vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB, result);\n }\n /** Return `point + vectorA \\ scalarA + vectorB * scalarB + vectorC * scalarC` */\n public static createAdd3Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, vectorC: Point4d, scalarC: number, result?: Point4d): Point4d {\n return Point4d.create(vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB + vectorC.xyzw[0] * scalarC, vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB + vectorC.xyzw[1] * scalarC, vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB + vectorC.xyzw[2] * scalarC, vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB + vectorC.xyzw[3] * scalarC, result);\n }\n /** Return dot product of (4d) vectors from the instance to targetA and targetB */\n public dotVectorsToTargets(targetA: Point4d, targetB: Point4d): number {\n return (targetA.xyzw[0] - this.xyzw[0]) * (targetB.xyzw[0] - this.xyzw[0]) +\n (targetA.xyzw[1] - this.xyzw[1]) * (targetB.xyzw[1] - this.xyzw[1]) +\n (targetA.xyzw[2] - this.xyzw[2]) * (targetB.xyzw[2] - this.xyzw[2]) +\n (targetA.xyzw[3] - this.xyzw[3]) * (targetB.xyzw[3] - this.xyzw[3]);\n }\n /** return (4d) dot product of the instance and other point. */\n public dotProduct(other: Point4d): number {\n return this.xyzw[0] * other.xyzw[0] + this.xyzw[1] * other.xyzw[1] + this.xyzw[2] * other.xyzw[2] + this.xyzw[3] * other.xyzw[3];\n }\n /** return (4d) dot product of the instance with xyzw */\n public dotProductXYZW(x: number, y: number, z: number, w: number): number {\n return this.xyzw[0] * x + this.xyzw[1] * y + this.xyzw[2] * z + this.xyzw[3] * w;\n }\n /** dotProduct with (point.x, point.y, point.z, 1) Used in PlaneAltitudeEvaluator interface */\n public altitude(point: Point3d): number {\n return this.xyzw[0] * point.x + this.xyzw[1] * point.y + this.xyzw[2] * point.z + this.xyzw[3];\n }\n /** dotProduct with (x, y, z, 1) Used in PlaneAltitudeEvaluator interface */\n public altitudeXYZ(x: number, y: number, z: number): number {\n return this.xyzw[0] * x + this.xyzw[1] * y + this.xyzw[2] * z + this.xyzw[3];\n }\n /** dotProduct with (point.x, point.y, point.z, point.w) Used in PlaneAltitudeEvaluator interface */\n public weightedAltitude(point: Point4d): number {\n return this.xyzw[0] * point.x + this.xyzw[1] * point.y + this.xyzw[2] * point.z + this.xyzw[3] * point.w;\n }\n /** dotProduct with (vector.x, vector.y, vector.z, 0). Used in PlaneAltitudeEvaluator interface */\n public velocity(vector: Vector3d): number {\n return this.xyzw[0] * vector.x + this.xyzw[1] * vector.y + this.xyzw[2] * vector.z;\n }\n /** dotProduct with (x,y,z, 0). Used in PlaneAltitudeEvaluator interface */\n public velocityXYZ(x: number, y: number, z: number): number {\n return this.xyzw[0] * x + this.xyzw[1] * y + this.xyzw[2] * z;\n }\n /**\n * Return the x component of the normal used to evaluate altitude.\n */\n public normalX(): number { return this.x; }\n /**\n * Return the x component of the normal used to evaluate altitude.\n */\n public normalY(): number { return this.y; }\n /**\n * Return the z component of the normal used to evaluate altitude.\n */\n public normalZ(): number { return this.z; }\n\n /** unit X vector */\n public static unitX(): Point4d { return new Point4d(1, 0, 0, 0); }\n /** unit Y vector */\n public static unitY(): Point4d { return new Point4d(0, 1, 0, 0); }\n /** unit Z vector */\n public static unitZ(): Point4d { return new Point4d(0, 0, 1, 0); }\n /** unit W vector */\n public static unitW(): Point4d { return new Point4d(0, 0, 0, 1); }\n /** Divide by denominator, but return undefined if denominator is zero. */\n public safeDivideOrNull(denominator: number, result?: Point4d): Point4d | undefined {\n if (denominator !== 0.0) {\n return this.scale(1.0 / denominator, result);\n }\n return undefined;\n }\n /**\n * * Return xyz projection of spacePoint to the plane (this Point4d is understood as plane coefficients, not point coordinates)\n * * If the xyz part of `this` are all zero, (a clone of) `spacePoint` is returned.\n */\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\n return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);\n }\n /** Return the projection of (x,y,z) onto the plane. */\n public override projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d {\n const h = this.altitudeXYZ(x, y, z);\n const nn = this.magnitudeSquaredXYZ();\n // this unusual tol is needed so that toPlane3dByOriginAndUnitNormal agrees with its original implementation\n const alpha = Geometry.conditionalDivideCoordinate(-h, nn, Geometry.largeFractionResult * Geometry.largeFractionResult);\n if (alpha === undefined)\n return Point3d.create(x, y, z, result);\n return Point3d.create(x + alpha * this.x, y + alpha * this.y, z + alpha * this.z, result);\n }\n /** scale all components (including w!!) */\n public scale(scale: number, result?: Point4d): Point4d {\n result = result ? result : new Point4d();\n result.xyzw[0] = this.xyzw[0] * scale;\n result.xyzw[1] = this.xyzw[1] * scale;\n result.xyzw[2] = this.xyzw[2] * scale;\n result.xyzw[3] = this.xyzw[3] * scale;\n return result;\n }\n /** Negate components (including w!!) */\n public negate(result?: Point4d): Point4d {\n result = result ? result : new Point4d();\n result.xyzw[0] = -this.xyzw[0];\n result.xyzw[1] = -this.xyzw[1];\n result.xyzw[2] = -this.xyzw[2];\n result.xyzw[3] = -this.xyzw[3];\n return result;\n }\n /**\n * If `this.w` is nonzero, return a 4d point `(x/w,y/w,z/w, 1)`\n * If `this.w` is zero, return undefined.\n * @param result optional result\n */\n public normalizeWeight(result?: Point4d): Point4d | undefined {\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\n result = result ? result : new Point4d();\n return this.safeDivideOrNull(mag, result);\n }\n /**\n * If `this.w` is nonzero, return a 3d point `(x/w,y/w,z/w)`\n * If `this.w` is zero, return undefined.\n * @param result optional result\n */\n public realPoint(result?: Point3d): Point3d | undefined {\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\n if (mag === 0.0)\n return undefined;\n const a = 1.0 / mag; // in zero case everything multiplies right back to true zero.\n return Point3d.create(this.xyzw[0] * a, this.xyzw[1] * a, this.xyzw[2] * a, result);\n }\n\n /** Convert the homogeneous point to a (strongly typed) point or vector.\n * * If `this.w` is nonzero, return a Point3d `(x/w,y/w,z/w)`\n * * If `this.w` is zero, return a Vector3d `(x,y,z)`\n */\n public realPointOrVector(): Point3d | Vector3d {\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\n if (mag === 0.0)\n return Vector3d.create(this.x, this.y, this.z);\n const a = 1.0 / mag; // in zero case everything multiplies right back to true zero.\n return Point3d.create(this.x * a, this.y * a, this.z * a);\n }\n /**\n * * If w is nonzero, return Point3d with x/w,y/w,z/w.\n * * If w is zero, return 000\n * @param x x coordinate\n * @param y y coordinate\n * @param z z coordinate\n * @param w w coordinate\n * @param result optional result\n */\n public static createRealPoint3dDefault000(x: number, y: number, z: number, w: number, result?: Point3d): Point3d {\n const mag = Geometry.correctSmallFraction(w);\n const a = mag === 0 ? 0.0 : (1.0 / mag); // in zero case everything multiplies right back to true zero.\n return Point3d.create(x * a, y * a, z * a, result);\n }\n /**\n * * If w is nonzero, return Vector3d which is the derivative of the projected xyz with given w and 4d derivatives.\n * * If w is zero, return 000\n * @param x x coordinate\n * @param y y coordinate\n * @param z z coordinate\n * @param w w coordinate\n * @param dx x coordinate of derivative\n * @param dy y coordinate of derivative\n * @param dz z coordinate of derivative\n * @param dw w coordinate of derivative\n * @param result optional result\n */\n public static createRealDerivativeRay3dDefault000(x: number, y: number, z: number, w: number, dx: number, dy: number, dz: number, dw: number, result?: Ray3d): Ray3d {\n const mag = Geometry.correctSmallFraction(w);\n // real point is X/w.\n // real derivative is (X' * w - X *w) / ww, and weight is always 0 by cross products.\n const a = mag === 0 ? 0.0 : (1.0 / mag); // in zero case everything multiplies right back to true zero.\n const aa = a * a;\n return Ray3d.createXYZUVW(x * a, y * a, z * a, (dx * w - dw * x) * aa, (dy * w - dw * y) * aa, (dz * w - dw * z) * aa, result);\n }\n /**\n * * If w is nonzero, return Vector3d which is the derivative of the projected xyz with given w and 4d derivatives.\n * * If w is zero, return 000\n * @param x x coordinate\n * @param y y coordinate\n * @param z z coordinate\n * @param w w coordinate\n * @param dx x coordinate of derivative\n * @param dy y coordinate of derivative\n * @param dz z coordinate of derivative\n * @param dw w coordinate of derivative\n * @param result optional result\n */\n public static createRealDerivativePlane3dByOriginAndVectorsDefault000(x: number, y: number, z: number, w: number, dx: number, dy: number, dz: number, dw: number, ddx: number, ddy: number, ddz: number, ddw: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n const mag = Geometry.correctSmallFraction(w);\n // real point is X/w.\n // real derivative is (X' * w - X *w) / ww, and weight is always 0 by cross products.\n const a = mag === 0 ? 0.0 : (1.0 / mag); // in zero case everything multiplies right back to true zero.\n const aa = a * a;\n const fx = x * a;\n const fy = y * a;\n const fz = z * a;\n const dfx = (dx * w - dw * x) * aa;\n const dfy = (dy * w - dw * y) * aa;\n const dfz = (dz * w - dw * z) * aa;\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(fx, fy, fz, dfx, dfy, dfz, quotientDerivative2(ddx, dw, ddw, fx, dfx, a), quotientDerivative2(ddy, dw, ddw, fy, dfy, a), quotientDerivative2(ddz, dw, ddw, fz, dfz, a), result);\n }\n /**\n * * If this.w is nonzero, return Point3d with x/w,y/w,z/w.\n * * If this.w is zero, return 000\n */\n public realPointDefault000(result?: Point3d): Point3d {\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\n if (mag === 0.0)\n return Point3d.create(0, 0, 0, result);\n result = result ? result : new Point3d();\n const a = 1.0 / mag;\n return Point3d.create(this.xyzw[0] * a, this.xyzw[1] * a, this.xyzw[2] * a, result);\n }\n /** divide all components (x,y,z,w) by the 4d magnitude.\n *\n * * This is appropriate for normalizing a quaternion\n * * Use normalizeWeight to divide by the w component.\n */\n public normalizeXYZW(result?: Point4d): Point4d | undefined {\n const mag = Geometry.correctSmallFraction(this.magnitudeXYZW());\n result = result ? result : new Point4d();\n return this.safeDivideOrNull(mag, result);\n }\n\n /**\n * Return the determinant of the 3x3 matrix using components i,j,k of the 3 inputs.\n */\n public static determinantIndexed3X3(pointA: Point4d, pointB: Point4d, pointC: Point4d, i: number, j: number, k: number) {\n return Geometry.tripleProduct(\n pointA.xyzw[i], pointA.xyzw[j], pointA.xyzw[k],\n pointB.xyzw[i], pointB.xyzw[j], pointB.xyzw[k],\n pointC.xyzw[i], pointC.xyzw[j], pointC.xyzw[k]);\n }\n /**\n * Return a Point4d perpendicular to all 3 inputs. (A higher level cross product concept)\n * @param pointA first point\n * @param pointB second point\n * @param pointC third point\n */\n public static perpendicularPoint4dPlane(pointA: Point4d, pointB: Point4d, pointC: Point4d): Point4d {\n return Point4d.create(\n Point4d.determinantIndexed3X3(pointA, pointB, pointC, 1, 2, 3),\n -Point4d.determinantIndexed3X3(pointA, pointB, pointC, 2, 3, 0),\n Point4d.determinantIndexed3X3(pointA, pointB, pointC, 3, 0, 1),\n -Point4d.determinantIndexed3X3(pointA, pointB, pointC, 0, 1, 2));\n }\n /** Treating this Point4d as plane coefficients, convert to origin and normal form. */\n public toPlane3dByOriginAndUnitNormal(result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined {\n return Plane3dByOriginAndUnitNormal.createFrom(this, result);\n }\n /** Normalize so sum of squares of all 4 coordinates is 1. */\n public normalizeQuaternion() {\n const magnitude = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n\n if (magnitude > 0.0) {\n const f = 1.0 / magnitude;\n this.x *= f;\n this.y *= f;\n this.z *= f;\n this.w *= f;\n }\n return magnitude;\n }\n /** Return a (normalized) quaternion interpolated between two quaternions. */\n public static interpolateQuaternions(quaternion0: Point4d, fractionParameter: number, quaternion1: Point4d, result?: Point4d): Point4d {\n if (!result)\n result = new Point4d();\n const maxSafeCosine = 0.9995;\n\n // return exact quaternions for special values\n if (0.0 === fractionParameter) {\n result = quaternion0;\n return result;\n }\n if (1.0 === fractionParameter) {\n result = quaternion1;\n return result;\n }\n if (0.5 === fractionParameter) {\n quaternion0.plus(quaternion1, result);\n result.normalizeQuaternion();\n return result;\n }\n\n const q0 = quaternion0.clone();\n const q1 = quaternion1.clone();\n let dot = quaternion0.dotProduct(quaternion1);\n\n // prevent interpolation through the longer great arc\n if (dot < 0.0) {\n q1.negate(q1);\n dot = -dot;\n }\n\n // if nearly parallel, use interpolate and renormalize .\n if (dot > maxSafeCosine) {\n q0.interpolate(fractionParameter, q1, result);\n result.normalizeQuaternion();\n return result;\n }\n\n // safety check\n if (dot < -1.0)\n dot = -1.0;\n else if (dot > 1.0)\n dot = 1.0;\n\n // create orthonormal basis {q0, q2}\n const q2 = new Point4d();\n q1.plusScaled(q0, -dot, q2); // bsiDPoint4d_addScaledDPoint4d(& q2, & q1, & q0, -dot);\n q2.normalizeQuaternion();\n\n const angle = Math.acos(dot);\n const angleOfInterpolation = angle * fractionParameter;\n result = Point4d.createAdd2Scaled(q0, Math.cos(angleOfInterpolation), q2, Math.sin(angleOfInterpolation));\n return result;\n }\n /** Measure the \"angle\" between two points, using all 4 components in the dot product that\n * gives the cosine of the angle.\n */\n public radiansToPoint4dXYZW(other: Point4d): number | undefined {\n const magA = this.magnitudeXYZW();\n const magB = other.magnitudeXYZW();\n const dot = this.dotProduct(other); // == cos (theta) * magA * magB\n const cos = Geometry.conditionalDivideFraction(dot, magA * magB);\n if (cos === undefined)\n return undefined;\n return Math.acos(cos);\n }\n}\n"]}
1
+ {"version":3,"file":"Point4d.js","sourceRoot":"","sources":["../../../src/geometry4d/Point4d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAmB,QAAQ,EAA0B,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAQ5C;;;;;;;;;GASG;AACH,SAAS,mBAAmB,CAAC,GAAW,EAAE,EAAU,EAAE,GAAW,EAC/D,CAAS,EAAE,EAAU,EAAE,IAAY;IACnC,OAAO,IAAI,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,OAAQ,SAAQ,OAAO;IAClC,6CAA6C;IACtC,IAAI,CAAe;IAC1B,kCAAkC;IAC3B,GAAG,CAAC,IAAY,CAAC,EAAE,IAAY,CAAC,EAAE,IAAY,CAAC,EAAE,IAAY,CAAC;QACnE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACj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;QAC7B,MAAM,oBAAoB,GAAG,KAAK,GAAG,iBAAiB,CAAC;QACvD,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC;QAC1G,OAAO,MAAM,CAAC;IAChB,CAAC;IACD;;OAEG;IACI,oBAAoB,CAAC,KAAc;QACxC,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QAClC,MAAM,IAAI,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;QACnC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAE,+BAA+B;QACpE,MAAM,GAAG,GAAG,QAAQ,CAAC,yBAAyB,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC;QACjE,IAAI,GAAG,KAAK,SAAS;YACnB,OAAO,SAAS,CAAC;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;CACF","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 Numerics\n */\nimport { BeJSONFunctions, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { Plane3d } from \"../geometry3d/Plane3d\";\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { XAndY, XYAndZ } from \"../geometry3d/XYZProps\";\n\n/**\n * 4d point packed in an array of 4 numbers.\n * @public\n */\nexport type Point4dProps = number[];\n/**\n *\n * @param ddg numerator second derivative\n * @param dh denominator derivative\n * @param ddh denominator second derivative\n * @param f primary function (g/h)\n * @param df derivative of (g/h)\n * @param divH = (1/h)\n * @internal\n */\nfunction quotientDerivative2(ddg: number, dh: number, ddh: number,\n f: number, df: number, divH: number): number {\n return divH * (ddg - 2.0 * df * dh - f * ddh);\n}\n\n/** 4 Dimensional point (x,y,z,w) used in perspective calculations.\n * * the coordinates are stored in a Float64Array of length 4.\n * * properties `x`, `y`, `z`, `w` access array members.\n * *\n * * The coordinates are physically stored as a single Float64Array with 4 entries. (w last)\n * *\n * @public\n */\nexport class Point4d extends Plane3d implements BeJSONFunctions {\n /** x,y,z,w are packed into a Float64Array */\n public xyzw: Float64Array;\n /** Set x,y,z,w of this point. */\n public set(x: number = 0, y: number = 0, z: number = 0, w: number = 0): Point4d {\n this.xyzw[0] = x;\n this.xyzw[1] = y;\n this.xyzw[2] = z;\n this.xyzw[3] = w;\n return this;\n }\n /** Set a component by index.\n * * No change if index is out of range.\n */\n public setComponent(index: number, value: number) {\n if (index >= 0 && index < 4) {\n this.xyzw[index] = value;\n }\n }\n /** The x component. */\n public get x() { return this.xyzw[0]; }\n public set x(val: number) { this.xyzw[0] = val; }\n /** The y component. */\n public get y() { return this.xyzw[1]; }\n public set y(val: number) { this.xyzw[1] = val; }\n /** The z component. */\n public get z() { return this.xyzw[2]; }\n public set z(val: number) { this.xyzw[2] = val; }\n /** The w component of this point. */\n public get w() { return this.xyzw[3]; }\n public set w(val: number) { this.xyzw[3] = val; }\n /** Construct from coordinates. */\n protected constructor(x: number = 0, y: number = 0, z: number = 0, w: number = 0) {\n super();\n this.xyzw = new Float64Array(4);\n this.xyzw[0] = x;\n this.xyzw[1] = y;\n this.xyzw[2] = z;\n this.xyzw[3] = w;\n }\n /** Return a Point4d with specified x,y,z,w */\n public static create(x: number = 0, y: number = 0, z: number = 0, w: number = 0, result?: Point4d): Point4d {\n return result ? result.set(x, y, z, w) : new Point4d(x, y, z, w);\n }\n /**\n * Create a \"Point4d as a plane\" from \"any\" other [[PlaneAltitudeEvaluator]] type.\n * @param source\n * @returns\n */\n public static createPlaneFrom(source: PlaneAltitudeEvaluator): Point4d | undefined {\n return new Point4d(source.normalX(), source.normalY(), source.normalZ(), source.altitudeXYZ(0, 0, 0));\n }\n /** Copy coordinates from `other`. */\n public setFrom(other: Point4d): Point4d {\n this.xyzw[0] = other.xyzw[0];\n this.xyzw[1] = other.xyzw[1];\n this.xyzw[2] = other.xyzw[2];\n this.xyzw[3] = other.xyzw[3];\n return this;\n }\n /** Clone this point */\n public clone(result?: Point4d): Point4d {\n return result ? result.setFrom(this) : new Point4d(this.xyzw[0], this.xyzw[1], this.xyzw[2], this.xyzw[3]);\n }\n /** Set this point's xyzw from a json array `[x,y,z,w]` */\n public setFromJSON(json?: Point4dProps) {\n if (Geometry.isNumberArray(json, 4))\n this.set(json[0], json[1], json[2], json[3]);\n else\n this.set(0, 0, 0, 0);\n }\n\n /** Create a new point with coordinates from a json array `[x,y,z,w]` */\n public static fromJSON(json?: Point4dProps): Point4d {\n const result = new Point4d();\n result.setFromJSON(json);\n return result;\n }\n /** Near-equality test, using `Geometry.isSameCoordinate` on all 4 x,y,z,w */\n public isAlmostEqual(other: Point4d, tolerance: number = Geometry.smallMetricDistance): boolean {\n return Geometry.isSameCoordinate(this.x, other.x, tolerance)\n && Geometry.isSameCoordinate(this.y, other.y, tolerance)\n && Geometry.isSameCoordinate(this.z, other.z, tolerance)\n && Geometry.isSameCoordinate(this.w, other.w, tolerance);\n }\n /**\n * Test for same coordinate by direct x,y,z,w args\n * @param x x to test\n * @param y y to test\n * @param z z to test\n * @param w w to test\n */\n public isAlmostEqualXYZW(x: number, y: number, z: number, w: number, tolerance: number = Geometry.smallMetricDistance): boolean {\n return Geometry.isSameCoordinate(this.x, x, tolerance)\n && Geometry.isSameCoordinate(this.y, y, tolerance)\n && Geometry.isSameCoordinate(this.z, z, tolerance)\n && Geometry.isSameCoordinate(this.w, w, tolerance);\n }\n\n /**\n * Convert an Angle to a JSON object.\n * @return {*} [x,y,z,w]\n */\n public toJSON(): Point4dProps {\n return [this.xyzw[0], this.xyzw[1], this.xyzw[2], this.xyzw[3]];\n }\n /** Return the 4d distance from this point to other, with all 4 components squared into the hypotenuse.\n * * x,y,z,w all participate without normalization.\n */\n public distanceXYZW(other: Point4d): number {\n return Geometry.hypotenuseXYZW(other.xyzw[0] - this.xyzw[0], other.xyzw[1] - this.xyzw[1], other.xyzw[2] - this.xyzw[2], other.xyzw[3] - this.xyzw[3]);\n }\n /** Return the squared 4d distance from this point to other, with all 4 components squared into the hypotenuse.\n * * x,y,z,w all participate without normalization.\n */\n public distanceSquaredXYZW(other: Point4d): number {\n return Geometry.hypotenuseSquaredXYZW(other.xyzw[0] - this.xyzw[0], other.xyzw[1] - this.xyzw[1], other.xyzw[2] - this.xyzw[2], other.xyzw[3] - this.xyzw[3]);\n }\n /** Return the xy distance between the instance and `other` after normalizing by weights */\n public realDistanceXY(other: Point4d): number | undefined {\n const wA = this.w;\n const wB = other.w;\n if (Geometry.isSmallMetricDistance(wA) || Geometry.isSmallMetricDistance(wB))\n return undefined;\n return Geometry.hypotenuseXY(other.xyzw[0] / wB - this.xyzw[0] / wA, other.xyzw[1] / wB - this.xyzw[1] / wA);\n }\n /** Return the xy squared distance between the instance and `other` after normalizing by weights */\n public realDistanceSquaredXY(other: Point4d): number | undefined {\n const wA = this.w;\n const wB = other.w;\n if (Geometry.isSmallMetricDistance(wA) || Geometry.isSmallMetricDistance(wB))\n return undefined;\n return Geometry.hypotenuseSquaredXY(other.xyzw[0] / wB - this.xyzw[0] / wA, other.xyzw[1] / wB - this.xyzw[1] / wA);\n }\n /** Return the largest absolute distance between corresponding components\n * * x,y,z,w all participate without normalization.\n */\n public maxDiff(other: Point4d): number {\n return Math.max(Math.abs(other.xyzw[0] - this.xyzw[0]), Math.abs(other.xyzw[1] - this.xyzw[1]), Math.abs(other.xyzw[2] - this.xyzw[2]), Math.abs(other.xyzw[3] - this.xyzw[3]));\n }\n /** Return the largest absolute entry of all 4 components x,y,z,w */\n public maxAbs(): number {\n return Math.max(Math.abs(this.xyzw[0]), Math.abs(this.xyzw[1]), Math.abs(this.xyzw[2]), Math.abs(this.xyzw[3]));\n }\n /** Returns the magnitude including all 4 components x,y,z,w */\n public magnitudeXYZW(): number {\n return Geometry.hypotenuseXYZW(this.xyzw[0], this.xyzw[1], this.xyzw[2], this.xyzw[3]);\n }\n /** Returns the magnitude of the leading xyz components. w is ignored. (i.e. the leading xyz are NOT divided by w.) */\n public magnitudeSquaredXYZ(): number {\n return Geometry.hypotenuseSquaredXYZ(this.xyzw[0], this.xyzw[1], this.xyzw[2]);\n }\n\n /** Return the difference (this-other) using all 4 components x,y,z,w */\n public minus(other: Point4d, result?: Point4d): Point4d {\n return Point4d.create(this.xyzw[0] - other.xyzw[0], this.xyzw[1] - other.xyzw[1], this.xyzw[2] - other.xyzw[2], this.xyzw[3] - other.xyzw[3], result);\n }\n /** Return `((other.w * this) - (this.w * other))` */\n public crossWeightedMinus(other: Point4d, result?: Vector3d): Vector3d {\n const wa = this.xyzw[3];\n const wb = other.xyzw[3];\n return Vector3d.create(wb * this.xyzw[0] - wa * other.xyzw[0], wb * this.xyzw[1] - wa * other.xyzw[1], wb * this.xyzw[2] - wa * other.xyzw[2], result);\n }\n /** Return `((other.w * this) - (this.w * other))`, with other.w known to be 1 */\n public crossWeightedMinusPoint3d(other: Point3d, result?: Vector3d): Vector3d {\n const wa = this.xyzw[3];\n return Vector3d.create(this.xyzw[0] - wa * other.x, this.xyzw[1] - wa * other.y, this.xyzw[2] - wa * other.z, result);\n }\n /** Return the sum of this and other, using all 4 components x,y,z,w */\n public plus(other: Point4d, result?: Point4d): Point4d {\n return Point4d.create(this.xyzw[0] + other.xyzw[0], this.xyzw[1] + other.xyzw[1], this.xyzw[2] + other.xyzw[2], this.xyzw[3] + other.xyzw[3], result);\n }\n /** Test if all components are nearly zero. */\n public get isAlmostZero(): boolean {\n return Geometry.isSmallMetricDistance(this.maxAbs());\n }\n /** Create a point with zero in all coordinates. */\n public static createZero(): Point4d { return new Point4d(0, 0, 0, 0); }\n /**\n * Create plane coefficients for the plane containing pointA, pointB, and 0010.\n * @param pointA first point\n * @param pointB second point\n */\n public static createPlanePointPointZ(pointA: Point4d, pointB: Point4d, result?: Point4d) {\n return Point4d.create(pointA.y * pointB.w - pointA.w * pointB.y, pointA.w * pointB.x - pointA.x * pointB.w, 0.0, pointA.x * pointB.y - pointA.y * pointB.x, result);\n }\n /**\n * extract 3 consecutive numbers from a Float64Array into the xyz values of a Point4d with w = 1.\n * @param data buffer of numbers\n * @param xIndex first index for x,y,z sequence\n */\n public static createFromPackedXYZ(data: Float64Array, xIndex: number = 0, result?: Point4d): Point4d | undefined {\n if (xIndex >= 0 && xIndex + 2 < data.length)\n return Point4d.create(data[xIndex], data[xIndex + 1], data[xIndex + 2], 1.0, result);\n return undefined;\n }\n /**\n * extract 4 consecutive numbers from a Float64Array into a Point4d.\n * @param data buffer of numbers\n * @param xIndex first index for x,y,z,w sequence\n */\n public static createFromPacked(data: Float64Array, xIndex: number = 0, result?: Point4d): Point4d | undefined {\n if (xIndex >= 0 && xIndex + 3 < data.length)\n return Point4d.create(data[xIndex], data[xIndex + 1], data[xIndex + 2], data[xIndex + 3], result);\n return undefined;\n }\n /**\n * extract 4 consecutive numbers from a Float64Array into a Point4d.\n * @param data buffer of numbers\n * @param xIndex first index for x,y,z,w sequence. Assumed to be a valid index!\n * @deprecated in 4.x - might be removed in next major version. Use createFromPacked instead.\n */\n public static createFromPackedXYZW(data: Float64Array, xIndex: number = 0, result?: Point4d): Point4d {\n return Point4d.create(data[xIndex], data[xIndex + 1], data[xIndex + 2], data[xIndex + 3], result);\n }\n /** Create a `Point4d` with x,y,z from an `XYAndZ` input, and w from a separate number. */\n public static createFromPointAndWeight(xyz: XYAndZ, w: number): Point4d {\n return new Point4d(xyz.x, xyz.y, xyz.z, w);\n }\n /** Create a `Point4d` from\n * * Point2d, Point3d, or Point4d\n * * other structure with members x,y and optional z,w\n * * array of numbers\n * * default z is 0.0\n * * default w is 1.0 (array[3] can replace)\n */\n public static createFromPoint(point: XAndY | XYAndZ | Point4d | number[]): Point4d {\n if (point instanceof Point2d)\n return new Point4d(point.x, point.y, 0, 1);\n if (point instanceof Point3d)\n return new Point4d(point.x, point.y, point.z, 1);\n if (point instanceof Point4d)\n return point.clone();\n // hm ... some flavor of x,y,z subset ...\n if (Array.isArray(point)) {\n const x1 = point.length > 0 ? point[0] : 0.0;\n const y1 = point.length > 1 ? point[1] : 0.0;\n const z1 = point.length > 2 ? point[2] : 0.0;\n const w1 = point.length > 3 ? point[3] : 1.0;\n return new Point4d(x1, y1, z1, w1);\n }\n const x = point.x;\n const y = point.y;\n const z = point.hasOwnProperty(\"z\") ? (point as any).z : 0.0;\n const w = point.hasOwnProperty(\"w\") ? (point as any).w : 1.0;\n return new Point4d(x, y, z, w);\n\n }\n /** Return `point + vector * scalar` */\n public plusScaled(vector: Point4d, scaleFactor: number, result?: Point4d): Point4d {\n return Point4d.create(this.xyzw[0] + vector.xyzw[0] * scaleFactor, this.xyzw[1] + vector.xyzw[1] * scaleFactor, this.xyzw[2] + vector.xyzw[2] * scaleFactor, this.xyzw[3] + vector.xyzw[3] * scaleFactor, result);\n }\n /** Return interpolation between instance and pointB at fraction\n */\n public interpolate(fraction: number, pointB: Point4d, result?: Point4d): Point4d {\n const v = 1.0 - fraction;\n return Point4d.create(this.xyzw[0] * v + pointB.xyzw[0] * fraction, this.xyzw[1] * v + pointB.xyzw[1] * fraction, this.xyzw[2] * v + pointB.xyzw[2] * fraction, this.xyzw[3] * v + pointB.xyzw[3] * fraction, result);\n }\n /** Return `point + vectorA * scalarA + vectorB * scalarB` */\n public plus2Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, result?: Point4d): Point4d {\n return Point4d.create(this.xyzw[0] + vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB, this.xyzw[1] + vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB, this.xyzw[2] + vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB, this.xyzw[3] + vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB, result);\n }\n /** Return `point + vectorA * scalarA + vectorB * scalarB + vectorC * scalarC` */\n public plus3Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, vectorC: Point4d, scalarC: number, result?: Point4d): Point4d {\n return Point4d.create(this.xyzw[0] + vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB + vectorC.xyzw[0] * scalarC, this.xyzw[1] + vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB + vectorC.xyzw[1] * scalarC, this.xyzw[2] + vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB + vectorC.xyzw[2] * scalarC, this.xyzw[3] + vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB + vectorC.xyzw[3] * scalarC, result);\n }\n /** Return `point + vectorA * scalarA + vectorB * scalarB` */\n public static createAdd2Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, result?: Point4d): Point4d {\n return Point4d.create(vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB, vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB, vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB, vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB, result);\n }\n /** Return `point + vectorA \\ scalarA + vectorB * scalarB + vectorC * scalarC` */\n public static createAdd3Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, vectorC: Point4d, scalarC: number, result?: Point4d): Point4d {\n return Point4d.create(vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB + vectorC.xyzw[0] * scalarC, vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB + vectorC.xyzw[1] * scalarC, vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB + vectorC.xyzw[2] * scalarC, vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB + vectorC.xyzw[3] * scalarC, result);\n }\n /** Return dot product of (4d) vectors from the instance to targetA and targetB */\n public dotVectorsToTargets(targetA: Point4d, targetB: Point4d): number {\n return (targetA.xyzw[0] - this.xyzw[0]) * (targetB.xyzw[0] - this.xyzw[0]) +\n (targetA.xyzw[1] - this.xyzw[1]) * (targetB.xyzw[1] - this.xyzw[1]) +\n (targetA.xyzw[2] - this.xyzw[2]) * (targetB.xyzw[2] - this.xyzw[2]) +\n (targetA.xyzw[3] - this.xyzw[3]) * (targetB.xyzw[3] - this.xyzw[3]);\n }\n /** return (4d) dot product of the instance and other point. */\n public dotProduct(other: Point4d): number {\n return this.xyzw[0] * other.xyzw[0] + this.xyzw[1] * other.xyzw[1] + this.xyzw[2] * other.xyzw[2] + this.xyzw[3] * other.xyzw[3];\n }\n /** return (4d) dot product of the instance with xyzw */\n public dotProductXYZW(x: number, y: number, z: number, w: number): number {\n return this.xyzw[0] * x + this.xyzw[1] * y + this.xyzw[2] * z + this.xyzw[3] * w;\n }\n /** dotProduct with (point.x, point.y, point.z, 1) Used in PlaneAltitudeEvaluator interface */\n public altitude(point: Point3d): number {\n return this.xyzw[0] * point.x + this.xyzw[1] * point.y + this.xyzw[2] * point.z + this.xyzw[3];\n }\n /** dotProduct with (x, y, z, 1) Used in PlaneAltitudeEvaluator interface */\n public altitudeXYZ(x: number, y: number, z: number): number {\n return this.xyzw[0] * x + this.xyzw[1] * y + this.xyzw[2] * z + this.xyzw[3];\n }\n /** dotProduct with (point.x, point.y, point.z, point.w) Used in PlaneAltitudeEvaluator interface */\n public weightedAltitude(point: Point4d): number {\n return this.xyzw[0] * point.x + this.xyzw[1] * point.y + this.xyzw[2] * point.z + this.xyzw[3] * point.w;\n }\n /** dotProduct with (vector.x, vector.y, vector.z, 0). Used in PlaneAltitudeEvaluator interface */\n public velocity(vector: Vector3d): number {\n return this.xyzw[0] * vector.x + this.xyzw[1] * vector.y + this.xyzw[2] * vector.z;\n }\n /** dotProduct with (x,y,z, 0). Used in PlaneAltitudeEvaluator interface */\n public velocityXYZ(x: number, y: number, z: number): number {\n return this.xyzw[0] * x + this.xyzw[1] * y + this.xyzw[2] * z;\n }\n /**\n * Return the x component of the normal used to evaluate altitude.\n */\n public normalX(): number { return this.x; }\n /**\n * Return the x component of the normal used to evaluate altitude.\n */\n public normalY(): number { return this.y; }\n /**\n * Return the z component of the normal used to evaluate altitude.\n */\n public normalZ(): number { return this.z; }\n\n /** unit X vector */\n public static unitX(): Point4d { return new Point4d(1, 0, 0, 0); }\n /** unit Y vector */\n public static unitY(): Point4d { return new Point4d(0, 1, 0, 0); }\n /** unit Z vector */\n public static unitZ(): Point4d { return new Point4d(0, 0, 1, 0); }\n /** unit W vector */\n public static unitW(): Point4d { return new Point4d(0, 0, 0, 1); }\n /** Divide by denominator, but return undefined if denominator is zero. */\n public safeDivideOrNull(denominator: number, result?: Point4d): Point4d | undefined {\n if (denominator !== 0.0) {\n return this.scale(1.0 / denominator, result);\n }\n return undefined;\n }\n /**\n * * Return xyz projection of spacePoint to the plane (this Point4d is understood as plane coefficients, not point coordinates)\n * * If the xyz part of `this` are all zero, (a clone of) `spacePoint` is returned.\n */\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\n return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);\n }\n /** Return the projection of (x,y,z) onto the plane. */\n public override projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d {\n const h = this.altitudeXYZ(x, y, z);\n const nn = this.magnitudeSquaredXYZ();\n // this unusual tol is needed so that toPlane3dByOriginAndUnitNormal agrees with its original implementation\n const alpha = Geometry.conditionalDivideCoordinate(-h, nn, Geometry.largeFractionResult * Geometry.largeFractionResult);\n if (alpha === undefined)\n return Point3d.create(x, y, z, result);\n return Point3d.create(x + alpha * this.x, y + alpha * this.y, z + alpha * this.z, result);\n }\n /** scale all components (including w!!) */\n public scale(scale: number, result?: Point4d): Point4d {\n result = result ? result : new Point4d();\n result.xyzw[0] = this.xyzw[0] * scale;\n result.xyzw[1] = this.xyzw[1] * scale;\n result.xyzw[2] = this.xyzw[2] * scale;\n result.xyzw[3] = this.xyzw[3] * scale;\n return result;\n }\n /** Negate components (including w!!) */\n public negate(result?: Point4d): Point4d {\n result = result ? result : new Point4d();\n result.xyzw[0] = -this.xyzw[0];\n result.xyzw[1] = -this.xyzw[1];\n result.xyzw[2] = -this.xyzw[2];\n result.xyzw[3] = -this.xyzw[3];\n return result;\n }\n /**\n * If `this.w` is nonzero, return a 4d point `(x/w,y/w,z/w, 1)`\n * If `this.w` is zero, return undefined.\n * @param result optional result\n */\n public normalizeWeight(result?: Point4d): Point4d | undefined {\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\n result = result ? result : new Point4d();\n return this.safeDivideOrNull(mag, result);\n }\n /**\n * If `this.w` is nonzero, return a 3d point `(x/w,y/w,z/w)`\n * If `this.w` is zero, return undefined.\n * @param result optional result\n */\n public realPoint(result?: Point3d): Point3d | undefined {\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\n if (mag === 0.0)\n return undefined;\n const a = 1.0 / mag; // in zero case everything multiplies right back to true zero.\n return Point3d.create(this.xyzw[0] * a, this.xyzw[1] * a, this.xyzw[2] * a, result);\n }\n\n /** Convert the homogeneous point to a (strongly typed) point or vector.\n * * If `this.w` is nonzero, return a Point3d `(x/w,y/w,z/w)`\n * * If `this.w` is zero, return a Vector3d `(x,y,z)`\n */\n public realPointOrVector(): Point3d | Vector3d {\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\n if (mag === 0.0)\n return Vector3d.create(this.x, this.y, this.z);\n const a = 1.0 / mag; // in zero case everything multiplies right back to true zero.\n return Point3d.create(this.x * a, this.y * a, this.z * a);\n }\n /**\n * * If w is nonzero, return Point3d with x/w,y/w,z/w.\n * * If w is zero, return 000\n * @param x x coordinate\n * @param y y coordinate\n * @param z z coordinate\n * @param w w coordinate\n * @param result optional result\n */\n public static createRealPoint3dDefault000(x: number, y: number, z: number, w: number, result?: Point3d): Point3d {\n const mag = Geometry.correctSmallFraction(w);\n const a = mag === 0 ? 0.0 : (1.0 / mag); // in zero case everything multiplies right back to true zero.\n return Point3d.create(x * a, y * a, z * a, result);\n }\n /**\n * * If w is nonzero, return Vector3d which is the derivative of the projected xyz with given w and 4d derivatives.\n * * If w is zero, return 000\n * @param x x coordinate\n * @param y y coordinate\n * @param z z coordinate\n * @param w w coordinate\n * @param dx x coordinate of derivative\n * @param dy y coordinate of derivative\n * @param dz z coordinate of derivative\n * @param dw w coordinate of derivative\n * @param result optional result\n */\n public static createRealDerivativeRay3dDefault000(x: number, y: number, z: number, w: number, dx: number, dy: number, dz: number, dw: number, result?: Ray3d): Ray3d {\n const mag = Geometry.correctSmallFraction(w);\n // real point is X/w.\n // real derivative is (X' * w - X *w) / ww, and weight is always 0 by cross products.\n const a = mag === 0 ? 0.0 : (1.0 / mag); // in zero case everything multiplies right back to true zero.\n const aa = a * a;\n return Ray3d.createXYZUVW(x * a, y * a, z * a, (dx * w - dw * x) * aa, (dy * w - dw * y) * aa, (dz * w - dw * z) * aa, result);\n }\n /**\n * * If w is nonzero, return Vector3d which is the derivative of the projected xyz with given w and 4d derivatives.\n * * If w is zero, return 000\n * @param x x coordinate\n * @param y y coordinate\n * @param z z coordinate\n * @param w w coordinate\n * @param dx x coordinate of derivative\n * @param dy y coordinate of derivative\n * @param dz z coordinate of derivative\n * @param dw w coordinate of derivative\n * @param result optional result\n */\n public static createRealDerivativePlane3dByOriginAndVectorsDefault000(x: number, y: number, z: number, w: number, dx: number, dy: number, dz: number, dw: number, ddx: number, ddy: number, ddz: number, ddw: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n const mag = Geometry.correctSmallFraction(w);\n // real point is X/w.\n // real derivative is (X' * w - X *w) / ww, and weight is always 0 by cross products.\n const a = mag === 0 ? 0.0 : (1.0 / mag); // in zero case everything multiplies right back to true zero.\n const aa = a * a;\n const fx = x * a;\n const fy = y * a;\n const fz = z * a;\n const dfx = (dx * w - dw * x) * aa;\n const dfy = (dy * w - dw * y) * aa;\n const dfz = (dz * w - dw * z) * aa;\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(fx, fy, fz, dfx, dfy, dfz, quotientDerivative2(ddx, dw, ddw, fx, dfx, a), quotientDerivative2(ddy, dw, ddw, fy, dfy, a), quotientDerivative2(ddz, dw, ddw, fz, dfz, a), result);\n }\n /**\n * * If this.w is nonzero, return Point3d with x/w,y/w,z/w.\n * * If this.w is zero, return 000\n */\n public realPointDefault000(result?: Point3d): Point3d {\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\n if (mag === 0.0)\n return Point3d.create(0, 0, 0, result);\n result = result ? result : new Point3d();\n const a = 1.0 / mag;\n return Point3d.create(this.xyzw[0] * a, this.xyzw[1] * a, this.xyzw[2] * a, result);\n }\n /** divide all components (x,y,z,w) by the 4d magnitude.\n *\n * * This is appropriate for normalizing a quaternion\n * * Use normalizeWeight to divide by the w component.\n */\n public normalizeXYZW(result?: Point4d): Point4d | undefined {\n const mag = Geometry.correctSmallFraction(this.magnitudeXYZW());\n result = result ? result : new Point4d();\n return this.safeDivideOrNull(mag, result);\n }\n\n /**\n * Return the determinant of the 3x3 matrix using components i,j,k of the 3 inputs.\n */\n public static determinantIndexed3X3(pointA: Point4d, pointB: Point4d, pointC: Point4d, i: number, j: number, k: number) {\n return Geometry.tripleProduct(\n pointA.xyzw[i], pointA.xyzw[j], pointA.xyzw[k],\n pointB.xyzw[i], pointB.xyzw[j], pointB.xyzw[k],\n pointC.xyzw[i], pointC.xyzw[j], pointC.xyzw[k]);\n }\n /**\n * Return a Point4d perpendicular to all 3 inputs. (A higher level cross product concept)\n * @param pointA first point\n * @param pointB second point\n * @param pointC third point\n */\n public static perpendicularPoint4dPlane(pointA: Point4d, pointB: Point4d, pointC: Point4d): Point4d {\n return Point4d.create(\n Point4d.determinantIndexed3X3(pointA, pointB, pointC, 1, 2, 3),\n -Point4d.determinantIndexed3X3(pointA, pointB, pointC, 2, 3, 0),\n Point4d.determinantIndexed3X3(pointA, pointB, pointC, 3, 0, 1),\n -Point4d.determinantIndexed3X3(pointA, pointB, pointC, 0, 1, 2));\n }\n /** Treating this Point4d as plane coefficients, convert to origin and normal form. */\n public toPlane3dByOriginAndUnitNormal(result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined {\n return Plane3dByOriginAndUnitNormal.createFrom(this, result);\n }\n /** Normalize so sum of squares of all 4 coordinates is 1. */\n public normalizeQuaternion() {\n const magnitude = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n\n if (magnitude > 0.0) {\n const f = 1.0 / magnitude;\n this.x *= f;\n this.y *= f;\n this.z *= f;\n this.w *= f;\n }\n return magnitude;\n }\n /** Return a (normalized) quaternion interpolated between two quaternions. */\n public static interpolateQuaternions(quaternion0: Point4d, fractionParameter: number, quaternion1: Point4d, result?: Point4d): Point4d {\n if (!result)\n result = new Point4d();\n const maxSafeCosine = 0.9995;\n\n // return exact quaternions for special values\n if (0.0 === fractionParameter) {\n result = quaternion0;\n return result;\n }\n if (1.0 === fractionParameter) {\n result = quaternion1;\n return result;\n }\n if (0.5 === fractionParameter) {\n quaternion0.plus(quaternion1, result);\n result.normalizeQuaternion();\n return result;\n }\n\n const q0 = quaternion0.clone();\n const q1 = quaternion1.clone();\n let dot = quaternion0.dotProduct(quaternion1);\n\n // prevent interpolation through the longer great arc\n if (dot < 0.0) {\n q1.negate(q1);\n dot = -dot;\n }\n\n // if nearly parallel, use interpolate and renormalize .\n if (dot > maxSafeCosine) {\n q0.interpolate(fractionParameter, q1, result);\n result.normalizeQuaternion();\n return result;\n }\n\n // safety check\n if (dot < -1.0)\n dot = -1.0;\n else if (dot > 1.0)\n dot = 1.0;\n\n // create orthonormal basis {q0, q2}\n const q2 = new Point4d();\n q1.plusScaled(q0, -dot, q2); // bsiDPoint4d_addScaledDPoint4d(& q2, & q1, & q0, -dot);\n q2.normalizeQuaternion();\n\n const angle = Math.acos(dot);\n const angleOfInterpolation = angle * fractionParameter;\n result = Point4d.createAdd2Scaled(q0, Math.cos(angleOfInterpolation), q2, Math.sin(angleOfInterpolation));\n return result;\n }\n /** Measure the \"angle\" between two points, using all 4 components in the dot product that\n * gives the cosine of the angle.\n */\n public radiansToPoint4dXYZW(other: Point4d): number | undefined {\n const magA = this.magnitudeXYZW();\n const magB = other.magnitudeXYZW();\n const dot = this.dotProduct(other); // == cos (theta) * magA * magB\n const cos = Geometry.conditionalDivideFraction(dot, magA * magB);\n if (cos === undefined)\n return undefined;\n return Math.acos(cos);\n }\n}\n"]}
@@ -210,7 +210,7 @@ export declare class IndexedPolyface extends Polyface {
210
210
  addColorIndex(index: number): void;
211
211
  /**
212
212
  * Clean up the open facet.
213
- * @deprecated in 4.x to remove nebulous "open facet" concept from the API. Call [[PolyfaceData.trimAllIndexArrays]]
213
+ * @deprecated in 4.x - might be removed in next major version. to remove nebulous "open facet" concept from the API. Call [[PolyfaceData.trimAllIndexArrays]]
214
214
  * instead.
215
215
  */
216
216
  cleanupOpenFacet(): void;
@@ -276,7 +276,7 @@ export declare class IndexedPolyface extends Polyface {
276
276
  extendRange(range: Range3d, transform?: Transform): void;
277
277
  /**
278
278
  * Given the index of a facet, return the data pertaining to the face it is a part of.
279
- * @deprecated in 4.x. Use [[IndexedPolyface.tryGetFaceData]], which verifies the index is in range.
279
+ * @deprecated in 4.x - might be removed in next major version. Use [[IndexedPolyface.tryGetFaceData]], which verifies the index is in range.
280
280
  */
281
281
  getFaceDataByFacetIndex(facetIndex: number): FacetFaceData;
282
282
  /**
@@ -464,7 +464,7 @@ export class IndexedPolyface extends Polyface {
464
464
  }
465
465
  /**
466
466
  * Clean up the open facet.
467
- * @deprecated in 4.x to remove nebulous "open facet" concept from the API. Call [[PolyfaceData.trimAllIndexArrays]]
467
+ * @deprecated in 4.x - might be removed in next major version. to remove nebulous "open facet" concept from the API. Call [[PolyfaceData.trimAllIndexArrays]]
468
468
  * instead.
469
469
  */
470
470
  cleanupOpenFacet() {
@@ -614,7 +614,7 @@ export class IndexedPolyface extends Polyface {
614
614
  }
615
615
  /**
616
616
  * Given the index of a facet, return the data pertaining to the face it is a part of.
617
- * @deprecated in 4.x. Use [[IndexedPolyface.tryGetFaceData]], which verifies the index is in range.
617
+ * @deprecated in 4.x - might be removed in next major version. Use [[IndexedPolyface.tryGetFaceData]], which verifies the index is in range.
618
618
  */
619
619
  getFaceDataByFacetIndex(facetIndex) {
620
620
  return this.data.face[this._facetToFaceData[facetIndex]];
@@ -1 +1 @@
1
- {"version":3,"file":"Polyface.js","sourceRoot":"","sources":["../../../src/polyface/Polyface.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,2BAA2B;AAE3B,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,OAAO,EAAY,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAW,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;GAIG;AACH,MAAM,OAAgB,QAAS,SAAQ,aAAa;IAClD,wCAAwC;IACxB,gBAAgB,GAAG,UAAU,CAAC;IAC9C,gCAAgC;IACzB,IAAI,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AAI,QAAQ,CAAC,cAAc,EAAE,IAAI,QAAQ,CAAC,cAAc,EAAE,YAAY,eAAe;YAC1F,MAAM,GAAG,QAAQ,CAAC,cAAc,EAAqB,CAAC;QACxD,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;YAChD,IAAI,aAAa,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,aAAa,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,UAAU;gBAC9F,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;QACrC,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","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 Polyface\n */\n\n// cspell:word internaldocs\n\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { Geometry } from \"../Geometry\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { GrowableXYArray } from \"../geometry3d/GrowableXYArray\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { FacetFaceData } from \"./FacetFaceData\";\nimport { IndexedPolyfaceVisitor } from \"./IndexedPolyfaceVisitor\";\nimport { PolyfaceData } from \"./PolyfaceData\";\n\n/**\n * A Polyface is an abstract mesh structure (of unspecified implementation) that provides a PolyfaceVisitor\n * to iterate over its facets.\n * @public\n */\nexport abstract class Polyface extends GeometryQuery {\n /** String name for schema properties */\n public readonly geometryCategory = \"polyface\";\n /** Underlying polyface data. */\n public data: PolyfaceData;\n /** Constructor */\n protected constructor(data: PolyfaceData) {\n super();\n this.data = data;\n }\n /**\n * Create and return a visitor for this concrete polyface.\n * @param numWrap the number of vertices to replicate in visitor arrays.\n */\n public abstract createVisitor(numWrap: number): PolyfaceVisitor;\n /**\n * The [[PolyfaceData.twoSided]] flag.\n */\n public get twoSided() {\n return this.data.twoSided;\n }\n public set twoSided(value: boolean) {\n this.data.twoSided = value;\n }\n /**\n * Flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2).\n * * A boundary edge of a mesh is defined as an edge with only one connected facet.\n * * Closed solid is a mesh with no boundary edge. Open sheet is a mesh that has boundary edge(s).\n */\n public get expectedClosure(): number {\n return this.data.expectedClosure;\n }\n public set expectedClosure(value: number) {\n this.data.expectedClosure = value;\n }\n /**\n * Check validity of indices into a data array.\n * * It is valid to have both indices and data undefined.\n * * It is NOT valid for just one to be defined.\n * * Index values at indices[indexPositionA <= i < indexPositionB] must be valid indices to the data array.\n * @param indices array of indices.\n * @param indexPositionA first index to test.\n * @param indexPositionB one past final index to test.\n * @param data data array.\n * @param dataLength length of data array.\n */\n public static areIndicesValid(\n indices: number[] | undefined,\n indexPositionA: number,\n indexPositionB: number,\n data: any,\n dataLength: number,\n ): boolean {\n if (indices === undefined && data === undefined)\n return true;\n if (indices === undefined || data === undefined)\n return false;\n if (indexPositionA < 0 || indexPositionA >= indices.length)\n return false;\n if (indexPositionB <= indexPositionA || indexPositionB > indices.length)\n return false;\n for (let i = indexPositionA; i < indexPositionB; i++)\n if (indices[i] < 0 || indices[i] >= dataLength)\n return false;\n return true;\n }\n /** Returns true if this polyface has no facets. */\n public abstract get isEmpty(): boolean;\n /** Returns the number of facets of this polyface. Subclasses should override. */\n public get facetCount(): number | undefined {\n return undefined;\n }\n}\n\n/**\n * An `IndexedPolyface` is a set of facets which can have normal, param, and color arrays with independent point,\n * normal, param, and color indices.\n * @public\n */\nexport class IndexedPolyface extends Polyface { // more info can be found at geometry/internaldocs/Polyface.md\n /**\n * Start indices of all facets of the polyface.\n * * Each element is an index to the `this.data.pointIndex` array entry for a specific facet.\n * * The facet count is `_facetStart.length - 1`.\n * * The face loop for the i_th facet consists of the entries in `this.data.pointIndex` at indices `_facetStart[i]`\n * up to (but not including) `_facetStart[i + 1]`.\n * * Note the array is initialized with one entry (value 0).\n */\n protected _facetStart: number[];\n /**\n * Index to the `this.data.face` array entry for a specific facet.\n * * `_facetToFaceData` has one entry per facet.\n */\n protected _facetToFaceData: number[];\n /**\n * Constructor for a new polyface.\n * @param data PolyfaceData arrays to capture.\n * @param facetStart optional array of facet start indices (e.g. known during clone)\n * @param facetToFacetData optional array of face identifiers (e.g. known during clone)\n */\n protected constructor(data: PolyfaceData, facetStart?: number[], facetToFaceData?: number[]) {\n super(data);\n if (facetStart)\n this._facetStart = facetStart.slice(); // deep copy\n else {\n this._facetStart = [];\n this._facetStart.push(0);\n }\n if (facetToFaceData)\n this._facetToFaceData = facetToFaceData.slice(); // deep copy\n else\n this._facetToFaceData = [];\n }\n\n /** Given an edgeIndex (index into `data.pointIndex`), return the index of the facet containing the edge. */\n public edgeIndexToFacetIndex(k: number | undefined): number | undefined {\n if (k === undefined)\n return undefined;\n return NumberArray.searchStrictlyIncreasingNumbers(this._facetStart, k);\n }\n /**\n * Given an edgeIndex (index into `data.pointIndex`), return the range of the edgeIndices of the containing facet.\n * * If an edge with edgeIndex `k` is found in the facet with facetIndex `f`, then the returned range `r` satisfies\n * `r.low = this.facetIndex0(f) <= k < this.facetIndex1(f) = r.high` and can be used to iterate the facet's face\n * loop. See [[facetIndex0]].\n */\n public edgeIndexToFaceLoop(k: number | undefined): Range1d | undefined {\n const q = this.edgeIndexToFacetIndex(k);\n if (q !== undefined)\n return Range1d.createXX(this.facetIndex0(q), this.facetIndex1(q));\n return undefined;\n }\n\n /** Test if other is an instance of `IndexedPolyface` */\n public isSameGeometryClass(other: any): boolean {\n return other instanceof IndexedPolyface;\n }\n /** Tests for equivalence between two IndexedPolyfaces. */\n public override isAlmostEqual(other: any): boolean {\n if (other instanceof IndexedPolyface) {\n return this.data.isAlmostEqual(other.data) &&\n NumberArray.isExactEqual(this._facetStart, other._facetStart) &&\n NumberArray.isExactEqual(this._facetToFaceData, other._facetToFaceData);\n }\n return false;\n }\n /** Returns true if either the point array or the point index array is empty. */\n public get isEmpty(): boolean {\n return this.data.pointCount === 0 || this.data.pointIndex.length === 0;\n }\n /**\n * Transform the mesh.\n * * If `transform` is a mirror, also reverse the index order around each facet.\n * * Note that this method always returns true. If transforming the normals fails (due to singular matrix or zero\n * normal), the original normal(s) are left unchanged.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n this.data.tryTransformInPlace(transform);\n if (transform.matrix.determinant() < 0)\n this.reverseIndices();\n return true;\n }\n /** Reverse indices for a single facet. */\n public reverseSingleFacet(facetId: number) {\n this.data.reverseIndicesSingleFacet(facetId, this._facetStart);\n }\n /** Return a deep clone. */\n public clone(): IndexedPolyface {\n return new IndexedPolyface(this.data.clone(), this._facetStart.slice(), this._facetToFaceData.slice());\n }\n /**\n * Return a deep clone with transformed points and normals.\n * @see [[IndexedPolyface.tryTransformInPlace]] for details of how transform is done.\n */\n public cloneTransformed(transform: Transform): IndexedPolyface { // we know tryTransformInPlace succeeds.\n const result = this.clone();\n result.tryTransformInPlace(transform);\n return result;\n }\n /** Reverse the order of indices around all facets. */\n public reverseIndices() {\n this.data.reverseIndices(this._facetStart);\n }\n /** Reverse the direction of all normal vectors. */\n public reverseNormals() {\n this.data.reverseNormals();\n }\n /**\n * Return face data using a facet index.\n * * Returns `undefined` if none found.\n * * This is the REFERENCE to the FacetFaceData not a copy.\n */\n public tryGetFaceData(i: number): FacetFaceData | undefined {\n if (i < 0 || i >= this._facetToFaceData.length)\n return undefined;\n const faceIndex = this._facetToFaceData[i];\n if (faceIndex < 0 || faceIndex >= this.data.face.length)\n return undefined;\n return this.data.face[faceIndex];\n }\n /**\n * Add facets from `source` to `this` polyface.\n * * Optionally reverse facet indices as per `PolyfaceData.reverseIndicesSingleFacet()` with `preserveStart = false` and\n * invert source normals.\n * * Optionally apply a `transform` to points and normals.\n * * Will only copy param, normal, color, and face data if we are already tracking them AND/OR the source contains them.\n */\n public addIndexedPolyface(source: IndexedPolyface, reversed: boolean, transform: Transform | undefined) {\n const numSourceFacets = source.facetCount;\n // add point, point index, and edge visibility data\n // note that there is no need to build an intermediate index map since all points are added\n const startOfNewPoints = this.data.point.length;\n const xyz = Point3d.create();\n for (let i = 0; i < source.data.point.length; i++) {\n source.data.point.getPoint3dAtUncheckedPointIndex(i, xyz);\n if (transform) {\n transform.multiplyPoint3d(xyz, xyz);\n this.addPoint(xyz);\n } else\n this.addPoint(xyz);\n }\n for (let i = 0; i < numSourceFacets; i++) {\n const i0 = source._facetStart[i];\n const i1 = source._facetStart[i + 1];\n if (reversed) {\n for (let j = i1; j-- > i0;) { // visibility is transferred from far vertex, e.g., -abc-d => dc-b-a\n this.addPointIndex(\n startOfNewPoints + source.data.pointIndex[j],\n source.data.edgeVisible[j > i0 ? j - 1 : i1 - 1],\n );\n }\n } else {\n for (let j = i0; j < i1; j++) {\n this.addPointIndex(\n startOfNewPoints + source.data.pointIndex[j],\n source.data.edgeVisible[j],\n );\n }\n }\n this.terminateFacet(false);\n }\n // add param and param index data\n if (undefined !== this.data.param && undefined !== source.data.param && undefined !== source.data.paramIndex) {\n const startOfNewParams = this.data.param.length;\n this.data.param.pushFromGrowableXYArray(source.data.param);\n for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals\n const i0 = source._facetStart[i];\n const i1 = source._facetStart[i + 1];\n if (reversed) {\n for (let j = i1; j-- > i0;)\n this.addParamIndex(startOfNewParams + source.data.paramIndex[j]);\n } else {\n for (let j = i0; j < i1; j++)\n this.addParamIndex(startOfNewParams + source.data.paramIndex[j]);\n }\n }\n }\n // add normal and normal index data\n if (undefined !== this.data.normal && undefined !== source.data.normal && undefined !== source.data.normalIndex) {\n const startOfNewNormals = this.data.normal.length;\n for (let i = 0; i < source.data.normal.length; i++) {\n const sourceNormal = source.data.normal.getVector3dAtCheckedVectorIndex(i)!;\n if (transform)\n transform.multiplyVector(sourceNormal, sourceNormal);\n if (reversed)\n sourceNormal.scaleInPlace(-1.0);\n this.addNormal(sourceNormal);\n }\n for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals\n const i0 = source._facetStart[i];\n const i1 = source._facetStart[i + 1];\n if (reversed) {\n for (let j = i1; j-- > i0;)\n this.addNormalIndex(startOfNewNormals + source.data.normalIndex[j]);\n } else {\n for (let j = i0; j < i1; j++)\n this.addNormalIndex(startOfNewNormals + source.data.normalIndex[j]);\n }\n }\n }\n // add color and color index data\n if (undefined !== this.data.color && undefined !== source.data.color && undefined !== source.data.colorIndex) {\n const startOfNewColors = this.data.color.length;\n for (const sourceColor of source.data.color)\n this.addColor(sourceColor);\n for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match colors\n const i0 = source._facetStart[i];\n const i1 = source._facetStart[i + 1];\n if (reversed) {\n for (let j = i1; j-- > i0;)\n this.addColorIndex(startOfNewColors + source.data.colorIndex[j]);\n } else {\n for (let j = i0; j < i1; j++)\n this.addColorIndex(startOfNewColors + source.data.colorIndex[j]);\n }\n }\n }\n // add face and facetToFace index data\n if (source.data.face.length !== 0) {\n const startOfNewFaceData = this.data.face.length;\n for (const face of source.data.face) {\n const sourceFaceData = face.clone();\n this.data.face.push(sourceFaceData);\n }\n for (const facetToFaceIdx of source._facetToFaceData) {\n this._facetToFaceData.push(startOfNewFaceData + facetToFaceIdx);\n }\n }\n }\n /**\n * Return the total number of indices in zero-terminated style, which includes\n * * all the indices in the packed zero-based table.\n * * one additional index for the zero-terminator of each facet.\n * @note Note that all index arrays (pointIndex, normalIndex, paramIndex, colorIndex) have the same counts, so there\n * is not a separate query for each of them.\n */\n public get zeroTerminatedIndexCount(): number {\n return this.data.pointIndex.length + this._facetStart.length - 1;\n }\n /**\n * Create an empty facet set with coordinate and index data to be supplied later.\n * @param needNormals `true` to allocate empty normal data and index arrays; `false` (default) to leave undefined.\n * @param needParams `true` to allocate empty uv parameter data and index arrays; `false` (default) to leave undefined.\n * @param needColors `true` to allocate empty color data and index arrays; `false` (default) to leave undefined.\n * @param twoSided `true` (default) if the facets are to be considered viewable from the back; `false` if they are amenable to backface culling.\n */\n public static create(\n needNormals: boolean = false,\n needParams: boolean = false,\n needColors: boolean = false,\n twoSided: boolean = true,\n ): IndexedPolyface {\n return new IndexedPolyface(new PolyfaceData(needNormals, needParams, needColors, twoSided));\n }\n /**\n * Add (a clone of) a point to point array.\n * @param point the point.\n * @param priorIndex (optional) index of prior point to check for possible duplicate value.\n * @returns the zero-based index of the added or duplicate point.\n */\n public addPoint(point: Point3d, priorIndex?: number): number {\n if (priorIndex !== undefined) {\n const distance = this.data.point.distanceIndexToPoint(priorIndex, point);\n if (distance !== undefined && Geometry.isSmallMetricDistance(distance))\n return priorIndex;\n }\n this.data.point.pushXYZ(point.x, point.y, point.z);\n return this.data.point.length - 1;\n }\n /**\n * Add a point to point array.\n * @param x the x coordinate of point.\n * @param y the y coordinate of point.\n * @param z the z coordinate of point.\n * @returns the zero-based index of the added point.\n */\n public addPointXYZ(x: number, y: number, z: number): number {\n this.data.point.pushXYZ(x, y, z);\n return this.data.point.length - 1;\n }\n /**\n * Add (a clone of) a uv parameter to the parameter array.\n * @param param the parameter.\n * @returns zero-based index of the added param.\n */\n public addParam(param: Point2d): number {\n if (!this.data.param)\n this.data.param = new GrowableXYArray();\n this.data.param.push(param);\n return this.data.param.length - 1;\n }\n /**\n * Add a uv parameter to the parameter array.\n * @param u the u part of parameter.\n * @param v the v part of parameter.\n * @param priorIndexA first index to check for possible duplicate value.\n * @param priorIndexB second index to check for possible duplicate value.\n * @returns zero-based index of the added or duplicate parameter.\n */\n public addParamUV(u: number, v: number, priorIndexA?: number, priorIndexB?: number): number {\n if (!this.data.param)\n this.data.param = new GrowableXYArray();\n if (priorIndexA !== undefined && this.data.isAlmostEqualParamIndexUV(priorIndexA, u, v))\n return priorIndexA;\n if (priorIndexB !== undefined && this.data.isAlmostEqualParamIndexUV(priorIndexB, u, v))\n return priorIndexB;\n this.data.param.pushXY(u, v);\n return this.data.param.length - 1;\n }\n /**\n * Add (a clone of) a normal vector to the normal array.\n * @param normal the normal vector.\n * @param priorIndexA first index to check for possible duplicate value.\n * @param priorIndexB second index to check for possible duplicate value.\n * @returns zero-based index of the added or duplicate normal.\n */\n public addNormal(normal: Vector3d, priorIndexA?: number, priorIndexB?: number): number {\n // check if `normal` is duplicate of `dataNormal` at index `i`\n const normalIsDuplicate = (i: number) => {\n const distance = this.data.normal!.distanceIndexToPoint(i, normal);\n return distance !== undefined && Geometry.isSmallMetricDistance(distance);\n };\n if (this.data.normal !== undefined) {\n if (priorIndexA !== undefined && normalIsDuplicate(priorIndexA))\n return priorIndexA;\n if (priorIndexB !== undefined && normalIsDuplicate(priorIndexB))\n return priorIndexB;\n // check the tail index for possible duplicate\n if (priorIndexA !== undefined || priorIndexB !== undefined) {\n const tailIndex = this.data.normal.length - 1;\n if (normalIsDuplicate(tailIndex))\n return tailIndex;\n }\n }\n return this.addNormalXYZ(normal.x, normal.y, normal.z);\n }\n /**\n * Add a normal vector to the normal array.\n * @param x the x coordinate of normal.\n * @param y the y coordinate of normal.\n * @param z the z coordinate of normal.\n * @returns zero-based index of the added normal vector.\n */\n public addNormalXYZ(x: number, y: number, z: number): number {\n if (!this.data.normal)\n this.data.normal = new GrowableXYZArray();\n this.data.normal.pushXYZ(x, y, z);\n return this.data.normal.length - 1;\n }\n /**\n * Add a color to the color array\n * @param color the color.\n * @returns zero-based index of the added color.\n */\n public addColor(color: number): number {\n if (!this.data.color)\n this.data.color = [];\n this.data.color.push(color);\n return this.data.color.length - 1;\n }\n /** Add a point index with edge visibility flag. */\n public addPointIndex(index: number, visible: boolean = true): void {\n this.data.pointIndex.push(index);\n this.data.edgeVisible.push(visible);\n }\n /** Add a normal index. */\n public addNormalIndex(index: number): void {\n if (!this.data.normalIndex)\n this.data.normalIndex = [];\n this.data.normalIndex.push(index);\n }\n /** Add a param index. */\n public addParamIndex(index: number): void {\n if (!this.data.paramIndex)\n this.data.paramIndex = [];\n this.data.paramIndex.push(index);\n }\n /** Add a color index. */\n public addColorIndex(index: number): void {\n if (!this.data.colorIndex)\n this.data.colorIndex = [];\n this.data.colorIndex.push(index);\n }\n /**\n * Clean up the open facet.\n * @deprecated in 4.x to remove nebulous \"open facet\" concept from the API. Call [[PolyfaceData.trimAllIndexArrays]]\n * instead.\n */\n public cleanupOpenFacet(): void {\n this.data.trimAllIndexArrays(this.data.pointIndex.length);\n }\n\n /**\n * Validate (the tail of) the active index arrays: point, normal, param, color.\n * @param index0 optional offset into the index arrays at which to start validating indices. Default 0.\n * @param errors optional array appended with error message(s) if invalid indices are encountered\n * @return whether the indices are valid\n */\n public validateAllIndices(index0: number = 0, errors?: string[]): boolean {\n const numPointIndices = this.data.pointIndex.length;\n const messages = errors ?? [];\n if (0 === numPointIndices) {\n messages.push(\"empty pointIndex array\");\n return false;\n }\n if (index0 < 0 || index0 >= numPointIndices) {\n messages.push(\"invalid input offset\");\n return false;\n }\n if (this.data.normalIndex && this.data.normalIndex.length !== numPointIndices)\n messages.push(\"normalIndex count must match pointIndex count\");\n if (this.data.paramIndex && this.data.paramIndex.length !== numPointIndices)\n messages.push(\"paramIndex count must equal pointIndex count\");\n if (this.data.colorIndex && this.data.colorIndex.length !== numPointIndices)\n messages.push(\"colorIndex count must equal pointIndex count\");\n if (this.data.edgeVisible.length !== numPointIndices)\n messages.push(\"visibleIndex count must equal pointIndex count\");\n if (!Polyface.areIndicesValid(this.data.pointIndex, index0, numPointIndices, this.data.point, this.data.point ? this.data.point.length : 0))\n messages.push(\"invalid point index encountered\");\n if (!Polyface.areIndicesValid(this.data.normalIndex, index0, numPointIndices, this.data.normal, this.data.normal ? this.data.normal.length : 0))\n messages.push(\"invalid normal index encountered\");\n if (!Polyface.areIndicesValid(this.data.paramIndex, index0, numPointIndices, this.data.param, this.data.param ? this.data.param.length : 0))\n messages.push(\"invalid param index encountered\");\n if (!Polyface.areIndicesValid(this.data.colorIndex, index0, numPointIndices, this.data.color, this.data.color ? this.data.color.length : 0))\n messages.push(\"invalid color index encountered\");\n if (this.data.edgeMateIndex) {\n if (this.data.edgeMateIndex.length !== numPointIndices)\n messages.push(\"edgeMateIndex count must equal pointIndex count\");\n else if (!this.data.edgeMateIndex.every((i: number | undefined) => i === undefined || this.data.isValidEdgeIndex(i)))\n messages.push(\"invalid edgeMate encountered\");\n }\n return 0 === messages.length;\n }\n\n /**\n * Announce the end of construction of a facet.\n * * Optionally check for:\n * * Same number of indices among all active index arrays -- point, normal, param, color\n * * All indices for the latest facet are within bounds of the respective data arrays.\n * * In error cases, all index arrays are trimmed back to the size when previous facet was terminated.\n * * A return value of `undefined` is normal. Otherwise, a string array of error messages is returned.\n */\n public terminateFacet(validateAllIndices: boolean = true): string[] | undefined {\n const numFacets = this._facetStart.length - 1;\n // number of indices in accepted facets\n const lengthA = this._facetStart[numFacets];\n // number of indices in all facets (accepted facet plus the last facet to be accepted)\n const lengthB = this.data.pointIndex.length;\n if (validateAllIndices) {\n const messages: string[] = [];\n if (lengthB < lengthA + 2)\n messages.push(\"Less than 3 indices in the last facet\");\n this.validateAllIndices(lengthA, messages);\n if (messages.length > 0) {\n this.data.trimAllIndexArrays(lengthA);\n return messages;\n }\n }\n this._facetStart.push(lengthB); // append start index of the future facet\n return undefined;\n }\n /** Number of facets (read-only property). */\n public override get facetCount(): number {\n return this._facetStart.length - 1;\n }\n /** Number of faces (read-only property). */\n public get faceCount(): number {\n return this.data.faceCount;\n }\n /** Number of points (read-only property). */\n public get pointCount(): number {\n return this.data.pointCount;\n }\n /** Number of colors (read-only property). */\n public get colorCount(): number {\n return this.data.colorCount;\n }\n /** Number of parameters (read-only property). */\n public get paramCount(): number {\n return this.data.paramCount;\n }\n /** Number of normals (read-only property). */\n public get normalCount(): number {\n return this.data.normalCount;\n }\n /** Test if `index` is a valid facet index. */\n public isValidFacetIndex(facetIndex: number): boolean {\n return facetIndex >= 0 && facetIndex < this.facetCount;\n }\n /** Return the number of edges in a particular facet. */\n public numEdgeInFacet(facetIndex: number): number {\n if (this.isValidFacetIndex(facetIndex))\n return this._facetStart[facetIndex + 1] - this._facetStart[facetIndex];\n return 0;\n }\n /**\n * Given a valid facet index, return the index at which its face loop starts in the index arrays.\n * * A \"face loop\" is a contiguous block of indices into the parallel polyface index arrays.\n * * Each of these indices represents an edge of a facet, thus it is sometimes called an \"edgeIndex\".\n * * Together with [[facetIndex1]], this method can be used to iterate the face loop of the facet\n * with index `iFacet` as follows:\n * ````\n * for (let iEdge = this.facetIndex0(iFacet); iEdge < this.facetIndex1(iFacet); iEdge++) {\n * const iPoint = this.data.pointIndex[iEdge];\n * const p = this.data.point[iPoint];\n * // ... process the edge of this facet starting at point p\n * }\n * ````\n */\n public facetIndex0(facetIndex: number): number {\n return this._facetStart[facetIndex];\n }\n /**\n * Given a valid facet index, return one past the index at which its face loop ends in the index arrays.\n * * For details, see [[facetIndex0]].\n */\n public facetIndex1(facetIndex: number): number {\n return this._facetStart[facetIndex + 1];\n }\n /** Return a readonly reference to the facetStart array accessed by [[facetIndex0]] and [[facetIndex1]]. */\n public get facetStart(): ReadonlyArray<number> {\n return this._facetStart;\n }\n /** create a visitor for this polyface */\n public createVisitor(numWrap: number = 0): IndexedPolyfaceVisitor {\n return IndexedPolyfaceVisitor.create(this, numWrap);\n }\n /** Return the range of (optionally transformed) points in this mesh. */\n public override range(transform?: Transform, result?: Range3d): Range3d {\n return this.data.range(result, transform);\n }\n /** Extend `range` with coordinates from this mesh. */\n public extendRange(range: Range3d, transform?: Transform): void {\n this.data.range(range, transform);\n }\n /**\n * Given the index of a facet, return the data pertaining to the face it is a part of.\n * @deprecated in 4.x. Use [[IndexedPolyface.tryGetFaceData]], which verifies the index is in range.\n */\n public getFaceDataByFacetIndex(facetIndex: number): FacetFaceData {\n return this.data.face[this._facetToFaceData[facetIndex]];\n }\n /**\n * Set new FacetFaceData.\n * * All terminated facets since the last face declaration will be mapped to a single new FacetFaceData object using\n * facetToFaceData[]. FacetFaceData holds the 2D range of the face. Returns `true` if successful, `false` otherwise.\n */\n public setNewFaceData(endFacetIndex: number = 0): boolean {\n const facetStart = this._facetToFaceData.length;\n if (facetStart >= this._facetStart.length)\n return false;\n if (0 === endFacetIndex) // the default for endFacetIndex is really the last facet\n endFacetIndex = this._facetStart.length; // last facet index corresponds to the future facet\n const faceData = FacetFaceData.createNull();\n const visitor = IndexedPolyfaceVisitor.create(this, 0);\n if (!visitor.moveToReadIndex(facetStart)) { // move visitor to first facet of new face\n return false;\n }\n // if parameter range is provided (by the polyface planeSet clipper) then use it\n const paramDefined = this.data.param !== undefined;\n const setParamRange: boolean = faceData.paramRange.isNull && paramDefined;\n do {\n if (setParamRange && visitor.param !== undefined)\n visitor.param.extendRange(faceData.paramRange);\n } while (visitor.moveToNextFacet() && visitor.currentReadIndex() < endFacetIndex);\n if (paramDefined && !(this.data.param!.length === 0) && faceData.paramDistanceRange.isNull)\n faceData.setParamDistanceRangeFromNewFaceData(this, facetStart, endFacetIndex);\n this.data.face.push(faceData);\n const faceDataIndex = this.data.face.length - 1;\n for (let i = this._facetToFaceData.length; i < endFacetIndex; i++)\n this._facetToFaceData.push(0 === this._facetStart[i] ? 0 : faceDataIndex);\n return true;\n }\n /** Second step of double dispatch: call `handler.handleIndexedPolyface(this)`. */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleIndexedPolyface(this);\n }\n /** If the input accesses an edgeMateIndex array, return it along with the owning IndexedPolyface. */\n public static hasEdgeMateIndex(polyface: Polyface | PolyfaceVisitor): { parent: IndexedPolyface, edgeMateIndex: Array<number | undefined> } | undefined {\n let parent: IndexedPolyface | undefined;\n if (polyface instanceof Polyface) {\n if (polyface instanceof IndexedPolyface)\n parent = polyface;\n } else if (polyface.clientPolyface() && polyface.clientPolyface() instanceof IndexedPolyface)\n parent = polyface.clientPolyface() as IndexedPolyface;\n if (parent) {\n const edgeMateIndex = parent.data.edgeMateIndex;\n if (edgeMateIndex && edgeMateIndex.length > 0 && edgeMateIndex.length === parent.data.indexCount)\n return { parent, edgeMateIndex };\n }\n return undefined;\n }\n}\n\n/**\n * A PolyfaceVisitor manages data while iterating facets.\n * * The polyface visitor holds data for one facet at a time.\n * * The caller can request the position in the addressed polyfaceData as a \"readIndex\".\n * * The readIndex values (as numbers) are not assumed to be sequential (i.e., they might be contiguous facet indices\n * or the indexing scheme might have gaps at the whim of the particular PolyfaceVisitor implementation).\n * * Example usage:\n * ```\n * const visitor = myPolyface.createVisitor();\n * for (visitor.reset(); visitor.moveToNextFacet(); ) {\n * // process the current facet\n * }\n * ```\n * @public\n */\nexport interface PolyfaceVisitor extends PolyfaceData {\n /** Load data for the facet with given index. */\n moveToReadIndex(index: number): boolean;\n /** Return the index of the currently loaded facet. */\n currentReadIndex(): number;\n /** Load data for the next facet. */\n moveToNextFacet(): boolean;\n /** Restart the visitor at the first facet. */\n reset(): void;\n /** Return the point index of vertex i within the currently loaded facet. */\n clientPointIndex(i: number): number;\n /** Return the param index of vertex i within the currently loaded facet. */\n clientParamIndex(i: number): number;\n /** Return the normal index of vertex i within the currently loaded facet. */\n clientNormalIndex(i: number): number;\n /** Return the color index of vertex i within the currently loaded facet. */\n clientColorIndex(i: number): number;\n /** Return the aux data index of vertex i within the currently loaded facet. */\n clientAuxIndex(i: number): number;\n /** Return the client polyface. */\n clientPolyface(): Polyface | undefined;\n /**\n * Set the number of vertices replicated in visitor arrays (both data and index arrays).\n * * 0,1,2 are the most common values.\n * * Example: suppose `[6,7,8]` is the pointIndex array representing a triangle. First edge would be `6,7`. Second\n * edge is `7,8`. Third edge is `8,6`. To access `6` for the third edge, we have to go back to the start of array.\n * Therefore, it is useful to store `6` at the end of pointIndex array, i.e., `[6,7,8,6]` meaning `numWrap = 1`.\n * * Continuing this example, `numWrap = 2` (i.e., `[6,7,8,6,7]`) is useful when each vertex visit requires\n * the next two points, e.g., to form two adjacent vectors for a cross product.\n */\n setNumWrap(numWrap: number): void;\n /** Clear the contents of the data arrays. Use this along with `pushDataFrom` to build up new facets. */\n clearArrays(): void;\n /** Transfer data from a specified index of the other visitor as new data in this visitor. */\n pushDataFrom(other: PolyfaceVisitor, index: number): void;\n /**\n * Transfer interpolated data from the other visitor.\n * * All data values are interpolated at `fraction` between `other` values at `index0` and `index1`.\n */\n pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void;\n /**\n * Return the number of facets this visitor is able to visit.\n * * Allows implementers to improve the efficiency of e.g., [[PolyfaceQuery.visitorClientFacetCount]].\n */\n getVisitableFacetCount?(): number;\n /** Create a visitor for a subset of the facets visitable by the instance. */\n createSubsetVisitor?(facetIndices: number[], numWrap: number): PolyfaceVisitor;\n}\n"]}
1
+ {"version":3,"file":"Polyface.js","sourceRoot":"","sources":["../../../src/polyface/Polyface.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,2BAA2B;AAE3B,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,OAAO,EAAY,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAW,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;GAIG;AACH,MAAM,OAAgB,QAAS,SAAQ,aAAa;IAClD,wCAAwC;IACxB,gBAAgB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C,MAAM,GAAG,QAAQ,CAAC;QACtB,CAAC;aAAM,IAAI,QAAQ,CAAC,cAAc,EAAE,IAAI,QAAQ,CAAC,cAAc,EAAE,YAAY,eAAe;YAC1F,MAAM,GAAG,QAAQ,CAAC,cAAc,EAAqB,CAAC;QACxD,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;YAChD,IAAI,aAAa,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,aAAa,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,UAAU;gBAC9F,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;QACrC,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","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 Polyface\n */\n\n// cspell:word internaldocs\n\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { Geometry } from \"../Geometry\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { GrowableXYArray } from \"../geometry3d/GrowableXYArray\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { FacetFaceData } from \"./FacetFaceData\";\nimport { IndexedPolyfaceVisitor } from \"./IndexedPolyfaceVisitor\";\nimport { PolyfaceData } from \"./PolyfaceData\";\n\n/**\n * A Polyface is an abstract mesh structure (of unspecified implementation) that provides a PolyfaceVisitor\n * to iterate over its facets.\n * @public\n */\nexport abstract class Polyface extends GeometryQuery {\n /** String name for schema properties */\n public readonly geometryCategory = \"polyface\";\n /** Underlying polyface data. */\n public data: PolyfaceData;\n /** Constructor */\n protected constructor(data: PolyfaceData) {\n super();\n this.data = data;\n }\n /**\n * Create and return a visitor for this concrete polyface.\n * @param numWrap the number of vertices to replicate in visitor arrays.\n */\n public abstract createVisitor(numWrap: number): PolyfaceVisitor;\n /**\n * The [[PolyfaceData.twoSided]] flag.\n */\n public get twoSided() {\n return this.data.twoSided;\n }\n public set twoSided(value: boolean) {\n this.data.twoSided = value;\n }\n /**\n * Flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2).\n * * A boundary edge of a mesh is defined as an edge with only one connected facet.\n * * Closed solid is a mesh with no boundary edge. Open sheet is a mesh that has boundary edge(s).\n */\n public get expectedClosure(): number {\n return this.data.expectedClosure;\n }\n public set expectedClosure(value: number) {\n this.data.expectedClosure = value;\n }\n /**\n * Check validity of indices into a data array.\n * * It is valid to have both indices and data undefined.\n * * It is NOT valid for just one to be defined.\n * * Index values at indices[indexPositionA <= i < indexPositionB] must be valid indices to the data array.\n * @param indices array of indices.\n * @param indexPositionA first index to test.\n * @param indexPositionB one past final index to test.\n * @param data data array.\n * @param dataLength length of data array.\n */\n public static areIndicesValid(\n indices: number[] | undefined,\n indexPositionA: number,\n indexPositionB: number,\n data: any,\n dataLength: number,\n ): boolean {\n if (indices === undefined && data === undefined)\n return true;\n if (indices === undefined || data === undefined)\n return false;\n if (indexPositionA < 0 || indexPositionA >= indices.length)\n return false;\n if (indexPositionB <= indexPositionA || indexPositionB > indices.length)\n return false;\n for (let i = indexPositionA; i < indexPositionB; i++)\n if (indices[i] < 0 || indices[i] >= dataLength)\n return false;\n return true;\n }\n /** Returns true if this polyface has no facets. */\n public abstract get isEmpty(): boolean;\n /** Returns the number of facets of this polyface. Subclasses should override. */\n public get facetCount(): number | undefined {\n return undefined;\n }\n}\n\n/**\n * An `IndexedPolyface` is a set of facets which can have normal, param, and color arrays with independent point,\n * normal, param, and color indices.\n * @public\n */\nexport class IndexedPolyface extends Polyface { // more info can be found at geometry/internaldocs/Polyface.md\n /**\n * Start indices of all facets of the polyface.\n * * Each element is an index to the `this.data.pointIndex` array entry for a specific facet.\n * * The facet count is `_facetStart.length - 1`.\n * * The face loop for the i_th facet consists of the entries in `this.data.pointIndex` at indices `_facetStart[i]`\n * up to (but not including) `_facetStart[i + 1]`.\n * * Note the array is initialized with one entry (value 0).\n */\n protected _facetStart: number[];\n /**\n * Index to the `this.data.face` array entry for a specific facet.\n * * `_facetToFaceData` has one entry per facet.\n */\n protected _facetToFaceData: number[];\n /**\n * Constructor for a new polyface.\n * @param data PolyfaceData arrays to capture.\n * @param facetStart optional array of facet start indices (e.g. known during clone)\n * @param facetToFacetData optional array of face identifiers (e.g. known during clone)\n */\n protected constructor(data: PolyfaceData, facetStart?: number[], facetToFaceData?: number[]) {\n super(data);\n if (facetStart)\n this._facetStart = facetStart.slice(); // deep copy\n else {\n this._facetStart = [];\n this._facetStart.push(0);\n }\n if (facetToFaceData)\n this._facetToFaceData = facetToFaceData.slice(); // deep copy\n else\n this._facetToFaceData = [];\n }\n\n /** Given an edgeIndex (index into `data.pointIndex`), return the index of the facet containing the edge. */\n public edgeIndexToFacetIndex(k: number | undefined): number | undefined {\n if (k === undefined)\n return undefined;\n return NumberArray.searchStrictlyIncreasingNumbers(this._facetStart, k);\n }\n /**\n * Given an edgeIndex (index into `data.pointIndex`), return the range of the edgeIndices of the containing facet.\n * * If an edge with edgeIndex `k` is found in the facet with facetIndex `f`, then the returned range `r` satisfies\n * `r.low = this.facetIndex0(f) <= k < this.facetIndex1(f) = r.high` and can be used to iterate the facet's face\n * loop. See [[facetIndex0]].\n */\n public edgeIndexToFaceLoop(k: number | undefined): Range1d | undefined {\n const q = this.edgeIndexToFacetIndex(k);\n if (q !== undefined)\n return Range1d.createXX(this.facetIndex0(q), this.facetIndex1(q));\n return undefined;\n }\n\n /** Test if other is an instance of `IndexedPolyface` */\n public isSameGeometryClass(other: any): boolean {\n return other instanceof IndexedPolyface;\n }\n /** Tests for equivalence between two IndexedPolyfaces. */\n public override isAlmostEqual(other: any): boolean {\n if (other instanceof IndexedPolyface) {\n return this.data.isAlmostEqual(other.data) &&\n NumberArray.isExactEqual(this._facetStart, other._facetStart) &&\n NumberArray.isExactEqual(this._facetToFaceData, other._facetToFaceData);\n }\n return false;\n }\n /** Returns true if either the point array or the point index array is empty. */\n public get isEmpty(): boolean {\n return this.data.pointCount === 0 || this.data.pointIndex.length === 0;\n }\n /**\n * Transform the mesh.\n * * If `transform` is a mirror, also reverse the index order around each facet.\n * * Note that this method always returns true. If transforming the normals fails (due to singular matrix or zero\n * normal), the original normal(s) are left unchanged.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n this.data.tryTransformInPlace(transform);\n if (transform.matrix.determinant() < 0)\n this.reverseIndices();\n return true;\n }\n /** Reverse indices for a single facet. */\n public reverseSingleFacet(facetId: number) {\n this.data.reverseIndicesSingleFacet(facetId, this._facetStart);\n }\n /** Return a deep clone. */\n public clone(): IndexedPolyface {\n return new IndexedPolyface(this.data.clone(), this._facetStart.slice(), this._facetToFaceData.slice());\n }\n /**\n * Return a deep clone with transformed points and normals.\n * @see [[IndexedPolyface.tryTransformInPlace]] for details of how transform is done.\n */\n public cloneTransformed(transform: Transform): IndexedPolyface { // we know tryTransformInPlace succeeds.\n const result = this.clone();\n result.tryTransformInPlace(transform);\n return result;\n }\n /** Reverse the order of indices around all facets. */\n public reverseIndices() {\n this.data.reverseIndices(this._facetStart);\n }\n /** Reverse the direction of all normal vectors. */\n public reverseNormals() {\n this.data.reverseNormals();\n }\n /**\n * Return face data using a facet index.\n * * Returns `undefined` if none found.\n * * This is the REFERENCE to the FacetFaceData not a copy.\n */\n public tryGetFaceData(i: number): FacetFaceData | undefined {\n if (i < 0 || i >= this._facetToFaceData.length)\n return undefined;\n const faceIndex = this._facetToFaceData[i];\n if (faceIndex < 0 || faceIndex >= this.data.face.length)\n return undefined;\n return this.data.face[faceIndex];\n }\n /**\n * Add facets from `source` to `this` polyface.\n * * Optionally reverse facet indices as per `PolyfaceData.reverseIndicesSingleFacet()` with `preserveStart = false` and\n * invert source normals.\n * * Optionally apply a `transform` to points and normals.\n * * Will only copy param, normal, color, and face data if we are already tracking them AND/OR the source contains them.\n */\n public addIndexedPolyface(source: IndexedPolyface, reversed: boolean, transform: Transform | undefined) {\n const numSourceFacets = source.facetCount;\n // add point, point index, and edge visibility data\n // note that there is no need to build an intermediate index map since all points are added\n const startOfNewPoints = this.data.point.length;\n const xyz = Point3d.create();\n for (let i = 0; i < source.data.point.length; i++) {\n source.data.point.getPoint3dAtUncheckedPointIndex(i, xyz);\n if (transform) {\n transform.multiplyPoint3d(xyz, xyz);\n this.addPoint(xyz);\n } else\n this.addPoint(xyz);\n }\n for (let i = 0; i < numSourceFacets; i++) {\n const i0 = source._facetStart[i];\n const i1 = source._facetStart[i + 1];\n if (reversed) {\n for (let j = i1; j-- > i0;) { // visibility is transferred from far vertex, e.g., -abc-d => dc-b-a\n this.addPointIndex(\n startOfNewPoints + source.data.pointIndex[j],\n source.data.edgeVisible[j > i0 ? j - 1 : i1 - 1],\n );\n }\n } else {\n for (let j = i0; j < i1; j++) {\n this.addPointIndex(\n startOfNewPoints + source.data.pointIndex[j],\n source.data.edgeVisible[j],\n );\n }\n }\n this.terminateFacet(false);\n }\n // add param and param index data\n if (undefined !== this.data.param && undefined !== source.data.param && undefined !== source.data.paramIndex) {\n const startOfNewParams = this.data.param.length;\n this.data.param.pushFromGrowableXYArray(source.data.param);\n for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals\n const i0 = source._facetStart[i];\n const i1 = source._facetStart[i + 1];\n if (reversed) {\n for (let j = i1; j-- > i0;)\n this.addParamIndex(startOfNewParams + source.data.paramIndex[j]);\n } else {\n for (let j = i0; j < i1; j++)\n this.addParamIndex(startOfNewParams + source.data.paramIndex[j]);\n }\n }\n }\n // add normal and normal index data\n if (undefined !== this.data.normal && undefined !== source.data.normal && undefined !== source.data.normalIndex) {\n const startOfNewNormals = this.data.normal.length;\n for (let i = 0; i < source.data.normal.length; i++) {\n const sourceNormal = source.data.normal.getVector3dAtCheckedVectorIndex(i)!;\n if (transform)\n transform.multiplyVector(sourceNormal, sourceNormal);\n if (reversed)\n sourceNormal.scaleInPlace(-1.0);\n this.addNormal(sourceNormal);\n }\n for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals\n const i0 = source._facetStart[i];\n const i1 = source._facetStart[i + 1];\n if (reversed) {\n for (let j = i1; j-- > i0;)\n this.addNormalIndex(startOfNewNormals + source.data.normalIndex[j]);\n } else {\n for (let j = i0; j < i1; j++)\n this.addNormalIndex(startOfNewNormals + source.data.normalIndex[j]);\n }\n }\n }\n // add color and color index data\n if (undefined !== this.data.color && undefined !== source.data.color && undefined !== source.data.colorIndex) {\n const startOfNewColors = this.data.color.length;\n for (const sourceColor of source.data.color)\n this.addColor(sourceColor);\n for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match colors\n const i0 = source._facetStart[i];\n const i1 = source._facetStart[i + 1];\n if (reversed) {\n for (let j = i1; j-- > i0;)\n this.addColorIndex(startOfNewColors + source.data.colorIndex[j]);\n } else {\n for (let j = i0; j < i1; j++)\n this.addColorIndex(startOfNewColors + source.data.colorIndex[j]);\n }\n }\n }\n // add face and facetToFace index data\n if (source.data.face.length !== 0) {\n const startOfNewFaceData = this.data.face.length;\n for (const face of source.data.face) {\n const sourceFaceData = face.clone();\n this.data.face.push(sourceFaceData);\n }\n for (const facetToFaceIdx of source._facetToFaceData) {\n this._facetToFaceData.push(startOfNewFaceData + facetToFaceIdx);\n }\n }\n }\n /**\n * Return the total number of indices in zero-terminated style, which includes\n * * all the indices in the packed zero-based table.\n * * one additional index for the zero-terminator of each facet.\n * @note Note that all index arrays (pointIndex, normalIndex, paramIndex, colorIndex) have the same counts, so there\n * is not a separate query for each of them.\n */\n public get zeroTerminatedIndexCount(): number {\n return this.data.pointIndex.length + this._facetStart.length - 1;\n }\n /**\n * Create an empty facet set with coordinate and index data to be supplied later.\n * @param needNormals `true` to allocate empty normal data and index arrays; `false` (default) to leave undefined.\n * @param needParams `true` to allocate empty uv parameter data and index arrays; `false` (default) to leave undefined.\n * @param needColors `true` to allocate empty color data and index arrays; `false` (default) to leave undefined.\n * @param twoSided `true` (default) if the facets are to be considered viewable from the back; `false` if they are amenable to backface culling.\n */\n public static create(\n needNormals: boolean = false,\n needParams: boolean = false,\n needColors: boolean = false,\n twoSided: boolean = true,\n ): IndexedPolyface {\n return new IndexedPolyface(new PolyfaceData(needNormals, needParams, needColors, twoSided));\n }\n /**\n * Add (a clone of) a point to point array.\n * @param point the point.\n * @param priorIndex (optional) index of prior point to check for possible duplicate value.\n * @returns the zero-based index of the added or duplicate point.\n */\n public addPoint(point: Point3d, priorIndex?: number): number {\n if (priorIndex !== undefined) {\n const distance = this.data.point.distanceIndexToPoint(priorIndex, point);\n if (distance !== undefined && Geometry.isSmallMetricDistance(distance))\n return priorIndex;\n }\n this.data.point.pushXYZ(point.x, point.y, point.z);\n return this.data.point.length - 1;\n }\n /**\n * Add a point to point array.\n * @param x the x coordinate of point.\n * @param y the y coordinate of point.\n * @param z the z coordinate of point.\n * @returns the zero-based index of the added point.\n */\n public addPointXYZ(x: number, y: number, z: number): number {\n this.data.point.pushXYZ(x, y, z);\n return this.data.point.length - 1;\n }\n /**\n * Add (a clone of) a uv parameter to the parameter array.\n * @param param the parameter.\n * @returns zero-based index of the added param.\n */\n public addParam(param: Point2d): number {\n if (!this.data.param)\n this.data.param = new GrowableXYArray();\n this.data.param.push(param);\n return this.data.param.length - 1;\n }\n /**\n * Add a uv parameter to the parameter array.\n * @param u the u part of parameter.\n * @param v the v part of parameter.\n * @param priorIndexA first index to check for possible duplicate value.\n * @param priorIndexB second index to check for possible duplicate value.\n * @returns zero-based index of the added or duplicate parameter.\n */\n public addParamUV(u: number, v: number, priorIndexA?: number, priorIndexB?: number): number {\n if (!this.data.param)\n this.data.param = new GrowableXYArray();\n if (priorIndexA !== undefined && this.data.isAlmostEqualParamIndexUV(priorIndexA, u, v))\n return priorIndexA;\n if (priorIndexB !== undefined && this.data.isAlmostEqualParamIndexUV(priorIndexB, u, v))\n return priorIndexB;\n this.data.param.pushXY(u, v);\n return this.data.param.length - 1;\n }\n /**\n * Add (a clone of) a normal vector to the normal array.\n * @param normal the normal vector.\n * @param priorIndexA first index to check for possible duplicate value.\n * @param priorIndexB second index to check for possible duplicate value.\n * @returns zero-based index of the added or duplicate normal.\n */\n public addNormal(normal: Vector3d, priorIndexA?: number, priorIndexB?: number): number {\n // check if `normal` is duplicate of `dataNormal` at index `i`\n const normalIsDuplicate = (i: number) => {\n const distance = this.data.normal!.distanceIndexToPoint(i, normal);\n return distance !== undefined && Geometry.isSmallMetricDistance(distance);\n };\n if (this.data.normal !== undefined) {\n if (priorIndexA !== undefined && normalIsDuplicate(priorIndexA))\n return priorIndexA;\n if (priorIndexB !== undefined && normalIsDuplicate(priorIndexB))\n return priorIndexB;\n // check the tail index for possible duplicate\n if (priorIndexA !== undefined || priorIndexB !== undefined) {\n const tailIndex = this.data.normal.length - 1;\n if (normalIsDuplicate(tailIndex))\n return tailIndex;\n }\n }\n return this.addNormalXYZ(normal.x, normal.y, normal.z);\n }\n /**\n * Add a normal vector to the normal array.\n * @param x the x coordinate of normal.\n * @param y the y coordinate of normal.\n * @param z the z coordinate of normal.\n * @returns zero-based index of the added normal vector.\n */\n public addNormalXYZ(x: number, y: number, z: number): number {\n if (!this.data.normal)\n this.data.normal = new GrowableXYZArray();\n this.data.normal.pushXYZ(x, y, z);\n return this.data.normal.length - 1;\n }\n /**\n * Add a color to the color array\n * @param color the color.\n * @returns zero-based index of the added color.\n */\n public addColor(color: number): number {\n if (!this.data.color)\n this.data.color = [];\n this.data.color.push(color);\n return this.data.color.length - 1;\n }\n /** Add a point index with edge visibility flag. */\n public addPointIndex(index: number, visible: boolean = true): void {\n this.data.pointIndex.push(index);\n this.data.edgeVisible.push(visible);\n }\n /** Add a normal index. */\n public addNormalIndex(index: number): void {\n if (!this.data.normalIndex)\n this.data.normalIndex = [];\n this.data.normalIndex.push(index);\n }\n /** Add a param index. */\n public addParamIndex(index: number): void {\n if (!this.data.paramIndex)\n this.data.paramIndex = [];\n this.data.paramIndex.push(index);\n }\n /** Add a color index. */\n public addColorIndex(index: number): void {\n if (!this.data.colorIndex)\n this.data.colorIndex = [];\n this.data.colorIndex.push(index);\n }\n /**\n * Clean up the open facet.\n * @deprecated in 4.x - might be removed in next major version. to remove nebulous \"open facet\" concept from the API. Call [[PolyfaceData.trimAllIndexArrays]]\n * instead.\n */\n public cleanupOpenFacet(): void {\n this.data.trimAllIndexArrays(this.data.pointIndex.length);\n }\n\n /**\n * Validate (the tail of) the active index arrays: point, normal, param, color.\n * @param index0 optional offset into the index arrays at which to start validating indices. Default 0.\n * @param errors optional array appended with error message(s) if invalid indices are encountered\n * @return whether the indices are valid\n */\n public validateAllIndices(index0: number = 0, errors?: string[]): boolean {\n const numPointIndices = this.data.pointIndex.length;\n const messages = errors ?? [];\n if (0 === numPointIndices) {\n messages.push(\"empty pointIndex array\");\n return false;\n }\n if (index0 < 0 || index0 >= numPointIndices) {\n messages.push(\"invalid input offset\");\n return false;\n }\n if (this.data.normalIndex && this.data.normalIndex.length !== numPointIndices)\n messages.push(\"normalIndex count must match pointIndex count\");\n if (this.data.paramIndex && this.data.paramIndex.length !== numPointIndices)\n messages.push(\"paramIndex count must equal pointIndex count\");\n if (this.data.colorIndex && this.data.colorIndex.length !== numPointIndices)\n messages.push(\"colorIndex count must equal pointIndex count\");\n if (this.data.edgeVisible.length !== numPointIndices)\n messages.push(\"visibleIndex count must equal pointIndex count\");\n if (!Polyface.areIndicesValid(this.data.pointIndex, index0, numPointIndices, this.data.point, this.data.point ? this.data.point.length : 0))\n messages.push(\"invalid point index encountered\");\n if (!Polyface.areIndicesValid(this.data.normalIndex, index0, numPointIndices, this.data.normal, this.data.normal ? this.data.normal.length : 0))\n messages.push(\"invalid normal index encountered\");\n if (!Polyface.areIndicesValid(this.data.paramIndex, index0, numPointIndices, this.data.param, this.data.param ? this.data.param.length : 0))\n messages.push(\"invalid param index encountered\");\n if (!Polyface.areIndicesValid(this.data.colorIndex, index0, numPointIndices, this.data.color, this.data.color ? this.data.color.length : 0))\n messages.push(\"invalid color index encountered\");\n if (this.data.edgeMateIndex) {\n if (this.data.edgeMateIndex.length !== numPointIndices)\n messages.push(\"edgeMateIndex count must equal pointIndex count\");\n else if (!this.data.edgeMateIndex.every((i: number | undefined) => i === undefined || this.data.isValidEdgeIndex(i)))\n messages.push(\"invalid edgeMate encountered\");\n }\n return 0 === messages.length;\n }\n\n /**\n * Announce the end of construction of a facet.\n * * Optionally check for:\n * * Same number of indices among all active index arrays -- point, normal, param, color\n * * All indices for the latest facet are within bounds of the respective data arrays.\n * * In error cases, all index arrays are trimmed back to the size when previous facet was terminated.\n * * A return value of `undefined` is normal. Otherwise, a string array of error messages is returned.\n */\n public terminateFacet(validateAllIndices: boolean = true): string[] | undefined {\n const numFacets = this._facetStart.length - 1;\n // number of indices in accepted facets\n const lengthA = this._facetStart[numFacets];\n // number of indices in all facets (accepted facet plus the last facet to be accepted)\n const lengthB = this.data.pointIndex.length;\n if (validateAllIndices) {\n const messages: string[] = [];\n if (lengthB < lengthA + 2)\n messages.push(\"Less than 3 indices in the last facet\");\n this.validateAllIndices(lengthA, messages);\n if (messages.length > 0) {\n this.data.trimAllIndexArrays(lengthA);\n return messages;\n }\n }\n this._facetStart.push(lengthB); // append start index of the future facet\n return undefined;\n }\n /** Number of facets (read-only property). */\n public override get facetCount(): number {\n return this._facetStart.length - 1;\n }\n /** Number of faces (read-only property). */\n public get faceCount(): number {\n return this.data.faceCount;\n }\n /** Number of points (read-only property). */\n public get pointCount(): number {\n return this.data.pointCount;\n }\n /** Number of colors (read-only property). */\n public get colorCount(): number {\n return this.data.colorCount;\n }\n /** Number of parameters (read-only property). */\n public get paramCount(): number {\n return this.data.paramCount;\n }\n /** Number of normals (read-only property). */\n public get normalCount(): number {\n return this.data.normalCount;\n }\n /** Test if `index` is a valid facet index. */\n public isValidFacetIndex(facetIndex: number): boolean {\n return facetIndex >= 0 && facetIndex < this.facetCount;\n }\n /** Return the number of edges in a particular facet. */\n public numEdgeInFacet(facetIndex: number): number {\n if (this.isValidFacetIndex(facetIndex))\n return this._facetStart[facetIndex + 1] - this._facetStart[facetIndex];\n return 0;\n }\n /**\n * Given a valid facet index, return the index at which its face loop starts in the index arrays.\n * * A \"face loop\" is a contiguous block of indices into the parallel polyface index arrays.\n * * Each of these indices represents an edge of a facet, thus it is sometimes called an \"edgeIndex\".\n * * Together with [[facetIndex1]], this method can be used to iterate the face loop of the facet\n * with index `iFacet` as follows:\n * ````\n * for (let iEdge = this.facetIndex0(iFacet); iEdge < this.facetIndex1(iFacet); iEdge++) {\n * const iPoint = this.data.pointIndex[iEdge];\n * const p = this.data.point[iPoint];\n * // ... process the edge of this facet starting at point p\n * }\n * ````\n */\n public facetIndex0(facetIndex: number): number {\n return this._facetStart[facetIndex];\n }\n /**\n * Given a valid facet index, return one past the index at which its face loop ends in the index arrays.\n * * For details, see [[facetIndex0]].\n */\n public facetIndex1(facetIndex: number): number {\n return this._facetStart[facetIndex + 1];\n }\n /** Return a readonly reference to the facetStart array accessed by [[facetIndex0]] and [[facetIndex1]]. */\n public get facetStart(): ReadonlyArray<number> {\n return this._facetStart;\n }\n /** create a visitor for this polyface */\n public createVisitor(numWrap: number = 0): IndexedPolyfaceVisitor {\n return IndexedPolyfaceVisitor.create(this, numWrap);\n }\n /** Return the range of (optionally transformed) points in this mesh. */\n public override range(transform?: Transform, result?: Range3d): Range3d {\n return this.data.range(result, transform);\n }\n /** Extend `range` with coordinates from this mesh. */\n public extendRange(range: Range3d, transform?: Transform): void {\n this.data.range(range, transform);\n }\n /**\n * Given the index of a facet, return the data pertaining to the face it is a part of.\n * @deprecated in 4.x - might be removed in next major version. Use [[IndexedPolyface.tryGetFaceData]], which verifies the index is in range.\n */\n public getFaceDataByFacetIndex(facetIndex: number): FacetFaceData {\n return this.data.face[this._facetToFaceData[facetIndex]];\n }\n /**\n * Set new FacetFaceData.\n * * All terminated facets since the last face declaration will be mapped to a single new FacetFaceData object using\n * facetToFaceData[]. FacetFaceData holds the 2D range of the face. Returns `true` if successful, `false` otherwise.\n */\n public setNewFaceData(endFacetIndex: number = 0): boolean {\n const facetStart = this._facetToFaceData.length;\n if (facetStart >= this._facetStart.length)\n return false;\n if (0 === endFacetIndex) // the default for endFacetIndex is really the last facet\n endFacetIndex = this._facetStart.length; // last facet index corresponds to the future facet\n const faceData = FacetFaceData.createNull();\n const visitor = IndexedPolyfaceVisitor.create(this, 0);\n if (!visitor.moveToReadIndex(facetStart)) { // move visitor to first facet of new face\n return false;\n }\n // if parameter range is provided (by the polyface planeSet clipper) then use it\n const paramDefined = this.data.param !== undefined;\n const setParamRange: boolean = faceData.paramRange.isNull && paramDefined;\n do {\n if (setParamRange && visitor.param !== undefined)\n visitor.param.extendRange(faceData.paramRange);\n } while (visitor.moveToNextFacet() && visitor.currentReadIndex() < endFacetIndex);\n if (paramDefined && !(this.data.param!.length === 0) && faceData.paramDistanceRange.isNull)\n faceData.setParamDistanceRangeFromNewFaceData(this, facetStart, endFacetIndex);\n this.data.face.push(faceData);\n const faceDataIndex = this.data.face.length - 1;\n for (let i = this._facetToFaceData.length; i < endFacetIndex; i++)\n this._facetToFaceData.push(0 === this._facetStart[i] ? 0 : faceDataIndex);\n return true;\n }\n /** Second step of double dispatch: call `handler.handleIndexedPolyface(this)`. */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleIndexedPolyface(this);\n }\n /** If the input accesses an edgeMateIndex array, return it along with the owning IndexedPolyface. */\n public static hasEdgeMateIndex(polyface: Polyface | PolyfaceVisitor): { parent: IndexedPolyface, edgeMateIndex: Array<number | undefined> } | undefined {\n let parent: IndexedPolyface | undefined;\n if (polyface instanceof Polyface) {\n if (polyface instanceof IndexedPolyface)\n parent = polyface;\n } else if (polyface.clientPolyface() && polyface.clientPolyface() instanceof IndexedPolyface)\n parent = polyface.clientPolyface() as IndexedPolyface;\n if (parent) {\n const edgeMateIndex = parent.data.edgeMateIndex;\n if (edgeMateIndex && edgeMateIndex.length > 0 && edgeMateIndex.length === parent.data.indexCount)\n return { parent, edgeMateIndex };\n }\n return undefined;\n }\n}\n\n/**\n * A PolyfaceVisitor manages data while iterating facets.\n * * The polyface visitor holds data for one facet at a time.\n * * The caller can request the position in the addressed polyfaceData as a \"readIndex\".\n * * The readIndex values (as numbers) are not assumed to be sequential (i.e., they might be contiguous facet indices\n * or the indexing scheme might have gaps at the whim of the particular PolyfaceVisitor implementation).\n * * Example usage:\n * ```\n * const visitor = myPolyface.createVisitor();\n * for (visitor.reset(); visitor.moveToNextFacet(); ) {\n * // process the current facet\n * }\n * ```\n * @public\n */\nexport interface PolyfaceVisitor extends PolyfaceData {\n /** Load data for the facet with given index. */\n moveToReadIndex(index: number): boolean;\n /** Return the index of the currently loaded facet. */\n currentReadIndex(): number;\n /** Load data for the next facet. */\n moveToNextFacet(): boolean;\n /** Restart the visitor at the first facet. */\n reset(): void;\n /** Return the point index of vertex i within the currently loaded facet. */\n clientPointIndex(i: number): number;\n /** Return the param index of vertex i within the currently loaded facet. */\n clientParamIndex(i: number): number;\n /** Return the normal index of vertex i within the currently loaded facet. */\n clientNormalIndex(i: number): number;\n /** Return the color index of vertex i within the currently loaded facet. */\n clientColorIndex(i: number): number;\n /** Return the aux data index of vertex i within the currently loaded facet. */\n clientAuxIndex(i: number): number;\n /** Return the client polyface. */\n clientPolyface(): Polyface | undefined;\n /**\n * Set the number of vertices replicated in visitor arrays (both data and index arrays).\n * * 0,1,2 are the most common values.\n * * Example: suppose `[6,7,8]` is the pointIndex array representing a triangle. First edge would be `6,7`. Second\n * edge is `7,8`. Third edge is `8,6`. To access `6` for the third edge, we have to go back to the start of array.\n * Therefore, it is useful to store `6` at the end of pointIndex array, i.e., `[6,7,8,6]` meaning `numWrap = 1`.\n * * Continuing this example, `numWrap = 2` (i.e., `[6,7,8,6,7]`) is useful when each vertex visit requires\n * the next two points, e.g., to form two adjacent vectors for a cross product.\n */\n setNumWrap(numWrap: number): void;\n /** Clear the contents of the data arrays. Use this along with `pushDataFrom` to build up new facets. */\n clearArrays(): void;\n /** Transfer data from a specified index of the other visitor as new data in this visitor. */\n pushDataFrom(other: PolyfaceVisitor, index: number): void;\n /**\n * Transfer interpolated data from the other visitor.\n * * All data values are interpolated at `fraction` between `other` values at `index0` and `index1`.\n */\n pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void;\n /**\n * Return the number of facets this visitor is able to visit.\n * * Allows implementers to improve the efficiency of e.g., [[PolyfaceQuery.visitorClientFacetCount]].\n */\n getVisitableFacetCount?(): number;\n /** Create a visitor for a subset of the facets visitable by the instance. */\n createSubsetVisitor?(facetIndices: number[], numWrap: number): PolyfaceVisitor;\n}\n"]}
@@ -278,7 +278,7 @@ export declare class PolyfaceBuilder extends NullGeometryHandler {
278
278
  * Apply stroke counts to curve primitives.
279
279
  * * Recursively visit all children of data.
280
280
  * * At each primitive, invoke `computeStrokeCountForOptions` method with options from the builder.
281
- * @deprecated in 4.x. This method does nothing and is unneeded.
281
+ * @deprecated in 4.x - might be removed in next major version. This method does nothing and is unneeded.
282
282
  */
283
283
  applyStrokeCountsToCurvePrimitives(data: AnyCurve | GeometryQuery): void;
284
284
  private addBetweenStrokeSetsWithRuledNormals;