@sienci/gviewer 0.1.27 → 0.1.28
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/dist/{GCodeSVGRenderer-COAZHkLX.js → GCodeSVGRenderer-Da9_qYpG.js} +1 -1
- package/dist/{GCodeSVGRenderer-5qai-V15.cjs → GCodeSVGRenderer-cMM0mATa.cjs} +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/viewcube.css +3 -3
- package/dist/viewer.cjs +1 -1
- package/dist/viewer.js +1 -1
- package/package.json +1 -1
|
@@ -368,7 +368,7 @@ function xe(r) {
|
|
|
368
368
|
}
|
|
369
369
|
});
|
|
370
370
|
}
|
|
371
|
-
const ye = ".gViewer-viewcube{position:absolute;left:60px;bottom:60px;width:84px;height:84px;z-index:9999;perspective:600px;pointer-events:auto}.gViewer-viewcube__cube{position:absolute;top:0;right:0;bottom:0;left:0;transform-style:preserve-3d;transition:transform 60ms linear}.gViewer-viewcube__face{position:absolute;width:84px;height:84px;display:flex;align-items:center;justify-content:center;font:600 11px system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;letter-spacing:.06em;text-transform:uppercase;color:#f0f5fce0;background:#0c1014b3;border:1px solid rgba(120,140,160,.35);border-radius:14px;cursor:pointer;-webkit-user-select:none;user-select:none;padding:0}.gViewer-viewcube__face:hover{background:#0c1014db;border-color:#a0bedc8c}.gViewer-viewcube__face.is-active{border-color:#
|
|
371
|
+
const ye = ".gViewer-viewcube{position:absolute;left:60px;bottom:60px;width:84px;height:84px;z-index:9999;perspective:600px;pointer-events:auto}.gViewer-viewcube__cube{position:absolute;top:0;right:0;bottom:0;left:0;transform-style:preserve-3d;transition:transform 60ms linear}.gViewer-viewcube__face{position:absolute;width:84px;height:84px;display:flex;align-items:center;justify-content:center;font:600 11px system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;letter-spacing:.06em;text-transform:uppercase;color:#f0f5fce0;background:#0c1014b3;border:1px solid rgba(120,140,160,.35);border-radius:14px;cursor:pointer;-webkit-user-select:none;user-select:none;padding:0}.gViewer-viewcube__face:hover{background:#0c1014db;border-color:#a0bedc8c}.gViewer-viewcube__face.is-active{border-color:#60a5faf2;box-shadow:0 0 0 1px #60a5fa59,0 10px 30px #00000059;color:#60a5faf2}.gViewer-viewcube__face--front{transform:translateZ(42px)}.gViewer-viewcube__face--back{transform:rotateY(180deg) translateZ(42px)}.gViewer-viewcube__face--left{transform:rotateY(-90deg) translateZ(42px)}.gViewer-viewcube__face--right{transform:rotateY(90deg) translateZ(42px)}.gViewer-viewcube__face--top{transform:rotateX(-90deg) translateZ(42px)}.gViewer-viewcube__face--bottom{transform:rotateX(90deg) translateZ(42px)}", Jt = "gviewer-viewcube-style";
|
|
372
372
|
function Ie() {
|
|
373
373
|
if (typeof document > "u" || document.getElementById(Jt)) return;
|
|
374
374
|
const r = document.createElement("style");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const De=require("three"),de=require("three/examples/jsm/controls/OrbitControls.js"),YQ=require("./gviewer.cjs"),Ce=require("three/examples/jsm/loaders/STLLoader.js");function Ne(i){const Q=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const B in i)if(B!=="default"){const t=Object.getOwnPropertyDescriptor(i,B);Object.defineProperty(Q,B,t.get?t:{enumerable:!0,get:()=>i[B]})}}return Q.default=i,Object.freeze(Q)}const h=Ne(De);function Oe(i){const Q=[];let B=null;for(const t of i.specs){if(t.positions.length===0||t.opacity<=0)continue;const A=t.positions.length/3,e=t.colors?t.colors.slice():lA(t.kind,A,i.options),P=new Float32Array(e.length);P.set(e);const r=new h.BufferGeometry;r.setAttribute("position",new h.BufferAttribute(t.positions,3));const s=new h.BufferAttribute(P,3);s.setUsage(h.DynamicDrawUsage),r.setAttribute("color",s),r.computeBoundingBox();const v=new h.LineBasicMaterial({vertexColors:!0,transparent:!0,opacity:t.opacity}),c=new h.LineSegments(r,v);i.scene.add(c),Q.push({line:c,baseColors:e,simColors:P,prefixEndVertex:t.prefixEndVertex,totalVertices:A,greyCursorVertex:0,kind:t.kind,cutBucketIndex:t.cutBucketIndex,workerColors:t.colors?e:void 0}),r.boundingBox&&(B=B?B.union(r.boundingBox):r.boundingBox.clone())}return{streams:Q,bounds:B}}function Le(i,Q){for(const B of Q)i.remove(B.line),B.line.geometry.dispose(),B.line.material.dispose()}function Me(i,Q){for(const B of i){if(B.workerColors)continue;const t=lA(B.kind,B.totalVertices,Q);B.baseColors=t,B.simColors.set(t),B.greyCursorVertex=0;const A=B.line.geometry.getAttribute("color");A.clearUpdateRanges(),A.addUpdateRange(0,B.simColors.length),A.needsUpdate=!0}}function He(i){const Q=Pt(i.options.render.theme.rapidOpacity??.3);for(const B of i.streams){const t=B.line.material;if(B.kind==="rapid"){t.opacity=Q;continue}t.opacity=fe({bucketIndex:B.cutBucketIndex??0,bucketCount:i.cutBucketCount,baseOpacity:i.options.render.theme.opacity})}}function je(i){const Q=i.stream.totalVertices,B=Math.max(0,Math.min(Q,Math.floor(i.nextCursorVertex))),t=Math.max(0,Math.min(Q,Math.floor(i.stream.greyCursorVertex)));if(B===t)return;const A=i.stream.line.geometry.getAttribute("color"),e=Fe(i.options),P=Math.min(t,B),r=Math.max(t,B);if(B>t)for(let s=t;s<B;s+=1){const v=s*3;i.stream.simColors[v]=e.r,i.stream.simColors[v+1]=e.g,i.stream.simColors[v+2]=e.b}else{const s=B*3,v=t*3;i.stream.simColors.set(i.stream.baseColors.subarray(s,v),s)}A.clearUpdateRanges(),A.addUpdateRange(P*3,(r-P)*3),A.needsUpdate=!0,i.stream.greyCursorVertex=B}function lA(i,Q,B){const t=B.render.theme.colors,A=B.mode.laser?t.laser??t.cutting:t.cutting,e=new h.Color(i==="rapid"?t.rapid:A),P=new Float32Array(Q*3);for(let r=0;r<Q;r+=1){const s=r*3;P[s]=e.r,P[s+1]=e.g,P[s+2]=e.b}return P}function Fe(i){const Q=i.render.theme.colors,B=new h.Color(i.render.theme.background),t=new h.Color(Q.processed??Q.cutting),A=B.clone().lerp(t,.65);return{r:A.r,g:A.g,b:A.b}}function fe(i){if(i.bucketCount<=1)return Pt(i.baseOpacity);const Q=i.bucketIndex/(i.bucketCount-1);return Pt(i.baseOpacity*Q)}function Pt(i){return Number.isFinite(i)?Math.max(0,Math.min(1,i)):0}const it={background:"#111827",opacity:.9,rapidOpacity:.3,colors:{rapid:"#0ef6ae",cutting:"#3e85c7",laser:"#a855f7",processed:"#6b7280",boundingBox:"#e2e8f0",machineBed:"#fbbf24",machineBedKeepout:"#df3b3b",grid:{major:"#2f3840",minor:"#1f252b"},axes:{x:"#df3b3b",y:"#06b881",z:"#295d8d"}}},kA={units:"mm",mode:{laser:!1,sim3d:!1},sim3d:{toolDiameter:6.35,resolution:256,showToolpath:!1,erosionPasses:2},bit:{enabled:!0,type:"drill",size:4.05,opacity:.9,tweenMs:140,colorSource:"cutting",color:it.colors.cutting,spinRpm:300},progress:{mode:"grey"},grid:{sizeX:1e3,sizeY:1e3,axisDepth:200,labels:!0,bounds:null},boundingBox:{visible:!1,labels:!1},machineBed:{visible:!1,min:null,max:null,keepout:null},geometry:{arcSegments:30,batching:{progressEveryLines:5e3,yieldEveryLines:5e4}},render:{antialias:!0,theme:it},camera:{fov:45,focusDurationMs:900,orbit:{enableDamping:!0},initialPosition:{x:0,y:-200,z:200}}};async function Ge(i,Q,B,t){var M,b,G;const A=Math.max(2,Math.floor(B)),e=(t==null?void 0:t.arcSegments)??30,P=(t==null?void 0:t.checkpointEveryLines)??2e3,r=((M=t==null?void 0:t.batch)==null?void 0:M.yieldEveryLines)??1e4,s=((b=t==null?void 0:t.batch)==null?void 0:b.shouldAbort)??(()=>!1),v=(G=t==null?void 0:t.batch)==null?void 0:G.onProgress;if(i.length===0){const C={xMin:-1,xMax:1,yMin:-1,yMax:1,zTop:1,zBot:0},j=new Float32Array(A*A).fill(C.zTop),F=new Map;return F.set(0,new Float32Array(j)),{moves:[],checkpoints:F,slabBounds:C,resolution:A,toolRadius:Q}}let c=1/0,n=-1/0,T=1/0,z=-1/0,w=1/0,o=-1/0;const a=new YQ.GCodeVirtualizer({onLinearMove(C){if(C.modals.motion==="G0")return;const j=C.transformedStart??C.start,F=C.transformedEnd??C.end;for(const H of[j,F])H.X<c&&(c=H.X),H.X>n&&(n=H.X),H.Y<T&&(T=H.Y),H.Y>z&&(z=H.Y),H.Z<w&&(w=H.Z),H.Z>o&&(o=H.Z)},onArcMove(C){const j=C.transformedStart??C.start,F=C.transformedEnd??C.end,H=C.transformedMax??C.max;for(const f of[j,F,H])f.X<c&&(c=f.X),f.X>n&&(n=f.X),f.Y<T&&(T=f.Y),f.Y>z&&(z=f.Y),f.Z<w&&(w=f.Z),f.Z>o&&(o=f.Z)}});for(const C of i)a.processLine(C);isFinite(c)||(c=-1,n=1,T=-1,z=1,w=0,o=0),c===n&&(c-=Q*2,n+=Q*2),T===z&&(T-=Q*2,z+=Q*2),c-=Q,n+=Q,T-=Q,z+=Q;const E=o;let l=w-Q;l>=E&&(l=E-1);const u={xMin:c,xMax:n,yMin:T,yMax:z,zTop:E,zBot:l},U=new Float32Array(A*A).fill(E),k=new Map;k.set(0,new Float32Array(U));const O=[];let D=0,N=0;const d=new YQ.GCodeVirtualizer({onLinearMove(C){const j=C.transformedStart??C.start,F=C.transformedEnd??C.end,H={lineIndex:N,x0:j.X,y0:j.Y,z0:j.Z,x1:F.X,y1:F.Y,z1:F.Z};O.push(H),rt(H,U,u,Q,A)},onArcMove(C){const j=C.transformedStart??C.start,F=C.transformedEnd??C.end,H=C.transformedCenter??C.center,f=be(j,F,H,C.plane,C.motion,e);for(const I of f){const R={lineIndex:N,...I};O.push(R),rt(R,U,u,Q,A)}}});for(let C=0;C<i.length&&!s();C++){N=C;const j=i[C];j!==void 0&&d.processLine(j),C-D>=P&&(k.set(C,new Float32Array(U)),D=C),C%r===0&&C>0&&(v==null||v(C,i.length),await new Promise(F=>setTimeout(F,0)))}return v==null||v(i.length,i.length),{moves:O,checkpoints:k,slabBounds:u,resolution:A,toolRadius:Q}}function rt(i,Q,B,t,A){const e=(B.xMax-B.xMin)/A,P=(B.yMax-B.yMin)/A,r=Math.hypot(i.x1-i.x0,i.y1-i.y0),s=Math.max(.001,Math.min(e,P)*.5),v=Math.max(1,Math.ceil(r/s)),c=Math.ceil(t/e),n=Math.ceil(t/P),T=t*t;for(let z=0;z<=v;z++){const w=z/v,o=i.x0+(i.x1-i.x0)*w,a=i.y0+(i.y1-i.y0)*w,E=i.z0+(i.z1-i.z0)*w,l=Math.floor((o-B.xMin)/e),u=Math.floor((a-B.yMin)/P);for(let U=-c;U<=c;U++){const k=l+U;if(k<0||k>=A)continue;const O=B.xMin+(k+.5)*e,D=(O-o)*(O-o);if(!(D>T))for(let N=-n;N<=n;N++){const d=u+N;if(d<0||d>=A)continue;const M=B.yMin+(d+.5)*P;if(D+(M-a)*(M-a)>T)continue;const G=d*A+k;Q[G]>E&&(Q[G]=E)}}}}function YB(i,Q){let B=0;for(const e of Q.checkpoints.keys())e<=i&&e>B&&(B=e);const t=Q.checkpoints.get(B),A=t?new Float32Array(t):new Float32Array(Q.resolution*Q.resolution).fill(Q.slabBounds.zTop);for(const e of Q.moves)e.lineIndex>B&&e.lineIndex<=i&&rt(e,A,Q.slabBounds,Q.toolRadius,Q.resolution);return A}function VB(i,Q,B,t){if(B<=0)return;const A=.001,e=Q*Q,P=new Float32Array(e);for(let r=0;r<B;r++){P.set(i);for(let s=0;s<Q;s++)for(let v=0;v<Q;v++){if(P[s*Q+v]<t-A)continue;let n=t;for(let T=-1;T<=1;T++){const z=s+T;if(!(z<0||z>=Q))for(let w=-1;w<=1;w++){if(w===0&&T===0)continue;const o=v+w;if(o<0||o>=Q)continue;const a=P[z*Q+o];a<n&&(n=a)}}n<t-A&&(i[s*Q+v]=n)}}}function be(i,Q,B,t,A,e){const P=Math.max(1,e);let r,s,v;t==="G18"?(r="Z",s="X",v="Y"):t==="G19"?(r="Y",s="Z",v="X"):(r="X",s="Y",v="Z");const c=Math.hypot(i[r]-B[r],i[s]-B[s]),n=Math.atan2(i[s]-B[s],i[r]-B[r]),T=Math.atan2(Q[s]-B[s],Q[r]-B[r]);let z;A==="G2"?(z=T-n,z>0&&(z-=Math.PI*2)):(z=T-n,z<0&&(z+=Math.PI*2));const w=[];let o={...i};for(let a=1;a<=P;a++){const E=a/P,l=n+z*E,u=E,U=B[r]+c*Math.cos(l),k=B[s]+c*Math.sin(l),O=i[v]+(Q[v]-i[v])*u,D={X:0,Y:0,Z:0};D[r]=U,D[s]=k,D[v]=O,w.push({x0:o.X,y0:o.Y,z0:o.Z,x1:D.X,y1:D.Y,z1:D.Z}),o=D}return w}let OB=null;function ge(){if(OB)return OB;const i=512,Q=document.createElement("canvas");Q.width=i,Q.height=i;const B=Q.getContext("2d");B.fillStyle="#8B5E3C",B.fillRect(0,0,i,i);const t=Math.floor(40+Math.random()*20);for(let A=0;A<t;A++){const e=Math.random()*i,P=1+Math.random()*2,r=Math.floor(139+(Math.random()-.5)*40),s=Math.floor(94+(Math.random()-.5)*30),v=Math.floor(60+(Math.random()-.5)*20);B.strokeStyle=`rgb(${r},${s},${v})`,B.lineWidth=P,B.beginPath(),B.moveTo(0,e),B.lineTo(i,e),B.stroke()}for(let A=0;A<300;A++){const e=Math.random()*i,P=Math.random()*i,r=20+Math.random()*60,s=(Math.random()-.5)*.3,v=Math.floor(100+Math.random()*80),c=Math.floor(60+Math.random()*50),n=Math.floor(30+Math.random()*40);B.strokeStyle=`rgba(${v},${c},${n},0.35)`,B.lineWidth=.5+Math.random()*1,B.beginPath(),B.moveTo(e,P),B.quadraticCurveTo(e+r*.5*Math.cos(s),P+r*.5*Math.sin(s)*.1,e+r*Math.cos(s*.5),P+r*.15),B.stroke()}return OB=new h.CanvasTexture(Q),OB}function pe(i,Q){const B=new h.Group;B.name="gviewer:sim3d-slab";const t=i.xMax-i.xMin,A=i.yMax-i.yMin,e=i.zTop-i.zBot,P=(i.xMin+i.xMax)/2,r=(i.yMin+i.yMax)/2,s=(i.zBot+i.zTop)/2,v=ge();v.wrapS=h.RepeatWrapping,v.wrapT=h.RepeatWrapping,v.repeat.set(t/100,A/100);const c=new h.MeshStandardMaterial({map:v,roughness:.85,metalness:0,side:h.FrontSide}),n=new h.MeshStandardMaterial({color:8016432,roughness:.9,metalness:0,side:h.DoubleSide}),T=new h.MeshStandardMaterial({color:7030822,roughness:.9,metalness:0}),z=new h.PlaneGeometry(t,A,Q-1,Q-1),w=Q*Q,o=new Float32Array(w*3),a=z.attributes.position;for(let G=0;G<w;G++)o[G*3]=a.getX(G),o[G*3+1]=a.getY(G),o[G*3+2]=0;const E=new h.BufferAttribute(o,3);E.usage=h.DynamicDrawUsage,z.setAttribute("position",E),z.computeVertexNormals();const l=new h.Mesh(z,c);l.name="gviewer:sim3d-top",l.position.set(P,r,i.zTop),B.add(l);const u=new h.PlaneGeometry(t,e);u.rotateX(Math.PI/2);const U=new h.Mesh(u,n);U.position.set(P,i.yMax,s),B.add(U);const k=new h.PlaneGeometry(t,e);k.rotateX(Math.PI/2);const O=new h.Mesh(k,n);O.position.set(P,i.yMin,s),B.add(O);const D=new h.PlaneGeometry(e,A);D.rotateY(-Math.PI/2);const N=new h.Mesh(D,n);N.position.set(i.xMax,r,s),B.add(N);const d=new h.PlaneGeometry(e,A);d.rotateY(-Math.PI/2);const M=new h.Mesh(d,n);M.position.set(i.xMin,r,s),B.add(M);const b=new h.Mesh(new h.PlaneGeometry(t,A),T);return b.position.set(P,r,i.zBot),B.add(b),{group:B,topMesh:l,topPositionAttr:E,slabBounds:i,resolution:Q}}function JB(i,Q){const{topPositionAttr:B,slabBounds:t,resolution:A}=i,e=A*A;for(let P=0;P<e;P++){const r=Math.floor(P/A),s=P%A,v=(A-1-r)*A+s;B.setZ(P,Q[v]-t.zTop)}B.needsUpdate=!0,i.topMesh.geometry.computeVertexNormals()}function me(i){i.group.traverse(Q=>{if(Q instanceof h.Mesh){Q.geometry.dispose();const B=Q.material;Array.isArray(B)?B.forEach(t=>{t.map&&t.map.dispose(),t.dispose()}):(B.map&&B.map.dispose(),B.dispose())}})}const xe=".gViewer-viewcube{position:absolute;left:60px;bottom:60px;width:84px;height:84px;z-index:9999;perspective:600px;pointer-events:auto}.gViewer-viewcube__cube{position:absolute;top:0;right:0;bottom:0;left:0;transform-style:preserve-3d;transition:transform 60ms linear}.gViewer-viewcube__face{position:absolute;width:84px;height:84px;display:flex;align-items:center;justify-content:center;font:600 11px system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;letter-spacing:.06em;text-transform:uppercase;color:#f0f5fce0;background:#0c1014b3;border:1px solid rgba(120,140,160,.35);border-radius:14px;cursor:pointer;-webkit-user-select:none;user-select:none;padding:0}.gViewer-viewcube__face:hover{background:#0c1014db;border-color:#a0bedc8c}.gViewer-viewcube__face.is-active{border-color:#0ef6aef2;box-shadow:0 0 0 1px #0ef6ae59,0 10px 30px #00000059;color:#0ef6aef2}.gViewer-viewcube__face--front{transform:translateZ(42px)}.gViewer-viewcube__face--back{transform:rotateY(180deg) translateZ(42px)}.gViewer-viewcube__face--left{transform:rotateY(-90deg) translateZ(42px)}.gViewer-viewcube__face--right{transform:rotateY(90deg) translateZ(42px)}.gViewer-viewcube__face--top{transform:rotateX(-90deg) translateZ(42px)}.gViewer-viewcube__face--bottom{transform:rotateX(90deg) translateZ(42px)}",Jt="gviewer-viewcube-style";function ye(){if(typeof document>"u"||document.getElementById(Jt))return;const i=document.createElement("style");i.id=Jt,i.setAttribute("data-gviewer","viewcube"),i.textContent=xe,document.head.appendChild(i)}class uA{constructor(Q){ye(),this.onSelectView=Q.onSelectView,this.faceButtons=new Map,this.root=document.createElement("div"),this.root.className="gViewer-viewcube",this.cube=document.createElement("div"),this.cube.className="gViewer-viewcube__cube",this.root.appendChild(this.cube);const B=[{view:"front",className:"gViewer-viewcube__face--front",label:"Front"},{view:"back",className:"gViewer-viewcube__face--back",label:"Back"},{view:"left",className:"gViewer-viewcube__face--left",label:"Left"},{view:"right",className:"gViewer-viewcube__face--right",label:"Right"},{view:"top",className:"gViewer-viewcube__face--top",label:"Top"},{view:"bottom",className:"gViewer-viewcube__face--bottom",label:"Bottom"}];for(const t of B){const A=document.createElement("button");A.type="button",A.className=`gViewer-viewcube__face ${t.className}`,A.textContent=t.label,A.addEventListener("click",()=>this.onSelectView(t.view)),this.cube.appendChild(A),this.faceButtons.set(t.view,A)}Q.container.appendChild(this.root)}setActiveFace(Q){for(const[B,t]of this.faceButtons.entries())B===Q?t.classList.add("is-active"):t.classList.remove("is-active")}setRotationMatrix3d(Q){const B=Array.from({length:16},(t,A)=>{const e=Q[A]??0;return Number.isFinite(e)?String(Math.abs(e)<1e-12?0:Number(e.toFixed(8))):"0"});this.cube.style.transform=`matrix3d(${B.join(",")})`}dispose(){this.root.remove()}}function MQ(i,Q,B={}){const{opacity:t=1,size:A=10}=B,e=new h.Object3D,P=100,r=document.createElement("canvas"),s=r.getContext("2d");if(!s)throw new Error("Missing canvas 2D context.");s.font=`normal ${P}px Arial`;const c=s.measureText(i).width;r.width=c,r.height=P,s.font=`normal ${P}px Arial`,s.textAlign="center",s.textBaseline="middle",s.fillStyle=Q,s.fillText(i,c/2,P/2);const n=new h.Texture(r);n.needsUpdate=!0,n.minFilter=h.LinearFilter;const T=new h.SpriteMaterial({map:n,transparent:!0,opacity:t});e.textHeight=A,e.textWidth=c/P*e.textHeight,B.textAlign==="left"?e.position.x=(B.x??0)+(e.textWidth??0)/2:B.textAlign==="right"?e.position.x=(B.x??0)-(e.textWidth??0)/2:e.position.x=B.x??0,B.textBaseline==="top"?e.position.y=(B.y??0)-(e.textHeight??0)/2:B.textBaseline==="bottom"?e.position.y=(B.y??0)+(e.textHeight??0)/2:e.position.y=B.y??0,e.position.z=B.z??0;const z=new h.Sprite(T);return z.scale.set(c/P*A,A,1),e.add(z),e}function Ie(i){i.traverse(Q=>{var t;if(!(Q instanceof h.Sprite))return;const B=Q.material;(t=B.map)==null||t.dispose(),B.dispose()})}const Se=25.4;function Ye(i,Q){const B=new h.Group,t=new h.Box3Helper(i.clone(),new h.Color(Q.render.theme.colors.boundingBox)),A=t.material;return A.transparent=!0,A.opacity=.65,A.depthWrite=!1,A.linewidth=2,B.add(t),Q.boundingBox.labels&&B.add(...Ve(i.clone(),Q)),B}function Ve(i,Q){const B=Q.render.theme.colors.boundingBox,t=.8,A=u=>Math.abs(u)<1e-9?"0":u.toFixed(3),e=u=>Q.units==="in"?`${A(u/Se)} in`:`${A(u)} mm`,P=i.min,r=i.max,s=u=>MQ(u,B,{size:4,opacity:t}),v=s(e(P.x)),c=s(e(r.x)),n=s(e(P.y)),T=s(e(r.y)),z=s(e(P.z)),w=s(e(r.z)),o=new h.Vector3;i.getSize(o);const a=Math.max(2,Math.max(o.x,o.y,o.z)*.02),E=(P.x+r.x)/2,l=(P.y+r.y)/2;return v.position.set(P.x-a,l,P.z-a),c.position.set(r.x+a,l,P.z-a),n.position.set(E,P.y-a,P.z-a),T.position.set(E,r.y+a,P.z-a),z.position.set(E,l,P.z-a),w.position.set(E,l,r.z+a),[v,c,n,T,z,w]}function Je(i){i.traverse(Q=>{var B;if(Q instanceof h.LineSegments||Q instanceof h.Line){Q.geometry.dispose();const t=Q.material;Array.isArray(t)?t.forEach(A=>A.dispose()):t.dispose();return}if(Q instanceof h.Sprite){const t=Q.material;(B=t.map)==null||B.dispose(),t.dispose()}})}function Rt(i,Q,B){const t=new Float32Array([i.x,i.y,0,Q.x,i.y,0,Q.x,Q.y,0,i.x,Q.y,0,i.x,i.y,0]),A=new h.BufferGeometry;A.setAttribute("position",new h.BufferAttribute(t,3));const e=new h.LineBasicMaterial({color:new h.Color(B),transparent:!0,opacity:.35,depthWrite:!1});return new h.LineLoop(A,e)}function Re(i,Q,B,t=10){const A=[],e=i.x-Q.y,P=Q.x-i.y;for(let v=e;v<=P;v+=t){const c=Math.max(i.x,i.y+v),n=Math.min(Q.x,Q.y+v);n>c&&A.push(c,c-v,0,n,n-v,0)}const r=new h.BufferGeometry;r.setAttribute("position",new h.BufferAttribute(new Float32Array(A),3));const s=new h.LineBasicMaterial({color:new h.Color(B),transparent:!0,opacity:.35,depthWrite:!1});return new h.LineSegments(r,s)}function Xe(i,Q,B,t){const A=new h.Group;if(A.add(Rt(i,Q,B.render.theme.colors.machineBed)),t){const e=B.render.theme.colors.machineBedKeepout;A.add(Rt(t.min,t.max,e)),A.add(Re(t.min,t.max,e))}return A}function Ke(i){i.traverse(Q=>{if(Q instanceof h.LineSegments||Q instanceof h.Line){Q.geometry.dispose();const B=Q.material;Array.isArray(B)?B.forEach(t=>t.dispose()):B.dispose()}})}function Ze(i){const Q=window.getComputedStyle(i);(Q.position==="static"||!Q.position)&&(i.style.position="relative"),i.style.overflow||(i.style.overflow="hidden")}function We(i){if(i<.5)return 4*i*i*i;const Q=-2*i+2;return 1-Q*Q*Q/2}function Xt(i){const Q=new h.Vector3,B={right:new h.Vector3(1,0,0),left:new h.Vector3(-1,0,0),front:new h.Vector3(0,-1,0),back:new h.Vector3(0,1,0),top:new h.Vector3(0,0,1),bottom:new h.Vector3(0,0,-1)};switch(i){case"front":Q.copy(B.front);break;case"back":Q.copy(B.back);break;case"left":Q.copy(B.left);break;case"right":Q.copy(B.right);break;case"top":Q.copy(B.top);break;case"bottom":Q.copy(B.bottom);break;case"front-top-left":Q.copy(B.front).add(B.top).add(B.left);break;case"front-top-right":Q.copy(B.front).add(B.top).add(B.right);break;case"front-bottom-left":Q.copy(B.front).add(B.bottom).add(B.left);break;case"front-bottom-right":Q.copy(B.front).add(B.bottom).add(B.right);break;case"back-top-left":Q.copy(B.back).add(B.top).add(B.left);break;case"back-top-right":Q.copy(B.back).add(B.top).add(B.right);break;case"back-bottom-left":Q.copy(B.back).add(B.bottom).add(B.left);break;case"back-bottom-right":Q.copy(B.back).add(B.bottom).add(B.right);break;default:Q.copy(B.front);break}return Q.normalize()}function qe(i,Q){const B=i.x-Q.x,t=i.y-Q.y,A=i.z-Q.z,e=Math.abs(B),P=Math.abs(t),r=Math.abs(A);return r>=e&&r>=P?A>=0?"top":"bottom":e>=P?B>=0?"right":"left":t>=0?"back":"front"}const UA=25.4;function Ut(i){if(i.bounds)return{minX:i.bounds.min.x,maxX:i.bounds.max.x,minY:i.bounds.min.y,maxY:i.bounds.max.y};const Q=Math.max(1,i.sizeXMm)/2,B=Math.max(1,i.sizeYMm)/2;return{minX:-Q,maxX:Q,minY:-B,maxY:B}}function _e(i){const{minX:Q,maxX:B,minY:t,maxY:A}=Ut(i),e=i.units==="mm"?10:UA,P=[],r=[],s=(w,o,a,E,l)=>{l.push(w,o,0,a,E,0)},v=Math.ceil(t/e)*e,c=Math.floor(A/e)*e;for(let w=v;w<=c+1e-6;w+=e)s(Q,w,B,w,Math.abs(w)<1e-6?P:r);const n=Math.ceil(Q/e)*e,T=Math.floor(B/e)*e;for(let w=n;w<=T+1e-6;w+=e)s(w,t,w,A,Math.abs(w)<1e-6?P:r);const z=new h.Group;return r.length>0&&z.add(Kt(r,i.theme.colors.grid.minor,.25)),P.length>0&&z.add(Kt(P,i.theme.colors.grid.major,.4)),z}function Kt(i,Q,B){const t=new h.BufferGeometry;t.setAttribute("position",new h.Float32BufferAttribute(i,3));const A=new h.LineBasicMaterial({color:new h.Color(Q),transparent:!0,opacity:B,depthWrite:!1});return new h.LineSegments(t,A)}function $e(i){i.traverse(Q=>{if(!(Q instanceof h.LineSegments))return;Q.geometry.dispose();const B=Q.material;Array.isArray(B)?B.forEach(t=>t.dispose()):B.dispose()})}function QP(i){const Q=new h.Group,{minX:B,maxX:t,minY:A,maxY:e}=Ut({sizeXMm:i.sizeXWorld,sizeYMm:i.sizeYWorld,bounds:i.bounds}),P=Math.max(1,i.depthWorld),r=Math.max(1,Math.min(Math.max(t-B,e-A)/24,30)),s=r*.6,v=E=>new h.LineDashedMaterial({color:new h.Color(E),dashSize:r,gapSize:s,transparent:!0,opacity:.75,depthWrite:!1}),c=new h.Line(new h.BufferGeometry().setFromPoints([new h.Vector3(B,0,0),new h.Vector3(t,0,0)]),v(i.theme.colors.axes.x));c.computeLineDistances();const n=new h.Line(new h.BufferGeometry().setFromPoints([new h.Vector3(0,A,0),new h.Vector3(0,e,0)]),v(i.theme.colors.axes.y));n.computeLineDistances();const T=new h.Line(new h.BufferGeometry().setFromPoints([new h.Vector3(0,0,0),new h.Vector3(0,0,P)]),v(i.theme.colors.axes.z));T.computeLineDistances(),Q.add(c,n,T);const z=Math.max(2,r),w=MQ("X",i.theme.colors.axes.x,{size:5});w.position.set(t+z,0,0);const o=MQ("Y",i.theme.colors.axes.y,{size:5});o.position.set(0,e+z,0);const a=MQ("Z",i.theme.colors.axes.z,{size:5});return a.position.set(0,0,P+z),Q.add(w,o,a),Q}function BP(i){i.traverse(Q=>{var B;if(Q instanceof h.Line){Q.geometry.dispose();const t=Q.material;Array.isArray(t)?t.forEach(A=>A.dispose()):t.dispose();return}if(Q instanceof h.Sprite){const t=Q.material;(B=t.map)==null||B.dispose(),t.dispose()}})}function tP(i){const Q=new h.Group,{minX:B,maxX:t,minY:A,maxY:e}=Ut(i),P=i.units==="mm"?10:1,r=P*2,s=i.units==="mm"?1:UA,v=.5,c=4,n=.1,T=5,z=i.theme.colors.axes.x,w=i.theme.colors.axes.y,o={opacity:v,size:c};for(let a=P;;a+=r){const E=a*s;if(E>t+1e-6)break;const l=MQ(String(a),z,o);l.position.set(E,T,n),Q.add(l)}for(let a=P;;a+=r){const E=a*s;if(-E<B-1e-6)break;const l=MQ(String(-a),z,o);l.position.set(-E,T,n),Q.add(l)}for(let a=P;;a+=r){const E=a*s;if(E>e+1e-6)break;const l=MQ(String(a),w,o);l.position.set(-T,E,n),Q.add(l)}for(let a=P;;a+=r){const E=a*s;if(-E<A-1e-6)break;const l=MQ(String(-a),w,o);l.position.set(-T,-E,n),Q.add(l)}return Q}function dQ(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function DA(i,Q){i.prototype=Object.create(Q.prototype),i.prototype.constructor=i,i.__proto__=Q}/*!
|
|
1
|
+
"use strict";const De=require("three"),de=require("three/examples/jsm/controls/OrbitControls.js"),YQ=require("./gviewer.cjs"),Ce=require("three/examples/jsm/loaders/STLLoader.js");function Ne(i){const Q=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const B in i)if(B!=="default"){const t=Object.getOwnPropertyDescriptor(i,B);Object.defineProperty(Q,B,t.get?t:{enumerable:!0,get:()=>i[B]})}}return Q.default=i,Object.freeze(Q)}const h=Ne(De);function Oe(i){const Q=[];let B=null;for(const t of i.specs){if(t.positions.length===0||t.opacity<=0)continue;const A=t.positions.length/3,e=t.colors?t.colors.slice():lA(t.kind,A,i.options),P=new Float32Array(e.length);P.set(e);const r=new h.BufferGeometry;r.setAttribute("position",new h.BufferAttribute(t.positions,3));const s=new h.BufferAttribute(P,3);s.setUsage(h.DynamicDrawUsage),r.setAttribute("color",s),r.computeBoundingBox();const v=new h.LineBasicMaterial({vertexColors:!0,transparent:!0,opacity:t.opacity}),c=new h.LineSegments(r,v);i.scene.add(c),Q.push({line:c,baseColors:e,simColors:P,prefixEndVertex:t.prefixEndVertex,totalVertices:A,greyCursorVertex:0,kind:t.kind,cutBucketIndex:t.cutBucketIndex,workerColors:t.colors?e:void 0}),r.boundingBox&&(B=B?B.union(r.boundingBox):r.boundingBox.clone())}return{streams:Q,bounds:B}}function Le(i,Q){for(const B of Q)i.remove(B.line),B.line.geometry.dispose(),B.line.material.dispose()}function Me(i,Q){for(const B of i){if(B.workerColors)continue;const t=lA(B.kind,B.totalVertices,Q);B.baseColors=t,B.simColors.set(t),B.greyCursorVertex=0;const A=B.line.geometry.getAttribute("color");A.clearUpdateRanges(),A.addUpdateRange(0,B.simColors.length),A.needsUpdate=!0}}function He(i){const Q=Pt(i.options.render.theme.rapidOpacity??.3);for(const B of i.streams){const t=B.line.material;if(B.kind==="rapid"){t.opacity=Q;continue}t.opacity=fe({bucketIndex:B.cutBucketIndex??0,bucketCount:i.cutBucketCount,baseOpacity:i.options.render.theme.opacity})}}function je(i){const Q=i.stream.totalVertices,B=Math.max(0,Math.min(Q,Math.floor(i.nextCursorVertex))),t=Math.max(0,Math.min(Q,Math.floor(i.stream.greyCursorVertex)));if(B===t)return;const A=i.stream.line.geometry.getAttribute("color"),e=Fe(i.options),P=Math.min(t,B),r=Math.max(t,B);if(B>t)for(let s=t;s<B;s+=1){const v=s*3;i.stream.simColors[v]=e.r,i.stream.simColors[v+1]=e.g,i.stream.simColors[v+2]=e.b}else{const s=B*3,v=t*3;i.stream.simColors.set(i.stream.baseColors.subarray(s,v),s)}A.clearUpdateRanges(),A.addUpdateRange(P*3,(r-P)*3),A.needsUpdate=!0,i.stream.greyCursorVertex=B}function lA(i,Q,B){const t=B.render.theme.colors,A=B.mode.laser?t.laser??t.cutting:t.cutting,e=new h.Color(i==="rapid"?t.rapid:A),P=new Float32Array(Q*3);for(let r=0;r<Q;r+=1){const s=r*3;P[s]=e.r,P[s+1]=e.g,P[s+2]=e.b}return P}function Fe(i){const Q=i.render.theme.colors,B=new h.Color(i.render.theme.background),t=new h.Color(Q.processed??Q.cutting),A=B.clone().lerp(t,.65);return{r:A.r,g:A.g,b:A.b}}function fe(i){if(i.bucketCount<=1)return Pt(i.baseOpacity);const Q=i.bucketIndex/(i.bucketCount-1);return Pt(i.baseOpacity*Q)}function Pt(i){return Number.isFinite(i)?Math.max(0,Math.min(1,i)):0}const it={background:"#111827",opacity:.9,rapidOpacity:.3,colors:{rapid:"#0ef6ae",cutting:"#3e85c7",laser:"#a855f7",processed:"#6b7280",boundingBox:"#e2e8f0",machineBed:"#fbbf24",machineBedKeepout:"#df3b3b",grid:{major:"#2f3840",minor:"#1f252b"},axes:{x:"#df3b3b",y:"#06b881",z:"#295d8d"}}},kA={units:"mm",mode:{laser:!1,sim3d:!1},sim3d:{toolDiameter:6.35,resolution:256,showToolpath:!1,erosionPasses:2},bit:{enabled:!0,type:"drill",size:4.05,opacity:.9,tweenMs:140,colorSource:"cutting",color:it.colors.cutting,spinRpm:300},progress:{mode:"grey"},grid:{sizeX:1e3,sizeY:1e3,axisDepth:200,labels:!0,bounds:null},boundingBox:{visible:!1,labels:!1},machineBed:{visible:!1,min:null,max:null,keepout:null},geometry:{arcSegments:30,batching:{progressEveryLines:5e3,yieldEveryLines:5e4}},render:{antialias:!0,theme:it},camera:{fov:45,focusDurationMs:900,orbit:{enableDamping:!0},initialPosition:{x:0,y:-200,z:200}}};async function Ge(i,Q,B,t){var M,b,G;const A=Math.max(2,Math.floor(B)),e=(t==null?void 0:t.arcSegments)??30,P=(t==null?void 0:t.checkpointEveryLines)??2e3,r=((M=t==null?void 0:t.batch)==null?void 0:M.yieldEveryLines)??1e4,s=((b=t==null?void 0:t.batch)==null?void 0:b.shouldAbort)??(()=>!1),v=(G=t==null?void 0:t.batch)==null?void 0:G.onProgress;if(i.length===0){const C={xMin:-1,xMax:1,yMin:-1,yMax:1,zTop:1,zBot:0},j=new Float32Array(A*A).fill(C.zTop),F=new Map;return F.set(0,new Float32Array(j)),{moves:[],checkpoints:F,slabBounds:C,resolution:A,toolRadius:Q}}let c=1/0,n=-1/0,T=1/0,z=-1/0,w=1/0,o=-1/0;const a=new YQ.GCodeVirtualizer({onLinearMove(C){if(C.modals.motion==="G0")return;const j=C.transformedStart??C.start,F=C.transformedEnd??C.end;for(const H of[j,F])H.X<c&&(c=H.X),H.X>n&&(n=H.X),H.Y<T&&(T=H.Y),H.Y>z&&(z=H.Y),H.Z<w&&(w=H.Z),H.Z>o&&(o=H.Z)},onArcMove(C){const j=C.transformedStart??C.start,F=C.transformedEnd??C.end,H=C.transformedMax??C.max;for(const f of[j,F,H])f.X<c&&(c=f.X),f.X>n&&(n=f.X),f.Y<T&&(T=f.Y),f.Y>z&&(z=f.Y),f.Z<w&&(w=f.Z),f.Z>o&&(o=f.Z)}});for(const C of i)a.processLine(C);isFinite(c)||(c=-1,n=1,T=-1,z=1,w=0,o=0),c===n&&(c-=Q*2,n+=Q*2),T===z&&(T-=Q*2,z+=Q*2),c-=Q,n+=Q,T-=Q,z+=Q;const E=o;let l=w-Q;l>=E&&(l=E-1);const u={xMin:c,xMax:n,yMin:T,yMax:z,zTop:E,zBot:l},U=new Float32Array(A*A).fill(E),k=new Map;k.set(0,new Float32Array(U));const O=[];let D=0,N=0;const d=new YQ.GCodeVirtualizer({onLinearMove(C){const j=C.transformedStart??C.start,F=C.transformedEnd??C.end,H={lineIndex:N,x0:j.X,y0:j.Y,z0:j.Z,x1:F.X,y1:F.Y,z1:F.Z};O.push(H),rt(H,U,u,Q,A)},onArcMove(C){const j=C.transformedStart??C.start,F=C.transformedEnd??C.end,H=C.transformedCenter??C.center,f=be(j,F,H,C.plane,C.motion,e);for(const I of f){const R={lineIndex:N,...I};O.push(R),rt(R,U,u,Q,A)}}});for(let C=0;C<i.length&&!s();C++){N=C;const j=i[C];j!==void 0&&d.processLine(j),C-D>=P&&(k.set(C,new Float32Array(U)),D=C),C%r===0&&C>0&&(v==null||v(C,i.length),await new Promise(F=>setTimeout(F,0)))}return v==null||v(i.length,i.length),{moves:O,checkpoints:k,slabBounds:u,resolution:A,toolRadius:Q}}function rt(i,Q,B,t,A){const e=(B.xMax-B.xMin)/A,P=(B.yMax-B.yMin)/A,r=Math.hypot(i.x1-i.x0,i.y1-i.y0),s=Math.max(.001,Math.min(e,P)*.5),v=Math.max(1,Math.ceil(r/s)),c=Math.ceil(t/e),n=Math.ceil(t/P),T=t*t;for(let z=0;z<=v;z++){const w=z/v,o=i.x0+(i.x1-i.x0)*w,a=i.y0+(i.y1-i.y0)*w,E=i.z0+(i.z1-i.z0)*w,l=Math.floor((o-B.xMin)/e),u=Math.floor((a-B.yMin)/P);for(let U=-c;U<=c;U++){const k=l+U;if(k<0||k>=A)continue;const O=B.xMin+(k+.5)*e,D=(O-o)*(O-o);if(!(D>T))for(let N=-n;N<=n;N++){const d=u+N;if(d<0||d>=A)continue;const M=B.yMin+(d+.5)*P;if(D+(M-a)*(M-a)>T)continue;const G=d*A+k;Q[G]>E&&(Q[G]=E)}}}}function YB(i,Q){let B=0;for(const e of Q.checkpoints.keys())e<=i&&e>B&&(B=e);const t=Q.checkpoints.get(B),A=t?new Float32Array(t):new Float32Array(Q.resolution*Q.resolution).fill(Q.slabBounds.zTop);for(const e of Q.moves)e.lineIndex>B&&e.lineIndex<=i&&rt(e,A,Q.slabBounds,Q.toolRadius,Q.resolution);return A}function VB(i,Q,B,t){if(B<=0)return;const A=.001,e=Q*Q,P=new Float32Array(e);for(let r=0;r<B;r++){P.set(i);for(let s=0;s<Q;s++)for(let v=0;v<Q;v++){if(P[s*Q+v]<t-A)continue;let n=t;for(let T=-1;T<=1;T++){const z=s+T;if(!(z<0||z>=Q))for(let w=-1;w<=1;w++){if(w===0&&T===0)continue;const o=v+w;if(o<0||o>=Q)continue;const a=P[z*Q+o];a<n&&(n=a)}}n<t-A&&(i[s*Q+v]=n)}}}function be(i,Q,B,t,A,e){const P=Math.max(1,e);let r,s,v;t==="G18"?(r="Z",s="X",v="Y"):t==="G19"?(r="Y",s="Z",v="X"):(r="X",s="Y",v="Z");const c=Math.hypot(i[r]-B[r],i[s]-B[s]),n=Math.atan2(i[s]-B[s],i[r]-B[r]),T=Math.atan2(Q[s]-B[s],Q[r]-B[r]);let z;A==="G2"?(z=T-n,z>0&&(z-=Math.PI*2)):(z=T-n,z<0&&(z+=Math.PI*2));const w=[];let o={...i};for(let a=1;a<=P;a++){const E=a/P,l=n+z*E,u=E,U=B[r]+c*Math.cos(l),k=B[s]+c*Math.sin(l),O=i[v]+(Q[v]-i[v])*u,D={X:0,Y:0,Z:0};D[r]=U,D[s]=k,D[v]=O,w.push({x0:o.X,y0:o.Y,z0:o.Z,x1:D.X,y1:D.Y,z1:D.Z}),o=D}return w}let OB=null;function ge(){if(OB)return OB;const i=512,Q=document.createElement("canvas");Q.width=i,Q.height=i;const B=Q.getContext("2d");B.fillStyle="#8B5E3C",B.fillRect(0,0,i,i);const t=Math.floor(40+Math.random()*20);for(let A=0;A<t;A++){const e=Math.random()*i,P=1+Math.random()*2,r=Math.floor(139+(Math.random()-.5)*40),s=Math.floor(94+(Math.random()-.5)*30),v=Math.floor(60+(Math.random()-.5)*20);B.strokeStyle=`rgb(${r},${s},${v})`,B.lineWidth=P,B.beginPath(),B.moveTo(0,e),B.lineTo(i,e),B.stroke()}for(let A=0;A<300;A++){const e=Math.random()*i,P=Math.random()*i,r=20+Math.random()*60,s=(Math.random()-.5)*.3,v=Math.floor(100+Math.random()*80),c=Math.floor(60+Math.random()*50),n=Math.floor(30+Math.random()*40);B.strokeStyle=`rgba(${v},${c},${n},0.35)`,B.lineWidth=.5+Math.random()*1,B.beginPath(),B.moveTo(e,P),B.quadraticCurveTo(e+r*.5*Math.cos(s),P+r*.5*Math.sin(s)*.1,e+r*Math.cos(s*.5),P+r*.15),B.stroke()}return OB=new h.CanvasTexture(Q),OB}function pe(i,Q){const B=new h.Group;B.name="gviewer:sim3d-slab";const t=i.xMax-i.xMin,A=i.yMax-i.yMin,e=i.zTop-i.zBot,P=(i.xMin+i.xMax)/2,r=(i.yMin+i.yMax)/2,s=(i.zBot+i.zTop)/2,v=ge();v.wrapS=h.RepeatWrapping,v.wrapT=h.RepeatWrapping,v.repeat.set(t/100,A/100);const c=new h.MeshStandardMaterial({map:v,roughness:.85,metalness:0,side:h.FrontSide}),n=new h.MeshStandardMaterial({color:8016432,roughness:.9,metalness:0,side:h.DoubleSide}),T=new h.MeshStandardMaterial({color:7030822,roughness:.9,metalness:0}),z=new h.PlaneGeometry(t,A,Q-1,Q-1),w=Q*Q,o=new Float32Array(w*3),a=z.attributes.position;for(let G=0;G<w;G++)o[G*3]=a.getX(G),o[G*3+1]=a.getY(G),o[G*3+2]=0;const E=new h.BufferAttribute(o,3);E.usage=h.DynamicDrawUsage,z.setAttribute("position",E),z.computeVertexNormals();const l=new h.Mesh(z,c);l.name="gviewer:sim3d-top",l.position.set(P,r,i.zTop),B.add(l);const u=new h.PlaneGeometry(t,e);u.rotateX(Math.PI/2);const U=new h.Mesh(u,n);U.position.set(P,i.yMax,s),B.add(U);const k=new h.PlaneGeometry(t,e);k.rotateX(Math.PI/2);const O=new h.Mesh(k,n);O.position.set(P,i.yMin,s),B.add(O);const D=new h.PlaneGeometry(e,A);D.rotateY(-Math.PI/2);const N=new h.Mesh(D,n);N.position.set(i.xMax,r,s),B.add(N);const d=new h.PlaneGeometry(e,A);d.rotateY(-Math.PI/2);const M=new h.Mesh(d,n);M.position.set(i.xMin,r,s),B.add(M);const b=new h.Mesh(new h.PlaneGeometry(t,A),T);return b.position.set(P,r,i.zBot),B.add(b),{group:B,topMesh:l,topPositionAttr:E,slabBounds:i,resolution:Q}}function JB(i,Q){const{topPositionAttr:B,slabBounds:t,resolution:A}=i,e=A*A;for(let P=0;P<e;P++){const r=Math.floor(P/A),s=P%A,v=(A-1-r)*A+s;B.setZ(P,Q[v]-t.zTop)}B.needsUpdate=!0,i.topMesh.geometry.computeVertexNormals()}function me(i){i.group.traverse(Q=>{if(Q instanceof h.Mesh){Q.geometry.dispose();const B=Q.material;Array.isArray(B)?B.forEach(t=>{t.map&&t.map.dispose(),t.dispose()}):(B.map&&B.map.dispose(),B.dispose())}})}const xe=".gViewer-viewcube{position:absolute;left:60px;bottom:60px;width:84px;height:84px;z-index:9999;perspective:600px;pointer-events:auto}.gViewer-viewcube__cube{position:absolute;top:0;right:0;bottom:0;left:0;transform-style:preserve-3d;transition:transform 60ms linear}.gViewer-viewcube__face{position:absolute;width:84px;height:84px;display:flex;align-items:center;justify-content:center;font:600 11px system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;letter-spacing:.06em;text-transform:uppercase;color:#f0f5fce0;background:#0c1014b3;border:1px solid rgba(120,140,160,.35);border-radius:14px;cursor:pointer;-webkit-user-select:none;user-select:none;padding:0}.gViewer-viewcube__face:hover{background:#0c1014db;border-color:#a0bedc8c}.gViewer-viewcube__face.is-active{border-color:#60a5faf2;box-shadow:0 0 0 1px #60a5fa59,0 10px 30px #00000059;color:#60a5faf2}.gViewer-viewcube__face--front{transform:translateZ(42px)}.gViewer-viewcube__face--back{transform:rotateY(180deg) translateZ(42px)}.gViewer-viewcube__face--left{transform:rotateY(-90deg) translateZ(42px)}.gViewer-viewcube__face--right{transform:rotateY(90deg) translateZ(42px)}.gViewer-viewcube__face--top{transform:rotateX(-90deg) translateZ(42px)}.gViewer-viewcube__face--bottom{transform:rotateX(90deg) translateZ(42px)}",Jt="gviewer-viewcube-style";function ye(){if(typeof document>"u"||document.getElementById(Jt))return;const i=document.createElement("style");i.id=Jt,i.setAttribute("data-gviewer","viewcube"),i.textContent=xe,document.head.appendChild(i)}class uA{constructor(Q){ye(),this.onSelectView=Q.onSelectView,this.faceButtons=new Map,this.root=document.createElement("div"),this.root.className="gViewer-viewcube",this.cube=document.createElement("div"),this.cube.className="gViewer-viewcube__cube",this.root.appendChild(this.cube);const B=[{view:"front",className:"gViewer-viewcube__face--front",label:"Front"},{view:"back",className:"gViewer-viewcube__face--back",label:"Back"},{view:"left",className:"gViewer-viewcube__face--left",label:"Left"},{view:"right",className:"gViewer-viewcube__face--right",label:"Right"},{view:"top",className:"gViewer-viewcube__face--top",label:"Top"},{view:"bottom",className:"gViewer-viewcube__face--bottom",label:"Bottom"}];for(const t of B){const A=document.createElement("button");A.type="button",A.className=`gViewer-viewcube__face ${t.className}`,A.textContent=t.label,A.addEventListener("click",()=>this.onSelectView(t.view)),this.cube.appendChild(A),this.faceButtons.set(t.view,A)}Q.container.appendChild(this.root)}setActiveFace(Q){for(const[B,t]of this.faceButtons.entries())B===Q?t.classList.add("is-active"):t.classList.remove("is-active")}setRotationMatrix3d(Q){const B=Array.from({length:16},(t,A)=>{const e=Q[A]??0;return Number.isFinite(e)?String(Math.abs(e)<1e-12?0:Number(e.toFixed(8))):"0"});this.cube.style.transform=`matrix3d(${B.join(",")})`}dispose(){this.root.remove()}}function MQ(i,Q,B={}){const{opacity:t=1,size:A=10}=B,e=new h.Object3D,P=100,r=document.createElement("canvas"),s=r.getContext("2d");if(!s)throw new Error("Missing canvas 2D context.");s.font=`normal ${P}px Arial`;const c=s.measureText(i).width;r.width=c,r.height=P,s.font=`normal ${P}px Arial`,s.textAlign="center",s.textBaseline="middle",s.fillStyle=Q,s.fillText(i,c/2,P/2);const n=new h.Texture(r);n.needsUpdate=!0,n.minFilter=h.LinearFilter;const T=new h.SpriteMaterial({map:n,transparent:!0,opacity:t});e.textHeight=A,e.textWidth=c/P*e.textHeight,B.textAlign==="left"?e.position.x=(B.x??0)+(e.textWidth??0)/2:B.textAlign==="right"?e.position.x=(B.x??0)-(e.textWidth??0)/2:e.position.x=B.x??0,B.textBaseline==="top"?e.position.y=(B.y??0)-(e.textHeight??0)/2:B.textBaseline==="bottom"?e.position.y=(B.y??0)+(e.textHeight??0)/2:e.position.y=B.y??0,e.position.z=B.z??0;const z=new h.Sprite(T);return z.scale.set(c/P*A,A,1),e.add(z),e}function Ie(i){i.traverse(Q=>{var t;if(!(Q instanceof h.Sprite))return;const B=Q.material;(t=B.map)==null||t.dispose(),B.dispose()})}const Se=25.4;function Ye(i,Q){const B=new h.Group,t=new h.Box3Helper(i.clone(),new h.Color(Q.render.theme.colors.boundingBox)),A=t.material;return A.transparent=!0,A.opacity=.65,A.depthWrite=!1,A.linewidth=2,B.add(t),Q.boundingBox.labels&&B.add(...Ve(i.clone(),Q)),B}function Ve(i,Q){const B=Q.render.theme.colors.boundingBox,t=.8,A=u=>Math.abs(u)<1e-9?"0":u.toFixed(3),e=u=>Q.units==="in"?`${A(u/Se)} in`:`${A(u)} mm`,P=i.min,r=i.max,s=u=>MQ(u,B,{size:4,opacity:t}),v=s(e(P.x)),c=s(e(r.x)),n=s(e(P.y)),T=s(e(r.y)),z=s(e(P.z)),w=s(e(r.z)),o=new h.Vector3;i.getSize(o);const a=Math.max(2,Math.max(o.x,o.y,o.z)*.02),E=(P.x+r.x)/2,l=(P.y+r.y)/2;return v.position.set(P.x-a,l,P.z-a),c.position.set(r.x+a,l,P.z-a),n.position.set(E,P.y-a,P.z-a),T.position.set(E,r.y+a,P.z-a),z.position.set(E,l,P.z-a),w.position.set(E,l,r.z+a),[v,c,n,T,z,w]}function Je(i){i.traverse(Q=>{var B;if(Q instanceof h.LineSegments||Q instanceof h.Line){Q.geometry.dispose();const t=Q.material;Array.isArray(t)?t.forEach(A=>A.dispose()):t.dispose();return}if(Q instanceof h.Sprite){const t=Q.material;(B=t.map)==null||B.dispose(),t.dispose()}})}function Rt(i,Q,B){const t=new Float32Array([i.x,i.y,0,Q.x,i.y,0,Q.x,Q.y,0,i.x,Q.y,0,i.x,i.y,0]),A=new h.BufferGeometry;A.setAttribute("position",new h.BufferAttribute(t,3));const e=new h.LineBasicMaterial({color:new h.Color(B),transparent:!0,opacity:.35,depthWrite:!1});return new h.LineLoop(A,e)}function Re(i,Q,B,t=10){const A=[],e=i.x-Q.y,P=Q.x-i.y;for(let v=e;v<=P;v+=t){const c=Math.max(i.x,i.y+v),n=Math.min(Q.x,Q.y+v);n>c&&A.push(c,c-v,0,n,n-v,0)}const r=new h.BufferGeometry;r.setAttribute("position",new h.BufferAttribute(new Float32Array(A),3));const s=new h.LineBasicMaterial({color:new h.Color(B),transparent:!0,opacity:.35,depthWrite:!1});return new h.LineSegments(r,s)}function Xe(i,Q,B,t){const A=new h.Group;if(A.add(Rt(i,Q,B.render.theme.colors.machineBed)),t){const e=B.render.theme.colors.machineBedKeepout;A.add(Rt(t.min,t.max,e)),A.add(Re(t.min,t.max,e))}return A}function Ke(i){i.traverse(Q=>{if(Q instanceof h.LineSegments||Q instanceof h.Line){Q.geometry.dispose();const B=Q.material;Array.isArray(B)?B.forEach(t=>t.dispose()):B.dispose()}})}function Ze(i){const Q=window.getComputedStyle(i);(Q.position==="static"||!Q.position)&&(i.style.position="relative"),i.style.overflow||(i.style.overflow="hidden")}function We(i){if(i<.5)return 4*i*i*i;const Q=-2*i+2;return 1-Q*Q*Q/2}function Xt(i){const Q=new h.Vector3,B={right:new h.Vector3(1,0,0),left:new h.Vector3(-1,0,0),front:new h.Vector3(0,-1,0),back:new h.Vector3(0,1,0),top:new h.Vector3(0,0,1),bottom:new h.Vector3(0,0,-1)};switch(i){case"front":Q.copy(B.front);break;case"back":Q.copy(B.back);break;case"left":Q.copy(B.left);break;case"right":Q.copy(B.right);break;case"top":Q.copy(B.top);break;case"bottom":Q.copy(B.bottom);break;case"front-top-left":Q.copy(B.front).add(B.top).add(B.left);break;case"front-top-right":Q.copy(B.front).add(B.top).add(B.right);break;case"front-bottom-left":Q.copy(B.front).add(B.bottom).add(B.left);break;case"front-bottom-right":Q.copy(B.front).add(B.bottom).add(B.right);break;case"back-top-left":Q.copy(B.back).add(B.top).add(B.left);break;case"back-top-right":Q.copy(B.back).add(B.top).add(B.right);break;case"back-bottom-left":Q.copy(B.back).add(B.bottom).add(B.left);break;case"back-bottom-right":Q.copy(B.back).add(B.bottom).add(B.right);break;default:Q.copy(B.front);break}return Q.normalize()}function qe(i,Q){const B=i.x-Q.x,t=i.y-Q.y,A=i.z-Q.z,e=Math.abs(B),P=Math.abs(t),r=Math.abs(A);return r>=e&&r>=P?A>=0?"top":"bottom":e>=P?B>=0?"right":"left":t>=0?"back":"front"}const UA=25.4;function Ut(i){if(i.bounds)return{minX:i.bounds.min.x,maxX:i.bounds.max.x,minY:i.bounds.min.y,maxY:i.bounds.max.y};const Q=Math.max(1,i.sizeXMm)/2,B=Math.max(1,i.sizeYMm)/2;return{minX:-Q,maxX:Q,minY:-B,maxY:B}}function _e(i){const{minX:Q,maxX:B,minY:t,maxY:A}=Ut(i),e=i.units==="mm"?10:UA,P=[],r=[],s=(w,o,a,E,l)=>{l.push(w,o,0,a,E,0)},v=Math.ceil(t/e)*e,c=Math.floor(A/e)*e;for(let w=v;w<=c+1e-6;w+=e)s(Q,w,B,w,Math.abs(w)<1e-6?P:r);const n=Math.ceil(Q/e)*e,T=Math.floor(B/e)*e;for(let w=n;w<=T+1e-6;w+=e)s(w,t,w,A,Math.abs(w)<1e-6?P:r);const z=new h.Group;return r.length>0&&z.add(Kt(r,i.theme.colors.grid.minor,.25)),P.length>0&&z.add(Kt(P,i.theme.colors.grid.major,.4)),z}function Kt(i,Q,B){const t=new h.BufferGeometry;t.setAttribute("position",new h.Float32BufferAttribute(i,3));const A=new h.LineBasicMaterial({color:new h.Color(Q),transparent:!0,opacity:B,depthWrite:!1});return new h.LineSegments(t,A)}function $e(i){i.traverse(Q=>{if(!(Q instanceof h.LineSegments))return;Q.geometry.dispose();const B=Q.material;Array.isArray(B)?B.forEach(t=>t.dispose()):B.dispose()})}function QP(i){const Q=new h.Group,{minX:B,maxX:t,minY:A,maxY:e}=Ut({sizeXMm:i.sizeXWorld,sizeYMm:i.sizeYWorld,bounds:i.bounds}),P=Math.max(1,i.depthWorld),r=Math.max(1,Math.min(Math.max(t-B,e-A)/24,30)),s=r*.6,v=E=>new h.LineDashedMaterial({color:new h.Color(E),dashSize:r,gapSize:s,transparent:!0,opacity:.75,depthWrite:!1}),c=new h.Line(new h.BufferGeometry().setFromPoints([new h.Vector3(B,0,0),new h.Vector3(t,0,0)]),v(i.theme.colors.axes.x));c.computeLineDistances();const n=new h.Line(new h.BufferGeometry().setFromPoints([new h.Vector3(0,A,0),new h.Vector3(0,e,0)]),v(i.theme.colors.axes.y));n.computeLineDistances();const T=new h.Line(new h.BufferGeometry().setFromPoints([new h.Vector3(0,0,0),new h.Vector3(0,0,P)]),v(i.theme.colors.axes.z));T.computeLineDistances(),Q.add(c,n,T);const z=Math.max(2,r),w=MQ("X",i.theme.colors.axes.x,{size:5});w.position.set(t+z,0,0);const o=MQ("Y",i.theme.colors.axes.y,{size:5});o.position.set(0,e+z,0);const a=MQ("Z",i.theme.colors.axes.z,{size:5});return a.position.set(0,0,P+z),Q.add(w,o,a),Q}function BP(i){i.traverse(Q=>{var B;if(Q instanceof h.Line){Q.geometry.dispose();const t=Q.material;Array.isArray(t)?t.forEach(A=>A.dispose()):t.dispose();return}if(Q instanceof h.Sprite){const t=Q.material;(B=t.map)==null||B.dispose(),t.dispose()}})}function tP(i){const Q=new h.Group,{minX:B,maxX:t,minY:A,maxY:e}=Ut(i),P=i.units==="mm"?10:1,r=P*2,s=i.units==="mm"?1:UA,v=.5,c=4,n=.1,T=5,z=i.theme.colors.axes.x,w=i.theme.colors.axes.y,o={opacity:v,size:c};for(let a=P;;a+=r){const E=a*s;if(E>t+1e-6)break;const l=MQ(String(a),z,o);l.position.set(E,T,n),Q.add(l)}for(let a=P;;a+=r){const E=a*s;if(-E<B-1e-6)break;const l=MQ(String(-a),z,o);l.position.set(-E,T,n),Q.add(l)}for(let a=P;;a+=r){const E=a*s;if(E>e+1e-6)break;const l=MQ(String(a),w,o);l.position.set(-T,E,n),Q.add(l)}for(let a=P;;a+=r){const E=a*s;if(-E<A-1e-6)break;const l=MQ(String(-a),w,o);l.position.set(-T,-E,n),Q.add(l)}return Q}function dQ(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function DA(i,Q){i.prototype=Object.create(Q.prototype),i.prototype.constructor=i,i.__proto__=Q}/*!
|
|
2
2
|
* GSAP 3.15.0
|
|
3
3
|
* https://gsap.com
|
|
4
4
|
*
|
package/dist/react.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react"),F=require("./GCodeSVGRenderer-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react"),F=require("./GCodeSVGRenderer-cMM0mATa.cjs");function C(a){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const s in a)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(a,s);Object.defineProperty(d,s,i.get?i:{enumerable:!0,get:()=>a[s]})}}return d.default=a,Object.freeze(d)}const o=C(V),G=o.forwardRef(function(d,s){const{id:i,options:l,callbacks:c,className:p,style:m}=d,u=o.useRef(null),r=o.useRef(null);return o.useEffect(()=>{const e=u.current;if(!e)return;const f=new F.GCodeViewer({id:i,container:e,options:l,callbacks:c});return r.current=f,()=>{r.current=null,f.dispose()}},[i]),o.useEffect(()=>{var e;(e=r.current)==null||e.setOptions(l??{})},[l]),o.useEffect(()=>{var e;(e=r.current)==null||e.setCallbacks(c??{})},[c]),o.useImperativeHandle(s,()=>{const e=()=>{const t=r.current;if(!t)throw new Error("GCodeViewer is not ready.");return t};return{get id(){return i},setCallbacks(t){e().setCallbacks(t)},snapCameraToView(t,n){e().snapCameraToView(t,n)},setRotateEnabled(t){e().setRotateEnabled(t)},setCameraFollowEnabled(t){e().setCameraFollowEnabled(t)},screenToWorld(t,n,w){return e().screenToWorld(t,n,w)},worldToScreen(t,n,w){return e().worldToScreen(t,n,w)},setBitPosition(t,n){e().setBitPosition(t,n)},setBitVisible(t){e().setBitVisible(t)},setBitSpinning(t){e().setBitSpinning(t)},setToolpathRotationA(t){e().setToolpathRotationA(t)},hideUntilLine(t,n){e().hideUntilLine(t,n)},seekToLine(t,n){e().seekToLine(t,n)},showAll(){e().showAll()},resetColors(){e().resetColors()},loadFromUrl(t,n){return e().loadFromUrl(t,n)},loadFromFile(t){return e().loadFromFile(t)},loadFromText(t){return e().loadFromText(t)},loadFromLines(t){return e().loadFromLines(t)},loadFromWorkerData(t){return e().loadFromWorkerData(t)},unload(){e().unload()},setOptions(t){e().setOptions(t)},getOptions(){return e().getOptions()},resize(){e().resize()},focusToModel(){e().focusToModel()},resetCamera(){e().resetCamera()},getBounds(){return e().getBounds()},dispose(){e().dispose()}}},[i]),o.createElement("div",{ref:u,className:p,style:m})}),b=o.forwardRef(function(d,s){const{id:i,options:l,className:c,style:p}=d,m=o.useRef(null),u=o.useRef(null);return o.useEffect(()=>{const r=m.current;if(!r)return;const e=new F.GCodeSVGRenderer(r,l);return u.current=e,()=>{u.current=null,e.dispose()}},[]),o.useEffect(()=>{var r;l&&((r=u.current)==null||r.setOptions(l))},[l]),o.useImperativeHandle(s,()=>{const r=()=>{const e=u.current;if(!e)throw new Error("GCodeSVGRenderer is not ready.");return e};return{loadFromLines:e=>r().loadFromLines(e),loadFromFile:e=>r().loadFromFile(e),loadFromText:e=>r().loadFromText(e),loadFromWorkerData:e=>r().loadFromWorkerData(e),loadFromPrecomputedGroups:(e,f)=>r().loadFromPrecomputedGroups(e,f),clear:()=>r().clear(),resetView:()=>r().resetView(),setOptions:e=>r().setOptions(e),setProjectionMode:e=>r().setProjectionMode(e),setBitPosition:e=>r().setBitPosition(e),setBitVisible:e=>r().setBitVisible(e),getSVGElement:()=>r().getSVGElement(),dispose:()=>r().dispose()}},[]),o.createElement("div",{ref:m,className:c,style:{width:"100%",height:"100%",...p}})});exports.GCodeSVGVisualizer=b;exports.GCodeVisualizer=G;
|
package/dist/react.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as o from "react";
|
|
2
|
-
import { a as w, G as V } from "./GCodeSVGRenderer-
|
|
2
|
+
import { a as w, G as V } from "./GCodeSVGRenderer-Da9_qYpG.js";
|
|
3
3
|
const G = o.forwardRef(
|
|
4
4
|
function(c, m) {
|
|
5
5
|
const { id: l, options: n, callbacks: a, className: f, style: u } = c, i = o.useRef(null), t = o.useRef(null);
|
package/dist/viewcube.css
CHANGED
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.gViewer-viewcube__face.is-active{
|
|
44
|
-
border-color: rgba(
|
|
45
|
-
box-shadow: 0 0 0 1px rgba(
|
|
46
|
-
color: rgba(
|
|
44
|
+
border-color: rgba(96,165,250,0.95);
|
|
45
|
+
box-shadow: 0 0 0 1px rgba(96,165,250,0.35), 0 10px 30px rgba(0,0,0,0.35);
|
|
46
|
+
color: rgba(96,165,250,0.95);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.gViewer-viewcube__face--front{ transform: translateZ(42px); }
|
package/dist/viewer.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./GCodeSVGRenderer-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./GCodeSVGRenderer-cMM0mATa.cjs"),a={dark:{background:"#111827",opacity:.9,rapidOpacity:.3,colors:{rapid:"#0ef6ae",cutting:"#3e85c7",laser:"#a855f7",processed:"#6b7280",boundingBox:"#e2e8f0",machineBed:"#f5a623",machineBedKeepout:"#df3b3b",grid:{major:"#77a9d7",minor:"#3e6e9e"},axes:{x:"#df3b3b",y:"#06b881",z:"#295d8d"}}},light:{background:"#e5e7eb",opacity:.9,rapidOpacity:.3,colors:{rapid:"#295d8d",cutting:"#111827",laser:"#FF0000",processed:"#9ca3af",boundingBox:"#4b5563",machineBed:"#b45309",machineBedKeepout:"#df3b3b",grid:{major:"#295d8d",minor:"#5191cc"},axes:{x:"#df3b3b",y:"#06b881",z:"#295d8d"}}},"flexoki-dark":{background:"#100f0f",opacity:.9,rapidOpacity:.3,colors:{rapid:"#DA702C",cutting:"#3AA99F",laser:"#8B7EC8",processed:"#6f6e69",boundingBox:"#cecdc3",machineBed:"#ffcc66",machineBedKeepout:"#d14d41",grid:{major:"#a89984",minor:"#6f6e69"},axes:{x:"#d14d41",y:"#879a39",z:"#4385be"}}},"tokyo-night":{background:"#1a1b26",opacity:.9,rapidOpacity:.3,colors:{rapid:"#ff9e64",cutting:"#7dcfff",laser:"#bb9af7",processed:"#565f89",boundingBox:"#c0caf5",machineBed:"#e0af68",machineBedKeepout:"#f7768e",grid:{major:"#7aa2f7",minor:"#414868"},axes:{x:"#f7768e",y:"#9ece6a",z:"#7aa2f7"}}},"gruvbox-light":{background:"#fbf1c7",opacity:.9,rapidOpacity:.3,colors:{rapid:"#d65d0e",cutting:"#3c3836",laser:"#b16286",processed:"#928374",boundingBox:"#7c6f64",machineBed:"#d79921",machineBedKeepout:"#cc241d",grid:{major:"#7c6f64",minor:"#a89984"},axes:{x:"#cc241d",y:"#98971a",z:"#458588"}}},"ayu-dark":{background:"#0b0e14",opacity:.9,rapidOpacity:.3,colors:{rapid:"#FFA659",cutting:"#73D0FF",laser:"#DFBFFF",processed:"#6E7C8F",boundingBox:"#CBCCC6",machineBed:"#FFD173",machineBedKeepout:"#F28779",grid:{major:"#77a9d7",minor:"#3e6590"},axes:{x:"#F28779",y:"#D5FF80",z:"#5CCFE6"}}},"ayu-light":{background:"#fafafa",opacity:.9,rapidOpacity:.3,colors:{rapid:"#FA8D3E",cutting:"#22A4E6",laser:"#A37ACC",processed:"#ADAEB1",boundingBox:"#5C6773",machineBed:"#F2AE49",machineBedKeepout:"#F07171",grid:{major:"#5c6773",minor:"#9aacba"},axes:{x:"#F07171",y:"#86B300",z:"#55B4D4"}}}};exports.GCodeSVGRenderer=e.GCodeSVGRenderer;exports.GCodeViewer=e.GCodeViewer;exports.ViewCube=e.ViewCube;exports.defaultGCodeViewerOptions=e.defaultGCodeViewerOptions;exports.defaultGCodeViewerTheme=e.defaultGCodeViewerTheme;exports.gCodeViewerThemePresets=a;
|
package/dist/viewer.js
CHANGED