@itwin/core-geometry 4.1.0-dev.67 → 4.1.0-dev.68

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 (45) hide show
  1. package/lib/cjs/curve/RegionOps.d.ts +1 -0
  2. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  3. package/lib/cjs/curve/RegionOps.js +1 -0
  4. package/lib/cjs/curve/RegionOps.js.map +1 -1
  5. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts +4 -4
  6. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
  7. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +4 -4
  8. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  9. package/lib/cjs/geometry3d/Plane3d.d.ts +41 -32
  10. package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -1
  11. package/lib/cjs/geometry3d/Plane3d.js +11 -8
  12. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  13. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +37 -34
  14. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
  15. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +65 -43
  16. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  17. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  18. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +2 -0
  19. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  20. package/lib/cjs/geometry3d/Transform.d.ts +3 -3
  21. package/lib/cjs/geometry3d/Transform.js +3 -3
  22. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  23. package/lib/esm/curve/RegionOps.d.ts +1 -0
  24. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  25. package/lib/esm/curve/RegionOps.js +1 -0
  26. package/lib/esm/curve/RegionOps.js.map +1 -1
  27. package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts +4 -4
  28. package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
  29. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +4 -4
  30. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  31. package/lib/esm/geometry3d/Plane3d.d.ts +41 -32
  32. package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -1
  33. package/lib/esm/geometry3d/Plane3d.js +11 -8
  34. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  35. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +37 -34
  36. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
  37. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +65 -43
  38. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  39. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  40. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +2 -0
  41. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  42. package/lib/esm/geometry3d/Transform.d.ts +3 -3
  43. package/lib/esm/geometry3d/Transform.js +3 -3
  44. package/lib/esm/geometry3d/Transform.js.map +1 -1
  45. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"Plane3dByOriginAndVectors.js","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndVectors.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,0CAAmE;AACnE,uCAAoC;AAEpC,uDAAsD;AACtD,mCAAgC;AAChC,2CAAwC;AAExC,yCAAsC;AAEtC;;;;;;;;;;;;;;GAcG;AACH,MAAa,yBAA0B,SAAQ,iBAAO;IAOpD,YAAoB,MAAe,EAAE,OAAiB,EAAE,OAAiB;QACvE,KAA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AAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC9C,IAAI,KAAK,IAAI,KAAK,EAAE;YAClB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;YACvE,MAAM,CAAC,GAAG,mBAAQ,CAAC,2BAA2B,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;YAClE,IAAI,CAAC,KAAK,SAAS;gBACjB,OAAO,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;SACzD;aAAM;YACL,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;YACvE,MAAM,CAAC,GAAG,mBAAQ,CAAC,2BAA2B,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;YAClE,IAAI,CAAC,KAAK,SAAS;gBACjB,OAAO,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;SACzD;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;CACF;AA5YD,8DA4YC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\nimport { AxisOrder, BeJSONFunctions, Geometry } from \"../Geometry\";\r\nimport { Plane3d } from \"./Plane3d\";\r\nimport { Point4d } from \"../geometry4d/Point4d\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { Ray3d } from \"./Ray3d\";\r\nimport { Transform } from \"./Transform\";\r\nimport { XYAndZ } from \"./XYZProps\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\n\r\n/**\r\n * A Plane3dByOriginAndVectors is an origin and a pair of vectors.\r\n * This defines a plane with a (possibly skewed) uv coordinate grid\r\n * * The grid directions (`vectorU` and `vectorV`)\r\n * * are NOT required to be unit vectors.\r\n * * are NOT required to be perpendicular vectors.\r\n * * The skewed, non-uniform scaling of the grid directions is the primary focus of this class.\r\n * * Queries of altitude, velocity, normalX, normalY, and normalZ use the NORMALIZED cross product of vectorU\r\n * and vectorV as plane normal.\r\n * * Hence these are cartesian distances.\r\n * * If numerous calls to these are expected, the repeated normalization may be a performance issue.\r\n * * Using a [[Plane3dByOriginAndUnitNormal]] or the rigid transform returned by [[toRigidFrame]] would provide\r\n * better performance.\r\n * @public\r\n */\r\nexport class Plane3dByOriginAndVectors extends Plane3d implements BeJSONFunctions {\r\n /** Origin of plane grid */\r\n public origin: Point3d;\r\n /** u direction in plane grid */\r\n public vectorU: Vector3d;\r\n /** v direction in plane grid */\r\n public vectorV: Vector3d;\r\n private constructor(origin: Point3d, vectorU: Vector3d, vectorV: Vector3d) {\r\n super();\r\n this.origin = origin;\r\n this.vectorU = vectorU;\r\n this.vectorV = vectorV;\r\n }\r\n /** Create a new plane from origin and 2 in-plane vectors. */\r\n public static createOriginAndVectors(\r\n origin: Point3d, vectorU: Vector3d, vectorV: Vector3d, result?: Plane3dByOriginAndVectors\r\n ): Plane3dByOriginAndVectors {\r\n if (result) {\r\n result.origin.setFrom(origin);\r\n result.vectorU.setFrom(vectorU);\r\n result.vectorV.setFrom(vectorV);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndVectors(origin.clone(), vectorU.clone(), vectorV.clone());\r\n }\r\n /** Clone to a new plane. */\r\n public clone(result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n if (result !== undefined)\r\n result.setOriginAndVectors(this.origin, this.vectorU, this.vectorV);\r\n return new Plane3dByOriginAndVectors(this.origin.clone(), this.vectorU.clone(), this.vectorV.clone());\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndVectors from a variety of plane types.\r\n * * The input is NOT captured.\r\n */\r\n public static createFrom(source: Plane3d, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors | undefined {\r\n if (source instanceof Plane3dByOriginAndVectors)\r\n return source.clone(result);\r\n const normal = source.getUnitNormal();\r\n if (normal === undefined)\r\n return undefined;\r\n const origin = source.getAnyPointOnPlane();\r\n const vectorU = Matrix3d.createPerpendicularVectorFavorXYPlane(normal);\r\n if (vectorU.tryNormalizeInPlace()) {\r\n const vectorV = normal.unitCrossProduct(vectorU);\r\n if (vectorV !== undefined)\r\n return new Plane3dByOriginAndVectors(origin, vectorU, vectorV);\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Return a Plane3dByOriginAndVectors, with\r\n * * origin is the translation (aka origin) from the Transform\r\n * * vectorU is the X column of the transform\r\n * * vectorV is the Y column of the transform.\r\n * @param transform source transform\r\n * @param xLength optional length to impose on vectorU.\r\n * @param yLength optional length to impose on vectorV.\r\n * @param result optional preexisting result\r\n */\r\n public static createFromTransformColumnsXYAndLengths(\r\n transform: Transform, xLength: number | undefined, yLength: number | undefined, result?: Plane3dByOriginAndVectors\r\n ): Plane3dByOriginAndVectors {\r\n if (result) {\r\n result.origin.setFrom(transform.getOrigin());\r\n transform.matrix.columnX(result.vectorU);\r\n transform.matrix.columnY(result.vectorV);\r\n } else {\r\n result = new Plane3dByOriginAndVectors(\r\n transform.getOrigin(),\r\n transform.matrix.columnX(),\r\n transform.matrix.columnY());\r\n }\r\n if (xLength !== undefined)\r\n result.vectorU.scaleToLength(xLength, result.vectorU);\r\n if (yLength !== undefined)\r\n result.vectorV.scaleToLength(yLength, result.vectorV);\r\n return result;\r\n }\r\n /** Capture origin and directions in a new plane. */\r\n public static createCapture(\r\n origin: Point3d, vectorU: Vector3d, vectorV: Vector3d, result?: Plane3dByOriginAndVectors\r\n ): Plane3dByOriginAndVectors {\r\n if (!result)\r\n return new Plane3dByOriginAndVectors(origin, vectorU, vectorV);\r\n result.origin = origin;\r\n result.vectorU = vectorU;\r\n result.vectorV = vectorV;\r\n return result;\r\n }\r\n\r\n /** Set all origin and both vectors from direct numeric parameters */\r\n public setOriginAndVectorsXYZ(\r\n x0: number, y0: number, z0: number, ux: number, uy: number, uz: number, vx: number, vy: number, vz: number\r\n ): Plane3dByOriginAndVectors {\r\n this.origin.set(x0, y0, z0);\r\n this.vectorU.set(ux, uy, uz);\r\n this.vectorV.set(vx, vy, vz);\r\n return this;\r\n }\r\n /**\r\n * Set all origin and both vectors from coordinates in given origin and vectors.\r\n * * Note that coordinates are copied out of the parameters -- the given parameters are NOT retained by reference.\r\n */\r\n public setOriginAndVectors(origin: Point3d, vectorU: Vector3d, vectorV: Vector3d): Plane3dByOriginAndVectors {\r\n this.origin.setFrom(origin);\r\n this.vectorU.setFrom(vectorU);\r\n this.vectorV.setFrom(vectorV);\r\n return this;\r\n }\r\n /** Create a new plane from direct numeric parameters */\r\n public static createOriginAndVectorsXYZ(\r\n x0: number, y0: number, z0: number,\r\n ux: number, uy: number, uz: number,\r\n vx: number, vy: number, vz: number,\r\n result?: Plane3dByOriginAndVectors\r\n ): Plane3dByOriginAndVectors {\r\n if (result)\r\n return result.setOriginAndVectorsXYZ(x0, y0, z0, ux, uy, uz, vx, vy, vz);\r\n return new Plane3dByOriginAndVectors(\r\n Point3d.create(x0, y0, z0), Vector3d.create(ux, uy, uz), Vector3d.create(vx, vy, vz)\r\n );\r\n }\r\n /**\r\n * Define a plane by three points in the plane.\r\n * @param origin origin for the parameterization.\r\n * @param targetU target point for the vectorU starting at the origin.\r\n * @param targetV target point for the vectorV originating at the origin.\r\n * @param result optional result.\r\n */\r\n public static createOriginAndTargets(\r\n origin: Point3d, targetU: Point3d, targetV: Point3d, result?: Plane3dByOriginAndVectors\r\n ): Plane3dByOriginAndVectors {\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\r\n origin.x, origin.y, origin.z,\r\n targetU.x - origin.x, targetU.y - origin.y, targetU.z - origin.z,\r\n targetV.x - origin.x, targetV.y - origin.y, targetV.z - origin.z,\r\n result\r\n );\r\n }\r\n /** Create a plane with origin at 000, unit vectorU in x direction, and unit vectorV in the y direction. */\r\n public static createXYPlane(result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(0, 0, 0, 1, 0, 0, 0, 1, 0, result);\r\n }\r\n /**\r\n * Create a plane from data presented as Float64Arrays.\r\n * @param origin x,y,z of origin.\r\n * @param vectorU x,y,z of vectorU\r\n * @param vectorV x,y,z of vectorV\r\n */\r\n public static createOriginAndVectorsArrays(\r\n origin: Float64Array, vectorU: Float64Array, vectorV: Float64Array, result?: Plane3dByOriginAndVectors\r\n ): Plane3dByOriginAndVectors {\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\r\n origin[0], origin[1], origin[2],\r\n vectorU[0], vectorU[1], vectorU[2],\r\n vectorV[0], vectorV[1], vectorV[2],\r\n result\r\n );\r\n }\r\n /**\r\n * Create a plane from data presented as Float64Array with weights\r\n * @param origin x,y,z,w of origin.\r\n * @param vectorU x,y,z,w of vectorU\r\n * @param vectorV x,y,z,w of vectorV\r\n */\r\n public static createOriginAndVectorsWeightedArrays(\r\n originW: Float64Array, vectorUw: Float64Array, vectorVw: Float64Array, result?: Plane3dByOriginAndVectors\r\n ): Plane3dByOriginAndVectors {\r\n const w = originW[3];\r\n result = Plane3dByOriginAndVectors.createXYPlane(result);\r\n if (Geometry.isSmallMetricDistance(w))\r\n return result;\r\n const dw = 1.0 / w;\r\n const au = vectorUw[3] * dw * dw;\r\n const av = vectorVw[3] * dw * dw;\r\n // for homogeneous function X, with w its weight:\r\n // (X/w) is the cartesian point.\r\n // (X/w)' = (X' w - X w')/(w*w)\r\n // = X'/w - (X/w)(w'/w)\r\n // = X'/w - X w'/w^2)\r\n // The w parts of the formal xyzw sums are identically 0.\r\n // Here the X' and its w' are taken from each vectorUw and vectorVw\r\n result.origin.set(originW[0] * dw, originW[1] * dw, originW[2] * dw);\r\n Vector3d.createAdd2ScaledXYZ(\r\n vectorUw[0], vectorUw[1], vectorUw[2], dw, originW[0], originW[1], originW[2], -au, result.vectorU\r\n );\r\n Vector3d.createAdd2ScaledXYZ(\r\n vectorVw[0], vectorVw[1], vectorVw[2], dw, originW[0], originW[1], originW[2], -av, result.vectorV\r\n );\r\n return result;\r\n }\r\n /**\r\n * Evaluate a point a grid coordinates on the plane.\r\n * * The computed point is `origin + vectorU * u + vectorV * v`\r\n * @param u coordinate along vectorU\r\n * @param v coordinate along vectorV\r\n * @param result optional result destination.\r\n * @returns Return the computed coordinate.\r\n */\r\n public fractionToPoint(u: number, v: number, result?: Point3d): Point3d {\r\n return this.origin.plus2Scaled(this.vectorU, u, this.vectorV, v, result);\r\n }\r\n /** Return the vector from the plane origin to parametric coordinate (u.v) */\r\n public fractionToVector(u: number, v: number, result?: Vector3d): Vector3d {\r\n return Vector3d.createAdd2Scaled(this.vectorU, u, this.vectorV, v, result);\r\n }\r\n /** Set coordinates from a json object such as `{origin: [1,2,3], vectorU:[4,5,6], vectorV[3,2,1]}` */\r\n public setFromJSON(json?: any) {\r\n if (!json || !json.origin || !json.vectorV) {\r\n this.origin.set(0, 0, 0);\r\n this.vectorU.set(1, 0, 0);\r\n this.vectorV.set(0, 1, 0);\r\n } else {\r\n this.origin.setFromJSON(json.origin);\r\n this.vectorU.setFromJSON(json.vectorU);\r\n this.vectorV.setFromJSON(json.vectorV);\r\n }\r\n }\r\n /**\r\n * Convert an Angle to a JSON object.\r\n * @return {*} [origin,normal]\r\n */\r\n public toJSON(): any {\r\n return {\r\n origin: this.origin.toJSON(),\r\n vectorU: this.vectorU.toJSON(),\r\n vectorV: this.vectorV.toJSON(),\r\n };\r\n }\r\n /** Create a new plane. See `setFromJSON` for layout example. */\r\n public static fromJSON(json?: any): Plane3dByOriginAndVectors {\r\n const result = Plane3dByOriginAndVectors.createXYPlane();\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Test origin and vectors for isAlmostEqual with `other` */\r\n public isAlmostEqual(other: Plane3dByOriginAndVectors): boolean {\r\n return this.origin.isAlmostEqual(other.origin)\r\n && this.vectorU.isAlmostEqual(other.vectorU)\r\n && this.vectorV.isAlmostEqual(other.vectorV);\r\n }\r\n /**\r\n * Normalize both `vectorU` and `vectorV` in place. This does NOT make them perpendicular.\r\n * * Return true if both succeeded.\r\n */\r\n public normalizeInPlace(): boolean {\r\n const okU = this.vectorU.normalizeInPlace();\r\n const okV = this.vectorV.normalizeInPlace();\r\n return okU && okV;\r\n }\r\n /** Return (if possible) a unit normal to the plane */\r\n public override getUnitNormal(result?: Vector3d): Vector3d | undefined {\r\n return this.vectorU.unitCrossProduct(this.vectorV, result);\r\n }\r\n /**\r\n * Return (if possible) a unit normal to the plane.\r\n * * This method is the same as getUnitNormal, which was created later as part of the abstract base class Plane3d.\r\n */\r\n public unitNormal(result?: Vector3d): Vector3d | undefined {\r\n return this.vectorU.unitCrossProduct(this.vectorV, result);\r\n }\r\n /**\r\n * Return some point on the plane.\r\n */\r\n public override getAnyPointOnPlane(result?: Point3d): Point3d {\r\n return this.origin.clone(result);\r\n }\r\n private static _workVector: Vector3d;\r\n /** Return (if possible) a ray with origin at plane origin, direction as unit normal to the plane */\r\n public unitNormalRay(result?: Ray3d): Ray3d | undefined {\r\n if (!Plane3dByOriginAndVectors._workVector)\r\n Plane3dByOriginAndVectors._workVector = Vector3d.create();\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV, Plane3dByOriginAndVectors._workVector);\r\n if (unitNormal === undefined)\r\n return undefined;\r\n return Ray3d.create(this.origin, unitNormal, result);\r\n }\r\n /**\r\n * Create a rigid frame (i.e. frenet frame) with\r\n * * origin at the plane origin\r\n * * x axis along the (normalized) vectorU\r\n * * y axis normalized vectorU to vectorV plane, and perpendicular to x axis\r\n * * z axis perpendicular to both.\r\n * @param result optional result\r\n */\r\n public toRigidFrame(result?: Transform): Transform | undefined {\r\n return Transform.createRigidFromOriginAndColumns(this.origin, this.vectorU, this.vectorV, AxisOrder.XYZ, result);\r\n }\r\n /** Apply the transform to the origin and vectors in place */\r\n public transformInPlace(transform: Transform) {\r\n transform.multiplyPoint3d(this.origin, this.origin);\r\n transform.multiplyVector(this.vectorU, this.vectorU);\r\n transform.multiplyVector(this.vectorV, this.vectorV);\r\n }\r\n /**\r\n * Return x component of the (normalized!) {vectorU CROSS vectorV}.\r\n * Return 0 if the cross product is zero.\r\n */\r\n public normalX(): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n return unitNormal !== undefined ? unitNormal.x : 0.0;\r\n }\r\n /**\r\n * Return y component of the (normalized!) {vectorU CROSS vectorV}.\r\n * Return 0 if the cross product is zero.\r\n */\r\n public normalY(): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n return unitNormal !== undefined ? unitNormal.y : 0.0;\r\n }\r\n /**\r\n * Return z component of the (normalized!) {vectorU CROSS vectorV}.\r\n * Return 0 if the cross product is zero.\r\n */\r\n public normalZ(): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n return unitNormal !== undefined ? unitNormal.z : 0.0;\r\n }\r\n /** Return signed cartesian altitude perpendicular to the plane. This uses the normalized cross product as normal. */\r\n public altitude(xyz: XYAndZ): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n if (unitNormal === undefined)\r\n return 0.0;\r\n return Geometry.dotProductXYZXYZ(\r\n (xyz.x - this.origin.x), (xyz.y - this.origin.y), (xyz.z - this.origin.z),\r\n unitNormal.x, unitNormal.y, unitNormal.z);\r\n }\r\n /** Return signed cartesian altitude perpendicular to the plane. This uses the normalized cross product as normal. */\r\n public altitudeXYZ(x: number, y: number, z: number): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n if (unitNormal === undefined)\r\n return 0.0;\r\n return Geometry.dotProductXYZXYZ(\r\n (x - this.origin.x), (y - this.origin.y), (z - this.origin.z),\r\n unitNormal.x, unitNormal.y, unitNormal.z);\r\n }\r\n /** Return signed projection of the input vector to the plane normal. This uses the normalized cross product as normal. */\r\n public velocity(xyzVector: XYAndZ): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n if (unitNormal === undefined)\r\n return 0.0;\r\n return Geometry.dotProductXYZXYZ(\r\n xyzVector.x, xyzVector.y, xyzVector.z,\r\n unitNormal.x, unitNormal.y, unitNormal.z);\r\n }\r\n /** Return signed projection of the input vector to the plane normal. This uses the normalized cross product as normal. */\r\n public velocityXYZ(x: number, y: number, z: number): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n if (unitNormal === undefined)\r\n return 0.0;\r\n return Geometry.dotProductXYZXYZ(\r\n x, y, z,\r\n unitNormal.x, unitNormal.y, unitNormal.z);\r\n }\r\n /**\r\n * Return triple product of homogeneous difference {(xyzw - w * origin)} with vectorU and vectorV.\r\n * * In the usual manner of homogeneous calculations, this is proportional to true cartesian distance from the\r\n * plane but is not a physical distance.\r\n */\r\n public weightedAltitude(xyzw: Point4d) {\r\n const w = xyzw.w;\r\n return Geometry.tripleProduct(\r\n (xyzw.x - this.origin.x * w), (xyzw.y - this.origin.y * w), (xyzw.z - this.origin.z * w),\r\n this.vectorU.x, this.vectorU.y, this.vectorU.z,\r\n this.vectorV.x, this.vectorV.y, this.vectorV.z);\r\n }\r\n /**\r\n * Return the projection of spacePoint onto the plane.\r\n * If the plane is degenerate to a ray, project to the ray.\r\n * If the plane is degenerate to its origin, return the point\r\n */\r\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n if (unitNormal !== undefined) {\r\n const w = unitNormal.dotProductStartEnd(this.origin, spacePoint);\r\n return spacePoint.plusScaled(unitNormal, -w, result);\r\n }\r\n // uh oh. vectorU and vectorV are colinear or zero.\r\n // project to ray defined by the longer one, or just to origin.\r\n const dotUU = this.vectorU.magnitudeSquared();\r\n const dotVV = this.vectorV.magnitudeSquared();\r\n if (dotUU >= dotVV) {\r\n const dotUW = this.vectorU.dotProductStartEnd(this.origin, spacePoint);\r\n const f = Geometry.conditionalDivideCoordinate(dotUW, dotUU, 0.0);\r\n if (f !== undefined)\r\n return spacePoint.plusScaled(this.vectorU, f, result);\r\n } else {\r\n const dotVW = this.vectorV.dotProductStartEnd(this.origin, spacePoint);\r\n const f = Geometry.conditionalDivideCoordinate(dotVW, dotVV, 0.0);\r\n if (f !== undefined)\r\n return spacePoint.plusScaled(this.vectorV, f, result);\r\n }\r\n return this.origin.clone(result);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Plane3dByOriginAndVectors.js","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndVectors.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,0CAAmE;AACnE,uCAAoC;AAEpC,uDAAsD;AACtD,mCAAgC;AAChC,2CAAwC;AAExC,yCAAsC;AAEtC;;;;;;;;;;;;;;GAcG;AACH,MAAa,yBAA0B,SAAQ,iBAAO;IAOpD,YAAoB,MAAe,EAAE,OAAiB,EAAE,OAAiB;QACvE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IACD,6DAA6D;IACtD,MAAM,CAAC,sBAAsB,CAClC,MAAe,EAAE,OAAiB,EAAE,OAAiB,EAAE,MAAkC;QAEzF,IAAI,MAAM,EAAE;YACV,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAC9B,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YAChC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YAChC,OAAO,MAAM,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CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;YACvE,MAAM,CAAC,GAAG,mBAAQ,CAAC,2BAA2B,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;YAClE,IAAI,CAAC,KAAK,SAAS;gBACjB,OAAO,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;SACzD;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;CACF;AA9YD,8DA8YC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\nimport { AxisOrder, BeJSONFunctions, Geometry } from \"../Geometry\";\r\nimport { Plane3d } from \"./Plane3d\";\r\nimport { Point4d } from \"../geometry4d/Point4d\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { Ray3d } from \"./Ray3d\";\r\nimport { Transform } from \"./Transform\";\r\nimport { XYAndZ } from \"./XYZProps\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\n\r\n/**\r\n * A Plane3dByOriginAndVectors is an origin and a pair of vectors.\r\n * This defines a plane with a (possibly skewed) uv coordinate grid\r\n * * The grid directions (`vectorU` and `vectorV`)\r\n * * are NOT required to be unit vectors.\r\n * * are NOT required to be perpendicular vectors.\r\n * * The skewed, non-uniform scaling of the grid directions is the primary focus of this class.\r\n * * Queries of altitude, velocity, normalX, normalY, and normalZ use the NORMALIZED cross product of vectorU\r\n * and vectorV as plane normal.\r\n * * Hence these are cartesian distances.\r\n * * If numerous calls to these are expected, the repeated normalization may be a performance issue.\r\n * * Using a [[Plane3dByOriginAndUnitNormal]] or the rigid transform returned by [[toRigidFrame]] would provide\r\n * better performance.\r\n * @public\r\n */\r\nexport class Plane3dByOriginAndVectors extends Plane3d implements BeJSONFunctions {\r\n /** Origin of plane grid */\r\n public origin: Point3d;\r\n /** u direction in plane grid */\r\n public vectorU: Vector3d;\r\n /** v direction in plane grid */\r\n public vectorV: Vector3d;\r\n private constructor(origin: Point3d, vectorU: Vector3d, vectorV: Vector3d) {\r\n super();\r\n this.origin = origin;\r\n this.vectorU = vectorU;\r\n this.vectorV = vectorV;\r\n }\r\n /** Create a new plane from origin and 2 in-plane vectors. */\r\n public static createOriginAndVectors(\r\n origin: Point3d, vectorU: Vector3d, vectorV: Vector3d, result?: Plane3dByOriginAndVectors\r\n ): Plane3dByOriginAndVectors {\r\n if (result) {\r\n result.origin.setFrom(origin);\r\n result.vectorU.setFrom(vectorU);\r\n result.vectorV.setFrom(vectorV);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndVectors(origin.clone(), vectorU.clone(), vectorV.clone());\r\n }\r\n /** Clone to a new plane. */\r\n public clone(result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n if (result !== undefined)\r\n result.setOriginAndVectors(this.origin, this.vectorU, this.vectorV);\r\n return new Plane3dByOriginAndVectors(this.origin.clone(), this.vectorU.clone(), this.vectorV.clone());\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndVectors from a variety of plane types.\r\n * * The input is NOT captured.\r\n */\r\n public static createFrom(source: Plane3d, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors | undefined {\r\n if (source instanceof Plane3dByOriginAndVectors)\r\n return source.clone(result);\r\n const normal = source.getUnitNormal();\r\n if (normal === undefined)\r\n return undefined;\r\n const origin = source.getAnyPointOnPlane();\r\n const vectorU = Matrix3d.createPerpendicularVectorFavorXYPlane(normal);\r\n if (vectorU.tryNormalizeInPlace()) {\r\n const vectorV = normal.unitCrossProduct(vectorU);\r\n if (vectorV !== undefined)\r\n return new Plane3dByOriginAndVectors(origin, vectorU, vectorV);\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Return a Plane3dByOriginAndVectors, with\r\n * * origin is the translation (aka origin) from the Transform\r\n * * vectorU is the X column of the transform\r\n * * vectorV is the Y column of the transform.\r\n * @param transform source transform\r\n * @param xLength optional length to impose on vectorU.\r\n * @param yLength optional length to impose on vectorV.\r\n * @param result optional preexisting result\r\n */\r\n public static createFromTransformColumnsXYAndLengths(\r\n transform: Transform, xLength: number | undefined, yLength: number | undefined, result?: Plane3dByOriginAndVectors\r\n ): Plane3dByOriginAndVectors {\r\n if (result) {\r\n result.origin.setFrom(transform.getOrigin());\r\n transform.matrix.columnX(result.vectorU);\r\n transform.matrix.columnY(result.vectorV);\r\n } else {\r\n result = new Plane3dByOriginAndVectors(\r\n transform.getOrigin(),\r\n transform.matrix.columnX(),\r\n transform.matrix.columnY());\r\n }\r\n if (xLength !== undefined)\r\n result.vectorU.scaleToLength(xLength, result.vectorU);\r\n if (yLength !== undefined)\r\n result.vectorV.scaleToLength(yLength, result.vectorV);\r\n return result;\r\n }\r\n /** Capture origin and directions in a new plane. */\r\n public static createCapture(\r\n origin: Point3d, vectorU: Vector3d, vectorV: Vector3d, result?: Plane3dByOriginAndVectors\r\n ): Plane3dByOriginAndVectors {\r\n if (!result)\r\n return new Plane3dByOriginAndVectors(origin, vectorU, vectorV);\r\n result.origin = origin;\r\n result.vectorU = vectorU;\r\n result.vectorV = vectorV;\r\n return result;\r\n }\r\n\r\n /** Set all origin and both vectors from direct numeric parameters */\r\n public setOriginAndVectorsXYZ(\r\n x0: number, y0: number, z0: number, ux: number, uy: number, uz: number, vx: number, vy: number, vz: number\r\n ): Plane3dByOriginAndVectors {\r\n this.origin.set(x0, y0, z0);\r\n this.vectorU.set(ux, uy, uz);\r\n this.vectorV.set(vx, vy, vz);\r\n return this;\r\n }\r\n /**\r\n * Set all origin and both vectors from coordinates in given origin and vectors.\r\n * * Note that coordinates are copied out of the parameters -- the given parameters are NOT retained by reference.\r\n */\r\n public setOriginAndVectors(origin: Point3d, vectorU: Vector3d, vectorV: Vector3d): Plane3dByOriginAndVectors {\r\n this.origin.setFrom(origin);\r\n this.vectorU.setFrom(vectorU);\r\n this.vectorV.setFrom(vectorV);\r\n return this;\r\n }\r\n /** Create a new plane from direct numeric parameters */\r\n public static createOriginAndVectorsXYZ(\r\n x0: number, y0: number, z0: number,\r\n ux: number, uy: number, uz: number,\r\n vx: number, vy: number, vz: number,\r\n result?: Plane3dByOriginAndVectors\r\n ): Plane3dByOriginAndVectors {\r\n if (result)\r\n return result.setOriginAndVectorsXYZ(x0, y0, z0, ux, uy, uz, vx, vy, vz);\r\n return new Plane3dByOriginAndVectors(\r\n Point3d.create(x0, y0, z0), Vector3d.create(ux, uy, uz), Vector3d.create(vx, vy, vz)\r\n );\r\n }\r\n /**\r\n * Define a plane by three points in the plane.\r\n * @param origin origin for the parameterization.\r\n * @param targetU target point for the vectorU starting at the origin.\r\n * @param targetV target point for the vectorV originating at the origin.\r\n * @param result optional result.\r\n */\r\n public static createOriginAndTargets(\r\n origin: Point3d, targetU: Point3d, targetV: Point3d, result?: Plane3dByOriginAndVectors\r\n ): Plane3dByOriginAndVectors {\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\r\n origin.x, origin.y, origin.z,\r\n targetU.x - origin.x, targetU.y - origin.y, targetU.z - origin.z,\r\n targetV.x - origin.x, targetV.y - origin.y, targetV.z - origin.z,\r\n result\r\n );\r\n }\r\n /** Create a plane with origin at 000, unit vectorU in x direction, and unit vectorV in the y direction. */\r\n public static createXYPlane(result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(0, 0, 0, 1, 0, 0, 0, 1, 0, result);\r\n }\r\n /**\r\n * Create a plane from data presented as Float64Arrays.\r\n * @param origin x,y,z of origin.\r\n * @param vectorU x,y,z of vectorU\r\n * @param vectorV x,y,z of vectorV\r\n */\r\n public static createOriginAndVectorsArrays(\r\n origin: Float64Array, vectorU: Float64Array, vectorV: Float64Array, result?: Plane3dByOriginAndVectors\r\n ): Plane3dByOriginAndVectors {\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\r\n origin[0], origin[1], origin[2],\r\n vectorU[0], vectorU[1], vectorU[2],\r\n vectorV[0], vectorV[1], vectorV[2],\r\n result\r\n );\r\n }\r\n /**\r\n * Create a plane from data presented as Float64Array with weights\r\n * @param origin x,y,z,w of origin.\r\n * @param vectorU x,y,z,w of vectorU\r\n * @param vectorV x,y,z,w of vectorV\r\n */\r\n public static createOriginAndVectorsWeightedArrays(\r\n originW: Float64Array, vectorUw: Float64Array, vectorVw: Float64Array, result?: Plane3dByOriginAndVectors\r\n ): Plane3dByOriginAndVectors {\r\n const w = originW[3];\r\n result = Plane3dByOriginAndVectors.createXYPlane(result);\r\n if (Geometry.isSmallMetricDistance(w))\r\n return result;\r\n const dw = 1.0 / w;\r\n const au = vectorUw[3] * dw * dw;\r\n const av = vectorVw[3] * dw * dw;\r\n // for homogeneous function X, with w its weight:\r\n // (X/w) is the cartesian point.\r\n // (X/w)' = (X' w - X w')/(w*w)\r\n // = X'/w - (X/w)(w'/w)\r\n // = X'/w - X w'/w^2)\r\n // The w parts of the formal xyzw sums are identically 0.\r\n // Here the X' and its w' are taken from each vectorUw and vectorVw\r\n result.origin.set(originW[0] * dw, originW[1] * dw, originW[2] * dw);\r\n Vector3d.createAdd2ScaledXYZ(\r\n vectorUw[0], vectorUw[1], vectorUw[2], dw, originW[0], originW[1], originW[2], -au, result.vectorU\r\n );\r\n Vector3d.createAdd2ScaledXYZ(\r\n vectorVw[0], vectorVw[1], vectorVw[2], dw, originW[0], originW[1], originW[2], -av, result.vectorV\r\n );\r\n return result;\r\n }\r\n /**\r\n * Evaluate a point a grid coordinates on the plane.\r\n * * The computed point is `origin + vectorU * u + vectorV * v`\r\n * @param u coordinate along vectorU\r\n * @param v coordinate along vectorV\r\n * @param result optional result destination.\r\n * @returns Return the computed coordinate.\r\n */\r\n public fractionToPoint(u: number, v: number, result?: Point3d): Point3d {\r\n return this.origin.plus2Scaled(this.vectorU, u, this.vectorV, v, result);\r\n }\r\n /** Return the vector from the plane origin to parametric coordinate (u.v) */\r\n public fractionToVector(u: number, v: number, result?: Vector3d): Vector3d {\r\n return Vector3d.createAdd2Scaled(this.vectorU, u, this.vectorV, v, result);\r\n }\r\n /** Set coordinates from a json object such as `{origin: [1,2,3], vectorU:[4,5,6], vectorV[3,2,1]}` */\r\n public setFromJSON(json?: any) {\r\n if (!json || !json.origin || !json.vectorV) {\r\n this.origin.set(0, 0, 0);\r\n this.vectorU.set(1, 0, 0);\r\n this.vectorV.set(0, 1, 0);\r\n } else {\r\n this.origin.setFromJSON(json.origin);\r\n this.vectorU.setFromJSON(json.vectorU);\r\n this.vectorV.setFromJSON(json.vectorV);\r\n }\r\n }\r\n /**\r\n * Convert an Angle to a JSON object.\r\n * @return {*} [origin,normal]\r\n */\r\n public toJSON(): any {\r\n return {\r\n origin: this.origin.toJSON(),\r\n vectorU: this.vectorU.toJSON(),\r\n vectorV: this.vectorV.toJSON(),\r\n };\r\n }\r\n /** Create a new plane. See `setFromJSON` for layout example. */\r\n public static fromJSON(json?: any): Plane3dByOriginAndVectors {\r\n const result = Plane3dByOriginAndVectors.createXYPlane();\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Test origin and vectors for isAlmostEqual with `other` */\r\n public isAlmostEqual(other: Plane3dByOriginAndVectors): boolean {\r\n return this.origin.isAlmostEqual(other.origin)\r\n && this.vectorU.isAlmostEqual(other.vectorU)\r\n && this.vectorV.isAlmostEqual(other.vectorV);\r\n }\r\n /**\r\n * Normalize both `vectorU` and `vectorV` in place. This does NOT make them perpendicular.\r\n * * Return true if both succeeded.\r\n */\r\n public normalizeInPlace(): boolean {\r\n const okU = this.vectorU.normalizeInPlace();\r\n const okV = this.vectorV.normalizeInPlace();\r\n return okU && okV;\r\n }\r\n /** Return (if possible) a unit normal to the plane */\r\n public override getUnitNormal(result?: Vector3d): Vector3d | undefined {\r\n return this.vectorU.unitCrossProduct(this.vectorV, result);\r\n }\r\n /**\r\n * Return (if possible) a unit normal to the plane.\r\n * * This method is the same as getUnitNormal, which was created later as part of the abstract base class Plane3d.\r\n */\r\n public unitNormal(result?: Vector3d): Vector3d | undefined {\r\n return this.vectorU.unitCrossProduct(this.vectorV, result);\r\n }\r\n /**\r\n * Return some point on the plane.\r\n */\r\n public override getAnyPointOnPlane(result?: Point3d): Point3d {\r\n // This function returns the plane origin. In general, a point x is on the plane if\r\n // and only if x = o + a*u + b*v, where a and b are scalars.\r\n return this.origin.clone(result);\r\n }\r\n private static _workVector: Vector3d;\r\n /** Return (if possible) a ray with origin at plane origin, direction as unit normal to the plane */\r\n public unitNormalRay(result?: Ray3d): Ray3d | undefined {\r\n if (!Plane3dByOriginAndVectors._workVector)\r\n Plane3dByOriginAndVectors._workVector = Vector3d.create();\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV, Plane3dByOriginAndVectors._workVector);\r\n if (unitNormal === undefined)\r\n return undefined;\r\n return Ray3d.create(this.origin, unitNormal, result);\r\n }\r\n /**\r\n * Create a rigid frame (i.e. frenet frame) with\r\n * * origin at the plane origin\r\n * * x axis along the (normalized) vectorU\r\n * * y axis normalized vectorU to vectorV plane, and perpendicular to x axis\r\n * * z axis perpendicular to both.\r\n * @param result optional result\r\n */\r\n public toRigidFrame(result?: Transform): Transform | undefined {\r\n return Transform.createRigidFromOriginAndColumns(this.origin, this.vectorU, this.vectorV, AxisOrder.XYZ, result);\r\n }\r\n /** Apply the transform to the origin and vectors in place */\r\n public transformInPlace(transform: Transform) {\r\n transform.multiplyPoint3d(this.origin, this.origin);\r\n transform.multiplyVector(this.vectorU, this.vectorU);\r\n transform.multiplyVector(this.vectorV, this.vectorV);\r\n }\r\n /**\r\n * Return x component of the (normalized!) {vectorU CROSS vectorV}.\r\n * Return 0 if the cross product is zero.\r\n */\r\n public normalX(): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n return unitNormal !== undefined ? unitNormal.x : 0.0;\r\n }\r\n /**\r\n * Return y component of the (normalized!) {vectorU CROSS vectorV}.\r\n * Return 0 if the cross product is zero.\r\n */\r\n public normalY(): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n return unitNormal !== undefined ? unitNormal.y : 0.0;\r\n }\r\n /**\r\n * Return z component of the (normalized!) {vectorU CROSS vectorV}.\r\n * Return 0 if the cross product is zero.\r\n */\r\n public normalZ(): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n return unitNormal !== undefined ? unitNormal.z : 0.0;\r\n }\r\n /** Return signed cartesian altitude perpendicular to the plane. This uses the normalized cross product as normal. */\r\n public altitude(xyz: XYAndZ): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n if (unitNormal === undefined)\r\n return 0.0;\r\n return Geometry.dotProductXYZXYZ(\r\n (xyz.x - this.origin.x), (xyz.y - this.origin.y), (xyz.z - this.origin.z),\r\n unitNormal.x, unitNormal.y, unitNormal.z);\r\n }\r\n /** Return signed cartesian altitude perpendicular to the plane. This uses the normalized cross product as normal. */\r\n public altitudeXYZ(x: number, y: number, z: number): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n if (unitNormal === undefined)\r\n return 0.0;\r\n return Geometry.dotProductXYZXYZ(\r\n (x - this.origin.x), (y - this.origin.y), (z - this.origin.z),\r\n unitNormal.x, unitNormal.y, unitNormal.z);\r\n }\r\n /** Return signed projection of the input vector to the plane normal. This uses the normalized cross product as normal. */\r\n public velocity(xyzVector: XYAndZ): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n if (unitNormal === undefined)\r\n return 0.0;\r\n return Geometry.dotProductXYZXYZ(\r\n xyzVector.x, xyzVector.y, xyzVector.z,\r\n unitNormal.x, unitNormal.y, unitNormal.z);\r\n }\r\n /** Return signed projection of the input vector to the plane normal. This uses the normalized cross product as normal. */\r\n public velocityXYZ(x: number, y: number, z: number): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n if (unitNormal === undefined)\r\n return 0.0;\r\n return Geometry.dotProductXYZXYZ(\r\n x, y, z,\r\n unitNormal.x, unitNormal.y, unitNormal.z);\r\n }\r\n /**\r\n * Return triple product of homogeneous difference {(xyzw - w * origin)} with vectorU and vectorV.\r\n * * In the usual manner of homogeneous calculations, this is proportional to true cartesian distance from the\r\n * plane but is not a physical distance.\r\n */\r\n public weightedAltitude(xyzw: Point4d) {\r\n const w = xyzw.w;\r\n return Geometry.tripleProduct(\r\n (xyzw.x - this.origin.x * w), (xyzw.y - this.origin.y * w), (xyzw.z - this.origin.z * w),\r\n this.vectorU.x, this.vectorU.y, this.vectorU.z,\r\n this.vectorV.x, this.vectorV.y, this.vectorV.z);\r\n }\r\n /**\r\n * Return the projection of spacePoint onto the plane.\r\n * If the plane is degenerate to a ray, project to the ray.\r\n * If the plane is degenerate to its origin, return the point\r\n */\r\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n if (unitNormal !== undefined) {\r\n const w = unitNormal.dotProductStartEnd(this.origin, spacePoint);\r\n return spacePoint.plusScaled(unitNormal, -w, result);\r\n }\r\n // uh oh. vectorU and vectorV are colinear or zero.\r\n // project to ray defined by the longer one, or just to origin.\r\n const dotUU = this.vectorU.magnitudeSquared();\r\n const dotVV = this.vectorV.magnitudeSquared();\r\n if (dotUU >= dotVV) {\r\n const dotUW = this.vectorU.dotProductStartEnd(this.origin, spacePoint);\r\n const f = Geometry.conditionalDivideCoordinate(dotUW, dotUU, 0.0);\r\n if (f !== undefined)\r\n return spacePoint.plusScaled(this.vectorU, f, result);\r\n } else {\r\n const dotVW = this.vectorV.dotProductStartEnd(this.origin, spacePoint);\r\n const f = Geometry.conditionalDivideCoordinate(dotVW, dotVV, 0.0);\r\n if (f !== undefined)\r\n return spacePoint.plusScaled(this.vectorV, f, result);\r\n }\r\n return this.origin.clone(result);\r\n }\r\n}\r\n"]}
@@ -90,7 +90,7 @@ export declare class Transform implements BeJSONFunctions {
90
90
  /**
91
91
  * Create a Transform with translation provided by x,y,z parts.
92
92
  * * Translation Transform maps any vector `v` to `v + p` where `p = (x,y,z)`
93
- * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeMove
93
+ * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeTransform
94
94
  * @param x x part of translation
95
95
  * @param y y part of translation
96
96
  * @param z z part of translation
@@ -101,7 +101,7 @@ export declare class Transform implements BeJSONFunctions {
101
101
  /**
102
102
  * Create a Transform with specified `translation` part.
103
103
  * * Translation Transform maps any vector `v` to `v + translation`
104
- * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeMove
104
+ * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeTransform
105
105
  * @param translation x,y,z parts of the translation
106
106
  * @param result optional pre-allocated Transform
107
107
  * @returns new or updated transform
@@ -154,7 +154,7 @@ export declare class Transform implements BeJSONFunctions {
154
154
  * Create a Transform which leaves the fixedPoint unchanged and scales everything else around it by
155
155
  * a single scale factor. The returned Transform maps a point `p` to `M*p + (f - M*f)`
156
156
  * where `f` is the fixedPoint and M is the scale matrix (i.e., `Tp = M*(p-f) + f`).
157
- * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeScale
157
+ * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeTransform
158
158
  */
159
159
  static createScaleAboutPoint(fixedPoint: Point3d, scale: number, result?: Transform): Transform;
160
160
  /**
@@ -180,7 +180,7 @@ class Transform {
180
180
  /**
181
181
  * Create a Transform with translation provided by x,y,z parts.
182
182
  * * Translation Transform maps any vector `v` to `v + p` where `p = (x,y,z)`
183
- * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeMove
183
+ * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeTransform
184
184
  * @param x x part of translation
185
185
  * @param y y part of translation
186
186
  * @param z z part of translation
@@ -193,7 +193,7 @@ class Transform {
193
193
  /**
194
194
  * Create a Transform with specified `translation` part.
195
195
  * * Translation Transform maps any vector `v` to `v + translation`
196
- * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeMove
196
+ * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeTransform
197
197
  * @param translation x,y,z parts of the translation
198
198
  * @param result optional pre-allocated Transform
199
199
  * @returns new or updated transform
@@ -316,7 +316,7 @@ class Transform {
316
316
  * Create a Transform which leaves the fixedPoint unchanged and scales everything else around it by
317
317
  * a single scale factor. The returned Transform maps a point `p` to `M*p + (f - M*f)`
318
318
  * where `f` is the fixedPoint and M is the scale matrix (i.e., `Tp = M*(p-f) + f`).
319
- * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeScale
319
+ * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeTransform
320
320
  */
321
321
  static createScaleAboutPoint(fixedPoint, scale, result) {
322
322
  const matrix = Matrix3d_1.Matrix3d.createScale(scale, scale, scale);
@@ -1 +1 @@
1
- {"version":3,"file":"Transform.js","sourceRoot":"","sources":["../../../src/geometry3d/Transform.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAAmE;AACnE,mDAAgD;AAChD,yCAAsC;AACtC,uDAA4C;AAC5C,uDAA2D;AAC3D,mCAAkC;AAGlC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAa,SAAS;IAGpB,0EAA0E;IAC1E,YAAoB,MAAW,EAAE,MAAgB;QAC/C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,sEAAsE;IAC/D,MAAM,KAAK,QAAQ;QACxB,IAAI,SAAS,KAAK,IAAI,CAAC,SAAS,E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,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACxE,SAAS,CAAC,qBAAqB,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;SAC/D;IACH,CAAC;CACF;AA9xBD,8BA8xBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { AxisOrder, BeJSONFunctions, Geometry } from \"../Geometry\";\r\nimport { Point4d } from \"../geometry4d/Point4d\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\nimport { Point2d } from \"./Point2dVector2d\";\r\nimport { Point3d, Vector3d, XYZ } from \"./Point3dVector3d\";\r\nimport { Range3d } from \"./Range\";\r\nimport { TransformProps, XAndY, XYAndZ } from \"./XYZProps\";\r\n\r\n/**\r\n * A Transform consists of an origin and a Matrix3d. This describes a coordinate frame with this origin, with\r\n * the columns of the Matrix3d being the local x,y,z axis directions.\r\n * * The math for a Transform `T` consisting of a Matrix3d `M` and a Point3d `o` on a Vector3d `p` is: `Tp = M*p + o`.\r\n * In other words, `T` is a combination of two operations on `p`: the action of matrix multiplication, followed by a\r\n * translation. `Origin` is a traditional term for `o`, because `T` can be interpreted as a change of basis from the\r\n * global axes centered at the global origin, to a new set of axes specified by matrix M columns centered at `o`.\r\n * * Beware that for common transformations (e.g. scale about point, rotate around an axis) the `fixed point` that\r\n * is used when describing the transform is NOT the `origin` stored in the transform. Setup methods (e.g\r\n * createFixedPointAndMatrix, createScaleAboutPoint) take care of determining the appropriate origin coordinates.\r\n * * If `T` is a translation, no point is fixed by `T`.\r\n * * If `T` is the identity, all points are fixed by `T`.\r\n * * If `T` is a scale about a point, one point is fixed by `T`.\r\n * * If `T` is a rotation about an axis, a line is fixed by `T`.\r\n * * If `T` is a projection to the plane, a plane is fixed by `T`.\r\n * @public\r\n */\r\nexport class Transform implements BeJSONFunctions {\r\n private _origin: XYZ;\r\n private _matrix: Matrix3d;\r\n // Constructor accepts and uses pointer to content (no copy is done here).\r\n private constructor(origin: XYZ, matrix: Matrix3d) {\r\n this._origin = origin;\r\n this._matrix = matrix;\r\n }\r\n private static _identity?: Transform;\r\n /** The identity Transform. Value is frozen and cannot be modified. */\r\n public static get identity(): Transform {\r\n if (undefined === this._identity) {\r\n this._identity = Transform.createIdentity();\r\n this._identity.freeze();\r\n }\r\n return this._identity;\r\n }\r\n /** Freeze this instance (and its members) so it is read-only */\r\n public freeze(): Readonly<this> {\r\n this._origin.freeze();\r\n this._matrix.freeze();\r\n return Object.freeze(this);\r\n }\r\n /**\r\n * Copy contents from other Transform into this Transform\r\n * @param other source transform\r\n */\r\n public setFrom(other: Transform) {\r\n this._origin.setFrom(other._origin);\r\n this._matrix.setFrom(other._matrix);\r\n }\r\n /** Set this Transform to be an identity. */\r\n public setIdentity() {\r\n this._origin.setZero();\r\n this._matrix.setIdentity();\r\n }\r\n /**\r\n * Set this Transform instance from flexible inputs:\r\n * * Any object (such as another Transform or TransformProps) that has `origin` and `matrix` members\r\n * accepted by `Point3d.setFromJSON` and `Matrix3d.setFromJSON`\r\n * * An array of 3 number arrays, each with 4 entries which are rows in a 3x4 matrix.\r\n * * An array of 12 numbers, each block of 4 entries as a row 3x4 matrix.\r\n * * If no input is provided, the identity Transform is returned.\r\n */\r\n public setFromJSON(json?: TransformProps | Transform): void {\r\n if (json) {\r\n if (json instanceof Object && (json as any).origin && (json as any).matrix) {\r\n this._origin.setFromJSON((json as any).origin);\r\n this._matrix.setFromJSON((json as any).matrix);\r\n return;\r\n }\r\n if (Geometry.isArrayOfNumberArray(json, 3, 4)) {\r\n const data = json as number[][];\r\n this._matrix.setRowValues(\r\n data[0][0], data[0][1], data[0][2],\r\n data[1][0], data[1][1], data[1][2],\r\n data[2][0], data[2][1], data[2][2]\r\n );\r\n this._origin.set(data[0][3], data[1][3], data[2][3]);\r\n return;\r\n }\r\n if (Geometry.isNumberArray(json, 12)) {\r\n const data = json as number[];\r\n this._matrix.setRowValues(\r\n data[0], data[1], data[2],\r\n data[4], data[5], data[6],\r\n data[8], data[9], data[10]\r\n );\r\n this._origin.set(data[3], data[7], data[11]);\r\n return;\r\n }\r\n }\r\n this.setIdentity();\r\n }\r\n /**\r\n * Test for near equality with `other` Transform. Comparison uses the `isAlmostEqual` methods on the `origin` and\r\n * `matrix` parts.\r\n * @param other Transform to compare to.\r\n */\r\n public isAlmostEqual(other: Readonly<Transform>): boolean {\r\n return this.origin.isAlmostEqual(other.origin) && this.matrix.isAlmostEqual(other.matrix);\r\n }\r\n /**\r\n * Test for near equality with `other` Transform. Comparison uses the `isAlmostEqual` methods on the `origin` part\r\n * and the `isAlmostEqualAllowZRotation` method on the `matrix` part.\r\n * @param other Transform to compare to.\r\n */\r\n public isAlmostEqualAllowZRotation(other: Transform): boolean {\r\n return this._origin.isAlmostEqual(other._origin) && this._matrix.isAlmostEqualAllowZRotation(other._matrix);\r\n }\r\n /**\r\n * Return a 3 by 4 matrix containing the rows of this Transform.\r\n * * The transform's origin coordinates are the last entries of the 3 json arrays\r\n */\r\n public toRows(): number[][] {\r\n return [\r\n [this._matrix.coffs[0], this._matrix.coffs[1], this._matrix.coffs[2], this._origin.x],\r\n [this._matrix.coffs[3], this._matrix.coffs[4], this._matrix.coffs[5], this._origin.y],\r\n [this._matrix.coffs[6], this._matrix.coffs[7], this._matrix.coffs[8], this._origin.z],\r\n ];\r\n }\r\n /**\r\n * Return a 3 by 4 matrix containing the rows of this Transform.\r\n * * The transform's origin coordinates are the last entries of the 3 json arrays\r\n */\r\n public toJSON(): TransformProps {\r\n return this.toRows();\r\n }\r\n /** Return a new Transform initialized by `Transform.setFromJSON` */\r\n public static fromJSON(json?: TransformProps): Transform {\r\n const result = Transform.createIdentity();\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Copy the contents of `this` transform into a new Transform (or to the result, if specified). */\r\n public clone(result?: Transform): Transform {\r\n if (result) {\r\n result._matrix.setFrom(this._matrix);\r\n result._origin.setFrom(this._origin);\r\n return result;\r\n }\r\n return new Transform(\r\n Point3d.createFrom(this._origin),\r\n this._matrix.clone()\r\n );\r\n }\r\n /**\r\n * Return a modified copy of `this` Transform so that its `matrix` part is rigid (`origin` part is untouched).\r\n * * @see [[Matrix3d.axisOrderCrossProductsInPlace]] documentation for details of how the matrix is modified to rigid.\r\n */\r\n public cloneRigid(axisOrder: AxisOrder = AxisOrder.XYZ): Transform | undefined {\r\n const modifiedMatrix = Matrix3d.createRigidFromMatrix3d(this.matrix, axisOrder);\r\n if (!modifiedMatrix)\r\n return undefined;\r\n return new Transform(this.origin.cloneAsPoint3d(), modifiedMatrix);\r\n }\r\n /** Create a Transform with the given `origin` and `matrix`. Inputs are captured, not cloned. */\r\n public static createRefs(origin: XYZ | undefined, matrix: Matrix3d, result?: Transform): Transform {\r\n if (!origin)\r\n origin = Point3d.createZero();\r\n if (result) {\r\n result._origin = origin;\r\n result._matrix = matrix;\r\n return result;\r\n }\r\n return new Transform(origin, matrix);\r\n }\r\n /** Create a Transform with complete contents given. `q` inputs make the matrix and `a` inputs make the origin */\r\n public static createRowValues(\r\n qxx: number, qxy: number, qxz: number, ax: number,\r\n qyx: number, qyy: number, qyz: number, ay: number,\r\n qzx: number, qzy: number, qzz: number, az: number,\r\n result?: Transform\r\n ): Transform {\r\n if (result) {\r\n result._origin.set(ax, ay, az);\r\n result._matrix.setRowValues(qxx, qxy, qxz, qyx, qyy, qyz, qzx, qzy, qzz);\r\n return result;\r\n }\r\n return new Transform(\r\n Point3d.create(ax, ay, az),\r\n Matrix3d.createRowValues(qxx, qxy, qxz, qyx, qyy, qyz, qzx, qzy, qzz)\r\n );\r\n }\r\n /** Create a Transform with all zeros */\r\n public static createZero(result?: Transform): Transform {\r\n return Transform.createRowValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, result);\r\n }\r\n /**\r\n * Create a Transform with translation provided by x,y,z parts.\r\n * * Translation Transform maps any vector `v` to `v + p` where `p = (x,y,z)`\r\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeMove\r\n * @param x x part of translation\r\n * @param y y part of translation\r\n * @param z z part of translation\r\n * @param result optional pre-allocated Transform\r\n * @returns new or updated transform\r\n */\r\n public static createTranslationXYZ(x: number = 0, y: number = 0, z: number = 0, result?: Transform): Transform {\r\n return Transform.createRefs(Vector3d.create(x, y, z), Matrix3d.createIdentity(), result);\r\n }\r\n /**\r\n * Create a Transform with specified `translation` part.\r\n * * Translation Transform maps any vector `v` to `v + translation`\r\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeMove\r\n * @param translation x,y,z parts of the translation\r\n * @param result optional pre-allocated Transform\r\n * @returns new or updated transform\r\n */\r\n public static createTranslation(translation: XYZ, result?: Transform): Transform {\r\n return Transform.createRefs(translation, Matrix3d.createIdentity(), result);\r\n }\r\n /** Return a reference (and NOT a copy) to the `matrix` part of the Transform. */\r\n public get matrix(): Matrix3d {\r\n return this._matrix;\r\n }\r\n /** Return a reference (and NOT a copy) to the `origin` part of the Transform. */\r\n public get origin(): XYZ {\r\n return this._origin;\r\n }\r\n /** return a (clone of) the `origin` part of the Transform, as a `Point3d` */\r\n public getOrigin(): Point3d {\r\n return Point3d.createFrom(this._origin);\r\n }\r\n /** return a (clone of) the `origin` part of the Transform, as a `Vector3d` */\r\n public getTranslation(): Vector3d {\r\n return Vector3d.createFrom(this._origin);\r\n }\r\n /** return a (clone of) the `matrix` part of the Transform, as a `Matrix3d` */\r\n public getMatrix(): Matrix3d {\r\n return this._matrix.clone();\r\n }\r\n /** test if the transform has `origin` = (0,0,0) and identity `matrix` */\r\n public get isIdentity(): boolean {\r\n return this._matrix.isIdentity && this._origin.isAlmostZero;\r\n }\r\n /** Create an identity transform */\r\n public static createIdentity(result?: Transform): Transform {\r\n if (result) {\r\n result._origin.setZero();\r\n result._matrix.setIdentity();\r\n return result;\r\n }\r\n return Transform.createRefs(Point3d.createZero(), Matrix3d.createIdentity());\r\n }\r\n /**\r\n * Create a Transform using the given `origin` and `matrix`.\r\n * * This is a the appropriate construction when the columns of the matrix are coordinate axes of a\r\n * local-to-world mapping.\r\n * * This function is a closely related to `createFixedPointAndMatrix` whose point input is the fixed point\r\n * of the world-to-world transformation.\r\n * * If origin is `undefined`, (0,0,0) is used. If matrix is `undefined` the identity matrix is used.\r\n */\r\n public static createOriginAndMatrix(\r\n origin: XYZ | undefined, matrix: Matrix3d | undefined, result?: Transform\r\n ): Transform {\r\n if (result) {\r\n result._origin.setFromPoint3d(origin);\r\n result._matrix.setFrom(matrix);\r\n return result;\r\n }\r\n return Transform.createRefs(\r\n origin ? origin.cloneAsPoint3d() : Point3d.createZero(),\r\n matrix === undefined ? Matrix3d.createIdentity() : matrix.clone(),\r\n result\r\n );\r\n }\r\n /** Create a Transform using the given `origin` and columns of the `matrix`. If `undefined` zero is used. */\r\n public setOriginAndMatrixColumns(\r\n origin: XYZ | undefined, vectorX: Vector3d | undefined, vectorY: Vector3d | undefined, vectorZ: Vector3d | undefined\r\n ): void {\r\n if (origin !== undefined)\r\n this._origin.setFrom(origin);\r\n this._matrix.setColumns(vectorX, vectorY, vectorZ);\r\n }\r\n /** Create a Transform using the given `origin` and columns of the `matrix` */\r\n public static createOriginAndMatrixColumns(\r\n origin: XYZ, vectorX: Vector3d, vectorY: Vector3d, vectorZ: Vector3d, result?: Transform\r\n ): Transform {\r\n if (result)\r\n result.setOriginAndMatrixColumns(origin, vectorX, vectorY, vectorZ);\r\n else\r\n result = Transform.createRefs(Vector3d.createFrom(origin), Matrix3d.createColumns(vectorX, vectorY, vectorZ));\r\n return result;\r\n }\r\n /**\r\n * Create a Transform such that its `matrix` part is rigid.\r\n * @see [[Matrix3d.createRigidFromColumns]] for details of how the matrix is created to be rigid.\r\n */\r\n public static createRigidFromOriginAndColumns(\r\n origin: XYZ | undefined, vectorX: Vector3d, vectorY: Vector3d, axisOrder: AxisOrder, result?: Transform\r\n ): Transform | undefined {\r\n const matrix = Matrix3d.createRigidFromColumns(vectorX, vectorY, axisOrder, result ? result._matrix : undefined);\r\n if (!matrix)\r\n return undefined;\r\n if (result) {\r\n // result._matrix was already modified to become rigid via createRigidFromColumns\r\n result._origin.setFrom(origin);\r\n return result;\r\n }\r\n /**\r\n * We don't want to pass \"origin\" to createRefs because createRefs does not clone \"origin\". That means if \"origin\"\r\n * is changed via Transform at any point, the initial \"origin\" passed by the user is also changed. To avoid that,\r\n * we pass \"undefined\" to createRefs so that it allocates a new point which then we set it to the \"origin\" which\r\n * is passed by user in the next line.\r\n */\r\n result = Transform.createRefs(undefined, matrix);\r\n result._origin.setFromPoint3d(origin);\r\n return result;\r\n }\r\n /**\r\n * Create a Transform with the specified `matrix`. Compute an `origin` (different from the given `fixedPoint`)\r\n * so that the `fixedPoint` maps back to itself. The returned Transform, transforms a point `p` to `M*p + (f - M*f)`\r\n * where `f` is the fixedPoint (i.e., `Tp = M*(p-f) + f`).\r\n */\r\n public static createFixedPointAndMatrix(\r\n fixedPoint: XYAndZ | undefined, matrix: Matrix3d, result?: Transform\r\n ): Transform {\r\n if (fixedPoint) {\r\n /**\r\n * if f is a fixed point, then Tf = M*f + o = f where M is the matrix and o is the origin.\r\n * we define the origin o = f - M*f. Therefore, Tf = Mf + o = M*f + (f - M*f) = f.\r\n */\r\n const origin = Matrix3d.xyzMinusMatrixTimesXYZ(fixedPoint, matrix, fixedPoint);\r\n return Transform.createRefs(origin, matrix.clone(), result);\r\n }\r\n return Transform.createRefs(undefined, matrix.clone());\r\n }\r\n /**\r\n * Create a transform with the specified `matrix` and points `a` and `b`. The returned Transform maps\r\n * point `p` to `M*(p-a) + b` (i.e., `Tp = M*(p-a) + b`), so maps `a` to 'b'.\r\n */\r\n public static createMatrixPickupPutdown(\r\n matrix: Matrix3d, a: Point3d, b: Point3d, result?: Transform\r\n ): Transform {\r\n // we define the origin o = b - M*a so Tp = M*p + o = M*p + (b - M*a) = M*(p-a) + b\r\n const origin = Matrix3d.xyzMinusMatrixTimesXYZ(b, matrix, a);\r\n return Transform.createRefs(origin, matrix.clone(), result);\r\n }\r\n /**\r\n * Create a Transform which leaves the fixedPoint unchanged and scales everything else around it by\r\n * a single scale factor. The returned Transform maps a point `p` to `M*p + (f - M*f)`\r\n * where `f` is the fixedPoint and M is the scale matrix (i.e., `Tp = M*(p-f) + f`).\r\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeScale\r\n */\r\n public static createScaleAboutPoint(fixedPoint: Point3d, scale: number, result?: Transform): Transform {\r\n const matrix = Matrix3d.createScale(scale, scale, scale);\r\n /**\r\n * if f is a fixed point, then Tf = M*f + o = f where M is the matrix and o is the origin.\r\n * we define the origin o = f - M*f. Therefore, Tf = M*f + o = M*f + (f - M*f) = f.\r\n */\r\n const origin = Matrix3d.xyzMinusMatrixTimesXYZ(fixedPoint, matrix, fixedPoint);\r\n return Transform.createRefs(origin, matrix, result);\r\n }\r\n /**\r\n * Return a transformation which flattens space onto a plane, sweeping along a direction which may be different from the plane normal.\r\n * @param sweepVector vector for the sweep direction\r\n * @param planePoint any point on the plane\r\n * @param planeNormal vector normal to the plane.\r\n */\r\n public static createFlattenAlongVectorToPlane(sweepVector: Vector3d, planePoint: XYAndZ, planeNormal: Vector3d): Transform | undefined {\r\n const matrix = Matrix3d.createFlattenAlongVectorToPlane(sweepVector, planeNormal);\r\n if (matrix === undefined)\r\n return undefined;\r\n return Transform.createFixedPointAndMatrix(planePoint, matrix);\r\n }\r\n /**\r\n * Transform the input 2d point (using `Tp = M*p + o`).\r\n * Return as a new point or in the pre-allocated result (if result is given).\r\n */\r\n public multiplyPoint2d(point: XAndY, result?: Point2d): Point2d {\r\n return Matrix3d.xyPlusMatrixTimesXY(this._origin, this._matrix, point, result);\r\n }\r\n /**\r\n * Transform the input 3d point (using `Tp = M*p + o`).\r\n * Return as a new point or in the pre-allocated result (if result is given).\r\n */\r\n public multiplyPoint3d(point: XYAndZ, result?: Point3d): Point3d {\r\n // Tx = Mx + o so we return Mx + o\r\n return Matrix3d.xyzPlusMatrixTimesXYZ(this._origin, this._matrix, point, result);\r\n }\r\n /**\r\n * Transform the input 3d point in place (using `Tp = M*p + o`).\r\n * Return as a new point or in the pre-allocated result (if result is given).\r\n */\r\n public multiplyXYAndZInPlace(point: XYAndZ): void {\r\n return Matrix3d.xyzPlusMatrixTimesXYZInPlace(this._origin, this._matrix, point);\r\n }\r\n /**\r\n * Transform the input 3d point (using `Tp = M*p + o`).\r\n * Return as a new point or in the pre-allocated result (if result is given).\r\n */\r\n public multiplyXYZ(x: number, y: number, z: number = 0, result?: Point3d): Point3d {\r\n // Tx = Mx + o so we return Mx + o\r\n return Matrix3d.xyzPlusMatrixTimesCoordinates(this._origin, this._matrix, x, y, z, result);\r\n }\r\n /**\r\n * Multiply a specific row (component) of the 3x4 instance times (x,y,z,1). Return the result.\r\n */\r\n public multiplyComponentXYZ(componentIndex: number, x: number, y: number, z: number = 0): number {\r\n const coffs = this._matrix.coffs;\r\n const idx = 3 * componentIndex;\r\n return this.origin.at(componentIndex) + (coffs[idx] * x) + (coffs[idx + 1] * y) + (coffs[idx + 2] * z);\r\n }\r\n /**\r\n * Multiply a specific row (component) of the 3x4 instance times (x,y,z,w). Return the result.\r\n */\r\n public multiplyComponentXYZW(componentIndex: number, x: number, y: number, z: number, w: number): number {\r\n const coffs = this._matrix.coffs;\r\n const idx = 3 * componentIndex;\r\n return (this.origin.at(componentIndex) * w) + (coffs[idx] * x) + (coffs[idx + 1] * y) + (coffs[idx + 2] * z);\r\n }\r\n /**\r\n * Transform the homogeneous point. Return as a new `Point4d`, or in the pre-allocated result (if result is given).\r\n * * If `p = (x,y,z)` then this method computes `Tp = M*p + o*w` and returns the `Point4d` formed by `Tp` in the\r\n * first three coordinates, and `w` in the fourth.\r\n * * Logically, this is multiplication by the 4x4 matrix formed from the 3x4 instance augmented with fourth row 0001.\r\n */\r\n public multiplyXYZW(x: number, y: number, z: number, w: number, result?: Point4d): Point4d {\r\n return Matrix3d.xyzPlusMatrixTimesWeightedCoordinates(this._origin, this._matrix, x, y, z, w, result);\r\n }\r\n /**\r\n * Transform the homogeneous point. Return as new `Float64Array` with size 4, or in the pre-allocated result (if\r\n * result is given).\r\n * * If `p = (x,y,z)` then this method computes `Tp = M*p + o*w` and returns the `Float64Array` formed by `Tp`\r\n * in the first 3 numbers of the array and `w` as the fourth.\r\n * * Logically, this is multiplication by the 4x4 matrix formed from the 3x4 instance augmented with fourth row 0001.\r\n */\r\n public multiplyXYZWToFloat64Array(x: number, y: number, z: number, w: number, result?: Float64Array): Float64Array {\r\n return Matrix3d.xyzPlusMatrixTimesWeightedCoordinatesToFloat64Array(this._origin, this._matrix, x, y, z, w, result);\r\n }\r\n /**\r\n * * Transform the point. Return as new `Float64Array` with size 3, or in the pre-allocated result (if result is given).\r\n * * If `p = (x,y,z)` then this method computes `Tp = M*p + o` and returns it as the first 3 elements of the array.\r\n */\r\n public multiplyXYZToFloat64Array(x: number, y: number, z: number, result?: Float64Array): Float64Array {\r\n return Matrix3d.xyzPlusMatrixTimesCoordinatesToFloat64Array(this._origin, this._matrix, x, y, z, result);\r\n }\r\n /**\r\n * Multiply the homogeneous point by the transpose of `this` Transform. Return as a new `Point4d` or in the\r\n * pre-allocated result (if result is given).\r\n * * If `p = (x,y,z)` then this method computes `M^t*p` and returns it in the first three coordinates of the `Point4d`,\r\n * and `o*p + w` in the fourth.\r\n * * Logically, this is multiplication by the transpose of the 4x4 matrix formed from the 3x4 instance augmented with\r\n * fourth row 0001.\r\n */\r\n public multiplyTransposeXYZW(x: number, y: number, z: number, w: number, result?: Point4d): Point4d {\r\n const coffs = this._matrix.coffs;\r\n const origin = this._origin;\r\n return Point4d.create(\r\n (x * coffs[0]) + (y * coffs[3]) + (z * coffs[6]),\r\n (x * coffs[1]) + (y * coffs[4]) + (z * coffs[7]),\r\n (x * coffs[2]) + (y * coffs[5]) + (z * coffs[8]),\r\n (x * origin.x) + (y * origin.y) + (z * origin.z) + w,\r\n result\r\n );\r\n }\r\n /** For each point in the array, replace point by the transformed point (using `Tp = M*p + o`) */\r\n public multiplyPoint3dArrayInPlace(points: Point3d[]) {\r\n let point;\r\n for (point of points)\r\n Matrix3d.xyzPlusMatrixTimesXYZ(this._origin, this._matrix, point, point);\r\n }\r\n /** For each point in the 2d array, replace point by the transformed point (using `Tp = M*p + o`) */\r\n public multiplyPoint3dArrayArrayInPlace(chains: Point3d[][]) {\r\n for (const chain of chains)\r\n this.multiplyPoint3dArrayInPlace(chain);\r\n }\r\n /**\r\n * Multiply the point by the inverse Transform.\r\n * * If for a point `p` we have `Tp = M*p + o = q`, then `p = MInverse*(q - o) = TInverse q` so `TInverse`\r\n * Transform has matrix part `MInverse` and origin part `-MInverse*o`.\r\n * * Return as a new point or in the optional `result`.\r\n * * Returns `undefined` if the `matrix` part if this Transform is singular.\r\n */\r\n public multiplyInversePoint3d(point: XYAndZ, result?: Point3d): Point3d | undefined {\r\n return this._matrix.multiplyInverseXYZAsPoint3d(\r\n point.x - this._origin.x,\r\n point.y - this._origin.y,\r\n point.z - this._origin.z,\r\n result\r\n );\r\n }\r\n /**\r\n * Multiply the homogenous point by the inverse Transform.\r\n * * If for a point `p` we have `Tp = M*p + o = q`, then `p = MInverse*(q - o) = TInverse q` so `TInverse` Transform\r\n * has matrix part `MInverse` and origin part `-MInverse*o`.\r\n * * This method computes `TInverse p = MInverse*p - w*MInverse*o` and returns the `Point4d` formed by `TInverse*p`\r\n * in the first three coordinates, and `w` in the fourth.\r\n * * Logically, this is multiplication by the inverse of the 4x4 matrix formed from the 3x4 instance augmented with\r\n * fourth row 0001. This is equivalent to the 4x4 matrix formed in similar fashion from the inverse of this instance.\r\n * * Return as a new point or in the optional `result`.\r\n * * Returns `undefined` if the `matrix` part if this Transform is singular.\r\n */\r\n public multiplyInversePoint4d(weightedPoint: Point4d, result?: Point4d): Point4d | undefined {\r\n const w = weightedPoint.w;\r\n return this._matrix.multiplyInverseXYZW(\r\n weightedPoint.x - w * this.origin.x,\r\n weightedPoint.y - w * this.origin.y,\r\n weightedPoint.z - w * this.origin.z,\r\n w,\r\n result\r\n );\r\n }\r\n /**\r\n * Multiply the point by the inverse Transform.\r\n * * If for a point `p` we have `Tp = M*p + o = q`, then `p = MInverse*(q - o) = TInverse q` so `TInverse` Transform\r\n * has matrix part `MInverse` and origin part `-MInverse*o`.\r\n * * Return as a new point or in the optional `result`.\r\n * * Returns `undefined` if the `matrix` part if this Transform is singular.\r\n */\r\n public multiplyInverseXYZ(x: number, y: number, z: number, result?: Point3d): Point3d | undefined {\r\n return this._matrix.multiplyInverseXYZAsPoint3d(\r\n x - this._origin.x,\r\n y - this._origin.y,\r\n z - this._origin.z,\r\n result\r\n );\r\n }\r\n /**\r\n * * Compute (if needed) the inverse of the `matrix` part of the Transform, thereby ensuring inverse\r\n * operations can complete.\r\n * @param useCached If true, accept prior cached inverse if available.\r\n * @returns `true` if matrix inverse completes, `false` otherwise.\r\n */\r\n public computeCachedInverse(useCached: boolean = true): boolean {\r\n return this._matrix.computeCachedInverse(useCached);\r\n }\r\n /**\r\n * Match the length of destination array with the length of source array\r\n * * If destination has more elements than source, remove the extra elements.\r\n * * If destination has fewer elements than source, use `constructionFunction` to create new elements.\r\n * *\r\n * @param source the source array\r\n * @param dest the destination array\r\n * @param constructionFunction function to call to create new elements.\r\n */\r\n public static matchArrayLengths(source: any[], dest: any[], constructionFunction: () => any): number {\r\n const numSource = source.length;\r\n const numDest = dest.length;\r\n if (numSource > numDest) {\r\n for (let i = numDest; i < numSource; i++) {\r\n dest.push(constructionFunction());\r\n }\r\n } else if (numDest > numSource) {\r\n dest.length = numSource;\r\n }\r\n return numSource;\r\n }\r\n /**\r\n * Multiply each point in the array by the inverse of `this` Transform.\r\n * * For a transform `T = [M o]` the inverse transform `T' = [M' -M'o]` exists if and only if `M` has an inverse\r\n * `M'`. Indeed, for any point `p`, we have `T'Tp = T'(Mp + o) = M'(Mp + o) - M'o = M'Mp + M'o - M'o = p.`\r\n * * If `result` is given, resize it to match the input `points` array and update it with original points `p[]`.\r\n * * If `result` is not given, return a new array.\r\n * * Returns `undefined` if the `matrix` part if this Transform is singular.\r\n */\r\n public multiplyInversePoint3dArray(points: Point3d[], result?: Point3d[]): Point3d[] | undefined {\r\n if (!this._matrix.computeCachedInverse(true))\r\n return undefined;\r\n const originX = this.origin.x;\r\n const originY = this.origin.y;\r\n const originZ = this.origin.z;\r\n if (result) {\r\n const n = Transform.matchArrayLengths(points, result, Point3d.createZero);\r\n for (let i = 0; i < n; i++)\r\n this._matrix.multiplyInverseXYZAsPoint3d(\r\n points[i].x - originX,\r\n points[i].y - originY,\r\n points[i].z - originZ,\r\n result[i]\r\n );\r\n return result;\r\n }\r\n result = [];\r\n for (const point of points)\r\n result.push(\r\n this._matrix.multiplyInverseXYZAsPoint3d(\r\n point.x - originX,\r\n point.y - originY,\r\n point.z - originZ\r\n )!\r\n );\r\n return result;\r\n }\r\n /**\r\n * Multiply each point in the array by the inverse of `this` Transform in place.\r\n * * For a transform `T = [M o]` the inverse transform `T' = [M' -M'o]` exists if and only if `M` has an inverse\r\n * `M'`. Indeed, for any point `p`, we have `T'Tp = T'(Mp + o) = M'(Mp + o) - M'o = M'Mp + M'o - M'o = p.`\r\n * * Returns `true` if the `matrix` part if this Transform is invertible and `false` if singular.\r\n */\r\n public multiplyInversePoint3dArrayInPlace(points: Point3d[]): boolean {\r\n if (!this._matrix.computeCachedInverse(true))\r\n return false;\r\n for (const point of points)\r\n this._matrix.multiplyInverseXYZAsPoint3d(\r\n point.x - this.origin.x,\r\n point.y - this.origin.y,\r\n point.z - this.origin.z,\r\n point\r\n );\r\n return true;\r\n }\r\n /**\r\n * Transform the input 2d point array (using `Tp = M*p + o`).\r\n * * If `result` is given, resize it to match the input `points` array and update it with transformed points.\r\n * * If `result` is not given, return a new array.\r\n */\r\n public multiplyPoint2dArray(points: Point2d[], result?: Point2d[]): Point2d[] {\r\n if (result) {\r\n const n = Transform.matchArrayLengths(points, result, Point2d.createZero);\r\n for (let i = 0; i < n; i++)\r\n Matrix3d.xyPlusMatrixTimesXY(this._origin, this._matrix, points[i], result[i]);\r\n return result;\r\n }\r\n result = [];\r\n for (const p of points)\r\n result.push(Matrix3d.xyPlusMatrixTimesXY(this._origin, this._matrix, p));\r\n return result;\r\n }\r\n /**\r\n * Transform the input 3d point array (using `Tp = M*p + o`).\r\n * * If `result` is given, resize it to match the input `points` array and update it with transformed points.\r\n * * If `result` is not given, return a new array.\r\n */\r\n public multiplyPoint3dArray(points: Point3d[], result?: Point3d[]): Point3d[] {\r\n if (result) {\r\n const n = Transform.matchArrayLengths(points, result, Point3d.createZero);\r\n for (let i = 0; i < n; i++)\r\n Matrix3d.xyzPlusMatrixTimesXYZ(this._origin, this._matrix, points[i], result[i]);\r\n return result;\r\n }\r\n result = [];\r\n for (const p of points)\r\n result.push(Matrix3d.xyzPlusMatrixTimesXYZ(this._origin, this._matrix, p));\r\n return result;\r\n }\r\n /**\r\n * Multiply the vector by the `matrix` part of the Transform.\r\n * * The `origin` part of Transform is not used.\r\n * * If `result` is given, update it with the multiplication. Otherwise, create a new Vector3d.\r\n */\r\n public multiplyVector(vector: Vector3d, result?: Vector3d): Vector3d {\r\n return this._matrix.multiplyVector(vector, result);\r\n }\r\n /**\r\n * Multiply the vector by the `matrix` part of the Transform in place.\r\n * * The `origin` part of Transform is not used.\r\n */\r\n public multiplyVectorInPlace(vector: Vector3d): void {\r\n this._matrix.multiplyVectorInPlace(vector);\r\n }\r\n /**\r\n * Multiply the vector (x,y,z) by the `matrix` part of the Transform.\r\n * * The `origin` part of Transform is not used.\r\n * * If `result` is given, update it with the multiplication. Otherwise, create a new Vector3d.\r\n */\r\n public multiplyVectorXYZ(x: number, y: number, z: number, result?: Vector3d): Vector3d {\r\n return this._matrix.multiplyXYZ(x, y, z, result);\r\n }\r\n /**\r\n * Calculate `transformA * transformB` and store it into the calling instance (`this`).\r\n * * **Note:** If `transformA = [A a]` and `transformB = [B b]` then `transformA * transformB` is defined as\r\n * `[A*B Ab+a]`.\r\n * * @see [[multiplyTransformTransform]] documentation for math details.\r\n * @param transformA first operand\r\n * @param transformB second operand\r\n */\r\n public setMultiplyTransformTransform(transformA: Transform, transformB: Transform): void {\r\n Matrix3d.xyzPlusMatrixTimesXYZ(\r\n transformA._origin,\r\n transformA._matrix,\r\n transformB._origin,\r\n this._origin as Point3d\r\n );\r\n transformA._matrix.multiplyMatrixMatrix(transformB._matrix, this._matrix);\r\n }\r\n /**\r\n * Multiply `this` Transform times `other` Transform.\r\n * * **Note:** If `this = [A a]` and `other = [B b]` then `this * other` is defined as [A*B Ab+a] because:\r\n * ```\r\n * equation\r\n * \\begin{matrix}\r\n * \\text{this Transform with matrix part }\\bold{A}\\text{ and origin part }\\bold{a} & \\blockTransform{A}{a}\\\\\r\n * \\text{other Transform with matrix part }\\bold{B}\\text{ and origin part }\\bold{b} & \\blockTransform{B}{b} \\\\\r\n * \\text{product}& \\blockTransform{A}{a}\\blockTransform{B}{b}=\\blockTransform{AB}{Ab + a}\r\n * \\end{matrix}\r\n * ```\r\n * @param other the 'other` Transform to be multiplied to `this` Transform.\r\n * @param result optional preallocated `result` to reuse.\r\n */\r\n public multiplyTransformTransform(other: Transform, result?: Transform) {\r\n if (!result)\r\n return Transform.createRefs(\r\n Matrix3d.xyzPlusMatrixTimesXYZ(this._origin, this._matrix, other._origin),\r\n this._matrix.multiplyMatrixMatrix(other._matrix)\r\n );\r\n result.setMultiplyTransformTransform(this, other);\r\n return result;\r\n }\r\n /**\r\n * Multiply `this` Transform times `other` Matrix3d (considered to be a Transform with 0 `origin`).\r\n * * **Note:** If `this = [A a]` and `other = [B 0]`, then `this * other` is defined as [A*B a] because:\r\n * ```\r\n * equation\r\n * \\begin{matrix}\r\n * \\text{this Transform with matrix part }\\bold{A}\\text{ and origin part }\\bold{a} & \\blockTransform{A}{a}\\\\\r\n * \\text{other matrix }\\bold{B}\\text{ promoted to block Transform} & \\blockTransform{B}{0} \\\\\r\n * \\text{product}& \\blockTransform{A}{a}\\blockTransform{B}{0}=\\blockTransform{AB}{a}\r\n * \\end{matrix}\r\n * ```\r\n * @param other the `other` Matrix3d to be multiplied to `this` Transform.\r\n * @param result optional preallocated `result` to reuse.\r\n */\r\n public multiplyTransformMatrix3d(other: Matrix3d, result?: Transform): Transform {\r\n if (!result)\r\n return Transform.createRefs(\r\n this._origin.cloneAsPoint3d(),\r\n this._matrix.multiplyMatrixMatrix(other)\r\n );\r\n this._matrix.multiplyMatrixMatrix(other, result._matrix);\r\n result._origin.setFrom(this._origin);\r\n return result;\r\n }\r\n /**\r\n * Return the range of the transformed corners.\r\n * * The 8 corners are transformed individually.\r\n * * **Note:** Suppose you have a geometry, a range box around that geometry, and your Transform is a rotation.\r\n * If you rotate the range box and recompute a new range box around the rotated range box, then the new range\r\n * box will have a larger volume than the original range box. However, if you rotate the geometry itself and\r\n * then recompute the range box, it will be a tighter range box around the rotated geometry. `multiplyRange`\r\n * function creates the larger range box because it only has access to the range box and not the geometry itself.\r\n */\r\n public multiplyRange(range: Range3d, result?: Range3d): Range3d {\r\n if (range.isNull)\r\n return range.clone(result);\r\n const lowX = range.low.x;\r\n const lowY = range.low.y;\r\n const lowZ = range.low.z;\r\n const highX = range.high.x;\r\n const highY = range.high.y;\r\n const highZ = range.high.z;\r\n result = Range3d.createNull(result);\r\n result.extendTransformedXYZ(this, lowX, lowY, lowZ);\r\n result.extendTransformedXYZ(this, highX, lowY, lowZ);\r\n result.extendTransformedXYZ(this, lowX, highY, lowZ);\r\n result.extendTransformedXYZ(this, highX, highY, lowZ);\r\n result.extendTransformedXYZ(this, lowX, lowY, highZ);\r\n result.extendTransformedXYZ(this, highX, lowY, highZ);\r\n result.extendTransformedXYZ(this, lowX, highY, highZ);\r\n result.extendTransformedXYZ(this, highX, highY, highZ);\r\n return result;\r\n }\r\n /**\r\n * Return a Transform which is the inverse of `this` Transform.\r\n * * If `transform = [M o]` then `transformInverse = [MInverse -MInverse*o]`\r\n * * Return `undefined` if this Transform's matrix is singular.\r\n */\r\n public inverse(result?: Transform): Transform | undefined {\r\n const matrixInverse = this._matrix.inverse(result ? result._matrix : undefined);\r\n if (!matrixInverse)\r\n return undefined;\r\n if (result) {\r\n // result._matrix is already defined\r\n matrixInverse.multiplyXYZ(-this._origin.x, -this._origin.y, -this._origin.z, result._origin as Vector3d);\r\n return result;\r\n }\r\n return Transform.createRefs(\r\n matrixInverse.multiplyXYZ(-this._origin.x, -this._origin.y, -this._origin.z),\r\n matrixInverse\r\n );\r\n }\r\n /**\r\n * Initialize 2 Transforms that map between the unit box (specified by 000 and 111) and the range box specified\r\n * by the input points.\r\n * @param min the min corner of the range box\r\n * @param max the max corner of the range box\r\n * @param npcToGlobal maps NPC coordinates into range box coordinates. Specifically, maps 000 to `min` and maps\r\n * 111 to `max`. This Transform is the inverse of `globalToNpc`. Object created by caller, re-initialized here.\r\n * @param globalToNpc maps range box coordinates into NPC coordinates. Specifically, maps `min` to 000 and maps\r\n * `max` to 111. This Transform is the inverse of `npcToGlobal`. Object created by caller, re-initialized here.\r\n * * NPC stands for `Normalized Projection Coordinate`\r\n */\r\n public static initFromRange(min: Point3d, max: Point3d, npcToGlobal?: Transform, globalToNpc?: Transform): void {\r\n const diag = max.minus(min);\r\n if (diag.x === 0.0)\r\n diag.x = 1.0;\r\n if (diag.y === 0.0)\r\n diag.y = 1.0;\r\n if (diag.z === 0.0)\r\n diag.z = 1.0;\r\n const rMatrix = new Matrix3d();\r\n /**\r\n * [diag.x 0 0 min.x]\r\n * npcToGlobal = [ 0 diag.y 0 min.y]\r\n * [ 0 0 diag.y min.z]\r\n *\r\n * npcToGlobal * 0 = min\r\n * npcToGlobal * 1 = diag + min = max\r\n */\r\n if (npcToGlobal) {\r\n Matrix3d.createScale(diag.x, diag.y, diag.z, rMatrix);\r\n Transform.createOriginAndMatrix(min, rMatrix, npcToGlobal);\r\n }\r\n /**\r\n * [1/diag.x 0 0 -min.x/diag.x]\r\n * globalToNpc = [ 0 1/diag.y 0 -min.y/diag.y]\r\n * [ 0 0 1/diag.y -min.z/diag.z]\r\n *\r\n * globalToNpc * min = min/diag - min/diag = 0\r\n * globalToNpc * max = max/diag - min/diag = diag/diag = 1\r\n */\r\n if (globalToNpc) {\r\n const origin = new Point3d(-min.x / diag.x, -min.y / diag.y, -min.z / diag.z);\r\n Matrix3d.createScale(1.0 / diag.x, 1.0 / diag.y, 1.0 / diag.z, rMatrix);\r\n Transform.createOriginAndMatrix(origin, rMatrix, globalToNpc);\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Transform.js","sourceRoot":"","sources":["../../../src/geometry3d/Transform.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAAmE;AACnE,mDAAgD;AAChD,yCAAsC;AACtC,uDAA4C;AAC5C,uDAA2D;AAC3D,mCAAkC;AAGlC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAa,SAAS;IAGpB,0EAA0E;IAC1E,YAAoB,MAAW,EAAE,MAAgB;QAC/C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,sEAAsE;IAC/D,MAAM,KAAK,QAAQ;QACxB,IAAI,SAAS,KAAK,IAAI,CAAC,SAAS,EAAE;YAChC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,cAAc,EAAE,CAAC;YAC5C,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;SACzB;QACD,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IACD,gEAAgE;IACzD,MAAM;QACX,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACtB,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACtB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IACD;;;O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C,CAAC,KAAK,GAAG;YAChB,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC;QACf,IAAI,IAAI,CAAC,CAAC,KAAK,GAAG;YAChB,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC;QACf,IAAI,IAAI,CAAC,CAAC,KAAK,GAAG;YAChB,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC;QACf,MAAM,OAAO,GAAG,IAAI,mBAAQ,EAAE,CAAC;QAC/B;;;;;;;WAOG;QACH,IAAI,WAAW,EAAE;YACf,mBAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACtD,SAAS,CAAC,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;SAC5D;QACD;;;;;;;WAOG;QACH,IAAI,WAAW,EAAE;YACf,MAAM,MAAM,GAAG,IAAI,yBAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAC9E,mBAAQ,CAAC,WAAW,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACxE,SAAS,CAAC,qBAAqB,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;SAC/D;IACH,CAAC;CACF;AA9xBD,8BA8xBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { AxisOrder, BeJSONFunctions, Geometry } from \"../Geometry\";\r\nimport { Point4d } from \"../geometry4d/Point4d\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\nimport { Point2d } from \"./Point2dVector2d\";\r\nimport { Point3d, Vector3d, XYZ } from \"./Point3dVector3d\";\r\nimport { Range3d } from \"./Range\";\r\nimport { TransformProps, XAndY, XYAndZ } from \"./XYZProps\";\r\n\r\n/**\r\n * A Transform consists of an origin and a Matrix3d. This describes a coordinate frame with this origin, with\r\n * the columns of the Matrix3d being the local x,y,z axis directions.\r\n * * The math for a Transform `T` consisting of a Matrix3d `M` and a Point3d `o` on a Vector3d `p` is: `Tp = M*p + o`.\r\n * In other words, `T` is a combination of two operations on `p`: the action of matrix multiplication, followed by a\r\n * translation. `Origin` is a traditional term for `o`, because `T` can be interpreted as a change of basis from the\r\n * global axes centered at the global origin, to a new set of axes specified by matrix M columns centered at `o`.\r\n * * Beware that for common transformations (e.g. scale about point, rotate around an axis) the `fixed point` that\r\n * is used when describing the transform is NOT the `origin` stored in the transform. Setup methods (e.g\r\n * createFixedPointAndMatrix, createScaleAboutPoint) take care of determining the appropriate origin coordinates.\r\n * * If `T` is a translation, no point is fixed by `T`.\r\n * * If `T` is the identity, all points are fixed by `T`.\r\n * * If `T` is a scale about a point, one point is fixed by `T`.\r\n * * If `T` is a rotation about an axis, a line is fixed by `T`.\r\n * * If `T` is a projection to the plane, a plane is fixed by `T`.\r\n * @public\r\n */\r\nexport class Transform implements BeJSONFunctions {\r\n private _origin: XYZ;\r\n private _matrix: Matrix3d;\r\n // Constructor accepts and uses pointer to content (no copy is done here).\r\n private constructor(origin: XYZ, matrix: Matrix3d) {\r\n this._origin = origin;\r\n this._matrix = matrix;\r\n }\r\n private static _identity?: Transform;\r\n /** The identity Transform. Value is frozen and cannot be modified. */\r\n public static get identity(): Transform {\r\n if (undefined === this._identity) {\r\n this._identity = Transform.createIdentity();\r\n this._identity.freeze();\r\n }\r\n return this._identity;\r\n }\r\n /** Freeze this instance (and its members) so it is read-only */\r\n public freeze(): Readonly<this> {\r\n this._origin.freeze();\r\n this._matrix.freeze();\r\n return Object.freeze(this);\r\n }\r\n /**\r\n * Copy contents from other Transform into this Transform\r\n * @param other source transform\r\n */\r\n public setFrom(other: Transform) {\r\n this._origin.setFrom(other._origin);\r\n this._matrix.setFrom(other._matrix);\r\n }\r\n /** Set this Transform to be an identity. */\r\n public setIdentity() {\r\n this._origin.setZero();\r\n this._matrix.setIdentity();\r\n }\r\n /**\r\n * Set this Transform instance from flexible inputs:\r\n * * Any object (such as another Transform or TransformProps) that has `origin` and `matrix` members\r\n * accepted by `Point3d.setFromJSON` and `Matrix3d.setFromJSON`\r\n * * An array of 3 number arrays, each with 4 entries which are rows in a 3x4 matrix.\r\n * * An array of 12 numbers, each block of 4 entries as a row 3x4 matrix.\r\n * * If no input is provided, the identity Transform is returned.\r\n */\r\n public setFromJSON(json?: TransformProps | Transform): void {\r\n if (json) {\r\n if (json instanceof Object && (json as any).origin && (json as any).matrix) {\r\n this._origin.setFromJSON((json as any).origin);\r\n this._matrix.setFromJSON((json as any).matrix);\r\n return;\r\n }\r\n if (Geometry.isArrayOfNumberArray(json, 3, 4)) {\r\n const data = json as number[][];\r\n this._matrix.setRowValues(\r\n data[0][0], data[0][1], data[0][2],\r\n data[1][0], data[1][1], data[1][2],\r\n data[2][0], data[2][1], data[2][2]\r\n );\r\n this._origin.set(data[0][3], data[1][3], data[2][3]);\r\n return;\r\n }\r\n if (Geometry.isNumberArray(json, 12)) {\r\n const data = json as number[];\r\n this._matrix.setRowValues(\r\n data[0], data[1], data[2],\r\n data[4], data[5], data[6],\r\n data[8], data[9], data[10]\r\n );\r\n this._origin.set(data[3], data[7], data[11]);\r\n return;\r\n }\r\n }\r\n this.setIdentity();\r\n }\r\n /**\r\n * Test for near equality with `other` Transform. Comparison uses the `isAlmostEqual` methods on the `origin` and\r\n * `matrix` parts.\r\n * @param other Transform to compare to.\r\n */\r\n public isAlmostEqual(other: Readonly<Transform>): boolean {\r\n return this.origin.isAlmostEqual(other.origin) && this.matrix.isAlmostEqual(other.matrix);\r\n }\r\n /**\r\n * Test for near equality with `other` Transform. Comparison uses the `isAlmostEqual` methods on the `origin` part\r\n * and the `isAlmostEqualAllowZRotation` method on the `matrix` part.\r\n * @param other Transform to compare to.\r\n */\r\n public isAlmostEqualAllowZRotation(other: Transform): boolean {\r\n return this._origin.isAlmostEqual(other._origin) && this._matrix.isAlmostEqualAllowZRotation(other._matrix);\r\n }\r\n /**\r\n * Return a 3 by 4 matrix containing the rows of this Transform.\r\n * * The transform's origin coordinates are the last entries of the 3 json arrays\r\n */\r\n public toRows(): number[][] {\r\n return [\r\n [this._matrix.coffs[0], this._matrix.coffs[1], this._matrix.coffs[2], this._origin.x],\r\n [this._matrix.coffs[3], this._matrix.coffs[4], this._matrix.coffs[5], this._origin.y],\r\n [this._matrix.coffs[6], this._matrix.coffs[7], this._matrix.coffs[8], this._origin.z],\r\n ];\r\n }\r\n /**\r\n * Return a 3 by 4 matrix containing the rows of this Transform.\r\n * * The transform's origin coordinates are the last entries of the 3 json arrays\r\n */\r\n public toJSON(): TransformProps {\r\n return this.toRows();\r\n }\r\n /** Return a new Transform initialized by `Transform.setFromJSON` */\r\n public static fromJSON(json?: TransformProps): Transform {\r\n const result = Transform.createIdentity();\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Copy the contents of `this` transform into a new Transform (or to the result, if specified). */\r\n public clone(result?: Transform): Transform {\r\n if (result) {\r\n result._matrix.setFrom(this._matrix);\r\n result._origin.setFrom(this._origin);\r\n return result;\r\n }\r\n return new Transform(\r\n Point3d.createFrom(this._origin),\r\n this._matrix.clone()\r\n );\r\n }\r\n /**\r\n * Return a modified copy of `this` Transform so that its `matrix` part is rigid (`origin` part is untouched).\r\n * * @see [[Matrix3d.axisOrderCrossProductsInPlace]] documentation for details of how the matrix is modified to rigid.\r\n */\r\n public cloneRigid(axisOrder: AxisOrder = AxisOrder.XYZ): Transform | undefined {\r\n const modifiedMatrix = Matrix3d.createRigidFromMatrix3d(this.matrix, axisOrder);\r\n if (!modifiedMatrix)\r\n return undefined;\r\n return new Transform(this.origin.cloneAsPoint3d(), modifiedMatrix);\r\n }\r\n /** Create a Transform with the given `origin` and `matrix`. Inputs are captured, not cloned. */\r\n public static createRefs(origin: XYZ | undefined, matrix: Matrix3d, result?: Transform): Transform {\r\n if (!origin)\r\n origin = Point3d.createZero();\r\n if (result) {\r\n result._origin = origin;\r\n result._matrix = matrix;\r\n return result;\r\n }\r\n return new Transform(origin, matrix);\r\n }\r\n /** Create a Transform with complete contents given. `q` inputs make the matrix and `a` inputs make the origin */\r\n public static createRowValues(\r\n qxx: number, qxy: number, qxz: number, ax: number,\r\n qyx: number, qyy: number, qyz: number, ay: number,\r\n qzx: number, qzy: number, qzz: number, az: number,\r\n result?: Transform\r\n ): Transform {\r\n if (result) {\r\n result._origin.set(ax, ay, az);\r\n result._matrix.setRowValues(qxx, qxy, qxz, qyx, qyy, qyz, qzx, qzy, qzz);\r\n return result;\r\n }\r\n return new Transform(\r\n Point3d.create(ax, ay, az),\r\n Matrix3d.createRowValues(qxx, qxy, qxz, qyx, qyy, qyz, qzx, qzy, qzz)\r\n );\r\n }\r\n /** Create a Transform with all zeros */\r\n public static createZero(result?: Transform): Transform {\r\n return Transform.createRowValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, result);\r\n }\r\n /**\r\n * Create a Transform with translation provided by x,y,z parts.\r\n * * Translation Transform maps any vector `v` to `v + p` where `p = (x,y,z)`\r\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeTransform\r\n * @param x x part of translation\r\n * @param y y part of translation\r\n * @param z z part of translation\r\n * @param result optional pre-allocated Transform\r\n * @returns new or updated transform\r\n */\r\n public static createTranslationXYZ(x: number = 0, y: number = 0, z: number = 0, result?: Transform): Transform {\r\n return Transform.createRefs(Vector3d.create(x, y, z), Matrix3d.createIdentity(), result);\r\n }\r\n /**\r\n * Create a Transform with specified `translation` part.\r\n * * Translation Transform maps any vector `v` to `v + translation`\r\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeTransform\r\n * @param translation x,y,z parts of the translation\r\n * @param result optional pre-allocated Transform\r\n * @returns new or updated transform\r\n */\r\n public static createTranslation(translation: XYZ, result?: Transform): Transform {\r\n return Transform.createRefs(translation, Matrix3d.createIdentity(), result);\r\n }\r\n /** Return a reference (and NOT a copy) to the `matrix` part of the Transform. */\r\n public get matrix(): Matrix3d {\r\n return this._matrix;\r\n }\r\n /** Return a reference (and NOT a copy) to the `origin` part of the Transform. */\r\n public get origin(): XYZ {\r\n return this._origin;\r\n }\r\n /** return a (clone of) the `origin` part of the Transform, as a `Point3d` */\r\n public getOrigin(): Point3d {\r\n return Point3d.createFrom(this._origin);\r\n }\r\n /** return a (clone of) the `origin` part of the Transform, as a `Vector3d` */\r\n public getTranslation(): Vector3d {\r\n return Vector3d.createFrom(this._origin);\r\n }\r\n /** return a (clone of) the `matrix` part of the Transform, as a `Matrix3d` */\r\n public getMatrix(): Matrix3d {\r\n return this._matrix.clone();\r\n }\r\n /** test if the transform has `origin` = (0,0,0) and identity `matrix` */\r\n public get isIdentity(): boolean {\r\n return this._matrix.isIdentity && this._origin.isAlmostZero;\r\n }\r\n /** Create an identity transform */\r\n public static createIdentity(result?: Transform): Transform {\r\n if (result) {\r\n result._origin.setZero();\r\n result._matrix.setIdentity();\r\n return result;\r\n }\r\n return Transform.createRefs(Point3d.createZero(), Matrix3d.createIdentity());\r\n }\r\n /**\r\n * Create a Transform using the given `origin` and `matrix`.\r\n * * This is a the appropriate construction when the columns of the matrix are coordinate axes of a\r\n * local-to-world mapping.\r\n * * This function is a closely related to `createFixedPointAndMatrix` whose point input is the fixed point\r\n * of the world-to-world transformation.\r\n * * If origin is `undefined`, (0,0,0) is used. If matrix is `undefined` the identity matrix is used.\r\n */\r\n public static createOriginAndMatrix(\r\n origin: XYZ | undefined, matrix: Matrix3d | undefined, result?: Transform\r\n ): Transform {\r\n if (result) {\r\n result._origin.setFromPoint3d(origin);\r\n result._matrix.setFrom(matrix);\r\n return result;\r\n }\r\n return Transform.createRefs(\r\n origin ? origin.cloneAsPoint3d() : Point3d.createZero(),\r\n matrix === undefined ? Matrix3d.createIdentity() : matrix.clone(),\r\n result\r\n );\r\n }\r\n /** Create a Transform using the given `origin` and columns of the `matrix`. If `undefined` zero is used. */\r\n public setOriginAndMatrixColumns(\r\n origin: XYZ | undefined, vectorX: Vector3d | undefined, vectorY: Vector3d | undefined, vectorZ: Vector3d | undefined\r\n ): void {\r\n if (origin !== undefined)\r\n this._origin.setFrom(origin);\r\n this._matrix.setColumns(vectorX, vectorY, vectorZ);\r\n }\r\n /** Create a Transform using the given `origin` and columns of the `matrix` */\r\n public static createOriginAndMatrixColumns(\r\n origin: XYZ, vectorX: Vector3d, vectorY: Vector3d, vectorZ: Vector3d, result?: Transform\r\n ): Transform {\r\n if (result)\r\n result.setOriginAndMatrixColumns(origin, vectorX, vectorY, vectorZ);\r\n else\r\n result = Transform.createRefs(Vector3d.createFrom(origin), Matrix3d.createColumns(vectorX, vectorY, vectorZ));\r\n return result;\r\n }\r\n /**\r\n * Create a Transform such that its `matrix` part is rigid.\r\n * @see [[Matrix3d.createRigidFromColumns]] for details of how the matrix is created to be rigid.\r\n */\r\n public static createRigidFromOriginAndColumns(\r\n origin: XYZ | undefined, vectorX: Vector3d, vectorY: Vector3d, axisOrder: AxisOrder, result?: Transform\r\n ): Transform | undefined {\r\n const matrix = Matrix3d.createRigidFromColumns(vectorX, vectorY, axisOrder, result ? result._matrix : undefined);\r\n if (!matrix)\r\n return undefined;\r\n if (result) {\r\n // result._matrix was already modified to become rigid via createRigidFromColumns\r\n result._origin.setFrom(origin);\r\n return result;\r\n }\r\n /**\r\n * We don't want to pass \"origin\" to createRefs because createRefs does not clone \"origin\". That means if \"origin\"\r\n * is changed via Transform at any point, the initial \"origin\" passed by the user is also changed. To avoid that,\r\n * we pass \"undefined\" to createRefs so that it allocates a new point which then we set it to the \"origin\" which\r\n * is passed by user in the next line.\r\n */\r\n result = Transform.createRefs(undefined, matrix);\r\n result._origin.setFromPoint3d(origin);\r\n return result;\r\n }\r\n /**\r\n * Create a Transform with the specified `matrix`. Compute an `origin` (different from the given `fixedPoint`)\r\n * so that the `fixedPoint` maps back to itself. The returned Transform, transforms a point `p` to `M*p + (f - M*f)`\r\n * where `f` is the fixedPoint (i.e., `Tp = M*(p-f) + f`).\r\n */\r\n public static createFixedPointAndMatrix(\r\n fixedPoint: XYAndZ | undefined, matrix: Matrix3d, result?: Transform\r\n ): Transform {\r\n if (fixedPoint) {\r\n /**\r\n * if f is a fixed point, then Tf = M*f + o = f where M is the matrix and o is the origin.\r\n * we define the origin o = f - M*f. Therefore, Tf = Mf + o = M*f + (f - M*f) = f.\r\n */\r\n const origin = Matrix3d.xyzMinusMatrixTimesXYZ(fixedPoint, matrix, fixedPoint);\r\n return Transform.createRefs(origin, matrix.clone(), result);\r\n }\r\n return Transform.createRefs(undefined, matrix.clone());\r\n }\r\n /**\r\n * Create a transform with the specified `matrix` and points `a` and `b`. The returned Transform maps\r\n * point `p` to `M*(p-a) + b` (i.e., `Tp = M*(p-a) + b`), so maps `a` to 'b'.\r\n */\r\n public static createMatrixPickupPutdown(\r\n matrix: Matrix3d, a: Point3d, b: Point3d, result?: Transform\r\n ): Transform {\r\n // we define the origin o = b - M*a so Tp = M*p + o = M*p + (b - M*a) = M*(p-a) + b\r\n const origin = Matrix3d.xyzMinusMatrixTimesXYZ(b, matrix, a);\r\n return Transform.createRefs(origin, matrix.clone(), result);\r\n }\r\n /**\r\n * Create a Transform which leaves the fixedPoint unchanged and scales everything else around it by\r\n * a single scale factor. The returned Transform maps a point `p` to `M*p + (f - M*f)`\r\n * where `f` is the fixedPoint and M is the scale matrix (i.e., `Tp = M*(p-f) + f`).\r\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeTransform\r\n */\r\n public static createScaleAboutPoint(fixedPoint: Point3d, scale: number, result?: Transform): Transform {\r\n const matrix = Matrix3d.createScale(scale, scale, scale);\r\n /**\r\n * if f is a fixed point, then Tf = M*f + o = f where M is the matrix and o is the origin.\r\n * we define the origin o = f - M*f. Therefore, Tf = M*f + o = M*f + (f - M*f) = f.\r\n */\r\n const origin = Matrix3d.xyzMinusMatrixTimesXYZ(fixedPoint, matrix, fixedPoint);\r\n return Transform.createRefs(origin, matrix, result);\r\n }\r\n /**\r\n * Return a transformation which flattens space onto a plane, sweeping along a direction which may be different from the plane normal.\r\n * @param sweepVector vector for the sweep direction\r\n * @param planePoint any point on the plane\r\n * @param planeNormal vector normal to the plane.\r\n */\r\n public static createFlattenAlongVectorToPlane(sweepVector: Vector3d, planePoint: XYAndZ, planeNormal: Vector3d): Transform | undefined {\r\n const matrix = Matrix3d.createFlattenAlongVectorToPlane(sweepVector, planeNormal);\r\n if (matrix === undefined)\r\n return undefined;\r\n return Transform.createFixedPointAndMatrix(planePoint, matrix);\r\n }\r\n /**\r\n * Transform the input 2d point (using `Tp = M*p + o`).\r\n * Return as a new point or in the pre-allocated result (if result is given).\r\n */\r\n public multiplyPoint2d(point: XAndY, result?: Point2d): Point2d {\r\n return Matrix3d.xyPlusMatrixTimesXY(this._origin, this._matrix, point, result);\r\n }\r\n /**\r\n * Transform the input 3d point (using `Tp = M*p + o`).\r\n * Return as a new point or in the pre-allocated result (if result is given).\r\n */\r\n public multiplyPoint3d(point: XYAndZ, result?: Point3d): Point3d {\r\n // Tx = Mx + o so we return Mx + o\r\n return Matrix3d.xyzPlusMatrixTimesXYZ(this._origin, this._matrix, point, result);\r\n }\r\n /**\r\n * Transform the input 3d point in place (using `Tp = M*p + o`).\r\n * Return as a new point or in the pre-allocated result (if result is given).\r\n */\r\n public multiplyXYAndZInPlace(point: XYAndZ): void {\r\n return Matrix3d.xyzPlusMatrixTimesXYZInPlace(this._origin, this._matrix, point);\r\n }\r\n /**\r\n * Transform the input 3d point (using `Tp = M*p + o`).\r\n * Return as a new point or in the pre-allocated result (if result is given).\r\n */\r\n public multiplyXYZ(x: number, y: number, z: number = 0, result?: Point3d): Point3d {\r\n // Tx = Mx + o so we return Mx + o\r\n return Matrix3d.xyzPlusMatrixTimesCoordinates(this._origin, this._matrix, x, y, z, result);\r\n }\r\n /**\r\n * Multiply a specific row (component) of the 3x4 instance times (x,y,z,1). Return the result.\r\n */\r\n public multiplyComponentXYZ(componentIndex: number, x: number, y: number, z: number = 0): number {\r\n const coffs = this._matrix.coffs;\r\n const idx = 3 * componentIndex;\r\n return this.origin.at(componentIndex) + (coffs[idx] * x) + (coffs[idx + 1] * y) + (coffs[idx + 2] * z);\r\n }\r\n /**\r\n * Multiply a specific row (component) of the 3x4 instance times (x,y,z,w). Return the result.\r\n */\r\n public multiplyComponentXYZW(componentIndex: number, x: number, y: number, z: number, w: number): number {\r\n const coffs = this._matrix.coffs;\r\n const idx = 3 * componentIndex;\r\n return (this.origin.at(componentIndex) * w) + (coffs[idx] * x) + (coffs[idx + 1] * y) + (coffs[idx + 2] * z);\r\n }\r\n /**\r\n * Transform the homogeneous point. Return as a new `Point4d`, or in the pre-allocated result (if result is given).\r\n * * If `p = (x,y,z)` then this method computes `Tp = M*p + o*w` and returns the `Point4d` formed by `Tp` in the\r\n * first three coordinates, and `w` in the fourth.\r\n * * Logically, this is multiplication by the 4x4 matrix formed from the 3x4 instance augmented with fourth row 0001.\r\n */\r\n public multiplyXYZW(x: number, y: number, z: number, w: number, result?: Point4d): Point4d {\r\n return Matrix3d.xyzPlusMatrixTimesWeightedCoordinates(this._origin, this._matrix, x, y, z, w, result);\r\n }\r\n /**\r\n * Transform the homogeneous point. Return as new `Float64Array` with size 4, or in the pre-allocated result (if\r\n * result is given).\r\n * * If `p = (x,y,z)` then this method computes `Tp = M*p + o*w` and returns the `Float64Array` formed by `Tp`\r\n * in the first 3 numbers of the array and `w` as the fourth.\r\n * * Logically, this is multiplication by the 4x4 matrix formed from the 3x4 instance augmented with fourth row 0001.\r\n */\r\n public multiplyXYZWToFloat64Array(x: number, y: number, z: number, w: number, result?: Float64Array): Float64Array {\r\n return Matrix3d.xyzPlusMatrixTimesWeightedCoordinatesToFloat64Array(this._origin, this._matrix, x, y, z, w, result);\r\n }\r\n /**\r\n * * Transform the point. Return as new `Float64Array` with size 3, or in the pre-allocated result (if result is given).\r\n * * If `p = (x,y,z)` then this method computes `Tp = M*p + o` and returns it as the first 3 elements of the array.\r\n */\r\n public multiplyXYZToFloat64Array(x: number, y: number, z: number, result?: Float64Array): Float64Array {\r\n return Matrix3d.xyzPlusMatrixTimesCoordinatesToFloat64Array(this._origin, this._matrix, x, y, z, result);\r\n }\r\n /**\r\n * Multiply the homogeneous point by the transpose of `this` Transform. Return as a new `Point4d` or in the\r\n * pre-allocated result (if result is given).\r\n * * If `p = (x,y,z)` then this method computes `M^t*p` and returns it in the first three coordinates of the `Point4d`,\r\n * and `o*p + w` in the fourth.\r\n * * Logically, this is multiplication by the transpose of the 4x4 matrix formed from the 3x4 instance augmented with\r\n * fourth row 0001.\r\n */\r\n public multiplyTransposeXYZW(x: number, y: number, z: number, w: number, result?: Point4d): Point4d {\r\n const coffs = this._matrix.coffs;\r\n const origin = this._origin;\r\n return Point4d.create(\r\n (x * coffs[0]) + (y * coffs[3]) + (z * coffs[6]),\r\n (x * coffs[1]) + (y * coffs[4]) + (z * coffs[7]),\r\n (x * coffs[2]) + (y * coffs[5]) + (z * coffs[8]),\r\n (x * origin.x) + (y * origin.y) + (z * origin.z) + w,\r\n result\r\n );\r\n }\r\n /** For each point in the array, replace point by the transformed point (using `Tp = M*p + o`) */\r\n public multiplyPoint3dArrayInPlace(points: Point3d[]) {\r\n let point;\r\n for (point of points)\r\n Matrix3d.xyzPlusMatrixTimesXYZ(this._origin, this._matrix, point, point);\r\n }\r\n /** For each point in the 2d array, replace point by the transformed point (using `Tp = M*p + o`) */\r\n public multiplyPoint3dArrayArrayInPlace(chains: Point3d[][]) {\r\n for (const chain of chains)\r\n this.multiplyPoint3dArrayInPlace(chain);\r\n }\r\n /**\r\n * Multiply the point by the inverse Transform.\r\n * * If for a point `p` we have `Tp = M*p + o = q`, then `p = MInverse*(q - o) = TInverse q` so `TInverse`\r\n * Transform has matrix part `MInverse` and origin part `-MInverse*o`.\r\n * * Return as a new point or in the optional `result`.\r\n * * Returns `undefined` if the `matrix` part if this Transform is singular.\r\n */\r\n public multiplyInversePoint3d(point: XYAndZ, result?: Point3d): Point3d | undefined {\r\n return this._matrix.multiplyInverseXYZAsPoint3d(\r\n point.x - this._origin.x,\r\n point.y - this._origin.y,\r\n point.z - this._origin.z,\r\n result\r\n );\r\n }\r\n /**\r\n * Multiply the homogenous point by the inverse Transform.\r\n * * If for a point `p` we have `Tp = M*p + o = q`, then `p = MInverse*(q - o) = TInverse q` so `TInverse` Transform\r\n * has matrix part `MInverse` and origin part `-MInverse*o`.\r\n * * This method computes `TInverse p = MInverse*p - w*MInverse*o` and returns the `Point4d` formed by `TInverse*p`\r\n * in the first three coordinates, and `w` in the fourth.\r\n * * Logically, this is multiplication by the inverse of the 4x4 matrix formed from the 3x4 instance augmented with\r\n * fourth row 0001. This is equivalent to the 4x4 matrix formed in similar fashion from the inverse of this instance.\r\n * * Return as a new point or in the optional `result`.\r\n * * Returns `undefined` if the `matrix` part if this Transform is singular.\r\n */\r\n public multiplyInversePoint4d(weightedPoint: Point4d, result?: Point4d): Point4d | undefined {\r\n const w = weightedPoint.w;\r\n return this._matrix.multiplyInverseXYZW(\r\n weightedPoint.x - w * this.origin.x,\r\n weightedPoint.y - w * this.origin.y,\r\n weightedPoint.z - w * this.origin.z,\r\n w,\r\n result\r\n );\r\n }\r\n /**\r\n * Multiply the point by the inverse Transform.\r\n * * If for a point `p` we have `Tp = M*p + o = q`, then `p = MInverse*(q - o) = TInverse q` so `TInverse` Transform\r\n * has matrix part `MInverse` and origin part `-MInverse*o`.\r\n * * Return as a new point or in the optional `result`.\r\n * * Returns `undefined` if the `matrix` part if this Transform is singular.\r\n */\r\n public multiplyInverseXYZ(x: number, y: number, z: number, result?: Point3d): Point3d | undefined {\r\n return this._matrix.multiplyInverseXYZAsPoint3d(\r\n x - this._origin.x,\r\n y - this._origin.y,\r\n z - this._origin.z,\r\n result\r\n );\r\n }\r\n /**\r\n * * Compute (if needed) the inverse of the `matrix` part of the Transform, thereby ensuring inverse\r\n * operations can complete.\r\n * @param useCached If true, accept prior cached inverse if available.\r\n * @returns `true` if matrix inverse completes, `false` otherwise.\r\n */\r\n public computeCachedInverse(useCached: boolean = true): boolean {\r\n return this._matrix.computeCachedInverse(useCached);\r\n }\r\n /**\r\n * Match the length of destination array with the length of source array\r\n * * If destination has more elements than source, remove the extra elements.\r\n * * If destination has fewer elements than source, use `constructionFunction` to create new elements.\r\n * *\r\n * @param source the source array\r\n * @param dest the destination array\r\n * @param constructionFunction function to call to create new elements.\r\n */\r\n public static matchArrayLengths(source: any[], dest: any[], constructionFunction: () => any): number {\r\n const numSource = source.length;\r\n const numDest = dest.length;\r\n if (numSource > numDest) {\r\n for (let i = numDest; i < numSource; i++) {\r\n dest.push(constructionFunction());\r\n }\r\n } else if (numDest > numSource) {\r\n dest.length = numSource;\r\n }\r\n return numSource;\r\n }\r\n /**\r\n * Multiply each point in the array by the inverse of `this` Transform.\r\n * * For a transform `T = [M o]` the inverse transform `T' = [M' -M'o]` exists if and only if `M` has an inverse\r\n * `M'`. Indeed, for any point `p`, we have `T'Tp = T'(Mp + o) = M'(Mp + o) - M'o = M'Mp + M'o - M'o = p.`\r\n * * If `result` is given, resize it to match the input `points` array and update it with original points `p[]`.\r\n * * If `result` is not given, return a new array.\r\n * * Returns `undefined` if the `matrix` part if this Transform is singular.\r\n */\r\n public multiplyInversePoint3dArray(points: Point3d[], result?: Point3d[]): Point3d[] | undefined {\r\n if (!this._matrix.computeCachedInverse(true))\r\n return undefined;\r\n const originX = this.origin.x;\r\n const originY = this.origin.y;\r\n const originZ = this.origin.z;\r\n if (result) {\r\n const n = Transform.matchArrayLengths(points, result, Point3d.createZero);\r\n for (let i = 0; i < n; i++)\r\n this._matrix.multiplyInverseXYZAsPoint3d(\r\n points[i].x - originX,\r\n points[i].y - originY,\r\n points[i].z - originZ,\r\n result[i]\r\n );\r\n return result;\r\n }\r\n result = [];\r\n for (const point of points)\r\n result.push(\r\n this._matrix.multiplyInverseXYZAsPoint3d(\r\n point.x - originX,\r\n point.y - originY,\r\n point.z - originZ\r\n )!\r\n );\r\n return result;\r\n }\r\n /**\r\n * Multiply each point in the array by the inverse of `this` Transform in place.\r\n * * For a transform `T = [M o]` the inverse transform `T' = [M' -M'o]` exists if and only if `M` has an inverse\r\n * `M'`. Indeed, for any point `p`, we have `T'Tp = T'(Mp + o) = M'(Mp + o) - M'o = M'Mp + M'o - M'o = p.`\r\n * * Returns `true` if the `matrix` part if this Transform is invertible and `false` if singular.\r\n */\r\n public multiplyInversePoint3dArrayInPlace(points: Point3d[]): boolean {\r\n if (!this._matrix.computeCachedInverse(true))\r\n return false;\r\n for (const point of points)\r\n this._matrix.multiplyInverseXYZAsPoint3d(\r\n point.x - this.origin.x,\r\n point.y - this.origin.y,\r\n point.z - this.origin.z,\r\n point\r\n );\r\n return true;\r\n }\r\n /**\r\n * Transform the input 2d point array (using `Tp = M*p + o`).\r\n * * If `result` is given, resize it to match the input `points` array and update it with transformed points.\r\n * * If `result` is not given, return a new array.\r\n */\r\n public multiplyPoint2dArray(points: Point2d[], result?: Point2d[]): Point2d[] {\r\n if (result) {\r\n const n = Transform.matchArrayLengths(points, result, Point2d.createZero);\r\n for (let i = 0; i < n; i++)\r\n Matrix3d.xyPlusMatrixTimesXY(this._origin, this._matrix, points[i], result[i]);\r\n return result;\r\n }\r\n result = [];\r\n for (const p of points)\r\n result.push(Matrix3d.xyPlusMatrixTimesXY(this._origin, this._matrix, p));\r\n return result;\r\n }\r\n /**\r\n * Transform the input 3d point array (using `Tp = M*p + o`).\r\n * * If `result` is given, resize it to match the input `points` array and update it with transformed points.\r\n * * If `result` is not given, return a new array.\r\n */\r\n public multiplyPoint3dArray(points: Point3d[], result?: Point3d[]): Point3d[] {\r\n if (result) {\r\n const n = Transform.matchArrayLengths(points, result, Point3d.createZero);\r\n for (let i = 0; i < n; i++)\r\n Matrix3d.xyzPlusMatrixTimesXYZ(this._origin, this._matrix, points[i], result[i]);\r\n return result;\r\n }\r\n result = [];\r\n for (const p of points)\r\n result.push(Matrix3d.xyzPlusMatrixTimesXYZ(this._origin, this._matrix, p));\r\n return result;\r\n }\r\n /**\r\n * Multiply the vector by the `matrix` part of the Transform.\r\n * * The `origin` part of Transform is not used.\r\n * * If `result` is given, update it with the multiplication. Otherwise, create a new Vector3d.\r\n */\r\n public multiplyVector(vector: Vector3d, result?: Vector3d): Vector3d {\r\n return this._matrix.multiplyVector(vector, result);\r\n }\r\n /**\r\n * Multiply the vector by the `matrix` part of the Transform in place.\r\n * * The `origin` part of Transform is not used.\r\n */\r\n public multiplyVectorInPlace(vector: Vector3d): void {\r\n this._matrix.multiplyVectorInPlace(vector);\r\n }\r\n /**\r\n * Multiply the vector (x,y,z) by the `matrix` part of the Transform.\r\n * * The `origin` part of Transform is not used.\r\n * * If `result` is given, update it with the multiplication. Otherwise, create a new Vector3d.\r\n */\r\n public multiplyVectorXYZ(x: number, y: number, z: number, result?: Vector3d): Vector3d {\r\n return this._matrix.multiplyXYZ(x, y, z, result);\r\n }\r\n /**\r\n * Calculate `transformA * transformB` and store it into the calling instance (`this`).\r\n * * **Note:** If `transformA = [A a]` and `transformB = [B b]` then `transformA * transformB` is defined as\r\n * `[A*B Ab+a]`.\r\n * * @see [[multiplyTransformTransform]] documentation for math details.\r\n * @param transformA first operand\r\n * @param transformB second operand\r\n */\r\n public setMultiplyTransformTransform(transformA: Transform, transformB: Transform): void {\r\n Matrix3d.xyzPlusMatrixTimesXYZ(\r\n transformA._origin,\r\n transformA._matrix,\r\n transformB._origin,\r\n this._origin as Point3d\r\n );\r\n transformA._matrix.multiplyMatrixMatrix(transformB._matrix, this._matrix);\r\n }\r\n /**\r\n * Multiply `this` Transform times `other` Transform.\r\n * * **Note:** If `this = [A a]` and `other = [B b]` then `this * other` is defined as [A*B Ab+a] because:\r\n * ```\r\n * equation\r\n * \\begin{matrix}\r\n * \\text{this Transform with matrix part }\\bold{A}\\text{ and origin part }\\bold{a} & \\blockTransform{A}{a}\\\\\r\n * \\text{other Transform with matrix part }\\bold{B}\\text{ and origin part }\\bold{b} & \\blockTransform{B}{b} \\\\\r\n * \\text{product}& \\blockTransform{A}{a}\\blockTransform{B}{b}=\\blockTransform{AB}{Ab + a}\r\n * \\end{matrix}\r\n * ```\r\n * @param other the 'other` Transform to be multiplied to `this` Transform.\r\n * @param result optional preallocated `result` to reuse.\r\n */\r\n public multiplyTransformTransform(other: Transform, result?: Transform) {\r\n if (!result)\r\n return Transform.createRefs(\r\n Matrix3d.xyzPlusMatrixTimesXYZ(this._origin, this._matrix, other._origin),\r\n this._matrix.multiplyMatrixMatrix(other._matrix)\r\n );\r\n result.setMultiplyTransformTransform(this, other);\r\n return result;\r\n }\r\n /**\r\n * Multiply `this` Transform times `other` Matrix3d (considered to be a Transform with 0 `origin`).\r\n * * **Note:** If `this = [A a]` and `other = [B 0]`, then `this * other` is defined as [A*B a] because:\r\n * ```\r\n * equation\r\n * \\begin{matrix}\r\n * \\text{this Transform with matrix part }\\bold{A}\\text{ and origin part }\\bold{a} & \\blockTransform{A}{a}\\\\\r\n * \\text{other matrix }\\bold{B}\\text{ promoted to block Transform} & \\blockTransform{B}{0} \\\\\r\n * \\text{product}& \\blockTransform{A}{a}\\blockTransform{B}{0}=\\blockTransform{AB}{a}\r\n * \\end{matrix}\r\n * ```\r\n * @param other the `other` Matrix3d to be multiplied to `this` Transform.\r\n * @param result optional preallocated `result` to reuse.\r\n */\r\n public multiplyTransformMatrix3d(other: Matrix3d, result?: Transform): Transform {\r\n if (!result)\r\n return Transform.createRefs(\r\n this._origin.cloneAsPoint3d(),\r\n this._matrix.multiplyMatrixMatrix(other)\r\n );\r\n this._matrix.multiplyMatrixMatrix(other, result._matrix);\r\n result._origin.setFrom(this._origin);\r\n return result;\r\n }\r\n /**\r\n * Return the range of the transformed corners.\r\n * * The 8 corners are transformed individually.\r\n * * **Note:** Suppose you have a geometry, a range box around that geometry, and your Transform is a rotation.\r\n * If you rotate the range box and recompute a new range box around the rotated range box, then the new range\r\n * box will have a larger volume than the original range box. However, if you rotate the geometry itself and\r\n * then recompute the range box, it will be a tighter range box around the rotated geometry. `multiplyRange`\r\n * function creates the larger range box because it only has access to the range box and not the geometry itself.\r\n */\r\n public multiplyRange(range: Range3d, result?: Range3d): Range3d {\r\n if (range.isNull)\r\n return range.clone(result);\r\n const lowX = range.low.x;\r\n const lowY = range.low.y;\r\n const lowZ = range.low.z;\r\n const highX = range.high.x;\r\n const highY = range.high.y;\r\n const highZ = range.high.z;\r\n result = Range3d.createNull(result);\r\n result.extendTransformedXYZ(this, lowX, lowY, lowZ);\r\n result.extendTransformedXYZ(this, highX, lowY, lowZ);\r\n result.extendTransformedXYZ(this, lowX, highY, lowZ);\r\n result.extendTransformedXYZ(this, highX, highY, lowZ);\r\n result.extendTransformedXYZ(this, lowX, lowY, highZ);\r\n result.extendTransformedXYZ(this, highX, lowY, highZ);\r\n result.extendTransformedXYZ(this, lowX, highY, highZ);\r\n result.extendTransformedXYZ(this, highX, highY, highZ);\r\n return result;\r\n }\r\n /**\r\n * Return a Transform which is the inverse of `this` Transform.\r\n * * If `transform = [M o]` then `transformInverse = [MInverse -MInverse*o]`\r\n * * Return `undefined` if this Transform's matrix is singular.\r\n */\r\n public inverse(result?: Transform): Transform | undefined {\r\n const matrixInverse = this._matrix.inverse(result ? result._matrix : undefined);\r\n if (!matrixInverse)\r\n return undefined;\r\n if (result) {\r\n // result._matrix is already defined\r\n matrixInverse.multiplyXYZ(-this._origin.x, -this._origin.y, -this._origin.z, result._origin as Vector3d);\r\n return result;\r\n }\r\n return Transform.createRefs(\r\n matrixInverse.multiplyXYZ(-this._origin.x, -this._origin.y, -this._origin.z),\r\n matrixInverse\r\n );\r\n }\r\n /**\r\n * Initialize 2 Transforms that map between the unit box (specified by 000 and 111) and the range box specified\r\n * by the input points.\r\n * @param min the min corner of the range box\r\n * @param max the max corner of the range box\r\n * @param npcToGlobal maps NPC coordinates into range box coordinates. Specifically, maps 000 to `min` and maps\r\n * 111 to `max`. This Transform is the inverse of `globalToNpc`. Object created by caller, re-initialized here.\r\n * @param globalToNpc maps range box coordinates into NPC coordinates. Specifically, maps `min` to 000 and maps\r\n * `max` to 111. This Transform is the inverse of `npcToGlobal`. Object created by caller, re-initialized here.\r\n * * NPC stands for `Normalized Projection Coordinate`\r\n */\r\n public static initFromRange(min: Point3d, max: Point3d, npcToGlobal?: Transform, globalToNpc?: Transform): void {\r\n const diag = max.minus(min);\r\n if (diag.x === 0.0)\r\n diag.x = 1.0;\r\n if (diag.y === 0.0)\r\n diag.y = 1.0;\r\n if (diag.z === 0.0)\r\n diag.z = 1.0;\r\n const rMatrix = new Matrix3d();\r\n /**\r\n * [diag.x 0 0 min.x]\r\n * npcToGlobal = [ 0 diag.y 0 min.y]\r\n * [ 0 0 diag.y min.z]\r\n *\r\n * npcToGlobal * 0 = min\r\n * npcToGlobal * 1 = diag + min = max\r\n */\r\n if (npcToGlobal) {\r\n Matrix3d.createScale(diag.x, diag.y, diag.z, rMatrix);\r\n Transform.createOriginAndMatrix(min, rMatrix, npcToGlobal);\r\n }\r\n /**\r\n * [1/diag.x 0 0 -min.x/diag.x]\r\n * globalToNpc = [ 0 1/diag.y 0 -min.y/diag.y]\r\n * [ 0 0 1/diag.y -min.z/diag.z]\r\n *\r\n * globalToNpc * min = min/diag - min/diag = 0\r\n * globalToNpc * max = max/diag - min/diag = diag/diag = 1\r\n */\r\n if (globalToNpc) {\r\n const origin = new Point3d(-min.x / diag.x, -min.y / diag.y, -min.z / diag.z);\r\n Matrix3d.createScale(1.0 / diag.x, 1.0 / diag.y, 1.0 / diag.z, rMatrix);\r\n Transform.createOriginAndMatrix(origin, rMatrix, globalToNpc);\r\n }\r\n }\r\n}\r\n"]}
@@ -183,6 +183,7 @@ export declare class RegionOps {
183
183
  * not detect self intersection among widely separated edges.
184
184
  * * If offsetDistance is given as a number, default OffsetOptions are applied.
185
185
  * * See [[JointOptions]] class doc for offset construction rules.
186
+ * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/Offset
186
187
  * @param curves base curves.
187
188
  * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.
188
189
  */
@@ -1 +1 @@
1
- {"version":3,"file":"RegionOps.d.ts","sourceRoot":"","sources":["../../../src/curve/RegionOps.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1E,OAAO,EAAyB,0BAA0B,EAAgB,MAAM,2BAA2B,CAAC;AAE5G,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,yCAAyC,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAExH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD,OAAO,EAA+B,YAAY,EAAE,aAAa,EAA4B,MAAM,yCAAyC,CAAC;AAE7I,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE3C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAS9B;;;;GAIG;A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separated edges.
332
332
  * * If offsetDistance is given as a number, default OffsetOptions are applied.
333
333
  * * See [[JointOptions]] class doc for offset construction rules.
334
+ * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/Offset
334
335
  * @param curves base curves.
335
336
  * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.
336
337
  */