@itwin/core-geometry 5.0.0-dev.2 → 5.0.0-dev.20
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 +19 -1
- package/lib/cjs/bspline/BSplineCurveOps.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.js +18 -21
- package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +30 -7
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +53 -7
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +16 -2
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +33 -2
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +81 -53
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +190 -103
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +12 -8
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +29 -8
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.d.ts +12 -6
- package/lib/cjs/curve/Loop.d.ts.map +1 -1
- package/lib/cjs/curve/Loop.js +12 -6
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.d.ts +8 -6
- package/lib/cjs/curve/Query/CylindricalRange.d.ts.map +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.js +13 -9
- package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +24 -18
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +14 -8
- package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js +17 -8
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js +4 -4
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts +2 -0
- package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js +4 -0
- package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +32 -10
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +54 -16
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +13 -2
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +24 -10
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +11 -8
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +28 -26
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +6 -6
- package/lib/cjs/geometry3d/Point3dVector3d.js +6 -6
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +12 -6
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +94 -47
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts +7 -4
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +7 -4
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry4d/MomentData.d.ts +72 -73
- package/lib/cjs/geometry4d/MomentData.d.ts.map +1 -1
- package/lib/cjs/geometry4d/MomentData.js +62 -64
- package/lib/cjs/geometry4d/MomentData.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.d.ts +5 -5
- package/lib/cjs/numerics/Polynomials.js +6 -6
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/polyface/AuxData.d.ts +2 -2
- package/lib/cjs/polyface/AuxData.d.ts.map +1 -1
- package/lib/cjs/polyface/AuxData.js +11 -3
- package/lib/cjs/polyface/AuxData.js.map +1 -1
- package/lib/cjs/polyface/Polyface.d.ts +3 -5
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +6 -13
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +13 -6
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +65 -38
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +13 -3
- package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +21 -4
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +2 -2
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +4 -3
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +5 -5
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +5 -5
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/solid/Box.d.ts +9 -3
- package/lib/cjs/solid/Box.d.ts.map +1 -1
- package/lib/cjs/solid/Box.js +10 -5
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.d.ts +3 -2
- package/lib/cjs/solid/Cone.d.ts.map +1 -1
- package/lib/cjs/solid/Cone.js +3 -3
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts +9 -3
- package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
- package/lib/cjs/solid/LinearSweep.js +9 -4
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts +15 -4
- package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js +20 -7
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts +35 -26
- package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RuledSweep.js +41 -28
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.d.ts +12 -11
- package/lib/cjs/solid/SolidPrimitive.d.ts.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.js +8 -5
- package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
- package/lib/cjs/solid/Sphere.d.ts +17 -7
- package/lib/cjs/solid/Sphere.d.ts.map +1 -1
- package/lib/cjs/solid/Sphere.js +22 -16
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.d.ts +1 -1
- package/lib/cjs/solid/SweepContour.js +1 -1
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.d.ts +8 -2
- package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
- package/lib/cjs/solid/TorusPipe.js +9 -5
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js +18 -21
- package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +30 -7
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +53 -7
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +16 -2
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +33 -2
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +81 -53
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +190 -103
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +12 -8
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +29 -8
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.d.ts +12 -6
- package/lib/esm/curve/Loop.d.ts.map +1 -1
- package/lib/esm/curve/Loop.js +12 -6
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/Query/CylindricalRange.d.ts +8 -6
- package/lib/esm/curve/Query/CylindricalRange.d.ts.map +1 -1
- package/lib/esm/curve/Query/CylindricalRange.js +13 -9
- package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +24 -18
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +1 -1
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.d.ts +14 -8
- package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js +17 -8
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js +4 -4
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.d.ts +2 -0
- package/lib/esm/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js +4 -0
- package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts +32 -10
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +54 -16
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +13 -2
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +24 -10
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +11 -8
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +28 -26
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +6 -6
- package/lib/esm/geometry3d/Point3dVector3d.js +6 -6
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +12 -6
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +94 -47
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts +7 -4
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +7 -4
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry4d/MomentData.d.ts +72 -73
- package/lib/esm/geometry4d/MomentData.d.ts.map +1 -1
- package/lib/esm/geometry4d/MomentData.js +62 -64
- package/lib/esm/geometry4d/MomentData.js.map +1 -1
- package/lib/esm/numerics/Polynomials.d.ts +5 -5
- package/lib/esm/numerics/Polynomials.js +6 -6
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/polyface/AuxData.d.ts +2 -2
- package/lib/esm/polyface/AuxData.d.ts.map +1 -1
- package/lib/esm/polyface/AuxData.js +11 -3
- package/lib/esm/polyface/AuxData.js.map +1 -1
- package/lib/esm/polyface/Polyface.d.ts +3 -5
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +6 -13
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +13 -6
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +65 -38
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +13 -3
- package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js +21 -4
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +2 -2
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +4 -3
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +5 -5
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +5 -5
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/solid/Box.d.ts +9 -3
- package/lib/esm/solid/Box.d.ts.map +1 -1
- package/lib/esm/solid/Box.js +10 -5
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.d.ts +3 -2
- package/lib/esm/solid/Cone.d.ts.map +1 -1
- package/lib/esm/solid/Cone.js +3 -3
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.d.ts +9 -3
- package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
- package/lib/esm/solid/LinearSweep.js +9 -4
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts +15 -4
- package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/esm/solid/RotationalSweep.js +20 -7
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.d.ts +35 -26
- package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
- package/lib/esm/solid/RuledSweep.js +41 -28
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SolidPrimitive.d.ts +12 -11
- package/lib/esm/solid/SolidPrimitive.d.ts.map +1 -1
- package/lib/esm/solid/SolidPrimitive.js +8 -5
- package/lib/esm/solid/SolidPrimitive.js.map +1 -1
- package/lib/esm/solid/Sphere.d.ts +17 -7
- package/lib/esm/solid/Sphere.d.ts.map +1 -1
- package/lib/esm/solid/Sphere.js +22 -16
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.d.ts +1 -1
- package/lib/esm/solid/SweepContour.js +1 -1
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/solid/TorusPipe.d.ts +8 -2
- package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
- package/lib/esm/solid/TorusPipe.js +9 -5
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/package.json +4 -4
package/lib/cjs/curve/Arc3d.js
CHANGED
|
@@ -10,6 +10,7 @@ const Geometry_1 = require("../Geometry");
|
|
|
10
10
|
const Angle_1 = require("../geometry3d/Angle");
|
|
11
11
|
const AngleSweep_1 = require("../geometry3d/AngleSweep");
|
|
12
12
|
const Matrix3d_1 = require("../geometry3d/Matrix3d");
|
|
13
|
+
const Plane3dByOriginAndUnitNormal_1 = require("../geometry3d/Plane3dByOriginAndUnitNormal");
|
|
13
14
|
const Plane3dByOriginAndVectors_1 = require("../geometry3d/Plane3dByOriginAndVectors");
|
|
14
15
|
const Point3dVector3d_1 = require("../geometry3d/Point3dVector3d");
|
|
15
16
|
const Range_1 = require("../geometry3d/Range");
|
|
@@ -155,10 +156,17 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
155
156
|
isSameGeometryClass(other) {
|
|
156
157
|
return other instanceof Arc3d;
|
|
157
158
|
}
|
|
158
|
-
/** Read
|
|
159
|
+
/** Read/write the center. Getter returns clone. */
|
|
159
160
|
get center() {
|
|
160
161
|
return this._center.clone();
|
|
161
162
|
}
|
|
163
|
+
set center(center) {
|
|
164
|
+
this._center.setFrom(center);
|
|
165
|
+
}
|
|
166
|
+
/** Read property for (reference to) center. */
|
|
167
|
+
get centerRef() {
|
|
168
|
+
return this._center;
|
|
169
|
+
}
|
|
162
170
|
/** Read property for (clone of) vector0. */
|
|
163
171
|
get vector0() {
|
|
164
172
|
return this._matrix.columnX();
|
|
@@ -179,7 +187,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
179
187
|
get matrixRef() {
|
|
180
188
|
return this._matrix;
|
|
181
189
|
}
|
|
182
|
-
/**
|
|
190
|
+
/** Read/write the sweep. Getter returns reference. */
|
|
183
191
|
get sweep() {
|
|
184
192
|
return this._sweep;
|
|
185
193
|
}
|
|
@@ -764,7 +772,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
764
772
|
const axy = this._matrix.columnXDotColumnY();
|
|
765
773
|
return Angle_1.Angle.isPerpendicularDotSet(axx, ayy, axy) && Geometry_1.Geometry.isSameCoordinateSquared(axx, ayy);
|
|
766
774
|
}
|
|
767
|
-
/** Return radius if the vector0 and vector90 are of equal length and perpendicular. */
|
|
775
|
+
/** Return radius if the vector0 and vector90 are of equal length and perpendicular. Ignores z. */
|
|
768
776
|
circularRadiusXY() {
|
|
769
777
|
const ux = this._matrix.at(0, 0);
|
|
770
778
|
const uy = this._matrix.at(1, 0);
|
|
@@ -906,7 +914,12 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
906
914
|
setVector0Vector90(vector0, vector90) {
|
|
907
915
|
this._matrix.setColumns(vector0, vector90, vector0.unitCrossProductWithDefault(vector90, 0, 0, 0));
|
|
908
916
|
}
|
|
909
|
-
/**
|
|
917
|
+
/**
|
|
918
|
+
* Return the symmetric definition of the arc, with rigid axes and radii.
|
|
919
|
+
* * The caller can send the returned data into [[createScaledXYColumns]] to construct the major-minor axis
|
|
920
|
+
* version of the instance arc. This formulation of the arc has the same shape, but has perpendicular axes,
|
|
921
|
+
* from which the arc's symmetry is readily apparent.
|
|
922
|
+
*/
|
|
910
923
|
toScaledMatrix3d() {
|
|
911
924
|
const angleData = Angle_1.Angle.dotProductsToHalfAngleTrigValues(this._matrix.columnXMagnitudeSquared(), this._matrix.columnYMagnitudeSquared(), this._matrix.columnXDotColumnY(), true);
|
|
912
925
|
const vector0A = this._matrix.multiplyXY(angleData.c, angleData.s);
|
|
@@ -1046,9 +1059,9 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
1046
1059
|
}
|
|
1047
1060
|
/**
|
|
1048
1061
|
* Return an arc whose basis vectors are rotated by given angle within the current basis space.
|
|
1049
|
-
* *
|
|
1050
|
-
*
|
|
1051
|
-
*
|
|
1062
|
+
* * The returned arc will have `vector0 = this.vector0 * cos(theta) + this.vector90 * sin(theta)`.
|
|
1063
|
+
* * The returned arc has the same shape as the instance.
|
|
1064
|
+
* * In other words, the arc's sweep is adjusted so that all fractional parameters evaluate to the same points.
|
|
1052
1065
|
* * Specifically, theta is subtracted from the original start and end angles.
|
|
1053
1066
|
* @param theta the angle (in the input arc space) which is to become the 0-degree point in the new arc.
|
|
1054
1067
|
*/
|
|
@@ -1061,6 +1074,39 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
1061
1074
|
const arcB = Arc3d.create(this._center.clone(), vector0, vector90, newSweep);
|
|
1062
1075
|
return arcB;
|
|
1063
1076
|
}
|
|
1077
|
+
/**
|
|
1078
|
+
* Return a cloned arc with basis rotated to align with the global axes. The arc's shape is unchanged.
|
|
1079
|
+
* * This method is most useful when the instance is an xy-circular arc, for then the aligned arc's stored sweep
|
|
1080
|
+
* angles can be understood as being measured from the global positive x-axis to the arc's start/end. This is *not*
|
|
1081
|
+
* the case for xy-elliptical arcs: the parameter angle difference between two points on an ellipse is in general
|
|
1082
|
+
* not the same as the angle measured between their radials.
|
|
1083
|
+
* * For an xy instance, the output arc will have:
|
|
1084
|
+
* * vector0 is in the same direction as the positive x-axis
|
|
1085
|
+
* * perpendicularVector is in the same direction as the positive z-axis
|
|
1086
|
+
* * For a general instance, the output arc will have:
|
|
1087
|
+
* * vector0 is in the same direction as the projection of the positive x-axis vector onto the arc plane
|
|
1088
|
+
* * perpendicularVector lies in the halfspace z >= 0
|
|
1089
|
+
* @returns cloned arc, or undefined (if the instance normal is parallel to the x-axis, or its matrix is singular)
|
|
1090
|
+
*/
|
|
1091
|
+
cloneAxisAligned() {
|
|
1092
|
+
const plane = Plane3dByOriginAndUnitNormal_1.Plane3dByOriginAndUnitNormal.create(this.center, this.perpendicularVector.crossProduct(Point3dVector3d_1.Vector3d.unitX()));
|
|
1093
|
+
if (!plane)
|
|
1094
|
+
return undefined;
|
|
1095
|
+
const axisPts = [];
|
|
1096
|
+
if (2 !== this.appendPlaneIntersectionPoints(plane, axisPts))
|
|
1097
|
+
return undefined;
|
|
1098
|
+
const iAxisPt = plane.getNormalRef().dotProduct(this.perpendicularVector.crossProductStartEnd(this.center, axisPts[0].point)) > 0.0 ? 0 : 1;
|
|
1099
|
+
const toUnitX = this.sweep.fractionToAngle(axisPts[iAxisPt].fraction);
|
|
1100
|
+
const arc1 = this.cloneInRotatedBasis(toUnitX); // rotate in arc's plane
|
|
1101
|
+
if (this.perpendicularVector.dotProduct(Point3dVector3d_1.Vector3d.unitZ()) < -Geometry_1.Geometry.smallAngleRadians) {
|
|
1102
|
+
if (this.matrixRef.isSingular())
|
|
1103
|
+
return undefined;
|
|
1104
|
+
const flip = Matrix3d_1.Matrix3d.createRowValues(1, 0, 0, 0, -1, 0, 0, 0, -1); // rotate 180 degrees around arc's local x-axis
|
|
1105
|
+
arc1.matrixRef.multiplyMatrixMatrix(flip, arc1.matrixRef);
|
|
1106
|
+
arc1.sweep.setStartEndDegrees(-arc1.sweep.startDegrees, -arc1.sweep.endDegrees); // rotation alone is insufficient to flip
|
|
1107
|
+
}
|
|
1108
|
+
return arc1;
|
|
1109
|
+
}
|
|
1064
1110
|
/**
|
|
1065
1111
|
* Find intervals of this CurvePrimitive that are interior to a clipper.
|
|
1066
1112
|
* @param clipper clip structure (e.g.clip planes).
|