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/editor/types.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import type { ObjectTransformation } from "../freeform/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Numeric identifier used for faces, edges, and vertices in freeform topology APIs.
|
|
5
|
+
*/
|
|
3
6
|
export type TopologyId = number;
|
|
7
|
+
/**
|
|
8
|
+
* Kernel edit permissions shared by global and feature-scoped freeform capabilities.
|
|
9
|
+
*/
|
|
4
10
|
export interface FreeformOperationCapabilities {
|
|
5
11
|
canPushPullFace: boolean;
|
|
6
12
|
canMoveFace: boolean;
|
|
@@ -14,6 +20,9 @@ export interface FreeformOperationCapabilities {
|
|
|
14
20
|
canLoopCut: boolean;
|
|
15
21
|
reasons?: string[];
|
|
16
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Global editing capabilities for a freeform geometry object.
|
|
25
|
+
*/
|
|
17
26
|
export interface FreeformEditCapabilities extends FreeformOperationCapabilities {
|
|
18
27
|
editingMode: "freeform";
|
|
19
28
|
entityType: "freeform";
|
|
@@ -22,29 +31,50 @@ export interface FreeformEditCapabilities extends FreeformOperationCapabilities
|
|
|
22
31
|
canEditPlacement: false;
|
|
23
32
|
canConvertToFreeform: false;
|
|
24
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Feature-scoped editing capabilities for a single face, edge, or vertex.
|
|
36
|
+
*/
|
|
25
37
|
export interface FreeformFeatureEditCapabilities extends FreeformOperationCapabilities {
|
|
26
38
|
domain: "face" | "edge" | "vertex";
|
|
27
39
|
topologyId: TopologyId;
|
|
28
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* How a topology id changed after an edit.
|
|
43
|
+
*/
|
|
29
44
|
export type TopologyRemapStatus = "unchanged" | "split" | "merged" | "deleted";
|
|
45
|
+
/**
|
|
46
|
+
* Maps an old topology id to the ids that replaced it.
|
|
47
|
+
*/
|
|
30
48
|
export interface TopologyRemapEntry {
|
|
31
49
|
old_id: TopologyId;
|
|
32
50
|
new_ids: TopologyId[];
|
|
33
51
|
primary_id: TopologyId | null;
|
|
34
52
|
status: TopologyRemapStatus;
|
|
35
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Newly created topology ids emitted by a freeform edit.
|
|
56
|
+
*/
|
|
36
57
|
export interface TopologyCreatedIds {
|
|
37
58
|
faces: TopologyId[];
|
|
38
59
|
edges: TopologyId[];
|
|
39
60
|
vertices: TopologyId[];
|
|
40
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Topology remap payload returned by edits that change face/edge/vertex ids.
|
|
64
|
+
*/
|
|
41
65
|
export interface TopologyRemap {
|
|
42
66
|
faces: TopologyRemapEntry[];
|
|
43
67
|
edges: TopologyRemapEntry[];
|
|
44
68
|
vertices: TopologyRemapEntry[];
|
|
45
69
|
created_ids: TopologyCreatedIds;
|
|
46
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Diagnostic severities returned by freeform validity checks.
|
|
73
|
+
*/
|
|
47
74
|
export type DiagnosticSeverity = "info" | "warning" | "error";
|
|
75
|
+
/**
|
|
76
|
+
* Individual diagnostic emitted by a freeform edit or validation pass.
|
|
77
|
+
*/
|
|
48
78
|
export interface FreeformDiagnostic {
|
|
49
79
|
code: string;
|
|
50
80
|
severity: DiagnosticSeverity;
|
|
@@ -52,11 +82,17 @@ export interface FreeformDiagnostic {
|
|
|
52
82
|
domain?: string;
|
|
53
83
|
topology_id?: TopologyId;
|
|
54
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Validity summary returned after a freeform edit.
|
|
87
|
+
*/
|
|
55
88
|
export interface FreeformValidity {
|
|
56
89
|
ok: boolean;
|
|
57
90
|
healed?: boolean;
|
|
58
91
|
diagnostics: FreeformDiagnostic[];
|
|
59
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Face metadata returned by the freeform editor.
|
|
95
|
+
*/
|
|
60
96
|
export interface FaceInfo {
|
|
61
97
|
face_id: TopologyId;
|
|
62
98
|
centroid: Vector3;
|
|
@@ -67,6 +103,9 @@ export interface FaceInfo {
|
|
|
67
103
|
vertex_ids: TopologyId[];
|
|
68
104
|
adjacent_face_ids: TopologyId[];
|
|
69
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* Edge metadata returned by the freeform editor.
|
|
108
|
+
*/
|
|
70
109
|
export interface EdgeInfo {
|
|
71
110
|
edge_id: TopologyId;
|
|
72
111
|
curve_type: string;
|
|
@@ -76,30 +115,48 @@ export interface EdgeInfo {
|
|
|
76
115
|
end: Vector3;
|
|
77
116
|
incident_face_ids: TopologyId[];
|
|
78
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Vertex metadata returned by the freeform editor.
|
|
120
|
+
*/
|
|
79
121
|
export interface VertexInfo {
|
|
80
122
|
vertex_id: TopologyId;
|
|
81
123
|
position: Vector3;
|
|
82
124
|
edge_ids: TopologyId[];
|
|
83
125
|
face_ids: TopologyId[];
|
|
84
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Triangulated face render data for topology overlays.
|
|
129
|
+
*/
|
|
85
130
|
export interface TopologyFaceRenderData {
|
|
86
131
|
face_id: TopologyId;
|
|
87
132
|
positions: number[];
|
|
88
133
|
indices: number[];
|
|
89
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Edge polyline render data for topology overlays.
|
|
137
|
+
*/
|
|
90
138
|
export interface TopologyEdgeRenderData {
|
|
91
139
|
edge_id: TopologyId;
|
|
92
140
|
positions: number[];
|
|
93
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Vertex render data for topology overlays.
|
|
144
|
+
*/
|
|
94
145
|
export interface TopologyVertexRenderData {
|
|
95
146
|
vertex_id: TopologyId;
|
|
96
147
|
position: Vector3;
|
|
97
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* Full renderable topology payload emitted by the freeform editor.
|
|
151
|
+
*/
|
|
98
152
|
export interface TopologyRenderData {
|
|
99
153
|
faces: TopologyFaceRenderData[];
|
|
100
154
|
edges: TopologyEdgeRenderData[];
|
|
101
155
|
vertices: TopologyVertexRenderData[];
|
|
102
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Structured result payload returned by freeform edit operations.
|
|
159
|
+
*/
|
|
103
160
|
export interface FreeformEditResult {
|
|
104
161
|
entity_id: string;
|
|
105
162
|
brep_serialized?: string;
|
|
@@ -114,6 +171,9 @@ export interface FreeformEditResult {
|
|
|
114
171
|
validity: FreeformValidity;
|
|
115
172
|
placement: ObjectTransformation;
|
|
116
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Optional flags that control how much auxiliary data an edit returns.
|
|
176
|
+
*/
|
|
117
177
|
export interface EditOperationOptions {
|
|
118
178
|
includeBrepSerialized?: boolean;
|
|
119
179
|
includeLocalBrepSerialized?: boolean;
|
|
@@ -127,16 +187,25 @@ export interface EditOperationOptions {
|
|
|
127
187
|
constraintFrame?: "local" | "world";
|
|
128
188
|
openSurfaceMode?: boolean;
|
|
129
189
|
}
|
|
190
|
+
/**
|
|
191
|
+
* High-level editing mode families exposed by public wrappers.
|
|
192
|
+
*/
|
|
130
193
|
export type EditingMode = "parametric" | "freeform";
|
|
131
194
|
export type ParametricEntityType = "line" | "polyline" | "arc" | "curve" | "rectangle" | "polygon" | "cuboid" | "cylinder" | "sphere" | "wedge" | "opening" | "sweep";
|
|
132
195
|
export type EntityType = ParametricEntityType | "freeform";
|
|
133
196
|
export type EditFamily = "profile" | "curve" | "box" | "radial" | "wedge" | "sweep" | "freeform";
|
|
134
197
|
export type ParametricEditFamily = Exclude<EditFamily, "freeform">;
|
|
198
|
+
/**
|
|
199
|
+
* Shared placement structure for parametric wrappers.
|
|
200
|
+
*/
|
|
135
201
|
export interface ParametricPlacement {
|
|
136
202
|
translation: Vector3;
|
|
137
203
|
rotation: Vector3;
|
|
138
204
|
scale: Vector3;
|
|
139
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
* Base capability payload shared by parametric and freeform wrappers.
|
|
208
|
+
*/
|
|
140
209
|
export interface BaseEditCapabilities {
|
|
141
210
|
editingMode: EditingMode;
|
|
142
211
|
entityType: EntityType;
|
|
@@ -145,6 +214,9 @@ export interface BaseEditCapabilities {
|
|
|
145
214
|
canEditPlacement: boolean;
|
|
146
215
|
canConvertToFreeform: boolean;
|
|
147
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* Capability payload returned by parametric wrappers such as `Polygon` or `Cuboid`.
|
|
219
|
+
*/
|
|
148
220
|
export interface ParametricEditCapabilities extends BaseEditCapabilities {
|
|
149
221
|
editingMode: "parametric";
|
|
150
222
|
entityType: ParametricEntityType;
|
|
@@ -1,21 +1,80 @@
|
|
|
1
1
|
import { OGFreeformGeometry, Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import type { CreateFreeformGeometryOptions, FreeformSource, ObjectTransformation } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Thin client-side wrapper around the kernel `OGFreeformGeometry` object.
|
|
5
|
+
*/
|
|
3
6
|
export declare class FreeformGeometry {
|
|
4
7
|
private readonly geometry;
|
|
5
8
|
constructor(geometry: OGFreeformGeometry);
|
|
9
|
+
/**
|
|
10
|
+
* Returns the stable kernel-side id for this freeform geometry object.
|
|
11
|
+
*/
|
|
6
12
|
getId(): string;
|
|
13
|
+
/**
|
|
14
|
+
* Returns the world-space serialized BRep payload.
|
|
15
|
+
*/
|
|
7
16
|
getBrepSerialized(): string;
|
|
17
|
+
/**
|
|
18
|
+
* Returns the local-space serialized BRep payload.
|
|
19
|
+
*/
|
|
8
20
|
getLocalBrepSerialized(): string;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the serialized triangle position buffer emitted by the kernel.
|
|
23
|
+
*/
|
|
9
24
|
getGeometrySerialized(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Returns world-space triangle positions as a plain number array.
|
|
27
|
+
*/
|
|
28
|
+
getGeometryBuffer(): number[];
|
|
29
|
+
/**
|
|
30
|
+
* Returns local-space triangle positions as a plain number array.
|
|
31
|
+
*/
|
|
32
|
+
getLocalGeometryBuffer(): number[];
|
|
33
|
+
/**
|
|
34
|
+
* Returns the serialized outline buffer emitted by the kernel.
|
|
35
|
+
*/
|
|
10
36
|
getOutlineGeometrySerialized(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Returns world-space outline segment positions as a plain number array.
|
|
39
|
+
*/
|
|
40
|
+
getOutlineGeometryBuffer(): number[];
|
|
41
|
+
/**
|
|
42
|
+
* Returns local-space outline segment positions as a plain number array.
|
|
43
|
+
*/
|
|
44
|
+
getLocalOutlineGeometryBuffer(): number[];
|
|
45
|
+
/**
|
|
46
|
+
* Returns the current normalized placement for this freeform geometry.
|
|
47
|
+
*/
|
|
11
48
|
getPlacement(): ObjectTransformation;
|
|
49
|
+
/**
|
|
50
|
+
* Replaces the full placement transform in one call.
|
|
51
|
+
*/
|
|
12
52
|
setPlacement(transform: ObjectTransformation): void;
|
|
53
|
+
/**
|
|
54
|
+
* Sets translation, rotation, and scale without changing the current anchor.
|
|
55
|
+
*/
|
|
13
56
|
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
57
|
+
/**
|
|
58
|
+
* Updates only the translation component of the placement.
|
|
59
|
+
*/
|
|
14
60
|
setTranslation(translation: Vector3): void;
|
|
61
|
+
/**
|
|
62
|
+
* Updates only the rotation component of the placement.
|
|
63
|
+
*/
|
|
15
64
|
setRotation(rotation: Vector3): void;
|
|
65
|
+
/**
|
|
66
|
+
* Updates only the scale component of the placement.
|
|
67
|
+
*/
|
|
16
68
|
setScale(scale: Vector3): void;
|
|
69
|
+
/**
|
|
70
|
+
* Updates the explicit modeling anchor used by downstream transforms.
|
|
71
|
+
*/
|
|
17
72
|
setAnchor(anchor: Vector3): void;
|
|
18
73
|
/** @internal */
|
|
19
74
|
getKernelGeometry(): OGFreeformGeometry;
|
|
20
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Creates a `FreeformGeometry` wrapper from serialized BRep JSON, a parsed
|
|
78
|
+
* BRep object, or another wrapper exposing BRep accessors.
|
|
79
|
+
*/
|
|
21
80
|
export declare function createFreeformGeometry(source: FreeformSource, options?: CreateFreeformGeometryOptions): FreeformGeometry;
|
package/src/freeform/index.d.ts
CHANGED
package/src/freeform/types.d.ts
CHANGED
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
|
+
/**
|
|
3
|
+
* Placement values accepted when constructing freeform geometry wrappers.
|
|
4
|
+
*/
|
|
2
5
|
export interface FreeformPlacementInput {
|
|
3
6
|
anchor?: Vector3;
|
|
4
7
|
translation: Vector3;
|
|
5
8
|
rotation: Vector3;
|
|
6
9
|
scale: Vector3;
|
|
7
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Fully normalized placement state used by freeform editing APIs.
|
|
13
|
+
*/
|
|
8
14
|
export interface ObjectTransformation {
|
|
9
15
|
anchor: Vector3;
|
|
10
16
|
translation: Vector3;
|
|
11
17
|
rotation: Vector3;
|
|
12
18
|
scale: Vector3;
|
|
13
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Options for building a `FreeformGeometry` wrapper from a BRep-like source.
|
|
22
|
+
*/
|
|
14
23
|
export interface CreateFreeformGeometryOptions {
|
|
15
24
|
id?: string;
|
|
16
25
|
placement?: FreeformPlacementInput | ObjectTransformation;
|
|
17
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Accepted sources for creating a freeform wrapper.
|
|
29
|
+
*/
|
|
18
30
|
export type FreeformSource = string | Record<string, unknown> | {
|
|
19
31
|
getLocalBrepSerialized?: () => string;
|
|
20
32
|
getLocalBrepData?: () => unknown;
|
|
@@ -1,23 +1,38 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
2
|
import { type CreateFreeformGeometryOptions, type FreeformGeometry } from "../freeform.js";
|
|
3
|
+
/**
|
|
4
|
+
* Accepted operand formats for boolean helpers.
|
|
5
|
+
*/
|
|
3
6
|
export type BooleanOperand = string | Record<string, unknown> | {
|
|
4
7
|
getBrep?: () => unknown;
|
|
5
8
|
getBrepData?: () => unknown;
|
|
6
9
|
getBrepSerialized?: () => string;
|
|
7
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Kernel-side boolean tuning options.
|
|
13
|
+
*/
|
|
8
14
|
export interface BooleanKernelOptions {
|
|
9
15
|
tolerance?: number;
|
|
10
16
|
mergeCoplanarFaces?: boolean;
|
|
11
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Rendering options applied to the boolean result mesh.
|
|
20
|
+
*/
|
|
12
21
|
export interface BooleanRenderOptions {
|
|
13
22
|
color?: number;
|
|
14
23
|
outline?: boolean;
|
|
15
24
|
fatOutlines?: boolean;
|
|
16
25
|
outlineWidth?: number;
|
|
17
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Combined kernel and rendering options accepted by boolean helpers.
|
|
29
|
+
*/
|
|
18
30
|
export interface BooleanExecutionOptions extends BooleanRenderOptions {
|
|
19
31
|
kernel?: BooleanKernelOptions;
|
|
20
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Structured report returned by the kernel boolean pipeline.
|
|
35
|
+
*/
|
|
21
36
|
export interface BooleanReport {
|
|
22
37
|
operation: string;
|
|
23
38
|
operand_kind: string;
|
|
@@ -76,6 +91,9 @@ export declare class BooleanResult extends THREE.Mesh {
|
|
|
76
91
|
}
|
|
77
92
|
/**
|
|
78
93
|
* Computes a kernel-backed boolean union and returns a renderable result mesh.
|
|
94
|
+
*
|
|
95
|
+
* Accepts wrapper objects directly, including `Solid`, `Cuboid`, `Opening`,
|
|
96
|
+
* and other shapes that expose BRep accessors.
|
|
79
97
|
*/
|
|
80
98
|
export declare function booleanUnion(lhs: BooleanOperand, rhs: BooleanOperand, options?: BooleanExecutionOptions): BooleanResult;
|
|
81
99
|
/**
|
|
@@ -84,6 +102,16 @@ export declare function booleanUnion(lhs: BooleanOperand, rhs: BooleanOperand, o
|
|
|
84
102
|
export declare function booleanIntersection(lhs: BooleanOperand, rhs: BooleanOperand, options?: BooleanExecutionOptions): BooleanResult;
|
|
85
103
|
/**
|
|
86
104
|
* Computes a kernel-backed boolean subtraction and returns a renderable result mesh.
|
|
105
|
+
*
|
|
106
|
+
* Use this when you want a standalone helper rather than a shape-level
|
|
107
|
+
* convenience method like `opening.subtractFrom(host)`.
|
|
87
108
|
*/
|
|
88
109
|
export declare function booleanSubtraction(lhs: BooleanOperand, rhs: BooleanOperand, options?: BooleanExecutionOptions): BooleanResult;
|
|
110
|
+
/**
|
|
111
|
+
* Computes a kernel-backed repeated subtraction using a left-to-right cutter array.
|
|
112
|
+
*
|
|
113
|
+
* This is used by the shape-level `.subtract([...])` helpers so the heavy
|
|
114
|
+
* boolean orchestration stays in the Rust/WASM layer instead of JavaScript.
|
|
115
|
+
*/
|
|
116
|
+
export declare function executeBooleanSubtractionMany(lhs: BooleanOperand, cutters: BooleanOperand[], options?: BooleanExecutionOptions): BooleanResult;
|
|
89
117
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FreeformSource } from "../freeform.js";
|
|
2
|
+
/**
|
|
3
|
+
* Sources accepted by the BRep-face extrusion helper.
|
|
4
|
+
*/
|
|
5
|
+
export type ExtrudeBrepSource = FreeformSource;
|
|
6
|
+
/**
|
|
7
|
+
* Extrudes the first face or wire in a local BRep payload into a closed solid BRep.
|
|
8
|
+
*/
|
|
9
|
+
export declare function extrudeBrepFace(source: ExtrudeBrepSource, height: number): string;
|
package/src/primitives/arc.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
|
+
/**
|
|
4
|
+
* Construction options for an arc or full-circle primitive.
|
|
5
|
+
*/
|
|
3
6
|
export interface IArcOptions {
|
|
4
7
|
ogid?: string;
|
|
5
8
|
center: Vector3;
|
|
@@ -14,13 +17,25 @@ export interface IArcOptions {
|
|
|
14
17
|
rotation?: Vector3;
|
|
15
18
|
scale?: Vector3;
|
|
16
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Placement updates accepted by `Arc`.
|
|
22
|
+
*/
|
|
17
23
|
export interface ArcPlacementOptions {
|
|
18
24
|
translation?: Vector3;
|
|
19
25
|
rotation?: Vector3;
|
|
20
26
|
scale?: Vector3;
|
|
21
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Partial config payload accepted by `Arc.setConfig(...)`.
|
|
30
|
+
*/
|
|
22
31
|
export type ArcConfigUpdate = Partial<Omit<IArcOptions, "translation" | "rotation" | "scale">>;
|
|
32
|
+
/**
|
|
33
|
+
* Alias for `Arc` placement updates.
|
|
34
|
+
*/
|
|
23
35
|
export type ArcPlacementUpdate = ArcPlacementOptions;
|
|
36
|
+
/**
|
|
37
|
+
* Arc wrapper backed by the kernel OGArc primitive.
|
|
38
|
+
*/
|
|
24
39
|
export declare class Arc extends THREE.Line {
|
|
25
40
|
ogid: string;
|
|
26
41
|
options: IArcOptions;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
2
|
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
3
|
+
/**
|
|
4
|
+
* Construction options for a control-point-driven curve.
|
|
5
|
+
*/
|
|
3
6
|
export interface ICurveOptions {
|
|
4
7
|
ogid?: string;
|
|
5
8
|
controlPoints: Vector3[];
|
|
@@ -8,18 +11,33 @@ export interface ICurveOptions {
|
|
|
8
11
|
rotation?: Vector3;
|
|
9
12
|
scale?: Vector3;
|
|
10
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Placement updates accepted by `Curve`.
|
|
16
|
+
*/
|
|
11
17
|
export interface CurvePlacementOptions {
|
|
12
18
|
translation?: Vector3;
|
|
13
19
|
rotation?: Vector3;
|
|
14
20
|
scale?: Vector3;
|
|
15
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Partial config payload accepted by `Curve.setConfig(...)`.
|
|
24
|
+
*/
|
|
16
25
|
export type CurveConfigUpdate = Partial<Omit<ICurveOptions, "translation" | "rotation" | "scale">>;
|
|
26
|
+
/**
|
|
27
|
+
* Alias for `Curve` placement updates.
|
|
28
|
+
*/
|
|
17
29
|
export type CurvePlacementUpdate = CurvePlacementOptions;
|
|
30
|
+
/**
|
|
31
|
+
* Offset result returned by `Curve.offset(...)`.
|
|
32
|
+
*/
|
|
18
33
|
export interface ICurveOffsetResult {
|
|
19
34
|
points: Vector3[];
|
|
20
35
|
beveledVertexIndices: number[];
|
|
21
36
|
isClosed: boolean;
|
|
22
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Curve wrapper backed by the kernel OGCurve primitive.
|
|
40
|
+
*/
|
|
23
41
|
export declare class Curve extends THREE.Line {
|
|
24
42
|
ogid: string;
|
|
25
43
|
options: ICurveOptions;
|
package/src/primitives/line.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
|
+
/**
|
|
4
|
+
* Construction options for a line segment wrapper.
|
|
5
|
+
*/
|
|
3
6
|
export interface ILineOptions {
|
|
4
7
|
ogid?: string;
|
|
5
8
|
start: Vector3;
|
|
@@ -11,13 +14,25 @@ export interface ILineOptions {
|
|
|
11
14
|
rotation?: Vector3;
|
|
12
15
|
scale?: Vector3;
|
|
13
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Placement updates accepted by `Line`.
|
|
19
|
+
*/
|
|
14
20
|
export interface LinePlacementOptions {
|
|
15
21
|
translation?: Vector3;
|
|
16
22
|
rotation?: Vector3;
|
|
17
23
|
scale?: Vector3;
|
|
18
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Partial config payload accepted by `Line.setConfig(...)`.
|
|
27
|
+
*/
|
|
19
28
|
export type LineConfigUpdate = Partial<Omit<ILineOptions, "translation" | "rotation" | "scale">>;
|
|
29
|
+
/**
|
|
30
|
+
* Alias for `Line` placement updates.
|
|
31
|
+
*/
|
|
20
32
|
export type LinePlacementUpdate = LinePlacementOptions;
|
|
33
|
+
/**
|
|
34
|
+
* Offset result returned by `Line.offset(...)`.
|
|
35
|
+
*/
|
|
21
36
|
export interface ILineOffsetResult {
|
|
22
37
|
points: Vector3[];
|
|
23
38
|
beveledVertexIndices: number[];
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import { Vector3 } from '../../opengeometry/pkg/opengeometry.js';
|
|
3
|
+
/**
|
|
4
|
+
* Construction options for an ordered polyline wrapper.
|
|
5
|
+
*/
|
|
3
6
|
export interface IPolylineOptions {
|
|
4
7
|
ogid?: string;
|
|
5
8
|
color: number;
|
|
@@ -10,18 +13,33 @@ export interface IPolylineOptions {
|
|
|
10
13
|
rotation?: Vector3;
|
|
11
14
|
scale?: Vector3;
|
|
12
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Placement updates accepted by `Polyline`.
|
|
18
|
+
*/
|
|
13
19
|
export interface PolylinePlacementOptions {
|
|
14
20
|
translation?: Vector3;
|
|
15
21
|
rotation?: Vector3;
|
|
16
22
|
scale?: Vector3;
|
|
17
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Partial config payload accepted by `Polyline.setConfig(...)`.
|
|
26
|
+
*/
|
|
18
27
|
export type PolylineConfigUpdate = Partial<Omit<IPolylineOptions, "translation" | "rotation" | "scale">>;
|
|
28
|
+
/**
|
|
29
|
+
* Alias for `Polyline` placement updates.
|
|
30
|
+
*/
|
|
19
31
|
export type PolylinePlacementUpdate = PolylinePlacementOptions;
|
|
32
|
+
/**
|
|
33
|
+
* Offset result returned by `Polyline.offset(...)`.
|
|
34
|
+
*/
|
|
20
35
|
export interface IOffsetResult {
|
|
21
36
|
points: Vector3[];
|
|
22
37
|
beveledVertexIndices: number[];
|
|
23
38
|
isClosed: boolean;
|
|
24
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Polyline wrapper backed by the kernel OGPolyline primitive.
|
|
42
|
+
*/
|
|
25
43
|
export declare class Polyline extends THREE.Line {
|
|
26
44
|
ogid: string;
|
|
27
45
|
options: IPolylineOptions;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
|
+
/**
|
|
4
|
+
* Construction options for a rectangle profile wrapper.
|
|
5
|
+
*/
|
|
3
6
|
export interface IRectangleOptions {
|
|
4
7
|
ogid?: string;
|
|
5
8
|
center: Vector3;
|
|
@@ -12,18 +15,33 @@ export interface IRectangleOptions {
|
|
|
12
15
|
rotation?: Vector3;
|
|
13
16
|
scale?: Vector3;
|
|
14
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Placement updates accepted by `Rectangle`.
|
|
20
|
+
*/
|
|
15
21
|
export interface RectanglePlacementOptions {
|
|
16
22
|
translation?: Vector3;
|
|
17
23
|
rotation?: Vector3;
|
|
18
24
|
scale?: Vector3;
|
|
19
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Partial config payload accepted by `Rectangle.setConfig(...)`.
|
|
28
|
+
*/
|
|
20
29
|
export type RectangleConfigUpdate = Partial<Omit<IRectangleOptions, "translation" | "rotation" | "scale">>;
|
|
30
|
+
/**
|
|
31
|
+
* Alias for `Rectangle` placement updates.
|
|
32
|
+
*/
|
|
21
33
|
export type RectanglePlacementUpdate = RectanglePlacementOptions;
|
|
34
|
+
/**
|
|
35
|
+
* Offset result returned by `Rectangle.offset(...)`.
|
|
36
|
+
*/
|
|
22
37
|
export interface IRectangleOffsetResult {
|
|
23
38
|
points: Vector3[];
|
|
24
39
|
beveledVertexIndices: number[];
|
|
25
40
|
isClosed: boolean;
|
|
26
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Rectangle wrapper backed by the kernel OGRectangle primitive.
|
|
44
|
+
*/
|
|
27
45
|
export declare class Rectangle extends THREE.Line {
|
|
28
46
|
ogid: string;
|
|
29
47
|
options: IRectangleOptions;
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import type { BooleanExecutionOptions, BooleanOperand, BooleanResult } from "../operations/boolean.js";
|
|
2
|
+
/**
|
|
3
|
+
* Operand types accepted by shape instance `.subtract(...)` helpers.
|
|
4
|
+
*/
|
|
2
5
|
export type ShapeSubtractOperand = BooleanOperand;
|
|
6
|
+
/**
|
|
7
|
+
* Array-only operand list accepted by shape instance `.subtract(...)` helpers.
|
|
8
|
+
*/
|
|
9
|
+
export type ShapeSubtractOperands = ShapeSubtractOperand[];
|
|
10
|
+
/**
|
|
11
|
+
* Options accepted by shape instance `.subtract(...)` helpers.
|
|
12
|
+
*/
|
|
3
13
|
export type ShapeSubtractOptions = BooleanExecutionOptions;
|
|
14
|
+
/**
|
|
15
|
+
* Return type for shape instance `.subtract(...)` helpers.
|
|
16
|
+
*/
|
|
4
17
|
export type ShapeSubtractResult = BooleanResult;
|
|
5
18
|
/**
|
|
6
19
|
* Executes a kernel-backed subtraction for a shape wrapper against another boolean operand.
|
|
7
20
|
*/
|
|
8
|
-
export declare function subtractShapeOperand(host: ShapeSubtractOperand,
|
|
21
|
+
export declare function subtractShapeOperand(host: ShapeSubtractOperand, operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
package/src/shapes/cuboid.d.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
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
|
+
* Placement updates accepted by `Cuboid`.
|
|
7
|
+
*/
|
|
5
8
|
export interface CuboidPlacementOptions {
|
|
6
9
|
translation?: Vector3;
|
|
7
10
|
rotation?: Vector3;
|
|
8
11
|
scale?: Vector3;
|
|
9
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Construction options for a cuboid shape.
|
|
15
|
+
*/
|
|
10
16
|
export interface ICuboidOptions extends CuboidPlacementOptions {
|
|
11
17
|
ogid?: string;
|
|
12
18
|
center: Vector3;
|
|
@@ -17,8 +23,17 @@ export interface ICuboidOptions extends CuboidPlacementOptions {
|
|
|
17
23
|
fatOutlines?: boolean;
|
|
18
24
|
outlineWidth?: number;
|
|
19
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Partial config payload accepted by `Cuboid.setConfig(...)`.
|
|
28
|
+
*/
|
|
20
29
|
export type CuboidConfigUpdate = Partial<Omit<ICuboidOptions, "translation" | "rotation" | "scale">>;
|
|
30
|
+
/**
|
|
31
|
+
* Alias for `Cuboid` placement updates.
|
|
32
|
+
*/
|
|
21
33
|
export type CuboidPlacementUpdate = CuboidPlacementOptions;
|
|
34
|
+
/**
|
|
35
|
+
* Box-shaped solid wrapper backed by the kernel cuboid primitive.
|
|
36
|
+
*/
|
|
22
37
|
export declare class Cuboid extends THREE.Mesh {
|
|
23
38
|
#private;
|
|
24
39
|
ogid: string;
|
|
@@ -36,9 +51,9 @@ export declare class Cuboid extends THREE.Mesh {
|
|
|
36
51
|
generateGeometry(): void;
|
|
37
52
|
getBrepData(): any;
|
|
38
53
|
/**
|
|
39
|
-
* Subtracts
|
|
54
|
+
* Subtracts one or more boolean operands, such as Opening volumes, from this cuboid.
|
|
40
55
|
*/
|
|
41
|
-
subtract(
|
|
56
|
+
subtract(operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
42
57
|
set outline(enable: boolean);
|
|
43
58
|
get outline(): boolean;
|
|
44
59
|
set fatOutlines(value: boolean);
|