@itwin/core-geometry 5.10.0-dev.1 → 5.10.0-dev.11
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 +22 -1
- package/lib/cjs/clipping/BooleanClipNode.d.ts +28 -29
- package/lib/cjs/clipping/BooleanClipNode.d.ts.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.js +61 -29
- package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +12 -13
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +19 -12
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.d.ts +13 -8
- package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +18 -7
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.d.ts +13 -5
- package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.d.ts +11 -5
- package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipVector.js +22 -7
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +7 -20
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +16 -20
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +8 -19
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +19 -22
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +4 -4
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +5 -6
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +4 -4
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +4 -6
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.d.ts +2 -3
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js +5 -6
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.d.ts +4 -3
- package/lib/cjs/geometry3d/Ellipsoid.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js +7 -4
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +2 -0
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +4 -0
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.d.ts +16 -11
- package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js +16 -11
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js +8 -13
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/solid/Box.d.ts +2 -0
- package/lib/cjs/solid/Box.d.ts.map +1 -1
- package/lib/cjs/solid/Box.js +4 -0
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.d.ts +12 -0
- package/lib/cjs/solid/Cone.d.ts.map +1 -1
- package/lib/cjs/solid/Cone.js +23 -0
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts +2 -0
- package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
- package/lib/cjs/solid/LinearSweep.js +4 -0
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts +2 -0
- package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js +4 -0
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.d.ts +8 -1
- package/lib/cjs/solid/SolidPrimitive.d.ts.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.js +8 -0
- package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
- package/lib/cjs/solid/Sphere.d.ts +2 -0
- package/lib/cjs/solid/Sphere.d.ts.map +1 -1
- package/lib/cjs/solid/Sphere.js +4 -0
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.d.ts +2 -0
- package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
- package/lib/cjs/solid/TorusPipe.js +4 -0
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.d.ts +28 -29
- package/lib/esm/clipping/BooleanClipNode.d.ts.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.js +61 -29
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +12 -13
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +19 -12
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts +13 -8
- package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +18 -7
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.d.ts +13 -5
- package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.d.ts +11 -5
- package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
- package/lib/esm/clipping/ClipVector.js +22 -7
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +7 -20
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +16 -20
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +8 -19
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +19 -22
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +4 -4
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +5 -6
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +4 -4
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +4 -6
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.d.ts +2 -3
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js +5 -6
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.d.ts +4 -3
- package/lib/esm/geometry3d/Ellipsoid.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js +7 -4
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +2 -0
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +4 -0
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.d.ts +16 -11
- package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js +16 -11
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js +8 -13
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/solid/Box.d.ts +2 -0
- package/lib/esm/solid/Box.d.ts.map +1 -1
- package/lib/esm/solid/Box.js +4 -0
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.d.ts +12 -0
- package/lib/esm/solid/Cone.d.ts.map +1 -1
- package/lib/esm/solid/Cone.js +23 -0
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.d.ts +2 -0
- package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
- package/lib/esm/solid/LinearSweep.js +4 -0
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts +2 -0
- package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/esm/solid/RotationalSweep.js +4 -0
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.d.ts +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SolidPrimitive.d.ts +8 -1
- package/lib/esm/solid/SolidPrimitive.d.ts.map +1 -1
- package/lib/esm/solid/SolidPrimitive.js +8 -0
- package/lib/esm/solid/SolidPrimitive.js.map +1 -1
- package/lib/esm/solid/Sphere.d.ts +2 -0
- package/lib/esm/solid/Sphere.d.ts.map +1 -1
- package/lib/esm/solid/Sphere.js +4 -0
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/TorusPipe.d.ts +2 -0
- package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
- package/lib/esm/solid/TorusPipe.js +4 -0
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/package.json +3 -3
|
@@ -33,9 +33,8 @@ export declare class AppendPlaneIntersectionStrokeHandler extends NewtonRtoRStro
|
|
|
33
33
|
private announceSolutionFraction;
|
|
34
34
|
evaluate(fraction: number): boolean;
|
|
35
35
|
/**
|
|
36
|
-
* * ASSUME both the "A" and "B"
|
|
37
|
-
* * If function value changed sign between, interpolate an approximate root and improve it with
|
|
38
|
-
* the newton solver.
|
|
36
|
+
* * ASSUME both the "A" and "B" evaluations (fraction, function, and derivative) are known.
|
|
37
|
+
* * If function value changed sign between, interpolate an approximate root and improve it with the newton solver.
|
|
39
38
|
*/
|
|
40
39
|
private searchInterval;
|
|
41
40
|
/** Evaluate and save _functionB, _derivativeB, and _fractionB. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppendPlaneIntersectionStrokeHandler.d.ts","sourceRoot":"","sources":["../../../../src/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAY,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGrE,OAAO,EAA0C,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACxG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,qBAAa,oCAAqC,SAAQ,uBAAwB,YAAW,cAAc;IACzG,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,cAAc,CAAwB;IAC9C,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,UAAU,CAAa;IAE/B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,aAAa,CAAa;IAElC,OAAO,CAAC,IAAI,CAAQ;IACpB,OAAO,CAAC,aAAa,CAAyC;
|
|
1
|
+
{"version":3,"file":"AppendPlaneIntersectionStrokeHandler.d.ts","sourceRoot":"","sources":["../../../../src/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAY,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGrE,OAAO,EAA0C,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACxG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,qBAAa,oCAAqC,SAAQ,uBAAwB,YAAW,cAAc;IACzG,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,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
// private derivativeA: number;
|
|
23
|
+
// private derivativeA: number; <---- Not currently used
|
|
24
24
|
_functionB = 0;
|
|
25
25
|
_fractionB = 0;
|
|
26
26
|
_derivativeB = 0;
|
|
@@ -52,8 +52,7 @@ export class AppendPlaneIntersectionStrokeHandler extends NewtonRtoRStrokeHandle
|
|
|
52
52
|
this._functionA = 0.0;
|
|
53
53
|
// this.derivativeA = 0.0;
|
|
54
54
|
}
|
|
55
|
-
endCurvePrimitive() {
|
|
56
|
-
}
|
|
55
|
+
endCurvePrimitive() { }
|
|
57
56
|
announceIntervalForUniformStepStrokes(cp, numStrokes, fraction0, fraction1) {
|
|
58
57
|
this.startCurvePrimitive(cp);
|
|
59
58
|
if (numStrokes < 1)
|
|
@@ -93,13 +92,13 @@ export class AppendPlaneIntersectionStrokeHandler extends NewtonRtoRStrokeHandle
|
|
|
93
92
|
const curve = this.effectiveCurve();
|
|
94
93
|
if (!curve)
|
|
95
94
|
return false;
|
|
95
|
+
// the Newton function is just plane altitude: curve points that lie on the plane are altitude roots (i.e., altitude = 0).
|
|
96
96
|
this.currentF = this._plane.altitude(curve.fractionToPoint(fraction));
|
|
97
97
|
return true;
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
100
|
-
* * ASSUME both the "A" and "B"
|
|
101
|
-
* * If function value changed sign between, interpolate an approximate root and improve it with
|
|
102
|
-
* the newton solver.
|
|
100
|
+
* * ASSUME both the "A" and "B" evaluations (fraction, function, and derivative) are known.
|
|
101
|
+
* * If function value changed sign between, interpolate an approximate root and improve it with the newton solver.
|
|
103
102
|
*/
|
|
104
103
|
searchInterval() {
|
|
105
104
|
if (this._functionA * this._functionB > 0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppendPlaneIntersectionStrokeHandler.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EA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AI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACpC,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/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { Geometry, PlaneAltitudeEvaluator } from \"../../Geometry\";\r\nimport { IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\r\nimport { Point3d, Vector3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\r\nimport { Order2Bezier } from \"../../numerics/BezierPolynomials\";\r\nimport { Newton1dUnboundedApproximateDerivative, NewtonRtoRStrokeHandler } from \"../../numerics/Newton\";\r\nimport { CurveLocationDetail } from \"../CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"../CurvePrimitive\";\r\n\r\n/**\r\n * Context for computing intersections of a CurvePrimitive with a plane.\r\n * @internal\r\n */\r\nexport class AppendPlaneIntersectionStrokeHandler extends NewtonRtoRStrokeHandler implements IStrokeHandler {\r\n private _curve: CurvePrimitive | undefined;\r\n private _plane: PlaneAltitudeEvaluator;\r\n private _intersections: CurveLocationDetail[];\r\n private _fractionA: number = 0;\r\n private _functionA: number = 0;\r\n // private derivativeA: number; <---- Not currently used\r\n private _functionB: number = 0;\r\n private _fractionB: number = 0;\r\n private _derivativeB: number = 0;\r\n private _numThisCurve: number = 0;\r\n // scratch vars for use within methods.\r\n private _ray: Ray3d;\r\n private _newtonSolver: Newton1dUnboundedApproximateDerivative;\r\n\r\n // Return the first defined curve among: this.parentCurvePrimitive, this.curve;\r\n public effectiveCurve(): CurvePrimitive | undefined {\r\n if (this._parentCurvePrimitive)\r\n return this._parentCurvePrimitive;\r\n return this._curve;\r\n }\r\n\r\n public get getDerivativeB() {\r\n return this._derivativeB; // <--- _derivativeB is not currently used anywhere. Provided getter to suppress lint error\r\n }\r\n\r\n public constructor(plane: PlaneAltitudeEvaluator, intersections: CurveLocationDetail[]) {\r\n super();\r\n this._plane = plane;\r\n this._intersections = intersections;\r\n this.startCurvePrimitive(undefined);\r\n this._ray = Ray3d.createZero();\r\n this._newtonSolver = new Newton1dUnboundedApproximateDerivative(this);\r\n }\r\n\r\n public startCurvePrimitive(curve: CurvePrimitive | undefined) {\r\n this._curve = curve;\r\n this._fractionA = 0.0;\r\n this._numThisCurve = 0;\r\n this._functionA = 0.0;\r\n // this.derivativeA = 0.0;\r\n }\r\n\r\n public endCurvePrimitive() {\r\n }\r\n\r\n public announceIntervalForUniformStepStrokes(\r\n cp: CurvePrimitive,\r\n numStrokes: number,\r\n fraction0: number,\r\n fraction1: number): void {\r\n this.startCurvePrimitive(cp);\r\n if (numStrokes < 1) numStrokes = 1;\r\n const df = 1.0 / numStrokes;\r\n for (let i = 0; i <= numStrokes; i++) {\r\n const fraction = Geometry.interpolate(fraction0, i * df, fraction1);\r\n cp.fractionToPointAndDerivative(fraction, this._ray);\r\n this.announcePointTangent(this._ray.origin, fraction, this._ray.direction);\r\n }\r\n }\r\n\r\n public announceSegmentInterval(\r\n _cp: CurvePrimitive,\r\n point0: Point3d,\r\n point1: Point3d,\r\n _numStrokes: number,\r\n fraction0: number,\r\n fraction1: number): void {\r\n const h0 = this._plane.altitude(point0);\r\n const h1 = this._plane.altitude(point1);\r\n if (h0 * h1 > 0.0)\r\n return;\r\n const fraction01 = Order2Bezier.solveCoffs(h0, h1);\r\n // let numIntersection = 0;\r\n if (fraction01 !== undefined) {\r\n // numIntersection++;\r\n const fraction = Geometry.interpolate(fraction0, fraction01, fraction1);\r\n this._newtonSolver.setX(fraction);\r\n if (this._newtonSolver.runIterations()) {\r\n this.announceSolutionFraction(this._newtonSolver.getX());\r\n }\r\n // this.intersections.push(CurveLocationDetail.createCurveFractionPoint(cp, fraction, cp.fractionToPoint(fraction)));\r\n }\r\n }\r\n\r\n private announceSolutionFraction(fraction: number) {\r\n const curve = this.effectiveCurve();\r\n if (curve) {\r\n this._ray = curve.fractionToPointAndDerivative(fraction, this._ray);\r\n this._intersections.push(CurveLocationDetail.createCurveFractionPoint(curve, fraction, this._ray.origin));\r\n }\r\n }\r\n\r\n public evaluate(fraction: number): boolean {\r\n const curve = this.effectiveCurve();\r\n if (!curve)\r\n return false;\r\n this.currentF = this._plane.altitude(curve.fractionToPoint(fraction));\r\n return true;\r\n }\r\n\r\n /**\r\n * * ASSUME both the \"A\" and \"B\" evaluations (fraction, function, and derivative) are known.\r\n * * If function value changed sign between, interpolate an approximate root and improve it with\r\n * the newton solver.\r\n */\r\n private searchInterval() {\r\n if (this._functionA * this._functionB > 0) return;\r\n if (this._functionA === 0) this.announceSolutionFraction(this._fractionA);\r\n if (this._functionB === 0) this.announceSolutionFraction(this._fractionB);\r\n if (this._functionA * this._functionB < 0) {\r\n const fraction = Geometry.inverseInterpolate(this._fractionA, this._functionA, this._fractionB, this._functionB);\r\n if (fraction) {\r\n this._newtonSolver.setX(fraction);\r\n if (this._newtonSolver.runIterations())\r\n this.announceSolutionFraction(this._newtonSolver.getX());\r\n }\r\n }\r\n }\r\n\r\n /** Evaluate and save _functionB, _derivativeB, and _fractionB. */\r\n private evaluateB(xyz: Point3d, fraction: number, tangent: Vector3d) {\r\n this._functionB = this._plane.altitude(xyz);\r\n this._derivativeB = this._plane.velocity(tangent);\r\n this._fractionB = fraction;\r\n }\r\n\r\n /**\r\n * Announce point and tangent for evaluations.\r\n * * The function evaluation is saved as the \"B\" function point.\r\n * * The function point count is incremented\r\n * * If function point count is greater than 1, the current interval is searched.\r\n * * The just-evaluated point (\"B\") is saved as the \"old\" (\"A\") evaluation point.\r\n * @param xyz\r\n * @param fraction\r\n * @param tangent\r\n */\r\n public announcePointTangent(xyz: Point3d, fraction: number, tangent: Vector3d): void {\r\n this.evaluateB(xyz, fraction, tangent);\r\n if (this._numThisCurve++ > 0) this.searchInterval();\r\n this._functionA = this._functionB;\r\n this._fractionA = this._fractionB;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"AppendPlaneIntersectionStrokeHandler.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAA0B,MAAM,gBAAgB,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,sCAAsC,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACxG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAG7D;;;GAGG;AACH,MAAM,OAAO,oCAAqC,SAAQ,uBAAuB;IACvE,MAAM,CAA6B;IACnC,MAAM,CAAyB;IAC/B,cAAc,CAAwB;IACtC,UAAU,GAAW,CAAC,CAAC;IACvB,UAAU,GAAW,CAAC,CAAC;IAC/B,yDAAyD;IACjD,UAAU,GAAW,CAAC,CAAC;IACvB,UAAU,GAAW,CAAC,CAAC;IACvB,YAAY,GAAW,CAAC,CAAC;IACzB,aAAa,GAAW,CAAC,CAAC;IAClC,uCAAuC;IAC/B,IAAI,CAAQ;IACZ,aAAa,CAAyC;IAC9D,+EAA+E;IACxE,cAAc;QACnB,IAAI,IAAI,CAAC,qBAAqB;YAC5B,OAAO,IAAI,CAAC,qBAAqB,CAAC;QACpC,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,2FAA2F;IACvH,CAAC;IACD,YAAmB,KAA6B,EAAE,aAAoC;QACpF,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,mBAAmB,CAAC,SAAS,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3E,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACvC,IAAI,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC;YAC1B,IAAI,CAAC,cAAc,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACpC,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/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { Geometry, PlaneAltitudeEvaluator } from \"../../Geometry\";\r\nimport { IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\r\nimport { Point3d, Vector3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\r\nimport { Order2Bezier } from \"../../numerics/BezierPolynomials\";\r\nimport { Newton1dUnboundedApproximateDerivative, NewtonRtoRStrokeHandler } from \"../../numerics/Newton\";\r\nimport { CurveLocationDetail } from \"../CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"../CurvePrimitive\";\r\n\r\n/**\r\n * Context for computing intersections of a CurvePrimitive with a plane.\r\n * @internal\r\n */\r\nexport class AppendPlaneIntersectionStrokeHandler extends NewtonRtoRStrokeHandler implements IStrokeHandler {\r\n private _curve: CurvePrimitive | undefined;\r\n private _plane: PlaneAltitudeEvaluator;\r\n private _intersections: CurveLocationDetail[];\r\n private _fractionA: number = 0;\r\n private _functionA: number = 0;\r\n // private derivativeA: number; <---- Not currently used\r\n private _functionB: number = 0;\r\n private _fractionB: number = 0;\r\n private _derivativeB: number = 0;\r\n private _numThisCurve: number = 0;\r\n // scratch vars for use within methods.\r\n private _ray: Ray3d;\r\n private _newtonSolver: Newton1dUnboundedApproximateDerivative;\r\n // Return the first defined curve among: this.parentCurvePrimitive, this.curve;\r\n public effectiveCurve(): CurvePrimitive | undefined {\r\n if (this._parentCurvePrimitive)\r\n return this._parentCurvePrimitive;\r\n return this._curve;\r\n }\r\n public get getDerivativeB() {\r\n return this._derivativeB; // <--- _derivativeB is not currently used anywhere. Provided getter to suppress lint error\r\n }\r\n public constructor(plane: PlaneAltitudeEvaluator, intersections: CurveLocationDetail[]) {\r\n super();\r\n this._plane = plane;\r\n this._intersections = intersections;\r\n this.startCurvePrimitive(undefined);\r\n this._ray = Ray3d.createZero();\r\n this._newtonSolver = new Newton1dUnboundedApproximateDerivative(this);\r\n }\r\n public startCurvePrimitive(curve: CurvePrimitive | undefined): void {\r\n this._curve = curve;\r\n this._fractionA = 0.0;\r\n this._numThisCurve = 0;\r\n this._functionA = 0.0;\r\n // this.derivativeA = 0.0;\r\n }\r\n public endCurvePrimitive() { }\r\n public announceIntervalForUniformStepStrokes(\r\n cp: CurvePrimitive,\r\n numStrokes: number,\r\n fraction0: number,\r\n fraction1: number,\r\n ): void {\r\n this.startCurvePrimitive(cp);\r\n if (numStrokes < 1)\r\n numStrokes = 1;\r\n const df = 1.0 / numStrokes;\r\n for (let i = 0; i <= numStrokes; i++) {\r\n const fraction = Geometry.interpolate(fraction0, i * df, fraction1);\r\n cp.fractionToPointAndDerivative(fraction, this._ray);\r\n this.announcePointTangent(this._ray.origin, fraction, this._ray.direction);\r\n }\r\n }\r\n public announceSegmentInterval(\r\n _cp: CurvePrimitive,\r\n point0: Point3d,\r\n point1: Point3d,\r\n _numStrokes: number,\r\n fraction0: number,\r\n fraction1: number,\r\n ): void {\r\n const h0 = this._plane.altitude(point0);\r\n const h1 = this._plane.altitude(point1);\r\n if (h0 * h1 > 0.0)\r\n return;\r\n const fraction01 = Order2Bezier.solveCoffs(h0, h1);\r\n // let numIntersection = 0;\r\n if (fraction01 !== undefined) {\r\n // numIntersection++;\r\n const fraction = Geometry.interpolate(fraction0, fraction01, fraction1);\r\n this._newtonSolver.setX(fraction);\r\n if (this._newtonSolver.runIterations()) {\r\n this.announceSolutionFraction(this._newtonSolver.getX());\r\n }\r\n // this.intersections.push(CurveLocationDetail.createCurveFractionPoint(cp, fraction, cp.fractionToPoint(fraction)));\r\n }\r\n }\r\n private announceSolutionFraction(fraction: number): void {\r\n const curve = this.effectiveCurve();\r\n if (curve) {\r\n this._ray = curve.fractionToPointAndDerivative(fraction, this._ray);\r\n this._intersections.push(CurveLocationDetail.createCurveFractionPoint(curve, fraction, this._ray.origin));\r\n }\r\n }\r\n public evaluate(fraction: number): boolean {\r\n const curve = this.effectiveCurve();\r\n if (!curve)\r\n return false;\r\n // the Newton function is just plane altitude: curve points that lie on the plane are altitude roots (i.e., altitude = 0).\r\n this.currentF = this._plane.altitude(curve.fractionToPoint(fraction));\r\n return true;\r\n }\r\n /**\r\n * * ASSUME both the \"A\" and \"B\" evaluations (fraction, function, and derivative) are known.\r\n * * If function value changed sign between, interpolate an approximate root and improve it with the newton solver.\r\n */\r\n private searchInterval(): void {\r\n if (this._functionA * this._functionB > 0)\r\n return;\r\n if (this._functionA === 0)\r\n this.announceSolutionFraction(this._fractionA);\r\n if (this._functionB === 0)\r\n this.announceSolutionFraction(this._fractionB);\r\n if (this._functionA * this._functionB < 0) {\r\n const fraction = Geometry.inverseInterpolate(this._fractionA, this._functionA, this._fractionB, this._functionB);\r\n if (fraction) {\r\n this._newtonSolver.setX(fraction);\r\n if (this._newtonSolver.runIterations())\r\n this.announceSolutionFraction(this._newtonSolver.getX());\r\n }\r\n }\r\n }\r\n /** Evaluate and save _functionB, _derivativeB, and _fractionB. */\r\n private evaluateB(xyz: Point3d, fraction: number, tangent: Vector3d): void {\r\n this._functionB = this._plane.altitude(xyz);\r\n this._derivativeB = this._plane.velocity(tangent);\r\n this._fractionB = fraction;\r\n }\r\n /**\r\n * Announce point and tangent for evaluations.\r\n * * The function evaluation is saved as the \"B\" function point.\r\n * * The function point count is incremented\r\n * * If function point count is greater than 1, the current interval is searched.\r\n * * The just-evaluated point (\"B\") is saved as the \"old\" (\"A\") evaluation point.\r\n * @param xyz\r\n * @param fraction\r\n * @param tangent\r\n */\r\n public announcePointTangent(xyz: Point3d, fraction: number, tangent: Vector3d): void {\r\n this.evaluateB(xyz, fraction, tangent);\r\n if (this._numThisCurve++ > 0)\r\n this.searchInterval();\r\n this._functionA = this._functionB;\r\n this._fractionA = this._fractionB;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionSpiral3d.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionSpiral3d.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"TransitionSpiral3d.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionSpiral3d.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;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AAC,OAAO,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC;QAC7E,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC,4BAA4B,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;IACxF,CAAC;IACD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,yBAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,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 { BSplineCurve3d } from \"../../bspline/BSplineCurve\";\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { Matrix3d } from \"../../geometry3d/Matrix3d\";\r\nimport { Range1d, Range3d } from \"../../geometry3d/Range\";\r\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\r\nimport { Transform } from \"../../geometry3d/Transform\";\r\nimport { CurvePrimitive } from \"../CurvePrimitive\";\r\nimport { CurveOffsetXYHandler } from \"../internalContexts/CurveOffsetXYHandler\";\r\nimport { PlaneAltitudeRangeContext } from \"../internalContexts/PlaneAltitudeRangeContext\";\r\nimport { LineString3d } from \"../LineString3d\";\r\nimport { OffsetOptions } from \"../OffsetOptions\";\r\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\r\n\r\nimport type { Vector3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport type { Ray3d } from \"../../geometry3d/Ray3d\";\r\n\r\n/**\r\n * This is the set of valid type names for \"integrated\" spirals.\r\n * * Behavior is expressed by a `NormalizedTransition` snap function.\r\n * * The snap function varies smoothly from f(0) = 0 to f(1) = 1.\r\n * * The various snap functions are:\r\n * * clothoid: linear\r\n * * biquadratic: 2 quadratics pieced together, joining with 1st derivative continuity at f(0.5) = 0.5, with zero\r\n * slope f'(0) = 0 and f'(1) = 0\r\n * * bloss: A single cubic with zero slope at 0 and 1\r\n * * cosine: half of a cosine wave, centered around 0.5\r\n * * sine: full period of a sine wave added to the line f(u)=u\r\n * *\r\n * @public\r\n */\r\nexport type IntegratedSpiralTypeName = \"clothoid\" | \"bloss\" | \"biquadratic\" | \"cosine\" | \"sine\";\r\n\r\n/**\r\n * This is the set of valid type names for \"direct\" spirals.\r\n * \"Direct\" spirals can evaluate fractionToPoint by direct equations, i.e. not requiring the numeric integrations in\r\n * \"Integrated\" spiral types.\r\n * @public\r\n */\r\nexport type DirectSpiralTypeName =\r\n \"Arema\" // 2 terms from each of the X,Y clothoid series expansions; identical to ChineseCubic\r\n | \"JapaneseCubic\" // 1 term from each of the X,Y clothoid series expansions; y = x^3 / (6RL)\r\n | \"ChineseCubic\" // identical to Arema\r\n | \"WesternAustralian\" // simple cubic; 2 terms of x series, 1 term of y series\r\n | \"HalfCosine\" // high continuity cosine variation from quadratic\r\n | \"AustralianRailCorp\" // cubic with high accuracy distance series\r\n | \"Czech\" // simple cubic with two term distance approximation\r\n | \"Italian\" // similar to Czech\r\n | \"MXCubicAlongArc\" // x obtained from fractional distance via 2-terms from series, y = x^3 / (6RL)\r\n | \"Polish\" // similar to MXCubicAlongArc\r\n ;\r\n\r\n/**\r\n * TransitionSpiral3d is a base class for multiple variants of spirals.\r\n * * The menagerie of spiral types have 2 broad categories:\r\n * * IntegratedSpiral3d -- a spiral whose direct function for curvature versus distance must be integrated to\r\n * determine x,y.\r\n * * The IntegratedSpiral3d types are enumerated in `IntegratedSpiralTypes`.\r\n * * DirectSpiral3d -- a spiral implemented with direct calculation of x,y from fractional position along the spiral.\r\n * * The direct spiral types are enumerated in the `DirectSpiralType`.\r\n * * The method set for CurvePrimitive support includes a `handleTransitionSpiral(g: TransitionSpiral3d)` which receives\r\n * all the spiral types.\r\n * * The spiral class may impose expectations that its inflection is at the origin, with tangent along the x axis.\r\n * * This is generally necessary for direct spirals.\r\n * * This is not necessary for integrated spirals.\r\n * @public\r\n */\r\n// see internaldocs/Spiral.md for more info\r\nexport abstract class TransitionSpiral3d extends CurvePrimitive {\r\n /** String name of spiral type. */\r\n protected _spiralType: string;\r\n /** Original defining properties. */\r\n protected _designProperties: TransitionConditionalProperties | undefined;\r\n /** Placement transform. */\r\n protected _localToWorld: Transform;\r\n /**\r\n * Fractional interval for the \"active\" part of a containing spiral.\r\n * (the radius, angle, and length conditions define a complete spiral, and some portion of it is \"active\")\r\n */\r\n protected _activeFractionInterval: Segment1d;\r\n /** Return (reference to) the active portion of the reference spiral. */\r\n public get activeFractionInterval(): Segment1d {\r\n return this._activeFractionInterval;\r\n }\r\n /** Strokes in the active portion. */\r\n public abstract get activeStrokes(): LineString3d;\r\n /** (Reference to) placement transform. */\r\n public get localToWorld(): Transform {\r\n return this._localToWorld;\r\n }\r\n protected constructor(\r\n spiralType: string | undefined,\r\n localToWorld: Transform,\r\n activeFractionInterval: Segment1d | undefined,\r\n designProperties: TransitionConditionalProperties | undefined,\r\n ) {\r\n super();\r\n this._spiralType = spiralType ? spiralType : \"unknownSpiralType\";\r\n this._designProperties = designProperties;\r\n this._localToWorld = localToWorld;\r\n this._activeFractionInterval = activeFractionInterval ? activeFractionInterval : Segment1d.create(0, 1);\r\n }\r\n public get spiralType(): string {\r\n return this._spiralType;\r\n }\r\n /** Return 1/r with convention that exact zero input returns 0 (straight line, zero curvature, infinite radius). */\r\n public static radiusToCurvature(radius: number): number {\r\n return (radius === 0.0) ? 0.0 : 1.0 / radius;\r\n }\r\n /** Return 1/k with convention that near-zero input returns 0 (straight line, zero curvature, infinite radius). */\r\n public static curvatureToRadius(curvature: number): number {\r\n if (Math.abs(curvature) < Geometry.smallAngleRadians)\r\n return 0.0;\r\n return 1.0 / curvature;\r\n }\r\n /** Return a deep clone. */\r\n public abstract override clone(): TransitionSpiral3d;\r\n /** Recompute strokes. */\r\n public abstract refreshComputedProperties(): void;\r\n /** Return (if possible) a spiral which is a portion of this curve. */\r\n public override clonePartialCurve(fractionA: number, fractionB: number): TransitionSpiral3d {\r\n const spiralB = this.clone();\r\n const globalFractionA = this._activeFractionInterval.fractionToPoint(fractionA);\r\n const globalFractionB = this._activeFractionInterval.fractionToPoint(fractionB);\r\n spiralB._activeFractionInterval.set(globalFractionA, globalFractionB);\r\n spiralB.refreshComputedProperties();\r\n return spiralB;\r\n }\r\n /** Clone with a transform applied. */\r\n public override cloneTransformed(transform: Transform): TransitionSpiral3d {\r\n const result = this.clone();\r\n result.tryTransformInPlace(transform); // we're confident it will always work\r\n return result;\r\n }\r\n /** Return the average of the start and end curvatures. */\r\n public static averageCurvature(radiusLimits: Segment1d): number {\r\n return 0.5 * (TransitionSpiral3d.radiusToCurvature(radiusLimits.x0) + TransitionSpiral3d.radiusToCurvature(radiusLimits.x1));\r\n }\r\n /**\r\n * Given two radii (or zeros for 0 curvature) return the average curvature.\r\n * @param r0 start radius, or 0 for line.\r\n * @param r1 end radius, or 0 for line.\r\n */\r\n public static averageCurvatureR0R1(r0: number, r1: number): number {\r\n return 0.5 * (TransitionSpiral3d.radiusToCurvature(r0) + TransitionSpiral3d.radiusToCurvature(r1));\r\n }\r\n /**\r\n * Given two radii (or zeros for 0 curvature) return the curvature at the given fraction.\r\n * @param r0 start radius, or 0 for line.\r\n * @param fraction fractional position between the curvatures defined by r0 and r1.\r\n * @param r1 end radius, or 0 for line.\r\n */\r\n public static interpolateCurvatureR0R1(r0: number, fraction: number, r1: number): number {\r\n return Geometry.interpolate(TransitionSpiral3d.radiusToCurvature(r0), fraction, TransitionSpiral3d.radiusToCurvature(r1));\r\n }\r\n /** Return the arc length of a transition spiral with given sweep and radius pair. */\r\n public static radiusRadiusSweepRadiansToArcLength(radius0: number, radius1: number, sweepRadians: number): number {\r\n return Math.abs(sweepRadians / TransitionSpiral3d.averageCurvatureR0R1(radius0, radius1));\r\n }\r\n /** Return the turn angle for spiral of given length between two radii */\r\n public static radiusRadiusLengthToSweepRadians(radius0: number, radius1: number, arcLength: number): number {\r\n return TransitionSpiral3d.averageCurvatureR0R1(radius0, radius1) * arcLength;\r\n }\r\n /** Return the end radius for spiral of given start radius, length, and turn angle. */\r\n public static radius0LengthSweepRadiansToRadius1(radius0: number, arcLength: number, sweepRadians: number) {\r\n return TransitionSpiral3d.curvatureToRadius(\r\n (2.0 * sweepRadians / arcLength) - TransitionSpiral3d.radiusToCurvature(radius0),\r\n );\r\n }\r\n /** Return the start radius for spiral of given end radius, length, and turn angle. */\r\n public static radius1LengthSweepRadiansToRadius0(radius1: number, arcLength: number, sweepRadians: number) {\r\n return TransitionSpiral3d.curvatureToRadius(\r\n (2.0 * sweepRadians / arcLength) - TransitionSpiral3d.radiusToCurvature(radius1),\r\n );\r\n }\r\n /** Return the original defining properties (if any) saved by the constructor. */\r\n public get designProperties(): TransitionConditionalProperties | undefined {\r\n return this._designProperties;\r\n }\r\n /**\r\n * * If transformA is rigid with uniform scale, apply the rigid part of transformA to the localToWorld transform and\r\n * return the scale and rigid separation.\r\n * * If not rigid, do nothing and return undefined.\r\n * * Also apply the scale factor to the designProperties.\r\n * @param transformA\r\n */\r\n protected applyRigidPartOfTransform(transformA: Transform): { rigidAxes: Matrix3d, scale: number } | undefined {\r\n const rigidData = transformA.matrix.factorRigidWithSignedScale();\r\n if (rigidData !== undefined) {\r\n // [sQ a][R b] = [sQ*R sQb+a]\r\n // but we save it as [Q*R sQb+a] with spiral data scaled by s\r\n const transformC0 = transformA.multiplyTransformTransform(this.localToWorld);\r\n // but pull the scale part out of the matrix\r\n const matrixC = rigidData.rigidAxes.multiplyMatrixMatrix(this.localToWorld.matrix);\r\n this._localToWorld = Transform.createOriginAndMatrix(transformC0.origin, matrixC);\r\n if (this.designProperties)\r\n this.designProperties.applyScaleFactor(rigidData.scale);\r\n return rigidData;\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\r\n * * No attempt is made to join the offsets of smaller constituent primitives. To construct a fully joined offset for an\r\n * aggregate instance (e.g., LineString3d, CurveChainWithDistanceIndex), use RegionOps.constructCurveXYOffset() instead.\r\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object.\r\n */\r\n public override constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions): BSplineCurve3d | undefined {\r\n const options = OffsetOptions.create(offsetDistanceOrOptions);\r\n const handler = new CurveOffsetXYHandler(this, options.leftOffsetDistance);\r\n this.emitStrokableParts(handler, options.strokeOptions);\r\n return handler.claimResult();\r\n }\r\n /** Extend the range by the strokes of the spiral. */\r\n public override extendRange(rangeToExtend: Range3d, transform?: Transform): void {\r\n rangeToExtend.extendRange(this.rangeBetweenFractions(0.0, 1.0, transform));\r\n }\r\n /**\r\n * Return the range of spiral between fractions of the activeStrokes.\r\n * * Use activeStrokes point count times interval factor for initial evaluation count, but do at least 5.\r\n */\r\n public override rangeBetweenFractions(fractionA: number, fractionB: number, transform?: Transform): Range3d {\r\n const strokes = this.activeStrokes;\r\n if (undefined === strokes)\r\n return Range3d.createNull();\r\n let count = Math.ceil(strokes.numPoints() * Math.abs(fractionB - fractionA));\r\n count = Geometry.clamp(5, count, 30);\r\n return this.rangeBetweenFractionsByCount(fractionA, fractionB, count, transform, 0.5);\r\n }\r\n /**\r\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of\r\n * projection.\r\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\r\n * @param lowHigh optional receiver for output\r\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\r\n * end of the ray.\r\n */\r\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\r\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"TransitionSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionSpiral3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAW,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAwCjD;;;;;;;;;;;;;;GAcG;AACH,2CAA2C;AAC3C,MAAM,OAAgB,kBAAmB,SAAQ,cAAc;IAC7D,kCAAkC;IACxB,WAAW,CAAS;IAC9B,oCAAoC;IAC1B,iBAAiB,CAA8C;IACzE,2BAA2B;IACjB,aAAa,CAAY;IACnC;;;OAGG;IACO,uBAAuB,CAAY;IAC7C,wEAAwE;IACxE,IAAW,sBAAsB;QAC/B,OAAO,IAAI,CAAC,uBAAuB,CAAC;IACtC,CAAC;IAGD,0CAA0C;IAC1C,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IACD,YACE,UAA8B,EAC9B,YAAuB,EACvB,sBAA6C,EAC7C,gBAA6D;QAE7D,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,mBAAmB,CAAC;QACjE,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;QAC1C,IAAI,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,kBAAkB,CAAC,CAAC;QAC3E,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;QACxD,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC;IAC/B,CAAC;IACD,qDAAqD;IACrC,WAAW,CAAC,aAAsB,EAAE,SAAqB;QACvE,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;IAC7E,CAAC;IACD;;;OAGG;IACa,qBAAqB,CAAC,SAAiB,EAAE,SAAiB,EAAE,SAAqB;QAC/F,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC;QACnC,IAAI,SAAS,KAAK,OAAO;YACvB,OAAO,OAAO,CAAC,UAAU,EAAE,CAAC;QAC9B,IAAI,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC;QAC7E,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC,4BAA4B,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;IACxF,CAAC;IACD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,yBAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,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 { BSplineCurve3d } from \"../../bspline/BSplineCurve\";\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { Matrix3d } from \"../../geometry3d/Matrix3d\";\r\nimport { Range1d, Range3d } from \"../../geometry3d/Range\";\r\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\r\nimport { Transform } from \"../../geometry3d/Transform\";\r\nimport { CurvePrimitive } from \"../CurvePrimitive\";\r\nimport { CurveOffsetXYHandler } from \"../internalContexts/CurveOffsetXYHandler\";\r\nimport { PlaneAltitudeRangeContext } from \"../internalContexts/PlaneAltitudeRangeContext\";\r\nimport { LineString3d } from \"../LineString3d\";\r\nimport { OffsetOptions } from \"../OffsetOptions\";\r\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\r\n\r\nimport type { Vector3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport type { Ray3d } from \"../../geometry3d/Ray3d\";\r\n/**\r\n * This is the set of valid type names for \"integrated\" spirals.\r\n * * Behavior is expressed by a `NormalizedTransition` snap function.\r\n * * The snap function varies smoothly from f(0) = 0 to f(1) = 1.\r\n * * The various snap functions are:\r\n * * clothoid: linear\r\n * * biquadratic: 2 quadratics pieced together, joining with 1st derivative continuity at f(0.5) = 0.5, with zero\r\n * slope f'(0) = 0 and f'(1) = 0\r\n * * bloss: A single cubic with zero slope at 0 and 1\r\n * * cosine: half of a cosine wave, centered around 0.5\r\n * * sine: full period of a sine wave added to the line f(u)=u\r\n * *\r\n * @public\r\n */\r\nexport type IntegratedSpiralTypeName = \"clothoid\" | \"bloss\" | \"biquadratic\" | \"cosine\" | \"sine\";\r\n\r\n/**\r\n * This is the set of valid type names for \"direct\" spirals.\r\n * \"Direct\" spirals can evaluate fractionToPoint by direct equations, i.e. not requiring the numeric integrations in\r\n * \"Integrated\" spiral types.\r\n * @public\r\n */\r\nexport type DirectSpiralTypeName =\r\n \"Arema\" // 2 terms from each of the X,Y clothoid series expansions; identical to ChineseCubic\r\n | \"JapaneseCubic\" // 1 term from each of the X,Y clothoid series expansions; y = x^3 / (6RL)\r\n | \"ChineseCubic\" // identical to Arema\r\n | \"WesternAustralian\" // simple cubic; 2 terms of x series, 1 term of y series\r\n | \"HalfCosine\" // high continuity cosine variation from quadratic\r\n | \"AustralianRailCorp\" // cubic with high accuracy distance series\r\n | \"Czech\" // simple cubic with two term distance approximation\r\n | \"Italian\" // similar to Czech\r\n | \"MXCubicAlongArc\" // x obtained from fractional distance via 2-terms from series, y = x^3 / (6RL)\r\n | \"Polish\" // similar to MXCubicAlongArc\r\n ;\r\n\r\n/**\r\n * TransitionSpiral3d is a base class for multiple variants of spirals.\r\n * * The menagerie of spiral types have 2 broad categories:\r\n * * IntegratedSpiral3d -- a spiral whose direct function for curvature versus distance must be integrated to\r\n * determine x,y.\r\n * * The IntegratedSpiral3d types are enumerated in `IntegratedSpiralTypes`.\r\n * * DirectSpiral3d -- a spiral implemented with direct calculation of x,y from fractional position along the spiral.\r\n * * The direct spiral types are enumerated in the `DirectSpiralType`.\r\n * * The method set for CurvePrimitive support includes a `handleTransitionSpiral(g: TransitionSpiral3d)` which receives\r\n * all the spiral types.\r\n * * The spiral class may impose expectations that its inflection is at the origin, with tangent along the x axis.\r\n * * This is generally necessary for direct spirals.\r\n * * This is not necessary for integrated spirals.\r\n * @public\r\n */\r\n// see internaldocs/Spiral.md for more info\r\nexport abstract class TransitionSpiral3d extends CurvePrimitive {\r\n /** String name of spiral type. */\r\n protected _spiralType: string;\r\n /** Original defining properties. */\r\n protected _designProperties: TransitionConditionalProperties | undefined;\r\n /** Placement transform. */\r\n protected _localToWorld: Transform;\r\n /**\r\n * Fractional interval for the \"active\" part of a containing spiral.\r\n * (the radius, angle, and length conditions define a complete spiral, and some portion of it is \"active\")\r\n */\r\n protected _activeFractionInterval: Segment1d;\r\n /** Return (reference to) the active portion of the reference spiral. */\r\n public get activeFractionInterval(): Segment1d {\r\n return this._activeFractionInterval;\r\n }\r\n /** Strokes in the active portion. */\r\n public abstract get activeStrokes(): LineString3d;\r\n /** (Reference to) placement transform. */\r\n public get localToWorld(): Transform {\r\n return this._localToWorld;\r\n }\r\n protected constructor(\r\n spiralType: string | undefined,\r\n localToWorld: Transform,\r\n activeFractionInterval: Segment1d | undefined,\r\n designProperties: TransitionConditionalProperties | undefined,\r\n ) {\r\n super();\r\n this._spiralType = spiralType ? spiralType : \"unknownSpiralType\";\r\n this._designProperties = designProperties;\r\n this._localToWorld = localToWorld;\r\n this._activeFractionInterval = activeFractionInterval ? activeFractionInterval : Segment1d.create(0, 1);\r\n }\r\n public get spiralType(): string {\r\n return this._spiralType;\r\n }\r\n /** Return 1/r with convention that exact zero input returns 0 (straight line, zero curvature, infinite radius). */\r\n public static radiusToCurvature(radius: number): number {\r\n return (radius === 0.0) ? 0.0 : 1.0 / radius;\r\n }\r\n /** Return 1/k with convention that near-zero input returns 0 (straight line, zero curvature, infinite radius). */\r\n public static curvatureToRadius(curvature: number): number {\r\n if (Math.abs(curvature) < Geometry.smallAngleRadians)\r\n return 0.0;\r\n return 1.0 / curvature;\r\n }\r\n /** Return a deep clone. */\r\n public abstract override clone(): TransitionSpiral3d;\r\n /** Recompute strokes. */\r\n public abstract refreshComputedProperties(): void;\r\n /** Return (if possible) a spiral which is a portion of this curve. */\r\n public override clonePartialCurve(fractionA: number, fractionB: number): TransitionSpiral3d {\r\n const spiralB = this.clone();\r\n const globalFractionA = this._activeFractionInterval.fractionToPoint(fractionA);\r\n const globalFractionB = this._activeFractionInterval.fractionToPoint(fractionB);\r\n spiralB._activeFractionInterval.set(globalFractionA, globalFractionB);\r\n spiralB.refreshComputedProperties();\r\n return spiralB;\r\n }\r\n /** Clone with a transform applied. */\r\n public override cloneTransformed(transform: Transform): TransitionSpiral3d {\r\n const result = this.clone();\r\n result.tryTransformInPlace(transform); // we're confident it will always work\r\n return result;\r\n }\r\n /** Return the average of the start and end curvatures. */\r\n public static averageCurvature(radiusLimits: Segment1d): number {\r\n return 0.5 * (TransitionSpiral3d.radiusToCurvature(radiusLimits.x0) + TransitionSpiral3d.radiusToCurvature(radiusLimits.x1));\r\n }\r\n /**\r\n * Given two radii (or zeros for 0 curvature) return the average curvature.\r\n * @param r0 start radius, or 0 for line.\r\n * @param r1 end radius, or 0 for line.\r\n */\r\n public static averageCurvatureR0R1(r0: number, r1: number): number {\r\n return 0.5 * (TransitionSpiral3d.radiusToCurvature(r0) + TransitionSpiral3d.radiusToCurvature(r1));\r\n }\r\n /**\r\n * Given two radii (or zeros for 0 curvature) return the curvature at the given fraction.\r\n * @param r0 start radius, or 0 for line.\r\n * @param fraction fractional position between the curvatures defined by r0 and r1.\r\n * @param r1 end radius, or 0 for line.\r\n */\r\n public static interpolateCurvatureR0R1(r0: number, fraction: number, r1: number): number {\r\n return Geometry.interpolate(TransitionSpiral3d.radiusToCurvature(r0), fraction, TransitionSpiral3d.radiusToCurvature(r1));\r\n }\r\n /** Return the arc length of a transition spiral with given sweep and radius pair. */\r\n public static radiusRadiusSweepRadiansToArcLength(radius0: number, radius1: number, sweepRadians: number): number {\r\n return Math.abs(sweepRadians / TransitionSpiral3d.averageCurvatureR0R1(radius0, radius1));\r\n }\r\n /** Return the turn angle for spiral of given length between two radii */\r\n public static radiusRadiusLengthToSweepRadians(radius0: number, radius1: number, arcLength: number): number {\r\n return TransitionSpiral3d.averageCurvatureR0R1(radius0, radius1) * arcLength;\r\n }\r\n /** Return the end radius for spiral of given start radius, length, and turn angle. */\r\n public static radius0LengthSweepRadiansToRadius1(radius0: number, arcLength: number, sweepRadians: number) {\r\n return TransitionSpiral3d.curvatureToRadius(\r\n (2.0 * sweepRadians / arcLength) - TransitionSpiral3d.radiusToCurvature(radius0),\r\n );\r\n }\r\n /** Return the start radius for spiral of given end radius, length, and turn angle. */\r\n public static radius1LengthSweepRadiansToRadius0(radius1: number, arcLength: number, sweepRadians: number) {\r\n return TransitionSpiral3d.curvatureToRadius(\r\n (2.0 * sweepRadians / arcLength) - TransitionSpiral3d.radiusToCurvature(radius1),\r\n );\r\n }\r\n /** Return the original defining properties (if any) saved by the constructor. */\r\n public get designProperties(): TransitionConditionalProperties | undefined {\r\n return this._designProperties;\r\n }\r\n /**\r\n * * If transformA is rigid with uniform scale, apply the rigid part of transformA to the localToWorld transform and\r\n * return the scale and rigid separation.\r\n * * If not rigid, do nothing and return undefined.\r\n * * Also apply the scale factor to the designProperties.\r\n * @param transformA\r\n */\r\n protected applyRigidPartOfTransform(transformA: Transform): { rigidAxes: Matrix3d, scale: number } | undefined {\r\n const rigidData = transformA.matrix.factorRigidWithSignedScale();\r\n if (rigidData !== undefined) {\r\n // [sQ a][R b] = [sQ*R sQb+a]\r\n // but we save it as [Q*R sQb+a] with spiral data scaled by s\r\n const transformC0 = transformA.multiplyTransformTransform(this.localToWorld);\r\n // but pull the scale part out of the matrix\r\n const matrixC = rigidData.rigidAxes.multiplyMatrixMatrix(this.localToWorld.matrix);\r\n this._localToWorld = Transform.createOriginAndMatrix(transformC0.origin, matrixC);\r\n if (this.designProperties)\r\n this.designProperties.applyScaleFactor(rigidData.scale);\r\n return rigidData;\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\r\n * * No attempt is made to join the offsets of smaller constituent primitives. To construct a fully joined offset for an\r\n * aggregate instance (e.g., LineString3d, CurveChainWithDistanceIndex), use RegionOps.constructCurveXYOffset() instead.\r\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object.\r\n */\r\n public override constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions): BSplineCurve3d | undefined {\r\n const options = OffsetOptions.create(offsetDistanceOrOptions);\r\n const handler = new CurveOffsetXYHandler(this, options.leftOffsetDistance);\r\n this.emitStrokableParts(handler, options.strokeOptions);\r\n return handler.claimResult();\r\n }\r\n /** Extend the range by the strokes of the spiral. */\r\n public override extendRange(rangeToExtend: Range3d, transform?: Transform): void {\r\n rangeToExtend.extendRange(this.rangeBetweenFractions(0.0, 1.0, transform));\r\n }\r\n /**\r\n * Return the range of spiral between fractions of the activeStrokes.\r\n * * Use activeStrokes point count times interval factor for initial evaluation count, but do at least 5.\r\n */\r\n public override rangeBetweenFractions(fractionA: number, fractionB: number, transform?: Transform): Range3d {\r\n const strokes = this.activeStrokes;\r\n if (undefined === strokes)\r\n return Range3d.createNull();\r\n let count = Math.ceil(strokes.numPoints() * Math.abs(fractionB - fractionA));\r\n count = Geometry.clamp(5, count, 30);\r\n return this.rangeBetweenFractionsByCount(fractionA, fractionB, count, transform, 0.5);\r\n }\r\n /**\r\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of\r\n * projection.\r\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\r\n * @param lowHigh optional receiver for output\r\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\r\n * end of the ray.\r\n */\r\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\r\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\r\n }\r\n}\r\n"]}
|
|
@@ -35,7 +35,8 @@ export declare class Ellipsoid implements Clipper {
|
|
|
35
35
|
private _workPointA;
|
|
36
36
|
private _workPointB;
|
|
37
37
|
private constructor();
|
|
38
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Create with a clone (not capture) with given transform.
|
|
39
40
|
* * If transform is undefined, create a unit sphere.
|
|
40
41
|
*/
|
|
41
42
|
static create(matrixOrTransform?: Transform | Matrix3d): Ellipsoid;
|
|
@@ -247,9 +248,9 @@ export declare class Ellipsoid implements Clipper {
|
|
|
247
248
|
static radiansToUnitNormalRay(ellipsoid: Ellipsoid | undefined, thetaRadians: number, phiRadians: number, result?: Ray3d): Ray3d | undefined;
|
|
248
249
|
/** Implementation of [[Clipper.isPointOnOrInside]]. */
|
|
249
250
|
isPointOnOrInside(point: Point3d): boolean;
|
|
250
|
-
/**
|
|
251
|
+
/** Method from [[Clipper]] interface. */
|
|
251
252
|
announceClippedSegmentIntervals(f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber): boolean;
|
|
252
|
-
/**
|
|
253
|
+
/** Method from [[Clipper]] interface. */
|
|
253
254
|
announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
|
|
254
255
|
}
|
|
255
256
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ellipsoid.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/Ellipsoid.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,6BAA6B,EAA2B,MAAM,kCAAkC,CAAC;AAC1G,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,oBAAoB,EAAE,kCAAkC,EAAE,MAAM,yBAAyB,CAAC;AAEnG,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAKhD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAW,OAAO,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AA4GpC;;;;;;;;;GASG;AACH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AiB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,YAAY;IAkB1I;;OAEG;IACI,QAAQ,IAAI,uBAAuB;CAG3C;AACD;;;;GAIG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,WAAW,CAAsB;IACzC,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO;IAIP;;;;;;;OAOG;WACW,kBAAkB,CAAC,iBAAiB,EAAE,SAAS,EAC3D,WAAW,EAAE,uBAAuB,EAAE,SAAS,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,iBAAiB,EAAE,GAAG,SAAS;IAsDrI,OAAO,CAAC,uCAAuC;IAc/C,OAAO,CAAC,WAAW;IAUnB;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAqBjB,OAAO,CAAC,KAAK;IAGb;;;;;;;;;;OAUG;WACW,kCAAkC,CAAC,SAAS,EAAE,SAAS,EACnE,MAAM,EAAE,uBAAuB,EAC/B,MAAM,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,EAClD,4BAA4B,EAAE,MAAM,EACpC,4BAA4B,EAAE,MAAM,GAAG;QAAE,YAAY,EAAE,KAAK,CAAC;QAAC,oCAAoC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;CA6B3H"}
|
|
@@ -150,7 +150,8 @@ export class Ellipsoid {
|
|
|
150
150
|
this._workPointA = Point3d.create();
|
|
151
151
|
this._workPointB = Point3d.create();
|
|
152
152
|
}
|
|
153
|
-
/**
|
|
153
|
+
/**
|
|
154
|
+
* Create with a clone (not capture) with given transform.
|
|
154
155
|
* * If transform is undefined, create a unit sphere.
|
|
155
156
|
*/
|
|
156
157
|
static create(matrixOrTransform) {
|
|
@@ -184,7 +185,9 @@ export class Ellipsoid {
|
|
|
184
185
|
* * In the sphere space, an xyz (vector from origin) with magnitude less than 1 is INSIDE the sphere (hence its world image is INSIDE the ellipsoid)
|
|
185
186
|
* * In the sphere space, an xyz (vector from origin) with magnitude greater than 1 is OUTSIDE the sphere (hence its world image is OUTSIDE the ellipsoid)
|
|
186
187
|
*/
|
|
187
|
-
get transformRef() {
|
|
188
|
+
get transformRef() {
|
|
189
|
+
return this._transform;
|
|
190
|
+
}
|
|
188
191
|
/**
|
|
189
192
|
* * Convert a world point to point within the underlying mapped sphere space.
|
|
190
193
|
* * In the sphere space, an xyz (vector from origin) with magnitude equal to 1 is ON the sphere (hence its world image is ON the ellipsoid)
|
|
@@ -649,7 +652,7 @@ export class Ellipsoid {
|
|
|
649
652
|
return localPoint.magnitude() <= 1.0;
|
|
650
653
|
return false;
|
|
651
654
|
}
|
|
652
|
-
/**
|
|
655
|
+
/** Method from [[Clipper]] interface. */
|
|
653
656
|
announceClippedSegmentIntervals(f0, f1, pointA, pointB, announce) {
|
|
654
657
|
const localA = this._transform.multiplyInversePoint3d(pointA, this._workPointA);
|
|
655
658
|
const localB = this._transform.multiplyInversePoint3d(pointB, this._workPointB);
|
|
@@ -688,7 +691,7 @@ export class Ellipsoid {
|
|
|
688
691
|
}
|
|
689
692
|
return false;
|
|
690
693
|
}
|
|
691
|
-
/**
|
|
694
|
+
/** Method from [[Clipper]] interface. */
|
|
692
695
|
announceClippedArcIntervals(arc, announce) {
|
|
693
696
|
const arcData = arc.toVectors();
|
|
694
697
|
let numAnnounce = 0;
|