@itwin/core-geometry 5.11.0-dev.1 → 5.11.0-dev.11
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 +28 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +1 -1
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.d.ts +2 -2
- package/lib/cjs/clipping/BooleanClipNode.js +2 -2
- package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +8 -2
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +8 -2
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.d.ts +26 -24
- package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +44 -35
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +1 -1
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.d.ts +4 -3
- package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipVector.js +4 -3
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +2 -2
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +2 -2
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +7 -8
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +10 -10
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +1 -1
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +1 -1
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +9 -9
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.d.ts +13 -13
- package/lib/cjs/geometry4d/Matrix4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js +13 -13
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.d.ts +5 -2
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.d.ts.map +1 -1
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js +5 -2
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts +21 -5
- package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js +27 -4
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.d.ts +7 -1
- package/lib/cjs/solid/SolidPrimitive.d.ts.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.js +8 -1
- package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts +1 -1
- package/lib/esm/bspline/BSplineCurve.js +1 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.d.ts +2 -2
- package/lib/esm/clipping/BooleanClipNode.js +2 -2
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +8 -2
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +8 -2
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts +26 -24
- package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +44 -35
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +1 -1
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.d.ts +4 -3
- package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
- package/lib/esm/clipping/ClipVector.js +4 -3
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +2 -2
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +2 -2
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +7 -8
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +10 -10
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +1 -1
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +1 -1
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +9 -9
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.d.ts +13 -13
- package/lib/esm/geometry4d/Matrix4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js +13 -13
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.d.ts +5 -2
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.d.ts.map +1 -1
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js +5 -2
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts +21 -5
- package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/esm/solid/RotationalSweep.js +26 -4
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/SolidPrimitive.d.ts +7 -1
- package/lib/esm/solid/SolidPrimitive.d.ts.map +1 -1
- package/lib/esm/solid/SolidPrimitive.js +6 -0
- package/lib/esm/solid/SolidPrimitive.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BentleyGeometryFlatBuffer.js","sourceRoot":"","sources":["../../../src/serialization/BentleyGeometryFlatBuffer.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;GAGG;AACH,MAAM,OAAO,yBAAyB;IACpC,gBAAwB,CAAC;IACzB
|
|
1
|
+
{"version":3,"file":"BentleyGeometryFlatBuffer.js","sourceRoot":"","sources":["../../../src/serialization/BentleyGeometryFlatBuffer.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;GAGG;AACH,MAAM,OAAO,yBAAyB;IACpC,gBAAwB,CAAC;IACzB;;;;;OAKG;IACI,MAAM,CAAC,eAAe,CAAC,IAAqC,EAAE,sBAA+B,KAAK;QACvG,OAAO,UAAU,CAAC,eAAe,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC5F,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,eAAe,CAAC,YAAwB,EAAE,sBAA+B,KAAK;QAC1F,OAAO,UAAU,CAAC,eAAe,CAAC,YAAY,EAAE,mBAAmB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACpG,CAAC;CACF;AAED,iEAAiE;AACjE,MAAM,cAAc,GAAG,IAAI,UAAU,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Serialization\r\n */\r\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\r\nimport { BGFBReader } from \"./BGFBReader\";\r\nimport { BGFBWriter } from \"./BGFBWriter\";\r\n\r\n/**\r\n * Top level entries to convert between GeometryQuery types and FlatBuffer Bytes.\r\n * @public\r\n */\r\nexport class BentleyGeometryFlatBuffer {\r\n private constructor() { }\r\n /**\r\n * Serialize bytes to a flatbuffer.\r\n * @param data geometry to serialize\r\n * @param addVersionSignature whether to prepend a version signature to the output bytes. Pass `true` for iModel FB geometry streams.\r\n * @public\r\n */\r\n public static geometryToBytes(data: GeometryQuery | GeometryQuery[], addVersionSignature: boolean = false): Uint8Array | undefined {\r\n return BGFBWriter.geometryToBytes(data, addVersionSignature ? signatureBytes : undefined);\r\n }\r\n\r\n /**\r\n * Deserialize bytes from a flatbuffer.\r\n * @param justTheBytes FlatBuffer bytes as created by BGFBWriter.createFlatBuffer\r\n * @param hasVersionSignature Whether the input bytes include a version prefix. Pass `true` for iModel FB geometry streams.\r\n * @public\r\n */\r\n public static bytesToGeometry(justTheBytes: Uint8Array, hasVersionSignature: boolean = false): GeometryQuery | GeometryQuery[] | undefined {\r\n return BGFBReader.bytesToGeometry(justTheBytes, hasVersionSignature ? signatureBytes : undefined);\r\n }\r\n}\r\n\r\n/** \"bg0001fb\" header, persisted in iModel FB geometry streams */\r\nconst signatureBytes = new Uint8Array([98, 103, 48, 48, 48, 49, 102, 98]);\r\n"]}
|
|
@@ -1,16 +1,32 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Solid
|
|
3
3
|
*/
|
|
4
|
-
import { AnyCurve } from "../curve/CurveTypes";
|
|
5
4
|
import { CurveCollection } from "../curve/CurveCollection";
|
|
5
|
+
import { AnyCurve } from "../curve/CurveTypes";
|
|
6
6
|
import { GeometryQuery } from "../curve/GeometryQuery";
|
|
7
7
|
import { Angle } from "../geometry3d/Angle";
|
|
8
8
|
import { GeometryHandler } from "../geometry3d/GeometryHandler";
|
|
9
9
|
import { Range3d } from "../geometry3d/Range";
|
|
10
10
|
import { Ray3d } from "../geometry3d/Ray3d";
|
|
11
11
|
import { Transform } from "../geometry3d/Transform";
|
|
12
|
-
import { SolidPrimitive } from "./SolidPrimitive";
|
|
12
|
+
import { SolidPrimitive, SolidPrimitiveConstructiveFrameOptions } from "./SolidPrimitive";
|
|
13
13
|
import { SweepContour } from "./SweepContour";
|
|
14
|
+
/**
|
|
15
|
+
* Options for [[RotationalSweep.getConstructiveFrame]].
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export declare class RotationalSweepConstructiveFrameOptions extends SolidPrimitiveConstructiveFrameOptions {
|
|
19
|
+
/**
|
|
20
|
+
* Though the y-axis of the frame returned by [[RotationalSweep.getConstructiveFrame]] is perpendicular to the
|
|
21
|
+
* contour plane, it can point in one of two directions. This option allows the caller to control this direction.
|
|
22
|
+
* * If `false` (default), the y-axis of the frame is the normal reported by the contour. This direction is
|
|
23
|
+
* independent of the solid's sweep direction.
|
|
24
|
+
* * If `true`, the y-axis of the frame is aligned to the solid's sweep direction: specifically, it points in the
|
|
25
|
+
* direction of positive sweep. With this choice, columns 0, 1 of the returned frame can be used to construct the
|
|
26
|
+
* `vector0` and `vector90` vectors needed to construct a centerline arc for the solid.
|
|
27
|
+
*/
|
|
28
|
+
alignToSweep?: boolean;
|
|
29
|
+
}
|
|
14
30
|
/**
|
|
15
31
|
* A RotationalSweep is:
|
|
16
32
|
* * A planar contour (any Loop, Path, or parityRegion)
|
|
@@ -28,8 +44,8 @@ export declare class RotationalSweep extends SolidPrimitive {
|
|
|
28
44
|
private _sweepAngle;
|
|
29
45
|
private constructor();
|
|
30
46
|
/**
|
|
31
|
-
* Create a rotational sweep.
|
|
32
|
-
* @param contour profile to sweep, coplanar with axis
|
|
47
|
+
* Create a rotational sweep. All input objects are CAPTURED.
|
|
48
|
+
* @param contour profile to sweep, coplanar with axis.
|
|
33
49
|
* @param axis rotation axis.
|
|
34
50
|
* @param sweepAngle signed angular sweep.
|
|
35
51
|
* @param capped whether to cap the surface to make a solid.
|
|
@@ -41,7 +57,7 @@ export declare class RotationalSweep extends SolidPrimitive {
|
|
|
41
57
|
* * z direction along the rotation ray.
|
|
42
58
|
* * y direction perpendicular to the base contour plane.
|
|
43
59
|
*/
|
|
44
|
-
getConstructiveFrame(): Transform | undefined;
|
|
60
|
+
getConstructiveFrame(options?: RotationalSweepConstructiveFrameOptions): Transform | undefined;
|
|
45
61
|
/** Return clone of (not reference to) the axis vector. */
|
|
46
62
|
cloneAxisRay(): Ray3d;
|
|
47
63
|
/** Return (REFERENCE TO) the swept curves. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RotationalSweep.d.ts","sourceRoot":"","sources":["../../../src/solid/RotationalSweep.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"RotationalSweep.d.ts","sourceRoot":"","sources":["../../../src/solid/RotationalSweep.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,0B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tC,mBAAmB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO;IAG/C,uDAAuD;IACvC,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;IAS5D,0BAA0B;IACnB,KAAK,IAAI,eAAe;IAG/B;;;OAGG;IACI,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO;IAWzD;;;OAGG;IACI,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,eAAe,GAAG,SAAS;IAI1E,gFAAgF;IACzE,yBAAyB,CAAC,OAAO,EAAE,eAAe,GAAG,GAAG;IAG/D,mGAAmG;IAC5F,8BAA8B,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS;IAOvF;;;OAGG;IACI,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAKvE,wDAAwD;IACjD,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS;IAoBxD,kEAAkE;IAClE,IAAoB,MAAM,IAAI,OAAO,CAEpC;IACD,kDAAkD;IAClD,IAAW,cAAc,IAAI,OAAO,CAEnC;CACF"}
|
|
@@ -7,8 +7,24 @@ import { AxisOrder, Geometry } from "../Geometry";
|
|
|
7
7
|
import { Angle } from "../geometry3d/Angle";
|
|
8
8
|
import { Matrix3d } from "../geometry3d/Matrix3d";
|
|
9
9
|
import { Transform } from "../geometry3d/Transform";
|
|
10
|
-
import { SolidPrimitive } from "./SolidPrimitive";
|
|
10
|
+
import { SolidPrimitive, SolidPrimitiveConstructiveFrameOptions } from "./SolidPrimitive";
|
|
11
11
|
import { SweepContour } from "./SweepContour";
|
|
12
|
+
/**
|
|
13
|
+
* Options for [[RotationalSweep.getConstructiveFrame]].
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export class RotationalSweepConstructiveFrameOptions extends SolidPrimitiveConstructiveFrameOptions {
|
|
17
|
+
/**
|
|
18
|
+
* Though the y-axis of the frame returned by [[RotationalSweep.getConstructiveFrame]] is perpendicular to the
|
|
19
|
+
* contour plane, it can point in one of two directions. This option allows the caller to control this direction.
|
|
20
|
+
* * If `false` (default), the y-axis of the frame is the normal reported by the contour. This direction is
|
|
21
|
+
* independent of the solid's sweep direction.
|
|
22
|
+
* * If `true`, the y-axis of the frame is aligned to the solid's sweep direction: specifically, it points in the
|
|
23
|
+
* direction of positive sweep. With this choice, columns 0, 1 of the returned frame can be used to construct the
|
|
24
|
+
* `vector0` and `vector90` vectors needed to construct a centerline arc for the solid.
|
|
25
|
+
*/
|
|
26
|
+
alignToSweep;
|
|
27
|
+
}
|
|
12
28
|
/**
|
|
13
29
|
* A RotationalSweep is:
|
|
14
30
|
* * A planar contour (any Loop, Path, or parityRegion)
|
|
@@ -31,8 +47,8 @@ export class RotationalSweep extends SolidPrimitive {
|
|
|
31
47
|
this._sweepAngle = sweepAngle;
|
|
32
48
|
}
|
|
33
49
|
/**
|
|
34
|
-
* Create a rotational sweep.
|
|
35
|
-
* @param contour profile to sweep, coplanar with axis
|
|
50
|
+
* Create a rotational sweep. All input objects are CAPTURED.
|
|
51
|
+
* @param contour profile to sweep, coplanar with axis.
|
|
36
52
|
* @param axis rotation axis.
|
|
37
53
|
* @param sweepAngle signed angular sweep.
|
|
38
54
|
* @param capped whether to cap the surface to make a solid.
|
|
@@ -51,8 +67,14 @@ export class RotationalSweep extends SolidPrimitive {
|
|
|
51
67
|
* * z direction along the rotation ray.
|
|
52
68
|
* * y direction perpendicular to the base contour plane.
|
|
53
69
|
*/
|
|
54
|
-
getConstructiveFrame() {
|
|
70
|
+
getConstructiveFrame(options) {
|
|
55
71
|
const contourPerpendicular = this._contour.localToWorld.matrix.columnZ();
|
|
72
|
+
if (options?.alignToSweep) {
|
|
73
|
+
const center = this._contour.curves.range().diagonalFractionToPoint(0.5); // ASSUME: contour range center is off the axis
|
|
74
|
+
const toCenter = this._normalizedAxis.perpendicularPartOfVectorToTarget(center);
|
|
75
|
+
if (this._normalizedAxis.direction.tripleProduct(toCenter, contourPerpendicular) < 0)
|
|
76
|
+
contourPerpendicular.negate(contourPerpendicular);
|
|
77
|
+
}
|
|
56
78
|
const axes = Matrix3d.createRigidFromColumns(contourPerpendicular, this._normalizedAxis.direction, AxisOrder.YZX);
|
|
57
79
|
if (axes) {
|
|
58
80
|
return Transform.createOriginAndMatrix(this._normalizedAxis.origin, axes);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RotationalSweep.js","sourceRoot":"","sources":["../../../src/solid/RotationalSweep.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAS/F,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,OAAO,eAAgB,SAAQ,cAAc;IACjD,wCAAwC;IACxB,kBAAkB,GAAG,iBAAiB,CAAC;IAE/C,QAAQ,CAAe;IACvB,eAAe,CAAQ;IACvB,WAAW,CAAQ;IAC3B,YAAoB,OAAqB,EAAE,cAAqB,EAAE,UAAiB,EAAE,MAAe;QAClG,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;QACtC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IACD;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,OAAiB,EAAE,IAAW,EAAE,UAAiB,EAAE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AS,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAChF,MAAM,aAAa,GAAG,SAAS,CAAC,cAAc,EAAE,CAAC;QACjD,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,kBAAkB,GAAG,SAAS,CAAC,cAAc,EAAE,CAAC;YACtD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC;gBAClC,SAAS,CAAC,0BAA0B,CAClC,IAAI,CAAC,8BAA8B,CAAC,CAAC,GAAG,OAAO,EAAE,aAAa,CAAC,EAAE,kBAAkB,CACpF,CAAC;gBACF,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;YACjD,CAAC;QACH,CAAC;aAAM,CAAC;YACN,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,OAAO,EAAE,CAAC,EAAE;gBAC/B,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,8BAA8B,CAAC,CAAC,GAAG,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;QAChG,CAAC;IACH,CAAC;IACD,kEAAkE;IAClE,IAAoB,MAAM;QACxB,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,mBAAmB,EAAE,EAAE,IAAI,CAAC,CAAC;IAC1H,CAAC;IACD,kDAAkD;IAClD,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC;IACtD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Solid\r\n */\r\n\r\nimport { AnyCurve } from \"../curve/CurveTypes\";\r\nimport { CurveCollection } from \"../curve/CurveCollection\";\r\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\r\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\r\nimport { AxisOrder, Geometry } from \"../Geometry\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\r\nimport { Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { SolidPrimitive } from \"./SolidPrimitive\";\r\nimport { SweepContour } from \"./SweepContour\";\r\n\r\n/**\r\n * A RotationalSweep is:\r\n * * A planar contour (any Loop, Path, or parityRegion)\r\n * * An axis vector.\r\n * * The planar contour is expected to be in the plane of the axis vector.\r\n * * The contour may have points and/or lines that are on the axis, but otherwise is entirely on one side of the axis.\r\n * * A sweep angle.\r\n * @public\r\n */\r\nexport class RotationalSweep extends SolidPrimitive {\r\n /** String name for schema properties */\r\n public readonly solidPrimitiveType = \"rotationalSweep\";\r\n\r\n private _contour: SweepContour;\r\n private _normalizedAxis: Ray3d;\r\n private _sweepAngle: Angle;\r\n private constructor(contour: SweepContour, normalizedAxis: Ray3d, sweepAngle: Angle, capped: boolean) {\r\n super(capped);\r\n this._contour = contour;\r\n this._normalizedAxis = normalizedAxis;\r\n this._sweepAngle = sweepAngle;\r\n }\r\n /**\r\n * Create a rotational sweep.\r\n * @param contour profile to sweep, coplanar with axis (CAPTURED).\r\n * @param axis rotation axis.\r\n * @param sweepAngle signed angular sweep.\r\n * @param capped whether to cap the surface to make a solid.\r\n */\r\n public static create(contour: AnyCurve, axis: Ray3d, sweepAngle: Angle, capped: boolean): RotationalSweep | undefined {\r\n if (!axis.direction.normalizeInPlace())\r\n return undefined;\r\n const sweepable = SweepContour.createForRotation(contour, axis);\r\n if (!sweepable)\r\n return undefined;\r\n return new RotationalSweep(sweepable, axis, sweepAngle.clone(), capped);\r\n }\r\n /**\r\n * Return a coordinate frame (right handed unit vectors).\r\n * * origin at origin of rotation ray.\r\n * * z direction along the rotation ray.\r\n * * y direction perpendicular to the base contour plane.\r\n */\r\n public getConstructiveFrame(): Transform | undefined {\r\n const contourPerpendicular = this._contour.localToWorld.matrix.columnZ();\r\n const axes = Matrix3d.createRigidFromColumns(contourPerpendicular, this._normalizedAxis.direction, AxisOrder.YZX);\r\n if (axes) {\r\n return Transform.createOriginAndMatrix(this._normalizedAxis.origin, axes);\r\n }\r\n return undefined;\r\n }\r\n /** Return clone of (not reference to) the axis vector. */\r\n public cloneAxisRay(): Ray3d {\r\n return this._normalizedAxis.clone();\r\n }\r\n /** Return (REFERENCE TO) the swept curves. */\r\n public getCurves(): CurveCollection {\r\n return this._contour.curves;\r\n }\r\n /** Return (REFERENCE TO) the swept curves with containing plane markup. */\r\n public getSweepContourRef(): SweepContour {\r\n return this._contour;\r\n }\r\n /** Return the sweep angle. */\r\n public getSweep(): Angle {\r\n return this._sweepAngle.clone();\r\n }\r\n /** Test if `other` is a `RotationalSweep` */\r\n public isSameGeometryClass(other: any): boolean {\r\n return other instanceof RotationalSweep;\r\n }\r\n /** Test for same axis, capping, and swept geometry. */\r\n public override isAlmostEqual(other: GeometryQuery): boolean {\r\n if (other instanceof RotationalSweep) {\r\n return this._contour.isAlmostEqual(other._contour)\r\n && this._normalizedAxis.isAlmostEqual(other._normalizedAxis)\r\n && this._sweepAngle.isAlmostEqual(other._sweepAngle)\r\n && this.capped === other.capped;\r\n }\r\n return false;\r\n }\r\n /** Return a deep clone */\r\n public clone(): RotationalSweep {\r\n return new RotationalSweep(this._contour.clone(), this._normalizedAxis.clone(), this._sweepAngle.clone(), this.capped);\r\n }\r\n /**\r\n * Transform the contour and axis.\r\n * * This fails if the transformation is singular.\r\n */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n if (transform.matrix.isSingular())\r\n return false;\r\n if (this._contour.tryTransformInPlace(transform)) {\r\n this._normalizedAxis.transformInPlace(transform);\r\n if (transform.matrix.determinant() < 0.0)\r\n this._sweepAngle.setRadians(-this._sweepAngle.radians);\r\n return this._normalizedAxis.direction.normalizeInPlace();\r\n }\r\n return false;\r\n }\r\n /**\r\n * Return a transformed clone.\r\n * * This fails if the transformation is singular.\r\n */\r\n public cloneTransformed(transform: Transform): RotationalSweep | undefined {\r\n const result = this.clone();\r\n return result.tryTransformInPlace(transform) ? result : undefined;\r\n }\r\n /** Dispatch to strongly typed handler `handler.handleRotationalSweep(this)`. */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleRotationalSweep(this);\r\n }\r\n /** Return a transform that rotates around the rotational axis by a fraction of the total sweep. */\r\n public getFractionalRotationTransform(vFraction: number, result?: Transform): Transform {\r\n const radians = this._sweepAngle.radians * vFraction;\r\n const rotation = Transform.createFixedPointAndMatrix(this._normalizedAxis.origin,\r\n Matrix3d.createRotationAroundVector(this._normalizedAxis.direction, Angle.createRadians(radians),\r\n result ? result.matrix : undefined) as Matrix3d);\r\n return rotation;\r\n }\r\n /**\r\n * Return the curves of a constant-v section of the solid.\r\n * @param vFraction fractional position along the sweep direction\r\n */\r\n public constantVSection(vFraction: number): CurveCollection | undefined {\r\n const section = this._contour.curves.clone();\r\n section.tryTransformInPlace(this.getFractionalRotationTransform(vFraction));\r\n return section;\r\n }\r\n /** Extend range using sampled points on the surface. */\r\n public extendRange(range: Range3d, transform?: Transform) {\r\n const degreeStep = 360 / 32;\r\n const options = StrokeOptions.createForCurves();\r\n options.angleTol = Angle.createDegrees(degreeStep);\r\n const strokes = this._contour.curves.cloneStroked(options);\r\n const numStep = Geometry.stepCount(degreeStep, this._sweepAngle.degrees, 4, 32);\r\n const stepTransform = Transform.createIdentity();\r\n if (transform) {\r\n const compositeTransform = Transform.createIdentity();\r\n for (let i = 0; i <= numStep; i++) {\r\n transform.multiplyTransformTransform(\r\n this.getFractionalRotationTransform(i / numStep, stepTransform), compositeTransform,\r\n );\r\n strokes.extendRange(range, compositeTransform);\r\n }\r\n } else {\r\n for (let i = 0; i <= numStep; i++)\r\n strokes.extendRange(range, this.getFractionalRotationTransform(i / numStep, stepTransform));\r\n }\r\n }\r\n /** Return true if the sweep axis and contour are not coplanar. */\r\n public override get isSkew(): boolean {\r\n return !this._normalizedAxis.direction.isPerpendicularTo(this._contour.localToWorld.matrix.columnXCrossColumnY(), true);\r\n }\r\n /** Specify if the sweep forms a closed volume. */\r\n public get isClosedVolume(): boolean {\r\n return this.capped || this._sweepAngle.isFullCircle;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"RotationalSweep.js","sourceRoot":"","sources":["../../../src/solid/RotationalSweep.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAS/F,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,sCAAsC,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;GAGG;AACH,MAAM,OAAO,uCAAwC,SAAQ,sCAAsC;IACjG;;;;;;;;OAQG;IACI,YAAY,CAAW;CAC/B;AAED;;;;;;;;GAQG;AACH,MAAM,OAAO,eAAgB,SAAQ,cAAc;IACjD,wCAAwC;IACxB,kBAAkB,GAAG,iBAAiB,CAAC;IAE/C,QAAQ,CAAe;IACvB,eAAe,CAAQ;IACvB,WAAW,CAAQ;IAC3B,YAAoB,OAAqB,EAAE,cAAqB,EAAE,UAAiB,EAAE,MAAe;QA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K,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,OAAO,EAAE,CAAC,EAAE;gBAC/B,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,8BAA8B,CAAC,CAAC,GAAG,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;QAChG,CAAC;IACH,CAAC;IACD,kEAAkE;IAClE,IAAoB,MAAM;QACxB,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,mBAAmB,EAAE,EAAE,IAAI,CAAC,CAAC;IAC1H,CAAC;IACD,kDAAkD;IAClD,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC;IACtD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Solid\r\n */\r\n\r\nimport { CurveCollection } from \"../curve/CurveCollection\";\r\nimport { AnyCurve } from \"../curve/CurveTypes\";\r\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\r\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\r\nimport { AxisOrder, Geometry } from \"../Geometry\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\r\nimport { Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { SolidPrimitive, SolidPrimitiveConstructiveFrameOptions } from \"./SolidPrimitive\";\r\nimport { SweepContour } from \"./SweepContour\";\r\n\r\n/**\r\n * Options for [[RotationalSweep.getConstructiveFrame]].\r\n * @public\r\n */\r\nexport class RotationalSweepConstructiveFrameOptions extends SolidPrimitiveConstructiveFrameOptions {\r\n /**\r\n * Though the y-axis of the frame returned by [[RotationalSweep.getConstructiveFrame]] is perpendicular to the\r\n * contour plane, it can point in one of two directions. This option allows the caller to control this direction.\r\n * * If `false` (default), the y-axis of the frame is the normal reported by the contour. This direction is\r\n * independent of the solid's sweep direction.\r\n * * If `true`, the y-axis of the frame is aligned to the solid's sweep direction: specifically, it points in the\r\n * direction of positive sweep. With this choice, columns 0, 1 of the returned frame can be used to construct the\r\n * `vector0` and `vector90` vectors needed to construct a centerline arc for the solid.\r\n */\r\n public alignToSweep?: boolean;\r\n}\r\n\r\n/**\r\n * A RotationalSweep is:\r\n * * A planar contour (any Loop, Path, or parityRegion)\r\n * * An axis vector.\r\n * * The planar contour is expected to be in the plane of the axis vector.\r\n * * The contour may have points and/or lines that are on the axis, but otherwise is entirely on one side of the axis.\r\n * * A sweep angle.\r\n * @public\r\n */\r\nexport class RotationalSweep extends SolidPrimitive {\r\n /** String name for schema properties */\r\n public readonly solidPrimitiveType = \"rotationalSweep\";\r\n\r\n private _contour: SweepContour;\r\n private _normalizedAxis: Ray3d;\r\n private _sweepAngle: Angle;\r\n private constructor(contour: SweepContour, normalizedAxis: Ray3d, sweepAngle: Angle, capped: boolean) {\r\n super(capped);\r\n this._contour = contour;\r\n this._normalizedAxis = normalizedAxis;\r\n this._sweepAngle = sweepAngle;\r\n }\r\n /**\r\n * Create a rotational sweep. All input objects are CAPTURED.\r\n * @param contour profile to sweep, coplanar with axis.\r\n * @param axis rotation axis.\r\n * @param sweepAngle signed angular sweep.\r\n * @param capped whether to cap the surface to make a solid.\r\n */\r\n public static create(contour: AnyCurve, axis: Ray3d, sweepAngle: Angle, capped: boolean): RotationalSweep | undefined {\r\n if (!axis.direction.normalizeInPlace())\r\n return undefined;\r\n const sweepable = SweepContour.createForRotation(contour, axis);\r\n if (!sweepable)\r\n return undefined;\r\n return new RotationalSweep(sweepable, axis, sweepAngle.clone(), capped);\r\n }\r\n /**\r\n * Return a coordinate frame (right handed unit vectors).\r\n * * origin at origin of rotation ray.\r\n * * z direction along the rotation ray.\r\n * * y direction perpendicular to the base contour plane.\r\n */\r\n public getConstructiveFrame(options?: RotationalSweepConstructiveFrameOptions): Transform | undefined {\r\n const contourPerpendicular = this._contour.localToWorld.matrix.columnZ();\r\n if (options?.alignToSweep) {\r\n const center = this._contour.curves.range().diagonalFractionToPoint(0.5); // ASSUME: contour range center is off the axis\r\n const toCenter = this._normalizedAxis.perpendicularPartOfVectorToTarget(center);\r\n if (this._normalizedAxis.direction.tripleProduct(toCenter, contourPerpendicular) < 0)\r\n contourPerpendicular.negate(contourPerpendicular);\r\n }\r\n const axes = Matrix3d.createRigidFromColumns(contourPerpendicular, this._normalizedAxis.direction, AxisOrder.YZX);\r\n if (axes) {\r\n return Transform.createOriginAndMatrix(this._normalizedAxis.origin, axes);\r\n }\r\n return undefined;\r\n }\r\n /** Return clone of (not reference to) the axis vector. */\r\n public cloneAxisRay(): Ray3d {\r\n return this._normalizedAxis.clone();\r\n }\r\n /** Return (REFERENCE TO) the swept curves. */\r\n public getCurves(): CurveCollection {\r\n return this._contour.curves;\r\n }\r\n /** Return (REFERENCE TO) the swept curves with containing plane markup. */\r\n public getSweepContourRef(): SweepContour {\r\n return this._contour;\r\n }\r\n /** Return the sweep angle. */\r\n public getSweep(): Angle {\r\n return this._sweepAngle.clone();\r\n }\r\n /** Test if `other` is a `RotationalSweep` */\r\n public isSameGeometryClass(other: any): boolean {\r\n return other instanceof RotationalSweep;\r\n }\r\n /** Test for same axis, capping, and swept geometry. */\r\n public override isAlmostEqual(other: GeometryQuery): boolean {\r\n if (other instanceof RotationalSweep) {\r\n return this._contour.isAlmostEqual(other._contour)\r\n && this._normalizedAxis.isAlmostEqual(other._normalizedAxis)\r\n && this._sweepAngle.isAlmostEqual(other._sweepAngle)\r\n && this.capped === other.capped;\r\n }\r\n return false;\r\n }\r\n /** Return a deep clone */\r\n public clone(): RotationalSweep {\r\n return new RotationalSweep(this._contour.clone(), this._normalizedAxis.clone(), this._sweepAngle.clone(), this.capped);\r\n }\r\n /**\r\n * Transform the contour and axis.\r\n * * This fails if the transformation is singular.\r\n */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n if (transform.matrix.isSingular())\r\n return false;\r\n if (this._contour.tryTransformInPlace(transform)) {\r\n this._normalizedAxis.transformInPlace(transform);\r\n if (transform.matrix.determinant() < 0.0)\r\n this._sweepAngle.setRadians(-this._sweepAngle.radians);\r\n return this._normalizedAxis.direction.normalizeInPlace();\r\n }\r\n return false;\r\n }\r\n /**\r\n * Return a transformed clone.\r\n * * This fails if the transformation is singular.\r\n */\r\n public cloneTransformed(transform: Transform): RotationalSweep | undefined {\r\n const result = this.clone();\r\n return result.tryTransformInPlace(transform) ? result : undefined;\r\n }\r\n /** Dispatch to strongly typed handler `handler.handleRotationalSweep(this)`. */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleRotationalSweep(this);\r\n }\r\n /** Return a transform that rotates around the rotational axis by a fraction of the total sweep. */\r\n public getFractionalRotationTransform(vFraction: number, result?: Transform): Transform {\r\n const radians = this._sweepAngle.radians * vFraction;\r\n const rotation = Transform.createFixedPointAndMatrix(this._normalizedAxis.origin,\r\n Matrix3d.createRotationAroundVector(this._normalizedAxis.direction, Angle.createRadians(radians),\r\n result ? result.matrix : undefined) as Matrix3d);\r\n return rotation;\r\n }\r\n /**\r\n * Return the curves of a constant-v section of the solid.\r\n * @param vFraction fractional position along the sweep direction\r\n */\r\n public constantVSection(vFraction: number): CurveCollection | undefined {\r\n const section = this._contour.curves.clone();\r\n section.tryTransformInPlace(this.getFractionalRotationTransform(vFraction));\r\n return section;\r\n }\r\n /** Extend range using sampled points on the surface. */\r\n public extendRange(range: Range3d, transform?: Transform) {\r\n const degreeStep = 360 / 32;\r\n const options = StrokeOptions.createForCurves();\r\n options.angleTol = Angle.createDegrees(degreeStep);\r\n const strokes = this._contour.curves.cloneStroked(options);\r\n const numStep = Geometry.stepCount(degreeStep, this._sweepAngle.degrees, 4, 32);\r\n const stepTransform = Transform.createIdentity();\r\n if (transform) {\r\n const compositeTransform = Transform.createIdentity();\r\n for (let i = 0; i <= numStep; i++) {\r\n transform.multiplyTransformTransform(\r\n this.getFractionalRotationTransform(i / numStep, stepTransform), compositeTransform,\r\n );\r\n strokes.extendRange(range, compositeTransform);\r\n }\r\n } else {\r\n for (let i = 0; i <= numStep; i++)\r\n strokes.extendRange(range, this.getFractionalRotationTransform(i / numStep, stepTransform));\r\n }\r\n }\r\n /** Return true if the sweep axis and contour are not coplanar. */\r\n public override get isSkew(): boolean {\r\n return !this._normalizedAxis.direction.isPerpendicularTo(this._contour.localToWorld.matrix.columnXCrossColumnY(), true);\r\n }\r\n /** Specify if the sweep forms a closed volume. */\r\n public get isClosedVolume(): boolean {\r\n return this.capped || this._sweepAngle.isFullCircle;\r\n }\r\n}\r\n"]}
|
|
@@ -29,6 +29,12 @@ export type SolidPrimitiveType = "box" | "cone" | "sphere" | "linearSweep" | "ro
|
|
|
29
29
|
* @public
|
|
30
30
|
*/
|
|
31
31
|
export type AnySolidPrimitive = Box | Cone | Sphere | LinearSweep | RotationalSweep | RuledSweep | TorusPipe;
|
|
32
|
+
/**
|
|
33
|
+
* Options for [[SolidPrimitive.getConstructiveFrame]], extended by subclasses.
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export declare class SolidPrimitiveConstructiveFrameOptions {
|
|
37
|
+
}
|
|
32
38
|
/**
|
|
33
39
|
* Base class for SolidPrimitive variants.
|
|
34
40
|
* * The base class holds capped flag for all derived classes.
|
|
@@ -52,7 +58,7 @@ export declare abstract class SolidPrimitive extends GeometryQuery {
|
|
|
52
58
|
* * The particulars of origin and orientation are specific to each SolidPrimitive type.
|
|
53
59
|
* * The returned Transform is generally rigid (no preservation of skew, mirror, or scale in the solid's definition).
|
|
54
60
|
*/
|
|
55
|
-
abstract getConstructiveFrame(): Transform | undefined;
|
|
61
|
+
abstract getConstructiveFrame(_options?: SolidPrimitiveConstructiveFrameOptions): Transform | undefined;
|
|
56
62
|
/**
|
|
57
63
|
* Return true if the solid's local coordinate axes lack full orthogonality.
|
|
58
64
|
* * Skew typically takes the form of a local z-axis that is not perpendicular to the local xy-plane.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidPrimitive.d.ts","sourceRoot":"","sources":["../../../src/solid/SolidPrimitive.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,GAAG,iBAAiB,GAAG,YAAY,GAAG,WAAW,CAAC;AAE5H;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,GAAG,GAAG,IAAI,GAAG,MAAM,GAAG,WAAW,GAAG,eAAe,GAAG,UAAU,GAAG,SAAS,CAAC;AAE7G;;;;GAIG;AACH,8BAAsB,cAAe,SAAQ,aAAa;IACxD,yCAAyC;IACzC,SAAgB,gBAAgB,WAAW;IAC3C,yCAAyC;IACzC,kBAAyB,kBAAkB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CAAsC;CAAG;AAEtD;;;;GAIG;AACH,8BAAsB,cAAe,SAAQ,aAAa;IACxD,yCAAyC;IACzC,SAAgB,gBAAgB,WAAW;IAC3C,yCAAyC;IACzC,kBAAyB,kBAAkB,EAAE,kBAAkB,CAAC;IAChE,wHAAwH;IACxH,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC;IAC3B,SAAS,aAAa,MAAM,EAAE,OAAO;IAIrC,sCAAsC;IACtC,IAAW,MAAM,IAAI,OAAO,CAE3B;IACD,IAAW,MAAM,CAAC,MAAM,EAAE,OAAO,EAEhC;IACD,qDAAqD;aACrC,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IACjF;;;;OAIG;aACa,oBAAoB,CAAC,QAAQ,CAAC,EAAE,sCAAsC,GAAG,SAAS,GAAG,SAAS;IAC9G;;;;OAIG;IACH,IAAW,MAAM,IAAI,OAAO,CAE3B;IACD;;;;;;OAMG;IACH,aAAoB,cAAc,IAAI,OAAO,CAAC;CAC/C"}
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { GeometryQuery } from "../curve/GeometryQuery";
|
|
6
|
+
/**
|
|
7
|
+
* Options for [[SolidPrimitive.getConstructiveFrame]], extended by subclasses.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export class SolidPrimitiveConstructiveFrameOptions {
|
|
11
|
+
}
|
|
6
12
|
/**
|
|
7
13
|
* Base class for SolidPrimitive variants.
|
|
8
14
|
* * The base class holds capped flag for all derived classes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidPrimitive.js","sourceRoot":"","sources":["../../../src/solid/SolidPrimitive.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AA8BvD;;;;GAIG;AACH,MAAM,OAAgB,cAAe,SAAQ,aAAa;IACxD,yCAAyC;IACzB,gBAAgB,GAAG,OAAO,CAAC;IAG3C,wHAAwH;IAC9G,OAAO,CAAU;IAC3B,YAAsB,MAAe;QACnC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IACD,sCAAsC;IACtC,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,IAAW,MAAM,CAAC,MAAe;QAC/B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IASD;;;;OAIG;IACH,IAAW,MAAM;QACf,OAAO,KAAK,CAAC;IACf,CAAC;CASF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Solid\r\n */\r\n\r\nimport { CurveCollection } from \"../curve/CurveCollection\";\r\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Box } from \"./Box\";\r\nimport { Cone } from \"./Cone\";\r\nimport { LinearSweep } from \"./LinearSweep\";\r\nimport { RotationalSweep } from \"./RotationalSweep\";\r\nimport { RuledSweep } from \"./RuledSweep\";\r\nimport { Sphere } from \"./Sphere\";\r\nimport { TorusPipe } from \"./TorusPipe\";\r\n\r\n/**\r\n * Describes the concrete type of a [[SolidPrimitive]]. Each type name maps to a specific subclass and can be used for\r\n * type-switching in conditional statements.\r\n * - \"box\" => [[Box]]\r\n * - \"cone\" => [[Cone]]\r\n * - \"sphere\" => [[Sphere]]\r\n * - \"linearSweep\" => [[LinearSweep]]\r\n * - \"rotationalSweep\" => [[RotationalSweep]]\r\n * - \"ruledSweep\" => [[RuledSweep]]\r\n * - \"torusPipe\" => [[TorusPipe]]\r\n * @public\r\n */\r\nexport type SolidPrimitiveType = \"box\" | \"cone\" | \"sphere\" | \"linearSweep\" | \"rotationalSweep\" | \"ruledSweep\" | \"torusPipe\";\r\n\r\n/**\r\n * Union type of all subclasses of [[SolidPrimitive]].\r\n * @public\r\n */\r\nexport type AnySolidPrimitive = Box | Cone | Sphere | LinearSweep | RotationalSweep | RuledSweep | TorusPipe;\r\n\r\n/**\r\n * Base class for SolidPrimitive variants.\r\n * * The base class holds capped flag for all derived classes.\r\n * @public\r\n */\r\nexport abstract class SolidPrimitive extends GeometryQuery {\r\n /** String name for schema properties. */\r\n public readonly geometryCategory = \"solid\";\r\n /** String name for schema properties. */\r\n public abstract readonly solidPrimitiveType: SolidPrimitiveType;\r\n /** Flag indicating whether cap region is considered closed (i.e. a planar region, rather than just a wire in space). */\r\n protected _capped: boolean;\r\n protected constructor(capped: boolean) {\r\n super();\r\n this._capped = capped;\r\n }\r\n /** Whether this is a capped solid. */\r\n public get capped(): boolean {\r\n return this._capped;\r\n }\r\n public set capped(capped: boolean) {\r\n this._capped = capped;\r\n }\r\n /** Return a cross section at specified vFraction. */\r\n public abstract constantVSection(_vFraction: number): CurveCollection | undefined;\r\n /**\r\n * Return a Transform from the solid's local coordinate system to world.\r\n * * The particulars of origin and orientation are specific to each SolidPrimitive type.\r\n * * The returned Transform is generally rigid (no preservation of skew, mirror, or scale in the solid's definition).\r\n */\r\n public abstract getConstructiveFrame(): Transform | undefined;\r\n /**\r\n * Return true if the solid's local coordinate axes lack full orthogonality.\r\n * * Skew typically takes the form of a local z-axis that is not perpendicular to the local xy-plane.\r\n * * This property is always `false` for a [[RuledSweep]].\r\n */\r\n public get isSkew(): boolean {\r\n return false;\r\n }\r\n /**\r\n * Return true if this is a closed volume\r\n * * LinearSweep, Box, Cone only depend on capped.\r\n * * Sphere affected by capped and latitude sweep\r\n * * TorusPipe and RotationalSweep affected by capped and sweep\r\n * * RuledSweep is affected by capped and match of first, last contour\r\n */\r\n public abstract get isClosedVolume(): boolean;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"SolidPrimitive.js","sourceRoot":"","sources":["../../../src/solid/SolidPrimitive.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AA8BvD;;;GAGG;AACH,MAAM,OAAO,sCAAsC;CAAG;AAEtD;;;;GAIG;AACH,MAAM,OAAgB,cAAe,SAAQ,aAAa;IACxD,yCAAyC;IACzB,gBAAgB,GAAG,OAAO,CAAC;IAG3C,wHAAwH;IAC9G,OAAO,CAAU;IAC3B,YAAsB,MAAe;QACnC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IACD,sCAAsC;IACtC,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,IAAW,MAAM,CAAC,MAAe;QAC/B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IASD;;;;OAIG;IACH,IAAW,MAAM;QACf,OAAO,KAAK,CAAC;IACf,CAAC;CASF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Solid\r\n */\r\n\r\nimport { CurveCollection } from \"../curve/CurveCollection\";\r\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Box } from \"./Box\";\r\nimport { Cone } from \"./Cone\";\r\nimport { LinearSweep } from \"./LinearSweep\";\r\nimport { RotationalSweep } from \"./RotationalSweep\";\r\nimport { RuledSweep } from \"./RuledSweep\";\r\nimport { Sphere } from \"./Sphere\";\r\nimport { TorusPipe } from \"./TorusPipe\";\r\n\r\n/**\r\n * Describes the concrete type of a [[SolidPrimitive]]. Each type name maps to a specific subclass and can be used for\r\n * type-switching in conditional statements.\r\n * - \"box\" => [[Box]]\r\n * - \"cone\" => [[Cone]]\r\n * - \"sphere\" => [[Sphere]]\r\n * - \"linearSweep\" => [[LinearSweep]]\r\n * - \"rotationalSweep\" => [[RotationalSweep]]\r\n * - \"ruledSweep\" => [[RuledSweep]]\r\n * - \"torusPipe\" => [[TorusPipe]]\r\n * @public\r\n */\r\nexport type SolidPrimitiveType = \"box\" | \"cone\" | \"sphere\" | \"linearSweep\" | \"rotationalSweep\" | \"ruledSweep\" | \"torusPipe\";\r\n\r\n/**\r\n * Union type of all subclasses of [[SolidPrimitive]].\r\n * @public\r\n */\r\nexport type AnySolidPrimitive = Box | Cone | Sphere | LinearSweep | RotationalSweep | RuledSweep | TorusPipe;\r\n\r\n/**\r\n * Options for [[SolidPrimitive.getConstructiveFrame]], extended by subclasses.\r\n * @public\r\n */\r\nexport class SolidPrimitiveConstructiveFrameOptions {}\r\n\r\n/**\r\n * Base class for SolidPrimitive variants.\r\n * * The base class holds capped flag for all derived classes.\r\n * @public\r\n */\r\nexport abstract class SolidPrimitive extends GeometryQuery {\r\n /** String name for schema properties. */\r\n public readonly geometryCategory = \"solid\";\r\n /** String name for schema properties. */\r\n public abstract readonly solidPrimitiveType: SolidPrimitiveType;\r\n /** Flag indicating whether cap region is considered closed (i.e. a planar region, rather than just a wire in space). */\r\n protected _capped: boolean;\r\n protected constructor(capped: boolean) {\r\n super();\r\n this._capped = capped;\r\n }\r\n /** Whether this is a capped solid. */\r\n public get capped(): boolean {\r\n return this._capped;\r\n }\r\n public set capped(capped: boolean) {\r\n this._capped = capped;\r\n }\r\n /** Return a cross section at specified vFraction. */\r\n public abstract constantVSection(_vFraction: number): CurveCollection | undefined;\r\n /**\r\n * Return a Transform from the solid's local coordinate system to world.\r\n * * The particulars of origin and orientation are specific to each SolidPrimitive type.\r\n * * The returned Transform is generally rigid (no preservation of skew, mirror, or scale in the solid's definition).\r\n */\r\n public abstract getConstructiveFrame(_options?: SolidPrimitiveConstructiveFrameOptions): Transform | undefined;\r\n /**\r\n * Return true if the solid's local coordinate axes lack full orthogonality.\r\n * * Skew typically takes the form of a local z-axis that is not perpendicular to the local xy-plane.\r\n * * This property is always `false` for a [[RuledSweep]].\r\n */\r\n public get isSkew(): boolean {\r\n return false;\r\n }\r\n /**\r\n * Return true if this is a closed volume\r\n * * LinearSweep, Box, Cone only depend on capped.\r\n * * Sphere affected by capped and latitude sweep\r\n * * TorusPipe and RotationalSweep affected by capped and sweep\r\n * * RuledSweep is affected by capped and match of first, last contour\r\n */\r\n public abstract get isClosedVolume(): boolean;\r\n}\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/core-geometry",
|
|
3
|
-
"version": "5.11.0-dev.
|
|
3
|
+
"version": "5.11.0-dev.11",
|
|
4
4
|
"description": "iTwin.js Core Geometry library",
|
|
5
5
|
"main": "lib/cjs/core-geometry.js",
|
|
6
6
|
"module": "lib/esm/core-geometry.js",
|
|
@@ -26,16 +26,16 @@
|
|
|
26
26
|
"@itwin/eslint-plugin": "^6.0.0",
|
|
27
27
|
"@types/flatbuffers": "~1.10.0",
|
|
28
28
|
"@types/node": "~20.17.0",
|
|
29
|
-
"@vitest/coverage-v8": "^
|
|
29
|
+
"@vitest/coverage-v8": "^4.1.8",
|
|
30
30
|
"eslint": "^9.31.0",
|
|
31
31
|
"rimraf": "^6.0.1",
|
|
32
32
|
"typescript": "~5.6.2",
|
|
33
|
-
"vitest": "^
|
|
34
|
-
"@itwin/build-tools": "5.11.0-dev.
|
|
33
|
+
"vitest": "^4.1.8",
|
|
34
|
+
"@itwin/build-tools": "5.11.0-dev.11"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"flatbuffers": "~1.12.0",
|
|
38
|
-
"@itwin/core-bentley": "5.11.0-dev.
|
|
38
|
+
"@itwin/core-bentley": "5.11.0-dev.11"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "npm run -s build:cjs && npm run -s build:esm",
|