PageSourceSearch

https://goldrush.net/v8/timber-finish.js

js goldrush.net collected 2026-10-05 10:29:00 UTC 1,016 bytes, 3 lines download raw bytes

1// Align a single photographed timber strip with each member, instead of mapping
2// an entire deck of planks onto every post. Runs before batching.
3export function finishTimber(scene,m){let count=0;scene.traverse(o=>{if(!o.isMesh||Array.isArray(o.material)||!o.material.map||o.material.map!==m.wood.map)return;const g=o.geometry.clone(),p=g.attributes.position,n=g.attributes.normal,uv=g.attributes.uv;if(!uv||!n)return;g.computeBoundingBox();const b=g.boundingBox,mins=b.min.toArray(),maxs=b.max.toArray(),sizes=maxs.map((v,i)=>v-mins[i]);const long=sizes.indexOf(Math.max(...sizes));if(sizes[long]<1e-6)return;for(let i=0;i<p.count;i++){const pos=[p.getX(i),p.getY(i),p.getZ(i)],norm=[Math.abs(n.getX(i)),Math.abs(n.getY(i)),Math.abs(n.getZ(i))],face=norm.indexOf(Math.max(...norm));const side=[0,1,2].find(a=>a!==long&&a!==face)??(long+1)%3;uv.setXY(i,(pos[long]-mins[long])/sizes[long],(pos[side]-mins[side])/Math.max(sizes[side],1e-6));}uv.needsUpdate=true;o.geometry=g;count++});return{alignedTimbers:count};}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.