@itwin/core-geometry 5.0.0-dev.2 → 5.0.0-dev.22
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
|
@@ -5,11 +5,14 @@
|
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.PolyfaceBuilder = void 0;
|
|
8
|
+
/** @packageDocumentation
|
|
9
|
+
* @module Polyface
|
|
10
|
+
*/
|
|
11
|
+
const Arc3d_1 = require("../curve/Arc3d");
|
|
8
12
|
const ConstructCurveBetweenCurves_1 = require("../curve/ConstructCurveBetweenCurves");
|
|
9
13
|
const CurveCollection_1 = require("../curve/CurveCollection");
|
|
10
14
|
const CurveFactory_1 = require("../curve/CurveFactory");
|
|
11
15
|
const CurvePrimitive_1 = require("../curve/CurvePrimitive");
|
|
12
|
-
const GeometryQuery_1 = require("../curve/GeometryQuery");
|
|
13
16
|
const LineString3d_1 = require("../curve/LineString3d");
|
|
14
17
|
const ParityRegion_1 = require("../curve/ParityRegion");
|
|
15
18
|
const CylindricalRange_1 = require("../curve/Query/CylindricalRange");
|
|
@@ -23,7 +26,6 @@ const GeometryHandler_1 = require("../geometry3d/GeometryHandler");
|
|
|
23
26
|
const GrowableFloat64Array_1 = require("../geometry3d/GrowableFloat64Array");
|
|
24
27
|
const GrowableXYArray_1 = require("../geometry3d/GrowableXYArray");
|
|
25
28
|
const GrowableXYZArray_1 = require("../geometry3d/GrowableXYZArray");
|
|
26
|
-
const IndexedXYZCollection_1 = require("../geometry3d/IndexedXYZCollection");
|
|
27
29
|
const Matrix3d_1 = require("../geometry3d/Matrix3d");
|
|
28
30
|
const Plane3dByOriginAndVectors_1 = require("../geometry3d/Plane3dByOriginAndVectors");
|
|
29
31
|
const Point2dVector2d_1 = require("../geometry3d/Point2dVector2d");
|
|
@@ -1080,17 +1082,28 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1080
1082
|
}
|
|
1081
1083
|
/** Construct facets for a rotational sweep. */
|
|
1082
1084
|
addRotationalSweep(surface) {
|
|
1083
|
-
const contour = surface.
|
|
1084
|
-
const section0 = StrokeCountChain_1.StrokeCountSection.createForParityRegionOrChain(contour, this._options);
|
|
1085
|
+
const contour = surface.getSweepContourRef();
|
|
1086
|
+
const section0 = StrokeCountChain_1.StrokeCountSection.createForParityRegionOrChain(contour.getCurves(), this._options);
|
|
1085
1087
|
const baseStrokes = section0.getStrokes();
|
|
1088
|
+
// ensure sweep is positive for buildRotationalNormalsInLineStrings
|
|
1086
1089
|
const axis = surface.cloneAxisRay();
|
|
1090
|
+
const sweepAngle = surface.getSweep();
|
|
1091
|
+
if (sweepAngle.radians < 0.0) {
|
|
1092
|
+
axis.direction.scaleInPlace(-1);
|
|
1093
|
+
sweepAngle.setRadians(-sweepAngle.radians);
|
|
1094
|
+
}
|
|
1095
|
+
// swingVector points in the direction of positive sweep
|
|
1087
1096
|
const perpendicularVector = CylindricalRange_1.CylindricalRangeQuery.computeMaxVectorFromRay(axis, baseStrokes);
|
|
1088
1097
|
const swingVector = axis.direction.crossProduct(perpendicularVector);
|
|
1098
|
+
// ensure contour computed normal is aligned with swingVector for buildRotationalNormalsInLineStrings
|
|
1099
|
+
const contourNormalAgreesWithSwingDir = contour.localToWorld.matrix.dotColumnZ(swingVector) > 0;
|
|
1100
|
+
if (!contourNormalAgreesWithSwingDir)
|
|
1101
|
+
baseStrokes.reverseInPlace();
|
|
1089
1102
|
if (this._options.needNormals)
|
|
1090
1103
|
CylindricalRange_1.CylindricalRangeQuery.buildRotationalNormalsInLineStrings(baseStrokes, axis, swingVector);
|
|
1091
1104
|
const maxDistance = perpendicularVector.magnitude();
|
|
1092
|
-
const maxPath = Math.abs(maxDistance *
|
|
1093
|
-
let numStep = StrokeOptions_1.StrokeOptions.applyAngleTol(this._options, 1,
|
|
1105
|
+
const maxPath = Math.abs(maxDistance * sweepAngle.radians);
|
|
1106
|
+
let numStep = StrokeOptions_1.StrokeOptions.applyAngleTol(this._options, 1, sweepAngle.radians, undefined);
|
|
1094
1107
|
numStep = StrokeOptions_1.StrokeOptions.applyMaxEdgeLength(this._options, numStep, maxPath);
|
|
1095
1108
|
for (let i = 1; i <= numStep; i++) {
|
|
1096
1109
|
const transformA = surface.getFractionalRotationTransform((i - 1) / numStep);
|
|
@@ -1098,11 +1111,10 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1098
1111
|
this.addBetweenRotatedStrokeSets(baseStrokes, transformA, i - 1, transformB, i);
|
|
1099
1112
|
}
|
|
1100
1113
|
if (surface.capped) {
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
capContour.emitFacets(this, false, surface.getFractionalRotationTransform(1.0));
|
|
1114
|
+
contour.purgeFacets();
|
|
1115
|
+
const reverseNearCap = contourNormalAgreesWithSwingDir;
|
|
1116
|
+
contour.emitFacets(this, reverseNearCap, undefined);
|
|
1117
|
+
contour.emitFacets(this, !reverseNearCap, surface.getFractionalRotationTransform(1.0));
|
|
1106
1118
|
}
|
|
1107
1119
|
}
|
|
1108
1120
|
/** Construct facets for any planar region. */
|
|
@@ -1166,9 +1178,9 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1166
1178
|
const normalIndices = ls.ensureEmptyNormalIndices();
|
|
1167
1179
|
const normalIndex0 = this.findOrAddNormalInLineString(ls, 0, transform);
|
|
1168
1180
|
normalIndices.push(normalIndex0);
|
|
1169
|
-
let normalIndexA = normalIndex0;
|
|
1170
|
-
let normalIndexB;
|
|
1171
1181
|
if (n > 1) {
|
|
1182
|
+
let normalIndexA = normalIndex0;
|
|
1183
|
+
let normalIndexB;
|
|
1172
1184
|
for (let i = 1; i + 1 < n; i++) {
|
|
1173
1185
|
normalIndexB = this.findOrAddNormalInLineString(ls, i, transform, normalIndexA);
|
|
1174
1186
|
normalIndices.push(normalIndexB);
|
|
@@ -1183,9 +1195,9 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1183
1195
|
const uvIndices = ls.ensureEmptyUVIndices();
|
|
1184
1196
|
const uvIndex0 = this.findOrAddParamInLineString(ls, 0, vParam);
|
|
1185
1197
|
uvIndices.push(uvIndex0);
|
|
1186
|
-
let uvIndexA = uvIndex0;
|
|
1187
|
-
let uvIndexB;
|
|
1188
1198
|
if (n > 1) {
|
|
1199
|
+
let uvIndexA = uvIndex0;
|
|
1200
|
+
let uvIndexB;
|
|
1189
1201
|
for (let i = 1; i + 1 < n; i++) {
|
|
1190
1202
|
uvIndexB = this.findOrAddParamInLineString(ls, i, vParam, uvIndexA);
|
|
1191
1203
|
uvIndices.push(uvIndexB);
|
|
@@ -1820,16 +1832,25 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1820
1832
|
const context = GreedyTriangulationBetweenLineStrings_1.GreedyTriangulationBetweenLineStrings.createContext();
|
|
1821
1833
|
context.emitTriangles(resolveToIndexedXYZCollectionOrCarrier(pointsA), resolveToIndexedXYZCollectionOrCarrier(pointsB), (triangle) => { this.addTriangleFacet(triangle.points); });
|
|
1822
1834
|
}
|
|
1823
|
-
|
|
1835
|
+
/** Doc is same as `addMiteredPipes` doc. */
|
|
1836
|
+
addMiteredPipesFromPoints(centerline, sectionData, numFacetAround = 12, capped = false) {
|
|
1824
1837
|
const sections = CurveFactory_1.CurveFactory.createMiteredPipeSections(centerline, sectionData);
|
|
1825
1838
|
const pointA0 = Point3dVector3d_1.Point3d.create();
|
|
1826
1839
|
const pointA1 = Point3dVector3d_1.Point3d.create();
|
|
1827
1840
|
const pointB0 = Point3dVector3d_1.Point3d.create();
|
|
1828
1841
|
const pointB1 = Point3dVector3d_1.Point3d.create();
|
|
1842
|
+
const wantCaps = capped && (!(sectionData instanceof Arc3d_1.Arc3d) || sectionData.sweep.isFullCircle);
|
|
1829
1843
|
if (numFacetAround < 3)
|
|
1830
1844
|
numFacetAround = 3;
|
|
1831
1845
|
const df = 1.0 / numFacetAround;
|
|
1832
|
-
|
|
1846
|
+
if (wantCaps) { // start cap facets
|
|
1847
|
+
const startLineString = LineString3d_1.LineString3d.create();
|
|
1848
|
+
for (let i = 0; i < numFacetAround; i++)
|
|
1849
|
+
startLineString.addPoint(sections[0].fractionToPoint(i * df));
|
|
1850
|
+
this.addTrianglesInUncheckedConvexPolygon(startLineString, true);
|
|
1851
|
+
this.endFace();
|
|
1852
|
+
}
|
|
1853
|
+
for (let i = 1; i < sections.length; i++) { // side facets
|
|
1833
1854
|
const arcA = sections[i - 1];
|
|
1834
1855
|
const arcB = sections[i];
|
|
1835
1856
|
arcA.fractionToPoint(0.0, pointA0);
|
|
@@ -1838,38 +1859,44 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1838
1859
|
const f = k * df;
|
|
1839
1860
|
arcA.fractionToPoint(f, pointA1);
|
|
1840
1861
|
arcB.fractionToPoint(f, pointB1);
|
|
1841
|
-
this.addQuadFacet([pointA0,
|
|
1862
|
+
this.addQuadFacet([pointA0, pointA1, pointB1, pointB0]); // ASSUME: CCW section traversal wrt rail tangent
|
|
1842
1863
|
}
|
|
1843
1864
|
}
|
|
1865
|
+
if (wantCaps) { // end cap facets
|
|
1866
|
+
const endLineString = LineString3d_1.LineString3d.create();
|
|
1867
|
+
for (let i = 0; i < numFacetAround; i++)
|
|
1868
|
+
endLineString.addPoint(sections[sections.length - 1].fractionToPoint(i * df));
|
|
1869
|
+
this.addTrianglesInUncheckedConvexPolygon(endLineString, false);
|
|
1870
|
+
this.endFace();
|
|
1871
|
+
}
|
|
1844
1872
|
}
|
|
1845
1873
|
/**
|
|
1846
1874
|
* Add quad facets along a mitered pipe that follows a centerline curve.
|
|
1875
|
+
* * At the end of each pipe segment, the pipe is mitered by the plane that bisects the angle between successive
|
|
1876
|
+
* centerline segments.
|
|
1847
1877
|
* * Circular or elliptical pipe cross sections can be specified by supplying either a radius, a pair of semi-axis
|
|
1848
|
-
* lengths, or
|
|
1849
|
-
* * For semi-axis length input, x
|
|
1850
|
-
*
|
|
1851
|
-
*
|
|
1852
|
-
*
|
|
1878
|
+
* lengths, or an Arc3d:
|
|
1879
|
+
* * For semi-axis length input, x and y correspond to ellipse local axes perpendicular to each other and to the
|
|
1880
|
+
* start tangent.
|
|
1881
|
+
* * For Arc3d input, the center is translated to the centerline start point, but otherwise the arc is used as-is
|
|
1882
|
+
* for the first section. For best results, the arc should be perpendicular to the centerline start tangent.
|
|
1883
|
+
* @param centerline centerline of pipe. If curved, it will be stroked using the builder's StrokeOptions, otherwise
|
|
1884
|
+
* for best results, ensure no successive duplicate points with e.g., [[GrowableXYZArray.createCompressed]].
|
|
1885
|
+
* @param sectionData circle radius, ellipse semi-axis lengths, or Arc3d.
|
|
1853
1886
|
* @param numFacetAround how many equal parameter-space chords around each section.
|
|
1887
|
+
* @param capped if `true`, add a cap at each end of the pipe; defaults to `false`.
|
|
1854
1888
|
*/
|
|
1855
|
-
addMiteredPipes(centerline, sectionData, numFacetAround = 12) {
|
|
1856
|
-
if (Array.isArray(centerline))
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
}
|
|
1862
|
-
else if (centerline instanceof IndexedXYZCollection_1.IndexedXYZCollection) {
|
|
1863
|
-
this.addMiteredPipesFromPoints(centerline, sectionData, numFacetAround);
|
|
1864
|
-
}
|
|
1865
|
-
else if (centerline instanceof LineString3d_1.LineString3d) {
|
|
1866
|
-
this.addMiteredPipesFromPoints(centerline.packedPoints, sectionData, numFacetAround);
|
|
1867
|
-
}
|
|
1868
|
-
else if (centerline instanceof GeometryQuery_1.GeometryQuery) {
|
|
1889
|
+
addMiteredPipes(centerline, sectionData, numFacetAround = 12, capped = false) {
|
|
1890
|
+
if (Array.isArray(centerline))
|
|
1891
|
+
centerline = new Point3dArrayCarrier_1.Point3dArrayCarrier(centerline);
|
|
1892
|
+
else if (centerline instanceof LineString3d_1.LineString3d)
|
|
1893
|
+
centerline = centerline.packedPoints;
|
|
1894
|
+
else if (centerline instanceof CurvePrimitive_1.CurvePrimitive) {
|
|
1869
1895
|
const linestring = LineString3d_1.LineString3d.create();
|
|
1870
1896
|
centerline.emitStrokes(linestring, this._options);
|
|
1871
|
-
|
|
1897
|
+
centerline = linestring.packedPoints;
|
|
1872
1898
|
}
|
|
1899
|
+
this.addMiteredPipesFromPoints(centerline, sectionData, numFacetAround, capped);
|
|
1873
1900
|
}
|
|
1874
1901
|
/** Return the polyface index array indices corresponding to the given edge, or `undefined` if error. */
|
|
1875
1902
|
getEdgeIndices(edge) {
|