Build and revise procedural 3D assets with your coding agent. Local MCP server, CLI and TypeScript engine with rendered review, editable source and GLB export.
JavaScript 3d3d-assets3d-modelingagent-skillsagent-toolsai-agentsasset-pipelinecligame-assetsglbgltfmcpmcp-servermodel-context-protocolprocedural-generationprocedural-modelingtext-to-3dthreejstypescript
import * as THREE from 'three/webgpu';
/** Exact authored marker closure; tool geometry stays in its own asset frame. */
export function attachAtSocket(socket,toolRoot,toolGrip){
if(!socket||!toolRoot||!toolGrip)throw Error('Tool attachment requires both declared grip frames.');
toolRoot.updateWorldMatrix(true,true);
const localGrip=new THREE.Matrix4().copy(toolRoot.matrixWorld).invert().multiply(toolGrip.matrixWorld),placement=localGrip.invert();
socket.add(toolRoot);placement.decompose(toolRoot.position,toolRoot.quaternion,toolRoot.scale);toolRoot.updateMatrix();
}