@itwin/core-geometry 5.0.0-dev.62 → 5.0.0-dev.64

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 (55) hide show
  1. package/lib/cjs/bspline/BSpline1dNd.d.ts +90 -54
  2. package/lib/cjs/bspline/BSpline1dNd.d.ts.map +1 -1
  3. package/lib/cjs/bspline/BSpline1dNd.js +134 -99
  4. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  5. package/lib/cjs/bspline/BSplineCurve.d.ts +193 -155
  6. package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
  7. package/lib/cjs/bspline/BSplineCurve.js +245 -181
  8. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  9. package/lib/cjs/bspline/BezierCurve3d.d.ts +3 -1
  10. package/lib/cjs/bspline/BezierCurve3d.d.ts.map +1 -1
  11. package/lib/cjs/bspline/BezierCurve3d.js +3 -5
  12. package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
  13. package/lib/cjs/bspline/KnotVector.d.ts +74 -54
  14. package/lib/cjs/bspline/KnotVector.d.ts.map +1 -1
  15. package/lib/cjs/bspline/KnotVector.js +127 -80
  16. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  17. package/lib/cjs/curve/Arc3d.d.ts +2 -0
  18. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  19. package/lib/cjs/curve/Arc3d.js +2 -0
  20. package/lib/cjs/curve/Arc3d.js.map +1 -1
  21. package/lib/cjs/geometry3d/PointHelpers.d.ts +3 -3
  22. package/lib/cjs/geometry3d/PointHelpers.js +3 -3
  23. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  24. package/lib/cjs/geometry3d/Ray3d.d.ts +2 -2
  25. package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
  26. package/lib/cjs/geometry3d/Ray3d.js +8 -11
  27. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  28. package/lib/esm/bspline/BSpline1dNd.d.ts +90 -54
  29. package/lib/esm/bspline/BSpline1dNd.d.ts.map +1 -1
  30. package/lib/esm/bspline/BSpline1dNd.js +134 -99
  31. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  32. package/lib/esm/bspline/BSplineCurve.d.ts +193 -155
  33. package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
  34. package/lib/esm/bspline/BSplineCurve.js +245 -181
  35. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  36. package/lib/esm/bspline/BezierCurve3d.d.ts +3 -1
  37. package/lib/esm/bspline/BezierCurve3d.d.ts.map +1 -1
  38. package/lib/esm/bspline/BezierCurve3d.js +3 -5
  39. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  40. package/lib/esm/bspline/KnotVector.d.ts +74 -54
  41. package/lib/esm/bspline/KnotVector.d.ts.map +1 -1
  42. package/lib/esm/bspline/KnotVector.js +127 -80
  43. package/lib/esm/bspline/KnotVector.js.map +1 -1
  44. package/lib/esm/curve/Arc3d.d.ts +2 -0
  45. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  46. package/lib/esm/curve/Arc3d.js +2 -0
  47. package/lib/esm/curve/Arc3d.js.map +1 -1
  48. package/lib/esm/geometry3d/PointHelpers.d.ts +3 -3
  49. package/lib/esm/geometry3d/PointHelpers.js +3 -3
  50. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  51. package/lib/esm/geometry3d/Ray3d.d.ts +2 -2
  52. package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
  53. package/lib/esm/geometry3d/Ray3d.js +8 -11
  54. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  55. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"Ray3d.js","sourceRoot":"","sources":["../../../src/geometry3d/Ray3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,sEAAoH;AACpH,0CAAmE;AACnE,yDAAsD;AACtD,yCAAsC;AAEtC,u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EAAE,YAAY,GAAG,EAAE,CAAC,CAAC;QAC9E,IAAI,QAAQ,IAAI,GAAG;YACjB,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,QAAQ,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,QAAQ,GAAG,EAAE,CAAC,CAAC;aACpF,CAAC;YACJ,MAAM,CAAC,GAAW,QAAQ,GAAG,GAAG,CAAC;YACjC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;QACpE,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAphBD,sBAohBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\nimport { CurveCurveApproachType, CurveLocationDetail, CurveLocationDetailPair } from \"../curve/CurveLocationDetail\";\nimport { AxisOrder, BeJSONFunctions, Geometry } from \"../Geometry\";\nimport { SmallSystem } from \"../numerics/SmallSystem\";\nimport { Matrix3d } from \"./Matrix3d\";\nimport { Plane3dByOriginAndUnitNormal } from \"./Plane3dByOriginAndUnitNormal\";\nimport { Vector2d } from \"./Point2dVector2d\";\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\nimport { Range1d, Range3d } from \"./Range\";\nimport { Transform } from \"./Transform\";\nimport { XYAndZ } from \"./XYZProps\";\n\n// cspell:word Cramer\n/**\n * A Ray3d contains\n * * an `origin` point.\n * * a `direction` vector (The vector is not required to be normalized).\n * * an optional weight (number).\n * @public\n */\nexport class Ray3d implements BeJSONFunctions {\n /** The ray origin */\n public origin: Point3d;\n /** The ray direction. This is commonly (but not always) a unit vector. */\n public direction: Vector3d;\n /** Numeric annotation. */\n public a?: number; // optional (e.g. weight)\n private static _workVector0?: Vector3d;\n private static _workVector1?: Vector3d;\n private static _workVector2?: Vector3d;\n private static _workVector3?: Vector3d;\n private static _workVector4?: Vector3d;\n private static _workMatrix?: Matrix3d;\n // constructor (captures references)\n private constructor(origin: Point3d, direction: Vector3d) {\n this.origin = origin;\n this.direction = direction;\n this.a = undefined;\n }\n private static _create(x: number, y: number, z: number, u: number, v: number, w: number) {\n return new Ray3d(Point3d.create(x, y, z), Vector3d.create(u, v, w));\n }\n /** Create a ray on the x axis. */\n public static createXAxis(): Ray3d {\n return Ray3d._create(0, 0, 0, 1, 0, 0);\n }\n /** Create a ray on the y axis. */\n public static createYAxis(): Ray3d {\n return Ray3d._create(0, 0, 0, 0, 1, 0);\n }\n /** Create a ray on the z axis. */\n public static createZAxis(): Ray3d {\n return Ray3d._create(0, 0, 0, 0, 0, 1);\n }\n /** Create a ray with all zeros. */\n public static createZero(result?: Ray3d): Ray3d {\n if (result) {\n result.origin.setZero();\n result.direction.setZero();\n return result;\n }\n return new Ray3d(Point3d.createZero(), Vector3d.createZero());\n }\n /**\n * Test for nearly equal Ray3d objects.\n * * This tests for near equality of origin and direction -- i.e. member-by-member comparison.\n * * Use [[isAlmostEqualPointSet]] to allow origins to be anywhere along the common ray and to have to allow the\n * directions to be scaled or opposing.\n */\n public isAlmostEqual(other: Ray3d): boolean {\n return this.origin.isAlmostEqual(other.origin) && this.direction.isAlmostEqual(other.direction);\n }\n /**\n * Return the dot product of the ray's direction vector with a vector from the ray origin\n * to the `spacePoint`.\n * * If the instance is the unit normal of a plane, then this method returns the (signed) altitude\n * of `spacePoint` with respect to the plane.\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/ProjectVectorOnPlane\n */\n public dotProductToPoint(spacePoint: Point3d): number {\n return this.direction.dotProductStartEnd(this.origin, spacePoint);\n }\n /** Return the fractional coordinate (along the direction vector) of the `spacePoint` projected to the ray. */\n public pointToFraction(spacePoint: Point3d): number {\n return Geometry.safeDivideFraction(\n this.dotProductToPoint(spacePoint),\n this.direction.magnitudeSquared(),\n 0,\n );\n }\n /** Return the `spacePoint` projected onto the ray. */\n public projectPointToRay(spacePoint: Point3d): Point3d {\n /**\n * To project a point to the ray, we can create a vector called \"v\" from ray origin to the spacePoint and project\n * that vector to the ray direction vector \"r\". The projection is \"((v.r)/||r||^2) r\" where \"v.r\" is the dot\n * product. Note that pointToFraction returns \"(v.r)/||r||^2\".\n * Note: If r is the normal of a plane, then projection length \"(v.r)/||r||\" is the signed altitude of the\n * spacePoint with respect to the plane.\n */\n return this.origin.plusScaled(this.direction, this.pointToFraction(spacePoint));\n }\n /**\n * Test for nearly equal rays, allowing origin float and direction scaling.\n * * Use [[isAlmostEqual]] to require member-by-member comparison.\n */\n public isAlmostEqualPointSet(other: Ray3d): boolean {\n /**\n * This function tests two rays to determine if they define the same infinite lines.\n * So the origins can be different as long as they are on the infinite line (they can\n * \"float\") but the directions must be parallel or antiparallel.\n */\n if (!this.direction.isParallelTo(other.direction, true))\n return false;\n /**\n * In exact math, we consider a ray to have an infinite line as direction (not a finite vector).\n * Therefore, in exact math it is not possible for one origin to be on the other ray but not vice\n * versa. However, we test both ways because first check may pass due to round-off errors.\n */\n let workPoint = this.projectPointToRay(other.origin);\n if (!other.origin.isAlmostEqualMetric(workPoint))\n return false;\n workPoint = other.projectPointToRay(this.origin);\n if (!this.origin.isAlmostEqualMetric(workPoint))\n return false;\n return true;\n }\n /** Create a ray from origin and direction. */\n public static create(origin: Point3d, direction: Vector3d, result?: Ray3d): Ray3d {\n if (result) {\n result.set(origin, direction);\n return result;\n }\n return new Ray3d(origin.clone(), direction.clone());\n }\n /**\n * Given a homogeneous point and its derivative components, construct a Ray3d with cartesian\n * coordinates and derivatives.\n * @param weightedPoint `[x,y,z,w]` parts of weighted point.\n * @param weightedDerivative `[x,y,z,w]` derivatives\n * @param result\n */\n public static createWeightedDerivative(\n weightedPoint: Float64Array, weightedDerivative: Float64Array, result?: Ray3d,\n ): Ray3d | undefined {\n const w = weightedPoint[3];\n const dw = weightedDerivative[3];\n const x = weightedPoint[0];\n const y = weightedPoint[1];\n const z = weightedPoint[2];\n const dx = weightedDerivative[0] * w - weightedPoint[0] * dw;\n const dy = weightedDerivative[1] * w - weightedPoint[1] * dw;\n const dz = weightedDerivative[2] * w - weightedPoint[2] * dw;\n if (Geometry.isSmallMetricDistance(w))\n return undefined;\n const divW = 1.0 / w;\n const divWW = divW * divW;\n return Ray3d.createXYZUVW(\n x * divW, y * divW, z * divW,\n dx * divWW, dy * divWW, dz * divWW,\n result,\n );\n }\n /** Create from coordinates of the origin and direction. */\n public static createXYZUVW(\n originX: number, originY: number, originZ: number,\n directionX: number, directionY: number, directionZ: number,\n result?: Ray3d,\n ): Ray3d {\n if (result) {\n result.getOriginRef().set(originX, originY, originZ);\n result.getDirectionRef().set(directionX, directionY, directionZ);\n return result;\n }\n return new Ray3d(Point3d.create(originX, originY, originZ), Vector3d.create(directionX, directionY, directionZ));\n }\n /** Capture origin and direction in a new Ray3d. */\n public static createCapture(origin: Point3d, direction: Vector3d): Ray3d {\n return new Ray3d(origin, direction);\n }\n /** Create from (clones of) origin, direction, and numeric weight. */\n public static createPointVectorNumber(origin: Point3d, direction: Vector3d, a: number, result?: Ray3d): Ray3d {\n if (result) {\n result.origin.setFrom(origin);\n result.direction.setFrom(direction);\n result.a = a;\n return result;\n }\n result = new Ray3d(origin.clone(), direction.clone());\n result.a = a;\n return result;\n }\n /** Create from origin and target. The direction vector is the full length (non-unit) vector from origin to target. */\n public static createStartEnd(origin: Point3d, target: Point3d, result?: Ray3d): Ray3d {\n if (result) {\n result.origin.setFrom(origin);\n result.direction.setStartEnd(origin, target);\n return result;\n }\n return new Ray3d(origin.clone(), Vector3d.createStartEnd(origin, target));\n }\n /** Return a reference to the ray's origin. */\n public getOriginRef(): Point3d {\n return this.origin;\n }\n /** Return a reference to the ray's direction vector. */\n public getDirectionRef(): Vector3d {\n return this.direction;\n }\n /** Copy coordinates from origin and direction. */\n public set(origin: Point3d, direction: Vector3d): void {\n this.origin.setFrom(origin);\n this.direction.setFrom(direction);\n }\n /** Clone the ray. */\n public clone(result?: Ray3d): Ray3d {\n if (result) {\n result.set(this.origin.clone(), this.direction.clone());\n return result;\n }\n return new Ray3d(this.origin.clone(), this.direction.clone());\n }\n /** Return a clone of the transformed instance */\n public cloneTransformed(transform: Transform, result?: Ray3d): Ray3d {\n return Ray3d.create(\n transform.multiplyPoint3d(this.origin, result?.origin),\n transform.multiplyVector(this.direction, result?.direction),\n result,\n );\n }\n /** Create a clone and return the inverse transform of the clone. */\n public cloneInverseTransformed(transform: Transform, result?: Ray3d): Ray3d | undefined {\n if (!transform.computeCachedInverse(true))\n return undefined;\n return Ray3d.create(\n transform.multiplyInversePoint3d(this.origin, result?.origin)!,\n transform.matrix.multiplyInverseXYZAsVector3d(\n this.direction.x, this.direction.y, this.direction.z, result?.direction,\n )!,\n result,\n );\n }\n /** Apply a transform in place. */\n public transformInPlace(transform: Transform) {\n transform.multiplyPoint3d(this.origin, this.origin);\n transform.multiplyVector(this.direction, this.direction);\n }\n /** Copy data from another ray. */\n public setFrom(source: Ray3d): void {\n this.set(source.origin, source.direction);\n }\n /**\n * Return a point at fractional position along the ray.\n * * fraction 0 is the ray origin.\n * * fraction 1 is at the end of the direction vector when placed at the origin.\n */\n public fractionToPoint(fraction: number, result?: Point3d): Point3d {\n return this.origin.plusScaled(this.direction, fraction, result);\n }\n /**\n * Return a transform for rigid axes at ray origin with z in ray direction.\n * * If the direction vector is zero, axes default to identity (from [[Matrix3d.createRigidHeadsUp]])\n */\n public toRigidZFrame(result?: Transform): Transform {\n const axes = Ray3d._workMatrix = Matrix3d.createRigidHeadsUp(this.direction, AxisOrder.ZXY, Ray3d._workMatrix);\n return Transform.createOriginAndMatrix(this.origin, axes, result);\n }\n /** Convert {origin:[x,y,z], direction:[u,v,w]} to a Ray3d. */\n public setFromJSON(json?: any) {\n if (!json) {\n this.origin.set(0, 0, 0);\n this.direction.set(0, 0, 1);\n return;\n }\n this.origin.setFromJSON(json.origin);\n this.direction.setFromJSON(json.direction);\n }\n /**\n * Construct a JSON object from this Ray3d.\n * @return {*} [origin,normal]\n */\n public toJSON(): any {\n return { origin: this.origin.toJSON(), direction: this.direction.toJSON() };\n }\n /** Create a new ray from json object. See `setFromJSON` for json structure; */\n public static fromJSON(json?: any) {\n const result = Ray3d.createXAxis();\n result.setFromJSON(json);\n return result;\n }\n /**\n * Try to scale the direction vector to a given `magnitude`.\n * * Returns `false` if the ray direction is a zero vector.\n */\n public trySetDirectionMagnitudeInPlace(magnitude: number = 1.0): boolean {\n if (this.direction.tryNormalizeInPlace()) {\n this.direction.scaleInPlace(magnitude);\n return true;\n }\n this.direction.setZero();\n this.a = 0.0;\n return false;\n }\n /**\n * Normalize the ray direction in place.\n * * If parameter `a` is clearly nonzero and the direction vector can be normalized,\n * * Save the parameter `a` as the optional `a` member of the ray.\n * * Normalize the ray's direction vector.\n * * If parameter `a` is nearly zero,\n * * Set the `a` member to zero.\n * * Set the ray's direction vector to zero.\n * @param a value to be saved (e.g,. area).\n * @returns `true` if `a` is nonzero and normalization was successful. Otherwise, return `false`.\n */\n public tryNormalizeInPlaceWithAreaWeight(a: number): boolean {\n const tolerance = Geometry.smallMetricDistanceSquared;\n this.a = a;\n if (Math.abs(a) > tolerance && this.direction.tryNormalizeInPlace(tolerance))\n return true;\n this.direction.setZero();\n this.a = 0.0;\n return false;\n }\n /** Return distance from the ray to point in space. */\n public distance(spacePoint: Point3d): number {\n const uu = this.direction.magnitudeSquared();\n const uv = this.dotProductToPoint(spacePoint);\n const aa = Geometry.inverseMetricDistanceSquared(uu);\n if (aa)\n return Math.sqrt(this.origin.distanceSquared(spacePoint) - uv * uv * aa);\n else\n return Math.sqrt(this.origin.distanceSquared(spacePoint));\n }\n /**\n * Return the intersection parameter of the line defined by the ray with a `plane`.\n * * Stores the point of intersection in the `result` point (if passed as a parameter) and returns the parameter\n * along the ray where the intersection occurs. If we call the parameter 'f' then the point of intersection would\n * be `ray.origin + f * ray.direction`. Therefore:\n * * if ray intersects the plane at its origin, the function returns f = 0.\n * * if intersects at `ray.origin + ray.direction`, the function returns f = 1.\n * * if intersects behind the ray origin, the function returns f < 0.\n * * if intersects after `ray.origin + ray.direction`, the function returns f > 1.\n * * Returns `undefined` if the ray and plane are parallel or coplanar.\n */\n public intersectionWithPlane(plane: Plane3dByOriginAndUnitNormal, result?: Point3d): number | undefined {\n const vectorA = Vector3d.createStartEnd(plane.getOriginRef(), this.origin);\n const uDotN = this.direction.dotProduct(plane.getNormalRef());\n const nDotN = this.direction.magnitudeSquared();\n const aDotN = vectorA.dotProduct(plane.getNormalRef());\n const division = Geometry.conditionalDivideFraction(-aDotN, uDotN);\n if (undefined === division)\n return undefined;\n const division1 = Geometry.conditionalDivideFraction(nDotN, uDotN);\n if (undefined === division1)\n return undefined;\n if (result) {\n this.origin.plusScaled(this.direction, division, result);\n }\n return division;\n }\n /**\n * Find the intersection of the line defined by the ray with a Range3d.\n * * Return the range of parameters (on the ray) which are \"inside\" the range.\n * * Note that a range is always returned; if there is no intersection it is indicated by the test `result.isNull`.\n */\n public intersectionWithRange3d(range: Range3d, result?: Range1d): Range1d {\n if (range.isNull)\n return Range1d.createNull(result);\n const interval = Range1d.createXX(-Geometry.largeCoordinateResult, Geometry.largeCoordinateResult, result);\n if (interval.clipLinearMapToInterval(this.origin.x, this.direction.x, range.low.x, range.high.x)\n && interval.clipLinearMapToInterval(this.origin.y, this.direction.y, range.low.y, range.high.y)\n && interval.clipLinearMapToInterval(this.origin.z, this.direction.z, range.low.z, range.high.z)\n )\n return interval;\n return interval;\n }\n /**\n * Compute the intersection of the ray with a triangle.\n * * This method is faster than `BarycentricTriangle.intersectRay3d`.\n * @param vertex0 first vertex of the triangle\n * @param vertex1 second vertex of the triangle\n * @param vertex2 third vertex of the triangle\n * @param distanceTol optional tolerance used to check if ray is parallel to the triangle or if we have line\n * intersection but not ray intersection (if tolerance is not provided, Geometry.smallMetricDistance is used)\n * @param parameterTol optional tolerance used to snap barycentric coordinates of the intersection point to\n * a triangle edge or vertex (if tolerance is not provided, Geometry.smallFloatingPoint is used)\n * @param result optional pre-allocated object to fill and return\n * @returns the intersection point if ray intersects the triangle. Otherwise, return undefined.\n */\n public intersectionWithTriangle(\n vertex0: Point3d, vertex1: Point3d, vertex2: Point3d, distanceTol?: number, parameterTol?: number, result?: Point3d,\n ): Point3d | undefined {\n /**\n * Suppose ray is shown by \"rayOrigin + t*rayVector\" and barycentric coordinate of point\n * P = w*v0 + u*v1 + v*v2 = (1-u-v)*v0 + u*v1 + v*v2 = v0 + u*(v1-v0) + v*(v2-v0)\n *\n * Then if ray intersects triangle at a point we have\n * v0 + u*(v1-v0) + v*(v2-v0) = rayOrigin + t*rayVector\n * or\n * -t*rayVector + u*(v1-v0) + v*(v2-v0) = rayOrigin - v0\n *\n * This equation can be reformulated as the following linear system:\n *\n * [ | | | ] [t] [ | ]\n * [-rayVector v1-v0 v2-v0] [u] = [rayOrigin - v0]\n * [ | | | ] [v] [ | ]\n *\n * Then to find t, u, and v use Cramer's Rule and also the fact that if matrix A = [c1,c2,c3], then\n * det(A) = c1.(c2 x c3) which leads to\n *\n * t = [(rayOrigin - v0).((v1-v0) x (v2-v0))] / [-rayVector.((v1-v0) x (v2-v0))]\n * u = [-rayVector.((rayOrigin - v0) x (v2-v0))] / [-rayVector.((v1-v0) x (v2-v0))]\n * v = [-rayVector.((v1-v0) x (rayOrigin - v0))] / [-rayVector.((v1-v0) x (v2-v0))]\n *\n * Now note that swapping any 2 vectors c_i and c_j in formula c1.(c2 x c3) negates it. For example:\n * c1.(c2 x c3) = -c3.(c2 x c1) = c2.(c3 x c1)\n *\n * This leads to the final formulas used in the following code:\n * t = [(v2-v0).((rayOrigin - v0) x (v1-v0))] / [(v1-v0).(rayVector x (v2-v0))]\n * u = [(rayOrigin - v0).(rayVector x (v2-v0))] / [(v1-v0).(rayVector x (v2-v0))]\n * v = [-rayVector.((rayOrigin - v0) x (v1-v0))] / [(v1-v0).(rayVector x (v2-v0))]\n *\n * Note that we should verify 0 <= u,v,w <= 1. To do so we only need to check 0 <= u <= 1, 0 <= v, and u+v <= 1.\n * That's because w = 1-(u+v) and if we have those 4 checks, it's guaranteed that v <= 1 and 0 <= u+v and so\n * 0 <= w <= 1.\n *\n * More info be found at\n * https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm\n */\n if (distanceTol === undefined || distanceTol < 0) // we explicitly allow zero tolerance\n distanceTol = Geometry.smallMetricDistance;\n if (parameterTol === undefined || parameterTol < 0) // we explicitly allow zero tolerance\n parameterTol = Geometry.smallFloatingPoint;\n const edge1 = Ray3d._workVector0 = Vector3d.createStartEnd(vertex0, vertex1, Ray3d._workVector0);\n const edge2 = Ray3d._workVector1 = Vector3d.createStartEnd(vertex0, vertex2, Ray3d._workVector1);\n const h = Ray3d._workVector2 = this.direction.crossProduct(edge2, Ray3d._workVector2);\n const a = edge1.dotProduct(h);\n if (a >= -distanceTol && a <= distanceTol)\n return undefined; // ray is parallel to the triangle (includes coplanar case)\n const f = 1.0 / a;\n const s = Ray3d._workVector3 = Vector3d.createStartEnd(vertex0, this.origin, Ray3d._workVector3);\n let u = f * s.dotProduct(h);\n if (u < 0.0) {\n if (u > -parameterTol)\n u = 0.0;\n else\n return undefined; // ray does not intersect the triangle\n } else if (u > 1.0) {\n if (u < 1.0 + parameterTol)\n u = 1.0;\n else\n return undefined; // ray does not intersect the triangle\n }\n const q = Ray3d._workVector4 = s.crossProduct(edge1, Ray3d._workVector4);\n let v = f * this.direction.dotProduct(q);\n if (v < 0.0) {\n if (v > -parameterTol)\n v = 0.0;\n else\n return undefined; // ray does not intersect the triangle\n } else if (u + v > 1.0) {\n if (u + v < 1.0 + parameterTol)\n v = 1.0 - u;\n else\n return undefined; // ray does not intersect the triangle\n }\n // at this stage, we know the line (parameterized as the ray) intersects the triangle\n const t = f * edge2.dotProduct(q);\n if (t <= distanceTol) // line intersection but not ray intersection\n return undefined;\n return this.origin.plusScaled(this.direction, t, result); // ray intersection\n }\n /**\n * Return the shortest vector `v` to `targetPoint` from the line defined by this ray.\n * * If the projection of `targetPoint` onto the line defined by this ray is q, then `v  = targetPoint - q`.\n */\n public perpendicularPartOfVectorToTarget(targetPoint: XYAndZ, result?: Vector3d): Vector3d {\n const vectorV = Vector3d.createStartEnd(this.origin, targetPoint);\n const uu = this.direction.magnitudeSquared();\n const uv = this.direction.dotProductStartEnd(this.origin, targetPoint);\n const fraction = Geometry.safeDivideFraction(uv, uu, 0.0);\n return vectorV.plusScaled(this.direction, -fraction, result);\n }\n /**\n * Determine if two rays intersect, or are fully overlapped, or parallel but not coincident, or skew.\n * * Return a CurveLocationDetailPair which contains fraction and point on each ray and has\n * annotation (in member `approachType`) indicating one of these relationships:\n * * CurveCurveApproachType.Intersection -- the rays have a simple intersection, at fractions indicated\n * in detailA and detailB\n * * CurveCurveApproachType.PerpendicularChord -- there is pair of where the rays have closest approach.\n * The rays are skew in space.\n * * CurveCurveApproachType.CoincidentGeometry -- the rays are the same unbounded line in space. The\n * fractions and points are a representative single common point.\n * * CurveCurveApproachType.Parallel -- the rays are parallel (and not coincident). The two points are\n * at the minimum distance\n */\n public static closestApproachRay3dRay3d(rayA: Ray3d, rayB: Ray3d): CurveLocationDetailPair {\n const intersectionFractions = Vector2d.create();\n let fractionA, fractionB;\n let pointA, pointB;\n let pairType;\n if (\n SmallSystem.ray3dXYZUVWClosestApproachUnbounded(\n rayA.origin.x, rayA.origin.y, rayA.origin.z, rayA.direction.x, rayA.direction.y, rayA.direction.z,\n rayB.origin.x, rayB.origin.y, rayB.origin.z, rayB.direction.x, rayB.direction.y, rayB.direction.z,\n intersectionFractions,\n )\n ) {\n fractionA = intersectionFractions.x;\n fractionB = intersectionFractions.y;\n pointA = rayA.fractionToPoint(fractionA);\n pointB = rayB.fractionToPoint(fractionB);\n pairType = pointA.isAlmostEqualMetric(pointB) ?\n CurveCurveApproachType.Intersection : CurveCurveApproachType.PerpendicularChord;\n } else {\n fractionB = 0.0;\n fractionA = rayA.pointToFraction(rayB.origin);\n pointA = rayA.fractionToPoint(fractionA);\n pointB = rayB.fractionToPoint(fractionB);\n pairType = pointA.isAlmostEqualMetric(pointB) ?\n CurveCurveApproachType.CoincidentGeometry : CurveCurveApproachType.ParallelGeometry;\n }\n const pair = CurveLocationDetailPair.createCapture(\n CurveLocationDetail.createRayFractionPoint(rayA, fractionA, rayA.fractionToPoint(fractionA)),\n CurveLocationDetail.createRayFractionPoint(rayB, fractionB, rayB.fractionToPoint(fractionB)));\n pair.approachType = pairType;\n return pair;\n }\n /**\n * Return a ray with `ray.origin` interpolated between `pt1` and `pt2` at the given `fraction`\n * and `ray.direction` set to the vector from `pt1` to `pt2` multiplied by the given `tangentScale`.\n * @param pt1 start point of the interpolation.\n * @param fraction fractional position between points.\n * @param pt2 end point of the interpolation.\n * @param tangentScale scale factor to apply to the startToEnd vector.\n * @param result optional receiver.\n */\n public static interpolatePointAndTangent(\n pt1: XYAndZ, fraction: number, pt2: XYAndZ, tangentScale: number, result?: Ray3d,\n ): Ray3d {\n result = result ?? Ray3d.createZero();\n const dx = pt2.x - pt1.x;\n const dy = pt2.y - pt1.y;\n const dz = pt2.z - pt1.z;\n result.direction.set(tangentScale * dx, tangentScale * dy, tangentScale * dz);\n if (fraction <= 0.5)\n result.origin.set(pt1.x + fraction * dx, pt1.y + fraction * dy, pt1.z + fraction * dz);\n else {\n const t: number = fraction - 1.0;\n result.origin.set(pt2.x + t * dx, pt2.y + t * dy, pt2.z + t * dz);\n }\n return result;\n }\n}\n"]}
1
+ {"version":3,"file":"Ray3d.js","sourceRoot":"","sources":["../../../src/geometry3d/Ray3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,sEAAoH;AACp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QAC9E,IAAI,QAAQ,IAAI,GAAG;YACjB,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,QAAQ,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,QAAQ,GAAG,EAAE,CAAC,CAAC;aACpF,CAAC;YACJ,MAAM,CAAC,GAAW,QAAQ,GAAG,GAAG,CAAC;YACjC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;QACpE,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAjhBD,sBAihBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\nimport { CurveCurveApproachType, CurveLocationDetail, CurveLocationDetailPair } from \"../curve/CurveLocationDetail\";\nimport { AxisOrder, BeJSONFunctions, Geometry } from \"../Geometry\";\nimport { SmallSystem } from \"../numerics/SmallSystem\";\nimport { Matrix3d } from \"./Matrix3d\";\nimport { Plane3dByOriginAndUnitNormal } from \"./Plane3dByOriginAndUnitNormal\";\nimport { Vector2d } from \"./Point2dVector2d\";\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\nimport { Range1d, Range3d } from \"./Range\";\nimport { Transform } from \"./Transform\";\nimport { XYAndZ } from \"./XYZProps\";\n\n// cspell:word Cramer\n/**\n * A Ray3d contains\n * * an `origin` point.\n * * a `direction` vector (The vector is not required to be normalized).\n * * an optional weight (number).\n * @public\n */\nexport class Ray3d implements BeJSONFunctions {\n /** The ray origin */\n public origin: Point3d;\n /** The ray direction. This is commonly (but not always) a unit vector. */\n public direction: Vector3d;\n /** Numeric annotation. */\n public a?: number; // optional (e.g. weight)\n private static _workVector0?: Vector3d;\n private static _workVector1?: Vector3d;\n private static _workVector2?: Vector3d;\n private static _workVector3?: Vector3d;\n private static _workVector4?: Vector3d;\n private static _workMatrix?: Matrix3d;\n // constructor (captures references)\n private constructor(origin: Point3d, direction: Vector3d) {\n this.origin = origin;\n this.direction = direction;\n this.a = undefined;\n }\n private static _create(x: number, y: number, z: number, u: number, v: number, w: number) {\n return new Ray3d(Point3d.create(x, y, z), Vector3d.create(u, v, w));\n }\n /** Create a ray on the x axis. */\n public static createXAxis(): Ray3d {\n return Ray3d._create(0, 0, 0, 1, 0, 0);\n }\n /** Create a ray on the y axis. */\n public static createYAxis(): Ray3d {\n return Ray3d._create(0, 0, 0, 0, 1, 0);\n }\n /** Create a ray on the z axis. */\n public static createZAxis(): Ray3d {\n return Ray3d._create(0, 0, 0, 0, 0, 1);\n }\n /** Create a ray with all zeros. */\n public static createZero(result?: Ray3d): Ray3d {\n if (result) {\n result.origin.setZero();\n result.direction.setZero();\n return result;\n }\n return new Ray3d(Point3d.createZero(), Vector3d.createZero());\n }\n /**\n * Test for nearly equal Ray3d objects.\n * * This tests for near equality of origin and direction -- i.e. member-by-member comparison.\n * * Use [[isAlmostEqualPointSet]] to allow origins to be anywhere along the common ray and to have to allow the\n * directions to be scaled or opposing.\n */\n public isAlmostEqual(other: Ray3d): boolean {\n return this.origin.isAlmostEqual(other.origin) && this.direction.isAlmostEqual(other.direction);\n }\n /**\n * Return the dot product of the ray's direction vector with a vector from the ray origin\n * to the `spacePoint`.\n * * If the instance is the unit normal of a plane, then this method returns the (signed) altitude\n * of `spacePoint` with respect to the plane.\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/ProjectVectorOnPlane\n */\n public dotProductToPoint(spacePoint: Point3d): number {\n return this.direction.dotProductStartEnd(this.origin, spacePoint);\n }\n /** Return the fractional coordinate (along the direction vector) of the `spacePoint` projected to the ray. */\n public pointToFraction(spacePoint: Point3d): number {\n return Geometry.safeDivideFraction(\n this.dotProductToPoint(spacePoint),\n this.direction.magnitudeSquared(),\n 0,\n );\n }\n /** Return the `spacePoint` projected onto the ray. */\n public projectPointToRay(spacePoint: Point3d): Point3d {\n /**\n * To project a point to the ray, we can create a vector called \"v\" from ray origin to the spacePoint and project\n * that vector to the ray direction vector \"r\". The projection is \"((v.r)/||r||^2) r\" where \"v.r\" is the dot\n * product. Note that pointToFraction returns \"(v.r)/||r||^2\".\n * Note: If r is the normal of a plane, then projection length \"(v.r)/||r||\" is the signed altitude of the\n * spacePoint with respect to the plane.\n */\n return this.origin.plusScaled(this.direction, this.pointToFraction(spacePoint));\n }\n /**\n * Test for nearly equal rays, allowing origin float and direction scaling.\n * * Use [[isAlmostEqual]] to require member-by-member comparison.\n */\n public isAlmostEqualPointSet(other: Ray3d): boolean {\n /**\n * This function tests two rays to determine if they define the same infinite lines.\n * So the origins can be different as long as they are on the infinite line (they can\n * \"float\") but the directions must be parallel or antiparallel.\n */\n if (!this.direction.isParallelTo(other.direction, true))\n return false;\n /**\n * In exact math, we consider a ray to have an infinite line as direction (not a finite vector).\n * Therefore, in exact math it is not possible for one origin to be on the other ray but not vice\n * versa. However, we test both ways because first check may pass due to round-off errors.\n */\n let workPoint = this.projectPointToRay(other.origin);\n if (!other.origin.isAlmostEqualMetric(workPoint))\n return false;\n workPoint = other.projectPointToRay(this.origin);\n if (!this.origin.isAlmostEqualMetric(workPoint))\n return false;\n return true;\n }\n /** Create a ray from origin and direction. */\n public static create(origin: Point3d, direction: Vector3d, result?: Ray3d): Ray3d {\n if (result) {\n result.set(origin, direction);\n return result;\n }\n return new Ray3d(origin.clone(), direction.clone());\n }\n /**\n * Given a homogeneous point and its derivative components, construct a Ray3d with cartesian\n * coordinates and derivatives.\n * @param weightedPoint `[x,y,z,w]` parts of weighted point.\n * @param weightedDerivative `[x,y,z,w]` derivatives\n * @param result\n */\n public static createWeightedDerivative(\n weightedPoint: Float64Array, weightedDerivative: Float64Array, result?: Ray3d,\n ): Ray3d | undefined {\n const w = weightedPoint[3];\n const dw = weightedDerivative[3];\n const x = weightedPoint[0];\n const y = weightedPoint[1];\n const z = weightedPoint[2];\n const dx = weightedDerivative[0] * w - weightedPoint[0] * dw;\n const dy = weightedDerivative[1] * w - weightedPoint[1] * dw;\n const dz = weightedDerivative[2] * w - weightedPoint[2] * dw;\n if (Geometry.isSmallMetricDistance(w))\n return undefined;\n const divW = 1.0 / w;\n const divWW = divW * divW;\n return Ray3d.createXYZUVW(\n x * divW, y * divW, z * divW,\n dx * divWW, dy * divWW, dz * divWW,\n result,\n );\n }\n /** Create from coordinates of the origin and direction. */\n public static createXYZUVW(\n originX: number, originY: number, originZ: number,\n directionX: number, directionY: number, directionZ: number,\n result?: Ray3d,\n ): Ray3d {\n if (result) {\n result.getOriginRef().set(originX, originY, originZ);\n result.getDirectionRef().set(directionX, directionY, directionZ);\n return result;\n }\n return new Ray3d(Point3d.create(originX, originY, originZ), Vector3d.create(directionX, directionY, directionZ));\n }\n /** Capture origin and direction in a new Ray3d. */\n public static createCapture(origin: Point3d, direction: Vector3d): Ray3d {\n return new Ray3d(origin, direction);\n }\n /** Create from (clones of) origin, direction, and numeric weight. */\n public static createPointVectorNumber(origin: Point3d, direction: Vector3d, a: number, result?: Ray3d): Ray3d {\n if (result) {\n result.origin.setFrom(origin);\n result.direction.setFrom(direction);\n result.a = a;\n return result;\n }\n result = new Ray3d(origin.clone(), direction.clone());\n result.a = a;\n return result;\n }\n /** Create from origin and target. The direction vector is the full length (non-unit) vector from origin to target. */\n public static createStartEnd(origin: Point3d, target: Point3d, result?: Ray3d): Ray3d {\n if (result) {\n result.origin.setFrom(origin);\n result.direction.setStartEnd(origin, target);\n return result;\n }\n return new Ray3d(origin.clone(), Vector3d.createStartEnd(origin, target));\n }\n /** Return a reference to the ray's origin. */\n public getOriginRef(): Point3d {\n return this.origin;\n }\n /** Return a reference to the ray's direction vector. */\n public getDirectionRef(): Vector3d {\n return this.direction;\n }\n /** Copy coordinates from origin and direction. */\n public set(origin: Point3d, direction: Vector3d): void {\n this.origin.setFrom(origin);\n this.direction.setFrom(direction);\n }\n /** Clone the ray. */\n public clone(result?: Ray3d): Ray3d {\n if (result) {\n result.set(this.origin.clone(), this.direction.clone());\n return result;\n }\n return new Ray3d(this.origin.clone(), this.direction.clone());\n }\n /** Return a clone of the transformed instance */\n public cloneTransformed(transform: Transform, result?: Ray3d): Ray3d {\n return Ray3d.create(\n transform.multiplyPoint3d(this.origin, result?.origin),\n transform.multiplyVector(this.direction, result?.direction),\n result,\n );\n }\n /** Create a clone and return the inverse transform of the clone. */\n public cloneInverseTransformed(transform: Transform, result?: Ray3d): Ray3d | undefined {\n if (!transform.computeCachedInverse(true))\n return undefined;\n return Ray3d.create(\n transform.multiplyInversePoint3d(this.origin, result?.origin)!,\n transform.matrix.multiplyInverseXYZAsVector3d(\n this.direction.x, this.direction.y, this.direction.z, result?.direction,\n )!,\n result,\n );\n }\n /** Apply a transform in place. */\n public transformInPlace(transform: Transform) {\n transform.multiplyPoint3d(this.origin, this.origin);\n transform.multiplyVector(this.direction, this.direction);\n }\n /** Copy data from another ray. */\n public setFrom(source: Ray3d): void {\n this.set(source.origin, source.direction);\n }\n /**\n * Return a point at fractional position along the ray.\n * * fraction 0 is the ray origin.\n * * fraction 1 is at the end of the direction vector when placed at the origin.\n */\n public fractionToPoint(fraction: number, result?: Point3d): Point3d {\n return this.origin.plusScaled(this.direction, fraction, result);\n }\n /**\n * Return a transform for rigid axes at ray origin with z in ray direction.\n * * If the direction vector is zero, axes default to identity (from [[Matrix3d.createRigidHeadsUp]])\n */\n public toRigidZFrame(result?: Transform): Transform {\n const axes = Ray3d._workMatrix = Matrix3d.createRigidHeadsUp(this.direction, AxisOrder.ZXY, Ray3d._workMatrix);\n return Transform.createOriginAndMatrix(this.origin, axes, result);\n }\n /** Convert {origin:[x,y,z], direction:[u,v,w]} to a Ray3d. */\n public setFromJSON(json?: any) {\n if (!json) {\n this.origin.set(0, 0, 0);\n this.direction.set(0, 0, 1);\n return;\n }\n this.origin.setFromJSON(json.origin);\n this.direction.setFromJSON(json.direction);\n }\n /**\n * Construct a JSON object from this Ray3d.\n * @return {*} [origin,normal]\n */\n public toJSON(): any {\n return { origin: this.origin.toJSON(), direction: this.direction.toJSON() };\n }\n /** Create a new ray from json object. See `setFromJSON` for json structure; */\n public static fromJSON(json?: any) {\n const result = Ray3d.createXAxis();\n result.setFromJSON(json);\n return result;\n }\n /**\n * Try to scale the direction vector to a given `magnitude`.\n * * Returns `false` if the ray direction is a zero vector.\n */\n public trySetDirectionMagnitudeInPlace(magnitude: number = 1.0): boolean {\n if (this.direction.tryNormalizeInPlace()) {\n this.direction.scaleInPlace(magnitude);\n return true;\n }\n this.direction.setZero();\n this.a = 0.0;\n return false;\n }\n /**\n * Normalize the ray direction in place.\n * * If parameter `a` is clearly nonzero and the direction vector can be normalized,\n * * Save the parameter `a` as the optional `a` member of the ray.\n * * Normalize the ray's direction vector.\n * * If parameter `a` is nearly zero,\n * * Set the `a` member to zero.\n * * Set the ray's direction vector to zero.\n * @param a value to be saved (e.g,. area).\n * @returns `true` if `a` is nonzero and normalization was successful. Otherwise, return `false`.\n */\n public tryNormalizeInPlaceWithAreaWeight(a: number): boolean {\n const tolerance = Geometry.smallMetricDistanceSquared;\n this.a = a;\n if (Math.abs(a) > tolerance && this.direction.tryNormalizeInPlace(tolerance))\n return true;\n this.direction.setZero();\n this.a = 0.0;\n return false;\n }\n /** Return distance from the ray to point in space. */\n public distance(spacePoint: Point3d): number {\n const uu = this.direction.magnitudeSquared();\n const uv = this.dotProductToPoint(spacePoint);\n const aa = Geometry.inverseMetricDistanceSquared(uu);\n if (aa)\n return Math.sqrt(this.origin.distanceSquared(spacePoint) - uv * uv * aa);\n else\n return Math.sqrt(this.origin.distanceSquared(spacePoint));\n }\n /**\n * Return the intersection parameter of the line defined by the ray with a `plane`.\n * * Stores the point of intersection in the `result` point (if passed as a parameter) and returns the parameter\n * along the ray where the intersection occurs. If we call the parameter 'f' then the point of intersection would\n * be `ray.origin + f * ray.direction`. Therefore:\n * * if ray intersects the plane at its origin, the function returns f = 0.\n * * if intersects at `ray.origin + ray.direction`, the function returns f = 1.\n * * if intersects behind the ray origin, the function returns f < 0.\n * * if intersects after `ray.origin + ray.direction`, the function returns f > 1.\n * * Returns `undefined` if the ray and plane are parallel or coplanar.\n */\n public intersectionWithPlane(plane: Plane3dByOriginAndUnitNormal, result?: Point3d): number | undefined {\n const vectorA = Vector3d.createStartEnd(plane.getOriginRef(), this.origin);\n const uDotN = this.direction.dotProduct(plane.getNormalRef());\n const nDotN = this.direction.magnitudeSquared();\n const aDotN = vectorA.dotProduct(plane.getNormalRef());\n const division = Geometry.conditionalDivideFraction(-aDotN, uDotN);\n if (undefined === division)\n return undefined;\n const division1 = Geometry.conditionalDivideFraction(nDotN, uDotN);\n if (undefined === division1)\n return undefined;\n if (result) {\n this.origin.plusScaled(this.direction, division, result);\n }\n return division;\n }\n /**\n * Find the intersection of the line defined by the ray with a Range3d.\n * * Return the range of parameters (on the ray) which are \"inside\" the range.\n * * Note that a range is always returned; if there is no intersection it is indicated by the test `result.isNull`.\n */\n public intersectionWithRange3d(range: Range3d, result?: Range1d): Range1d {\n if (range.isNull)\n return Range1d.createNull(result);\n const interval = Range1d.createXX(-Geometry.largeCoordinateResult, Geometry.largeCoordinateResult, result);\n if (interval.clipLinearMapToInterval(this.origin.x, this.direction.x, range.low.x, range.high.x)\n && interval.clipLinearMapToInterval(this.origin.y, this.direction.y, range.low.y, range.high.y)\n && interval.clipLinearMapToInterval(this.origin.z, this.direction.z, range.low.z, range.high.z)\n )\n return interval;\n return interval;\n }\n /**\n * Compute the intersection of the ray with a triangle.\n * * This method is faster than `BarycentricTriangle.intersectRay3d`.\n * @param vertex0 first vertex of the triangle\n * @param vertex1 second vertex of the triangle\n * @param vertex2 third vertex of the triangle\n * @param distanceTol optional tolerance used to check if ray is parallel to the triangle or if we have line\n * intersection but not ray intersection (if tolerance is not provided, Geometry.smallMetricDistance is used)\n * @param parameterTol optional tolerance used to allow intersections just beyond an edge/vertex in barycentric\n * coordinate space (if tolerance is not provided, Geometry.smallFloatingPoint is used)\n * @param result optional pre-allocated object to fill and return\n * @returns the intersection point if ray intersects the triangle. Otherwise, return undefined.\n */\n public intersectionWithTriangle(\n vertex0: Point3d, vertex1: Point3d, vertex2: Point3d, distanceTol?: number, parameterTol?: number, result?: Point3d,\n ): Point3d | undefined {\n /**\n * Suppose ray is shown by \"rayOrigin + t*rayVector\" and barycentric coordinate of point\n * P = w*v0 + u*v1 + v*v2 = (1-u-v)*v0 + u*v1 + v*v2 = v0 + u*(v1-v0) + v*(v2-v0)\n *\n * Then if ray intersects triangle at a point we have\n * v0 + u*(v1-v0) + v*(v2-v0) = rayOrigin + t*rayVector\n * or\n * -t*rayVector + u*(v1-v0) + v*(v2-v0) = rayOrigin - v0\n *\n * This equation can be reformulated as the following linear system:\n *\n * [ | | | ] [t] [ | ]\n * [-rayVector v1-v0 v2-v0] [u] = [rayOrigin - v0]\n * [ | | | ] [v] [ | ]\n *\n * Then to find t, u, and v use Cramer's Rule and also the fact that if matrix A = [c1,c2,c3], then\n * det(A) = c1.(c2 x c3) which leads to\n *\n * t = [(rayOrigin - v0).((v1-v0) x (v2-v0))] / [-rayVector.((v1-v0) x (v2-v0))]\n * u = [-rayVector.((rayOrigin - v0) x (v2-v0))] / [-rayVector.((v1-v0) x (v2-v0))]\n * v = [-rayVector.((v1-v0) x (rayOrigin - v0))] / [-rayVector.((v1-v0) x (v2-v0))]\n *\n * Now note that swapping any 2 vectors c_i and c_j in formula c1.(c2 x c3) negates it. For example:\n * c1.(c2 x c3) = -c3.(c2 x c1) = c2.(c3 x c1)\n *\n * This leads to the final formulas used in the following code:\n * t = [(v2-v0).((rayOrigin - v0) x (v1-v0))] / [(v1-v0).(rayVector x (v2-v0))]\n * u = [(rayOrigin - v0).(rayVector x (v2-v0))] / [(v1-v0).(rayVector x (v2-v0))]\n * v = [-rayVector.((rayOrigin - v0) x (v1-v0))] / [(v1-v0).(rayVector x (v2-v0))]\n *\n * Note that we should verify 0 <= u,v,w <= 1. To do so we only need to check 0 <= u <= 1, 0 <= v, and u+v <= 1.\n * That's because w = 1-(u+v) and if we have those 4 checks, it's guaranteed that v <= 1 and 0 <= u+v and so\n * 0 <= w <= 1.\n *\n * More info be found at\n * https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm\n */\n if (distanceTol === undefined || distanceTol < 0) // we explicitly allow zero tolerance\n distanceTol = Geometry.smallMetricDistance;\n if (parameterTol === undefined || parameterTol < 0) // we explicitly allow zero tolerance\n parameterTol = Geometry.smallFloatingPoint;\n const edge1 = Ray3d._workVector0 = Vector3d.createStartEnd(vertex0, vertex1, Ray3d._workVector0);\n const edge2 = Ray3d._workVector1 = Vector3d.createStartEnd(vertex0, vertex2, Ray3d._workVector1);\n const h = Ray3d._workVector2 = this.direction.crossProduct(edge2, Ray3d._workVector2);\n const a = edge1.dotProduct(h);\n if (a >= -distanceTol && a <= distanceTol)\n return undefined; // ray is parallel to the triangle (includes coplanar case)\n const f = 1.0 / a;\n const s = Ray3d._workVector3 = Vector3d.createStartEnd(vertex0, this.origin, Ray3d._workVector3);\n let u = f * s.dotProduct(h);\n if (u < 0.0) {\n if (u >= -parameterTol)\n u = 0.0;\n else\n return undefined; // ray does not intersect the triangle\n } else if (u > 1.0) {\n if (u <= 1.0 + parameterTol)\n u = 1.0;\n else\n return undefined; // ray does not intersect the triangle\n }\n const q = Ray3d._workVector4 = s.crossProduct(edge1, Ray3d._workVector4);\n let v = f * this.direction.dotProduct(q);\n if (v < 0.0) {\n if (v >= -parameterTol)\n v = 0.0;\n else\n return undefined; // ray does not intersect the triangle\n } else if (u + v > 1.0 + parameterTol) {\n return undefined; // ray does not intersect the triangle\n }\n // at this stage, we know the line (parameterized as the ray) intersects the triangle\n const t = f * edge2.dotProduct(q);\n if (t < -distanceTol) // line intersection but not ray intersection\n return undefined;\n return this.origin.plusScaled(this.direction, t, result); // ray intersection\n }\n /**\n * Return the shortest vector `v` to `targetPoint` from the line defined by this ray.\n * * If the projection of `targetPoint` onto the line defined by this ray is q, then `v  = targetPoint - q`.\n */\n public perpendicularPartOfVectorToTarget(targetPoint: XYAndZ, result?: Vector3d): Vector3d {\n const vectorV = Vector3d.createStartEnd(this.origin, targetPoint);\n const uu = this.direction.magnitudeSquared();\n const uv = this.direction.dotProductStartEnd(this.origin, targetPoint);\n const fraction = Geometry.safeDivideFraction(uv, uu, 0.0);\n return vectorV.plusScaled(this.direction, -fraction, result);\n }\n /**\n * Determine if two rays intersect, or are fully overlapped, or parallel but not coincident, or skew.\n * * Return a CurveLocationDetailPair which contains fraction and point on each ray and has\n * annotation (in member `approachType`) indicating one of these relationships:\n * * CurveCurveApproachType.Intersection -- the rays have a simple intersection, at fractions indicated\n * in detailA and detailB\n * * CurveCurveApproachType.PerpendicularChord -- there is pair of where the rays have closest approach.\n * The rays are skew in space.\n * * CurveCurveApproachType.CoincidentGeometry -- the rays are the same unbounded line in space. The\n * fractions and points are a representative single common point.\n * * CurveCurveApproachType.Parallel -- the rays are parallel (and not coincident). The two points are\n * at the minimum distance\n */\n public static closestApproachRay3dRay3d(rayA: Ray3d, rayB: Ray3d): CurveLocationDetailPair {\n const intersectionFractions = Vector2d.create();\n let fractionA, fractionB;\n let pointA, pointB;\n let pairType;\n if (\n SmallSystem.ray3dXYZUVWClosestApproachUnbounded(\n rayA.origin.x, rayA.origin.y, rayA.origin.z, rayA.direction.x, rayA.direction.y, rayA.direction.z,\n rayB.origin.x, rayB.origin.y, rayB.origin.z, rayB.direction.x, rayB.direction.y, rayB.direction.z,\n intersectionFractions,\n )\n ) {\n fractionA = intersectionFractions.x;\n fractionB = intersectionFractions.y;\n pointA = rayA.fractionToPoint(fractionA);\n pointB = rayB.fractionToPoint(fractionB);\n pairType = pointA.isAlmostEqualMetric(pointB) ?\n CurveCurveApproachType.Intersection : CurveCurveApproachType.PerpendicularChord;\n } else {\n fractionB = 0.0;\n fractionA = rayA.pointToFraction(rayB.origin);\n pointA = rayA.fractionToPoint(fractionA);\n pointB = rayB.fractionToPoint(fractionB);\n pairType = pointA.isAlmostEqualMetric(pointB) ?\n CurveCurveApproachType.CoincidentGeometry : CurveCurveApproachType.ParallelGeometry;\n }\n const pair = CurveLocationDetailPair.createCapture(\n CurveLocationDetail.createRayFractionPoint(rayA, fractionA, rayA.fractionToPoint(fractionA)),\n CurveLocationDetail.createRayFractionPoint(rayB, fractionB, rayB.fractionToPoint(fractionB)));\n pair.approachType = pairType;\n return pair;\n }\n /**\n * Return a ray with `ray.origin` interpolated between `pt1` and `pt2` at the given `fraction`\n * and `ray.direction` set to the vector from `pt1` to `pt2` multiplied by the given `tangentScale`.\n * @param pt1 start point of the interpolation.\n * @param fraction fractional position between points.\n * @param pt2 end point of the interpolation.\n * @param tangentScale scale factor to apply to the startToEnd vector.\n * @param result optional receiver.\n */\n public static interpolatePointAndTangent(\n pt1: XYAndZ, fraction: number, pt2: XYAndZ, tangentScale: number, result?: Ray3d,\n ): Ray3d {\n result = result ?? Ray3d.createZero();\n const dx = pt2.x - pt1.x;\n const dy = pt2.y - pt1.y;\n const dz = pt2.z - pt1.z;\n result.direction.set(tangentScale * dx, tangentScale * dy, tangentScale * dz);\n if (fraction <= 0.5)\n result.origin.set(pt1.x + fraction * dx, pt1.y + fraction * dy, pt1.z + fraction * dz);\n else {\n const t: number = fraction - 1.0;\n result.origin.set(pt2.x + t * dx, pt2.y + t * dy, pt2.z + t * dz);\n }\n return result;\n }\n}\n"]}
@@ -3,108 +3,144 @@
3
3
  */
4
4
  import { Point3d } from "../geometry3d/Point3dVector3d";
5
5
  import { BSplineWrapMode, KnotVector } from "./KnotVector";
6
- /** Bspline knots and poles for 1d-to-Nd.
6
+ /**
7
+ * Knots and poles for a B-spline function mapping R to R^n.
7
8
  * * The "pole" (aka control point) of this class is a block of `poleLength` numbers.
8
9
  * * Derived classes (not this class) assign meaning such as x,y,z,w.
9
- * * for instance, an instance of this class with `poleLength===3` does not know if its poles are x,y,z or weighted 2D x,y,w
10
+ * * For instance, an instance of this class with `poleLength===3` does not know if its poles are x,y,z or
11
+ * weighted 2D x,y,w.
10
12
  * @public
11
13
  */
12
14
  export declare class BSpline1dNd {
13
- /** knots of the bspline */
15
+ /** Knots of the bspline. */
14
16
  knots: KnotVector;
15
- /** poles, packed in blocks of `poleLength` doubles. */
17
+ /** Poles packed in blocks of `poleLength` doubles. */
16
18
  packedData: Float64Array;
17
- /** (property accessor) Return the number of numeric values per pole. */
19
+ /** The number of numeric values per pole. */
18
20
  poleLength: number;
19
21
  /** (property accessor) Return the degree of the polynomials. */
20
22
  get degree(): number;
21
- /** (property accessor) Return the number of order (one more than degree) of the polynomials */
23
+ /** (property accessor) Return the order (one more than degree) of the polynomials. */
22
24
  get order(): number;
23
- /** (property accessor) Return the number of bezier spans (including null spans at multiple knots)*/
25
+ /** (property accessor) Return the number of bezier spans (including null spans at multiple knots). */
24
26
  get numSpan(): number;
25
- /** (property accessor) Return the number of poles*/
27
+ /** (property accessor) Return the number of poles. */
26
28
  get numPoles(): number;
27
- /** copy 3 values of pole `i` into a point.
29
+ /**
30
+ * Copy 3 values of pole `i` into a point.
28
31
  * * The calling class is responsible for knowing if this is an appropriate access to the blocked data.
29
32
  */
30
33
  getPoint3dPole(i: number, result?: Point3d): Point3d | undefined;
31
- /** preallocated array (length === `order`) used as temporary in evaluations */
34
+ /**
35
+ * Values of the `order` relevant B-spline basis functions at a parameter.
36
+ * * Preallocated to length `order` in the constructor and used as a temporary in evaluations.
37
+ */
32
38
  basisBuffer: Float64Array;
33
- /** preallocated array (length === `poleLength`) used as temporary in evaluations */
34
- poleBuffer: Float64Array;
35
- /** preallocated array (length === `order`) used as temporary in evaluations */
39
+ /**
40
+ * Derivatives of the `order` relevant B-spline basis functions at a parameter.
41
+ * * Preallocated to length `order` in the constructor and used as a temporary in evaluations.
42
+ */
36
43
  basisBuffer1: Float64Array;
37
- /** preallocated array (length === `order`) used as temporary in evaluations */
44
+ /**
45
+ * Second derivatives of the `order` relevant B-spline basis functions at a parameter.
46
+ * * Preallocated to length `order` in the constructor and used as a temporary in evaluations.
47
+ */
38
48
  basisBuffer2: Float64Array;
39
- /** preallocated array (length === `poleLength`) used as temporary in evaluations */
49
+ /**
50
+ * Temporary to hold a single point.
51
+ * * Preallocated to length `poleLength` in the constructor.
52
+ */
53
+ poleBuffer: Float64Array;
54
+ /**
55
+ * Temporary to hold a single derivative vector.
56
+ * * Preallocated to length `poleLength` in the constructor.
57
+ */
40
58
  poleBuffer1: Float64Array;
41
- /** preallocated array (length === `poleLength`) used as temporary in evaluations */
59
+ /**
60
+ * Temporary to hold a single second derivative vector.
61
+ * * Preallocated to length `poleLength` in the constructor.
62
+ */
42
63
  poleBuffer2: Float64Array;
43
64
  /**
44
- * initialize arrays for given spline dimensions.
45
- * @param numPoles number of poles
46
- * @param poleLength number of coordinates per pole (e.g.. 3 for 3D unweighted, 4 for 3d weighted, 2 for 2d unweighted, 3 for 2d weighted)
47
- * @param order number of poles in support for a section of the bspline
48
- * @param knots KnotVector. This is captured, not cloned.
65
+ * Initialize arrays for given spline dimensions.
66
+ * @param numPoles number of poles.
67
+ * @param poleLength number of coordinates per pole (e.g.. 3 for 3D unweighted, 4 for 3d weighted, 2 for 2d unweighted,
68
+ * 3 for 2d weighted).
69
+ * @param order number of poles defining a Bezier segment of the B-spline function.
70
+ * @param knots the KnotVector. This is captured, not cloned.
49
71
  */
50
72
  protected constructor(numPoles: number, poleLength: number, order: number, knots: KnotVector);
51
73
  /**
52
- * create a 1Bspline1dNd`
53
- * @param numPoles number of poles
54
- * @param poleLength number of coordinates per pole (e.g.. 3 for 3D unweighted, 4 for 3d weighted, 2 for 2d unweighted, 3 for 2d weighted)
55
- * @param order number of poles in support for a section of the bspline
56
- * @param knots KnotVector. This is captured, not cloned.
74
+ * Create a `BSpline1dNd`.
75
+ * @param numPoles number of poles.
76
+ * @param poleLength number of coordinates per pole (e.g.. 3 for 3D unweighted, 4 for 3d weighted, 2 for 2d unweighted,
77
+ * 3 for 2d weighted).
78
+ * @param order number of poles defining a Bezier segment of the B-spline function.
79
+ * @param knots the KnotVector. This is captured, not cloned.
57
80
  */
58
- static create(numPoles: number, poleLength: number, order: number, knots: KnotVector): BSpline1dNd | undefined;
59
- /** Map a span index and local fraction to knot value. */
60
- spanFractionToKnot(span: number, localFraction: number): number;
81
+ static create(numPoles: number, poleLength: number, order: number, knots: KnotVector): BSpline1dNd;
82
+ /** Map a span index and span fraction to knot value. */
83
+ spanFractionToKnot(spanIndex: number, spanFraction: number): number;
61
84
  /**
62
- * Evaluate the `order` basis functions (and optionally one or two derivatives) at a given fractional position within indexed span.
63
- * @returns true if and only if output arrays are sufficiently sized
85
+ * Evaluate the `order` basis functions (and optionally one or two derivatives) at a given fractional position within
86
+ * indexed span.
87
+ * @returns true if and only if output arrays are sufficiently sized.
64
88
  */
65
89
  evaluateBasisFunctionsInSpan(spanIndex: number, spanFraction: number, f: Float64Array, df?: Float64Array, ddf?: Float64Array): boolean;
90
+ /**
91
+ * Compute the linear combination of the given span's poles and the weights in `basisBuffer`, and store this point
92
+ * in `poleBuffer`.
93
+ */
94
+ sumPoleBufferForSpan(spanIndex: number): void;
95
+ /**
96
+ * Compute the linear combination of the given span's poles and the weights in `basisBuffer1`, and store this
97
+ * derivative vector in `poleBuffer1`.
98
+ */
99
+ sumPoleBuffer1ForSpan(spanIndex: number): void;
100
+ /**
101
+ * Compute the linear combination of the given span's poles and the weights in `basisBuffer2`, and store this
102
+ * second derivative vector in `poleBuffer2`.
103
+ */
104
+ sumPoleBuffer2ForSpan(spanIndex: number): void;
66
105
  /**
67
106
  * * Evaluate the basis functions at spanIndex and fraction.
68
- * * Evaluations are stored in the preallocated `this.basisBuffer`
69
- * * Immediately do the summations of the basis values times the respective control points
107
+ * * Evaluations are stored in the preallocated `this.basisBuffer`.
108
+ * * Immediately do the summations of the basis values times the respective poles.
70
109
  * * Summations are stored in the preallocated `this.poleBuffer`
71
110
  * */
72
111
  evaluateBuffersInSpan(spanIndex: number, spanFraction: number): void;
73
112
  /**
74
113
  * * Evaluate the basis functions and one derivative at spanIndex and fraction.
75
- * * Evaluations are stored in the preallocated `this.basisBuffer`
76
- * * Immediately do the summations of the basis values times the respective control points
114
+ * * Function evaluations are stored in the preallocated `this.basisBuffer`; derivative evaluations in `this.basisBuffer1`.
115
+ * * Immediately do the summations of the basis values times the respective poles.
77
116
  * * Summations are stored in the preallocated `this.poleBuffer` and `this.poleBuffer1`
78
117
  * */
79
118
  evaluateBuffersInSpan1(spanIndex: number, spanFraction: number): void;
80
- /** sum poles in `poleBuffer` at span `spanIndex` by the weights in the `basisBuffer` */
81
- sumPoleBufferForSpan(spanIndex: number): void;
82
- /** sum poles in `poleBuffer1` at span `spanIndex` by the weights in the `basisBuffer1`, i.e. form first derivatives */
83
- sumPoleBuffer1ForSpan(spanIndex: number): void;
84
- /** sum poles in `poleBuffer2` at span `spanIndex` by the weights in the `basisBuffer2`, i.e. form second derivatives */
85
- sumPoleBuffer2ForSpan(spanIndex: number): void;
86
- /** Evaluate the function values and 1 or 2 derivatives into `this.poleBuffer`, `this.poleBuffer1` and `this.poleBuffer2` */
87
- evaluateBuffersAtKnot(u: number, numDerivative?: number): void;
88
119
  /**
89
- * Reverse the (blocked) poles (in `this.packedData` in place.
120
+ * Evaluate the B-spline function and optional derivatives at the given parameter in knot space.
121
+ * * Function value is stored in `poleBuffer`; optional derivative vectors in `poleBuffer1` and `poleBuffer2`.
90
122
  */
123
+ evaluateBuffersAtKnot(u: number, numDerivative?: number): void;
124
+ /** Reverse the instance poles and knots in place. */
91
125
  reverseInPlace(): void;
92
126
  /**
93
- * Test if the leading and trailing polygon coordinates are replicated in the manner of a "closed" bspline polygon which has been expanded
94
- * to act as a normal bspline.
95
- * @returns true if `degree` leading and trailing polygon blocks match
96
- * @deprecated in 4.x. Use testClosablePolygon instead.
127
+ * Test if the leading and trailing polygon coordinates are replicated in the manner of a "closed" bspline polygon
128
+ * which has been expanded to act as a normal bspline.
129
+ * @returns true if `degree` leading and trailing polygon blocks match.
130
+ * @deprecated in 4.x. Use `testClosablePolygon` instead.
97
131
  */
98
132
  testCloseablePolygon(mode?: BSplineWrapMode): boolean;
99
133
  /**
100
- * Test if the leading and trailing polygon coordinates are replicated in the manner of a "closed" bspline polygon which has been expanded
101
- * to act as a normal bspline.
102
- * @returns true if `degree` leading and trailing polygon blocks match
134
+ * Test if the leading and trailing poles are replicated in the manner of a "closed" B-spline function with wraparound
135
+ * control polygon.
136
+ * @param mode wrap mode, indicating the number of wraparound poles to check. If undefined, `knots.wrappable` is used.
137
+ * @returns true if the expected leading and trailing poles match, according to `mode`.
103
138
  */
104
139
  testClosablePolygon(mode?: BSplineWrapMode): boolean;
105
- /** Insert knot and resulting pole into the instance, optionally multiple times.
106
- * @param knot the knot to be inserted (may already exist in the KnotVector)
107
- * @param totalMultiplicity the total multiplicity of the knot on return
140
+ /**
141
+ * Insert the knot and resulting pole into the instance, optionally multiple times.
142
+ * @param knot the knot to be inserted (may already exist in the KnotVector).
143
+ * @param totalMultiplicity the total multiplicity of the knot on return.
108
144
  */
109
145
  addKnot(knot: number, totalMultiplicity: number): boolean;
110
146
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BSpline1dNd.d.ts","sourceRoot":"","sources":["../../../src/bspline/BSpline1dNd.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE3D;;;;;GAKG;AACH,qBAAa,WAAW;IACtB,2BAA2B;IACpB,KAAK,EAAE,UAAU,CAAC;IACzB,uDAAuD;IAChD,UAAU,EAAE,YAAY,CAAC;IAChC,wEAAwE;IACjE,UAAU,EAAE,MAAM,CAAC;IAC1B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