@itwin/core-geometry 4.9.0-dev.12 → 4.9.0-dev.14
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 +6 -1
- package/lib/cjs/Geometry.d.ts +57 -46
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +73 -53
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +128 -34
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +174 -20
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +2 -1
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +2 -1
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +19 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +39 -0
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/LineString3d.js +1 -1
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/OffsetOptions.d.ts +1 -1
- package/lib/cjs/curve/OffsetOptions.js +1 -1
- package/lib/cjs/curve/OffsetOptions.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +2 -1
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +2 -1
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +23 -7
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +43 -35
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts +211 -0
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -0
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +1000 -0
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -0
- package/lib/cjs/geometry3d/Angle.d.ts +18 -5
- package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Angle.js +23 -7
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts +14 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +47 -12
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +6 -4
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +6 -4
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +2 -3
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +2 -3
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts +6 -5
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +11 -10
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts +6 -1
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +9 -3
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +1 -1
- package/lib/cjs/geometry3d/Transform.js +1 -1
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/numerics/Newton.d.ts +3 -3
- package/lib/cjs/numerics/Newton.d.ts.map +1 -1
- package/lib/cjs/numerics/Newton.js +14 -16
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.d.ts +2 -2
- package/lib/cjs/numerics/Polynomials.js +2 -2
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +7 -4
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +8 -4
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +3 -3
- package/lib/cjs/polyface/PolyfaceQuery.js +3 -3
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js +2 -2
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts +1 -1
- package/lib/cjs/topology/Graph.js +2 -2
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.d.ts +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.d.ts +57 -15
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js +168 -127
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.d.ts +35 -35
- package/lib/cjs/topology/HalfEdgePositionDetail.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.js +63 -41
- package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts +64 -12
- package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.js +174 -75
- package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/cjs/topology/Triangulation.d.ts +16 -10
- package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
- package/lib/cjs/topology/Triangulation.js +23 -30
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/esm/Geometry.d.ts +57 -46
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +73 -53
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +128 -34
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +172 -19
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +2 -1
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +2 -1
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +19 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +39 -0
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/LineString3d.js +1 -1
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/OffsetOptions.d.ts +1 -1
- package/lib/esm/curve/OffsetOptions.js +1 -1
- package/lib/esm/curve/OffsetOptions.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +2 -1
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +2 -1
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +23 -7
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +43 -35
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts +211 -0
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -0
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +995 -0
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -0
- package/lib/esm/geometry3d/Angle.d.ts +18 -5
- package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
- package/lib/esm/geometry3d/Angle.js +23 -7
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts +14 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +47 -12
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +6 -4
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +6 -4
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +2 -3
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +2 -3
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts +6 -5
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +11 -10
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts +6 -1
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +9 -3
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +1 -1
- package/lib/esm/geometry3d/Transform.js +1 -1
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/numerics/Newton.d.ts +3 -3
- package/lib/esm/numerics/Newton.d.ts.map +1 -1
- package/lib/esm/numerics/Newton.js +14 -16
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/Polynomials.d.ts +2 -2
- package/lib/esm/numerics/Polynomials.js +2 -2
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +7 -4
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +8 -4
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +3 -3
- package/lib/esm/polyface/PolyfaceQuery.js +3 -3
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js +2 -2
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +1 -1
- package/lib/esm/topology/Graph.js +2 -2
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.d.ts +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.d.ts +57 -15
- package/lib/esm/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js +168 -127
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.d.ts +35 -35
- package/lib/esm/topology/HalfEdgePositionDetail.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.js +63 -41
- package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.d.ts +64 -12
- package/lib/esm/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js +173 -74
- package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/esm/topology/Triangulation.d.ts +16 -10
- package/lib/esm/topology/Triangulation.d.ts.map +1 -1
- package/lib/esm/topology/Triangulation.js +24 -31
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/package.json +3 -3
package/lib/cjs/curve/Arc3d.d.ts
CHANGED
|
@@ -17,43 +17,140 @@ import { XYAndZ } from "../geometry3d/XYZProps";
|
|
|
17
17
|
import { Matrix4d } from "../geometry4d/Matrix4d";
|
|
18
18
|
import { Point4d } from "../geometry4d/Point4d";
|
|
19
19
|
import { SineCosinePolynomial } from "../numerics/Polynomials";
|
|
20
|
+
import { CurveChain } from "./CurveCollection";
|
|
20
21
|
import { VariantCurveExtendParameter } from "./CurveExtendMode";
|
|
21
22
|
import { CurveLocationDetail } from "./CurveLocationDetail";
|
|
22
23
|
import { AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from "./CurvePrimitive";
|
|
23
24
|
import { GeometryQuery } from "./GeometryQuery";
|
|
25
|
+
import { LineSegment3d } from "./LineSegment3d";
|
|
24
26
|
import { LineString3d } from "./LineString3d";
|
|
25
27
|
import { OffsetOptions } from "./OffsetOptions";
|
|
26
28
|
import { StrokeOptions } from "./StrokeOptions";
|
|
27
29
|
/**
|
|
28
|
-
* Compact vector form of an elliptic arc defined by center, vectors
|
|
30
|
+
* Compact vector form of an elliptic arc defined by center, vectors at 0 and 90 degrees, and angular sweep.
|
|
29
31
|
* * @see [Curve Collections]($docs/learning/geometry/CurvePrimitive.md) learning article for further details of the
|
|
30
32
|
* parameterization and meaning of the vectors.
|
|
31
33
|
* @public
|
|
32
34
|
*/
|
|
33
35
|
export interface ArcVectors {
|
|
34
|
-
/** Center point of arc */
|
|
36
|
+
/** Center point of arc. */
|
|
35
37
|
center: Point3d;
|
|
36
|
-
/** Vector to point at
|
|
38
|
+
/** Vector from the arc center to the arc point at parameter 0 degrees. */
|
|
37
39
|
vector0: Vector3d;
|
|
38
|
-
/** Vector to point at
|
|
40
|
+
/** Vector from the arc center to the arc point at parameter 90 degrees. */
|
|
39
41
|
vector90: Vector3d;
|
|
40
|
-
/**
|
|
42
|
+
/** Angular range swept by the arc, of length less than 2*pi if not a full ellipse. */
|
|
41
43
|
sweep: AngleSweep;
|
|
42
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Carrier structure for an arc with fractional data on incoming, outgoing curves.
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
export interface ArcBlendData {
|
|
50
|
+
/** Constructed arc */
|
|
51
|
+
arc?: Arc3d;
|
|
52
|
+
/** Fraction "moving backward" on the inbound curve */
|
|
53
|
+
fraction10: number;
|
|
54
|
+
/** Fraction "moving forward" on the outbound curve */
|
|
55
|
+
fraction12: number;
|
|
56
|
+
/** Optional reference point */
|
|
57
|
+
point?: Point3d;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Enumeration of methods used to sample an elliptical arc in [[Arc3d.constructCircularArcChainApproximation]].
|
|
61
|
+
* * Because ellipses have two axes of symmetry, samples are computed for one quadrant and reflected across each
|
|
62
|
+
* axis to the other quadrants. Any samples that fall outside the arc sweep are filtered out.
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
export declare enum EllipticalArcSampleMethod {
|
|
66
|
+
/** Generate n samples uniformly interpolated between the min and max parameters of a full ellipse quadrant. */
|
|
67
|
+
UniformParameter = 0,
|
|
68
|
+
/** Generate n samples uniformly interpolated between the min and max curvatures of a full ellipse quadrant. */
|
|
69
|
+
UniformCurvature = 1,
|
|
70
|
+
/**
|
|
71
|
+
* Generate n samples interpolated between the min and max curvatures of a full ellipse quadrant, using a
|
|
72
|
+
* [[FractionMapper]] callback to generate the interpolation weights.
|
|
73
|
+
*/
|
|
74
|
+
NonUniformCurvature = 2,
|
|
75
|
+
/**
|
|
76
|
+
* Generate samples by subdividing parameter space until the approximation has less than a given max
|
|
77
|
+
* distance to the elliptical arc.
|
|
78
|
+
*/
|
|
79
|
+
AdaptiveSubdivision = 3
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* A function that maps [0,1]->[0,1].
|
|
83
|
+
* @public
|
|
84
|
+
*/
|
|
85
|
+
export type FractionMapper = (f: number) => number;
|
|
86
|
+
/**
|
|
87
|
+
* Options for generating samples for the construction of an approximation to an elliptical arc.
|
|
88
|
+
* * Used by [[Arc3d.constructCircularArcChainApproximation]].
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
91
|
+
export declare class EllipticalArcApproximationOptions {
|
|
92
|
+
private _sampleMethod;
|
|
93
|
+
private _numSamplesInQuadrant;
|
|
94
|
+
private _maxError;
|
|
95
|
+
private _remapFunction;
|
|
96
|
+
private _forcePath;
|
|
97
|
+
/** Default error tolerance. */
|
|
98
|
+
static defaultMaxError: number;
|
|
99
|
+
private constructor();
|
|
100
|
+
/**
|
|
101
|
+
* Construct options with optional defaults.
|
|
102
|
+
* @param method sample method, default [[EllipticalArcSampleMethod.AdaptiveSubdivision]].
|
|
103
|
+
* @param numSamplesInQuadrant samples in each full quadrant for interpolation methods, default 4.
|
|
104
|
+
* @param maxError positive maximum distance to ellipse for the subdivision method, default 1cm.
|
|
105
|
+
* @param remapFunction optional callback to remap fraction space for [[EllipticalArcSampleMethod.NonUniformCurvature]],
|
|
106
|
+
* default quadratic. For best results, this function should be a bijection.
|
|
107
|
+
* @param forcePath whether to return a [[Path]] instead of a [[Loop]] when approximating a full elliptical arc,
|
|
108
|
+
* default false.
|
|
109
|
+
*/
|
|
110
|
+
static create(method?: EllipticalArcSampleMethod, numSamplesInQuadrant?: number, maxError?: number, remapFunction?: FractionMapper, forcePath?: boolean): EllipticalArcApproximationOptions;
|
|
111
|
+
/** Clone the options. */
|
|
112
|
+
clone(): EllipticalArcApproximationOptions;
|
|
113
|
+
/** Method used to sample the elliptical arc. */
|
|
114
|
+
get sampleMethod(): EllipticalArcSampleMethod;
|
|
115
|
+
set sampleMethod(method: EllipticalArcSampleMethod);
|
|
116
|
+
/**
|
|
117
|
+
* Number of samples to return in each full quadrant, including endpoint(s).
|
|
118
|
+
* * Used by interpolation sample methods.
|
|
119
|
+
* * In general, for n samples, the approximating [[Path]] consists of n-1 primitives,
|
|
120
|
+
* and the approximating [[Loop]] consists of n primitives.
|
|
121
|
+
* * Minimum value is 2.
|
|
122
|
+
*/
|
|
123
|
+
get numSamplesInQuadrant(): number;
|
|
124
|
+
set numSamplesInQuadrant(numSamples: number);
|
|
125
|
+
/**
|
|
126
|
+
* Maximum distance (in meters) of the computed approximation to the elliptical arc.
|
|
127
|
+
* * Used by [[EllipticalArcSampleMethod.AdaptiveSubdivision]].
|
|
128
|
+
*/
|
|
129
|
+
get maxError(): number;
|
|
130
|
+
set maxError(error: number);
|
|
131
|
+
/**
|
|
132
|
+
* Callback function to remap fraction space to fraction space.
|
|
133
|
+
* * Used by [[EllipticalArcSampleMethod.NonUniformCurvature]].
|
|
134
|
+
*/
|
|
135
|
+
get remapFunction(): FractionMapper;
|
|
136
|
+
set remapFunction(f: FractionMapper);
|
|
137
|
+
/** Whether to return a [[Path]] instead of a [[Loop]] when approximating a full (closed) ellipse. */
|
|
138
|
+
get forcePath(): boolean;
|
|
139
|
+
set forcePath(value: boolean);
|
|
140
|
+
}
|
|
43
141
|
/**
|
|
44
142
|
* Circular or elliptic arc.
|
|
45
143
|
* * The angle to point equation is:
|
|
46
|
-
*
|
|
144
|
+
* * `X = center + cos(theta) * vector0 + sin(theta) * vector90`
|
|
47
145
|
* * When the two vectors are perpendicular and have equal length, it is a true circle.
|
|
48
146
|
* * Non-perpendicular vectors are always elliptic.
|
|
49
147
|
* * Vectors of unequal length are always elliptic.
|
|
50
148
|
* * To create an ellipse in the common "major and minor axis" form of an ellipse:
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* * The method toScaledMatrix3d() can be called to convert the unrestricted vector0,vector90 to perpendicular form.
|
|
55
|
-
* * The unrestricted form is much easier to work with for common calculations
|
|
56
|
-
* intersection with plane.
|
|
149
|
+
* * vector0 is the vector from the center to the major axis extreme.
|
|
150
|
+
* * vector90 is the vector from the center to the minor axis extreme.
|
|
151
|
+
* * Note that constructing these vectors to the extreme points makes them perpendicular.
|
|
152
|
+
* * The method toScaledMatrix3d() can be called to convert the unrestricted vector0, vector90 to perpendicular form.
|
|
153
|
+
* * The unrestricted form is much easier to work with for common calculations: stroking, projection to 2d, intersection with plane.
|
|
57
154
|
* @public
|
|
58
155
|
*/
|
|
59
156
|
export declare class Arc3d extends CurvePrimitive implements BeJSONFunctions {
|
|
@@ -157,6 +254,11 @@ export declare class Arc3d extends CurvePrimitive implements BeJSONFunctions {
|
|
|
157
254
|
* @returns elliptical arc, or undefined if construction impossible.
|
|
158
255
|
*/
|
|
159
256
|
static createStartMiddleEnd(point0: XYAndZ, point1: XYAndZ, point2: XYAndZ, sweep?: AngleSweep, result?: Arc3d): Arc3d | undefined;
|
|
257
|
+
/**
|
|
258
|
+
* Create a circular arc defined by start point, tangent at start point, and end point.
|
|
259
|
+
* If tangent is parallel to line segment from start to end, return the line segment.
|
|
260
|
+
*/
|
|
261
|
+
static createCircularStartTangentEnd(start: Point3d, tangentAtStart: Vector3d, end: Point3d, result?: Arc3d): Arc3d | LineSegment3d;
|
|
160
262
|
/**
|
|
161
263
|
* Return a clone of this arc, projected to given z value.
|
|
162
264
|
* * If `z` is omitted, the clone is at the z of the center.
|
|
@@ -181,7 +283,7 @@ export declare class Arc3d extends CurvePrimitive implements BeJSONFunctions {
|
|
|
181
283
|
* Create a circular arc defined by start point, any intermediate point, and end point.
|
|
182
284
|
* If the points are colinear, assemble them into a linestring.
|
|
183
285
|
*/
|
|
184
|
-
static createCircularStartMiddleEnd(pointA: XYAndZ, pointB: XYAndZ, pointC: XYAndZ, result?: Arc3d): Arc3d | LineString3d
|
|
286
|
+
static createCircularStartMiddleEnd(pointA: XYAndZ, pointB: XYAndZ, pointC: XYAndZ, result?: Arc3d): Arc3d | LineString3d;
|
|
185
287
|
/** The arc has simple proportional arc length if and only if it is a circular arc. */
|
|
186
288
|
getFractionToDistanceScale(): number | undefined;
|
|
187
289
|
/**
|
|
@@ -217,7 +319,7 @@ export declare class Arc3d extends CurvePrimitive implements BeJSONFunctions {
|
|
|
217
319
|
*/
|
|
218
320
|
radiansToPointAndDerivative(radians: number, result?: Ray3d): Ray3d;
|
|
219
321
|
/**
|
|
220
|
-
* Evaluate the point
|
|
322
|
+
* Evaluate the point with respect to the angle (in radians)
|
|
221
323
|
* @param radians angular position
|
|
222
324
|
* @param result optional preallocated ray.
|
|
223
325
|
*/
|
|
@@ -238,12 +340,12 @@ export declare class Arc3d extends CurvePrimitive implements BeJSONFunctions {
|
|
|
238
340
|
*/
|
|
239
341
|
angleToPointAndDerivative(theta: Angle, result?: Ray3d): Ray3d;
|
|
240
342
|
/**
|
|
241
|
-
* Return the start point
|
|
343
|
+
* Return the start point of the arc.
|
|
242
344
|
* @param result optional preallocated result
|
|
243
345
|
*/
|
|
244
346
|
startPoint(result?: Point3d): Point3d;
|
|
245
347
|
/**
|
|
246
|
-
* Return the end point
|
|
348
|
+
* Return the end point of the arc.
|
|
247
349
|
* @param result optional preallocated result
|
|
248
350
|
*/
|
|
249
351
|
endPoint(result?: Point3d): Point3d;
|
|
@@ -278,12 +380,12 @@ export declare class Arc3d extends CurvePrimitive implements BeJSONFunctions {
|
|
|
278
380
|
*/
|
|
279
381
|
moveSignedDistanceFromFraction(startFraction: number, signedDistance: number, allowExtension: false, result?: CurveLocationDetail): CurveLocationDetail;
|
|
280
382
|
/**
|
|
281
|
-
* Return all angles
|
|
383
|
+
* Return all radian angles where the ellipse tangent is perpendicular to the vector to a spacePoint.
|
|
282
384
|
* @param spacePoint point of origin of vectors to the ellipse
|
|
283
|
-
* @param _extend
|
|
284
|
-
* @param
|
|
385
|
+
* @param _extend always true. Sweep is ignored: perpendiculars for the full ellipse are returned.
|
|
386
|
+
* @param endpoints if true, force the end radians into the result.
|
|
285
387
|
*/
|
|
286
|
-
allPerpendicularAngles(spacePoint: Point3d, _extend?: boolean,
|
|
388
|
+
allPerpendicularAngles(spacePoint: Point3d, _extend?: boolean, endpoints?: boolean): number[];
|
|
287
389
|
/**
|
|
288
390
|
* Return details of the closest point on the arc, optionally extending to full ellipse.
|
|
289
391
|
* @param spacePoint search for point closest to this point.
|
|
@@ -479,19 +581,11 @@ export declare class Arc3d extends CurvePrimitive implements BeJSONFunctions {
|
|
|
479
581
|
* @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the end of the ray.
|
|
480
582
|
*/
|
|
481
583
|
projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined;
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
/** Constructed arc */
|
|
489
|
-
arc?: Arc3d;
|
|
490
|
-
/** Fraction "moving backward" on the inbound curve */
|
|
491
|
-
fraction10: number;
|
|
492
|
-
/** Fraction "moving forward" on the outbound curve */
|
|
493
|
-
fraction12: number;
|
|
494
|
-
/** Optional reference point */
|
|
495
|
-
point?: Point3d;
|
|
584
|
+
/**
|
|
585
|
+
* Construct a circular arc chain approximation to the instance elliptical arc.
|
|
586
|
+
* @param options bundle of options for sampling an elliptical arc (use default options if undefined)
|
|
587
|
+
* @returns the approximating curve chain, the circular instance, or undefined if construction fails.
|
|
588
|
+
*/
|
|
589
|
+
constructCircularArcChainApproximation(options?: EllipticalArcApproximationOptions): CurveChain | Arc3d | undefined;
|
|
496
590
|
}
|
|
497
591
|
//# sourceMappingURL=Arc3d.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Arc3d.d.ts","sourceRoot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;;;OAKG;IACa,uBAAuB,CAAC,GAAG,EAAE,QAAQ,GAAG,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS;IAItG;;;;OAIG;IACI,sCAAsC,CAAC,OAAO,CAAC,EAAE,iCAAiC,GAAG,UAAU,GAAG,KAAK,GAAG,SAAS;CAS3H"}
|
package/lib/cjs/curve/Arc3d.js
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.Arc3d = void 0;
|
|
7
|
+
exports.Arc3d = exports.EllipticalArcApproximationOptions = exports.EllipticalArcSampleMethod = void 0;
|
|
8
|
+
const Constant_1 = require("../Constant");
|
|
8
9
|
const Geometry_1 = require("../Geometry");
|
|
9
10
|
const Angle_1 = require("../geometry3d/Angle");
|
|
10
11
|
const AngleSweep_1 = require("../geometry3d/AngleSweep");
|
|
@@ -18,24 +19,134 @@ const CurveExtendMode_1 = require("./CurveExtendMode");
|
|
|
18
19
|
const CurveLocationDetail_1 = require("./CurveLocationDetail");
|
|
19
20
|
const CurvePrimitive_1 = require("./CurvePrimitive");
|
|
20
21
|
const CurveOffsetXYHandler_1 = require("./internalContexts/CurveOffsetXYHandler");
|
|
22
|
+
const EllipticalArcApproximationContext_1 = require("./internalContexts/EllipticalArcApproximationContext");
|
|
21
23
|
const PlaneAltitudeRangeContext_1 = require("./internalContexts/PlaneAltitudeRangeContext");
|
|
24
|
+
const LineSegment3d_1 = require("./LineSegment3d");
|
|
22
25
|
const LineString3d_1 = require("./LineString3d");
|
|
23
26
|
const OffsetOptions_1 = require("./OffsetOptions");
|
|
27
|
+
const Path_1 = require("./Path");
|
|
24
28
|
const StrokeOptions_1 = require("./StrokeOptions");
|
|
29
|
+
/**
|
|
30
|
+
* Enumeration of methods used to sample an elliptical arc in [[Arc3d.constructCircularArcChainApproximation]].
|
|
31
|
+
* * Because ellipses have two axes of symmetry, samples are computed for one quadrant and reflected across each
|
|
32
|
+
* axis to the other quadrants. Any samples that fall outside the arc sweep are filtered out.
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
var EllipticalArcSampleMethod;
|
|
36
|
+
(function (EllipticalArcSampleMethod) {
|
|
37
|
+
/** Generate n samples uniformly interpolated between the min and max parameters of a full ellipse quadrant. */
|
|
38
|
+
EllipticalArcSampleMethod[EllipticalArcSampleMethod["UniformParameter"] = 0] = "UniformParameter";
|
|
39
|
+
/** Generate n samples uniformly interpolated between the min and max curvatures of a full ellipse quadrant. */
|
|
40
|
+
EllipticalArcSampleMethod[EllipticalArcSampleMethod["UniformCurvature"] = 1] = "UniformCurvature";
|
|
41
|
+
/**
|
|
42
|
+
* Generate n samples interpolated between the min and max curvatures of a full ellipse quadrant, using a
|
|
43
|
+
* [[FractionMapper]] callback to generate the interpolation weights.
|
|
44
|
+
*/
|
|
45
|
+
EllipticalArcSampleMethod[EllipticalArcSampleMethod["NonUniformCurvature"] = 2] = "NonUniformCurvature";
|
|
46
|
+
/**
|
|
47
|
+
* Generate samples by subdividing parameter space until the approximation has less than a given max
|
|
48
|
+
* distance to the elliptical arc.
|
|
49
|
+
*/
|
|
50
|
+
EllipticalArcSampleMethod[EllipticalArcSampleMethod["AdaptiveSubdivision"] = 3] = "AdaptiveSubdivision";
|
|
51
|
+
})(EllipticalArcSampleMethod || (exports.EllipticalArcSampleMethod = EllipticalArcSampleMethod = {}));
|
|
52
|
+
/**
|
|
53
|
+
* Options for generating samples for the construction of an approximation to an elliptical arc.
|
|
54
|
+
* * Used by [[Arc3d.constructCircularArcChainApproximation]].
|
|
55
|
+
* @public
|
|
56
|
+
*/
|
|
57
|
+
class EllipticalArcApproximationOptions {
|
|
58
|
+
constructor(method, numSamplesInQuadrant, maxError, remapFunction, forcePath) {
|
|
59
|
+
this._sampleMethod = method;
|
|
60
|
+
this._numSamplesInQuadrant = numSamplesInQuadrant;
|
|
61
|
+
this._maxError = maxError;
|
|
62
|
+
this._remapFunction = remapFunction;
|
|
63
|
+
this._forcePath = forcePath;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Construct options with optional defaults.
|
|
67
|
+
* @param method sample method, default [[EllipticalArcSampleMethod.AdaptiveSubdivision]].
|
|
68
|
+
* @param numSamplesInQuadrant samples in each full quadrant for interpolation methods, default 4.
|
|
69
|
+
* @param maxError positive maximum distance to ellipse for the subdivision method, default 1cm.
|
|
70
|
+
* @param remapFunction optional callback to remap fraction space for [[EllipticalArcSampleMethod.NonUniformCurvature]],
|
|
71
|
+
* default quadratic. For best results, this function should be a bijection.
|
|
72
|
+
* @param forcePath whether to return a [[Path]] instead of a [[Loop]] when approximating a full elliptical arc,
|
|
73
|
+
* default false.
|
|
74
|
+
*/
|
|
75
|
+
static create(method = EllipticalArcSampleMethod.AdaptiveSubdivision, numSamplesInQuadrant = 4, maxError = this.defaultMaxError, remapFunction = (x) => x * x, forcePath = false) {
|
|
76
|
+
if (numSamplesInQuadrant < 2)
|
|
77
|
+
numSamplesInQuadrant = 2;
|
|
78
|
+
if (maxError <= 0)
|
|
79
|
+
maxError = this.defaultMaxError;
|
|
80
|
+
return new EllipticalArcApproximationOptions(method, numSamplesInQuadrant, maxError, remapFunction, forcePath);
|
|
81
|
+
}
|
|
82
|
+
/** Clone the options. */
|
|
83
|
+
clone() {
|
|
84
|
+
return new EllipticalArcApproximationOptions(this.sampleMethod, this.numSamplesInQuadrant, this.maxError, this.remapFunction, this.forcePath);
|
|
85
|
+
}
|
|
86
|
+
/** Method used to sample the elliptical arc. */
|
|
87
|
+
get sampleMethod() {
|
|
88
|
+
return this._sampleMethod;
|
|
89
|
+
}
|
|
90
|
+
set sampleMethod(method) {
|
|
91
|
+
this._sampleMethod = method;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Number of samples to return in each full quadrant, including endpoint(s).
|
|
95
|
+
* * Used by interpolation sample methods.
|
|
96
|
+
* * In general, for n samples, the approximating [[Path]] consists of n-1 primitives,
|
|
97
|
+
* and the approximating [[Loop]] consists of n primitives.
|
|
98
|
+
* * Minimum value is 2.
|
|
99
|
+
*/
|
|
100
|
+
get numSamplesInQuadrant() {
|
|
101
|
+
return this._numSamplesInQuadrant;
|
|
102
|
+
}
|
|
103
|
+
set numSamplesInQuadrant(numSamples) {
|
|
104
|
+
this._numSamplesInQuadrant = numSamples;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Maximum distance (in meters) of the computed approximation to the elliptical arc.
|
|
108
|
+
* * Used by [[EllipticalArcSampleMethod.AdaptiveSubdivision]].
|
|
109
|
+
*/
|
|
110
|
+
get maxError() {
|
|
111
|
+
return this._maxError;
|
|
112
|
+
}
|
|
113
|
+
set maxError(error) {
|
|
114
|
+
this._maxError = error;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Callback function to remap fraction space to fraction space.
|
|
118
|
+
* * Used by [[EllipticalArcSampleMethod.NonUniformCurvature]].
|
|
119
|
+
*/
|
|
120
|
+
get remapFunction() {
|
|
121
|
+
return this._remapFunction;
|
|
122
|
+
}
|
|
123
|
+
set remapFunction(f) {
|
|
124
|
+
this._remapFunction = f;
|
|
125
|
+
}
|
|
126
|
+
/** Whether to return a [[Path]] instead of a [[Loop]] when approximating a full (closed) ellipse. */
|
|
127
|
+
get forcePath() {
|
|
128
|
+
return this._forcePath;
|
|
129
|
+
}
|
|
130
|
+
set forcePath(value) {
|
|
131
|
+
this._forcePath = value;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.EllipticalArcApproximationOptions = EllipticalArcApproximationOptions;
|
|
135
|
+
/** Default error tolerance. */
|
|
136
|
+
EllipticalArcApproximationOptions.defaultMaxError = Constant_1.Constant.oneCentimeter;
|
|
25
137
|
/**
|
|
26
138
|
* Circular or elliptic arc.
|
|
27
139
|
* * The angle to point equation is:
|
|
28
|
-
*
|
|
140
|
+
* * `X = center + cos(theta) * vector0 + sin(theta) * vector90`
|
|
29
141
|
* * When the two vectors are perpendicular and have equal length, it is a true circle.
|
|
30
142
|
* * Non-perpendicular vectors are always elliptic.
|
|
31
143
|
* * Vectors of unequal length are always elliptic.
|
|
32
144
|
* * To create an ellipse in the common "major and minor axis" form of an ellipse:
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* * The method toScaledMatrix3d() can be called to convert the unrestricted vector0,vector90 to perpendicular form.
|
|
37
|
-
* * The unrestricted form is much easier to work with for common calculations
|
|
38
|
-
* intersection with plane.
|
|
145
|
+
* * vector0 is the vector from the center to the major axis extreme.
|
|
146
|
+
* * vector90 is the vector from the center to the minor axis extreme.
|
|
147
|
+
* * Note that constructing these vectors to the extreme points makes them perpendicular.
|
|
148
|
+
* * The method toScaledMatrix3d() can be called to convert the unrestricted vector0, vector90 to perpendicular form.
|
|
149
|
+
* * The unrestricted form is much easier to work with for common calculations: stroking, projection to 2d, intersection with plane.
|
|
39
150
|
* @public
|
|
40
151
|
*/
|
|
41
152
|
class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
@@ -207,6 +318,35 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
207
318
|
vector90.scaleInPlace(v90Len);
|
|
208
319
|
return Arc3d.create(center, vector0, vector90, sweep, result);
|
|
209
320
|
}
|
|
321
|
+
/**
|
|
322
|
+
* Create a circular arc defined by start point, tangent at start point, and end point.
|
|
323
|
+
* If tangent is parallel to line segment from start to end, return the line segment.
|
|
324
|
+
*/
|
|
325
|
+
static createCircularStartTangentEnd(start, tangentAtStart, end, result) {
|
|
326
|
+
// To find the circle passing through start and end with tangentAtStart at start:
|
|
327
|
+
// - find line 1: the perpendicular bisector of the line from start to end.
|
|
328
|
+
// - find line 2: the perpendicular to the tangentAtStart.
|
|
329
|
+
// - intersection of the two lines would be the circle center.
|
|
330
|
+
const vector = Point3dVector3d_1.Vector3d.createStartEnd(start, end);
|
|
331
|
+
const normal = tangentAtStart.crossProduct(vector).normalize();
|
|
332
|
+
if (normal) {
|
|
333
|
+
const vectorPerp = normal.crossProduct(vector);
|
|
334
|
+
const tangentPerp = normal.crossProduct(tangentAtStart);
|
|
335
|
+
const midPoint = start.plusScaled(vector, 0.5);
|
|
336
|
+
const lineSeg1 = LineSegment3d_1.LineSegment3d.create(start, start.plusScaled(tangentPerp, 1));
|
|
337
|
+
const lineSeg2 = LineSegment3d_1.LineSegment3d.create(midPoint, midPoint.plusScaled(vectorPerp, 1));
|
|
338
|
+
const intersection = LineSegment3d_1.LineSegment3d.closestApproach(lineSeg1, true, lineSeg2, true);
|
|
339
|
+
if (intersection) {
|
|
340
|
+
const center = intersection.detailA.point;
|
|
341
|
+
const vector0 = Point3dVector3d_1.Vector3d.createStartEnd(center, start);
|
|
342
|
+
const vector90 = normal.crossProduct(vector0);
|
|
343
|
+
const endVector = Point3dVector3d_1.Vector3d.createStartEnd(center, end);
|
|
344
|
+
const sweep = AngleSweep_1.AngleSweep.create(vector0.signedAngleTo(endVector, normal));
|
|
345
|
+
return Arc3d.create(center, vector0, vector90, sweep, result);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return LineSegment3d_1.LineSegment3d.create(start, end);
|
|
349
|
+
}
|
|
210
350
|
/**
|
|
211
351
|
* Return a clone of this arc, projected to given z value.
|
|
212
352
|
* * If `z` is omitted, the clone is at the z of the center.
|
|
@@ -250,10 +390,10 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
250
390
|
const ac2 = vectorAC.magnitudeSquared();
|
|
251
391
|
const normal = vectorAB.sizedCrossProduct(vectorAC, Math.sqrt(Math.sqrt(ab2 * ac2)));
|
|
252
392
|
if (normal) {
|
|
253
|
-
const vectorToCenter = Polynomials_1.SmallSystem.linearSystem3d(normal.x, normal.y, normal.z, vectorAB.x, vectorAB.y, vectorAB.z, vectorAC.x, vectorAC.y, vectorAC.z, 0, // vectorToCenter DOT normal = 0
|
|
254
|
-
0.5 * ab2, // vectorToCenter DOT vectorAB =
|
|
393
|
+
const vectorToCenter = Polynomials_1.SmallSystem.linearSystem3d(normal.x, normal.y, normal.z, vectorAB.x, vectorAB.y, vectorAB.z, vectorAC.x, vectorAC.y, vectorAC.z, 0, // vectorToCenter DOT normal = 0 (ensure normal is perp to the plane of the 3 points)
|
|
394
|
+
0.5 * ab2, // vectorToCenter DOT vectorAB = ab2 / 2 (ensure the projection of vectorToCenter on AB bisects AB)
|
|
255
395
|
0.5 * ac2);
|
|
256
|
-
if (vectorToCenter) {
|
|
396
|
+
if (vectorToCenter) { // i.e., the negative of vectorX
|
|
257
397
|
const center = Point3dVector3d_1.Point3d.create(pointA.x, pointA.y, pointA.z).plus(vectorToCenter);
|
|
258
398
|
const vectorX = Point3dVector3d_1.Vector3d.createStartEnd(center, pointA);
|
|
259
399
|
const vectorY = Point3dVector3d_1.Vector3d.createRotateVectorAroundVector(vectorX, normal, Angle_1.Angle.createDegrees(90));
|
|
@@ -337,7 +477,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
337
477
|
return result;
|
|
338
478
|
}
|
|
339
479
|
/**
|
|
340
|
-
* Evaluate the point
|
|
480
|
+
* Evaluate the point with respect to the angle (in radians)
|
|
341
481
|
* @param radians angular position
|
|
342
482
|
* @param result optional preallocated ray.
|
|
343
483
|
*/
|
|
@@ -379,14 +519,14 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
379
519
|
return result;
|
|
380
520
|
}
|
|
381
521
|
/**
|
|
382
|
-
* Return the start point
|
|
522
|
+
* Return the start point of the arc.
|
|
383
523
|
* @param result optional preallocated result
|
|
384
524
|
*/
|
|
385
525
|
startPoint(result) {
|
|
386
526
|
return this.fractionToPoint(0.0, result);
|
|
387
527
|
}
|
|
388
528
|
/**
|
|
389
|
-
* Return the end point
|
|
529
|
+
* Return the end point of the arc.
|
|
390
530
|
* @param result optional preallocated result
|
|
391
531
|
*/
|
|
392
532
|
endPoint(result) {
|
|
@@ -474,19 +614,19 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
474
614
|
return CurveLocationDetail_1.CurveLocationDetail.createConditionalMoveSignedDistance(allowExtension, this, startFraction, startFraction + signedFractionMove, signedDistance, result);
|
|
475
615
|
}
|
|
476
616
|
/**
|
|
477
|
-
* Return all angles
|
|
617
|
+
* Return all radian angles where the ellipse tangent is perpendicular to the vector to a spacePoint.
|
|
478
618
|
* @param spacePoint point of origin of vectors to the ellipse
|
|
479
|
-
* @param _extend
|
|
480
|
-
* @param
|
|
619
|
+
* @param _extend always true. Sweep is ignored: perpendiculars for the full ellipse are returned.
|
|
620
|
+
* @param endpoints if true, force the end radians into the result.
|
|
481
621
|
*/
|
|
482
|
-
allPerpendicularAngles(spacePoint, _extend = true,
|
|
622
|
+
allPerpendicularAngles(spacePoint, _extend = true, endpoints = false) {
|
|
483
623
|
const radians = [];
|
|
484
624
|
const vectorQ = spacePoint.vectorTo(this.center);
|
|
485
625
|
const uu = this._matrix.columnXMagnitudeSquared();
|
|
486
626
|
const uv = this._matrix.columnXDotColumnY();
|
|
487
627
|
const vv = this._matrix.columnYMagnitudeSquared();
|
|
488
628
|
Polynomials_1.TrigPolynomial.solveUnitCircleImplicitQuadricIntersection(uv, vv - uu, -uv, this._matrix.dotColumnY(vectorQ), -this._matrix.dotColumnX(vectorQ), 0.0, radians);
|
|
489
|
-
if (
|
|
629
|
+
if (endpoints) {
|
|
490
630
|
radians.push(this.sweep.startRadians);
|
|
491
631
|
radians.push(this.sweep.endRadians);
|
|
492
632
|
}
|
|
@@ -720,8 +860,8 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
720
860
|
const vector90A = this._matrix.multiplyXY(-angleData.s, angleData.c);
|
|
721
861
|
const axes = Matrix3d_1.Matrix3d.createRigidFromColumns(vector0A, vector90A, Geometry_1.AxisOrder.XYZ);
|
|
722
862
|
return {
|
|
723
|
-
axes: (axes ? axes : Matrix3d_1.Matrix3d.createIdentity()),
|
|
724
863
|
center: this._center,
|
|
864
|
+
axes: (axes ? axes : Matrix3d_1.Matrix3d.createIdentity()),
|
|
725
865
|
r0: vector0A.magnitude(),
|
|
726
866
|
r90: vector90A.magnitude(),
|
|
727
867
|
sweep: this.sweep.cloneMinusRadians(angleData.radians),
|
|
@@ -997,6 +1137,20 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
997
1137
|
projectedParameterRange(ray, lowHigh) {
|
|
998
1138
|
return PlaneAltitudeRangeContext_1.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
|
|
999
1139
|
}
|
|
1140
|
+
/**
|
|
1141
|
+
* Construct a circular arc chain approximation to the instance elliptical arc.
|
|
1142
|
+
* @param options bundle of options for sampling an elliptical arc (use default options if undefined)
|
|
1143
|
+
* @returns the approximating curve chain, the circular instance, or undefined if construction fails.
|
|
1144
|
+
*/
|
|
1145
|
+
constructCircularArcChainApproximation(options) {
|
|
1146
|
+
if (!options)
|
|
1147
|
+
options = EllipticalArcApproximationOptions.create();
|
|
1148
|
+
const context = EllipticalArcApproximationContext_1.EllipticalArcApproximationContext.create(this);
|
|
1149
|
+
const result = context.constructCircularArcChainApproximation(options);
|
|
1150
|
+
if (!result && this.isCircular)
|
|
1151
|
+
return (this.sweep.isFullCircle && options.forcePath) ? Path_1.Path.create(this) : this;
|
|
1152
|
+
return result;
|
|
1153
|
+
}
|
|
1000
1154
|
}
|
|
1001
1155
|
exports.Arc3d = Arc3d;
|
|
1002
1156
|
Arc3d._workPointA = Point3dVector3d_1.Point3d.create();
|