opengeometry 2.0.18 → 3.0.0
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/LICENSE.md +373 -0
- package/README.md +187 -128
- package/body-registry-MbAD6Hyq.js +3159 -0
- package/body-registry-MbAD6Hyq.js.map +1 -0
- package/index.d.ts +18 -115
- package/index.js +1170 -11758
- package/index.js.map +1 -1
- package/opengeometry/pkg/opengeometry.d.ts +144 -1304
- package/opengeometry/pkg/opengeometry.js +1316 -5806
- package/opengeometry/pkg/opengeometry_bg.wasm +0 -0
- package/opengeometry/pkg/opengeometry_bg.wasm.d.ts +62 -458
- package/opengeometry_bg.wasm +0 -0
- package/opengeometry_bg.wasm.d.ts +62 -458
- package/package.json +54 -34
- package/src/bodies/body-factory.d.ts +3 -0
- package/src/bodies/body-options.d.ts +19 -0
- package/src/bodies/body-placement.d.ts +10 -0
- package/src/bodies/body-registry.d.ts +3 -0
- package/src/bodies/body.d.ts +71 -0
- package/src/bodies/display-clone.d.ts +10 -0
- package/src/bodies/node-methods.d.ts +30 -0
- package/src/bodies/sheet.d.ts +14 -0
- package/src/bodies/solid.d.ts +23 -0
- package/src/bodies/system-assembly.d.ts +26 -0
- package/src/bodies/wire.d.ts +14 -0
- package/src/constants/index.d.ts +4 -0
- package/src/constants/operations.d.ts +58 -0
- package/src/constants/primitives.d.ts +69 -0
- package/src/constants/regions.d.ts +1 -0
- package/src/constants/transforms.d.ts +4 -0
- package/src/dto/boolean-report.d.ts +24 -0
- package/src/dto/bounds.d.ts +1 -0
- package/src/dto/brep.d.ts +99 -0
- package/src/dto/change-set.d.ts +13 -0
- package/src/dto/creation.d.ts +3 -0
- package/src/dto/display-buffers.d.ts +14 -0
- package/src/dto/events.d.ts +2 -0
- package/src/{export/analytic-ifc.d.ts → dto/ifc-body.d.ts} +16 -18
- package/src/dto/mark-stats.d.ts +4 -0
- package/src/dto/measure.d.ts +16 -0
- package/src/dto/mirror.d.ts +4 -0
- package/src/dto/node-info.d.ts +11 -0
- package/src/dto/pick-result.d.ts +6 -0
- package/src/dto/placement.d.ts +6 -0
- package/src/dto/primitives.d.ts +77 -0
- package/src/dto/regions.d.ts +42 -0
- package/src/dto/step-export.d.ts +42 -0
- package/src/errors.d.ts +20 -0
- package/src/export/export-step.d.ts +10 -0
- package/src/export/ifc-body.d.ts +4 -0
- package/src/kernel/kernel-errors.d.ts +5 -0
- package/src/kernel/kernel-loader.d.ts +5 -0
- package/src/kernel/kernel-session.d.ts +2 -0
- package/src/limits.d.ts +12 -0
- package/src/marks/limbo.d.ts +6 -0
- package/src/marks/og-mark.d.ts +10 -0
- package/src/marks/transaction.d.ts +3 -0
- package/src/opengeometry.d.ts +69 -0
- package/src/operations/offsets.d.ts +5 -0
- package/src/operations/regions.d.ts +4 -0
- package/src/picking/pick-targets.d.ts +6 -0
- package/src/picking/resolve-hit.d.ts +3 -0
- package/src/rendering/deferred.d.ts +7 -0
- package/src/rendering/geometry/geometry-scheduler.d.ts +12 -0
- package/src/rendering/geometry/host-group.d.ts +10 -0
- package/src/rendering/geometry/render-pass.d.ts +8 -0
- package/src/rendering/geometry/settle.d.ts +10 -0
- package/src/rendering/inline-backend.d.ts +14 -0
- package/src/rendering/lod/body-size.d.ts +11 -0
- package/src/rendering/lod/camera-observer.d.ts +2 -0
- package/src/rendering/lod/deflection.d.ts +2 -0
- package/src/rendering/lod/display-bounds.d.ts +4 -0
- package/src/rendering/lod/displayed.d.ts +7 -0
- package/src/rendering/lod/host-drawn.d.ts +5 -0
- package/src/rendering/lod/host-groups.d.ts +28 -0
- package/src/rendering/lod/lod-controller.d.ts +75 -0
- package/src/rendering/lod/screen-metrics.d.ts +2 -0
- package/src/rendering/materials/material-pool.d.ts +12 -0
- package/src/rendering/materials/ref-counted-pool.d.ts +12 -0
- package/src/rendering/provider.d.ts +19 -0
- package/src/rendering/records/geometry-record.d.ts +21 -0
- package/src/rendering/records/record-pool.d.ts +29 -0
- package/src/rendering/records/validate-display-buffers.d.ts +2 -0
- package/src/rendering/tessellation-worker.d.ts +1 -0
- package/src/rendering/worker/job-queue.d.ts +8 -0
- package/src/rendering/worker/message-guards.d.ts +9 -0
- package/src/rendering/worker/snapshot-cache.d.ts +10 -0
- package/src/rendering/worker-backend.d.ts +44 -0
- package/src/rendering/worker-protocol.d.ts +52 -0
- package/src/runtime/create-runtime.d.ts +7 -0
- package/src/runtime/event-bus.d.ts +3 -0
- package/src/runtime/reset.d.ts +1 -0
- package/src/runtime/runtime-state.d.ts +68 -0
- package/src/testing/internals.d.ts +18 -0
- package/src/world-graph/codec.d.ts +45 -0
- package/src/world-graph/world-graph-client.d.ts +13 -0
- package/tessellation-worker.js +634 -0
- package/tessellation-worker.js.map +1 -0
- package/testing.d.ts +1 -0
- package/testing.js +87 -0
- package/testing.js.map +1 -0
- package/analytic-worker.js +0 -90
- package/src/base-types.d.ts +0 -13
- package/src/editor/freeform.d.ts +0 -91
- package/src/editor/index.d.ts +0 -6
- package/src/editor/parametric.d.ts +0 -15
- package/src/editor/types.d.ts +0 -223
- package/src/examples/booleans.d.ts +0 -24
- package/src/examples/editor-modes.d.ts +0 -20
- package/src/examples/index.d.ts +0 -11
- package/src/examples/offset-ring-variable.d.ts +0 -13
- package/src/examples/offset.d.ts +0 -18
- package/src/examples/primitives.d.ts +0 -16
- package/src/examples/ribbon-from-offsets.d.ts +0 -33
- package/src/examples/shapes.d.ts +0 -20
- package/src/examples/sweep.d.ts +0 -9
- package/src/freeform/geometry.d.ts +0 -82
- package/src/freeform/index.d.ts +0 -5
- package/src/freeform/types.d.ts +0 -36
- package/src/markup/spotMarker.d.ts +0 -4
- package/src/operations/analytic-errors.d.ts +0 -8
- package/src/operations/boolean-regions.d.ts +0 -20
- package/src/operations/boolean.d.ts +0 -16
- package/src/operations/editor/freeform.d.ts +0 -1
- package/src/operations/editor/index.d.ts +0 -1
- package/src/operations/editor/parametric.d.ts +0 -1
- package/src/operations/editor/types.d.ts +0 -1
- package/src/operations/extrude.d.ts +0 -9
- package/src/operations/index.d.ts +0 -9
- package/src/operations/loft.d.ts +0 -13
- package/src/operations/offset-regions.d.ts +0 -76
- package/src/primitives/analytic-curve.d.ts +0 -42
- package/src/primitives/arc.d.ts +0 -36
- package/src/primitives/curve.d.ts +0 -64
- package/src/primitives/elliptical_arc.d.ts +0 -38
- package/src/primitives/index.d.ts +0 -9
- package/src/primitives/line.d.ts +0 -77
- package/src/primitives/polyline.d.ts +0 -78
- package/src/primitives/rectangle.d.ts +0 -72
- package/src/rendering/analytic-lod.d.ts +0 -32
- package/src/rendering/analytic-tessellation.d.ts +0 -32
- package/src/shapes/analytic-pattern.d.ts +0 -36
- package/src/shapes/analytic-solid.d.ts +0 -304
- package/src/shapes/cuboid.d.ts +0 -62
- package/src/shapes/cylinder.d.ts +0 -36
- package/src/shapes/index.d.ts +0 -11
- package/src/shapes/opening.d.ts +0 -31
- package/src/shapes/outline-utils.d.ts +0 -35
- package/src/shapes/polygon.d.ts +0 -102
- package/src/shapes/solid.d.ts +0 -108
- package/src/shapes/sphere.d.ts +0 -27
- package/src/shapes/sweep.d.ts +0 -76
- package/src/shapes/wedge.d.ts +0 -75
- package/src/utils/event.d.ts +0 -29
- package/src/utils/randomizer.d.ts +0 -1
- package/src/world/world-graph.d.ts +0 -112
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
export type IfcPreparedValue = {
|
|
2
|
-
kind:
|
|
2
|
+
kind: 'Ref';
|
|
3
3
|
id: number;
|
|
4
4
|
} | {
|
|
5
|
-
kind:
|
|
5
|
+
kind: 'List';
|
|
6
6
|
values: IfcPreparedValue[];
|
|
7
7
|
} | {
|
|
8
|
-
kind:
|
|
8
|
+
kind: 'Real';
|
|
9
9
|
value: number;
|
|
10
10
|
} | {
|
|
11
|
-
kind:
|
|
11
|
+
kind: 'Integer';
|
|
12
12
|
value: number;
|
|
13
13
|
} | {
|
|
14
|
-
kind:
|
|
14
|
+
kind: 'Text' | 'Enum';
|
|
15
15
|
value: string;
|
|
16
16
|
} | {
|
|
17
|
-
kind:
|
|
17
|
+
kind: 'Bool';
|
|
18
18
|
value: boolean;
|
|
19
19
|
} | {
|
|
20
|
-
kind:
|
|
20
|
+
kind: 'Null' | 'Derived';
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type AnalyticExchangeBodyV2 = {
|
|
23
23
|
schema_version: 2;
|
|
24
24
|
revision: string;
|
|
25
|
-
length_unit:
|
|
26
|
-
up_axis:
|
|
27
|
-
coordinate_space:
|
|
28
|
-
representation_type:
|
|
25
|
+
length_unit: 'metre';
|
|
26
|
+
up_axis: 'Z';
|
|
27
|
+
coordinate_space: 'world';
|
|
28
|
+
representation_type: 'AdvancedBrep' | 'CSG';
|
|
29
29
|
quality: {
|
|
30
|
-
kind:
|
|
30
|
+
kind: 'Analytic';
|
|
31
31
|
} | {
|
|
32
|
-
kind:
|
|
32
|
+
kind: 'Approximate';
|
|
33
33
|
max_error: number;
|
|
34
34
|
};
|
|
35
35
|
geometric_tolerance: number;
|
|
@@ -52,10 +52,8 @@ export interface AnalyticExchangeBodyV2 {
|
|
|
52
52
|
key: string;
|
|
53
53
|
face: number;
|
|
54
54
|
}[];
|
|
55
|
-
role:
|
|
55
|
+
role: 'Authored' | 'Preserved' | 'Split' | 'Cut' | 'Coincident';
|
|
56
56
|
reversed: boolean;
|
|
57
57
|
};
|
|
58
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;
|
|
59
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type Measure = {
|
|
2
|
+
volume: number;
|
|
3
|
+
area: number;
|
|
4
|
+
errorBound: number;
|
|
5
|
+
areaErrorBound: number;
|
|
6
|
+
deflection: number;
|
|
7
|
+
};
|
|
8
|
+
export type Validity = {
|
|
9
|
+
valid: boolean;
|
|
10
|
+
closed: boolean;
|
|
11
|
+
bodyType: 'Wire' | 'Sheet' | 'Solid' | null;
|
|
12
|
+
error?: {
|
|
13
|
+
code: string;
|
|
14
|
+
message: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export type ProfileArc = {
|
|
2
|
+
center: [number, number];
|
|
3
|
+
counterClockwise: boolean;
|
|
4
|
+
};
|
|
5
|
+
export type ProfileSegment = {
|
|
6
|
+
to: [number, number];
|
|
7
|
+
arc?: ProfileArc;
|
|
8
|
+
};
|
|
9
|
+
export type ProfileParams = {
|
|
10
|
+
start: [number, number];
|
|
11
|
+
segments: ProfileSegment[];
|
|
12
|
+
closed: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type ArcParams = {
|
|
15
|
+
radius: number;
|
|
16
|
+
startAngle: number;
|
|
17
|
+
sweepAngle: number;
|
|
18
|
+
};
|
|
19
|
+
export type CylinderSectorParams = {
|
|
20
|
+
radius: number;
|
|
21
|
+
height: number;
|
|
22
|
+
startAngle: number;
|
|
23
|
+
sweepAngle: number;
|
|
24
|
+
};
|
|
25
|
+
export type PolyhedronParams = {
|
|
26
|
+
points: [number, number, number][];
|
|
27
|
+
faces: number[][];
|
|
28
|
+
};
|
|
29
|
+
export type SphereParams = {
|
|
30
|
+
radius: number;
|
|
31
|
+
};
|
|
32
|
+
export type ConeParams = {
|
|
33
|
+
radiusBottom: number;
|
|
34
|
+
radiusTop: number;
|
|
35
|
+
height: number;
|
|
36
|
+
};
|
|
37
|
+
export type TorusParams = {
|
|
38
|
+
majorRadius: number;
|
|
39
|
+
minorRadius: number;
|
|
40
|
+
};
|
|
41
|
+
export type SlotPrismParams = {
|
|
42
|
+
length: number;
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
};
|
|
46
|
+
export type RoundedBoxParams = {
|
|
47
|
+
width: number;
|
|
48
|
+
height: number;
|
|
49
|
+
depth: number;
|
|
50
|
+
radius: number;
|
|
51
|
+
};
|
|
52
|
+
export type PipeSegmentParams = {
|
|
53
|
+
outerRadius: number;
|
|
54
|
+
innerRadius: number;
|
|
55
|
+
height: number;
|
|
56
|
+
startAngle: number;
|
|
57
|
+
sweepAngle: number;
|
|
58
|
+
};
|
|
59
|
+
export type PolysolidParams = {
|
|
60
|
+
path: ProfileParams;
|
|
61
|
+
width: number;
|
|
62
|
+
height: number;
|
|
63
|
+
justify?: 'centre' | 'left' | 'right';
|
|
64
|
+
};
|
|
65
|
+
export type RegularPolygonParams = {
|
|
66
|
+
sides: number;
|
|
67
|
+
radius: number;
|
|
68
|
+
};
|
|
69
|
+
export type SlotParams = {
|
|
70
|
+
length: number;
|
|
71
|
+
width: number;
|
|
72
|
+
};
|
|
73
|
+
export type RoundedRectangleParams = {
|
|
74
|
+
width: number;
|
|
75
|
+
breadth: number;
|
|
76
|
+
radius: number;
|
|
77
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export type OffsetRegion = {
|
|
2
|
+
outer: {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
z: number;
|
|
6
|
+
}[];
|
|
7
|
+
holes: {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
z: number;
|
|
11
|
+
}[][];
|
|
12
|
+
};
|
|
13
|
+
export type CurvedRegionEdge = {
|
|
14
|
+
kind: 'line';
|
|
15
|
+
from: [number, number];
|
|
16
|
+
to: [number, number];
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'arc';
|
|
19
|
+
center: [number, number];
|
|
20
|
+
radius: number;
|
|
21
|
+
start_angle: number;
|
|
22
|
+
sweep_angle: number;
|
|
23
|
+
};
|
|
24
|
+
export type CurvedRegion2D = {
|
|
25
|
+
outer: CurvedRegionEdge[];
|
|
26
|
+
holes: CurvedRegionEdge[][];
|
|
27
|
+
};
|
|
28
|
+
export type RegionOperation = 'union' | 'intersection' | 'subtraction';
|
|
29
|
+
export type OffsetHole = {
|
|
30
|
+
ring: readonly number[] | Float64Array;
|
|
31
|
+
distances: readonly number[] | Float64Array;
|
|
32
|
+
};
|
|
33
|
+
export type OffsetPolylineOptions = {
|
|
34
|
+
acuteThresholdDegrees?: number;
|
|
35
|
+
bevel?: boolean;
|
|
36
|
+
closed?: boolean;
|
|
37
|
+
};
|
|
38
|
+
export type OffsetPath2D = {
|
|
39
|
+
edges: CurvedRegionEdge[];
|
|
40
|
+
bevelled: number[];
|
|
41
|
+
closed: boolean;
|
|
42
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export type StepBodyReport = {
|
|
2
|
+
ogId: string;
|
|
3
|
+
shapeId: string;
|
|
4
|
+
shapeRevision: number;
|
|
5
|
+
solids: number;
|
|
6
|
+
faces: number;
|
|
7
|
+
edges: number;
|
|
8
|
+
cavityShells: number;
|
|
9
|
+
collapsedChartUses: number;
|
|
10
|
+
fittedCurves: number;
|
|
11
|
+
pcurvelessEdges: number;
|
|
12
|
+
exchangeErrorBound: number;
|
|
13
|
+
geometricTolerance: number;
|
|
14
|
+
};
|
|
15
|
+
export type StepSkipped = {
|
|
16
|
+
ogId: string;
|
|
17
|
+
reason: string;
|
|
18
|
+
};
|
|
19
|
+
export type StepExportReport = {
|
|
20
|
+
unit: string;
|
|
21
|
+
upAxis: string;
|
|
22
|
+
timestamp: string;
|
|
23
|
+
products: number;
|
|
24
|
+
solids: number;
|
|
25
|
+
faces: number;
|
|
26
|
+
edges: number;
|
|
27
|
+
cavityShells: number;
|
|
28
|
+
collapsedChartUses: number;
|
|
29
|
+
fittedCurves: number;
|
|
30
|
+
pcurvelessEdges: number;
|
|
31
|
+
entities: number;
|
|
32
|
+
bytes: number;
|
|
33
|
+
exchangeErrorBound: number;
|
|
34
|
+
geometricTolerance: number;
|
|
35
|
+
validationLevel: string;
|
|
36
|
+
bodies: StepBodyReport[];
|
|
37
|
+
skipped: StepSkipped[];
|
|
38
|
+
};
|
|
39
|
+
export type StepExport = {
|
|
40
|
+
text: string;
|
|
41
|
+
report: StepExportReport;
|
|
42
|
+
};
|
package/src/errors.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { OperateErrorDetails } from './dto/boolean-report.js';
|
|
2
|
+
export type ErrorDetails = Partial<OperateErrorDetails> & Record<string, unknown>;
|
|
3
|
+
export declare class OGError extends Error {
|
|
4
|
+
readonly code: string;
|
|
5
|
+
readonly call: string;
|
|
6
|
+
readonly details: ErrorDetails;
|
|
7
|
+
constructor(code: string, call: string, message: string, details?: unknown);
|
|
8
|
+
toJSON(): {
|
|
9
|
+
code: string;
|
|
10
|
+
call: string;
|
|
11
|
+
message: string;
|
|
12
|
+
details: unknown;
|
|
13
|
+
};
|
|
14
|
+
static fromJSON(value: {
|
|
15
|
+
code: string;
|
|
16
|
+
call: string;
|
|
17
|
+
message: string;
|
|
18
|
+
details?: unknown;
|
|
19
|
+
}): OGError;
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Body } from '../bodies/body.js';
|
|
2
|
+
import { SystemAssembly } from '../bodies/system-assembly.js';
|
|
3
|
+
import type { StepExport } from '../dto/step-export.js';
|
|
4
|
+
export declare function exportStep(options: {
|
|
5
|
+
nodes: (Body | SystemAssembly | string)[];
|
|
6
|
+
unit?: 'metre' | 'millimetre';
|
|
7
|
+
upAxis?: 'Y' | 'Z';
|
|
8
|
+
name?: string;
|
|
9
|
+
timestamp?: string;
|
|
10
|
+
}): Promise<StepExport>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import initializeKernel, { initSync, OGTessellator, OGWorldGraph, type InitOutput } from '../../opengeometry/pkg/opengeometry.js';
|
|
2
|
+
export { initializeKernel, initSync, OGTessellator, OGWorldGraph };
|
|
3
|
+
export declare function compileKernel(wasmURL: string | URL): Promise<WebAssembly.Module>;
|
|
4
|
+
export declare function initKernel(module: WebAssembly.Module): Promise<InitOutput>;
|
|
5
|
+
export declare function takePanicMessage(): string | undefined;
|
package/src/limits.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const ACCURACY: {
|
|
2
|
+
readonly geometric: 1e-8;
|
|
3
|
+
readonly intersection: 1e-9;
|
|
4
|
+
readonly tessellation: 0.01;
|
|
5
|
+
readonly exchange: 0.000001;
|
|
6
|
+
};
|
|
7
|
+
export declare const MAX_TRIANGLES: 2000000;
|
|
8
|
+
export declare const HYSTERESIS_KEEP: readonly [0.75, 4];
|
|
9
|
+
export declare const PIXELS_AT_REST: 0.5;
|
|
10
|
+
export declare const PIXELS_MOVING: 2;
|
|
11
|
+
export declare const EVALUATION_INTERVAL_MS: 100;
|
|
12
|
+
export declare const MOTION_WINDOW_MS: 150;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Body } from '../bodies/body.js';
|
|
2
|
+
import { type Runtime } from '../runtime/runtime-state.js';
|
|
3
|
+
export declare function enterLimbo(body: Body): void;
|
|
4
|
+
export declare function finalizeSettled(state: Runtime): void;
|
|
5
|
+
export declare function revive(body: Body): void;
|
|
6
|
+
export declare function finalizeNow(body: Body): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MarkStats } from '../dto/mark-stats.js';
|
|
2
|
+
export declare class OGMark {
|
|
3
|
+
private slot;
|
|
4
|
+
constructor(slot: number);
|
|
5
|
+
private get active();
|
|
6
|
+
rollback(): void;
|
|
7
|
+
release(): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function createMark(): OGMark;
|
|
10
|
+
export declare function markStats(): MarkStats;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type * as THREE from 'three';
|
|
2
|
+
import type { Body } from './bodies/body.js';
|
|
3
|
+
import type { SystemAssembly } from './bodies/system-assembly.js';
|
|
4
|
+
import type { Events, Listener } from './dto/events.js';
|
|
5
|
+
import type { AnalyticExchangeBodyV2 } from './dto/ifc-body.js';
|
|
6
|
+
import type { MarkStats } from './dto/mark-stats.js';
|
|
7
|
+
import type { CurvedRegion2D, OffsetHole, OffsetPath2D, OffsetPolylineOptions, OffsetRegion, RegionOperation } from './dto/regions.js';
|
|
8
|
+
import type { StepExport } from './dto/step-export.js';
|
|
9
|
+
import { type OGMark } from './marks/og-mark.js';
|
|
10
|
+
import { HostGroup } from './rendering/geometry/host-group.js';
|
|
11
|
+
export declare class OpenGeometry {
|
|
12
|
+
static create(input?: {
|
|
13
|
+
wasmURL?: string | URL;
|
|
14
|
+
wasmModule?: WebAssembly.Module;
|
|
15
|
+
}, options?: {
|
|
16
|
+
workerURL?: string | URL;
|
|
17
|
+
tessellation?: 'worker' | 'inline';
|
|
18
|
+
}): Promise<typeof OpenGeometry>;
|
|
19
|
+
static on(event: Events, handler: Listener): () => boolean;
|
|
20
|
+
static flush(options?: {
|
|
21
|
+
geometry?: 'sync';
|
|
22
|
+
bodies?: readonly Body[];
|
|
23
|
+
}): void;
|
|
24
|
+
static markDisplayed(bodies: readonly Body[]): void;
|
|
25
|
+
static setHostDrawn(bodies: readonly Body[], hostDrawn: boolean): void;
|
|
26
|
+
static hostGroup(bodies: readonly Body[]): HostGroup;
|
|
27
|
+
static settled(options?: {
|
|
28
|
+
deflection?: number;
|
|
29
|
+
}): Promise<{
|
|
30
|
+
failed: {
|
|
31
|
+
ogId: string;
|
|
32
|
+
error: unknown;
|
|
33
|
+
}[];
|
|
34
|
+
}>;
|
|
35
|
+
static setDisplayDeflection(world?: number): void;
|
|
36
|
+
static releaseIdleGeometry(): {
|
|
37
|
+
records: number;
|
|
38
|
+
bytes: number;
|
|
39
|
+
};
|
|
40
|
+
static setCameraMotion(moving: boolean): void;
|
|
41
|
+
static observeCamera(renderer: THREE.WebGLRenderer, camera: THREE.Camera): void;
|
|
42
|
+
static resolveHit(hit: THREE.Intersection): {
|
|
43
|
+
ogId: string;
|
|
44
|
+
shapeRevision: number;
|
|
45
|
+
faceId?: number;
|
|
46
|
+
edgeId?: number;
|
|
47
|
+
} | undefined;
|
|
48
|
+
static exportStep(options: {
|
|
49
|
+
nodes: (Body | SystemAssembly | string)[];
|
|
50
|
+
unit?: 'metre' | 'millimetre';
|
|
51
|
+
upAxis?: 'Y' | 'Z';
|
|
52
|
+
name?: string;
|
|
53
|
+
timestamp?: string;
|
|
54
|
+
}): Promise<StepExport>;
|
|
55
|
+
static exportIfcBody(node: Body | SystemAssembly): AnalyticExchangeBodyV2;
|
|
56
|
+
static booleanRegions2D(a: readonly OffsetRegion[], b: readonly OffsetRegion[], operation: RegionOperation): OffsetRegion[];
|
|
57
|
+
static booleanCurvedRegions2D(a: readonly CurvedRegion2D[], b: readonly CurvedRegion2D[], operation: RegionOperation): CurvedRegion2D[];
|
|
58
|
+
static insetCurvedRegion2D(region: CurvedRegion2D, distance: number): CurvedRegion2D[];
|
|
59
|
+
static offsetRingVariable(ring: readonly number[] | Float64Array, distances: readonly number[] | Float64Array, holes?: readonly OffsetHole[]): CurvedRegion2D[];
|
|
60
|
+
static offsetCurvedRingVariable(region: CurvedRegion2D, distances: readonly number[] | Float64Array, holeDistances?: readonly (readonly number[] | Float64Array)[]): CurvedRegion2D[];
|
|
61
|
+
static offsetPolylineRegions(path: readonly number[] | Float64Array, width: number, closed: boolean, miterLimit?: number): CurvedRegion2D[];
|
|
62
|
+
static offsetPolyline(path: readonly number[] | Float64Array, distance: number, options?: OffsetPolylineOptions): OffsetPath2D;
|
|
63
|
+
static mark(): OGMark;
|
|
64
|
+
static markStats(): MarkStats;
|
|
65
|
+
static transaction<T>(fn: () => T, options?: {
|
|
66
|
+
dryRun?: boolean;
|
|
67
|
+
}): T;
|
|
68
|
+
static reset(): void;
|
|
69
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CurvedRegion2D, OffsetHole, OffsetPath2D, OffsetPolylineOptions } from '../dto/regions.js';
|
|
2
|
+
export declare function offsetRingVariable(ring: readonly number[] | Float64Array, distances: readonly number[] | Float64Array, holes?: readonly OffsetHole[]): CurvedRegion2D[];
|
|
3
|
+
export declare function offsetCurvedRingVariable(region: CurvedRegion2D, distances: readonly number[] | Float64Array, holeDistances?: readonly (readonly number[] | Float64Array)[]): CurvedRegion2D[];
|
|
4
|
+
export declare function offsetPolylineRegions(path: readonly number[] | Float64Array, width: number, closed: boolean, miterLimit?: number): CurvedRegion2D[];
|
|
5
|
+
export declare function offsetPolyline(path: readonly number[] | Float64Array, distance: number, options?: OffsetPolylineOptions): OffsetPath2D;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CurvedRegion2D, OffsetRegion, RegionOperation } from '../dto/regions.js';
|
|
2
|
+
export declare function booleanRegions2D(a: readonly OffsetRegion[], b: readonly OffsetRegion[], operation: RegionOperation): OffsetRegion[];
|
|
3
|
+
export declare function booleanCurvedRegions2D(a: readonly CurvedRegion2D[], b: readonly CurvedRegion2D[], operation: RegionOperation): CurvedRegion2D[];
|
|
4
|
+
export declare function insetCurvedRegion2D(region: CurvedRegion2D, distance: number): CurvedRegion2D[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as THREE from 'three';
|
|
2
|
+
import type { Body } from '../bodies/body.js';
|
|
3
|
+
import type { GeometryRecord } from '../rendering/records/geometry-record.js';
|
|
4
|
+
export declare function pickTarget(object: THREE.Object3D): Body | undefined;
|
|
5
|
+
export declare function faceIdAt(ranges: Uint32Array, faceIndex: number): number | undefined;
|
|
6
|
+
export declare function edgeIdAt(record: GeometryRecord, index: number): number | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Body } from '../../bodies/body.js';
|
|
2
|
+
import { type Runtime } from '../../runtime/runtime-state.js';
|
|
3
|
+
export type FlushOptions = {
|
|
4
|
+
geometry?: 'sync';
|
|
5
|
+
bodies?: readonly Body[];
|
|
6
|
+
};
|
|
7
|
+
export declare function flush(options?: FlushOptions): void;
|
|
8
|
+
export declare function checkedBodies(state: Runtime, bodies: readonly Body[], label: string, skipDisposed?: boolean): readonly Body[];
|
|
9
|
+
export declare function flushForDispose(): void;
|
|
10
|
+
export declare function notifyBody(body: Body, type: 'geometrychanged' | 'placementchanged'): void;
|
|
11
|
+
export declare function wanted(body: Body): number | undefined;
|
|
12
|
+
export declare function ensureGeometry(body: Body, sync?: boolean): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Body } from '../../bodies/body.js';
|
|
2
|
+
export declare class HostGroup {
|
|
3
|
+
private readonly state;
|
|
4
|
+
private readonly group;
|
|
5
|
+
private disposed;
|
|
6
|
+
constructor(bodies: readonly Body[]);
|
|
7
|
+
drawn(): void;
|
|
8
|
+
set(bodies: readonly Body[]): void;
|
|
9
|
+
dispose(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Body } from '../../bodies/body.js';
|
|
2
|
+
import { type Runtime } from '../../runtime/runtime-state.js';
|
|
3
|
+
export declare function noteDisplayed(body: Body): void;
|
|
4
|
+
export declare function noteDrawn(body: Body): void;
|
|
5
|
+
export declare function markDisplayed(bodies: readonly Body[]): void;
|
|
6
|
+
export declare function setHostDrawn(bodies: readonly Body[], hostDrawn: boolean): void;
|
|
7
|
+
export declare function beginPass(state: Runtime): boolean;
|
|
8
|
+
export declare function refreshDisplayed(state: Runtime): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DisplayBuffers } from '../dto/display-buffers.js';
|
|
2
|
+
import type { OGWorldGraph } from '../kernel/kernel-loader.js';
|
|
3
|
+
import type { TessellationProvider, TessellationRequest } from './provider.js';
|
|
4
|
+
export declare class InlineBackend implements TessellationProvider {
|
|
5
|
+
private graph;
|
|
6
|
+
readonly activeBackend: "inline";
|
|
7
|
+
constructor(graph: OGWorldGraph);
|
|
8
|
+
ensureSnapshot(): Promise<void>;
|
|
9
|
+
compute(value: TessellationRequest): DisplayBuffers;
|
|
10
|
+
request(value: TessellationRequest): Promise<DisplayBuffers>;
|
|
11
|
+
cancelShape(): void;
|
|
12
|
+
drop(): void;
|
|
13
|
+
dispose(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Body } from '../../bodies/body.js';
|
|
2
|
+
import type { Runtime } from '../../runtime/runtime-state.js';
|
|
3
|
+
export type ShapeBuckets = {
|
|
4
|
+
revision: number;
|
|
5
|
+
floor: number;
|
|
6
|
+
static: number;
|
|
7
|
+
error?: unknown;
|
|
8
|
+
};
|
|
9
|
+
export declare function shapeBuckets(state: Runtime, body: Body): ShapeBuckets | undefined;
|
|
10
|
+
export declare function localTarget(world: number, body: Body): number | undefined;
|
|
11
|
+
export declare function finestLocal(bodies: Iterable<Body>, valueOf: (body: Body) => number | undefined): number | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Body } from '../../bodies/body.js';
|
|
2
|
+
import type { Runtime } from '../../runtime/runtime-state.js';
|
|
3
|
+
export declare function isDisplayed(state: Runtime, body: Body): boolean;
|
|
4
|
+
export declare function displayedBodies(state: Runtime): Body[];
|
|
5
|
+
export declare function stampedCount(state: Runtime): number;
|
|
6
|
+
export declare function stampDisplayed(state: Runtime, body: Body): void;
|
|
7
|
+
export declare function wakeDisplayed(state: Runtime, body: Body): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Body } from '../../bodies/body.js';
|
|
2
|
+
import type { Runtime } from '../../runtime/runtime-state.js';
|
|
3
|
+
export declare function shown(state: Runtime, body: Body): boolean;
|
|
4
|
+
export declare function setShown(state: Runtime, body: Body, value: boolean): void;
|
|
5
|
+
export declare function handToHost(state: Runtime, body: Body, hostDrawn: boolean): void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Body } from '../../bodies/body.js';
|
|
2
|
+
import type { Runtime } from '../../runtime/runtime-state.js';
|
|
3
|
+
export type GroupState = {
|
|
4
|
+
pass: number;
|
|
5
|
+
members: Set<Body>;
|
|
6
|
+
};
|
|
7
|
+
export type HostGroups = {
|
|
8
|
+
live: Set<GroupState>;
|
|
9
|
+
of: WeakMap<Body, GroupState[]>;
|
|
10
|
+
woken: Set<GroupState>;
|
|
11
|
+
pending: Set<Body>;
|
|
12
|
+
drawn: boolean;
|
|
13
|
+
revision: number;
|
|
14
|
+
dropped: FinalizationRegistry<GroupState>;
|
|
15
|
+
};
|
|
16
|
+
export declare function createHostGroups(release: (group: GroupState) => void): HostGroups;
|
|
17
|
+
export declare function groupShown(state: Runtime, group: GroupState): boolean;
|
|
18
|
+
export declare function groupDisplayed(state: Runtime, body: Body): boolean;
|
|
19
|
+
export declare function stampGroup(state: Runtime, group: GroupState): void;
|
|
20
|
+
export declare function setMembers(state: Runtime, group: GroupState, members: readonly Body[]): void;
|
|
21
|
+
export declare function dropGroup(state: Runtime, group: GroupState): void;
|
|
22
|
+
export declare function dropMember(state: Runtime, body: Body): void;
|
|
23
|
+
export declare function groupedBodies(state: Runtime): Body[];
|
|
24
|
+
export declare function groupsKey(state: Runtime): number;
|
|
25
|
+
export declare function queueGrouped(state: Runtime, body: Body): void;
|
|
26
|
+
export declare function shownChanged(state: Runtime, body: Body): void;
|
|
27
|
+
export declare function queueShapes(state: Runtime, shapeId?: string): void;
|
|
28
|
+
export declare function takeWaiting(state: Runtime): Set<Body>;
|