opengeometry 2.0.7 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -13
- package/index.js +575 -76
- package/index.js.map +1 -1
- package/opengeometry/pkg/opengeometry.d.ts +237 -201
- package/opengeometry/pkg/opengeometry.js +209 -42
- package/opengeometry/pkg/opengeometry_bg.wasm +0 -0
- package/opengeometry/pkg/opengeometry_bg.wasm.d.ts +206 -200
- package/opengeometry_bg.wasm +0 -0
- package/opengeometry_bg.wasm.d.ts +206 -200
- package/package.json +1 -1
- package/src/examples/wall-from-offsets.d.ts +30 -1
- package/src/operations/boolean-errors.d.ts +90 -0
- package/src/operations/boolean.d.ts +34 -3
- package/src/operations/index.d.ts +1 -0
|
@@ -10,6 +10,23 @@ export type BooleanOperand = string | Record<string, unknown> | {
|
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* Kernel-side boolean tuning options.
|
|
13
|
+
*
|
|
14
|
+
* `tolerance` is in **model units** (meters by convention). When omitted, the
|
|
15
|
+
* kernel auto-scales it to `operandsDiagonal * 1e-8` (clamped to a `1e-6`
|
|
16
|
+
* floor in many-subtract). This drives the kernel-side polygon / face math
|
|
17
|
+
* (vertex welding, plane coincidence, AABB enforcement).
|
|
18
|
+
*
|
|
19
|
+
* **NOTE: this tolerance does NOT control boolmesh's internal snap window.**
|
|
20
|
+
* Boolmesh has its own welding tolerance that may treat faces within ~1mm
|
|
21
|
+
* of each other as coincident, regardless of what `tolerance` you pass. If
|
|
22
|
+
* your cutter face sits within about 0.001 m – 0.01 m of a host face you
|
|
23
|
+
* may still hit a `DegenerateTriangle` / `CoincidentFaces` error path.
|
|
24
|
+
*
|
|
25
|
+
* **Recommended cutter overshoot for through-cuts:** `max(hostThickness *
|
|
26
|
+
* 0.05, 0.01)` in model units. See `knowledge/boolean-tolerance-guide.md`.
|
|
27
|
+
*
|
|
28
|
+
* `mergeCoplanarFaces` (default `true`) controls whether the planar pipeline
|
|
29
|
+
* merges coplanar adjacent faces in its output.
|
|
13
30
|
*/
|
|
14
31
|
export interface BooleanKernelOptions {
|
|
15
32
|
tolerance?: number;
|
|
@@ -17,9 +34,16 @@ export interface BooleanKernelOptions {
|
|
|
17
34
|
}
|
|
18
35
|
/**
|
|
19
36
|
* Rendering options applied to the boolean result mesh.
|
|
37
|
+
*
|
|
38
|
+
* `color`, `opacity`, `transparent`, and `side` override the corresponding
|
|
39
|
+
* fields on the host (LHS) operand's cloned material. Omit them to inherit
|
|
40
|
+
* the host's appearance unchanged.
|
|
20
41
|
*/
|
|
21
42
|
export interface BooleanRenderOptions {
|
|
22
|
-
color?:
|
|
43
|
+
color?: THREE.ColorRepresentation;
|
|
44
|
+
opacity?: number;
|
|
45
|
+
transparent?: boolean;
|
|
46
|
+
side?: THREE.Side;
|
|
23
47
|
outline?: boolean;
|
|
24
48
|
fatOutlines?: boolean;
|
|
25
49
|
outlineWidth?: number;
|
|
@@ -61,11 +85,18 @@ export declare class BooleanResult extends THREE.Mesh {
|
|
|
61
85
|
private _outlineEnabled;
|
|
62
86
|
private _fatOutlines;
|
|
63
87
|
private _outlineWidth;
|
|
64
|
-
constructor(kernelResult: KernelBooleanResult, options?: BooleanRenderOptions);
|
|
88
|
+
constructor(kernelResult: KernelBooleanResult, options?: BooleanRenderOptions, host?: BooleanOperand | null);
|
|
89
|
+
/**
|
|
90
|
+
* Updates the result mesh's color in place without re-running the boolean
|
|
91
|
+
* pipeline. Accepts any value Three.js accepts (`number`, hex string, css
|
|
92
|
+
* color name, or `THREE.Color`). No-op for materials without a `color` field.
|
|
93
|
+
*/
|
|
94
|
+
set color(value: THREE.ColorRepresentation);
|
|
95
|
+
get color(): THREE.Color | null;
|
|
65
96
|
/**
|
|
66
97
|
* Rebuilds the mesh, cached BRep payload, and outline geometry from the kernel output.
|
|
67
98
|
*/
|
|
68
|
-
applyKernelResult(kernelResult: KernelBooleanResult,
|
|
99
|
+
applyKernelResult(kernelResult: KernelBooleanResult, options?: BooleanRenderOptions, sourceMaterial?: THREE.Material | null): void;
|
|
69
100
|
/**
|
|
70
101
|
* Returns the parsed BRep object for reuse with scene export or downstream operations.
|
|
71
102
|
*/
|