opengeometry 2.0.11 → 2.0.14
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/analytic-worker.js +90 -0
- package/index.d.ts +16 -1
- package/index.js +3222 -3057
- package/index.js.map +1 -1
- package/opengeometry/pkg/opengeometry.d.ts +362 -224
- package/opengeometry/pkg/opengeometry.js +982 -298
- package/opengeometry/pkg/opengeometry_bg.wasm +0 -0
- package/opengeometry/pkg/opengeometry_bg.wasm.d.ts +251 -198
- package/opengeometry_bg.wasm +0 -0
- package/opengeometry_bg.wasm.d.ts +251 -198
- package/package.json +2 -1
- package/src/editor/types.d.ts +1 -1
- package/src/examples/booleans.d.ts +3 -2
- package/src/examples/editor-modes.d.ts +4 -8
- package/src/examples/index.d.ts +1 -0
- package/src/examples/offset-ring-variable.d.ts +13 -0
- package/src/examples/shapes.d.ts +1 -1
- package/src/examples/wall-from-offsets.d.ts +7 -14
- package/src/export/analytic-ifc.d.ts +61 -0
- package/src/freeform/geometry.d.ts +2 -0
- package/src/freeform/index.d.ts +1 -1
- package/src/operations/analytic-errors.d.ts +8 -0
- package/src/operations/boolean.d.ts +9 -141
- package/src/operations/index.d.ts +2 -4
- package/src/operations/loft.d.ts +13 -0
- package/src/operations/offset-regions.d.ts +36 -0
- package/src/primitives/analytic-curve.d.ts +42 -0
- package/src/primitives/arc.d.ts +26 -55
- package/src/primitives/elliptical_arc.d.ts +38 -0
- package/src/primitives/index.d.ts +1 -0
- package/src/rendering/analytic-lod.d.ts +32 -0
- package/src/rendering/analytic-tessellation.d.ts +32 -0
- package/src/shapes/analytic-pattern.d.ts +36 -0
- package/src/shapes/analytic-solid.d.ts +288 -0
- package/src/shapes/cuboid.d.ts +40 -54
- package/src/shapes/cylinder.d.ts +26 -70
- package/src/shapes/opening.d.ts +19 -82
- package/src/shapes/polygon.d.ts +4 -5
- package/src/shapes/solid.d.ts +0 -8
- package/src/shapes/sphere.d.ts +18 -73
- package/src/shapes/sweep.d.ts +0 -5
- package/src/shapes/wedge.d.ts +0 -5
- package/src/toolkit/index.d.ts +0 -4
- package/src/toolkit/wall.d.ts +0 -40
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { type AnalyticTessellationData } from "../rendering/analytic-tessellation.js";
|
|
3
|
+
import { AnalyticExchangeBodyV2 } from "../export/analytic-ifc.js";
|
|
4
|
+
export interface AnalyticFrame {
|
|
5
|
+
origin: [number, number, number];
|
|
6
|
+
x: [number, number, number];
|
|
7
|
+
y: [number, number, number];
|
|
8
|
+
z: [number, number, number];
|
|
9
|
+
}
|
|
10
|
+
export interface AnalyticAccuracy {
|
|
11
|
+
geometric: number;
|
|
12
|
+
intersection: number;
|
|
13
|
+
tessellation: number;
|
|
14
|
+
exchange: number;
|
|
15
|
+
}
|
|
16
|
+
export interface AnalyticCircularWallOpening {
|
|
17
|
+
id: string;
|
|
18
|
+
angle: number;
|
|
19
|
+
width: number;
|
|
20
|
+
bottom: number;
|
|
21
|
+
height: number;
|
|
22
|
+
}
|
|
23
|
+
export type AnalyticPolygonLoftAlignment = "auto" | {
|
|
24
|
+
upperStartIndex: number;
|
|
25
|
+
reverseUpper?: boolean;
|
|
26
|
+
};
|
|
27
|
+
export interface AnalyticProjectionCamera {
|
|
28
|
+
position: {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
z: number;
|
|
32
|
+
};
|
|
33
|
+
target: {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
z: number;
|
|
37
|
+
};
|
|
38
|
+
up: {
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
z: number;
|
|
42
|
+
};
|
|
43
|
+
near: number;
|
|
44
|
+
projection_mode: "Orthographic" | "Perspective";
|
|
45
|
+
}
|
|
46
|
+
export interface AnalyticProjectionHlr {
|
|
47
|
+
hide_hidden_edges: boolean;
|
|
48
|
+
}
|
|
49
|
+
interface AnalyticOptions {
|
|
50
|
+
ogid?: string;
|
|
51
|
+
frame?: AnalyticFrame;
|
|
52
|
+
accuracy?: AnalyticAccuracy;
|
|
53
|
+
deflection?: number;
|
|
54
|
+
color?: THREE.ColorRepresentation;
|
|
55
|
+
}
|
|
56
|
+
export type AnalyticPrimitiveOptions = AnalyticOptions & ({
|
|
57
|
+
kind: "cuboid";
|
|
58
|
+
width: number;
|
|
59
|
+
depth: number;
|
|
60
|
+
height: number;
|
|
61
|
+
} | {
|
|
62
|
+
kind: "linearExtrusion";
|
|
63
|
+
outer: [number, number][];
|
|
64
|
+
holes: [number, number][][];
|
|
65
|
+
height: number;
|
|
66
|
+
} | {
|
|
67
|
+
kind: "polygonLoft";
|
|
68
|
+
lower: [number, number, number][];
|
|
69
|
+
upper: [number, number, number][];
|
|
70
|
+
alignment?: AnalyticPolygonLoftAlignment;
|
|
71
|
+
} | {
|
|
72
|
+
kind: "straightWallWithArchedOpening";
|
|
73
|
+
width: number;
|
|
74
|
+
depth: number;
|
|
75
|
+
height: number;
|
|
76
|
+
opening: {
|
|
77
|
+
id: string;
|
|
78
|
+
station: number;
|
|
79
|
+
width: number;
|
|
80
|
+
bottom: number;
|
|
81
|
+
height: number;
|
|
82
|
+
};
|
|
83
|
+
} | {
|
|
84
|
+
kind: "planarPolyhedron";
|
|
85
|
+
vertices: [number, number, number][];
|
|
86
|
+
faces: number[][];
|
|
87
|
+
} | {
|
|
88
|
+
kind: "cylinder" | "cone";
|
|
89
|
+
radius: number;
|
|
90
|
+
height: number;
|
|
91
|
+
} | {
|
|
92
|
+
kind: "cylinderSector";
|
|
93
|
+
radius: number;
|
|
94
|
+
height: number;
|
|
95
|
+
startAngle: number;
|
|
96
|
+
sweepAngle: number;
|
|
97
|
+
} | {
|
|
98
|
+
kind: "sphere";
|
|
99
|
+
radius: number;
|
|
100
|
+
} | {
|
|
101
|
+
kind: "frustum";
|
|
102
|
+
lowerRadius: number;
|
|
103
|
+
upperRadius: number;
|
|
104
|
+
height: number;
|
|
105
|
+
} | {
|
|
106
|
+
kind: "torus";
|
|
107
|
+
majorRadius: number;
|
|
108
|
+
minorRadius: number;
|
|
109
|
+
} | {
|
|
110
|
+
kind: "circularWall";
|
|
111
|
+
radius: number;
|
|
112
|
+
thickness: number;
|
|
113
|
+
height: number;
|
|
114
|
+
startAngle: number;
|
|
115
|
+
sweepAngle: number;
|
|
116
|
+
} | {
|
|
117
|
+
kind: "circularWallWithOpenings";
|
|
118
|
+
radius: number;
|
|
119
|
+
thickness: number;
|
|
120
|
+
height: number;
|
|
121
|
+
startAngle: number;
|
|
122
|
+
sweepAngle: number;
|
|
123
|
+
openings: AnalyticCircularWallOpening[];
|
|
124
|
+
} | {
|
|
125
|
+
kind: "circularWallWithArchedOpening";
|
|
126
|
+
radius: number;
|
|
127
|
+
thickness: number;
|
|
128
|
+
height: number;
|
|
129
|
+
startAngle: number;
|
|
130
|
+
sweepAngle: number;
|
|
131
|
+
opening: AnalyticCircularWallOpening;
|
|
132
|
+
} | {
|
|
133
|
+
kind: "coaxialCircleLoft";
|
|
134
|
+
lowerRadius: number;
|
|
135
|
+
upperRadius: number;
|
|
136
|
+
height: number;
|
|
137
|
+
} | {
|
|
138
|
+
kind: "revolvedRectangle";
|
|
139
|
+
innerRadius: number;
|
|
140
|
+
outerRadius: number;
|
|
141
|
+
height: number;
|
|
142
|
+
} | {
|
|
143
|
+
kind: "chamferedCuboid";
|
|
144
|
+
width: number;
|
|
145
|
+
depth: number;
|
|
146
|
+
height: number;
|
|
147
|
+
chamfer: number;
|
|
148
|
+
} | {
|
|
149
|
+
kind: "filletedCylinder";
|
|
150
|
+
radius: number;
|
|
151
|
+
height: number;
|
|
152
|
+
filletRadius: number;
|
|
153
|
+
});
|
|
154
|
+
export type AnalyticBooleanOp = "union" | "intersection" | "subtraction";
|
|
155
|
+
export type AnalyticPointClassification = "inside" | "outside" | "boundary" | "unknown";
|
|
156
|
+
export interface AnalyticBooleanReport {
|
|
157
|
+
operation: AnalyticBooleanOp;
|
|
158
|
+
quality: {
|
|
159
|
+
kind: "Analytic";
|
|
160
|
+
};
|
|
161
|
+
contacts: [number, number, number][];
|
|
162
|
+
coincident: boolean;
|
|
163
|
+
face_mappings: {
|
|
164
|
+
source: {
|
|
165
|
+
entity: string;
|
|
166
|
+
body: string;
|
|
167
|
+
key: string;
|
|
168
|
+
face: number;
|
|
169
|
+
};
|
|
170
|
+
result_faces: number[];
|
|
171
|
+
}[];
|
|
172
|
+
}
|
|
173
|
+
export interface AnalyticBrepOptions extends Omit<AnalyticOptions, "ogid" | "frame" | "accuracy"> {
|
|
174
|
+
kind: "brep";
|
|
175
|
+
serialized: string;
|
|
176
|
+
}
|
|
177
|
+
export interface AnalyticTessellationStats {
|
|
178
|
+
requestedDeflection: number;
|
|
179
|
+
achievedDeflection: number;
|
|
180
|
+
triangleCount: number;
|
|
181
|
+
faceCount: number;
|
|
182
|
+
revision: bigint;
|
|
183
|
+
}
|
|
184
|
+
export interface AnalyticTessellationOptions {
|
|
185
|
+
maxTriangles?: number;
|
|
186
|
+
}
|
|
187
|
+
export interface AnalyticStepExport {
|
|
188
|
+
text: string;
|
|
189
|
+
report: {
|
|
190
|
+
schema_version: 2;
|
|
191
|
+
revision: string;
|
|
192
|
+
length_unit: "metre" | "millimetre";
|
|
193
|
+
quality: {
|
|
194
|
+
kind: string;
|
|
195
|
+
};
|
|
196
|
+
faces: number;
|
|
197
|
+
edges: number;
|
|
198
|
+
solids: number;
|
|
199
|
+
cavity_shells: number;
|
|
200
|
+
collapsed_chart_uses: number;
|
|
201
|
+
geometric_tolerance: number;
|
|
202
|
+
exchange_error_bound: number;
|
|
203
|
+
validation_level: string;
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
export interface AnalyticStlExport {
|
|
207
|
+
bytes: Uint8Array;
|
|
208
|
+
report: {
|
|
209
|
+
schema_version: 2;
|
|
210
|
+
revision: string;
|
|
211
|
+
triangle_count: number;
|
|
212
|
+
requested_deflection: number;
|
|
213
|
+
achieved_deflection: number;
|
|
214
|
+
float32_encoding_error: number;
|
|
215
|
+
quality: "tessellated_from_analytic_brep";
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
export declare class AnalyticSolid extends THREE.Group {
|
|
219
|
+
readonly ogid: string;
|
|
220
|
+
readonly surface: THREE.Mesh<THREE.BufferGeometry, THREE.MeshStandardMaterial>;
|
|
221
|
+
readonly featureOutline: THREE.LineSegments<THREE.BufferGeometry, THREE.LineBasicMaterial>;
|
|
222
|
+
private kernel;
|
|
223
|
+
private triangleFaces;
|
|
224
|
+
private outlineEdges;
|
|
225
|
+
private disposed;
|
|
226
|
+
private lastDeflection;
|
|
227
|
+
private booleanReport?;
|
|
228
|
+
get report(): AnalyticBooleanReport | undefined;
|
|
229
|
+
get isDisposed(): boolean;
|
|
230
|
+
get modelRevision(): bigint;
|
|
231
|
+
get deflection(): number;
|
|
232
|
+
get color(): THREE.Color;
|
|
233
|
+
set color(value: THREE.ColorRepresentation);
|
|
234
|
+
get outline(): boolean;
|
|
235
|
+
set outline(value: boolean);
|
|
236
|
+
constructor(options: AnalyticPrimitiveOptions | AnalyticBrepOptions);
|
|
237
|
+
static fromBrep(serialized: string, options?: Omit<AnalyticBrepOptions, "kind" | "serialized">): AnalyticSolid;
|
|
238
|
+
boolean(other: AnalyticSolid, operation: AnalyticBooleanOp, options?: {
|
|
239
|
+
deflection?: number;
|
|
240
|
+
color?: THREE.ColorRepresentation;
|
|
241
|
+
}): AnalyticSolid;
|
|
242
|
+
union(other: AnalyticSolid, options?: {
|
|
243
|
+
deflection?: number;
|
|
244
|
+
color?: THREE.ColorRepresentation;
|
|
245
|
+
}): AnalyticSolid;
|
|
246
|
+
intersection(other: AnalyticSolid, options?: {
|
|
247
|
+
deflection?: number;
|
|
248
|
+
color?: THREE.ColorRepresentation;
|
|
249
|
+
}): AnalyticSolid;
|
|
250
|
+
subtract(cutters: AnalyticSolid[], options?: {
|
|
251
|
+
deflection?: number;
|
|
252
|
+
color?: THREE.ColorRepresentation;
|
|
253
|
+
}): AnalyticSolid;
|
|
254
|
+
shell(thickness: number, options?: {
|
|
255
|
+
deflection?: number;
|
|
256
|
+
color?: THREE.ColorRepresentation;
|
|
257
|
+
}): AnalyticSolid;
|
|
258
|
+
getBrepSerialized(): string;
|
|
259
|
+
getBrepData(): Record<string, unknown>;
|
|
260
|
+
/** Rebuilds authored analytic geometry while preserving the wrapper and placement. */
|
|
261
|
+
protected replaceDefinition(options: AnalyticPrimitiveOptions): AnalyticTessellationStats;
|
|
262
|
+
getWorldBrepSerialized(): string;
|
|
263
|
+
prepareIfcExchange(): AnalyticExchangeBodyV2;
|
|
264
|
+
exportIfc(): {
|
|
265
|
+
text: string;
|
|
266
|
+
report: AnalyticExchangeBodyV2;
|
|
267
|
+
};
|
|
268
|
+
/** Exports world placement and authored metre geometry, converted once to the selected STEP unit. */
|
|
269
|
+
exportStep(lengthUnit?: "metre" | "millimetre"): AnalyticStepExport;
|
|
270
|
+
/** Exports a binary STL tessellated from the placed analytic BRep at an explicit error budget. */
|
|
271
|
+
exportStl(deflection?: number): AnalyticStlExport;
|
|
272
|
+
faceIdForTriangle(triangle: number): number | undefined;
|
|
273
|
+
edgeIdForOutlineSegment(segment: number): number | undefined;
|
|
274
|
+
/** Evaluates the oriented support normal at a projected model-space point; this does not classify trim membership. */
|
|
275
|
+
normalAtFace(faceId: number, modelPoint: THREE.Vector3): THREE.Vector3;
|
|
276
|
+
/** Classifies a world-space point against the regularized material represented by this solid. */
|
|
277
|
+
classifyPoint(worldPoint: THREE.Vector3): AnalyticPointClassification;
|
|
278
|
+
projectTo2DLines(camera: AnalyticProjectionCamera, hlr: AnalyticProjectionHlr, deflection?: number): string;
|
|
279
|
+
getModelBounds(): THREE.Box3;
|
|
280
|
+
retessellate(deflection: number): AnalyticTessellationStats;
|
|
281
|
+
tessellate(deflection: number, options?: AnalyticTessellationOptions): AnalyticTessellationData;
|
|
282
|
+
/** Applies a transient worker mesh only when it still matches this authored model revision. */
|
|
283
|
+
applyTessellation(result: AnalyticTessellationData, deflection: number): AnalyticTessellationStats;
|
|
284
|
+
dispose(): void;
|
|
285
|
+
private checkActive;
|
|
286
|
+
private worldKernel;
|
|
287
|
+
}
|
|
288
|
+
export {};
|
package/src/shapes/cuboid.d.ts
CHANGED
|
@@ -1,76 +1,62 @@
|
|
|
1
1
|
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
|
-
import {
|
|
4
|
-
import type { ShapeSubtractOperands, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
5
|
-
/**
|
|
6
|
-
* Placement updates accepted by `Cuboid`.
|
|
7
|
-
*/
|
|
3
|
+
import { AnalyticSolid, type AnalyticAccuracy } from "./analytic-solid.js";
|
|
8
4
|
export interface CuboidPlacementOptions {
|
|
9
5
|
translation?: Vector3;
|
|
10
6
|
rotation?: Vector3;
|
|
11
7
|
scale?: Vector3;
|
|
12
8
|
}
|
|
13
|
-
/**
|
|
14
|
-
* Construction options for a cuboid shape.
|
|
15
|
-
*/
|
|
16
9
|
export interface ICuboidOptions extends CuboidPlacementOptions {
|
|
10
|
+
ogid?: string;
|
|
11
|
+
center?: Vector3;
|
|
12
|
+
width?: number;
|
|
13
|
+
height?: number;
|
|
14
|
+
depth?: number;
|
|
15
|
+
color?: THREE.ColorRepresentation;
|
|
16
|
+
deflection?: number;
|
|
17
|
+
accuracy?: AnalyticAccuracy;
|
|
18
|
+
}
|
|
19
|
+
export type CuboidConfigUpdate = Partial<Omit<ICuboidOptions, "ogid" | "translation" | "rotation" | "scale">>;
|
|
20
|
+
export type CuboidPlacementUpdate = CuboidPlacementOptions;
|
|
21
|
+
interface NormalizedCuboidOptions {
|
|
17
22
|
ogid?: string;
|
|
18
23
|
center: Vector3;
|
|
19
24
|
width: number;
|
|
20
25
|
height: number;
|
|
21
26
|
depth: number;
|
|
22
|
-
color:
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
color: THREE.ColorRepresentation;
|
|
28
|
+
deflection: number;
|
|
29
|
+
accuracy?: AnalyticAccuracy;
|
|
30
|
+
translation: Vector3;
|
|
31
|
+
rotation: Vector3;
|
|
32
|
+
scale: Vector3;
|
|
25
33
|
}
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export type CuboidConfigUpdate = Partial<Omit<ICuboidOptions, "translation" | "rotation" | "scale">>;
|
|
30
|
-
/**
|
|
31
|
-
* Alias for `Cuboid` placement updates.
|
|
32
|
-
*/
|
|
33
|
-
export type CuboidPlacementUpdate = CuboidPlacementOptions;
|
|
34
|
-
/**
|
|
35
|
-
* Box-shaped solid wrapper backed by the kernel cuboid primitive.
|
|
36
|
-
*/
|
|
37
|
-
export declare class Cuboid extends THREE.Mesh {
|
|
38
|
-
#private;
|
|
39
|
-
ogid: string;
|
|
40
|
-
options: ICuboidOptions;
|
|
41
|
-
private cuboid;
|
|
42
|
-
private _outlineEnabled;
|
|
43
|
-
private _fatOutlines;
|
|
44
|
-
private _outlineWidth;
|
|
45
|
-
set width(value: number);
|
|
46
|
-
set color(color: number);
|
|
34
|
+
/** Authoritative six-plane BRep with transient tessellation. */
|
|
35
|
+
export declare class Cuboid extends AnalyticSolid {
|
|
36
|
+
options: NormalizedCuboidOptions;
|
|
47
37
|
constructor(options?: ICuboidOptions);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
set fatOutlines(value: boolean);
|
|
60
|
-
get fatOutlines(): boolean;
|
|
61
|
-
set outlineWidth(value: number);
|
|
62
|
-
get outlineWidth(): number;
|
|
63
|
-
get outlineMesh(): ShapeOutlineMesh | null;
|
|
64
|
-
getAnchor(): Vector3;
|
|
65
|
-
setPlacement(placement: CuboidPlacementUpdate): void;
|
|
38
|
+
set width(value: number);
|
|
39
|
+
get width(): number;
|
|
40
|
+
set height(value: number);
|
|
41
|
+
get height(): number;
|
|
42
|
+
set depth(value: number);
|
|
43
|
+
get depth(): number;
|
|
44
|
+
set color(value: THREE.ColorRepresentation);
|
|
45
|
+
get color(): THREE.Color;
|
|
46
|
+
setConfig(update: CuboidConfigUpdate): void;
|
|
47
|
+
getConfig(): Readonly<NormalizedCuboidOptions>;
|
|
48
|
+
setPlacement(update: CuboidPlacementUpdate): void;
|
|
66
49
|
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
67
50
|
setTranslation(translation: Vector3): void;
|
|
68
51
|
setRotation(rotation: Vector3): void;
|
|
69
52
|
setScale(scale: Vector3): void;
|
|
53
|
+
getPlacement(): Required<CuboidPlacementOptions>;
|
|
54
|
+
getAnchor(): Vector3;
|
|
70
55
|
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
71
|
-
canConvertToFreeform():
|
|
72
|
-
toFreeform(
|
|
73
|
-
|
|
56
|
+
canConvertToFreeform(): false;
|
|
57
|
+
toFreeform(): never;
|
|
58
|
+
cleanGeometry(): void;
|
|
74
59
|
discardGeometry(): void;
|
|
75
|
-
private
|
|
60
|
+
private applyPlacement;
|
|
76
61
|
}
|
|
62
|
+
export {};
|
package/src/shapes/cylinder.d.ts
CHANGED
|
@@ -1,80 +1,36 @@
|
|
|
1
1
|
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
|
-
import
|
|
4
|
-
/**
|
|
5
|
-
* Construction options for a cylinder shape.
|
|
6
|
-
*/
|
|
3
|
+
import { AnalyticSolid, type AnalyticAccuracy } from "./analytic-solid.js";
|
|
7
4
|
export interface ICylinderOptions {
|
|
5
|
+
ogid?: string;
|
|
6
|
+
center?: Vector3;
|
|
7
|
+
radius?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
startAngle?: number;
|
|
10
|
+
sweepAngle?: number;
|
|
11
|
+
deflection?: number;
|
|
12
|
+
accuracy?: AnalyticAccuracy;
|
|
13
|
+
color?: THREE.ColorRepresentation;
|
|
14
|
+
}
|
|
15
|
+
interface NormalizedCylinderOptions {
|
|
8
16
|
ogid?: string;
|
|
9
17
|
center: Vector3;
|
|
10
18
|
radius: number;
|
|
11
19
|
height: number;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
translation?: Vector3;
|
|
18
|
-
rotation?: Vector3;
|
|
19
|
-
scale?: Vector3;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Placement updates accepted by `Cylinder`.
|
|
23
|
-
*/
|
|
24
|
-
export interface CylinderPlacementOptions {
|
|
25
|
-
translation?: Vector3;
|
|
26
|
-
rotation?: Vector3;
|
|
27
|
-
scale?: Vector3;
|
|
20
|
+
startAngle: number;
|
|
21
|
+
sweepAngle: number;
|
|
22
|
+
deflection: number;
|
|
23
|
+
accuracy?: AnalyticAccuracy;
|
|
24
|
+
color: THREE.ColorRepresentation;
|
|
28
25
|
}
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export type CylinderConfigUpdate = Partial<Omit<ICylinderOptions, "translation" | "rotation" | "scale">>;
|
|
33
|
-
/**
|
|
34
|
-
* Alias for `Cylinder` placement updates.
|
|
35
|
-
*/
|
|
36
|
-
export type CylinderPlacementUpdate = CylinderPlacementOptions;
|
|
37
|
-
/**
|
|
38
|
-
* Cylinder wrapper backed by the kernel cylindrical primitive.
|
|
39
|
-
*/
|
|
40
|
-
export declare class Cylinder extends THREE.Mesh {
|
|
41
|
-
#private;
|
|
42
|
-
ogid: string;
|
|
43
|
-
options: ICylinderOptions;
|
|
44
|
-
private cylinder;
|
|
45
|
-
private _outlineEnabled;
|
|
46
|
-
private _fatOutlines;
|
|
47
|
-
private _outlineWidth;
|
|
48
|
-
set radius(value: number);
|
|
49
|
-
set color(color: number);
|
|
26
|
+
/** Authoritative Plane/Cylinder BRep with transient deflection tessellation. */
|
|
27
|
+
export declare class Cylinder extends AnalyticSolid {
|
|
28
|
+
readonly options: Readonly<NormalizedCylinderOptions>;
|
|
50
29
|
constructor(options?: ICylinderOptions);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
57
|
-
setTranslation(translation: Vector3): void;
|
|
58
|
-
setRotation(rotation: Vector3): void;
|
|
59
|
-
setScale(scale: Vector3): void;
|
|
60
|
-
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
61
|
-
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
62
|
-
canConvertToFreeform(): boolean;
|
|
63
|
-
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
64
|
-
cleanGeometry(): void;
|
|
65
|
-
generateGeometry(): void;
|
|
66
|
-
getBrep(): any;
|
|
67
|
-
/**
|
|
68
|
-
* Subtracts one or more boolean operands, such as Opening volumes, from this cylinder.
|
|
69
|
-
*/
|
|
70
|
-
subtract(operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
71
|
-
set outline(enable: boolean);
|
|
72
|
-
get outline(): boolean;
|
|
73
|
-
set fatOutlines(value: boolean);
|
|
74
|
-
get fatOutlines(): boolean;
|
|
75
|
-
set outlineWidth(value: number);
|
|
76
|
-
get outlineWidth(): number;
|
|
77
|
-
private clearOutlineMesh;
|
|
78
|
-
discardGeometry(): void;
|
|
79
|
-
private writePositionsToGeometry;
|
|
30
|
+
get radius(): number;
|
|
31
|
+
get height(): number;
|
|
32
|
+
get startAngle(): number;
|
|
33
|
+
get sweepAngle(): number;
|
|
34
|
+
getAnchor(): THREE.Vector3;
|
|
80
35
|
}
|
|
36
|
+
export {};
|
package/src/shapes/opening.d.ts
CHANGED
|
@@ -1,94 +1,31 @@
|
|
|
1
1
|
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
* Construction options for an architectural opening volume.
|
|
7
|
-
*/
|
|
8
|
-
export interface IOpeningOptions {
|
|
3
|
+
import { AnalyticSolid, type AnalyticAccuracy } from "./analytic-solid.js";
|
|
4
|
+
import { Cuboid, type CuboidConfigUpdate, type CuboidPlacementOptions } from "./cuboid.js";
|
|
5
|
+
export interface IOpeningOptions extends CuboidPlacementOptions {
|
|
9
6
|
ogid?: string;
|
|
10
|
-
center
|
|
11
|
-
width
|
|
12
|
-
height
|
|
13
|
-
depth
|
|
14
|
-
color
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
translation?: Vector3;
|
|
18
|
-
rotation?: Vector3;
|
|
19
|
-
scale?: Vector3;
|
|
7
|
+
center?: Vector3;
|
|
8
|
+
width?: number;
|
|
9
|
+
height?: number;
|
|
10
|
+
depth?: number;
|
|
11
|
+
color?: THREE.ColorRepresentation;
|
|
12
|
+
deflection?: number;
|
|
13
|
+
accuracy?: AnalyticAccuracy;
|
|
20
14
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*/
|
|
24
|
-
export interface OpeningPlacementOptions {
|
|
25
|
-
translation?: Vector3;
|
|
26
|
-
rotation?: Vector3;
|
|
27
|
-
scale?: Vector3;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Partial config payload accepted by `Opening.setConfig(...)`.
|
|
31
|
-
*/
|
|
32
|
-
export type OpeningConfigUpdate = Partial<Omit<IOpeningOptions, "translation" | "rotation" | "scale">>;
|
|
33
|
-
/**
|
|
34
|
-
* Alias for `Opening` placement updates.
|
|
35
|
-
*/
|
|
15
|
+
export type OpeningPlacementOptions = CuboidPlacementOptions;
|
|
16
|
+
export type OpeningConfigUpdate = CuboidConfigUpdate;
|
|
36
17
|
export type OpeningPlacementUpdate = OpeningPlacementOptions;
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
export declare class Opening extends THREE.Mesh {
|
|
41
|
-
#private;
|
|
42
|
-
ogid: string;
|
|
43
|
-
options: IOpeningOptions;
|
|
44
|
-
private opening;
|
|
45
|
-
private _outlineEnabled;
|
|
46
|
-
private _fatOutlines;
|
|
47
|
-
private _outlineWidth;
|
|
48
|
-
set width(value: number);
|
|
49
|
-
set height(value: number);
|
|
50
|
-
set depth(value: number);
|
|
18
|
+
/** Strict BRep v2 subtractive box. */
|
|
19
|
+
export declare class Opening extends Cuboid {
|
|
20
|
+
constructor(options?: IOpeningOptions);
|
|
51
21
|
get dimensions(): {
|
|
52
22
|
width: number;
|
|
53
23
|
height: number;
|
|
54
24
|
depth: number;
|
|
55
25
|
};
|
|
56
|
-
constructor(options?: IOpeningOptions);
|
|
57
|
-
validateOptions(): void;
|
|
58
|
-
setConfig(options: OpeningConfigUpdate): void;
|
|
59
|
-
getConfig(): IOpeningOptions;
|
|
60
|
-
getAnchor(): Vector3;
|
|
61
|
-
setPlacement(placement: OpeningPlacementUpdate): void;
|
|
62
|
-
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
63
|
-
setTranslation(translation: Vector3): void;
|
|
64
|
-
setRotation(rotation: Vector3): void;
|
|
65
|
-
setScale(scale: Vector3): void;
|
|
66
|
-
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
67
26
|
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
getBrepData(): any;
|
|
73
|
-
/**
|
|
74
|
-
* Subtracts one or more boolean operands from this opening volume.
|
|
75
|
-
*/
|
|
76
|
-
subtract(operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
77
|
-
/**
|
|
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.
|
|
82
|
-
*/
|
|
83
|
-
subtractFrom(host: ShapeSubtractOperand, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
84
|
-
set outline(enable: boolean);
|
|
85
|
-
get outline(): boolean;
|
|
86
|
-
set fatOutlines(value: boolean);
|
|
87
|
-
get fatOutlines(): boolean;
|
|
88
|
-
set outlineWidth(value: number);
|
|
89
|
-
get outlineWidth(): number;
|
|
90
|
-
get outlineMesh(): ShapeOutlineMesh | null;
|
|
91
|
-
private clearOutlineMesh;
|
|
92
|
-
discardGeometry(): void;
|
|
93
|
-
private writePositionsToGeometry;
|
|
27
|
+
subtractFrom(host: AnalyticSolid, options?: {
|
|
28
|
+
deflection?: number;
|
|
29
|
+
color?: THREE.ColorRepresentation;
|
|
30
|
+
}): AnalyticSolid;
|
|
94
31
|
}
|
package/src/shapes/polygon.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
2
|
import { OGPolygon, Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
3
3
|
import { Solid } from "./solid.js";
|
|
4
|
-
import
|
|
4
|
+
import { type PolygonLoftOptions } from "../operations/loft.js";
|
|
5
5
|
/**
|
|
6
6
|
* Construction options for a planar polygon.
|
|
7
7
|
*/
|
|
@@ -79,14 +79,13 @@ export declare class Polygon extends THREE.Mesh {
|
|
|
79
79
|
* starts from a planar profile and needs a boolean-ready solid.
|
|
80
80
|
*/
|
|
81
81
|
extrude(height: number): Solid;
|
|
82
|
+
/** Builds a capped analytic ruled loft from this profile to `other`. */
|
|
83
|
+
loftTo(other: Polygon, options?: PolygonLoftOptions): import("./analytic-solid.js").AnalyticSolid;
|
|
82
84
|
/**
|
|
83
85
|
* Returns the serialized BRep payload for this polygon.
|
|
84
86
|
*/
|
|
85
87
|
getBrepData(): string | null;
|
|
86
|
-
|
|
87
|
-
* Subtracts one or more boolean operands from this polygon.
|
|
88
|
-
*/
|
|
89
|
-
subtract(operands: ShapeSubtractOperands, options?: ShapeSubtractOptions): ShapeSubtractResult;
|
|
88
|
+
private worldProfilePoints;
|
|
90
89
|
set outlineColor(color: number);
|
|
91
90
|
get outlineColor(): number;
|
|
92
91
|
set outline(enable: boolean);
|
package/src/shapes/solid.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
|
2
2
|
import * as THREE from "three";
|
|
3
3
|
import { type FreeformGeometry } from "../freeform.js";
|
|
4
4
|
import type { FreeformSource } from "../freeform/types.js";
|
|
5
|
-
import type { ShapeSubtractOperands, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
6
5
|
/**
|
|
7
6
|
* Construction options for a generic BRep-backed solid.
|
|
8
7
|
*/
|
|
@@ -91,13 +90,6 @@ export declare class Solid extends THREE.Mesh {
|
|
|
91
90
|
* Returns the parsed world-space BRep object for this solid.
|
|
92
91
|
*/
|
|
93
92
|
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
93
|
/**
|
|
102
94
|
* Rebuilds the visible mesh and outline from the current freeform geometry.
|
|
103
95
|
*/
|