opengeometry 2.0.13 → 2.0.15
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 +4 -4
- package/analytic-worker.js +90 -0
- package/index.d.ts +16 -1
- package/index.js +3096 -3551
- package/index.js.map +1 -1
- package/opengeometry/pkg/opengeometry.d.ts +383 -347
- package/opengeometry/pkg/opengeometry.js +793 -506
- package/opengeometry/pkg/opengeometry_bg.wasm +0 -0
- package/opengeometry/pkg/opengeometry_bg.wasm.d.ts +300 -276
- package/opengeometry_bg.wasm +0 -0
- package/opengeometry_bg.wasm.d.ts +300 -276
- package/package.json +3 -4
- package/src/examples/booleans.d.ts +3 -2
- package/src/examples/editor-modes.d.ts +4 -8
- package/src/examples/index.d.ts +1 -1
- package/src/examples/ribbon-from-offsets.d.ts +33 -0
- package/src/examples/shapes.d.ts +1 -1
- 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-regions.d.ts +20 -0
- package/src/operations/boolean.d.ts +9 -141
- package/src/operations/index.d.ts +3 -1
- package/src/operations/loft.d.ts +13 -0
- package/src/operations/offset-regions.d.ts +11 -12
- package/src/primitives/analytic-curve.d.ts +42 -0
- package/src/primitives/arc.d.ts +26 -55
- package/src/primitives/elliptical_arc.d.ts +29 -57
- 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 +304 -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/examples/wall-from-offsets.d.ts +0 -40
- package/src/operations/boolean-errors.d.ts +0 -90
- package/src/shapes/boolean-subtract.d.ts +0 -21
|
@@ -1,66 +1,38 @@
|
|
|
1
|
-
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
1
|
import * as THREE from "three";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
3
|
+
import { AnalyticCurve, type AnalyticCurveStats } from "./analytic-curve.js";
|
|
4
|
+
import type { AnalyticAccuracy } from "../shapes/analytic-solid.js";
|
|
6
5
|
export interface IEllipticalArcOptions {
|
|
6
|
+
ogid?: string;
|
|
7
|
+
center?: Vector3;
|
|
8
|
+
majorRadius?: number;
|
|
9
|
+
minorRadius?: number;
|
|
10
|
+
startAngle?: number;
|
|
11
|
+
sweepAngle?: number;
|
|
12
|
+
deflection?: number;
|
|
13
|
+
accuracy?: AnalyticAccuracy;
|
|
14
|
+
color?: THREE.ColorRepresentation;
|
|
15
|
+
}
|
|
16
|
+
export type EllipticalArcConfigUpdate = Partial<Omit<IEllipticalArcOptions, "ogid">>;
|
|
17
|
+
interface NormalizedEllipticalArcOptions {
|
|
7
18
|
ogid?: string;
|
|
8
19
|
center: Vector3;
|
|
9
|
-
|
|
10
|
-
|
|
20
|
+
majorRadius: number;
|
|
21
|
+
minorRadius: number;
|
|
11
22
|
startAngle: number;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
width?: number;
|
|
17
|
-
translation?: Vector3;
|
|
18
|
-
rotation?: Vector3;
|
|
19
|
-
scale?: Vector3;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Placement updates accepted by `EllipticalArc`.
|
|
23
|
-
*/
|
|
24
|
-
export interface EllipticalArcPlacementOptions {
|
|
25
|
-
translation?: Vector3;
|
|
26
|
-
rotation?: Vector3;
|
|
27
|
-
scale?: Vector3;
|
|
23
|
+
sweepAngle: number;
|
|
24
|
+
deflection: number;
|
|
25
|
+
accuracy?: AnalyticAccuracy;
|
|
26
|
+
color: THREE.ColorRepresentation;
|
|
28
27
|
}
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export type EllipticalArcConfigUpdate = Partial<Omit<IEllipticalArcOptions, "translation" | "rotation" | "scale">>;
|
|
33
|
-
/**
|
|
34
|
-
* Alias for `EllipticalArc` placement updates.
|
|
35
|
-
*/
|
|
36
|
-
export type EllipticalArcPlacementUpdate = EllipticalArcPlacementOptions;
|
|
37
|
-
/**
|
|
38
|
-
* EllipticalArc wrapper backed by the kernel OGEllipticalArc primitive.
|
|
39
|
-
*/
|
|
40
|
-
export declare class EllipticalArc extends THREE.Line {
|
|
41
|
-
ogid: string;
|
|
42
|
-
options: IEllipticalArcOptions;
|
|
43
|
-
private ellipticalArc;
|
|
44
|
-
private fatLine;
|
|
45
|
-
set color(color: number);
|
|
28
|
+
/** Authoritative elliptical edge with transient deflection tessellation. */
|
|
29
|
+
export declare class EllipticalArc extends AnalyticCurve {
|
|
30
|
+
options: Readonly<NormalizedEllipticalArcOptions>;
|
|
46
31
|
constructor(options?: IEllipticalArcOptions);
|
|
47
|
-
validateOptions(): void;
|
|
48
|
-
setConfig(options: EllipticalArcConfigUpdate): void;
|
|
49
32
|
getAnchor(): Vector3;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
setScale(scale: Vector3): void;
|
|
55
|
-
getConfig(): IEllipticalArcOptions;
|
|
56
|
-
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
57
|
-
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
58
|
-
canConvertToFreeform(): boolean;
|
|
59
|
-
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
60
|
-
private getCurrentPositions;
|
|
61
|
-
private updateRenderStyle;
|
|
62
|
-
private generateGeometry;
|
|
63
|
-
getBrep(): any;
|
|
64
|
-
discardGeometry(): void;
|
|
65
|
-
private writePositionsToGeometry;
|
|
33
|
+
getConfig(): Readonly<NormalizedEllipticalArcOptions>;
|
|
34
|
+
setConfig(update: EllipticalArcConfigUpdate): AnalyticCurveStats;
|
|
35
|
+
getBrep(): Record<string, unknown>;
|
|
36
|
+
retessellate(deflection: number): AnalyticCurveStats;
|
|
66
37
|
}
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import type { AnalyticSolid, AnalyticTessellationStats } from "../shapes/analytic-solid.js";
|
|
3
|
+
import { AnalyticTessellationWorker } from "./analytic-tessellation.js";
|
|
4
|
+
export declare function deflectionBucket(target: number, previous?: number): number;
|
|
5
|
+
export declare function worldUnitsPerPixel(camera: THREE.PerspectiveCamera | THREE.OrthographicCamera, depth: number, physicalHeight: number): number;
|
|
6
|
+
export interface AnalyticLodOptions {
|
|
7
|
+
fixedDeflection?: number;
|
|
8
|
+
onUpdate?: (solid: AnalyticSolid, statistics: AnalyticTessellationStats) => void;
|
|
9
|
+
onError?: (solid: AnalyticSolid, error: Error) => void;
|
|
10
|
+
}
|
|
11
|
+
/** Register authored changes explicitly; camera meshes never refresh a scene's authored BRep snapshots. */
|
|
12
|
+
export declare class AnalyticLodController {
|
|
13
|
+
private readonly worker;
|
|
14
|
+
private readonly options;
|
|
15
|
+
private readonly entries;
|
|
16
|
+
private readonly cameraState;
|
|
17
|
+
private lastMotion;
|
|
18
|
+
private lastSchedule;
|
|
19
|
+
private initialized;
|
|
20
|
+
private closed;
|
|
21
|
+
private refining;
|
|
22
|
+
private fixedDeflection?;
|
|
23
|
+
constructor(worker: AnalyticTessellationWorker, options?: AnalyticLodOptions);
|
|
24
|
+
setDeflection(deflection?: number): void;
|
|
25
|
+
register(solid: AnalyticSolid): Promise<void>;
|
|
26
|
+
unregister(solid: AnalyticSolid): Promise<void>;
|
|
27
|
+
update(camera: THREE.PerspectiveCamera | THREE.OrthographicCamera, physicalHeight: number, now?: number, motion?: boolean): void;
|
|
28
|
+
/** Explicit export refinement; a resource or precision failure rejects and retains each body's prior mesh. */
|
|
29
|
+
refine(deflection: number): Promise<void>;
|
|
30
|
+
dispose(): void;
|
|
31
|
+
}
|
|
32
|
+
export declare function uniformScale(matrix: THREE.Matrix4): number;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface AnalyticTessellationData {
|
|
2
|
+
positions: Float64Array;
|
|
3
|
+
normals: Float32Array;
|
|
4
|
+
indices: Uint32Array;
|
|
5
|
+
triangleFaceIds: Uint32Array;
|
|
6
|
+
outlinePositions: Float64Array;
|
|
7
|
+
outlineEdgeIds: Uint32Array;
|
|
8
|
+
revision: bigint;
|
|
9
|
+
achievedDeflection: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const GEOMETRY_DEFLECTION_SHARE = 0.75;
|
|
12
|
+
export interface AnalyticWorkerOptions {
|
|
13
|
+
workerURL: string | URL;
|
|
14
|
+
kernelURL: string | URL;
|
|
15
|
+
wasmURL: string | URL;
|
|
16
|
+
}
|
|
17
|
+
export declare class AnalyticTessellationWorker {
|
|
18
|
+
private readonly worker;
|
|
19
|
+
private readonly pending;
|
|
20
|
+
private readonly generations;
|
|
21
|
+
private readonly ready;
|
|
22
|
+
private serial;
|
|
23
|
+
private closed;
|
|
24
|
+
constructor(options: AnalyticWorkerOptions);
|
|
25
|
+
setModel(handle: string, serialized: string): Promise<void>;
|
|
26
|
+
tessellate(handle: string, deflection: number): Promise<AnalyticTessellationData>;
|
|
27
|
+
cancel(handle: string): number;
|
|
28
|
+
removeModel(handle: string): Promise<void>;
|
|
29
|
+
dispose(): void;
|
|
30
|
+
private send;
|
|
31
|
+
private fail;
|
|
32
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { AnalyticSolid } from "./analytic-solid.js";
|
|
3
|
+
export interface AnalyticPatternInstance {
|
|
4
|
+
id?: string;
|
|
5
|
+
matrix: THREE.Matrix4;
|
|
6
|
+
}
|
|
7
|
+
export interface AnalyticPatternHit {
|
|
8
|
+
pattern: AnalyticPattern;
|
|
9
|
+
instanceIndex: number;
|
|
10
|
+
instanceId: string;
|
|
11
|
+
source: AnalyticSolid;
|
|
12
|
+
faceId?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Renders many rigid placements of one authoritative analytic body. The source
|
|
16
|
+
* owns the BRep; instances own only identity and placement matrices.
|
|
17
|
+
*/
|
|
18
|
+
export declare class AnalyticPattern extends THREE.Group {
|
|
19
|
+
readonly source: AnalyticSolid;
|
|
20
|
+
readonly surface: THREE.InstancedMesh<THREE.BufferGeometry, THREE.Material>;
|
|
21
|
+
readonly instanceIds: readonly string[];
|
|
22
|
+
private disposed;
|
|
23
|
+
constructor(source: AnalyticSolid, instances: readonly AnalyticPatternInstance[]);
|
|
24
|
+
get count(): number;
|
|
25
|
+
setInstanceMatrix(index: number, matrix: THREE.Matrix4): void;
|
|
26
|
+
resolveIntersection(intersection: THREE.Intersection): AnalyticPatternHit | undefined;
|
|
27
|
+
dispose(): void;
|
|
28
|
+
private checkActive;
|
|
29
|
+
}
|
|
30
|
+
export declare function linearPattern(source: AnalyticSolid, count: number, spacing: THREE.Vector3): AnalyticPattern;
|
|
31
|
+
export declare function rectangularPattern(source: AnalyticSolid, counts: readonly [number, number], spacing: readonly [THREE.Vector3, THREE.Vector3]): AnalyticPattern;
|
|
32
|
+
export declare function circularPattern(source: AnalyticSolid, count: number, radius: number, options?: {
|
|
33
|
+
startAngle?: number;
|
|
34
|
+
sweepAngle?: number;
|
|
35
|
+
rotateInstances?: boolean;
|
|
36
|
+
}): AnalyticPattern;
|
|
@@ -0,0 +1,304 @@
|
|
|
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 AnalyticAnnularSectorOpening {
|
|
17
|
+
id: string;
|
|
18
|
+
angle: number;
|
|
19
|
+
width: number;
|
|
20
|
+
bottom: number;
|
|
21
|
+
height: number;
|
|
22
|
+
}
|
|
23
|
+
export type AnalyticProfileEdge = {
|
|
24
|
+
kind: "line";
|
|
25
|
+
from: [number, number];
|
|
26
|
+
to: [number, number];
|
|
27
|
+
} | {
|
|
28
|
+
kind: "arc";
|
|
29
|
+
center: [number, number];
|
|
30
|
+
radius: number;
|
|
31
|
+
startAngle: number;
|
|
32
|
+
sweepAngle: number;
|
|
33
|
+
};
|
|
34
|
+
export type AnalyticPolygonLoftAlignment = "auto" | {
|
|
35
|
+
upperStartIndex: number;
|
|
36
|
+
reverseUpper?: boolean;
|
|
37
|
+
};
|
|
38
|
+
export interface AnalyticProjectionCamera {
|
|
39
|
+
position: {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
z: number;
|
|
43
|
+
};
|
|
44
|
+
target: {
|
|
45
|
+
x: number;
|
|
46
|
+
y: number;
|
|
47
|
+
z: number;
|
|
48
|
+
};
|
|
49
|
+
up: {
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
z: number;
|
|
53
|
+
};
|
|
54
|
+
near: number;
|
|
55
|
+
projection_mode: "Orthographic" | "Perspective";
|
|
56
|
+
}
|
|
57
|
+
export interface AnalyticProjectionHlr {
|
|
58
|
+
hide_hidden_edges: boolean;
|
|
59
|
+
}
|
|
60
|
+
interface AnalyticOptions {
|
|
61
|
+
ogid?: string;
|
|
62
|
+
frame?: AnalyticFrame;
|
|
63
|
+
accuracy?: AnalyticAccuracy;
|
|
64
|
+
deflection?: number;
|
|
65
|
+
color?: THREE.ColorRepresentation;
|
|
66
|
+
}
|
|
67
|
+
export type AnalyticPrimitiveOptions = AnalyticOptions & ({
|
|
68
|
+
kind: "cuboid";
|
|
69
|
+
width: number;
|
|
70
|
+
depth: number;
|
|
71
|
+
height: number;
|
|
72
|
+
} | {
|
|
73
|
+
kind: "linearExtrusion";
|
|
74
|
+
outer: [number, number][];
|
|
75
|
+
holes: [number, number][][];
|
|
76
|
+
height: number;
|
|
77
|
+
} | {
|
|
78
|
+
kind: "arcEdgedExtrusion";
|
|
79
|
+
outer: AnalyticProfileEdge[];
|
|
80
|
+
holes?: AnalyticProfileEdge[][];
|
|
81
|
+
height: number;
|
|
82
|
+
} | {
|
|
83
|
+
kind: "polygonLoft";
|
|
84
|
+
lower: [number, number, number][];
|
|
85
|
+
upper: [number, number, number][];
|
|
86
|
+
alignment?: AnalyticPolygonLoftAlignment;
|
|
87
|
+
} | {
|
|
88
|
+
kind: "boxWithArchedOpening";
|
|
89
|
+
width: number;
|
|
90
|
+
depth: number;
|
|
91
|
+
height: number;
|
|
92
|
+
opening: {
|
|
93
|
+
id: string;
|
|
94
|
+
station: number;
|
|
95
|
+
width: number;
|
|
96
|
+
bottom: number;
|
|
97
|
+
height: number;
|
|
98
|
+
};
|
|
99
|
+
} | {
|
|
100
|
+
kind: "planarPolyhedron";
|
|
101
|
+
vertices: [number, number, number][];
|
|
102
|
+
faces: number[][];
|
|
103
|
+
} | {
|
|
104
|
+
kind: "cylinder" | "cone";
|
|
105
|
+
radius: number;
|
|
106
|
+
height: number;
|
|
107
|
+
} | {
|
|
108
|
+
kind: "cylinderSector";
|
|
109
|
+
radius: number;
|
|
110
|
+
height: number;
|
|
111
|
+
startAngle: number;
|
|
112
|
+
sweepAngle: number;
|
|
113
|
+
} | {
|
|
114
|
+
kind: "sphere";
|
|
115
|
+
radius: number;
|
|
116
|
+
} | {
|
|
117
|
+
kind: "frustum";
|
|
118
|
+
lowerRadius: number;
|
|
119
|
+
upperRadius: number;
|
|
120
|
+
height: number;
|
|
121
|
+
} | {
|
|
122
|
+
kind: "torus";
|
|
123
|
+
majorRadius: number;
|
|
124
|
+
minorRadius: number;
|
|
125
|
+
} | {
|
|
126
|
+
kind: "annularSectorExtrusion";
|
|
127
|
+
radius: number;
|
|
128
|
+
thickness: number;
|
|
129
|
+
height: number;
|
|
130
|
+
startAngle: number;
|
|
131
|
+
sweepAngle: number;
|
|
132
|
+
} | {
|
|
133
|
+
kind: "annularSectorExtrusionWithOpenings";
|
|
134
|
+
radius: number;
|
|
135
|
+
thickness: number;
|
|
136
|
+
height: number;
|
|
137
|
+
startAngle: number;
|
|
138
|
+
sweepAngle: number;
|
|
139
|
+
openings: AnalyticAnnularSectorOpening[];
|
|
140
|
+
} | {
|
|
141
|
+
kind: "annularSectorExtrusionWithArchedOpening";
|
|
142
|
+
radius: number;
|
|
143
|
+
thickness: number;
|
|
144
|
+
height: number;
|
|
145
|
+
startAngle: number;
|
|
146
|
+
sweepAngle: number;
|
|
147
|
+
opening: AnalyticAnnularSectorOpening;
|
|
148
|
+
} | {
|
|
149
|
+
kind: "coaxialCircleLoft";
|
|
150
|
+
lowerRadius: number;
|
|
151
|
+
upperRadius: number;
|
|
152
|
+
height: number;
|
|
153
|
+
} | {
|
|
154
|
+
kind: "revolvedRectangle";
|
|
155
|
+
innerRadius: number;
|
|
156
|
+
outerRadius: number;
|
|
157
|
+
height: number;
|
|
158
|
+
} | {
|
|
159
|
+
kind: "chamferedCuboid";
|
|
160
|
+
width: number;
|
|
161
|
+
depth: number;
|
|
162
|
+
height: number;
|
|
163
|
+
chamfer: number;
|
|
164
|
+
} | {
|
|
165
|
+
kind: "filletedCylinder";
|
|
166
|
+
radius: number;
|
|
167
|
+
height: number;
|
|
168
|
+
filletRadius: number;
|
|
169
|
+
});
|
|
170
|
+
export type AnalyticBooleanOp = "union" | "intersection" | "subtraction";
|
|
171
|
+
export type AnalyticPointClassification = "inside" | "outside" | "boundary" | "unknown";
|
|
172
|
+
export interface AnalyticBooleanReport {
|
|
173
|
+
operation: AnalyticBooleanOp;
|
|
174
|
+
quality: {
|
|
175
|
+
kind: "Analytic";
|
|
176
|
+
};
|
|
177
|
+
contacts: [number, number, number][];
|
|
178
|
+
coincident: boolean;
|
|
179
|
+
face_mappings: {
|
|
180
|
+
source: {
|
|
181
|
+
entity: string;
|
|
182
|
+
body: string;
|
|
183
|
+
key: string;
|
|
184
|
+
face: number;
|
|
185
|
+
};
|
|
186
|
+
result_faces: number[];
|
|
187
|
+
}[];
|
|
188
|
+
}
|
|
189
|
+
export interface AnalyticBrepOptions extends Omit<AnalyticOptions, "ogid" | "frame" | "accuracy"> {
|
|
190
|
+
kind: "brep";
|
|
191
|
+
serialized: string;
|
|
192
|
+
}
|
|
193
|
+
export interface AnalyticTessellationStats {
|
|
194
|
+
requestedDeflection: number;
|
|
195
|
+
achievedDeflection: number;
|
|
196
|
+
triangleCount: number;
|
|
197
|
+
faceCount: number;
|
|
198
|
+
revision: bigint;
|
|
199
|
+
}
|
|
200
|
+
export interface AnalyticTessellationOptions {
|
|
201
|
+
maxTriangles?: number;
|
|
202
|
+
}
|
|
203
|
+
export interface AnalyticStepExport {
|
|
204
|
+
text: string;
|
|
205
|
+
report: {
|
|
206
|
+
schema_version: 2;
|
|
207
|
+
revision: string;
|
|
208
|
+
length_unit: "metre" | "millimetre";
|
|
209
|
+
quality: {
|
|
210
|
+
kind: string;
|
|
211
|
+
};
|
|
212
|
+
faces: number;
|
|
213
|
+
edges: number;
|
|
214
|
+
solids: number;
|
|
215
|
+
cavity_shells: number;
|
|
216
|
+
collapsed_chart_uses: number;
|
|
217
|
+
geometric_tolerance: number;
|
|
218
|
+
exchange_error_bound: number;
|
|
219
|
+
validation_level: string;
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
export interface AnalyticStlExport {
|
|
223
|
+
bytes: Uint8Array;
|
|
224
|
+
report: {
|
|
225
|
+
schema_version: 2;
|
|
226
|
+
revision: string;
|
|
227
|
+
triangle_count: number;
|
|
228
|
+
requested_deflection: number;
|
|
229
|
+
achieved_deflection: number;
|
|
230
|
+
float32_encoding_error: number;
|
|
231
|
+
quality: "tessellated_from_analytic_brep";
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
export declare class AnalyticSolid extends THREE.Group {
|
|
235
|
+
readonly ogid: string;
|
|
236
|
+
readonly surface: THREE.Mesh<THREE.BufferGeometry, THREE.MeshStandardMaterial>;
|
|
237
|
+
readonly featureOutline: THREE.LineSegments<THREE.BufferGeometry, THREE.LineBasicMaterial>;
|
|
238
|
+
private kernel;
|
|
239
|
+
private triangleFaces;
|
|
240
|
+
private outlineEdges;
|
|
241
|
+
private disposed;
|
|
242
|
+
private lastDeflection;
|
|
243
|
+
private booleanReport?;
|
|
244
|
+
get report(): AnalyticBooleanReport | undefined;
|
|
245
|
+
get isDisposed(): boolean;
|
|
246
|
+
get modelRevision(): bigint;
|
|
247
|
+
get deflection(): number;
|
|
248
|
+
get color(): THREE.Color;
|
|
249
|
+
set color(value: THREE.ColorRepresentation);
|
|
250
|
+
get outline(): boolean;
|
|
251
|
+
set outline(value: boolean);
|
|
252
|
+
constructor(options: AnalyticPrimitiveOptions | AnalyticBrepOptions);
|
|
253
|
+
static fromBrep(serialized: string, options?: Omit<AnalyticBrepOptions, "kind" | "serialized">): AnalyticSolid;
|
|
254
|
+
boolean(other: AnalyticSolid, operation: AnalyticBooleanOp, options?: {
|
|
255
|
+
deflection?: number;
|
|
256
|
+
color?: THREE.ColorRepresentation;
|
|
257
|
+
}): AnalyticSolid;
|
|
258
|
+
union(other: AnalyticSolid, options?: {
|
|
259
|
+
deflection?: number;
|
|
260
|
+
color?: THREE.ColorRepresentation;
|
|
261
|
+
}): AnalyticSolid;
|
|
262
|
+
intersection(other: AnalyticSolid, options?: {
|
|
263
|
+
deflection?: number;
|
|
264
|
+
color?: THREE.ColorRepresentation;
|
|
265
|
+
}): AnalyticSolid;
|
|
266
|
+
subtract(cutters: AnalyticSolid[], options?: {
|
|
267
|
+
deflection?: number;
|
|
268
|
+
color?: THREE.ColorRepresentation;
|
|
269
|
+
}): AnalyticSolid;
|
|
270
|
+
shell(thickness: number, options?: {
|
|
271
|
+
deflection?: number;
|
|
272
|
+
color?: THREE.ColorRepresentation;
|
|
273
|
+
}): AnalyticSolid;
|
|
274
|
+
getBrepSerialized(): string;
|
|
275
|
+
getBrepData(): Record<string, unknown>;
|
|
276
|
+
/** Rebuilds authored analytic geometry while preserving the wrapper and placement. */
|
|
277
|
+
protected replaceDefinition(options: AnalyticPrimitiveOptions): AnalyticTessellationStats;
|
|
278
|
+
getWorldBrepSerialized(): string;
|
|
279
|
+
prepareIfcExchange(): AnalyticExchangeBodyV2;
|
|
280
|
+
exportIfc(): {
|
|
281
|
+
text: string;
|
|
282
|
+
report: AnalyticExchangeBodyV2;
|
|
283
|
+
};
|
|
284
|
+
/** Exports world placement and authored metre geometry, converted once to the selected STEP unit. */
|
|
285
|
+
exportStep(lengthUnit?: "metre" | "millimetre"): AnalyticStepExport;
|
|
286
|
+
/** Exports a binary STL tessellated from the placed analytic BRep at an explicit error budget. */
|
|
287
|
+
exportStl(deflection?: number): AnalyticStlExport;
|
|
288
|
+
faceIdForTriangle(triangle: number): number | undefined;
|
|
289
|
+
edgeIdForOutlineSegment(segment: number): number | undefined;
|
|
290
|
+
/** Evaluates the oriented support normal at a projected model-space point; this does not classify trim membership. */
|
|
291
|
+
normalAtFace(faceId: number, modelPoint: THREE.Vector3): THREE.Vector3;
|
|
292
|
+
/** Classifies a world-space point against the regularized material represented by this solid. */
|
|
293
|
+
classifyPoint(worldPoint: THREE.Vector3): AnalyticPointClassification;
|
|
294
|
+
projectTo2DLines(camera: AnalyticProjectionCamera, hlr: AnalyticProjectionHlr, deflection?: number): string;
|
|
295
|
+
getModelBounds(): THREE.Box3;
|
|
296
|
+
retessellate(deflection: number): AnalyticTessellationStats;
|
|
297
|
+
tessellate(deflection: number, options?: AnalyticTessellationOptions): AnalyticTessellationData;
|
|
298
|
+
/** Applies a transient worker mesh only when it still matches this authored model revision. */
|
|
299
|
+
applyTessellation(result: AnalyticTessellationData, deflection: number): AnalyticTessellationStats;
|
|
300
|
+
dispose(): void;
|
|
301
|
+
private checkActive;
|
|
302
|
+
private worldKernel;
|
|
303
|
+
}
|
|
304
|
+
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 {};
|