PageSourceSearch

https://scanruler.stefan-755.workers.dev/assets/dxf-O47yLK0c.js

js scanruler.stefan-755.workers.dev collected 2026-10-03 08:10:08 UTC 6,130 bytes, 4 lines download raw bytes

1import{s as j,p as v,b as Z,a as q}from"./index-DoWuw9R-.js";import{l as Q,d as ee,n as L,D as te}from"./drawing-DvYnk0bX.js";const ie={mm:.01,px:.25},m={edges:"edges",elements:"elements",labels:"labels"},O="1F",e=(n,s)=>`${String(n).padStart(3)}
2${s}`,ne={Ø:"%%c","°":"%%d","±":"%%p"};function F(n){let s="";for(const E of n.replace(/\s*·\s*/g,", ")){const D=E.codePointAt(0);s+=D<127?E:ne[E]??`\\U+${D.toString(16).toUpperCase().padStart(4,"0")}`}return s}const g=n=>e(999,F(n.replace(/—/g,"-").replace(/×/g,"x")));function X(n){const s=/^#([0-9a-f]{6})$/i.exec(n.trim());return s?parseInt(s[1],16):null}function oe(n){const s=(l,d,r,C,p=[])=>[e(0,"TABLE"),e(2,l),e(5,d),e(330,"0"),e(100,"AcDbSymbolTable"),e(70,r),...p,...C,e(0,"ENDTAB")],E=(l,d,r,C,p)=>[e(0,l),e(5,d),e(330,r),e(100,"AcDbSymbolTableRecord"),e(100,C),...p],D=(l,d,r)=>E("LTYPE",l,"5","AcDbLinetypeTableRecord",[e(2,d),e(70,0),e(3,r),e(72,65),e(73,0),e(40,0)]);return[e(0,"SECTION"),e(2,"TABLES"),...s("VPORT","8",0,[]),...s("LTYPE","5",3,[...D("14","BYBLOCK",""),...D("15","BYLAYER",""),...D("16","CONTINUOUS","Solid line")]),...s("LAYER","2",4,n),...s("STYLE","3",1,E("STYLE","11","3","AcDbTextStyleTableRecord",[e(2,"STANDARD"),e(70,0),e(40,0),e(41,1),e(50,0),e(71,0),e(42,2.5),e(3,"txt"),e(4,"")])),...s("VIEW","6",0,[]),...s("UCS","7",0,[]),...s("APPID","9",1,E("APPID","12","9","AcDbRegAppTableRecord",[e(2,"ACAD"),e(70,0)])),...s("DIMSTYLE","A",0,[],[e(100,"AcDbDimStyleTable")]),...s("BLOCK_RECORD","1",2,[...E("BLOCK_RECORD",O,"1","AcDbBlockTableRecord",[e(2,"*MODEL_SPACE")]),...E("BLOCK_RECORD","1B","1","AcDbBlockTableRecord",[e(2,"*PAPER_SPACE")])]),e(0,"ENDSEC")]}const ce=[e(0,"SECTION"),e(2,"BLOCKS"),e(0,"BLOCK"),e(5,"20"),e(330,O),e(100,"AcDbEntity"),e(8,"0"),e(100,"AcDbBlockBegin"),e(2,"*MODEL_SPACE"),e(70,0),e(10,0),e(20,0),e(30,0),e(3,"*MODEL_SPACE"),e(1,""),e(0,"ENDBLK"),e(5,"21"),e(330,O),e(100,"AcDbEntity"),e(8,"0"),e(100,"AcDbBlockEnd"),e(0,"BLOCK"),e(5,"1C"),e(330,"1B"),e(100,"AcDbEntity"),e(67,1),e(8,"0"),e(100,"AcDbBlockBegin"),e(2,"*PAPER_SPACE"),e(70,0),e(10,0),e(20,0),e(30,0),e(3,"*PAPER_SPACE"),e(1,""),e(0,"ENDBLK"),e(5,"1D"),e(330,"1B"),e(100,"AcDbEntity"),e(67,1),e(8,"0"),e(100,"AcDbBlockEnd"),e(0,"ENDSEC")],se=[e(0,"SECTION"),e(2,"OBJECTS"),e(0,"DICTIONARY"),e(5,"C"),e(330,"0"),e(100,"AcDbDictionary"),e(281,1),e(3,"ACAD_GROUP"),e(350,"D"),e(0,"DICTIONARY"),e(5,"D"),e(330,"C"),e(100,"AcDbDictionary"),e(281,1),e(0,"ENDSEC")];function Ee(n){const s=j(n.alignDir,n.turns,n.mirror),E=v(s),D=n.origin??[0,0],l=t=>E([t[0]-D[0],t[1]-D[1]]),d=n.unit==="mm"?4:3,r=t=>L(t,d),C=t=>{const c=(s.mirror?s.roll-t:s.roll+t)*180/Math.PI;return L((c%360+360)%360,6)},{min:p,max:R}=n.bounds,u=[l(p),l(R),l([p[0],R[1]]),l([R[0],p[1]])],P=Math.min(...u.map(t=>t[0])),B=Math.max(...u.map(t=>t[0])),x=Math.min(...u.map(t=>t[1])),$=Math.max(...u.map(t=>t[1])),N=Math.hypot(B-P,$-x)||1,M=N*.011,W=N*.012;let _=256;const f=()=>(_++).toString(16).toUpperCase(),A=(t,c)=>[e(t,r(c[0])),e(t+10,r(c[1])),e(t+20,0)],y=[],I=(t,c,o,i)=>{y.push(e(0,t),e(5,f()),e(330,O),e(100,"AcDbEntity"),e(8,c)),o!==null&&y.push(e(420,o)),y.push(...i)};if(n.chains){const{points:t,offsets:c}=n.chains,{x:o,y:i}=n.chainUnit,b=n.edgeTolerance/Math.max(o,i);for(let a=0;a+1<c.length;a++){const T=c[a],S=c[a+1];if(S-T<2)continue;const Y=S-T>3&&t[T*2]===t[(S-1)*2]&&t[T*2+1]===t[(S-1)*2+1],K=Z(t,T,Y?S-1:S,b),k=[e(100,"AcDbPolyline"),e(90,K.length),e(70,Y?1:0)];for(const G of K){const[H,J]=l([t[G*2]*o,t[G*2+1]*i]);k.push(e(10,r(H)),e(20,r(J)))}I("LWPOLYLINE",m.edges,null,k)}}const w=t=>{switch(t.kind){case"point":return[{type:"POINT",body:[e(100,"AcDbPoint"),...A(10,l(t.at))]}];case"line":{const[c,o]=t.center,[i,b]=t.dir,a=t.length/2;return[{type:"LINE",body:[e(100,"AcDbLine"),...A(10,l([c-i*a,o-b*a])),...A(11,l([c+i*a,o+b*a]))]}]}case"circle":return[{type:"CIRCLE",body:[e(100,"AcDbCircle"),...A(10,l(t.center)),e(40,r(t.radius))]}];case"arc":{if(t.sweep>=2*Math.PI-1e-6)return[{type:"CIRCLE",body:[e(100,"AcDbCircle"),...A(10,l(t.center)),e(40,r(t.radius))]}];const c=t.start+t.sweep;return[{type:"ARC",body:[e(100,"AcDbCircle"),...A(10,l(t.center)),e(40,r(t.radius)),e(100,"AcDbArc"),e(50,C(s.mirror?c:t.start)),e(51,C(s.mirror?t.start:c))]}]}case"spline":{const{poles:c,knots:o}=q(t),i=[o[0],o[0],o[0],o[0],...o.slice(1,-1).flatMap(a=>[a,a,a]),o[o.length-1],o[o.length-1],o[o.length-1],o[o.length-1]];return[{type:"SPLINE",body:[e(100,"AcDbSpline"),e(70,8),e(71,3),e(72,i.length),e(73,c.length),e(74,0),...i.map(a=>e(40,L(a,6))),...c.flatMap(a=>A(10,l(a)))]}]}}},U=(t,c,o)=>{c!==""&&I("TEXT",m.labels,o,[e(100,"AcDbText"),...A(10,t),e(40,r(M)),e(1,F(c)),e(100,"AcDbText")])};for(const t of n.elements){const c=X(t.color);for(const b of w(t.fit))I(b.type,m.elements,c,b.body);const[o,i]=l(Q(t.fit,N));U([o,i+1.2*M],t.name,c),U([o,i],t.value,c)}const h=(t,c,o)=>[e(0,"LAYER"),e(5,f()),e(330,"2"),e(100,"AcDbSymbolTableRecord"),e(100,"AcDbLayerTableRecord"),e(2,t),e(70,0),e(62,c),...o===null?[]:[e(420,o)],e(6,"CONTINUOUS")],V=[...h("0",7,null),...h(m.edges,4,X(te)),...h(m.elements,7,null),...h(m.labels,7,null)],z=n.unit==="mm"?"millimetre":"image pixel";return[...[g(n.title),g(n.scaleNote),g(`One unit is one ${z}; y up;
2 the origin is ${n.origin?"the alignment's origin":"the sheet's own origin"}${ee(n.alignDir,n.turns,n.mirror).replace(/^, /,"; ")}`),g(`Layers: edges (the detected edge chains${n.edgeTolerance>0?`, thinned to ${L(n.edgeTolerance,4)} ${n.unit}`:""}), elements (the fitted geometry), labels`),e(0,"SECTION"),e(2,"HEADER"),e(9,"$ACADVER"),e(1,"AC1015"),e(9,"$DWGCODEPAGE"),e(3,"ANSI_1252"),e(9,"$INSBASE"),e(10,0),e(20,0),e(30,0),e(9,"$EXTMIN"),e(10,r(P)),e(20,r(x)),e(30,0),e(9,"$EXTMAX"),e(10,r(B)),e(20,r($)),e(30,0),e(9,"$INSUNITS"),e(70,n.unit==="mm"?4:0),e(9,"$MEASUREMENT"),e(70,1),e(9,"$LUNITS"),e(70,2),e(9,"$LUPREC"),e(70,4),e(9,"$PDMODE"),e(70,3),e(9,"$PDSIZE"),e(40,r(W)),e(9,"$HANDSEED"),e(5,_.toString(16).toUpperCase()),e(0,"ENDSEC")],...oe(V),...ce,e(0,"SECTION"),e(2,"ENTITIES"),...y,e(0,"ENDSEC"),...se,e(0,"EOF")].join(`
3`)+`
4`}export{ie as DXF_EDGE_TOLERANCE,m as DXF_LAYERS,Ee as buildFlatDxf,F as dxfText};

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