threejs
Three.js scene-graph parsing and export workflows: mesh baking, InstancedMesh expansion, part partitioning, per-link OBJ export, and URDF articulation.
npxskills add benchflow-ai/skillsbench--skill threejsLoading…
Three.js scene-graph parsing and export workflows: mesh baking, InstancedMesh expansion, part partitioning, per-link OBJ export, and URDF articulation.
npxskills add benchflow-ai/skillsbench--skill threejsLoading…
createScene(), then updateMatrixWorld(true).THREE.Group nodes as parts/links.Object3D (root)
├── Group (part)
│ ├── Mesh
│ └── Group (child part)
│ └── Mesh
└── Group (another part)
└── Mesh
THREE.Scene / THREE.Object3D: containersTHREE.Group: logical part (no geometry)THREE.Mesh: geometry + materialfunction buildPartMap(root) {
const parts = new Map();
root.traverse((obj) => {
if (obj.isGroup && obj.name) parts.set(obj.name, { group: obj, meshes: [] });
});
root.traverse((obj) => {
if (!obj.isMesh) return;
let parent = obj.parent;
while (parent && !(parent.isGroup && parent.name)) parent = parent.parent;
if (parent && parts.has(parent.name)) parts.get(parent.name).meshes.push(obj);
});
return Array.from(parts.values()).filter((p) => p.meshes.length > 0);
}
Always bake transforms before export:
root.updateMatrixWorld(true);
let geom = mesh.geometry.clone();
geom.applyMatrix4(mesh.matrixWorld);
if (geom.index) geom = geom.toNonIndexed();
if (!geom.attributes.normal) geom.computeVertexNormals();
const tempMatrix = new THREE.Matrix4();
const instanceMatrix = new THREE.Matrix4();
obj.getMatrixAt(i, instanceMatrix);
tempMatrix.copy(obj.matrixWorld).multiply(instanceMatrix);
const axisMatrix = new THREE.Matrix4().makeRotationX(-Math.PI / 2);
geom.applyMatrix4(axisMatrix);
<part>.obj.Reference: references/link-export-rules.md.
fixed unless evidence suggests revolute/prismatic.References:
references/joint-type-heuristics.mdreferences/urdf-minimal.mdnode scripts/export_instanced_obj.mjsnode scripts/export_link_objs.mjs --input <scene_js> --out-dir <dir>node scripts/build_urdf_from_scene.mjs --input <scene_js> --output <file.urdf> --mesh-dir <mesh_dir>Adjust inputs/outputs inside scripts as needed.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.
CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.
CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).