@itwin/core-geometry 4.3.0-dev.4 → 4.3.0-dev.5
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/CHANGELOG.md +11 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +18 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +47 -0
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +9 -9
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +7 -10
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.d.ts +2 -2
- package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurve.js +3 -16
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +16 -0
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +28 -0
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.d.ts.map +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.js +2 -4
- package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +1 -4
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +1 -4
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +0 -9
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +16 -35
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +12 -6
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +71 -12
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts +11 -5
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +73 -8
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js +2 -3
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.d.ts +1 -1
- package/lib/cjs/geometry4d/Point4d.js +1 -1
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.d.ts +3 -4
- package/lib/cjs/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js +8 -6
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +18 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +48 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +9 -9
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +7 -10
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.d.ts +2 -2
- package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurve.js +3 -16
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +16 -0
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +28 -0
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.d.ts.map +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.js +2 -4
- package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +1 -4
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +1 -4
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +0 -9
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +16 -35
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +12 -6
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +72 -13
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts +11 -5
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +74 -9
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js +2 -3
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.d.ts +1 -1
- package/lib/esm/geometry4d/Point4d.js +1 -1
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.d.ts +3 -4
- package/lib/esm/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js +8 -6
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiChainCollector.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/MultiChainCollector.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAc,SAAS,EAAE,MAAM,cAAc,CAAC;AAGrD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,mBAAmB;IAe9B;;;OAGG;IACH,YAAmB,YAAY,GAAG,QAAQ,CAAC,mBAAmB,EAAE,iBAAqC,QAAQ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C,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACxD,IAAI,EAAE;gBACJ,aAAa,CAAC,EAAE,CAAC,CAAC;SACrB;aAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YAC5B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;gBAC1B,MAAM,EAAE,GAAG,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;gBACpD,IAAI,EAAE;oBACJ,aAAa,CAAC,EAAE,CAAC,CAAC;aACrB;SACF;IACH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { FrameBuilder } from \"../../geometry3d/FrameBuilder\";\r\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport { XYAndZ } from \"../../geometry3d/XYZProps\";\r\nimport { Arc3d } from \"../Arc3d\";\r\nimport { AnyCurve } from \"../CurveTypes\";\r\nimport { BagOfCurves, CurveCollection } from \"../CurveCollection\";\r\nimport { CurveCurve } from \"../CurveCurve\";\r\nimport { CurvePrimitive } from \"../CurvePrimitive\";\r\nimport { LineSegment3d } from \"../LineSegment3d\";\r\nimport { LineString3d } from \"../LineString3d\";\r\nimport { Loop } from \"../Loop\";\r\nimport { Path } from \"../Path\";\r\nimport { ChainTypes, RegionOps } from \"../RegionOps\";\r\nimport { StrokeOptions } from \"../StrokeOptions\";\r\n\r\n/**\r\n * Manage a growing array of arrays of curve primitives that are to be joined \"head to tail\" in paths.\r\n * * The caller makes a sequence of calls to announce individual primitives.\r\n * * This collector (unlike the simpler [[ChainCollectorContext]]) expects to have inputs arriving in random order, leaving multiple open chains in play at any time.\r\n * * When all curves have been announced, the call to `grabResults` restructures the various active chains into Paths (and optionally, Loops).\r\n * * Chain formation is dependent upon input fragment order, as a greedy algorithm is employed.\r\n * * Usage pattern is\r\n * * initialization: `context = new MultiChainCollector(gapTol, planeTol)`\r\n * * many times:\r\n * * `context.captureCurve(anyCurve)`\r\n * * `context.captureCurvePrimitive(primitive)`\r\n * * end: `result = context.grabResult(makeLoopIfClosed)`\r\n * @internal\r\n */\r\nexport class MultiChainCollector {\r\n /** accumulated chains */\r\n private _chains: CurvePrimitive[][];\r\n /** largest gap distance to close */\r\n private _gapTolerance: number;\r\n /** end point snap tolerance (assumed to be as tight or tighter than gapTolerance) */\r\n private _snapTolerance: number;\r\n /** tolerance for choosing Path or Loop. If undefined, always Path. */\r\n private _planeTolerance: number | undefined;\r\n\r\n private static _staticPointA: Point3d;\r\n private static _staticPointB: Point3d;\r\n private _xyzWork0?: Point3d;\r\n private _xyzWork1?: Point3d;\r\n\r\n /** Initialize with an empty array of chains.\r\n * @param gapTolerance tolerance for calling endpoints identical\r\n * @param planeTolerance tolerance for considering a closed chain to be planar. If undefined, only create Path. If defined, create Loops for closed chains within tolerance of a plane.\r\n */\r\n public constructor(gapTolerance = Geometry.smallMetricDistance, planeTolerance: number | undefined = Geometry.smallMetricDistance) {\r\n this._chains = [];\r\n this._gapTolerance = gapTolerance;\r\n this._snapTolerance = Geometry.smallMetricDistance;\r\n this._planeTolerance = planeTolerance;\r\n }\r\n /**\r\n * Find a chain (with index _other than_ exceptChainIndex) that starts or ends at xyz\r\n * @param xyz endpoint to check\r\n * @param tolerance absolute distance tolerance for equating endpoints\r\n * @param exceptChainIndex index of chain to ignore. Send -1 to consider all chains.\r\n */\r\n private findAnyChainToConnect(xyz: Point3d, tolerance: number, exceptChainIndex: number = -1): { chainIndex: number, atEnd: boolean } | undefined {\r\n for (let chainIndexA = 0; chainIndexA < this._chains.length; chainIndexA++) {\r\n if (exceptChainIndex === chainIndexA)\r\n continue;\r\n const chain = this._chains[chainIndexA];\r\n this._xyzWork1 = chain[chain.length - 1].endPoint(this._xyzWork1);\r\n if (this._xyzWork1.isAlmostEqual(xyz, tolerance))\r\n return { chainIndex: chainIndexA, atEnd: true };\r\n this._xyzWork1 = chain[0].startPoint(this._xyzWork1);\r\n if (this._xyzWork1.isAlmostEqual(xyz, tolerance))\r\n return { chainIndex: chainIndexA, atEnd: false };\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Insert a single curve primitive into the active chains.\r\n * * The primitive is captured (not cloned)\r\n * * The primitive may be reversed in place\r\n * @param candidate curve to add to the context\r\n */\r\n public captureCurvePrimitive(candidate: CurvePrimitive) {\r\n if (this._snapTolerance < this._gapTolerance) {\r\n if (this.attachPrimitiveToAnyChain(candidate, this._snapTolerance))\r\n return;\r\n }\r\n if (this.attachPrimitiveToAnyChain(candidate, this._gapTolerance))\r\n return;\r\n this._chains.push([candidate]);\r\n }\r\n /**\r\n * Insert any curve into the collection.\r\n * * This recurses into Path, Loop, BagOfCurves etc\r\n * * All primitives are captured, and may be reversed in place.\r\n * @param candidate curve to add to the context\r\n */\r\n public captureCurve(candidate: AnyCurve) {\r\n if (candidate instanceof CurvePrimitive)\r\n this.captureCurvePrimitive(candidate);\r\n else if (candidate instanceof CurveCollection && candidate.children !== undefined) {\r\n for (const c of candidate.children) {\r\n this.captureCurve(c as AnyCurve);\r\n }\r\n }\r\n }\r\n /** If allowed by the geometry type, move an endpoint. */\r\n private static simpleEndPointMove(curve: CurvePrimitive, atEnd: boolean, to: XYAndZ): boolean {\r\n if (curve instanceof (LineSegment3d)) {\r\n if (atEnd) {\r\n curve.point1Ref.setFrom(to);\r\n } else {\r\n curve.point0Ref.setFrom(to);\r\n }\r\n return true;\r\n } else if (curve instanceof LineString3d && curve.numPoints() > 0) {\r\n const i = atEnd ? curve.numPoints() - 1 : 0;\r\n curve.packedPoints.setAtCheckedPointIndex(i, to);\r\n return true;\r\n }\r\n return false;\r\n }\r\n /**\r\n * Try to move the end of curve0 and/or the start of curve1 to a common point.\r\n * * All z-coordinates are ignored.\r\n * @param curve0 first curve, assumed to end close to the start of curve1\r\n * @param curve1 second curve, assumed to start close to the end of curve0\r\n * @param gapTolerance max distance to move a curve start/end point\r\n * @returns whether curve start/end point(s) moved\r\n */\r\n private static moveHeadOrTail(curve0: CurvePrimitive, curve1: CurvePrimitive, gapTolerance: number): boolean {\r\n const xyz0 = curve0.endPoint();\r\n const xyz1 = curve1.startPoint();\r\n const minShift = Geometry.smallMetricDistance * 0.001;\r\n const d01 = xyz0.distanceXY(xyz1);\r\n if (d01 < minShift)\r\n return false;\r\n // try lines and linestrings\r\n if (d01 < gapTolerance) {\r\n if (this.simpleEndPointMove(curve1, false, xyz0) || this.simpleEndPointMove(curve0, true, xyz1))\r\n return true;\r\n }\r\n // try other primitive types\r\n const intersections = CurveCurve.intersectionXYPairs(curve0, true, curve1, true);\r\n const shiftFactor = 5.0;\r\n for (const pair of intersections) {\r\n const detail0 = pair.detailA;\r\n const detail1 = pair.detailB;\r\n const distance0 = detail0.point.distanceXY(xyz0);\r\n const distance1 = detail1.point.distanceXY(xyz1);\r\n if (distance0 < shiftFactor * gapTolerance && distance1 < shiftFactor * gapTolerance) {\r\n if (curve0 instanceof Arc3d && curve1 instanceof Arc3d) {\r\n const radians0End = curve0.sweep.fractionToRadians(detail0.fraction);\r\n curve0.sweep.setStartEndRadians(curve0.sweep.startRadians, radians0End);\r\n const radians1Start = curve1.sweep.fractionToRadians(detail1.fraction);\r\n curve1.sweep.setStartEndRadians(radians1Start, curve1.sweep.endRadians);\r\n return true;\r\n }\r\n // TODO: other combinations of types\r\n }\r\n }\r\n return false;\r\n }\r\n /** Announce a curve primitive\r\n * * If a \"nearby\" connection is possible, insert the candidate in the chain and force endpoint match.\r\n * * Otherwise start a new chain.\r\n */\r\n private attachPrimitiveToAnyChain(candidate: CurvePrimitive, tolerance: number): boolean {\r\n if (candidate) {\r\n this._xyzWork0 = candidate.startPoint(this._xyzWork0);\r\n let connect = this.findAnyChainToConnect(this._xyzWork0, tolerance);\r\n if (connect) {\r\n if (connect.atEnd) {\r\n const chain = this._chains[connect.chainIndex];\r\n const index0 = chain.length - 1;\r\n this._chains[connect.chainIndex].push(candidate);\r\n MultiChainCollector.moveHeadOrTail(chain[index0], chain[index0 + 1], this._gapTolerance);\r\n this.searchAndMergeChainIndex(connect.chainIndex, tolerance);\r\n return true;\r\n } else {\r\n candidate.reverseInPlace();\r\n const chain = this._chains[connect.chainIndex];\r\n chain.splice(0, 0, candidate);\r\n MultiChainCollector.moveHeadOrTail(chain[0], chain[1], this._gapTolerance);\r\n this.searchAndMergeChainIndex(connect.chainIndex, tolerance);\r\n return true;\r\n }\r\n } else {\r\n this._xyzWork0 = candidate.endPoint(this._xyzWork0);\r\n connect = this.findAnyChainToConnect(this._xyzWork0, tolerance);\r\n if (connect) {\r\n if (connect.atEnd) {\r\n candidate.reverseInPlace();\r\n const chain = this._chains[connect.chainIndex];\r\n const index0 = chain.length - 1;\r\n this._chains[connect.chainIndex].push(candidate);\r\n MultiChainCollector.moveHeadOrTail(chain[index0], chain[index0 + 1], this._gapTolerance);\r\n this.searchAndMergeChainIndex(connect.chainIndex, tolerance);\r\n return true;\r\n } else {\r\n const chain = this._chains[connect.chainIndex];\r\n chain.splice(0, 0, candidate);\r\n MultiChainCollector.moveHeadOrTail(chain[0], chain[1], this._gapTolerance);\r\n this.searchAndMergeChainIndex(connect.chainIndex, tolerance);\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * Merge two entries in the chain array.\r\n * * Move each primitive from chainB to the end of chainA.\r\n * * Clear chainB.\r\n * * Move the final chain to chainB index.\r\n * * Decrement the array length.\r\n * @param chainIndexA index of chainA\r\n * @param chainIndexB index of chainB\r\n */\r\n private mergeChainsForwardForward(chainIndexA: number, chainIndexB: number) {\r\n const chainA = this._chains[chainIndexA];\r\n const chainB = this._chains[chainIndexB];\r\n for (const p of chainB) {\r\n chainA.push(p);\r\n }\r\n chainB.length = 0; // chainIndexB is unused\r\n const lastChainIndex = this._chains.length - 1;\r\n if (chainIndexB !== lastChainIndex)\r\n this._chains[chainIndexB] = this._chains[lastChainIndex];\r\n this._chains.pop();\r\n }\r\n /** Reverse the curve chain in place. */\r\n private reverseChain(chainIndex: number) {\r\n const chain = this._chains[chainIndex];\r\n chain.reverse();\r\n for (const p of chain)\r\n p.reverseInPlace();\r\n }\r\n /** See if the head or tail of chainIndex matches any existing chain. If so, merge the two chains. */\r\n private searchAndMergeChainIndex(chainIndex: number, tolerance: number): void {\r\n // ASSUME valid index of non-empty chain\r\n const chain = this._chains[chainIndex];\r\n const lastIndexInChain = chain.length - 1;\r\n this._xyzWork0 = chain[0].startPoint(this._xyzWork0);\r\n // try start with any other chain\r\n let connect = this.findAnyChainToConnect(this._xyzWork0, tolerance, chainIndex);\r\n if (connect) {\r\n if (!connect.atEnd)\r\n this.reverseChain(connect.chainIndex);\r\n this.mergeChainsForwardForward(connect.chainIndex, chainIndex);\r\n return;\r\n }\r\n // try end with any other chain\r\n this._xyzWork0 = chain[lastIndexInChain].endPoint(this._xyzWork0);\r\n connect = this.findAnyChainToConnect(this._xyzWork0, tolerance, chainIndex);\r\n if (connect) {\r\n if (connect.atEnd)\r\n this.reverseChain(connect.chainIndex);\r\n this.mergeChainsForwardForward(chainIndex, connect.chainIndex);\r\n return;\r\n }\r\n }\r\n /**\r\n * Convert an array of curve primitives into the simplest possible strongly typed curve structure.\r\n * @param curves input array, assembled correctly into a single contiguous path, captured by returned object\r\n * @param makeLoopIfClosed whether to return a Loop from physically closed curves array, otherwise Path\r\n * @return Loop or Path if multiple curves; the primitive if only one curve; undefined if no curves\r\n */\r\n private promoteArrayToCurves(curves: CurvePrimitive[], makeLoopIfClosed: boolean): CurvePrimitive | Path | Loop | undefined {\r\n if (curves.length === 0)\r\n return undefined;\r\n if (makeLoopIfClosed) {\r\n const primitive0 = curves[0];\r\n const primitiveN = curves[curves.length - 1];\r\n MultiChainCollector._staticPointA = primitive0.startPoint(MultiChainCollector._staticPointA);\r\n MultiChainCollector._staticPointB = primitiveN.endPoint(MultiChainCollector._staticPointB);\r\n if (MultiChainCollector.moveHeadOrTail(primitiveN, primitive0, this._gapTolerance)) {\r\n // get the corrected coordinates\r\n MultiChainCollector._staticPointA = primitive0.startPoint(MultiChainCollector._staticPointA);\r\n MultiChainCollector._staticPointB = primitiveN.endPoint(MultiChainCollector._staticPointB);\r\n }\r\n if (MultiChainCollector._staticPointA.isAlmostEqual(MultiChainCollector._staticPointB, this._gapTolerance)) {\r\n const localToWorld = FrameBuilder.createRightHandedLocalToWorld(curves);\r\n if (localToWorld) {\r\n const worldToLocal = localToWorld.inverse();\r\n if (worldToLocal) {\r\n const range = RegionOps.curveArrayRange(curves, worldToLocal);\r\n if (this._planeTolerance !== undefined && range.zLength() <= this._planeTolerance) {\r\n return Loop.createArray(curves);\r\n }\r\n }\r\n }\r\n return Path.createArray(curves);\r\n }\r\n }\r\n if (curves.length === 1)\r\n return curves[0];\r\n return Path.createArray(curves);\r\n }\r\n /** Stroke the curve chain to a line string, de-duplicate the points. */\r\n private chainToLineString3d(chain: CurvePrimitive[], options?: StrokeOptions): LineString3d | undefined {\r\n if (chain.length === 0)\r\n return undefined;\r\n const linestring = LineString3d.create();\r\n for (const curve of chain)\r\n curve.emitStrokes(linestring, options);\r\n linestring.removeDuplicatePoints(this._gapTolerance);\r\n return linestring;\r\n }\r\n /** Return the collected results, structured as the simplest possible type. */\r\n public grabResult(makeLoopIfClosed: boolean = false): ChainTypes {\r\n const chains = this._chains;\r\n if (chains.length === 0)\r\n return undefined;\r\n if (chains.length === 1)\r\n return this.promoteArrayToCurves(chains[0], makeLoopIfClosed);\r\n const bag = BagOfCurves.create();\r\n for (const chain of chains) {\r\n const q = this.promoteArrayToCurves(chain, makeLoopIfClosed);\r\n bag.tryAddChild(q);\r\n }\r\n return bag;\r\n }\r\n /** Return chains as individual calls to announceChain. */\r\n public announceChainsAsLineString3d(announceChain: (ls: LineString3d) => void, options?: StrokeOptions): void {\r\n const chains = this._chains;\r\n if (chains.length === 1) {\r\n const ls = this.chainToLineString3d(chains[0], options);\r\n if (ls)\r\n announceChain(ls);\r\n } else if (chains.length > 1) {\r\n for (const chain of chains) {\r\n const ls = this.chainToLineString3d(chain, options);\r\n if (ls)\r\n announceChain(ls);\r\n }\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"MultiChainCollector.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/MultiChainCollector.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAc,SAAS,EAAE,MAAM,cAAc,CAAC;AAGrD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,mBAAmB;IAe9B;;;OAGG;IACH,YAAmB,YAAY,GAAG,QAAQ,CAAC,mBAAmB,EAAE,iBAAqC,QAAQ,CAAC,mBAAmB;QAC/H,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAClC,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC,mBAAmB,CAAC;QACnD,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IACxC,CA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OAAO,CAAC,CAAC;gBACpD,IAAI,EAAE;oBACJ,aAAa,CAAC,EAAE,CAAC,CAAC;aACrB;SACF;IACH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { FrameBuilder } from \"../../geometry3d/FrameBuilder\";\r\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport { XYAndZ } from \"../../geometry3d/XYZProps\";\r\nimport { Arc3d } from \"../Arc3d\";\r\nimport { AnyCurve } from \"../CurveTypes\";\r\nimport { BagOfCurves, CurveCollection } from \"../CurveCollection\";\r\nimport { CurveCurve } from \"../CurveCurve\";\r\nimport { CurvePrimitive } from \"../CurvePrimitive\";\r\nimport { LineSegment3d } from \"../LineSegment3d\";\r\nimport { LineString3d } from \"../LineString3d\";\r\nimport { Loop } from \"../Loop\";\r\nimport { Path } from \"../Path\";\r\nimport { ChainTypes, RegionOps } from \"../RegionOps\";\r\nimport { StrokeOptions } from \"../StrokeOptions\";\r\n\r\n/**\r\n * Manage a growing array of arrays of curve primitives that are to be joined \"head to tail\" in paths.\r\n * * The caller makes a sequence of calls to announce individual primitives.\r\n * * This collector (unlike the simpler [[ChainCollectorContext]]) expects to have inputs arriving in random order, leaving multiple open chains in play at any time.\r\n * * When all curves have been announced, the call to `grabResults` restructures the various active chains into Paths (and optionally, Loops).\r\n * * Chain formation is dependent upon input fragment order, as a greedy algorithm is employed.\r\n * * Usage pattern is\r\n * * initialization: `context = new MultiChainCollector(gapTol, planeTol)`\r\n * * many times:\r\n * * `context.captureCurve(anyCurve)`\r\n * * `context.captureCurvePrimitive(primitive)`\r\n * * end: `result = context.grabResult(makeLoopIfClosed)`\r\n * @internal\r\n */\r\nexport class MultiChainCollector {\r\n /** accumulated chains */\r\n private _chains: CurvePrimitive[][];\r\n /** largest gap distance to close */\r\n private _gapTolerance: number;\r\n /** end point snap tolerance (assumed to be as tight or tighter than gapTolerance) */\r\n private _snapTolerance: number;\r\n /** tolerance for choosing Path or Loop. If undefined, always Path. */\r\n private _planeTolerance: number | undefined;\r\n\r\n private static _staticPointA: Point3d;\r\n private static _staticPointB: Point3d;\r\n private _xyzWork0?: Point3d;\r\n private _xyzWork1?: Point3d;\r\n\r\n /** Initialize with an empty array of chains.\r\n * @param gapTolerance tolerance for calling endpoints identical\r\n * @param planeTolerance tolerance for considering a closed chain to be planar. If undefined, only create Path. If defined, create Loops for closed chains within tolerance of a plane.\r\n */\r\n public constructor(gapTolerance = Geometry.smallMetricDistance, planeTolerance: number | undefined = Geometry.smallMetricDistance) {\r\n this._chains = [];\r\n this._gapTolerance = gapTolerance;\r\n this._snapTolerance = Geometry.smallMetricDistance;\r\n this._planeTolerance = planeTolerance;\r\n }\r\n /**\r\n * Find a chain (with index _other than_ exceptChainIndex) that starts or ends at xyz\r\n * @param xyz endpoint to check\r\n * @param tolerance absolute distance tolerance for equating endpoints\r\n * @param exceptChainIndex index of chain to ignore. Send -1 to consider all chains.\r\n */\r\n private findAnyChainToConnect(xyz: Point3d, tolerance: number, exceptChainIndex: number = -1): { chainIndex: number, atEnd: boolean } | undefined {\r\n for (let chainIndexA = 0; chainIndexA < this._chains.length; chainIndexA++) {\r\n if (exceptChainIndex === chainIndexA)\r\n continue;\r\n const chain = this._chains[chainIndexA];\r\n this._xyzWork1 = chain[chain.length - 1].endPoint(this._xyzWork1);\r\n if (this._xyzWork1.isAlmostEqual(xyz, tolerance))\r\n return { chainIndex: chainIndexA, atEnd: true };\r\n this._xyzWork1 = chain[0].startPoint(this._xyzWork1);\r\n if (this._xyzWork1.isAlmostEqual(xyz, tolerance))\r\n return { chainIndex: chainIndexA, atEnd: false };\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Insert a single curve primitive into the active chains.\r\n * * The primitive is captured (not cloned)\r\n * * The primitive may be reversed in place\r\n * @param candidate curve to add to the context\r\n */\r\n public captureCurvePrimitive(candidate: CurvePrimitive) {\r\n if (this._snapTolerance < this._gapTolerance) {\r\n if (this.attachPrimitiveToAnyChain(candidate, this._snapTolerance))\r\n return;\r\n }\r\n if (this.attachPrimitiveToAnyChain(candidate, this._gapTolerance))\r\n return;\r\n this._chains.push([candidate]);\r\n }\r\n /**\r\n * Insert any curve into the collection.\r\n * * This recurses into Path, Loop, BagOfCurves etc\r\n * * All primitives are captured, and may be reversed in place.\r\n * @param candidate curve to add to the context\r\n */\r\n public captureCurve(candidate: AnyCurve) {\r\n if (candidate instanceof CurvePrimitive)\r\n this.captureCurvePrimitive(candidate);\r\n else if (candidate instanceof CurveCollection) {\r\n for (const c of candidate.children)\r\n this.captureCurve(c);\r\n }\r\n }\r\n /** If allowed by the geometry type, move an endpoint. */\r\n private static simpleEndPointMove(curve: CurvePrimitive, atEnd: boolean, to: XYAndZ): boolean {\r\n if (curve instanceof (LineSegment3d)) {\r\n if (atEnd) {\r\n curve.point1Ref.setFrom(to);\r\n } else {\r\n curve.point0Ref.setFrom(to);\r\n }\r\n return true;\r\n } else if (curve instanceof LineString3d && curve.numPoints() > 0) {\r\n const i = atEnd ? curve.numPoints() - 1 : 0;\r\n curve.packedPoints.setAtCheckedPointIndex(i, to);\r\n return true;\r\n }\r\n return false;\r\n }\r\n /**\r\n * Try to move the end of curve0 and/or the start of curve1 to a common point.\r\n * * All z-coordinates are ignored.\r\n * @param curve0 first curve, assumed to end close to the start of curve1\r\n * @param curve1 second curve, assumed to start close to the end of curve0\r\n * @param gapTolerance max distance to move a curve start/end point\r\n * @returns whether curve start/end point(s) moved\r\n */\r\n private static moveHeadOrTail(curve0: CurvePrimitive, curve1: CurvePrimitive, gapTolerance: number): boolean {\r\n const xyz0 = curve0.endPoint();\r\n const xyz1 = curve1.startPoint();\r\n const minShift = Geometry.smallMetricDistance * 0.001;\r\n const d01 = xyz0.distanceXY(xyz1);\r\n if (d01 < minShift)\r\n return false;\r\n // try lines and linestrings\r\n if (d01 < gapTolerance) {\r\n if (this.simpleEndPointMove(curve1, false, xyz0) || this.simpleEndPointMove(curve0, true, xyz1))\r\n return true;\r\n }\r\n // try other primitive types\r\n const intersections = CurveCurve.intersectionXYPairs(curve0, true, curve1, true);\r\n const shiftFactor = 5.0;\r\n for (const pair of intersections) {\r\n const detail0 = pair.detailA;\r\n const detail1 = pair.detailB;\r\n const distance0 = detail0.point.distanceXY(xyz0);\r\n const distance1 = detail1.point.distanceXY(xyz1);\r\n if (distance0 < shiftFactor * gapTolerance && distance1 < shiftFactor * gapTolerance) {\r\n if (curve0 instanceof Arc3d && curve1 instanceof Arc3d) {\r\n const radians0End = curve0.sweep.fractionToRadians(detail0.fraction);\r\n curve0.sweep.setStartEndRadians(curve0.sweep.startRadians, radians0End);\r\n const radians1Start = curve1.sweep.fractionToRadians(detail1.fraction);\r\n curve1.sweep.setStartEndRadians(radians1Start, curve1.sweep.endRadians);\r\n return true;\r\n }\r\n // TODO: other combinations of types\r\n }\r\n }\r\n return false;\r\n }\r\n /** Announce a curve primitive\r\n * * If a \"nearby\" connection is possible, insert the candidate in the chain and force endpoint match.\r\n * * Otherwise start a new chain.\r\n */\r\n private attachPrimitiveToAnyChain(candidate: CurvePrimitive, tolerance: number): boolean {\r\n if (candidate) {\r\n this._xyzWork0 = candidate.startPoint(this._xyzWork0);\r\n let connect = this.findAnyChainToConnect(this._xyzWork0, tolerance);\r\n if (connect) {\r\n if (connect.atEnd) {\r\n const chain = this._chains[connect.chainIndex];\r\n const index0 = chain.length - 1;\r\n this._chains[connect.chainIndex].push(candidate);\r\n MultiChainCollector.moveHeadOrTail(chain[index0], chain[index0 + 1], this._gapTolerance);\r\n this.searchAndMergeChainIndex(connect.chainIndex, tolerance);\r\n return true;\r\n } else {\r\n candidate.reverseInPlace();\r\n const chain = this._chains[connect.chainIndex];\r\n chain.splice(0, 0, candidate);\r\n MultiChainCollector.moveHeadOrTail(chain[0], chain[1], this._gapTolerance);\r\n this.searchAndMergeChainIndex(connect.chainIndex, tolerance);\r\n return true;\r\n }\r\n } else {\r\n this._xyzWork0 = candidate.endPoint(this._xyzWork0);\r\n connect = this.findAnyChainToConnect(this._xyzWork0, tolerance);\r\n if (connect) {\r\n if (connect.atEnd) {\r\n candidate.reverseInPlace();\r\n const chain = this._chains[connect.chainIndex];\r\n const index0 = chain.length - 1;\r\n this._chains[connect.chainIndex].push(candidate);\r\n MultiChainCollector.moveHeadOrTail(chain[index0], chain[index0 + 1], this._gapTolerance);\r\n this.searchAndMergeChainIndex(connect.chainIndex, tolerance);\r\n return true;\r\n } else {\r\n const chain = this._chains[connect.chainIndex];\r\n chain.splice(0, 0, candidate);\r\n MultiChainCollector.moveHeadOrTail(chain[0], chain[1], this._gapTolerance);\r\n this.searchAndMergeChainIndex(connect.chainIndex, tolerance);\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * Merge two entries in the chain array.\r\n * * Move each primitive from chainB to the end of chainA.\r\n * * Clear chainB.\r\n * * Move the final chain to chainB index.\r\n * * Decrement the array length.\r\n * @param chainIndexA index of chainA\r\n * @param chainIndexB index of chainB\r\n */\r\n private mergeChainsForwardForward(chainIndexA: number, chainIndexB: number) {\r\n const chainA = this._chains[chainIndexA];\r\n const chainB = this._chains[chainIndexB];\r\n for (const p of chainB) {\r\n chainA.push(p);\r\n }\r\n chainB.length = 0; // chainIndexB is unused\r\n const lastChainIndex = this._chains.length - 1;\r\n if (chainIndexB !== lastChainIndex)\r\n this._chains[chainIndexB] = this._chains[lastChainIndex];\r\n this._chains.pop();\r\n }\r\n /** Reverse the curve chain in place. */\r\n private reverseChain(chainIndex: number) {\r\n const chain = this._chains[chainIndex];\r\n chain.reverse();\r\n for (const p of chain)\r\n p.reverseInPlace();\r\n }\r\n /** See if the head or tail of chainIndex matches any existing chain. If so, merge the two chains. */\r\n private searchAndMergeChainIndex(chainIndex: number, tolerance: number): void {\r\n // ASSUME valid index of non-empty chain\r\n const chain = this._chains[chainIndex];\r\n const lastIndexInChain = chain.length - 1;\r\n this._xyzWork0 = chain[0].startPoint(this._xyzWork0);\r\n // try start with any other chain\r\n let connect = this.findAnyChainToConnect(this._xyzWork0, tolerance, chainIndex);\r\n if (connect) {\r\n if (!connect.atEnd)\r\n this.reverseChain(connect.chainIndex);\r\n this.mergeChainsForwardForward(connect.chainIndex, chainIndex);\r\n return;\r\n }\r\n // try end with any other chain\r\n this._xyzWork0 = chain[lastIndexInChain].endPoint(this._xyzWork0);\r\n connect = this.findAnyChainToConnect(this._xyzWork0, tolerance, chainIndex);\r\n if (connect) {\r\n if (connect.atEnd)\r\n this.reverseChain(connect.chainIndex);\r\n this.mergeChainsForwardForward(chainIndex, connect.chainIndex);\r\n return;\r\n }\r\n }\r\n /**\r\n * Convert an array of curve primitives into the simplest possible strongly typed curve structure.\r\n * @param curves input array, assembled correctly into a single contiguous path, captured by returned object\r\n * @param makeLoopIfClosed whether to return a Loop from physically closed curves array, otherwise Path\r\n * @return Loop or Path if multiple curves; the primitive if only one curve; undefined if no curves\r\n */\r\n private promoteArrayToCurves(curves: CurvePrimitive[], makeLoopIfClosed: boolean): CurvePrimitive | Path | Loop | undefined {\r\n if (curves.length === 0)\r\n return undefined;\r\n if (makeLoopIfClosed) {\r\n const primitive0 = curves[0];\r\n const primitiveN = curves[curves.length - 1];\r\n MultiChainCollector._staticPointA = primitive0.startPoint(MultiChainCollector._staticPointA);\r\n MultiChainCollector._staticPointB = primitiveN.endPoint(MultiChainCollector._staticPointB);\r\n if (MultiChainCollector.moveHeadOrTail(primitiveN, primitive0, this._gapTolerance)) {\r\n // get the corrected coordinates\r\n MultiChainCollector._staticPointA = primitive0.startPoint(MultiChainCollector._staticPointA);\r\n MultiChainCollector._staticPointB = primitiveN.endPoint(MultiChainCollector._staticPointB);\r\n }\r\n if (MultiChainCollector._staticPointA.isAlmostEqual(MultiChainCollector._staticPointB, this._gapTolerance)) {\r\n const localToWorld = FrameBuilder.createRightHandedLocalToWorld(curves);\r\n if (localToWorld) {\r\n const worldToLocal = localToWorld.inverse();\r\n if (worldToLocal) {\r\n const range = RegionOps.curveArrayRange(curves, worldToLocal);\r\n if (this._planeTolerance !== undefined && range.zLength() <= this._planeTolerance) {\r\n return Loop.createArray(curves);\r\n }\r\n }\r\n }\r\n return Path.createArray(curves);\r\n }\r\n }\r\n if (curves.length === 1)\r\n return curves[0];\r\n return Path.createArray(curves);\r\n }\r\n /** Stroke the curve chain to a line string, de-duplicate the points. */\r\n private chainToLineString3d(chain: CurvePrimitive[], options?: StrokeOptions): LineString3d | undefined {\r\n if (chain.length === 0)\r\n return undefined;\r\n const linestring = LineString3d.create();\r\n for (const curve of chain)\r\n curve.emitStrokes(linestring, options);\r\n linestring.removeDuplicatePoints(this._gapTolerance);\r\n return linestring;\r\n }\r\n /** Return the collected results, structured as the simplest possible type. */\r\n public grabResult(makeLoopIfClosed: boolean = false): ChainTypes {\r\n const chains = this._chains;\r\n if (chains.length === 0)\r\n return undefined;\r\n if (chains.length === 1)\r\n return this.promoteArrayToCurves(chains[0], makeLoopIfClosed);\r\n const bag = BagOfCurves.create();\r\n for (const chain of chains) {\r\n const q = this.promoteArrayToCurves(chain, makeLoopIfClosed);\r\n bag.tryAddChild(q);\r\n }\r\n return bag;\r\n }\r\n /** Return chains as individual calls to announceChain. */\r\n public announceChainsAsLineString3d(announceChain: (ls: LineString3d) => void, options?: StrokeOptions): void {\r\n const chains = this._chains;\r\n if (chains.length === 1) {\r\n const ls = this.chainToLineString3d(chains[0], options);\r\n if (ls)\r\n announceChain(ls);\r\n } else if (chains.length > 1) {\r\n for (const chain of chains) {\r\n const ls = this.chainToLineString3d(chain, options);\r\n if (ls)\r\n announceChain(ls);\r\n }\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -182,7 +182,7 @@ export declare class Point4d extends Plane3d implements BeJSONFunctions {
|
|
|
182
182
|
/** Divide by denominator, but return undefined if denominator is zero. */
|
|
183
183
|
safeDivideOrNull(denominator: number, result?: Point4d): Point4d | undefined;
|
|
184
184
|
/**
|
|
185
|
-
* * Return xyz projection of spacePoint to the plane
|
|
185
|
+
* * Return xyz projection of spacePoint to the plane (this Point4d is understood as plane coefficients, not point coordinates)
|
|
186
186
|
* * If the xyz part of `this` are all zero, (a clone of) `spacePoint` is returned.
|
|
187
187
|
*/
|
|
188
188
|
projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d;
|
|
@@ -336,7 +336,7 @@ export class Point4d extends Plane3d {
|
|
|
336
336
|
return undefined;
|
|
337
337
|
}
|
|
338
338
|
/**
|
|
339
|
-
* * Return xyz projection of spacePoint to the plane
|
|
339
|
+
* * Return xyz projection of spacePoint to the plane (this Point4d is understood as plane coefficients, not point coordinates)
|
|
340
340
|
* * If the xyz part of `this` are all zero, (a clone of) `spacePoint` is returned.
|
|
341
341
|
*/
|
|
342
342
|
projectPointToPlane(spacePoint, result) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Point4d.js","sourceRoot":"","sources":["../../../src/geometry4d/Point4d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAmB,QAAQ,EAA0B,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAQ5C;;;;;;;;;GASG;AACH,SAAS,mBAAmB,CAAC,GAAW,EAAE,EAAU,EAAE,GAAW,EAC/D,CAAS,EAAE,EAAU,EAAE,IAAY;IACnC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AG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAE,+BAA+B;QACpE,MAAM,GAAG,GAAG,QAAQ,CAAC,yBAAyB,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC;QACjE,IAAI,GAAG,KAAK,SAAS;YACnB,OAAO,SAAS,CAAC;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Numerics\r\n */\r\nimport { BeJSONFunctions, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\r\nimport { Plane3d } from \"../geometry3d/Plane3d\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\r\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\r\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { XAndY, XYAndZ } from \"../geometry3d/XYZProps\";\r\n\r\n/**\r\n * 4d point packed in an array of 4 numbers.\r\n * @public\r\n */\r\nexport type Point4dProps = number[];\r\n/**\r\n *\r\n * @param ddg numerator second derivative\r\n * @param dh denominator derivative\r\n * @param ddh denominator second derivative\r\n * @param f primary function (g/h)\r\n * @param df derivative of (g/h)\r\n * @param divH = (1/h)\r\n * @internal\r\n */\r\nfunction quotientDerivative2(ddg: number, dh: number, ddh: number,\r\n f: number, df: number, divH: number): number {\r\n return divH * (ddg - 2.0 * df * dh - f * ddh);\r\n}\r\n\r\n/** 4 Dimensional point (x,y,z,w) used in perspective calculations.\r\n * * the coordinates are stored in a Float64Array of length 4.\r\n * * properties `x`, `y`, `z`, `w` access array members.\r\n * *\r\n * * The coordinates are physically stored as a single Float64Array with 4 entries. (w last)\r\n * *\r\n * @public\r\n */\r\nexport class Point4d extends Plane3d implements BeJSONFunctions {\r\n /** x,y,z,w are packed into a Float64Array */\r\n public xyzw: Float64Array;\r\n /** Set x,y,z,w of this point. */\r\n public set(x: number = 0, y: number = 0, z: number = 0, w: number = 0): Point4d {\r\n this.xyzw[0] = x;\r\n this.xyzw[1] = y;\r\n this.xyzw[2] = z;\r\n this.xyzw[3] = w;\r\n return this;\r\n }\r\n /** Set a component by index.\r\n * * No change if index is out of range.\r\n */\r\n public setComponent(index: number, value: number) {\r\n if (index >= 0 && index < 4) {\r\n this.xyzw[index] = value;\r\n }\r\n }\r\n /** The x component. */\r\n public get x() { return this.xyzw[0]; }\r\n public set x(val: number) { this.xyzw[0] = val; }\r\n /** The y component. */\r\n public get y() { return this.xyzw[1]; }\r\n public set y(val: number) { this.xyzw[1] = val; }\r\n /** The z component. */\r\n public get z() { return this.xyzw[2]; }\r\n public set z(val: number) { this.xyzw[2] = val; }\r\n /** The w component of this point. */\r\n public get w() { return this.xyzw[3]; }\r\n public set w(val: number) { this.xyzw[3] = val; }\r\n /** Construct from coordinates. */\r\n protected constructor(x: number = 0, y: number = 0, z: number = 0, w: number = 0) {\r\n super();\r\n this.xyzw = new Float64Array(4);\r\n this.xyzw[0] = x;\r\n this.xyzw[1] = y;\r\n this.xyzw[2] = z;\r\n this.xyzw[3] = w;\r\n }\r\n /** Return a Point4d with specified x,y,z,w */\r\n public static create(x: number = 0, y: number = 0, z: number = 0, w: number = 0, result?: Point4d): Point4d {\r\n return result ? result.set(x, y, z, w) : new Point4d(x, y, z, w);\r\n }\r\n /**\r\n * Create a \"Point4d as a plane\" from \"any\" other [[PlaneAltitudeEvaluator]] type.\r\n * @param source\r\n * @returns\r\n */\r\n public static createPlaneFrom(source: PlaneAltitudeEvaluator): Point4d | undefined {\r\n return new Point4d(source.normalX(), source.normalY(), source.normalZ(), source.altitudeXYZ(0, 0, 0));\r\n }\r\n /** Copy coordinates from `other`. */\r\n public setFrom(other: Point4d): Point4d {\r\n this.xyzw[0] = other.xyzw[0];\r\n this.xyzw[1] = other.xyzw[1];\r\n this.xyzw[2] = other.xyzw[2];\r\n this.xyzw[3] = other.xyzw[3];\r\n return this;\r\n }\r\n /** Clone this point */\r\n public clone(result?: Point4d): Point4d {\r\n return result ? result.setFrom(this) : new Point4d(this.xyzw[0], this.xyzw[1], this.xyzw[2], this.xyzw[3]);\r\n }\r\n /** Set this point's xyzw from a json array `[x,y,z,w]` */\r\n public setFromJSON(json?: Point4dProps) {\r\n if (Geometry.isNumberArray(json, 4))\r\n this.set(json[0], json[1], json[2], json[3]);\r\n else\r\n this.set(0, 0, 0, 0);\r\n }\r\n\r\n /** Create a new point with coordinates from a json array `[x,y,z,w]` */\r\n public static fromJSON(json?: Point4dProps): Point4d {\r\n const result = new Point4d();\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Near-equality test, using `Geometry.isSameCoordinate` on all 4 x,y,z,w */\r\n public isAlmostEqual(other: Point4d): boolean {\r\n return Geometry.isSameCoordinate(this.x, other.x)\r\n && Geometry.isSameCoordinate(this.y, other.y)\r\n && Geometry.isSameCoordinate(this.z, other.z)\r\n && Geometry.isSameCoordinate(this.w, other.w);\r\n }\r\n /**\r\n * Test for same coordinate by direct x,y,z,w args\r\n * @param x x to test\r\n * @param y y to test\r\n * @param z z to test\r\n * @param w w to test\r\n */\r\n public isAlmostEqualXYZW(x: number, y: number, z: number, w: number): boolean {\r\n return Geometry.isSameCoordinate(this.x, x)\r\n && Geometry.isSameCoordinate(this.y, y)\r\n && Geometry.isSameCoordinate(this.z, z)\r\n && Geometry.isSameCoordinate(this.w, w);\r\n }\r\n\r\n /**\r\n * Convert an Angle to a JSON object.\r\n * @return {*} [x,y,z,w]\r\n */\r\n public toJSON(): Point4dProps {\r\n return [this.xyzw[0], this.xyzw[1], this.xyzw[2], this.xyzw[3]];\r\n }\r\n /** Return the 4d distance from this point to other, with all 4 components squared into the hypotenuse.\r\n * * x,y,z,w all participate without normalization.\r\n */\r\n public distanceXYZW(other: Point4d): number {\r\n return Geometry.hypotenuseXYZW(other.xyzw[0] - this.xyzw[0], other.xyzw[1] - this.xyzw[1], other.xyzw[2] - this.xyzw[2], other.xyzw[3] - this.xyzw[3]);\r\n }\r\n /** Return the squared 4d distance from this point to other, with all 4 components squared into the hypotenuse.\r\n * * x,y,z,w all participate without normalization.\r\n */\r\n public distanceSquaredXYZW(other: Point4d): number {\r\n return Geometry.hypotenuseSquaredXYZW(other.xyzw[0] - this.xyzw[0], other.xyzw[1] - this.xyzw[1], other.xyzw[2] - this.xyzw[2], other.xyzw[3] - this.xyzw[3]);\r\n }\r\n /** Return the distance between the instance and other after normalizing by weights\r\n */\r\n public realDistanceXY(other: Point4d): number | undefined {\r\n const wA = this.w;\r\n const wB = other.w;\r\n if (Geometry.isSmallMetricDistance(wA) || Geometry.isSmallMetricDistance(wB))\r\n return undefined;\r\n return Geometry.hypotenuseXY(other.xyzw[0] / wB - this.xyzw[0] / wA, other.xyzw[1] / wB - this.xyzw[1] / wA);\r\n }\r\n /** Return the largest absolute distance between corresponding components\r\n * * x,y,z,w all participate without normalization.\r\n */\r\n public maxDiff(other: Point4d): number {\r\n return Math.max(Math.abs(other.xyzw[0] - this.xyzw[0]), Math.abs(other.xyzw[1] - this.xyzw[1]), Math.abs(other.xyzw[2] - this.xyzw[2]), Math.abs(other.xyzw[3] - this.xyzw[3]));\r\n }\r\n /** Return the largest absolute entry of all 4 components x,y,z,w */\r\n public maxAbs(): number {\r\n return Math.max(Math.abs(this.xyzw[0]), Math.abs(this.xyzw[1]), Math.abs(this.xyzw[2]), Math.abs(this.xyzw[3]));\r\n }\r\n /** Returns the magnitude including all 4 components x,y,z,w */\r\n public magnitudeXYZW(): number {\r\n return Geometry.hypotenuseXYZW(this.xyzw[0], this.xyzw[1], this.xyzw[2], this.xyzw[3]);\r\n }\r\n /** Returns the magnitude of the leading xyz components. w is ignored. (i.e. the leading xyz are NOT divided by w.) */\r\n public magnitudeSquaredXYZ(): number {\r\n return Geometry.hypotenuseSquaredXYZ(this.xyzw[0], this.xyzw[1], this.xyzw[2]);\r\n }\r\n\r\n /** Return the difference (this-other) using all 4 components x,y,z,w */\r\n public minus(other: Point4d, result?: Point4d): Point4d {\r\n return Point4d.create(this.xyzw[0] - other.xyzw[0], this.xyzw[1] - other.xyzw[1], this.xyzw[2] - other.xyzw[2], this.xyzw[3] - other.xyzw[3], result);\r\n }\r\n /** Return `((other.w * this) - (this.w * other))` */\r\n public crossWeightedMinus(other: Point4d, result?: Vector3d): Vector3d {\r\n const wa = this.xyzw[3];\r\n const wb = other.xyzw[3];\r\n return Vector3d.create(wb * this.xyzw[0] - wa * other.xyzw[0], wb * this.xyzw[1] - wa * other.xyzw[1], wb * this.xyzw[2] - wa * other.xyzw[2], result);\r\n }\r\n /** Return `((other.w * this) - (this.w * other))`, with other.w known to be 1 */\r\n public crossWeightedMinusPoint3d(other: Point3d, result?: Vector3d): Vector3d {\r\n const wa = this.xyzw[3];\r\n return Vector3d.create(this.xyzw[0] - wa * other.x, this.xyzw[1] - wa * other.y, this.xyzw[2] - wa * other.z, result);\r\n }\r\n /** Return the sum of this and other, using all 4 components x,y,z,w */\r\n public plus(other: Point4d, result?: Point4d): Point4d {\r\n return Point4d.create(this.xyzw[0] + other.xyzw[0], this.xyzw[1] + other.xyzw[1], this.xyzw[2] + other.xyzw[2], this.xyzw[3] + other.xyzw[3], result);\r\n }\r\n /** Test if all components are nearly zero. */\r\n public get isAlmostZero(): boolean {\r\n return Geometry.isSmallMetricDistance(this.maxAbs());\r\n }\r\n /** Create a point with zero in all coordinates. */\r\n public static createZero(): Point4d { return new Point4d(0, 0, 0, 0); }\r\n /**\r\n * Create plane coefficients for the plane containing pointA, pointB, and 0010.\r\n * @param pointA first point\r\n * @param pointB second point\r\n */\r\n public static createPlanePointPointZ(pointA: Point4d, pointB: Point4d, result?: Point4d) {\r\n return Point4d.create(pointA.y * pointB.w - pointA.w * pointB.y, pointA.w * pointB.x - pointA.x * pointB.w, 0.0, pointA.x * pointB.y - pointA.y * pointB.x, result);\r\n }\r\n /**\r\n * extract 4 consecutive numbers from a Float64Array into a Point4d.\r\n * @param data buffer of numbers\r\n * @param xIndex first index for x,y,z,w sequence\r\n */\r\n public static createFromPackedXYZW(data: Float64Array, xIndex: number = 0, result?: Point4d): Point4d {\r\n return Point4d.create(data[xIndex], data[xIndex + 1], data[xIndex + 2], data[xIndex + 3], result);\r\n }\r\n /** Create a `Point4d` with x,y,z from an `XYAndZ` input, and w from a separate number. */\r\n public static createFromPointAndWeight(xyz: XYAndZ, w: number): Point4d {\r\n return new Point4d(xyz.x, xyz.y, xyz.z, w);\r\n }\r\n /** Create a `Point4d` from\r\n * * Point2d, Point3d, or Point4d\r\n * * other structure with members x,y and optional z,w\r\n * * array of numbers\r\n * * default z is 0.0\r\n * * default w is 1.0 (array[3] can replace)\r\n */\r\n\r\n public static createFromPoint(point: XAndY | XYAndZ | Point4d | number[]): Point4d {\r\n if (point instanceof Point2d)\r\n return new Point4d(point.x, point.y, 0, 1);\r\n if (point instanceof Point3d)\r\n return new Point4d(point.x, point.y, point.z, 1);\r\n if (point instanceof Point4d)\r\n return point.clone();\r\n // hm ... some flavor of x,y,z subset ...\r\n if (Array.isArray(point)) {\r\n const x1 = point.length > 0 ? point[0] : 0.0;\r\n const y1 = point.length > 1 ? point[1] : 0.0;\r\n const z1 = point.length > 2 ? point[2] : 0.0;\r\n const w1 = point.length > 3 ? point[3] : 1.0;\r\n return new Point4d(x1, y1, z1, w1);\r\n }\r\n const x = point.x;\r\n const y = point.y;\r\n const z = point.hasOwnProperty(\"z\") ? (point as any).z : 0.0;\r\n const w = point.hasOwnProperty(\"w\") ? (point as any).w : 1.0;\r\n return new Point4d(x, y, z, w);\r\n\r\n }\r\n /** Return `point + vector * scalar` */\r\n public plusScaled(vector: Point4d, scaleFactor: number, result?: Point4d): Point4d {\r\n return Point4d.create(this.xyzw[0] + vector.xyzw[0] * scaleFactor, this.xyzw[1] + vector.xyzw[1] * scaleFactor, this.xyzw[2] + vector.xyzw[2] * scaleFactor, this.xyzw[3] + vector.xyzw[3] * scaleFactor, result);\r\n }\r\n /** Return interpolation between instance and pointB at fraction\r\n */\r\n public interpolate(fraction: number, pointB: Point4d, result?: Point4d): Point4d {\r\n const v = 1.0 - fraction;\r\n return Point4d.create(this.xyzw[0] * v + pointB.xyzw[0] * fraction, this.xyzw[1] * v + pointB.xyzw[1] * fraction, this.xyzw[2] * v + pointB.xyzw[2] * fraction, this.xyzw[3] * v + pointB.xyzw[3] * fraction, result);\r\n }\r\n /** Return `point + vectorA * scalarA + vectorB * scalarB` */\r\n public plus2Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, result?: Point4d): Point4d {\r\n return Point4d.create(this.xyzw[0] + vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB, this.xyzw[1] + vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB, this.xyzw[2] + vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB, this.xyzw[3] + vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB, result);\r\n }\r\n /** Return `point + vectorA * scalarA + vectorB * scalarB + vectorC * scalarC` */\r\n public plus3Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, vectorC: Point4d, scalarC: number, result?: Point4d): Point4d {\r\n return Point4d.create(this.xyzw[0] + vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB + vectorC.xyzw[0] * scalarC, this.xyzw[1] + vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB + vectorC.xyzw[1] * scalarC, this.xyzw[2] + vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB + vectorC.xyzw[2] * scalarC, this.xyzw[3] + vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB + vectorC.xyzw[3] * scalarC, result);\r\n }\r\n /** Return `point + vectorA * scalarA + vectorB * scalarB` */\r\n public static createAdd2Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, result?: Point4d): Point4d {\r\n return Point4d.create(vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB, vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB, vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB, vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB, result);\r\n }\r\n /** Return `point + vectorA \\ scalarA + vectorB * scalarB + vectorC * scalarC` */\r\n public static createAdd3Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, vectorC: Point4d, scalarC: number, result?: Point4d): Point4d {\r\n return Point4d.create(vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB + vectorC.xyzw[0] * scalarC, vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB + vectorC.xyzw[1] * scalarC, vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB + vectorC.xyzw[2] * scalarC, vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB + vectorC.xyzw[3] * scalarC, result);\r\n }\r\n /** Return dot product of (4d) vectors from the instance to targetA and targetB */\r\n public dotVectorsToTargets(targetA: Point4d, targetB: Point4d): number {\r\n return (targetA.xyzw[0] - this.xyzw[0]) * (targetB.xyzw[0] - this.xyzw[0]) +\r\n (targetA.xyzw[1] - this.xyzw[1]) * (targetB.xyzw[1] - this.xyzw[1]) +\r\n (targetA.xyzw[2] - this.xyzw[2]) * (targetB.xyzw[2] - this.xyzw[2]) +\r\n (targetA.xyzw[3] - this.xyzw[3]) * (targetB.xyzw[3] - this.xyzw[3]);\r\n }\r\n /** return (4d) dot product of the instance and other point. */\r\n public dotProduct(other: Point4d): number {\r\n return this.xyzw[0] * other.xyzw[0] + this.xyzw[1] * other.xyzw[1] + this.xyzw[2] * other.xyzw[2] + this.xyzw[3] * other.xyzw[3];\r\n }\r\n /** return (4d) dot product of the instance with xyzw */\r\n public dotProductXYZW(x: number, y: number, z: number, w: number): number {\r\n return this.xyzw[0] * x + this.xyzw[1] * y + this.xyzw[2] * z + this.xyzw[3] * w;\r\n }\r\n /** dotProduct with (point.x, point.y, point.z, 1) Used in PlaneAltitudeEvaluator interface */\r\n public altitude(point: Point3d): number {\r\n return this.xyzw[0] * point.x + this.xyzw[1] * point.y + this.xyzw[2] * point.z + this.xyzw[3];\r\n }\r\n /** dotProduct with (x, y, z, 1) Used in PlaneAltitudeEvaluator interface */\r\n public altitudeXYZ(x: number, y: number, z: number): number {\r\n return this.xyzw[0] * x + this.xyzw[1] * y + this.xyzw[2] * z + this.xyzw[3];\r\n }\r\n /** dotProduct with (point.x, point.y, point.z, point.w) Used in PlaneAltitudeEvaluator interface */\r\n public weightedAltitude(point: Point4d): number {\r\n return this.xyzw[0] * point.x + this.xyzw[1] * point.y + this.xyzw[2] * point.z + this.xyzw[3] * point.w;\r\n }\r\n /** dotProduct with (vector.x, vector.y, vector.z, 0). Used in PlaneAltitudeEvaluator interface */\r\n public velocity(vector: Vector3d): number {\r\n return this.xyzw[0] * vector.x + this.xyzw[1] * vector.y + this.xyzw[2] * vector.z;\r\n }\r\n /** dotProduct with (x,y,z, 0). Used in PlaneAltitudeEvaluator interface */\r\n public velocityXYZ(x: number, y: number, z: number): number {\r\n return this.xyzw[0] * x + this.xyzw[1] * y + this.xyzw[2] * z;\r\n }\r\n /**\r\n * Return the x component of the normal used to evaluate altitude.\r\n */\r\n public normalX(): number { return this.x; }\r\n /**\r\n * Return the x component of the normal used to evaluate altitude.\r\n */\r\n public normalY(): number { return this.y; }\r\n /**\r\n * Return the z component of the normal used to evaluate altitude.\r\n */\r\n public normalZ(): number { return this.z; }\r\n\r\n /** unit X vector */\r\n public static unitX(): Point4d { return new Point4d(1, 0, 0, 0); }\r\n /** unit Y vector */\r\n public static unitY(): Point4d { return new Point4d(0, 1, 0, 0); }\r\n /** unit Z vector */\r\n public static unitZ(): Point4d { return new Point4d(0, 0, 1, 0); }\r\n /** unit W vector */\r\n public static unitW(): Point4d { return new Point4d(0, 0, 0, 1); }\r\n /** Divide by denominator, but return undefined if denominator is zero. */\r\n public safeDivideOrNull(denominator: number, result?: Point4d): Point4d | undefined {\r\n if (denominator !== 0.0) {\r\n return this.scale(1.0 / denominator, result);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * * Return xyz projection of spacePoint to the plane of the DPoint4d (understood as coefficients, not point coordinates)\r\n * * If the xyz part of `this` are all zero, (a clone of) `spacePoint` is returned.\r\n */\r\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\r\n const h = this.altitude(spacePoint);\r\n const nn = this.magnitudeSquaredXYZ();\r\n const alpha = Geometry.conditionalDivideCoordinate(-h, nn);\r\n if (alpha === undefined)\r\n return spacePoint.clone(result);\r\n return spacePoint.plusXYZ(alpha * this.x, alpha * this.y, alpha * this.z, result);\r\n }\r\n /** scale all components (including w!!) */\r\n public scale(scale: number, result?: Point4d): Point4d {\r\n result = result ? result : new Point4d();\r\n result.xyzw[0] = this.xyzw[0] * scale;\r\n result.xyzw[1] = this.xyzw[1] * scale;\r\n result.xyzw[2] = this.xyzw[2] * scale;\r\n result.xyzw[3] = this.xyzw[3] * scale;\r\n return result;\r\n }\r\n /** Negate components (including w!!) */\r\n public negate(result?: Point4d): Point4d {\r\n result = result ? result : new Point4d();\r\n result.xyzw[0] = -this.xyzw[0];\r\n result.xyzw[1] = -this.xyzw[1];\r\n result.xyzw[2] = -this.xyzw[2];\r\n result.xyzw[3] = -this.xyzw[3];\r\n return result;\r\n }\r\n /**\r\n * If `this.w` is nonzero, return a 4d point `(x/w,y/w,z/w, 1)`\r\n * If `this.w` is zero, return undefined.\r\n * @param result optional result\r\n */\r\n public normalizeWeight(result?: Point4d): Point4d | undefined {\r\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\r\n result = result ? result : new Point4d();\r\n return this.safeDivideOrNull(mag, result);\r\n }\r\n /**\r\n * If `this.w` is nonzero, return a 3d point `(x/w,y/w,z/w)`\r\n * If `this.w` is zero, return undefined.\r\n * @param result optional result\r\n */\r\n public realPoint(result?: Point3d): Point3d | undefined {\r\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\r\n if (mag === 0.0)\r\n return undefined;\r\n const a = 1.0 / mag; // in zero case everything multiplies right back to true zero.\r\n return Point3d.create(this.xyzw[0] * a, this.xyzw[1] * a, this.xyzw[2] * a, result);\r\n }\r\n\r\n /** Convert the homogeneous point to a (strongly typed) point or vector.\r\n * * If `this.w` is nonzero, return a Point3d `(x/w,y/w,z/w)`\r\n * * If `this.w` is zero, return a Vector3d `(x,y,z)`\r\n */\r\n public realPointOrVector(): Point3d | Vector3d {\r\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\r\n if (mag === 0.0)\r\n return Vector3d.create(this.x, this.y, this.z);\r\n const a = 1.0 / mag; // in zero case everything multiplies right back to true zero.\r\n return Point3d.create(this.x * a, this.y * a, this.z * a);\r\n }\r\n /**\r\n * * If w is nonzero, return Point3d with x/w,y/w,z/w.\r\n * * If w is zero, return 000\r\n * @param x x coordinate\r\n * @param y y coordinate\r\n * @param z z coordinate\r\n * @param w w coordinate\r\n * @param result optional result\r\n */\r\n public static createRealPoint3dDefault000(x: number, y: number, z: number, w: number, result?: Point3d): Point3d {\r\n const mag = Geometry.correctSmallFraction(w);\r\n const a = mag === 0 ? 0.0 : (1.0 / mag); // in zero case everything multiplies right back to true zero.\r\n return Point3d.create(x * a, y * a, z * a, result);\r\n }\r\n /**\r\n * * If w is nonzero, return Vector3d which is the derivative of the projected xyz with given w and 4d derivatives.\r\n * * If w is zero, return 000\r\n * @param x x coordinate\r\n * @param y y coordinate\r\n * @param z z coordinate\r\n * @param w w coordinate\r\n * @param dx x coordinate of derivative\r\n * @param dy y coordinate of derivative\r\n * @param dz z coordinate of derivative\r\n * @param dw w coordinate of derivative\r\n * @param result optional result\r\n */\r\n public static createRealDerivativeRay3dDefault000(x: number, y: number, z: number, w: number, dx: number, dy: number, dz: number, dw: number, result?: Ray3d): Ray3d {\r\n const mag = Geometry.correctSmallFraction(w);\r\n // real point is X/w.\r\n // real derivative is (X' * w - X *w) / ww, and weight is always 0 by cross products.\r\n const a = mag === 0 ? 0.0 : (1.0 / mag); // in zero case everything multiplies right back to true zero.\r\n const aa = a * a;\r\n return Ray3d.createXYZUVW(x * a, y * a, z * a, (dx * w - dw * x) * aa, (dy * w - dw * y) * aa, (dz * w - dw * z) * aa, result);\r\n }\r\n /**\r\n * * If w is nonzero, return Vector3d which is the derivative of the projected xyz with given w and 4d derivatives.\r\n * * If w is zero, return 000\r\n * @param x x coordinate\r\n * @param y y coordinate\r\n * @param z z coordinate\r\n * @param w w coordinate\r\n * @param dx x coordinate of derivative\r\n * @param dy y coordinate of derivative\r\n * @param dz z coordinate of derivative\r\n * @param dw w coordinate of derivative\r\n * @param result optional result\r\n */\r\n public static createRealDerivativePlane3dByOriginAndVectorsDefault000(x: number, y: number, z: number, w: number, dx: number, dy: number, dz: number, dw: number, ddx: number, ddy: number, ddz: number, ddw: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n const mag = Geometry.correctSmallFraction(w);\r\n // real point is X/w.\r\n // real derivative is (X' * w - X *w) / ww, and weight is always 0 by cross products.\r\n const a = mag === 0 ? 0.0 : (1.0 / mag); // in zero case everything multiplies right back to true zero.\r\n const aa = a * a;\r\n const fx = x * a;\r\n const fy = y * a;\r\n const fz = z * a;\r\n const dfx = (dx * w - dw * x) * aa;\r\n const dfy = (dy * w - dw * y) * aa;\r\n const dfz = (dz * w - dw * z) * aa;\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(fx, fy, fz, dfx, dfy, dfz, quotientDerivative2(ddx, dw, ddw, fx, dfx, a), quotientDerivative2(ddy, dw, ddw, fy, dfy, a), quotientDerivative2(ddz, dw, ddw, fz, dfz, a), result);\r\n }\r\n /**\r\n * * If this.w is nonzero, return Point3d with x/w,y/w,z/w.\r\n * * If this.w is zero, return 000\r\n */\r\n public realPointDefault000(result?: Point3d): Point3d {\r\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\r\n if (mag === 0.0)\r\n return Point3d.create(0, 0, 0, result);\r\n result = result ? result : new Point3d();\r\n const a = 1.0 / mag;\r\n return Point3d.create(this.xyzw[0] * a, this.xyzw[1] * a, this.xyzw[2] * a, result);\r\n }\r\n /** divide all components (x,y,z,w) by the 4d magnitude.\r\n *\r\n * * This is appropriate for normalizing a quaternion\r\n * * Use normalizeWeight to divide by the w component.\r\n */\r\n public normalizeXYZW(result?: Point4d): Point4d | undefined {\r\n const mag = Geometry.correctSmallFraction(this.magnitudeXYZW());\r\n result = result ? result : new Point4d();\r\n return this.safeDivideOrNull(mag, result);\r\n }\r\n\r\n /**\r\n * Return the determinant of the 3x3 matrix using components i,j,k of the 3 inputs.\r\n */\r\n public static determinantIndexed3X3(pointA: Point4d, pointB: Point4d, pointC: Point4d, i: number, j: number, k: number) {\r\n return Geometry.tripleProduct(\r\n pointA.xyzw[i], pointA.xyzw[j], pointA.xyzw[k],\r\n pointB.xyzw[i], pointB.xyzw[j], pointB.xyzw[k],\r\n pointC.xyzw[i], pointC.xyzw[j], pointC.xyzw[k]);\r\n }\r\n /**\r\n * Return a Point4d perpendicular to all 3 inputs. (A higher level cross product concept)\r\n * @param pointA first point\r\n * @param pointB second point\r\n * @param pointC third point\r\n */\r\n public static perpendicularPoint4dPlane(pointA: Point4d, pointB: Point4d, pointC: Point4d): Point4d {\r\n return Point4d.create(\r\n Point4d.determinantIndexed3X3(pointA, pointB, pointC, 1, 2, 3),\r\n -Point4d.determinantIndexed3X3(pointA, pointB, pointC, 2, 3, 0),\r\n Point4d.determinantIndexed3X3(pointA, pointB, pointC, 3, 0, 1),\r\n -Point4d.determinantIndexed3X3(pointA, pointB, pointC, 0, 1, 2));\r\n }\r\n /** Treating this Point4d as plane coefficients, convert to origin and normal form. */\r\n public toPlane3dByOriginAndUnitNormal(result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined {\r\n return Plane3dByOriginAndUnitNormal.createFrom(this, result);\r\n }\r\n /** Normalize so sum of squares of all 4 coordinates is 1. */\r\n public normalizeQuaternion() {\r\n const magnitude = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\r\n\r\n if (magnitude > 0.0) {\r\n const f = 1.0 / magnitude;\r\n this.x *= f;\r\n this.y *= f;\r\n this.z *= f;\r\n this.w *= f;\r\n }\r\n return magnitude;\r\n }\r\n /** Return a (normalized) quaternion interpolated between two quaternions. */\r\n public static interpolateQuaternions(quaternion0: Point4d, fractionParameter: number, quaternion1: Point4d, result?: Point4d): Point4d {\r\n if (!result)\r\n result = new Point4d();\r\n const maxSafeCosine = 0.9995;\r\n\r\n // return exact quaternions for special values\r\n if (0.0 === fractionParameter) {\r\n result = quaternion0;\r\n return result;\r\n }\r\n if (1.0 === fractionParameter) {\r\n result = quaternion1;\r\n return result;\r\n }\r\n if (0.5 === fractionParameter) {\r\n quaternion0.plus(quaternion1, result);\r\n result.normalizeQuaternion();\r\n return result;\r\n }\r\n\r\n const q0 = quaternion0.clone();\r\n const q1 = quaternion1.clone();\r\n let dot = quaternion0.dotProduct(quaternion1);\r\n\r\n // prevent interpolation through the longer great arc\r\n if (dot < 0.0) {\r\n q1.negate(q1);\r\n dot = -dot;\r\n }\r\n\r\n // if nearly parallel, use interpolate and renormalize .\r\n if (dot > maxSafeCosine) {\r\n q0.interpolate(fractionParameter, q1, result);\r\n result.normalizeQuaternion();\r\n return result;\r\n }\r\n\r\n // safety check\r\n if (dot < -1.0)\r\n dot = -1.0;\r\n else if (dot > 1.0)\r\n dot = 1.0;\r\n\r\n // create orthonormal basis {q0, q2}\r\n const q2 = new Point4d();\r\n q1.plusScaled(q0, -dot, q2); // bsiDPoint4d_addScaledDPoint4d(& q2, & q1, & q0, -dot);\r\n q2.normalizeQuaternion();\r\n\r\n const angle = Math.acos(dot);\r\n const angleOfInterpolation = angle * fractionParameter;\r\n result = Point4d.createAdd2Scaled(q0, Math.cos(angleOfInterpolation), q2, Math.sin(angleOfInterpolation));\r\n return result;\r\n }\r\n /** Measure the \"angle\" between two points, using all 4 components in the dot product that\r\n * gives the cosine of the angle.\r\n */\r\n public radiansToPoint4dXYZW(other: Point4d): number | undefined {\r\n const magA = this.magnitudeXYZW();\r\n const magB = other.magnitudeXYZW();\r\n const dot = this.dotProduct(other); // == cos (theta) * magA * magB\r\n const cos = Geometry.conditionalDivideFraction(dot, magA * magB);\r\n if (cos === undefined)\r\n return undefined;\r\n return Math.acos(cos);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Point4d.js","sourceRoot":"","sources":["../../../src/geometry4d/Point4d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAmB,QAAQ,EAA0B,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAQ5C;;;;;;;;;GASG;AACH,SAAS,mBAAmB,CAAC,GAAW,EAAE,EAAU,EAAE,GAAW,EAC/D,CAAS,EAAE,EAAU,EAAE,IAAY;IACnC,OAAO,IAAI,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,OAAQ,SAAQ,OAAO;IAGlC,kCAAkC;I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B,OAAO,SAAS,CAAC;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Numerics\r\n */\r\nimport { BeJSONFunctions, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\r\nimport { Plane3d } from \"../geometry3d/Plane3d\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\r\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\r\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { XAndY, XYAndZ } from \"../geometry3d/XYZProps\";\r\n\r\n/**\r\n * 4d point packed in an array of 4 numbers.\r\n * @public\r\n */\r\nexport type Point4dProps = number[];\r\n/**\r\n *\r\n * @param ddg numerator second derivative\r\n * @param dh denominator derivative\r\n * @param ddh denominator second derivative\r\n * @param f primary function (g/h)\r\n * @param df derivative of (g/h)\r\n * @param divH = (1/h)\r\n * @internal\r\n */\r\nfunction quotientDerivative2(ddg: number, dh: number, ddh: number,\r\n f: number, df: number, divH: number): number {\r\n return divH * (ddg - 2.0 * df * dh - f * ddh);\r\n}\r\n\r\n/** 4 Dimensional point (x,y,z,w) used in perspective calculations.\r\n * * the coordinates are stored in a Float64Array of length 4.\r\n * * properties `x`, `y`, `z`, `w` access array members.\r\n * *\r\n * * The coordinates are physically stored as a single Float64Array with 4 entries. (w last)\r\n * *\r\n * @public\r\n */\r\nexport class Point4d extends Plane3d implements BeJSONFunctions {\r\n /** x,y,z,w are packed into a Float64Array */\r\n public xyzw: Float64Array;\r\n /** Set x,y,z,w of this point. */\r\n public set(x: number = 0, y: number = 0, z: number = 0, w: number = 0): Point4d {\r\n this.xyzw[0] = x;\r\n this.xyzw[1] = y;\r\n this.xyzw[2] = z;\r\n this.xyzw[3] = w;\r\n return this;\r\n }\r\n /** Set a component by index.\r\n * * No change if index is out of range.\r\n */\r\n public setComponent(index: number, value: number) {\r\n if (index >= 0 && index < 4) {\r\n this.xyzw[index] = value;\r\n }\r\n }\r\n /** The x component. */\r\n public get x() { return this.xyzw[0]; }\r\n public set x(val: number) { this.xyzw[0] = val; }\r\n /** The y component. */\r\n public get y() { return this.xyzw[1]; }\r\n public set y(val: number) { this.xyzw[1] = val; }\r\n /** The z component. */\r\n public get z() { return this.xyzw[2]; }\r\n public set z(val: number) { this.xyzw[2] = val; }\r\n /** The w component of this point. */\r\n public get w() { return this.xyzw[3]; }\r\n public set w(val: number) { this.xyzw[3] = val; }\r\n /** Construct from coordinates. */\r\n protected constructor(x: number = 0, y: number = 0, z: number = 0, w: number = 0) {\r\n super();\r\n this.xyzw = new Float64Array(4);\r\n this.xyzw[0] = x;\r\n this.xyzw[1] = y;\r\n this.xyzw[2] = z;\r\n this.xyzw[3] = w;\r\n }\r\n /** Return a Point4d with specified x,y,z,w */\r\n public static create(x: number = 0, y: number = 0, z: number = 0, w: number = 0, result?: Point4d): Point4d {\r\n return result ? result.set(x, y, z, w) : new Point4d(x, y, z, w);\r\n }\r\n /**\r\n * Create a \"Point4d as a plane\" from \"any\" other [[PlaneAltitudeEvaluator]] type.\r\n * @param source\r\n * @returns\r\n */\r\n public static createPlaneFrom(source: PlaneAltitudeEvaluator): Point4d | undefined {\r\n return new Point4d(source.normalX(), source.normalY(), source.normalZ(), source.altitudeXYZ(0, 0, 0));\r\n }\r\n /** Copy coordinates from `other`. */\r\n public setFrom(other: Point4d): Point4d {\r\n this.xyzw[0] = other.xyzw[0];\r\n this.xyzw[1] = other.xyzw[1];\r\n this.xyzw[2] = other.xyzw[2];\r\n this.xyzw[3] = other.xyzw[3];\r\n return this;\r\n }\r\n /** Clone this point */\r\n public clone(result?: Point4d): Point4d {\r\n return result ? result.setFrom(this) : new Point4d(this.xyzw[0], this.xyzw[1], this.xyzw[2], this.xyzw[3]);\r\n }\r\n /** Set this point's xyzw from a json array `[x,y,z,w]` */\r\n public setFromJSON(json?: Point4dProps) {\r\n if (Geometry.isNumberArray(json, 4))\r\n this.set(json[0], json[1], json[2], json[3]);\r\n else\r\n this.set(0, 0, 0, 0);\r\n }\r\n\r\n /** Create a new point with coordinates from a json array `[x,y,z,w]` */\r\n public static fromJSON(json?: Point4dProps): Point4d {\r\n const result = new Point4d();\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Near-equality test, using `Geometry.isSameCoordinate` on all 4 x,y,z,w */\r\n public isAlmostEqual(other: Point4d): boolean {\r\n return Geometry.isSameCoordinate(this.x, other.x)\r\n && Geometry.isSameCoordinate(this.y, other.y)\r\n && Geometry.isSameCoordinate(this.z, other.z)\r\n && Geometry.isSameCoordinate(this.w, other.w);\r\n }\r\n /**\r\n * Test for same coordinate by direct x,y,z,w args\r\n * @param x x to test\r\n * @param y y to test\r\n * @param z z to test\r\n * @param w w to test\r\n */\r\n public isAlmostEqualXYZW(x: number, y: number, z: number, w: number): boolean {\r\n return Geometry.isSameCoordinate(this.x, x)\r\n && Geometry.isSameCoordinate(this.y, y)\r\n && Geometry.isSameCoordinate(this.z, z)\r\n && Geometry.isSameCoordinate(this.w, w);\r\n }\r\n\r\n /**\r\n * Convert an Angle to a JSON object.\r\n * @return {*} [x,y,z,w]\r\n */\r\n public toJSON(): Point4dProps {\r\n return [this.xyzw[0], this.xyzw[1], this.xyzw[2], this.xyzw[3]];\r\n }\r\n /** Return the 4d distance from this point to other, with all 4 components squared into the hypotenuse.\r\n * * x,y,z,w all participate without normalization.\r\n */\r\n public distanceXYZW(other: Point4d): number {\r\n return Geometry.hypotenuseXYZW(other.xyzw[0] - this.xyzw[0], other.xyzw[1] - this.xyzw[1], other.xyzw[2] - this.xyzw[2], other.xyzw[3] - this.xyzw[3]);\r\n }\r\n /** Return the squared 4d distance from this point to other, with all 4 components squared into the hypotenuse.\r\n * * x,y,z,w all participate without normalization.\r\n */\r\n public distanceSquaredXYZW(other: Point4d): number {\r\n return Geometry.hypotenuseSquaredXYZW(other.xyzw[0] - this.xyzw[0], other.xyzw[1] - this.xyzw[1], other.xyzw[2] - this.xyzw[2], other.xyzw[3] - this.xyzw[3]);\r\n }\r\n /** Return the distance between the instance and other after normalizing by weights\r\n */\r\n public realDistanceXY(other: Point4d): number | undefined {\r\n const wA = this.w;\r\n const wB = other.w;\r\n if (Geometry.isSmallMetricDistance(wA) || Geometry.isSmallMetricDistance(wB))\r\n return undefined;\r\n return Geometry.hypotenuseXY(other.xyzw[0] / wB - this.xyzw[0] / wA, other.xyzw[1] / wB - this.xyzw[1] / wA);\r\n }\r\n /** Return the largest absolute distance between corresponding components\r\n * * x,y,z,w all participate without normalization.\r\n */\r\n public maxDiff(other: Point4d): number {\r\n return Math.max(Math.abs(other.xyzw[0] - this.xyzw[0]), Math.abs(other.xyzw[1] - this.xyzw[1]), Math.abs(other.xyzw[2] - this.xyzw[2]), Math.abs(other.xyzw[3] - this.xyzw[3]));\r\n }\r\n /** Return the largest absolute entry of all 4 components x,y,z,w */\r\n public maxAbs(): number {\r\n return Math.max(Math.abs(this.xyzw[0]), Math.abs(this.xyzw[1]), Math.abs(this.xyzw[2]), Math.abs(this.xyzw[3]));\r\n }\r\n /** Returns the magnitude including all 4 components x,y,z,w */\r\n public magnitudeXYZW(): number {\r\n return Geometry.hypotenuseXYZW(this.xyzw[0], this.xyzw[1], this.xyzw[2], this.xyzw[3]);\r\n }\r\n /** Returns the magnitude of the leading xyz components. w is ignored. (i.e. the leading xyz are NOT divided by w.) */\r\n public magnitudeSquaredXYZ(): number {\r\n return Geometry.hypotenuseSquaredXYZ(this.xyzw[0], this.xyzw[1], this.xyzw[2]);\r\n }\r\n\r\n /** Return the difference (this-other) using all 4 components x,y,z,w */\r\n public minus(other: Point4d, result?: Point4d): Point4d {\r\n return Point4d.create(this.xyzw[0] - other.xyzw[0], this.xyzw[1] - other.xyzw[1], this.xyzw[2] - other.xyzw[2], this.xyzw[3] - other.xyzw[3], result);\r\n }\r\n /** Return `((other.w * this) - (this.w * other))` */\r\n public crossWeightedMinus(other: Point4d, result?: Vector3d): Vector3d {\r\n const wa = this.xyzw[3];\r\n const wb = other.xyzw[3];\r\n return Vector3d.create(wb * this.xyzw[0] - wa * other.xyzw[0], wb * this.xyzw[1] - wa * other.xyzw[1], wb * this.xyzw[2] - wa * other.xyzw[2], result);\r\n }\r\n /** Return `((other.w * this) - (this.w * other))`, with other.w known to be 1 */\r\n public crossWeightedMinusPoint3d(other: Point3d, result?: Vector3d): Vector3d {\r\n const wa = this.xyzw[3];\r\n return Vector3d.create(this.xyzw[0] - wa * other.x, this.xyzw[1] - wa * other.y, this.xyzw[2] - wa * other.z, result);\r\n }\r\n /** Return the sum of this and other, using all 4 components x,y,z,w */\r\n public plus(other: Point4d, result?: Point4d): Point4d {\r\n return Point4d.create(this.xyzw[0] + other.xyzw[0], this.xyzw[1] + other.xyzw[1], this.xyzw[2] + other.xyzw[2], this.xyzw[3] + other.xyzw[3], result);\r\n }\r\n /** Test if all components are nearly zero. */\r\n public get isAlmostZero(): boolean {\r\n return Geometry.isSmallMetricDistance(this.maxAbs());\r\n }\r\n /** Create a point with zero in all coordinates. */\r\n public static createZero(): Point4d { return new Point4d(0, 0, 0, 0); }\r\n /**\r\n * Create plane coefficients for the plane containing pointA, pointB, and 0010.\r\n * @param pointA first point\r\n * @param pointB second point\r\n */\r\n public static createPlanePointPointZ(pointA: Point4d, pointB: Point4d, result?: Point4d) {\r\n return Point4d.create(pointA.y * pointB.w - pointA.w * pointB.y, pointA.w * pointB.x - pointA.x * pointB.w, 0.0, pointA.x * pointB.y - pointA.y * pointB.x, result);\r\n }\r\n /**\r\n * extract 4 consecutive numbers from a Float64Array into a Point4d.\r\n * @param data buffer of numbers\r\n * @param xIndex first index for x,y,z,w sequence\r\n */\r\n public static createFromPackedXYZW(data: Float64Array, xIndex: number = 0, result?: Point4d): Point4d {\r\n return Point4d.create(data[xIndex], data[xIndex + 1], data[xIndex + 2], data[xIndex + 3], result);\r\n }\r\n /** Create a `Point4d` with x,y,z from an `XYAndZ` input, and w from a separate number. */\r\n public static createFromPointAndWeight(xyz: XYAndZ, w: number): Point4d {\r\n return new Point4d(xyz.x, xyz.y, xyz.z, w);\r\n }\r\n /** Create a `Point4d` from\r\n * * Point2d, Point3d, or Point4d\r\n * * other structure with members x,y and optional z,w\r\n * * array of numbers\r\n * * default z is 0.0\r\n * * default w is 1.0 (array[3] can replace)\r\n */\r\n\r\n public static createFromPoint(point: XAndY | XYAndZ | Point4d | number[]): Point4d {\r\n if (point instanceof Point2d)\r\n return new Point4d(point.x, point.y, 0, 1);\r\n if (point instanceof Point3d)\r\n return new Point4d(point.x, point.y, point.z, 1);\r\n if (point instanceof Point4d)\r\n return point.clone();\r\n // hm ... some flavor of x,y,z subset ...\r\n if (Array.isArray(point)) {\r\n const x1 = point.length > 0 ? point[0] : 0.0;\r\n const y1 = point.length > 1 ? point[1] : 0.0;\r\n const z1 = point.length > 2 ? point[2] : 0.0;\r\n const w1 = point.length > 3 ? point[3] : 1.0;\r\n return new Point4d(x1, y1, z1, w1);\r\n }\r\n const x = point.x;\r\n const y = point.y;\r\n const z = point.hasOwnProperty(\"z\") ? (point as any).z : 0.0;\r\n const w = point.hasOwnProperty(\"w\") ? (point as any).w : 1.0;\r\n return new Point4d(x, y, z, w);\r\n\r\n }\r\n /** Return `point + vector * scalar` */\r\n public plusScaled(vector: Point4d, scaleFactor: number, result?: Point4d): Point4d {\r\n return Point4d.create(this.xyzw[0] + vector.xyzw[0] * scaleFactor, this.xyzw[1] + vector.xyzw[1] * scaleFactor, this.xyzw[2] + vector.xyzw[2] * scaleFactor, this.xyzw[3] + vector.xyzw[3] * scaleFactor, result);\r\n }\r\n /** Return interpolation between instance and pointB at fraction\r\n */\r\n public interpolate(fraction: number, pointB: Point4d, result?: Point4d): Point4d {\r\n const v = 1.0 - fraction;\r\n return Point4d.create(this.xyzw[0] * v + pointB.xyzw[0] * fraction, this.xyzw[1] * v + pointB.xyzw[1] * fraction, this.xyzw[2] * v + pointB.xyzw[2] * fraction, this.xyzw[3] * v + pointB.xyzw[3] * fraction, result);\r\n }\r\n /** Return `point + vectorA * scalarA + vectorB * scalarB` */\r\n public plus2Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, result?: Point4d): Point4d {\r\n return Point4d.create(this.xyzw[0] + vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB, this.xyzw[1] + vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB, this.xyzw[2] + vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB, this.xyzw[3] + vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB, result);\r\n }\r\n /** Return `point + vectorA * scalarA + vectorB * scalarB + vectorC * scalarC` */\r\n public plus3Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, vectorC: Point4d, scalarC: number, result?: Point4d): Point4d {\r\n return Point4d.create(this.xyzw[0] + vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB + vectorC.xyzw[0] * scalarC, this.xyzw[1] + vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB + vectorC.xyzw[1] * scalarC, this.xyzw[2] + vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB + vectorC.xyzw[2] * scalarC, this.xyzw[3] + vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB + vectorC.xyzw[3] * scalarC, result);\r\n }\r\n /** Return `point + vectorA * scalarA + vectorB * scalarB` */\r\n public static createAdd2Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, result?: Point4d): Point4d {\r\n return Point4d.create(vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB, vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB, vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB, vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB, result);\r\n }\r\n /** Return `point + vectorA \\ scalarA + vectorB * scalarB + vectorC * scalarC` */\r\n public static createAdd3Scaled(vectorA: Point4d, scalarA: number, vectorB: Point4d, scalarB: number, vectorC: Point4d, scalarC: number, result?: Point4d): Point4d {\r\n return Point4d.create(vectorA.xyzw[0] * scalarA + vectorB.xyzw[0] * scalarB + vectorC.xyzw[0] * scalarC, vectorA.xyzw[1] * scalarA + vectorB.xyzw[1] * scalarB + vectorC.xyzw[1] * scalarC, vectorA.xyzw[2] * scalarA + vectorB.xyzw[2] * scalarB + vectorC.xyzw[2] * scalarC, vectorA.xyzw[3] * scalarA + vectorB.xyzw[3] * scalarB + vectorC.xyzw[3] * scalarC, result);\r\n }\r\n /** Return dot product of (4d) vectors from the instance to targetA and targetB */\r\n public dotVectorsToTargets(targetA: Point4d, targetB: Point4d): number {\r\n return (targetA.xyzw[0] - this.xyzw[0]) * (targetB.xyzw[0] - this.xyzw[0]) +\r\n (targetA.xyzw[1] - this.xyzw[1]) * (targetB.xyzw[1] - this.xyzw[1]) +\r\n (targetA.xyzw[2] - this.xyzw[2]) * (targetB.xyzw[2] - this.xyzw[2]) +\r\n (targetA.xyzw[3] - this.xyzw[3]) * (targetB.xyzw[3] - this.xyzw[3]);\r\n }\r\n /** return (4d) dot product of the instance and other point. */\r\n public dotProduct(other: Point4d): number {\r\n return this.xyzw[0] * other.xyzw[0] + this.xyzw[1] * other.xyzw[1] + this.xyzw[2] * other.xyzw[2] + this.xyzw[3] * other.xyzw[3];\r\n }\r\n /** return (4d) dot product of the instance with xyzw */\r\n public dotProductXYZW(x: number, y: number, z: number, w: number): number {\r\n return this.xyzw[0] * x + this.xyzw[1] * y + this.xyzw[2] * z + this.xyzw[3] * w;\r\n }\r\n /** dotProduct with (point.x, point.y, point.z, 1) Used in PlaneAltitudeEvaluator interface */\r\n public altitude(point: Point3d): number {\r\n return this.xyzw[0] * point.x + this.xyzw[1] * point.y + this.xyzw[2] * point.z + this.xyzw[3];\r\n }\r\n /** dotProduct with (x, y, z, 1) Used in PlaneAltitudeEvaluator interface */\r\n public altitudeXYZ(x: number, y: number, z: number): number {\r\n return this.xyzw[0] * x + this.xyzw[1] * y + this.xyzw[2] * z + this.xyzw[3];\r\n }\r\n /** dotProduct with (point.x, point.y, point.z, point.w) Used in PlaneAltitudeEvaluator interface */\r\n public weightedAltitude(point: Point4d): number {\r\n return this.xyzw[0] * point.x + this.xyzw[1] * point.y + this.xyzw[2] * point.z + this.xyzw[3] * point.w;\r\n }\r\n /** dotProduct with (vector.x, vector.y, vector.z, 0). Used in PlaneAltitudeEvaluator interface */\r\n public velocity(vector: Vector3d): number {\r\n return this.xyzw[0] * vector.x + this.xyzw[1] * vector.y + this.xyzw[2] * vector.z;\r\n }\r\n /** dotProduct with (x,y,z, 0). Used in PlaneAltitudeEvaluator interface */\r\n public velocityXYZ(x: number, y: number, z: number): number {\r\n return this.xyzw[0] * x + this.xyzw[1] * y + this.xyzw[2] * z;\r\n }\r\n /**\r\n * Return the x component of the normal used to evaluate altitude.\r\n */\r\n public normalX(): number { return this.x; }\r\n /**\r\n * Return the x component of the normal used to evaluate altitude.\r\n */\r\n public normalY(): number { return this.y; }\r\n /**\r\n * Return the z component of the normal used to evaluate altitude.\r\n */\r\n public normalZ(): number { return this.z; }\r\n\r\n /** unit X vector */\r\n public static unitX(): Point4d { return new Point4d(1, 0, 0, 0); }\r\n /** unit Y vector */\r\n public static unitY(): Point4d { return new Point4d(0, 1, 0, 0); }\r\n /** unit Z vector */\r\n public static unitZ(): Point4d { return new Point4d(0, 0, 1, 0); }\r\n /** unit W vector */\r\n public static unitW(): Point4d { return new Point4d(0, 0, 0, 1); }\r\n /** Divide by denominator, but return undefined if denominator is zero. */\r\n public safeDivideOrNull(denominator: number, result?: Point4d): Point4d | undefined {\r\n if (denominator !== 0.0) {\r\n return this.scale(1.0 / denominator, result);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * * Return xyz projection of spacePoint to the plane (this Point4d is understood as plane coefficients, not point coordinates)\r\n * * If the xyz part of `this` are all zero, (a clone of) `spacePoint` is returned.\r\n */\r\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\r\n const h = this.altitude(spacePoint);\r\n const nn = this.magnitudeSquaredXYZ();\r\n const alpha = Geometry.conditionalDivideCoordinate(-h, nn);\r\n if (alpha === undefined)\r\n return spacePoint.clone(result);\r\n return spacePoint.plusXYZ(alpha * this.x, alpha * this.y, alpha * this.z, result);\r\n }\r\n /** scale all components (including w!!) */\r\n public scale(scale: number, result?: Point4d): Point4d {\r\n result = result ? result : new Point4d();\r\n result.xyzw[0] = this.xyzw[0] * scale;\r\n result.xyzw[1] = this.xyzw[1] * scale;\r\n result.xyzw[2] = this.xyzw[2] * scale;\r\n result.xyzw[3] = this.xyzw[3] * scale;\r\n return result;\r\n }\r\n /** Negate components (including w!!) */\r\n public negate(result?: Point4d): Point4d {\r\n result = result ? result : new Point4d();\r\n result.xyzw[0] = -this.xyzw[0];\r\n result.xyzw[1] = -this.xyzw[1];\r\n result.xyzw[2] = -this.xyzw[2];\r\n result.xyzw[3] = -this.xyzw[3];\r\n return result;\r\n }\r\n /**\r\n * If `this.w` is nonzero, return a 4d point `(x/w,y/w,z/w, 1)`\r\n * If `this.w` is zero, return undefined.\r\n * @param result optional result\r\n */\r\n public normalizeWeight(result?: Point4d): Point4d | undefined {\r\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\r\n result = result ? result : new Point4d();\r\n return this.safeDivideOrNull(mag, result);\r\n }\r\n /**\r\n * If `this.w` is nonzero, return a 3d point `(x/w,y/w,z/w)`\r\n * If `this.w` is zero, return undefined.\r\n * @param result optional result\r\n */\r\n public realPoint(result?: Point3d): Point3d | undefined {\r\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\r\n if (mag === 0.0)\r\n return undefined;\r\n const a = 1.0 / mag; // in zero case everything multiplies right back to true zero.\r\n return Point3d.create(this.xyzw[0] * a, this.xyzw[1] * a, this.xyzw[2] * a, result);\r\n }\r\n\r\n /** Convert the homogeneous point to a (strongly typed) point or vector.\r\n * * If `this.w` is nonzero, return a Point3d `(x/w,y/w,z/w)`\r\n * * If `this.w` is zero, return a Vector3d `(x,y,z)`\r\n */\r\n public realPointOrVector(): Point3d | Vector3d {\r\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\r\n if (mag === 0.0)\r\n return Vector3d.create(this.x, this.y, this.z);\r\n const a = 1.0 / mag; // in zero case everything multiplies right back to true zero.\r\n return Point3d.create(this.x * a, this.y * a, this.z * a);\r\n }\r\n /**\r\n * * If w is nonzero, return Point3d with x/w,y/w,z/w.\r\n * * If w is zero, return 000\r\n * @param x x coordinate\r\n * @param y y coordinate\r\n * @param z z coordinate\r\n * @param w w coordinate\r\n * @param result optional result\r\n */\r\n public static createRealPoint3dDefault000(x: number, y: number, z: number, w: number, result?: Point3d): Point3d {\r\n const mag = Geometry.correctSmallFraction(w);\r\n const a = mag === 0 ? 0.0 : (1.0 / mag); // in zero case everything multiplies right back to true zero.\r\n return Point3d.create(x * a, y * a, z * a, result);\r\n }\r\n /**\r\n * * If w is nonzero, return Vector3d which is the derivative of the projected xyz with given w and 4d derivatives.\r\n * * If w is zero, return 000\r\n * @param x x coordinate\r\n * @param y y coordinate\r\n * @param z z coordinate\r\n * @param w w coordinate\r\n * @param dx x coordinate of derivative\r\n * @param dy y coordinate of derivative\r\n * @param dz z coordinate of derivative\r\n * @param dw w coordinate of derivative\r\n * @param result optional result\r\n */\r\n public static createRealDerivativeRay3dDefault000(x: number, y: number, z: number, w: number, dx: number, dy: number, dz: number, dw: number, result?: Ray3d): Ray3d {\r\n const mag = Geometry.correctSmallFraction(w);\r\n // real point is X/w.\r\n // real derivative is (X' * w - X *w) / ww, and weight is always 0 by cross products.\r\n const a = mag === 0 ? 0.0 : (1.0 / mag); // in zero case everything multiplies right back to true zero.\r\n const aa = a * a;\r\n return Ray3d.createXYZUVW(x * a, y * a, z * a, (dx * w - dw * x) * aa, (dy * w - dw * y) * aa, (dz * w - dw * z) * aa, result);\r\n }\r\n /**\r\n * * If w is nonzero, return Vector3d which is the derivative of the projected xyz with given w and 4d derivatives.\r\n * * If w is zero, return 000\r\n * @param x x coordinate\r\n * @param y y coordinate\r\n * @param z z coordinate\r\n * @param w w coordinate\r\n * @param dx x coordinate of derivative\r\n * @param dy y coordinate of derivative\r\n * @param dz z coordinate of derivative\r\n * @param dw w coordinate of derivative\r\n * @param result optional result\r\n */\r\n public static createRealDerivativePlane3dByOriginAndVectorsDefault000(x: number, y: number, z: number, w: number, dx: number, dy: number, dz: number, dw: number, ddx: number, ddy: number, ddz: number, ddw: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n const mag = Geometry.correctSmallFraction(w);\r\n // real point is X/w.\r\n // real derivative is (X' * w - X *w) / ww, and weight is always 0 by cross products.\r\n const a = mag === 0 ? 0.0 : (1.0 / mag); // in zero case everything multiplies right back to true zero.\r\n const aa = a * a;\r\n const fx = x * a;\r\n const fy = y * a;\r\n const fz = z * a;\r\n const dfx = (dx * w - dw * x) * aa;\r\n const dfy = (dy * w - dw * y) * aa;\r\n const dfz = (dz * w - dw * z) * aa;\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(fx, fy, fz, dfx, dfy, dfz, quotientDerivative2(ddx, dw, ddw, fx, dfx, a), quotientDerivative2(ddy, dw, ddw, fy, dfy, a), quotientDerivative2(ddz, dw, ddw, fz, dfz, a), result);\r\n }\r\n /**\r\n * * If this.w is nonzero, return Point3d with x/w,y/w,z/w.\r\n * * If this.w is zero, return 000\r\n */\r\n public realPointDefault000(result?: Point3d): Point3d {\r\n const mag = Geometry.correctSmallFraction(this.xyzw[3]);\r\n if (mag === 0.0)\r\n return Point3d.create(0, 0, 0, result);\r\n result = result ? result : new Point3d();\r\n const a = 1.0 / mag;\r\n return Point3d.create(this.xyzw[0] * a, this.xyzw[1] * a, this.xyzw[2] * a, result);\r\n }\r\n /** divide all components (x,y,z,w) by the 4d magnitude.\r\n *\r\n * * This is appropriate for normalizing a quaternion\r\n * * Use normalizeWeight to divide by the w component.\r\n */\r\n public normalizeXYZW(result?: Point4d): Point4d | undefined {\r\n const mag = Geometry.correctSmallFraction(this.magnitudeXYZW());\r\n result = result ? result : new Point4d();\r\n return this.safeDivideOrNull(mag, result);\r\n }\r\n\r\n /**\r\n * Return the determinant of the 3x3 matrix using components i,j,k of the 3 inputs.\r\n */\r\n public static determinantIndexed3X3(pointA: Point4d, pointB: Point4d, pointC: Point4d, i: number, j: number, k: number) {\r\n return Geometry.tripleProduct(\r\n pointA.xyzw[i], pointA.xyzw[j], pointA.xyzw[k],\r\n pointB.xyzw[i], pointB.xyzw[j], pointB.xyzw[k],\r\n pointC.xyzw[i], pointC.xyzw[j], pointC.xyzw[k]);\r\n }\r\n /**\r\n * Return a Point4d perpendicular to all 3 inputs. (A higher level cross product concept)\r\n * @param pointA first point\r\n * @param pointB second point\r\n * @param pointC third point\r\n */\r\n public static perpendicularPoint4dPlane(pointA: Point4d, pointB: Point4d, pointC: Point4d): Point4d {\r\n return Point4d.create(\r\n Point4d.determinantIndexed3X3(pointA, pointB, pointC, 1, 2, 3),\r\n -Point4d.determinantIndexed3X3(pointA, pointB, pointC, 2, 3, 0),\r\n Point4d.determinantIndexed3X3(pointA, pointB, pointC, 3, 0, 1),\r\n -Point4d.determinantIndexed3X3(pointA, pointB, pointC, 0, 1, 2));\r\n }\r\n /** Treating this Point4d as plane coefficients, convert to origin and normal form. */\r\n public toPlane3dByOriginAndUnitNormal(result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined {\r\n return Plane3dByOriginAndUnitNormal.createFrom(this, result);\r\n }\r\n /** Normalize so sum of squares of all 4 coordinates is 1. */\r\n public normalizeQuaternion() {\r\n const magnitude = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\r\n\r\n if (magnitude > 0.0) {\r\n const f = 1.0 / magnitude;\r\n this.x *= f;\r\n this.y *= f;\r\n this.z *= f;\r\n this.w *= f;\r\n }\r\n return magnitude;\r\n }\r\n /** Return a (normalized) quaternion interpolated between two quaternions. */\r\n public static interpolateQuaternions(quaternion0: Point4d, fractionParameter: number, quaternion1: Point4d, result?: Point4d): Point4d {\r\n if (!result)\r\n result = new Point4d();\r\n const maxSafeCosine = 0.9995;\r\n\r\n // return exact quaternions for special values\r\n if (0.0 === fractionParameter) {\r\n result = quaternion0;\r\n return result;\r\n }\r\n if (1.0 === fractionParameter) {\r\n result = quaternion1;\r\n return result;\r\n }\r\n if (0.5 === fractionParameter) {\r\n quaternion0.plus(quaternion1, result);\r\n result.normalizeQuaternion();\r\n return result;\r\n }\r\n\r\n const q0 = quaternion0.clone();\r\n const q1 = quaternion1.clone();\r\n let dot = quaternion0.dotProduct(quaternion1);\r\n\r\n // prevent interpolation through the longer great arc\r\n if (dot < 0.0) {\r\n q1.negate(q1);\r\n dot = -dot;\r\n }\r\n\r\n // if nearly parallel, use interpolate and renormalize .\r\n if (dot > maxSafeCosine) {\r\n q0.interpolate(fractionParameter, q1, result);\r\n result.normalizeQuaternion();\r\n return result;\r\n }\r\n\r\n // safety check\r\n if (dot < -1.0)\r\n dot = -1.0;\r\n else if (dot > 1.0)\r\n dot = 1.0;\r\n\r\n // create orthonormal basis {q0, q2}\r\n const q2 = new Point4d();\r\n q1.plusScaled(q0, -dot, q2); // bsiDPoint4d_addScaledDPoint4d(& q2, & q1, & q0, -dot);\r\n q2.normalizeQuaternion();\r\n\r\n const angle = Math.acos(dot);\r\n const angleOfInterpolation = angle * fractionParameter;\r\n result = Point4d.createAdd2Scaled(q0, Math.cos(angleOfInterpolation), q2, Math.sin(angleOfInterpolation));\r\n return result;\r\n }\r\n /** Measure the \"angle\" between two points, using all 4 components in the dot product that\r\n * gives the cosine of the angle.\r\n */\r\n public radiansToPoint4dXYZW(other: Point4d): number | undefined {\r\n const magA = this.magnitudeXYZW();\r\n const magB = other.magnitudeXYZW();\r\n const dot = this.dotProduct(other); // == cos (theta) * magA * magB\r\n const cos = Geometry.conditionalDivideFraction(dot, magA * magB);\r\n if (cos === undefined)\r\n return undefined;\r\n return Math.acos(cos);\r\n }\r\n}\r\n"]}
|
|
@@ -72,9 +72,9 @@ export declare abstract class BezierCoffs {
|
|
|
72
72
|
* @param a constant to add.
|
|
73
73
|
*/
|
|
74
74
|
addInPlace(a: number): void;
|
|
75
|
-
/** Compute parameter values where the bezier value matches
|
|
75
|
+
/** Compute parameter values where the bezier value matches targetValue.
|
|
76
76
|
* * The base class finds roots only in 01. (i.e. ignores _restrictTo01)
|
|
77
|
-
* * Order-specific implementations apply special case
|
|
77
|
+
* * Order-specific implementations apply special case analytic logic, e.g. for degree 1,2,3,4.
|
|
78
78
|
*/
|
|
79
79
|
roots(targetValue: number, _restrictTo01: boolean): number[] | undefined;
|
|
80
80
|
/** Given an array of numbers, optionally remove those not in the 0..1 interval.
|
|
@@ -272,11 +272,10 @@ export declare class UnivariateBezier extends BezierCoffs {
|
|
|
272
272
|
*/
|
|
273
273
|
runNewton(startFraction: number, tolerance?: number): number | undefined;
|
|
274
274
|
/** Find roots of a bezier polynomial
|
|
275
|
-
* * Only look for roots in 0..1
|
|
276
275
|
* * As roots are found, deflate the polynomial.
|
|
277
276
|
* * bezier coffs are changed (and order reduced) at each step.
|
|
278
277
|
*/
|
|
279
|
-
static
|
|
278
|
+
static deflateRoots(bezier: UnivariateBezier): number[] | undefined;
|
|
280
279
|
}
|
|
281
280
|
/** Bezier polynomial specialized to order 2 (2 coefficients, straight line function)\
|
|
282
281
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BezierPolynomials.d.ts","sourceRoot":"","sources":["../../../src/numerics/BezierPolynomials.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,oBAA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C,MAAM,EAAE,sBAAsB,GAAG,YAAY;IAY5F;;;OAGG;IACI,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY;IAcrE;;;;;;OAMG;IACI,iBAAiB,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY;IAiB1G;;;;;;OAMG;IACI,2BAA2B,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY;IAsBpH;;;OAGG;IACI,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAWlC,6DAA6D;IACtD,kCAAkC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM;IAOrF,+FAA+F;IACxF,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAGnC,yDAAyD;IAClD,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,oBAAoB,GAAG,IAAI;CAuCtF"}
|
|
@@ -86,14 +86,15 @@ export class BezierCoffs {
|
|
|
86
86
|
for (let i = 0; i < this.coffs.length; i++)
|
|
87
87
|
this.coffs[i] += a;
|
|
88
88
|
}
|
|
89
|
-
/** Compute parameter values where the bezier value matches
|
|
89
|
+
/** Compute parameter values where the bezier value matches targetValue.
|
|
90
90
|
* * The base class finds roots only in 01. (i.e. ignores _restrictTo01)
|
|
91
|
-
* * Order-specific implementations apply special case
|
|
91
|
+
* * Order-specific implementations apply special case analytic logic, e.g. for degree 1,2,3,4.
|
|
92
92
|
*/
|
|
93
93
|
roots(targetValue, _restrictTo01) {
|
|
94
94
|
const bezier = UnivariateBezier.create(this);
|
|
95
95
|
bezier.addInPlace(-targetValue);
|
|
96
|
-
|
|
96
|
+
const roots = UnivariateBezier.deflateRoots(bezier);
|
|
97
|
+
return this.filter01(roots, true);
|
|
97
98
|
}
|
|
98
99
|
/** Given an array of numbers, optionally remove those not in the 0..1 interval.
|
|
99
100
|
* @param roots candidate values
|
|
@@ -121,7 +122,9 @@ export class BezierCoffs {
|
|
|
121
122
|
return undefined;
|
|
122
123
|
}
|
|
123
124
|
/** zero out all coefficients. */
|
|
124
|
-
zero() {
|
|
125
|
+
zero() {
|
|
126
|
+
this.coffs.fill(0);
|
|
127
|
+
}
|
|
125
128
|
/** Subdivide -- write results into caller-supplied bezier coffs (which must be of the same order) */
|
|
126
129
|
subdivide(u, left, right) {
|
|
127
130
|
const order = this.order;
|
|
@@ -644,11 +647,10 @@ export class UnivariateBezier extends BezierCoffs {
|
|
|
644
647
|
// first c0*b0 = a0
|
|
645
648
|
// last c[orderC-1]*b1 = a[orderA-1]
|
|
646
649
|
/** Find roots of a bezier polynomial
|
|
647
|
-
* * Only look for roots in 0..1
|
|
648
650
|
* * As roots are found, deflate the polynomial.
|
|
649
651
|
* * bezier coffs are changed (and order reduced) at each step.
|
|
650
652
|
*/
|
|
651
|
-
static
|
|
653
|
+
static deflateRoots(bezier) {
|
|
652
654
|
const roots = [];
|
|
653
655
|
const coffs = bezier.coffs;
|
|
654
656
|
let a0, a1, segmentFraction, globalStartFraction, newtonFraction;
|