@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
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical SceneDocument persistence.
|
|
3
|
+
*
|
|
4
|
+
* `document.json` is the single scene source. Assets and their package-relative
|
|
5
|
+
* resource descriptions are part of the document; resource bytes live in a
|
|
6
|
+
* content-addressed store keyed by SHA-256. Retired envelopes are rejected;
|
|
7
|
+
* older schema versions are rejected before current-shape validation.
|
|
8
|
+
*/
|
|
9
|
+
import type { SceneDocument } from '../doc/schema';
|
|
10
|
+
import { type StudioDocumentDomainExtension } from '../doc/domain-extensions';
|
|
11
|
+
import type { Diagnostic } from '../util/diagnostics';
|
|
12
|
+
export declare const SCENE_DOCUMENT_FILE_NAME = "document.json";
|
|
13
|
+
export declare const SCENE_DOCUMENT_FORMAT = "sim-studio.document@7";
|
|
14
|
+
export declare const SCENE_FILE_DIAGNOSTIC: {
|
|
15
|
+
readonly notJson: "SCENE_FILE_NOT_JSON";
|
|
16
|
+
readonly unsupportedFormat: "SCENE_FILE_UNSUPPORTED_FORMAT";
|
|
17
|
+
readonly unsupportedVersion: "SCENE_FILE_UNSUPPORTED_VERSION";
|
|
18
|
+
readonly migrated: "SCENE_FILE_MIGRATED";
|
|
19
|
+
readonly invalidDocument: "SCENE_FILE_INVALID_DOCUMENT";
|
|
20
|
+
};
|
|
21
|
+
export interface SceneDocumentWrite {
|
|
22
|
+
readonly text: string;
|
|
23
|
+
readonly contentHash: string;
|
|
24
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
25
|
+
}
|
|
26
|
+
export interface SceneDocumentRead {
|
|
27
|
+
readonly document: SceneDocument | null;
|
|
28
|
+
readonly contentHash: string | null;
|
|
29
|
+
/** Always null in the current strict reader. */
|
|
30
|
+
readonly migratedFrom: number | null;
|
|
31
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
32
|
+
}
|
|
33
|
+
export interface SceneDocumentCodecOptions {
|
|
34
|
+
readonly domainExtensions?: readonly StudioDocumentDomainExtension[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Normalises ordering and floating-point representation without changing scene
|
|
38
|
+
* facts. This is the canonical form used for both persistence and hashing.
|
|
39
|
+
*/
|
|
40
|
+
export declare function normalizeSceneDocument(document: SceneDocument, options?: SceneDocumentCodecOptions): SceneDocument;
|
|
41
|
+
/** Hash of immutable scene facts; mutable updatedAt metadata is excluded. */
|
|
42
|
+
export declare function calculateSceneContentHash(document: SceneDocument, options?: SceneDocumentCodecOptions): string;
|
|
43
|
+
/**
|
|
44
|
+
* Recomputes a canonical hash at a historical schema version. Persistence
|
|
45
|
+
* adapters use this only to verify pre-migration snapshots before accepting
|
|
46
|
+
* their current canonical form as pending migration.
|
|
47
|
+
*/
|
|
48
|
+
export declare function calculateSceneContentHashForVersion(document: SceneDocument, schemaVersion: number, options?: SceneDocumentCodecOptions): string;
|
|
49
|
+
export declare function serializeSceneDocument(document: SceneDocument, options?: SceneDocumentCodecOptions): SceneDocumentWrite;
|
|
50
|
+
export declare const writeSceneDocument: typeof serializeSceneDocument;
|
|
51
|
+
export declare function parseSceneDocument(text: string, options?: SceneDocumentCodecOptions): SceneDocumentRead;
|
|
52
|
+
export declare const readSceneDocument: typeof parseSceneDocument;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LoadedScenePackage, ScenePackageArtifact, ScenePackageInput, ScenePackageReadPorts } from '../project/contracts';
|
|
2
|
+
export declare class ScenePackageError extends Error {
|
|
3
|
+
readonly code: string;
|
|
4
|
+
constructor(code: string, message: string);
|
|
5
|
+
}
|
|
6
|
+
export declare function createScenePackage(input: ScenePackageInput, _ports?: ScenePackageReadPorts): Promise<ScenePackageArtifact>;
|
|
7
|
+
export { createScenePackageFromHost } from './create-scene-package-from-host';
|
|
8
|
+
export declare function readScenePackage(bytes: ArrayBuffer | Uint8Array, ports?: ScenePackageReadPorts): Promise<LoadedScenePackage>;
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { z as w, U, Z as D, _ as M, h as L, a7 as P, E as C, u as z, d as v, a as _, a3 as W, x as V } from "./scene-graph-DBLKAhxa.js";
|
|
2
|
+
const G = Object.freeze({
|
|
3
|
+
local: Object.freeze([0, 0, 0])
|
|
4
|
+
});
|
|
5
|
+
function K(n) {
|
|
6
|
+
return n.origin ?? G;
|
|
7
|
+
}
|
|
8
|
+
function k(n) {
|
|
9
|
+
const s = K(n);
|
|
10
|
+
return {
|
|
11
|
+
pivot: s,
|
|
12
|
+
local: R(s.local),
|
|
13
|
+
provenance: n.origin ? "authored" : "default"
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
const Z = Object.freeze([
|
|
17
|
+
"source",
|
|
18
|
+
"bounds-center",
|
|
19
|
+
"bounds-base",
|
|
20
|
+
"bounds-top",
|
|
21
|
+
"bounds-min-x",
|
|
22
|
+
"bounds-max-x",
|
|
23
|
+
"bounds-min-y",
|
|
24
|
+
"bounds-max-y",
|
|
25
|
+
"bounds-long-min",
|
|
26
|
+
"bounds-long-max",
|
|
27
|
+
"bounds-short-min",
|
|
28
|
+
"bounds-short-max",
|
|
29
|
+
"bounds-long-min-base",
|
|
30
|
+
"bounds-long-min-top",
|
|
31
|
+
"bounds-long-max-base",
|
|
32
|
+
"bounds-long-max-top",
|
|
33
|
+
"bounds-short-min-base",
|
|
34
|
+
"bounds-short-min-top",
|
|
35
|
+
"bounds-short-max-base",
|
|
36
|
+
"bounds-short-max-top",
|
|
37
|
+
"geometry-median",
|
|
38
|
+
"surface-center-of-mass",
|
|
39
|
+
"volume-center-of-mass"
|
|
40
|
+
]);
|
|
41
|
+
function J(n, s, o = null) {
|
|
42
|
+
if (n === "source") return [0, 0, 0];
|
|
43
|
+
if (n === "geometry-median")
|
|
44
|
+
return y(o == null ? void 0 : o.median, "GEOMETRY_MEDIAN_UNAVAILABLE");
|
|
45
|
+
if (n === "surface-center-of-mass")
|
|
46
|
+
return y(o == null ? void 0 : o.surfaceCenterOfMass, "SURFACE_CENTER_OF_MASS_UNAVAILABLE");
|
|
47
|
+
if (n === "volume-center-of-mass")
|
|
48
|
+
return y(o == null ? void 0 : o.volumeCenterOfMass, "VOLUME_CENTER_OF_MASS_UNAVAILABLE");
|
|
49
|
+
if (!s) throw new Error("BOUNDS_UNAVAILABLE");
|
|
50
|
+
const e = O(s);
|
|
51
|
+
switch (n) {
|
|
52
|
+
case "bounds-center":
|
|
53
|
+
return e;
|
|
54
|
+
case "bounds-base":
|
|
55
|
+
return [e[0], e[1], s.min[2]];
|
|
56
|
+
case "bounds-top":
|
|
57
|
+
return [e[0], e[1], s.max[2]];
|
|
58
|
+
case "bounds-min-x":
|
|
59
|
+
return [s.min[0], e[1], e[2]];
|
|
60
|
+
case "bounds-max-x":
|
|
61
|
+
return [s.max[0], e[1], e[2]];
|
|
62
|
+
case "bounds-min-y":
|
|
63
|
+
return [e[0], s.min[1], e[2]];
|
|
64
|
+
case "bounds-max-y":
|
|
65
|
+
return [e[0], s.max[1], e[2]];
|
|
66
|
+
case "bounds-long-min":
|
|
67
|
+
case "bounds-long-max":
|
|
68
|
+
case "bounds-short-min":
|
|
69
|
+
case "bounds-short-max":
|
|
70
|
+
case "bounds-long-min-base":
|
|
71
|
+
case "bounds-long-min-top":
|
|
72
|
+
case "bounds-long-max-base":
|
|
73
|
+
case "bounds-long-max-top":
|
|
74
|
+
case "bounds-short-min-base":
|
|
75
|
+
case "bounds-short-min-top":
|
|
76
|
+
case "bounds-short-max-base":
|
|
77
|
+
case "bounds-short-max-top": {
|
|
78
|
+
const a = T(s)[0] >= T(s)[1], l = n.includes("-max"), m = n.startsWith("bounds-long") === a, d = n.endsWith("-base") ? s.min[2] : n.endsWith("-top") ? s.max[2] : e[2];
|
|
79
|
+
return m ? [e[0], l ? s.max[1] : s.min[1], d] : [l ? s.max[0] : s.min[0], e[1], d];
|
|
80
|
+
}
|
|
81
|
+
default:
|
|
82
|
+
return [0, 0, 0];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function T(n) {
|
|
86
|
+
return [
|
|
87
|
+
n.max[0] - n.min[0],
|
|
88
|
+
n.max[1] - n.min[1],
|
|
89
|
+
n.max[2] - n.min[2]
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
function O(n) {
|
|
93
|
+
return [0, 1, 2].map((s) => (n.min[s] + n.max[s]) / 2);
|
|
94
|
+
}
|
|
95
|
+
function Y(n) {
|
|
96
|
+
return Array.from(
|
|
97
|
+
{ length: 8 },
|
|
98
|
+
(s, o) => [
|
|
99
|
+
n[o & 1 ? "max" : "min"][0],
|
|
100
|
+
n[o & 2 ? "max" : "min"][1],
|
|
101
|
+
n[o & 4 ? "max" : "min"][2]
|
|
102
|
+
]
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
function F(n, s) {
|
|
106
|
+
return M(
|
|
107
|
+
s.rotation,
|
|
108
|
+
n.map((e, t) => e * s.scale[t])
|
|
109
|
+
).map((e, t) => {
|
|
110
|
+
const a = e + s.position[t];
|
|
111
|
+
return a === 0 ? 0 : a;
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function N(n, s) {
|
|
115
|
+
const o = Y(n).map((e) => F(e, s));
|
|
116
|
+
return {
|
|
117
|
+
min: [0, 1, 2].map((e) => Math.min(...o.map((t) => t[e]))),
|
|
118
|
+
max: [0, 1, 2].map((e) => Math.max(...o.map((t) => t[e])))
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function x(n) {
|
|
122
|
+
return n.length ? {
|
|
123
|
+
min: [0, 1, 2].map((s) => Math.min(...n.map((o) => o.min[s]))),
|
|
124
|
+
max: [0, 1, 2].map((s) => Math.max(...n.map((o) => o.max[s])))
|
|
125
|
+
} : null;
|
|
126
|
+
}
|
|
127
|
+
function E(n, s) {
|
|
128
|
+
var o, e;
|
|
129
|
+
switch (s.nodeType) {
|
|
130
|
+
case "asset":
|
|
131
|
+
return ((o = z(n, s.assetRevisionId)) == null ? void 0 : o.bounds) ?? null;
|
|
132
|
+
case "visual":
|
|
133
|
+
return ((e = C(n, s.visualRevisionId)) == null ? void 0 : e.bounds) ?? null;
|
|
134
|
+
case "domain":
|
|
135
|
+
return s.bounds ?? null;
|
|
136
|
+
case "placeholder":
|
|
137
|
+
return {
|
|
138
|
+
min: s.size.map((t) => -t / 2),
|
|
139
|
+
max: s.size.map((t) => t / 2)
|
|
140
|
+
};
|
|
141
|
+
case "group":
|
|
142
|
+
return x(
|
|
143
|
+
s.children.flatMap((t) => {
|
|
144
|
+
const a = E(n, t);
|
|
145
|
+
return a ? [N(a, L(
|
|
146
|
+
t.localTransform,
|
|
147
|
+
P(t)
|
|
148
|
+
))] : [];
|
|
149
|
+
})
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function I(n, s, o, e) {
|
|
154
|
+
const t = w(n.root, s);
|
|
155
|
+
if (!t) return null;
|
|
156
|
+
const a = U(n.root, s), l = D(n.root, s);
|
|
157
|
+
if (!a || !l) return null;
|
|
158
|
+
let u = (e == null ? void 0 : e(s)) ?? E(n, t);
|
|
159
|
+
const m = (o == null ? void 0 : o(s)) ?? null, d = t.nodeType === "group" ? t.children.map(
|
|
160
|
+
(i) => I(n, i.nodeId, o, e)
|
|
161
|
+
) : [];
|
|
162
|
+
!u && t.nodeType === "group" && (u = x(
|
|
163
|
+
d.flatMap(
|
|
164
|
+
(i) => i != null && i.localBounds ? [N(i.localBounds, i.localTransform)] : []
|
|
165
|
+
)
|
|
166
|
+
));
|
|
167
|
+
const p = m ?? (t.nodeType === "group" ? x(d.flatMap((i) => i != null && i.worldBounds ? [i.worldBounds] : [])) : u ? N(u, l) : null), h = m || d.some((i) => (i == null ? void 0 : i.boundsSource) === "runtime") ? "runtime" : p ? "document" : "unknown", b = k(t), f = F(b.local, l), g = a.position, r = M(t.localTransform.rotation, [0, 0, 1]), c = M(a.rotation, [0, 0, 1]);
|
|
168
|
+
return S({
|
|
169
|
+
nodeId: s,
|
|
170
|
+
nodeType: t.nodeType,
|
|
171
|
+
localTransform: t.localTransform,
|
|
172
|
+
worldTransform: a,
|
|
173
|
+
localBounds: u,
|
|
174
|
+
worldBounds: p,
|
|
175
|
+
boundsCenter: p ? O(p) : null,
|
|
176
|
+
boundsSource: h,
|
|
177
|
+
pivot: {
|
|
178
|
+
value: g,
|
|
179
|
+
source: "node-origin"
|
|
180
|
+
},
|
|
181
|
+
sourcePivot: { value: null, source: "unknown" },
|
|
182
|
+
sourceOrigin: {
|
|
183
|
+
local: [0, 0, 0],
|
|
184
|
+
world: l.position.map((i) => i === 0 ? 0 : i),
|
|
185
|
+
provenance: "asset-local"
|
|
186
|
+
},
|
|
187
|
+
origin: {
|
|
188
|
+
...b,
|
|
189
|
+
world: f
|
|
190
|
+
},
|
|
191
|
+
orientation: {
|
|
192
|
+
localUpAxis: [0, 0, 1],
|
|
193
|
+
parentUpDirection: r,
|
|
194
|
+
worldUpDirection: c,
|
|
195
|
+
preset: j(r)
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
function X(n, s) {
|
|
200
|
+
const o = [...new Set(s)].filter(
|
|
201
|
+
(t) => t !== n.root.nodeId && w(n.root, t)
|
|
202
|
+
), e = new Set(o);
|
|
203
|
+
return o.filter(
|
|
204
|
+
(t) => !W(n.root, t).slice(0, -1).some((a) => e.has(a.nodeId))
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
function H(n, s, o) {
|
|
208
|
+
const e = X(n, s), t = x(
|
|
209
|
+
e.flatMap((l) => {
|
|
210
|
+
var m;
|
|
211
|
+
const u = (m = I(n, l, o)) == null ? void 0 : m.worldBounds;
|
|
212
|
+
return u ? [u] : [];
|
|
213
|
+
})
|
|
214
|
+
), a = t ? O(t) : null;
|
|
215
|
+
return S({
|
|
216
|
+
nodeIds: e,
|
|
217
|
+
worldBounds: t,
|
|
218
|
+
boundsCenter: a,
|
|
219
|
+
pivot: { value: a, source: a ? "bounds-center" : "unknown" }
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
function Q(n, s, o) {
|
|
223
|
+
const e = w(n.root, s);
|
|
224
|
+
if (!e) return null;
|
|
225
|
+
const t = o ?? E(n, e), a = t ? T(t) : null, l = e.nodeType === "group" ? "GROUP_DIMENSIONS" : t ? a.some((u) => !Number.isFinite(u) || u <= 1e-12) ? "DEGENERATE_BOUNDS" : null : "BOUNDS_UNAVAILABLE";
|
|
226
|
+
return S({
|
|
227
|
+
nodeId: s,
|
|
228
|
+
revisionId: e.nodeType === "asset" ? e.assetRevisionId : e.nodeType === "visual" ? e.visualRevisionId : null,
|
|
229
|
+
units: "m",
|
|
230
|
+
source: o ? "runtime" : t ? "document" : "unknown",
|
|
231
|
+
dimensions: a ? a.map(
|
|
232
|
+
(u, m) => u * Math.abs(e.localTransform.scale[m])
|
|
233
|
+
) : null,
|
|
234
|
+
sourceDimensions: a,
|
|
235
|
+
scale: e.localTransform.scale,
|
|
236
|
+
editable: l === null,
|
|
237
|
+
reason: l
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
function S(n) {
|
|
241
|
+
return v(_(n));
|
|
242
|
+
}
|
|
243
|
+
function R(n) {
|
|
244
|
+
return [n[0], n[1], n[2]];
|
|
245
|
+
}
|
|
246
|
+
function y(n, s) {
|
|
247
|
+
if (!n || n.some((o) => !Number.isFinite(o)))
|
|
248
|
+
throw new Error(s);
|
|
249
|
+
return R(n);
|
|
250
|
+
}
|
|
251
|
+
function j(n) {
|
|
252
|
+
const s = Math.hypot(...n);
|
|
253
|
+
if (!Number.isFinite(s) || s <= 1e-12) return null;
|
|
254
|
+
const o = n.map((t) => t / s), e = 1e-6;
|
|
255
|
+
return Math.abs(o[0] - 1) <= e && Math.abs(o[1]) <= e && Math.abs(o[2]) <= e ? "+X" : Math.abs(o[0]) <= e && Math.abs(o[1] - 1) <= e && Math.abs(o[2]) <= e ? "+Y" : Math.abs(o[0]) <= e && Math.abs(o[1]) <= e && Math.abs(o[2] - 1) <= e ? "+Z" : null;
|
|
256
|
+
}
|
|
257
|
+
function $(n, s, o) {
|
|
258
|
+
var b, f, g;
|
|
259
|
+
const e = V(n, s);
|
|
260
|
+
if (!e) return null;
|
|
261
|
+
const t = o == null ? void 0 : o.physicsRuntime, a = t ? t.bodies.filter((r) => t.worldKind === "asset-session" || r.instanceId === s).map((r) => {
|
|
262
|
+
var c;
|
|
263
|
+
return {
|
|
264
|
+
id: r.id,
|
|
265
|
+
name: r.name,
|
|
266
|
+
sourcePath: r.sourcePath,
|
|
267
|
+
motionType: r.motionType,
|
|
268
|
+
massKg: r.mass,
|
|
269
|
+
centerOfMassM: r.centerOfMass,
|
|
270
|
+
centerOfMassFrame: "world",
|
|
271
|
+
principalInertiaKgM2: r.inertia,
|
|
272
|
+
inertiaFrame: "body-principal",
|
|
273
|
+
inertiaOrientationWorld: ((c = r.inertiaOrientationWorld) == null ? void 0 : c.length) === 9 ? r.inertiaOrientationWorld : null
|
|
274
|
+
};
|
|
275
|
+
}) : null, l = t ? t.joints.filter((r) => t.worldKind === "asset-session" || r.instanceId === s).map((r) => {
|
|
276
|
+
var c;
|
|
277
|
+
return {
|
|
278
|
+
name: r.name,
|
|
279
|
+
type: r.type,
|
|
280
|
+
position: r.position,
|
|
281
|
+
velocity: r.velocity,
|
|
282
|
+
range: r.range,
|
|
283
|
+
axis: ((c = r.axisWorld) == null ? void 0 : c.length) === 3 ? r.axisWorld : null,
|
|
284
|
+
axisFrame: "world"
|
|
285
|
+
};
|
|
286
|
+
}) : null, u = A((b = o == null ? void 0 : o.visualDiagnostics) == null ? void 0 : b.usd), m = A(u == null ? void 0 : u.physics), d = m == null ? void 0 : m.colliders, p = Array.isArray(d) ? d.flatMap((r) => {
|
|
287
|
+
const c = A(r);
|
|
288
|
+
return typeof (c == null ? void 0 : c.path) == "string" ? [
|
|
289
|
+
{
|
|
290
|
+
path: c.path,
|
|
291
|
+
geometryType: typeof c.typeName == "string" ? c.typeName : null,
|
|
292
|
+
source: "asset-inspection"
|
|
293
|
+
}
|
|
294
|
+
] : [];
|
|
295
|
+
}) : ((f = e.physics.colliderPrimPaths) == null ? void 0 : f.map((r) => ({
|
|
296
|
+
path: r,
|
|
297
|
+
geometryType: null,
|
|
298
|
+
source: "override"
|
|
299
|
+
}))) ?? null, h = {
|
|
300
|
+
nodeId: s,
|
|
301
|
+
coordinateSystem: n.coordinateSystem,
|
|
302
|
+
authored: { physics: e.physics, initialJoints: ((g = e.initialPose) == null ? void 0 : g.joints) ?? null },
|
|
303
|
+
colliders: p,
|
|
304
|
+
bodies: a,
|
|
305
|
+
joints: l,
|
|
306
|
+
runtime: t ? {
|
|
307
|
+
source: t.worldKind,
|
|
308
|
+
status: t.status,
|
|
309
|
+
time: t.time,
|
|
310
|
+
timestepSeconds: t.timestep
|
|
311
|
+
} : null,
|
|
312
|
+
unavailable: [
|
|
313
|
+
...p ? [] : ["colliders"],
|
|
314
|
+
...a ? [] : ["bodies"],
|
|
315
|
+
...l ? [] : ["joints"]
|
|
316
|
+
]
|
|
317
|
+
};
|
|
318
|
+
return v(_(h));
|
|
319
|
+
}
|
|
320
|
+
function A(n) {
|
|
321
|
+
return n && typeof n == "object" && !Array.isArray(n) ? n : null;
|
|
322
|
+
}
|
|
323
|
+
export {
|
|
324
|
+
G as D,
|
|
325
|
+
Z as N,
|
|
326
|
+
I as a,
|
|
327
|
+
$ as b,
|
|
328
|
+
H as c,
|
|
329
|
+
J as d,
|
|
330
|
+
E as e,
|
|
331
|
+
O as f,
|
|
332
|
+
Q as g,
|
|
333
|
+
Y as h,
|
|
334
|
+
K as n,
|
|
335
|
+
k as r,
|
|
336
|
+
F as t
|
|
337
|
+
};
|