three-live 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/three-author-engine.js +58 -40
- package/dist/three-author.cjs +52 -34
- package/dist/three-author.d.ts +2 -1
- package/dist/three-author.js +52 -34
- package/dist/three-convert.cjs +55 -37
- package/dist/three-convert.d.ts +2 -1
- package/dist/three-convert.js +55 -37
- package/dist/three-live-animation.cjs +7 -7
- package/dist/three-live-animation.d.ts +2 -1
- package/dist/three-live-animation.js +7 -7
- package/dist/three-live-animation.min.js +7 -7
- package/dist/three-live-cad.cjs +2 -2
- package/dist/three-live-cad.d.ts +2 -1
- package/dist/three-live-cad.js +2 -2
- package/dist/three-live-cad.min.js +2 -2
- package/dist/three-live-element.cjs +24 -6
- package/dist/three-live-element.d.ts +2 -1
- package/dist/three-live-element.js +24 -6
- package/dist/three-live-full.cjs +76 -58
- package/dist/three-live-full.js +76 -58
- package/dist/three-live-full.min.js +76 -58
- package/dist/three-live-studio.cjs +18 -18
- package/dist/three-live-studio.d.ts +2 -1
- package/dist/three-live-studio.js +18 -18
- package/dist/three-live-studio.min.js +18 -18
- package/dist/three-live-viewer.cjs +24 -6
- package/dist/three-live-viewer.d.ts +2 -1
- package/dist/three-live-viewer.js +24 -6
- package/dist/three-live-viewer.min.js +24 -6
- package/dist/three-live.cjs +56 -38
- package/dist/three-live.js +55 -37
- package/dist/three-live.min.js +56 -38
- package/dist/three-view.cjs +24 -6
- package/dist/three-view.d.ts +2 -1
- package/dist/three-view.js +24 -6
- package/dist/three-xr.cjs +49 -31
- package/dist/three-xr.d.ts +2 -1
- package/dist/three-xr.js +49 -31
- package/package.json +1 -1
package/dist/three-live-cad.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export {
|
|
|
53
53
|
installCadExtension,
|
|
54
54
|
MAX_BSP_DEPTH,
|
|
55
55
|
MAX_CSG_TRIANGLES,
|
|
56
|
+
MAX_SHAPE_POINTS,
|
|
56
57
|
MAX_TEXT_GEOMETRY_CHARS,
|
|
57
58
|
type ExtrudeGeometryOptions,
|
|
58
59
|
type TextGeometryOptions,
|
|
@@ -298,7 +299,7 @@ export interface XRLiveAttributes extends ThreeLiveAttributes {
|
|
|
298
299
|
'peer-name'?: string;
|
|
299
300
|
/** Local avatar visor & laser color (`#rrggbb`) in `shared-room`. */
|
|
300
301
|
'peer-color'?: string;
|
|
301
|
-
/** Opt-in WebRTC
|
|
302
|
+
/** Opt-in WebRTC voice signaling relay (offer/answer/ICE) and `voiceGain` helpers in `shared-room`. Apps own `RTCPeerConnection` and audio. */
|
|
302
303
|
'shared-room-voice'?: boolean | string;
|
|
303
304
|
/** xr-live-sim: character camera mode, or `none` to disable the character. */
|
|
304
305
|
'character-controller'?:
|
package/dist/three-live-cad.js
CHANGED
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
var pe="__THREE_LIVE_REGISTRY__";function le(){let C=typeof globalThis<"u"?globalThis:{};if(!C[pe]){let L={plugins:[],decoders:new Map};try{Object.defineProperty(C,pe,{value:L,writable:!1,configurable:!1,enumerable:!1})}catch{C[pe]=L}}return C[pe]}var dn=le().plugins;function Ke(C){let L=le();L.workerExtensionInstallers||(L.workerExtensionInstallers=[]),L.workerExtensionInstallers.includes(C)||L.workerExtensionInstallers.push(C)}function Je(C){let L=le().plugins;L.some(D=>D.name===C.name)||L.push(C),C.onRegister?.()}var xn=8192,pn=512,gn=128;function we(C,L){if(!C||!C.BufferGeometry)return null;let D=C.Vector2,Me=C.Vector3,nn=C.Quaternion,ge=C.Matrix4,tn=C.Color,_=C.BufferAttribute,ee=C.BufferGeometry,sn=C.Material,Ge=C.MeshStandardMaterial,he=C.Mesh,ce=8192,me=512,Ce=128;class ye{constructor(e){this.currentPoint=new D(0,0),this.segments=[],Array.isArray(e)&&e.length>0&&this.fromPoints(e)}fromPoints(e){if(!e.length)return this;this.moveTo(e[0].x,e[0].y);for(let n=1;n<e.length;n++)this.lineTo(e[n].x,e[n].y);return this}moveTo(e,n){let t=Number(e)||0,o=Number(n)||0;return this.currentPoint.set(t,o),this.segments.push({type:"move",pts:[t,o]}),this}lineTo(e,n){let t=Number(e)||0,o=Number(n)||0;return this.segments.length===0&&this.segments.push({type:"move",pts:[this.currentPoint.x,this.currentPoint.y]}),this.currentPoint.set(t,o),this.segments.push({type:"line",pts:[t,o]}),this}quadraticCurveTo(e,n,t,o){let c=this.currentPoint.x,r=this.currentPoint.y,i=Number(e)||0,h=Number(n)||0,a=Number(t)||0,m=Number(o)||0;return this.segments.length===0&&this.segments.push({type:"move",pts:[c,r]}),this.currentPoint.set(a,m),this.segments.push({type:"quad",pts:[c,r,i,h,a,m]}),this}bezierCurveTo(e,n,t,o,c,r){let i=this.currentPoint.x,h=this.currentPoint.y,a=Number(e)||0,m=Number(n)||0,u=Number(t)||0,l=Number(o)||0,f=Number(c)||0,y=Number(r)||0;return this.segments.length===0&&this.segments.push({type:"move",pts:[i,h]}),this.currentPoint.set(f,y),this.segments.push({type:"cubic",pts:[i,h,a,m,u,l,f,y]}),this}absarc(e,n,t,o,c,r=!1){return this.absellipse(e,n,t,t,o,c,r,0)}arc(e,n,t,o,c,r=!1){return this.absarc(this.currentPoint.x+(Number(e)||0),this.currentPoint.y+(Number(n)||0),t,o,c,r)}absellipse(e,n,t,o,c,r,i=!1,h=0){let a=Number(e)||0,m=Number(n)||0,u=Math.max(0,Number(t)||0),l=Math.max(0,Number(o)||0),f=Number(c)||0,y=Number(r)||0,b=i?1:0,x=Number(h)||0;this.segments.push({type:"arc",pts:[a,m,u,l,f,y,b,x]});let p=Math.cos(x),v=Math.sin(x),S=u*Math.cos(y),d=l*Math.sin(y);return this.currentPoint.set(a+S*p-d*v,m+S*v+d*p),this}ellipse(e,n,t,o,c,r,i=!1,h=0){return this.absellipse(this.currentPoint.x+(Number(e)||0),this.currentPoint.y+(Number(n)||0),t,o,c,r,i,h)}closePath(){if(this.segments.length>0){let e=this.segments[0],n=0,t=0;if(e.type==="arc"){let o=e.pts[0],c=e.pts[1],r=e.pts[2],i=e.pts[3],h=e.pts[4],a=e.pts[7],m=Math.cos(a),u=Math.sin(a),l=r*Math.cos(h),f=i*Math.sin(h);n=o+l*m-f*u,t=c+l*u+f*m}else n=e.pts[0],t=e.pts[1];Math.hypot(this.currentPoint.x-n,this.currentPoint.y-t)>1e-6&&this.lineTo(n,t)}return this}getPoints(e=12){let n=Math.max(1,Math.min(128,Math.floor(Number(e)||12))),t=[],o=(c,r)=>{if(t.length>0){let i=t[t.length-1];if(Math.hypot(i.x-c,i.y-r)<1e-6)return}t.push(new D(c,r))};for(let c of this.segments){let r=c.pts;if(c.type==="move"||c.type==="line")o(r[0],r[1]);else if(c.type==="quad"){let i=r[0],h=r[1],a=r[2],m=r[3],u=r[4],l=r[5];o(i,h);for(let f=1;f<=n;f++){let y=f/n,b=1-y;o(b*b*i+2*b*y*a+y*y*u,b*b*h+2*b*y*m+y*y*l)}}else if(c.type==="cubic"){let i=r[0],h=r[1],a=r[2],m=r[3],u=r[4],l=r[5],f=r[6],y=r[7];o(i,h);for(let b=1;b<=n;b++){let x=b/n,p=1-x,v=p*p,S=x*x;o(v*p*i+3*v*x*a+3*p*S*u+S*x*f,v*p*h+3*v*x*m+3*p*S*l+S*x*y)}}else if(c.type==="arc"){let i=r[0],h=r[1],a=r[2],m=r[3],u=r[4],l=r[5],f=r[6]!==0,y=r[7],b=Math.PI*2,x=l-u,p=Math.abs(x)<1e-9;for(;x<0;)x+=b;for(;x>b;)x-=b;x<1e-9&&(x=p?0:b),f&&!p&&(x=x===b?-b:x-b);let v=Math.cos(y),S=Math.sin(y),d=Math.max(2,n);for(let k=0;k<=d;k++){let T=k/d,z=u+T*x,G=a*Math.cos(z),M=m*Math.sin(z);o(i+G*v-M*S,h+G*S+M*v)}}}if(t.length>2){let c=t[0],r=t[t.length-1];Math.hypot(c.x-r.x,c.y-r.y)<1e-6&&t.pop()}return t}getSpacedPoints(e=12){return this.getPoints(e)}}class ae extends ye{constructor(e){super(e),this.holes=[]}extractPoints(e=12){return{shape:this.getPoints(e),holes:this.holes.map(n=>n.getPoints(e))}}}function fe(s){let e=0,n=s.length;for(let t=0,o=n-1;t<n;o=t++)e+=s[o].x*s[t].y-s[t].x*s[o].y;return e*.5}function on(s,e,n,t,o,c,r,i){let h=r-n,a=i-t,m=o-n,u=c-t,l=s-n,f=e-t,y=h*h+a*a,b=h*m+a*u,x=h*l+a*f,p=m*m+u*u,v=m*l+u*f,S=y*p-b*b;if(Math.abs(S)<1e-12)return!1;let d=1/S,k=(p*x-b*v)*d,T=(y*v-b*x)*d;return k>=-1e-7&&T>=-1e-7&&k+T<=1+1e-7}function ke(s,e){let n=s.slice();fe(n)<0&&n.reverse();let t=n.map(r=>new D(r.x,r.y)),o=n.map((r,i)=>i),c=[];for(let r of e){if(!r||r.length<3)continue;let i=r.slice();fe(i)>0&&i.reverse();let h=[],a=-1/0,m=0;for(let u=0;u<i.length;u++){let l=i[u],f=t.length;t.push(new D(l.x,l.y)),h.push(f),l.x>a&&(a=l.x,m=u)}c.push({pts:i,indices:h,maxX:a,maxIdx:m})}c.sort((r,i)=>i.maxX-r.maxX);for(let r of c){let i=r.pts[r.maxIdx].x,h=r.pts[r.maxIdx].y,a=0,m=1/0;for(let l=0;l<o.length;l++){let f=t[o[l]],y=Math.hypot(f.x-i,f.y-h)+(f.x>=i?0:1e3);y<m&&(m=y,a=l)}let u=[];for(let l=0;l<=a;l++)u.push(o[l]);for(let l=0;l<=r.indices.length;l++){let f=r.indices[(r.maxIdx+l)%r.indices.length];u.push(f)}for(let l=a;l<o.length;l++)u.push(o[l]);o=u}return{merged:o.map(r=>t[r]),mergedIndices:o,allVertices:t}}function Te(s,e){let n=[],t=s.slice();if(t.length<3)return n;let o=t.length*t.length+64,c=0;for(;t.length>2&&o-- >0;){let r=t.length,i=t[(c+r-1)%r],h=t[c%r],a=t[(c+1)%r],m=e[i],u=e[h],l=e[a];if((u.x-m.x)*(l.y-m.y)-(u.y-m.y)*(l.x-m.x)>1e-9){let y=!0;for(let b=0;b<r;b++){let x=t[b];if(x===i||x===h||x===a)continue;let p=e[x];if(!(Math.hypot(p.x-m.x,p.y-m.y)<1e-6||Math.hypot(p.x-u.x,p.y-u.y)<1e-6||Math.hypot(p.x-l.x,p.y-l.y)<1e-6)&&on(p.x,p.y,m.x,m.y,u.x,u.y,l.x,l.y)){y=!1;break}}if(y){n.push([i,h,a]),t.splice(c%r,1),c=0;continue}}c++,c>=r*2&&(n.push([i,h,a]),t.splice(c%r,1),c=0)}return n}class rn extends ee{constructor(e=new ae,n=12){super();let t=Array.isArray(e)?e:[e],o=[],c=[],r=[],i=[];for(let h of t){if(!(h instanceof ye))continue;let a=h instanceof ae?h.extractPoints(n):{shape:h.getPoints(n),holes:[]};if(a.shape.length<3)continue;let{mergedIndices:m,allVertices:u}=ke(a.shape,a.holes),l=Te(m,u),f=o.length/3,y=1/0,b=1/0,x=-1/0,p=-1/0;for(let d of u)d.x<y&&(y=d.x),d.y<b&&(b=d.y),d.x>x&&(x=d.x),d.y>p&&(p=d.y);let v=Math.max(1e-6,x-y),S=Math.max(1e-6,p-b);for(let d of u)o.push(d.x,d.y,0),c.push(0,0,1),r.push((d.x-y)/v,(d.y-b)/S);for(let[d,k,T]of l)i.push(f+d,f+k,f+T)}this.setAttribute("position",new _(new Float32Array(o),3)),this.setAttribute("normal",new _(new Float32Array(c),3)),this.setAttribute("uv",new _(new Float32Array(r),2)),this.setIndex(i)}}function cn(s){let e=s.length,n=[];for(let t=0;t<e;t++){let o=s[(t+e-1)%e],c=s[t],r=s[(t+1)%e],i=c.x-o.x,h=c.y-o.y,a=Math.hypot(i,h)||1;i/=a,h/=a;let m=r.x-c.x,u=r.y-c.y,l=Math.hypot(m,u)||1;m/=l,u/=l;let f=h,y=-i,b=u,x=-m,p=f+b,v=y+x,S=Math.hypot(p,v);if(S>1e-6){p/=S,v/=S;let d=Math.max(.35,p*f+v*y);n.push(new D(p/d,v/d))}else n.push(new D(f,y))}return n}class an extends ee{constructor(e=new ae,n={}){super();let t=Array.isArray(e)?e:[e],o=Math.max(1,Math.min(64,Math.floor(Number(n.curveSegments??12)))),c=Number.isFinite(Number(n.depth??n.amount))?Number(n.depth??n.amount):1,r=Math.max(1,Math.min(32,Math.floor(Number(n.steps??1)))),i=!!(n.bevelEnabled??!1),h=i?Math.max(0,Number(n.bevelThickness??.06)):0,a=i?Math.max(0,Number(n.bevelSize??h*.8)):0,m=i?Number(n.bevelOffset??0):0,u=i?Math.max(1,Math.min(8,Math.floor(Number(n.bevelSegments??2)))):0,l=[],f=[],y=[],b=[];for(let x of t){if(!(x instanceof ye))continue;let p=x instanceof ae?x.extractPoints(o):{shape:x.getPoints(o),holes:[]};if(p.shape.length<3)continue;let v=p.shape.slice();fe(v)<0&&v.reverse();let S=[];for(let g of p.holes){if(g.length<3)continue;let P=g.slice();fe(P)>0&&P.reverse(),S.push(P)}let{mergedIndices:d,allVertices:k}=ke(v,S),T=Te(d,k),z=[v,...S],G=[];for(let g of z){let P=cn(g);for(let w of P)G.push(w)}let M=1/0,V=1/0,X=-1/0,F=-1/0;for(let g of k)g.x<M&&(M=g.x),g.y<V&&(V=g.y),g.x>X&&(X=g.x),g.y>F&&(F=g.y);let N=Math.max(1e-6,X-M),B=Math.max(1e-6,F-V),ne=-h,te=c+h,W=l.length/3;for(let g=0;g<k.length;g++){let P=k[g],w=G[g]??new D(0,0),R=P.x+w.x*m,E=P.y+w.y*m;l.push(R,E,ne),f.push(0,0,-1),y.push((R-M)/N,(E-V)/B)}for(let[g,P,w]of T)b.push(W+g,W+w,W+P);let j=l.length/3;for(let g=0;g<k.length;g++){let P=k[g],w=G[g]??new D(0,0),R=P.x+w.x*m,E=P.y+w.y*m;l.push(R,E,te),f.push(0,0,1),y.push((R-M)/N,(E-V)/B)}for(let[g,P,w]of T)b.push(j+g,j+P,j+w);let I=[];if(i&&u>0)for(let g=0;g<u;g++){let w=g/u*Math.PI/2;I.push({z:-h*Math.cos(w),expand:m+a*Math.sin(w)})}for(let g=0;g<=r;g++){let P=g/r;I.push({z:P*c,expand:m+a})}if(i&&u>0)for(let g=1;g<=u;g++){let w=g/u*Math.PI/2;I.push({z:c+h*Math.sin(w),expand:m+a*Math.cos(w)})}let O=0;for(let g of z){let P=g.length;for(let w=0;w<I.length-1;w++){let R=I[w],E=I[w+1];for(let A=0;A<P;A++){let Y=(A+1)%P,H=g[A],U=g[Y],$=G[O+A],Q=G[O+Y],Z=H.x+$.x*R.expand,K=H.y+$.y*R.expand,J=U.x+Q.x*R.expand,q=U.y+Q.y*R.expand,fn=U.x+Q.x*E.expand,bn=U.y+Q.y*E.expand,Fe=H.x+$.x*E.expand,Be=H.y+$.y*E.expand,Oe=J-Z,Ye=q-K,qe=0,We=Fe-Z,je=Be-K,He=E.z-R.z,se=Ye*He-qe*je,oe=qe*We-Oe*He,re=Oe*je-Ye*We,Pe=Math.hypot(se,oe,re)||1;se/=Pe,oe/=Pe,re/=Pe;let ie=l.length/3;l.push(Z,K,R.z,J,q,R.z,fn,bn,E.z,Fe,Be,E.z),f.push(se,oe,re,se,oe,re,se,oe,re,se,oe,re);let Ue=A/P,$e=(A+1)/P,Qe=w/(I.length-1),Ze=(w+1)/(I.length-1);y.push(Ue,Qe,$e,Qe,$e,Ze,Ue,Ze),b.push(ie,ie+1,ie+2,ie,ie+2,ie+3)}}O+=P}}this.setAttribute("position",new _(new Float32Array(l),3)),this.setAttribute("normal",new _(new Float32Array(f),3)),this.setAttribute("uv",new _(new Float32Array(y),2)),this.setIndex(b)}}function Le(s){return{x:s.x,y:s.y,z:s.z,nx:s.nx,ny:s.ny,nz:s.nz,u:s.u,v:s.v}}function un(s){return{x:s.x,y:s.y,z:s.z,nx:-s.nx,ny:-s.ny,nz:-s.nz,u:s.u,v:s.v}}function ln(s,e,n){let t=s.nx+(e.nx-s.nx)*n,o=s.ny+(e.ny-s.ny)*n,c=s.nz+(e.nz-s.nz)*n,r=Math.hypot(t,o,c)||1;return{x:s.x+(e.x-s.x)*n,y:s.y+(e.y-s.y)*n,z:s.z+(e.z-s.z)*n,nx:t/r,ny:o/r,nz:c/r,u:s.u+(e.u-s.u)*n,v:s.v+(e.v-s.v)*n}}function de(s){if(s.length<3)return null;let e=s[0],n=s[1],t=s[2],o=n.x-e.x,c=n.y-e.y,r=n.z-e.z,i=t.x-e.x,h=t.y-e.y,a=t.z-e.z,m=c*a-r*h,u=r*i-o*a,l=o*h-c*i,f=Math.hypot(m,u,l);if(f<1e-9)return null;m/=f,u/=f,l/=f;let y=m*e.x+u*e.y+l*e.z;return{vertices:s,nx:m,ny:u,nz:l,w:y}}function hn(s){s.vertices.reverse();for(let e=0;e<s.vertices.length;e++)s.vertices[e]=un(s.vertices[e]);s.nx=-s.nx,s.ny=-s.ny,s.nz=-s.nz,s.w=-s.w}let Re=1e-5,Ee=0,ve=1,be=2,ze=3;function Ve(s,e,n,t,o,c,r,i,h){let a=0,m=[];for(let u=0;u<o.vertices.length;u++){let l=o.vertices[u],f=s*l.x+e*l.y+n*l.z-t,y=f<-Re?be:f>Re?ve:Ee;a|=y,m.push(y)}switch(a){case Ee:{s*o.nx+e*o.ny+n*o.nz>0?c.push(o):r.push(o);break}case ve:i.push(o);break;case be:h.push(o);break;case ze:{let u=[],l=[],f=o.vertices.length;for(let y=0;y<f;y++){let b=(y+1)%f,x=m[y],p=m[b],v=o.vertices[y],S=o.vertices[b];if(x!==be&&u.push(v),x!==ve&&l.push(x!==be?Le(v):v),(x|p)===ze){let d=S.x-v.x,k=S.y-v.y,T=S.z-v.z,z=s*d+e*k+n*T,G=Math.abs(z)>1e-12?(t-(s*v.x+e*v.y+n*v.z))/z:.5,M=ln(v,S,Math.max(0,Math.min(1,G)));u.push(M),l.push(Le(M))}}if(u.length>=3){let y=de(u);y&&i.push(y)}if(l.length>=3){let y=de(l);y&&h.push(y)}break}default:break}}class ue{constructor(e,n=0){this.nx=0,this.ny=0,this.nz=0,this.w=0,this.hasPlane=!1,this.polygons=[],this.front=null,this.back=null,e&&e.length>0&&this.build(e,n)}invert(){for(let n=0;n<this.polygons.length;n++)hn(this.polygons[n]);this.nx=-this.nx,this.ny=-this.ny,this.nz=-this.nz,this.w=-this.w,this.front&&this.front.invert(),this.back&&this.back.invert();let e=this.front;this.front=this.back,this.back=e}clipPolygons(e,n=0){if(!this.hasPlane||e.length===0||n>=me)return e.slice();let t=[],o=[];for(let c=0;c<e.length;c++)Ve(this.nx,this.ny,this.nz,this.w,e[c],t,o,t,o);return this.front&&t.length>0&&(t=this.front.clipPolygons(t,n+1)),this.back?o=o.length>0?this.back.clipPolygons(o,n+1):[]:o=[],t.concat(o)}clipTo(e,n=0){this.polygons.length>0&&(this.polygons=e.clipPolygons(this.polygons,0)),n<me&&(this.front&&this.front.clipTo(e,n+1),this.back&&this.back.clipTo(e,n+1))}allPolygons(e=[]){for(let n=0;n<this.polygons.length;n++)e.push(this.polygons[n]);return this.front&&this.front.allPolygons(e),this.back&&this.back.allPolygons(e),e}build(e,n=0){if(!e.length)return;if(!this.hasPlane){let c=e[0];this.nx=c.nx,this.ny=c.ny,this.nz=c.nz,this.w=c.w,this.hasPlane=!0}if(n>=me){for(let c=0;c<e.length;c++)this.polygons.push(e[c]);return}let t=[],o=[];for(let c=0;c<e.length;c++)Ve(this.nx,this.ny,this.nz,this.w,e[c],this.polygons,this.polygons,t,o);t.length>0&&(this.front||(this.front=new ue),this.front.build(t,n+1)),o.length>0&&(this.back||(this.back=new ue),this.back.build(o,n+1))}}function Ie(s,e){let n=s.attributes.position;if(!n||n.count===0)return[];let t=s.attributes.normal,o=s.attributes.uv,c=s.index?s.index.array:null,r=Math.floor(c?c.length/3:n.count/3);if(r>ce)throw new RangeError(`SecurityError: CSG input triangle count (${r}) exceeds MAX_CSG_TRIANGLES (${ce})`);let i=e?e.elements:null,h=i?i[0]*(i[5]*i[10]-i[9]*i[6])-i[4]*(i[1]*i[10]-i[9]*i[2])+i[8]*(i[1]*i[6]-i[5]*i[2])<0:!1,a=u=>{let l=n.getX(u),f=n.getY(u),y=n.getZ(u),b=t?t.getX(u):0,x=t?t.getY(u):0,p=t?t.getZ(u):1;if(i){let d=i[0]*l+i[4]*f+i[8]*y+i[12],k=i[1]*l+i[5]*f+i[9]*y+i[13],T=i[2]*l+i[6]*f+i[10]*y+i[14];l=d,f=k,y=T;let z=i[0]*b+i[4]*x+i[8]*p,G=i[1]*b+i[5]*x+i[9]*p,M=i[2]*b+i[6]*x+i[10]*p,V=Math.hypot(z,G,M)||1;b=z/V,x=G/V,p=M/V}let v=o?o.getX(u):0,S=o?o.getY(u):0;return{x:l,y:f,z:y,nx:b,ny:x,nz:p,u:v,v:S}},m=[];for(let u=0;u<r;u++){let l=c?c[u*3]:u*3,f=c?c[u*3+1]:u*3+1,y=c?c[u*3+2]:u*3+2,b=de(h?[a(l),a(y),a(f)]:[a(l),a(f),a(y)]);b&&m.push(b)}return m}function mn(s){let e=[],n=[],t=[],o=[];for(let r of s){let i=r.vertices;if(i.length<3)continue;let h=e.length/3;for(let a of i)e.push(a.x,a.y,a.z),n.push(r.nx,r.ny,r.nz),t.push(a.u,a.v);for(let a=1;a<i.length-1;a++)o.push(h,h+a,h+a+1)}let c=new ee;return c.setAttribute("position",new _(new Float32Array(e),3)),c.setAttribute("normal",new _(new Float32Array(n),3)),c.setAttribute("uv",new _(new Float32Array(t),2)),c.setIndex(o),c}function yn(s,e,n){if(s.length+e.length>ce)throw new RangeError(`SecurityError: Combined CSG triangle count (${s.length+e.length}) exceeds MAX_CSG_TRIANGLES (${ce})`);if(s.length===0)return n==="union"?e:[];if(e.length===0)return n==="intersect"?[]:s;let t=new ue(s),o=new ue(e);return n==="union"?(t.clipTo(o),o.clipTo(t),o.invert(),o.clipTo(t),o.invert(),t.build(o.allPolygons()),t.allPolygons()):n==="subtract"?(t.invert(),t.clipTo(o),o.clipTo(t),o.invert(),o.clipTo(t),o.invert(),t.build(o.allPolygons()),t.invert(),t.allPolygons()):(t.invert(),o.clipTo(t),o.invert(),t.clipTo(o),o.clipTo(t),t.build(o.allPolygons()),t.invert(),t.allPolygons())}function Ae(s,e,n,t=null,o=null){let c=Ie(s,t),r=Ie(e,o);return mn(yn(c,r,n))}function Se(s,e,n){let t=s instanceof he||!!s?.isMesh,o=e instanceof he||!!e?.isMesh,c=t?s.geometry:s,r=o?e.geometry:e,i=null;if(o)if(e.updateMatrix(),t){s.updateMatrix();let u=new ge().makeScale(1/(s.scale.x||1),1/(s.scale.y||1),1/(s.scale.z||1)),l=Math.hypot(s.quaternion.x,s.quaternion.y,s.quaternion.z,s.quaternion.w)||1,f=new ge().compose(new Me(0,0,0),new nn(-s.quaternion.x/l,-s.quaternion.y/l,-s.quaternion.z/l,s.quaternion.w/l),new Me(1,1,1)),y=new ge().makeTranslation(-s.position.x,-s.position.y,-s.position.z);i=u.multiply(f).multiply(y).multiply(e.matrix)}else i=e.matrix;let h=Ae(c,r,n,null,i),a=t?s.material:new Ge,m=new he(h,a);return t&&(m.position.copy(s.position),m.quaternion.copy(s.quaternion),m.scale.copy(s.scale),m.name=s.name),m}let xe={toGeometry:Ae,subtract(s,e){return Se(s,e,"subtract")},union(s,e){return Se(s,e,"union")},intersect(s,e){return Se(s,e,"intersect")}},Ne={0:[[[.15,0],[.85,0],[.85,1],[.15,1],[.15,0]]],1:[[[.3,.8],[.5,1],[.5,0]],[[.2,0],[.8,0]]],2:[[[.15,.8],[.3,1],[.7,1],[.85,.8],[.85,.55],[.15,0],[.85,0]]],3:[[[.15,.85],[.3,1],[.75,1],[.85,.75],[.5,.5],[.85,.25],[.75,0],[.3,0],[.15,.15]]],4:[[[.7,0],[.7,1],[.15,.35],[.9,.35]]],5:[[[.85,1],[.2,1],[.15,.55],[.75,.55],[.85,.3],[.75,0],[.2,0]]],6:[[[.8,.9],[.5,1],[.15,.7],[.15,.15],[.5,0],[.85,.2],[.85,.45],[.5,.55],[.15,.45]]],7:[[[.15,1],[.85,1],[.35,0]]],8:[[[.2,.5],[.15,.75],[.3,1],[.7,1],[.85,.75],[.8,.5],[.2,.5],[.15,.2],[.3,0],[.7,0],[.85,.2],[.8,.5]]],9:[[[.85,.55],[.5,.45],[.15,.55],[.15,.85],[.5,1],[.85,.85],[.85,.2],[.5,0],[.2,.1]]],A:[[[.1,0],[.5,1],[.9,0]],[[.25,.35],[.75,.35]]],B:[[[.15,0],[.15,1],[.7,1],[.85,.75],[.7,.5],[.15,.5]],[[.7,.5],[.85,.25],[.7,0],[.15,0]]],C:[[[.85,.8],[.65,1],[.3,1],[.15,.75],[.15,.25],[.3,0],[.65,0],[.85,.2]]],D:[[[.15,0],[.15,1],[.65,1],[.85,.75],[.85,.25],[.65,0],[.15,0]]],E:[[[.85,1],[.15,1],[.15,0],[.85,0]],[[.15,.5],[.7,.5]]],F:[[[.85,1],[.15,1],[.15,0]],[[.15,.5],[.7,.5]]],G:[[[.85,.8],[.65,1],[.3,1],[.15,.75],[.15,.25],[.3,0],[.85,0],[.85,.45],[.55,.45]]],H:[[[.15,0],[.15,1]],[[.85,0],[.85,1]],[[.15,.5],[.85,.5]]],I:[[[.25,1],[.75,1]],[[.5,1],[.5,0]],[[.25,0],[.75,0]]],J:[[[.8,1],[.8,.25],[.6,0],[.3,0],[.15,.25]]],K:[[[.15,0],[.15,1]],[[.85,1],[.15,.45],[.85,0]]],L:[[[.15,1],[.15,0],[.85,0]]],M:[[[.1,0],[.1,1],[.5,.35],[.9,1],[.9,0]]],N:[[[.15,0],[.15,1],[.85,0],[.85,1]]],O:[[[.3,0],[.7,0],[.85,.25],[.85,.75],[.7,1],[.3,1],[.15,.75],[.15,.25],[.3,0]]],P:[[[.15,0],[.15,1],[.7,1],[.85,.75],[.7,.5],[.15,.5]]],Q:[[[.3,0],[.7,0],[.85,.25],[.85,.75],[.7,1],[.3,1],[.15,.75],[.15,.25],[.3,0]],[[.55,.3],[.9,-.05]]],R:[[[.15,0],[.15,1],[.7,1],[.85,.75],[.7,.5],[.15,.5]],[[.55,.5],[.85,0]]],S:[[[.85,.85],[.65,1],[.3,1],[.15,.75],[.85,.25],[.7,0],[.3,0],[.15,.15]]],T:[[[.1,1],[.9,1]],[[.5,1],[.5,0]]],U:[[[.15,1],[.15,.25],[.35,0],[.65,0],[.85,.25],[.85,1]]],V:[[[.1,1],[.5,0],[.9,1]]],W:[[[.05,1],[.25,0],[.5,.65],[.75,0],[.95,1]]],X:[[[.15,1],[.85,0]],[[.85,1],[.15,0]]],Y:[[[.15,1],[.5,.5],[.85,1]],[[.5,.5],[.5,0]]],Z:[[[.15,1],[.85,1],[.15,0],[.85,0]]],".":[[[.45,0],[.55,0],[.55,.12],[.45,.12],[.45,0]]],",":[[[.5,.15],[.4,-.1]]],":":[[[.45,.1],[.55,.1]],[[.45,.7],[.55,.7]]],"-":[[[.2,.5],[.8,.5]]],"+":[[[.2,.5],[.8,.5]],[[.5,.2],[.5,.8]]],"=":[[[.2,.35],[.8,.35]],[[.2,.65],[.8,.65]]],"/":[[[.2,0],[.8,1]]],"!":[[[.5,1],[.5,.28]],[[.5,.1],[.5,0]]],"?":[[[.2,.8],[.35,1],[.7,1],[.85,.75],[.5,.45],[.5,.28]],[[.5,.1],[.5,0]]],"(":[[[.65,1],[.35,.65],[.35,.35],[.65,0]]],")":[[[.35,1],[.65,.65],[.65,.35],[.35,0]]],"%":[[[.2,0],[.8,1]],[[.2,.8],[.35,.8],[.35,.95],[.2,.95],[.2,.8]],[[.65,.05],[.8,.05],[.8,.2],[.65,.2],[.65,.05]]],"#":[[[.32,0],[.32,1]],[[.68,0],[.68,1]],[[.12,.35],[.88,.35]],[[.12,.65],[.88,.65]]],$:[[[.8,.8],[.6,.92],[.3,.92],[.18,.72],[.82,.28],[.7,.08],[.4,.08],[.2,.2]],[[.5,1],[.5,0]]],_:[[[.1,0],[.9,0]]],"[":[[[.65,1],[.3,1],[.3,0],[.65,0]]],"]":[[[.35,1],[.7,1],[.7,0],[.35,0]]],"<":[[[.75,.85],[.25,.5],[.75,.15]]],">":[[[.25,.85],[.75,.5],[.25,.15]]],"*":[[[.5,.2],[.5,.8]],[[.2,.35],[.8,.65]],[[.2,.65],[.8,.35]]],"\\":[[[.2,1],[.8,0]]]};class _e extends ee{constructor(e="",n={}){super();let t=String(e??"").slice(0,Ce),o=Math.max(.005,Math.min(100,Number(n.size??.2))),c=!!(n.bevelEnabled??!1),r=c?Math.max(0,Math.min(2,Number(n.bevelThickness??o*.04))):0,i=c?Math.max(0,Math.min(2,Number(n.bevelSize??o*.03))):0,h=Math.max(.001,Math.min(20,Number(n.depth??n.height??o*.2)))+r*2,a=o*.085+i,m=o*.68,u=o*.82,l=[],f=[],y=[],b=[],x=(S,d,k,T,z,G,M)=>{let V=k-S,X=T-d,F=Math.hypot(V,X),N=1,B=0;F>1e-6&&(N=V/F,B=X/F);let ne=-B*z,te=N*z,W=N*z*.6,j=B*z*.6,I=S-W+ne,O=d-j+te,g=S-W-ne,P=d-j-te,w=k+W-ne,R=T+j-te,E=k+W+ne,A=T+j+te,Y=(H,U,$,Q,Z,K,J)=>{let q=l.length/3;l.push(H[0],H[1],H[2],U[0],U[1],U[2],$[0],$[1],$[2],Q[0],Q[1],Q[2]),f.push(Z,K,J,Z,K,J,Z,K,J,Z,K,J),y.push(0,0,1,0,1,1,0,1),b.push(q,q+1,q+2,q,q+2,q+3)};Y([I,O,M],[g,P,M],[w,R,M],[E,A,M],0,0,1),Y([g,P,G],[I,O,G],[E,A,G],[w,R,G],0,0,-1),Y([I,O,G],[g,P,G],[g,P,M],[I,O,M],-N,-B,0),Y([w,R,G],[E,A,G],[E,A,M],[w,R,M],N,B,0),Y([g,P,G],[w,R,G],[w,R,M],[g,P,M],-B,N,0),Y([E,A,G],[I,O,G],[I,O,M],[E,A,M],B,-N,0)},p=0,v=0;for(let S=0;S<t.length;S++){let d=t[S];if(d===`
|
|
18
|
-
`){
|
|
17
|
+
var de="__THREE_LIVE_REGISTRY__";function me(){let L=typeof globalThis<"u"?globalThis:{};if(!L[de]){let E={plugins:[],decoders:new Map};try{Object.defineProperty(L,de,{value:E,writable:!1,configurable:!1,enumerable:!1})}catch{L[de]=E}}return L[de]}var Gn=me().plugins;function nn(L){let E=me();E.workerExtensionInstallers||(E.workerExtensionInstallers=[]),E.workerExtensionInstallers.includes(L)||E.workerExtensionInstallers.push(L)}function tn(L){let E=me().plugins;E.some(Y=>Y.name===L.name)||E.push(L),L.onRegister?.()}var Sn=8192,Pn=2048,Mn=128,wn=4096;function Ge(L,E){if(!L||!L.BufferGeometry)return null;let Y=L.Vector2,ke=L.Vector3,on=L.Quaternion,ve=L.Matrix4,rn=L.Matrix3,cn=L.Color,X=L.BufferAttribute,te=L.BufferGeometry,an=L.Material,Ce=L.MeshStandardMaterial,ye=L.Mesh,le=8192,se=2048,Te=128,Se=4096,B=(t,e)=>{let n=t==null?NaN:Number(t);return Number.isFinite(n)?n:e};class fe{constructor(e){this.currentPoint=new Y(0,0),this.segments=[],Array.isArray(e)&&e.length>0&&this.fromPoints(e)}fromPoints(e){if(!e.length)return this;this.moveTo(e[0].x,e[0].y);for(let n=1;n<e.length;n++)this.lineTo(e[n].x,e[n].y);return this}moveTo(e,n){let s=Number(e)||0,r=Number(n)||0;return this.currentPoint.set(s,r),this.segments.push({type:"move",pts:[s,r]}),this}lineTo(e,n){let s=Number(e)||0,r=Number(n)||0;return this.segments.length===0&&this.segments.push({type:"move",pts:[this.currentPoint.x,this.currentPoint.y]}),this.currentPoint.set(s,r),this.segments.push({type:"line",pts:[s,r]}),this}quadraticCurveTo(e,n,s,r){let i=this.currentPoint.x,a=this.currentPoint.y,u=Number(e)||0,h=Number(n)||0,o=Number(s)||0,m=Number(r)||0;return this.segments.length===0&&this.segments.push({type:"move",pts:[i,a]}),this.currentPoint.set(o,m),this.segments.push({type:"quad",pts:[i,a,u,h,o,m]}),this}bezierCurveTo(e,n,s,r,i,a){let u=this.currentPoint.x,h=this.currentPoint.y,o=Number(e)||0,m=Number(n)||0,l=Number(s)||0,c=Number(r)||0,f=Number(i)||0,x=Number(a)||0;return this.segments.length===0&&this.segments.push({type:"move",pts:[u,h]}),this.currentPoint.set(f,x),this.segments.push({type:"cubic",pts:[u,h,o,m,l,c,f,x]}),this}absarc(e,n,s,r,i,a=!1){return this.absellipse(e,n,s,s,r,i,a,0)}arc(e,n,s,r,i,a=!1){return this.absarc(this.currentPoint.x+(Number(e)||0),this.currentPoint.y+(Number(n)||0),s,r,i,a)}absellipse(e,n,s,r,i,a,u=!1,h=0){let o=Number(e)||0,m=Number(n)||0,l=Math.max(0,Number(s)||0),c=Math.max(0,Number(r)||0),f=Number(i)||0,x=Number(a)||0,p=u?1:0,b=Number(h)||0;this.segments.push({type:"arc",pts:[o,m,l,c,f,x,p,b]});let y=Math.cos(b),g=Math.sin(b),S=l*Math.cos(x),d=c*Math.sin(x);return this.currentPoint.set(o+S*y-d*g,m+S*g+d*y),this}ellipse(e,n,s,r,i,a,u=!1,h=0){return this.absellipse(this.currentPoint.x+(Number(e)||0),this.currentPoint.y+(Number(n)||0),s,r,i,a,u,h)}closePath(){if(this.segments.length>0){let e=this.segments[0],n=0,s=0;if(e.type==="arc"){let r=e.pts[0],i=e.pts[1],a=e.pts[2],u=e.pts[3],h=e.pts[4],o=e.pts[7],m=Math.cos(o),l=Math.sin(o),c=a*Math.cos(h),f=u*Math.sin(h);n=r+c*m-f*l,s=i+c*l+f*m}else n=e.pts[0],s=e.pts[1];Math.hypot(this.currentPoint.x-n,this.currentPoint.y-s)>1e-6&&this.lineTo(n,s)}return this}getPoints(e=12){let n=Math.max(1,Math.min(128,Math.floor(Number(e)||12))),s=[],r=(i,a)=>{if(s.length>0){let u=s[s.length-1];if(Math.hypot(u.x-i,u.y-a)<1e-6)return}s.push(new Y(i,a))};for(let i of this.segments){let a=i.pts;if(i.type==="move"||i.type==="line")r(a[0],a[1]);else if(i.type==="quad"){let u=a[0],h=a[1],o=a[2],m=a[3],l=a[4],c=a[5];r(u,h);for(let f=1;f<=n;f++){let x=f/n,p=1-x;r(p*p*u+2*p*x*o+x*x*l,p*p*h+2*p*x*m+x*x*c)}}else if(i.type==="cubic"){let u=a[0],h=a[1],o=a[2],m=a[3],l=a[4],c=a[5],f=a[6],x=a[7];r(u,h);for(let p=1;p<=n;p++){let b=p/n,y=1-b,g=y*y,S=b*b;r(g*y*u+3*g*b*o+3*y*S*l+S*b*f,g*y*h+3*g*b*m+3*y*S*c+S*b*x)}}else if(i.type==="arc"){let u=a[0],h=a[1],o=a[2],m=a[3],l=a[4],c=a[5],f=a[6]!==0,x=a[7],p=Math.PI*2,b=c-l,y=Math.abs(b)<1e-9;for(;b<0;)b+=p;for(;b>p;)b-=p;b<1e-9&&(b=y?0:p),f&&!y&&(b=b===p?-p:b-p);let g=Math.cos(x),S=Math.sin(x),d=Math.max(2,n);for(let M=0;M<=d;M++){let P=M/d,w=l+P*b,k=o*Math.cos(w),T=m*Math.sin(w);r(u+k*g-T*S,h+k*S+T*g)}}}if(s.length>2){let i=s[0],a=s[s.length-1];Math.hypot(i.x-a.x,i.y-a.y)<1e-6&&s.pop()}return s}getSpacedPoints(e=12){return this.getPoints(e)}}class xe extends fe{constructor(e){super(e),this.holes=[]}extractPoints(e=12){return{shape:this.getPoints(e),holes:this.holes.map(n=>n.getPoints(e))}}}function be(t){let e=0,n=t.length;for(let s=0,r=n-1;s<n;r=s++)e+=t[r].x*t[s].y-t[s].x*t[r].y;return e*.5}function un(t,e,n,s,r,i,a,u){let h=a-n,o=u-s,m=r-n,l=i-s,c=t-n,f=e-s,x=h*h+o*o,p=h*m+o*l,b=h*c+o*f,y=m*m+l*l,g=m*c+l*f,S=x*y-p*p;if(Math.abs(S)<1e-12)return!1;let d=1/S,M=(y*b-p*g)*d,P=(x*g-p*b)*d;return M>=-1e-7&&P>=-1e-7&&M+P<=1+1e-7}function Le(t,e){let n=t.slice();be(n)<0&&n.reverse();let s=n.map(h=>new Y(h.x,h.y)),r=n.map((h,o)=>o),i=[];for(let h of e){if(!h||h.length<3)continue;let o=h.slice();be(o)>0&&o.reverse();let m=[],l=-1/0,c=0;for(let f=0;f<o.length;f++){let x=o[f],p=s.length;s.push(new Y(x.x,x.y)),m.push(p),x.x>l&&(l=x.x,c=f)}i.push({pts:o,indices:m,maxX:l,maxIdx:c})}i.sort((h,o)=>o.maxX-h.maxX);let a=(h,o,m)=>(o.x-h.x)*(m.y-h.y)-(o.y-h.y)*(m.x-h.x),u=(h,o,m)=>{for(let l=0;l<m.length;l++){let c=m[l],f=m[(l+1)%m.length];if(a(h,o,c)*a(h,o,f)<0&&a(c,f,h)*a(c,f,o)<0)return!0}return!1};for(let h of i){let o=h.pts[h.maxIdx],m=o.x,l=r.length,c=r.map(y=>s[y]),f=y=>Math.hypot(c[y].x-m,c[y].y-o.y),x=c.map((y,g)=>g).sort((y,g)=>+(c[y].x<m)-+(c[g].x<m)||f(y)-f(g)),p=x[0];for(let y of x){let g=c[y],S=c[(y+l-1)%l],d=c[(y+1)%l],M=a(g,d,o)>=0,P=a(S,g,o)>=0;if((a(S,g,d)>=0?M&&P:M||P)&&!u(o,g,c)&&!i.some(k=>u(o,g,k.pts))){p=y;break}}let b=[];for(let y=0;y<=p;y++)b.push(r[y]);for(let y=0;y<=h.indices.length;y++){let g=h.indices[(h.maxIdx+y)%h.indices.length];b.push(g)}for(let y=p;y<r.length;y++)b.push(r[y]);r=b}return{merged:r.map(h=>s[h]),mergedIndices:r,allVertices:s}}function Ee(t,e){let n=[],s=t.slice();if(s.length<3)return n;let r=s.length*s.length+64,i=0;for(;s.length>2&&r-- >0;){let a=s.length,u=s[(i+a-1)%a],h=s[i%a],o=s[(i+1)%a],m=e[u],l=e[h],c=e[o];if((l.x-m.x)*(c.y-m.y)-(l.y-m.y)*(c.x-m.x)>1e-9){let x=!0;for(let p=0;p<a;p++){let b=s[p];if(b===u||b===h||b===o)continue;let y=e[b];if(un(y.x,y.y,m.x,m.y,l.x,l.y,c.x,c.y)&&Math.hypot(y.x-m.x,y.y-m.y)>=1e-6&&Math.hypot(y.x-l.x,y.y-l.y)>=1e-6&&Math.hypot(y.x-c.x,y.y-c.y)>=1e-6){x=!1;break}}if(x){n.push([u,h,o]),s.splice(i%a,1),i=Math.max(0,i%a-1);continue}}i++,i>=a*2&&(n.push([u,h,o]),s.splice((i-1)%a,1),i=0)}return n}function Re(t,e){let n=t instanceof xe?t.extractPoints(e):{shape:t.getPoints(e),holes:[]},s=n.shape.length;for(let r of n.holes)s+=r.length;if(s>Se)throw new RangeError(`SecurityError: shape point count (${s}) exceeds MAX_SHAPE_POINTS (${Se})`);return n}class ln extends te{constructor(e=new xe,n=12){super();let s=Array.isArray(e)?e:[e],r=[],i=[],a=[],u=[];for(let h of s){if(!(h instanceof fe))continue;let o=Re(h,n);if(o.shape.length<3)continue;let{mergedIndices:m,allVertices:l}=Le(o.shape,o.holes),c=Ee(m,l),f=r.length/3,x=1/0,p=1/0,b=-1/0,y=-1/0;for(let d of l)d.x<x&&(x=d.x),d.y<p&&(p=d.y),d.x>b&&(b=d.x),d.y>y&&(y=d.y);let g=Math.max(1e-6,b-x),S=Math.max(1e-6,y-p);for(let d of l)r.push(d.x,d.y,0),i.push(0,0,1),a.push((d.x-x)/g,(d.y-p)/S);for(let[d,M,P]of c)u.push(f+d,f+M,f+P)}this.setAttribute("position",new X(D(r),3)),this.setAttribute("normal",new X(D(i),3)),this.setAttribute("uv",new X(D(a),2)),this.setIndex(u)}}function D(t){let e=t.length,n=new Float32Array(e);for(let s=0;s<e;s++)n[s]=t[s];return n}function hn(t){let e=t.length,n=[];for(let s=0;s<e;s++){let r=t[(s+e-1)%e],i=t[s],a=t[(s+1)%e],u=i.x-r.x,h=i.y-r.y,o=Math.hypot(u,h)||1;u/=o,h/=o;let m=a.x-i.x,l=a.y-i.y,c=Math.hypot(m,l)||1;m/=c,l/=c;let f=h,x=-u,p=l,b=-m,y=f+p,g=x+b,S=Math.hypot(y,g);if(S>1e-6){y/=S,g/=S;let d=Math.max(.35,y*f+g*x);n.push(new Y(y/d,g/d))}else n.push(new Y(f,x))}return n}class mn extends te{constructor(e=new xe,n={}){super();let s=Array.isArray(e)?e:[e],r=Math.max(1,Math.min(64,Math.floor(B(n.curveSegments,12)))),i=B(n.depth??n.amount,1),a=Math.max(1,Math.min(32,Math.floor(B(n.steps,1)))),u=!!(n.bevelEnabled??!1),h=u?Math.max(0,B(n.bevelThickness,.06)):0,o=u?Math.max(0,B(n.bevelSize,h*.8)):0,m=u?B(n.bevelOffset,0):0,l=u?Math.max(1,Math.min(8,Math.floor(B(n.bevelSegments,2)))):0,c=[],f=[],x=[],p=[];for(let b of s){if(!(b instanceof fe))continue;let y=Re(b,r);if(y.shape.length<3)continue;let g=y.shape.slice();be(g)<0&&g.reverse();let S=[];for(let v of y.holes){if(v.length<3)continue;let G=v.slice();be(G)>0&&G.reverse(),S.push(G)}let{mergedIndices:d,allVertices:M}=Le(g,S),P=Ee(d,M),w=[g,...S],k=[];for(let v of w){let G=hn(v);for(let C of G)k.push(C)}let T=1/0,V=1/0,I=-1/0,O=-1/0;for(let v of M)v.x<T&&(T=v.x),v.y<V&&(V=v.y),v.x>I&&(I=v.x),v.y>O&&(O=v.y);let _=Math.max(1e-6,I-T),H=Math.max(1e-6,O-V),oe=-h,re=i+h,j=c.length/3;for(let v=0;v<M.length;v++){let G=M[v],C=k[v]??new Y(0,0),R=G.x+C.x*m,z=G.y+C.y*m;c.push(R,z,oe),f.push(0,0,-1),x.push((R-T)/_,(z-V)/H)}for(let[v,G,C]of P)p.push(j+v,j+C,j+G);let $=c.length/3;for(let v=0;v<M.length;v++){let G=M[v],C=k[v]??new Y(0,0),R=G.x+C.x*m,z=G.y+C.y*m;c.push(R,z,re),f.push(0,0,1),x.push((R-T)/_,(z-V)/H)}for(let[v,G,C]of P)p.push($+v,$+G,$+C);let A=[];if(u&&l>0)for(let v=0;v<l;v++){let C=v/l*Math.PI/2;A.push({z:-h*Math.cos(C),expand:m+o*Math.sin(C)})}for(let v=0;v<=a;v++){let G=v/a;A.push({z:G*i,expand:m+o})}if(u&&l>0)for(let v=1;v<=l;v++){let C=v/l*Math.PI/2;A.push({z:i+h*Math.sin(C),expand:m+o*Math.cos(C)})}let F=0;for(let v of w){let G=v.length;for(let C=0;C<A.length-1;C++){let R=A[C],z=A[C+1];for(let N=0;N<G;N++){let q=(N+1)%G,Z=v[N],U=v[q],Q=k[F+N],K=k[F+q],J=Z.x+Q.x*R.expand,ee=Z.y+Q.y*R.expand,ne=U.x+K.x*R.expand,W=U.y+K.y*R.expand,dn=U.x+K.x*z.expand,vn=U.y+K.y*z.expand,He=Z.x+Q.x*z.expand,Fe=Z.y+Q.y*z.expand,qe=ne-J,We=W-ee,je=0,$e=He-J,Ze=Fe-ee,Ue=z.z-R.z,ie=We*Ue-je*Ze,ce=je*$e-qe*Ue,ae=qe*Ze-We*$e,we=Math.hypot(ie,ce,ae)||1;ie/=we,ce/=we,ae/=we;let ue=c.length/3;c.push(J,ee,R.z,ne,W,R.z,dn,vn,z.z,He,Fe,z.z),f.push(ie,ce,ae,ie,ce,ae,ie,ce,ae,ie,ce,ae);let Qe=N/G,Ke=(N+1)/G,Je=C/(A.length-1),en=(C+1)/(A.length-1);x.push(Qe,Je,Ke,Je,Ke,en,Qe,en),p.push(ue,ue+1,ue+2,ue,ue+2,ue+3)}}F+=G}}this.setAttribute("position",new X(D(c),3)),this.setAttribute("normal",new X(D(f),3)),this.setAttribute("uv",new X(D(x),2)),this.setIndex(p)}}function ze(t){return{x:t.x,y:t.y,z:t.z,nx:t.nx,ny:t.ny,nz:t.nz,u:t.u,v:t.v}}function yn(t){return{x:t.x,y:t.y,z:t.z,nx:-t.nx,ny:-t.ny,nz:-t.nz,u:t.u,v:t.v}}function fn(t,e,n){let s=t.nx+(e.nx-t.nx)*n,r=t.ny+(e.ny-t.ny)*n,i=t.nz+(e.nz-t.nz)*n,a=Math.hypot(s,r,i)||1;return{x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n,z:t.z+(e.z-t.z)*n,nx:s/a,ny:r/a,nz:i/a,u:t.u+(e.u-t.u)*n,v:t.v+(e.v-t.v)*n}}function xn(t){if(t.length<3)return null;let e=t[0],n=t[1],s=t[2],r=n.x-e.x,i=n.y-e.y,a=n.z-e.z,u=s.x-e.x,h=s.y-e.y,o=s.z-e.z,m=i*o-a*h,l=a*u-r*o,c=r*h-i*u,f=Math.hypot(m,l,c);if(f<1e-9)return null;m/=f,l/=f,c/=f;let x=m*e.x+l*e.y+c*e.z;return{vertices:t,nx:m,ny:l,nz:c,w:x}}function bn(t){t.vertices.reverse();for(let e=0;e<t.vertices.length;e++)t.vertices[e]=yn(t.vertices[e]);t.nx=-t.nx,t.ny=-t.ny,t.nz=-t.nz,t.w=-t.w}let Ie=1e-5,Ve=0,Pe=1,pe=2,_e=3;function Ae(t,e,n,s,r,i,a,u,h){let o=0,m=[];for(let l=0;l<r.vertices.length;l++){let c=r.vertices[l],f=t*c.x+e*c.y+n*c.z-s,x=f<-Ie?pe:f>Ie?Pe:Ve;o|=x,m.push(x)}switch(o){case Ve:{t*r.nx+e*r.ny+n*r.nz>0?i.push(r):a.push(r);break}case Pe:u.push(r);break;case pe:h.push(r);break;case _e:{let l=[],c=[],f=r.vertices.length;for(let g=0;g<f;g++){let S=(g+1)%f,d=m[g],M=m[S],P=r.vertices[g],w=r.vertices[S];if(d!==pe&&l.push(P),d!==Pe&&c.push(d!==pe?ze(P):P),(d|M)===_e){let k=w.x-P.x,T=w.y-P.y,V=w.z-P.z,I=t*k+e*T+n*V,O=Math.abs(I)>1e-12?(s-(t*P.x+e*P.y+n*P.z))/I:.5,_=fn(P,w,Math.max(0,Math.min(1,O)));l.push(_),c.push(ze(_))}}let{nx:x,ny:p,nz:b,w:y}=r;l.length>=3&&u.push({vertices:l,nx:x,ny:p,nz:b,w:y}),c.length>=3&&h.push({vertices:c,nx:x,ny:p,nz:b,w:y});break}default:break}}class he{constructor(e,n=0){this.nx=0,this.ny=0,this.nz=0,this.w=0,this.hasPlane=!1,this.polygons=[],this.front=null,this.back=null,e&&e.length>0&&this.build(e,n)}invert(){for(let n=0;n<this.polygons.length;n++)bn(this.polygons[n]);this.nx=-this.nx,this.ny=-this.ny,this.nz=-this.nz,this.w=-this.w,this.front&&this.front.invert(),this.back&&this.back.invert();let e=this.front;this.front=this.back,this.back=e}clipPolygons(e,n=0){if(!this.hasPlane||e.length===0)return e.slice();if(n>=se)throw new RangeError(`SecurityError: CSG BSP depth exceeds MAX_BSP_DEPTH (${se})`);let s=[],r=[];for(let i=0;i<e.length;i++)Ae(this.nx,this.ny,this.nz,this.w,e[i],s,r,s,r);return this.front&&s.length>0&&(s=this.front.clipPolygons(s,n+1)),this.back?r=r.length>0?this.back.clipPolygons(r,n+1):[]:r=[],s.concat(r)}clipTo(e,n=0){this.polygons.length>0&&(this.polygons=e.clipPolygons(this.polygons,0)),n<se&&(this.front&&this.front.clipTo(e,n+1),this.back&&this.back.clipTo(e,n+1))}allPolygons(e=[]){for(let n=0;n<this.polygons.length;n++)e.push(this.polygons[n]);return this.front&&this.front.allPolygons(e),this.back&&this.back.allPolygons(e),e}build(e,n=0){if(!e.length)return;if(!this.hasPlane){let i=e[e.length>>1];this.nx=i.nx,this.ny=i.ny,this.nz=i.nz,this.w=i.w,this.hasPlane=!0}if(n>=se)throw new RangeError(`SecurityError: CSG BSP depth exceeds MAX_BSP_DEPTH (${se})`);let s=[],r=[];for(let i=0;i<e.length;i++)Ae(this.nx,this.ny,this.nz,this.w,e[i],this.polygons,this.polygons,s,r);s.length>0&&(this.front||(this.front=new he),this.front.build(s,n+1)),r.length>0&&(this.back||(this.back=new he),this.back.build(r,n+1))}}function Ne(t,e){if(!e&&t._csgPolygons)return t._csgPolygons;let n=t.attributes.position;if(!n||n.count===0)return[];let s=t.attributes.normal,r=t.attributes.uv,i=t.index?t.index.array:null,a=Math.floor(i?i.length/3:n.count/3);if(a>le)throw new RangeError(`SecurityError: CSG input triangle count (${a}) exceeds MAX_CSG_TRIANGLES (${le})`);let u=e?e.elements:null,h=u?u[0]*(u[5]*u[10]-u[9]*u[6])-u[4]*(u[1]*u[10]-u[9]*u[2])+u[8]*(u[1]*u[6]-u[5]*u[2])<0:!1,o=u?new rn().getNormalMatrix(e).elements:null,m=c=>{let f=n.getX(c),x=n.getY(c),p=n.getZ(c),b=s?s.getX(c):NaN,y=s?s.getY(c):NaN,g=s?s.getZ(c):NaN;if(u&&o){let M=u[0]*f+u[4]*x+u[8]*p+u[12],P=u[1]*f+u[5]*x+u[9]*p+u[13],w=u[2]*f+u[6]*x+u[10]*p+u[14];f=M,x=P,p=w;let k=o[0]*b+o[3]*y+o[6]*g,T=o[1]*b+o[4]*y+o[7]*g,V=o[2]*b+o[5]*y+o[8]*g,I=Math.hypot(k,T,V)||1;b=k/I,y=T/I,g=V/I}let S=r?r.getX(c):0,d=r?r.getY(c):0;return{x:f,y:x,z:p,nx:b,ny:y,nz:g,u:S,v:d}},l=[];for(let c=0;c<a;c++){let f=i?i[c*3]:c*3,x=i?i[c*3+1]:c*3+1,p=i?i[c*3+2]:c*3+2,b=xn(h?[m(f),m(p),m(x)]:[m(f),m(x),m(p)]);b&&l.push(b)}return l}function pn(t){let e=[],n=[],s=[],r=[];for(let a of t){let u=a.vertices;if(u.length<3)continue;let h=e.length/3;for(let o of u)e.push(o.x,o.y,o.z),Number.isFinite(o.nx)&&o.nx*o.nx+o.ny*o.ny+o.nz*o.nz>.5?n.push(o.nx,o.ny,o.nz):n.push(a.nx,a.ny,a.nz),s.push(o.u,o.v);for(let o=1;o<u.length-1;o++)r.push(h,h+o,h+o+1)}let i=new te;return i.setAttribute("position",new X(D(e),3)),i.setAttribute("normal",new X(D(n),3)),i.setAttribute("uv",new X(D(s),2)),i.setIndex(r),i._csgPolygons=t,i}function gn(t,e,n){if(t.length+e.length>le)throw new RangeError(`SecurityError: Combined CSG triangle count (${t.length+e.length}) exceeds MAX_CSG_TRIANGLES (${le})`);if(t.length===0)return n==="union"?e:[];if(e.length===0)return n==="intersect"?[]:t;let s=1/0,r=1/0,i=1/0,a=-1/0,u=-1/0,h=-1/0;for(let f=0;f<e.length;f++){let x=e[f].vertices;for(let p=0;p<x.length;p++){let b=x[p];b.x<s&&(s=b.x),b.y<r&&(r=b.y),b.z<i&&(i=b.z),b.x>a&&(a=b.x),b.y>u&&(u=b.y),b.z>h&&(h=b.z)}}s-=1e-4,r-=1e-4,i-=1e-4,a+=1e-4,u+=1e-4,h+=1e-4;let o=[],m=[];for(let f=0;f<t.length;f++){let x=t[f],p=x.vertices,b=1/0,y=1/0,g=1/0,S=-1/0,d=-1/0,M=-1/0;for(let P=0;P<p.length;P++){let w=p[P];w.x<b&&(b=w.x),w.y<y&&(y=w.y),w.z<g&&(g=w.z),w.x>S&&(S=w.x),w.y>d&&(d=w.y),w.z>M&&(M=w.z)}S<s||b>a||d<r||y>u||M<i||g>h?m.push(x):o.push(x)}if(o.length===0)return n==="union"?t.concat(e):n==="subtract"?t:[];let l=new he(o),c=new he(e);return n==="union"?(l.clipTo(c),c.clipTo(l),c.invert(),c.clipTo(l),c.invert(),l.build(c.allPolygons()),m.concat(l.allPolygons())):n==="subtract"?(l.invert(),l.clipTo(c),c.clipTo(l),c.invert(),c.clipTo(l),c.invert(),l.build(c.allPolygons()),l.invert(),m.concat(l.allPolygons())):(l.invert(),c.clipTo(l),c.invert(),l.clipTo(c),c.clipTo(l),l.build(c.allPolygons()),l.invert(),l.allPolygons())}function Xe(t,e,n,s=null,r=null){let i=Ne(t,s),a=Ne(e,r);return pn(gn(i,a,n))}function Me(t,e,n){let s=t instanceof ye||!!t?.isMesh,r=e instanceof ye||!!e?.isMesh,i=s?t.geometry:t,a=r?e.geometry:e,u=null;if(r)if(e.updateMatrix(),s){t.updateMatrix();let l=new ve().makeScale(1/(t.scale.x||1),1/(t.scale.y||1),1/(t.scale.z||1)),c=Math.hypot(t.quaternion.x,t.quaternion.y,t.quaternion.z,t.quaternion.w)||1,f=new ve().compose(new ke(0,0,0),new on(-t.quaternion.x/c,-t.quaternion.y/c,-t.quaternion.z/c,t.quaternion.w/c),new ke(1,1,1)),x=new ve().makeTranslation(-t.position.x,-t.position.y,-t.position.z);u=l.multiply(f).multiply(x).multiply(e.matrix)}else u=e.matrix;let h=Xe(i,a,n,null,u),o=s?t.material:new Ce,m=new ye(h,o);return s&&(m.position.copy(t.position),m.quaternion.copy(t.quaternion),m.scale.copy(t.scale),m.name=t.name),m}let ge={toGeometry:Xe,subtract(t,e){return Me(t,e,"subtract")},union(t,e){return Me(t,e,"union")},intersect(t,e){return Me(t,e,"intersect")}},De={0:[[[.15,0],[.85,0],[.85,1],[.15,1],[.15,0]]],1:[[[.3,.8],[.5,1],[.5,0]],[[.2,0],[.8,0]]],2:[[[.15,.8],[.3,1],[.7,1],[.85,.8],[.85,.55],[.15,0],[.85,0]]],3:[[[.15,.85],[.3,1],[.75,1],[.85,.75],[.5,.5],[.85,.25],[.75,0],[.3,0],[.15,.15]]],4:[[[.7,0],[.7,1],[.15,.35],[.9,.35]]],5:[[[.85,1],[.2,1],[.15,.55],[.75,.55],[.85,.3],[.75,0],[.2,0]]],6:[[[.8,.9],[.5,1],[.15,.7],[.15,.15],[.5,0],[.85,.2],[.85,.45],[.5,.55],[.15,.45]]],7:[[[.15,1],[.85,1],[.35,0]]],8:[[[.2,.5],[.15,.75],[.3,1],[.7,1],[.85,.75],[.8,.5],[.2,.5],[.15,.2],[.3,0],[.7,0],[.85,.2],[.8,.5]]],9:[[[.85,.55],[.5,.45],[.15,.55],[.15,.85],[.5,1],[.85,.85],[.85,.2],[.5,0],[.2,.1]]],A:[[[.1,0],[.5,1],[.9,0]],[[.25,.35],[.75,.35]]],B:[[[.15,0],[.15,1],[.7,1],[.85,.75],[.7,.5],[.15,.5]],[[.7,.5],[.85,.25],[.7,0],[.15,0]]],C:[[[.85,.8],[.65,1],[.3,1],[.15,.75],[.15,.25],[.3,0],[.65,0],[.85,.2]]],D:[[[.15,0],[.15,1],[.65,1],[.85,.75],[.85,.25],[.65,0],[.15,0]]],E:[[[.85,1],[.15,1],[.15,0],[.85,0]],[[.15,.5],[.7,.5]]],F:[[[.85,1],[.15,1],[.15,0]],[[.15,.5],[.7,.5]]],G:[[[.85,.8],[.65,1],[.3,1],[.15,.75],[.15,.25],[.3,0],[.85,0],[.85,.45],[.55,.45]]],H:[[[.15,0],[.15,1]],[[.85,0],[.85,1]],[[.15,.5],[.85,.5]]],I:[[[.25,1],[.75,1]],[[.5,1],[.5,0]],[[.25,0],[.75,0]]],J:[[[.8,1],[.8,.25],[.6,0],[.3,0],[.15,.25]]],K:[[[.15,0],[.15,1]],[[.85,1],[.15,.45],[.85,0]]],L:[[[.15,1],[.15,0],[.85,0]]],M:[[[.1,0],[.1,1],[.5,.35],[.9,1],[.9,0]]],N:[[[.15,0],[.15,1],[.85,0],[.85,1]]],O:[[[.3,0],[.7,0],[.85,.25],[.85,.75],[.7,1],[.3,1],[.15,.75],[.15,.25],[.3,0]]],P:[[[.15,0],[.15,1],[.7,1],[.85,.75],[.7,.5],[.15,.5]]],Q:[[[.3,0],[.7,0],[.85,.25],[.85,.75],[.7,1],[.3,1],[.15,.75],[.15,.25],[.3,0]],[[.55,.3],[.9,-.05]]],R:[[[.15,0],[.15,1],[.7,1],[.85,.75],[.7,.5],[.15,.5]],[[.55,.5],[.85,0]]],S:[[[.85,.85],[.65,1],[.3,1],[.15,.75],[.85,.25],[.7,0],[.3,0],[.15,.15]]],T:[[[.1,1],[.9,1]],[[.5,1],[.5,0]]],U:[[[.15,1],[.15,.25],[.35,0],[.65,0],[.85,.25],[.85,1]]],V:[[[.1,1],[.5,0],[.9,1]]],W:[[[.05,1],[.25,0],[.5,.65],[.75,0],[.95,1]]],X:[[[.15,1],[.85,0]],[[.85,1],[.15,0]]],Y:[[[.15,1],[.5,.5],[.85,1]],[[.5,.5],[.5,0]]],Z:[[[.15,1],[.85,1],[.15,0],[.85,0]]],".":[[[.45,0],[.55,0],[.55,.12],[.45,.12],[.45,0]]],",":[[[.5,.15],[.4,-.1]]],":":[[[.45,.1],[.55,.1]],[[.45,.7],[.55,.7]]],"-":[[[.2,.5],[.8,.5]]],"+":[[[.2,.5],[.8,.5]],[[.5,.2],[.5,.8]]],"=":[[[.2,.35],[.8,.35]],[[.2,.65],[.8,.65]]],"/":[[[.2,0],[.8,1]]],"!":[[[.5,1],[.5,.28]],[[.5,.1],[.5,0]]],"?":[[[.2,.8],[.35,1],[.7,1],[.85,.75],[.5,.45],[.5,.28]],[[.5,.1],[.5,0]]],"(":[[[.65,1],[.35,.65],[.35,.35],[.65,0]]],")":[[[.35,1],[.65,.65],[.65,.35],[.35,0]]],"%":[[[.2,0],[.8,1]],[[.2,.8],[.35,.8],[.35,.95],[.2,.95],[.2,.8]],[[.65,.05],[.8,.05],[.8,.2],[.65,.2],[.65,.05]]],"#":[[[.32,0],[.32,1]],[[.68,0],[.68,1]],[[.12,.35],[.88,.35]],[[.12,.65],[.88,.65]]],$:[[[.8,.8],[.6,.92],[.3,.92],[.18,.72],[.82,.28],[.7,.08],[.4,.08],[.2,.2]],[[.5,1],[.5,0]]],_:[[[.1,0],[.9,0]]],"[":[[[.65,1],[.3,1],[.3,0],[.65,0]]],"]":[[[.35,1],[.7,1],[.7,0],[.35,0]]],"<":[[[.75,.85],[.25,.5],[.75,.15]]],">":[[[.25,.85],[.75,.5],[.25,.15]]],"*":[[[.5,.2],[.5,.8]],[[.2,.35],[.8,.65]],[[.2,.65],[.8,.35]]],"\\":[[[.2,1],[.8,0]]]};class Oe extends te{constructor(e="",n={}){super();let s=String(e??"").slice(0,Te),r=Math.max(.005,Math.min(100,B(n.size,.2))),i=!!(n.bevelEnabled??!1),a=i?Math.max(0,Math.min(2,B(n.bevelThickness,r*.04))):0,u=i?Math.max(0,Math.min(2,B(n.bevelSize,r*.03))):0,h=Math.max(.001,Math.min(20,B(n.depth??n.height,r*.2)))+a*2,o=r*.085+u,m=r*.68,l=r*.82,c=[],f=[],x=[],p=[],b=(S,d,M,P,w,k,T)=>{let V=M-S,I=P-d,O=Math.hypot(V,I),_=1,H=0;O>1e-6&&(_=V/O,H=I/O);let oe=-H*w,re=_*w,j=_*w*.6,$=H*w*.6,A=S-j+oe,F=d-$+re,v=S-j-oe,G=d-$-re,C=M+j-oe,R=P+$-re,z=M+j+oe,N=P+$+re,q=(Z,U,Q,K,J,ee,ne)=>{let W=c.length/3;c.push(Z[0],Z[1],Z[2],U[0],U[1],U[2],Q[0],Q[1],Q[2],K[0],K[1],K[2]),f.push(J,ee,ne,J,ee,ne,J,ee,ne,J,ee,ne),x.push(0,0,1,0,1,1,0,1),p.push(W,W+1,W+2,W,W+2,W+3)};q([A,F,T],[v,G,T],[C,R,T],[z,N,T],0,0,1),q([v,G,k],[A,F,k],[z,N,k],[C,R,k],0,0,-1),q([A,F,k],[v,G,k],[v,G,T],[A,F,T],-_,-H,0),q([C,R,k],[z,N,k],[z,N,T],[C,R,T],_,H,0),q([v,G,k],[C,R,k],[C,R,T],[v,G,T],H,-_,0),q([z,N,k],[A,F,k],[A,F,T],[z,N,T],-H,_,0)},y=0,g=0;for(let S=0;S<s.length;S++){let d=s[S];if(d===`
|
|
18
|
+
`){y=0,g-=r*1.35;continue}if(d===" "||d===" "){y+=l*(d===" "?.75:3);continue}if(d==="\r")continue;let M=d.toUpperCase(),P=d!==M&&d>="a"&&d<="z",w=De[M]??De["?"],k=P?r*.76:r,T=P?m*.88:m;for(let V of w)for(let I=0;I<V.length-1;I++){let O=V[I],_=V[I+1];b(y+O[0]*T,g+O[1]*k,y+_[0]*T,g+_[1]*k,o,-h*.5,h*.5)}y+=P?l*.88:l}this.setAttribute("position",new X(D(c),3)),this.setAttribute("normal",new X(D(f),3)),this.setAttribute("uv",new X(D(x),2)),this.setIndex(p),n.center!==!1?this.center():this.computeBoundingBox()}}function Be(t){if(!t)return;let e=t,n=t.userData?.xr?.text;if(n!=null&&n!==!1){let r=e.geometry?.attributes?.position;if((!r||r.count===0)&&t.userData._textApplied!==!0){let i="",a=.08,u=.015,h;if(typeof n=="string"||typeof n=="number")i=String(n);else if(typeof n=="object"){let o=n;i=String(o.text??o.value??""),o.size!==void 0&&(a=Number(o.size)||.08),(o.depth!==void 0||o.height!==void 0)&&(u=Number(o.depth??o.height)||a*.2),(typeof o.color=="string"||typeof o.color=="number")&&(h=o.color)}i.trim().length>0&&(e.geometry=new Oe(i,{size:a,depth:u}),t.userData._textApplied=!0,e.material instanceof an?h!==void 0&&t.userData._autoTextColorApplied!==!0&&(e.material.color=new cn(h),t.userData._autoTextColorApplied=!0):e.material=new Ce({color:h??16317180}))}}let s=t.userData?.csg;if(s&&typeof s=="object"&&t.userData._csgApplied!==!0&&e.geometry instanceof te&&e.geometry.attributes.position?.count>0){t.userData._csgApplied=!0;let r=Array.isArray(s)?s:[s],i=e.geometry;for(let a of r){if(!a||typeof a!="object")continue;let u=a,h=String(u.op??u.operation??"subtract"),o=h==="union"||h==="intersect"?h:"subtract",m=u.target??u.mesh??u.geometry;if(m instanceof ye||m instanceof te)try{let l=o==="union"?ge.union(e,m):o==="intersect"?ge.intersect(e,m):ge.subtract(e,m);e.geometry!==i&&e.geometry.dispose?.(),e.geometry=l.geometry}catch(l){typeof console<"u"&&console.warn("[three-live] userData.csg skipped:",l)}}}}let Ye={Path:fe,Shape:xe,ShapeGeometry:ln,ExtrudeGeometry:mn,TextGeometry:Oe,CSG:ge,MAX_CSG_TRIANGLES:le,MAX_BSP_DEPTH:se,MAX_TEXT_GEOMETRY_CHARS:Te,MAX_SHAPE_POINTS:Se,materializeDeclarativeGeometry:Be};return E&&typeof E=="object"&&(E.authorNamespace||(E.authorNamespace={}),Object.assign(E.authorNamespace,Ye),E.materializeDeclarativeGeometry=Be),Ye}var sn={name:"cad",onRegister(){nn(Ge);let L=me(),E=L.threeNamespace??(typeof globalThis<"u"?globalThis.THREE:void 0);E&&Ge(E,L)}};tn(sn);export{Pn as MAX_BSP_DEPTH,Sn as MAX_CSG_TRIANGLES,wn as MAX_SHAPE_POINTS,Mn as MAX_TEXT_GEOMETRY_CHARS,sn as cadPlugin,Ge as installCadExtension};
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
"use strict";var ThreeLiveCAD=(()=>{var Ce=Object.defineProperty;var vn=Object.getOwnPropertyDescriptor;var Sn=Object.getOwnPropertyNames;var Pn=Object.prototype.hasOwnProperty;var wn=(P,G)=>{for(var I in G)Ce(P,I,{get:G[I],enumerable:!0})},Mn=(P,G,I,ae)=>{if(G&&typeof G=="object"||typeof G=="function")for(let J of Sn(G))!Pn.call(P,J)&&J!==I&&Ce(P,J,{get:()=>G[J],enumerable:!(ae=vn(G,J))||ae.enumerable});return P};var Gn=P=>Mn(Ce({},"__esModule",{value:!0}),P);var Cn={};wn(Cn,{MAX_BSP_DEPTH:()=>on,MAX_CSG_TRIANGLES:()=>sn,MAX_TEXT_GEOMETRY_CHARS:()=>rn,cadPlugin:()=>ke,installCadExtension:()=>ve});var de="__THREE_LIVE_REGISTRY__";function me(){let P=typeof globalThis<"u"?globalThis:{};if(!P[de]){let G={plugins:[],decoders:new Map};try{Object.defineProperty(P,de,{value:G,writable:!1,configurable:!1,enumerable:!1})}catch{P[de]=G}}return P[de]}var Tn=me().plugins;function nn(P){let G=me();G.workerExtensionInstallers||(G.workerExtensionInstallers=[]),G.workerExtensionInstallers.includes(P)||G.workerExtensionInstallers.push(P)}function tn(P){let G=me().plugins;G.some(I=>I.name===P.name)||G.push(P),P.onRegister?.()}var sn=8192,on=512,rn=128;function ve(P,G){if(!P||!P.BufferGeometry)return null;let I=P.Vector2,ae=P.Vector3,J=P.Quaternion,Se=P.Matrix4,cn=P.Color,X=P.BufferAttribute,ne=P.BufferGeometry,an=P.Material,Te=P.MeshStandardMaterial,ye=P.Mesh,ue=8192,fe=512,Le=128;class be{constructor(e){this.currentPoint=new I(0,0),this.segments=[],Array.isArray(e)&&e.length>0&&this.fromPoints(e)}fromPoints(e){if(!e.length)return this;this.moveTo(e[0].x,e[0].y);for(let n=1;n<e.length;n++)this.lineTo(e[n].x,e[n].y);return this}moveTo(e,n){let t=Number(e)||0,o=Number(n)||0;return this.currentPoint.set(t,o),this.segments.push({type:"move",pts:[t,o]}),this}lineTo(e,n){let t=Number(e)||0,o=Number(n)||0;return this.segments.length===0&&this.segments.push({type:"move",pts:[this.currentPoint.x,this.currentPoint.y]}),this.currentPoint.set(t,o),this.segments.push({type:"line",pts:[t,o]}),this}quadraticCurveTo(e,n,t,o){let c=this.currentPoint.x,r=this.currentPoint.y,i=Number(e)||0,h=Number(n)||0,a=Number(t)||0,m=Number(o)||0;return this.segments.length===0&&this.segments.push({type:"move",pts:[c,r]}),this.currentPoint.set(a,m),this.segments.push({type:"quad",pts:[c,r,i,h,a,m]}),this}bezierCurveTo(e,n,t,o,c,r){let i=this.currentPoint.x,h=this.currentPoint.y,a=Number(e)||0,m=Number(n)||0,u=Number(t)||0,l=Number(o)||0,f=Number(c)||0,y=Number(r)||0;return this.segments.length===0&&this.segments.push({type:"move",pts:[i,h]}),this.currentPoint.set(f,y),this.segments.push({type:"cubic",pts:[i,h,a,m,u,l,f,y]}),this}absarc(e,n,t,o,c,r=!1){return this.absellipse(e,n,t,t,o,c,r,0)}arc(e,n,t,o,c,r=!1){return this.absarc(this.currentPoint.x+(Number(e)||0),this.currentPoint.y+(Number(n)||0),t,o,c,r)}absellipse(e,n,t,o,c,r,i=!1,h=0){let a=Number(e)||0,m=Number(n)||0,u=Math.max(0,Number(t)||0),l=Math.max(0,Number(o)||0),f=Number(c)||0,y=Number(r)||0,b=i?1:0,x=Number(h)||0;this.segments.push({type:"arc",pts:[a,m,u,l,f,y,b,x]});let p=Math.cos(x),v=Math.sin(x),S=u*Math.cos(y),d=l*Math.sin(y);return this.currentPoint.set(a+S*p-d*v,m+S*v+d*p),this}ellipse(e,n,t,o,c,r,i=!1,h=0){return this.absellipse(this.currentPoint.x+(Number(e)||0),this.currentPoint.y+(Number(n)||0),t,o,c,r,i,h)}closePath(){if(this.segments.length>0){let e=this.segments[0],n=0,t=0;if(e.type==="arc"){let o=e.pts[0],c=e.pts[1],r=e.pts[2],i=e.pts[3],h=e.pts[4],a=e.pts[7],m=Math.cos(a),u=Math.sin(a),l=r*Math.cos(h),f=i*Math.sin(h);n=o+l*m-f*u,t=c+l*u+f*m}else n=e.pts[0],t=e.pts[1];Math.hypot(this.currentPoint.x-n,this.currentPoint.y-t)>1e-6&&this.lineTo(n,t)}return this}getPoints(e=12){let n=Math.max(1,Math.min(128,Math.floor(Number(e)||12))),t=[],o=(c,r)=>{if(t.length>0){let i=t[t.length-1];if(Math.hypot(i.x-c,i.y-r)<1e-6)return}t.push(new I(c,r))};for(let c of this.segments){let r=c.pts;if(c.type==="move"||c.type==="line")o(r[0],r[1]);else if(c.type==="quad"){let i=r[0],h=r[1],a=r[2],m=r[3],u=r[4],l=r[5];o(i,h);for(let f=1;f<=n;f++){let y=f/n,b=1-y;o(b*b*i+2*b*y*a+y*y*u,b*b*h+2*b*y*m+y*y*l)}}else if(c.type==="cubic"){let i=r[0],h=r[1],a=r[2],m=r[3],u=r[4],l=r[5],f=r[6],y=r[7];o(i,h);for(let b=1;b<=n;b++){let x=b/n,p=1-x,v=p*p,S=x*x;o(v*p*i+3*v*x*a+3*p*S*u+S*x*f,v*p*h+3*v*x*m+3*p*S*l+S*x*y)}}else if(c.type==="arc"){let i=r[0],h=r[1],a=r[2],m=r[3],u=r[4],l=r[5],f=r[6]!==0,y=r[7],b=Math.PI*2,x=l-u,p=Math.abs(x)<1e-9;for(;x<0;)x+=b;for(;x>b;)x-=b;x<1e-9&&(x=p?0:b),f&&!p&&(x=x===b?-b:x-b);let v=Math.cos(y),S=Math.sin(y),d=Math.max(2,n);for(let T=0;T<=d;T++){let L=T/d,z=u+L*x,k=a*Math.cos(z),C=m*Math.sin(z);o(i+k*v-C*S,h+k*S+C*v)}}}if(t.length>2){let c=t[0],r=t[t.length-1];Math.hypot(c.x-r.x,c.y-r.y)<1e-6&&t.pop()}return t}getSpacedPoints(e=12){return this.getPoints(e)}}class le extends be{constructor(e){super(e),this.holes=[]}extractPoints(e=12){return{shape:this.getPoints(e),holes:this.holes.map(n=>n.getPoints(e))}}}function xe(s){let e=0,n=s.length;for(let t=0,o=n-1;t<n;o=t++)e+=s[o].x*s[t].y-s[t].x*s[o].y;return e*.5}function un(s,e,n,t,o,c,r,i){let h=r-n,a=i-t,m=o-n,u=c-t,l=s-n,f=e-t,y=h*h+a*a,b=h*m+a*u,x=h*l+a*f,p=m*m+u*u,v=m*l+u*f,S=y*p-b*b;if(Math.abs(S)<1e-12)return!1;let d=1/S,T=(p*x-b*v)*d,L=(y*v-b*x)*d;return T>=-1e-7&&L>=-1e-7&&T+L<=1+1e-7}function Re(s,e){let n=s.slice();xe(n)<0&&n.reverse();let t=n.map(r=>new I(r.x,r.y)),o=n.map((r,i)=>i),c=[];for(let r of e){if(!r||r.length<3)continue;let i=r.slice();xe(i)>0&&i.reverse();let h=[],a=-1/0,m=0;for(let u=0;u<i.length;u++){let l=i[u],f=t.length;t.push(new I(l.x,l.y)),h.push(f),l.x>a&&(a=l.x,m=u)}c.push({pts:i,indices:h,maxX:a,maxIdx:m})}c.sort((r,i)=>i.maxX-r.maxX);for(let r of c){let i=r.pts[r.maxIdx].x,h=r.pts[r.maxIdx].y,a=0,m=1/0;for(let l=0;l<o.length;l++){let f=t[o[l]],y=Math.hypot(f.x-i,f.y-h)+(f.x>=i?0:1e3);y<m&&(m=y,a=l)}let u=[];for(let l=0;l<=a;l++)u.push(o[l]);for(let l=0;l<=r.indices.length;l++){let f=r.indices[(r.maxIdx+l)%r.indices.length];u.push(f)}for(let l=a;l<o.length;l++)u.push(o[l]);o=u}return{merged:o.map(r=>t[r]),mergedIndices:o,allVertices:t}}function Ee(s,e){let n=[],t=s.slice();if(t.length<3)return n;let o=t.length*t.length+64,c=0;for(;t.length>2&&o-- >0;){let r=t.length,i=t[(c+r-1)%r],h=t[c%r],a=t[(c+1)%r],m=e[i],u=e[h],l=e[a];if((u.x-m.x)*(l.y-m.y)-(u.y-m.y)*(l.x-m.x)>1e-9){let y=!0;for(let b=0;b<r;b++){let x=t[b];if(x===i||x===h||x===a)continue;let p=e[x];if(!(Math.hypot(p.x-m.x,p.y-m.y)<1e-6||Math.hypot(p.x-u.x,p.y-u.y)<1e-6||Math.hypot(p.x-l.x,p.y-l.y)<1e-6)&&un(p.x,p.y,m.x,m.y,u.x,u.y,l.x,l.y)){y=!1;break}}if(y){n.push([i,h,a]),t.splice(c%r,1),c=0;continue}}c++,c>=r*2&&(n.push([i,h,a]),t.splice(c%r,1),c=0)}return n}class ln extends ne{constructor(e=new le,n=12){super();let t=Array.isArray(e)?e:[e],o=[],c=[],r=[],i=[];for(let h of t){if(!(h instanceof be))continue;let a=h instanceof le?h.extractPoints(n):{shape:h.getPoints(n),holes:[]};if(a.shape.length<3)continue;let{mergedIndices:m,allVertices:u}=Re(a.shape,a.holes),l=Ee(m,u),f=o.length/3,y=1/0,b=1/0,x=-1/0,p=-1/0;for(let d of u)d.x<y&&(y=d.x),d.y<b&&(b=d.y),d.x>x&&(x=d.x),d.y>p&&(p=d.y);let v=Math.max(1e-6,x-y),S=Math.max(1e-6,p-b);for(let d of u)o.push(d.x,d.y,0),c.push(0,0,1),r.push((d.x-y)/v,(d.y-b)/S);for(let[d,T,L]of l)i.push(f+d,f+T,f+L)}this.setAttribute("position",new X(new Float32Array(o),3)),this.setAttribute("normal",new X(new Float32Array(c),3)),this.setAttribute("uv",new X(new Float32Array(r),2)),this.setIndex(i)}}function hn(s){let e=s.length,n=[];for(let t=0;t<e;t++){let o=s[(t+e-1)%e],c=s[t],r=s[(t+1)%e],i=c.x-o.x,h=c.y-o.y,a=Math.hypot(i,h)||1;i/=a,h/=a;let m=r.x-c.x,u=r.y-c.y,l=Math.hypot(m,u)||1;m/=l,u/=l;let f=h,y=-i,b=u,x=-m,p=f+b,v=y+x,S=Math.hypot(p,v);if(S>1e-6){p/=S,v/=S;let d=Math.max(.35,p*f+v*y);n.push(new I(p/d,v/d))}else n.push(new I(f,y))}return n}class mn extends ne{constructor(e=new le,n={}){super();let t=Array.isArray(e)?e:[e],o=Math.max(1,Math.min(64,Math.floor(Number(n.curveSegments??12)))),c=Number.isFinite(Number(n.depth??n.amount))?Number(n.depth??n.amount):1,r=Math.max(1,Math.min(32,Math.floor(Number(n.steps??1)))),i=!!(n.bevelEnabled??!1),h=i?Math.max(0,Number(n.bevelThickness??.06)):0,a=i?Math.max(0,Number(n.bevelSize??h*.8)):0,m=i?Number(n.bevelOffset??0):0,u=i?Math.max(1,Math.min(8,Math.floor(Number(n.bevelSegments??2)))):0,l=[],f=[],y=[],b=[];for(let x of t){if(!(x instanceof be))continue;let p=x instanceof le?x.extractPoints(o):{shape:x.getPoints(o),holes:[]};if(p.shape.length<3)continue;let v=p.shape.slice();xe(v)<0&&v.reverse();let S=[];for(let g of p.holes){if(g.length<3)continue;let w=g.slice();xe(w)>0&&w.reverse(),S.push(w)}let{mergedIndices:d,allVertices:T}=Re(v,S),L=Ee(d,T),z=[v,...S],k=[];for(let g of z){let w=hn(g);for(let M of w)k.push(M)}let C=1/0,V=1/0,D=-1/0,F=-1/0;for(let g of T)g.x<C&&(C=g.x),g.y<V&&(V=g.y),g.x>D&&(D=g.x),g.y>F&&(F=g.y);let _=Math.max(1e-6,D-C),B=Math.max(1e-6,F-V),te=-h,se=c+h,W=l.length/3;for(let g=0;g<T.length;g++){let w=T[g],M=k[g]??new I(0,0),R=w.x+M.x*m,E=w.y+M.y*m;l.push(R,E,te),f.push(0,0,-1),y.push((R-C)/_,(E-V)/B)}for(let[g,w,M]of L)b.push(W+g,W+M,W+w);let j=l.length/3;for(let g=0;g<T.length;g++){let w=T[g],M=k[g]??new I(0,0),R=w.x+M.x*m,E=w.y+M.y*m;l.push(R,E,se),f.push(0,0,1),y.push((R-C)/_,(E-V)/B)}for(let[g,w,M]of L)b.push(j+g,j+w,j+M);let A=[];if(i&&u>0)for(let g=0;g<u;g++){let M=g/u*Math.PI/2;A.push({z:-h*Math.cos(M),expand:m+a*Math.sin(M)})}for(let g=0;g<=r;g++){let w=g/r;A.push({z:w*c,expand:m+a})}if(i&&u>0)for(let g=1;g<=u;g++){let M=g/u*Math.PI/2;A.push({z:c+h*Math.sin(M),expand:m+a*Math.cos(M)})}let O=0;for(let g of z){let w=g.length;for(let M=0;M<A.length-1;M++){let R=A[M],E=A[M+1];for(let N=0;N<w;N++){let Y=(N+1)%w,H=g[N],U=g[Y],$=k[O+N],Q=k[O+Y],Z=H.x+$.x*R.expand,K=H.y+$.y*R.expand,ee=U.x+Q.x*R.expand,q=U.y+Q.y*R.expand,gn=U.x+Q.x*E.expand,dn=U.y+Q.y*E.expand,Ye=H.x+$.x*E.expand,qe=H.y+$.y*E.expand,We=ee-Z,je=q-K,He=0,Ue=Ye-Z,$e=qe-K,Qe=E.z-R.z,oe=je*Qe-He*$e,re=He*Ue-We*Qe,ie=We*$e-je*Ue,Ge=Math.hypot(oe,re,ie)||1;oe/=Ge,re/=Ge,ie/=Ge;let ce=l.length/3;l.push(Z,K,R.z,ee,q,R.z,gn,dn,E.z,Ye,qe,E.z),f.push(oe,re,ie,oe,re,ie,oe,re,ie,oe,re,ie);let Ze=N/w,Ke=(N+1)/w,Je=M/(A.length-1),en=(M+1)/(A.length-1);y.push(Ze,Je,Ke,Je,Ke,en,Ze,en),b.push(ce,ce+1,ce+2,ce,ce+2,ce+3)}}O+=w}}this.setAttribute("position",new X(new Float32Array(l),3)),this.setAttribute("normal",new X(new Float32Array(f),3)),this.setAttribute("uv",new X(new Float32Array(y),2)),this.setIndex(b)}}function ze(s){return{x:s.x,y:s.y,z:s.z,nx:s.nx,ny:s.ny,nz:s.nz,u:s.u,v:s.v}}function yn(s){return{x:s.x,y:s.y,z:s.z,nx:-s.nx,ny:-s.ny,nz:-s.nz,u:s.u,v:s.v}}function fn(s,e,n){let t=s.nx+(e.nx-s.nx)*n,o=s.ny+(e.ny-s.ny)*n,c=s.nz+(e.nz-s.nz)*n,r=Math.hypot(t,o,c)||1;return{x:s.x+(e.x-s.x)*n,y:s.y+(e.y-s.y)*n,z:s.z+(e.z-s.z)*n,nx:t/r,ny:o/r,nz:c/r,u:s.u+(e.u-s.u)*n,v:s.v+(e.v-s.v)*n}}function Pe(s){if(s.length<3)return null;let e=s[0],n=s[1],t=s[2],o=n.x-e.x,c=n.y-e.y,r=n.z-e.z,i=t.x-e.x,h=t.y-e.y,a=t.z-e.z,m=c*a-r*h,u=r*i-o*a,l=o*h-c*i,f=Math.hypot(m,u,l);if(f<1e-9)return null;m/=f,u/=f,l/=f;let y=m*e.x+u*e.y+l*e.z;return{vertices:s,nx:m,ny:u,nz:l,w:y}}function bn(s){s.vertices.reverse();for(let e=0;e<s.vertices.length;e++)s.vertices[e]=yn(s.vertices[e]);s.nx=-s.nx,s.ny=-s.ny,s.nz=-s.nz,s.w=-s.w}let Ve=1e-5,Ie=0,we=1,pe=2,Ae=3;function Ne(s,e,n,t,o,c,r,i,h){let a=0,m=[];for(let u=0;u<o.vertices.length;u++){let l=o.vertices[u],f=s*l.x+e*l.y+n*l.z-t,y=f<-Ve?pe:f>Ve?we:Ie;a|=y,m.push(y)}switch(a){case Ie:{s*o.nx+e*o.ny+n*o.nz>0?c.push(o):r.push(o);break}case we:i.push(o);break;case pe:h.push(o);break;case Ae:{let u=[],l=[],f=o.vertices.length;for(let y=0;y<f;y++){let b=(y+1)%f,x=m[y],p=m[b],v=o.vertices[y],S=o.vertices[b];if(x!==pe&&u.push(v),x!==we&&l.push(x!==pe?ze(v):v),(x|p)===Ae){let d=S.x-v.x,T=S.y-v.y,L=S.z-v.z,z=s*d+e*T+n*L,k=Math.abs(z)>1e-12?(t-(s*v.x+e*v.y+n*v.z))/z:.5,C=fn(v,S,Math.max(0,Math.min(1,k)));u.push(C),l.push(ze(C))}}if(u.length>=3){let y=Pe(u);y&&i.push(y)}if(l.length>=3){let y=Pe(l);y&&h.push(y)}break}default:break}}class he{constructor(e,n=0){this.nx=0,this.ny=0,this.nz=0,this.w=0,this.hasPlane=!1,this.polygons=[],this.front=null,this.back=null,e&&e.length>0&&this.build(e,n)}invert(){for(let n=0;n<this.polygons.length;n++)bn(this.polygons[n]);this.nx=-this.nx,this.ny=-this.ny,this.nz=-this.nz,this.w=-this.w,this.front&&this.front.invert(),this.back&&this.back.invert();let e=this.front;this.front=this.back,this.back=e}clipPolygons(e,n=0){if(!this.hasPlane||e.length===0||n>=fe)return e.slice();let t=[],o=[];for(let c=0;c<e.length;c++)Ne(this.nx,this.ny,this.nz,this.w,e[c],t,o,t,o);return this.front&&t.length>0&&(t=this.front.clipPolygons(t,n+1)),this.back?o=o.length>0?this.back.clipPolygons(o,n+1):[]:o=[],t.concat(o)}clipTo(e,n=0){this.polygons.length>0&&(this.polygons=e.clipPolygons(this.polygons,0)),n<fe&&(this.front&&this.front.clipTo(e,n+1),this.back&&this.back.clipTo(e,n+1))}allPolygons(e=[]){for(let n=0;n<this.polygons.length;n++)e.push(this.polygons[n]);return this.front&&this.front.allPolygons(e),this.back&&this.back.allPolygons(e),e}build(e,n=0){if(!e.length)return;if(!this.hasPlane){let c=e[0];this.nx=c.nx,this.ny=c.ny,this.nz=c.nz,this.w=c.w,this.hasPlane=!0}if(n>=fe){for(let c=0;c<e.length;c++)this.polygons.push(e[c]);return}let t=[],o=[];for(let c=0;c<e.length;c++)Ne(this.nx,this.ny,this.nz,this.w,e[c],this.polygons,this.polygons,t,o);t.length>0&&(this.front||(this.front=new he),this.front.build(t,n+1)),o.length>0&&(this.back||(this.back=new he),this.back.build(o,n+1))}}function _e(s,e){let n=s.attributes.position;if(!n||n.count===0)return[];let t=s.attributes.normal,o=s.attributes.uv,c=s.index?s.index.array:null,r=Math.floor(c?c.length/3:n.count/3);if(r>ue)throw new RangeError(`SecurityError: CSG input triangle count (${r}) exceeds MAX_CSG_TRIANGLES (${ue})`);let i=e?e.elements:null,h=i?i[0]*(i[5]*i[10]-i[9]*i[6])-i[4]*(i[1]*i[10]-i[9]*i[2])+i[8]*(i[1]*i[6]-i[5]*i[2])<0:!1,a=u=>{let l=n.getX(u),f=n.getY(u),y=n.getZ(u),b=t?t.getX(u):0,x=t?t.getY(u):0,p=t?t.getZ(u):1;if(i){let d=i[0]*l+i[4]*f+i[8]*y+i[12],T=i[1]*l+i[5]*f+i[9]*y+i[13],L=i[2]*l+i[6]*f+i[10]*y+i[14];l=d,f=T,y=L;let z=i[0]*b+i[4]*x+i[8]*p,k=i[1]*b+i[5]*x+i[9]*p,C=i[2]*b+i[6]*x+i[10]*p,V=Math.hypot(z,k,C)||1;b=z/V,x=k/V,p=C/V}let v=o?o.getX(u):0,S=o?o.getY(u):0;return{x:l,y:f,z:y,nx:b,ny:x,nz:p,u:v,v:S}},m=[];for(let u=0;u<r;u++){let l=c?c[u*3]:u*3,f=c?c[u*3+1]:u*3+1,y=c?c[u*3+2]:u*3+2,b=Pe(h?[a(l),a(y),a(f)]:[a(l),a(f),a(y)]);b&&m.push(b)}return m}function xn(s){let e=[],n=[],t=[],o=[];for(let r of s){let i=r.vertices;if(i.length<3)continue;let h=e.length/3;for(let a of i)e.push(a.x,a.y,a.z),n.push(r.nx,r.ny,r.nz),t.push(a.u,a.v);for(let a=1;a<i.length-1;a++)o.push(h,h+a,h+a+1)}let c=new ne;return c.setAttribute("position",new X(new Float32Array(e),3)),c.setAttribute("normal",new X(new Float32Array(n),3)),c.setAttribute("uv",new X(new Float32Array(t),2)),c.setIndex(o),c}function pn(s,e,n){if(s.length+e.length>ue)throw new RangeError(`SecurityError: Combined CSG triangle count (${s.length+e.length}) exceeds MAX_CSG_TRIANGLES (${ue})`);if(s.length===0)return n==="union"?e:[];if(e.length===0)return n==="intersect"?[]:s;let t=new he(s),o=new he(e);return n==="union"?(t.clipTo(o),o.clipTo(t),o.invert(),o.clipTo(t),o.invert(),t.build(o.allPolygons()),t.allPolygons()):n==="subtract"?(t.invert(),t.clipTo(o),o.clipTo(t),o.invert(),o.clipTo(t),o.invert(),t.build(o.allPolygons()),t.invert(),t.allPolygons()):(t.invert(),o.clipTo(t),o.invert(),t.clipTo(o),o.clipTo(t),t.build(o.allPolygons()),t.invert(),t.allPolygons())}function Xe(s,e,n,t=null,o=null){let c=_e(s,t),r=_e(e,o);return xn(pn(c,r,n))}function Me(s,e,n){let t=s instanceof ye||!!s?.isMesh,o=e instanceof ye||!!e?.isMesh,c=t?s.geometry:s,r=o?e.geometry:e,i=null;if(o)if(e.updateMatrix(),t){s.updateMatrix();let u=new Se().makeScale(1/(s.scale.x||1),1/(s.scale.y||1),1/(s.scale.z||1)),l=Math.hypot(s.quaternion.x,s.quaternion.y,s.quaternion.z,s.quaternion.w)||1,f=new Se().compose(new ae(0,0,0),new J(-s.quaternion.x/l,-s.quaternion.y/l,-s.quaternion.z/l,s.quaternion.w/l),new ae(1,1,1)),y=new Se().makeTranslation(-s.position.x,-s.position.y,-s.position.z);i=u.multiply(f).multiply(y).multiply(e.matrix)}else i=e.matrix;let h=Xe(c,r,n,null,i),a=t?s.material:new Te,m=new ye(h,a);return t&&(m.position.copy(s.position),m.quaternion.copy(s.quaternion),m.scale.copy(s.scale),m.name=s.name),m}let ge={toGeometry:Xe,subtract(s,e){return Me(s,e,"subtract")},union(s,e){return Me(s,e,"union")},intersect(s,e){return Me(s,e,"intersect")}},De={0:[[[.15,0],[.85,0],[.85,1],[.15,1],[.15,0]]],1:[[[.3,.8],[.5,1],[.5,0]],[[.2,0],[.8,0]]],2:[[[.15,.8],[.3,1],[.7,1],[.85,.8],[.85,.55],[.15,0],[.85,0]]],3:[[[.15,.85],[.3,1],[.75,1],[.85,.75],[.5,.5],[.85,.25],[.75,0],[.3,0],[.15,.15]]],4:[[[.7,0],[.7,1],[.15,.35],[.9,.35]]],5:[[[.85,1],[.2,1],[.15,.55],[.75,.55],[.85,.3],[.75,0],[.2,0]]],6:[[[.8,.9],[.5,1],[.15,.7],[.15,.15],[.5,0],[.85,.2],[.85,.45],[.5,.55],[.15,.45]]],7:[[[.15,1],[.85,1],[.35,0]]],8:[[[.2,.5],[.15,.75],[.3,1],[.7,1],[.85,.75],[.8,.5],[.2,.5],[.15,.2],[.3,0],[.7,0],[.85,.2],[.8,.5]]],9:[[[.85,.55],[.5,.45],[.15,.55],[.15,.85],[.5,1],[.85,.85],[.85,.2],[.5,0],[.2,.1]]],A:[[[.1,0],[.5,1],[.9,0]],[[.25,.35],[.75,.35]]],B:[[[.15,0],[.15,1],[.7,1],[.85,.75],[.7,.5],[.15,.5]],[[.7,.5],[.85,.25],[.7,0],[.15,0]]],C:[[[.85,.8],[.65,1],[.3,1],[.15,.75],[.15,.25],[.3,0],[.65,0],[.85,.2]]],D:[[[.15,0],[.15,1],[.65,1],[.85,.75],[.85,.25],[.65,0],[.15,0]]],E:[[[.85,1],[.15,1],[.15,0],[.85,0]],[[.15,.5],[.7,.5]]],F:[[[.85,1],[.15,1],[.15,0]],[[.15,.5],[.7,.5]]],G:[[[.85,.8],[.65,1],[.3,1],[.15,.75],[.15,.25],[.3,0],[.85,0],[.85,.45],[.55,.45]]],H:[[[.15,0],[.15,1]],[[.85,0],[.85,1]],[[.15,.5],[.85,.5]]],I:[[[.25,1],[.75,1]],[[.5,1],[.5,0]],[[.25,0],[.75,0]]],J:[[[.8,1],[.8,.25],[.6,0],[.3,0],[.15,.25]]],K:[[[.15,0],[.15,1]],[[.85,1],[.15,.45],[.85,0]]],L:[[[.15,1],[.15,0],[.85,0]]],M:[[[.1,0],[.1,1],[.5,.35],[.9,1],[.9,0]]],N:[[[.15,0],[.15,1],[.85,0],[.85,1]]],O:[[[.3,0],[.7,0],[.85,.25],[.85,.75],[.7,1],[.3,1],[.15,.75],[.15,.25],[.3,0]]],P:[[[.15,0],[.15,1],[.7,1],[.85,.75],[.7,.5],[.15,.5]]],Q:[[[.3,0],[.7,0],[.85,.25],[.85,.75],[.7,1],[.3,1],[.15,.75],[.15,.25],[.3,0]],[[.55,.3],[.9,-.05]]],R:[[[.15,0],[.15,1],[.7,1],[.85,.75],[.7,.5],[.15,.5]],[[.55,.5],[.85,0]]],S:[[[.85,.85],[.65,1],[.3,1],[.15,.75],[.85,.25],[.7,0],[.3,0],[.15,.15]]],T:[[[.1,1],[.9,1]],[[.5,1],[.5,0]]],U:[[[.15,1],[.15,.25],[.35,0],[.65,0],[.85,.25],[.85,1]]],V:[[[.1,1],[.5,0],[.9,1]]],W:[[[.05,1],[.25,0],[.5,.65],[.75,0],[.95,1]]],X:[[[.15,1],[.85,0]],[[.85,1],[.15,0]]],Y:[[[.15,1],[.5,.5],[.85,1]],[[.5,.5],[.5,0]]],Z:[[[.15,1],[.85,1],[.15,0],[.85,0]]],".":[[[.45,0],[.55,0],[.55,.12],[.45,.12],[.45,0]]],",":[[[.5,.15],[.4,-.1]]],":":[[[.45,.1],[.55,.1]],[[.45,.7],[.55,.7]]],"-":[[[.2,.5],[.8,.5]]],"+":[[[.2,.5],[.8,.5]],[[.5,.2],[.5,.8]]],"=":[[[.2,.35],[.8,.35]],[[.2,.65],[.8,.65]]],"/":[[[.2,0],[.8,1]]],"!":[[[.5,1],[.5,.28]],[[.5,.1],[.5,0]]],"?":[[[.2,.8],[.35,1],[.7,1],[.85,.75],[.5,.45],[.5,.28]],[[.5,.1],[.5,0]]],"(":[[[.65,1],[.35,.65],[.35,.35],[.65,0]]],")":[[[.35,1],[.65,.65],[.65,.35],[.35,0]]],"%":[[[.2,0],[.8,1]],[[.2,.8],[.35,.8],[.35,.95],[.2,.95],[.2,.8]],[[.65,.05],[.8,.05],[.8,.2],[.65,.2],[.65,.05]]],"#":[[[.32,0],[.32,1]],[[.68,0],[.68,1]],[[.12,.35],[.88,.35]],[[.12,.65],[.88,.65]]],$:[[[.8,.8],[.6,.92],[.3,.92],[.18,.72],[.82,.28],[.7,.08],[.4,.08],[.2,.2]],[[.5,1],[.5,0]]],_:[[[.1,0],[.9,0]]],"[":[[[.65,1],[.3,1],[.3,0],[.65,0]]],"]":[[[.35,1],[.7,1],[.7,0],[.35,0]]],"<":[[[.75,.85],[.25,.5],[.75,.15]]],">":[[[.25,.85],[.75,.5],[.25,.15]]],"*":[[[.5,.2],[.5,.8]],[[.2,.35],[.8,.65]],[[.2,.65],[.8,.35]]],"\\":[[[.2,1],[.8,0]]]};class Fe extends ne{constructor(e="",n={}){super();let t=String(e??"").slice(0,Le),o=Math.max(.005,Math.min(100,Number(n.size??.2))),c=!!(n.bevelEnabled??!1),r=c?Math.max(0,Math.min(2,Number(n.bevelThickness??o*.04))):0,i=c?Math.max(0,Math.min(2,Number(n.bevelSize??o*.03))):0,h=Math.max(.001,Math.min(20,Number(n.depth??n.height??o*.2)))+r*2,a=o*.085+i,m=o*.68,u=o*.82,l=[],f=[],y=[],b=[],x=(S,d,T,L,z,k,C)=>{let V=T-S,D=L-d,F=Math.hypot(V,D),_=1,B=0;F>1e-6&&(_=V/F,B=D/F);let te=-B*z,se=_*z,W=_*z*.6,j=B*z*.6,A=S-W+te,O=d-j+se,g=S-W-te,w=d-j-se,M=T+W-te,R=L+j-se,E=T+W+te,N=L+j+se,Y=(H,U,$,Q,Z,K,ee)=>{let q=l.length/3;l.push(H[0],H[1],H[2],U[0],U[1],U[2],$[0],$[1],$[2],Q[0],Q[1],Q[2]),f.push(Z,K,ee,Z,K,ee,Z,K,ee,Z,K,ee),y.push(0,0,1,0,1,1,0,1),b.push(q,q+1,q+2,q,q+2,q+3)};Y([A,O,C],[g,w,C],[M,R,C],[E,N,C],0,0,1),Y([g,w,k],[A,O,k],[E,N,k],[M,R,k],0,0,-1),Y([A,O,k],[g,w,k],[g,w,C],[A,O,C],-_,-B,0),Y([M,R,k],[E,N,k],[E,N,C],[M,R,C],_,B,0),Y([g,w,k],[M,R,k],[M,R,C],[g,w,C],-B,_,0),Y([E,N,k],[A,O,k],[A,O,C],[E,N,C],B,-_,0)},p=0,v=0;for(let S=0;S<t.length;S++){let d=t[S];if(d===`
|
|
18
|
-
`){
|
|
17
|
+
"use strict";var ThreeLiveCAD=(()=>{var Te=Object.defineProperty;var kn=Object.getOwnPropertyDescriptor;var Cn=Object.getOwnPropertyNames;var Tn=Object.prototype.hasOwnProperty;var Ln=(M,L)=>{for(var A in L)Te(M,A,{get:L[A],enumerable:!0})},En=(M,L,A,he)=>{if(L&&typeof L=="object"||typeof L=="function")for(let ne of Cn(L))!Tn.call(M,ne)&&ne!==A&&Te(M,ne,{get:()=>L[ne],enumerable:!(he=kn(L,ne))||he.enumerable});return M};var Rn=M=>En(Te({},"__esModule",{value:!0}),M);var zn={};Ln(zn,{MAX_BSP_DEPTH:()=>an,MAX_CSG_TRIANGLES:()=>cn,MAX_SHAPE_POINTS:()=>ln,MAX_TEXT_GEOMETRY_CHARS:()=>un,cadPlugin:()=>Le,installCadExtension:()=>Pe});var Se="__THREE_LIVE_REGISTRY__";function fe(){let M=typeof globalThis<"u"?globalThis:{};if(!M[Se]){let L={plugins:[],decoders:new Map};try{Object.defineProperty(M,Se,{value:L,writable:!1,configurable:!1,enumerable:!1})}catch{M[Se]=L}}return M[Se]}var Vn=fe().plugins;function on(M){let L=fe();L.workerExtensionInstallers||(L.workerExtensionInstallers=[]),L.workerExtensionInstallers.includes(M)||L.workerExtensionInstallers.push(M)}function rn(M){let L=fe().plugins;L.some(A=>A.name===M.name)||L.push(M),M.onRegister?.()}var cn=8192,an=2048,un=128,ln=4096;function Pe(M,L){if(!M||!M.BufferGeometry)return null;let A=M.Vector2,he=M.Vector3,ne=M.Quaternion,Me=M.Matrix4,hn=M.Matrix3,mn=M.Color,D=M.BufferAttribute,se=M.BufferGeometry,yn=M.Material,Ee=M.MeshStandardMaterial,xe=M.Mesh,me=8192,oe=2048,Re=128,we=4096,Y=(t,e)=>{let n=t==null?NaN:Number(t);return Number.isFinite(n)?n:e};class be{constructor(e){this.currentPoint=new A(0,0),this.segments=[],Array.isArray(e)&&e.length>0&&this.fromPoints(e)}fromPoints(e){if(!e.length)return this;this.moveTo(e[0].x,e[0].y);for(let n=1;n<e.length;n++)this.lineTo(e[n].x,e[n].y);return this}moveTo(e,n){let s=Number(e)||0,r=Number(n)||0;return this.currentPoint.set(s,r),this.segments.push({type:"move",pts:[s,r]}),this}lineTo(e,n){let s=Number(e)||0,r=Number(n)||0;return this.segments.length===0&&this.segments.push({type:"move",pts:[this.currentPoint.x,this.currentPoint.y]}),this.currentPoint.set(s,r),this.segments.push({type:"line",pts:[s,r]}),this}quadraticCurveTo(e,n,s,r){let i=this.currentPoint.x,a=this.currentPoint.y,u=Number(e)||0,h=Number(n)||0,o=Number(s)||0,m=Number(r)||0;return this.segments.length===0&&this.segments.push({type:"move",pts:[i,a]}),this.currentPoint.set(o,m),this.segments.push({type:"quad",pts:[i,a,u,h,o,m]}),this}bezierCurveTo(e,n,s,r,i,a){let u=this.currentPoint.x,h=this.currentPoint.y,o=Number(e)||0,m=Number(n)||0,l=Number(s)||0,c=Number(r)||0,f=Number(i)||0,x=Number(a)||0;return this.segments.length===0&&this.segments.push({type:"move",pts:[u,h]}),this.currentPoint.set(f,x),this.segments.push({type:"cubic",pts:[u,h,o,m,l,c,f,x]}),this}absarc(e,n,s,r,i,a=!1){return this.absellipse(e,n,s,s,r,i,a,0)}arc(e,n,s,r,i,a=!1){return this.absarc(this.currentPoint.x+(Number(e)||0),this.currentPoint.y+(Number(n)||0),s,r,i,a)}absellipse(e,n,s,r,i,a,u=!1,h=0){let o=Number(e)||0,m=Number(n)||0,l=Math.max(0,Number(s)||0),c=Math.max(0,Number(r)||0),f=Number(i)||0,x=Number(a)||0,p=u?1:0,b=Number(h)||0;this.segments.push({type:"arc",pts:[o,m,l,c,f,x,p,b]});let y=Math.cos(b),g=Math.sin(b),S=l*Math.cos(x),d=c*Math.sin(x);return this.currentPoint.set(o+S*y-d*g,m+S*g+d*y),this}ellipse(e,n,s,r,i,a,u=!1,h=0){return this.absellipse(this.currentPoint.x+(Number(e)||0),this.currentPoint.y+(Number(n)||0),s,r,i,a,u,h)}closePath(){if(this.segments.length>0){let e=this.segments[0],n=0,s=0;if(e.type==="arc"){let r=e.pts[0],i=e.pts[1],a=e.pts[2],u=e.pts[3],h=e.pts[4],o=e.pts[7],m=Math.cos(o),l=Math.sin(o),c=a*Math.cos(h),f=u*Math.sin(h);n=r+c*m-f*l,s=i+c*l+f*m}else n=e.pts[0],s=e.pts[1];Math.hypot(this.currentPoint.x-n,this.currentPoint.y-s)>1e-6&&this.lineTo(n,s)}return this}getPoints(e=12){let n=Math.max(1,Math.min(128,Math.floor(Number(e)||12))),s=[],r=(i,a)=>{if(s.length>0){let u=s[s.length-1];if(Math.hypot(u.x-i,u.y-a)<1e-6)return}s.push(new A(i,a))};for(let i of this.segments){let a=i.pts;if(i.type==="move"||i.type==="line")r(a[0],a[1]);else if(i.type==="quad"){let u=a[0],h=a[1],o=a[2],m=a[3],l=a[4],c=a[5];r(u,h);for(let f=1;f<=n;f++){let x=f/n,p=1-x;r(p*p*u+2*p*x*o+x*x*l,p*p*h+2*p*x*m+x*x*c)}}else if(i.type==="cubic"){let u=a[0],h=a[1],o=a[2],m=a[3],l=a[4],c=a[5],f=a[6],x=a[7];r(u,h);for(let p=1;p<=n;p++){let b=p/n,y=1-b,g=y*y,S=b*b;r(g*y*u+3*g*b*o+3*y*S*l+S*b*f,g*y*h+3*g*b*m+3*y*S*c+S*b*x)}}else if(i.type==="arc"){let u=a[0],h=a[1],o=a[2],m=a[3],l=a[4],c=a[5],f=a[6]!==0,x=a[7],p=Math.PI*2,b=c-l,y=Math.abs(b)<1e-9;for(;b<0;)b+=p;for(;b>p;)b-=p;b<1e-9&&(b=y?0:p),f&&!y&&(b=b===p?-p:b-p);let g=Math.cos(x),S=Math.sin(x),d=Math.max(2,n);for(let w=0;w<=d;w++){let P=w/d,G=l+P*b,C=o*Math.cos(G),E=m*Math.sin(G);r(u+C*g-E*S,h+C*S+E*g)}}}if(s.length>2){let i=s[0],a=s[s.length-1];Math.hypot(i.x-a.x,i.y-a.y)<1e-6&&s.pop()}return s}getSpacedPoints(e=12){return this.getPoints(e)}}class pe extends be{constructor(e){super(e),this.holes=[]}extractPoints(e=12){return{shape:this.getPoints(e),holes:this.holes.map(n=>n.getPoints(e))}}}function ge(t){let e=0,n=t.length;for(let s=0,r=n-1;s<n;r=s++)e+=t[r].x*t[s].y-t[s].x*t[r].y;return e*.5}function fn(t,e,n,s,r,i,a,u){let h=a-n,o=u-s,m=r-n,l=i-s,c=t-n,f=e-s,x=h*h+o*o,p=h*m+o*l,b=h*c+o*f,y=m*m+l*l,g=m*c+l*f,S=x*y-p*p;if(Math.abs(S)<1e-12)return!1;let d=1/S,w=(y*b-p*g)*d,P=(x*g-p*b)*d;return w>=-1e-7&&P>=-1e-7&&w+P<=1+1e-7}function ze(t,e){let n=t.slice();ge(n)<0&&n.reverse();let s=n.map(h=>new A(h.x,h.y)),r=n.map((h,o)=>o),i=[];for(let h of e){if(!h||h.length<3)continue;let o=h.slice();ge(o)>0&&o.reverse();let m=[],l=-1/0,c=0;for(let f=0;f<o.length;f++){let x=o[f],p=s.length;s.push(new A(x.x,x.y)),m.push(p),x.x>l&&(l=x.x,c=f)}i.push({pts:o,indices:m,maxX:l,maxIdx:c})}i.sort((h,o)=>o.maxX-h.maxX);let a=(h,o,m)=>(o.x-h.x)*(m.y-h.y)-(o.y-h.y)*(m.x-h.x),u=(h,o,m)=>{for(let l=0;l<m.length;l++){let c=m[l],f=m[(l+1)%m.length];if(a(h,o,c)*a(h,o,f)<0&&a(c,f,h)*a(c,f,o)<0)return!0}return!1};for(let h of i){let o=h.pts[h.maxIdx],m=o.x,l=r.length,c=r.map(y=>s[y]),f=y=>Math.hypot(c[y].x-m,c[y].y-o.y),x=c.map((y,g)=>g).sort((y,g)=>+(c[y].x<m)-+(c[g].x<m)||f(y)-f(g)),p=x[0];for(let y of x){let g=c[y],S=c[(y+l-1)%l],d=c[(y+1)%l],w=a(g,d,o)>=0,P=a(S,g,o)>=0;if((a(S,g,d)>=0?w&&P:w||P)&&!u(o,g,c)&&!i.some(C=>u(o,g,C.pts))){p=y;break}}let b=[];for(let y=0;y<=p;y++)b.push(r[y]);for(let y=0;y<=h.indices.length;y++){let g=h.indices[(h.maxIdx+y)%h.indices.length];b.push(g)}for(let y=p;y<r.length;y++)b.push(r[y]);r=b}return{merged:r.map(h=>s[h]),mergedIndices:r,allVertices:s}}function Ie(t,e){let n=[],s=t.slice();if(s.length<3)return n;let r=s.length*s.length+64,i=0;for(;s.length>2&&r-- >0;){let a=s.length,u=s[(i+a-1)%a],h=s[i%a],o=s[(i+1)%a],m=e[u],l=e[h],c=e[o];if((l.x-m.x)*(c.y-m.y)-(l.y-m.y)*(c.x-m.x)>1e-9){let x=!0;for(let p=0;p<a;p++){let b=s[p];if(b===u||b===h||b===o)continue;let y=e[b];if(fn(y.x,y.y,m.x,m.y,l.x,l.y,c.x,c.y)&&Math.hypot(y.x-m.x,y.y-m.y)>=1e-6&&Math.hypot(y.x-l.x,y.y-l.y)>=1e-6&&Math.hypot(y.x-c.x,y.y-c.y)>=1e-6){x=!1;break}}if(x){n.push([u,h,o]),s.splice(i%a,1),i=Math.max(0,i%a-1);continue}}i++,i>=a*2&&(n.push([u,h,o]),s.splice((i-1)%a,1),i=0)}return n}function Ve(t,e){let n=t instanceof pe?t.extractPoints(e):{shape:t.getPoints(e),holes:[]},s=n.shape.length;for(let r of n.holes)s+=r.length;if(s>we)throw new RangeError(`SecurityError: shape point count (${s}) exceeds MAX_SHAPE_POINTS (${we})`);return n}class xn extends se{constructor(e=new pe,n=12){super();let s=Array.isArray(e)?e:[e],r=[],i=[],a=[],u=[];for(let h of s){if(!(h instanceof be))continue;let o=Ve(h,n);if(o.shape.length<3)continue;let{mergedIndices:m,allVertices:l}=ze(o.shape,o.holes),c=Ie(m,l),f=r.length/3,x=1/0,p=1/0,b=-1/0,y=-1/0;for(let d of l)d.x<x&&(x=d.x),d.y<p&&(p=d.y),d.x>b&&(b=d.x),d.y>y&&(y=d.y);let g=Math.max(1e-6,b-x),S=Math.max(1e-6,y-p);for(let d of l)r.push(d.x,d.y,0),i.push(0,0,1),a.push((d.x-x)/g,(d.y-p)/S);for(let[d,w,P]of c)u.push(f+d,f+w,f+P)}this.setAttribute("position",new D(O(r),3)),this.setAttribute("normal",new D(O(i),3)),this.setAttribute("uv",new D(O(a),2)),this.setIndex(u)}}function O(t){let e=t.length,n=new Float32Array(e);for(let s=0;s<e;s++)n[s]=t[s];return n}function bn(t){let e=t.length,n=[];for(let s=0;s<e;s++){let r=t[(s+e-1)%e],i=t[s],a=t[(s+1)%e],u=i.x-r.x,h=i.y-r.y,o=Math.hypot(u,h)||1;u/=o,h/=o;let m=a.x-i.x,l=a.y-i.y,c=Math.hypot(m,l)||1;m/=c,l/=c;let f=h,x=-u,p=l,b=-m,y=f+p,g=x+b,S=Math.hypot(y,g);if(S>1e-6){y/=S,g/=S;let d=Math.max(.35,y*f+g*x);n.push(new A(y/d,g/d))}else n.push(new A(f,x))}return n}class pn extends se{constructor(e=new pe,n={}){super();let s=Array.isArray(e)?e:[e],r=Math.max(1,Math.min(64,Math.floor(Y(n.curveSegments,12)))),i=Y(n.depth??n.amount,1),a=Math.max(1,Math.min(32,Math.floor(Y(n.steps,1)))),u=!!(n.bevelEnabled??!1),h=u?Math.max(0,Y(n.bevelThickness,.06)):0,o=u?Math.max(0,Y(n.bevelSize,h*.8)):0,m=u?Y(n.bevelOffset,0):0,l=u?Math.max(1,Math.min(8,Math.floor(Y(n.bevelSegments,2)))):0,c=[],f=[],x=[],p=[];for(let b of s){if(!(b instanceof be))continue;let y=Ve(b,r);if(y.shape.length<3)continue;let g=y.shape.slice();ge(g)<0&&g.reverse();let S=[];for(let v of y.holes){if(v.length<3)continue;let k=v.slice();ge(k)>0&&k.reverse(),S.push(k)}let{mergedIndices:d,allVertices:w}=ze(g,S),P=Ie(d,w),G=[g,...S],C=[];for(let v of G){let k=bn(v);for(let T of k)C.push(T)}let E=1/0,V=1/0,I=-1/0,B=-1/0;for(let v of w)v.x<E&&(E=v.x),v.y<V&&(V=v.y),v.x>I&&(I=v.x),v.y>B&&(B=v.y);let _=Math.max(1e-6,I-E),H=Math.max(1e-6,B-V),re=-h,ie=i+h,j=c.length/3;for(let v=0;v<w.length;v++){let k=w[v],T=C[v]??new A(0,0),R=k.x+T.x*m,z=k.y+T.y*m;c.push(R,z,re),f.push(0,0,-1),x.push((R-E)/_,(z-V)/H)}for(let[v,k,T]of P)p.push(j+v,j+T,j+k);let $=c.length/3;for(let v=0;v<w.length;v++){let k=w[v],T=C[v]??new A(0,0),R=k.x+T.x*m,z=k.y+T.y*m;c.push(R,z,ie),f.push(0,0,1),x.push((R-E)/_,(z-V)/H)}for(let[v,k,T]of P)p.push($+v,$+k,$+T);let N=[];if(u&&l>0)for(let v=0;v<l;v++){let T=v/l*Math.PI/2;N.push({z:-h*Math.cos(T),expand:m+o*Math.sin(T)})}for(let v=0;v<=a;v++){let k=v/a;N.push({z:k*i,expand:m+o})}if(u&&l>0)for(let v=1;v<=l;v++){let T=v/l*Math.PI/2;N.push({z:i+h*Math.sin(T),expand:m+o*Math.cos(T)})}let F=0;for(let v of G){let k=v.length;for(let T=0;T<N.length-1;T++){let R=N[T],z=N[T+1];for(let X=0;X<k;X++){let q=(X+1)%k,Z=v[X],U=v[q],Q=C[F+X],K=C[F+q],J=Z.x+Q.x*R.expand,ee=Z.y+Q.y*R.expand,te=U.x+K.x*R.expand,W=U.y+K.y*R.expand,wn=U.x+K.x*z.expand,Gn=U.y+K.y*z.expand,We=Z.x+Q.x*z.expand,je=Z.y+Q.y*z.expand,$e=te-J,Ze=W-ee,Ue=0,Qe=We-J,Ke=je-ee,Je=z.z-R.z,ce=Ze*Je-Ue*Ke,ae=Ue*Qe-$e*Je,ue=$e*Ke-Ze*Qe,Ce=Math.hypot(ce,ae,ue)||1;ce/=Ce,ae/=Ce,ue/=Ce;let le=c.length/3;c.push(J,ee,R.z,te,W,R.z,wn,Gn,z.z,We,je,z.z),f.push(ce,ae,ue,ce,ae,ue,ce,ae,ue,ce,ae,ue);let en=X/k,nn=(X+1)/k,tn=T/(N.length-1),sn=(T+1)/(N.length-1);x.push(en,tn,nn,tn,nn,sn,en,sn),p.push(le,le+1,le+2,le,le+2,le+3)}}F+=k}}this.setAttribute("position",new D(O(c),3)),this.setAttribute("normal",new D(O(f),3)),this.setAttribute("uv",new D(O(x),2)),this.setIndex(p)}}function _e(t){return{x:t.x,y:t.y,z:t.z,nx:t.nx,ny:t.ny,nz:t.nz,u:t.u,v:t.v}}function gn(t){return{x:t.x,y:t.y,z:t.z,nx:-t.nx,ny:-t.ny,nz:-t.nz,u:t.u,v:t.v}}function dn(t,e,n){let s=t.nx+(e.nx-t.nx)*n,r=t.ny+(e.ny-t.ny)*n,i=t.nz+(e.nz-t.nz)*n,a=Math.hypot(s,r,i)||1;return{x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n,z:t.z+(e.z-t.z)*n,nx:s/a,ny:r/a,nz:i/a,u:t.u+(e.u-t.u)*n,v:t.v+(e.v-t.v)*n}}function vn(t){if(t.length<3)return null;let e=t[0],n=t[1],s=t[2],r=n.x-e.x,i=n.y-e.y,a=n.z-e.z,u=s.x-e.x,h=s.y-e.y,o=s.z-e.z,m=i*o-a*h,l=a*u-r*o,c=r*h-i*u,f=Math.hypot(m,l,c);if(f<1e-9)return null;m/=f,l/=f,c/=f;let x=m*e.x+l*e.y+c*e.z;return{vertices:t,nx:m,ny:l,nz:c,w:x}}function Sn(t){t.vertices.reverse();for(let e=0;e<t.vertices.length;e++)t.vertices[e]=gn(t.vertices[e]);t.nx=-t.nx,t.ny=-t.ny,t.nz=-t.nz,t.w=-t.w}let Ae=1e-5,Ne=0,Ge=1,de=2,Xe=3;function De(t,e,n,s,r,i,a,u,h){let o=0,m=[];for(let l=0;l<r.vertices.length;l++){let c=r.vertices[l],f=t*c.x+e*c.y+n*c.z-s,x=f<-Ae?de:f>Ae?Ge:Ne;o|=x,m.push(x)}switch(o){case Ne:{t*r.nx+e*r.ny+n*r.nz>0?i.push(r):a.push(r);break}case Ge:u.push(r);break;case de:h.push(r);break;case Xe:{let l=[],c=[],f=r.vertices.length;for(let g=0;g<f;g++){let S=(g+1)%f,d=m[g],w=m[S],P=r.vertices[g],G=r.vertices[S];if(d!==de&&l.push(P),d!==Ge&&c.push(d!==de?_e(P):P),(d|w)===Xe){let C=G.x-P.x,E=G.y-P.y,V=G.z-P.z,I=t*C+e*E+n*V,B=Math.abs(I)>1e-12?(s-(t*P.x+e*P.y+n*P.z))/I:.5,_=dn(P,G,Math.max(0,Math.min(1,B)));l.push(_),c.push(_e(_))}}let{nx:x,ny:p,nz:b,w:y}=r;l.length>=3&&u.push({vertices:l,nx:x,ny:p,nz:b,w:y}),c.length>=3&&h.push({vertices:c,nx:x,ny:p,nz:b,w:y});break}default:break}}class ye{constructor(e,n=0){this.nx=0,this.ny=0,this.nz=0,this.w=0,this.hasPlane=!1,this.polygons=[],this.front=null,this.back=null,e&&e.length>0&&this.build(e,n)}invert(){for(let n=0;n<this.polygons.length;n++)Sn(this.polygons[n]);this.nx=-this.nx,this.ny=-this.ny,this.nz=-this.nz,this.w=-this.w,this.front&&this.front.invert(),this.back&&this.back.invert();let e=this.front;this.front=this.back,this.back=e}clipPolygons(e,n=0){if(!this.hasPlane||e.length===0)return e.slice();if(n>=oe)throw new RangeError(`SecurityError: CSG BSP depth exceeds MAX_BSP_DEPTH (${oe})`);let s=[],r=[];for(let i=0;i<e.length;i++)De(this.nx,this.ny,this.nz,this.w,e[i],s,r,s,r);return this.front&&s.length>0&&(s=this.front.clipPolygons(s,n+1)),this.back?r=r.length>0?this.back.clipPolygons(r,n+1):[]:r=[],s.concat(r)}clipTo(e,n=0){this.polygons.length>0&&(this.polygons=e.clipPolygons(this.polygons,0)),n<oe&&(this.front&&this.front.clipTo(e,n+1),this.back&&this.back.clipTo(e,n+1))}allPolygons(e=[]){for(let n=0;n<this.polygons.length;n++)e.push(this.polygons[n]);return this.front&&this.front.allPolygons(e),this.back&&this.back.allPolygons(e),e}build(e,n=0){if(!e.length)return;if(!this.hasPlane){let i=e[e.length>>1];this.nx=i.nx,this.ny=i.ny,this.nz=i.nz,this.w=i.w,this.hasPlane=!0}if(n>=oe)throw new RangeError(`SecurityError: CSG BSP depth exceeds MAX_BSP_DEPTH (${oe})`);let s=[],r=[];for(let i=0;i<e.length;i++)De(this.nx,this.ny,this.nz,this.w,e[i],this.polygons,this.polygons,s,r);s.length>0&&(this.front||(this.front=new ye),this.front.build(s,n+1)),r.length>0&&(this.back||(this.back=new ye),this.back.build(r,n+1))}}function Oe(t,e){if(!e&&t._csgPolygons)return t._csgPolygons;let n=t.attributes.position;if(!n||n.count===0)return[];let s=t.attributes.normal,r=t.attributes.uv,i=t.index?t.index.array:null,a=Math.floor(i?i.length/3:n.count/3);if(a>me)throw new RangeError(`SecurityError: CSG input triangle count (${a}) exceeds MAX_CSG_TRIANGLES (${me})`);let u=e?e.elements:null,h=u?u[0]*(u[5]*u[10]-u[9]*u[6])-u[4]*(u[1]*u[10]-u[9]*u[2])+u[8]*(u[1]*u[6]-u[5]*u[2])<0:!1,o=u?new hn().getNormalMatrix(e).elements:null,m=c=>{let f=n.getX(c),x=n.getY(c),p=n.getZ(c),b=s?s.getX(c):NaN,y=s?s.getY(c):NaN,g=s?s.getZ(c):NaN;if(u&&o){let w=u[0]*f+u[4]*x+u[8]*p+u[12],P=u[1]*f+u[5]*x+u[9]*p+u[13],G=u[2]*f+u[6]*x+u[10]*p+u[14];f=w,x=P,p=G;let C=o[0]*b+o[3]*y+o[6]*g,E=o[1]*b+o[4]*y+o[7]*g,V=o[2]*b+o[5]*y+o[8]*g,I=Math.hypot(C,E,V)||1;b=C/I,y=E/I,g=V/I}let S=r?r.getX(c):0,d=r?r.getY(c):0;return{x:f,y:x,z:p,nx:b,ny:y,nz:g,u:S,v:d}},l=[];for(let c=0;c<a;c++){let f=i?i[c*3]:c*3,x=i?i[c*3+1]:c*3+1,p=i?i[c*3+2]:c*3+2,b=vn(h?[m(f),m(p),m(x)]:[m(f),m(x),m(p)]);b&&l.push(b)}return l}function Pn(t){let e=[],n=[],s=[],r=[];for(let a of t){let u=a.vertices;if(u.length<3)continue;let h=e.length/3;for(let o of u)e.push(o.x,o.y,o.z),Number.isFinite(o.nx)&&o.nx*o.nx+o.ny*o.ny+o.nz*o.nz>.5?n.push(o.nx,o.ny,o.nz):n.push(a.nx,a.ny,a.nz),s.push(o.u,o.v);for(let o=1;o<u.length-1;o++)r.push(h,h+o,h+o+1)}let i=new se;return i.setAttribute("position",new D(O(e),3)),i.setAttribute("normal",new D(O(n),3)),i.setAttribute("uv",new D(O(s),2)),i.setIndex(r),i._csgPolygons=t,i}function Mn(t,e,n){if(t.length+e.length>me)throw new RangeError(`SecurityError: Combined CSG triangle count (${t.length+e.length}) exceeds MAX_CSG_TRIANGLES (${me})`);if(t.length===0)return n==="union"?e:[];if(e.length===0)return n==="intersect"?[]:t;let s=1/0,r=1/0,i=1/0,a=-1/0,u=-1/0,h=-1/0;for(let f=0;f<e.length;f++){let x=e[f].vertices;for(let p=0;p<x.length;p++){let b=x[p];b.x<s&&(s=b.x),b.y<r&&(r=b.y),b.z<i&&(i=b.z),b.x>a&&(a=b.x),b.y>u&&(u=b.y),b.z>h&&(h=b.z)}}s-=1e-4,r-=1e-4,i-=1e-4,a+=1e-4,u+=1e-4,h+=1e-4;let o=[],m=[];for(let f=0;f<t.length;f++){let x=t[f],p=x.vertices,b=1/0,y=1/0,g=1/0,S=-1/0,d=-1/0,w=-1/0;for(let P=0;P<p.length;P++){let G=p[P];G.x<b&&(b=G.x),G.y<y&&(y=G.y),G.z<g&&(g=G.z),G.x>S&&(S=G.x),G.y>d&&(d=G.y),G.z>w&&(w=G.z)}S<s||b>a||d<r||y>u||w<i||g>h?m.push(x):o.push(x)}if(o.length===0)return n==="union"?t.concat(e):n==="subtract"?t:[];let l=new ye(o),c=new ye(e);return n==="union"?(l.clipTo(c),c.clipTo(l),c.invert(),c.clipTo(l),c.invert(),l.build(c.allPolygons()),m.concat(l.allPolygons())):n==="subtract"?(l.invert(),l.clipTo(c),c.clipTo(l),c.invert(),c.clipTo(l),c.invert(),l.build(c.allPolygons()),l.invert(),m.concat(l.allPolygons())):(l.invert(),c.clipTo(l),c.invert(),l.clipTo(c),c.clipTo(l),l.build(c.allPolygons()),l.invert(),l.allPolygons())}function Be(t,e,n,s=null,r=null){let i=Oe(t,s),a=Oe(e,r);return Pn(Mn(i,a,n))}function ke(t,e,n){let s=t instanceof xe||!!t?.isMesh,r=e instanceof xe||!!e?.isMesh,i=s?t.geometry:t,a=r?e.geometry:e,u=null;if(r)if(e.updateMatrix(),s){t.updateMatrix();let l=new Me().makeScale(1/(t.scale.x||1),1/(t.scale.y||1),1/(t.scale.z||1)),c=Math.hypot(t.quaternion.x,t.quaternion.y,t.quaternion.z,t.quaternion.w)||1,f=new Me().compose(new he(0,0,0),new ne(-t.quaternion.x/c,-t.quaternion.y/c,-t.quaternion.z/c,t.quaternion.w/c),new he(1,1,1)),x=new Me().makeTranslation(-t.position.x,-t.position.y,-t.position.z);u=l.multiply(f).multiply(x).multiply(e.matrix)}else u=e.matrix;let h=Be(i,a,n,null,u),o=s?t.material:new Ee,m=new xe(h,o);return s&&(m.position.copy(t.position),m.quaternion.copy(t.quaternion),m.scale.copy(t.scale),m.name=t.name),m}let ve={toGeometry:Be,subtract(t,e){return ke(t,e,"subtract")},union(t,e){return ke(t,e,"union")},intersect(t,e){return ke(t,e,"intersect")}},Ye={0:[[[.15,0],[.85,0],[.85,1],[.15,1],[.15,0]]],1:[[[.3,.8],[.5,1],[.5,0]],[[.2,0],[.8,0]]],2:[[[.15,.8],[.3,1],[.7,1],[.85,.8],[.85,.55],[.15,0],[.85,0]]],3:[[[.15,.85],[.3,1],[.75,1],[.85,.75],[.5,.5],[.85,.25],[.75,0],[.3,0],[.15,.15]]],4:[[[.7,0],[.7,1],[.15,.35],[.9,.35]]],5:[[[.85,1],[.2,1],[.15,.55],[.75,.55],[.85,.3],[.75,0],[.2,0]]],6:[[[.8,.9],[.5,1],[.15,.7],[.15,.15],[.5,0],[.85,.2],[.85,.45],[.5,.55],[.15,.45]]],7:[[[.15,1],[.85,1],[.35,0]]],8:[[[.2,.5],[.15,.75],[.3,1],[.7,1],[.85,.75],[.8,.5],[.2,.5],[.15,.2],[.3,0],[.7,0],[.85,.2],[.8,.5]]],9:[[[.85,.55],[.5,.45],[.15,.55],[.15,.85],[.5,1],[.85,.85],[.85,.2],[.5,0],[.2,.1]]],A:[[[.1,0],[.5,1],[.9,0]],[[.25,.35],[.75,.35]]],B:[[[.15,0],[.15,1],[.7,1],[.85,.75],[.7,.5],[.15,.5]],[[.7,.5],[.85,.25],[.7,0],[.15,0]]],C:[[[.85,.8],[.65,1],[.3,1],[.15,.75],[.15,.25],[.3,0],[.65,0],[.85,.2]]],D:[[[.15,0],[.15,1],[.65,1],[.85,.75],[.85,.25],[.65,0],[.15,0]]],E:[[[.85,1],[.15,1],[.15,0],[.85,0]],[[.15,.5],[.7,.5]]],F:[[[.85,1],[.15,1],[.15,0]],[[.15,.5],[.7,.5]]],G:[[[.85,.8],[.65,1],[.3,1],[.15,.75],[.15,.25],[.3,0],[.85,0],[.85,.45],[.55,.45]]],H:[[[.15,0],[.15,1]],[[.85,0],[.85,1]],[[.15,.5],[.85,.5]]],I:[[[.25,1],[.75,1]],[[.5,1],[.5,0]],[[.25,0],[.75,0]]],J:[[[.8,1],[.8,.25],[.6,0],[.3,0],[.15,.25]]],K:[[[.15,0],[.15,1]],[[.85,1],[.15,.45],[.85,0]]],L:[[[.15,1],[.15,0],[.85,0]]],M:[[[.1,0],[.1,1],[.5,.35],[.9,1],[.9,0]]],N:[[[.15,0],[.15,1],[.85,0],[.85,1]]],O:[[[.3,0],[.7,0],[.85,.25],[.85,.75],[.7,1],[.3,1],[.15,.75],[.15,.25],[.3,0]]],P:[[[.15,0],[.15,1],[.7,1],[.85,.75],[.7,.5],[.15,.5]]],Q:[[[.3,0],[.7,0],[.85,.25],[.85,.75],[.7,1],[.3,1],[.15,.75],[.15,.25],[.3,0]],[[.55,.3],[.9,-.05]]],R:[[[.15,0],[.15,1],[.7,1],[.85,.75],[.7,.5],[.15,.5]],[[.55,.5],[.85,0]]],S:[[[.85,.85],[.65,1],[.3,1],[.15,.75],[.85,.25],[.7,0],[.3,0],[.15,.15]]],T:[[[.1,1],[.9,1]],[[.5,1],[.5,0]]],U:[[[.15,1],[.15,.25],[.35,0],[.65,0],[.85,.25],[.85,1]]],V:[[[.1,1],[.5,0],[.9,1]]],W:[[[.05,1],[.25,0],[.5,.65],[.75,0],[.95,1]]],X:[[[.15,1],[.85,0]],[[.85,1],[.15,0]]],Y:[[[.15,1],[.5,.5],[.85,1]],[[.5,.5],[.5,0]]],Z:[[[.15,1],[.85,1],[.15,0],[.85,0]]],".":[[[.45,0],[.55,0],[.55,.12],[.45,.12],[.45,0]]],",":[[[.5,.15],[.4,-.1]]],":":[[[.45,.1],[.55,.1]],[[.45,.7],[.55,.7]]],"-":[[[.2,.5],[.8,.5]]],"+":[[[.2,.5],[.8,.5]],[[.5,.2],[.5,.8]]],"=":[[[.2,.35],[.8,.35]],[[.2,.65],[.8,.65]]],"/":[[[.2,0],[.8,1]]],"!":[[[.5,1],[.5,.28]],[[.5,.1],[.5,0]]],"?":[[[.2,.8],[.35,1],[.7,1],[.85,.75],[.5,.45],[.5,.28]],[[.5,.1],[.5,0]]],"(":[[[.65,1],[.35,.65],[.35,.35],[.65,0]]],")":[[[.35,1],[.65,.65],[.65,.35],[.35,0]]],"%":[[[.2,0],[.8,1]],[[.2,.8],[.35,.8],[.35,.95],[.2,.95],[.2,.8]],[[.65,.05],[.8,.05],[.8,.2],[.65,.2],[.65,.05]]],"#":[[[.32,0],[.32,1]],[[.68,0],[.68,1]],[[.12,.35],[.88,.35]],[[.12,.65],[.88,.65]]],$:[[[.8,.8],[.6,.92],[.3,.92],[.18,.72],[.82,.28],[.7,.08],[.4,.08],[.2,.2]],[[.5,1],[.5,0]]],_:[[[.1,0],[.9,0]]],"[":[[[.65,1],[.3,1],[.3,0],[.65,0]]],"]":[[[.35,1],[.7,1],[.7,0],[.35,0]]],"<":[[[.75,.85],[.25,.5],[.75,.15]]],">":[[[.25,.85],[.75,.5],[.25,.15]]],"*":[[[.5,.2],[.5,.8]],[[.2,.35],[.8,.65]],[[.2,.65],[.8,.35]]],"\\":[[[.2,1],[.8,0]]]};class He extends se{constructor(e="",n={}){super();let s=String(e??"").slice(0,Re),r=Math.max(.005,Math.min(100,Y(n.size,.2))),i=!!(n.bevelEnabled??!1),a=i?Math.max(0,Math.min(2,Y(n.bevelThickness,r*.04))):0,u=i?Math.max(0,Math.min(2,Y(n.bevelSize,r*.03))):0,h=Math.max(.001,Math.min(20,Y(n.depth??n.height,r*.2)))+a*2,o=r*.085+u,m=r*.68,l=r*.82,c=[],f=[],x=[],p=[],b=(S,d,w,P,G,C,E)=>{let V=w-S,I=P-d,B=Math.hypot(V,I),_=1,H=0;B>1e-6&&(_=V/B,H=I/B);let re=-H*G,ie=_*G,j=_*G*.6,$=H*G*.6,N=S-j+re,F=d-$+ie,v=S-j-re,k=d-$-ie,T=w+j-re,R=P+$-ie,z=w+j+re,X=P+$+ie,q=(Z,U,Q,K,J,ee,te)=>{let W=c.length/3;c.push(Z[0],Z[1],Z[2],U[0],U[1],U[2],Q[0],Q[1],Q[2],K[0],K[1],K[2]),f.push(J,ee,te,J,ee,te,J,ee,te,J,ee,te),x.push(0,0,1,0,1,1,0,1),p.push(W,W+1,W+2,W,W+2,W+3)};q([N,F,E],[v,k,E],[T,R,E],[z,X,E],0,0,1),q([v,k,C],[N,F,C],[z,X,C],[T,R,C],0,0,-1),q([N,F,C],[v,k,C],[v,k,E],[N,F,E],-_,-H,0),q([T,R,C],[z,X,C],[z,X,E],[T,R,E],_,H,0),q([v,k,C],[T,R,C],[T,R,E],[v,k,E],H,-_,0),q([z,X,C],[N,F,C],[N,F,E],[z,X,E],-H,_,0)},y=0,g=0;for(let S=0;S<s.length;S++){let d=s[S];if(d===`
|
|
18
|
+
`){y=0,g-=r*1.35;continue}if(d===" "||d===" "){y+=l*(d===" "?.75:3);continue}if(d==="\r")continue;let w=d.toUpperCase(),P=d!==w&&d>="a"&&d<="z",G=Ye[w]??Ye["?"],C=P?r*.76:r,E=P?m*.88:m;for(let V of G)for(let I=0;I<V.length-1;I++){let B=V[I],_=V[I+1];b(y+B[0]*E,g+B[1]*C,y+_[0]*E,g+_[1]*C,o,-h*.5,h*.5)}y+=P?l*.88:l}this.setAttribute("position",new D(O(c),3)),this.setAttribute("normal",new D(O(f),3)),this.setAttribute("uv",new D(O(x),2)),this.setIndex(p),n.center!==!1?this.center():this.computeBoundingBox()}}function Fe(t){if(!t)return;let e=t,n=t.userData?.xr?.text;if(n!=null&&n!==!1){let r=e.geometry?.attributes?.position;if((!r||r.count===0)&&t.userData._textApplied!==!0){let i="",a=.08,u=.015,h;if(typeof n=="string"||typeof n=="number")i=String(n);else if(typeof n=="object"){let o=n;i=String(o.text??o.value??""),o.size!==void 0&&(a=Number(o.size)||.08),(o.depth!==void 0||o.height!==void 0)&&(u=Number(o.depth??o.height)||a*.2),(typeof o.color=="string"||typeof o.color=="number")&&(h=o.color)}i.trim().length>0&&(e.geometry=new He(i,{size:a,depth:u}),t.userData._textApplied=!0,e.material instanceof yn?h!==void 0&&t.userData._autoTextColorApplied!==!0&&(e.material.color=new mn(h),t.userData._autoTextColorApplied=!0):e.material=new Ee({color:h??16317180}))}}let s=t.userData?.csg;if(s&&typeof s=="object"&&t.userData._csgApplied!==!0&&e.geometry instanceof se&&e.geometry.attributes.position?.count>0){t.userData._csgApplied=!0;let r=Array.isArray(s)?s:[s],i=e.geometry;for(let a of r){if(!a||typeof a!="object")continue;let u=a,h=String(u.op??u.operation??"subtract"),o=h==="union"||h==="intersect"?h:"subtract",m=u.target??u.mesh??u.geometry;if(m instanceof xe||m instanceof se)try{let l=o==="union"?ve.union(e,m):o==="intersect"?ve.intersect(e,m):ve.subtract(e,m);e.geometry!==i&&e.geometry.dispose?.(),e.geometry=l.geometry}catch(l){typeof console<"u"&&console.warn("[three-live] userData.csg skipped:",l)}}}}let qe={Path:be,Shape:pe,ShapeGeometry:xn,ExtrudeGeometry:pn,TextGeometry:He,CSG:ve,MAX_CSG_TRIANGLES:me,MAX_BSP_DEPTH:oe,MAX_TEXT_GEOMETRY_CHARS:Re,MAX_SHAPE_POINTS:we,materializeDeclarativeGeometry:Fe};return L&&typeof L=="object"&&(L.authorNamespace||(L.authorNamespace={}),Object.assign(L.authorNamespace,qe),L.materializeDeclarativeGeometry=Fe),qe}var Le={name:"cad",onRegister(){on(Pe);let M=fe(),L=M.threeNamespace??(typeof globalThis<"u"?globalThis.THREE:void 0);L&&Pe(L,M)}};rn(Le);return Rn(zn);})();
|