opengeometry 2.0.2 → 2.0.4
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/README.md +34 -6
- package/index.d.ts +30 -13
- package/index.js +794 -326
- package/index.js.map +1 -1
- package/opengeometry/pkg/opengeometry.d.ts +152 -137
- package/opengeometry/pkg/opengeometry.js +89 -7
- package/opengeometry/pkg/opengeometry_bg.wasm +0 -0
- package/opengeometry/pkg/opengeometry_bg.wasm.d.ts +143 -137
- package/opengeometry_bg.wasm +0 -0
- package/opengeometry_bg.wasm.d.ts +143 -137
- package/package.json +18 -8
- package/src/base-types.d.ts +7 -1
- package/src/editor/freeform.d.ts +63 -0
- package/src/editor/index.d.ts +3 -0
- package/src/editor/parametric.d.ts +10 -0
- package/src/editor/types.d.ts +72 -0
- package/src/freeform/geometry.d.ts +59 -0
- package/src/freeform/index.d.ts +3 -0
- package/src/freeform/types.d.ts +12 -0
- package/src/operations/boolean.d.ts +28 -0
- package/src/operations/extrude.d.ts +9 -0
- package/src/operations/index.d.ts +1 -0
- package/src/primitives/arc.d.ts +15 -0
- package/src/primitives/curve.d.ts +18 -0
- package/src/primitives/line.d.ts +15 -0
- package/src/primitives/polyline.d.ts +18 -0
- package/src/primitives/rectangle.d.ts +18 -0
- package/src/shapes/boolean-subtract.d.ts +14 -1
- package/src/shapes/cuboid.d.ts +18 -3
- package/src/shapes/cylinder.d.ts +18 -3
- package/src/shapes/extrusion.d.ts +64 -0
- package/src/shapes/index.d.ts +1 -0
- package/src/shapes/opening.d.ts +21 -3
- package/src/shapes/outline-utils.d.ts +21 -0
- package/src/shapes/polygon.d.ts +36 -6
- package/src/shapes/solid.d.ts +116 -0
- package/src/shapes/sphere.d.ts +18 -3
- package/src/shapes/sweep.d.ts +18 -3
- package/src/shapes/wedge.d.ts +18 -3
package/src/shapes/cylinder.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ShapeSubtractOperands, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
4
|
+
/**
|
|
5
|
+
* Construction options for a cylinder shape.
|
|
6
|
+
*/
|
|
4
7
|
export interface ICylinderOptions {
|
|
5
8
|
ogid?: string;
|
|
6
9
|
center: Vector3;
|
|
@@ -15,13 +18,25 @@ export interface ICylinderOptions {
|
|
|
15
18
|
rotation?: Vector3;
|
|
16
19
|
scale?: Vector3;
|
|
17
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Placement updates accepted by `Cylinder`.
|
|
23
|
+
*/
|
|
18
24
|
export interface CylinderPlacementOptions {
|
|
19
25
|
translation?: Vector3;
|
|
20
26
|
rotation?: Vector3;
|
|
21
27
|
scale?: Vector3;
|
|
22
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Partial config payload accepted by `Cylinder.setConfig(...)`.
|
|
31
|
+
*/
|
|
23
32
|
export type CylinderConfigUpdate = Partial<Omit<ICylinderOptions, "translation" | "rotation" | "scale">>;
|
|
33
|
+
/**
|
|
34
|
+
* Alias for `Cylinder` placement updates.
|
|
35
|
+
*/
|
|
24
36
|
export type CylinderPlacementUpdate = CylinderPlacementOptions;
|
|
37
|
+
/**
|
|
38
|
+
* Cylinder wrapper backed by the kernel cylindrical primitive.
|
|
39
|
+
*/
|
|
25
40
|
export declare class Cylinder extends THREE.Mesh {
|
|
26
41
|
#private;
|
|
27
42
|
ogid: string;
|
|
@@ -50,9 +65,9 @@ export declare class Cylinder extends THREE.Mesh {
|
|
|
50
65
|
generateGeometry(): void;
|
|
51
66
|
getBrep(): any;
|
|
52
67
|
/**
|
|
53
|
-
* Subtracts
|
|
68
|
+
* Subtracts one or more boolean operands, such as Opening volumes, from this cylinder.
|
|
54
69
|
*/
|
|
55
|
-
subtract(
|
|
70
|
+
subtract(operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
56
71
|
set outline(enable: boolean);
|
|
57
72
|
get outline(): boolean;
|
|
58
73
|
set fatOutlines(value: boolean);
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
4
|
+
export interface IExtrusionOptions {
|
|
5
|
+
ogid?: string;
|
|
6
|
+
vertices: Vector3[];
|
|
7
|
+
holes?: Vector3[][];
|
|
8
|
+
height: number;
|
|
9
|
+
color: number;
|
|
10
|
+
fatOutlines?: boolean;
|
|
11
|
+
outlineWidth?: number;
|
|
12
|
+
translation?: Vector3;
|
|
13
|
+
rotation?: Vector3;
|
|
14
|
+
scale?: Vector3;
|
|
15
|
+
}
|
|
16
|
+
export interface ExtrusionPlacementOptions {
|
|
17
|
+
translation?: Vector3;
|
|
18
|
+
rotation?: Vector3;
|
|
19
|
+
scale?: Vector3;
|
|
20
|
+
}
|
|
21
|
+
export type ExtrusionConfigUpdate = Partial<Omit<IExtrusionOptions, "translation" | "rotation" | "scale">>;
|
|
22
|
+
export type ExtrusionPlacementUpdate = ExtrusionPlacementOptions;
|
|
23
|
+
export declare class Extrusion extends THREE.Mesh {
|
|
24
|
+
#private;
|
|
25
|
+
ogid: string;
|
|
26
|
+
options: IExtrusionOptions;
|
|
27
|
+
private extrusion;
|
|
28
|
+
private _outlineEnabled;
|
|
29
|
+
private _fatOutlines;
|
|
30
|
+
private _outlineWidth;
|
|
31
|
+
private _outlineColor;
|
|
32
|
+
set color(color: number);
|
|
33
|
+
constructor(options?: IExtrusionOptions);
|
|
34
|
+
validateOptions(): void;
|
|
35
|
+
setConfig(options: ExtrusionConfigUpdate): void;
|
|
36
|
+
getConfig(): IExtrusionOptions;
|
|
37
|
+
getAnchor(): Vector3;
|
|
38
|
+
setAnchor(anchor: Vector3): void;
|
|
39
|
+
resetAnchor(): void;
|
|
40
|
+
setPlacement(placement: ExtrusionPlacementUpdate): void;
|
|
41
|
+
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
42
|
+
setTranslation(translation: Vector3): void;
|
|
43
|
+
setRotation(rotation: Vector3): void;
|
|
44
|
+
setScale(scale: Vector3): void;
|
|
45
|
+
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
46
|
+
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
47
|
+
canConvertToFreeform(): boolean;
|
|
48
|
+
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
49
|
+
cleanGeometry(): void;
|
|
50
|
+
generateGeometry(): void;
|
|
51
|
+
getBrepData(): any;
|
|
52
|
+
subtract(operand: ShapeSubtractOperand, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
53
|
+
set outlineColor(color: number);
|
|
54
|
+
get outlineColor(): number;
|
|
55
|
+
set outline(enable: boolean);
|
|
56
|
+
get outline(): boolean;
|
|
57
|
+
set fatOutlines(value: boolean);
|
|
58
|
+
get fatOutlines(): boolean;
|
|
59
|
+
set outlineWidth(value: number);
|
|
60
|
+
get outlineWidth(): number;
|
|
61
|
+
clearOutlineMesh(): void;
|
|
62
|
+
discardGeometry(): void;
|
|
63
|
+
private writePositionsToGeometry;
|
|
64
|
+
}
|
package/src/shapes/index.d.ts
CHANGED
package/src/shapes/opening.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
3
|
import { ShapeOutlineMesh } from "./outline-utils.js";
|
|
4
|
-
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
4
|
+
import type { ShapeSubtractOperand, ShapeSubtractOperands, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
5
|
+
/**
|
|
6
|
+
* Construction options for an architectural opening volume.
|
|
7
|
+
*/
|
|
5
8
|
export interface IOpeningOptions {
|
|
6
9
|
ogid?: string;
|
|
7
10
|
center: Vector3;
|
|
@@ -15,13 +18,25 @@ export interface IOpeningOptions {
|
|
|
15
18
|
rotation?: Vector3;
|
|
16
19
|
scale?: Vector3;
|
|
17
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Placement updates accepted by `Opening`.
|
|
23
|
+
*/
|
|
18
24
|
export interface OpeningPlacementOptions {
|
|
19
25
|
translation?: Vector3;
|
|
20
26
|
rotation?: Vector3;
|
|
21
27
|
scale?: Vector3;
|
|
22
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Partial config payload accepted by `Opening.setConfig(...)`.
|
|
31
|
+
*/
|
|
23
32
|
export type OpeningConfigUpdate = Partial<Omit<IOpeningOptions, "translation" | "rotation" | "scale">>;
|
|
33
|
+
/**
|
|
34
|
+
* Alias for `Opening` placement updates.
|
|
35
|
+
*/
|
|
24
36
|
export type OpeningPlacementUpdate = OpeningPlacementOptions;
|
|
37
|
+
/**
|
|
38
|
+
* Opening wrapper used as a subtractive solid in architectural workflows.
|
|
39
|
+
*/
|
|
25
40
|
export declare class Opening extends THREE.Mesh {
|
|
26
41
|
#private;
|
|
27
42
|
ogid: string;
|
|
@@ -56,11 +71,14 @@ export declare class Opening extends THREE.Mesh {
|
|
|
56
71
|
generateGeometry(): void;
|
|
57
72
|
getBrepData(): any;
|
|
58
73
|
/**
|
|
59
|
-
* Subtracts
|
|
74
|
+
* Subtracts one or more boolean operands from this opening volume.
|
|
60
75
|
*/
|
|
61
|
-
subtract(
|
|
76
|
+
subtract(operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
62
77
|
/**
|
|
63
78
|
* Uses this opening volume to cut a host shape.
|
|
79
|
+
*
|
|
80
|
+
* Prefer this helper for wall, slab, and other host-cutting workflows in
|
|
81
|
+
* browser-based AEC/BIM tools.
|
|
64
82
|
*/
|
|
65
83
|
subtractFrom(host: ShapeSubtractOperand, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
66
84
|
set outline(enable: boolean);
|
|
@@ -1,14 +1,35 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
2
|
import { LineSegments2 } from "three/examples/jsm/lines/LineSegments2.js";
|
|
3
|
+
/**
|
|
4
|
+
* Outline mesh variants used by shape wrappers.
|
|
5
|
+
*/
|
|
3
6
|
export type ShapeOutlineMesh = THREE.LineSegments | LineSegments2;
|
|
7
|
+
/**
|
|
8
|
+
* Options for building a shape outline mesh.
|
|
9
|
+
*/
|
|
4
10
|
export interface ShapeOutlineMeshOptions {
|
|
5
11
|
positions: number[];
|
|
6
12
|
color?: number;
|
|
7
13
|
fatOutlines?: boolean;
|
|
8
14
|
outlineWidth?: number;
|
|
9
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Clamps outline width inputs to the supported positive finite range.
|
|
18
|
+
*/
|
|
10
19
|
export declare function sanitizeOutlineWidth(width?: number): number;
|
|
20
|
+
/**
|
|
21
|
+
* Creates either a thin or fat outline mesh from line segment positions.
|
|
22
|
+
*/
|
|
11
23
|
export declare function createShapeOutlineMesh({ positions, color, fatOutlines, outlineWidth, }: ShapeOutlineMeshOptions): ShapeOutlineMesh;
|
|
24
|
+
/**
|
|
25
|
+
* Disposes the geometry and material owned by an outline mesh.
|
|
26
|
+
*/
|
|
12
27
|
export declare function disposeShapeOutlineMesh(mesh: ShapeOutlineMesh | null): void;
|
|
28
|
+
/**
|
|
29
|
+
* Updates the color of an existing outline mesh in place.
|
|
30
|
+
*/
|
|
13
31
|
export declare function setShapeOutlineColor(mesh: ShapeOutlineMesh | null, color: number): void;
|
|
32
|
+
/**
|
|
33
|
+
* Reads the current outline color, falling back when no outline exists.
|
|
34
|
+
*/
|
|
14
35
|
export declare function getShapeOutlineColor(mesh: ShapeOutlineMesh | null, fallback?: number): number;
|
package/src/shapes/polygon.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
2
|
import { OGPolygon, Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
3
|
-
import
|
|
3
|
+
import { Solid } from "./solid.js";
|
|
4
|
+
import type { ShapeSubtractOperands, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
5
|
+
/**
|
|
6
|
+
* Construction options for a planar polygon.
|
|
7
|
+
*/
|
|
4
8
|
export interface IPolygonOptions {
|
|
5
9
|
ogid?: string;
|
|
6
10
|
vertices: Vector3[];
|
|
@@ -17,8 +21,17 @@ export interface PolygonPlacementOptions {
|
|
|
17
21
|
rotation?: Vector3;
|
|
18
22
|
scale?: Vector3;
|
|
19
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Partial polygon config updates that regenerate the profile when geometry changes.
|
|
26
|
+
*/
|
|
20
27
|
export type PolygonConfigUpdate = Partial<Omit<IPolygonOptions, "translation" | "rotation" | "scale">>;
|
|
28
|
+
/**
|
|
29
|
+
* Placement updates accepted by `Polygon`.
|
|
30
|
+
*/
|
|
21
31
|
export type PolygonPlacementUpdate = PolygonPlacementOptions;
|
|
32
|
+
/**
|
|
33
|
+
* Planar polygon mesh with support for holes, booleans, and extrusion to `Solid`.
|
|
34
|
+
*/
|
|
22
35
|
export declare class Polygon extends THREE.Mesh {
|
|
23
36
|
#private;
|
|
24
37
|
ogid: string;
|
|
@@ -28,10 +41,8 @@ export declare class Polygon extends THREE.Mesh {
|
|
|
28
41
|
private _fatOutlines;
|
|
29
42
|
private _outlineWidth;
|
|
30
43
|
private _outlineColor;
|
|
31
|
-
transformationMatrix: THREE.Matrix4;
|
|
32
44
|
set color(color: number);
|
|
33
45
|
get color(): number;
|
|
34
|
-
private _geometryCenterOffset;
|
|
35
46
|
constructor(options?: IPolygonOptions);
|
|
36
47
|
validateOptions(): void;
|
|
37
48
|
setConfig(options: PolygonConfigUpdate): void;
|
|
@@ -45,19 +56,37 @@ export declare class Polygon extends THREE.Mesh {
|
|
|
45
56
|
setRotation(rotation: Vector3): void;
|
|
46
57
|
setScale(scale: Vector3): void;
|
|
47
58
|
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
59
|
+
/**
|
|
60
|
+
* Returns the editing capability payload advertised by parametric wrappers.
|
|
61
|
+
*/
|
|
48
62
|
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
63
|
+
/**
|
|
64
|
+
* Polygon always supports conversion into the freeform editing wrapper.
|
|
65
|
+
*/
|
|
49
66
|
canConvertToFreeform(): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Returns a freeform wrapper for direct BRep editing of this polygon.
|
|
69
|
+
*/
|
|
50
70
|
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
51
71
|
cleanGeometry(): void;
|
|
52
72
|
generateGeometry(): void;
|
|
53
73
|
addVertices(vertices: Vector3[]): void;
|
|
54
|
-
saveTransformationToBREP(): void;
|
|
55
74
|
addHole(holeVertices: Vector3[]): void;
|
|
75
|
+
/**
|
|
76
|
+
* Builds a kernel-backed `Solid` by extruding this polygon face by `height`.
|
|
77
|
+
*
|
|
78
|
+
* This is the recommended public path when a browser CAD or AEC workflow
|
|
79
|
+
* starts from a planar profile and needs a boolean-ready solid.
|
|
80
|
+
*/
|
|
81
|
+
extrude(height: number): Solid;
|
|
82
|
+
/**
|
|
83
|
+
* Returns the serialized BRep payload for this polygon.
|
|
84
|
+
*/
|
|
56
85
|
getBrepData(): string | null;
|
|
57
86
|
/**
|
|
58
|
-
* Subtracts
|
|
87
|
+
* Subtracts one or more boolean operands from this polygon.
|
|
59
88
|
*/
|
|
60
|
-
subtract(
|
|
89
|
+
subtract(operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
61
90
|
set outlineColor(color: number);
|
|
62
91
|
get outlineColor(): number;
|
|
63
92
|
set outline(enable: boolean);
|
|
@@ -70,4 +99,5 @@ export declare class Polygon extends THREE.Mesh {
|
|
|
70
99
|
private clearOutlineMesh;
|
|
71
100
|
dispose(): void;
|
|
72
101
|
private writePositionsToGeometry;
|
|
102
|
+
private disposeResources;
|
|
73
103
|
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
import { type FreeformGeometry } from "../freeform.js";
|
|
4
|
+
import type { FreeformSource } from "../freeform/types.js";
|
|
5
|
+
import type { ShapeSubtractOperands, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
6
|
+
/**
|
|
7
|
+
* Construction options for a generic BRep-backed solid.
|
|
8
|
+
*/
|
|
9
|
+
export interface ISolidOptions {
|
|
10
|
+
ogid?: string;
|
|
11
|
+
brep: FreeformSource;
|
|
12
|
+
color: number;
|
|
13
|
+
fatOutlines?: boolean;
|
|
14
|
+
outlineWidth?: number;
|
|
15
|
+
anchor?: Vector3;
|
|
16
|
+
translation?: Vector3;
|
|
17
|
+
rotation?: Vector3;
|
|
18
|
+
scale?: Vector3;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Placement updates accepted by `Solid`.
|
|
22
|
+
*/
|
|
23
|
+
export interface SolidPlacementOptions {
|
|
24
|
+
translation?: Vector3;
|
|
25
|
+
rotation?: Vector3;
|
|
26
|
+
scale?: Vector3;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Additional options accepted when creating a `Solid` through face extrusion.
|
|
30
|
+
*/
|
|
31
|
+
export interface ExtrudeSolidOptions extends Omit<ISolidOptions, "brep" | "ogid" | "anchor" | "translation" | "rotation" | "scale"> {
|
|
32
|
+
ogid?: string;
|
|
33
|
+
anchor?: Vector3;
|
|
34
|
+
translation?: Vector3;
|
|
35
|
+
rotation?: Vector3;
|
|
36
|
+
scale?: Vector3;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Generic renderable BRep-backed solid used for extrusion outputs and other
|
|
40
|
+
* kernel results that are not dedicated parametric shapes.
|
|
41
|
+
*/
|
|
42
|
+
export declare class Solid extends THREE.Mesh {
|
|
43
|
+
#private;
|
|
44
|
+
ogid: string;
|
|
45
|
+
options: ISolidOptions;
|
|
46
|
+
private solid;
|
|
47
|
+
private _outlineEnabled;
|
|
48
|
+
private _fatOutlines;
|
|
49
|
+
private _outlineWidth;
|
|
50
|
+
private _outlineColor;
|
|
51
|
+
set color(color: number);
|
|
52
|
+
get color(): number;
|
|
53
|
+
constructor(options: ISolidOptions);
|
|
54
|
+
/**
|
|
55
|
+
* Extrudes a face-like BRep source and wraps the result as a renderable solid.
|
|
56
|
+
*
|
|
57
|
+
* Prefer `polygon.extrude(height)` when the source is already a `Polygon`.
|
|
58
|
+
*/
|
|
59
|
+
static extrude(source: FreeformSource, height: number, options: ExtrudeSolidOptions): Solid;
|
|
60
|
+
/**
|
|
61
|
+
* Returns the current placement values as cloned vectors.
|
|
62
|
+
*/
|
|
63
|
+
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
64
|
+
/**
|
|
65
|
+
* Applies translation, rotation, and scale updates to the wrapped BRep.
|
|
66
|
+
*/
|
|
67
|
+
setPlacement(placement: SolidPlacementOptions): void;
|
|
68
|
+
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
69
|
+
setTranslation(translation: Vector3): void;
|
|
70
|
+
setRotation(rotation: Vector3): void;
|
|
71
|
+
setScale(scale: Vector3): void;
|
|
72
|
+
getAnchor(): Vector3;
|
|
73
|
+
setAnchor(anchor: Vector3): void;
|
|
74
|
+
/**
|
|
75
|
+
* Solid is always convertible back to the freeform editing wrapper.
|
|
76
|
+
*/
|
|
77
|
+
canConvertToFreeform(): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Returns a freeform wrapper for direct editing of this solid's BRep.
|
|
80
|
+
*/
|
|
81
|
+
toFreeform(id?: string): FreeformGeometry;
|
|
82
|
+
/**
|
|
83
|
+
* Returns the world-space serialized BRep payload for this solid.
|
|
84
|
+
*/
|
|
85
|
+
getBrepSerialized(): string;
|
|
86
|
+
/**
|
|
87
|
+
* Returns the local-space serialized BRep payload for this solid.
|
|
88
|
+
*/
|
|
89
|
+
getLocalBrepSerialized(): string;
|
|
90
|
+
/**
|
|
91
|
+
* Returns the parsed world-space BRep object for this solid.
|
|
92
|
+
*/
|
|
93
|
+
getBrepData(): any;
|
|
94
|
+
/**
|
|
95
|
+
* Subtracts one or more boolean operands from this solid.
|
|
96
|
+
*
|
|
97
|
+
* This is the main shape-level boolean workflow after operations like
|
|
98
|
+
* `polygon.extrude(height)` or `Solid.extrude(...)`.
|
|
99
|
+
*/
|
|
100
|
+
subtract(operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
101
|
+
/**
|
|
102
|
+
* Rebuilds the visible mesh and outline from the current freeform geometry.
|
|
103
|
+
*/
|
|
104
|
+
generateGeometry(): void;
|
|
105
|
+
set outlineColor(color: number);
|
|
106
|
+
get outlineColor(): number;
|
|
107
|
+
set outline(enable: boolean);
|
|
108
|
+
get outline(): boolean;
|
|
109
|
+
set fatOutlines(value: boolean);
|
|
110
|
+
get fatOutlines(): boolean;
|
|
111
|
+
set outlineWidth(value: number);
|
|
112
|
+
get outlineWidth(): number;
|
|
113
|
+
clearOutlineMesh(): void;
|
|
114
|
+
private getPlacementTransform;
|
|
115
|
+
private writePositionsToGeometry;
|
|
116
|
+
}
|
package/src/shapes/sphere.d.ts
CHANGED
|
@@ -2,7 +2,10 @@ import * as OGKernel from "../../opengeometry/pkg/opengeometry.js";
|
|
|
2
2
|
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
3
3
|
import * as THREE from "three";
|
|
4
4
|
import { ShapeOutlineMesh } from "./outline-utils.js";
|
|
5
|
-
import type {
|
|
5
|
+
import type { ShapeSubtractOperands, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
6
|
+
/**
|
|
7
|
+
* Construction options for a sphere shape.
|
|
8
|
+
*/
|
|
6
9
|
export interface ISphereOptions {
|
|
7
10
|
ogid?: string;
|
|
8
11
|
center: Vector3;
|
|
@@ -16,13 +19,25 @@ export interface ISphereOptions {
|
|
|
16
19
|
rotation?: Vector3;
|
|
17
20
|
scale?: Vector3;
|
|
18
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Placement updates accepted by `Sphere`.
|
|
24
|
+
*/
|
|
19
25
|
export interface SpherePlacementOptions {
|
|
20
26
|
translation?: Vector3;
|
|
21
27
|
rotation?: Vector3;
|
|
22
28
|
scale?: Vector3;
|
|
23
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Partial config payload accepted by `Sphere.setConfig(...)`.
|
|
32
|
+
*/
|
|
24
33
|
export type SphereConfigUpdate = Partial<Omit<ISphereOptions, "translation" | "rotation" | "scale">>;
|
|
34
|
+
/**
|
|
35
|
+
* Alias for `Sphere` placement updates.
|
|
36
|
+
*/
|
|
25
37
|
export type SpherePlacementUpdate = SpherePlacementOptions;
|
|
38
|
+
/**
|
|
39
|
+
* Sphere wrapper backed by the kernel sphere primitive.
|
|
40
|
+
*/
|
|
26
41
|
export declare class Sphere extends THREE.Mesh {
|
|
27
42
|
#private;
|
|
28
43
|
ogid: string;
|
|
@@ -51,9 +66,9 @@ export declare class Sphere extends THREE.Mesh {
|
|
|
51
66
|
generateGeometry(): void;
|
|
52
67
|
getBrep(): any;
|
|
53
68
|
/**
|
|
54
|
-
* Subtracts
|
|
69
|
+
* Subtracts one or more boolean operands, such as Opening volumes, from this sphere.
|
|
55
70
|
*/
|
|
56
|
-
subtract(
|
|
71
|
+
subtract(operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
57
72
|
set outline(enable: boolean);
|
|
58
73
|
get outline(): boolean;
|
|
59
74
|
set fatOutlines(value: boolean);
|
package/src/shapes/sweep.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import * as OGKernel from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
3
3
|
import * as THREE from "three";
|
|
4
|
-
import type {
|
|
4
|
+
import type { ShapeSubtractOperands, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
5
|
+
/**
|
|
6
|
+
* Construction options for a swept solid.
|
|
7
|
+
*/
|
|
5
8
|
export interface ISweepOptions {
|
|
6
9
|
ogid?: string;
|
|
7
10
|
path: Vector3[];
|
|
@@ -15,13 +18,25 @@ export interface ISweepOptions {
|
|
|
15
18
|
rotation?: Vector3;
|
|
16
19
|
scale?: Vector3;
|
|
17
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Placement updates accepted by `Sweep`.
|
|
23
|
+
*/
|
|
18
24
|
export interface SweepPlacementOptions {
|
|
19
25
|
translation?: Vector3;
|
|
20
26
|
rotation?: Vector3;
|
|
21
27
|
scale?: Vector3;
|
|
22
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Partial config payload accepted by `Sweep.setConfig(...)`.
|
|
31
|
+
*/
|
|
23
32
|
export type SweepConfigUpdate = Partial<Omit<ISweepOptions, "translation" | "rotation" | "scale">>;
|
|
33
|
+
/**
|
|
34
|
+
* Alias for `Sweep` placement updates.
|
|
35
|
+
*/
|
|
24
36
|
export type SweepPlacementUpdate = SweepPlacementOptions;
|
|
37
|
+
/**
|
|
38
|
+
* Sweep wrapper backed by the kernel sweep primitive.
|
|
39
|
+
*/
|
|
25
40
|
export declare class Sweep extends THREE.Mesh {
|
|
26
41
|
#private;
|
|
27
42
|
ogid: string;
|
|
@@ -51,9 +66,9 @@ export declare class Sweep extends THREE.Mesh {
|
|
|
51
66
|
generateGeometry(): void;
|
|
52
67
|
getBrep(): any;
|
|
53
68
|
/**
|
|
54
|
-
* Subtracts
|
|
69
|
+
* Subtracts one or more boolean operands, such as Opening volumes, from this sweep.
|
|
55
70
|
*/
|
|
56
|
-
subtract(
|
|
71
|
+
subtract(operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
57
72
|
set outline(enable: boolean);
|
|
58
73
|
get outline(): boolean;
|
|
59
74
|
set fatOutlines(value: boolean);
|
package/src/shapes/wedge.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
3
|
import { ShapeOutlineMesh } from "./outline-utils.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { ShapeSubtractOperands, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
5
|
+
/**
|
|
6
|
+
* Construction options for a wedge/prism shape.
|
|
7
|
+
*/
|
|
5
8
|
export interface IWedgeOptions {
|
|
6
9
|
ogid?: string;
|
|
7
10
|
center: Vector3;
|
|
@@ -15,13 +18,25 @@ export interface IWedgeOptions {
|
|
|
15
18
|
rotation?: Vector3;
|
|
16
19
|
scale?: Vector3;
|
|
17
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Placement updates accepted by `Wedge`.
|
|
23
|
+
*/
|
|
18
24
|
export interface WedgePlacementOptions {
|
|
19
25
|
translation?: Vector3;
|
|
20
26
|
rotation?: Vector3;
|
|
21
27
|
scale?: Vector3;
|
|
22
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Partial config payload accepted by `Wedge.setConfig(...)`.
|
|
31
|
+
*/
|
|
23
32
|
export type WedgeConfigUpdate = Partial<Omit<IWedgeOptions, "translation" | "rotation" | "scale">>;
|
|
33
|
+
/**
|
|
34
|
+
* Alias for `Wedge` placement updates.
|
|
35
|
+
*/
|
|
24
36
|
export type WedgePlacementUpdate = WedgePlacementOptions;
|
|
37
|
+
/**
|
|
38
|
+
* Wedge wrapper backed by the kernel wedge primitive.
|
|
39
|
+
*/
|
|
25
40
|
export declare class Wedge extends THREE.Mesh {
|
|
26
41
|
#private;
|
|
27
42
|
ogid: string;
|
|
@@ -49,9 +64,9 @@ export declare class Wedge extends THREE.Mesh {
|
|
|
49
64
|
generateGeometry(): void;
|
|
50
65
|
getBrepData(): any;
|
|
51
66
|
/**
|
|
52
|
-
* Subtracts
|
|
67
|
+
* Subtracts one or more boolean operands, such as Opening volumes, from this wedge.
|
|
53
68
|
*/
|
|
54
|
-
subtract(
|
|
69
|
+
subtract(operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
55
70
|
set outline(enable: boolean);
|
|
56
71
|
get outline(): boolean;
|
|
57
72
|
set fatOutlines(value: boolean);
|