// Illustrative furniture; the supplied drawings document room uses, not a furnishing design. export function furnish(ctx,data){ const {THREE,planPoint,box,mesh,group}=ctx;const material=c=>new THREE.MeshStandardMaterial({color:c,roughness:.82}); const m={wood:material('#bea17b'),light:material('#dfceb1'),sage:material('#9eab9c'),fabric:material('#c5b8a5'),white:material('#efede4'),dark:material('#36413e'),water:material('#b8ced0'),metal:material('#9da6a3')}; for(const f of data.levels){ f.furnitureColliders=[];let parent=f.furniture,base=0; function block(name,x,y,w,d,h,z,mat=m.wood){const [X,Z]=planPoint(x,y);return box(parent,name,X,base+z+h/2,Z,w,h,d,mat);} function solid(x,y,w,d){const [X,Z]=planPoint(x,y);f.furnitureColliders.push({minX:X-w/2,maxX:X+w/2,minZ:Z-d/2,maxZ:Z+d/2});} function oval(name,x,y,w,d,h,z,mat){const o=mesh(new THREE.SphereGeometry(1,16,8),mat,parent,name);const [X,Z]=planPoint(x,y);o.position.set(X,base+z+h/2,Z);o.scale.set(w/2,h/2,d/2);return o;} function cabinet(x,y,w,d,h=.86){block('Skříňka',x,y,w,d,h,.04,m.sage);block('Pracovní deska',x,y,w+.035,d+.035,.045,h+.04,m.light);for(let a=x-w/2+.6;a1.4?2:1);i++)oval('Polštář',x+(w>1.4?(i-.5)*.78:0),y+d/2-.32,.65,.4,.13,.59,m.white);solid(x,y,w,d);} function sofa(x,y,w=2.2){block('Pohovka – sedák',x,y,w,.9,.37,.12,m.fabric);block('Opěradlo pohovky',x,y+.38,w,.17,.72,.12,m.sage);for(const a of [-1,1])block('Područka',x+a*(w/2-.08),y,.16,.92,.56,.12,m.sage);for(let a=x-w/2+.4;a