Agent skill for creative 3D visualization: turn an idea into a Three.js/Blender scene worth exploring. Claude Code + Codex plugin, 223 recipes, 440 knowledge records, 22 proved kits, 37 runnable studies.
import {THREE,mat,mesh,sphere,line,label} from '../scene-kit.js';
import {study,instrumentBase,ring,rounded,setSegment,dynamicLine,TAU} from '../study-kit.js';
import {doublePendulumDerivative,doublePendulumEnergy,rk4Step} from './physics-models.js';
export function createScene(){
const group=new THREE.Group(),{brass,dark}=instrumentBase(group,5.7,2.4,-1.65),steel=mat('#aac2c5',.25,.7),pink=mat('#dba18b',.3,.4);
const pivot=[0,1.25,.12],params={m1:1,m2:.82,l1:1.12,l2:1.02,g:9.81};let release=112,delta=.12,running=true,states,energies,acc=0,time=0;
for(const x of [-2.25,2.25]){rounded([.15,3.45,.2],dark,[x,.14,-.46],group,.04);for(const y of [-1.35,1.7])mesh(new THREE.CylinderGeometry(.15,.15,.08,24),brass,[x,y,-.46],group).rotation.x=Math.PI/2;}
rounded([4.7,.14,.28],dark,[0,1.82,-.46],group,.04);rounded([.16,.7,.45],brass,[0,1.48,-.22],group,.035);
ring(.18,.04,steel,group,pivot);ring(.1,.019,brass,group,[0,1.25,.2]);
const dial=new THREE.Group();dial.position.set(0,1.25,-.5);group.add(dial);ring(.55,.008,brass,dial);
for(let i=0;i<72;i++){const a=i/72*TAU;line([[.55*Math.sin(a),-.55*Math.cos(a),0],[(i%6?.58:.63)*Math.sin(a),-(i%6?.58:.63)*Math.cos(a),0]],'#bfa779',dial,.6);}
const models=[];for(let i=0;i<2;i++){const m=i?mat('#80cbbf',.35,.3,{transparent:true,opacity:.65}):pink;const rods=[0,1].map(()=>mesh(new THREE.CylinderGeometry(.028,.028,1,16),i?m:brass,[0,0,0],group));const bobs=[0,1].map(()=>sphere([0,0,0],.11,m,group));const hubs=bobs.map(b=>ring(.115,.017,i?m:steel,b));const trail=dynamicLine(450,i?'#7ac7bc':'#dca08b',group,.58);models.push({rods,bobs,hubs,trail,history:[]});}
label('A · RELEASE',[-1.45,-1.34,.75],'#dfa58f',.12,group);label('B · + ε',[1.45,-1.34,.75],'#9bd6c7',.12,group);
const points=s=>{const a=[params.l1*Math.sin(s[0]),pivot[1]-params.l1*Math.cos(s[0]),pivot[2]];return[a,[a[0]+params.l2*Math.sin(s[2]),a[1]-params.l2*Math.cos(s[2]),a[2]]];};
function reset(){running=true;states=[[release*Math.PI/180,0,(release-4)*Math.PI/180,0],[release*Math.PI/180,0,(release-4+delta)*Math.PI/180,0]];energies=states.map(s=>doublePendulumEnergy(s,params));acc=time=0;models.forEach(m=>m.history=[]);refresh(false);}
function refresh(append){models.forEach((m,i)=>{const [a,b]=points(states[i]);a[2]+=.04*i;b[2]+=.04*i;setSegment(m.rods[0],[...pivot.slice(0,2),pivot[2]+.04*i],a);setSegment(m.rods[1],a,b);m.bobs[0].position.set(...a);m.bobs[1].position.set(...b);if(append){m.history.push([...b]);if(m.history.length>450)m.history.shift();}m.trail.setPoints(m.history);});}
function update(dt){if(running&&dt>0){acc+=Math.min(dt,.05);let count=0;while(acc>=1/240&&count++<16){states=states.map(s=>rk4Step(s,1/240,doublePendulumDerivative,params));acc-=1/240;time+=1/240;}refresh(true);}else refresh(false);}
reset();return study(group,{update,reset,needsAnimation:()=>running,controls:[{id:'angle',label:'Release angle (degrees)',type:'range',min:60,max:145,step:1,get:()=>release,set:v=>{release=v;reset();}},{id:'difference',label:'Initial difference ε (degrees)',type:'range',min:.01,max:1,step:.01,get:()=>delta,set:v=>{delta=v;reset();}},{id:'run',label:'Release / pause both pendulums',type:'button',set:()=>running=!running},{id:'again',label:'Repeat the same experiment',type:'button',set:()=>{reset();running=true;}}],stats:()=>[{label:'Model time',value:time.toFixed(2)+' s'},{label:'Tip separation',value:new THREE.Vector3(...points(states[0])[1]).distanceTo(new THREE.Vector3(...points(states[1])[1])).toFixed(3)+' m'},{label:'Energy error A',value:(doublePendulumEnergy(states[0],params)-energies[0]).toExponential(1)+' J'}],views:{overview:{position:[2.8,1.8,8.3],target:[0,.25,0]},detail:{position:[1.5,1,5.5],target:[0,.4,0]}},note:'Model constants: m₁=1 kg, m₂=0.82 kg, l₁=1.12 m, l₂=1.02 m, g=9.81 m/s². Two independent planar double pendulums use point masses, massless rods, frictionless pivots and fixed 1/240 s RK4 integration. Their initial second angles differ by ε. The traces and slight display depth offset aid comparison; the two mathematical systems do not collide. Numerical energy error is reported rather than interpreted as friction.',sources:[{title:'UC Berkeley Rotations — Double pendulum',url:'https://rotations.berkeley.edu/the-double-pendulum/'}]});
}