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