@itwin/core-geometry 5.11.0-dev.17 → 5.11.0-dev.19
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.
- package/lib/cjs/curve/LineSegment3d.d.ts +1 -2
- package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +1 -2
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.d.ts +1 -2
- package/lib/cjs/geometry3d/BilinearPatch.d.ts.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js +1 -2
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +29 -54
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +30 -55
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +2 -4
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +2 -4
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.d.ts +1 -2
- package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +1 -2
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.d.ts +1 -2
- package/lib/esm/geometry3d/BilinearPatch.d.ts.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js +1 -2
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +29 -54
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +30 -55
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +2 -4
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +2 -4
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/package.json +3 -3
|
@@ -20,8 +20,7 @@ import { StrokeOptions } from "./StrokeOptions";
|
|
|
20
20
|
* * endPoint
|
|
21
21
|
* * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. each of these
|
|
22
22
|
* equivalent forms maps fraction `f` to a point `X(f)`:
|
|
23
|
-
* ```
|
|
24
|
-
* equation
|
|
23
|
+
* ```equation
|
|
25
24
|
* X(f) = P_0 + f*(P_1 - P_0)\newline
|
|
26
25
|
* X(f) = (1-f)*P_0 + f*P_1
|
|
27
26
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineSegment3d.d.ts","sourceRoot":"","sources":["../../../src/curve/LineSegment3d.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAY,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEpF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EAAsB,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAqB,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACxG,OAAO,EAAE,kCAAkC,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAi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,GAAG,SAAS;IAWhD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAG,EAAE,QAAQ,GAAG,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS;CAGvG"}
|
|
@@ -29,8 +29,7 @@ const OffsetOptions_1 = require("./OffsetOptions");
|
|
|
29
29
|
* * endPoint
|
|
30
30
|
* * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. each of these
|
|
31
31
|
* equivalent forms maps fraction `f` to a point `X(f)`:
|
|
32
|
-
* ```
|
|
33
|
-
* equation
|
|
32
|
+
* ```equation
|
|
34
33
|
* X(f) = P_0 + f*(P_1 - P_0)\newline
|
|
35
34
|
* X(f) = (1-f)*P_0 + f*P_1
|
|
36
35
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineSegment3d.js","sourceRoot":"","sources":["../../../src/curve/LineSegment3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,sDAA6C;AAE7C,0CAAgF;AAEhF,uFAAoF;AACpF,mEAAyD;AACzD,mEAAkE;AAClE,+CAAuD;AACvD,+CAA4C;AAE5C,qEAA6D;AAC7D,yDAAsD;AACtD,uDAAoF;AACpF,+DAAwG;AACxG,qDAAsF;AAEtF,4FAAyF;AAEzF,mDAAgD;AAGhD;;;;;;;;;;;;;GAaG;AACH,MAAa,aAAc,SAAQ,+BAAc;IAC/C,wCAAwC;IACxB,kBAAkB,GAAG,aAAa,CAAC;IACnD,kDAAkD;IAC3C,mBAAmB,CAAC,KAAoB;QAC7C,OAAO,KAAK,YAAY,aAAa,CAAC;IACxC,CAAC;IACD,iCAAiC;IACzB,OAAO,CAAU;IACzB,+BAA+B;IACvB,OAAO,CAAU;IACzB;;;OAGG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD;;;OAGG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,O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AC,eAAe,CAAC,SAAS,CAAC,CAAC;QAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QAC/C,IAAI,SAAS,EAAE,CAAC;YACd,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAC1C,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,eAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,CAAC;IACD;;;OAGG;IACa,iBAAiB,CAC/B,uBAA+C;QAE/C,MAAM,SAAS,GAAG,0BAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtE,IAAI,SAAS,CAAC,gBAAgB,EAAE,EAAE,CAAC;YACjC,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;YACnC,MAAM,UAAU,GAAG,6BAAa,CAAC,iBAAiB,CAAC,uBAAuB,CAAC,CAAC;YAC5E,OAAO,aAAa,CAAC,MAAM,CACzB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAC/F,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,qDAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF;AA1dD,sCA0dC","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 Curve\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { Clipper } from \"../clipping/ClipUtils\";\nimport { BeJSONFunctions, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { GeometryHandler, IStrokeHandler } from \"../geometry3d/GeometryHandler\";\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { Order2Bezier } from \"../numerics/BezierPolynomials\";\nimport { SmallSystem } from \"../numerics/SmallSystem\";\nimport { CurveExtendOptions, VariantCurveExtendParameter } from \"./CurveExtendMode\";\nimport { CurveIntervalRole, CurveLocationDetail, CurveLocationDetailPair } from \"./CurveLocationDetail\";\nimport { AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"./CurvePrimitive\";\nimport { GeometryQuery } from \"./GeometryQuery\";\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\nimport { LineString3d } from \"./LineString3d\";\nimport { OffsetOptions } from \"./OffsetOptions\";\nimport { StrokeOptions } from \"./StrokeOptions\";\n\n/**\n * A LineSegment3d is:\n * * A 3d line segment represented by its start and end coordinates\n * * startPoint\n * * endPoint\n * * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. each of these\n * equivalent forms maps fraction `f` to a point `X(f)`:\n * ```\n * equation\n * X(f) = P_0 + f*(P_1 - P_0)\\newline\n * X(f) = (1-f)*P_0 + f*P_1\n * ```\n * @public\n */\nexport class LineSegment3d extends CurvePrimitive implements BeJSONFunctions {\n /** String name for schema properties */\n public readonly curvePrimitiveType = \"lineSegment\";\n /** Test if `other` is of class `LineSegment3d` */\n public isSameGeometryClass(other: GeometryQuery): boolean {\n return other instanceof LineSegment3d;\n }\n /** Start point of the segment */\n private _point0: Point3d;\n /** End point of the segment */\n private _point1: Point3d;\n /**\n * Return REFERENCE to the start point of this segment.\n * * This is distinct from the `CurvePrimitive` abstract method `startPoint()` which creates a returned point.\n */\n public get point0Ref(): Point3d {\n return this._point0;\n }\n /**\n * Return REFERENCE to the end point of this segment.\n * * This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point.\n */\n public get point1Ref(): Point3d {\n return this._point1;\n }\n /** Return a copy of the start and end points in an array. */\n public get points(): Point3d[] {\n return [this._point0.clone(), this._point1.clone()];\n }\n /** A LineSegment3d extends along its infinite line. */\n public override get isExtensibleFractionSpace(): boolean {\n return true;\n }\n /**\n * CAPTURE point references as a `LineSegment3d`\n * @param point0\n * @param point1\n */\n protected constructor(point0: Point3d, point1: Point3d) {\n super();\n this._point0 = point0;\n this._point1 = point1;\n }\n /** Set the start and endpoints by capturing input references. */\n public setRefs(point0: Point3d, point1: Point3d) {\n this._point0 = point0;\n this._point1 = point1;\n }\n /** Set the start and endpoints by cloning the input parameters. */\n public set(point0: Point3d, point1: Point3d) {\n this._point0 = point0.clone();\n this._point1 = point1.clone();\n }\n /** Copy (clone) data from other */\n public setFrom(other: LineSegment3d) {\n this._point0.setFrom(other._point0);\n this._point1.setFrom(other._point1);\n }\n /** Return a (clone of) the start point (This is NOT a reference to the stored start point) */\n public override startPoint(result?: Point3d): Point3d {\n if (result) { result.setFrom(this._point0); return result; }\n return this._point0.clone();\n }\n /** Return a (clone of) the end point (This is NOT a reference to the stored end point) */\n public override endPoint(result?: Point3d): Point3d {\n if (result) { result.setFrom(this._point1); return result; }\n return this._point1.clone();\n }\n /** Return the point and derivative vector at fractional position along the line segment. */\n public fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d {\n result = result ? result : Ray3d.createZero();\n result.direction.setStartEnd(this._point0, this._point1);\n this._point0.interpolate(fraction, this._point1, result.origin);\n return result;\n }\n /**\n * Construct a plane with\n * * origin at the fractional position along the line segment\n * * x axis is the first derivative, i.e. along the line segment\n * * y axis is the second derivative, i.e. 000\n */\n public fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n result = result ? result : Plane3dByOriginAndVectors.createXYPlane();\n result.vectorU.setStartEnd(this._point0, this._point1);\n result.vectorV.set(0, 0, 0);\n this._point0.interpolate(fraction, this._point1, result.origin);\n return result;\n }\n /** Clone the LineSegment3d */\n public clone(): LineSegment3d {\n return LineSegment3d.create(this._point0, this._point1);\n }\n /** Clone and apply transform to the clone. */\n public cloneTransformed(transform: Transform): LineSegment3d { // we know tryTransformInPlace succeeds.\n const c = this.clone();\n c.tryTransformInPlace(transform);\n return c;\n }\n /** Create with start and end points. The point contents are cloned into the LineSegment3d. */\n public static create(point0: Point3d, point1: Point3d, result?: LineSegment3d): LineSegment3d {\n if (result) {\n result.set(point0, point1); // and this will clone them !!\n return result;\n }\n return new LineSegment3d(point0.clone(), point1.clone());\n }\n /** Create with start and end points. The point contents are CAPTURED into the result */\n public static createCapture(point0: Point3d, point1: Point3d): LineSegment3d {\n return new LineSegment3d(point0, point1);\n }\n /**\n * Create a LineSegment3d from xy coordinates of start and end, with common z.\n * @param x0 start point x coordinate.\n * @param y0 start point y coordinate.\n * @param x1 end point x coordinate.\n * @param y1 end point y coordinate.\n * @param z z coordinate to use for both points.\n * @param result optional existing LineSegment to be reinitialized.\n */\n public static createXYXY(x0: number, y0: number, x1: number, y1: number, z: number = 0, result?: LineSegment3d) {\n if (result) {\n result._point0.set(x0, y0, z);\n result._point1.set(x1, y1, z);\n return result;\n }\n return new LineSegment3d(Point3d.create(x0, y0, z), Point3d.create(x1, y1, z));\n }\n /**\n * Create a LineSegment3d from xy coordinates of start and end, with common z.\n * @param x0 start point x coordinate.\n * @param y0 start point y coordinate.\n * @param x1 end point x coordinate.\n * @param y1 end point y coordinate.\n * @param z z coordinate to use for both points.\n * @param result optional existing LineSegment to be reinitialized.\n */\n public static createXYZXYZ(\n x0: number, y0: number, z0: number, x1: number, y1: number, z1: number, result?: LineSegment3d,\n ): LineSegment3d {\n if (result) {\n result._point0.set(x0, y0, z0);\n result._point1.set(x1, y1, z1);\n return result;\n }\n return new LineSegment3d(Point3d.create(x0, y0, z0), Point3d.create(x1, y1, z1));\n }\n /** Return the point at fractional position along the line segment. */\n public fractionToPoint(fraction: number, result?: Point3d): Point3d {\n return this._point0.interpolate(fraction, this._point1, result);\n }\n /** Return the length of the segment. */\n public override curveLength(): number {\n return this._point0.distance(this._point1);\n }\n /** Return the length of the partial segment between fractions. */\n public override curveLengthBetweenFractions(fraction0: number, fraction1: number): number {\n return Math.abs(fraction1 - fraction0) * this._point0.distance(this._point1);\n }\n /** Return the length of the segment. */\n public quickLength(): number {\n return this.curveLength();\n }\n /**\n * Returns a curve location detail with both xyz and fractional coordinates of the closest point.\n * @param spacePoint point in space\n * @param extend if false (default), only return points within the bounded line segment. If true, allow the point to be on\n * the unbounded line that contains the bounded segment.\n * @param result optional pre-allocated object to populate and return\n * @returns detail, with `a` field set to the distance from `spacePoint` to the closest point\n */\n public override closestPoint(\n spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n let fraction = spacePoint.fractionOfProjectionToLine(this._point0, this._point1, 0.0);\n fraction = CurveExtendOptions.correctFraction(extend, fraction);\n result = CurveLocationDetail.create(this, result);\n result.fraction = fraction;\n this._point0.interpolate(fraction, this._point1, result.point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = result.point.distance(spacePoint);\n return result;\n }\n /**\n * Compute the closest approach between a pair of line segments.\n * * The approach distance is returned in the `a` fields of the details.\n * @param segmentA first line segment\n * @param extendA how to extend segmentA forward/backward\n * @param segmentB second line segment\n * @param extendB how to extend segmentB forward/backward\n * @param result optional pre-allocated object to populate and return\n * @returns pair of details, one per segment, each with `a` field set to the closest approach distance\n */\n public static closestApproach(\n segmentA: LineSegment3d,\n extendA: VariantCurveExtendParameter,\n segmentB: LineSegment3d,\n extendB: VariantCurveExtendParameter,\n result?: CurveLocationDetailPair,\n ): CurveLocationDetailPair | undefined {\n const unboundedFractions = Vector2d.create();\n if (result === undefined)\n result = CurveLocationDetailPair.createCapture(CurveLocationDetail.create(), CurveLocationDetail.create());\n if (SmallSystem.lineSegment3dClosestApproachUnbounded(segmentA._point0, segmentA._point1, segmentB._point0, segmentB._point1, unboundedFractions)) {\n // There is a simple approach between the unbounded segments. Maybe its a really easy case ...\n const fractionA = CurveExtendOptions.correctFraction(extendA, unboundedFractions.x);\n const fractionB = CurveExtendOptions.correctFraction(extendB, unboundedFractions.y);\n // if neither fraction was corrected, just accept !!!\n if (fractionA === unboundedFractions.x && fractionB === unboundedFractions.y) {\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, fractionA, result.detailA);\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, fractionB, result.detailB);\n result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);\n return result;\n }\n // One or both of the fractions were clamped back to an endpoint.\n // Claim: (????!!!????) The only proximity candidates that matter are from clamped point onto the other.\n if (fractionA !== unboundedFractions.x && fractionB !== unboundedFractions.y) {\n // Fill in (in the result) both individual details with \"projected\" points and distance.\n // The \"loser\" will have its contents replaced.\n const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;\n const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;\n segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);\n segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);\n if (result.detailA.a <= result.detailB.a) {\n CurveLocationDetail.createCurveFractionPoint(segmentB, fractionB, clampedPointOnB, result.detailB);\n } else {\n CurveLocationDetail.createCurveFractionPoint(segmentA, fractionA, clampedPointOnA, result.detailA);\n }\n } else if (fractionB !== unboundedFractions.y) {\n // B (only) was clamped.\n const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;\n segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);\n result.detailB.setCurve(segmentB);\n result.detailB.point.setFrom(clampedPointOnB);\n result.detailB.fraction = fractionB;\n } else {\n // fractionA was clamped.\n const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;\n segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);\n result.detailA.setCurve(segmentA);\n result.detailA.point.setFrom(clampedPointOnA);\n result.detailA.fraction = fractionA;\n }\n result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);\n return result;\n }\n // (probably? certainly?) parallel (possibly coincident) lines.\n // run all 4 endpoint-to-other cases . . . reassemble carefully ...\n const resultSet = [\n segmentA.closestPoint(segmentB._point0, extendA),\n segmentA.closestPoint(segmentB._point1, extendA),\n segmentB.closestPoint(segmentA._point0, extendB),\n segmentB.closestPoint(segmentA._point1, extendB),\n ];\n let dMin = resultSet[0].a;\n let iMin = 0;\n for (let i = 1; i < 4; i++) {\n if (resultSet[i].a < dMin) {\n iMin = i;\n dMin = resultSet[i].a;\n }\n }\n if (iMin === 0) {\n resultSet[0].clone(result.detailA);\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 0.0, result.detailB);\n result.detailB.a = result.detailA.a;\n } else if (iMin === 1) {\n resultSet[1].clone(result.detailA);\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 1.0, result.detailB);\n result.detailB.a = result.detailA.a;\n } else if (iMin === 2) {\n resultSet[2].clone(result.detailB);\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 0.0, result.detailA);\n result.detailA.a = result.detailB.a;\n } else {\n assert(iMin === 3);\n resultSet[3].clone(result.detailB);\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 1.0, result.detailA);\n result.detailA.a = result.detailB.a;\n }\n return result;\n }\n /** Swap the endpoint references. */\n public reverseInPlace(): void {\n const a = this._point0;\n this._point0 = this._point1;\n this._point1 = a;\n }\n /** Transform the two endpoints of this LinSegment. */\n public tryTransformInPlace(transform: Transform): boolean {\n this._point0 = transform.multiplyPoint3d(this._point0, this._point0);\n this._point1 = transform.multiplyPoint3d(this._point1, this._point1);\n return true;\n }\n /** Test if both endpoints are in a plane (within tolerance) */\n public isInPlane(plane: PlaneAltitudeEvaluator): boolean {\n return Geometry.isSmallMetricDistance(plane.altitude(this._point0))\n && Geometry.isSmallMetricDistance(plane.altitude(this._point1));\n }\n /**\n * Compute points of simple (transverse) with a plane.\n * * Use isInPlane to test if the line segment is completely in the plane.\n */\n public override appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number {\n const h0 = plane.altitude(this._point0);\n const h1 = plane.altitude(this._point1);\n const fraction = Order2Bezier.solveCoffs(h0, h1);\n let numIntersection = 0;\n if (fraction !== undefined) {\n numIntersection++;\n const detail = CurveLocationDetail.createCurveFractionPoint(this, fraction, this.fractionToPoint(fraction));\n detail.intervalRole = CurveIntervalRole.isolated;\n result.push(detail);\n }\n return numIntersection;\n }\n /**\n * Extend a range to include the (optionally transformed) line segment\n * @param range range to extend\n * @param transform optional transform to apply to the end points\n */\n public extendRange(range: Range3d, transform?: Transform): void {\n if (transform) {\n range.extendTransformedPoint(transform, this._point0);\n range.extendTransformedPoint(transform, this._point1);\n } else {\n range.extendPoint(this._point0);\n range.extendPoint(this._point1);\n }\n }\n /**\n * Construct a line from either of these json forms:\n *\n * * object with named start and end:\n * `{startPoint: pointValue, endPoint: pointValue}`\n * * array of two point values:\n * `[pointValue, pointValue]`\n * The point values are any values accepted by the Point3d method setFromJSON.\n * @param json data to parse.\n */\n public setFromJSON(json?: any) {\n if (!json) {\n this._point0.set(0, 0, 0);\n this._point1.set(1, 0, 0);\n return;\n } else if (json.startPoint && json.endPoint) { // {startPoint:json point, endPoint:json point}\n this._point0.setFromJSON(json.startPoint);\n this._point1.setFromJSON(json.endPoint);\n } else if (Array.isArray(json)\n && json.length > 1) { // [json point, json point]\n this._point0.setFromJSON(json[0]);\n this._point1.setFromJSON(json[1]);\n }\n }\n /** A simple line segment's fraction and distance are proportional. */\n public override getFractionToDistanceScale(): number | undefined {\n return this.curveLength();\n }\n /**\n * Place the lineSegment3d start and points in a json object\n * @return {*} [[x,y,z],[x,y,z]]\n */\n public toJSON(): any {\n return [this._point0.toJSON(), this._point1.toJSON()];\n }\n /** Create a new `LineSegment3d` with coordinates from json object. See `setFromJSON` for object layout description. */\n public static fromJSON(json?: any): LineSegment3d {\n const result = new LineSegment3d(Point3d.createZero(), Point3d.create());\n result.setFromJSON(json);\n return result;\n }\n /** Near equality test with `other`. */\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof LineSegment3d) {\n const ls = other;\n return this._point0.isAlmostEqual(ls._point0) && this._point1.isAlmostEqual(ls._point1);\n }\n return false;\n }\n /** Emit strokes to caller-supplied linestring */\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void {\n const numStroke = this.computeStrokeCountForOptions(options);\n dest.appendFractionalStrokePoints(this, numStroke, 0.0, 1.0);\n }\n /** Emit strokes to caller-supplied handler */\n public emitStrokableParts(handler: IStrokeHandler, options?: StrokeOptions): void {\n handler.startCurvePrimitive(this);\n const numStroke = this.computeStrokeCountForOptions(options);\n handler.announceSegmentInterval(this, this._point0, this._point1, numStroke, 0.0, 1.0);\n handler.endCurvePrimitive(this);\n }\n /**\n * Return the stroke count required for given options.\n * @param options StrokeOptions that determine count\n */\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\n let numStroke = 1;\n if (options) {\n if (options.maxEdgeLength)\n numStroke = options.applyMaxEdgeLength(numStroke, this.curveLength());\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\n }\n return numStroke;\n }\n /** Second step of double dispatch: call `handler.handleLineSegment3d(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleLineSegment3d(this);\n }\n /**\n * Find intervals of this curve primitive that are interior to a clipper\n * @param clipper clip structure (e.g. clip planes)\n * @param announce function to be called announcing fractional intervals `announce(fraction0, fraction1, curvePrimitive)`\n */\n public override announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n return clipper.announceClippedSegmentIntervals(\n 0.0, 1.0, this._point0, this._point1,\n announce ? (fraction0: number, fraction1: number) => announce(fraction0, fraction1, this) : undefined,\n );\n }\n /**\n * Return (if possible) a curve primitive which is a portion of this curve.\n * @param fractionA [in] start fraction\n * @param fractionB [in] end fraction\n */\n public override clonePartialCurve(fractionA: number, fractionB: number): LineSegment3d {\n return LineSegment3d.create(this.fractionToPoint(fractionA), this.fractionToPoint(fractionB));\n }\n /**\n * Returns a (high accuracy) range of the curve between fractional positions\n * * Default implementation returns teh range of the curve from clonePartialCurve\n */\n public override rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d {\n // (This is cheap -- don't bother testing for fraction0===fraction1)\n if (!transform) {\n const range = Range3d.create();\n range.extendInterpolated(this._point0, fraction0, this._point1);\n range.extendInterpolated(this._point0, fraction1, this._point1);\n return range;\n }\n const point0 = this.fractionToPoint(fraction0);\n const point1 = this.fractionToPoint(fraction1);\n if (transform) {\n transform.multiplyPoint3d(point0, point0);\n transform.multiplyPoint3d(point1, point1);\n }\n return Range3d.create(point0, point1);\n }\n /**\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object\n */\n public override constructOffsetXY(\n offsetDistanceOrOptions: number | OffsetOptions,\n ): CurvePrimitive | CurvePrimitive[] | undefined {\n const offsetVec = Vector3d.createStartEnd(this._point0, this._point1);\n if (offsetVec.normalizeInPlace()) {\n offsetVec.rotate90CCWXY(offsetVec);\n const offsetDist = OffsetOptions.getOffsetDistance(offsetDistanceOrOptions);\n return LineSegment3d.create(\n this._point0.plusScaled(offsetVec, offsetDist), this._point1.plusScaled(offsetVec, offsetDist),\n );\n }\n return undefined;\n }\n /**\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of\n * projection.\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\n * @param lowHigh optional receiver for output\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\n * end of the ray.\n */\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"LineSegment3d.js","sourceRoot":"","sources":["../../../src/curve/LineSegment3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,sDAA6C;AAE7C,0CAAgF;AAEhF,uFAAoF;AACpF,mEAAyD;AACzD,mEAAkE;AAClE,+CAAuD;AACvD,+CAA4C;AAE5C,qEAA6D;AAC7D,yDAAsD;AACtD,uDAAoF;AACpF,+DAAwG;AACxG,qDAAsF;AAEtF,4FAAyF;AAEzF,mDAAgD;AAGhD;;;;;;;;;;;;GAYG;AACH,MAAa,aAAc,SAAQ,+BAAc;IAC/C,wCAAwC;IACxB,kBAAkB,GAAG,aAAa,CAAC;IACnD,kDAAkD;IAC3C,mBAAmB,CAAC,KAAoB;QAC7C,OAAO,KAAK,YAAY,aAAa,CAAC;IACxC,CAAC;IACD,iCAAiC;IACzB,OAAO,CAAU;IACzB,+BAA+B;IACvB,OAAO,CAAU;IACzB;;;OAGG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD;;;OAGG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,6DAA6D;IAC7D,IAAW,MAAM;QACf,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IACtD,CAAC;IACD,uDAAuD;IACvD,IAAoB,yBAAyB;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IACD;;;;OAIG;IACH,YAAsB,MAAe,EAAE,MAAe;QACpD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OA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xC,CAAC;IACD;;;OAGG;IACa,iBAAiB,CAC/B,uBAA+C;QAE/C,MAAM,SAAS,GAAG,0BAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtE,IAAI,SAAS,CAAC,gBAAgB,EAAE,EAAE,CAAC;YACjC,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;YACnC,MAAM,UAAU,GAAG,6BAAa,CAAC,iBAAiB,CAAC,uBAAuB,CAAC,CAAC;YAC5E,OAAO,aAAa,CAAC,MAAM,CACzB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAC/F,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,qDAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF;AA1dD,sCA0dC","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 Curve\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { Clipper } from \"../clipping/ClipUtils\";\nimport { BeJSONFunctions, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { GeometryHandler, IStrokeHandler } from \"../geometry3d/GeometryHandler\";\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { Order2Bezier } from \"../numerics/BezierPolynomials\";\nimport { SmallSystem } from \"../numerics/SmallSystem\";\nimport { CurveExtendOptions, VariantCurveExtendParameter } from \"./CurveExtendMode\";\nimport { CurveIntervalRole, CurveLocationDetail, CurveLocationDetailPair } from \"./CurveLocationDetail\";\nimport { AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"./CurvePrimitive\";\nimport { GeometryQuery } from \"./GeometryQuery\";\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\nimport { LineString3d } from \"./LineString3d\";\nimport { OffsetOptions } from \"./OffsetOptions\";\nimport { StrokeOptions } from \"./StrokeOptions\";\n\n/**\n * A LineSegment3d is:\n * * A 3d line segment represented by its start and end coordinates\n * * startPoint\n * * endPoint\n * * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. each of these\n * equivalent forms maps fraction `f` to a point `X(f)`:\n * ```equation\n * X(f) = P_0 + f*(P_1 - P_0)\\newline\n * X(f) = (1-f)*P_0 + f*P_1\n * ```\n * @public\n */\nexport class LineSegment3d extends CurvePrimitive implements BeJSONFunctions {\n /** String name for schema properties */\n public readonly curvePrimitiveType = \"lineSegment\";\n /** Test if `other` is of class `LineSegment3d` */\n public isSameGeometryClass(other: GeometryQuery): boolean {\n return other instanceof LineSegment3d;\n }\n /** Start point of the segment */\n private _point0: Point3d;\n /** End point of the segment */\n private _point1: Point3d;\n /**\n * Return REFERENCE to the start point of this segment.\n * * This is distinct from the `CurvePrimitive` abstract method `startPoint()` which creates a returned point.\n */\n public get point0Ref(): Point3d {\n return this._point0;\n }\n /**\n * Return REFERENCE to the end point of this segment.\n * * This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point.\n */\n public get point1Ref(): Point3d {\n return this._point1;\n }\n /** Return a copy of the start and end points in an array. */\n public get points(): Point3d[] {\n return [this._point0.clone(), this._point1.clone()];\n }\n /** A LineSegment3d extends along its infinite line. */\n public override get isExtensibleFractionSpace(): boolean {\n return true;\n }\n /**\n * CAPTURE point references as a `LineSegment3d`\n * @param point0\n * @param point1\n */\n protected constructor(point0: Point3d, point1: Point3d) {\n super();\n this._point0 = point0;\n this._point1 = point1;\n }\n /** Set the start and endpoints by capturing input references. */\n public setRefs(point0: Point3d, point1: Point3d) {\n this._point0 = point0;\n this._point1 = point1;\n }\n /** Set the start and endpoints by cloning the input parameters. */\n public set(point0: Point3d, point1: Point3d) {\n this._point0 = point0.clone();\n this._point1 = point1.clone();\n }\n /** Copy (clone) data from other */\n public setFrom(other: LineSegment3d) {\n this._point0.setFrom(other._point0);\n this._point1.setFrom(other._point1);\n }\n /** Return a (clone of) the start point (This is NOT a reference to the stored start point) */\n public override startPoint(result?: Point3d): Point3d {\n if (result) { result.setFrom(this._point0); return result; }\n return this._point0.clone();\n }\n /** Return a (clone of) the end point (This is NOT a reference to the stored end point) */\n public override endPoint(result?: Point3d): Point3d {\n if (result) { result.setFrom(this._point1); return result; }\n return this._point1.clone();\n }\n /** Return the point and derivative vector at fractional position along the line segment. */\n public fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d {\n result = result ? result : Ray3d.createZero();\n result.direction.setStartEnd(this._point0, this._point1);\n this._point0.interpolate(fraction, this._point1, result.origin);\n return result;\n }\n /**\n * Construct a plane with\n * * origin at the fractional position along the line segment\n * * x axis is the first derivative, i.e. along the line segment\n * * y axis is the second derivative, i.e. 000\n */\n public fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n result = result ? result : Plane3dByOriginAndVectors.createXYPlane();\n result.vectorU.setStartEnd(this._point0, this._point1);\n result.vectorV.set(0, 0, 0);\n this._point0.interpolate(fraction, this._point1, result.origin);\n return result;\n }\n /** Clone the LineSegment3d */\n public clone(): LineSegment3d {\n return LineSegment3d.create(this._point0, this._point1);\n }\n /** Clone and apply transform to the clone. */\n public cloneTransformed(transform: Transform): LineSegment3d { // we know tryTransformInPlace succeeds.\n const c = this.clone();\n c.tryTransformInPlace(transform);\n return c;\n }\n /** Create with start and end points. The point contents are cloned into the LineSegment3d. */\n public static create(point0: Point3d, point1: Point3d, result?: LineSegment3d): LineSegment3d {\n if (result) {\n result.set(point0, point1); // and this will clone them !!\n return result;\n }\n return new LineSegment3d(point0.clone(), point1.clone());\n }\n /** Create with start and end points. The point contents are CAPTURED into the result */\n public static createCapture(point0: Point3d, point1: Point3d): LineSegment3d {\n return new LineSegment3d(point0, point1);\n }\n /**\n * Create a LineSegment3d from xy coordinates of start and end, with common z.\n * @param x0 start point x coordinate.\n * @param y0 start point y coordinate.\n * @param x1 end point x coordinate.\n * @param y1 end point y coordinate.\n * @param z z coordinate to use for both points.\n * @param result optional existing LineSegment to be reinitialized.\n */\n public static createXYXY(x0: number, y0: number, x1: number, y1: number, z: number = 0, result?: LineSegment3d) {\n if (result) {\n result._point0.set(x0, y0, z);\n result._point1.set(x1, y1, z);\n return result;\n }\n return new LineSegment3d(Point3d.create(x0, y0, z), Point3d.create(x1, y1, z));\n }\n /**\n * Create a LineSegment3d from xy coordinates of start and end, with common z.\n * @param x0 start point x coordinate.\n * @param y0 start point y coordinate.\n * @param x1 end point x coordinate.\n * @param y1 end point y coordinate.\n * @param z z coordinate to use for both points.\n * @param result optional existing LineSegment to be reinitialized.\n */\n public static createXYZXYZ(\n x0: number, y0: number, z0: number, x1: number, y1: number, z1: number, result?: LineSegment3d,\n ): LineSegment3d {\n if (result) {\n result._point0.set(x0, y0, z0);\n result._point1.set(x1, y1, z1);\n return result;\n }\n return new LineSegment3d(Point3d.create(x0, y0, z0), Point3d.create(x1, y1, z1));\n }\n /** Return the point at fractional position along the line segment. */\n public fractionToPoint(fraction: number, result?: Point3d): Point3d {\n return this._point0.interpolate(fraction, this._point1, result);\n }\n /** Return the length of the segment. */\n public override curveLength(): number {\n return this._point0.distance(this._point1);\n }\n /** Return the length of the partial segment between fractions. */\n public override curveLengthBetweenFractions(fraction0: number, fraction1: number): number {\n return Math.abs(fraction1 - fraction0) * this._point0.distance(this._point1);\n }\n /** Return the length of the segment. */\n public quickLength(): number {\n return this.curveLength();\n }\n /**\n * Returns a curve location detail with both xyz and fractional coordinates of the closest point.\n * @param spacePoint point in space\n * @param extend if false (default), only return points within the bounded line segment. If true, allow the point to be on\n * the unbounded line that contains the bounded segment.\n * @param result optional pre-allocated object to populate and return\n * @returns detail, with `a` field set to the distance from `spacePoint` to the closest point\n */\n public override closestPoint(\n spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n let fraction = spacePoint.fractionOfProjectionToLine(this._point0, this._point1, 0.0);\n fraction = CurveExtendOptions.correctFraction(extend, fraction);\n result = CurveLocationDetail.create(this, result);\n result.fraction = fraction;\n this._point0.interpolate(fraction, this._point1, result.point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = result.point.distance(spacePoint);\n return result;\n }\n /**\n * Compute the closest approach between a pair of line segments.\n * * The approach distance is returned in the `a` fields of the details.\n * @param segmentA first line segment\n * @param extendA how to extend segmentA forward/backward\n * @param segmentB second line segment\n * @param extendB how to extend segmentB forward/backward\n * @param result optional pre-allocated object to populate and return\n * @returns pair of details, one per segment, each with `a` field set to the closest approach distance\n */\n public static closestApproach(\n segmentA: LineSegment3d,\n extendA: VariantCurveExtendParameter,\n segmentB: LineSegment3d,\n extendB: VariantCurveExtendParameter,\n result?: CurveLocationDetailPair,\n ): CurveLocationDetailPair | undefined {\n const unboundedFractions = Vector2d.create();\n if (result === undefined)\n result = CurveLocationDetailPair.createCapture(CurveLocationDetail.create(), CurveLocationDetail.create());\n if (SmallSystem.lineSegment3dClosestApproachUnbounded(segmentA._point0, segmentA._point1, segmentB._point0, segmentB._point1, unboundedFractions)) {\n // There is a simple approach between the unbounded segments. Maybe its a really easy case ...\n const fractionA = CurveExtendOptions.correctFraction(extendA, unboundedFractions.x);\n const fractionB = CurveExtendOptions.correctFraction(extendB, unboundedFractions.y);\n // if neither fraction was corrected, just accept !!!\n if (fractionA === unboundedFractions.x && fractionB === unboundedFractions.y) {\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, fractionA, result.detailA);\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, fractionB, result.detailB);\n result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);\n return result;\n }\n // One or both of the fractions were clamped back to an endpoint.\n // Claim: (????!!!????) The only proximity candidates that matter are from clamped point onto the other.\n if (fractionA !== unboundedFractions.x && fractionB !== unboundedFractions.y) {\n // Fill in (in the result) both individual details with \"projected\" points and distance.\n // The \"loser\" will have its contents replaced.\n const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;\n const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;\n segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);\n segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);\n if (result.detailA.a <= result.detailB.a) {\n CurveLocationDetail.createCurveFractionPoint(segmentB, fractionB, clampedPointOnB, result.detailB);\n } else {\n CurveLocationDetail.createCurveFractionPoint(segmentA, fractionA, clampedPointOnA, result.detailA);\n }\n } else if (fractionB !== unboundedFractions.y) {\n // B (only) was clamped.\n const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;\n segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);\n result.detailB.setCurve(segmentB);\n result.detailB.point.setFrom(clampedPointOnB);\n result.detailB.fraction = fractionB;\n } else {\n // fractionA was clamped.\n const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;\n segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);\n result.detailA.setCurve(segmentA);\n result.detailA.point.setFrom(clampedPointOnA);\n result.detailA.fraction = fractionA;\n }\n result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);\n return result;\n }\n // (probably? certainly?) parallel (possibly coincident) lines.\n // run all 4 endpoint-to-other cases . . . reassemble carefully ...\n const resultSet = [\n segmentA.closestPoint(segmentB._point0, extendA),\n segmentA.closestPoint(segmentB._point1, extendA),\n segmentB.closestPoint(segmentA._point0, extendB),\n segmentB.closestPoint(segmentA._point1, extendB),\n ];\n let dMin = resultSet[0].a;\n let iMin = 0;\n for (let i = 1; i < 4; i++) {\n if (resultSet[i].a < dMin) {\n iMin = i;\n dMin = resultSet[i].a;\n }\n }\n if (iMin === 0) {\n resultSet[0].clone(result.detailA);\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 0.0, result.detailB);\n result.detailB.a = result.detailA.a;\n } else if (iMin === 1) {\n resultSet[1].clone(result.detailA);\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 1.0, result.detailB);\n result.detailB.a = result.detailA.a;\n } else if (iMin === 2) {\n resultSet[2].clone(result.detailB);\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 0.0, result.detailA);\n result.detailA.a = result.detailB.a;\n } else {\n assert(iMin === 3);\n resultSet[3].clone(result.detailB);\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 1.0, result.detailA);\n result.detailA.a = result.detailB.a;\n }\n return result;\n }\n /** Swap the endpoint references. */\n public reverseInPlace(): void {\n const a = this._point0;\n this._point0 = this._point1;\n this._point1 = a;\n }\n /** Transform the two endpoints of this LinSegment. */\n public tryTransformInPlace(transform: Transform): boolean {\n this._point0 = transform.multiplyPoint3d(this._point0, this._point0);\n this._point1 = transform.multiplyPoint3d(this._point1, this._point1);\n return true;\n }\n /** Test if both endpoints are in a plane (within tolerance) */\n public isInPlane(plane: PlaneAltitudeEvaluator): boolean {\n return Geometry.isSmallMetricDistance(plane.altitude(this._point0))\n && Geometry.isSmallMetricDistance(plane.altitude(this._point1));\n }\n /**\n * Compute points of simple (transverse) with a plane.\n * * Use isInPlane to test if the line segment is completely in the plane.\n */\n public override appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number {\n const h0 = plane.altitude(this._point0);\n const h1 = plane.altitude(this._point1);\n const fraction = Order2Bezier.solveCoffs(h0, h1);\n let numIntersection = 0;\n if (fraction !== undefined) {\n numIntersection++;\n const detail = CurveLocationDetail.createCurveFractionPoint(this, fraction, this.fractionToPoint(fraction));\n detail.intervalRole = CurveIntervalRole.isolated;\n result.push(detail);\n }\n return numIntersection;\n }\n /**\n * Extend a range to include the (optionally transformed) line segment\n * @param range range to extend\n * @param transform optional transform to apply to the end points\n */\n public extendRange(range: Range3d, transform?: Transform): void {\n if (transform) {\n range.extendTransformedPoint(transform, this._point0);\n range.extendTransformedPoint(transform, this._point1);\n } else {\n range.extendPoint(this._point0);\n range.extendPoint(this._point1);\n }\n }\n /**\n * Construct a line from either of these json forms:\n *\n * * object with named start and end:\n * `{startPoint: pointValue, endPoint: pointValue}`\n * * array of two point values:\n * `[pointValue, pointValue]`\n * The point values are any values accepted by the Point3d method setFromJSON.\n * @param json data to parse.\n */\n public setFromJSON(json?: any) {\n if (!json) {\n this._point0.set(0, 0, 0);\n this._point1.set(1, 0, 0);\n return;\n } else if (json.startPoint && json.endPoint) { // {startPoint:json point, endPoint:json point}\n this._point0.setFromJSON(json.startPoint);\n this._point1.setFromJSON(json.endPoint);\n } else if (Array.isArray(json)\n && json.length > 1) { // [json point, json point]\n this._point0.setFromJSON(json[0]);\n this._point1.setFromJSON(json[1]);\n }\n }\n /** A simple line segment's fraction and distance are proportional. */\n public override getFractionToDistanceScale(): number | undefined {\n return this.curveLength();\n }\n /**\n * Place the lineSegment3d start and points in a json object\n * @return {*} [[x,y,z],[x,y,z]]\n */\n public toJSON(): any {\n return [this._point0.toJSON(), this._point1.toJSON()];\n }\n /** Create a new `LineSegment3d` with coordinates from json object. See `setFromJSON` for object layout description. */\n public static fromJSON(json?: any): LineSegment3d {\n const result = new LineSegment3d(Point3d.createZero(), Point3d.create());\n result.setFromJSON(json);\n return result;\n }\n /** Near equality test with `other`. */\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof LineSegment3d) {\n const ls = other;\n return this._point0.isAlmostEqual(ls._point0) && this._point1.isAlmostEqual(ls._point1);\n }\n return false;\n }\n /** Emit strokes to caller-supplied linestring */\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void {\n const numStroke = this.computeStrokeCountForOptions(options);\n dest.appendFractionalStrokePoints(this, numStroke, 0.0, 1.0);\n }\n /** Emit strokes to caller-supplied handler */\n public emitStrokableParts(handler: IStrokeHandler, options?: StrokeOptions): void {\n handler.startCurvePrimitive(this);\n const numStroke = this.computeStrokeCountForOptions(options);\n handler.announceSegmentInterval(this, this._point0, this._point1, numStroke, 0.0, 1.0);\n handler.endCurvePrimitive(this);\n }\n /**\n * Return the stroke count required for given options.\n * @param options StrokeOptions that determine count\n */\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\n let numStroke = 1;\n if (options) {\n if (options.maxEdgeLength)\n numStroke = options.applyMaxEdgeLength(numStroke, this.curveLength());\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\n }\n return numStroke;\n }\n /** Second step of double dispatch: call `handler.handleLineSegment3d(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleLineSegment3d(this);\n }\n /**\n * Find intervals of this curve primitive that are interior to a clipper\n * @param clipper clip structure (e.g. clip planes)\n * @param announce function to be called announcing fractional intervals `announce(fraction0, fraction1, curvePrimitive)`\n */\n public override announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n return clipper.announceClippedSegmentIntervals(\n 0.0, 1.0, this._point0, this._point1,\n announce ? (fraction0: number, fraction1: number) => announce(fraction0, fraction1, this) : undefined,\n );\n }\n /**\n * Return (if possible) a curve primitive which is a portion of this curve.\n * @param fractionA [in] start fraction\n * @param fractionB [in] end fraction\n */\n public override clonePartialCurve(fractionA: number, fractionB: number): LineSegment3d {\n return LineSegment3d.create(this.fractionToPoint(fractionA), this.fractionToPoint(fractionB));\n }\n /**\n * Returns a (high accuracy) range of the curve between fractional positions\n * * Default implementation returns teh range of the curve from clonePartialCurve\n */\n public override rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d {\n // (This is cheap -- don't bother testing for fraction0===fraction1)\n if (!transform) {\n const range = Range3d.create();\n range.extendInterpolated(this._point0, fraction0, this._point1);\n range.extendInterpolated(this._point0, fraction1, this._point1);\n return range;\n }\n const point0 = this.fractionToPoint(fraction0);\n const point1 = this.fractionToPoint(fraction1);\n if (transform) {\n transform.multiplyPoint3d(point0, point0);\n transform.multiplyPoint3d(point1, point1);\n }\n return Range3d.create(point0, point1);\n }\n /**\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object\n */\n public override constructOffsetXY(\n offsetDistanceOrOptions: number | OffsetOptions,\n ): CurvePrimitive | CurvePrimitive[] | undefined {\n const offsetVec = Vector3d.createStartEnd(this._point0, this._point1);\n if (offsetVec.normalizeInPlace()) {\n offsetVec.rotate90CCWXY(offsetVec);\n const offsetDist = OffsetOptions.getOffsetDistance(offsetDistanceOrOptions);\n return LineSegment3d.create(\n this._point0.plusScaled(offsetVec, offsetDist), this._point1.plusScaled(offsetVec, offsetDist),\n );\n }\n return undefined;\n }\n /**\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of\n * projection.\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\n * @param lowHigh optional receiver for output\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\n * end of the ray.\n */\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\n }\n}\n"]}
|
|
@@ -11,8 +11,7 @@ import { Transform } from "./Transform";
|
|
|
11
11
|
/**
|
|
12
12
|
* A bilinear patch is a surface defined by its 4 corner points.
|
|
13
13
|
* * The corner points do not have to be coplanar, but if they are, the quadrilateral should be convex to avoid a self-intersecting surface.
|
|
14
|
-
* ```
|
|
15
|
-
* equation
|
|
14
|
+
* ```equation
|
|
16
15
|
* \begin{matrix}
|
|
17
16
|
* v\text{-direction}\\
|
|
18
17
|
* \uparrow\\
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BilinearPatch.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/BilinearPatch.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,6BAA6B,EAA2B,MAAM,kCAAkC,CAAC;AAI1G,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC
|
|
1
|
+
{"version":3,"file":"BilinearPatch.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/BilinearPatch.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,6BAA6B,EAA2B,MAAM,kCAAkC,CAAC;AAI1G,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,aAAc,YAAW,SAAS;IAC7C,4CAA4C;IACrC,OAAO,EAAE,OAAO,CAAC;IACxB,4CAA4C;IACrC,OAA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AAG,yBAAyB;IAsBxH,iHAAiH;IACjH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAO/B;;;;OAIG;IACI,YAAY,CAAC,GAAG,EAAE,KAAK,GAAG,6BAA6B,EAAE,GAAG,SAAS;IAsC5E,yEAAyE;IAClE,cAAc,IAAI,MAAM;IAG/B,yEAAyE;IAClE,cAAc,IAAI,MAAM;CAGhC"}
|
|
@@ -18,8 +18,7 @@ const Point3dVector3d_1 = require("./Point3dVector3d");
|
|
|
18
18
|
/**
|
|
19
19
|
* A bilinear patch is a surface defined by its 4 corner points.
|
|
20
20
|
* * The corner points do not have to be coplanar, but if they are, the quadrilateral should be convex to avoid a self-intersecting surface.
|
|
21
|
-
* ```
|
|
22
|
-
* equation
|
|
21
|
+
* ```equation
|
|
23
22
|
* \begin{matrix}
|
|
24
23
|
* v\text{-direction}\\
|
|
25
24
|
* \uparrow\\
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BilinearPatch.js","sourceRoot":"","sources":["../../../src/geometry3d/BilinearPatch.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,4EAA0G;AAC1G,sEAAmE;AACnE,0CAAuC;AACvC,yDAAsD;AAEtD,2EAAwE;AACxE,uDAA4C;AAK5C,kCAAkC;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAa,aAAa;IACxB,4CAA4C;IACrC,OAAO,CAAU;IACxB,4CAA4C;IACrC,OAAO,CAAU;IACxB,4CAA4C;IACrC,OAAO,CAAU;IACxB,4CAA4C;IACrC,OAAO,CAAU;IACxB;;;;;;OAMG;IACH,YAAmB,OAAgB,EAAE,OAAgB,EAAE,OAAgB,EAAE,OAAgB;QACvF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OA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AAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACxG,MAAM,KAAK,GAAG,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;gBACrC,MAAM,CAAC,IAAI,CAAC,IAAI,qDAA6B,CAC3C,yCAAmB,CAAC,sBAAsB,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,EACzD,+CAAuB,CAAC,oBAAoB,CAAC,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,CAC/D,CAAC;YACJ,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,yEAAyE;IAClE,cAAc;QACnB,OAAO,mBAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;IACD,yEAAyE;IAClE,cAAc;QACnB,OAAO,mBAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;CACF;AAlMD,sCAkMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Solid\n */\n\nimport { CurveAndSurfaceLocationDetail, UVSurfaceLocationDetail } from \"../bspline/SurfaceLocationDetail\";\nimport { CurveLocationDetail } from \"../curve/CurveLocationDetail\";\nimport { Geometry } from \"../Geometry\";\nimport { SmallSystem } from \"../numerics/SmallSystem\";\nimport { UVSurface } from \"./GeometryHandler\";\nimport { Plane3dByOriginAndVectors } from \"./Plane3dByOriginAndVectors\";\nimport { Point3d } from \"./Point3dVector3d\";\nimport { Range3d } from \"./Range\";\nimport { Ray3d } from \"./Ray3d\";\nimport { Transform } from \"./Transform\";\n\n// cspell:word uparrow, rightarrow\n\n/**\n * A bilinear patch is a surface defined by its 4 corner points.\n * * The corner points do not have to be coplanar, but if they are, the quadrilateral should be convex to avoid a self-intersecting surface.\n * ```\n * equation\n * \\begin{matrix}\n * v\\text{-direction}\\\\\n * \\uparrow\\\\\n * \\text{point01} &\\cdots &\\text{A1} &\\cdots &\\text{point11}\\\\\n * \\vdots &&\\vdots &&\\vdots\\\\\n * \\text{B0} &\\cdots &\\text{X} &\\cdots &\\text{B1}\\\\\n * \\vdots &&\\vdots &&\\vdots\\\\\n * \\text{point00} &\\cdots &\\text{A0} &\\cdots &\\text{point10} &\\rightarrow~u\\text{-direction}\n * \\end{matrix}\n * ```\n * * To evaluate the point at (u,v), the following are equivalent:\n * * interpolate first with u then with v:\n * * A0 = interpolate between point00 and point10 at fraction u\n * * A1 = interpolate between point01 and point11 at fraction u\n * * X = interpolate between A0 and A1 at fraction v\n * * interpolate first with v then with u:\n * * B0 = interpolate between point00 and point01 at fraction v\n * * B1 = interpolate between point10 and point11 at fraction v\n * * X = interpolate between B0 and B1 at fraction u\n * * sum all at once:\n * * X = (1-u)(1-v)point00 + (1-u)(v)point01 + (u)(1-v)point10 + (u)(v)point11\n * @public\n */\nexport class BilinearPatch implements UVSurface {\n /** corner at parametric coordinate (0,0) */\n public point00: Point3d;\n /** corner at parametric coordinate (1,0) */\n public point10: Point3d;\n /** corner at parametric coordinate (0,1) */\n public point01: Point3d;\n /** corner at parametric coordinate (1,1) */\n public point11: Point3d;\n /**\n * Capture (not clone) corners to create a new BilinearPatch.\n * @param point00 Point at uv=0,0\n * @param point10 Point at uv=1,0\n * @param point10 Point at uv=0,1\n * @param point11 Point at uv=1,1\n */\n public constructor(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\n this.point00 = point00;\n this.point10 = point10;\n this.point01 = point01;\n this.point11 = point11;\n }\n /**\n * Clone (not capture) corners to create a new BilinearPatch.\n * @param point00 Point at uv=0,0\n * @param point10 Point at uv=1,0\n * @param point10 Point at uv=0,1\n * @param point11 Point at uv=1,1\n */\n public static create(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\n return new BilinearPatch(point00.clone(), point10.clone(), point01.clone(), point11.clone());\n }\n /** Create a patch from xyz values of the 4 corners. */\n public static createXYZ(\n x00: number, y00: number, z00: number,\n x10: number, y10: number, z10: number,\n x01: number, y01: number, z01: number,\n x11: number, y11: number, z11: number,\n ) {\n return new BilinearPatch(\n Point3d.create(x00, y00, z00),\n Point3d.create(x10, y10, z10),\n Point3d.create(x01, y01, z01),\n Point3d.create(x11, y11, z11),\n );\n }\n /** Return a cloned patch. */\n public clone(): BilinearPatch {\n return new BilinearPatch(\n this.point00.clone(),\n this.point10.clone(),\n this.point01.clone(),\n this.point11.clone(),\n );\n }\n /** Test equality of the 4 points. */\n public isAlmostEqual(other: BilinearPatch): boolean {\n return this.point00.isAlmostEqual(other.point00)\n && this.point10.isAlmostEqual(other.point10)\n && this.point01.isAlmostEqual(other.point01)\n && this.point11.isAlmostEqual(other.point11);\n }\n /** Apply the transform to each point. */\n public tryTransformInPlace(transform: Transform): boolean {\n transform.multiplyPoint3d(this.point00, this.point00);\n transform.multiplyPoint3d(this.point10, this.point10);\n transform.multiplyPoint3d(this.point01, this.point01);\n transform.multiplyPoint3d(this.point11, this.point11);\n return true;\n }\n /** Return a cloned and transformed patch. */\n public cloneTransformed(transform: Transform): BilinearPatch | undefined {\n const result = this.clone();\n result.tryTransformInPlace(transform);\n return result;\n }\n /** Extend a range by the range of the (optionally transformed) patch. */\n public extendRange(range: Range3d, transform?: Transform) {\n if (transform) {\n range.extendTransformedPoint(transform, this.point00);\n range.extendTransformedPoint(transform, this.point10);\n range.extendTransformedPoint(transform, this.point01);\n range.extendTransformedPoint(transform, this.point11);\n } else {\n range.extendPoint(this.point00);\n range.extendPoint(this.point10);\n range.extendPoint(this.point01);\n range.extendPoint(this.point11);\n }\n }\n /**\n * Convert fractional u and v coordinates to surface point\n * @param u fractional coordinate in u direction\n * @param v fractional coordinate in v direction\n * @param result optional pre-allocated point\n */\n public uvFractionToPoint(u: number, v: number, result?: Point3d): Point3d {\n const f00 = (1.0 - u) * (1.0 - v);\n const f10 = u * (1.0 - v);\n const f01 = (1.0 - u) * v;\n const f11 = u * v;\n return Point3d.create(\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\n result,\n );\n }\n /** Evaluate as a uv surface, returning point and two derivative vectors.\n * @param u fractional coordinate in u direction\n * @param v fractional coordinate in v direction\n * @param result optional pre-allocated carrier for point and vectors\n */\n public uvFractionToPointAndTangents(u: number, v: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n const u0 = 1.0 - u;\n const v0 = 1.0 - v;\n const f00 = u0 * v0;\n const f10 = u * v0;\n const f01 = u0 * v;\n const f11 = u * v;\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\n // u derivative ..\n v0 * (this.point10.x - this.point00.x) + v * (this.point11.x - this.point01.x),\n v0 * (this.point10.y - this.point00.y) + v * (this.point11.y - this.point01.y),\n v0 * (this.point10.z - this.point00.z) + v * (this.point11.z - this.point01.z),\n // v derivative ..\n u0 * (this.point01.x - this.point00.x) + u * (this.point11.x - this.point10.x),\n u0 * (this.point01.y - this.point00.y) + u * (this.point11.y - this.point10.y),\n u0 * (this.point01.z - this.point00.z) + u * (this.point11.z - this.point10.z),\n result,\n );\n }\n /** If data[iB][pivotColumn] is larger in absolute value than data[iA][pivotColumn], then swap rows iA and iB. */\n private static conditionalPivot(pivotColumn: number, data: Float64Array[], iA: number, iB: number) {\n if (Math.abs(data[iB][pivotColumn]) > Math.abs(data[iA][pivotColumn])) {\n const q = data[iA];\n data[iA] = data[iB];\n data[iB] = q;\n }\n }\n /**\n * Compute the points of intersection with a ray.\n * @param ray ray in space\n * @returns 1 or 2 points if there are intersections, undefined if no intersections\n */\n public intersectRay(ray: Ray3d): CurveAndSurfaceLocationDetail[] | undefined {\n const vectorU = this.point10.minus(this.point00);\n const vectorV = this.point01.minus(this.point00);\n const vectorW = this.point11.minus(this.point10);\n vectorW.subtractInPlace(vectorV);\n // We seek t, u, v such that:\n // `ray.origin + t*ray.direction = point00 + u*vectorU + v*vectorV + u*v*vectorW`\n // For typical direction as x, the scalar equation with coefficient order for arrays is:\n // `0 = -t*ray.direction.x + (point00.x - ray.origin.x) + u*vectorU.x + v*vectorV.x + u*v*vectorW.x`\n // and this particular equation is invoked to compute t when u and v are known.\n const coffs = [\n new Float64Array([-ray.direction.x, this.point00.x - ray.origin.x, vectorU.x, vectorV.x, vectorW.x]),\n new Float64Array([-ray.direction.y, this.point00.y - ray.origin.y, vectorU.y, vectorV.y, vectorW.y]),\n new Float64Array([-ray.direction.z, this.point00.z - ray.origin.z, vectorU.z, vectorV.z, vectorW.z]),\n ];\n // swap rows so that the equation with largest ray.direction coefficient is first.\n BilinearPatch.conditionalPivot(0, coffs, 0, 1);\n BilinearPatch.conditionalPivot(0, coffs, 0, 2);\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[1], -1.0);\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[2], -1.0);\n const uvArray = SmallSystem.solveBilinearPair(\n coffs[1][1], coffs[1][2], coffs[1][3], coffs[1][4],\n coffs[2][1], coffs[2][2], coffs[2][3], coffs[2][4],\n );\n if (uvArray) {\n const result: CurveAndSurfaceLocationDetail[] = [];\n for (const uv of uvArray) {\n const t = -(coffs[0][1] + coffs[0][2] * uv.x + (coffs[0][3] + coffs[0][4] * uv.x) * uv.y) / coffs[0][0];\n const point = ray.fractionToPoint(t);\n result.push(new CurveAndSurfaceLocationDetail(\n CurveLocationDetail.createRayFractionPoint(ray, t, point),\n UVSurfaceLocationDetail.createSurfaceUVPoint(this, uv, point)),\n );\n }\n return result;\n }\n return undefined;\n }\n /** Returns the larger of the u-direction edge lengths at v=0 and v=1. */\n public maxUEdgeLength(): number {\n return Geometry.maxXY(this.point00.distance(this.point10), this.point01.distance(this.point11));\n }\n /** Returns the larger of the v-direction edge lengths at u=0 and u=1. */\n public maxVEdgeLength(): number {\n return Geometry.maxXY(this.point00.distance(this.point01), this.point10.distance(this.point11));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"BilinearPatch.js","sourceRoot":"","sources":["../../../src/geometry3d/BilinearPatch.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,4EAA0G;AAC1G,sEAAmE;AACnE,0CAAuC;AACvC,yDAAsD;AAEtD,2EAAwE;AACxE,uDAA4C;AAK5C,kCAAkC;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAa,aAAa;IACxB,4CAA4C;IACrC,OAAO,CAAU;IACxB,4CAA4C;IACrC,OAAO,CAAU;IACxB,4CAA4C;IACrC,OAAO,CAAU;IACxB,4CAA4C;IACrC,OAAO,CAAU;IACxB;;;;;;OAMG;IACH,YAAmB,OAAgB,EAAE,OAAgB,EAAE,OAAgB,EAAE,OAAgB;QACvF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,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,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACxG,MAAM,KAAK,GAAG,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;gBACrC,MAAM,CAAC,IAAI,CAAC,IAAI,qDAA6B,CAC3C,yCAAmB,CAAC,sBAAsB,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,EACzD,+CAAuB,CAAC,oBAAoB,CAAC,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,CAC/D,CAAC;YACJ,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,yEAAyE;IAClE,cAAc;QACnB,OAAO,mBAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;IACD,yEAAyE;IAClE,cAAc;QACnB,OAAO,mBAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;CACF;AAlMD,sCAkMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Solid\n */\n\nimport { CurveAndSurfaceLocationDetail, UVSurfaceLocationDetail } from \"../bspline/SurfaceLocationDetail\";\nimport { CurveLocationDetail } from \"../curve/CurveLocationDetail\";\nimport { Geometry } from \"../Geometry\";\nimport { SmallSystem } from \"../numerics/SmallSystem\";\nimport { UVSurface } from \"./GeometryHandler\";\nimport { Plane3dByOriginAndVectors } from \"./Plane3dByOriginAndVectors\";\nimport { Point3d } from \"./Point3dVector3d\";\nimport { Range3d } from \"./Range\";\nimport { Ray3d } from \"./Ray3d\";\nimport { Transform } from \"./Transform\";\n\n// cspell:word uparrow, rightarrow\n\n/**\n * A bilinear patch is a surface defined by its 4 corner points.\n * * The corner points do not have to be coplanar, but if they are, the quadrilateral should be convex to avoid a self-intersecting surface.\n * ```equation\n * \\begin{matrix}\n * v\\text{-direction}\\\\\n * \\uparrow\\\\\n * \\text{point01} &\\cdots &\\text{A1} &\\cdots &\\text{point11}\\\\\n * \\vdots &&\\vdots &&\\vdots\\\\\n * \\text{B0} &\\cdots &\\text{X} &\\cdots &\\text{B1}\\\\\n * \\vdots &&\\vdots &&\\vdots\\\\\n * \\text{point00} &\\cdots &\\text{A0} &\\cdots &\\text{point10} &\\rightarrow~u\\text{-direction}\n * \\end{matrix}\n * ```\n * * To evaluate the point at (u,v), the following are equivalent:\n * * interpolate first with u then with v:\n * * A0 = interpolate between point00 and point10 at fraction u\n * * A1 = interpolate between point01 and point11 at fraction u\n * * X = interpolate between A0 and A1 at fraction v\n * * interpolate first with v then with u:\n * * B0 = interpolate between point00 and point01 at fraction v\n * * B1 = interpolate between point10 and point11 at fraction v\n * * X = interpolate between B0 and B1 at fraction u\n * * sum all at once:\n * * X = (1-u)(1-v)point00 + (1-u)(v)point01 + (u)(1-v)point10 + (u)(v)point11\n * @public\n */\nexport class BilinearPatch implements UVSurface {\n /** corner at parametric coordinate (0,0) */\n public point00: Point3d;\n /** corner at parametric coordinate (1,0) */\n public point10: Point3d;\n /** corner at parametric coordinate (0,1) */\n public point01: Point3d;\n /** corner at parametric coordinate (1,1) */\n public point11: Point3d;\n /**\n * Capture (not clone) corners to create a new BilinearPatch.\n * @param point00 Point at uv=0,0\n * @param point10 Point at uv=1,0\n * @param point10 Point at uv=0,1\n * @param point11 Point at uv=1,1\n */\n public constructor(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\n this.point00 = point00;\n this.point10 = point10;\n this.point01 = point01;\n this.point11 = point11;\n }\n /**\n * Clone (not capture) corners to create a new BilinearPatch.\n * @param point00 Point at uv=0,0\n * @param point10 Point at uv=1,0\n * @param point10 Point at uv=0,1\n * @param point11 Point at uv=1,1\n */\n public static create(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\n return new BilinearPatch(point00.clone(), point10.clone(), point01.clone(), point11.clone());\n }\n /** Create a patch from xyz values of the 4 corners. */\n public static createXYZ(\n x00: number, y00: number, z00: number,\n x10: number, y10: number, z10: number,\n x01: number, y01: number, z01: number,\n x11: number, y11: number, z11: number,\n ) {\n return new BilinearPatch(\n Point3d.create(x00, y00, z00),\n Point3d.create(x10, y10, z10),\n Point3d.create(x01, y01, z01),\n Point3d.create(x11, y11, z11),\n );\n }\n /** Return a cloned patch. */\n public clone(): BilinearPatch {\n return new BilinearPatch(\n this.point00.clone(),\n this.point10.clone(),\n this.point01.clone(),\n this.point11.clone(),\n );\n }\n /** Test equality of the 4 points. */\n public isAlmostEqual(other: BilinearPatch): boolean {\n return this.point00.isAlmostEqual(other.point00)\n && this.point10.isAlmostEqual(other.point10)\n && this.point01.isAlmostEqual(other.point01)\n && this.point11.isAlmostEqual(other.point11);\n }\n /** Apply the transform to each point. */\n public tryTransformInPlace(transform: Transform): boolean {\n transform.multiplyPoint3d(this.point00, this.point00);\n transform.multiplyPoint3d(this.point10, this.point10);\n transform.multiplyPoint3d(this.point01, this.point01);\n transform.multiplyPoint3d(this.point11, this.point11);\n return true;\n }\n /** Return a cloned and transformed patch. */\n public cloneTransformed(transform: Transform): BilinearPatch | undefined {\n const result = this.clone();\n result.tryTransformInPlace(transform);\n return result;\n }\n /** Extend a range by the range of the (optionally transformed) patch. */\n public extendRange(range: Range3d, transform?: Transform) {\n if (transform) {\n range.extendTransformedPoint(transform, this.point00);\n range.extendTransformedPoint(transform, this.point10);\n range.extendTransformedPoint(transform, this.point01);\n range.extendTransformedPoint(transform, this.point11);\n } else {\n range.extendPoint(this.point00);\n range.extendPoint(this.point10);\n range.extendPoint(this.point01);\n range.extendPoint(this.point11);\n }\n }\n /**\n * Convert fractional u and v coordinates to surface point\n * @param u fractional coordinate in u direction\n * @param v fractional coordinate in v direction\n * @param result optional pre-allocated point\n */\n public uvFractionToPoint(u: number, v: number, result?: Point3d): Point3d {\n const f00 = (1.0 - u) * (1.0 - v);\n const f10 = u * (1.0 - v);\n const f01 = (1.0 - u) * v;\n const f11 = u * v;\n return Point3d.create(\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\n result,\n );\n }\n /** Evaluate as a uv surface, returning point and two derivative vectors.\n * @param u fractional coordinate in u direction\n * @param v fractional coordinate in v direction\n * @param result optional pre-allocated carrier for point and vectors\n */\n public uvFractionToPointAndTangents(u: number, v: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n const u0 = 1.0 - u;\n const v0 = 1.0 - v;\n const f00 = u0 * v0;\n const f10 = u * v0;\n const f01 = u0 * v;\n const f11 = u * v;\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\n // u derivative ..\n v0 * (this.point10.x - this.point00.x) + v * (this.point11.x - this.point01.x),\n v0 * (this.point10.y - this.point00.y) + v * (this.point11.y - this.point01.y),\n v0 * (this.point10.z - this.point00.z) + v * (this.point11.z - this.point01.z),\n // v derivative ..\n u0 * (this.point01.x - this.point00.x) + u * (this.point11.x - this.point10.x),\n u0 * (this.point01.y - this.point00.y) + u * (this.point11.y - this.point10.y),\n u0 * (this.point01.z - this.point00.z) + u * (this.point11.z - this.point10.z),\n result,\n );\n }\n /** If data[iB][pivotColumn] is larger in absolute value than data[iA][pivotColumn], then swap rows iA and iB. */\n private static conditionalPivot(pivotColumn: number, data: Float64Array[], iA: number, iB: number) {\n if (Math.abs(data[iB][pivotColumn]) > Math.abs(data[iA][pivotColumn])) {\n const q = data[iA];\n data[iA] = data[iB];\n data[iB] = q;\n }\n }\n /**\n * Compute the points of intersection with a ray.\n * @param ray ray in space\n * @returns 1 or 2 points if there are intersections, undefined if no intersections\n */\n public intersectRay(ray: Ray3d): CurveAndSurfaceLocationDetail[] | undefined {\n const vectorU = this.point10.minus(this.point00);\n const vectorV = this.point01.minus(this.point00);\n const vectorW = this.point11.minus(this.point10);\n vectorW.subtractInPlace(vectorV);\n // We seek t, u, v such that:\n // `ray.origin + t*ray.direction = point00 + u*vectorU + v*vectorV + u*v*vectorW`\n // For typical direction as x, the scalar equation with coefficient order for arrays is:\n // `0 = -t*ray.direction.x + (point00.x - ray.origin.x) + u*vectorU.x + v*vectorV.x + u*v*vectorW.x`\n // and this particular equation is invoked to compute t when u and v are known.\n const coffs = [\n new Float64Array([-ray.direction.x, this.point00.x - ray.origin.x, vectorU.x, vectorV.x, vectorW.x]),\n new Float64Array([-ray.direction.y, this.point00.y - ray.origin.y, vectorU.y, vectorV.y, vectorW.y]),\n new Float64Array([-ray.direction.z, this.point00.z - ray.origin.z, vectorU.z, vectorV.z, vectorW.z]),\n ];\n // swap rows so that the equation with largest ray.direction coefficient is first.\n BilinearPatch.conditionalPivot(0, coffs, 0, 1);\n BilinearPatch.conditionalPivot(0, coffs, 0, 2);\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[1], -1.0);\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[2], -1.0);\n const uvArray = SmallSystem.solveBilinearPair(\n coffs[1][1], coffs[1][2], coffs[1][3], coffs[1][4],\n coffs[2][1], coffs[2][2], coffs[2][3], coffs[2][4],\n );\n if (uvArray) {\n const result: CurveAndSurfaceLocationDetail[] = [];\n for (const uv of uvArray) {\n const t = -(coffs[0][1] + coffs[0][2] * uv.x + (coffs[0][3] + coffs[0][4] * uv.x) * uv.y) / coffs[0][0];\n const point = ray.fractionToPoint(t);\n result.push(new CurveAndSurfaceLocationDetail(\n CurveLocationDetail.createRayFractionPoint(ray, t, point),\n UVSurfaceLocationDetail.createSurfaceUVPoint(this, uv, point)),\n );\n }\n return result;\n }\n return undefined;\n }\n /** Returns the larger of the u-direction edge lengths at v=0 and v=1. */\n public maxUEdgeLength(): number {\n return Geometry.maxXY(this.point00.distance(this.point10), this.point01.distance(this.point11));\n }\n /** Returns the larger of the v-direction edge lengths at u=0 and u=1. */\n public maxVEdgeLength(): number {\n return Geometry.maxXY(this.point00.distance(this.point01), this.point10.distance(this.point11));\n }\n}\n"]}
|
|
@@ -10,12 +10,11 @@ import { Transform } from "./Transform";
|
|
|
10
10
|
import { Matrix3dProps, WritableXYAndZ, XAndY, XYAndZ } from "./XYZProps";
|
|
11
11
|
/**
|
|
12
12
|
* PackedMatrix3dOps contains static methods for matrix operations where the matrix is a Float64Array.
|
|
13
|
-
* * The Float64Array contains the matrix entries in row-major order
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* equation
|
|
17
|
-
* \newcommand[1]\mij{#1_{00}\ #1_{01}\ a_{02}}
|
|
13
|
+
* * The Float64Array contains the matrix entries in row-major order:
|
|
14
|
+
* ```equation
|
|
15
|
+
* \mij{a}
|
|
18
16
|
* ```
|
|
17
|
+
* @internal
|
|
19
18
|
*/
|
|
20
19
|
export declare class PackedMatrix3dOps {
|
|
21
20
|
/**
|
|
@@ -96,13 +95,11 @@ export declare enum InverseMatrixState {
|
|
|
96
95
|
* * A very common use is to hold a rigid body rotation (which has no scaling or skew), but the 3x3 contents can
|
|
97
96
|
* also hold scaling and skewing.
|
|
98
97
|
* * The matrix with 2-dimensional layout (note: a 2d array can be shown by a matrix)
|
|
99
|
-
* ```
|
|
100
|
-
* equation
|
|
98
|
+
* ```equation
|
|
101
99
|
* \matrixXY{A}
|
|
102
100
|
* ```
|
|
103
101
|
* is stored as 9 numbers in "row-major" order in a `Float64Array`, viz
|
|
104
|
-
* ```
|
|
105
|
-
* equation
|
|
102
|
+
* ```equation
|
|
106
103
|
* \rowMajorMatrixXY{A}
|
|
107
104
|
* ```
|
|
108
105
|
* * If the matrix inverse is known it is stored in the inverseCoffs array.
|
|
@@ -126,8 +123,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
126
123
|
static numComputeCache: number;
|
|
127
124
|
/**
|
|
128
125
|
* Matrix contents as a flat array of numbers in row-major order.
|
|
129
|
-
* ```
|
|
130
|
-
* equation
|
|
126
|
+
* ```equation
|
|
131
127
|
* \mxy{B}
|
|
132
128
|
* \mij{B}
|
|
133
129
|
* ```
|
|
@@ -136,8 +132,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
136
132
|
coffs: Float64Array;
|
|
137
133
|
/**
|
|
138
134
|
* Matrix inverse contents.
|
|
139
|
-
* ```
|
|
140
|
-
* equation
|
|
135
|
+
* ```equation
|
|
141
136
|
* \mxy{A}
|
|
142
137
|
* ```
|
|
143
138
|
* * DO NOT directly modify this array. It will destroy integrity of the cached inverse state.
|
|
@@ -212,8 +207,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
212
207
|
/**
|
|
213
208
|
* Returns a Matrix3d populated by numeric values given in row-major order.
|
|
214
209
|
* Sets all entries in the matrix from call parameters appearing in row-major order, i.e.
|
|
215
|
-
* ```
|
|
216
|
-
* equation
|
|
210
|
+
* ```equation
|
|
217
211
|
* \begin{bmatrix}a_{xx}\ a_{xy}\ a_{xz}\\ a_{yx}\ a_{yy}\ a_{yz}\\ a_{zx}\ a_{zy}\ a_{zz}\end{bmatrix}
|
|
218
212
|
* ```
|
|
219
213
|
* @param axx Row x, column x(0, 0) entry
|
|
@@ -290,8 +284,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
290
284
|
* * Note that for geometry transformations "all zeros" is not a useful default state.
|
|
291
285
|
* * Hence, almost always use `createIdentity` for graphics transformations.
|
|
292
286
|
* * "All zeros" is appropriate for summing moment data.
|
|
293
|
-
* ```
|
|
294
|
-
* equation
|
|
287
|
+
* ```equation
|
|
295
288
|
* \begin{bmatrix}0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0\end{bmatrix}
|
|
296
289
|
* ```
|
|
297
290
|
*/
|
|
@@ -301,8 +294,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
301
294
|
* * All diagonal entries (xx,yy,zz) are one
|
|
302
295
|
* * All others are zero.
|
|
303
296
|
* * This (rather than "all zeros") is the useful state for most graphics transformations.
|
|
304
|
-
* ```
|
|
305
|
-
* equation
|
|
297
|
+
* ```equation
|
|
306
298
|
* \begin{bmatrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1\end{bmatrix}
|
|
307
299
|
* ```
|
|
308
300
|
*
|
|
@@ -310,16 +302,14 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
310
302
|
static createIdentity(result?: Matrix3d): Matrix3d;
|
|
311
303
|
/**
|
|
312
304
|
* Create a matrix with distinct x,y,z diagonal (scale) entries.
|
|
313
|
-
* ```
|
|
314
|
-
* equation
|
|
305
|
+
* ```equation
|
|
315
306
|
* \begin{bmatrix}s_x & 0 & 0 \\ 0 & s_y & 0\\ 0 & 0 & s_z\end{bmatrix}
|
|
316
307
|
* ```
|
|
317
308
|
*/
|
|
318
309
|
static createScale(scaleFactorX: number, scaleFactorY: number, scaleFactorZ: number, result?: Matrix3d): Matrix3d;
|
|
319
310
|
/**
|
|
320
311
|
* Create a matrix with uniform scale factor "s":
|
|
321
|
-
* ```
|
|
322
|
-
* equation
|
|
312
|
+
* ```equation
|
|
323
313
|
* \begin{bmatrix}s & 0 & 0 \\ 0 & s & 0\\ 0 & 0 & s\end{bmatrix}
|
|
324
314
|
* ```
|
|
325
315
|
*/
|
|
@@ -405,16 +395,14 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
405
395
|
applyGivensColumnOp(i: number, j: number, c: number, s: number): void;
|
|
406
396
|
/**
|
|
407
397
|
* Create a matrix from column vectors.
|
|
408
|
-
* ```
|
|
409
|
-
* equation
|
|
398
|
+
* ```equation
|
|
410
399
|
* \begin{bmatrix}U_x & V_x & W_x \\ U_y & V_y & W_y \\ U_z & V_z & W_z \end{bmatrix}
|
|
411
400
|
* ```
|
|
412
401
|
*/
|
|
413
402
|
static createColumns(vectorU: Vector3d, vectorV: Vector3d, vectorW: Vector3d, result?: Matrix3d): Matrix3d;
|
|
414
403
|
/**
|
|
415
404
|
* Create a matrix with each column's _x,y_ parts given `XAndY` and separate numeric z values.
|
|
416
|
-
* ```
|
|
417
|
-
* equation
|
|
405
|
+
* ```equation
|
|
418
406
|
* \begin{bmatrix}U_x & V_x & W_x \\ U_y & V_y & W_y \\ u & v & w \end{bmatrix}
|
|
419
407
|
* ```
|
|
420
408
|
*/
|
|
@@ -681,8 +669,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
681
669
|
getRow(columnIndex: number, result?: Vector3d): Vector3d;
|
|
682
670
|
/**
|
|
683
671
|
* Create a matrix from row vectors.
|
|
684
|
-
* ```
|
|
685
|
-
* equation
|
|
672
|
+
* ```equation
|
|
686
673
|
* \begin{bmatrix}U_x & U_y & U_z \\ V_x & V_y & V_z \\ W_x & W_y & W_z \end{bmatrix}
|
|
687
674
|
* ```
|
|
688
675
|
*/
|
|
@@ -695,8 +682,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
695
682
|
* mirror of the `vector` across the `plane`. In general, When scale != 0, the result is computed by first
|
|
696
683
|
* projecting the `vector` to the `plane`, then translating that projection along the `direction` (if scale > 0)
|
|
697
684
|
* or in opposite direction (if scale < 0).
|
|
698
|
-
* ```
|
|
699
|
-
* equation
|
|
685
|
+
* ```equation
|
|
700
686
|
* \text{The matrix is } I + (s-1) D D^T
|
|
701
687
|
* \\ \text{with }D\text{ being the normalized direction vector and }s\text{ being the scale.}
|
|
702
688
|
* ```
|
|
@@ -716,8 +702,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
716
702
|
static createFlattenAlongVectorToPlane(sweepVector: Vector3d, planeNormal: Vector3d): Matrix3d | undefined;
|
|
717
703
|
/**
|
|
718
704
|
* Multiply `matrix * point`, treating the point as a column vector on the right.
|
|
719
|
-
* ```
|
|
720
|
-
* equation
|
|
705
|
+
* ```equation
|
|
721
706
|
* \matrixXY{A}\columnSubXYZ{U}
|
|
722
707
|
* ```
|
|
723
708
|
* @return the point result
|
|
@@ -725,8 +710,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
725
710
|
multiplyPoint(point: Point3d, result?: Point3d): Point3d;
|
|
726
711
|
/**
|
|
727
712
|
* Multiply `matrix * vector`, treating the vector is a column vector on the right.
|
|
728
|
-
* ```
|
|
729
|
-
* equation
|
|
713
|
+
* ```equation
|
|
730
714
|
* \matrixXY{A}\columnSubXYZ{U}
|
|
731
715
|
* ```
|
|
732
716
|
* @return the vector result
|
|
@@ -751,8 +735,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
751
735
|
/**
|
|
752
736
|
* Treat the 3x3 matrix and origin as upper 3x4 part of a 4x4 matrix, with 0001 as the final row.
|
|
753
737
|
* Multiply the 4x4 matrix by `[x,y,z,w]`
|
|
754
|
-
* ```
|
|
755
|
-
* equation
|
|
738
|
+
* ```equation
|
|
756
739
|
* \begin{bmatrix}M_0 & M_1 & M_2 & Ox \\ M_3 & M_4 & M_5 & Oy \\ M_6 & M_7 & M_8 & Oz \\ 0 & 0 & 0 & 1\end{bmatrix} * \begin{bmatrix}x \\ y \\ z \\ w\end{bmatrix}
|
|
757
740
|
* ```
|
|
758
741
|
* @param origin translation part (xyz in column 3)
|
|
@@ -767,8 +750,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
767
750
|
/**
|
|
768
751
|
* Treat the 3x3 matrix and origin as upper 3x4 part of a 4x4 matrix, with 0001 as the final row.
|
|
769
752
|
* Multiply the 4x4 matrix by `[x,y,z,w]`
|
|
770
|
-
* ```
|
|
771
|
-
* equation
|
|
753
|
+
* ```equation
|
|
772
754
|
* \begin{bmatrix}M_0 & M_1 & M_2 & Ox \\ M_3 & M_4 & M_5 & Oy \\ M_6 & M_7 & M_8 & Oz \\ 0 & 0 & 0 & 1\end{bmatrix} * \begin{bmatrix}x \\ y \\ z \\ w\end{bmatrix}
|
|
773
755
|
* ```
|
|
774
756
|
* @param origin translation part (xyz in column 3)
|
|
@@ -783,8 +765,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
783
765
|
/**
|
|
784
766
|
* Treat the 3x3 matrix and origin as a 3x4 matrix.
|
|
785
767
|
* * Multiply the 3x4 matrix by `[x,y,z,1]`
|
|
786
|
-
* ```
|
|
787
|
-
* equation
|
|
768
|
+
* ```equation
|
|
788
769
|
* \begin{bmatrix}M_0 & M_1 & M_2 & Ox \\ M_3 & M_4 & M_5 & Oy \\ M_6 & M_7 & M_8 & Oz\end{bmatrix} * \begin{bmatrix}x \\ y \\ z \\ 1\end{bmatrix}
|
|
789
770
|
* ```
|
|
790
771
|
* @param origin translation part (xyz in column 3)
|
|
@@ -798,8 +779,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
798
779
|
/**
|
|
799
780
|
* Multiply the transpose matrix times a vector.
|
|
800
781
|
* * This produces the same x,y,z as treating the vector as a row on the left of the (un-transposed) matrix.
|
|
801
|
-
* ```
|
|
802
|
-
* equation
|
|
782
|
+
* ```equation
|
|
803
783
|
* \begin{matrix}
|
|
804
784
|
* \text{Treating U as a column to the right of transposed matrix\: return column}&\columnSubXYZ{V}&=&\matrixTransposeSubXY{A}\columnSubXYZ{U} \\
|
|
805
785
|
* \text{Treating U as a row to the left of untransposed matrix\: return row}&\rowSubXYZ{V}&=&\rowSubXYZ{U}\matrixXY{A}
|
|
@@ -845,14 +825,13 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
845
825
|
/**
|
|
846
826
|
* Multiply the transpose matrix times column using individual numeric inputs.
|
|
847
827
|
* * This produces the same x,y,z as treating the vector as a row on the left of the (un-transposed) matrix.
|
|
848
|
-
* ```
|
|
849
|
-
* equation
|
|
828
|
+
* ```equation
|
|
850
829
|
* \begin{matrix}
|
|
851
830
|
* \text{treating the input as a column vector } \columnXYZ{x}{y}{z}\text{ compute }&\columnSubXYZ{V} &= &A^T \columnXYZ{x}{y}{z} \\
|
|
852
831
|
* \text{or as a row vector } \rowXYZ{x}{y}{z} \text{ compute }&\rowSubXYZ{V} &= &\rowXYZ{x}{y}{z} A \\
|
|
853
832
|
* \phantom{8888}\text{and return V as a Vector3d} & & &
|
|
854
833
|
* \end{matrix}
|
|
855
|
-
*
|
|
834
|
+
* ```
|
|
856
835
|
* @param result the vector result (optional)
|
|
857
836
|
*/
|
|
858
837
|
multiplyTransposeXYZ(x: number, y: number, z: number, result?: Vector3d): Vector3d;
|
|
@@ -920,8 +899,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
920
899
|
multiplyMatrixInverseMatrix(other: Matrix3d, result?: Matrix3d): Matrix3d | undefined;
|
|
921
900
|
/**
|
|
922
901
|
* Multiply `this` matrix times the transpose of `other` matrix
|
|
923
|
-
* ```
|
|
924
|
-
* equation
|
|
902
|
+
* ```equation
|
|
925
903
|
* \text{for instance matrix }A\text{ and matrix }B\text{ return matrix }C{\text where }\\\matrixXY{C}=\matrixXY{A}\matrixTransposeSubXY{B}
|
|
926
904
|
* ```
|
|
927
905
|
* @return the matrix result: this*otherTranspose
|
|
@@ -929,8 +907,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
929
907
|
multiplyMatrixMatrixTranspose(other: Matrix3d, result?: Matrix3d): Matrix3d;
|
|
930
908
|
/**
|
|
931
909
|
* Multiply the transpose of `this` matrix times `other` matrix
|
|
932
|
-
* ```
|
|
933
|
-
* equation
|
|
910
|
+
* ```equation
|
|
934
911
|
* \matrixXY{result}=\matrixXY{\text{this}}\matrixTransposeSubXY{\text{other}}
|
|
935
912
|
* ```
|
|
936
913
|
* @return the matrix result: thisTranspose*other
|
|
@@ -939,8 +916,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
939
916
|
/**
|
|
940
917
|
* Multiply `this` Matrix3d (considered to be a Transform with 0 `origin`) times `other` Transform.
|
|
941
918
|
* * **Note:** If `this = [A 0]` and `other = [B b]`, then `this * other` is defined as [A*B Ab] because:
|
|
942
|
-
* ```
|
|
943
|
-
* equation
|
|
919
|
+
* ```equation
|
|
944
920
|
* \begin{matrix}
|
|
945
921
|
* \text{this matrix }\bold{A}\text{ promoted to block Transform} & \blockTransform{A}{0} \\
|
|
946
922
|
* \text{other Transform with `matrix` part }\bold{B}\text{ and origin part }\bold{b} & \blockTransform{B}{b}\\
|
|
@@ -1098,8 +1074,7 @@ export declare class Matrix3d implements BeJSONFunctions {
|
|
|
1098
1074
|
* Add scaled values from an outer product of vectors U and V.
|
|
1099
1075
|
* * The scaled outer product is a matrix with `rank 1` (all columns/rows are linearly dependent).
|
|
1100
1076
|
* * This is useful in constructing mirrors and directional scales.
|
|
1101
|
-
* ```
|
|
1102
|
-
* equation
|
|
1077
|
+
* ```equation
|
|
1103
1078
|
* A += s \columnSubXYZ{U}\rowSubXYZ{V}
|
|
1104
1079
|
* \\ \matrixXY{A} += s \begin{bmatrix}
|
|
1105
1080
|
* U_x * V_x & U_x * V_y & U_x * V_z \\
|