opengeometry 2.0.13 → 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 +3065 -3675
- package/index.js.map +1 -1
- package/opengeometry/pkg/opengeometry.d.ts +261 -236
- package/opengeometry/pkg/opengeometry.js +754 -538
- package/opengeometry/pkg/opengeometry_bg.wasm +0 -0
- package/opengeometry/pkg/opengeometry_bg.wasm.d.ts +211 -190
- package/opengeometry_bg.wasm +0 -0
- package/opengeometry_bg.wasm.d.ts +211 -190
- package/package.json +2 -1
- package/src/examples/booleans.d.ts +3 -2
- package/src/examples/editor-modes.d.ts +4 -8
- 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 -1
- package/src/operations/loft.d.ts +13 -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 +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 +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
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export type IfcPreparedValue = {
|
|
2
|
+
kind: "Ref";
|
|
3
|
+
id: number;
|
|
4
|
+
} | {
|
|
5
|
+
kind: "List";
|
|
6
|
+
values: IfcPreparedValue[];
|
|
7
|
+
} | {
|
|
8
|
+
kind: "Real";
|
|
9
|
+
value: number;
|
|
10
|
+
} | {
|
|
11
|
+
kind: "Integer";
|
|
12
|
+
value: number;
|
|
13
|
+
} | {
|
|
14
|
+
kind: "Text" | "Enum";
|
|
15
|
+
value: string;
|
|
16
|
+
} | {
|
|
17
|
+
kind: "Bool";
|
|
18
|
+
value: boolean;
|
|
19
|
+
} | {
|
|
20
|
+
kind: "Null" | "Derived";
|
|
21
|
+
};
|
|
22
|
+
export interface AnalyticExchangeBodyV2 {
|
|
23
|
+
schema_version: 2;
|
|
24
|
+
revision: string;
|
|
25
|
+
length_unit: "metre";
|
|
26
|
+
up_axis: "Z";
|
|
27
|
+
coordinate_space: "world";
|
|
28
|
+
representation_type: "AdvancedBrep" | "CSG";
|
|
29
|
+
quality: {
|
|
30
|
+
kind: "Analytic";
|
|
31
|
+
} | {
|
|
32
|
+
kind: "Approximate";
|
|
33
|
+
max_error: number;
|
|
34
|
+
};
|
|
35
|
+
geometric_tolerance: number;
|
|
36
|
+
exchange_error_bound: number;
|
|
37
|
+
validation_level: string;
|
|
38
|
+
entities: {
|
|
39
|
+
id: number;
|
|
40
|
+
entity_type: string;
|
|
41
|
+
attributes: IfcPreparedValue[];
|
|
42
|
+
}[];
|
|
43
|
+
solids: number[];
|
|
44
|
+
faces: {
|
|
45
|
+
face: number;
|
|
46
|
+
key: string;
|
|
47
|
+
entity: number;
|
|
48
|
+
provenance: {
|
|
49
|
+
sources: {
|
|
50
|
+
entity: string;
|
|
51
|
+
body: string;
|
|
52
|
+
key: string;
|
|
53
|
+
face: number;
|
|
54
|
+
}[];
|
|
55
|
+
role: "Authored" | "Preserved" | "Split" | "Cut" | "Coincident";
|
|
56
|
+
reversed: boolean;
|
|
57
|
+
};
|
|
58
|
+
}[];
|
|
59
|
+
}
|
|
60
|
+
/** Serializes Rust-prepared geometry; this function does not fit curves or tessellate surfaces. */
|
|
61
|
+
export declare function analyticIfcText(body: AnalyticExchangeBodyV2, name?: string): string;
|
|
@@ -78,3 +78,5 @@ export declare class FreeformGeometry {
|
|
|
78
78
|
* BRep object, or another wrapper exposing BRep accessors.
|
|
79
79
|
*/
|
|
80
80
|
export declare function createFreeformGeometry(source: FreeformSource, options?: CreateFreeformGeometryOptions): FreeformGeometry;
|
|
81
|
+
/** Triangulates an explicitly faceted BRep, including its planar face holes. */
|
|
82
|
+
export declare function tessellateFacetedBrep(serialized: string): Float64Array;
|
package/src/freeform/index.d.ts
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Freeform geometry types and helpers for working with raw BRep-backed models.
|
|
3
3
|
*/
|
|
4
4
|
export * from "./types.js";
|
|
5
|
-
export { FreeformGeometry, createFreeformGeometry } from "./geometry.js";
|
|
5
|
+
export { FreeformGeometry, createFreeformGeometry, tessellateFacetedBrep } from "./geometry.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type AnalyticGeometryErrorCode = "math" | "invalid_geometry" | "invalid_topology" | "unsupported_geometry" | "ambiguous_profile_alignment" | "coverage_gap" | "singular_parameterization" | "missing_reference" | "unsupported_schema" | "unresolved_intersection" | "unresolved_tessellation" | "limit_exceeded" | "unknown";
|
|
2
|
+
export declare class AnalyticGeometryError extends Error {
|
|
3
|
+
readonly code: AnalyticGeometryErrorCode;
|
|
4
|
+
readonly detail: unknown;
|
|
5
|
+
readonly families?: readonly [string, string];
|
|
6
|
+
constructor(code: AnalyticGeometryErrorCode, message: string, detail?: unknown);
|
|
7
|
+
}
|
|
8
|
+
export declare function parseAnalyticGeometryError(raw: unknown): AnalyticGeometryError;
|
|
@@ -1,148 +1,16 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
|
-
import {
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export type BooleanOperand = string | Record<string, unknown> | {
|
|
7
|
-
getBrep?: () => unknown;
|
|
8
|
-
getBrepData?: () => unknown;
|
|
9
|
-
getBrepSerialized?: () => string;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
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.
|
|
30
|
-
*/
|
|
31
|
-
export interface BooleanKernelOptions {
|
|
32
|
-
tolerance?: number;
|
|
33
|
-
mergeCoplanarFaces?: boolean;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
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.
|
|
41
|
-
*/
|
|
42
|
-
export interface BooleanRenderOptions {
|
|
2
|
+
import { AnalyticSolid } from "../shapes/analytic-solid.js";
|
|
3
|
+
/** Rendering and tessellation options applied to an analytic boolean result. */
|
|
4
|
+
export interface BooleanExecutionOptions {
|
|
5
|
+
deflection?: number;
|
|
43
6
|
color?: THREE.ColorRepresentation;
|
|
44
7
|
opacity?: number;
|
|
45
8
|
transparent?: boolean;
|
|
46
9
|
side?: THREE.Side;
|
|
47
10
|
outline?: boolean;
|
|
48
|
-
fatOutlines?: boolean;
|
|
49
|
-
outlineWidth?: number;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Combined kernel and rendering options accepted by boolean helpers.
|
|
53
|
-
*/
|
|
54
|
-
export interface BooleanExecutionOptions extends BooleanRenderOptions {
|
|
55
|
-
kernel?: BooleanKernelOptions;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Structured report returned by the kernel boolean pipeline.
|
|
59
|
-
*/
|
|
60
|
-
export interface BooleanReport {
|
|
61
|
-
operation: string;
|
|
62
|
-
operand_kind: string;
|
|
63
|
-
input_face_count: number;
|
|
64
|
-
input_triangle_count: number;
|
|
65
|
-
output_face_count: number;
|
|
66
|
-
output_shell_count: number;
|
|
67
|
-
empty: boolean;
|
|
68
|
-
}
|
|
69
|
-
interface KernelBooleanResult {
|
|
70
|
-
brepSerialized: string;
|
|
71
|
-
geometrySerialized: string;
|
|
72
|
-
outlineGeometrySerialized: string;
|
|
73
|
-
reportJson: string;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Renderable result mesh returned by the kernel boolean helpers.
|
|
77
|
-
*/
|
|
78
|
-
export declare class BooleanResult extends THREE.Mesh {
|
|
79
|
-
#private;
|
|
80
|
-
ogid: string;
|
|
81
|
-
report: BooleanReport | null;
|
|
82
|
-
private brepSerialized;
|
|
83
|
-
private brepData;
|
|
84
|
-
private outlinePositions;
|
|
85
|
-
private _outlineEnabled;
|
|
86
|
-
private _fatOutlines;
|
|
87
|
-
private _outlineWidth;
|
|
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;
|
|
96
|
-
/**
|
|
97
|
-
* Rebuilds the mesh, cached BRep payload, and outline geometry from the kernel output.
|
|
98
|
-
*/
|
|
99
|
-
applyKernelResult(kernelResult: KernelBooleanResult, options?: BooleanRenderOptions, sourceMaterial?: THREE.Material | null): void;
|
|
100
|
-
/**
|
|
101
|
-
* Returns the parsed BRep object for reuse with scene export or downstream operations.
|
|
102
|
-
*/
|
|
103
|
-
getBrepData(): Record<string, unknown> | null;
|
|
104
|
-
/**
|
|
105
|
-
* Returns the serialized BRep JSON emitted by the kernel boolean operation.
|
|
106
|
-
*/
|
|
107
|
-
getBrepSerialized(): string;
|
|
108
|
-
canConvertToFreeform(): boolean;
|
|
109
|
-
/**
|
|
110
|
-
* Converts the boolean output into a first-class freeform geometry object so
|
|
111
|
-
* it can participate in direct face/edge/vertex editing.
|
|
112
|
-
*/
|
|
113
|
-
toFreeform(options?: CreateFreeformGeometryOptions): FreeformGeometry;
|
|
114
|
-
set outline(enable: boolean);
|
|
115
|
-
get outline(): boolean;
|
|
116
|
-
set fatOutlines(value: boolean);
|
|
117
|
-
get fatOutlines(): boolean;
|
|
118
|
-
set outlineWidth(value: number);
|
|
119
|
-
get outlineWidth(): number;
|
|
120
|
-
disposeGeometry(): void;
|
|
121
|
-
private clearOutlineMesh;
|
|
122
11
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
*/
|
|
129
|
-
export declare function booleanUnion(lhs: BooleanOperand, rhs: BooleanOperand, options?: BooleanExecutionOptions): BooleanResult;
|
|
130
|
-
/**
|
|
131
|
-
* Computes a kernel-backed boolean intersection and returns a renderable result mesh.
|
|
132
|
-
*/
|
|
133
|
-
export declare function booleanIntersection(lhs: BooleanOperand, rhs: BooleanOperand, options?: BooleanExecutionOptions): BooleanResult;
|
|
134
|
-
/**
|
|
135
|
-
* Computes a kernel-backed boolean subtraction and returns a renderable result mesh.
|
|
136
|
-
*
|
|
137
|
-
* Use this when you want a standalone helper rather than a shape-level
|
|
138
|
-
* convenience method like `opening.subtractFrom(host)`.
|
|
139
|
-
*/
|
|
140
|
-
export declare function booleanSubtraction(lhs: BooleanOperand, rhs: BooleanOperand, options?: BooleanExecutionOptions): BooleanResult;
|
|
141
|
-
/**
|
|
142
|
-
* Computes a kernel-backed repeated subtraction using a left-to-right cutter array.
|
|
143
|
-
*
|
|
144
|
-
* This is used by the shape-level `.subtract([...])` helpers so the heavy
|
|
145
|
-
* boolean orchestration stays in the Rust/WASM layer instead of JavaScript.
|
|
146
|
-
*/
|
|
147
|
-
export declare function executeBooleanSubtractionMany(lhs: BooleanOperand, cutters: BooleanOperand[], options?: BooleanExecutionOptions): BooleanResult;
|
|
148
|
-
export {};
|
|
12
|
+
export type BooleanOperand = AnalyticSolid;
|
|
13
|
+
export declare function booleanUnion(lhs: AnalyticSolid, rhs: AnalyticSolid, options?: BooleanExecutionOptions): AnalyticSolid;
|
|
14
|
+
export declare function booleanIntersection(lhs: AnalyticSolid, rhs: AnalyticSolid, options?: BooleanExecutionOptions): AnalyticSolid;
|
|
15
|
+
export declare function booleanSubtraction(lhs: AnalyticSolid, rhs: AnalyticSolid, options?: BooleanExecutionOptions): AnalyticSolid;
|
|
16
|
+
export declare function executeBooleanSubtractionMany(lhs: BooleanOperand, cutters: BooleanOperand[], options?: BooleanExecutionOptions): AnalyticSolid;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Kernel-backed boolean helpers and renderable result mesh.
|
|
3
3
|
*/
|
|
4
4
|
export * from "./boolean.js";
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./analytic-errors.js";
|
|
6
6
|
export * from "./extrude.js";
|
|
7
|
+
export * from "./loft.js";
|
|
7
8
|
export * from "./offset-regions.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { AnalyticSolid, type AnalyticPolygonLoftAlignment } from "../shapes/analytic-solid.js";
|
|
3
|
+
export type PolygonLoftPoint = readonly [number, number, number];
|
|
4
|
+
export interface PolygonLoftOptions {
|
|
5
|
+
alignment?: AnalyticPolygonLoftAlignment;
|
|
6
|
+
deflection?: number;
|
|
7
|
+
color?: THREE.ColorRepresentation;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Creates a capped ruled solid between two planar polygon sections.
|
|
11
|
+
* Sections must have equal vertex counts and produce planar side faces.
|
|
12
|
+
*/
|
|
13
|
+
export declare function loftPolygonSections(sections: readonly [readonly PolygonLoftPoint[], readonly PolygonLoftPoint[]], options?: PolygonLoftOptions): AnalyticSolid;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { OGAnalyticBrep } from "../../opengeometry/pkg/opengeometry.js";
|
|
3
|
+
import type { AnalyticAccuracy, AnalyticFrame } from "../shapes/analytic-solid.js";
|
|
4
|
+
export type AnalyticCurveOptions = {
|
|
5
|
+
ogid?: string;
|
|
6
|
+
frame?: AnalyticFrame;
|
|
7
|
+
accuracy?: AnalyticAccuracy;
|
|
8
|
+
startAngle: number;
|
|
9
|
+
sweepAngle: number;
|
|
10
|
+
deflection?: number;
|
|
11
|
+
color?: THREE.ColorRepresentation;
|
|
12
|
+
} & ({
|
|
13
|
+
kind: "arc";
|
|
14
|
+
radius: number;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "ellipticalArc";
|
|
17
|
+
majorRadius: number;
|
|
18
|
+
minorRadius: number;
|
|
19
|
+
});
|
|
20
|
+
export interface AnalyticCurveStats {
|
|
21
|
+
requestedDeflection: number;
|
|
22
|
+
achievedDeflection: number;
|
|
23
|
+
segmentCount: number;
|
|
24
|
+
revision: bigint;
|
|
25
|
+
}
|
|
26
|
+
export declare class AnalyticCurve extends THREE.Group {
|
|
27
|
+
readonly ogid: string;
|
|
28
|
+
readonly line: THREE.LineSegments<THREE.BufferGeometry, THREE.LineBasicMaterial>;
|
|
29
|
+
protected kernel: OGAnalyticBrep;
|
|
30
|
+
private segmentEdges;
|
|
31
|
+
private disposed;
|
|
32
|
+
get color(): THREE.Color;
|
|
33
|
+
set color(value: THREE.ColorRepresentation);
|
|
34
|
+
constructor(options: AnalyticCurveOptions);
|
|
35
|
+
getBrepSerialized(): string;
|
|
36
|
+
getBrepData(): Record<string, unknown>;
|
|
37
|
+
protected replaceDefinition(options: AnalyticCurveOptions): AnalyticCurveStats;
|
|
38
|
+
edgeIdForSegment(segment: number): number | undefined;
|
|
39
|
+
retessellate(deflection: number): AnalyticCurveStats;
|
|
40
|
+
dispose(): void;
|
|
41
|
+
private checkActive;
|
|
42
|
+
}
|
package/src/primitives/arc.d.ts
CHANGED
|
@@ -1,65 +1,36 @@
|
|
|
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 IArcOptions {
|
|
6
|
+
ogid?: string;
|
|
7
|
+
center?: Vector3;
|
|
8
|
+
radius?: number;
|
|
9
|
+
startAngle?: number;
|
|
10
|
+
sweepAngle?: number;
|
|
11
|
+
deflection?: number;
|
|
12
|
+
accuracy?: AnalyticAccuracy;
|
|
13
|
+
color?: THREE.ColorRepresentation;
|
|
14
|
+
}
|
|
15
|
+
export type ArcConfigUpdate = Partial<Omit<IArcOptions, "ogid">>;
|
|
16
|
+
interface NormalizedArcOptions {
|
|
7
17
|
ogid?: string;
|
|
8
18
|
center: Vector3;
|
|
9
19
|
radius: number;
|
|
10
20
|
startAngle: number;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
width?: number;
|
|
16
|
-
translation?: Vector3;
|
|
17
|
-
rotation?: Vector3;
|
|
18
|
-
scale?: Vector3;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Placement updates accepted by `Arc`.
|
|
22
|
-
*/
|
|
23
|
-
export interface ArcPlacementOptions {
|
|
24
|
-
translation?: Vector3;
|
|
25
|
-
rotation?: Vector3;
|
|
26
|
-
scale?: Vector3;
|
|
21
|
+
sweepAngle: number;
|
|
22
|
+
deflection: number;
|
|
23
|
+
accuracy?: AnalyticAccuracy;
|
|
24
|
+
color: THREE.ColorRepresentation;
|
|
27
25
|
}
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export type ArcConfigUpdate = Partial<Omit<IArcOptions, "translation" | "rotation" | "scale">>;
|
|
32
|
-
/**
|
|
33
|
-
* Alias for `Arc` placement updates.
|
|
34
|
-
*/
|
|
35
|
-
export type ArcPlacementUpdate = ArcPlacementOptions;
|
|
36
|
-
/**
|
|
37
|
-
* Arc wrapper backed by the kernel OGArc primitive.
|
|
38
|
-
*/
|
|
39
|
-
export declare class Arc extends THREE.Line {
|
|
40
|
-
ogid: string;
|
|
41
|
-
options: IArcOptions;
|
|
42
|
-
private arc;
|
|
43
|
-
private fatLine;
|
|
44
|
-
set color(color: number);
|
|
26
|
+
/** Authoritative circular edge with transient deflection tessellation. */
|
|
27
|
+
export declare class Arc extends AnalyticCurve {
|
|
28
|
+
options: Readonly<NormalizedArcOptions>;
|
|
45
29
|
constructor(options?: IArcOptions);
|
|
46
|
-
validateOptions(): void;
|
|
47
|
-
setConfig(options: ArcConfigUpdate): void;
|
|
48
30
|
getAnchor(): Vector3;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
setScale(scale: Vector3): void;
|
|
54
|
-
getConfig(): IArcOptions;
|
|
55
|
-
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
56
|
-
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
57
|
-
canConvertToFreeform(): boolean;
|
|
58
|
-
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
59
|
-
private getCurrentPositions;
|
|
60
|
-
private updateRenderStyle;
|
|
61
|
-
private generateGeometry;
|
|
62
|
-
getBrep(): any;
|
|
63
|
-
discardGeometry(): void;
|
|
64
|
-
private writePositionsToGeometry;
|
|
31
|
+
getConfig(): Readonly<NormalizedArcOptions>;
|
|
32
|
+
setConfig(update: ArcConfigUpdate): AnalyticCurveStats;
|
|
33
|
+
getBrep(): Record<string, unknown>;
|
|
34
|
+
retessellate(deflection: number): AnalyticCurveStats;
|
|
65
35
|
}
|
|
36
|
+
export {};
|
|
@@ -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;
|