opengeometry 0.0.6 → 1.0.9
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/index.d.ts +32 -2
- package/index.js +14750 -7338
- package/index.js.map +1 -1
- package/opengeometry_bg.wasm +0 -0
- package/opengeometry_bg.wasm.d.ts +162 -64
- package/package.json +7 -8
- package/src/examples/booleans.d.ts +22 -0
- package/src/examples/index.d.ts +9 -0
- package/src/examples/offset.d.ts +18 -0
- package/src/examples/primitives.d.ts +16 -0
- package/src/examples/shape-outline-dropdown.d.ts +23 -0
- package/src/examples/shapes.d.ts +20 -0
- package/src/examples/sweep.d.ts +9 -0
- package/src/examples/wall-from-offsets.d.ts +11 -0
- package/src/operations/boolean.d.ts +82 -0
- package/src/operations/index.d.ts +4 -0
- package/src/primitives/arc.d.ts +8 -2
- package/src/primitives/curve.d.ts +23 -0
- package/src/primitives/index.d.ts +4 -0
- package/src/primitives/line.d.ts +14 -1
- package/src/primitives/polyline.d.ts +13 -2
- package/src/primitives/rectangle.d.ts +13 -1
- package/src/shapes/boolean-subtract.d.ts +8 -0
- package/src/shapes/cuboid.d.ts +21 -2
- package/src/shapes/cylinder.d.ts +18 -1
- package/src/shapes/index.d.ts +6 -0
- package/src/shapes/opening.d.ts +25 -4
- package/src/shapes/outline-utils.d.ts +14 -0
- package/src/shapes/polygon.d.ts +24 -3
- package/src/shapes/sphere.d.ts +45 -0
- package/src/shapes/sweep.d.ts +42 -0
- package/src/shapes/swept-shape.d.ts +63 -0
- package/src/shapes/wedge.d.ts +44 -0
|
@@ -4,23 +4,34 @@ export interface IPolylineOptions {
|
|
|
4
4
|
ogid?: string;
|
|
5
5
|
color: number;
|
|
6
6
|
points: Vector3[];
|
|
7
|
+
fatLines?: boolean;
|
|
8
|
+
width?: number;
|
|
9
|
+
}
|
|
10
|
+
export type PolylineConfigUpdate = Partial<IPolylineOptions>;
|
|
11
|
+
export interface IOffsetResult {
|
|
12
|
+
points: Vector3[];
|
|
13
|
+
beveledVertexIndices: number[];
|
|
14
|
+
isClosed: boolean;
|
|
7
15
|
}
|
|
8
16
|
export declare class Polyline extends THREE.Line {
|
|
9
|
-
#private;
|
|
10
17
|
ogid: string;
|
|
11
18
|
options: IPolylineOptions;
|
|
12
19
|
isClosed: boolean;
|
|
13
20
|
private polyline;
|
|
21
|
+
private fatLine;
|
|
14
22
|
transformationMatrix: THREE.Matrix4;
|
|
15
23
|
set color(color: number);
|
|
16
24
|
constructor(options?: IPolylineOptions);
|
|
17
25
|
validateOptions(): void;
|
|
18
|
-
setConfig(options:
|
|
26
|
+
setConfig(options: PolylineConfigUpdate): void;
|
|
19
27
|
addPoint(point: Vector3): void;
|
|
20
28
|
/**
|
|
21
29
|
* Every time there are property changes, geometry needs to be discarded and regenerated.
|
|
22
30
|
* This is to ensure that the geometry is always up-to-date with the current state.
|
|
23
31
|
*/
|
|
24
32
|
discardGeometry(): void;
|
|
33
|
+
private getCurrentPositions;
|
|
34
|
+
private updateRenderStyle;
|
|
25
35
|
private generateGeometry;
|
|
36
|
+
getOffset(distance: number, acuteThresholdDegrees?: number, bevel?: boolean): IOffsetResult;
|
|
26
37
|
}
|
|
@@ -6,17 +6,29 @@ export interface IRectangleOptions {
|
|
|
6
6
|
width: number;
|
|
7
7
|
breadth: number;
|
|
8
8
|
color: number;
|
|
9
|
+
fatLines?: boolean;
|
|
10
|
+
lineWidth?: number;
|
|
11
|
+
}
|
|
12
|
+
export type RectangleConfigUpdate = Partial<IRectangleOptions>;
|
|
13
|
+
export interface IRectangleOffsetResult {
|
|
14
|
+
points: Vector3[];
|
|
15
|
+
beveledVertexIndices: number[];
|
|
16
|
+
isClosed: boolean;
|
|
9
17
|
}
|
|
10
18
|
export declare class Rectangle extends THREE.Line {
|
|
11
19
|
ogid: string;
|
|
12
20
|
options: IRectangleOptions;
|
|
13
21
|
private polyLineRectangle;
|
|
22
|
+
private fatLine;
|
|
14
23
|
set color(color: number);
|
|
15
24
|
constructor(options?: IRectangleOptions);
|
|
16
25
|
validateOptions(): void;
|
|
17
|
-
setConfig(options:
|
|
26
|
+
setConfig(options: RectangleConfigUpdate): void;
|
|
18
27
|
getConfig(): IRectangleOptions;
|
|
28
|
+
private getCurrentPositions;
|
|
29
|
+
private updateRenderStyle;
|
|
19
30
|
private generateGeometry;
|
|
20
31
|
getBrep(): any;
|
|
32
|
+
getOffset(distance: number, acuteThresholdDegrees?: number, bevel?: boolean): IRectangleOffsetResult;
|
|
21
33
|
discardGeometry(): void;
|
|
22
34
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BooleanExecutionOptions, BooleanOperand, BooleanResult } from "../operations/boolean";
|
|
2
|
+
export type ShapeSubtractOperand = BooleanOperand;
|
|
3
|
+
export type ShapeSubtractOptions = BooleanExecutionOptions;
|
|
4
|
+
export type ShapeSubtractResult = BooleanResult;
|
|
5
|
+
/**
|
|
6
|
+
* Executes a kernel-backed subtraction for a shape wrapper against another boolean operand.
|
|
7
|
+
*/
|
|
8
|
+
export declare function subtractShapeOperand(host: ShapeSubtractOperand, operand: ShapeSubtractOperand, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
package/src/shapes/cuboid.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Vector3 } from "../../../opengeometry/pkg/opengeometry";
|
|
2
2
|
import * as THREE from "three";
|
|
3
|
+
import { ShapeOutlineMesh } from "./outline-utils";
|
|
4
|
+
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract";
|
|
3
5
|
export interface ICuboidOptions {
|
|
4
6
|
ogid?: string;
|
|
5
7
|
center: Vector3;
|
|
@@ -7,22 +9,39 @@ export interface ICuboidOptions {
|
|
|
7
9
|
height: number;
|
|
8
10
|
depth: number;
|
|
9
11
|
color: number;
|
|
12
|
+
fatOutlines?: boolean;
|
|
13
|
+
outlineWidth?: number;
|
|
10
14
|
}
|
|
15
|
+
export type CuboidConfigUpdate = Partial<ICuboidOptions>;
|
|
11
16
|
export declare class Cuboid extends THREE.Mesh {
|
|
12
17
|
#private;
|
|
13
18
|
ogid: string;
|
|
14
19
|
options: ICuboidOptions;
|
|
15
20
|
private cuboid;
|
|
21
|
+
private _outlineEnabled;
|
|
22
|
+
private _fatOutlines;
|
|
23
|
+
private _outlineWidth;
|
|
16
24
|
private _geometryCenterOffset;
|
|
17
25
|
set width(value: number);
|
|
18
26
|
set color(color: number);
|
|
19
27
|
constructor(options?: ICuboidOptions);
|
|
20
28
|
validateOptions(): void;
|
|
21
|
-
|
|
29
|
+
getConfig(): ICuboidOptions;
|
|
30
|
+
setConfig(options: CuboidConfigUpdate): void;
|
|
22
31
|
cleanGeometry(): void;
|
|
23
32
|
generateGeometry(): void;
|
|
24
33
|
getBrepData(): any;
|
|
34
|
+
/**
|
|
35
|
+
* Subtracts another boolean operand, such as an Opening, from this cuboid.
|
|
36
|
+
*/
|
|
37
|
+
subtract(operand: ShapeSubtractOperand, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
25
38
|
set outline(enable: boolean);
|
|
26
|
-
get
|
|
39
|
+
get outline(): boolean;
|
|
40
|
+
set fatOutlines(value: boolean);
|
|
41
|
+
get fatOutlines(): boolean;
|
|
42
|
+
set outlineWidth(value: number);
|
|
43
|
+
get outlineWidth(): number;
|
|
44
|
+
get outlineMesh(): ShapeOutlineMesh | null;
|
|
45
|
+
private clearOutlineMesh;
|
|
27
46
|
discardGeometry(): void;
|
|
28
47
|
}
|
package/src/shapes/cylinder.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Vector3 } from "../../../opengeometry/pkg/opengeometry";
|
|
2
2
|
import * as THREE from "three";
|
|
3
|
+
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract";
|
|
3
4
|
export interface ICylinderOptions {
|
|
4
5
|
ogid?: string;
|
|
5
6
|
center: Vector3;
|
|
@@ -8,20 +9,36 @@ export interface ICylinderOptions {
|
|
|
8
9
|
segments: number;
|
|
9
10
|
angle: number;
|
|
10
11
|
color: number;
|
|
12
|
+
fatOutlines?: boolean;
|
|
13
|
+
outlineWidth?: number;
|
|
11
14
|
}
|
|
15
|
+
export type CylinderConfigUpdate = Partial<ICylinderOptions>;
|
|
12
16
|
export declare class Cylinder extends THREE.Mesh {
|
|
13
17
|
#private;
|
|
14
18
|
ogid: string;
|
|
15
19
|
options: ICylinderOptions;
|
|
16
20
|
private cylinder;
|
|
21
|
+
private _outlineEnabled;
|
|
22
|
+
private _fatOutlines;
|
|
23
|
+
private _outlineWidth;
|
|
17
24
|
set radius(value: number);
|
|
18
25
|
set color(color: number);
|
|
19
26
|
constructor(options?: ICylinderOptions);
|
|
20
27
|
validateOptions(): void;
|
|
21
|
-
setConfig(options:
|
|
28
|
+
setConfig(options: CylinderConfigUpdate): void;
|
|
22
29
|
cleanGeometry(): void;
|
|
23
30
|
generateGeometry(): void;
|
|
24
31
|
getBrep(): any;
|
|
32
|
+
/**
|
|
33
|
+
* Subtracts another boolean operand, such as an Opening, from this cylinder.
|
|
34
|
+
*/
|
|
35
|
+
subtract(operand: ShapeSubtractOperand, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
25
36
|
set outline(enable: boolean);
|
|
37
|
+
get outline(): boolean;
|
|
38
|
+
set fatOutlines(value: boolean);
|
|
39
|
+
get fatOutlines(): boolean;
|
|
40
|
+
set outlineWidth(value: number);
|
|
41
|
+
get outlineWidth(): number;
|
|
42
|
+
private clearOutlineMesh;
|
|
26
43
|
discardGeometry(): void;
|
|
27
44
|
}
|
package/src/shapes/index.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-level 3D shape wrappers backed by the OpenGeometry kernel.
|
|
3
|
+
*/
|
|
1
4
|
export * from './polygon';
|
|
2
5
|
export * from './cylinder';
|
|
3
6
|
export * from './cuboid';
|
|
4
7
|
export * from './opening';
|
|
8
|
+
export * from './sphere';
|
|
9
|
+
export * from './wedge';
|
|
10
|
+
export * from './sweep';
|
package/src/shapes/opening.d.ts
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import { Vector3 } from "./../../../opengeometry/pkg/opengeometry";
|
|
2
2
|
import * as THREE from "three";
|
|
3
|
-
|
|
3
|
+
import { ShapeOutlineMesh } from "./outline-utils";
|
|
4
|
+
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract";
|
|
5
|
+
export interface IOpeningOptions {
|
|
4
6
|
ogid?: string;
|
|
5
7
|
center: Vector3;
|
|
6
8
|
width: number;
|
|
7
9
|
height: number;
|
|
8
10
|
depth: number;
|
|
9
11
|
color: number;
|
|
12
|
+
fatOutlines?: boolean;
|
|
13
|
+
outlineWidth?: number;
|
|
10
14
|
}
|
|
15
|
+
export type OpeningConfigUpdate = Partial<IOpeningOptions>;
|
|
11
16
|
export declare class Opening extends THREE.Mesh {
|
|
12
17
|
#private;
|
|
13
18
|
ogid: string;
|
|
14
19
|
options: IOpeningOptions;
|
|
15
20
|
private opening;
|
|
21
|
+
private _outlineEnabled;
|
|
22
|
+
private _fatOutlines;
|
|
23
|
+
private _outlineWidth;
|
|
16
24
|
private _geometryCenterOffset;
|
|
17
25
|
set width(value: number);
|
|
18
26
|
set height(value: number);
|
|
@@ -24,12 +32,25 @@ export declare class Opening extends THREE.Mesh {
|
|
|
24
32
|
};
|
|
25
33
|
constructor(options?: IOpeningOptions);
|
|
26
34
|
validateOptions(): void;
|
|
27
|
-
setConfig(options:
|
|
35
|
+
setConfig(options: OpeningConfigUpdate): void;
|
|
28
36
|
cleanGeometry(): void;
|
|
29
37
|
generateGeometry(): void;
|
|
30
38
|
getBrepData(): any;
|
|
39
|
+
/**
|
|
40
|
+
* Subtracts another boolean operand from this opening volume.
|
|
41
|
+
*/
|
|
42
|
+
subtract(operand: ShapeSubtractOperand, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
43
|
+
/**
|
|
44
|
+
* Uses this opening volume to cut a host shape.
|
|
45
|
+
*/
|
|
46
|
+
subtractFrom(host: ShapeSubtractOperand, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
31
47
|
set outline(enable: boolean);
|
|
32
|
-
get
|
|
48
|
+
get outline(): boolean;
|
|
49
|
+
set fatOutlines(value: boolean);
|
|
50
|
+
get fatOutlines(): boolean;
|
|
51
|
+
set outlineWidth(value: number);
|
|
52
|
+
get outlineWidth(): number;
|
|
53
|
+
get outlineMesh(): ShapeOutlineMesh | null;
|
|
54
|
+
private clearOutlineMesh;
|
|
33
55
|
discardGeometry(): void;
|
|
34
56
|
}
|
|
35
|
-
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { LineSegments2 } from "three/examples/jsm/lines/LineSegments2.js";
|
|
3
|
+
export type ShapeOutlineMesh = THREE.LineSegments | LineSegments2;
|
|
4
|
+
export interface ShapeOutlineMeshOptions {
|
|
5
|
+
positions: number[];
|
|
6
|
+
color?: number;
|
|
7
|
+
fatOutlines?: boolean;
|
|
8
|
+
outlineWidth?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function sanitizeOutlineWidth(width?: number): number;
|
|
11
|
+
export declare function createShapeOutlineMesh({ positions, color, fatOutlines, outlineWidth, }: ShapeOutlineMeshOptions): ShapeOutlineMesh;
|
|
12
|
+
export declare function disposeShapeOutlineMesh(mesh: ShapeOutlineMesh | null): void;
|
|
13
|
+
export declare function setShapeOutlineColor(mesh: ShapeOutlineMesh | null, color: number): void;
|
|
14
|
+
export declare function getShapeOutlineColor(mesh: ShapeOutlineMesh | null, fallback?: number): number;
|
package/src/shapes/polygon.d.ts
CHANGED
|
@@ -1,29 +1,50 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
2
|
import { OGPolygon, Vector3 } from "../../../opengeometry/pkg/opengeometry";
|
|
3
|
-
|
|
3
|
+
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract";
|
|
4
|
+
export interface IPolygonOptions {
|
|
5
|
+
ogid?: string;
|
|
4
6
|
vertices: Vector3[];
|
|
7
|
+
holes?: Vector3[][];
|
|
8
|
+
color: number;
|
|
9
|
+
fatOutlines?: boolean;
|
|
10
|
+
outlineWidth?: number;
|
|
5
11
|
}
|
|
12
|
+
export type PolygonConfigUpdate = Partial<IPolygonOptions>;
|
|
6
13
|
export declare class Polygon extends THREE.Mesh {
|
|
7
14
|
#private;
|
|
8
15
|
ogid: string;
|
|
9
16
|
options: IPolygonOptions;
|
|
10
17
|
polygon: OGPolygon;
|
|
18
|
+
private _outlineEnabled;
|
|
19
|
+
private _fatOutlines;
|
|
20
|
+
private _outlineWidth;
|
|
21
|
+
private _outlineColor;
|
|
11
22
|
transformationMatrix: THREE.Matrix4;
|
|
12
23
|
set color(color: number);
|
|
24
|
+
get color(): number;
|
|
13
25
|
private _geometryCenterOffset;
|
|
14
26
|
constructor(options?: IPolygonOptions);
|
|
15
27
|
validateOptions(): void;
|
|
16
|
-
setConfig(): void;
|
|
28
|
+
setConfig(options: PolygonConfigUpdate): void;
|
|
29
|
+
cleanGeometry(): void;
|
|
17
30
|
generateGeometry(): void;
|
|
18
31
|
addVertices(vertices: Vector3[]): void;
|
|
19
32
|
saveTransformationToBREP(): void;
|
|
20
33
|
addHole(holeVertices: Vector3[]): void;
|
|
21
34
|
getBrepData(): string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Subtracts another boolean operand from this polygon.
|
|
37
|
+
*/
|
|
38
|
+
subtract(operand: ShapeSubtractOperand, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
22
39
|
set outlineColor(color: number);
|
|
23
40
|
get outlineColor(): number;
|
|
24
41
|
set outline(enable: boolean);
|
|
25
42
|
get outline(): boolean;
|
|
43
|
+
set fatOutlines(value: boolean);
|
|
44
|
+
get fatOutlines(): boolean;
|
|
45
|
+
set outlineWidth(value: number);
|
|
46
|
+
get outlineWidth(): number;
|
|
26
47
|
disposeGeometryMaterial(): void;
|
|
48
|
+
private clearOutlineMesh;
|
|
27
49
|
dispose(): void;
|
|
28
50
|
}
|
|
29
|
-
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Vector3 } from "../../../opengeometry/pkg/opengeometry";
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
import { ShapeOutlineMesh } from "./outline-utils";
|
|
4
|
+
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract";
|
|
5
|
+
export interface ISphereOptions {
|
|
6
|
+
ogid?: string;
|
|
7
|
+
center: Vector3;
|
|
8
|
+
radius: number;
|
|
9
|
+
widthSegments: number;
|
|
10
|
+
heightSegments: number;
|
|
11
|
+
color: number;
|
|
12
|
+
fatOutlines?: boolean;
|
|
13
|
+
outlineWidth?: number;
|
|
14
|
+
}
|
|
15
|
+
export type SphereConfigUpdate = Partial<ISphereOptions>;
|
|
16
|
+
export declare class Sphere extends THREE.Mesh {
|
|
17
|
+
#private;
|
|
18
|
+
ogid: string;
|
|
19
|
+
options: ISphereOptions;
|
|
20
|
+
private sphere;
|
|
21
|
+
private _outlineEnabled;
|
|
22
|
+
private _fatOutlines;
|
|
23
|
+
private _outlineWidth;
|
|
24
|
+
set radius(value: number);
|
|
25
|
+
set color(color: number);
|
|
26
|
+
constructor(options?: ISphereOptions);
|
|
27
|
+
validateOptions(): void;
|
|
28
|
+
setConfig(options: SphereConfigUpdate): void;
|
|
29
|
+
cleanGeometry(): void;
|
|
30
|
+
generateGeometry(): void;
|
|
31
|
+
getBrep(): any;
|
|
32
|
+
/**
|
|
33
|
+
* Subtracts another boolean operand, such as an Opening, from this sphere.
|
|
34
|
+
*/
|
|
35
|
+
subtract(operand: ShapeSubtractOperand, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
36
|
+
set outline(enable: boolean);
|
|
37
|
+
get outline(): boolean;
|
|
38
|
+
set fatOutlines(value: boolean);
|
|
39
|
+
get fatOutlines(): boolean;
|
|
40
|
+
set outlineWidth(value: number);
|
|
41
|
+
get outlineWidth(): number;
|
|
42
|
+
get outlineMesh(): ShapeOutlineMesh | null;
|
|
43
|
+
private clearOutlineMesh;
|
|
44
|
+
discardGeometry(): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Vector3 } from "../../../opengeometry/pkg/opengeometry";
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract";
|
|
4
|
+
export interface ISweepOptions {
|
|
5
|
+
ogid?: string;
|
|
6
|
+
path: Vector3[];
|
|
7
|
+
profile: Vector3[];
|
|
8
|
+
color: number;
|
|
9
|
+
capStart?: boolean;
|
|
10
|
+
capEnd?: boolean;
|
|
11
|
+
fatOutlines?: boolean;
|
|
12
|
+
outlineWidth?: number;
|
|
13
|
+
}
|
|
14
|
+
export type SweepConfigUpdate = Partial<ISweepOptions>;
|
|
15
|
+
export declare class Sweep extends THREE.Mesh {
|
|
16
|
+
#private;
|
|
17
|
+
ogid: string;
|
|
18
|
+
options: ISweepOptions;
|
|
19
|
+
private sweep;
|
|
20
|
+
private _outlineEnabled;
|
|
21
|
+
private _fatOutlines;
|
|
22
|
+
private _outlineWidth;
|
|
23
|
+
set color(color: number);
|
|
24
|
+
constructor(options?: ISweepOptions);
|
|
25
|
+
validateOptions(): void;
|
|
26
|
+
setConfig(options: SweepConfigUpdate): void;
|
|
27
|
+
cleanGeometry(): void;
|
|
28
|
+
generateGeometry(): void;
|
|
29
|
+
getBrep(): any;
|
|
30
|
+
/**
|
|
31
|
+
* Subtracts another boolean operand, such as an Opening, from this sweep.
|
|
32
|
+
*/
|
|
33
|
+
subtract(operand: ShapeSubtractOperand, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
34
|
+
set outline(enable: boolean);
|
|
35
|
+
get outline(): boolean;
|
|
36
|
+
set fatOutlines(value: boolean);
|
|
37
|
+
get fatOutlines(): boolean;
|
|
38
|
+
set outlineWidth(value: number);
|
|
39
|
+
get outlineWidth(): number;
|
|
40
|
+
private clearOutlineMesh;
|
|
41
|
+
discardGeometry(): void;
|
|
42
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { OGSweptShape, Vector3 } from "../../../opengeometry/pkg/opengeometry";
|
|
3
|
+
interface ISweptShapeOptions {
|
|
4
|
+
ogid?: string;
|
|
5
|
+
color?: number;
|
|
6
|
+
profileVertices?: Vector3[];
|
|
7
|
+
pathPoints?: Vector3[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* SweptShape class that extends THREE.Mesh
|
|
11
|
+
* Creates a 3D shape by sweeping a 2D profile along a 3D path
|
|
12
|
+
*/
|
|
13
|
+
export declare class SweptShape extends THREE.Mesh {
|
|
14
|
+
#private;
|
|
15
|
+
ogid: string;
|
|
16
|
+
options: ISweptShapeOptions;
|
|
17
|
+
sweptShape: OGSweptShape;
|
|
18
|
+
transformationMatrix: THREE.Matrix4;
|
|
19
|
+
get color(): number;
|
|
20
|
+
set color(color: number);
|
|
21
|
+
constructor(options?: ISweptShapeOptions);
|
|
22
|
+
validateOptions(): void;
|
|
23
|
+
setConfig(options?: ISweptShapeOptions): void;
|
|
24
|
+
/**
|
|
25
|
+
* Generate geometry from the swept shape
|
|
26
|
+
*/
|
|
27
|
+
generateGeometry(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Set the profile vertices for the sweep operation
|
|
30
|
+
*/
|
|
31
|
+
setProfileVertices(vertices: Vector3[]): void;
|
|
32
|
+
/**
|
|
33
|
+
* Set the path points for the sweep operation
|
|
34
|
+
*/
|
|
35
|
+
setPathPoints(points: Vector3[]): void;
|
|
36
|
+
/**
|
|
37
|
+
* Create a swept shape from a profile and path
|
|
38
|
+
*/
|
|
39
|
+
sweepAlongPath(profileVertices: Vector3[], pathPoints: Vector3[]): void;
|
|
40
|
+
/**
|
|
41
|
+
* Get the B-Rep data from the swept shape
|
|
42
|
+
*/
|
|
43
|
+
getBrepData(): string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Clear the swept shape data
|
|
46
|
+
*/
|
|
47
|
+
clearSweptShape(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Dispose of geometry and material resources
|
|
50
|
+
*/
|
|
51
|
+
disposeGeometry(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Enable/disable outline rendering
|
|
54
|
+
*/
|
|
55
|
+
set outline(enable: boolean);
|
|
56
|
+
get outline(): boolean;
|
|
57
|
+
get outlineMesh(): THREE.Line | null;
|
|
58
|
+
/**
|
|
59
|
+
* Dispose of all resources when the object is destroyed
|
|
60
|
+
*/
|
|
61
|
+
dispose(): void;
|
|
62
|
+
}
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Vector3 } from "../../../opengeometry/pkg/opengeometry";
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
import { ShapeOutlineMesh } from "./outline-utils";
|
|
4
|
+
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract";
|
|
5
|
+
export interface IWedgeOptions {
|
|
6
|
+
ogid?: string;
|
|
7
|
+
center: Vector3;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
depth: number;
|
|
11
|
+
color: number;
|
|
12
|
+
fatOutlines?: boolean;
|
|
13
|
+
outlineWidth?: number;
|
|
14
|
+
}
|
|
15
|
+
export type WedgeConfigUpdate = Partial<IWedgeOptions>;
|
|
16
|
+
export declare class Wedge extends THREE.Mesh {
|
|
17
|
+
#private;
|
|
18
|
+
ogid: string;
|
|
19
|
+
options: IWedgeOptions;
|
|
20
|
+
private wedge;
|
|
21
|
+
private _outlineEnabled;
|
|
22
|
+
private _fatOutlines;
|
|
23
|
+
private _outlineWidth;
|
|
24
|
+
set color(color: number);
|
|
25
|
+
constructor(options?: IWedgeOptions);
|
|
26
|
+
validateOptions(): void;
|
|
27
|
+
setConfig(options: WedgeConfigUpdate): void;
|
|
28
|
+
cleanGeometry(): void;
|
|
29
|
+
generateGeometry(): void;
|
|
30
|
+
getBrepData(): any;
|
|
31
|
+
/**
|
|
32
|
+
* Subtracts another boolean operand, such as an Opening, from this wedge.
|
|
33
|
+
*/
|
|
34
|
+
subtract(operand: ShapeSubtractOperand, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
35
|
+
set outline(enable: boolean);
|
|
36
|
+
get outline(): boolean;
|
|
37
|
+
set fatOutlines(value: boolean);
|
|
38
|
+
get fatOutlines(): boolean;
|
|
39
|
+
set outlineWidth(value: number);
|
|
40
|
+
get outlineWidth(): number;
|
|
41
|
+
get outlineMesh(): ShapeOutlineMesh | null;
|
|
42
|
+
private clearOutlineMesh;
|
|
43
|
+
discardGeometry(): void;
|
|
44
|
+
}
|