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
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import type { Body } from '../../bodies/body.js';
|
|
3
|
+
import { type Runtime } from '../../runtime/runtime-state.js';
|
|
4
|
+
type Tiers = {
|
|
5
|
+
temporary: number | undefined;
|
|
6
|
+
own: number | undefined;
|
|
7
|
+
global: number | undefined;
|
|
8
|
+
};
|
|
9
|
+
type SeenCamera = {
|
|
10
|
+
camera: THREE.Camera;
|
|
11
|
+
height: number;
|
|
12
|
+
};
|
|
13
|
+
type TemporaryTarget = {
|
|
14
|
+
deflection: number;
|
|
15
|
+
};
|
|
16
|
+
type PassInputs = {
|
|
17
|
+
revision: bigint;
|
|
18
|
+
flushed: bigint;
|
|
19
|
+
moving: boolean;
|
|
20
|
+
displayed: number;
|
|
21
|
+
groups: number[];
|
|
22
|
+
};
|
|
23
|
+
type ShapeLod = {
|
|
24
|
+
shapeId: string;
|
|
25
|
+
target?: number;
|
|
26
|
+
previous?: number;
|
|
27
|
+
failed: Set<string>;
|
|
28
|
+
pinned?: {
|
|
29
|
+
revision: number;
|
|
30
|
+
bucket: number;
|
|
31
|
+
};
|
|
32
|
+
forced?: number;
|
|
33
|
+
error?: {
|
|
34
|
+
revision: number;
|
|
35
|
+
error: unknown;
|
|
36
|
+
};
|
|
37
|
+
overrides?: {
|
|
38
|
+
pass: number;
|
|
39
|
+
tiers: Tiers;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export type LodState = {
|
|
43
|
+
shapes: Map<string, ShapeLod>;
|
|
44
|
+
camera: Float64Array;
|
|
45
|
+
frames: WeakMap<THREE.WebGLRenderer, number>;
|
|
46
|
+
bufferSize: THREE.Vector2;
|
|
47
|
+
initialised: boolean;
|
|
48
|
+
lastMotion: number;
|
|
49
|
+
lastSchedule: number;
|
|
50
|
+
settleTimer?: ReturnType<typeof setTimeout>;
|
|
51
|
+
lastSeen?: SeenCamera;
|
|
52
|
+
temporaries: TemporaryTarget[];
|
|
53
|
+
stale: boolean;
|
|
54
|
+
evaluated?: PassInputs;
|
|
55
|
+
drawn: Set<Body>;
|
|
56
|
+
walked: WeakMap<Body, number>;
|
|
57
|
+
refresh: () => void;
|
|
58
|
+
};
|
|
59
|
+
export declare function createLodState(refresh: () => void): LodState;
|
|
60
|
+
export declare function observe(state: Runtime, camera: THREE.Camera, height: number, now: number): void;
|
|
61
|
+
export declare function motionHint(state: Runtime, now: number): void;
|
|
62
|
+
export declare function settleNow(state: Runtime): void;
|
|
63
|
+
export declare function evaluatePass(state: Runtime, now: number, forced: boolean): boolean;
|
|
64
|
+
export declare function wantedKey(state: Runtime, body: Body): number | undefined;
|
|
65
|
+
export declare function overrideChanged(state: Runtime, shapeId?: string): void;
|
|
66
|
+
export declare function pushTemporaryTarget(state: Runtime, deflection: number): TemporaryTarget;
|
|
67
|
+
export declare function popTemporaryTarget(state: Runtime, token: TemporaryTarget): void;
|
|
68
|
+
export declare function markFailed(state: Runtime, shapeId: string, revision: number, bucket: number): boolean;
|
|
69
|
+
export declare function retryBucket(state: Runtime, shapeId: string, revision: number): number | undefined;
|
|
70
|
+
export declare function shapePriority(state: Runtime, shapeId: string): number;
|
|
71
|
+
export declare function recordError(state: Runtime, shapeId: string, revision: number, error: unknown): void;
|
|
72
|
+
export declare function clearError(state: Runtime, shapeId: string, revision: number): void;
|
|
73
|
+
export declare function capturedError(state: Runtime, body: Body): unknown;
|
|
74
|
+
export declare function forceNextBucket(state: Runtime, shapeId: string, bucket: number): void;
|
|
75
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { type PoolEntry, type PooledMaterial } from './ref-counted-pool.js';
|
|
3
|
+
export type MaterialAppearance = {
|
|
4
|
+
color: number;
|
|
5
|
+
opacity: number;
|
|
6
|
+
};
|
|
7
|
+
export type SurfaceEntry = PoolEntry<THREE.MeshStandardMaterial>;
|
|
8
|
+
export type LineEntry = PoolEntry<THREE.LineBasicMaterial>;
|
|
9
|
+
export declare function surfaceMaterial(value: MaterialAppearance): PooledMaterial<THREE.MeshStandardMaterial>;
|
|
10
|
+
export declare function lineMaterial(value: MaterialAppearance): PooledMaterial<THREE.LineBasicMaterial>;
|
|
11
|
+
export declare function releaseSurface(key: string): void;
|
|
12
|
+
export declare function releaseLine(key: string): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type PoolEntry<M> = {
|
|
2
|
+
material: M;
|
|
3
|
+
refs: number;
|
|
4
|
+
};
|
|
5
|
+
export type PooledMaterial<M> = {
|
|
6
|
+
key: string;
|
|
7
|
+
material: M;
|
|
8
|
+
};
|
|
9
|
+
export declare function acquire<M>(pool: Map<string, PoolEntry<M>>, key: string, create: () => M): PooledMaterial<M>;
|
|
10
|
+
export declare function release<M extends {
|
|
11
|
+
dispose(): void;
|
|
12
|
+
}>(pool: Map<string, PoolEntry<M>>, key: string): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DisplayBuffers } from '../dto/display-buffers.js';
|
|
2
|
+
export type TessellationRequest = {
|
|
3
|
+
shapeId: string;
|
|
4
|
+
revision: number;
|
|
5
|
+
bucket: number;
|
|
6
|
+
priority: number;
|
|
7
|
+
maxTriangles: number;
|
|
8
|
+
smoothAngle?: number | undefined;
|
|
9
|
+
generation: number;
|
|
10
|
+
};
|
|
11
|
+
export type TessellationProvider = {
|
|
12
|
+
readonly activeBackend: 'worker' | 'inline';
|
|
13
|
+
ensureSnapshot(shapeId: string, revision: number): Promise<void>;
|
|
14
|
+
request(value: TessellationRequest): Promise<DisplayBuffers>;
|
|
15
|
+
cancelShape(shapeId: string, generation: number): void;
|
|
16
|
+
drop(shapeId: string, revision: number): void;
|
|
17
|
+
dispose(): void;
|
|
18
|
+
compute?(value: TessellationRequest): DisplayBuffers;
|
|
19
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import type { DisplayBuffers } from '../../dto/display-buffers.js';
|
|
3
|
+
export declare function recordKey(shapeId: string, revision: number, bucket: number, smoothAngle?: number): string;
|
|
4
|
+
export declare class GeometryRecord {
|
|
5
|
+
readonly shapeId: string;
|
|
6
|
+
readonly key: string;
|
|
7
|
+
readonly surface: THREE.BufferGeometry | null;
|
|
8
|
+
readonly outline: THREE.BufferGeometry;
|
|
9
|
+
readonly origin: THREE.Vector3;
|
|
10
|
+
readonly faceRanges: Uint32Array;
|
|
11
|
+
readonly edgeIds: Uint32Array;
|
|
12
|
+
readonly smoothEdges: Uint8Array;
|
|
13
|
+
readonly revision: number;
|
|
14
|
+
readonly bucket: number;
|
|
15
|
+
readonly triangles: number;
|
|
16
|
+
readonly bytes: number;
|
|
17
|
+
refs: number;
|
|
18
|
+
lastUse: number;
|
|
19
|
+
constructor(shapeId: string, buffers: DisplayBuffers, smoothAngle?: number);
|
|
20
|
+
dispose(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import type { Bounds } from '../../dto/bounds.js';
|
|
3
|
+
import { type GeometryRecord } from './geometry-record.js';
|
|
4
|
+
export declare class RecordPool {
|
|
5
|
+
private records;
|
|
6
|
+
private byShape;
|
|
7
|
+
private idle;
|
|
8
|
+
private idleBytes;
|
|
9
|
+
private placeholders;
|
|
10
|
+
private placeholderOf;
|
|
11
|
+
private clock;
|
|
12
|
+
get(shapeId: string, revision: number, bucket: number, smoothAngle?: number): GeometryRecord | undefined;
|
|
13
|
+
put(record: GeometryRecord): GeometryRecord;
|
|
14
|
+
retain(record: GeometryRecord): void;
|
|
15
|
+
release(record: GeometryRecord): void;
|
|
16
|
+
purge(shapeId: string, revision?: number): void;
|
|
17
|
+
releaseIdle(): {
|
|
18
|
+
records: number;
|
|
19
|
+
bytes: number;
|
|
20
|
+
};
|
|
21
|
+
placeholder(shapeId: string, revision: number, bounds: () => Bounds | null): THREE.BufferGeometry;
|
|
22
|
+
releasePlaceholder(geometry: THREE.BufferGeometry): boolean;
|
|
23
|
+
clear(): void;
|
|
24
|
+
private owns;
|
|
25
|
+
private touch;
|
|
26
|
+
private setIdle;
|
|
27
|
+
private drop;
|
|
28
|
+
private evict;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TessellateMessage } from '../worker-protocol.js';
|
|
2
|
+
export declare class JobQueue {
|
|
3
|
+
private readonly jobs;
|
|
4
|
+
get size(): number;
|
|
5
|
+
push(job: TessellateMessage): number | undefined;
|
|
6
|
+
cancel(shapeId: string, generation: number): number | undefined;
|
|
7
|
+
next(): TessellateMessage | undefined;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WorkerMessage } from '../worker-protocol.js';
|
|
2
|
+
export type GuardFailure = {
|
|
3
|
+
request: number | undefined;
|
|
4
|
+
error: {
|
|
5
|
+
code: 'InvalidParameter';
|
|
6
|
+
message: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare function parseWorkerMessage(data: unknown): WorkerMessage | GuardFailure;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { OGTessellator } from '../../kernel/kernel-loader.js';
|
|
2
|
+
export declare class SnapshotCache {
|
|
3
|
+
private readonly entries;
|
|
4
|
+
private totalBytes;
|
|
5
|
+
private clock;
|
|
6
|
+
load(key: string, bytes: Uint8Array, tessellator: OGTessellator): void;
|
|
7
|
+
drop(key: string, tessellator: OGTessellator): void;
|
|
8
|
+
touch(key: string): number | undefined;
|
|
9
|
+
evict(except: string, tessellator: OGTessellator): string[];
|
|
10
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { DisplayBuffers } from '../dto/display-buffers.js';
|
|
2
|
+
import { OGError } from '../errors.js';
|
|
3
|
+
import type { OGWorldGraph } from '../kernel/kernel-loader.js';
|
|
4
|
+
import type { TessellationProvider, TessellationRequest } from './provider.js';
|
|
5
|
+
export type WorkerSend = {
|
|
6
|
+
kind: 'tessellate';
|
|
7
|
+
shapeId: string;
|
|
8
|
+
bucket: number;
|
|
9
|
+
priority: number;
|
|
10
|
+
generation: number;
|
|
11
|
+
};
|
|
12
|
+
export declare class WorkerBackend implements TessellationProvider {
|
|
13
|
+
private graph;
|
|
14
|
+
private module;
|
|
15
|
+
private workerURL;
|
|
16
|
+
private onFailure;
|
|
17
|
+
readonly activeBackend: "worker";
|
|
18
|
+
readonly sendLog: WorkerSend[];
|
|
19
|
+
private live;
|
|
20
|
+
private nextRequest;
|
|
21
|
+
private pending;
|
|
22
|
+
private snapshots;
|
|
23
|
+
private latestGenerations;
|
|
24
|
+
private readonly ready;
|
|
25
|
+
private restarts;
|
|
26
|
+
private failed;
|
|
27
|
+
private disposed;
|
|
28
|
+
private fallback;
|
|
29
|
+
constructor(graph: OGWorldGraph, module: WebAssembly.Module, workerURL: string | URL, onFailure: (error: OGError) => void);
|
|
30
|
+
get worker(): Worker | undefined;
|
|
31
|
+
private boot;
|
|
32
|
+
private crash;
|
|
33
|
+
private fail;
|
|
34
|
+
private drain;
|
|
35
|
+
private receive;
|
|
36
|
+
private send;
|
|
37
|
+
private recordSend;
|
|
38
|
+
ensureSnapshot(shapeId: string, revision: number): Promise<void>;
|
|
39
|
+
request(value: TessellationRequest): Promise<DisplayBuffers>;
|
|
40
|
+
private buffersFrom;
|
|
41
|
+
cancelShape(shapeId: string, generation: number): void;
|
|
42
|
+
drop(shapeId: string, revision: number): void;
|
|
43
|
+
dispose(): void;
|
|
44
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { DisplayBuffers } from '../dto/display-buffers.js';
|
|
2
|
+
import type { TessellationRequest } from './provider.js';
|
|
3
|
+
export type WorkerError = {
|
|
4
|
+
code: string;
|
|
5
|
+
message: string;
|
|
6
|
+
details?: unknown;
|
|
7
|
+
};
|
|
8
|
+
export type SnapshotMessage = {
|
|
9
|
+
kind: 'snapshot';
|
|
10
|
+
request: number;
|
|
11
|
+
shapeId: string;
|
|
12
|
+
revision: number;
|
|
13
|
+
bytes: Uint8Array;
|
|
14
|
+
};
|
|
15
|
+
export type TessellateMessage = TessellationRequest & {
|
|
16
|
+
kind: 'tessellate';
|
|
17
|
+
request: number;
|
|
18
|
+
};
|
|
19
|
+
export type WorkerMessage = {
|
|
20
|
+
kind: 'init';
|
|
21
|
+
request: 0;
|
|
22
|
+
module: WebAssembly.Module;
|
|
23
|
+
} | SnapshotMessage | TessellateMessage | {
|
|
24
|
+
kind: 'cancel';
|
|
25
|
+
shapeId: string;
|
|
26
|
+
generation: number;
|
|
27
|
+
} | {
|
|
28
|
+
kind: 'drop';
|
|
29
|
+
shapeId: string;
|
|
30
|
+
revision: number;
|
|
31
|
+
};
|
|
32
|
+
export type WorkerReply = {
|
|
33
|
+
request: number;
|
|
34
|
+
ok: true;
|
|
35
|
+
} | {
|
|
36
|
+
request: number;
|
|
37
|
+
ok: true;
|
|
38
|
+
buffers: DisplayBuffers;
|
|
39
|
+
} | {
|
|
40
|
+
request: number | undefined;
|
|
41
|
+
error: WorkerError;
|
|
42
|
+
} | {
|
|
43
|
+
request: number;
|
|
44
|
+
superseded: true;
|
|
45
|
+
} | {
|
|
46
|
+
request: number;
|
|
47
|
+
missingSnapshot: true;
|
|
48
|
+
} | {
|
|
49
|
+
kind: 'evicted';
|
|
50
|
+
shapeId: string;
|
|
51
|
+
revision: number;
|
|
52
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type CreateOptions, type Runtime } from './runtime-state.js';
|
|
2
|
+
export type KernelInput = {
|
|
3
|
+
wasmURL?: string | URL;
|
|
4
|
+
wasmModule?: WebAssembly.Module;
|
|
5
|
+
};
|
|
6
|
+
export declare function createRuntimeOnce(input: KernelInput, options: CreateOptions): Promise<Runtime>;
|
|
7
|
+
export declare function createRuntime(module: WebAssembly.Module, options: CreateOptions): Runtime;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function reset(): void;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Body } from '../bodies/body.js';
|
|
2
|
+
import type { Bounds } from '../dto/bounds.js';
|
|
3
|
+
import type { Events, Listener } from '../dto/events.js';
|
|
4
|
+
import type { OGWorldGraph } from '../kernel/kernel-loader.js';
|
|
5
|
+
import type { OGMark } from '../marks/og-mark.js';
|
|
6
|
+
import type { HostGroups } from '../rendering/lod/host-groups.js';
|
|
7
|
+
import type { LodState } from '../rendering/lod/lod-controller.js';
|
|
8
|
+
import type { LineEntry, SurfaceEntry } from '../rendering/materials/material-pool.js';
|
|
9
|
+
import type { TessellationProvider } from '../rendering/provider.js';
|
|
10
|
+
import type { RecordPool } from '../rendering/records/record-pool.js';
|
|
11
|
+
export type CreateOptions = {
|
|
12
|
+
workerURL?: string | URL;
|
|
13
|
+
tessellation?: 'worker' | 'inline';
|
|
14
|
+
};
|
|
15
|
+
export type LimboEntry = {
|
|
16
|
+
watermark: number;
|
|
17
|
+
parent: Body['parent'];
|
|
18
|
+
};
|
|
19
|
+
export type Runtime = {
|
|
20
|
+
graph: OGWorldGraph;
|
|
21
|
+
provider: TessellationProvider;
|
|
22
|
+
records: RecordPool;
|
|
23
|
+
bodies: Map<string, Body>;
|
|
24
|
+
pickTargets: WeakMap<object, Body>;
|
|
25
|
+
byShape: Map<string, Set<Body>>;
|
|
26
|
+
limbo: Map<Body, LimboEntry>;
|
|
27
|
+
listeners: Map<Events, Set<Listener>>;
|
|
28
|
+
revision: bigint;
|
|
29
|
+
readyShapes: Set<string>;
|
|
30
|
+
renderPassActive: boolean;
|
|
31
|
+
graphMoved: boolean;
|
|
32
|
+
pass: number;
|
|
33
|
+
displayed: Map<Body, number>;
|
|
34
|
+
hostDrawn: WeakMap<Body, boolean>;
|
|
35
|
+
groups: HostGroups;
|
|
36
|
+
pending: Map<string, Promise<void>>;
|
|
37
|
+
generations: Map<string, number>;
|
|
38
|
+
shapeBuckets: Map<string, {
|
|
39
|
+
revision: number;
|
|
40
|
+
floor: number;
|
|
41
|
+
static: number;
|
|
42
|
+
error?: unknown;
|
|
43
|
+
}>;
|
|
44
|
+
displayBounds: Map<Body, {
|
|
45
|
+
revision: bigint;
|
|
46
|
+
bounds: Bounds | null;
|
|
47
|
+
}>;
|
|
48
|
+
lod: LodState;
|
|
49
|
+
module: WebAssembly.Module;
|
|
50
|
+
createOptions: CreateOptions;
|
|
51
|
+
displayDeflection?: number;
|
|
52
|
+
poisoned: boolean;
|
|
53
|
+
flushes: number;
|
|
54
|
+
marks: Map<number, OGMark>;
|
|
55
|
+
flushing: boolean;
|
|
56
|
+
surfacePool: Map<string, SurfaceEntry>;
|
|
57
|
+
linePool: Map<string, LineEntry>;
|
|
58
|
+
epoch: number;
|
|
59
|
+
};
|
|
60
|
+
export declare function runtime(): Runtime;
|
|
61
|
+
export declare function currentRuntime(): Runtime | undefined;
|
|
62
|
+
export declare function setRuntime(value: Runtime | undefined): void;
|
|
63
|
+
export declare function pendingCreate(): Promise<Runtime> | undefined;
|
|
64
|
+
export declare function setPendingCreate(value: Promise<Runtime> | undefined): void;
|
|
65
|
+
export declare function nextEpoch(): number;
|
|
66
|
+
export declare function bodyKey(handle: number, generation: number): string;
|
|
67
|
+
export declare function reindexShape(state: Runtime, body: Body, previousShapeId: string | null): void;
|
|
68
|
+
export declare function releaseShapeIfEmpty(state: Runtime, shapeId: string, revision: number): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Body } from '../bodies/body.js';
|
|
2
|
+
import { type WorkerSend } from '../rendering/worker-backend.js';
|
|
3
|
+
export { register, unregister } from '../bodies/body-registry.js';
|
|
4
|
+
export { ensureGeometry, flush, wanted } from '../rendering/geometry/geometry-scheduler.js';
|
|
5
|
+
export { noteDisplayed } from '../rendering/geometry/render-pass.js';
|
|
6
|
+
export { wantedBucket } from '../rendering/lod/deflection.js';
|
|
7
|
+
export { parseWorkerMessage } from '../rendering/worker/message-guards.js';
|
|
8
|
+
export { emit } from '../runtime/event-bus.js';
|
|
9
|
+
export { currentRuntime, runtime } from '../runtime/runtime-state.js';
|
|
10
|
+
export { worldGraph as graph } from '../world-graph/world-graph-client.js';
|
|
11
|
+
export declare function activeBackend(): 'worker' | 'inline';
|
|
12
|
+
export declare function flushCount(): number;
|
|
13
|
+
export declare function displayed(body: Body): boolean;
|
|
14
|
+
export declare function pinWantedBucket(shapeId: string, bucket: number): void;
|
|
15
|
+
export declare function workerSendLog(): WorkerSend[];
|
|
16
|
+
export declare function postToWorker(message: unknown, options?: {
|
|
17
|
+
awaitCrash?: boolean;
|
|
18
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ShapeReport } from '../dto/boolean-report.js';
|
|
2
|
+
import type { Bounds } from '../dto/bounds.js';
|
|
3
|
+
import type { Brep } from '../dto/brep.js';
|
|
4
|
+
import type { ChangeSet } from '../dto/change-set.js';
|
|
5
|
+
import type { Creation } from '../dto/creation.js';
|
|
6
|
+
import type { AnalyticExchangeBodyV2 } from '../dto/ifc-body.js';
|
|
7
|
+
import type { MarkStats } from '../dto/mark-stats.js';
|
|
8
|
+
import type { NodeInfo } from '../dto/node-info.js';
|
|
9
|
+
import type { Placement } from '../dto/placement.js';
|
|
10
|
+
import type { CurvedRegion2D, OffsetPath2D, OffsetRegion, RegionOperation } from '../dto/regions.js';
|
|
11
|
+
import type { StepExport } from '../dto/step-export.js';
|
|
12
|
+
export declare function encode(value: unknown): string;
|
|
13
|
+
export declare function scope(options?: {
|
|
14
|
+
instances?: 'all';
|
|
15
|
+
}): string;
|
|
16
|
+
export declare function operationParams(kind: string, params: Record<string, unknown>, call: string): Record<string, unknown>;
|
|
17
|
+
export declare function polylinePoints(params: Record<string, unknown>, call: string): Float64Array;
|
|
18
|
+
export declare function regionsJson(regions: unknown, call: string): string;
|
|
19
|
+
export declare function regionOperation(value: unknown, call: string): RegionOperation;
|
|
20
|
+
export declare function curvedRegionsJson(regions: unknown, call: string): string;
|
|
21
|
+
export declare function numberList(value: unknown, call: string, label: string): Float64Array;
|
|
22
|
+
export declare function offsetHolesJson(holes: unknown, call: string): string;
|
|
23
|
+
export declare function decodeOffsetPath(text: string, call: string): OffsetPath2D;
|
|
24
|
+
export declare function decodeRegions(text: string, call: string): OffsetRegion[];
|
|
25
|
+
export declare function decodeCurvedRegions(text: string, call: string): CurvedRegion2D[];
|
|
26
|
+
export declare function decodeNodeInfo(text: string, call: string): NodeInfo;
|
|
27
|
+
export declare function decodeCreation(text: string, call: string): Creation;
|
|
28
|
+
export declare function decodePlacement(text: string, call: string): Placement;
|
|
29
|
+
export declare function decodeChildren(text: string, call: string): string[];
|
|
30
|
+
export declare function decodeParent(text: string, call: string): string | null;
|
|
31
|
+
export declare function decodeBounds(text: string, call: string): Bounds | null;
|
|
32
|
+
export declare function decodeIfcBody(text: string, call: string): AnalyticExchangeBodyV2;
|
|
33
|
+
export declare function decodeBrep(text: string, call: string): Brep;
|
|
34
|
+
export declare function decodeShapeReport(text: string, call: string): ShapeReport | null;
|
|
35
|
+
export declare function decodeMarkStats(text: string, call: string): MarkStats;
|
|
36
|
+
export declare function decodeDisplayBuckets(text: string, call: string): {
|
|
37
|
+
floor: number;
|
|
38
|
+
static: number;
|
|
39
|
+
};
|
|
40
|
+
export declare function decodeChangeSet(packet: unknown, call: string): {
|
|
41
|
+
changes: ChangeSet;
|
|
42
|
+
matrices: Float64Array;
|
|
43
|
+
};
|
|
44
|
+
export declare function decodeChanges(text: string, call: string): ChangeSet;
|
|
45
|
+
export declare function decodeStepExport(value: unknown, call: string): StepExport;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NodeInfo } from '../dto/node-info.js';
|
|
2
|
+
import type { OGWorldGraph } from '../kernel/kernel-loader.js';
|
|
3
|
+
export declare function worldGraph(): OGWorldGraph;
|
|
4
|
+
export declare function node(ogId: string, label: string): NodeInfo;
|
|
5
|
+
export declare function checkHandle(label: string, target: {
|
|
6
|
+
handle: number;
|
|
7
|
+
generation: number;
|
|
8
|
+
}): void;
|
|
9
|
+
export declare function creation(value: string, label: string): string;
|
|
10
|
+
export declare function displayBuckets(ogId: string, label: string): {
|
|
11
|
+
floor: number;
|
|
12
|
+
static: number;
|
|
13
|
+
};
|