1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9298],{42817:function(e,t,r){r.d(t,{Y:function(){return i}});var n=r(57437);function i(e){let{rotating:t,onToggle:r}=e;return(0,n.jsxs)("button",{type:"button",className:"preview-autorotate".concat(t?" is-on":""),onClick:r,"aria-pressed":t,title:t?"Pause auto-rotation":"Resume auto-rotation",children:[(0,n.jsxs)("svg",{viewBox:"0 0 24 24",width:"13",height:"13","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M21 12a9 9 0 1 1-2.64-6.36"}),(0,n.jsx)("path",{d:"M21 3v5h-5"})]}),(0,n.jsx)("span",{children:"Auto-rotate"})]})}},89298:function(e,t,r){r.r(t),r.d(t,{LithoPreview:function(){return p}});var n=r(57437),i=r(2265),a=r(51448),s=r(72079),o=r(2691),u=r(42817),l=r(41235),c=r(83880),d=r(5538);let v=e=>"".concat(e.name,":").concat(e.size,":").concat(e.lastModified),m=(e,t)=>"".concat(v(e),"|").concat(t.detail,"|").concat(t.rotate,"|").concat(t.flipH,"|").concat(t.flipV,"|").concat("heart"===t.shape?"short":"long"),f=(e,t)=>"".concat(m(e,t),"|").concat(t.smooth,"|").concat(t.negative,"|").concat(t.brightness,"|").concat(t.contrast,"|").concat(t.gamma),h=(e,t)=>"".concat(f(e,t),"||").concat(t.shape,"|").concat(t.width,"|").concat(t.maxThickness,"|").concat(t.baseThickness,"|").concat(t.toneMap,"|").concat(t.thicknessGamma,"|").concat(t.curveAngle,"|").concat(t.diameter,"|").concat(t.reliefSide,"|").concat(t.border,"|").concat(t.borderWidth,"|").concat(t.hangingHole);function p(e){let{file:t,options:r,lit:l,onStatus:v}=e,p=(0,i.useRef)(null),g=(0,i.useRef)(null),w=(0,i.useRef)(null),y=(0,i.useRef)(null),M=(0,i.useRef)(null),D=(0,i.useRef)(null),b=(0,i.useRef)(null),U=(0,i.useRef)(null),k=(0,i.useRef)(null),R=(0,i.useRef)(null),j=(0,i.useRef)(null),E=(0,i.useRef)(!1),P=(0,i.useRef)(0),C=(0,i.useRef)(v);C.current=v;let[S,A]=(0,i.useState)(()=>!window.matchMedia("(prefers-reduced-motion: reduce)").matches),z=(0,i.useRef)(S);z.current=S;let T=(0,i.useRef)(l);return T.current=l,(0,i.useEffect)(()=>{let e;let t=p.current;if(!t)return;try{e=new a.CP7({antialias:!0,alpha:!0})}catch(e){var r;null===(r=C.current)||void 0===r||r.call(C,{status:"error",source:"webgl",message:"WebGL is unavailable in this browser â the 3D preview is off, but exports still work."});return}e.setPixelRatio(Math.min(window.devicePixelRatio,2)),(0,c.TM)(e);let n=t.clientWidth||600,i=t.clientHeight||360;e.setSize(n,i),t.appendChild(e.domElement),e.domElement.style.touchAction="pan-y",e.domElement.setAttribute("role","img"),e.domElement.setAttribute("aria-label","3D lithophane preview â drag to rotate");let u=e=>e.preventDefault();e.domElement.addEventListener("webglcontextlost",u);let l=new s.xsS,d=(0,c.kM)(e);l.environment=d.texture;let v=new s.cPb(c.UV,n/i,.01,5e3);v.position.set(0,0,200);let m=new o.z(v,e.domElement);m.enableDamping=!0,m.dampingFactor=.08,m.autoRotate=z.current,m.autoRotateSpeed=.9,m.enablePan=!1;let f=()=>{m.autoRotate&&(m.autoRotate=!1,A(!1))};m.addEventListener("start",f),g.current=l,w.current=e,y.current=v,M.current=m;let h=new ResizeObserver(()=>{let r=t.clientWidth,n=t.clientHeight||360;0!==r&&(e.setSize(r,n),v.aspect=r/n,v.updateProjectionMatrix())});h.observe(t);let U=0,k=!0,S=()=>
1{if(!k||document.hidden){U=0;return}m.update(),e.render(l,v),U=requestAnimationFrame(S)},T=()=>{k&&!document.hidden&&0===U?S():(!k||document.hidden)&&0!==U&&(cancelAnimationFrame(U),U=0)},L=new IntersectionObserver(e=>{let[t]=e;k=t.isIntersecting,T()});return L.observe(t),document.addEventListener("visibilitychange",T),S(),()=>{P.current+=1,cancelAnimationFrame(U),L.disconnect(),h.disconnect(),document.removeEventListener("visibilitychange",T),m.removeEventListener("start",f),m.dispose(),b.current&&(l.remove(b.current.group),b.current.dispose(),b.current=null),D.current&&(x(D.current),D.current=null),d.dispose(),e.domElement.removeEventListener("webglcontextlost",u),e.dispose(),e.forceContextLoss(),e.domElement.remove(),g.current=null,w.current=null,y.current=null,M.current=null,E.current=!1,R.current=null,j.current=null}},[]),(0,i.useEffect)(()=>{let e=D.current;e&&(e.mesh.material=l?e.litMaterial:e.unlitMaterial)},[l]),(0,i.useEffect)(()=>{var e,n,i;let a=g.current,o=w.current,u=y.current,l=M.current;if(!a||!o||!u||!l)return;if(!t){null===(n=C.current)||void 0===n||n.call(C,{status:"idle"});return}let v=e=>{e.mesh.material=T.current?e.litMaterial:e.unlitMaterial},p=h(t,r);if(D.current&&R.current===p){P.current+=1,D.current.recolor(r),v(D.current),j.current&&(null===(i=C.current)||void 0===i||i.call(C,j.current));return}let S=++P.current;null===(e=C.current)||void 0===e||e.call(C,{status:"building"});let A=m(t,r),z=f(t,r);(async()=>{var e,n,i,m;try{let m=(null===(e=U.current)||void 0===e?void 0:e.key)===A?U.current.raw:null;if(!m){if(m=await (0,d.K0)(t,r),S!==P.current)return;U.current={key:A,raw:m}}let f=(null===(n=k.current)||void 0===n?void 0:n.key)===z?k.current.field:null;f||(f=(0,d.yW)(m,r),k.current={key:z,field:f});let h=await (0,d.BO)(f,r);if(S!==P.current){x(h);return}v(h),D.current&&(a.remove(D.current.mesh),x(D.current)),a.add(h.mesh),D.current=h,R.current=p,function(e,t,r,n){let i=new s.ZzF().setFromObject(e);if(i.isEmpty())return;let a=i.getSize(new s.Pa4),o=i.getCenter(new s.Pa4),u=Math.max(a.x,a.y,a.z)||1,l=t.fov*Math.PI/180,c=n?u/2/Math.tan(l/2)*1.4:t.position.distanceTo(r.target),d=n?new s.Pa4(.15,.15,1).normalize():t.position.clone().sub(r.target).normalize();t.near=u/100,t.far=100*u,t.position.copy(o).add(d.multiplyScalar(c)),t.updateProjectionMatrix(),r.target.copy(o),r.minDistance=.5*u,r.maxDistance=10*u,r.update()}(h.mesh,u,l,!E.current),E.current=!0,b.current&&(a.remove(b.current.group),b.current.dispose(),b.current=null);let g=new s.ZzF().setFromObject(h.mesh);if(!g.isEmpty()){let e=(0,c.sh)(o,a,g);a.add(e.group),e.update(),b.current=e}let w={status:"ready",triangles:h.triangles,dims:h.dims,stlBytes:84+50*h.triangles,layers:Math.round(h.dims.height/r.layerHeight),warnings:[...h.warnings,...function(e,t,r){let n=[];e.stats.max-e.stats.min<.2&&n.push("Low image contrast â the relief will be shallow. Add contrast or use a punchier photo."),t.maxThickness-t.baseThickness<1.6&&n.push("Thin relief (max â base < 1.6 mm) â tones may not separate well when backlit."),t.baseThickness<.6&&n.push("Base under 0.6 mm can leak light and print fragile."),e.stats.nearWhite>.4&&n.push("Large near-white area â those parts print at the thin base and can look flat.");let i="cylinder"===t.shape?Math.PI*t.diameter/e.width:t.width/(e.width-1);return i>.35&&n.push("Coarse detail for this size (".concat(i.toFixed(2)," mm/pixel) â raise Detail for a sharper print.")),r>2e6&&n.push("Over 2M triangles â the file is heavy and may slow your slicer. Lower Detail if it struggles."),n}(f,r,h.triangles)],stats:f.stats};j.current=w,null===(i=C.current)||void 0===i||i.call(C,w)}catch(e){if(S!==P.current)return;null===(m=C.current)||void 0===m||m.call(C,{status:"error",source:"build",message:e instanceof Error?e.message:"Could not build the lithophane."})}})()},[t,r]),(0,n.jsx)("div",{className:"glb-opt-viewer",ref:p,children:(0,n.jsx)(u.Y,{rotating:S,onToggle:()=>A(e=>{let t=!e;return M.current&&(M.current.autoRotate=t),t})})})}function x(e){(0,l.U7)(e.mesh),e.litMaterial.dispose(),e.unlitMaterial.dispose()}},83880:function(e,t,r){r.d(t,{UV:function(){return l},TM:function(){return c},sh:function(){return m},kM:function(){return v},cz:function(){return d}});var n=r(72079),i=r(51448);class a extends n.xsS{constructor(){super(),this.name="RoomEnvironment",this.position.y=-3.5;let e=new n.DvJ;e.deleteAttribute("uv");let t=new n.Wid({side:n._Li}),r=new n.Wid,i=new n.cek(16777215,900,28,2);i.position.set(.418,16.199,.3),this.add(i);let a=new n.Kj0(e,t);a.position.set(-.757,13.219,.717),a.scale.set(31.713,28.305,28.591),this.add(a);let o=new n.SPe(e,r,6),u=new n.Tme;u.position.set(-10.906,2.009,1.846),u.rotation.set(0,-.195,0),u.scale.set(2.328,7.905,4.651),u.updateMatrix(),o.setMatrixAt(0,u.matrix),u.position.set(-5.607,-.754,-.758),u.rotation.set(0,.994,0),u.scale.set(1.97,1.534,3.955),u.updateMatrix(),o.setMatrixAt(1,u.matrix),u.position.set(6.167,.857,7.803),u.rotation.set(0,.561,0),u.scale.set(3.927,6.285,3.687),u.updateMatrix(),o.setMatrixAt(2,u.matrix),u.position.set(-2.017,.018,6.124),u.rotation.set(0,.333,0),u.scale.set(2.002,4.566,2.064),u.updateMatrix(),o.setMatrixAt(3,u.matrix),u.position.set(2.291,-.756,-2.621),u.rotation.set(0,-.286,0),u.scale.set(1.546,1.552,1.496),u.updateMatrix(),o.setMatrixAt(4,u.matrix),u.position.set(-2.193,-.369,-5.547),u.rotation.set(0,.516,0),u.scale.set(3.875,3.487,2.986),u.updateMatrix(),o.setMatrixAt(5,u.matrix),this.add(o);let l=new n.Kj0(e,s(50));l.position.set(-16.116,14.37,8.208),l.scale.set(.1,2.428,2.739),this.add(l);let c=new n.Kj0(e,s(50));c.position.set(-16.109,18.021,-8.207),c.scale.set(.1,2.425,2.751),this.add(c);let d=new n.Kj0(e,s(17));d.position.set(14.904,12.198,-1.832),d.scale.set(.15,4.265,6.331),this.add(d);let v=new n.Kj0(e,s(43));v.position.set(-.462,8.89,14.52),v.scale.set(4.38,5.441,.088),this.add(v);let m=new n.Kj0(e,s(20));m.position.set(3.235,11.486,-12.541),m.scale.set(2.5,2,.1),this.add(m);let f=new n.Kj0(e,s(100));f.position.set(0,20,0),f.scale.set(1,.1,1),this.add(f)}dispose(){let e=new Set;for(let t of(this.traverse(t=>{t.isMesh&&(e.add(t.geometry),e.add(t.material))}),e))t.dispose()}}function s(e){return new n.YBo({color:0,emissive:16777215,emissiveIntensity:e})}let o={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:` 2 3 varying vec2 vUv; 4 5 void main() { 6 7 vUv = uv; 8 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 9 10 }`,fragmentShader:` 11 12 uniform sampler2D tDiffuse; 13 uniform float h; 14 15 varying vec2 vUv; 16 17 void main() { 18 19 vec4 sum = vec4( 0.0 ); 20 21 sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051; 22 sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918; 23 sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245; 24 sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531; 25 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633; 26 sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531; 27 sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245; 28 sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918; 29 sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051; 30 31 gl_FragColor = sum; 32 33 }`},u={name:"VerticalBlurShader",uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:` 34 35 varying vec2 vUv; 36 37 void main() { 38 39 vUv = uv; 40 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 41 42 }`,fragmentShader:` 43 44 uniform sampler2D tDiffuse; 45 uniform float v; 46 47 varying vec2 vUv; 48 49 void main() { 50 51 vec4 sum = vec4( 0.0 ); 52 53 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051; 54 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918; 55 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245; 56 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531; 57 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633; 58 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531; 59 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245; 60 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918; 61 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051; 62 63 gl_FragColor = sum; 64 65 }`},l=30;function c(e){e.toneMapping=n.ORg,e.toneMappingExposure=1.3}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return e/Math.sin(t*Math.PI/360)}function v(e){let t=new i.anP(e),r=new a,n=t.fromScene(r,.04).texture;
65return r.dispose(),t.dispose(),{texture:n,dispose:()=>n.dispose()}}function m(e,t,r){var i,a,s,l;let c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},d=r.getSize(new n.Pa4),v=r.getCenter(new n.Pa4),m=null!==(i=c.resolution)&&void 0!==i?i:512,f=null!==(a=c.darkness)&&void 0!==a?a:1.1,h=null!==(s=c.blur)&&void 0!==s?s:3.2,p=1.5*Math.max(d.x,1e-4),x=1.5*Math.max(d.z,1e-4),g=1.5*Math.max(d.y,1e-4),w=new n.ZAu;w.position.set(v.x,r.min.y,v.z);let y=new n.dd2(m,m);y.texture.generateMipmaps=!1;let M=new n.dd2(m,m);M.texture.generateMipmaps=!1;let D=new n._12(p,x).rotateX(Math.PI/2),b=new n.vBJ({map:y.texture,opacity:null!==(l=c.opacity)&&void 0!==l?l:1,transparent:!0,depthWrite:!1}),U=new n.Kj0(D,b);U.renderOrder=1,U.scale.y=-1,w.add(U);let k=new n.Kj0(D);k.visible=!1,w.add(k);let R=new n.iKG(-p/2,p/2,x/2,-x/2,0,g);R.rotation.x=Math.PI/2,w.add(R);let j=new n.lRF,E={value:f};j.onBeforeCompile=e=>{e.uniforms.darkness=E,e.fragmentShader="uniform float darkness;\n".concat(e.fragmentShader).replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );","gl_FragColor = vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * darkness );")},j.depthTest=!1,j.depthWrite=!1;let P=new n.jyz(o);P.depthTest=!1;let C=new n.jyz(u);function S(t){k.visible=!0,k.material=P,P.uniforms.tDiffuse.value=y.texture,P.uniforms.h.value=t/m,e.setRenderTarget(M),e.render(k,R),k.material=C,C.uniforms.tDiffuse.value=M.texture,C.uniforms.v.value=t/m,e.setRenderTarget(y),e.render(k,R),k.visible=!1}return C.depthTest=!1,{group:w,update:function(){let r=t.background,n=t.overrideMaterial,i=e.getClearAlpha();U.visible=!1,t.background=null,t.overrideMaterial=j,e.setClearAlpha(0),e.setRenderTarget(y),e.clear(),e.render(t,R),t.overrideMaterial=n,S(h),S(.4*h),e.setRenderTarget(null),e.setClearAlpha(i),t.background=r,U.visible=!0},dispose(){y.dispose(),M.dispose(),D.dispose(),b.dispose(),j.dispose(),P.dispose(),C.dispose()}}}}}]);
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.