@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.
Files changed (202) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/Geometry.d.ts +57 -46
  3. package/lib/cjs/Geometry.d.ts.map +1 -1
  4. package/lib/cjs/Geometry.js +73 -53
  5. package/lib/cjs/Geometry.js.map +1 -1
  6. package/lib/cjs/curve/Arc3d.d.ts +128 -34
  7. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  8. package/lib/cjs/curve/Arc3d.js +174 -20
  9. package/lib/cjs/curve/Arc3d.js.map +1 -1
  10. package/lib/cjs/curve/CurveCollection.d.ts +2 -1
  11. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  12. package/lib/cjs/curve/CurveCollection.js +2 -1
  13. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  14. package/lib/cjs/curve/CurveLocationDetail.d.ts +19 -1
  15. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  16. package/lib/cjs/curve/CurveLocationDetail.js +39 -0
  17. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  18. package/lib/cjs/curve/LineString3d.js +1 -1
  19. package/lib/cjs/curve/LineString3d.js.map +1 -1
  20. package/lib/cjs/curve/OffsetOptions.d.ts +1 -1
  21. package/lib/cjs/curve/OffsetOptions.js +1 -1
  22. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  23. package/lib/cjs/curve/RegionOps.d.ts +2 -1
  24. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  25. package/lib/cjs/curve/RegionOps.js +2 -1
  26. package/lib/cjs/curve/RegionOps.js.map +1 -1
  27. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +23 -7
  28. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  29. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +43 -35
  30. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  31. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts +211 -0
  32. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -0
  33. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +1000 -0
  34. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -0
  35. package/lib/cjs/geometry3d/Angle.d.ts +18 -5
  36. package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
  37. package/lib/cjs/geometry3d/Angle.js +23 -7
  38. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  39. package/lib/cjs/geometry3d/AngleSweep.d.ts +14 -1
  40. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  41. package/lib/cjs/geometry3d/AngleSweep.js +47 -12
  42. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  43. package/lib/cjs/geometry3d/Matrix3d.d.ts +6 -4
  44. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  45. package/lib/cjs/geometry3d/Matrix3d.js +6 -4
  46. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  47. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +2 -3
  48. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  49. package/lib/cjs/geometry3d/Point3dVector3d.js +2 -3
  50. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  51. package/lib/cjs/geometry3d/PointHelpers.d.ts +6 -5
  52. package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
  53. package/lib/cjs/geometry3d/PointHelpers.js +11 -10
  54. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  55. package/lib/cjs/geometry3d/Range.d.ts +6 -1
  56. package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
  57. package/lib/cjs/geometry3d/Range.js +9 -3
  58. package/lib/cjs/geometry3d/Range.js.map +1 -1
  59. package/lib/cjs/geometry3d/Transform.d.ts +1 -1
  60. package/lib/cjs/geometry3d/Transform.js +1 -1
  61. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  62. package/lib/cjs/numerics/Newton.d.ts +3 -3
  63. package/lib/cjs/numerics/Newton.d.ts.map +1 -1
  64. package/lib/cjs/numerics/Newton.js +14 -16
  65. package/lib/cjs/numerics/Newton.js.map +1 -1
  66. package/lib/cjs/numerics/Polynomials.d.ts +2 -2
  67. package/lib/cjs/numerics/Polynomials.js +2 -2
  68. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  69. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +7 -4
  70. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  71. package/lib/cjs/polyface/PolyfaceBuilder.js +8 -4
  72. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  73. package/lib/cjs/polyface/PolyfaceQuery.d.ts +3 -3
  74. package/lib/cjs/polyface/PolyfaceQuery.js +3 -3
  75. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  76. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  77. package/lib/cjs/serialization/BGFBWriter.js +2 -2
  78. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  79. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  80. package/lib/cjs/topology/Graph.d.ts +1 -1
  81. package/lib/cjs/topology/Graph.js +2 -2
  82. package/lib/cjs/topology/Graph.js.map +1 -1
  83. package/lib/cjs/topology/HalfEdgeNodeXYZUV.d.ts +1 -1
  84. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js +1 -1
  85. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  86. package/lib/cjs/topology/HalfEdgePointInGraphSearch.d.ts +57 -15
  87. package/lib/cjs/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
  88. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js +168 -127
  89. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  90. package/lib/cjs/topology/HalfEdgePositionDetail.d.ts +35 -35
  91. package/lib/cjs/topology/HalfEdgePositionDetail.d.ts.map +1 -1
  92. package/lib/cjs/topology/HalfEdgePositionDetail.js +63 -41
  93. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  94. package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts +64 -12
  95. package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
  96. package/lib/cjs/topology/InsertAndRetriangulateContext.js +174 -75
  97. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  98. package/lib/cjs/topology/Triangulation.d.ts +16 -10
  99. package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
  100. package/lib/cjs/topology/Triangulation.js +23 -30
  101. package/lib/cjs/topology/Triangulation.js.map +1 -1
  102. package/lib/esm/Geometry.d.ts +57 -46
  103. package/lib/esm/Geometry.d.ts.map +1 -1
  104. package/lib/esm/Geometry.js +73 -53
  105. package/lib/esm/Geometry.js.map +1 -1
  106. package/lib/esm/curve/Arc3d.d.ts +128 -34
  107. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  108. package/lib/esm/curve/Arc3d.js +172 -19
  109. package/lib/esm/curve/Arc3d.js.map +1 -1
  110. package/lib/esm/curve/CurveCollection.d.ts +2 -1
  111. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  112. package/lib/esm/curve/CurveCollection.js +2 -1
  113. package/lib/esm/curve/CurveCollection.js.map +1 -1
  114. package/lib/esm/curve/CurveLocationDetail.d.ts +19 -1
  115. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  116. package/lib/esm/curve/CurveLocationDetail.js +39 -0
  117. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  118. package/lib/esm/curve/LineString3d.js +1 -1
  119. package/lib/esm/curve/LineString3d.js.map +1 -1
  120. package/lib/esm/curve/OffsetOptions.d.ts +1 -1
  121. package/lib/esm/curve/OffsetOptions.js +1 -1
  122. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  123. package/lib/esm/curve/RegionOps.d.ts +2 -1
  124. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  125. package/lib/esm/curve/RegionOps.js +2 -1
  126. package/lib/esm/curve/RegionOps.js.map +1 -1
  127. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +23 -7
  128. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  129. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +43 -35
  130. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  131. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts +211 -0
  132. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -0
  133. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +995 -0
  134. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -0
  135. package/lib/esm/geometry3d/Angle.d.ts +18 -5
  136. package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
  137. package/lib/esm/geometry3d/Angle.js +23 -7
  138. package/lib/esm/geometry3d/Angle.js.map +1 -1
  139. package/lib/esm/geometry3d/AngleSweep.d.ts +14 -1
  140. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  141. package/lib/esm/geometry3d/AngleSweep.js +47 -12
  142. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  143. package/lib/esm/geometry3d/Matrix3d.d.ts +6 -4
  144. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  145. package/lib/esm/geometry3d/Matrix3d.js +6 -4
  146. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  147. package/lib/esm/geometry3d/Point3dVector3d.d.ts +2 -3
  148. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  149. package/lib/esm/geometry3d/Point3dVector3d.js +2 -3
  150. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  151. package/lib/esm/geometry3d/PointHelpers.d.ts +6 -5
  152. package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
  153. package/lib/esm/geometry3d/PointHelpers.js +11 -10
  154. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  155. package/lib/esm/geometry3d/Range.d.ts +6 -1
  156. package/lib/esm/geometry3d/Range.d.ts.map +1 -1
  157. package/lib/esm/geometry3d/Range.js +9 -3
  158. package/lib/esm/geometry3d/Range.js.map +1 -1
  159. package/lib/esm/geometry3d/Transform.d.ts +1 -1
  160. package/lib/esm/geometry3d/Transform.js +1 -1
  161. package/lib/esm/geometry3d/Transform.js.map +1 -1
  162. package/lib/esm/numerics/Newton.d.ts +3 -3
  163. package/lib/esm/numerics/Newton.d.ts.map +1 -1
  164. package/lib/esm/numerics/Newton.js +14 -16
  165. package/lib/esm/numerics/Newton.js.map +1 -1
  166. package/lib/esm/numerics/Polynomials.d.ts +2 -2
  167. package/lib/esm/numerics/Polynomials.js +2 -2
  168. package/lib/esm/numerics/Polynomials.js.map +1 -1
  169. package/lib/esm/polyface/PolyfaceBuilder.d.ts +7 -4
  170. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  171. package/lib/esm/polyface/PolyfaceBuilder.js +8 -4
  172. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  173. package/lib/esm/polyface/PolyfaceQuery.d.ts +3 -3
  174. package/lib/esm/polyface/PolyfaceQuery.js +3 -3
  175. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  176. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  177. package/lib/esm/serialization/BGFBWriter.js +2 -2
  178. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  179. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  180. package/lib/esm/topology/Graph.d.ts +1 -1
  181. package/lib/esm/topology/Graph.js +2 -2
  182. package/lib/esm/topology/Graph.js.map +1 -1
  183. package/lib/esm/topology/HalfEdgeNodeXYZUV.d.ts +1 -1
  184. package/lib/esm/topology/HalfEdgeNodeXYZUV.js +1 -1
  185. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  186. package/lib/esm/topology/HalfEdgePointInGraphSearch.d.ts +57 -15
  187. package/lib/esm/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
  188. package/lib/esm/topology/HalfEdgePointInGraphSearch.js +168 -127
  189. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  190. package/lib/esm/topology/HalfEdgePositionDetail.d.ts +35 -35
  191. package/lib/esm/topology/HalfEdgePositionDetail.d.ts.map +1 -1
  192. package/lib/esm/topology/HalfEdgePositionDetail.js +63 -41
  193. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  194. package/lib/esm/topology/InsertAndRetriangulateContext.d.ts +64 -12
  195. package/lib/esm/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
  196. package/lib/esm/topology/InsertAndRetriangulateContext.js +173 -74
  197. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  198. package/lib/esm/topology/Triangulation.d.ts +16 -10
  199. package/lib/esm/topology/Triangulation.d.ts.map +1 -1
  200. package/lib/esm/topology/Triangulation.js +24 -31
  201. package/lib/esm/topology/Triangulation.js.map +1 -1
  202. package/package.json +3 -3
@@ -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 for angle coordinates 0 and 90 degrees, and sweep.
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 angle 0 in parameter space */
38
+ /** Vector from the arc center to the arc point at parameter 0 degrees. */
37
39
  vector0: Vector3d;
38
- /** Vector to point at angle 90 degrees in parameter space */
40
+ /** Vector from the arc center to the arc point at parameter 90 degrees. */
39
41
  vector90: Vector3d;
40
- /** Angle swept by the subset of the complete arc */
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
- * * `X = center + cos(theta) * vector0 + sin(theta) * vector90`
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
- * ** vector0 is the vector from the center to the major axis extreme.
52
- * ** vector90 is the vector from the center to the minor axis extreme.
53
- * ** note that constructing the vectors to the extreme points makes them perpendicular.
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 -- stroking, projection to 2d,
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 | undefined;
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 and derivative with respect to the angle (in radians)
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 tof the arc.
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 tof the arc.
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 (in radians) where the ellipse tangent is perpendicular to the vector to a spacePoint.
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 (NOT SUPPORTED -- ALWAYS ACTS AS "true")
284
- * @param _endpoints if true, force the end radians into the result.
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, _endpoints?: boolean): number[];
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
- * Carrier structure for an arc with fractional data on incoming, outgoing curves.
485
- * @public
486
- */
487
- export interface ArcBlendData {
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":"","sources":["../../../src/curve/Arc3d.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAa,eAAe,EAAY,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAA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KG;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"}
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
+ import { Constant } from "../Constant";
5
6
  import { AxisOrder, Geometry } from "../Geometry";
6
7
  import { Angle } from "../geometry3d/Angle";
7
8
  import { AngleSweep } from "../geometry3d/AngleSweep";
@@ -15,24 +16,133 @@ import { CurveExtendMode, CurveExtendOptions } from "./CurveExtendMode";
15
16
  import { CurveIntervalRole, CurveLocationDetail, CurveSearchStatus } from "./CurveLocationDetail";
16
17
  import { CurvePrimitive } from "./CurvePrimitive";
17
18
  import { CurveOffsetXYHandler } from "./internalContexts/CurveOffsetXYHandler";
19
+ import { EllipticalArcApproximationContext } from "./internalContexts/EllipticalArcApproximationContext";
18
20
  import { PlaneAltitudeRangeContext } from "./internalContexts/PlaneAltitudeRangeContext";
21
+ import { LineSegment3d } from "./LineSegment3d";
19
22
  import { LineString3d } from "./LineString3d";
20
23
  import { OffsetOptions } from "./OffsetOptions";
24
+ import { Path } from "./Path";
21
25
  import { StrokeOptions } from "./StrokeOptions";
26
+ /**
27
+ * Enumeration of methods used to sample an elliptical arc in [[Arc3d.constructCircularArcChainApproximation]].
28
+ * * Because ellipses have two axes of symmetry, samples are computed for one quadrant and reflected across each
29
+ * axis to the other quadrants. Any samples that fall outside the arc sweep are filtered out.
30
+ * @public
31
+ */
32
+ export var EllipticalArcSampleMethod;
33
+ (function (EllipticalArcSampleMethod) {
34
+ /** Generate n samples uniformly interpolated between the min and max parameters of a full ellipse quadrant. */
35
+ EllipticalArcSampleMethod[EllipticalArcSampleMethod["UniformParameter"] = 0] = "UniformParameter";
36
+ /** Generate n samples uniformly interpolated between the min and max curvatures of a full ellipse quadrant. */
37
+ EllipticalArcSampleMethod[EllipticalArcSampleMethod["UniformCurvature"] = 1] = "UniformCurvature";
38
+ /**
39
+ * Generate n samples interpolated between the min and max curvatures of a full ellipse quadrant, using a
40
+ * [[FractionMapper]] callback to generate the interpolation weights.
41
+ */
42
+ EllipticalArcSampleMethod[EllipticalArcSampleMethod["NonUniformCurvature"] = 2] = "NonUniformCurvature";
43
+ /**
44
+ * Generate samples by subdividing parameter space until the approximation has less than a given max
45
+ * distance to the elliptical arc.
46
+ */
47
+ EllipticalArcSampleMethod[EllipticalArcSampleMethod["AdaptiveSubdivision"] = 3] = "AdaptiveSubdivision";
48
+ })(EllipticalArcSampleMethod || (EllipticalArcSampleMethod = {}));
49
+ /**
50
+ * Options for generating samples for the construction of an approximation to an elliptical arc.
51
+ * * Used by [[Arc3d.constructCircularArcChainApproximation]].
52
+ * @public
53
+ */
54
+ export class EllipticalArcApproximationOptions {
55
+ constructor(method, numSamplesInQuadrant, maxError, remapFunction, forcePath) {
56
+ this._sampleMethod = method;
57
+ this._numSamplesInQuadrant = numSamplesInQuadrant;
58
+ this._maxError = maxError;
59
+ this._remapFunction = remapFunction;
60
+ this._forcePath = forcePath;
61
+ }
62
+ /**
63
+ * Construct options with optional defaults.
64
+ * @param method sample method, default [[EllipticalArcSampleMethod.AdaptiveSubdivision]].
65
+ * @param numSamplesInQuadrant samples in each full quadrant for interpolation methods, default 4.
66
+ * @param maxError positive maximum distance to ellipse for the subdivision method, default 1cm.
67
+ * @param remapFunction optional callback to remap fraction space for [[EllipticalArcSampleMethod.NonUniformCurvature]],
68
+ * default quadratic. For best results, this function should be a bijection.
69
+ * @param forcePath whether to return a [[Path]] instead of a [[Loop]] when approximating a full elliptical arc,
70
+ * default false.
71
+ */
72
+ static create(method = EllipticalArcSampleMethod.AdaptiveSubdivision, numSamplesInQuadrant = 4, maxError = this.defaultMaxError, remapFunction = (x) => x * x, forcePath = false) {
73
+ if (numSamplesInQuadrant < 2)
74
+ numSamplesInQuadrant = 2;
75
+ if (maxError <= 0)
76
+ maxError = this.defaultMaxError;
77
+ return new EllipticalArcApproximationOptions(method, numSamplesInQuadrant, maxError, remapFunction, forcePath);
78
+ }
79
+ /** Clone the options. */
80
+ clone() {
81
+ return new EllipticalArcApproximationOptions(this.sampleMethod, this.numSamplesInQuadrant, this.maxError, this.remapFunction, this.forcePath);
82
+ }
83
+ /** Method used to sample the elliptical arc. */
84
+ get sampleMethod() {
85
+ return this._sampleMethod;
86
+ }
87
+ set sampleMethod(method) {
88
+ this._sampleMethod = method;
89
+ }
90
+ /**
91
+ * Number of samples to return in each full quadrant, including endpoint(s).
92
+ * * Used by interpolation sample methods.
93
+ * * In general, for n samples, the approximating [[Path]] consists of n-1 primitives,
94
+ * and the approximating [[Loop]] consists of n primitives.
95
+ * * Minimum value is 2.
96
+ */
97
+ get numSamplesInQuadrant() {
98
+ return this._numSamplesInQuadrant;
99
+ }
100
+ set numSamplesInQuadrant(numSamples) {
101
+ this._numSamplesInQuadrant = numSamples;
102
+ }
103
+ /**
104
+ * Maximum distance (in meters) of the computed approximation to the elliptical arc.
105
+ * * Used by [[EllipticalArcSampleMethod.AdaptiveSubdivision]].
106
+ */
107
+ get maxError() {
108
+ return this._maxError;
109
+ }
110
+ set maxError(error) {
111
+ this._maxError = error;
112
+ }
113
+ /**
114
+ * Callback function to remap fraction space to fraction space.
115
+ * * Used by [[EllipticalArcSampleMethod.NonUniformCurvature]].
116
+ */
117
+ get remapFunction() {
118
+ return this._remapFunction;
119
+ }
120
+ set remapFunction(f) {
121
+ this._remapFunction = f;
122
+ }
123
+ /** Whether to return a [[Path]] instead of a [[Loop]] when approximating a full (closed) ellipse. */
124
+ get forcePath() {
125
+ return this._forcePath;
126
+ }
127
+ set forcePath(value) {
128
+ this._forcePath = value;
129
+ }
130
+ }
131
+ /** Default error tolerance. */
132
+ EllipticalArcApproximationOptions.defaultMaxError = Constant.oneCentimeter;
22
133
  /**
23
134
  * Circular or elliptic arc.
24
135
  * * The angle to point equation is:
25
- * * `X = center + cos(theta) * vector0 + sin(theta) * vector90`
136
+ * * `X = center + cos(theta) * vector0 + sin(theta) * vector90`
26
137
  * * When the two vectors are perpendicular and have equal length, it is a true circle.
27
138
  * * Non-perpendicular vectors are always elliptic.
28
139
  * * Vectors of unequal length are always elliptic.
29
140
  * * To create an ellipse in the common "major and minor axis" form of an ellipse:
30
- * ** vector0 is the vector from the center to the major axis extreme.
31
- * ** vector90 is the vector from the center to the minor axis extreme.
32
- * ** note that constructing the vectors to the extreme points makes them perpendicular.
33
- * * The method toScaledMatrix3d() can be called to convert the unrestricted vector0,vector90 to perpendicular form.
34
- * * The unrestricted form is much easier to work with for common calculations -- stroking, projection to 2d,
35
- * intersection with plane.
141
+ * * vector0 is the vector from the center to the major axis extreme.
142
+ * * vector90 is the vector from the center to the minor axis extreme.
143
+ * * Note that constructing these vectors to the extreme points makes them perpendicular.
144
+ * * The method toScaledMatrix3d() can be called to convert the unrestricted vector0, vector90 to perpendicular form.
145
+ * * The unrestricted form is much easier to work with for common calculations: stroking, projection to 2d, intersection with plane.
36
146
  * @public
37
147
  */
38
148
  export class Arc3d extends CurvePrimitive {
@@ -204,6 +314,35 @@ export class Arc3d extends CurvePrimitive {
204
314
  vector90.scaleInPlace(v90Len);
205
315
  return Arc3d.create(center, vector0, vector90, sweep, result);
206
316
  }
317
+ /**
318
+ * Create a circular arc defined by start point, tangent at start point, and end point.
319
+ * If tangent is parallel to line segment from start to end, return the line segment.
320
+ */
321
+ static createCircularStartTangentEnd(start, tangentAtStart, end, result) {
322
+ // To find the circle passing through start and end with tangentAtStart at start:
323
+ // - find line 1: the perpendicular bisector of the line from start to end.
324
+ // - find line 2: the perpendicular to the tangentAtStart.
325
+ // - intersection of the two lines would be the circle center.
326
+ const vector = Vector3d.createStartEnd(start, end);
327
+ const normal = tangentAtStart.crossProduct(vector).normalize();
328
+ if (normal) {
329
+ const vectorPerp = normal.crossProduct(vector);
330
+ const tangentPerp = normal.crossProduct(tangentAtStart);
331
+ const midPoint = start.plusScaled(vector, 0.5);
332
+ const lineSeg1 = LineSegment3d.create(start, start.plusScaled(tangentPerp, 1));
333
+ const lineSeg2 = LineSegment3d.create(midPoint, midPoint.plusScaled(vectorPerp, 1));
334
+ const intersection = LineSegment3d.closestApproach(lineSeg1, true, lineSeg2, true);
335
+ if (intersection) {
336
+ const center = intersection.detailA.point;
337
+ const vector0 = Vector3d.createStartEnd(center, start);
338
+ const vector90 = normal.crossProduct(vector0);
339
+ const endVector = Vector3d.createStartEnd(center, end);
340
+ const sweep = AngleSweep.create(vector0.signedAngleTo(endVector, normal));
341
+ return Arc3d.create(center, vector0, vector90, sweep, result);
342
+ }
343
+ }
344
+ return LineSegment3d.create(start, end);
345
+ }
207
346
  /**
208
347
  * Return a clone of this arc, projected to given z value.
209
348
  * * If `z` is omitted, the clone is at the z of the center.
@@ -247,10 +386,10 @@ export class Arc3d extends CurvePrimitive {
247
386
  const ac2 = vectorAC.magnitudeSquared();
248
387
  const normal = vectorAB.sizedCrossProduct(vectorAC, Math.sqrt(Math.sqrt(ab2 * ac2)));
249
388
  if (normal) {
250
- const vectorToCenter = 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
251
- 0.5 * ab2, // vectorToCenter DOT vectorAB = 0.5 * vectorAB DOT vectorAB (Rayleigh quotient)
389
+ const vectorToCenter = 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)
390
+ 0.5 * ab2, // vectorToCenter DOT vectorAB = ab2 / 2 (ensure the projection of vectorToCenter on AB bisects AB)
252
391
  0.5 * ac2);
253
- if (vectorToCenter) {
392
+ if (vectorToCenter) { // i.e., the negative of vectorX
254
393
  const center = Point3d.create(pointA.x, pointA.y, pointA.z).plus(vectorToCenter);
255
394
  const vectorX = Vector3d.createStartEnd(center, pointA);
256
395
  const vectorY = Vector3d.createRotateVectorAroundVector(vectorX, normal, Angle.createDegrees(90));
@@ -334,7 +473,7 @@ export class Arc3d extends CurvePrimitive {
334
473
  return result;
335
474
  }
336
475
  /**
337
- * Evaluate the point and derivative with respect to the angle (in radians)
476
+ * Evaluate the point with respect to the angle (in radians)
338
477
  * @param radians angular position
339
478
  * @param result optional preallocated ray.
340
479
  */
@@ -376,14 +515,14 @@ export class Arc3d extends CurvePrimitive {
376
515
  return result;
377
516
  }
378
517
  /**
379
- * Return the start point tof the arc.
518
+ * Return the start point of the arc.
380
519
  * @param result optional preallocated result
381
520
  */
382
521
  startPoint(result) {
383
522
  return this.fractionToPoint(0.0, result);
384
523
  }
385
524
  /**
386
- * Return the end point tof the arc.
525
+ * Return the end point of the arc.
387
526
  * @param result optional preallocated result
388
527
  */
389
528
  endPoint(result) {
@@ -471,19 +610,19 @@ export class Arc3d extends CurvePrimitive {
471
610
  return CurveLocationDetail.createConditionalMoveSignedDistance(allowExtension, this, startFraction, startFraction + signedFractionMove, signedDistance, result);
472
611
  }
473
612
  /**
474
- * Return all angles (in radians) where the ellipse tangent is perpendicular to the vector to a spacePoint.
613
+ * Return all radian angles where the ellipse tangent is perpendicular to the vector to a spacePoint.
475
614
  * @param spacePoint point of origin of vectors to the ellipse
476
- * @param _extend (NOT SUPPORTED -- ALWAYS ACTS AS "true")
477
- * @param _endpoints if true, force the end radians into the result.
615
+ * @param _extend always true. Sweep is ignored: perpendiculars for the full ellipse are returned.
616
+ * @param endpoints if true, force the end radians into the result.
478
617
  */
479
- allPerpendicularAngles(spacePoint, _extend = true, _endpoints = false) {
618
+ allPerpendicularAngles(spacePoint, _extend = true, endpoints = false) {
480
619
  const radians = [];
481
620
  const vectorQ = spacePoint.vectorTo(this.center);
482
621
  const uu = this._matrix.columnXMagnitudeSquared();
483
622
  const uv = this._matrix.columnXDotColumnY();
484
623
  const vv = this._matrix.columnYMagnitudeSquared();
485
624
  TrigPolynomial.solveUnitCircleImplicitQuadricIntersection(uv, vv - uu, -uv, this._matrix.dotColumnY(vectorQ), -this._matrix.dotColumnX(vectorQ), 0.0, radians);
486
- if (_endpoints) {
625
+ if (endpoints) {
487
626
  radians.push(this.sweep.startRadians);
488
627
  radians.push(this.sweep.endRadians);
489
628
  }
@@ -717,8 +856,8 @@ export class Arc3d extends CurvePrimitive {
717
856
  const vector90A = this._matrix.multiplyXY(-angleData.s, angleData.c);
718
857
  const axes = Matrix3d.createRigidFromColumns(vector0A, vector90A, AxisOrder.XYZ);
719
858
  return {
720
- axes: (axes ? axes : Matrix3d.createIdentity()),
721
859
  center: this._center,
860
+ axes: (axes ? axes : Matrix3d.createIdentity()),
722
861
  r0: vector0A.magnitude(),
723
862
  r90: vector90A.magnitude(),
724
863
  sweep: this.sweep.cloneMinusRadians(angleData.radians),
@@ -994,6 +1133,20 @@ export class Arc3d extends CurvePrimitive {
994
1133
  projectedParameterRange(ray, lowHigh) {
995
1134
  return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
996
1135
  }
1136
+ /**
1137
+ * Construct a circular arc chain approximation to the instance elliptical arc.
1138
+ * @param options bundle of options for sampling an elliptical arc (use default options if undefined)
1139
+ * @returns the approximating curve chain, the circular instance, or undefined if construction fails.
1140
+ */
1141
+ constructCircularArcChainApproximation(options) {
1142
+ if (!options)
1143
+ options = EllipticalArcApproximationOptions.create();
1144
+ const context = EllipticalArcApproximationContext.create(this);
1145
+ const result = context.constructCircularArcChainApproximation(options);
1146
+ if (!result && this.isCircular)
1147
+ return (this.sweep.isFullCircle && options.forcePath) ? Path.create(this) : this;
1148
+ return result;
1149
+ }
997
1150
  }
998
1151
  Arc3d._workPointA = Point3d.create();
999
1152
  Arc3d._workPointB = Point3d.create();