@nebula-spatial/viewer 0.5.5 → 0.5.7
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/CHANGELOG.md +80 -0
- package/README.md +142 -7
- package/USD-VISUAL-MATERIAL-SUPPORT.md +14 -3
- package/basis/basis_transcoder.js +19 -0
- package/basis/basis_transcoder.wasm +0 -0
- package/dist/assets/ground-grid.d.ts +6 -0
- package/dist/assets/types.d.ts +49 -0
- package/dist/assets/usd-worker-B-HuMXLo.js +1505 -0
- package/dist/collision-debug-B2CISPB9.js +792 -0
- package/dist/index-BTAC6njT.js +10123 -0
- package/dist/index.d.ts +10 -2
- package/dist/index.js +17 -12
- package/dist/inspection/types.d.ts +79 -2
- package/dist/{mjcf-visual-zWaLqVqd.js → mjcf-visual-BVT3h87h.js} +7 -7
- package/dist/mujoco-runtime-CAyK0LHM.js +698 -0
- package/dist/resources-CHhCm2f7.js +27 -0
- package/dist/session-BQ8eCFRL.js +786 -0
- package/dist/{session-DVCZX72J.js → session-Dwoi1H46.js} +6 -5
- package/dist/simulation/mujoco-wasm-module.d.ts +11 -0
- package/dist/simulation/openusd-wasm-module.d.ts +10 -0
- package/dist/simulation/usd-query.d.ts +50 -0
- package/dist/simulation/usd-resource-policy.d.ts +28 -0
- package/dist/{stage-DGMYxyAS.js → stage-DUC-YNhD.js} +158 -170
- package/dist/{urdf-session-CF8xOenk.js → urdf-session-E0Nnr4Vs.js} +559 -546
- package/dist/usd-session-BUD3KtCr.js +6875 -0
- package/dist/version.d.ts +1 -1
- package/dist/{xacro-DidnrxXF.js → xacro-F7rdDouN.js} +1 -1
- package/openusd/openusd-runtime-manifest.json +15 -0
- package/openusd/openusd_probe.js +14 -14
- package/openusd/openusd_probe.wasm +0 -0
- package/package.json +5 -2
- package/dist/index-bTlVsOHA.js +0 -8165
- package/dist/mujoco-runtime-DTxVmIzc.js +0 -349
- package/dist/session-CZghJvw6.js +0 -883
- package/dist/usd-session-DkwOFmds.js +0 -4254
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { DataTexture as N, LinearMipmapLinearFilter as re, LinearFilter as se, LoadingManager as oe, Loader as ae, Texture as C, TextureLoader as ie, LinearSRGBColorSpace as V, SRGBColorSpace as le, RGBAFormat as K, UnsignedByteType as J, NoColorSpace as ce, Mesh as ue, MeshPhysicalMaterial as Z, MeshPhongMaterial as k, MeshLambertMaterial as fe, Color as _, Group as pe, Box3 as de, Vector3 as he } from "three";
|
|
2
2
|
import { DRACOLoader as me } from "three/examples/jsm/loaders/DRACOLoader.js";
|
|
3
3
|
import { GLTFLoader as ge } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
4
|
-
import { D as ye } from "./index-
|
|
5
|
-
import { d as Y, a as q, S as we
|
|
4
|
+
import { D as ye } from "./index-BTAC6njT.js";
|
|
5
|
+
import { d as Y, a as q, S as we } from "./stage-DUC-YNhD.js";
|
|
6
6
|
import { TGALoader as be } from "three/examples/jsm/loaders/TGALoader.js";
|
|
7
7
|
import { FBXLoader as xe } from "three/examples/jsm/loaders/FBXLoader.js";
|
|
8
8
|
import { unzlibSync as Ee } from "three/examples/jsm/libs/fflate.module.js";
|
|
9
|
+
import { disposeModelResources as j } from "./resources-CHhCm2f7.js";
|
|
9
10
|
const Me = 16 * 1024 * 1024;
|
|
10
11
|
function Q(e, t) {
|
|
11
12
|
if (!e || !t || e * t > Me) throw new Error("Invalid or oversized image dimensions (maximum 16M pixels).");
|
|
@@ -179,7 +180,7 @@ async function Ae(e, t, n) {
|
|
|
179
180
|
return d = new xe(o).parse(e, ""), await Promise.all(f), t.signal.throwIfAborted(), { root: d, textures: h, textureFailures: y };
|
|
180
181
|
} catch (w) {
|
|
181
182
|
if (s.abort(w), await Promise.allSettled(f), d) {
|
|
182
|
-
const { disposeModelResources: u } = await import("./
|
|
183
|
+
const { disposeModelResources: u } = await import("./resources-CHhCm2f7.js");
|
|
183
184
|
u(d, h);
|
|
184
185
|
} else for (const u of h) u.dispose();
|
|
185
186
|
throw w;
|
|
@@ -848,7 +849,7 @@ function We(e, t, n, s, r, c = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ ne
|
|
|
848
849
|
};
|
|
849
850
|
return u.userData.fbxConversionReport = v, u.visible = e.visible, u.toneMapped = e.toneMapped, u.clippingPlanes = e.clippingPlanes, u.clipIntersection = e.clipIntersection, u.clipShadows = e.clipShadows, u.polygonOffset = e.polygonOffset, u.polygonOffsetFactor = e.polygonOffsetFactor, u.polygonOffsetUnits = e.polygonOffsetUnits, u.dithering = e.dithering, u.needsUpdate = !0, t.set(e, u), u;
|
|
850
851
|
}
|
|
851
|
-
function
|
|
852
|
+
function at(e, t) {
|
|
852
853
|
let n = !1, s = null, r = null, c = "z", i, f = null, h;
|
|
853
854
|
const g = () => {
|
|
854
855
|
n = !0;
|
|
@@ -960,5 +961,5 @@ function G() {
|
|
|
960
961
|
return Object.assign(new Error("Model load aborted."), { name: "AbortError", code: "E_ABORTED" });
|
|
961
962
|
}
|
|
962
963
|
export {
|
|
963
|
-
|
|
964
|
+
at as createModelSession
|
|
964
965
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface MujocoWasmCompileOptions {
|
|
2
|
+
readonly mujocoBaseUrl?: string;
|
|
3
|
+
readonly signal?: AbortSignal;
|
|
4
|
+
}
|
|
5
|
+
/** Resolves the same MuJoCo WASM URL used by `MujocoRuntime.initialize`. */
|
|
6
|
+
export declare function resolveMujocoWasmUrl(mujocoBaseUrl?: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Downloads and compiles the configured MuJoCo WASM. Caching and sharing are
|
|
9
|
+
* owned by the caller; this function creates no global cache.
|
|
10
|
+
*/
|
|
11
|
+
export declare function compileMujocoWasmModule(options?: MujocoWasmCompileOptions): Promise<WebAssembly.Module>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface OpenUsdWasmCompileOptions {
|
|
2
|
+
readonly openUsdBaseUrl?: string;
|
|
3
|
+
readonly openUsdRuntimeId?: string;
|
|
4
|
+
readonly signal?: AbortSignal;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Downloads and compiles the configured OpenUSD Probe. Caching and sharing are
|
|
8
|
+
* owned by the caller; this function creates no global cache.
|
|
9
|
+
*/
|
|
10
|
+
export declare function compileOpenUsdWasmModule(options?: OpenUsdWasmCompileOptions): Promise<WebAssembly.Module>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { USDLoadedModel } from '@openusd-wasm/three-loader';
|
|
2
|
+
export interface UsdPrimInfo {
|
|
3
|
+
valid: boolean;
|
|
4
|
+
name: string;
|
|
5
|
+
path: string;
|
|
6
|
+
typeName: string;
|
|
7
|
+
instance: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface UsdAttributeValue {
|
|
10
|
+
valid: boolean;
|
|
11
|
+
authored: boolean;
|
|
12
|
+
value: unknown;
|
|
13
|
+
}
|
|
14
|
+
export interface UsdMetadataValue {
|
|
15
|
+
valid: boolean;
|
|
16
|
+
found: boolean;
|
|
17
|
+
value?: unknown;
|
|
18
|
+
text?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface UsdBoundMaterial {
|
|
21
|
+
found: boolean;
|
|
22
|
+
materialPath: string;
|
|
23
|
+
resolvedTargetPath: string;
|
|
24
|
+
bindingRelationshipPath: string;
|
|
25
|
+
}
|
|
26
|
+
export interface UsdAttributeRequest {
|
|
27
|
+
path: string;
|
|
28
|
+
names: readonly string[];
|
|
29
|
+
}
|
|
30
|
+
export type UsdAttributeValuesByPath = Record<string, Record<string, UsdAttributeValue>>;
|
|
31
|
+
/** Synchronous-in-process and asynchronous-in-worker access to a live USD stage. */
|
|
32
|
+
export interface UsdQuery {
|
|
33
|
+
stageMetadata(name: string): Promise<UsdMetadataValue>;
|
|
34
|
+
primInfo(path: string): Promise<UsdPrimInfo>;
|
|
35
|
+
primChildren(path: string): Promise<string[]>;
|
|
36
|
+
primDescendants(path: string, typeName?: string): Promise<string[]>;
|
|
37
|
+
primAttributes(path: string): Promise<string[]>;
|
|
38
|
+
primMetadata(path: string, name: string): Promise<UsdMetadataValue>;
|
|
39
|
+
relationshipTargets(path: string, name: string): Promise<string[]>;
|
|
40
|
+
attributeValue(path: string, name: string): Promise<UsdAttributeValue>;
|
|
41
|
+
attributeValues(requests: readonly UsdAttributeRequest[]): Promise<UsdAttributeValuesByPath>;
|
|
42
|
+
attributeMetadata(path: string, name: string, field: string): Promise<UsdMetadataValue>;
|
|
43
|
+
attributeConnections(path: string, name: string): Promise<string[]>;
|
|
44
|
+
boundMaterial(path: string): Promise<UsdBoundMaterial>;
|
|
45
|
+
}
|
|
46
|
+
export interface QueryableUsdModel extends USDLoadedModel {
|
|
47
|
+
usdQuery?: UsdQuery;
|
|
48
|
+
}
|
|
49
|
+
export declare function createStageQuery(stage: any, pxr: any): UsdQuery;
|
|
50
|
+
export declare function getUsdQuery(model: USDLoadedModel): UsdQuery | null;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read policy for USD composition resources.
|
|
3
|
+
*
|
|
4
|
+
* The viewer never inspects host error messages: only stable `code` values (or
|
|
5
|
+
* the HTTP status those messages carry) decide whether a failed reference is a
|
|
6
|
+
* degraded visual resource or a real load failure. Denial, authentication
|
|
7
|
+
* failure, cancellation and unclassified faults always stay fatal.
|
|
8
|
+
*/
|
|
9
|
+
export type UsdResourceFailureKind = 'missing' | 'invalid' | 'unavailable' | 'denied' | 'aborted' | 'unknown';
|
|
10
|
+
/** Stable codes a host resolver may attach to a rejected resource read. */
|
|
11
|
+
export declare const USD_RESOURCE_NOT_FOUND = "E_ASSET_RESOURCE_NOT_FOUND";
|
|
12
|
+
export declare const USD_RESOURCE_INVALID = "E_ASSET_RESOURCE_INVALID";
|
|
13
|
+
export declare const USD_RESOURCE_FETCH = "E_ASSET_FETCH";
|
|
14
|
+
export declare const USD_RESOURCE_EXTERNAL_DENIED = "E_ASSET_EXTERNAL_DENIED";
|
|
15
|
+
export declare const USD_RESOURCE_AUTH = "E_ASSET_AUTH";
|
|
16
|
+
/**
|
|
17
|
+
* Only recognized visual resources may degrade. Everything else — USD layers,
|
|
18
|
+
* MDL modules, unknown file types — keeps its failure.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isDegradableUsdResource(identifier: string): boolean;
|
|
21
|
+
export declare function codedUsdResourceError(message: string, code: string): Error;
|
|
22
|
+
export declare function classifyUsdResourceFailure(error: unknown): UsdResourceFailureKind;
|
|
23
|
+
/** Host denial, auth failure, cancellation and unknown faults are never swallowed. */
|
|
24
|
+
export declare function isDegradableUsdResourceFailure(error: unknown): boolean;
|
|
25
|
+
/** A 2xx status does not make an HTML error page or an empty body a usable resource. */
|
|
26
|
+
export declare function invalidUsdResourceContent(contentType: string | null, bytes: Uint8Array): string | null;
|
|
27
|
+
/** Blob equivalent of {@link invalidUsdResourceContent}, reading only a short prefix. */
|
|
28
|
+
export declare function invalidUsdResourceBlob(blob: Blob): Promise<string | null>;
|