three-usd-robot 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { getMaterialSubsets, resolveBoundMaterial, isRenderableGprim, COLLISION_API, isNonVisualPurpose, computeWorldTransform, computeLocalTransform, DefaultAssetResolver, toBytes, extractRobotDescription, isZip, CrateReader, openUsdz, buildKinematicTree, Stage, composeLayer, composeFile, crateToUsdaFile } from './chunk-PHHMWMCA.js';
2
- import { ThreeUsdRobot } from './chunk-3CANZKP3.js';
1
+ import { getMaterialSubsets, resolveBoundMaterial, isRenderableGprim, COLLISION_API, isNonVisualPurpose, computeLocalTransform, DefaultAssetResolver, toBytes, extractRobotDescription, isZip, CrateReader, openUsdz, buildKinematicTree, Stage, composeLayer, composeFile, crateToUsdaFile } from './chunk-2UD32EGU.js';
2
+ import { ThreeUsdRobot } from './chunk-WROYLUSS.js';
3
3
  import { identity4, multiply } from './chunk-IYKPVUZ2.js';
4
4
  import * as THREE from 'three';
5
5
 
@@ -168,6 +168,22 @@ function bindSceneMeshes(stage, robot3d, desc, options = {}) {
168
168
  for (const path of link.collisionPrims ?? []) owned.add(path);
169
169
  owned.add(link.primPath);
170
170
  }
171
+ const nodes = /* @__PURE__ */ new Map();
172
+ const containerFor = (prim) => {
173
+ const parent = prim.GetParent();
174
+ if (!parent || parent.IsPseudoRoot()) return robot3d;
175
+ let node = nodes.get(parent.GetPath());
176
+ if (!node) {
177
+ node = new THREE.Group();
178
+ node.name = parent.GetName();
179
+ node.userData.kind = "scene";
180
+ node.userData.primPath = parent.GetPath();
181
+ placeAtLocal(node, parent);
182
+ containerFor(parent).add(node);
183
+ nodes.set(parent.GetPath(), node);
184
+ }
185
+ return node;
186
+ };
171
187
  let attached = 0;
172
188
  for (const prim of stage.Traverse()) {
173
189
  if (!isRenderableGprim(prim) || owned.has(prim.GetPath())) continue;
@@ -179,14 +195,18 @@ function bindSceneMeshes(stage, robot3d, desc, options = {}) {
179
195
  mesh.name = prim.GetName();
180
196
  mesh.userData.kind = "scene";
181
197
  mesh.userData.primPath = prim.GetPath();
182
- mesh.matrixAutoUpdate = false;
183
- mesh.matrix.fromArray(computeWorldTransform(prim));
184
- mesh.matrixWorldNeedsUpdate = true;
185
- robot3d.add(mesh);
198
+ placeAtLocal(mesh, prim);
199
+ containerFor(prim).add(mesh);
200
+ nodes.set(prim.GetPath(), mesh);
186
201
  attached++;
187
202
  }
188
203
  return attached;
189
204
  }
205
+ function placeAtLocal(object, prim) {
206
+ object.matrixAutoUpdate = false;
207
+ object.matrix.fromArray(computeLocalTransform(prim).matrix);
208
+ object.matrixWorldNeedsUpdate = true;
209
+ }
190
210
  function buildMeshMaterials(meshPrim, stage, textures) {
191
211
  const subsets = stage ? getMaterialSubsets(meshPrim) : [];
192
212
  if (subsets.length === 0) return buildMeshMaterial(meshPrim, stage, textures);
@@ -446,6 +466,7 @@ var ThreeUsdRobotLoader = class {
446
466
  const robot = extractRobotDescription(stage, this.extractOptions());
447
467
  const tree = buildKinematicTree(robot);
448
468
  const robot3d = new ThreeUsdRobot(robot, tree, this.robotOptions());
469
+ robot3d.stage = stage;
449
470
  const loadVisuals = this.options.loadVisuals ?? true;
450
471
  const loadCollisions = this.options.loadCollisions ?? false;
451
472
  const isStaticScene = Object.keys(robot.links).length === 0 && Object.keys(robot.joints).length === 0;
@@ -489,7 +510,7 @@ var ThreeUsdRobotLoader = class {
489
510
  }
490
511
  robotOptions() {
491
512
  return {
492
- upAxisConversion: this.options.upAxisConversion ?? "auto",
513
+ ...this.options.worldUp ? { worldUp: this.options.worldUp } : { upAxisConversion: this.options.upAxisConversion ?? "auto" },
493
514
  ...this.options.clampJointLimits !== void 0 ? { clampJointLimits: this.options.clampJointLimits } : {},
494
515
  ...this.options.unitScale !== void 0 ? { unitScale: this.options.unitScale } : {},
495
516
  ...this.options.applyDriveTargetsAsInitialPose !== void 0 ? { applyInitialPose: this.options.applyDriveTargetsAsInitialPose } : {}
@@ -504,5 +525,5 @@ var ThreeUsdRobotLoader = class {
504
525
  };
505
526
 
506
527
  export { ThreeUsdRobotLoader, bindRobotMeshes, bindSceneMeshes, buildGprimGeometry, buildMeshGeometry, buildMeshMaterial, createTextureProvider };
507
- //# sourceMappingURL=chunk-YX5GIEMT.js.map
508
- //# sourceMappingURL=chunk-YX5GIEMT.js.map
528
+ //# sourceMappingURL=chunk-XEXFGL7R.js.map
529
+ //# sourceMappingURL=chunk-XEXFGL7R.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/three/MeshBinding.ts","../src/three/TextureBinding.ts","../src/three/ThreeUsdRobotLoader.ts"],"names":["begin","THREE2"],"mappings":";;;;;AAgCA,IAAM,aAAA,GAAgB,QAAA;AAiBf,SAAS,kBAAkB,QAAA,EAA6C;AAC7E,EAAA,MAAM,MAAA,GAAS,QAAA,CAAS,YAAA,CAAa,QAAQ,EAAE,GAAA,EAAI;AACnD,EAAA,IAAI,CAAC,WAAA,CAAY,MAAM,KAAK,MAAA,CAAO,MAAA,KAAW,GAAG,OAAO,IAAA;AAExD,EAAA,MAAM,QAAA,GAAW,IAAU,KAAA,CAAA,cAAA,EAAe;AAC1C,EAAA,QAAA,CAAS,YAAA,CAAa,YAAY,IAAU,KAAA,CAAA,sBAAA,CAAuB,MAAM,MAAM,CAAA,EAAG,CAAC,CAAC,CAAA;AAEpF,EAAA,MAAM,MAAA,GAAS,QAAA,CAAS,YAAA,CAAa,kBAAkB,EAAE,GAAA,EAAI;AAC7D,EAAA,MAAM,OAAA,GAAU,QAAA,CAAS,YAAA,CAAa,mBAAmB,EAAE,GAAA,EAAI;AAC/D,EAAA,IAAI,aAAA,CAAc,MAAM,CAAA,IAAK,aAAA,CAAc,OAAO,CAAA,EAAG;AACnD,IAAA,MAAM,OAAA,GAAU,mBAAmB,QAAQ,CAAA;AAC3C,IAAA,IAAI,OAAA,CAAQ,SAAS,CAAA,EAAG;AACtB,MAAA,QAAA,CAAS,SA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AAAA,EAEQ,cAAA,GAA6E;AACnF,IAAA,OAAO;AAAA,MACL,GAAI,IAAA,CAAK,OAAA,CAAQ,SAAA,KAAc,MAAA,GAAY,EAAE,SAAA,EAAW,IAAA,CAAK,OAAA,CAAQ,SAAA,EAAU,GAAI,EAAC;AAAA,MACpF,GAAI,IAAA,CAAK,OAAA,CAAQ,MAAA,KAAW,MAAA,GAAY,EAAE,MAAA,EAAQ,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAO,GAAI;AAAC,KAC7E;AAAA,EACF;AACF","file":"chunk-XEXFGL7R.js","sourcesContent":["/**\n * Binds renderable gprims — `UsdGeom.Mesh` plus the parametric solids (`Cube` /\n * `Sphere` / `Cylinder` / `Capsule` / `Cone`) — to Three.js geometry and\n * attaches them under the robot's link objects.\n *\n * Meshes are triangulated with a simple fan, use authored per-vertex normals\n * when present (else computed smooth normals), and read `primvars:st` UVs and\n * `primvars:displayColor`. Solids tessellate from their schema attributes.\n * Geometry is left in stage units; the global `metersPerUnit` scale is applied\n * at the root in M9.\n */\n\nimport * as THREE from \"three\";\nimport { type Mat4, identity4, multiply } from \"../kinematics/transforms.js\";\nimport type { Vec2, Vec3 } from \"../parser/ast.js\";\nimport type { RobotDescription } from \"../robot/RobotDescription.js\";\nimport {\n type MaterialSubset,\n getMaterialSubsets,\n isNonVisualPurpose,\n isRenderableGprim,\n} from \"../schemas/usdGeom.js\";\nimport { COLLISION_API } from \"../schemas/usdPhysics.js\";\nimport type { Prim } from \"../usd/Prim.js\";\nimport type { Stage } from \"../usd/Stage.js\";\nimport { computeLocalTransform } from \"../usd/xformOps.js\";\nimport { type ResolvedTexture, resolveBoundMaterial } from \"./MaterialBinding.js\";\nimport type { TextureProvider } from \"./TextureBinding.js\";\nimport type { ThreeUsdRobot } from \"./ThreeUsdRobot.js\";\n\nexport type MeshKind = \"visual\" | \"collision\";\n\nconst DEFAULT_COLOR = 0x9a9a9a;\n\nexport type BindMeshesOptions = {\n loadVisuals?: boolean;\n loadCollisions?: boolean;\n /** Resolves diffuse texture asset paths to `THREE.Texture` (M-tex). */\n textureProvider?: TextureProvider;\n};\n\n/**\n * Build a `BufferGeometry` from a Mesh prim, or `null` if it has no points.\n *\n * When the mesh carries `materialBind` face subsets, the triangles are ordered\n * subset by subset and a geometry group is added for each — so the mesh can be\n * drawn with one material per subset (see {@link buildMeshMaterials}). Group\n * order matches {@link getMaterialSubsets}, with any unassigned faces last.\n */\nexport function buildMeshGeometry(meshPrim: Prim): THREE.BufferGeometry | null {\n const points = meshPrim.GetAttribute(\"points\").Get();\n if (!isVec3Array(points) || points.length === 0) return null;\n\n const geometry = new THREE.BufferGeometry();\n geometry.setAttribute(\"position\", new THREE.Float32BufferAttribute(flat3(points), 3));\n\n const counts = meshPrim.GetAttribute(\"faceVertexCounts\").Get();\n const indices = meshPrim.GetAttribute(\"faceVertexIndices\").Get();\n if (isNumberArray(counts) && isNumberArray(indices)) {\n const subsets = getMaterialSubsets(meshPrim);\n if (subsets.length > 0) {\n geometry.setIndex(triangulateBySubset(geometry, counts, indices, subsets));\n } else {\n geometry.setIndex(triangulate(counts, indices));\n }\n } else if (isNumberArray(indices)) {\n geometry.setIndex(indices.slice());\n }\n\n const normals = meshPrim.GetAttribute(\"normals\").Get();\n if (isVec3Array(normals) && normals.length === points.length) {\n geometry.setAttribute(\"normal\", new THREE.Float32BufferAttribute(flat3(normals), 3));\n } else {\n geometry.computeVertexNormals();\n }\n\n const st = meshPrim.GetAttribute(\"primvars:st\").Get();\n if (isVec2Array(st) && st.length === points.length) {\n geometry.setAttribute(\"uv\", new THREE.Float32BufferAttribute(flat2(st), 2));\n }\n\n return geometry;\n}\n\n/**\n * Build geometry for any renderable gprim: `Mesh` via {@link buildMeshGeometry},\n * parametric solids from their schema attributes. Solids follow UsdGeom\n * semantics — sizes in stage units, centered at the origin, `axis` (default\n * `\"Z\"`) along the spine, and a capsule's `height` spans only its cylindrical\n * section. Returns `null` for unsupported prim types.\n */\nexport function buildGprimGeometry(prim: Prim): THREE.BufferGeometry | null {\n switch (prim.GetTypeName()) {\n case \"Mesh\":\n return buildMeshGeometry(prim);\n case \"Cube\": {\n const size = getNumber(prim, \"size\") ?? 2;\n return new THREE.BoxGeometry(size, size, size);\n }\n case \"Sphere\":\n return new THREE.SphereGeometry(getNumber(prim, \"radius\") ?? 1, 32, 16);\n case \"Cylinder\": {\n const radius = getNumber(prim, \"radius\") ?? 1;\n const height = getNumber(prim, \"height\") ?? 2;\n return orientSpine(new THREE.CylinderGeometry(radius, radius, height, 32), prim);\n }\n case \"Capsule\": {\n const radius = getNumber(prim, \"radius\") ?? 0.5;\n const height = getNumber(prim, \"height\") ?? 1;\n return orientSpine(new THREE.CapsuleGeometry(radius, height, 8, 32), prim);\n }\n case \"Cone\": {\n const radius = getNumber(prim, \"radius\") ?? 1;\n const height = getNumber(prim, \"height\") ?? 2;\n return orientSpine(new THREE.ConeGeometry(radius, height, 32), prim);\n }\n default:\n return null;\n }\n}\n\nfunction getNumber(prim: Prim, name: string): number | undefined {\n const v = prim.GetAttribute(name).Get();\n return typeof v === \"number\" ? v : undefined;\n}\n\n/** Rotate a Y-spined three.js primitive onto the prim's `axis` (USD default `Z`). */\nfunction orientSpine(geometry: THREE.BufferGeometry, prim: Prim): THREE.BufferGeometry {\n const axis = prim.GetAttribute(\"axis\").Get();\n if (axis === \"Y\") return geometry;\n if (axis === \"X\") return geometry.rotateZ(-Math.PI / 2);\n return geometry.rotateX(Math.PI / 2);\n}\n\n/**\n * Build a material for a gprim. Color priority: bound `UsdShade` material\n * (when `stage` is given) → `primvars:displayColor` → default gray. Textures\n * (via `textures`) become the matching `MeshStandardMaterial` maps — diffuse →\n * `map` (sRGB), plus `normalMap` / `roughnessMap` / `metalnessMap` / `aoMap`\n * (linear data) and emissive `emissiveMap`. Metalness / roughness / opacity /\n * emissive constants come from the bound material when present.\n */\nexport function buildMeshMaterial(\n meshPrim: Prim,\n stage?: Stage,\n textures?: TextureProvider,\n /** Resolve the material binding from here instead (a `GeomSubset`). */\n bindingPrim?: Prim,\n): THREE.Material {\n const color = new THREE.Color(DEFAULT_COLOR);\n let opacity = 1;\n\n const bound = stage ? resolveBoundMaterial(stage, bindingPrim ?? meshPrim) : undefined;\n if (bound?.color) {\n color.setRGB(bound.color[0], bound.color[1], bound.color[2]);\n } else {\n const displayColor = meshPrim.GetAttribute(\"primvars:displayColor\").Get();\n if (isVec3Array(displayColor) && displayColor[0]) {\n const [r, g, b] = displayColor[0];\n color.setRGB(r, g, b);\n }\n }\n if (bound?.opacity !== undefined) opacity = bound.opacity;\n\n // Resolve a channel's `THREE.Texture`, forwarding its wrap modes and\n // `UsdTransform2d` (the `UsdUVTexture.inputs:scale`/`bias` are folded into the\n // material factors below, not the sampler).\n const tex = (rt: ResolvedTexture | undefined, cs: \"srgb\" | \"linear\") =>\n rt && textures\n ? textures(rt.path, {\n colorSpace: cs,\n ...(rt.wrapS ? { wrapS: rt.wrapS } : {}),\n ...(rt.wrapT ? { wrapT: rt.wrapT } : {}),\n ...(rt.transform ? { transform: rt.transform } : {}),\n })\n : null;\n\n const map = tex(bound?.colorTexture, \"srgb\");\n // `inputs:scale` on the diffuse texture tints the map; otherwise pass through.\n if (map) {\n const s = bound?.colorTexture?.scale;\n if (s) color.setRGB(s[0], s[1], s[2]);\n else color.setRGB(1, 1, 1);\n }\n const normalMap = tex(bound?.normalTexture, \"linear\");\n const roughnessMap = tex(bound?.roughnessTexture, \"linear\");\n const metalnessMap = tex(bound?.metalnessTexture, \"linear\");\n const aoMap = tex(bound?.occlusionTexture, \"linear\");\n const emissiveMap = tex(bound?.emissiveTexture, \"srgb\");\n\n // A scalar map's `inputs:scale[0]` (or an authored constant) becomes three's\n // factor; three multiplies factor × map, so default to 1 to pass it through.\n const metalness =\n bound?.metalness ?? bound?.metalnessTexture?.scale?.[0] ?? (metalnessMap ? 1 : 0.1);\n const roughness =\n bound?.roughness ?? bound?.roughnessTexture?.scale?.[0] ?? (roughnessMap ? 1 : 0.8);\n\n const emissive = new THREE.Color(0x000000);\n if (bound?.emissiveColor) {\n emissive.setRGB(bound.emissiveColor[0], bound.emissiveColor[1], bound.emissiveColor[2]);\n } else if (emissiveMap) {\n emissive.setRGB(1, 1, 1); // let the map drive emission\n }\n\n // Opacity sourcing: a dedicated opacity texture → `alphaMap`; an opacity input\n // wired to the *same* image as the diffuse map → that map's own alpha channel\n // (no separate map needed). `opacityThreshold > 0` means alpha clip (a binary\n // cutout rendered in the opaque pass); otherwise sub-unit alpha blends.\n const opacityTex = bound?.opacityTexture;\n const sharesColorMap = !!(opacityTex && opacityTex.path === bound?.colorTexture?.path);\n const alphaMap = sharesColorMap ? null : tex(opacityTex, \"linear\");\n const hasAlphaSource = opacity < 1 || sharesColorMap || !!alphaMap;\n const threshold = bound?.opacityThreshold;\n const alphaTest = threshold !== undefined && threshold > 0 ? threshold : 0;\n // Alpha-clip masks render opaque (depth-written, discarded below the cutoff);\n // only true translucency uses the transparent/blended pass.\n const transparent = alphaTest === 0 && hasAlphaSource;\n\n const doubleSided = meshPrim.GetAttribute(\"doubleSided\").Get() === true;\n const material = new THREE.MeshStandardMaterial({\n color,\n metalness,\n roughness,\n emissive,\n transparent,\n opacity,\n ...(alphaTest > 0 ? { alphaTest } : {}),\n side: doubleSided ? THREE.DoubleSide : THREE.FrontSide,\n ...(map ? { map } : {}),\n ...(alphaMap ? { alphaMap } : {}),\n ...(normalMap ? { normalMap } : {}),\n ...(roughnessMap ? { roughnessMap } : {}),\n ...(metalnessMap ? { metalnessMap } : {}),\n ...(aoMap ? { aoMap } : {}),\n ...(emissiveMap ? { emissiveMap } : {}),\n });\n // Carry the USD material name so re-exports keep it (and dedupe by it).\n if (bound?.name) material.name = bound.name;\n return material;\n}\n\n/**\n * Attach visual (and optionally collision) meshes to every link of a built\n * {@link ThreeUsdRobot}. Each mesh is positioned by its transform relative to\n * the owning link prim.\n */\nexport function bindRobotMeshes(\n stage: Stage,\n robot3d: ThreeUsdRobot,\n desc: RobotDescription,\n options: BindMeshesOptions = {},\n): void {\n const loadVisuals = options.loadVisuals ?? true;\n const loadCollisions = options.loadCollisions ?? false;\n const textures = options.textureProvider;\n\n for (const [key, link] of Object.entries(desc.links)) {\n const linkObj = robot3d.getLinkObject(key);\n const linkPrim = stage.GetPrimAtPath(link.primPath);\n if (!linkObj || !linkPrim) continue;\n\n // A mesh may be both visual and collision; attach it once, as visual.\n const visualSet = new Set(link.visualPrims);\n\n if (loadVisuals) {\n for (const meshPath of link.visualPrims) {\n attachMesh(stage, linkPrim, meshPath, linkObj, \"visual\", textures);\n }\n }\n if (loadCollisions) {\n for (const meshPath of link.collisionPrims ?? []) {\n if (loadVisuals && visualSet.has(meshPath)) continue;\n attachMesh(stage, linkPrim, meshPath, linkObj, \"collision\", textures);\n }\n }\n }\n}\n\n/**\n * Attach the gprims that belong to no link — the static scenery of a cell that\n * also contains robots. The authored prim hierarchy is mirrored with\n * `THREE.Group` nodes (each carrying `userData.primPath` and its prim's local\n * transform), so grouped scenery — a pallet and its cartons, a fence and its\n * wires — stays one movable subtree. World placements are unchanged, and the\n * loader's up-axis and unit normalization still applies at the robot root.\n * Collision-only and guide/proxy prims are skipped.\n */\nexport function bindSceneMeshes(\n stage: Stage,\n robot3d: ThreeUsdRobot,\n desc: RobotDescription,\n options: { textureProvider?: TextureProvider } = {},\n): number {\n const owned = new Set<string>();\n for (const link of Object.values(desc.links)) {\n for (const path of link.visualPrims) owned.add(path);\n for (const path of link.collisionPrims ?? []) owned.add(path);\n owned.add(link.primPath);\n }\n\n // Ancestor prims materialize lazily, so subtrees with nothing renderable\n // produce no empty groups. Meshes register too: gprims can nest.\n const nodes = new Map<string, THREE.Object3D>();\n const containerFor = (prim: Prim): THREE.Object3D => {\n const parent = prim.GetParent();\n if (!parent || parent.IsPseudoRoot()) return robot3d;\n let node = nodes.get(parent.GetPath());\n if (!node) {\n node = new THREE.Group();\n node.name = parent.GetName();\n node.userData.kind = \"scene\";\n node.userData.primPath = parent.GetPath();\n placeAtLocal(node, parent);\n containerFor(parent).add(node);\n nodes.set(parent.GetPath(), node);\n }\n return node;\n };\n\n let attached = 0;\n for (const prim of stage.Traverse()) {\n if (!isRenderableGprim(prim) || owned.has(prim.GetPath())) continue;\n if (prim.HasAPI(COLLISION_API) || isNonVisualPurpose(prim)) continue;\n // Skip gprims under a link (already bound relative to their link).\n if ([...owned].some((path) => prim.GetPath().startsWith(`${path}/`))) continue;\n\n const geometry = buildGprimGeometry(prim);\n if (!geometry) continue;\n const mesh = new THREE.Mesh(geometry, buildMeshMaterial(prim, stage, options.textureProvider));\n mesh.name = prim.GetName();\n mesh.userData.kind = \"scene\";\n mesh.userData.primPath = prim.GetPath();\n placeAtLocal(mesh, prim);\n containerFor(prim).add(mesh);\n nodes.set(prim.GetPath(), mesh);\n attached++;\n }\n return attached;\n}\n\n/** Fix `object` at its prim's local transform (scenery is static). */\nfunction placeAtLocal(object: THREE.Object3D, prim: Prim): void {\n object.matrixAutoUpdate = false;\n object.matrix.fromArray(computeLocalTransform(prim).matrix);\n object.matrixWorldNeedsUpdate = true;\n}\n\n/**\n * Materials for a mesh: one per `materialBind` face subset (matching the\n * geometry groups {@link buildMeshGeometry} adds) plus a trailing fallback for\n * faces no subset claims. A mesh without subsets gets a single material.\n */\nexport function buildMeshMaterials(\n meshPrim: Prim,\n stage?: Stage,\n textures?: TextureProvider,\n): THREE.Material | THREE.Material[] {\n const subsets = stage ? getMaterialSubsets(meshPrim) : [];\n if (subsets.length === 0) return buildMeshMaterial(meshPrim, stage, textures);\n return [\n ...subsets.map((s) => buildMeshMaterial(meshPrim, stage, textures, s.prim)),\n buildMeshMaterial(meshPrim, stage, textures),\n ];\n}\n\nfunction attachMesh(\n stage: Stage,\n linkPrim: Prim,\n meshPath: string,\n parent: THREE.Object3D,\n kind: MeshKind,\n textures: TextureProvider | undefined,\n): void {\n const meshPrim = stage.GetPrimAtPath(meshPath);\n if (!meshPrim) return;\n const geometry = buildGprimGeometry(meshPrim);\n if (!geometry) return;\n\n const mesh = new THREE.Mesh(geometry, buildMeshMaterials(meshPrim, stage, textures));\n mesh.name = meshPrim.GetName();\n mesh.userData.kind = kind;\n mesh.userData.primPath = meshPath;\n // Collision meshes are loaded hidden; reveal via `robot.showCollision = true`.\n if (kind === \"collision\") mesh.visible = false;\n mesh.matrixAutoUpdate = false;\n mesh.matrix.fromArray(relativeTransform(linkPrim, meshPrim));\n mesh.matrixWorldNeedsUpdate = true;\n parent.add(mesh);\n}\n\n/** Accumulated local transform from `linkPrim` (exclusive) down to `meshPrim` (inclusive). */\nfunction relativeTransform(linkPrim: Prim, meshPrim: Prim): Mat4 {\n const chain: Prim[] = [];\n let p: Prim | null = meshPrim;\n const stop = linkPrim.GetPath();\n while (p && p.GetPath() !== stop) {\n chain.push(p);\n p = p.GetParent();\n }\n chain.reverse(); // top-most (just under link) → mesh\n\n let m = identity4();\n for (const prim of chain) {\n m = multiply(m, computeLocalTransform(prim).matrix);\n }\n return m;\n}\n\n// --- triangulation & typed-array helpers -----------------------------------\n\n/** Fan-triangulate USD polygon faces into a flat triangle index list. */\nfunction triangulate(faceVertexCounts: number[], faceVertexIndices: number[]): number[] {\n const tris: number[] = [];\n let offset = 0;\n for (const count of faceVertexCounts) {\n for (let k = 2; k < count; k++) {\n tris.push(\n faceVertexIndices[offset]!,\n faceVertexIndices[offset + k - 1]!,\n faceVertexIndices[offset + k]!,\n );\n }\n offset += count;\n }\n return tris;\n}\n\n/**\n * Triangulate subset by subset so each subset owns a contiguous run of the\n * index buffer, and register that run as a geometry group.\n */\nfunction triangulateBySubset(\n geometry: THREE.BufferGeometry,\n faceVertexCounts: number[],\n faceVertexIndices: number[],\n subsets: MaterialSubset[],\n): number[] {\n const faceStart: number[] = [];\n let offset = 0;\n for (const count of faceVertexCounts) {\n faceStart.push(offset);\n offset += count;\n }\n\n const tris: number[] = [];\n const emit = (face: number) => {\n const start = faceStart[face]!;\n const count = faceVertexCounts[face]!;\n for (let k = 2; k < count; k++) {\n tris.push(\n faceVertexIndices[start]!,\n faceVertexIndices[start + k - 1]!,\n faceVertexIndices[start + k]!,\n );\n }\n };\n\n const claimed = new Uint8Array(faceVertexCounts.length);\n subsets.forEach((subset, index) => {\n const begin = tris.length;\n for (const face of subset.faces) {\n if (face < 0 || face >= faceVertexCounts.length || claimed[face]) continue;\n claimed[face] = 1;\n emit(face);\n }\n if (tris.length > begin) geometry.addGroup(begin, tris.length - begin, index);\n });\n\n const begin = tris.length;\n for (let face = 0; face < faceVertexCounts.length; face++) {\n if (!claimed[face]) emit(face);\n }\n if (tris.length > begin) geometry.addGroup(begin, tris.length - begin, subsets.length);\n\n return tris;\n}\n\nfunction flat3(v: Vec3[]): number[] {\n const out = new Array<number>(v.length * 3);\n for (let i = 0; i < v.length; i++) {\n out[i * 3] = v[i]![0];\n out[i * 3 + 1] = v[i]![1];\n out[i * 3 + 2] = v[i]![2];\n }\n return out;\n}\n\nfunction flat2(v: Vec2[]): number[] {\n const out = new Array<number>(v.length * 2);\n for (let i = 0; i < v.length; i++) {\n out[i * 2] = v[i]![0];\n out[i * 2 + 1] = v[i]![1];\n }\n return out;\n}\n\nfunction isNumberArray(v: unknown): v is number[] {\n return Array.isArray(v) && v.every((n) => typeof n === \"number\");\n}\n\nfunction isVec3Array(v: unknown): v is Vec3[] {\n return Array.isArray(v) && v.every((e) => Array.isArray(e) && e.length === 3);\n}\n\nfunction isVec2Array(v: unknown): v is Vec2[] {\n return Array.isArray(v) && v.every((e) => Array.isArray(e) && e.length === 2);\n}\n","/**\n * Loads texture image assets referenced by `UsdShade` materials.\n *\n * A {@link TextureProvider} maps an authored asset path (plus sampler/transform\n * options) to a `THREE.Texture`. The default provider fetches the image **bytes**\n * through the {@link AssetResolver} and decodes them via a blob URL — so it works\n * uniformly for textures served over HTTP and for images embedded inside a\n * `.usdz` package (whose resolver serves zip entries, not real URLs). Decoded\n * images are cached per resolved URL and shared across every texture that uses\n * them; each `THREE.Texture` carries its own color space / wrap / transform.\n */\n\nimport * as THREE from \"three\";\nimport type { AssetResolver } from \"../usd/AssetResolver.js\";\nimport type { TextureTransform, TextureWrap } from \"./MaterialBinding.js\";\n\n/**\n * Color space to interpret a texture in. Color/albedo and emissive maps are\n * `\"srgb\"`; data maps (normal, roughness, metalness, occlusion) are `\"linear\"`.\n */\nexport type TextureColorSpace = \"srgb\" | \"linear\";\n\n/** Per-use sampler state applied to the returned `THREE.Texture`. */\nexport type TextureOptions = {\n /** Defaults to `\"srgb\"`. */\n colorSpace?: TextureColorSpace;\n wrapS?: TextureWrap;\n wrapT?: TextureWrap;\n transform?: TextureTransform;\n};\n\n/** Resolve an authored texture asset path to a `THREE.Texture` (or `null`). */\nexport type TextureProvider = (assetPath: string, options?: TextureOptions) => THREE.Texture | null;\n\nconst DEG2RAD = Math.PI / 180;\n\n/**\n * A {@link TextureProvider} backed by the {@link AssetResolver}, resolving paths\n * against `baseUrl`. Image bytes are fetched once per URL (works for HTTP and\n * `.usdz` entries alike) and the decoded image is shared; each call returns a\n * distinct `THREE.Texture` carrying the requested color space / wrap / transform.\n */\nexport function createTextureProvider(resolver: AssetResolver, baseUrl: string): TextureProvider {\n const images = new Map<string, Promise<TexImageSource>>();\n\n const imageFor = (url: string): Promise<TexImageSource> => {\n let p = images.get(url);\n if (!p) {\n p = loadImage(resolver, url);\n images.set(url, p);\n }\n return p;\n };\n\n return (assetPath: string, options: TextureOptions = {}) => {\n let url: string;\n try {\n url = resolver.resolve(assetPath, baseUrl);\n } catch {\n return null;\n }\n\n const texture = new THREE.Texture();\n texture.colorSpace =\n options.colorSpace === \"linear\" ? THREE.NoColorSpace : THREE.SRGBColorSpace;\n texture.wrapS = toThreeWrap(options.wrapS);\n texture.wrapT = toThreeWrap(options.wrapT);\n applyTransform(texture, options.transform);\n\n imageFor(url)\n .then((image) => {\n texture.image = image;\n texture.needsUpdate = true;\n })\n .catch(() => {\n /* leave the texture blank if the image can't be decoded */\n });\n return texture;\n };\n}\n\n/**\n * Fetch image bytes through the resolver and decode them via a blob URL into an\n * `HTMLImageElement` (so three's default `flipY = true` orients USD's bottom-left\n * `st` origin correctly, matching the prior `TextureLoader` HTTP path).\n */\nasync function loadImage(resolver: AssetResolver, url: string): Promise<TexImageSource> {\n const bytes = resolver.fetchBytes\n ? await resolver.fetchBytes(url)\n : new TextEncoder().encode(await resolver.fetchText(url));\n const blob = new Blob([bytes as BlobPart], { type: mimeOf(url) });\n const objectUrl = URL.createObjectURL(blob);\n try {\n return await new Promise<HTMLImageElement>((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = () => reject(new Error(`failed to decode texture: ${url}`));\n img.src = objectUrl;\n });\n } finally {\n // The decoded image keeps its pixels; the blob URL can be released.\n URL.revokeObjectURL(objectUrl);\n }\n}\n\nfunction toThreeWrap(wrap: TextureWrap | undefined): THREE.Wrapping {\n switch (wrap) {\n case \"clamp\":\n case \"black\": // three has no border color; clamp is the closest mode\n return THREE.ClampToEdgeWrapping;\n case \"mirror\":\n return THREE.MirroredRepeatWrapping;\n default:\n return THREE.RepeatWrapping;\n }\n}\n\n/** Map a `UsdTransform2d` onto a texture's offset / repeat / rotation. */\nfunction applyTransform(texture: THREE.Texture, t: TextureTransform | undefined): void {\n if (!t) return;\n if (t.scale) texture.repeat.set(t.scale[0], t.scale[1]);\n if (t.translation) texture.offset.set(t.translation[0], t.translation[1]);\n if (t.rotation !== undefined) {\n texture.rotation = t.rotation * DEG2RAD;\n texture.center.set(0, 0); // UsdTransform2d rotates about the origin\n }\n}\n\nfunction mimeOf(url: string): string {\n if (/\\.jpe?g$/i.test(url)) return \"image/jpeg\";\n if (/\\.webp$/i.test(url)) return \"image/webp\";\n return \"image/png\";\n}\n","import type { RobotDescription } from \"../robot/RobotDescription.js\";\nimport { extractRobotDescription } from \"../robot/RobotExtractor.js\";\nimport { buildKinematicTree } from \"../robot/buildKinematicTree.js\";\nimport { type AssetResolver, DefaultAssetResolver } from \"../usd/AssetResolver.js\";\nimport { Stage } from \"../usd/Stage.js\";\nimport { type BinarySource, type UsdSource, toBytes } from \"../usd/bytes.js\";\nimport { composeFile, composeLayer } from \"../usd/composition.js\";\nimport { CrateReader } from \"../usd/crate/CrateReader.js\";\nimport { crateToUsdaFile } from \"../usd/crate/toUsdaFile.js\";\nimport { isZip, openUsdz } from \"../usd/usdz.js\";\nimport { bindRobotMeshes, bindSceneMeshes } from \"./MeshBinding.js\";\nimport { createTextureProvider } from \"./TextureBinding.js\";\nimport { ThreeUsdRobot, type ThreeUsdRobotOptions, type WorldUpAxis } from \"./ThreeUsdRobot.js\";\n\nexport type ThreeUsdRobotLoaderOptions = {\n /** Resolver for references / payloads / sublayers (default {@link DefaultAssetResolver}). */\n assetResolver?: AssetResolver;\n /** Render visual meshes (M6). */\n loadVisuals?: boolean;\n /** Render collision meshes (M6). */\n loadCollisions?: boolean;\n /**\n * Also render gprims that belong to no link — the static scenery of a cell\n * that contains robots (floor, guarding, racking, …). Placed by their\n * authored stage transform. Default `false`; a stage with no articulation at\n * all (a pure static scene) defaults to `true` so it renders out of the box.\n */\n loadSceneGeometry?: boolean;\n /** Load diffuse textures referenced by materials (default `true`). */\n loadTextures?: boolean;\n /**\n * Target world up-axis. Any stage (Y-up or Z-up) is normalized into this\n * convention: `\"Y\"` for a standard three.js scene (the default behavior),\n * `\"Z\"` for a robotics-style Z-up world, `\"keep\"` to leave the authored\n * orientation. Takes precedence over {@link upAxisConversion}.\n */\n worldUp?: WorldUpAxis;\n /**\n * Legacy up-axis correction (M9). Default `\"auto\"` ≡ `worldUp: \"Y\"`.\n * @deprecated Use {@link worldUp}.\n */\n upAxisConversion?: \"auto\" | \"Y\" | \"Z\" | \"none\";\n /** Extra uniform scale multiplied with `metersPerUnit` (M9). */\n unitScale?: number;\n /** Clamp `setJointValue` to authored limits (default `true`). */\n clampJointLimits?: boolean;\n /** Seed joints from drive targets / joint state (M9). */\n applyDriveTargetsAsInitialPose?: boolean;\n /** Override the robot name. */\n robotName?: string;\n /** Receives non-fatal load diagnostics. */\n onWarn?: (message: string) => void;\n};\n\n/** A composed stage plus the context needed to bind its meshes and textures. */\ntype OpenedStage = { stage: Stage; baseUrl: string; resolver: AssetResolver };\n\n/**\n * Loads Isaac Sim / OpenUSD robot assets into a controllable {@link ThreeUsdRobot}.\n *\n * Assets load by URL ({@link loadAsync}) or from in-memory content\n * ({@link parse} — USDA text, `ArrayBuffer`, typed array, or `Blob`/`File`).\n * Composition (references / payloads / sublayers, M8) is resolved through an\n * {@link AssetResolver}. Mesh rendering is M6; unit / up-axis / initial-pose\n * handling is M9; USDC and variants are M10.\n */\nexport class ThreeUsdRobotLoader {\n readonly options: ThreeUsdRobotLoaderOptions;\n\n constructor(options: ThreeUsdRobotLoaderOptions = {}) {\n this.options = options;\n }\n\n private get resolver(): AssetResolver {\n return this.options.assetResolver ?? new DefaultAssetResolver();\n }\n\n /**\n * Fetch an asset by URL and build the robot. `.usdz` packages are unzipped and\n * composed from their entries; everything else is sniffed for the zip / crate\n * magic and parsed as USDZ, binary USDC, or USDA text.\n */\n async loadAsync(url: string): Promise<ThreeUsdRobot> {\n const bytes = await this.fetchRootBytes(url);\n // Extension first: sniffing only sees offset 0, the extension also covers\n // zip archives with a prefix (fflate reads the central directory anyway).\n if (/\\.usdz$/i.test(url)) return this.parseUsdz(bytes);\n return this.parse(bytes, url);\n }\n\n private async fetchRootBytes(url: string): Promise<Uint8Array> {\n const resolver = this.resolver;\n if (resolver.fetchBytes) return resolver.fetchBytes(url);\n return new TextEncoder().encode(await resolver.fetchText(url));\n }\n\n /**\n * Build a robot from in-memory content — no fetch involved. Accepts USDA\n * source text, or an `ArrayBuffer` / typed array / `Blob` (e.g. a dropped\n * `File`) holding USDA text, a binary crate, or a `.usdz` package; binary\n * input is sniffed for the zip / crate magic. `baseUrl` anchors relative\n * references, payloads, and texture paths of non-package input.\n */\n async parse(data: UsdSource, baseUrl = \"\"): Promise<ThreeUsdRobot> {\n return this.buildFromStage(await this.openSource(data, baseUrl));\n }\n\n /** Build a robot from a `.usdz` package (bytes, `ArrayBuffer`, or `Blob`). */\n async parseUsdz(data: BinarySource): Promise<ThreeUsdRobot> {\n return this.buildFromStage(await this.openUsdzStage(await toBytes(data)));\n }\n\n /** Build a robot from a binary crate (`.usdc` / binary `.usd`). */\n async parseCrate(data: BinarySource, baseUrl = \"\"): Promise<ThreeUsdRobot> {\n const stage = await this.composeStageFromBytes(await toBytes(data), baseUrl, this.resolver);\n return this.buildFromStage({ stage, baseUrl, resolver: this.resolver });\n }\n\n /**\n * Parse + compose in-memory content (same formats as {@link parse}) into the\n * Three.js-independent robot IR.\n */\n async parseRobotDescription(data: UsdSource, baseUrl = \"\"): Promise<RobotDescription> {\n const { stage } = await this.openSource(data, baseUrl);\n return extractRobotDescription(stage, this.extractOptions());\n }\n\n /** Sniff in-memory content (text / zip / crate) and compose it into a stage. */\n private async openSource(data: UsdSource, baseUrl: string): Promise<OpenedStage> {\n const resolver = this.resolver;\n if (typeof data === \"string\") {\n return { stage: await this.composeStage(data, baseUrl, resolver), baseUrl, resolver };\n }\n const bytes = await toBytes(data);\n if (isZip(bytes)) return this.openUsdzStage(bytes);\n const stage = CrateReader.isCrate(bytes)\n ? await this.composeStageFromBytes(bytes, baseUrl, resolver)\n : await this.composeStage(new TextDecoder().decode(bytes), baseUrl, resolver);\n return { stage, baseUrl, resolver };\n }\n\n private async openUsdzStage(bytes: Uint8Array): Promise<OpenedStage> {\n const pkg = openUsdz(bytes);\n // The root layer of a usdz is typically binary USDC — sniff, don't assume text.\n const rootBytes = await pkg.resolver.fetchBytes(pkg.rootEntry);\n const stage = await this.composeStageFromBytes(rootBytes, pkg.rootEntry, pkg.resolver);\n return { stage, baseUrl: pkg.rootEntry, resolver: pkg.resolver };\n }\n\n private buildFromStage({ stage, baseUrl, resolver }: OpenedStage): ThreeUsdRobot {\n const robot = extractRobotDescription(stage, this.extractOptions());\n const tree = buildKinematicTree(robot);\n const robot3d = new ThreeUsdRobot(robot, tree, this.robotOptions());\n robot3d.stage = stage;\n\n const loadVisuals = this.options.loadVisuals ?? true;\n const loadCollisions = this.options.loadCollisions ?? false;\n // A stage with no articulation at all is a pure static scene; default to\n // drawing its geometry — otherwise the load would be silently empty.\n const isStaticScene =\n Object.keys(robot.links).length === 0 && Object.keys(robot.joints).length === 0;\n if (isStaticScene && this.options.loadSceneGeometry === undefined) {\n this.options.onWarn?.(\n \"no articulation found (0 links / 0 joints); rendering the stage as static scene geometry\",\n );\n }\n const loadScene = this.options.loadSceneGeometry ?? isStaticScene;\n if (loadVisuals || loadCollisions || loadScene) {\n const textureProvider =\n (this.options.loadTextures ?? true) ? createTextureProvider(resolver, baseUrl) : undefined;\n if (loadVisuals || loadCollisions) {\n bindRobotMeshes(stage, robot3d, robot, {\n loadVisuals,\n loadCollisions,\n ...(textureProvider ? { textureProvider } : {}),\n });\n }\n if (loadScene) {\n bindSceneMeshes(stage, robot3d, robot, {\n ...(textureProvider ? { textureProvider } : {}),\n });\n }\n }\n return robot3d;\n }\n\n private async composeStage(\n text: string,\n baseUrl: string,\n resolver: AssetResolver,\n ): Promise<Stage> {\n const composeOptions = this.options.onWarn ? { onWarn: this.options.onWarn } : {};\n return Stage.OpenFromFile(await composeLayer(text, baseUrl, resolver, composeOptions));\n }\n\n /** Compose a layer from raw bytes, sniffing binary crate vs USDA text. */\n private async composeStageFromBytes(\n bytes: Uint8Array,\n baseUrl: string,\n resolver: AssetResolver,\n ): Promise<Stage> {\n const composeOptions = this.options.onWarn ? { onWarn: this.options.onWarn } : {};\n const composed = CrateReader.isCrate(bytes)\n ? await composeFile(\n crateToUsdaFile(new CrateReader(bytes)),\n baseUrl,\n resolver,\n composeOptions,\n )\n : await composeLayer(new TextDecoder().decode(bytes), baseUrl, resolver, composeOptions);\n return Stage.OpenFromFile(composed);\n }\n\n private robotOptions(): ThreeUsdRobotOptions {\n return {\n ...(this.options.worldUp\n ? { worldUp: this.options.worldUp }\n : { upAxisConversion: this.options.upAxisConversion ?? \"auto\" }),\n ...(this.options.clampJointLimits !== undefined\n ? { clampJointLimits: this.options.clampJointLimits }\n : {}),\n ...(this.options.unitScale !== undefined ? { unitScale: this.options.unitScale } : {}),\n ...(this.options.applyDriveTargetsAsInitialPose !== undefined\n ? { applyInitialPose: this.options.applyDriveTargetsAsInitialPose }\n : {}),\n };\n }\n\n private extractOptions(): { robotName?: string; onWarn?: (message: string) => void } {\n return {\n ...(this.options.robotName !== undefined ? { robotName: this.options.robotName } : {}),\n ...(this.options.onWarn !== undefined ? { onWarn: this.options.onWarn } : {}),\n };\n }\n}\n"]}
package/dist/core.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { U as UsdaFile, i as MetadataMap, q as UsdValue, P as PrimSpec, l as RelationshipSpec, m as SdfPath, f as AttributeSpec, r as Variability, n as Specifier, b as Vec3, V as Vec2, M as Mat4, L as LinkDescription, R as RobotDescription, J as JointType, A as Axis, d as LinkInertialDescription } from './buildKinematicTree-D4R0hEtN.js';
2
- export { e as AssetPath, B as BuildTreeOptions, C as CompositionArc, D as DEG2RAD, a as JointDescription, c as JointDriveDescription, g as KinematicNode, K as KinematicTree, h as ListOp, j as PropertySpec, Q as Quat, k as RAD2DEG, S as SampleChannel, T as TreeEdge, o as UsdDictionary, p as UsdMatrix, s as Vec4, t as buildKinematicTree, u as channelFromSamples, v as decomposeRigid, w as fromUsdMatrix, x as getTranslation, y as identity4, z as interpolate, E as invert, F as makeEuler, G as makeRotationFromQuat, H as makeRotationX, I as makeRotationY, N as makeRotationZ, O as makeScale, W as makeTranslation, X as multiply, Y as multiplyAll, Z as toUsdMatrix } from './buildKinematicTree-D4R0hEtN.js';
1
+ import { U as UsdaFile, b as Vec3, V as Vec2, M as Mat4, L as LinkDescription, S as Stage, R as RobotDescription, P as Prim, x as UsdValue, J as JointType, A as Axis, s as SdfPath, d as LinkInertialDescription } from './buildKinematicTree-DQ4Vr4sJ.js';
2
+ export { e as AssetPath, f as Attribute, g as AttributeSpec, B as BuildTreeOptions, C as CompositionArc, D as DEFAULT_METERS_PER_UNIT, h as DEG2RAD, a as JointDescription, c as JointDriveDescription, i as KinematicNode, K as KinematicTree, j as Layer, k as ListOp, l as MetadataMap, m as PrimSpec, n as PropertySpec, Q as Quat, o as RAD2DEG, p as Relationship, q as RelationshipSpec, r as SampleChannel, t as Specifier, T as TreeEdge, u as UpAxis, v as UsdDictionary, w as UsdMatrix, y as Variability, z as Vec4, E as buildKinematicTree, F as channelFromSamples, G as decomposeRigid, H as fromUsdMatrix, I as getTranslation, N as identity4, O as interpolate, W as invert, X as makeEuler, Y as makeRotationFromQuat, Z as makeRotationX, _ as makeRotationY, $ as makeRotationZ, a0 as makeScale, a1 as makeTranslation, a2 as multiply, a3 as multiplyAll, a4 as toUsdMatrix } from './buildKinematicTree-DQ4Vr4sJ.js';
3
3
  import { A as AssetResolver } from './bytes-MOJ2oN-u.js';
4
4
  export { B as BinarySource, D as DefaultAssetResolver, U as UsdSource, c as createMemoryResolver, j as joinPosix, t as toBytes } from './bytes-MOJ2oN-u.js';
5
5
 
@@ -70,163 +70,6 @@ declare class ParseError extends Error {
70
70
  /** Serialize a parsed (or authored) USDA layer to text. */
71
71
  declare function serializeUsda(file: UsdaFile): string;
72
72
 
73
- /** A parsed USDA layer (`SdfLayer`-like, read-only). */
74
- declare class Layer {
75
- private readonly _file;
76
- constructor(_file: UsdaFile);
77
- /** Serialize this layer back to USDA text (`SdfLayer::ExportToString`-like). */
78
- ExportToString(): string;
79
- GetVersion(): string;
80
- GetPseudoRootMetadata(): MetadataMap;
81
- GetMetadata(key: string): UsdValue | undefined;
82
- GetDefaultPrimName(): string | undefined;
83
- GetRootPrimSpecs(): PrimSpec[];
84
- }
85
-
86
- /**
87
- * A typed attribute on a prim (`UsdAttribute`-like).
88
- *
89
- * Mirrors the pxr USD API: `GetAttribute` always returns an `Attribute` object;
90
- * call {@link Attribute.IsValid} to check whether the attribute is actually
91
- * authored on the prim.
92
- */
93
- declare class Attribute {
94
- private readonly _prim;
95
- private readonly _name;
96
- private readonly _spec;
97
- constructor(_prim: Prim, _name: string, _spec: AttributeSpec | null);
98
- IsValid(): boolean;
99
- GetPrim(): Prim;
100
- GetName(): string;
101
- GetBaseName(): string;
102
- GetNamespace(): string;
103
- /** Scalar type name (without the `[]` suffix); pair with {@link IsArray}. */
104
- GetTypeName(): string;
105
- IsArray(): boolean;
106
- GetVariability(): Variability;
107
- IsCustom(): boolean;
108
- /** True if a default value or any time sample is authored. */
109
- HasValue(): boolean;
110
- HasAuthoredValue(): boolean;
111
- /**
112
- * Resolve the attribute value. With no `time`, returns the default value (or
113
- * the earliest time sample if only samples are authored). With a `time`,
114
- * returns the exact sample if present, else the default, else the earliest
115
- * sample. Returns `undefined` when nothing is authored.
116
- */
117
- Get(time?: number): UsdValue | undefined;
118
- GetTimeSamples(): Map<number, UsdValue>;
119
- GetConnections(): SdfPath[];
120
- }
121
- /** A relationship on a prim (`UsdRelationship`-like). */
122
- declare class Relationship {
123
- private readonly _prim;
124
- private readonly _name;
125
- private readonly _spec;
126
- constructor(_prim: Prim, _name: string, _spec: RelationshipSpec | null);
127
- IsValid(): boolean;
128
- GetPrim(): Prim;
129
- GetName(): string;
130
- GetBaseName(): string;
131
- GetNamespace(): string;
132
- IsCustom(): boolean;
133
- GetTargets(): SdfPath[];
134
- }
135
-
136
- /**
137
- * A composed prim on a {@link Stage} (`UsdPrim`-like).
138
- *
139
- * The pseudo-root (path `/`) is represented by a Prim with a `null` spec; its
140
- * children are the stage's root prims.
141
- */
142
- declare class Prim {
143
- private readonly _stage;
144
- private readonly _spec;
145
- private readonly _path;
146
- private readonly _parent;
147
- private readonly _children;
148
- private _attributes?;
149
- private _relationships?;
150
- constructor(_stage: Stage, _spec: PrimSpec | null, _path: string, _parent: Prim | null);
151
- /** @internal Used by {@link Stage} while building the prim tree. */
152
- _addChild(child: Prim): void;
153
- GetStage(): Stage;
154
- IsValid(): boolean;
155
- IsPseudoRoot(): boolean;
156
- GetName(): string;
157
- GetPath(): string;
158
- GetTypeName(): string;
159
- GetSpecifier(): Specifier | null;
160
- GetParent(): Prim | null;
161
- GetChildren(): Prim[];
162
- GetChild(name: string): Prim | null;
163
- private attrMap;
164
- /** Always returns an Attribute; check {@link Attribute.IsValid}. */
165
- GetAttribute(name: string): Attribute;
166
- HasAttribute(name: string): boolean;
167
- GetAttributes(): Attribute[];
168
- private relMap;
169
- /** Always returns a Relationship; check {@link Relationship.IsValid}. */
170
- GetRelationship(name: string): Relationship;
171
- HasRelationship(name: string): boolean;
172
- GetRelationships(): Relationship[];
173
- GetMetadata(key: string): UsdValue | undefined;
174
- GetAllMetadata(): MetadataMap;
175
- /** Applied API schema names from `apiSchemas` (e.g. `PhysicsArticulationRootAPI`). */
176
- GetAppliedSchemas(): string[];
177
- /**
178
- * Whether the given API schema is applied. Matches the bare schema name as
179
- * well as multi-apply instances (e.g. `HasAPI("PhysicsDriveAPI")` is true for
180
- * an applied `PhysicsDriveAPI:angular`).
181
- */
182
- HasAPI(schemaName: string): boolean;
183
- }
184
-
185
- /** OpenUSD's fallback stage linear unit when `metersPerUnit` is unauthored. */
186
- declare const DEFAULT_METERS_PER_UNIT = 0.01;
187
- type UpAxis = "Y" | "Z";
188
- /**
189
- * A composed USD stage (`UsdStage`-like) backed by a single in-memory USDA
190
- * layer. Multi-layer composition (sublayers / references / payloads) arrives in
191
- * M8; for now a stage wraps exactly one parsed layer.
192
- */
193
- declare class Stage {
194
- private readonly _layer;
195
- private readonly _byPath;
196
- private readonly _pseudoRoot;
197
- private constructor();
198
- /** Parse and open a stage from USDA source text. */
199
- static OpenFromString(usda: string): Stage;
200
- /** Open a stage from an already-parsed layer. */
201
- static OpenFromFile(file: UsdaFile): Stage;
202
- private buildPrim;
203
- GetRootLayer(): Layer;
204
- /**
205
- * Serialize the stage's backing layer to USDA text. Loader-built stages wrap
206
- * the fully composed layer, so this is a flattened (`usdcat --flatten`-like)
207
- * export of everything that was read — including binary-crate sources.
208
- */
209
- ExportToString(): string;
210
- GetPseudoRoot(): Prim;
211
- /** Returns the prim at the absolute path, or `null` if none exists. */
212
- GetPrimAtPath(path: string): Prim | null;
213
- /** The stage's default prim (from layer `defaultPrim` metadata), if any. */
214
- GetDefaultPrim(): Prim | null;
215
- /** Depth-first traversal of all prims (excludes the pseudo-root). */
216
- Traverse(): Prim[];
217
- GetMetadata(key: string): UsdValue | undefined;
218
- /** Stage up axis (`upAxis` metadata); defaults to `"Y"` per OpenUSD. */
219
- GetUpAxis(): UpAxis;
220
- /** Stage linear unit (`metersPerUnit` metadata); defaults to {@link DEFAULT_METERS_PER_UNIT}. */
221
- GetMetersPerUnit(): number;
222
- /** Animation start time code, if authored. */
223
- GetStartTimeCode(): number | undefined;
224
- /** Animation end time code, if authored. */
225
- GetEndTimeCode(): number | undefined;
226
- /** Time codes per second for playback; defaults to 24. */
227
- GetTimeCodesPerSecond(): number;
228
- }
229
-
230
73
  /**
231
74
  * Geometry access for the robot exporter (M13).
232
75
  *
@@ -664,4 +507,4 @@ declare function getJointStatePosition(prim: Prim, kind: "angular" | "linear"):
664
507
  /** Read `UsdPhysicsMassAPI` properties, or `undefined` when none are authored (M16). */
665
508
  declare function getMassProperties(prim: Prim): LinkInertialDescription | undefined;
666
509
 
667
- export { ARTICULATION_ROOT_API, AssetResolver, Attribute, AttributeSpec, Axis, COLLISION_API, type CollisionApproximation, type ComposeOptions, CrateReader, DEFAULT_METERS_PER_UNIT, type ExportMaterial, type ExportMesh, type ExportPhysicsMaterial, type ExportRobotOptions, type ExtractOptions, JointType, Layer, LinkDescription, LinkInertialDescription, MASS_API, MESH_COLLISION_API, Mat4, MetadataMap, PACKAGE_NAME, PHYSICS_MATERIAL_API, ParseError, Prim, PrimSpec, RIGID_BODY_API, Relationship, RelationshipSpec, type ResolvedXform, RobotDescription, type RobotGeometryProvider, SdfPath, Specifier, Stage, type TextureChannel, TokenizeError, type UpAxis, UsdValue, UsdaFile, type UsdzPackage, VERSION, type ValidateRobotOptions, type ValidationIssue, type ValidationSeverity, Variability, Vec2, Vec3, composeFile, composeLayer, computeLocalTransform, computeWorldTransform, crateToUsdaFile, driveKindFor, exportRobotUsda, extractRobotDescription, gatherGprimDescendants, gatherMeshDescendants, getJointAxis, getJointBodies, getJointDrive, getJointLimits, getJointLocalFrame, getJointStatePosition, getJointType, getMassProperties, hasArticulationRootAPI, hasCollisionAPI, hasRigidBodyAPI, isMesh, isRenderableGprim, isScope, isSolidGprim, isXform, isZip, iterDescendants, jointValueFromSI, jointValueToSI, normalizeJointLimits, openUsdz, parseOpType, parseUsda, refineJointType, serializeUsda, stageGeometryProvider, tokenize, validateRobotDescription, writeUsdz };
510
+ export { ARTICULATION_ROOT_API, AssetResolver, Axis, COLLISION_API, type CollisionApproximation, type ComposeOptions, CrateReader, type ExportMaterial, type ExportMesh, type ExportPhysicsMaterial, type ExportRobotOptions, type ExtractOptions, JointType, LinkDescription, LinkInertialDescription, MASS_API, MESH_COLLISION_API, Mat4, PACKAGE_NAME, PHYSICS_MATERIAL_API, ParseError, Prim, RIGID_BODY_API, type ResolvedXform, RobotDescription, type RobotGeometryProvider, SdfPath, Stage, type TextureChannel, TokenizeError, UsdValue, UsdaFile, type UsdzPackage, VERSION, type ValidateRobotOptions, type ValidationIssue, type ValidationSeverity, Vec2, Vec3, composeFile, composeLayer, computeLocalTransform, computeWorldTransform, crateToUsdaFile, driveKindFor, exportRobotUsda, extractRobotDescription, gatherGprimDescendants, gatherMeshDescendants, getJointAxis, getJointBodies, getJointDrive, getJointLimits, getJointLocalFrame, getJointStatePosition, getJointType, getMassProperties, hasArticulationRootAPI, hasCollisionAPI, hasRigidBodyAPI, isMesh, isRenderableGprim, isScope, isSolidGprim, isXform, isZip, iterDescendants, jointValueFromSI, jointValueToSI, normalizeJointLimits, openUsdz, parseOpType, parseUsda, refineJointType, serializeUsda, stageGeometryProvider, tokenize, validateRobotDescription, writeUsdz };
package/dist/core.js CHANGED
@@ -1,5 +1,5 @@
1
- export { PACKAGE_NAME, VERSION, exportRobotUsda, stageGeometryProvider, validateRobotDescription, writeUsdz } from './chunk-P6CHTMGW.js';
2
- export { ARTICULATION_ROOT_API, Attribute, COLLISION_API, CrateReader, DEFAULT_METERS_PER_UNIT, DefaultAssetResolver, Layer, MASS_API, MESH_COLLISION_API, PHYSICS_MATERIAL_API, ParseError, Prim, RIGID_BODY_API, Relationship, Stage, TokenizeError, buildKinematicTree, composeFile, composeLayer, computeLocalTransform, computeWorldTransform, crateToUsdaFile, createMemoryResolver, driveKindFor, extractRobotDescription, gatherGprimDescendants, gatherMeshDescendants, getJointAxis, getJointBodies, getJointDrive, getJointLimits, getJointLocalFrame, getJointStatePosition, getJointType, getMassProperties, hasArticulationRootAPI, hasCollisionAPI, hasRigidBodyAPI, isMesh, isRenderableGprim, isScope, isSolidGprim, isXform, isZip, iterDescendants, joinPosix, jointValueFromSI, jointValueToSI, normalizeJointLimits, openUsdz, parseOpType, parseUsda, refineJointType, serializeUsda, toBytes, tokenize } from './chunk-PHHMWMCA.js';
1
+ export { PACKAGE_NAME, VERSION, exportRobotUsda, stageGeometryProvider, validateRobotDescription, writeUsdz } from './chunk-TE4MPP5Q.js';
2
+ export { ARTICULATION_ROOT_API, Attribute, COLLISION_API, CrateReader, DEFAULT_METERS_PER_UNIT, DefaultAssetResolver, Layer, MASS_API, MESH_COLLISION_API, PHYSICS_MATERIAL_API, ParseError, Prim, RIGID_BODY_API, Relationship, Stage, TokenizeError, buildKinematicTree, composeFile, composeLayer, computeLocalTransform, computeWorldTransform, crateToUsdaFile, createMemoryResolver, driveKindFor, extractRobotDescription, gatherGprimDescendants, gatherMeshDescendants, getJointAxis, getJointBodies, getJointDrive, getJointLimits, getJointLocalFrame, getJointStatePosition, getJointType, getMassProperties, hasArticulationRootAPI, hasCollisionAPI, hasRigidBodyAPI, isMesh, isRenderableGprim, isScope, isSolidGprim, isXform, isZip, iterDescendants, joinPosix, jointValueFromSI, jointValueToSI, normalizeJointLimits, openUsdz, parseOpType, parseUsda, refineJointType, serializeUsda, toBytes, tokenize } from './chunk-2UD32EGU.js';
3
3
  export { AssetPath, DEG2RAD, Quat, RAD2DEG, UsdMatrix, channelFromSamples, decomposeRigid, fromUsdMatrix, getTranslation, identity4, interpolate, invert, makeEuler, makeRotationFromQuat, makeRotationX, makeRotationY, makeRotationZ, makeScale, makeTranslation, multiply, multiplyAll, toUsdMatrix } from './chunk-IYKPVUZ2.js';
4
4
  //# sourceMappingURL=core.js.map
5
5
  //# sourceMappingURL=core.js.map
package/dist/extras.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { T as ThreeUsdRobot } from './ThreeUsdRobot-CsjraHqP.js';
1
+ import { T as ThreeUsdRobot } from './ThreeUsdRobot-BAh-48DD.js';
2
2
  import 'three';
3
- import './buildKinematicTree-D4R0hEtN.js';
3
+ import './buildKinematicTree-DQ4Vr4sJ.js';
4
4
 
5
5
  /**
6
6
  * `three-usd-robot/extras`
package/dist/helpers.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as THREE from 'three';
2
- import { T as ThreeUsdRobot, J as JointObject } from './ThreeUsdRobot-CsjraHqP.js';
3
- import './buildKinematicTree-D4R0hEtN.js';
2
+ import { T as ThreeUsdRobot, J as JointObject } from './ThreeUsdRobot-BAh-48DD.js';
3
+ import './buildKinematicTree-DQ4Vr4sJ.js';
4
4
 
5
5
  /**
6
6
  * Per-link appearance helpers: highlight (tint), material replacement, and
package/dist/helpers.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ThreeUsdRobot } from './chunk-3CANZKP3.js';
1
+ import { ThreeUsdRobot } from './chunk-WROYLUSS.js';
2
2
  import './chunk-IYKPVUZ2.js';
3
3
  import * as THREE3 from 'three';
4
4
 
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { Stage, Prim, CollisionApproximation, ExportPhysicsMaterial, RobotGeometryProvider, ExportRobotOptions, ExportMaterial, ExportMesh } from './core.js';
2
- export { ARTICULATION_ROOT_API, Attribute, COLLISION_API, ComposeOptions, CrateReader, DEFAULT_METERS_PER_UNIT, ExtractOptions, Layer, MASS_API, MESH_COLLISION_API, PACKAGE_NAME, PHYSICS_MATERIAL_API, ParseError, RIGID_BODY_API, Relationship, ResolvedXform, TextureChannel, TokenizeError, UpAxis, UsdzPackage, VERSION, ValidateRobotOptions, ValidationIssue, ValidationSeverity, composeFile, composeLayer, computeLocalTransform, computeWorldTransform, crateToUsdaFile, driveKindFor, exportRobotUsda, extractRobotDescription, gatherGprimDescendants, gatherMeshDescendants, getJointAxis, getJointBodies, getJointDrive, getJointLimits, getJointLocalFrame, getJointStatePosition, getJointType, getMassProperties, hasArticulationRootAPI, hasCollisionAPI, hasRigidBodyAPI, isMesh, isRenderableGprim, isScope, isSolidGprim, isXform, isZip, iterDescendants, jointValueFromSI, jointValueToSI, normalizeJointLimits, openUsdz, parseOpType, parseUsda, refineJointType, serializeUsda, stageGeometryProvider, tokenize, validateRobotDescription, writeUsdz } from './core.js';
1
+ import { CollisionApproximation, ExportPhysicsMaterial, RobotGeometryProvider, ExportRobotOptions, ExportMaterial, ExportMesh } from './core.js';
2
+ export { ARTICULATION_ROOT_API, COLLISION_API, ComposeOptions, CrateReader, ExtractOptions, MASS_API, MESH_COLLISION_API, PACKAGE_NAME, PHYSICS_MATERIAL_API, ParseError, RIGID_BODY_API, ResolvedXform, TextureChannel, TokenizeError, UsdzPackage, VERSION, ValidateRobotOptions, ValidationIssue, ValidationSeverity, composeFile, composeLayer, computeLocalTransform, computeWorldTransform, crateToUsdaFile, driveKindFor, exportRobotUsda, extractRobotDescription, gatherGprimDescendants, gatherMeshDescendants, getJointAxis, getJointBodies, getJointDrive, getJointLimits, getJointLocalFrame, getJointStatePosition, getJointType, getMassProperties, hasArticulationRootAPI, hasCollisionAPI, hasRigidBodyAPI, isMesh, isRenderableGprim, isScope, isSolidGprim, isXform, isZip, iterDescendants, jointValueFromSI, jointValueToSI, normalizeJointLimits, openUsdz, parseOpType, parseUsda, refineJointType, serializeUsda, stageGeometryProvider, tokenize, validateRobotDescription, writeUsdz } from './core.js';
3
3
  import * as THREE from 'three';
4
- import { A as Axis, V as Vec2, b as Vec3, R as RobotDescription, c as JointDriveDescription, d as LinkInertialDescription, K as KinematicTree, U as UsdaFile, M as Mat4 } from './buildKinematicTree-D4R0hEtN.js';
5
- export { e as AssetPath, f as AttributeSpec, B as BuildTreeOptions, C as CompositionArc, D as DEG2RAD, a as JointDescription, J as JointType, g as KinematicNode, L as LinkDescription, h as ListOp, i as MetadataMap, P as PrimSpec, j as PropertySpec, Q as Quat, k as RAD2DEG, l as RelationshipSpec, S as SampleChannel, m as SdfPath, n as Specifier, T as TreeEdge, o as UsdDictionary, p as UsdMatrix, q as UsdValue, r as Variability, s as Vec4, t as buildKinematicTree, u as channelFromSamples, v as decomposeRigid, w as fromUsdMatrix, x as getTranslation, y as identity4, z as interpolate, E as invert, F as makeEuler, G as makeRotationFromQuat, H as makeRotationX, I as makeRotationY, N as makeRotationZ, O as makeScale, W as makeTranslation, X as multiply, Y as multiplyAll, Z as toUsdMatrix } from './buildKinematicTree-D4R0hEtN.js';
6
- import { T as ThreeUsdRobot } from './ThreeUsdRobot-CsjraHqP.js';
7
- export { J as JointObject, L as LinkObject, a as ThreeUsdRobotOptions } from './ThreeUsdRobot-CsjraHqP.js';
4
+ import { A as Axis, V as Vec2, b as Vec3, S as Stage, P as Prim, R as RobotDescription, c as JointDriveDescription, d as LinkInertialDescription, K as KinematicTree, U as UsdaFile, M as Mat4 } from './buildKinematicTree-DQ4Vr4sJ.js';
5
+ export { e as AssetPath, f as Attribute, g as AttributeSpec, B as BuildTreeOptions, C as CompositionArc, D as DEFAULT_METERS_PER_UNIT, h as DEG2RAD, a as JointDescription, J as JointType, i as KinematicNode, j as Layer, L as LinkDescription, k as ListOp, l as MetadataMap, m as PrimSpec, n as PropertySpec, Q as Quat, o as RAD2DEG, p as Relationship, q as RelationshipSpec, r as SampleChannel, s as SdfPath, t as Specifier, T as TreeEdge, u as UpAxis, v as UsdDictionary, w as UsdMatrix, x as UsdValue, y as Variability, z as Vec4, E as buildKinematicTree, F as channelFromSamples, G as decomposeRigid, H as fromUsdMatrix, I as getTranslation, N as identity4, O as interpolate, W as invert, X as makeEuler, Y as makeRotationFromQuat, Z as makeRotationX, _ as makeRotationY, $ as makeRotationZ, a0 as makeScale, a1 as makeTranslation, a2 as multiply, a3 as multiplyAll, a4 as toUsdMatrix } from './buildKinematicTree-DQ4Vr4sJ.js';
6
+ import { T as ThreeUsdRobot } from './ThreeUsdRobot-BAh-48DD.js';
7
+ export { J as JointObject, L as LinkObject, a as ThreeUsdRobotOptions, W as WorldUpAxis } from './ThreeUsdRobot-BAh-48DD.js';
8
8
  import { A as AssetResolver } from './bytes-MOJ2oN-u.js';
9
9
  export { B as BinarySource, D as DefaultAssetResolver, U as UsdSource, c as createMemoryResolver, j as joinPosix, t as toBytes } from './bytes-MOJ2oN-u.js';
10
- export { a as ThreeUsdRobotLoader, T as ThreeUsdRobotLoaderOptions } from './ThreeUsdRobotLoader-CxOGRLXH.js';
10
+ export { a as ThreeUsdRobotLoader, T as ThreeUsdRobotLoaderOptions } from './ThreeUsdRobotLoader-DYtvelif.js';
11
11
 
12
12
  /** Unit vector for a USD joint axis token. Returns a fresh vector each call. */
13
13
  declare function axisVector(axis: Axis): THREE.Vector3;
@@ -169,9 +169,12 @@ bindingPrim?: Prim): THREE.Material;
169
169
  declare function bindRobotMeshes(stage: Stage, robot3d: ThreeUsdRobot, desc: RobotDescription, options?: BindMeshesOptions): void;
170
170
  /**
171
171
  * Attach the gprims that belong to no link — the static scenery of a cell that
172
- * also contains robots. They are placed by their authored stage transform
173
- * under the robot root, so the loader's up-axis and unit normalization applies
174
- * to them too. Collision-only and guide/proxy prims are skipped.
172
+ * also contains robots. The authored prim hierarchy is mirrored with
173
+ * `THREE.Group` nodes (each carrying `userData.primPath` and its prim's local
174
+ * transform), so grouped scenery — a pallet and its cartons, a fence and its
175
+ * wires — stays one movable subtree. World placements are unchanged, and the
176
+ * loader's up-axis and unit normalization still applies at the robot root.
177
+ * Collision-only and guide/proxy prims are skipped.
175
178
  */
176
179
  declare function bindSceneMeshes(stage: Stage, robot3d: ThreeUsdRobot, desc: RobotDescription, options?: {
177
180
  textureProvider?: TextureProvider;
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { stageGeometryProvider, exportRobotUsda } from './chunk-P6CHTMGW.js';
2
- export { PACKAGE_NAME, VERSION, exportRobotUsda, stageGeometryProvider, validateRobotDescription, writeUsdz } from './chunk-P6CHTMGW.js';
3
- export { ThreeUsdRobotLoader, bindRobotMeshes, bindSceneMeshes, buildGprimGeometry, buildMeshGeometry, buildMeshMaterial, createTextureProvider } from './chunk-YX5GIEMT.js';
4
- import { refineJointType, buildKinematicTree } from './chunk-PHHMWMCA.js';
5
- export { ARTICULATION_ROOT_API, Attribute, COLLISION_API, CrateReader, DEFAULT_METERS_PER_UNIT, DefaultAssetResolver, Layer, MASS_API, MESH_COLLISION_API, PHYSICS_MATERIAL_API, ParseError, Prim, RIGID_BODY_API, Relationship, Stage, TokenizeError, buildKinematicTree, composeFile, composeLayer, computeLocalTransform, computeWorldTransform, crateToUsdaFile, createMemoryResolver, driveKindFor, extractRobotDescription, gatherGprimDescendants, gatherMeshDescendants, getJointAxis, getJointBodies, getJointDrive, getJointLimits, getJointLocalFrame, getJointStatePosition, getJointType, getMassProperties, hasArticulationRootAPI, hasCollisionAPI, hasRigidBodyAPI, isMesh, isRenderableGprim, isScope, isSolidGprim, isXform, isZip, iterDescendants, joinPosix, jointValueFromSI, jointValueToSI, normalizeJointLimits, openUsdz, parseOpType, parseUsda, refineJointType, resolveBoundMaterial, serializeUsda, toBytes, tokenize } from './chunk-PHHMWMCA.js';
6
- export { JointObject, LinkObject, ThreeUsdRobot, axisVector } from './chunk-3CANZKP3.js';
1
+ import { stageGeometryProvider, exportRobotUsda } from './chunk-TE4MPP5Q.js';
2
+ export { PACKAGE_NAME, VERSION, exportRobotUsda, stageGeometryProvider, validateRobotDescription, writeUsdz } from './chunk-TE4MPP5Q.js';
3
+ export { ThreeUsdRobotLoader, bindRobotMeshes, bindSceneMeshes, buildGprimGeometry, buildMeshGeometry, buildMeshMaterial, createTextureProvider } from './chunk-XEXFGL7R.js';
4
+ import { refineJointType, buildKinematicTree } from './chunk-2UD32EGU.js';
5
+ export { ARTICULATION_ROOT_API, Attribute, COLLISION_API, CrateReader, DEFAULT_METERS_PER_UNIT, DefaultAssetResolver, Layer, MASS_API, MESH_COLLISION_API, PHYSICS_MATERIAL_API, ParseError, Prim, RIGID_BODY_API, Relationship, Stage, TokenizeError, buildKinematicTree, composeFile, composeLayer, computeLocalTransform, computeWorldTransform, crateToUsdaFile, createMemoryResolver, driveKindFor, extractRobotDescription, gatherGprimDescendants, gatherMeshDescendants, getJointAxis, getJointBodies, getJointDrive, getJointLimits, getJointLocalFrame, getJointStatePosition, getJointType, getMassProperties, hasArticulationRootAPI, hasCollisionAPI, hasRigidBodyAPI, isMesh, isRenderableGprim, isScope, isSolidGprim, isXform, isZip, iterDescendants, joinPosix, jointValueFromSI, jointValueToSI, normalizeJointLimits, openUsdz, parseOpType, parseUsda, refineJointType, resolveBoundMaterial, serializeUsda, toBytes, tokenize } from './chunk-2UD32EGU.js';
6
+ export { JointObject, LinkObject, ThreeUsdRobot, axisVector } from './chunk-WROYLUSS.js';
7
7
  import { identity4, multiply, invert } from './chunk-IYKPVUZ2.js';
8
8
  export { AssetPath, DEG2RAD, Quat, RAD2DEG, UsdMatrix, channelFromSamples, decomposeRigid, fromUsdMatrix, getTranslation, identity4, interpolate, invert, makeEuler, makeRotationFromQuat, makeRotationX, makeRotationY, makeRotationZ, makeScale, makeTranslation, multiply, multiplyAll, toUsdMatrix } from './chunk-IYKPVUZ2.js';
9
9
  import * as THREE from 'three';
package/dist/react.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as _react_three_fiber from '@react-three/fiber';
2
2
  import { ThreeElements } from '@react-three/fiber';
3
3
  import * as React from 'react';
4
- import { T as ThreeUsdRobot } from './ThreeUsdRobot-CsjraHqP.js';
5
- import { T as ThreeUsdRobotLoaderOptions } from './ThreeUsdRobotLoader-CxOGRLXH.js';
4
+ import { T as ThreeUsdRobot } from './ThreeUsdRobot-BAh-48DD.js';
5
+ import { T as ThreeUsdRobotLoaderOptions } from './ThreeUsdRobotLoader-DYtvelif.js';
6
6
  import 'three';
7
- import './buildKinematicTree-D4R0hEtN.js';
7
+ import './buildKinematicTree-DQ4Vr4sJ.js';
8
8
  import './bytes-MOJ2oN-u.js';
9
9
 
10
10
  /**
package/dist/react.js CHANGED
@@ -1,6 +1,6 @@
1
- import { ThreeUsdRobotLoader } from './chunk-YX5GIEMT.js';
2
- import './chunk-PHHMWMCA.js';
3
- import './chunk-3CANZKP3.js';
1
+ import { ThreeUsdRobotLoader } from './chunk-XEXFGL7R.js';
2
+ import './chunk-2UD32EGU.js';
3
+ import './chunk-WROYLUSS.js';
4
4
  import './chunk-IYKPVUZ2.js';
5
5
  import { useFrame } from '@react-three/fiber';
6
6
  import * as React from 'react';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "three-usd-robot",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Kinematic OpenUSD robot loader for Three.js — load Isaac Sim / OpenUSD robot assets, extract joints and links, and control articulations in the browser.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -58,8 +58,8 @@
58
58
  "format": "biome format --write .",
59
59
  "check": "biome check --write .",
60
60
  "demo:factory": "tsx scripts/demo-factory.ts",
61
- "demo:install": "npm install --prefix examples/vite-joint-slider",
62
- "demo:build": "npm run demo:factory && npm run build --prefix examples/vite-joint-slider"
61
+ "demo:install": "npm install --prefix examples/vite-usd-inspector",
62
+ "demo:build": "npm run demo:factory && npm run build --prefix examples/vite-usd-inspector"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "@react-three/fiber": ">=8",