@nebula-spatial/viewer 0.6.3 → 0.6.4

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 CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this package are documented in this file.
4
4
 
5
+ ## 0.6.4
6
+
7
+ ### Changed
8
+
9
+ - `probeUsdDependencies()` 现在会读取并返回二进制材质层引用的纹理字节,使包含 `.usdc` 材质的 USD 包能够建立完整资源闭包;导出类型和返回结构保持不变。
10
+
5
11
  ## 0.6.3
6
12
 
7
13
  ### Added
@@ -1,7 +1,7 @@
1
1
  var ot = Object.defineProperty;
2
2
  var at = (e, t, n) => t in e ? ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var j = (e, t, n) => at(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { F as lt, G as T, H as Q, I as ct, J as ut, K as ft, U as dt, s as ht } from "./index-8NPEYTG6.js";
4
+ import { F as lt, G as T, H as Q, I as ct, J as ut, K as ft, U as dt, s as ht } from "./index-QdE4B8Hz.js";
5
5
  import { Vector3 as Z } from "three";
6
6
  const mt = /* @__PURE__ */ new Set([
7
7
  "E_MJCF_INCLUDE_CYCLE",
@@ -12,7 +12,7 @@ import { createCadDocumentSession as Vl, getCadDocumentRenderResource as Ul, for
12
12
  import { CSS2DObject as $l, CSS2DRenderer as Gl } from "three/addons/renderers/CSS2DRenderer.js";
13
13
  import { viewerRuntimeAssetUrls as gs } from "@nebula-spatial/viewer/runtime-assets";
14
14
  import Hl from "@mujoco/mujoco/mujoco.wasm?url";
15
- const ql = "0.6.3", Wl = "@nebula-spatial/viewer", vs = "__NEBULA_SPATIAL_VIEWER_BANNER_PRINTED__";
15
+ const ql = "0.6.4", Wl = "@nebula-spatial/viewer", vs = "__NEBULA_SPATIAL_VIEWER_BANNER_PRINTED__";
16
16
  function bs() {
17
17
  const n = `%c ${Wl} %c v${ql} `;
18
18
  console.log(n, "background:#111827;color:#ffffff;padding:4px 10px;border-radius:4px 0 0 4px;font-weight:700;", "background:#10B981;color:#ffffff;padding:4px 10px;border-radius:0 4px 4px 0;font-weight:700;");
@@ -10272,7 +10272,7 @@ const Hh = {
10272
10272
  clearColor: lt.dark
10273
10273
  },
10274
10274
  async createSession(e, t) {
10275
- const { createModelSession: i } = await import("./session-ChdKFNGE.js");
10275
+ const { createModelSession: i } = await import("./session-DDGiY6I8.js");
10276
10276
  return i(e, t);
10277
10277
  }
10278
10278
  });
@@ -10356,7 +10356,7 @@ const Kh = {
10356
10356
  clearColor: lt.dark
10357
10357
  },
10358
10358
  async createSession(e, t) {
10359
- const { createSimulationSession: i } = await import("./session-CEVNCYOy.js");
10359
+ const { createSimulationSession: i } = await import("./session-BSSjaFpR.js");
10360
10360
  return i(e, t);
10361
10361
  }
10362
10362
  });
@@ -11355,7 +11355,7 @@ const Cp = {
11355
11355
  return t === "ply" ? { format: "ply" } : t === "spz" ? { format: "gaussian-spz" } : t === "splat" ? { format: "splat" } : t === "ksplat" ? { format: "ksplat" } : t === "sog" || (s = e.entryPath) != null && s.toLowerCase().endsWith(".sog.zip") ? { format: "sog" } : t === "rad" ? { format: "rad" } : null;
11356
11356
  },
11357
11357
  async createSession(e, t) {
11358
- const { createVisualSession: i } = await import("./session-CorUzvdX.js");
11358
+ const { createVisualSession: i } = await import("./session-b0epJBBq.js");
11359
11359
  return i(e, t);
11360
11360
  }
11361
11361
  });
@@ -15377,7 +15377,7 @@ function xm(n, e, t) {
15377
15377
  }
15378
15378
  let O = null, j = null;
15379
15379
  try {
15380
- const H = rm(T, a.environment), { MujocoRuntime: ee } = await import("./mujoco-runtime-DiiANmuc.js");
15380
+ const H = rm(T, a.environment), { MujocoRuntime: ee } = await import("./mujoco-runtime-BGh1TiiB.js");
15381
15381
  if (O = new ee(), await O.initialize(H.physics, {
15382
15382
  baseUrl: e.mujocoBaseUrl,
15383
15383
  wasmModule: e.mujocoWasmModule
@@ -17365,7 +17365,7 @@ function Hg(n = {}) {
17365
17365
  }
17366
17366
  let ga = null;
17367
17367
  function qg() {
17368
- return ga ?? (ga = import("./usd-session-DAQ4VHuu.js").then(() => {
17368
+ return ga ?? (ga = import("./usd-session-CU8fHxm9.js").then(() => {
17369
17369
  })), ga;
17370
17370
  }
17371
17371
  function qm(n) {
@@ -17850,6 +17850,7 @@ async function tv(n) {
17850
17850
  fileName: ag(n.entryPath),
17851
17851
  autoResolveAssets: !0,
17852
17852
  collectTextureUrls: !0,
17853
+ readTextureBytes: !0,
17853
17854
  externalReferenceMode: "complete",
17854
17855
  selectMuJoCoPhysicsVariant: !0,
17855
17856
  maxFiles: 4096,
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as s, I as o, V as r, J as n, U as t, H as i, W as c, X as U, Y as d, Z as S, _ as E, $ as _, a0 as D, a1 as l, a2 as R, L as m, a3 as p, a4 as u, m as C, a5 as O, a6 as I, a7 as V, a8 as G, a9 as T, aa as f, ab as N } from "./index-8NPEYTG6.js";
1
+ import { D as s, I as o, V as r, J as n, U as t, H as i, W as c, X as U, Y as d, Z as S, _ as E, $ as _, a0 as D, a1 as l, a2 as R, L as m, a3 as p, a4 as u, m as C, a5 as O, a6 as I, a7 as V, a8 as G, a9 as T, aa as f, ab as N } from "./index-QdE4B8Hz.js";
2
2
  import { configureCadTextBuilder as x } from "@nebula-spatial/cad-loader";
3
3
  export {
4
4
  s as DEFAULT_GROUND_GRID_SCALE,
@@ -1,4 +1,4 @@
1
- import { O as v, T as E, d as z } from "./index-8NPEYTG6.js";
1
+ import { O as v, T as E, d as z } from "./index-QdE4B8Hz.js";
2
2
  import { Group as q, Euler as G, BoxGeometry as N, SphereGeometry as P, CylinderGeometry as $, CapsuleGeometry as I, PlaneGeometry as X, Mesh as j } from "three";
3
3
  function D(f) {
4
4
  const y = f.extension.documents, l = new q();
@@ -3,7 +3,7 @@ var B = (p, t, e) => t in p ? P(p, t, { enumerable: !0, configurable: !0, writab
3
3
  var j = (p, t, e) => B(p, typeof t != "symbol" ? t + "" : t, e);
4
4
  import L from "@mujoco/mujoco";
5
5
  import { Quaternion as D, Vector3 as w } from "three";
6
- import { e as C, y as R } from "./index-8NPEYTG6.js";
6
+ import { e as C, y as R } from "./index-QdE4B8Hz.js";
7
7
  let V = 0;
8
8
  function z(p, t) {
9
9
  const e = `/viewer-simulation-${++V}`;
@@ -1,6 +1,6 @@
1
- import { c as Fe, b as qe, S as Te, w as Je, d as Oe, p as ie, a as ke } from "./asset-ir-CTNCY5IT.js";
2
- import { D as Ne, B as ne, d as Le, E as Ce, S as Re } from "./index-8NPEYTG6.js";
3
- import { a as Ie, r as Ve } from "./spark-renderer-B_L1Xkr2.js";
1
+ import { c as Fe, b as qe, S as Te, w as Je, d as Oe, p as ie, a as ke } from "./asset-ir-CodOg3S4.js";
2
+ import { D as Ne, B as ne, d as Le, E as Ce, S as Re } from "./index-QdE4B8Hz.js";
3
+ import { a as Ie, r as Ve } from "./spark-renderer-upJSRoni.js";
4
4
  const Q = 0.7, ue = 0.2, Ue = 110 * Math.PI / 180;
5
5
  function $e(l, e = {}) {
6
6
  const b = l.getSnapshot();
@@ -257,7 +257,7 @@ function er(l, e) {
257
257
  const k = e.format;
258
258
  if (k === "usd" || k === "usda" || k === "usdc" || k === "usdz") {
259
259
  (s = e.reportProgress) == null || s.call(e, "usd-visual", "正在解析 USD 视觉场景...");
260
- const o = await (await import("./usd-session-DAQ4VHuu.js")).loadUsdSimulation(l, e, b);
260
+ const o = await (await import("./usd-session-CU8fHxm9.js")).loadUsdSimulation(l, e, b);
261
261
  if (p || e.signal.aborted)
262
262
  throw o.dispose(), fe();
263
263
  D = o, n = { root: o.visual.root, sync() {
@@ -276,7 +276,7 @@ function er(l, e) {
276
276
  }
277
277
  if (k === "urdf" || k === "xacro") {
278
278
  (E = e.reportProgress) == null || E.call(e, "urdf", "正在解析 URDF 场景与运动学结构...");
279
- const o = await (await import("./urdf-session-VIU_OO_x.js")).loadUrdfSimulation(l, e, b);
279
+ const o = await (await import("./urdf-session-B-nvkfBZ.js")).loadUrdfSimulation(l, e, b);
280
280
  if (p || e.signal.aborted)
281
281
  throw o.dispose(), fe();
282
282
  F = o.asset, r = o.stage, j = o.inspection, v = o.dispose, c = o.step, f = o.reset, d = o.play, A = o.pause, h = o.isPlaying, g = () => o.capabilities, O = () => o.physics, G = !1, u = !1, C = o.warning ?? null, H(), x();
@@ -300,7 +300,7 @@ function er(l, e) {
300
300
  (we = e.reportProgress) == null || we.call(e, "compile", "正在编译物理模型与参数...");
301
301
  const q = await We(F);
302
302
  $ = q, re(p, e.signal), (ge = e.reportProgress) == null || ge.call(e, "runtime", "正在初始化物理内核...");
303
- const { MujocoRuntime: o } = await import("./mujoco-runtime-DiiANmuc.js");
303
+ const { MujocoRuntime: o } = await import("./mujoco-runtime-BGh1TiiB.js");
304
304
  a = new o(), await a.initialize(q, {
305
305
  baseUrl: e.options.mujocoBaseUrl,
306
306
  wasmModule: e.options.mujocoWasmModule
@@ -308,7 +308,7 @@ function er(l, e) {
308
308
  } catch (q) {
309
309
  const o = ie(q, e.signal, "mjcf-physics");
310
310
  a == null || a.dispose(), a = null;
311
- const { compileMjcfPreview: V } = await import("./mjcf-visual-U8gS-Yco.js");
311
+ const { compileMjcfPreview: V } = await import("./mjcf-visual-De37eJ9x.js");
312
312
  let U;
313
313
  try {
314
314
  U = V(F);
@@ -1,7 +1,7 @@
1
1
  import { DataTexture as ne, LinearMipmapLinearFilter as Xe, LinearFilter as _e, Loader as J, LoaderUtils as Ve, FileLoader as Ge, TextureLoader as Se, RepeatWrapping as pe, ClampToEdgeWrapping as fe, Texture as Y, MeshPhongMaterial as W, MeshLambertMaterial as Fe, ColorManagement as N, Color as k, SRGBColorSpace as X, EquirectangularReflectionMapping as Ne, Matrix4 as L, Group as ce, Bone as he, PropertyBinding as ee, Object3D as Z, PerspectiveCamera as $e, PointLight as de, MathUtils as B, SpotLight as ze, DirectionalLight as je, SkinnedMesh as He, Mesh as Ae, LineBasicMaterial as We, Line as Ye, Vector3 as V, Skeleton as qe, AmbientLight as Ke, BufferGeometry as re, Float32BufferAttribute as j, Uint16BufferAttribute as Ze, Matrix3 as Qe, Vector2 as Je, ShapeUtils as et, Vector4 as tt, Euler as z, AnimationClip as nt, Quaternion as G, VectorKeyframeTrack as rt, QuaternionKeyframeTrack as me, NumberKeyframeTrack as st, LoadingManager as at, LinearSRGBColorSpace as ge, RGBAFormat as Ie, UnsignedByteType as Re, NoColorSpace as ot, MeshPhysicalMaterial as De, Box3 as it } from "three";
2
2
  import { DRACOLoader as lt } from "three/examples/jsm/loaders/DRACOLoader.js";
3
3
  import { GLTFLoader as ct } from "three/examples/jsm/loaders/GLTFLoader.js";
4
- import { z as ye, A as we, B as ut, d as ve, D as pt } from "./index-8NPEYTG6.js";
4
+ import { z as ye, A as we, B as ut, d as ve, D as pt } from "./index-QdE4B8Hz.js";
5
5
  import { TGALoader as ft } from "three/examples/jsm/loaders/TGALoader.js";
6
6
  import * as ht from "three/examples/jsm/libs/fflate.module.js";
7
7
  import { unzlibSync as dt } from "three/examples/jsm/libs/fflate.module.js";
@@ -1733,7 +1733,7 @@ async function Lt(o, e, t) {
1733
1733
  return m = new xt(u).parse(o, ""), await Promise.all(i), e.signal.throwIfAborted(), { root: m, textures: l, textureFailures: f };
1734
1734
  } catch (g) {
1735
1735
  if (n.abort(g), await Promise.allSettled(i), m) {
1736
- const { disposeModelResources: d } = await import("./index-8NPEYTG6.js").then((T) => T.ac);
1736
+ const { disposeModelResources: d } = await import("./index-QdE4B8Hz.js").then((T) => T.ac);
1737
1737
  d(m, l);
1738
1738
  } else for (const d of l) d.dispose();
1739
1739
  throw g;
@@ -1,8 +1,8 @@
1
1
  import { Group as O, MeshStandardMaterial as Z, Mesh as z, PointsMaterial as H, Points as j, Color as J, Box3 as $, Vector3 as b, MeshBasicMaterial as Q, BoxGeometry as q } from "three";
2
2
  import { PLYLoader as X } from "three/examples/jsm/loaders/PLYLoader.js";
3
3
  import { S as ee, a as x } from "./spark.module-kM8pwA1o.js";
4
- import { L as te, A as _, B as ne, D as ie } from "./index-8NPEYTG6.js";
5
- import { a as re, r as ae } from "./spark-renderer-B_L1Xkr2.js";
4
+ import { L as te, A as _, B as ne, D as ie } from "./index-QdE4B8Hz.js";
5
+ import { a as re, r as ae } from "./spark-renderer-upJSRoni.js";
6
6
  function xe(t, e) {
7
7
  let u = !1, s = null, c = null, i = null, o = null, w = null, d = null, h = null, r = null, v = "unsupported", B = null, F = null, k = null, S = "y", G;
8
8
  const V = P(), T = () => {
@@ -1,5 +1,5 @@
1
1
  import { b as d } from "./spark.module-kM8pwA1o.js";
2
- import { R as p } from "./index-8NPEYTG6.js";
2
+ import { R as p } from "./index-QdE4B8Hz.js";
3
3
  const a = /* @__PURE__ */ new WeakMap();
4
4
  function o(r, e, s) {
5
5
  let n = a.get(e);
@@ -1,8 +1,8 @@
1
1
  var We = Object.defineProperty;
2
2
  var Ce = (i, e, s) => e in i ? We(i, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[e] = s;
3
3
  var R = (i, e, s) => Ce(i, typeof e != "symbol" ? e + "" : e, s);
4
- import { c as Ge, b as Te, d as Ve, w as ye, e as ge, p as Je } from "./asset-ir-CTNCY5IT.js";
5
- import { d as I, N as Pe, O as be, t as Be, u as Qe, v as we, M as Xe, P as Ke, i as Ze, B as Ye, Q as ve, S as Me } from "./index-8NPEYTG6.js";
4
+ import { c as Ge, b as Te, d as Ve, w as ye, e as ge, p as Je } from "./asset-ir-CodOg3S4.js";
5
+ import { d as I, N as Pe, O as be, t as Be, u as Qe, v as we, M as Xe, P as Ke, i as Ze, B as Ye, Q as ve, S as Me } from "./index-QdE4B8Hz.js";
6
6
  import { Quaternion as P, Euler as X, LoadingManager as _e, Group as L, Mesh as z, MeshLambertMaterial as He, MeshPhongMaterial as Re, MeshStandardMaterial as oe, TextureLoader as et, SRGBColorSpace as tt, RepeatWrapping as it, BoxGeometry as re, SphereGeometry as ae, CylinderGeometry as De, CapsuleGeometry as qe, Matrix4 as W, Vector3 as O, MathUtils as st, Matrix3 as Ae, Box3 as $e, AxesHelper as nt, ArrowHelper as Ee, Line as ot, BufferGeometry as rt, LineBasicMaterial as je, Float32BufferAttribute as at, MeshBasicMaterial as Se, LineSegments as lt, EdgesGeometry as ct } from "three";
7
7
  import { GLTFLoader as ut } from "three/examples/jsm/loaders/GLTFLoader.js";
8
8
  import { ColladaLoader as dt } from "three/examples/jsm/loaders/ColladaLoader.js";
@@ -1090,7 +1090,7 @@ async function Vt(i, e, s) {
1090
1090
  const a = e.format === "xacro";
1091
1091
  if (a) {
1092
1092
  (q = e.reportProgress) == null || q.call(e, "xacro", "正在展开 Xacro 宏与依赖文件...");
1093
- const { expandXacro: v } = await import("./xacro-BMaNGmce.js");
1093
+ const { expandXacro: v } = await import("./xacro-BoRKvNlt.js");
1094
1094
  n = await v(n, t, s, e.options.xacro, e.signal);
1095
1095
  }
1096
1096
  if (e.signal.aborted) throw Q();
@@ -1140,7 +1140,7 @@ async function Vt(i, e, s) {
1140
1140
  try {
1141
1141
  const G = await vt(o);
1142
1142
  if (e.signal.aborted || S) throw Q();
1143
- const Z = await import("./mujoco-runtime-DiiANmuc.js");
1143
+ const Z = await import("./mujoco-runtime-BGh1TiiB.js");
1144
1144
  if (v = new Z.MujocoRuntime(), await v.initialize(G, {
1145
1145
  baseUrl: e.options.mujocoBaseUrl,
1146
1146
  wasmModule: e.options.mujocoWasmModule
@@ -2,9 +2,9 @@ var Zi = Object.defineProperty;
2
2
  var Qi = (e, t, n) => t in e ? Zi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var cn = (e, t, n) => Qi(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import { Box3 as wt, Vector3 as G, SphereGeometry as ec, Float32BufferAttribute as Nt, Mesh as Oe, MeshBasicMaterial as Zs, Group as _t, BoxGeometry as fa, LineSegments as tc, EdgesGeometry as nc, LineBasicMaterial as Qo, AxesHelper as sc, ArrowHelper as oc, Line as rc, BufferGeometry as da, Quaternion as Ye, Points as ha, MeshPhysicalMaterial as oe, FrontSide as Po, DoubleSide as tn, DataTexture as ss, UnsignedByteType as os, RGBAFormat as rs, NoColorSpace as Ve, SRGBColorSpace as yn, Material as ac, ShaderChunk as ma, Color as Ie, TextureLoader as ws, Texture as on, Ray as Co, BufferAttribute as ga, Matrix4 as ut, Matrix3 as _a, RepeatWrapping as Ee, MeshStandardMaterial as Do, ClampToEdgeWrapping as Pn, MirroredRepeatWrapping as ic, CanvasTexture as cc, PointsMaterial as uc, LinearSRGBColorSpace as lc, SkinnedMesh as Vn, Skeleton as pc, AnimationMixer as fc, LoopRepeat as dc, Sphere as hc } from "three";
5
- import { i as mc, d as No, r as gc, o as _c, a as yc, c as bc, b as ya, e as wc, f as vc, g as Sc, U as Mc, h as Uc, j as ba, k as wa, l as Oo, m as Gt, n as Ic, p as Ac, q as xc, M as Ro, s as va, R as Tc, t as er, u as tr, C as nr, v as Sa, w as Ma, x as Pc, S as sr } from "./index-8NPEYTG6.js";
5
+ import { i as mc, d as No, r as gc, o as _c, a as yc, c as bc, b as ya, e as wc, f as vc, g as Sc, U as Mc, h as Uc, j as ba, k as wa, l as Oo, m as Gt, n as Ic, p as Ac, q as xc, M as Ro, s as va, R as Tc, t as er, u as tr, C as nr, v as Sa, w as Ma, x as Pc, S as sr } from "./index-QdE4B8Hz.js";
6
6
  import { k as Cc } from "./physics-guide-size-CplAlsve.js";
7
- import { r as Ua, n as Tt, u as Dc, c as Nc, p as Oc, a as Rc, b as Ec } from "./asset-ir-CTNCY5IT.js";
7
+ import { r as Ua, n as Tt, u as Dc, c as Nc, p as Oc, a as Rc, b as Ec } from "./asset-ir-CodOg3S4.js";
8
8
  import { ConvexGeometry as Ia } from "three/examples/jsm/geometries/ConvexGeometry.js";
9
9
  import { buildUSDScene as $c, createUSDLoadedModel as kc } from "@openusd-wasm/three-loader";
10
10
  import { KTX2Loader as Lc } from "three/addons/loaders/KTX2Loader.js";
@@ -10322,7 +10322,7 @@ async function _h(e, t, n) {
10322
10322
  message: `${ft.accelerationDrives.length} 个 acceleration drive 已按 MuJoCo 初始化姿态的关节广义惯量 M(jj) 转换为等效力/力矩;多关节耦合或大幅运动后的有效惯量变化不会逐帧重算。`,
10323
10323
  source: "usd-physics"
10324
10324
  }), (qo = ft.massOverrides) != null && qo.length && f.approximations.push({ code: "USD_INFERRED_INERTIA", message: "保留显式总质量;惯量按碰撞几何的密度分布推导并同比缩放,重叠体积会重复计入。", source: "usd-physics" });
10325
- const { MujocoRuntime: K } = await import("./mujoco-runtime-DiiANmuc.js");
10325
+ const { MujocoRuntime: K } = await import("./mujoco-runtime-BGh1TiiB.js");
10326
10326
  k = new K(), await k.initialize(ft, {
10327
10327
  baseUrl: t.options.mujocoBaseUrl,
10328
10328
  wasmModule: t.options.mujocoWasmModule
package/dist/version.d.ts CHANGED
@@ -2,4 +2,4 @@
2
2
  * Viewer 版本号。必须与 package.json 的 version 保持一致,
3
3
  * check-boundary 脚本会在构建前校验两者是否漂移。
4
4
  */
5
- export declare const viewerVersion = "0.6.3";
5
+ export declare const viewerVersion = "0.6.4";
@@ -1,4 +1,4 @@
1
- import { n as bt } from "./asset-ir-CTNCY5IT.js";
1
+ import { n as bt } from "./asset-ir-CodOg3S4.js";
2
2
  function _t(t) {
3
3
  const e = t.split(/[\\/]/g);
4
4
  return e.pop(), e.length === 0 ? "./" : e.join("/") + "/";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nebula-spatial/viewer",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "description": "Read-only Three.js viewer facade",
5
5
  "license": "ISC",
6
6
  "engines": {