@nebula-spatial/studio 0.0.0-stage → 0.1.1
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 +206 -3
- package/dist/ai/contract.d.ts +73 -0
- package/dist/ai/host.d.ts +28 -0
- package/dist/asset/dependency-scan.d.ts +78 -0
- package/dist/asset/intake.d.ts +84 -0
- package/dist/asset/layout-detect.d.ts +40 -0
- package/dist/asset/media-type.d.ts +10 -0
- package/dist/asset/model-inspection.d.ts +127 -0
- package/dist/asset/record.d.ts +35 -0
- package/dist/asset/remote-asset-resolver.d.ts +36 -0
- package/dist/asset/repairs.d.ts +53 -0
- package/dist/asset/resource-locator.d.ts +15 -0
- package/dist/asset/revision-diff.d.ts +33 -0
- package/dist/asset/source-contracts.d.ts +21 -0
- package/dist/asset/source-paths.d.ts +15 -0
- package/dist/asset/usd-inspection.d.ts +39 -0
- package/dist/asset/usd-source-metadata.d.ts +142 -0
- package/dist/asset/visual-intake.d.ts +27 -0
- package/dist/asset/visual-record.d.ts +22 -0
- package/dist/asset/web-intake.d.ts +46 -0
- package/dist/asset-source-BExlEcRt.js +444 -0
- package/dist/assets/openusd_three_loader-DLiqJWUM.js +13769 -0
- package/dist/assets/usd-export-worker-BRxTLqer.js +182 -0
- package/dist/assets/usd-worker-DekqMsQv.js +1392 -0
- package/dist/builders-BAXRR5o5.js +1854 -0
- package/dist/core/asset-task.d.ts +105 -0
- package/dist/core/context.d.ts +23 -0
- package/dist/core/host.d.ts +432 -0
- package/dist/core/persistence-controller.d.ts +58 -0
- package/dist/core/plugins.d.ts +139 -0
- package/dist/core/scene-tree.d.ts +62 -0
- package/dist/core/versions.d.ts +2 -0
- package/dist/core/when.d.ts +13 -0
- package/dist/core/write-policy.d.ts +29 -0
- package/dist/delivery/build-plan.d.ts +2 -0
- package/dist/delivery/contracts.d.ts +362 -0
- package/dist/delivery/digest.d.ts +3 -0
- package/dist/delivery/evidence.d.ts +10 -0
- package/dist/delivery/export-evidence.d.ts +3 -0
- package/dist/delivery/index.d.ts +9 -0
- package/dist/delivery/prim-name.d.ts +17 -0
- package/dist/delivery/profile.d.ts +4 -0
- package/dist/doc/builders.d.ts +99 -0
- package/dist/doc/command.d.ts +195 -0
- package/dist/doc/domain-extensions.d.ts +34 -0
- package/dist/doc/node-facts.d.ts +87 -0
- package/dist/doc/physics-facts.d.ts +74 -0
- package/dist/doc/placement-policy.d.ts +71 -0
- package/dist/doc/random-placement.d.ts +30 -0
- package/dist/doc/scene-graph.d.ts +80 -0
- package/dist/doc/scene-regions.d.ts +29 -0
- package/dist/doc/schema.d.ts +452 -0
- package/dist/doc/task.d.ts +71 -0
- package/dist/doc/validate.d.ts +68 -0
- package/dist/editor/asset-source.d.ts +15 -0
- package/dist/editor/editor.d.ts +246 -0
- package/dist/editor/index.d.ts +22 -0
- package/dist/editor/shortcuts.d.ts +2 -0
- package/dist/editor/types.d.ts +143 -0
- package/dist/editor/ui-plugins.d.ts +64 -0
- package/dist/editor.js +1755 -0
- package/dist/editorial-BkAFWfbg.js +83 -0
- package/dist/export-evidence-DMNRhgL9.js +2705 -0
- package/dist/generalization/domain.d.ts +10 -0
- package/dist/generalization/generalization.d.ts +371 -0
- package/dist/generalization/index.d.ts +11 -0
- package/dist/generalization.js +1659 -0
- package/dist/history/undo-stack.d.ts +74 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.js +2840 -0
- package/dist/mjcf-visual-Bt4bUxd1.js +72 -0
- package/dist/mujoco-runtime-BYZnrvbR.js +467 -0
- package/dist/persist/content-addressed.d.ts +11 -0
- package/dist/persist/create-scene-package-from-host.d.ts +7 -0
- package/dist/persist/indexeddb-store.d.ts +69 -0
- package/dist/persist/scene-file.d.ts +52 -0
- package/dist/persist/scene-package.d.ts +8 -0
- package/dist/persist/snapshot.d.ts +5 -0
- package/dist/physics-facts-tfQYyNTD.js +337 -0
- package/dist/placement-policy-DY_FNRDu.js +405 -0
- package/dist/ports/asset-ingestor.d.ts +41 -0
- package/dist/ports/asset-source.d.ts +57 -0
- package/dist/ports/delivery.d.ts +13 -0
- package/dist/ports/persistence.d.ts +29 -0
- package/dist/project/asset-catalog.d.ts +21 -0
- package/dist/project/contracts.d.ts +272 -0
- package/dist/project/editorial.d.ts +16 -0
- package/dist/project/identity.d.ts +20 -0
- package/dist/project/index.d.ts +9 -0
- package/dist/project/scene-document.d.ts +5 -0
- package/dist/project/source-dependencies.d.ts +7 -0
- package/dist/remote-asset-resolver-Cb8cfNmw.js +136 -0
- package/dist/scene/index.d.ts +12 -0
- package/dist/scene-graph-DBLKAhxa.js +681 -0
- package/dist/scene-session-Cy6vDJ1l.js +21981 -0
- package/dist/scene.js +244 -0
- package/dist/session-BRBrCLdd.js +963 -0
- package/dist/session-DI5tPJxn.js +825 -0
- package/dist/session-q3uuG7OP.js +296 -0
- package/dist/studio/delivery-catalog.d.ts +28 -0
- package/dist/studio/in-memory-asset-source.d.ts +15 -0
- package/dist/studio/index.d.ts +31 -0
- package/dist/studio/indexeddb-asset-source.d.ts +32 -0
- package/dist/studio/indexeddb-persistence.d.ts +13 -0
- package/dist/studio/remote-asset-importer.d.ts +56 -0
- package/dist/studio/source-package.d.ts +9 -0
- package/dist/studio/usd-export-client.d.ts +13 -0
- package/dist/studio/usd-export-protocol.d.ts +98 -0
- package/dist/studio/usd-export-worker.d.ts +1 -0
- package/dist/studio/usd-zip-reader.d.ts +14 -0
- package/dist/studio/web-asset-ingestor.d.ts +10 -0
- package/dist/studio/web-host.d.ts +8 -0
- package/dist/studio.js +5545 -0
- package/dist/urdf-session-CQir2nb2.js +1230 -0
- package/dist/usd-session-DZJnEEOs.js +7385 -0
- package/dist/util/asset-facts.d.ts +3 -0
- package/dist/util/data.d.ts +17 -0
- package/dist/util/diagnostics.d.ts +38 -0
- package/dist/util/geometry.d.ts +11 -0
- package/dist/util/hash.d.ts +9 -0
- package/dist/util/ids.d.ts +20 -0
- package/dist/util/math.d.ts +47 -0
- package/dist/util/ply-metadata.d.ts +19 -0
- package/dist/util/studio-source.d.ts +23 -0
- package/dist/version.d.ts +5 -0
- package/dist/view/appearance.d.ts +13 -0
- package/dist/view/authoring-appearance.d.ts +25 -0
- package/dist/view/bounds-preview.d.ts +34 -0
- package/dist/view/bounds.d.ts +11 -0
- package/dist/view/camera-zoom.d.ts +3 -0
- package/dist/view/geometry-anchors.d.ts +20 -0
- package/dist/view/gizmo-appearance.d.ts +5 -0
- package/dist/view/gizmo.d.ts +81 -0
- package/dist/view/group-selection.d.ts +13 -0
- package/dist/view/node-features.d.ts +39 -0
- package/dist/view/picking.d.ts +49 -0
- package/dist/view/placement.d.ts +48 -0
- package/dist/view/region-editing.d.ts +25 -0
- package/dist/view/rotation-guide.d.ts +36 -0
- package/dist/view/runtime-capabilities.d.ts +22 -0
- package/dist/view/scene-session.d.ts +258 -0
- package/dist/view/screen-bounds.d.ts +17 -0
- package/dist/view/selection-transform.d.ts +20 -0
- package/dist/wasm-module-DZn2AM1W.js +13 -0
- package/dist/xacro-DLRXyk60.js +76 -0
- package/node_modules/@nebula-spatial/cad-loader/CHANGELOG.md +48 -0
- package/node_modules/@nebula-spatial/cad-loader/README.md +108 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/cad-types.d.ts +26 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/errors.d.ts +5 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/index.d.ts +24 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/index.js +2354 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/bin-group-reader.d.ts +9 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/bin-parser.d.ts +78 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/dxbs-sidecar.d.ts +24 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/geometry-segments.d.ts +20 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/text-roundtrip.d.ts +4 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/types.d.ts +81 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/runtime-text-decoder.d.ts +8 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/types.d.ts +153 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/utils/insert-bbox.d.ts +10 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/utils/viewport-rect.d.ts +21 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/index.d.ts +36 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/index.js +5829 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/geo-loader.d.ts +59 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/automatic-external-resources.d.ts +26 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/external-variant-sidecar-fetch.d.ts +13 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/flow-control.d.ts +29 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/frame-budget-scheduler.d.ts +21 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-compact-executor.d.ts +19 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-local-adapter.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-pipeline.d.ts +92 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-worker-adapter.d.ts +13 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node-builder.d.ts +34 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node-load-sink.d.ts +28 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node.d.ts +304 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare-worker-types.d.ts +94 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare.d.ts +38 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare.worker.d.ts +1 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-model-builder.d.ts +10 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-runtime-geometry.d.ts +15 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/line-canonical.d.ts +37 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/line-quality.d.ts +9 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/prepare-credit-gate.d.ts +20 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/transport.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/cad-render-node.d.ts +80 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/geo-node-cad-render-node.d.ts +12 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/geo-cad-line-geometry.d.ts +28 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/geo-cad-line-material.d.ts +18 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/block-geometry-registry.d.ts +35 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/insert-instance-table.d.ts +23 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/viewport-instance-presenter.d.ts +66 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/selection/cad-insert-selection.d.ts +35 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/selection/cad-text-selection.d.ts +31 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/annotation-idle-gate.d.ts +14 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-document-session.d.ts +187 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-font-runtime.d.ts +11 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-insert-id.d.ts +6 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-text-warmup.d.ts +38 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/create-cad-document-session.d.ts +5 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/load-session.d.ts +90 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/viewport-coverage.d.ts +32 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/abort.d.ts +3 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/cad-display-color.d.ts +55 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/cad-load-source.d.ts +8 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/color-buffer.d.ts +6 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/constants.d.ts +11 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/display-color-buffer.d.ts +27 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/errors.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/text-builder.d.ts +25 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/text-font.d.ts +12 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/types.d.ts +57 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/insert-bbox.d.ts +1 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/timing.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/viewport-rect.d.ts +1 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/viewer-theme.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/workers/geo-prepare.worker.js +2264 -0
- package/node_modules/@nebula-spatial/cad-loader/package.json +62 -0
- package/node_modules/@nebula-spatial/viewer/CHANGELOG.md +426 -0
- package/node_modules/@nebula-spatial/viewer/FBX-MATERIAL-CONVERSION.md +97 -0
- package/node_modules/@nebula-spatial/viewer/README.md +1056 -0
- package/node_modules/@nebula-spatial/viewer/USD-VISUAL-MATERIAL-SUPPORT.md +89 -0
- package/node_modules/@nebula-spatial/viewer/basis/basis_transcoder.js +19 -0
- package/node_modules/@nebula-spatial/viewer/basis/basis_transcoder.wasm +0 -0
- package/node_modules/@nebula-spatial/viewer/dist/asset-ir-DEOK9SqE.js +382 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/ground-grid.d.ts +6 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/source-types.d.ts +19 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/types.d.ts +393 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/usd-worker-Bom5cjz3.js +1392 -0
- package/node_modules/@nebula-spatial/viewer/dist/cad/text.d.ts +2 -0
- package/node_modules/@nebula-spatial/viewer/dist/cad/types.d.ts +368 -0
- package/node_modules/@nebula-spatial/viewer/dist/index-ByBlfVc0.js +12132 -0
- package/node_modules/@nebula-spatial/viewer/dist/index.d.ts +32 -0
- package/node_modules/@nebula-spatial/viewer/dist/index.js +26 -0
- package/node_modules/@nebula-spatial/viewer/dist/inspection/types.d.ts +112 -0
- package/node_modules/@nebula-spatial/viewer/dist/mjcf-visual-DVRa0w90.js +72 -0
- package/node_modules/@nebula-spatial/viewer/dist/mujoco-runtime-Dhx6Ua2u.js +463 -0
- package/node_modules/@nebula-spatial/viewer/dist/plugins.d.ts +179 -0
- package/node_modules/@nebula-spatial/viewer/dist/scene/instances.d.ts +36 -0
- package/node_modules/@nebula-spatial/viewer/dist/scene/types.d.ts +258 -0
- package/node_modules/@nebula-spatial/viewer/dist/session-B-j6KdA-.js +389 -0
- package/node_modules/@nebula-spatial/viewer/dist/session-B4AICTeJ.js +963 -0
- package/node_modules/@nebula-spatial/viewer/dist/session-BAG5cDYe.js +9153 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/mujoco-runtime.d.ts +118 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/mujoco-wasm-module.d.ts +11 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/openusd-wasm-module.d.ts +10 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/physics-runtime-state.d.ts +75 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/types.d.ts +129 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-inspection.d.ts +66 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-query.d.ts +50 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-resource-policy.d.ts +28 -0
- package/node_modules/@nebula-spatial/viewer/dist/types.d.ts +278 -0
- package/node_modules/@nebula-spatial/viewer/dist/ui/types.d.ts +48 -0
- package/node_modules/@nebula-spatial/viewer/dist/urdf-session-kemAnBn8.js +3231 -0
- package/node_modules/@nebula-spatial/viewer/dist/usd-session-QtwGKI7v.js +6771 -0
- package/node_modules/@nebula-spatial/viewer/dist/version.d.ts +5 -0
- package/node_modules/@nebula-spatial/viewer/dist/viewer.d.ts +2 -0
- package/node_modules/@nebula-spatial/viewer/dist/xacro-CYTPS7mh.js +1537 -0
- package/node_modules/@nebula-spatial/viewer/openusd/openusd-runtime-manifest.json +15 -0
- package/node_modules/@nebula-spatial/viewer/openusd/openusd_probe.js +14 -0
- package/node_modules/@nebula-spatial/viewer/openusd/openusd_probe.wasm +0 -0
- package/node_modules/@nebula-spatial/viewer/package.json +66 -0
- package/package.json +87 -6
package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare-worker-types.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { TextEntity, ViewportRect } from '../../shared/types';
|
|
2
|
+
import type { GeometryKind, PreparedLayerChunk } from './geo-prepare';
|
|
3
|
+
import type { ParsedHeader } from '../../core';
|
|
4
|
+
import type { ExternalVariantFetchSource } from '../geo-loader';
|
|
5
|
+
export type { GeometryKind, PreparedLayerChunk } from './geo-prepare';
|
|
6
|
+
export interface GeoPrepareParseRequest {
|
|
7
|
+
type: 'parse';
|
|
8
|
+
/**
|
|
9
|
+
* Main DXB3 payload. Omitted when the worker already retained the document
|
|
10
|
+
* buffer from an earlier parse in the same document session.
|
|
11
|
+
*/
|
|
12
|
+
buffer?: ArrayBuffer;
|
|
13
|
+
/** Use the main buffer retained by the worker instead of transferring one. */
|
|
14
|
+
useRetainedMainBuffer?: boolean;
|
|
15
|
+
hiddenInstanceIds?: number[];
|
|
16
|
+
keepTextsForHiddenInstances?: boolean;
|
|
17
|
+
loadBlocks?: boolean;
|
|
18
|
+
suppressExpandedInsertGeometry?: boolean;
|
|
19
|
+
maxExpandedInstanceVertices?: number;
|
|
20
|
+
externalVariantFetchSource?: ExternalVariantFetchSource;
|
|
21
|
+
deferExternalVariantGeometry?: boolean;
|
|
22
|
+
externalVariantBuffers?: Array<{
|
|
23
|
+
variantId: number;
|
|
24
|
+
buffer: ArrayBuffer;
|
|
25
|
+
}>;
|
|
26
|
+
requiredExternalVariantIds?: number[];
|
|
27
|
+
externalVariantGeometryFetchIds?: number[];
|
|
28
|
+
externalVariantDeltaOnly?: boolean;
|
|
29
|
+
cacheDocument?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface GeoPrepareGrantMessage {
|
|
32
|
+
type: 'grant';
|
|
33
|
+
geometryCredits: number;
|
|
34
|
+
textCredits: number;
|
|
35
|
+
}
|
|
36
|
+
export interface GeoPrepareCancelMessage {
|
|
37
|
+
type: 'cancel';
|
|
38
|
+
}
|
|
39
|
+
export type GeoPrepareWorkerInputMessage = GeoPrepareParseRequest | GeoPrepareGrantMessage | GeoPrepareCancelMessage;
|
|
40
|
+
export interface GeoPrepareHeaderMessage {
|
|
41
|
+
type: 'header';
|
|
42
|
+
header: ParsedHeader;
|
|
43
|
+
}
|
|
44
|
+
export interface GeoPrepareGeometryMessage {
|
|
45
|
+
type: 'geometry';
|
|
46
|
+
kind: GeometryKind;
|
|
47
|
+
layers: PreparedLayerChunk[];
|
|
48
|
+
cost: number;
|
|
49
|
+
}
|
|
50
|
+
export interface GeoPrepareTextMessage {
|
|
51
|
+
type: 'text';
|
|
52
|
+
texts: TextEntity[];
|
|
53
|
+
cost: number;
|
|
54
|
+
}
|
|
55
|
+
export interface TransferableVariantGeometryKindChunk {
|
|
56
|
+
readonly pos: Float32Array;
|
|
57
|
+
readonly col: Uint8Array;
|
|
58
|
+
readonly count: number;
|
|
59
|
+
readonly layerIndex?: number;
|
|
60
|
+
readonly lineweightPx?: number;
|
|
61
|
+
readonly bbox?: ViewportRect | null;
|
|
62
|
+
}
|
|
63
|
+
export interface TransferableVariantGeometry {
|
|
64
|
+
readonly variantId: number;
|
|
65
|
+
readonly line: readonly TransferableVariantGeometryKindChunk[];
|
|
66
|
+
readonly fill: readonly TransferableVariantGeometryKindChunk[];
|
|
67
|
+
readonly dot: readonly TransferableVariantGeometryKindChunk[];
|
|
68
|
+
}
|
|
69
|
+
export interface TransferableInsertInstanceBatch {
|
|
70
|
+
readonly meta: Uint32Array;
|
|
71
|
+
readonly mats: Float32Array;
|
|
72
|
+
readonly bboxes: Float32Array;
|
|
73
|
+
readonly count: number;
|
|
74
|
+
}
|
|
75
|
+
export interface GeoPrepareInsertModelMessage {
|
|
76
|
+
type: 'insertModel';
|
|
77
|
+
variants: readonly TransferableVariantGeometry[];
|
|
78
|
+
instances: TransferableInsertInstanceBatch;
|
|
79
|
+
cost: number;
|
|
80
|
+
bytes: number;
|
|
81
|
+
planMs: number;
|
|
82
|
+
}
|
|
83
|
+
export interface GeoPrepareDoneMessage {
|
|
84
|
+
type: 'done';
|
|
85
|
+
}
|
|
86
|
+
export interface GeoPrepareCompleteMessage {
|
|
87
|
+
type: 'complete';
|
|
88
|
+
}
|
|
89
|
+
export interface GeoPrepareErrorMessage {
|
|
90
|
+
type: 'error';
|
|
91
|
+
message: string;
|
|
92
|
+
code?: string;
|
|
93
|
+
}
|
|
94
|
+
export type GeoPrepareWorkerOutputMessage = GeoPrepareHeaderMessage | GeoPrepareGeometryMessage | GeoPrepareTextMessage | GeoPrepareInsertModelMessage | GeoPrepareDoneMessage | GeoPrepareCompleteMessage | GeoPrepareErrorMessage;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ViewportRect } from '../../shared/types';
|
|
2
|
+
import { type GeoChunk, type GeoGeometryChunk } from '../../core';
|
|
3
|
+
export type GeometryKind = Extract<GeoChunk['kind'], 'line' | 'fill' | 'dot'>;
|
|
4
|
+
export interface PreparedColorRun {
|
|
5
|
+
readonly startVertex: number;
|
|
6
|
+
readonly vertexCount: number;
|
|
7
|
+
readonly color: readonly [number, number, number];
|
|
8
|
+
}
|
|
9
|
+
export interface PreparedLayerChunk {
|
|
10
|
+
layerIndex: number;
|
|
11
|
+
lineweightPx?: number;
|
|
12
|
+
pos: Float32Array;
|
|
13
|
+
positionItemSize: 2 | 3;
|
|
14
|
+
col: Uint8Array;
|
|
15
|
+
count: number;
|
|
16
|
+
bbox: ViewportRect | null;
|
|
17
|
+
colorRuns?: readonly PreparedColorRun[];
|
|
18
|
+
linePositionKind?: 'xy-zero-z';
|
|
19
|
+
}
|
|
20
|
+
export type PrepareGeometryChunkOptions = {
|
|
21
|
+
markLinePositionXy?: boolean;
|
|
22
|
+
splitLineweight?: boolean;
|
|
23
|
+
};
|
|
24
|
+
export declare class PreparedGeometryAccumulatorByLayer {
|
|
25
|
+
#private;
|
|
26
|
+
get size(): number;
|
|
27
|
+
append(layers: readonly PreparedLayerChunk[]): number;
|
|
28
|
+
drain(): PreparedLayerChunk[];
|
|
29
|
+
}
|
|
30
|
+
export type PreparedGeometryAccumulators = Record<GeometryKind, PreparedGeometryAccumulatorByLayer>;
|
|
31
|
+
export declare function createPreparedGeometryAccumulatorByLayer(): PreparedGeometryAccumulatorByLayer;
|
|
32
|
+
export declare function createPreparedGeometryAccumulators(): PreparedGeometryAccumulators;
|
|
33
|
+
export declare function mergePreparedBounds(current: ViewportRect | null, next: ViewportRect | null): ViewportRect | null;
|
|
34
|
+
export declare function prepareGeometryChunkByLayer(payload: GeoGeometryChunk, options?: PrepareGeometryChunkOptions): PreparedLayerChunk[];
|
|
35
|
+
export declare function appendPreparedLayers(accumulator: PreparedGeometryAccumulatorByLayer, layers: readonly PreparedLayerChunk[]): number;
|
|
36
|
+
export declare function drainPreparedLayers(accumulator: PreparedGeometryAccumulatorByLayer): PreparedLayerChunk[];
|
|
37
|
+
export declare function estimatePreparedLayerBytes(layers: readonly PreparedLayerChunk[]): number;
|
|
38
|
+
export declare function collectPreparedLayerTransfers(layers: readonly PreparedLayerChunk[]): Transferable[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-model-builder.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TransferableInsertInstanceBatch, TransferableVariantGeometry } from './geo-prepare-worker-types';
|
|
2
|
+
import type { ParsedHeader } from '../../core';
|
|
3
|
+
export interface InsertModel {
|
|
4
|
+
variants: TransferableVariantGeometry[];
|
|
5
|
+
instances: TransferableInsertInstanceBatch;
|
|
6
|
+
bytes: number;
|
|
7
|
+
cost: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function buildInsertModel(header: ParsedHeader): InsertModel | null;
|
|
10
|
+
export declare function collectInsertModelTransfers(model: InsertModel): Transferable[];
|
package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-runtime-geometry.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ViewportRect } from '../../shared/types';
|
|
2
|
+
import type { GeoGeometryChunk, GroupLayerEncoding, InsertRuntimeVariant } from '../../core';
|
|
3
|
+
export type InsertRuntimeGeometryKind = 'line' | 'fill' | 'dot';
|
|
4
|
+
export type RuntimeVariantLayerChunk = {
|
|
5
|
+
readonly layerIndex: number;
|
|
6
|
+
readonly lineweightPx?: number;
|
|
7
|
+
readonly pos: Float32Array;
|
|
8
|
+
readonly col: Uint8Array;
|
|
9
|
+
readonly count: number;
|
|
10
|
+
readonly bbox: ViewportRect | null;
|
|
11
|
+
};
|
|
12
|
+
export type RuntimeVariantChunkMaps = Record<InsertRuntimeGeometryKind, ReadonlyMap<string, RuntimeVariantLayerChunk>>;
|
|
13
|
+
export declare function decodeRuntimeGeometryChunk(raw: Uint8Array, count: number, groupLayerEncoding?: GroupLayerEncoding): GeoGeometryChunk;
|
|
14
|
+
export declare function buildRuntimeVariantChunkMaps(variant: InsertRuntimeVariant): RuntimeVariantChunkMaps;
|
|
15
|
+
export declare function mergeRuntimeLayerChunkBBoxes(chunks: RuntimeVariantChunkMaps, textsBBox: ViewportRect | null): ViewportRect | null;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type LineVariant = 'thin' | 'fat';
|
|
2
|
+
export type LineCanonicalPosition = {
|
|
3
|
+
kind: 'xy';
|
|
4
|
+
xy: Float32Array;
|
|
5
|
+
} | {
|
|
6
|
+
kind: 'xyz';
|
|
7
|
+
xyz: Float32Array;
|
|
8
|
+
};
|
|
9
|
+
export type LineCanonicalMemoryStats = {
|
|
10
|
+
recordCount: number;
|
|
11
|
+
vertexCount: number;
|
|
12
|
+
xyRecordCount: number;
|
|
13
|
+
xyzRecordCount: number;
|
|
14
|
+
xyVertexCount: number;
|
|
15
|
+
xyzVertexCount: number;
|
|
16
|
+
positionBytes: number;
|
|
17
|
+
colorBytes: number;
|
|
18
|
+
totalBytes: number;
|
|
19
|
+
};
|
|
20
|
+
export type LineVariantStats = {
|
|
21
|
+
activeThinCount: number;
|
|
22
|
+
activeFatCount: number;
|
|
23
|
+
cachedThinCount: number;
|
|
24
|
+
cachedFatCount: number;
|
|
25
|
+
};
|
|
26
|
+
export type LineMemoryStatsSnapshot = {
|
|
27
|
+
canonical: LineCanonicalMemoryStats;
|
|
28
|
+
variants: LineVariantStats;
|
|
29
|
+
};
|
|
30
|
+
export declare function packLineCanonicalPosition(pos3d: Float32Array, vertexCount: number): LineCanonicalPosition;
|
|
31
|
+
export declare function packLineCanonicalPositionKnownXy(pos: Float32Array, vertexCount: number, itemSize?: 2 | 3): LineCanonicalPosition;
|
|
32
|
+
export declare function copyLineCanonicalPositionTo3d(position: LineCanonicalPosition, vertexCount: number, target: Float32Array, targetVertexOffset: number): void;
|
|
33
|
+
export declare function copyLineCanonicalPositionToItemSize(position: LineCanonicalPosition, vertexCount: number, target: Float32Array, targetVertexOffset: number, targetItemSize: 2 | 3): void;
|
|
34
|
+
export declare function estimateLineCanonicalMemory(position: LineCanonicalPosition, color: Uint8Array, vertexCount: number): LineCanonicalMemoryStats;
|
|
35
|
+
export declare function emptyLineCanonicalMemoryStats(): LineCanonicalMemoryStats;
|
|
36
|
+
export declare function addLineCanonicalMemoryStats(total: LineCanonicalMemoryStats, delta: LineCanonicalMemoryStats): LineCanonicalMemoryStats;
|
|
37
|
+
export declare function subtractLineCanonicalMemoryStats(total: LineCanonicalMemoryStats, delta: LineCanonicalMemoryStats): LineCanonicalMemoryStats;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LineRenderMode } from '../../shared/types';
|
|
2
|
+
export type RenderQualityMode = 'auto' | Exclude<LineRenderMode, 'width'>;
|
|
3
|
+
export type EffectiveRenderQuality = Exclude<LineRenderMode, 'width'>;
|
|
4
|
+
export interface AutoQualityContext {
|
|
5
|
+
visibleVertexCount: number;
|
|
6
|
+
zoom: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function resolveAutoLineQuality(current: EffectiveRenderQuality, context: AutoQualityContext): EffectiveRenderQuality;
|
|
9
|
+
export declare function resolveLineQuality(requested: RenderQualityMode, current: EffectiveRenderQuality, context: AutoQualityContext): EffectiveRenderQuality;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type CreditKind = 'geometry' | 'text';
|
|
2
|
+
export interface WorkerCreditGrant {
|
|
3
|
+
geometryCredits: number;
|
|
4
|
+
textCredits: number;
|
|
5
|
+
}
|
|
6
|
+
export declare class PrepareCreditGate {
|
|
7
|
+
private geometryCredits;
|
|
8
|
+
private textCredits;
|
|
9
|
+
private cancelled;
|
|
10
|
+
private readonly geometryWaiters;
|
|
11
|
+
private readonly textWaiters;
|
|
12
|
+
grant(grant: WorkerCreditGrant): void;
|
|
13
|
+
cancel(): void;
|
|
14
|
+
take(kind: CreditKind): Promise<boolean>;
|
|
15
|
+
private flushWaiters;
|
|
16
|
+
private flushKind;
|
|
17
|
+
private getCredits;
|
|
18
|
+
private setCredits;
|
|
19
|
+
private getWaiters;
|
|
20
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { Object3D } from 'three';
|
|
2
|
+
import type { CadDisplayContext, CadVisibilityFilter, CadWorldBounds } from '../session/cad-document-session';
|
|
3
|
+
import type { RenderDebugBreakdownEntry, SplitBlockLayerDetail } from '../shared/types';
|
|
4
|
+
export declare const CAD_RENDER_NODE_EDIT_METHODS: readonly ["updateTextEntry", "updateInsertInstanceTransform", "applyInsertTransform", "editBlock"];
|
|
5
|
+
export type CadRenderContentKind = 'geometry' | 'annotation';
|
|
6
|
+
export interface CadRenderContentChunk {
|
|
7
|
+
readonly documentFingerprint: string;
|
|
8
|
+
readonly variantId: string | number;
|
|
9
|
+
readonly chunkId: string;
|
|
10
|
+
readonly contentRevision: number;
|
|
11
|
+
readonly kind: CadRenderContentKind;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Disposable, read-only geometry borrowed from the CAD insert presenter.
|
|
15
|
+
* Disposing the preview releases only its presenter wrappers and materials;
|
|
16
|
+
* the document-owned block geometry remains owned by the render node.
|
|
17
|
+
*/
|
|
18
|
+
export interface CadInsertPreviewResource {
|
|
19
|
+
readonly object: Object3D;
|
|
20
|
+
readonly bounds: CadWorldBounds;
|
|
21
|
+
dispose(): void;
|
|
22
|
+
}
|
|
23
|
+
export interface CadRenderDiagnostics {
|
|
24
|
+
readonly entityCount: number;
|
|
25
|
+
readonly lineCount: number;
|
|
26
|
+
readonly fillCount: number;
|
|
27
|
+
readonly dotCount: number;
|
|
28
|
+
readonly textCount: number;
|
|
29
|
+
readonly lineRenderMode: string;
|
|
30
|
+
readonly renderableCount?: number;
|
|
31
|
+
readonly submittedVertexRefs?: number;
|
|
32
|
+
readonly blockVariantCount?: number;
|
|
33
|
+
readonly blockInstanceCount?: number;
|
|
34
|
+
readonly splitBlockLayerGroupCount?: number;
|
|
35
|
+
/** Draw-call source breakdown by renderable kind, for the debug popup. */
|
|
36
|
+
readonly renderDebugBreakdown?: RenderDebugBreakdownEntry[];
|
|
37
|
+
/** Top cross-layer block variants, for the debug popup. */
|
|
38
|
+
readonly splitBlockLayerDetails?: SplitBlockLayerDetail[];
|
|
39
|
+
}
|
|
40
|
+
export interface CadInsertVisibilityChange {
|
|
41
|
+
readonly insertId: string;
|
|
42
|
+
readonly visible: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface CadLayerVisibilityChange {
|
|
45
|
+
readonly layerIndex: number;
|
|
46
|
+
readonly visible: boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Read-only CAD render resource. Editing methods belong to legacy GeoNode and
|
|
50
|
+
* must not appear on this type.
|
|
51
|
+
*/
|
|
52
|
+
export interface CadRenderNode {
|
|
53
|
+
readonly object: Object3D;
|
|
54
|
+
readonly contentRevision: number;
|
|
55
|
+
getAuthoritativeBounds(filter: CadVisibilityFilter): CadWorldBounds | null;
|
|
56
|
+
getMountedBounds(filter: CadVisibilityFilter): CadWorldBounds | null;
|
|
57
|
+
getUnmountedExternalBounds(filter: CadVisibilityFilter): CadWorldBounds | null;
|
|
58
|
+
appendContent(chunk: CadRenderContentChunk): boolean;
|
|
59
|
+
setDisplayContext(context: CadDisplayContext): void;
|
|
60
|
+
setLayerVisible(layerIndex: number, visible: boolean): void;
|
|
61
|
+
/**
|
|
62
|
+
* Applies layer visibility changes as one render-resource transaction. This
|
|
63
|
+
* avoids rebuilding the viewport INSERT presenter once per changed layer.
|
|
64
|
+
*/
|
|
65
|
+
setLayerVisibleBatch(changes: ReadonlyArray<CadLayerVisibilityChange>): void;
|
|
66
|
+
setLayerColorOverride(layerIndex: number, color: number | null): void;
|
|
67
|
+
setInsertVisible(insertId: string, visible: boolean): void;
|
|
68
|
+
/**
|
|
69
|
+
* Applies many insert visibility changes atomically: one hidden-set update,
|
|
70
|
+
* one presenter refresh, and one structure/onChange notification for the
|
|
71
|
+
* whole batch, instead of one per call.
|
|
72
|
+
*/
|
|
73
|
+
setInsertVisibleBatch(changes: ReadonlyArray<CadInsertVisibilityChange>): void;
|
|
74
|
+
createInsertPreview(instanceId: number): CadInsertPreviewResource | null;
|
|
75
|
+
getDiagnostics(): CadRenderDiagnostics;
|
|
76
|
+
onChange(listener: () => void): () => void;
|
|
77
|
+
dispose(): void;
|
|
78
|
+
}
|
|
79
|
+
export type CadRenderNodeEditMethod = (typeof CAD_RENDER_NODE_EDIT_METHODS)[number];
|
|
80
|
+
export declare function isCadRenderNodeEditMethod(value: string): value is CadRenderNodeEditMethod;
|
package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/geo-node-cad-render-node.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { GeoNode } from '../loader/internal/geo-node';
|
|
2
|
+
import type { CadWorldBounds } from '../session/cad-document-session';
|
|
3
|
+
import type { CadRenderNode } from './cad-render-node';
|
|
4
|
+
export declare function planarBoundsFromXy(bounds: readonly [number, number, number, number] | null | undefined): CadWorldBounds | null;
|
|
5
|
+
export declare function mergeWorldBounds(current: CadWorldBounds | null, next: CadWorldBounds | null): CadWorldBounds | null;
|
|
6
|
+
export declare function createGeoNodeCadRenderNode(input: {
|
|
7
|
+
readonly node: GeoNode;
|
|
8
|
+
readonly getHeaderBounds: () => CadWorldBounds | null;
|
|
9
|
+
readonly getUnmountedBounds: () => CadWorldBounds | null;
|
|
10
|
+
readonly hiddenInstanceIds: Set<number>;
|
|
11
|
+
readonly onInsertVisibilityChange: () => void;
|
|
12
|
+
}): CadRenderNode;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Box3, BufferGeometry, InstancedBufferGeometry, LineSegments, Mesh, Sphere, Vector2 } from 'three';
|
|
2
|
+
import { GeoCadLineMaterial } from './geo-cad-line-material';
|
|
3
|
+
export type CadLineBBox = {
|
|
4
|
+
minX: number;
|
|
5
|
+
minY: number;
|
|
6
|
+
maxX: number;
|
|
7
|
+
maxY: number;
|
|
8
|
+
};
|
|
9
|
+
export type CadLineCreateArgs = {
|
|
10
|
+
position: Float32Array;
|
|
11
|
+
positionItemSize: 2 | 3;
|
|
12
|
+
color: Uint8Array;
|
|
13
|
+
vertexCount: number;
|
|
14
|
+
bbox: CadLineBBox;
|
|
15
|
+
};
|
|
16
|
+
export type FatCadLineCreateArgs = CadLineCreateArgs & {
|
|
17
|
+
linewidthPx: number;
|
|
18
|
+
resolution: Vector2;
|
|
19
|
+
};
|
|
20
|
+
export type ThinCadLine = LineSegments<BufferGeometry, GeoCadLineMaterial>;
|
|
21
|
+
export type FatCadLine = Mesh<InstancedBufferGeometry, GeoCadLineMaterial>;
|
|
22
|
+
export declare function createLineBoundsFromBbox(bbox: CadLineBBox): {
|
|
23
|
+
box: Box3;
|
|
24
|
+
sphere: Sphere;
|
|
25
|
+
};
|
|
26
|
+
export declare function createThinCadLine(args: CadLineCreateArgs): ThinCadLine;
|
|
27
|
+
export declare function createFatCadLine(args: FatCadLineCreateArgs): FatCadLine;
|
|
28
|
+
export declare function markCadLineColorBufferNeedsUpdate(geometry: BufferGeometry): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Color, RawShaderMaterial, Vector2 } from 'three';
|
|
2
|
+
export type CadLineVariant = 'thin' | 'fat';
|
|
3
|
+
export declare class GeoCadLineMaterial extends RawShaderMaterial {
|
|
4
|
+
readonly color: Color;
|
|
5
|
+
readonly resolution: Vector2;
|
|
6
|
+
constructor(args: {
|
|
7
|
+
variant: CadLineVariant;
|
|
8
|
+
linewidthPx?: number;
|
|
9
|
+
resolution?: Vector2;
|
|
10
|
+
});
|
|
11
|
+
get vertexColors(): boolean;
|
|
12
|
+
set vertexColors(value: boolean);
|
|
13
|
+
get opacity(): number;
|
|
14
|
+
set opacity(value: number);
|
|
15
|
+
get linewidthPx(): number;
|
|
16
|
+
set linewidthPx(value: number);
|
|
17
|
+
updateResolution(width: number, height: number): void;
|
|
18
|
+
}
|
package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/block-geometry-registry.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { BufferGeometry } from 'three';
|
|
2
|
+
import type { ViewportRect } from '../../shared/types';
|
|
3
|
+
export type BlockGeometryKind = 'line' | 'fill' | 'dot';
|
|
4
|
+
export interface BlockGeometryChunkInput {
|
|
5
|
+
readonly pos: Float32Array;
|
|
6
|
+
readonly col: Uint8Array;
|
|
7
|
+
readonly count: number;
|
|
8
|
+
readonly layerIndex?: number;
|
|
9
|
+
readonly lineweightPx?: number;
|
|
10
|
+
readonly bbox?: ViewportRect | null;
|
|
11
|
+
}
|
|
12
|
+
export interface VariantGeometryInput {
|
|
13
|
+
readonly variantId: number;
|
|
14
|
+
readonly line: readonly BlockGeometryChunkInput[];
|
|
15
|
+
readonly fill: readonly BlockGeometryChunkInput[];
|
|
16
|
+
readonly dot: readonly BlockGeometryChunkInput[];
|
|
17
|
+
}
|
|
18
|
+
export interface KindGeometry {
|
|
19
|
+
readonly geometry: BufferGeometry;
|
|
20
|
+
readonly vertexCount: number;
|
|
21
|
+
readonly layerIndex: number;
|
|
22
|
+
readonly lineweightPx?: number;
|
|
23
|
+
readonly bbox: ViewportRect | null;
|
|
24
|
+
}
|
|
25
|
+
export interface VariantGeometry {
|
|
26
|
+
readonly variantId: number;
|
|
27
|
+
readonly byKind: Map<BlockGeometryKind, readonly KindGeometry[]>;
|
|
28
|
+
}
|
|
29
|
+
export interface BlockGeometryRegistry {
|
|
30
|
+
getVariant(variantId: number): VariantGeometry | undefined;
|
|
31
|
+
variantIds(): Iterable<number>;
|
|
32
|
+
appendVariants(inputs: readonly VariantGeometryInput[]): VariantGeometry[];
|
|
33
|
+
dispose(): void;
|
|
34
|
+
}
|
|
35
|
+
export declare function buildBlockGeometryRegistry(inputs: readonly VariantGeometryInput[]): BlockGeometryRegistry;
|
package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/insert-instance-table.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ViewportRect } from '../../shared/types';
|
|
2
|
+
export interface InsertInstanceRecord {
|
|
3
|
+
readonly recordKey?: string;
|
|
4
|
+
readonly instanceId: number;
|
|
5
|
+
readonly variantId: number;
|
|
6
|
+
readonly layerIdx: number;
|
|
7
|
+
readonly matA: number;
|
|
8
|
+
readonly matB: number;
|
|
9
|
+
readonly matC: number;
|
|
10
|
+
readonly matD: number;
|
|
11
|
+
readonly tx: number;
|
|
12
|
+
readonly ty: number;
|
|
13
|
+
readonly bbox: ViewportRect;
|
|
14
|
+
}
|
|
15
|
+
export interface InsertInstanceTable {
|
|
16
|
+
readonly records: readonly InsertInstanceRecord[];
|
|
17
|
+
appendRecords(records: readonly InsertInstanceRecord[]): void;
|
|
18
|
+
replaceRecord(record: InsertInstanceRecord): boolean;
|
|
19
|
+
queryInRect(rect: ViewportRect): InsertInstanceRecord[];
|
|
20
|
+
size(): number;
|
|
21
|
+
variantHistogram(): Map<number, number>;
|
|
22
|
+
}
|
|
23
|
+
export declare function buildInsertInstanceTable(records: readonly InsertInstanceRecord[]): InsertInstanceTable;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { InstancedBufferGeometry, LineSegments, Mesh, Object3D, Points, type Material } from 'three';
|
|
2
|
+
import type { ViewportRect } from '../../shared/types';
|
|
3
|
+
import type { BlockGeometryKind, BlockGeometryRegistry, VariantGeometry } from './block-geometry-registry';
|
|
4
|
+
import type { InsertInstanceTable } from './insert-instance-table';
|
|
5
|
+
export interface LayerVisibility {
|
|
6
|
+
readonly version: number;
|
|
7
|
+
isVisible(layerIdx: number): boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface MaterialFactory {
|
|
10
|
+
(kind: BlockGeometryKind): Material;
|
|
11
|
+
}
|
|
12
|
+
export interface ViewportInstancePresenterOptions {
|
|
13
|
+
readonly registry: BlockGeometryRegistry;
|
|
14
|
+
readonly table: InsertInstanceTable;
|
|
15
|
+
readonly materialFactory: MaterialFactory;
|
|
16
|
+
readonly initialCapacity: number;
|
|
17
|
+
readonly marginRatio: number;
|
|
18
|
+
}
|
|
19
|
+
export interface ViewportInstancePresenterDebugSlot {
|
|
20
|
+
readonly variantId: number;
|
|
21
|
+
readonly kind: BlockGeometryKind;
|
|
22
|
+
readonly geometryLayerIndex: number;
|
|
23
|
+
readonly perVertexCount: number;
|
|
24
|
+
readonly localBBox: ViewportRect | null;
|
|
25
|
+
readonly mesh: PresenterRenderable;
|
|
26
|
+
readonly capacity: number;
|
|
27
|
+
}
|
|
28
|
+
type PresenterRenderable = (LineSegments | Mesh | Points) & {
|
|
29
|
+
geometry: InstancedBufferGeometry;
|
|
30
|
+
material: Material | Material[];
|
|
31
|
+
count: number;
|
|
32
|
+
};
|
|
33
|
+
export declare class ViewportInstancePresenter {
|
|
34
|
+
private readonly slots;
|
|
35
|
+
private readonly group;
|
|
36
|
+
private readonly marginRatio;
|
|
37
|
+
private readonly table;
|
|
38
|
+
private readonly materialFactory;
|
|
39
|
+
private readonly initialCapacity;
|
|
40
|
+
private attachedParent;
|
|
41
|
+
private lastQueryAll;
|
|
42
|
+
private lastQueryRect;
|
|
43
|
+
private lastQueryHits;
|
|
44
|
+
private lastFilteredQueryRect;
|
|
45
|
+
private lastFilteredQueryAll;
|
|
46
|
+
private lastLayerVersion;
|
|
47
|
+
private lastUserHiddenCacheKey;
|
|
48
|
+
private cacheValid;
|
|
49
|
+
private visibleVertexCount;
|
|
50
|
+
constructor(opts: ViewportInstancePresenterOptions);
|
|
51
|
+
appendVariant(variant: VariantGeometry): void;
|
|
52
|
+
attach(parent: Object3D): void;
|
|
53
|
+
detach(): void;
|
|
54
|
+
invalidateQueryCache(): void;
|
|
55
|
+
refresh(viewport: ViewportRect | null, layers: LayerVisibility, userHidden: ReadonlySet<number>, userHiddenRevision?: number): void;
|
|
56
|
+
currentVisibleVertexCount(): number;
|
|
57
|
+
private resolveQueryHits;
|
|
58
|
+
private removeVariantSlots;
|
|
59
|
+
private invalidateFilteredQueryCache;
|
|
60
|
+
dispose(): void;
|
|
61
|
+
_debugSlots(): readonly ViewportInstancePresenterDebugSlot[];
|
|
62
|
+
private ensureCapacity;
|
|
63
|
+
private writeMatRows;
|
|
64
|
+
private slotVisibleForRecord;
|
|
65
|
+
}
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { GeoNode } from '../loader/internal/geo-node';
|
|
2
|
+
import type { BlockInstanceBBox } from '../shared/types';
|
|
3
|
+
export interface CadPoint2D {
|
|
4
|
+
readonly x: number;
|
|
5
|
+
readonly y: number;
|
|
6
|
+
}
|
|
7
|
+
export interface CadInsertSelectionId {
|
|
8
|
+
readonly kind: 'insert';
|
|
9
|
+
readonly layerIndex: number;
|
|
10
|
+
readonly variantId: number;
|
|
11
|
+
readonly instanceId: number;
|
|
12
|
+
}
|
|
13
|
+
export interface CadInsertDetails {
|
|
14
|
+
readonly id: CadInsertSelectionId;
|
|
15
|
+
readonly label: string;
|
|
16
|
+
readonly blockName: string;
|
|
17
|
+
readonly layerName: string;
|
|
18
|
+
readonly layerIndex: number;
|
|
19
|
+
readonly tx: number;
|
|
20
|
+
readonly ty: number;
|
|
21
|
+
readonly rotation: number | null;
|
|
22
|
+
readonly scaleX: number | null;
|
|
23
|
+
readonly scaleY: number | null;
|
|
24
|
+
readonly bbox: Readonly<BlockInstanceBBox>;
|
|
25
|
+
}
|
|
26
|
+
export interface CadInsertPickOptions {
|
|
27
|
+
readonly padding?: number;
|
|
28
|
+
readonly isInstanceVisible?: (instanceId: number) => boolean;
|
|
29
|
+
readonly viewport?: Readonly<BlockInstanceBBox> | null;
|
|
30
|
+
}
|
|
31
|
+
export declare function cadInsertSelectionEquals(a: CadInsertSelectionId, b: CadInsertSelectionId): boolean;
|
|
32
|
+
/** Resolve a world-space point to the top-most selectable CAD INSERT instance. */
|
|
33
|
+
export declare function pickCadInsertAtPoint(node: GeoNode, point: CadPoint2D, options?: CadInsertPickOptions): CadInsertSelectionId | null;
|
|
34
|
+
/** Resolve stable, read-only CAD properties for an INSERT selection. */
|
|
35
|
+
export declare function resolveCadInsertDetails(node: GeoNode, id: CadInsertSelectionId): CadInsertDetails | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { GeoNode } from '../loader/internal/geo-node';
|
|
2
|
+
export interface CadPoint2D {
|
|
3
|
+
readonly x: number;
|
|
4
|
+
readonly y: number;
|
|
5
|
+
}
|
|
6
|
+
export interface CadTextSelectionId {
|
|
7
|
+
readonly kind: 'text';
|
|
8
|
+
readonly textId: number;
|
|
9
|
+
}
|
|
10
|
+
export interface CadTextDetails {
|
|
11
|
+
readonly id: CadTextSelectionId;
|
|
12
|
+
readonly content: string;
|
|
13
|
+
readonly x: number;
|
|
14
|
+
readonly y: number;
|
|
15
|
+
readonly height: number;
|
|
16
|
+
readonly rotation: number;
|
|
17
|
+
readonly layerName: string;
|
|
18
|
+
readonly layerIndex: number;
|
|
19
|
+
}
|
|
20
|
+
export interface CadTextSelection {
|
|
21
|
+
readonly documentKey: string | null;
|
|
22
|
+
readonly id: CadTextSelectionId;
|
|
23
|
+
readonly details: CadTextDetails | null;
|
|
24
|
+
}
|
|
25
|
+
export interface CadTextPickOptions {
|
|
26
|
+
/** Optional upper bound for callers that need to cap interactive scans. */
|
|
27
|
+
readonly maxTextCount?: number;
|
|
28
|
+
}
|
|
29
|
+
export declare function pickCadTextAtPoint(node: Pick<GeoNode, 'getTextEntries' | 'getLayers'>, point: CadPoint2D, options?: CadTextPickOptions): CadTextSelectionId | null;
|
|
30
|
+
export declare function resolveCadTextDetails(node: Pick<GeoNode, 'getTextEntries' | 'getLayers'>, id: CadTextSelectionId): CadTextDetails | null;
|
|
31
|
+
export declare function cadTextSelectionEquals(a: CadTextSelectionId | null, b: CadTextSelectionId | null): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ViewportRect } from '../core';
|
|
2
|
+
import type { ExternalBlockVariantManifestEntry, ExternalSceneAnnotationManifestEntry } from '../shared/types';
|
|
3
|
+
/** Copied from the product annotation idle gate. */
|
|
4
|
+
export declare const ANNOTATION_TEXT_APPEND_IDLE_DELAY_MS = 450;
|
|
5
|
+
export declare const ANNOTATION_LOAD_MAX_WORLD_UNITS_PER_PIXEL = 250;
|
|
6
|
+
export declare const ANNOTATION_VIEWPORT_PADDING_RATIO = 0.25;
|
|
7
|
+
export declare function shouldLoadSceneAnnotations(input: {
|
|
8
|
+
readonly manifestBBox: ViewportRect | null;
|
|
9
|
+
readonly viewport: ViewportRect | null;
|
|
10
|
+
readonly worldUnitsPerPixel: number;
|
|
11
|
+
}): boolean;
|
|
12
|
+
export declare function sceneManifestBBox(scene: ExternalSceneAnnotationManifestEntry | null | undefined): ViewportRect | null;
|
|
13
|
+
export declare function hasBlockAnnotationPayload(entry: ExternalBlockVariantManifestEntry): boolean;
|
|
14
|
+
export declare function isAnnotationZoomReadable(worldUnitsPerPixel: number): boolean;
|