dxf-kit 1.0.0 → 1.0.1

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.
Files changed (3) hide show
  1. package/dist/index.cjs +3 -2117
  2. package/dist/index.mjs +3 -2117
  3. package/package.json +15 -5
package/dist/index.cjs CHANGED
@@ -1,2124 +1,10 @@
1
1
  'use strict';
2
2
 
3
- /**
4
- * ============================================================
5
- * dxf-kit/src/dxfParser.js — ESM 版
6
- *
7
- * 与你原来的 CJS 版相比,改动只有 3 处:
8
- * 1. 删掉顶部 const fs = require("fs").promises
9
- * 2. parseDxf 内部按需 import("fs")
10
- * 3. 底部 module.exports → export
11
- * ============================================================
12
- */
3
+ (function(_0x33571c,_0x5b016b){const _0x1466cc=_0x20a9,_0x1eaa89=_0x33571c();while(!![]){try{const _0x1112c4=parseInt(_0x1466cc(0x1b6))/0x1+-parseInt(_0x1466cc(0x20e))/0x2+-parseInt(_0x1466cc(0x149))/0x3*(-parseInt(_0x1466cc(0x1bd))/0x4)+-parseInt(_0x1466cc(0x14c))/0x5+parseInt(_0x1466cc(0x15e))/0x6+-parseInt(_0x1466cc(0x1c1))/0x7*(-parseInt(_0x1466cc(0x197))/0x8)+parseInt(_0x1466cc(0x11e))/0x9;if(_0x1112c4===_0x5b016b)break;else _0x1eaa89['push'](_0x1eaa89['shift']());}catch(_0x36d8b1){_0x1eaa89['push'](_0x1eaa89['shift']());}}}(_0x3bfb,0x949fe));function tokenize(_0x4bb59e){const _0x5b5884=_0x20a9,_0x233d0d=_0x4bb59e[_0x5b5884(0x19c)](/\r?\n/),_0x4528d7=[];for(let _0xd368d0=0x0;_0xd368d0+0x1<_0x233d0d[_0x5b5884(0x210)];_0xd368d0+=0x2){const _0x33e881=parseInt(_0x233d0d[_0xd368d0][_0x5b5884(0x130)](),0xa),_0x1a4e0d=_0x233d0d[_0xd368d0+0x1]['trim']();_0x4528d7[_0x5b5884(0x1a0)]({'code':_0x33e881,'value':_0x1a4e0d});}return _0x4528d7;}function autoConvert(_0x4e543a,_0x560bc4){if(_0x4e543a>=0xa&&_0x4e543a<=0x3b||_0x4e543a>=0x6e&&_0x4e543a<=0x95||_0x4e543a>=0xd2&&_0x4e543a<=0xef||_0x4e543a>=0x1cc&&_0x4e543a<=0x1d5||_0x4e543a>=0x3f2&&_0x4e543a<=0x423)return parseFloat(_0x560bc4);if(_0x4e543a>=0x3c&&_0x4e543a<=0x4f||_0x4e543a>=0x5a&&_0x4e543a<=0x63||_0x4e543a>=0xaa&&_0x4e543a<=0xb3||_0x4e543a>=0x10e&&_0x4e543a<=0x121||_0x4e543a>=0x172&&_0x4e543a<=0x185||_0x4e543a>=0x190&&_0x4e543a<=0x199||_0x4e543a>=0x424&&_0x4e543a<=0x437)return parseInt(_0x560bc4,0xa);return _0x560bc4;}function splitSections(_0x267907){const _0x287d15=_0x20a9,_0x3a0388={};let _0x5e2c6b=0x0;while(_0x5e2c6b<_0x267907[_0x287d15(0x210)]){if(_0x267907[_0x5e2c6b][_0x287d15(0x1c9)]===0x0&&_0x267907[_0x5e2c6b]['value']===_0x287d15(0x1af)){_0x5e2c6b++;const _0x1f7ac7=_0x267907[_0x5e2c6b][_0x287d15(0x183)];_0x5e2c6b++;const _0x15842a=_0x5e2c6b;while(_0x5e2c6b<_0x267907[_0x287d15(0x210)]&&!(_0x267907[_0x5e2c6b][_0x287d15(0x1c9)]===0x0&&_0x267907[_0x5e2c6b][_0x287d15(0x183)]===_0x287d15(0x190))){_0x5e2c6b++;}_0x3a0388[_0x1f7ac7]=_0x267907[_0x287d15(0x1e4)](_0x15842a,_0x5e2c6b),_0x5e2c6b++;}else _0x5e2c6b++;}return _0x3a0388;}function parseHeader(_0x231da6){const _0xbdece1=_0x20a9;if(!_0x231da6||_0x231da6['length']===0x0)return {};const _0x424c9a={};let _0x587af4=0x0;while(_0x587af4<_0x231da6[_0xbdece1(0x210)]){if(_0x231da6[_0x587af4][_0xbdece1(0x1c9)]===0x9){const _0x11f7e0=_0x231da6[_0x587af4][_0xbdece1(0x183)];_0x587af4++;const _0x35b1f6={};while(_0x587af4<_0x231da6[_0xbdece1(0x210)]&&_0x231da6[_0x587af4][_0xbdece1(0x1c9)]!==0x9&&_0x231da6[_0x587af4]['code']!==0x0){_0x35b1f6[_0x231da6[_0x587af4][_0xbdece1(0x1c9)]]=autoConvert(_0x231da6[_0x587af4][_0xbdece1(0x1c9)],_0x231da6[_0x587af4][_0xbdece1(0x183)]),_0x587af4++;}const _0x3c9424=Object[_0xbdece1(0x154)](_0x35b1f6);_0x424c9a[_0x11f7e0]=_0x3c9424[_0xbdece1(0x210)]===0x1?_0x35b1f6[_0x3c9424[0x0]]:_0x35b1f6;}else _0x587af4++;}return _0x424c9a;}function parseClasses(_0x403514){const _0x153fb9=_0x20a9;if(!_0x403514||_0x403514[_0x153fb9(0x210)]===0x0)return [];const _0x24b373=[];let _0x581610=0x0;while(_0x581610<_0x403514['length']){if(_0x403514[_0x581610]['code']===0x0&&_0x403514[_0x581610][_0x153fb9(0x183)]===_0x153fb9(0x121)){_0x581610++;const _0x1dda02={};while(_0x581610<_0x403514[_0x153fb9(0x210)]&&_0x403514[_0x581610][_0x153fb9(0x1c9)]!==0x0){switch(_0x403514[_0x581610][_0x153fb9(0x1c9)]){case 0x1:_0x1dda02[_0x153fb9(0x1ce)]=_0x403514[_0x581610][_0x153fb9(0x183)];break;case 0x2:_0x1dda02[_0x153fb9(0x182)]=_0x403514[_0x581610][_0x153fb9(0x183)];break;case 0x3:_0x1dda02['appName']=_0x403514[_0x581610][_0x153fb9(0x183)];break;case 0x5a:_0x1dda02[_0x153fb9(0x117)]=parseInt(_0x403514[_0x581610][_0x153fb9(0x183)],0xa);break;case 0x5b:_0x1dda02[_0x153fb9(0x19f)]=parseInt(_0x403514[_0x581610][_0x153fb9(0x183)],0xa);break;case 0x118:_0x1dda02[_0x153fb9(0x14b)]=parseInt(_0x403514[_0x581610][_0x153fb9(0x183)],0xa);break;case 0x119:_0x1dda02[_0x153fb9(0x193)]=parseInt(_0x403514[_0x581610][_0x153fb9(0x183)],0xa);break;default:_0x1dda02['code_'+_0x403514[_0x581610]['code']]=_0x403514[_0x581610][_0x153fb9(0x183)];}_0x581610++;}_0x24b373[_0x153fb9(0x1a0)](_0x1dda02);}else _0x581610++;}return _0x24b373;}function _0x20a9(_0x34c901,_0x421031){_0x34c901=_0x34c901-0x109;const _0x3bfb3d=_0x3bfb();let _0x20a941=_0x3bfb3d[_0x34c901];return _0x20a941;}function parseTables(_0x10e4d5){const _0x46ff47=_0x20a9;if(!_0x10e4d5||_0x10e4d5[_0x46ff47(0x210)]===0x0)return {};const _0x3262a8={};let _0x562a4a=0x0;while(_0x562a4a<_0x10e4d5[_0x46ff47(0x210)]){if(_0x10e4d5[_0x562a4a]['code']===0x0&&_0x10e4d5[_0x562a4a][_0x46ff47(0x183)]===_0x46ff47(0x11a)){_0x562a4a++;const _0x39926c=_0x10e4d5[_0x562a4a][_0x46ff47(0x183)];_0x562a4a++;const _0x9e42ec=_0x562a4a;while(_0x562a4a<_0x10e4d5[_0x46ff47(0x210)]&&!(_0x10e4d5[_0x562a4a][_0x46ff47(0x1c9)]===0x0&&_0x10e4d5[_0x562a4a][_0x46ff47(0x183)]===_0x46ff47(0x1b7))){_0x562a4a++;}_0x3262a8[_0x39926c]=parseTableEntries(_0x39926c,_0x10e4d5['slice'](_0x9e42ec,_0x562a4a)),_0x562a4a++;}else _0x562a4a++;}return _0x3262a8;}function parseTableEntries(_0x1d7098,_0x29ed88){const _0x25706c=_0x20a9,_0x47899b=[];let _0x198c7c=0x0;while(_0x198c7c<_0x29ed88[_0x25706c(0x210)]){if(_0x29ed88[_0x198c7c]['code']===0x0){const _0x3190ad=_0x29ed88[_0x198c7c][_0x25706c(0x183)];_0x198c7c++;const _0x4e5ffb={'_type':_0x3190ad};while(_0x198c7c<_0x29ed88[_0x25706c(0x210)]&&_0x29ed88[_0x198c7c][_0x25706c(0x1c9)]!==0x0){const _0x320e0e=_0x29ed88[_0x198c7c]['code'],_0x4b821b=autoConvert(_0x320e0e,_0x29ed88[_0x198c7c][_0x25706c(0x183)]);switch(_0x320e0e){case 0x2:_0x4e5ffb[_0x25706c(0x152)]=_0x4b821b;break;case 0x5:_0x4e5ffb[_0x25706c(0x179)]=_0x4b821b;break;case 0x6:_0x4e5ffb[_0x25706c(0x139)]=_0x4b821b;break;case 0x7:_0x4e5ffb[_0x25706c(0x17d)]=_0x4b821b;break;case 0x3e:_0x4e5ffb['colorNumber']=_0x4b821b;break;case 0x46:_0x4e5ffb[_0x25706c(0x1ee)]=_0x4b821b;break;case 0x28:_0x4e5ffb['height']=_0x4b821b;break;case 0x29:_0x4e5ffb[_0x25706c(0x1fe)]=_0x4b821b;break;case 0x32:_0x4e5ffb['angle']=_0x4b821b;break;case 0x64:_0x4e5ffb[_0x25706c(0x1b8)]=_0x4e5ffb[_0x25706c(0x1b8)]?[][_0x25706c(0x1f4)](_0x4e5ffb[_0x25706c(0x1b8)],_0x4b821b):_0x4b821b;break;case 0x14a:_0x4e5ffb[_0x25706c(0x10e)]=_0x4b821b;break;case 0x172:_0x4e5ffb[_0x25706c(0x199)]=_0x4b821b;break;case 0x186:_0x4e5ffb[_0x25706c(0x192)]=_0x4b821b;break;default:_0x4e5ffb[_0x25706c(0x1f2)+_0x320e0e]!==undefined?_0x4e5ffb[_0x25706c(0x1f2)+_0x320e0e]=[][_0x25706c(0x1f4)](_0x4e5ffb[_0x25706c(0x1f2)+_0x320e0e],_0x4b821b):_0x4e5ffb[_0x25706c(0x1f2)+_0x320e0e]=_0x4b821b;}_0x198c7c++;}_0x47899b[_0x25706c(0x1a0)](_0x4e5ffb);}else _0x198c7c++;}return _0x47899b;}function parseBlocks(_0x51302e){const _0x27aa13=_0x20a9;if(!_0x51302e||_0x51302e['length']===0x0)return [];const _0x4317bd=[];let _0x4676f4=0x0;while(_0x4676f4<_0x51302e[_0x27aa13(0x210)]){if(_0x51302e[_0x4676f4][_0x27aa13(0x1c9)]===0x0&&_0x51302e[_0x4676f4][_0x27aa13(0x183)]===_0x27aa13(0x1da)){_0x4676f4++;const _0x96f656={'entities':[]};while(_0x4676f4<_0x51302e['length']&&_0x51302e[_0x4676f4][_0x27aa13(0x1c9)]!==0x0){switch(_0x51302e[_0x4676f4][_0x27aa13(0x1c9)]){case 0x2:_0x96f656[_0x27aa13(0x152)]=_0x51302e[_0x4676f4][_0x27aa13(0x183)];break;case 0x3:_0x96f656['name2']=_0x51302e[_0x4676f4][_0x27aa13(0x183)];break;case 0x5:_0x96f656['handle']=_0x51302e[_0x4676f4][_0x27aa13(0x183)];break;case 0x8:_0x96f656[_0x27aa13(0x15f)]=_0x51302e[_0x4676f4]['value'];break;case 0xa:_0x96f656[_0x27aa13(0x153)]=parseFloat(_0x51302e[_0x4676f4][_0x27aa13(0x183)]);break;case 0x14:_0x96f656[_0x27aa13(0x19b)]=parseFloat(_0x51302e[_0x4676f4][_0x27aa13(0x183)]);break;case 0x1e:_0x96f656['basePointZ']=parseFloat(_0x51302e[_0x4676f4][_0x27aa13(0x183)]);break;case 0x46:_0x96f656[_0x27aa13(0x1ee)]=parseInt(_0x51302e[_0x4676f4][_0x27aa13(0x183)],0xa);break;case 0x64:break;case 0x14a:_0x96f656[_0x27aa13(0x10e)]=_0x51302e[_0x4676f4][_0x27aa13(0x183)];break;default:_0x96f656[_0x27aa13(0x1f2)+_0x51302e[_0x4676f4][_0x27aa13(0x1c9)]]=_0x51302e[_0x4676f4]['value'];}_0x4676f4++;}const _0x56feaf=[];while(_0x4676f4<_0x51302e[_0x27aa13(0x210)]&&!(_0x51302e[_0x4676f4][_0x27aa13(0x1c9)]===0x0&&_0x51302e[_0x4676f4][_0x27aa13(0x183)]===_0x27aa13(0x1cd))){_0x56feaf[_0x27aa13(0x1a0)](_0x51302e[_0x4676f4]),_0x4676f4++;}if(_0x56feaf[_0x27aa13(0x210)]>0x0)_0x96f656[_0x27aa13(0x10b)]=parseEntityList(_0x56feaf);if(_0x4676f4<_0x51302e[_0x27aa13(0x210)]){_0x4676f4++;while(_0x4676f4<_0x51302e[_0x27aa13(0x210)]&&_0x51302e[_0x4676f4][_0x27aa13(0x1c9)]!==0x0)_0x4676f4++;}_0x4317bd[_0x27aa13(0x1a0)](_0x96f656);}else _0x4676f4++;}return _0x4317bd;}function parseEntityList(_0x3a01cb){const _0x275be0=_0x20a9,_0x5e62a0=[];let _0x543f8a=0x0;while(_0x543f8a<_0x3a01cb[_0x275be0(0x210)]){if(_0x3a01cb[_0x543f8a][_0x275be0(0x1c9)]===0x0){const _0x503af8=_0x3a01cb[_0x543f8a][_0x275be0(0x183)];_0x543f8a++;const _0x4a9458=[];while(_0x543f8a<_0x3a01cb[_0x275be0(0x210)]&&_0x3a01cb[_0x543f8a][_0x275be0(0x1c9)]!==0x0){_0x4a9458['push'](_0x3a01cb[_0x543f8a]),_0x543f8a++;}const _0x529bf8=parseOneEntity(_0x503af8,_0x4a9458);if(_0x529bf8)_0x5e62a0[_0x275be0(0x1a0)](_0x529bf8);}else _0x543f8a++;}return _0x5e62a0;}function parseOneEntity(_0x27b1f1,_0x330a29){const _0xfacd16=_0x20a9,_0x13b109={'type':_0x27b1f1};for(const _0x4c08b7 of _0x330a29){switch(_0x4c08b7[_0xfacd16(0x1c9)]){case 0x5:_0x13b109[_0xfacd16(0x179)]=_0x4c08b7[_0xfacd16(0x183)];break;case 0x8:_0x13b109[_0xfacd16(0x15f)]=_0x4c08b7['value'];break;case 0x6:_0x13b109[_0xfacd16(0x139)]=_0x4c08b7[_0xfacd16(0x183)];break;case 0x30:_0x13b109[_0xfacd16(0x172)]=parseFloat(_0x4c08b7[_0xfacd16(0x183)]);break;case 0x3c:_0x13b109[_0xfacd16(0x1bb)]=parseInt(_0x4c08b7['value'],0xa)===0x0;break;case 0x3e:_0x13b109[_0xfacd16(0x160)]=parseInt(_0x4c08b7['value'],0xa);break;case 0x43:_0x13b109['inPaperSpace']=parseInt(_0x4c08b7[_0xfacd16(0x183)],0xa)===0x1;break;case 0x14a:_0x13b109[_0xfacd16(0x10e)]=_0x4c08b7[_0xfacd16(0x183)];break;case 0x172:_0x13b109['lineweight']=parseInt(_0x4c08b7[_0xfacd16(0x183)],0xa);break;case 0x1a4:_0x13b109[_0xfacd16(0x1c0)]=parseInt(_0x4c08b7[_0xfacd16(0x183)],0xa);break;}}switch(_0x27b1f1){case _0xfacd16(0x11b):return parseLineEntity(_0x13b109,_0x330a29);case _0xfacd16(0x208):return parseLWPolylineEntity(_0x13b109,_0x330a29);case _0xfacd16(0x1ff):return parsePolylineEntity(_0x13b109,_0x330a29);case _0xfacd16(0x19a):return parseVertexEntity(_0x13b109,_0x330a29);case 'ARC':return parseArcEntity(_0x13b109,_0x330a29);case _0xfacd16(0x1ea):return parseCircleEntity(_0x13b109,_0x330a29);case _0xfacd16(0x18a):return parseEllipseEntity(_0x13b109,_0x330a29);case _0xfacd16(0x1cf):return parsePointEntity(_0x13b109,_0x330a29);case 'TEXT':return parseTextEntity(_0x13b109,_0x330a29);case _0xfacd16(0x1a4):return parseMTextEntity(_0x13b109,_0x330a29);case 'ATTRIB':return parseAttribEntity(_0x13b109,_0x330a29);case _0xfacd16(0x1d9):return parseAttribEntity(_0x13b109,_0x330a29);case _0xfacd16(0x146):return parseInsertEntity(_0x13b109,_0x330a29);case _0xfacd16(0x1ed):return parseDimensionEntity(_0x13b109,_0x330a29);case 'LEADER':return parseLeaderEntity(_0x13b109,_0x330a29);case 'MLEADER':return parseMLeaderEntity(_0x13b109,_0x330a29);case _0xfacd16(0x17b):return parseHatchEntity(_0x13b109,_0x330a29);case _0xfacd16(0x1f5):return parseSplineEntity(_0x13b109,_0x330a29);case _0xfacd16(0x13c):case _0xfacd16(0x184):case _0xfacd16(0x188):return parseSolidEntity(_0x13b109,_0x330a29);case _0xfacd16(0x1f7):return parse3DFaceEntity(_0x13b109,_0x330a29);case _0xfacd16(0x1a8):case _0xfacd16(0x1a7):return parseRayEntity(_0x13b109,_0x330a29);case 'VIEWPORT':return parseViewportEntity(_0x13b109,_0x330a29);case _0xfacd16(0x1a6):case 'WIPEOUT':return parseImageEntity(_0x13b109,_0x330a29);case 'TOLERANCE':return parseToleranceEntity(_0x13b109,_0x330a29);case _0xfacd16(0x119):return parseHelixEntity(_0x13b109,_0x330a29);case _0xfacd16(0x1bf):return parseMeshEntity(_0x13b109,_0x330a29);case _0xfacd16(0x133):case 'BODY':case _0xfacd16(0x1a9):return parseRegionEntity(_0x13b109,_0x330a29);case _0xfacd16(0x13a):return parseOle2Entity(_0x13b109,_0x330a29);case _0xfacd16(0x11a):return parseTableEntity(_0x13b109,_0x330a29);case _0xfacd16(0x1b9):return parseMLineEntity(_0x13b109,_0x330a29);case _0xfacd16(0x181):return _0x13b109;default:return parseGenericEntity(_0x13b109,_0x330a29);}}function parseLineEntity(_0x163cd8,_0x564b37){const _0x2821aa=_0x20a9;_0x163cd8[_0x2821aa(0x166)]={'x':0x0,'y':0x0,'z':0x0},_0x163cd8[_0x2821aa(0x1e9)]={'x':0x0,'y':0x0,'z':0x0},_0x163cd8[_0x2821aa(0x1a1)]=0x0,_0x163cd8['extrusionDirection']={'x':0x0,'y':0x0,'z':0x1};for(const _0x5e074e of _0x564b37){switch(_0x5e074e[_0x2821aa(0x1c9)]){case 0xa:_0x163cd8[_0x2821aa(0x166)]['x']=parseFloat(_0x5e074e[_0x2821aa(0x183)]);break;case 0x14:_0x163cd8[_0x2821aa(0x166)]['y']=parseFloat(_0x5e074e[_0x2821aa(0x183)]);break;case 0x1e:_0x163cd8[_0x2821aa(0x166)]['z']=parseFloat(_0x5e074e[_0x2821aa(0x183)]);break;case 0xb:_0x163cd8[_0x2821aa(0x1e9)]['x']=parseFloat(_0x5e074e['value']);break;case 0x15:_0x163cd8[_0x2821aa(0x1e9)]['y']=parseFloat(_0x5e074e[_0x2821aa(0x183)]);break;case 0x1f:_0x163cd8[_0x2821aa(0x1e9)]['z']=parseFloat(_0x5e074e[_0x2821aa(0x183)]);break;case 0x27:_0x163cd8['thickness']=parseFloat(_0x5e074e[_0x2821aa(0x183)]);break;case 0xd2:_0x163cd8[_0x2821aa(0x1ca)]['x']=parseFloat(_0x5e074e[_0x2821aa(0x183)]);break;case 0xdc:_0x163cd8[_0x2821aa(0x1ca)]['y']=parseFloat(_0x5e074e['value']);break;case 0xe6:_0x163cd8[_0x2821aa(0x1ca)]['z']=parseFloat(_0x5e074e['value']);break;}}return _0x163cd8;}function parseLWPolylineEntity(_0x3ad2d1,_0x1afda0){const _0x47f76c=_0x20a9;_0x3ad2d1['closed']=![],_0x3ad2d1[_0x47f76c(0x1b3)]=0x0,_0x3ad2d1['elevation']=0x0,_0x3ad2d1['thickness']=0x0,_0x3ad2d1[_0x47f76c(0x1a2)]=[],_0x3ad2d1[_0x47f76c(0x1ca)]={'x':0x0,'y':0x0,'z':0x1};let _0xe6da1c=null;for(const _0x23248c of _0x1afda0){switch(_0x23248c[_0x47f76c(0x1c9)]){case 0x46:_0x3ad2d1['closed']=(parseInt(_0x23248c[_0x47f76c(0x183)],0xa)&0x1)===0x1;break;case 0x26:_0x3ad2d1['elevation']=parseFloat(_0x23248c[_0x47f76c(0x183)]);break;case 0x27:_0x3ad2d1[_0x47f76c(0x1a1)]=parseFloat(_0x23248c[_0x47f76c(0x183)]);break;case 0x2b:_0x3ad2d1['constantWidth']=parseFloat(_0x23248c[_0x47f76c(0x183)]);break;case 0x5a:_0x3ad2d1[_0x47f76c(0x1d3)]=parseInt(_0x23248c[_0x47f76c(0x183)],0xa);break;case 0xa:if(_0xe6da1c)_0x3ad2d1[_0x47f76c(0x1a2)][_0x47f76c(0x1a0)](_0xe6da1c);_0xe6da1c={'x':parseFloat(_0x23248c['value']),'y':0x0,'bulge':0x0,'startWidth':0x0,'endWidth':0x0};break;case 0x14:if(_0xe6da1c)_0xe6da1c['y']=parseFloat(_0x23248c[_0x47f76c(0x183)]);break;case 0x28:if(_0xe6da1c)_0xe6da1c[_0x47f76c(0x1c4)]=parseFloat(_0x23248c[_0x47f76c(0x183)]);break;case 0x29:if(_0xe6da1c)_0xe6da1c[_0x47f76c(0x204)]=parseFloat(_0x23248c['value']);break;case 0x2a:if(_0xe6da1c)_0xe6da1c[_0x47f76c(0x200)]=parseFloat(_0x23248c['value']);break;case 0xd2:_0x3ad2d1[_0x47f76c(0x1ca)]['x']=parseFloat(_0x23248c[_0x47f76c(0x183)]);break;case 0xdc:_0x3ad2d1['extrusionDirection']['y']=parseFloat(_0x23248c['value']);break;case 0xe6:_0x3ad2d1[_0x47f76c(0x1ca)]['z']=parseFloat(_0x23248c[_0x47f76c(0x183)]);break;}}if(_0xe6da1c)_0x3ad2d1[_0x47f76c(0x1a2)]['push'](_0xe6da1c);return _0x3ad2d1;}function parsePolylineEntity(_0x5322d8,_0x5cc070){const _0x58946d=_0x20a9;_0x5322d8[_0x58946d(0x150)]=![],_0x5322d8['is3DPolyline']=![],_0x5322d8[_0x58946d(0x1c5)]=![],_0x5322d8['isPolyfaceMesh']=![],_0x5322d8[_0x58946d(0x113)]=0x0,_0x5322d8['meshNVertexCount']=0x0,_0x5322d8[_0x58946d(0x18b)]=0x0,_0x5322d8[_0x58946d(0x1f8)]=0x0,_0x5322d8[_0x58946d(0x132)]=0x0,_0x5322d8[_0x58946d(0x1a2)]=[];for(const _0x47e761 of _0x5cc070){switch(_0x47e761[_0x58946d(0x1c9)]){case 0xa:_0x5322d8[_0x58946d(0x187)]=parseFloat(_0x47e761[_0x58946d(0x183)]);break;case 0x14:_0x5322d8[_0x58946d(0x12c)]=parseFloat(_0x47e761['value']);break;case 0x1e:_0x5322d8[_0x58946d(0x132)]=parseFloat(_0x47e761['value']);break;case 0x27:_0x5322d8['thickness']=parseFloat(_0x47e761['value']);break;case 0x28:_0x5322d8[_0x58946d(0x18b)]=parseFloat(_0x47e761[_0x58946d(0x183)]);break;case 0x29:_0x5322d8[_0x58946d(0x1f8)]=parseFloat(_0x47e761[_0x58946d(0x183)]);break;case 0x46:{const _0x5aea98=parseInt(_0x47e761[_0x58946d(0x183)],0xa);_0x5322d8[_0x58946d(0x150)]=(_0x5aea98&0x1)===0x1,_0x5322d8['is3DPolyline']=(_0x5aea98&0x8)===0x8,_0x5322d8[_0x58946d(0x1c5)]=(_0x5aea98&0x10)===0x10,_0x5322d8[_0x58946d(0x216)]=(_0x5aea98&0x40)===0x40,_0x5322d8[_0x58946d(0x1ee)]=_0x5aea98;break;}case 0x47:_0x5322d8[_0x58946d(0x113)]=parseInt(_0x47e761[_0x58946d(0x183)],0xa);break;case 0x48:_0x5322d8[_0x58946d(0x1d1)]=parseInt(_0x47e761['value'],0xa);break;case 0xd2:(_0x5322d8[_0x58946d(0x1ca)]=_0x5322d8[_0x58946d(0x1ca)]||{})['x']=parseFloat(_0x47e761['value']);break;case 0xdc:(_0x5322d8[_0x58946d(0x1ca)]=_0x5322d8[_0x58946d(0x1ca)]||{})['y']=parseFloat(_0x47e761[_0x58946d(0x183)]);break;case 0xe6:(_0x5322d8[_0x58946d(0x1ca)]=_0x5322d8[_0x58946d(0x1ca)]||{})['z']=parseFloat(_0x47e761[_0x58946d(0x183)]);break;}}return _0x5322d8;}function parseVertexEntity(_0x454dff,_0x1b210d){const _0x1574f9=_0x20a9;_0x454dff[_0x1574f9(0x173)]={'x':0x0,'y':0x0,'z':0x0},_0x454dff[_0x1574f9(0x200)]=0x0,_0x454dff[_0x1574f9(0x1c4)]=0x0,_0x454dff[_0x1574f9(0x204)]=0x0,_0x454dff[_0x1574f9(0x1ee)]=0x0;for(const _0x30ac61 of _0x1b210d){switch(_0x30ac61['code']){case 0xa:_0x454dff[_0x1574f9(0x173)]['x']=parseFloat(_0x30ac61['value']);break;case 0x14:_0x454dff['position']['y']=parseFloat(_0x30ac61[_0x1574f9(0x183)]);break;case 0x1e:_0x454dff['position']['z']=parseFloat(_0x30ac61['value']);break;case 0x28:_0x454dff[_0x1574f9(0x1c4)]=parseFloat(_0x30ac61[_0x1574f9(0x183)]);break;case 0x29:_0x454dff['endWidth']=parseFloat(_0x30ac61[_0x1574f9(0x183)]);break;case 0x2a:_0x454dff[_0x1574f9(0x200)]=parseFloat(_0x30ac61[_0x1574f9(0x183)]);break;case 0x46:_0x454dff['flags']=parseInt(_0x30ac61[_0x1574f9(0x183)],0xa);break;case 0x47:_0x454dff[_0x1574f9(0x1de)]=parseInt(_0x30ac61[_0x1574f9(0x183)],0xa);break;case 0x48:_0x454dff['faceVertex2']=parseInt(_0x30ac61[_0x1574f9(0x183)],0xa);break;case 0x49:_0x454dff[_0x1574f9(0x212)]=parseInt(_0x30ac61[_0x1574f9(0x183)],0xa);break;case 0x4a:_0x454dff['faceVertex4']=parseInt(_0x30ac61[_0x1574f9(0x183)],0xa);break;}}return _0x454dff;}function parseArcEntity(_0x576ee6,_0x3ebf55){const _0x3a4fda=_0x20a9;_0x576ee6[_0x3a4fda(0x155)]={'x':0x0,'y':0x0,'z':0x0},_0x576ee6[_0x3a4fda(0x15a)]=0x0,_0x576ee6[_0x3a4fda(0x1d4)]=0x0,_0x576ee6['endAngle']=0x168,_0x576ee6[_0x3a4fda(0x1a1)]=0x0,_0x576ee6[_0x3a4fda(0x1ca)]={'x':0x0,'y':0x0,'z':0x1};for(const _0x153529 of _0x3ebf55){switch(_0x153529[_0x3a4fda(0x1c9)]){case 0xa:_0x576ee6[_0x3a4fda(0x155)]['x']=parseFloat(_0x153529[_0x3a4fda(0x183)]);break;case 0x14:_0x576ee6['center']['y']=parseFloat(_0x153529[_0x3a4fda(0x183)]);break;case 0x1e:_0x576ee6[_0x3a4fda(0x155)]['z']=parseFloat(_0x153529['value']);break;case 0x27:_0x576ee6['thickness']=parseFloat(_0x153529[_0x3a4fda(0x183)]);break;case 0x28:_0x576ee6[_0x3a4fda(0x15a)]=parseFloat(_0x153529[_0x3a4fda(0x183)]);break;case 0x32:_0x576ee6[_0x3a4fda(0x1d4)]=parseFloat(_0x153529[_0x3a4fda(0x183)]);break;case 0x33:_0x576ee6[_0x3a4fda(0x174)]=parseFloat(_0x153529['value']);break;case 0xd2:_0x576ee6[_0x3a4fda(0x1ca)]['x']=parseFloat(_0x153529['value']);break;case 0xdc:_0x576ee6[_0x3a4fda(0x1ca)]['y']=parseFloat(_0x153529[_0x3a4fda(0x183)]);break;case 0xe6:_0x576ee6[_0x3a4fda(0x1ca)]['z']=parseFloat(_0x153529[_0x3a4fda(0x183)]);break;}}return _0x576ee6;}function parseCircleEntity(_0x45e3b4,_0x3a8c29){const _0x4a44cb=_0x20a9;_0x45e3b4[_0x4a44cb(0x155)]={'x':0x0,'y':0x0,'z':0x0},_0x45e3b4[_0x4a44cb(0x15a)]=0x0,_0x45e3b4[_0x4a44cb(0x1a1)]=0x0,_0x45e3b4[_0x4a44cb(0x1ca)]={'x':0x0,'y':0x0,'z':0x1};for(const _0x5139a8 of _0x3a8c29){switch(_0x5139a8[_0x4a44cb(0x1c9)]){case 0xa:_0x45e3b4[_0x4a44cb(0x155)]['x']=parseFloat(_0x5139a8[_0x4a44cb(0x183)]);break;case 0x14:_0x45e3b4[_0x4a44cb(0x155)]['y']=parseFloat(_0x5139a8['value']);break;case 0x1e:_0x45e3b4[_0x4a44cb(0x155)]['z']=parseFloat(_0x5139a8[_0x4a44cb(0x183)]);break;case 0x27:_0x45e3b4[_0x4a44cb(0x1a1)]=parseFloat(_0x5139a8[_0x4a44cb(0x183)]);break;case 0x28:_0x45e3b4['radius']=parseFloat(_0x5139a8[_0x4a44cb(0x183)]);break;case 0xd2:_0x45e3b4[_0x4a44cb(0x1ca)]['x']=parseFloat(_0x5139a8['value']);break;case 0xdc:_0x45e3b4[_0x4a44cb(0x1ca)]['y']=parseFloat(_0x5139a8[_0x4a44cb(0x183)]);break;case 0xe6:_0x45e3b4[_0x4a44cb(0x1ca)]['z']=parseFloat(_0x5139a8['value']);break;}}return _0x45e3b4;}function parseEllipseEntity(_0x47c977,_0x46a042){const _0x4914fd=_0x20a9;_0x47c977[_0x4914fd(0x155)]={'x':0x0,'y':0x0,'z':0x0},_0x47c977[_0x4914fd(0x131)]={'x':0x0,'y':0x0,'z':0x0},_0x47c977[_0x4914fd(0x1c7)]=0x1,_0x47c977[_0x4914fd(0x1d4)]=0x0,_0x47c977[_0x4914fd(0x174)]=Math['PI']*0x2,_0x47c977[_0x4914fd(0x1ca)]={'x':0x0,'y':0x0,'z':0x1};for(const _0x554790 of _0x46a042){switch(_0x554790[_0x4914fd(0x1c9)]){case 0xa:_0x47c977[_0x4914fd(0x155)]['x']=parseFloat(_0x554790[_0x4914fd(0x183)]);break;case 0x14:_0x47c977[_0x4914fd(0x155)]['y']=parseFloat(_0x554790[_0x4914fd(0x183)]);break;case 0x1e:_0x47c977[_0x4914fd(0x155)]['z']=parseFloat(_0x554790[_0x4914fd(0x183)]);break;case 0xb:_0x47c977[_0x4914fd(0x131)]['x']=parseFloat(_0x554790[_0x4914fd(0x183)]);break;case 0x15:_0x47c977[_0x4914fd(0x131)]['y']=parseFloat(_0x554790[_0x4914fd(0x183)]);break;case 0x1f:_0x47c977[_0x4914fd(0x131)]['z']=parseFloat(_0x554790[_0x4914fd(0x183)]);break;case 0x28:_0x47c977[_0x4914fd(0x1c7)]=parseFloat(_0x554790[_0x4914fd(0x183)]);break;case 0x29:_0x47c977[_0x4914fd(0x1d4)]=parseFloat(_0x554790[_0x4914fd(0x183)]);break;case 0x2a:_0x47c977[_0x4914fd(0x174)]=parseFloat(_0x554790[_0x4914fd(0x183)]);break;case 0xd2:_0x47c977[_0x4914fd(0x1ca)]['x']=parseFloat(_0x554790[_0x4914fd(0x183)]);break;case 0xdc:_0x47c977[_0x4914fd(0x1ca)]['y']=parseFloat(_0x554790['value']);break;case 0xe6:_0x47c977[_0x4914fd(0x1ca)]['z']=parseFloat(_0x554790[_0x4914fd(0x183)]);break;}}return _0x47c977;}function parsePointEntity(_0x48bf29,_0x43f2db){const _0x381741=_0x20a9;_0x48bf29[_0x381741(0x173)]={'x':0x0,'y':0x0,'z':0x0},_0x48bf29[_0x381741(0x1a1)]=0x0,_0x48bf29[_0x381741(0x1ca)]={'x':0x0,'y':0x0,'z':0x1};for(const _0x24aab0 of _0x43f2db){switch(_0x24aab0[_0x381741(0x1c9)]){case 0xa:_0x48bf29['position']['x']=parseFloat(_0x24aab0[_0x381741(0x183)]);break;case 0x14:_0x48bf29[_0x381741(0x173)]['y']=parseFloat(_0x24aab0[_0x381741(0x183)]);break;case 0x1e:_0x48bf29[_0x381741(0x173)]['z']=parseFloat(_0x24aab0['value']);break;case 0x27:_0x48bf29['thickness']=parseFloat(_0x24aab0[_0x381741(0x183)]);break;case 0x32:_0x48bf29[_0x381741(0x16e)]=parseFloat(_0x24aab0[_0x381741(0x183)]);break;case 0xd2:_0x48bf29['extrusionDirection']['x']=parseFloat(_0x24aab0[_0x381741(0x183)]);break;case 0xdc:_0x48bf29[_0x381741(0x1ca)]['y']=parseFloat(_0x24aab0[_0x381741(0x183)]);break;case 0xe6:_0x48bf29[_0x381741(0x1ca)]['z']=parseFloat(_0x24aab0[_0x381741(0x183)]);break;}}return _0x48bf29;}function parseTextEntity(_0x46f32,_0x198655){const _0x5d2888=_0x20a9;_0x46f32['insertionPoint']={'x':0x0,'y':0x0,'z':0x0},_0x46f32['alignmentPoint']={'x':0x0,'y':0x0,'z':0x0},_0x46f32[_0x5d2888(0x20f)]=0x0,_0x46f32['text']='',_0x46f32['rotation']=0x0,_0x46f32[_0x5d2888(0x12a)]=0x1,_0x46f32['oblique']=0x0,_0x46f32[_0x5d2888(0x17d)]=_0x5d2888(0x176),_0x46f32[_0x5d2888(0x1e0)]=0x0,_0x46f32[_0x5d2888(0x1e2)]=0x0,_0x46f32[_0x5d2888(0x1be)]=0x0,_0x46f32[_0x5d2888(0x1a1)]=0x0,_0x46f32[_0x5d2888(0x1ca)]={'x':0x0,'y':0x0,'z':0x1};for(const _0x5d4303 of _0x198655){switch(_0x5d4303['code']){case 0x1:_0x46f32[_0x5d2888(0x20a)]=_0x5d4303[_0x5d2888(0x183)];break;case 0x7:_0x46f32[_0x5d2888(0x17d)]=_0x5d4303[_0x5d2888(0x183)];break;case 0xa:_0x46f32[_0x5d2888(0x109)]['x']=parseFloat(_0x5d4303[_0x5d2888(0x183)]);break;case 0x14:_0x46f32[_0x5d2888(0x109)]['y']=parseFloat(_0x5d4303[_0x5d2888(0x183)]);break;case 0x1e:_0x46f32[_0x5d2888(0x109)]['z']=parseFloat(_0x5d4303[_0x5d2888(0x183)]);break;case 0xb:_0x46f32[_0x5d2888(0x1d6)]['x']=parseFloat(_0x5d4303[_0x5d2888(0x183)]);break;case 0x15:_0x46f32[_0x5d2888(0x1d6)]['y']=parseFloat(_0x5d4303['value']);break;case 0x1f:_0x46f32[_0x5d2888(0x1d6)]['z']=parseFloat(_0x5d4303['value']);break;case 0x27:_0x46f32[_0x5d2888(0x1a1)]=parseFloat(_0x5d4303[_0x5d2888(0x183)]);break;case 0x28:_0x46f32['height']=parseFloat(_0x5d4303[_0x5d2888(0x183)]);break;case 0x29:_0x46f32[_0x5d2888(0x12a)]=parseFloat(_0x5d4303[_0x5d2888(0x183)]);break;case 0x32:_0x46f32[_0x5d2888(0x211)]=parseFloat(_0x5d4303[_0x5d2888(0x183)]);break;case 0x33:_0x46f32[_0x5d2888(0x143)]=parseFloat(_0x5d4303[_0x5d2888(0x183)]);break;case 0x47:_0x46f32[_0x5d2888(0x1e0)]=parseInt(_0x5d4303[_0x5d2888(0x183)],0xa);break;case 0x48:_0x46f32[_0x5d2888(0x1e2)]=parseInt(_0x5d4303[_0x5d2888(0x183)],0xa);break;case 0x49:_0x46f32['vAlign']=parseInt(_0x5d4303[_0x5d2888(0x183)],0xa);break;case 0xd2:_0x46f32[_0x5d2888(0x1ca)]['x']=parseFloat(_0x5d4303[_0x5d2888(0x183)]);break;case 0xdc:_0x46f32[_0x5d2888(0x1ca)]['y']=parseFloat(_0x5d4303[_0x5d2888(0x183)]);break;case 0xe6:_0x46f32[_0x5d2888(0x1ca)]['z']=parseFloat(_0x5d4303[_0x5d2888(0x183)]);break;}}return _0x46f32;}function _0x3bfb(){const _0x267251=['keys','center','width','insert_list','knotTolerance','edgeCount','radius','normal','join','node','2786874nDmGkl','layer','colorNumber','clippingBoundary','style','version','entryName','viewport_list','startPoint','arrowheadSize','brightness','includes','points','upperLeftCorner','line_list','modelerFormat','angle','hardPointer','patternName','uVector','linetypeScale','position','endAngle','https','STANDARD','lineSpacingStyle','binaryData','handle','middleOfText','HATCH','seedPoints','styleName','softPointer','turnHeight','prompt','SEQEND','cppClassName','value','3DSOLID','textWidth','HTTP\x20','dummyX','TRACE','startTangent','ELLIPSE','defaultStartWidth','dimensionType','patternType','clippingVertices','fitPointCount','ENDSEC','definitionPoint','plotStyleHandle','isEntity','ellipse_list','patternAngle','获取\x20DXF\x20失败:\x20HTTP\x20','1856760mxYTdX','TEXT','lineweight','VERTEX','basePointY','split','test','face3d_list','instanceCount','push','thickness','vertices','scale','MTEXT','imageSize','IMAGE','XLINE','RAY','SURFACE','blocks','ARC','frozenLayers','leaderPoints','Defpoints','SECTION','error','point1','endTangent','constantWidth','data','leaderLength','1012560UXzLKo','ENDTAB','subclassMarker','MLINE','tables','visible','solid','2564xbmaHM','vAlign','MESH','trueColor','7QtMxwo','acisData','weights','startWidth','is3DMesh','polyline_list','axisRatio','circle_list','code','extrusionDirection','viewTwistAngle','perspectiveLensLength','ENDBLK','dxfRecord','POINT','axisVector','meshNVertexCount','styleHandle','vertexCount','startAngle','attachmentPoint','alignmentPoint','viewDirection','undefined','ATTDEF','BLOCK','LEADER','columnSpacing','type','faceVertex1','statusCode','generationFlags','doglegLength','hAlign','patternScale','slice','function','rowCount','rows','hasAttributes','endPoint','CIRCLE','contrast','OBJECTS','DIMENSION','flags','CLASSES','fitPoints','versions','code_','direction','concat','SPLINE','ENTITIES','3DFACE','defaultEndWidth','columnWidths','HEADER','subdivisionLevel','text_list','acisDataString','widthFactor','POLYLINE','bulge','dimension_list','planar','lineSpacing','endWidth','ATTRIB','controlPointCount','columnCount','LWPOLYLINE','turns','text','textStyleId','associative','faceVertex4','2089978YPoLMO','height','length','rotation','faceVertex3','knots','blockName','periodic','isPolyfaceMesh','insertionPoint','\x20—\x20','entities','viewTarget','displayFlags','ownerHandle','rowSpacing','viewCenter','point_list','oleType','meshMVertexCount','arrowheadFlag','mtext_list','status','proxyCapabilities','point2','HELIX','TABLE','LINE','tag','viewHeight','7809687XQcfuc','fitTolerance','columns','CLASS','rowHeights','textHeight','http','TABLES','basePoint','attributes','utf-8','string','xScale','creationType','dummyY','degree','handedness','edges','trim','majorAxisEndPoint','elevation','REGION','tileMode','edgeCreases','contentType','invisibleEdgeFlags','lowerRightCorner','linetypeName','OLE2FRAME','get','SOLID','solid_list','clippingType','constraint','drawingDirection','hooklineFlag','layers','oblique','fade','faces','INSERT','arc_list','axisBasePoint','1077rUZZzl','boundaryPaths','wasProxy','5766205xGLCmF','controlPoints','rational','statusField','closed','WIPEOUT','name','basePointX'];_0x3bfb=function(){return _0x267251;};return _0x3bfb();}function parseMTextEntity(_0x310c6f,_0x325075){const _0x3ab135=_0x20a9;_0x310c6f['insertionPoint']={'x':0x0,'y':0x0,'z':0x0},_0x310c6f[_0x3ab135(0x1f3)]={'x':0x1,'y':0x0,'z':0x0},_0x310c6f[_0x3ab135(0x20f)]=0x0,_0x310c6f[_0x3ab135(0x156)]=0x0,_0x310c6f[_0x3ab135(0x20a)]='',_0x310c6f[_0x3ab135(0x211)]=0x0,_0x310c6f[_0x3ab135(0x17d)]=_0x3ab135(0x176),_0x310c6f['attachmentPoint']=0x1,_0x310c6f[_0x3ab135(0x140)]=0x1,_0x310c6f['lineSpacing']=0x1,_0x310c6f[_0x3ab135(0x177)]=0x1,_0x310c6f[_0x3ab135(0x1ca)]={'x':0x0,'y':0x0,'z':0x1};let _0x197227=[];for(const _0x273cc5 of _0x325075){switch(_0x273cc5[_0x3ab135(0x1c9)]){case 0x1:_0x197227[_0x3ab135(0x1a0)](_0x273cc5[_0x3ab135(0x183)]);break;case 0x3:_0x197227[_0x3ab135(0x1a0)](_0x273cc5[_0x3ab135(0x183)]);break;case 0x7:_0x310c6f['styleName']=_0x273cc5[_0x3ab135(0x183)];break;case 0xa:_0x310c6f['insertionPoint']['x']=parseFloat(_0x273cc5[_0x3ab135(0x183)]);break;case 0x14:_0x310c6f[_0x3ab135(0x109)]['y']=parseFloat(_0x273cc5[_0x3ab135(0x183)]);break;case 0x1e:_0x310c6f[_0x3ab135(0x109)]['z']=parseFloat(_0x273cc5[_0x3ab135(0x183)]);break;case 0xb:_0x310c6f[_0x3ab135(0x1f3)]['x']=parseFloat(_0x273cc5['value']);break;case 0x15:_0x310c6f[_0x3ab135(0x1f3)]['y']=parseFloat(_0x273cc5[_0x3ab135(0x183)]);break;case 0x1f:_0x310c6f[_0x3ab135(0x1f3)]['z']=parseFloat(_0x273cc5[_0x3ab135(0x183)]);break;case 0x28:_0x310c6f[_0x3ab135(0x20f)]=parseFloat(_0x273cc5[_0x3ab135(0x183)]);break;case 0x29:_0x310c6f[_0x3ab135(0x156)]=parseFloat(_0x273cc5['value']);break;case 0x2c:_0x310c6f[_0x3ab135(0x203)]=parseFloat(_0x273cc5['value']);break;case 0x32:_0x310c6f[_0x3ab135(0x211)]=parseFloat(_0x273cc5[_0x3ab135(0x183)]);break;case 0x47:_0x310c6f[_0x3ab135(0x1d5)]=parseInt(_0x273cc5[_0x3ab135(0x183)],0xa);break;case 0x48:_0x310c6f[_0x3ab135(0x140)]=parseInt(_0x273cc5[_0x3ab135(0x183)],0xa);break;case 0x49:_0x310c6f[_0x3ab135(0x177)]=parseInt(_0x273cc5[_0x3ab135(0x183)],0xa);break;case 0xd2:_0x310c6f['extrusionDirection']['x']=parseFloat(_0x273cc5[_0x3ab135(0x183)]);break;case 0xdc:_0x310c6f['extrusionDirection']['y']=parseFloat(_0x273cc5[_0x3ab135(0x183)]);break;case 0xe6:_0x310c6f[_0x3ab135(0x1ca)]['z']=parseFloat(_0x273cc5[_0x3ab135(0x183)]);break;}}return _0x310c6f[_0x3ab135(0x20a)]=_0x197227[_0x3ab135(0x15c)](''),_0x310c6f;}function parseAttribEntity(_0x19661d,_0x21dc6a){const _0x402275=_0x20a9;_0x19661d[_0x402275(0x109)]={'x':0x0,'y':0x0,'z':0x0},_0x19661d['alignmentPoint']={'x':0x0,'y':0x0,'z':0x0},_0x19661d[_0x402275(0x20f)]=0x0,_0x19661d[_0x402275(0x20a)]='',_0x19661d['tag']='',_0x19661d['prompt']='',_0x19661d[_0x402275(0x211)]=0x0,_0x19661d['flags']=0x0,_0x19661d[_0x402275(0x17d)]=_0x402275(0x176);for(const _0x21f472 of _0x21dc6a){switch(_0x21f472[_0x402275(0x1c9)]){case 0x1:_0x19661d[_0x402275(0x20a)]=_0x21f472[_0x402275(0x183)];break;case 0x2:_0x19661d[_0x402275(0x11c)]=_0x21f472[_0x402275(0x183)];break;case 0x3:_0x19661d[_0x402275(0x180)]=_0x21f472[_0x402275(0x183)];break;case 0x7:_0x19661d[_0x402275(0x17d)]=_0x21f472[_0x402275(0x183)];break;case 0xa:_0x19661d[_0x402275(0x109)]['x']=parseFloat(_0x21f472[_0x402275(0x183)]);break;case 0x14:_0x19661d['insertionPoint']['y']=parseFloat(_0x21f472['value']);break;case 0x1e:_0x19661d[_0x402275(0x109)]['z']=parseFloat(_0x21f472[_0x402275(0x183)]);break;case 0xb:_0x19661d['alignmentPoint']['x']=parseFloat(_0x21f472[_0x402275(0x183)]);break;case 0x15:_0x19661d['alignmentPoint']['y']=parseFloat(_0x21f472[_0x402275(0x183)]);break;case 0x1f:_0x19661d['alignmentPoint']['z']=parseFloat(_0x21f472[_0x402275(0x183)]);break;case 0x28:_0x19661d[_0x402275(0x20f)]=parseFloat(_0x21f472[_0x402275(0x183)]);break;case 0x29:_0x19661d[_0x402275(0x12a)]=parseFloat(_0x21f472['value']);break;case 0x32:_0x19661d['rotation']=parseFloat(_0x21f472[_0x402275(0x183)]);break;case 0x46:_0x19661d[_0x402275(0x1ee)]=parseInt(_0x21f472[_0x402275(0x183)],0xa);break;case 0x47:_0x19661d['generationFlags']=parseInt(_0x21f472['value'],0xa);break;case 0x48:_0x19661d[_0x402275(0x1e2)]=parseInt(_0x21f472[_0x402275(0x183)],0xa);break;case 0x49:_0x19661d['vAlign']=parseInt(_0x21f472[_0x402275(0x183)],0xa);break;}}return _0x19661d;}function parseInsertEntity(_0xd75b6e,_0x29b396){const _0x4a42a4=_0x20a9;_0xd75b6e[_0x4a42a4(0x214)]='',_0xd75b6e['insertionPoint']={'x':0x0,'y':0x0,'z':0x0},_0xd75b6e[_0x4a42a4(0x1a3)]={'x':0x1,'y':0x1,'z':0x1},_0xd75b6e[_0x4a42a4(0x211)]=0x0,_0xd75b6e[_0x4a42a4(0x207)]=0x1,_0xd75b6e[_0x4a42a4(0x1e6)]=0x1,_0xd75b6e[_0x4a42a4(0x1dc)]=0x0,_0xd75b6e['rowSpacing']=0x0,_0xd75b6e[_0x4a42a4(0x1ca)]={'x':0x0,'y':0x0,'z':0x1},_0xd75b6e[_0x4a42a4(0x127)]=[];for(const _0x340fdf of _0x29b396){switch(_0x340fdf[_0x4a42a4(0x1c9)]){case 0x2:_0xd75b6e[_0x4a42a4(0x214)]=_0x340fdf[_0x4a42a4(0x183)];break;case 0xa:_0xd75b6e['insertionPoint']['x']=parseFloat(_0x340fdf[_0x4a42a4(0x183)]);break;case 0x14:_0xd75b6e[_0x4a42a4(0x109)]['y']=parseFloat(_0x340fdf[_0x4a42a4(0x183)]);break;case 0x1e:_0xd75b6e[_0x4a42a4(0x109)]['z']=parseFloat(_0x340fdf[_0x4a42a4(0x183)]);break;case 0x29:_0xd75b6e[_0x4a42a4(0x1a3)]['x']=parseFloat(_0x340fdf['value']);break;case 0x2a:_0xd75b6e[_0x4a42a4(0x1a3)]['y']=parseFloat(_0x340fdf[_0x4a42a4(0x183)]);break;case 0x2b:_0xd75b6e[_0x4a42a4(0x1a3)]['z']=parseFloat(_0x340fdf[_0x4a42a4(0x183)]);break;case 0x2c:_0xd75b6e[_0x4a42a4(0x1dc)]=parseFloat(_0x340fdf[_0x4a42a4(0x183)]);break;case 0x2d:_0xd75b6e[_0x4a42a4(0x10f)]=parseFloat(_0x340fdf['value']);break;case 0x32:_0xd75b6e[_0x4a42a4(0x211)]=parseFloat(_0x340fdf['value']);break;case 0x42:_0xd75b6e['hasAttributes']=parseInt(_0x340fdf[_0x4a42a4(0x183)],0xa)===0x1;break;case 0x46:_0xd75b6e[_0x4a42a4(0x207)]=parseInt(_0x340fdf[_0x4a42a4(0x183)],0xa);break;case 0x47:_0xd75b6e['rowCount']=parseInt(_0x340fdf[_0x4a42a4(0x183)],0xa);break;case 0xd2:_0xd75b6e['extrusionDirection']['x']=parseFloat(_0x340fdf['value']);break;case 0xdc:_0xd75b6e[_0x4a42a4(0x1ca)]['y']=parseFloat(_0x340fdf[_0x4a42a4(0x183)]);break;case 0xe6:_0xd75b6e[_0x4a42a4(0x1ca)]['z']=parseFloat(_0x340fdf[_0x4a42a4(0x183)]);break;}}return _0xd75b6e;}function parseDimensionEntity(_0x4759ca,_0x249a51){const _0x8dc48e=_0x20a9;_0x4759ca[_0x8dc48e(0x214)]='',_0x4759ca[_0x8dc48e(0x191)]={'x':0x0,'y':0x0,'z':0x0},_0x4759ca[_0x8dc48e(0x17a)]={'x':0x0,'y':0x0,'z':0x0},_0x4759ca[_0x8dc48e(0x109)]={'x':0x0,'y':0x0,'z':0x0},_0x4759ca[_0x8dc48e(0x18c)]=0x0,_0x4759ca['text']='',_0x4759ca[_0x8dc48e(0x17d)]=_0x8dc48e(0x176),_0x4759ca['rotation']=0x0,_0x4759ca[_0x8dc48e(0x1b1)]={'x':0x0,'y':0x0,'z':0x0},_0x4759ca[_0x8dc48e(0x118)]={'x':0x0,'y':0x0,'z':0x0};for(const _0x41b9a8 of _0x249a51){switch(_0x41b9a8[_0x8dc48e(0x1c9)]){case 0x1:_0x4759ca[_0x8dc48e(0x20a)]=_0x41b9a8[_0x8dc48e(0x183)];break;case 0x2:_0x4759ca['blockName']=_0x41b9a8[_0x8dc48e(0x183)];break;case 0x3:_0x4759ca['styleName']=_0x41b9a8[_0x8dc48e(0x183)];break;case 0xa:_0x4759ca[_0x8dc48e(0x191)]['x']=parseFloat(_0x41b9a8[_0x8dc48e(0x183)]);break;case 0x14:_0x4759ca[_0x8dc48e(0x191)]['y']=parseFloat(_0x41b9a8[_0x8dc48e(0x183)]);break;case 0x1e:_0x4759ca[_0x8dc48e(0x191)]['z']=parseFloat(_0x41b9a8['value']);break;case 0xb:_0x4759ca['middleOfText']['x']=parseFloat(_0x41b9a8[_0x8dc48e(0x183)]);break;case 0x15:_0x4759ca[_0x8dc48e(0x17a)]['y']=parseFloat(_0x41b9a8['value']);break;case 0x1f:_0x4759ca[_0x8dc48e(0x17a)]['z']=parseFloat(_0x41b9a8['value']);break;case 0xd:_0x4759ca[_0x8dc48e(0x1b1)]['x']=parseFloat(_0x41b9a8['value']);break;case 0x17:_0x4759ca[_0x8dc48e(0x1b1)]['y']=parseFloat(_0x41b9a8[_0x8dc48e(0x183)]);break;case 0x21:_0x4759ca[_0x8dc48e(0x1b1)]['z']=parseFloat(_0x41b9a8['value']);break;case 0xe:_0x4759ca['point2']['x']=parseFloat(_0x41b9a8[_0x8dc48e(0x183)]);break;case 0x18:_0x4759ca[_0x8dc48e(0x118)]['y']=parseFloat(_0x41b9a8[_0x8dc48e(0x183)]);break;case 0x22:_0x4759ca[_0x8dc48e(0x118)]['z']=parseFloat(_0x41b9a8[_0x8dc48e(0x183)]);break;case 0x28:_0x4759ca[_0x8dc48e(0x1b5)]=parseFloat(_0x41b9a8['value']);break;case 0x32:_0x4759ca[_0x8dc48e(0x211)]=parseFloat(_0x41b9a8[_0x8dc48e(0x183)]);break;case 0x46:_0x4759ca[_0x8dc48e(0x18c)]=parseInt(_0x41b9a8[_0x8dc48e(0x183)],0xa);break;case 0x47:_0x4759ca[_0x8dc48e(0x1d5)]=parseInt(_0x41b9a8[_0x8dc48e(0x183)],0xa);break;}}return _0x4759ca;}function parseLeaderEntity(_0x3dd633,_0x40efce){const _0x5d3ad3=_0x20a9;_0x3dd633[_0x5d3ad3(0x17d)]=_0x5d3ad3(0x176),_0x3dd633[_0x5d3ad3(0x114)]=0x1,_0x3dd633['pathType']=0x0,_0x3dd633[_0x5d3ad3(0x12b)]=0x0,_0x3dd633[_0x5d3ad3(0x141)]=0x0,_0x3dd633['vertices']=[],_0x3dd633['annotationReference']=null,_0x3dd633['normal']={'x':0x0,'y':0x0,'z':0x1},_0x3dd633['horizontalDirection']={'x':0x1,'y':0x0,'z':0x0};let _0x23b6b4=null;for(const _0x44cd1c of _0x40efce){switch(_0x44cd1c[_0x5d3ad3(0x1c9)]){case 0x3:_0x3dd633[_0x5d3ad3(0x17d)]=_0x44cd1c[_0x5d3ad3(0x183)];break;case 0xa:_0x23b6b4=parseFloat(_0x44cd1c[_0x5d3ad3(0x183)]);break;case 0x14:_0x23b6b4!==null&&(_0x3dd633[_0x5d3ad3(0x1a2)][_0x5d3ad3(0x1a0)]({'x':_0x23b6b4,'y':parseFloat(_0x44cd1c[_0x5d3ad3(0x183)]),'z':0x0}),_0x23b6b4=null);break;case 0x1e:if(_0x3dd633['vertices'][_0x5d3ad3(0x210)]>0x0)_0x3dd633[_0x5d3ad3(0x1a2)][_0x3dd633['vertices'][_0x5d3ad3(0x210)]-0x1]['z']=parseFloat(_0x44cd1c[_0x5d3ad3(0x183)]);break;case 0x28:_0x3dd633[_0x5d3ad3(0x123)]=parseFloat(_0x44cd1c[_0x5d3ad3(0x183)]);break;case 0x29:_0x3dd633[_0x5d3ad3(0x185)]=parseFloat(_0x44cd1c[_0x5d3ad3(0x183)]);break;case 0x47:_0x3dd633[_0x5d3ad3(0x114)]=parseInt(_0x44cd1c[_0x5d3ad3(0x183)],0xa);break;case 0x48:_0x3dd633['pathType']=parseInt(_0x44cd1c[_0x5d3ad3(0x183)],0xa);break;case 0x49:_0x3dd633[_0x5d3ad3(0x12b)]=parseInt(_0x44cd1c[_0x5d3ad3(0x183)],0xa);break;case 0x4c:_0x3dd633[_0x5d3ad3(0x1d3)]=parseInt(_0x44cd1c[_0x5d3ad3(0x183)],0xa);break;case 0x154:_0x3dd633['annotationReference']=_0x44cd1c[_0x5d3ad3(0x183)];break;}}return _0x3dd633;}function parseMLeaderEntity(_0x497799,_0x44b4b0){const _0x192930=_0x20a9;_0x497799[_0x192930(0x17d)]='',_0x497799[_0x192930(0x20a)]='',_0x497799[_0x192930(0x1ad)]=[],_0x497799[_0x192930(0x136)]=0x0,_0x497799[_0x192930(0x20b)]='';let _0x53a506=null;for(const _0x1f4794 of _0x44b4b0){switch(_0x1f4794['code']){case 0x3:_0x497799[_0x192930(0x17d)]=_0x1f4794[_0x192930(0x183)];break;case 0x130:_0x497799['text']=_0x1f4794['value'];break;case 0xaa:_0x497799['contentType']=parseInt(_0x1f4794[_0x192930(0x183)],0xa);break;case 0x154:_0x497799[_0x192930(0x20b)]=_0x1f4794['value'];break;case 0xa:_0x53a506=parseFloat(_0x1f4794[_0x192930(0x183)]);break;case 0x14:_0x53a506!==null&&(_0x497799[_0x192930(0x1ad)][_0x192930(0x1a0)]({'x':_0x53a506,'y':parseFloat(_0x1f4794[_0x192930(0x183)]),'z':0x0}),_0x53a506=null);break;case 0x1e:if(_0x497799[_0x192930(0x1ad)][_0x192930(0x210)]>0x0)_0x497799[_0x192930(0x1ad)][_0x497799['leaderPoints'][_0x192930(0x210)]-0x1]['z']=parseFloat(_0x1f4794[_0x192930(0x183)]);break;case 0x28:_0x497799[_0x192930(0x1e1)]=parseFloat(_0x1f4794[_0x192930(0x183)]);break;case 0x29:_0x497799[_0x192930(0x167)]=parseFloat(_0x1f4794[_0x192930(0x183)]);break;case 0x2a:_0x497799['textHeight']=parseFloat(_0x1f4794[_0x192930(0x183)]);break;}}return _0x497799;}function parseHatchEntity(_0x1e25aa,_0x3e5a76){const _0x47f04b=_0x20a9;_0x1e25aa[_0x47f04b(0x170)]='',_0x1e25aa[_0x47f04b(0x1bc)]=![],_0x1e25aa[_0x47f04b(0x20c)]=![],_0x1e25aa[_0x47f04b(0x162)]=0x0,_0x1e25aa[_0x47f04b(0x18d)]=0x0,_0x1e25aa[_0x47f04b(0x195)]=0x0,_0x1e25aa[_0x47f04b(0x1e3)]=0x1,_0x1e25aa[_0x47f04b(0x132)]=0x0,_0x1e25aa[_0x47f04b(0x1ca)]={'x':0x0,'y':0x0,'z':0x1},_0x1e25aa[_0x47f04b(0x14a)]=[],_0x1e25aa[_0x47f04b(0x17c)]=[];let _0x500a35=![],_0x29d640=null;for(const _0x4ed32b of _0x3e5a76){switch(_0x4ed32b[_0x47f04b(0x1c9)]){case 0x2:_0x1e25aa[_0x47f04b(0x170)]=_0x4ed32b['value'];break;case 0xa:_0x500a35&&_0x29d640&&(_0x29d640[_0x47f04b(0x16a)]=_0x29d640['points']||[],_0x29d640[_0x47f04b(0x16a)][_0x47f04b(0x1a0)]({'x':parseFloat(_0x4ed32b[_0x47f04b(0x183)])}));break;case 0x14:if(_0x500a35&&_0x29d640&&_0x29d640['points']&&_0x29d640['points'][_0x47f04b(0x210)]>0x0)_0x29d640[_0x47f04b(0x16a)][_0x29d640[_0x47f04b(0x16a)][_0x47f04b(0x210)]-0x1]['y']=parseFloat(_0x4ed32b[_0x47f04b(0x183)]);break;case 0x1e:_0x1e25aa[_0x47f04b(0x132)]=parseFloat(_0x4ed32b['value']);break;case 0x29:_0x1e25aa['patternScale']=parseFloat(_0x4ed32b['value']);break;case 0x34:_0x1e25aa[_0x47f04b(0x195)]=parseFloat(_0x4ed32b['value']);break;case 0x46:_0x1e25aa[_0x47f04b(0x1bc)]=parseInt(_0x4ed32b[_0x47f04b(0x183)],0xa)===0x1;break;case 0x47:_0x1e25aa['associative']=parseInt(_0x4ed32b[_0x47f04b(0x183)],0xa)===0x1;break;case 0x4b:_0x1e25aa['style']=parseInt(_0x4ed32b[_0x47f04b(0x183)],0xa);break;case 0x4c:_0x1e25aa[_0x47f04b(0x18d)]=parseInt(_0x4ed32b[_0x47f04b(0x183)],0xa);break;case 0x5b:_0x500a35=!![];break;case 0x5c:if(_0x29d640)_0x1e25aa[_0x47f04b(0x14a)][_0x47f04b(0x1a0)](_0x29d640);_0x29d640={'type':parseInt(_0x4ed32b[_0x47f04b(0x183)],0xa),'edges':[],'points':[]};break;case 0x5d:if(_0x29d640)_0x29d640[_0x47f04b(0x159)]=parseInt(_0x4ed32b[_0x47f04b(0x183)],0xa);break;case 0x61:if(_0x29d640)_0x1e25aa[_0x47f04b(0x14a)]['push'](_0x29d640);_0x29d640=null,_0x500a35=![];break;case 0xd2:_0x1e25aa[_0x47f04b(0x1ca)]['x']=parseFloat(_0x4ed32b[_0x47f04b(0x183)]);break;case 0xdc:_0x1e25aa[_0x47f04b(0x1ca)]['y']=parseFloat(_0x4ed32b[_0x47f04b(0x183)]);break;case 0xe6:_0x1e25aa[_0x47f04b(0x1ca)]['z']=parseFloat(_0x4ed32b['value']);break;}}if(_0x29d640)_0x1e25aa[_0x47f04b(0x14a)][_0x47f04b(0x1a0)](_0x29d640);return _0x1e25aa;}function parseSplineEntity(_0x297c1c,_0x3b936a){const _0x39058e=_0x20a9;_0x297c1c[_0x39058e(0x15b)]={'x':0x0,'y':0x0,'z':0x1},_0x297c1c[_0x39058e(0x12d)]=0x3,_0x297c1c[_0x39058e(0x150)]=![],_0x297c1c['periodic']=![],_0x297c1c[_0x39058e(0x14e)]=![],_0x297c1c['planar']=![],_0x297c1c[_0x39058e(0x158)]=1e-7,_0x297c1c['controlPointTolerance']=1e-7,_0x297c1c[_0x39058e(0x11f)]=1e-10,_0x297c1c['startTangent']={'x':0x0,'y':0x0,'z':0x0},_0x297c1c[_0x39058e(0x1b2)]={'x':0x0,'y':0x0,'z':0x0},_0x297c1c[_0x39058e(0x213)]=[],_0x297c1c[_0x39058e(0x1c3)]=[],_0x297c1c[_0x39058e(0x14d)]=[],_0x297c1c[_0x39058e(0x1f0)]=[];let _0x5c5d44=null,_0x391a22=null;for(const _0x2430ea of _0x3b936a){switch(_0x2430ea['code']){case 0xa:_0x5c5d44=parseFloat(_0x2430ea[_0x39058e(0x183)]);break;case 0x14:_0x5c5d44!==null&&(_0x297c1c[_0x39058e(0x14d)][_0x39058e(0x1a0)]({'x':_0x5c5d44,'y':parseFloat(_0x2430ea[_0x39058e(0x183)]),'z':0x0}),_0x5c5d44=null);break;case 0x1e:if(_0x297c1c['controlPoints'][_0x39058e(0x210)]>0x0)_0x297c1c[_0x39058e(0x14d)][_0x297c1c[_0x39058e(0x14d)][_0x39058e(0x210)]-0x1]['z']=parseFloat(_0x2430ea[_0x39058e(0x183)]);break;case 0xb:_0x391a22=parseFloat(_0x2430ea['value']);break;case 0x15:_0x391a22!==null&&(_0x297c1c['fitPoints'][_0x39058e(0x1a0)]({'x':_0x391a22,'y':parseFloat(_0x2430ea['value']),'z':0x0}),_0x391a22=null);break;case 0x1f:if(_0x297c1c[_0x39058e(0x1f0)][_0x39058e(0x210)]>0x0)_0x297c1c[_0x39058e(0x1f0)][_0x297c1c[_0x39058e(0x1f0)]['length']-0x1]['z']=parseFloat(_0x2430ea[_0x39058e(0x183)]);break;case 0xc:_0x297c1c[_0x39058e(0x189)]['x']=parseFloat(_0x2430ea[_0x39058e(0x183)]);break;case 0x16:_0x297c1c[_0x39058e(0x189)]['y']=parseFloat(_0x2430ea['value']);break;case 0x20:_0x297c1c[_0x39058e(0x189)]['z']=parseFloat(_0x2430ea['value']);break;case 0xd:_0x297c1c[_0x39058e(0x1b2)]['x']=parseFloat(_0x2430ea[_0x39058e(0x183)]);break;case 0x17:_0x297c1c[_0x39058e(0x1b2)]['y']=parseFloat(_0x2430ea[_0x39058e(0x183)]);break;case 0x21:_0x297c1c[_0x39058e(0x1b2)]['z']=parseFloat(_0x2430ea[_0x39058e(0x183)]);break;case 0x28:_0x297c1c['knots'][_0x39058e(0x1a0)](parseFloat(_0x2430ea[_0x39058e(0x183)]));break;case 0x29:_0x297c1c[_0x39058e(0x1c3)][_0x39058e(0x1a0)](parseFloat(_0x2430ea[_0x39058e(0x183)]));break;case 0x2a:_0x297c1c[_0x39058e(0x158)]=parseFloat(_0x2430ea[_0x39058e(0x183)]);break;case 0x2b:_0x297c1c['controlPointTolerance']=parseFloat(_0x2430ea[_0x39058e(0x183)]);break;case 0x2c:_0x297c1c[_0x39058e(0x11f)]=parseFloat(_0x2430ea['value']);break;case 0x46:{const _0x59e470=parseInt(_0x2430ea[_0x39058e(0x183)],0xa);_0x297c1c[_0x39058e(0x150)]=(_0x59e470&0x1)===0x1,_0x297c1c[_0x39058e(0x215)]=(_0x59e470&0x2)===0x2,_0x297c1c['rational']=(_0x59e470&0x4)===0x4,_0x297c1c[_0x39058e(0x202)]=(_0x59e470&0x8)===0x8,_0x297c1c['flags']=_0x59e470;break;}case 0x47:_0x297c1c['degree']=parseInt(_0x2430ea['value'],0xa);break;case 0x48:_0x297c1c['knotCount']=parseInt(_0x2430ea[_0x39058e(0x183)],0xa);break;case 0x49:_0x297c1c[_0x39058e(0x206)]=parseInt(_0x2430ea[_0x39058e(0x183)],0xa);break;case 0x4a:_0x297c1c[_0x39058e(0x18f)]=parseInt(_0x2430ea[_0x39058e(0x183)],0xa);break;case 0xd2:_0x297c1c[_0x39058e(0x15b)]['x']=parseFloat(_0x2430ea[_0x39058e(0x183)]);break;case 0xdc:_0x297c1c[_0x39058e(0x15b)]['y']=parseFloat(_0x2430ea['value']);break;case 0xe6:_0x297c1c[_0x39058e(0x15b)]['z']=parseFloat(_0x2430ea[_0x39058e(0x183)]);break;}}return _0x297c1c;}function parseSolidEntity(_0x51fe41,_0x4a213f){const _0x3acd01=_0x20a9;_0x51fe41[_0x3acd01(0x16a)]=[{'x':0x0,'y':0x0,'z':0x0},{'x':0x0,'y':0x0,'z':0x0},{'x':0x0,'y':0x0,'z':0x0},{'x':0x0,'y':0x0,'z':0x0}],_0x51fe41[_0x3acd01(0x1a1)]=0x0,_0x51fe41[_0x3acd01(0x1ca)]={'x':0x0,'y':0x0,'z':0x1};for(const _0x5069b9 of _0x4a213f){switch(_0x5069b9['code']){case 0xa:_0x51fe41[_0x3acd01(0x16a)][0x0]['x']=parseFloat(_0x5069b9[_0x3acd01(0x183)]);break;case 0x14:_0x51fe41[_0x3acd01(0x16a)][0x0]['y']=parseFloat(_0x5069b9[_0x3acd01(0x183)]);break;case 0x1e:_0x51fe41[_0x3acd01(0x16a)][0x0]['z']=parseFloat(_0x5069b9['value']);break;case 0xb:_0x51fe41[_0x3acd01(0x16a)][0x1]['x']=parseFloat(_0x5069b9['value']);break;case 0x15:_0x51fe41['points'][0x1]['y']=parseFloat(_0x5069b9[_0x3acd01(0x183)]);break;case 0x1f:_0x51fe41[_0x3acd01(0x16a)][0x1]['z']=parseFloat(_0x5069b9['value']);break;case 0xc:_0x51fe41[_0x3acd01(0x16a)][0x2]['x']=parseFloat(_0x5069b9[_0x3acd01(0x183)]);break;case 0x16:_0x51fe41[_0x3acd01(0x16a)][0x2]['y']=parseFloat(_0x5069b9[_0x3acd01(0x183)]);break;case 0x20:_0x51fe41['points'][0x2]['z']=parseFloat(_0x5069b9['value']);break;case 0xd:_0x51fe41[_0x3acd01(0x16a)][0x3]['x']=parseFloat(_0x5069b9['value']);break;case 0x17:_0x51fe41[_0x3acd01(0x16a)][0x3]['y']=parseFloat(_0x5069b9[_0x3acd01(0x183)]);break;case 0x21:_0x51fe41[_0x3acd01(0x16a)][0x3]['z']=parseFloat(_0x5069b9['value']);break;case 0x27:_0x51fe41['thickness']=parseFloat(_0x5069b9[_0x3acd01(0x183)]);break;case 0xd2:_0x51fe41[_0x3acd01(0x1ca)]['x']=parseFloat(_0x5069b9[_0x3acd01(0x183)]);break;case 0xdc:_0x51fe41[_0x3acd01(0x1ca)]['y']=parseFloat(_0x5069b9[_0x3acd01(0x183)]);break;case 0xe6:_0x51fe41[_0x3acd01(0x1ca)]['z']=parseFloat(_0x5069b9[_0x3acd01(0x183)]);break;}}return _0x51fe41;}function parse3DFaceEntity(_0x4ef90c,_0x1a0dfe){const _0x5428d4=_0x20a9;_0x4ef90c['vertices']=[{'x':0x0,'y':0x0,'z':0x0},{'x':0x0,'y':0x0,'z':0x0},{'x':0x0,'y':0x0,'z':0x0},{'x':0x0,'y':0x0,'z':0x0}],_0x4ef90c[_0x5428d4(0x137)]=0x0;for(const _0x1b331c of _0x1a0dfe){switch(_0x1b331c[_0x5428d4(0x1c9)]){case 0xa:_0x4ef90c[_0x5428d4(0x1a2)][0x0]['x']=parseFloat(_0x1b331c[_0x5428d4(0x183)]);break;case 0x14:_0x4ef90c[_0x5428d4(0x1a2)][0x0]['y']=parseFloat(_0x1b331c[_0x5428d4(0x183)]);break;case 0x1e:_0x4ef90c[_0x5428d4(0x1a2)][0x0]['z']=parseFloat(_0x1b331c[_0x5428d4(0x183)]);break;case 0xb:_0x4ef90c[_0x5428d4(0x1a2)][0x1]['x']=parseFloat(_0x1b331c[_0x5428d4(0x183)]);break;case 0x15:_0x4ef90c[_0x5428d4(0x1a2)][0x1]['y']=parseFloat(_0x1b331c['value']);break;case 0x1f:_0x4ef90c[_0x5428d4(0x1a2)][0x1]['z']=parseFloat(_0x1b331c['value']);break;case 0xc:_0x4ef90c[_0x5428d4(0x1a2)][0x2]['x']=parseFloat(_0x1b331c[_0x5428d4(0x183)]);break;case 0x16:_0x4ef90c[_0x5428d4(0x1a2)][0x2]['y']=parseFloat(_0x1b331c[_0x5428d4(0x183)]);break;case 0x20:_0x4ef90c[_0x5428d4(0x1a2)][0x2]['z']=parseFloat(_0x1b331c['value']);break;case 0xd:_0x4ef90c[_0x5428d4(0x1a2)][0x3]['x']=parseFloat(_0x1b331c[_0x5428d4(0x183)]);break;case 0x17:_0x4ef90c['vertices'][0x3]['y']=parseFloat(_0x1b331c['value']);break;case 0x21:_0x4ef90c['vertices'][0x3]['z']=parseFloat(_0x1b331c[_0x5428d4(0x183)]);break;case 0x46:_0x4ef90c[_0x5428d4(0x137)]=parseInt(_0x1b331c[_0x5428d4(0x183)],0xa);break;}}return _0x4ef90c;}function parseRayEntity(_0x2ae14d,_0x2bcc98){const _0x344280=_0x20a9;_0x2ae14d['basePoint']={'x':0x0,'y':0x0,'z':0x0},_0x2ae14d['direction']={'x':0x1,'y':0x0,'z':0x0};for(const _0x1d7ab7 of _0x2bcc98){switch(_0x1d7ab7[_0x344280(0x1c9)]){case 0xa:_0x2ae14d['basePoint']['x']=parseFloat(_0x1d7ab7['value']);break;case 0x14:_0x2ae14d[_0x344280(0x126)]['y']=parseFloat(_0x1d7ab7[_0x344280(0x183)]);break;case 0x1e:_0x2ae14d['basePoint']['z']=parseFloat(_0x1d7ab7[_0x344280(0x183)]);break;case 0xb:_0x2ae14d[_0x344280(0x1f3)]['x']=parseFloat(_0x1d7ab7[_0x344280(0x183)]);break;case 0x15:_0x2ae14d[_0x344280(0x1f3)]['y']=parseFloat(_0x1d7ab7['value']);break;case 0x1f:_0x2ae14d[_0x344280(0x1f3)]['z']=parseFloat(_0x1d7ab7[_0x344280(0x183)]);break;}}return _0x2ae14d;}function parseViewportEntity(_0x5e7f0b,_0x46edcc){const _0x1e818c=_0x20a9;_0x5e7f0b[_0x1e818c(0x155)]={'x':0x0,'y':0x0,'z':0x0},_0x5e7f0b['width']=0x0,_0x5e7f0b[_0x1e818c(0x20f)]=0x0,_0x5e7f0b[_0x1e818c(0x10c)]={'x':0x0,'y':0x0,'z':0x0},_0x5e7f0b[_0x1e818c(0x1d7)]={'x':0x0,'y':0x0,'z':0x1},_0x5e7f0b[_0x1e818c(0x1cb)]=0x0,_0x5e7f0b[_0x1e818c(0x11d)]=0x0,_0x5e7f0b[_0x1e818c(0x110)]={'x':0x0,'y':0x0},_0x5e7f0b[_0x1e818c(0x1cc)]=0x32,_0x5e7f0b['statusField']=0x0,_0x5e7f0b['clippingBoundary']=null,_0x5e7f0b[_0x1e818c(0x1ac)]=[];for(const _0x1e0562 of _0x46edcc){switch(_0x1e0562[_0x1e818c(0x1c9)]){case 0xa:_0x5e7f0b[_0x1e818c(0x155)]['x']=parseFloat(_0x1e0562['value']);break;case 0x14:_0x5e7f0b[_0x1e818c(0x155)]['y']=parseFloat(_0x1e0562[_0x1e818c(0x183)]);break;case 0x1e:_0x5e7f0b['center']['z']=parseFloat(_0x1e0562['value']);break;case 0xc:_0x5e7f0b[_0x1e818c(0x110)]['x']=parseFloat(_0x1e0562[_0x1e818c(0x183)]);break;case 0x16:_0x5e7f0b['viewCenter']['y']=parseFloat(_0x1e0562[_0x1e818c(0x183)]);break;case 0x28:_0x5e7f0b[_0x1e818c(0x156)]=parseFloat(_0x1e0562[_0x1e818c(0x183)]);break;case 0x29:_0x5e7f0b['height']=parseFloat(_0x1e0562['value']);break;case 0x2d:_0x5e7f0b['viewHeight']=parseFloat(_0x1e0562[_0x1e818c(0x183)]);break;case 0x33:_0x5e7f0b[_0x1e818c(0x1cb)]=parseFloat(_0x1e0562[_0x1e818c(0x183)]);break;case 0x44:_0x5e7f0b[_0x1e818c(0x14f)]=parseInt(_0x1e0562[_0x1e818c(0x183)],0xa);break;case 0x45:_0x5e7f0b['id']=parseInt(_0x1e0562[_0x1e818c(0x183)],0xa);break;case 0x14b:_0x5e7f0b['frozenLayers'][_0x1e818c(0x1a0)](_0x1e0562[_0x1e818c(0x183)]);break;case 0x154:_0x5e7f0b[_0x1e818c(0x161)]=_0x1e0562[_0x1e818c(0x183)];break;}}return _0x5e7f0b;}function parseImageEntity(_0x14bd17,_0x4b0471){const _0x37572d=_0x20a9;_0x14bd17[_0x37572d(0x109)]={'x':0x0,'y':0x0,'z':0x0},_0x14bd17[_0x37572d(0x171)]={'x':0x1,'y':0x0,'z':0x0},_0x14bd17['vVector']={'x':0x0,'y':0x1,'z':0x0},_0x14bd17[_0x37572d(0x1a5)]={'u':0x0,'v':0x0},_0x14bd17['imageDefHandle']='',_0x14bd17[_0x37572d(0x10d)]=0x0,_0x14bd17[_0x37572d(0x13e)]=0x0,_0x14bd17[_0x37572d(0x168)]=0x32,_0x14bd17[_0x37572d(0x1eb)]=0x32,_0x14bd17[_0x37572d(0x144)]=0x0,_0x14bd17[_0x37572d(0x18e)]=[];for(const _0x279bb7 of _0x4b0471){switch(_0x279bb7['code']){case 0xa:_0x14bd17['insertionPoint']['x']=parseFloat(_0x279bb7[_0x37572d(0x183)]);break;case 0x14:_0x14bd17['insertionPoint']['y']=parseFloat(_0x279bb7['value']);break;case 0x1e:_0x14bd17[_0x37572d(0x109)]['z']=parseFloat(_0x279bb7[_0x37572d(0x183)]);break;case 0xd:_0x14bd17[_0x37572d(0x1a5)]['u']=parseFloat(_0x279bb7[_0x37572d(0x183)]);break;case 0x17:_0x14bd17[_0x37572d(0x1a5)]['v']=parseFloat(_0x279bb7[_0x37572d(0x183)]);break;case 0xe:_0x14bd17['clippingVertices'][_0x37572d(0x1a0)]({'x':parseFloat(_0x279bb7[_0x37572d(0x183)])});break;case 0x18:if(_0x14bd17[_0x37572d(0x18e)]['length']>0x0)_0x14bd17['clippingVertices'][_0x14bd17[_0x37572d(0x18e)]['length']-0x1]['y']=parseFloat(_0x279bb7['value']);break;case 0x46:_0x14bd17['displayFlags']=parseInt(_0x279bb7[_0x37572d(0x183)],0xa);break;case 0x154:_0x14bd17['imageDefHandle']=_0x279bb7[_0x37572d(0x183)];break;}}return _0x14bd17;}function parseToleranceEntity(_0x59fb0a,_0xc9196d){const _0x349678=_0x20a9;_0x59fb0a[_0x349678(0x109)]={'x':0x0,'y':0x0,'z':0x0},_0x59fb0a[_0x349678(0x1f3)]={'x':0x1,'y':0x0,'z':0x0},_0x59fb0a[_0x349678(0x17d)]=_0x349678(0x176),_0x59fb0a[_0x349678(0x20a)]='';for(const _0x5e5a16 of _0xc9196d){switch(_0x5e5a16['code']){case 0x1:_0x59fb0a[_0x349678(0x20a)]=_0x5e5a16[_0x349678(0x183)];break;case 0x3:_0x59fb0a['styleName']=_0x5e5a16['value'];break;case 0xa:_0x59fb0a['insertionPoint']['x']=parseFloat(_0x5e5a16[_0x349678(0x183)]);break;case 0x14:_0x59fb0a['insertionPoint']['y']=parseFloat(_0x5e5a16['value']);break;case 0x1e:_0x59fb0a[_0x349678(0x109)]['z']=parseFloat(_0x5e5a16[_0x349678(0x183)]);break;case 0xb:_0x59fb0a['direction']['x']=parseFloat(_0x5e5a16[_0x349678(0x183)]);break;case 0x15:_0x59fb0a[_0x349678(0x1f3)]['y']=parseFloat(_0x5e5a16[_0x349678(0x183)]);break;case 0x1f:_0x59fb0a[_0x349678(0x1f3)]['z']=parseFloat(_0x5e5a16['value']);break;}}return _0x59fb0a;}function parseHelixEntity(_0x40f9ed,_0x4d8b6a){const _0xa5d7af=_0x20a9;_0x40f9ed[_0xa5d7af(0x148)]={'x':0x0,'y':0x0,'z':0x0},_0x40f9ed[_0xa5d7af(0x166)]={'x':0x0,'y':0x0,'z':0x0},_0x40f9ed[_0xa5d7af(0x1d0)]={'x':0x0,'y':0x0,'z':0x1},_0x40f9ed['radius']=0x0,_0x40f9ed[_0xa5d7af(0x209)]=0x1,_0x40f9ed[_0xa5d7af(0x17f)]=0x0,_0x40f9ed['handedness']=0x0,_0x40f9ed[_0xa5d7af(0x13f)]=0x0;for(const _0x42b16f of _0x4d8b6a){switch(_0x42b16f[_0xa5d7af(0x1c9)]){case 0xa:_0x40f9ed[_0xa5d7af(0x148)]['x']=parseFloat(_0x42b16f[_0xa5d7af(0x183)]);break;case 0x14:_0x40f9ed[_0xa5d7af(0x148)]['y']=parseFloat(_0x42b16f[_0xa5d7af(0x183)]);break;case 0x1e:_0x40f9ed['axisBasePoint']['z']=parseFloat(_0x42b16f['value']);break;case 0xb:_0x40f9ed['startPoint']['x']=parseFloat(_0x42b16f['value']);break;case 0x15:_0x40f9ed[_0xa5d7af(0x166)]['y']=parseFloat(_0x42b16f[_0xa5d7af(0x183)]);break;case 0x1f:_0x40f9ed[_0xa5d7af(0x166)]['z']=parseFloat(_0x42b16f[_0xa5d7af(0x183)]);break;case 0x28:_0x40f9ed[_0xa5d7af(0x15a)]=parseFloat(_0x42b16f['value']);break;case 0x29:_0x40f9ed[_0xa5d7af(0x209)]=parseFloat(_0x42b16f[_0xa5d7af(0x183)]);break;case 0x2a:_0x40f9ed[_0xa5d7af(0x17f)]=parseFloat(_0x42b16f[_0xa5d7af(0x183)]);break;case 0x122:_0x40f9ed[_0xa5d7af(0x12e)]=parseInt(_0x42b16f[_0xa5d7af(0x183)],0xa);break;case 0x118:_0x40f9ed[_0xa5d7af(0x13f)]=parseInt(_0x42b16f[_0xa5d7af(0x183)],0xa);break;}}return _0x40f9ed;}function parseMeshEntity(_0x422f50,_0x3c369d){const _0x48c448=_0x20a9;_0x422f50[_0x48c448(0x163)]=0x2,_0x422f50[_0x48c448(0x1fb)]=0x0,_0x422f50[_0x48c448(0x1a2)]=[],_0x422f50[_0x48c448(0x145)]=[],_0x422f50[_0x48c448(0x12f)]=[],_0x422f50[_0x48c448(0x135)]=[];let _0x4e3804=null,_0x189d58=![],_0x2b0c20=![],_0x3a9784=![];for(const _0x4b9f27 of _0x3c369d){switch(_0x4b9f27[_0x48c448(0x1c9)]){case 0x47:_0x422f50[_0x48c448(0x163)]=parseInt(_0x4b9f27[_0x48c448(0x183)],0xa);break;case 0x48:_0x422f50[_0x48c448(0x1fb)]=parseInt(_0x4b9f27['value'],0xa);break;case 0x5b:_0x189d58=![];break;case 0x5c:_0x189d58=!![];break;case 0x5d:_0x2b0c20=!![],_0x189d58=![];break;case 0x5e:_0x3a9784=!![],_0x2b0c20=![];break;case 0x5f:_0x3a9784=![];break;case 0xa:_0x4e3804=parseFloat(_0x4b9f27[_0x48c448(0x183)]);break;case 0x14:_0x4e3804!==null&&(_0x422f50[_0x48c448(0x1a2)][_0x48c448(0x1a0)]({'x':_0x4e3804,'y':parseFloat(_0x4b9f27[_0x48c448(0x183)]),'z':0x0}),_0x4e3804=null);break;case 0x1e:if(_0x422f50[_0x48c448(0x1a2)][_0x48c448(0x210)]>0x0)_0x422f50['vertices'][_0x422f50['vertices'][_0x48c448(0x210)]-0x1]['z']=parseFloat(_0x4b9f27['value']);break;case 0x5a:if(_0x189d58)_0x422f50[_0x48c448(0x145)][_0x48c448(0x1a0)](parseInt(_0x4b9f27[_0x48c448(0x183)],0xa));else {if(_0x2b0c20)_0x422f50[_0x48c448(0x12f)][_0x48c448(0x1a0)](parseInt(_0x4b9f27[_0x48c448(0x183)],0xa));}break;case 0x8c:if(_0x3a9784)_0x422f50[_0x48c448(0x135)][_0x48c448(0x1a0)](parseFloat(_0x4b9f27[_0x48c448(0x183)]));break;}}return _0x422f50;}function parseRegionEntity(_0x5acb7f,_0x4c8a1a){const _0x5655cf=_0x20a9;_0x5acb7f[_0x5655cf(0x1c2)]=[];for(const _0x3cff72 of _0x4c8a1a){if(_0x3cff72[_0x5655cf(0x1c9)]===0x1||_0x3cff72['code']===0x3)_0x5acb7f[_0x5655cf(0x1c2)][_0x5655cf(0x1a0)](_0x3cff72[_0x5655cf(0x183)]);if(_0x3cff72[_0x5655cf(0x1c9)]===0x46)_0x5acb7f[_0x5655cf(0x16d)]=parseInt(_0x3cff72[_0x5655cf(0x183)],0xa);}return _0x5acb7f[_0x5655cf(0x1fd)]=_0x5acb7f[_0x5655cf(0x1c2)][_0x5655cf(0x15c)](''),_0x5acb7f;}function parseOle2Entity(_0x40d211,_0x17c050){const _0x507733=_0x20a9;_0x40d211[_0x507733(0x16b)]={'x':0x0,'y':0x0,'z':0x0},_0x40d211[_0x507733(0x138)]={'x':0x0,'y':0x0,'z':0x0},_0x40d211[_0x507733(0x112)]=0x0,_0x40d211[_0x507733(0x134)]=0x0;for(const _0x2b0977 of _0x17c050){switch(_0x2b0977['code']){case 0xa:_0x40d211[_0x507733(0x16b)]['x']=parseFloat(_0x2b0977['value']);break;case 0x14:_0x40d211[_0x507733(0x16b)]['y']=parseFloat(_0x2b0977[_0x507733(0x183)]);break;case 0xb:_0x40d211['lowerRightCorner']['x']=parseFloat(_0x2b0977[_0x507733(0x183)]);break;case 0x15:_0x40d211[_0x507733(0x138)]['y']=parseFloat(_0x2b0977[_0x507733(0x183)]);break;case 0x46:_0x40d211[_0x507733(0x112)]=parseInt(_0x2b0977[_0x507733(0x183)],0xa);break;case 0x47:_0x40d211['tileMode']=parseInt(_0x2b0977[_0x507733(0x183)],0xa);break;case 0x1:case 0x3:_0x40d211[_0x507733(0x178)]=_0x40d211[_0x507733(0x178)]||[],_0x40d211[_0x507733(0x178)][_0x507733(0x1a0)](_0x2b0977['value']);break;}}return _0x40d211;}function parseTableEntity(_0x905fd4,_0x12844b){const _0x58a1a5=_0x20a9;_0x905fd4[_0x58a1a5(0x109)]={'x':0x0,'y':0x0,'z':0x0},_0x905fd4[_0x58a1a5(0x214)]='',_0x905fd4[_0x58a1a5(0x1f3)]={'x':0x1,'y':0x0,'z':0x0},_0x905fd4['rows']=0x0,_0x905fd4[_0x58a1a5(0x120)]=0x0;for(const _0x1fff61 of _0x12844b){switch(_0x1fff61['code']){case 0x2:_0x905fd4[_0x58a1a5(0x214)]=_0x1fff61[_0x58a1a5(0x183)];break;case 0xa:_0x905fd4['insertionPoint']['x']=parseFloat(_0x1fff61[_0x58a1a5(0x183)]);break;case 0x14:_0x905fd4[_0x58a1a5(0x109)]['y']=parseFloat(_0x1fff61[_0x58a1a5(0x183)]);break;case 0xb:_0x905fd4['direction']['x']=parseFloat(_0x1fff61[_0x58a1a5(0x183)]);break;case 0x15:_0x905fd4[_0x58a1a5(0x1f3)]['y']=parseFloat(_0x1fff61[_0x58a1a5(0x183)]);break;case 0x5b:_0x905fd4[_0x58a1a5(0x1e7)]=parseInt(_0x1fff61[_0x58a1a5(0x183)],0xa);break;case 0x5c:_0x905fd4[_0x58a1a5(0x120)]=parseInt(_0x1fff61[_0x58a1a5(0x183)],0xa);break;case 0x8e:_0x905fd4[_0x58a1a5(0x122)]=_0x905fd4[_0x58a1a5(0x122)]||[],_0x905fd4['rowHeights']['push'](parseFloat(_0x1fff61[_0x58a1a5(0x183)]));break;case 0x8d:_0x905fd4[_0x58a1a5(0x1f9)]=_0x905fd4['columnWidths']||[],_0x905fd4[_0x58a1a5(0x1f9)]['push'](parseFloat(_0x1fff61['value']));break;}}return _0x905fd4;}function parseMLineEntity(_0x10762f,_0x3db9dd){const _0x39e6eb=_0x20a9;_0x10762f[_0x39e6eb(0x17d)]=_0x39e6eb(0x176),_0x10762f['scale']=0x1,_0x10762f['justification']=0x0,_0x10762f[_0x39e6eb(0x1ee)]=0x0,_0x10762f[_0x39e6eb(0x166)]={'x':0x0,'y':0x0,'z':0x0},_0x10762f[_0x39e6eb(0x15b)]={'x':0x0,'y':0x0,'z':0x1},_0x10762f[_0x39e6eb(0x1a2)]=[];let _0x11e2f2=null;for(const _0x4cc505 of _0x3db9dd){switch(_0x4cc505['code']){case 0x2:_0x10762f[_0x39e6eb(0x17d)]=_0x4cc505[_0x39e6eb(0x183)];break;case 0xa:_0x10762f[_0x39e6eb(0x166)]['x']=parseFloat(_0x4cc505[_0x39e6eb(0x183)]);break;case 0x14:_0x10762f['startPoint']['y']=parseFloat(_0x4cc505['value']);break;case 0x1e:_0x10762f[_0x39e6eb(0x166)]['z']=parseFloat(_0x4cc505[_0x39e6eb(0x183)]);break;case 0xb:_0x11e2f2=parseFloat(_0x4cc505[_0x39e6eb(0x183)]);break;case 0x15:_0x11e2f2!==null&&(_0x10762f[_0x39e6eb(0x1a2)][_0x39e6eb(0x1a0)]({'x':_0x11e2f2,'y':parseFloat(_0x4cc505[_0x39e6eb(0x183)]),'z':0x0}),_0x11e2f2=null);break;case 0x1f:if(_0x10762f[_0x39e6eb(0x1a2)][_0x39e6eb(0x210)]>0x0)_0x10762f['vertices'][_0x10762f[_0x39e6eb(0x1a2)][_0x39e6eb(0x210)]-0x1]['z']=parseFloat(_0x4cc505[_0x39e6eb(0x183)]);break;case 0x28:_0x10762f['scale']=parseFloat(_0x4cc505['value']);break;case 0x46:_0x10762f['justification']=parseInt(_0x4cc505[_0x39e6eb(0x183)],0xa);break;case 0x47:_0x10762f[_0x39e6eb(0x1ee)]=parseInt(_0x4cc505[_0x39e6eb(0x183)],0xa);break;case 0x48:_0x10762f[_0x39e6eb(0x1d3)]=parseInt(_0x4cc505['value'],0xa);break;case 0x154:_0x10762f[_0x39e6eb(0x1d2)]=_0x4cc505[_0x39e6eb(0x183)];break;case 0xd2:_0x10762f['normal']['x']=parseFloat(_0x4cc505[_0x39e6eb(0x183)]);break;case 0xdc:_0x10762f['normal']['y']=parseFloat(_0x4cc505[_0x39e6eb(0x183)]);break;case 0xe6:_0x10762f['normal']['z']=parseFloat(_0x4cc505[_0x39e6eb(0x183)]);break;}}return _0x10762f;}function parseGenericEntity(_0x4b398b,_0x189ce2){const _0x50f07f=_0x20a9;_0x4b398b[_0x50f07f(0x1b4)]={};for(const _0x4fcbc8 of _0x189ce2){const _0xe91e74=_0x50f07f(0x1f2)+_0x4fcbc8[_0x50f07f(0x1c9)],_0x52a1ec=autoConvert(_0x4fcbc8[_0x50f07f(0x1c9)],_0x4fcbc8[_0x50f07f(0x183)]);if(_0x4b398b[_0x50f07f(0x1b4)][_0xe91e74]!==undefined)_0x4b398b[_0x50f07f(0x1b4)][_0xe91e74]=[][_0x50f07f(0x1f4)](_0x4b398b[_0x50f07f(0x1b4)][_0xe91e74],_0x52a1ec);else _0x4b398b['data'][_0xe91e74]=_0x52a1ec;}return _0x4b398b;}function parseObjects(_0x393e36){const _0x3ebd71=_0x20a9;if(!_0x393e36||_0x393e36[_0x3ebd71(0x210)]===0x0)return [];const _0x1c2fbb=[];let _0x31134e=0x0;while(_0x31134e<_0x393e36[_0x3ebd71(0x210)]){if(_0x393e36[_0x31134e]['code']===0x0){const _0x366696=_0x393e36[_0x31134e][_0x3ebd71(0x183)];_0x31134e++;const _0x442b21={'type':_0x366696};while(_0x31134e<_0x393e36['length']&&_0x393e36[_0x31134e]['code']!==0x0){const _0xf8d15a=_0x393e36[_0x31134e][_0x3ebd71(0x1c9)],_0xd194e7=autoConvert(_0xf8d15a,_0x393e36[_0x31134e][_0x3ebd71(0x183)]);switch(_0xf8d15a){case 0x5:_0x442b21[_0x3ebd71(0x179)]=_0xd194e7;break;case 0x2:_0x442b21[_0x3ebd71(0x152)]=_0xd194e7;break;case 0x3:_0x442b21['entryName']=_0x442b21[_0x3ebd71(0x164)]?[][_0x3ebd71(0x1f4)](_0x442b21[_0x3ebd71(0x164)],_0xd194e7):_0xd194e7;break;case 0x14a:_0x442b21[_0x3ebd71(0x10e)]=_0xd194e7;break;case 0x15e:_0x442b21[_0x3ebd71(0x17e)]=_0x442b21[_0x3ebd71(0x17e)]?[][_0x3ebd71(0x1f4)](_0x442b21['softPointer'],_0xd194e7):_0xd194e7;break;case 0x168:_0x442b21[_0x3ebd71(0x16f)]=_0x442b21[_0x3ebd71(0x16f)]?[][_0x3ebd71(0x1f4)](_0x442b21[_0x3ebd71(0x16f)],_0xd194e7):_0xd194e7;break;default:const _0x2925d4='code_'+_0xf8d15a;if(_0x442b21[_0x2925d4]!==undefined)_0x442b21[_0x2925d4]=[][_0x3ebd71(0x1f4)](_0x442b21[_0x2925d4],_0xd194e7);else _0x442b21[_0x2925d4]=_0xd194e7;}_0x31134e++;}_0x1c2fbb[_0x3ebd71(0x1a0)](_0x442b21);}else _0x31134e++;}return _0x1c2fbb;}function assemblePolylineVertices(_0x5ab783){const _0x9293bf=_0x20a9,_0x4c556b=[];let _0x1dcfef=null;for(const _0x41bf9b of _0x5ab783){if(_0x41bf9b[_0x9293bf(0x1dd)]===_0x9293bf(0x1ff))_0x1dcfef=_0x41bf9b,_0x4c556b[_0x9293bf(0x1a0)](_0x41bf9b);else {if(_0x41bf9b['type']===_0x9293bf(0x19a)&&_0x1dcfef)_0x1dcfef[_0x9293bf(0x1a2)][_0x9293bf(0x1a0)]({'x':_0x41bf9b[_0x9293bf(0x173)]['x'],'y':_0x41bf9b[_0x9293bf(0x173)]['y'],'z':_0x41bf9b[_0x9293bf(0x173)]['z'],'bulge':_0x41bf9b[_0x9293bf(0x200)],'startWidth':_0x41bf9b[_0x9293bf(0x1c4)],'endWidth':_0x41bf9b[_0x9293bf(0x204)],'flags':_0x41bf9b['flags'],'faceVertex1':_0x41bf9b['faceVertex1'],'faceVertex2':_0x41bf9b['faceVertex2'],'faceVertex3':_0x41bf9b[_0x9293bf(0x212)],'faceVertex4':_0x41bf9b[_0x9293bf(0x20d)]});else _0x41bf9b[_0x9293bf(0x1dd)]==='SEQEND'?_0x1dcfef=null:(_0x1dcfef=null,_0x4c556b['push'](_0x41bf9b));}}return _0x4c556b;}function assembleInsertAttributes(_0x5bb747){const _0xac35b9=_0x20a9,_0x4726db=[];let _0x2e071f=null;for(const _0x2175de of _0x5bb747){if(_0x2175de['type']===_0xac35b9(0x146)&&_0x2175de[_0xac35b9(0x1e8)])_0x2e071f=_0x2175de,_0x4726db[_0xac35b9(0x1a0)](_0x2175de);else {if(_0x2175de[_0xac35b9(0x1dd)]===_0xac35b9(0x205)&&_0x2e071f)_0x2e071f[_0xac35b9(0x127)][_0xac35b9(0x1a0)](_0x2175de);else _0x2175de[_0xac35b9(0x1dd)]===_0xac35b9(0x181)?_0x2e071f=null:(_0x2e071f=null,_0x4726db[_0xac35b9(0x1a0)](_0x2175de));}}return _0x4726db;}async function fetchDxfFromUrl(_0x36af16){const _0x108b1c=_0x20a9;if(typeof fetch===_0x108b1c(0x1e5)){const _0x24ac00=await fetch(_0x36af16);if(!_0x24ac00['ok'])throw new Error(_0x108b1c(0x196)+_0x24ac00[_0x108b1c(0x116)]+_0x108b1c(0x10a)+_0x36af16);return await _0x24ac00['text']();}if(typeof process!==_0x108b1c(0x1d8)&&process[_0x108b1c(0x1f1)]?.[_0x108b1c(0x15d)]){const {default:_0x28ba6c}=_0x36af16['startsWith']('https')?await import(_0x108b1c(0x175)):await import(_0x108b1c(0x124));return new Promise((_0x3a64ce,_0x33a55d)=>{const _0x5d0d31=_0x108b1c;_0x28ba6c[_0x5d0d31(0x13b)](_0x36af16,_0x5f5c40=>{const _0x311ce7=_0x5d0d31;if(_0x5f5c40[_0x311ce7(0x1df)]!==0xc8){_0x33a55d(new Error(_0x311ce7(0x186)+_0x5f5c40['statusCode']));return;}let _0x4a3ba7='';_0x5f5c40['setEncoding'](_0x311ce7(0x128)),_0x5f5c40['on']('data',_0x33a56f=>_0x4a3ba7+=_0x33a56f),_0x5f5c40['on']('end',()=>_0x3a64ce(_0x4a3ba7)),_0x5f5c40['on'](_0x311ce7(0x1b0),_0x33a55d);})['on']('error',_0x33a55d);});}throw new Error('当前环境不支持\x20HTTP\x20请求');}async function readLocalFile(_0x4bd8f5){const _0x8fc569=_0x20a9;if(typeof process!==_0x8fc569(0x1d8)&&process[_0x8fc569(0x1f1)]?.[_0x8fc569(0x15d)]){const {readFile:_0x16dc18}=await import('fs/promises');return await _0x16dc18(_0x4bd8f5,'utf-8');}throw new Error('浏览器不支持读取本地路径,请用\x20URL\x20或\x20File\x20对象');}async function parseDxf(_0x390d60){const _0xdab701=_0x20a9;let _0x3e20e1;if(typeof Blob!==_0xdab701(0x1d8)&&_0x390d60 instanceof Blob)_0x3e20e1=await _0x390d60['text']();else {if(typeof _0x390d60===_0xdab701(0x129)){if(_0x390d60[_0xdab701(0x169)]('\x0a')||_0x390d60[_0xdab701(0x169)](_0xdab701(0x1af)))_0x3e20e1=_0x390d60;else /^https?:\/\//i[_0xdab701(0x19d)](_0x390d60)?_0x3e20e1=await fetchDxfFromUrl(_0x390d60):_0x3e20e1=await readLocalFile(_0x390d60);}else throw new Error('parseDxf:\x20请传入\x20DXF\x20字符串、文件路径、URL\x20或\x20File\x20对象');}const _0x2e3182=tokenize(_0x3e20e1),_0x56c4a2=splitSections(_0x2e3182),_0x19a63c={'header':parseHeader(_0x56c4a2[_0xdab701(0x1fa)]),'classes':parseClasses(_0x56c4a2[_0xdab701(0x1ef)]),'tables':parseTables(_0x56c4a2[_0xdab701(0x125)]),'blocks':parseBlocks(_0x56c4a2['BLOCKS']),'entities':parseEntityList(_0x56c4a2[_0xdab701(0x1f6)]||[]),'objects':parseObjects(_0x56c4a2[_0xdab701(0x1ec)])};_0x19a63c[_0xdab701(0x10b)]=assemblePolylineVertices(_0x19a63c[_0xdab701(0x10b)]),_0x19a63c[_0xdab701(0x10b)]=assembleInsertAttributes(_0x19a63c[_0xdab701(0x10b)]);for(const _0x3243fc of _0x19a63c[_0xdab701(0x1aa)]){_0x3243fc['entities']&&_0x3243fc[_0xdab701(0x10b)]['length']>0x0&&(_0x3243fc[_0xdab701(0x10b)]=assemblePolylineVertices(_0x3243fc[_0xdab701(0x10b)]),_0x3243fc['entities']=assembleInsertAttributes(_0x3243fc['entities']));}return _0x19a63c;}
13
4
 
14
- // ─────────────────── 工具函数 ───────────────────
15
- // (这部分和你原来的完全一样,一行不改)
5
+ const _0x2f0375=_0x4941;(function(_0x47d067,_0x1c4fd9){const _0x4494c8=_0x4941,_0x12a8e5=_0x47d067();while(!![]){try{const _0x8350a9=parseInt(_0x4494c8(0x14e))/0x1*(-parseInt(_0x4494c8(0x178))/0x2)+-parseInt(_0x4494c8(0x1b8))/0x3+-parseInt(_0x4494c8(0x10b))/0x4+-parseInt(_0x4494c8(0x159))/0x5*(-parseInt(_0x4494c8(0x127))/0x6)+parseInt(_0x4494c8(0x13d))/0x7*(-parseInt(_0x4494c8(0x10a))/0x8)+-parseInt(_0x4494c8(0x181))/0x9*(parseInt(_0x4494c8(0x176))/0xa)+parseInt(_0x4494c8(0x10f))/0xb*(parseInt(_0x4494c8(0x165))/0xc);if(_0x8350a9===_0x1c4fd9)break;else _0x12a8e5['push'](_0x12a8e5['shift']());}catch(_0x110130){_0x12a8e5['push'](_0x12a8e5['shift']());}}}(_0x48d4,0x6d95b));function pair(_0x8f6135,_0xdf1b70){if(_0xdf1b70===undefined||_0xdf1b70===null)return '';return '\x20\x20'+_0x8f6135+'\x0a'+_0xdf1b70+'\x0a';}function pairF(_0x377c9b,_0x13e934){if(_0x13e934===undefined||_0x13e934===null)return '';return pair(_0x377c9b,formatFloat(_0x13e934));}function formatFloat(_0x3be9df){const _0x5a76d1=_0x4941;if(typeof _0x3be9df!=='number'||isNaN(_0x3be9df))return '0.0';let _0x22c29f=_0x3be9df[_0x5a76d1(0x155)](0x6);_0x22c29f=_0x22c29f[_0x5a76d1(0x135)](/(\.\d*?)0+$/,'$1');if(_0x22c29f['endsWith']('.'))_0x22c29f+='0';return _0x22c29f;}function pairI(_0x4d3efa,_0x1a56c6){const _0x3ef841=_0x4941;if(_0x1a56c6===undefined||_0x1a56c6===null)return '';return pair(_0x4d3efa,Math[_0x3ef841(0x187)](_0x1a56c6));}function writePoint3D(_0x3f415d,_0x34cc6b){if(!_0x34cc6b)return '';return pairF(_0x3f415d,_0x34cc6b['x'])+pairF(_0x3f415d+0xa,_0x34cc6b['y'])+pairF(_0x3f415d+0x14,_0x34cc6b['z']);}function writePoint2D(_0x5ac6a1,_0x4f8a3b){if(!_0x4f8a3b)return '';return pairF(_0x5ac6a1,_0x4f8a3b['x'])+pairF(_0x5ac6a1+0xa,_0x4f8a3b['y']);}function writeExtrusion(_0x3e72d0){if(!_0x3e72d0)return '';if(_0x3e72d0['x']===0x0&&_0x3e72d0['y']===0x0&&_0x3e72d0['z']===0x1)return '';return pairF(0xd2,_0x3e72d0['x'])+pairF(0xdc,_0x3e72d0['y'])+pairF(0xe6,_0x3e72d0['z']);}function writeHeader(_0x300d07){const _0x1d5c80=_0x4941;if(!_0x300d07||Object[_0x1d5c80(0x104)](_0x300d07)[_0x1d5c80(0x1ee)]===0x0)return '';let _0x2e3620=pair(0x0,_0x1d5c80(0x177))+pair(0x2,_0x1d5c80(0x17c));for(const [_0x28da1e,_0x59a8e5]of Object['entries'](_0x300d07)){_0x2e3620+=pair(0x9,_0x28da1e);if(typeof _0x59a8e5===_0x1d5c80(0x1b5)&&_0x59a8e5!==null&&!Array[_0x1d5c80(0x1d6)](_0x59a8e5))for(const [_0x15687d,_0x2d0944]of Object[_0x1d5c80(0x151)](_0x59a8e5)){_0x2e3620+=pair(parseInt(_0x15687d),_0x2d0944);}else _0x2e3620+=pair(0x1,_0x59a8e5);}return _0x2e3620+=pair(0x0,_0x1d5c80(0x18c)),_0x2e3620;}function writeClasses(_0x1fc6c1){const _0x582f6d=_0x4941;if(!_0x1fc6c1||_0x1fc6c1[_0x582f6d(0x1ee)]===0x0)return '';let _0x4c2ed2=pair(0x0,'SECTION')+pair(0x2,_0x582f6d(0x197));for(const _0x5bc352 of _0x1fc6c1){_0x4c2ed2+=pair(0x0,_0x582f6d(0x210));if(_0x5bc352[_0x582f6d(0x168)])_0x4c2ed2+=pair(0x1,_0x5bc352[_0x582f6d(0x168)]);if(_0x5bc352[_0x582f6d(0x111)])_0x4c2ed2+=pair(0x2,_0x5bc352['cppClassName']);if(_0x5bc352[_0x582f6d(0x1da)])_0x4c2ed2+=pair(0x3,_0x5bc352[_0x582f6d(0x1da)]);if(_0x5bc352['proxyCapabilities']!==undefined)_0x4c2ed2+=pairI(0x5a,_0x5bc352['proxyCapabilities']);if(_0x5bc352[_0x582f6d(0x19d)]!==undefined)_0x4c2ed2+=pairI(0x5b,_0x5bc352[_0x582f6d(0x19d)]);if(_0x5bc352[_0x582f6d(0x133)]!==undefined)_0x4c2ed2+=pairI(0x118,_0x5bc352['wasProxy']);if(_0x5bc352[_0x582f6d(0x192)]!==undefined)_0x4c2ed2+=pairI(0x119,_0x5bc352[_0x582f6d(0x192)]);}return _0x4c2ed2+=pair(0x0,_0x582f6d(0x18c)),_0x4c2ed2;}function writeTables(_0x1735c0){const _0x1a018a=_0x4941;if(!_0x1735c0||Object[_0x1a018a(0x104)](_0x1735c0)[_0x1a018a(0x1ee)]===0x0)return '';let _0x3dddf7=pair(0x0,_0x1a018a(0x177))+pair(0x2,'TABLES');for(const [_0x114473,_0x4055bd]of Object[_0x1a018a(0x151)](_0x1735c0)){_0x3dddf7+=pair(0x0,_0x1a018a(0x1a7)),_0x3dddf7+=pair(0x2,_0x114473);if(_0x4055bd[_0x1a018a(0x1ee)]>0x0){const _0x425d7=_0x4055bd[0x0];if(_0x425d7[_0x1a018a(0x1dd)])_0x3dddf7+=pair(0x5,_0x425d7[_0x1a018a(0x1dd)]);if(_0x425d7[_0x1a018a(0x110)])_0x3dddf7+=pair(0x14a,_0x425d7[_0x1a018a(0x110)]);_0x3dddf7+=pair(0x64,_0x1a018a(0x1be)),_0x3dddf7+=pairI(0x46,_0x4055bd[_0x1a018a(0x1ee)]);}for(const _0x56592f of _0x4055bd){_0x3dddf7+=pair(0x0,_0x56592f['_type']||_0x114473);if(_0x56592f[_0x1a018a(0x1dd)])_0x3dddf7+=pair(0x5,_0x56592f[_0x1a018a(0x1dd)]);if(_0x56592f[_0x1a018a(0x110)])_0x3dddf7+=pair(0x14a,_0x56592f[_0x1a018a(0x110)]);if(_0x56592f[_0x1a018a(0x1c6)]){const _0x301067=[]['concat'](_0x56592f[_0x1a018a(0x1c6)]);for(const _0x365197 of _0x301067){_0x3dddf7+=pair(0x64,_0x365197);}}if(_0x56592f[_0x1a018a(0x157)])_0x3dddf7+=pair(0x2,_0x56592f[_0x1a018a(0x157)]);if(_0x56592f[_0x1a018a(0x142)]!==undefined)_0x3dddf7+=pairI(0x46,_0x56592f[_0x1a018a(0x142)]);if(_0x56592f[_0x1a018a(0x20d)]!==undefined)_0x3dddf7+=pairI(0x3e,_0x56592f[_0x1a018a(0x20d)]);if(_0x56592f[_0x1a018a(0x145)])_0x3dddf7+=pair(0x6,_0x56592f[_0x1a018a(0x145)]);if(_0x56592f['styleName'])_0x3dddf7+=pair(0x7,_0x56592f[_0x1a018a(0x15a)]);if(_0x56592f[_0x1a018a(0x14d)])_0x3dddf7+=pairF(0x28,_0x56592f[_0x1a018a(0x14d)]);if(_0x56592f[_0x1a018a(0x13b)])_0x3dddf7+=pairF(0x29,_0x56592f[_0x1a018a(0x13b)]);if(_0x56592f[_0x1a018a(0x179)])_0x3dddf7+=pairF(0x32,_0x56592f[_0x1a018a(0x179)]);if(_0x56592f[_0x1a018a(0x15b)]!==undefined)_0x3dddf7+=pairI(0x172,_0x56592f[_0x1a018a(0x15b)]);if(_0x56592f['plotStyleHandle'])_0x3dddf7+=pair(0x186,_0x56592f[_0x1a018a(0x1c3)]);if(_0x56592f[_0x1a018a(0x1cd)])for(const [_0x5d2b02,_0x56270e]of Object[_0x1a018a(0x151)](_0x56592f)){if(_0x5d2b02[_0x1a018a(0x108)]('code_')){const _0x5c3ccc=parseInt(_0x5d2b02[_0x1a018a(0x135)](_0x1a018a(0x1cb),'')),_0x3bf785=[][_0x1a018a(0x169)](_0x56270e);for(const _0x54e9f8 of _0x3bf785){_0x3dddf7+=pair(_0x5c3ccc,_0x54e9f8);}}}}_0x3dddf7+=pair(0x0,_0x1a018a(0x15f));}return _0x3dddf7+=pair(0x0,'ENDSEC'),_0x3dddf7;}function writeBlocks(_0x4a2132){const _0x1be0b=_0x4941;if(!_0x4a2132||_0x4a2132['length']===0x0)return '';let _0x856ac=pair(0x0,_0x1be0b(0x177))+pair(0x2,_0x1be0b(0x123));for(const _0x1b56b9 of _0x4a2132){_0x856ac+=pair(0x0,_0x1be0b(0x1ca));if(_0x1b56b9[_0x1be0b(0x1dd)])_0x856ac+=pair(0x5,_0x1b56b9[_0x1be0b(0x1dd)]);if(_0x1b56b9[_0x1be0b(0x110)])_0x856ac+=pair(0x14a,_0x1b56b9[_0x1be0b(0x110)]);_0x856ac+=pair(0x64,_0x1be0b(0x1e8));if(_0x1b56b9[_0x1be0b(0x17f)])_0x856ac+=pair(0x8,_0x1b56b9['layer']);_0x856ac+=pair(0x64,'AcDbBlockBegin');if(_0x1b56b9['name'])_0x856ac+=pair(0x2,_0x1b56b9['name']);if(_0x1b56b9[_0x1be0b(0x142)]!==undefined)_0x856ac+=pairI(0x46,_0x1b56b9['flags']);_0x856ac+=pairF(0xa,_0x1b56b9['basePointX']||_0x1b56b9[_0x1be0b(0x115)]&&_0x1b56b9['basePoint']['x']||0x0),_0x856ac+=pairF(0x14,_0x1b56b9['basePointY']||_0x1b56b9[_0x1be0b(0x115)]&&_0x1b56b9[_0x1be0b(0x115)]['y']||0x0),_0x856ac+=pairF(0x1e,_0x1b56b9['basePointZ']||_0x1b56b9['basePoint']&&_0x1b56b9[_0x1be0b(0x115)]['z']||0x0);if(_0x1b56b9['name2']||_0x1b56b9[_0x1be0b(0x157)])_0x856ac+=pair(0x3,_0x1b56b9['name2']||_0x1b56b9['name']);_0x1b56b9[_0x1be0b(0x154)]&&_0x1b56b9[_0x1be0b(0x154)][_0x1be0b(0x1ee)]>0x0&&(_0x856ac+=writeEntityList(_0x1b56b9[_0x1be0b(0x154)]));_0x856ac+=pair(0x0,'ENDBLK');if(_0x1b56b9[_0x1be0b(0x1dd)])_0x856ac+=pair(0x5,_0x1b56b9['handle']);if(_0x1b56b9[_0x1be0b(0x110)])_0x856ac+=pair(0x14a,_0x1b56b9['ownerHandle']);_0x856ac+=pair(0x64,'AcDbEntity');if(_0x1b56b9[_0x1be0b(0x17f)])_0x856ac+=pair(0x8,_0x1b56b9[_0x1be0b(0x17f)]);_0x856ac+=pair(0x64,'AcDbBlockEnd');}return _0x856ac+=pair(0x0,_0x1be0b(0x18c)),_0x856ac;}function writeEntityList(_0x40bb60){let _0x44f294='';for(const _0x5a2231 of _0x40bb60){_0x44f294+=writeOneEntity(_0x5a2231);}return _0x44f294;}function writeEntitiesSection(_0x30063a){const _0x295a2a=_0x4941;if(!_0x30063a||_0x30063a[_0x295a2a(0x1ee)]===0x0)return '';let _0x1d0b80=pair(0x0,'SECTION')+pair(0x2,_0x295a2a(0x1b1));return _0x1d0b80+=writeEntityList(_0x30063a),_0x1d0b80+=pair(0x0,_0x295a2a(0x18c)),_0x1d0b80;}function writeCommonFields(_0x287ff3){const _0x5bf11a=_0x4941;let _0x403ab1='';if(_0x287ff3['handle'])_0x403ab1+=pair(0x5,_0x287ff3[_0x5bf11a(0x1dd)]);if(_0x287ff3[_0x5bf11a(0x110)])_0x403ab1+=pair(0x14a,_0x287ff3['ownerHandle']);_0x403ab1+=pair(0x64,'AcDbEntity');if(_0x287ff3[_0x5bf11a(0x1b3)])_0x403ab1+=pairI(0x43,0x1);if(_0x287ff3[_0x5bf11a(0x17f)])_0x403ab1+=pair(0x8,_0x287ff3[_0x5bf11a(0x17f)]);if(_0x287ff3[_0x5bf11a(0x145)])_0x403ab1+=pair(0x6,_0x287ff3['linetypeName']);if(_0x287ff3[_0x5bf11a(0x20d)]!==undefined&&_0x287ff3[_0x5bf11a(0x20d)]!==0x0)_0x403ab1+=pairI(0x3e,_0x287ff3[_0x5bf11a(0x20d)]);if(_0x287ff3[_0x5bf11a(0x15b)]!==undefined)_0x403ab1+=pairI(0x172,_0x287ff3[_0x5bf11a(0x15b)]);if(_0x287ff3['linetypeScale']!==undefined&&_0x287ff3[_0x5bf11a(0x1b2)]!==0x1)_0x403ab1+=pairF(0x30,_0x287ff3[_0x5bf11a(0x1b2)]);if(_0x287ff3[_0x5bf11a(0x1ea)]===![])_0x403ab1+=pairI(0x3c,0x1);if(_0x287ff3[_0x5bf11a(0x189)])_0x403ab1+=pairI(0x1a4,_0x287ff3[_0x5bf11a(0x189)]);return _0x403ab1;}function writeOneEntity(_0x4b1058){const _0x57f919=_0x4941;if(!_0x4b1058||!_0x4b1058[_0x57f919(0x1fd)])return '';let _0x425689=pair(0x0,_0x4b1058[_0x57f919(0x1fd)]);_0x425689+=writeCommonFields(_0x4b1058);switch(_0x4b1058[_0x57f919(0x1fd)]){case _0x57f919(0x19c):_0x425689+=writeLineEntity(_0x4b1058);break;case _0x57f919(0x120):_0x425689+=writeLWPolylineEntity(_0x4b1058);break;case _0x57f919(0x161):_0x425689+=writePolylineEntity(_0x4b1058);break;case _0x57f919(0x105):_0x425689+=writeArcEntity(_0x4b1058);break;case _0x57f919(0x213):_0x425689+=writeCircleEntity(_0x4b1058);break;case 'ELLIPSE':_0x425689+=writeEllipseEntity(_0x4b1058);break;case _0x57f919(0x138):_0x425689+=writePointEntity(_0x4b1058);break;case _0x57f919(0x1e6):_0x425689+=writeTextEntity(_0x4b1058);break;case _0x57f919(0x19b):_0x425689+=writeMTextEntity(_0x4b1058);break;case 'ATTRIB':case 'ATTDEF':_0x425689+=writeAttribEntity(_0x4b1058);break;case _0x57f919(0x1af):_0x425689+=writeInsertEntity(_0x4b1058);break;case _0x57f919(0x182):_0x425689+=writeDimensionEntity(_0x4b1058);break;case _0x57f919(0x190):_0x425689+=writeLeaderEntity(_0x4b1058);break;case _0x57f919(0x19f):_0x425689+=writeMLeaderEntity(_0x4b1058);break;case _0x57f919(0x173):_0x425689+=writeHatchEntity(_0x4b1058);break;case _0x57f919(0x1a0):_0x425689+=writeSplineEntity(_0x4b1058);break;case 'SOLID':case _0x57f919(0x124):case _0x57f919(0x174):_0x425689+=writeSolidEntity(_0x4b1058);break;case _0x57f919(0x1e7):_0x425689+=write3DFaceEntity(_0x4b1058);break;case _0x57f919(0x19a):case _0x57f919(0x1a3):_0x425689+=writeRayEntity(_0x4b1058);break;case 'VIEWPORT':_0x425689+=writeViewportEntity(_0x4b1058);break;case 'IMAGE':case _0x57f919(0x1ec):_0x425689+=writeImageEntity(_0x4b1058);break;case _0x57f919(0x188):_0x425689+=writeToleranceEntity(_0x4b1058);break;case _0x57f919(0x1aa):_0x425689+=writeHelixEntity(_0x4b1058);break;case _0x57f919(0x16f):_0x425689+=writeMeshEntity(_0x4b1058);break;case 'REGION':case 'BODY':case _0x57f919(0x14b):_0x425689+=writeRegionEntity(_0x4b1058);break;case _0x57f919(0x20e):_0x425689+=writeOle2Entity(_0x4b1058);break;case _0x57f919(0x1a7):_0x425689+=writeTableEntity(_0x4b1058);break;case _0x57f919(0x175):_0x425689+=writeMLineEntity(_0x4b1058);break;case 'SEQEND':break;default:_0x425689+=writeGenericEntity(_0x4b1058);break;}return _0x425689;}function _0x4941(_0x185c88,_0x2b310e){_0x185c88=_0x185c88-0x101;const _0x48d415=_0x48d4();let _0x4941e9=_0x48d415[_0x185c88];return _0x4941e9;}function writeLineEntity(_0x2375f2){const _0x1f2f50=_0x4941;let _0x417b24=pair(0x64,'AcDbLine');if(_0x2375f2['thickness'])_0x417b24+=pairF(0x27,_0x2375f2[_0x1f2f50(0x1e9)]);return _0x417b24+=writePoint3D(0xa,_0x2375f2['startPoint']),_0x417b24+=writePoint3D(0xb,_0x2375f2[_0x1f2f50(0x1ef)]),_0x417b24+=writeExtrusion(_0x2375f2[_0x1f2f50(0x1f1)]),_0x417b24;}function writeLWPolylineEntity(_0x1832b7){const _0x30ccc3=_0x4941;let _0x3c7729=pair(0x64,'AcDbPolyline');const _0x45fac2=_0x1832b7[_0x30ccc3(0x1bf)]||[];_0x3c7729+=pairI(0x5a,_0x45fac2['length']);let _0x324046=0x0;if(_0x1832b7[_0x30ccc3(0x129)])_0x324046|=0x1;_0x3c7729+=pairI(0x46,_0x324046);if(_0x1832b7[_0x30ccc3(0x201)])_0x3c7729+=pairF(0x2b,_0x1832b7[_0x30ccc3(0x201)]);if(_0x1832b7['elevation'])_0x3c7729+=pairF(0x26,_0x1832b7[_0x30ccc3(0x1f5)]);if(_0x1832b7[_0x30ccc3(0x1e9)])_0x3c7729+=pairF(0x27,_0x1832b7[_0x30ccc3(0x1e9)]);for(const _0x3616a7 of _0x45fac2){_0x3c7729+=pairF(0xa,_0x3616a7['x']),_0x3c7729+=pairF(0x14,_0x3616a7['y']);if(_0x3616a7[_0x30ccc3(0x1e3)])_0x3c7729+=pairF(0x28,_0x3616a7['startWidth']);if(_0x3616a7[_0x30ccc3(0x1d8)])_0x3c7729+=pairF(0x29,_0x3616a7['endWidth']);if(_0x3616a7[_0x30ccc3(0x1eb)])_0x3c7729+=pairF(0x2a,_0x3616a7[_0x30ccc3(0x1eb)]);}return _0x3c7729+=writeExtrusion(_0x1832b7['extrusionDirection']),_0x3c7729;}function writePolylineEntity(_0xc0025){const _0x528feb=_0x4941;let _0x419bbf=pair(0x64,_0x528feb(0x119)),_0x1e9237=_0xc0025[_0x528feb(0x142)]||0x0;if(_0xc0025[_0x528feb(0x129)])_0x1e9237|=0x1;_0x419bbf+=pairI(0x46,_0x1e9237),_0x419bbf+=pairF(0xa,0x0),_0x419bbf+=pairF(0x14,0x0);if(_0xc0025['elevation'])_0x419bbf+=pairF(0x1e,_0xc0025[_0x528feb(0x1f5)]);if(_0xc0025[_0x528feb(0x1e9)])_0x419bbf+=pairF(0x27,_0xc0025['thickness']);if(_0xc0025[_0x528feb(0x12b)])_0x419bbf+=pairF(0x28,_0xc0025[_0x528feb(0x12b)]);if(_0xc0025[_0x528feb(0x16b)])_0x419bbf+=pairF(0x29,_0xc0025[_0x528feb(0x16b)]);if(_0xc0025[_0x528feb(0x216)])_0x419bbf+=pairI(0x47,_0xc0025[_0x528feb(0x216)]);if(_0xc0025[_0x528feb(0x1d7)])_0x419bbf+=pairI(0x48,_0xc0025['meshNVertexCount']);_0x419bbf+=writeExtrusion(_0xc0025[_0x528feb(0x1f1)]);if(_0xc0025[_0x528feb(0x1bf)]&&_0xc0025[_0x528feb(0x1bf)][_0x528feb(0x1ee)]>0x0){for(const _0x168560 of _0xc0025['vertices']){_0x419bbf+=pair(0x0,_0x528feb(0x20a));if(_0xc0025[_0x528feb(0x1dd)])_0x419bbf+=pair(0x5,'');_0x419bbf+=pair(0x64,_0x528feb(0x1e8));if(_0xc0025[_0x528feb(0x17f)])_0x419bbf+=pair(0x8,_0xc0025['layer']);_0x419bbf+=pair(0x64,_0x528feb(0x13f)),_0x419bbf+=pair(0x64,_0x528feb(0x121)),_0x419bbf+=pairF(0xa,_0x168560['x']),_0x419bbf+=pairF(0x14,_0x168560['y']),_0x419bbf+=pairF(0x1e,_0x168560['z']||0x0);if(_0x168560[_0x528feb(0x1e3)])_0x419bbf+=pairF(0x28,_0x168560[_0x528feb(0x1e3)]);if(_0x168560[_0x528feb(0x1d8)])_0x419bbf+=pairF(0x29,_0x168560['endWidth']);if(_0x168560[_0x528feb(0x1eb)])_0x419bbf+=pairF(0x2a,_0x168560[_0x528feb(0x1eb)]);if(_0x168560[_0x528feb(0x142)])_0x419bbf+=pairI(0x46,_0x168560[_0x528feb(0x142)]);}_0x419bbf+=pair(0x0,_0x528feb(0x1c9)),_0x419bbf+=pair(0x64,'AcDbEntity');if(_0xc0025[_0x528feb(0x17f)])_0x419bbf+=pair(0x8,_0xc0025[_0x528feb(0x17f)]);}return _0x419bbf;}function writeArcEntity(_0x428e25){const _0x140363=_0x4941;let _0x367a64=pair(0x64,_0x140363(0x1ed));if(_0x428e25['thickness'])_0x367a64+=pairF(0x27,_0x428e25[_0x140363(0x1e9)]);return _0x367a64+=writePoint3D(0xa,_0x428e25[_0x140363(0x130)]),_0x367a64+=pairF(0x28,_0x428e25[_0x140363(0x103)]),_0x367a64+=writeExtrusion(_0x428e25[_0x140363(0x1f1)]),_0x367a64+=pair(0x64,_0x140363(0x156)),_0x367a64+=pairF(0x32,_0x428e25['startAngle']),_0x367a64+=pairF(0x33,_0x428e25[_0x140363(0x1fe)]),_0x367a64;}function writeCircleEntity(_0xbe8dd){const _0x12ac1d=_0x4941;let _0x33fdc6=pair(0x64,_0x12ac1d(0x1ed));if(_0xbe8dd[_0x12ac1d(0x1e9)])_0x33fdc6+=pairF(0x27,_0xbe8dd[_0x12ac1d(0x1e9)]);return _0x33fdc6+=writePoint3D(0xa,_0xbe8dd[_0x12ac1d(0x130)]),_0x33fdc6+=pairF(0x28,_0xbe8dd[_0x12ac1d(0x103)]),_0x33fdc6+=writeExtrusion(_0xbe8dd[_0x12ac1d(0x1f1)]),_0x33fdc6;}function writeEllipseEntity(_0x37fa6d){const _0x5f7fc3=_0x4941;let _0x3d5666=pair(0x64,_0x5f7fc3(0x1ce));return _0x3d5666+=writePoint3D(0xa,_0x37fa6d[_0x5f7fc3(0x130)]),_0x3d5666+=writePoint3D(0xb,_0x37fa6d[_0x5f7fc3(0x17e)]),_0x3d5666+=writeExtrusion(_0x37fa6d['extrusionDirection']),_0x3d5666+=pairF(0x28,_0x37fa6d['axisRatio']),_0x3d5666+=pairF(0x29,_0x37fa6d[_0x5f7fc3(0x149)]),_0x3d5666+=pairF(0x2a,_0x37fa6d[_0x5f7fc3(0x1fe)]),_0x3d5666;}function writePointEntity(_0x16980d){const _0x438caf=_0x4941;let _0x19aaf6=pair(0x64,_0x438caf(0x1e2));_0x19aaf6+=writePoint3D(0xa,_0x16980d['position']);if(_0x16980d['thickness'])_0x19aaf6+=pairF(0x27,_0x16980d[_0x438caf(0x1e9)]);if(_0x16980d['angle'])_0x19aaf6+=pairF(0x32,_0x16980d[_0x438caf(0x179)]);return _0x19aaf6+=writeExtrusion(_0x16980d[_0x438caf(0x1f1)]),_0x19aaf6;}function writeTextEntity(_0x320161){const _0x1a5d4c=_0x4941;let _0x2a482e=pair(0x64,_0x1a5d4c(0x16c));if(_0x320161['thickness'])_0x2a482e+=pairF(0x27,_0x320161[_0x1a5d4c(0x1e9)]);_0x2a482e+=writePoint3D(0xa,_0x320161[_0x1a5d4c(0x203)]),_0x2a482e+=pairF(0x28,_0x320161[_0x1a5d4c(0x14d)]),_0x2a482e+=pair(0x1,_0x320161[_0x1a5d4c(0x18e)]);if(_0x320161['rotation'])_0x2a482e+=pairF(0x32,_0x320161[_0x1a5d4c(0x1d9)]);if(_0x320161[_0x1a5d4c(0x1fa)]&&_0x320161[_0x1a5d4c(0x1fa)]!==0x1)_0x2a482e+=pairF(0x29,_0x320161['xScale']);if(_0x320161[_0x1a5d4c(0x132)])_0x2a482e+=pairF(0x33,_0x320161['oblique']);if(_0x320161['styleName']&&_0x320161[_0x1a5d4c(0x15a)]!==_0x1a5d4c(0x141))_0x2a482e+=pair(0x7,_0x320161[_0x1a5d4c(0x15a)]);if(_0x320161[_0x1a5d4c(0x16e)])_0x2a482e+=pairI(0x47,_0x320161[_0x1a5d4c(0x16e)]);if(_0x320161[_0x1a5d4c(0x102)])_0x2a482e+=pairI(0x48,_0x320161['hAlign']);_0x2a482e+=writePoint3D(0xb,_0x320161[_0x1a5d4c(0x1df)]),_0x2a482e+=writeExtrusion(_0x320161[_0x1a5d4c(0x1f1)]),_0x2a482e+=pair(0x64,_0x1a5d4c(0x16c));if(_0x320161['vAlign'])_0x2a482e+=pairI(0x49,_0x320161['vAlign']);return _0x2a482e;}function writeMTextEntity(_0x156094){const _0x817f17=_0x4941;let _0x80fe12=pair(0x64,_0x817f17(0x18f));_0x80fe12+=writePoint3D(0xa,_0x156094[_0x817f17(0x203)]),_0x80fe12+=pairF(0x28,_0x156094[_0x817f17(0x14d)]);if(_0x156094[_0x817f17(0x164)])_0x80fe12+=pairF(0x29,_0x156094['width']);if(_0x156094[_0x817f17(0x1c0)])_0x80fe12+=pairI(0x47,_0x156094[_0x817f17(0x1c0)]);if(_0x156094[_0x817f17(0x1ba)])_0x80fe12+=pairI(0x48,_0x156094[_0x817f17(0x1ba)]);const _0x1fc581=_0x156094[_0x817f17(0x18e)]||'';if(_0x1fc581[_0x817f17(0x1ee)]>0xfa){let _0x30014f=_0x1fc581;while(_0x30014f[_0x817f17(0x1ee)]>0xfa){_0x80fe12+=pair(0x3,_0x30014f[_0x817f17(0x208)](0x0,0xfa)),_0x30014f=_0x30014f[_0x817f17(0x208)](0xfa);}_0x80fe12+=pair(0x1,_0x30014f);}else _0x80fe12+=pair(0x1,_0x1fc581);if(_0x156094[_0x817f17(0x15a)]&&_0x156094[_0x817f17(0x15a)]!==_0x817f17(0x141))_0x80fe12+=pair(0x7,_0x156094[_0x817f17(0x15a)]);if(_0x156094[_0x817f17(0x1d9)])_0x80fe12+=pairF(0x32,_0x156094[_0x817f17(0x1d9)]);if(_0x156094[_0x817f17(0x13a)])_0x80fe12+=pairI(0x49,_0x156094[_0x817f17(0x13a)]);if(_0x156094['lineSpacing']&&_0x156094[_0x817f17(0x170)]!==0x1)_0x80fe12+=pairF(0x2c,_0x156094[_0x817f17(0x170)]);return _0x80fe12+=writePoint3D(0xb,_0x156094['direction']),_0x80fe12+=writeExtrusion(_0x156094[_0x817f17(0x1f1)]),_0x80fe12;}function writeAttribEntity(_0x41233a){const _0x4fb8c1=_0x4941,_0xe9a4d4=_0x41233a[_0x4fb8c1(0x1fd)]===_0x4fb8c1(0x162);let _0x423b9d=pair(0x64,_0xe9a4d4?_0x4fb8c1(0x1f7):_0x4fb8c1(0x148));_0x423b9d+=writePoint3D(0xa,_0x41233a['insertionPoint']),_0x423b9d+=pairF(0x28,_0x41233a[_0x4fb8c1(0x14d)]),_0x423b9d+=pair(0x1,_0x41233a['text']);if(_0x41233a[_0x4fb8c1(0x1a9)])_0x423b9d+=pair(0x2,_0x41233a['tag']);if(_0x41233a['prompt'])_0x423b9d+=pair(0x3,_0x41233a[_0x4fb8c1(0x113)]);if(_0x41233a[_0x4fb8c1(0x142)])_0x423b9d+=pairI(0x46,_0x41233a['flags']);if(_0x41233a[_0x4fb8c1(0x1d9)])_0x423b9d+=pairF(0x32,_0x41233a[_0x4fb8c1(0x1d9)]);if(_0x41233a['xScale']&&_0x41233a[_0x4fb8c1(0x1fa)]!==0x1)_0x423b9d+=pairF(0x29,_0x41233a[_0x4fb8c1(0x1fa)]);if(_0x41233a[_0x4fb8c1(0x15a)]&&_0x41233a[_0x4fb8c1(0x15a)]!=='STANDARD')_0x423b9d+=pair(0x7,_0x41233a['styleName']);if(_0x41233a[_0x4fb8c1(0x16e)])_0x423b9d+=pairI(0x47,_0x41233a[_0x4fb8c1(0x16e)]);if(_0x41233a[_0x4fb8c1(0x102)])_0x423b9d+=pairI(0x48,_0x41233a[_0x4fb8c1(0x102)]);if(_0x41233a[_0x4fb8c1(0x1f8)])_0x423b9d+=pairI(0x49,_0x41233a[_0x4fb8c1(0x1f8)]);return _0x423b9d+=writePoint3D(0xb,_0x41233a[_0x4fb8c1(0x1df)]),_0x423b9d;}function writeInsertEntity(_0x35853d){const _0x112836=_0x4941;let _0x2efdc9=pair(0x64,_0x112836(0x191));if(_0x35853d[_0x112836(0x13e)])_0x2efdc9+=pairI(0x42,0x1);_0x2efdc9+=pair(0x2,_0x35853d[_0x112836(0x186)]),_0x2efdc9+=writePoint3D(0xa,_0x35853d[_0x112836(0x203)]);if(_0x35853d[_0x112836(0x160)]){if(_0x35853d[_0x112836(0x160)]['x']!==0x1)_0x2efdc9+=pairF(0x29,_0x35853d[_0x112836(0x160)]['x']);if(_0x35853d[_0x112836(0x160)]['y']!==0x1)_0x2efdc9+=pairF(0x2a,_0x35853d[_0x112836(0x160)]['y']);if(_0x35853d[_0x112836(0x160)]['z']!==0x1)_0x2efdc9+=pairF(0x2b,_0x35853d[_0x112836(0x160)]['z']);}if(_0x35853d['rotation'])_0x2efdc9+=pairF(0x32,_0x35853d[_0x112836(0x1d9)]);if(_0x35853d['columnCount']&&_0x35853d[_0x112836(0x1e4)]!==0x1)_0x2efdc9+=pairI(0x46,_0x35853d[_0x112836(0x1e4)]);if(_0x35853d[_0x112836(0x195)]&&_0x35853d[_0x112836(0x195)]!==0x1)_0x2efdc9+=pairI(0x47,_0x35853d[_0x112836(0x195)]);if(_0x35853d[_0x112836(0x196)])_0x2efdc9+=pairF(0x2c,_0x35853d[_0x112836(0x196)]);if(_0x35853d[_0x112836(0x1c5)])_0x2efdc9+=pairF(0x2d,_0x35853d[_0x112836(0x1c5)]);_0x2efdc9+=writeExtrusion(_0x35853d[_0x112836(0x1f1)]);if(_0x35853d['attributes']&&_0x35853d[_0x112836(0x12c)]['length']>0x0){for(const _0x4c18fb of _0x35853d[_0x112836(0x12c)]){_0x2efdc9+=writeOneEntity(_0x4c18fb);}_0x2efdc9+=pair(0x0,'SEQEND'),_0x2efdc9+=pair(0x64,_0x112836(0x1e8));if(_0x35853d[_0x112836(0x17f)])_0x2efdc9+=pair(0x8,_0x35853d[_0x112836(0x17f)]);}return _0x2efdc9;}function writeDimensionEntity(_0x3858a4){const _0x32d94c=_0x4941;let _0x69802b=pair(0x64,_0x32d94c(0x1a8));if(_0x3858a4['blockName'])_0x69802b+=pair(0x2,_0x3858a4[_0x32d94c(0x186)]);_0x69802b+=writePoint3D(0xa,_0x3858a4['definitionPoint']),_0x69802b+=writePoint3D(0xb,_0x3858a4[_0x32d94c(0x14f)]);if(_0x3858a4[_0x32d94c(0x193)]!==undefined)_0x69802b+=pairI(0x46,_0x3858a4['dimensionType']);if(_0x3858a4['attachmentPoint'])_0x69802b+=pairI(0x47,_0x3858a4[_0x32d94c(0x1c0)]);if(_0x3858a4[_0x32d94c(0x18e)])_0x69802b+=pair(0x1,_0x3858a4[_0x32d94c(0x18e)]);if(_0x3858a4[_0x32d94c(0x15a)]&&_0x3858a4[_0x32d94c(0x15a)]!==_0x32d94c(0x141))_0x69802b+=pair(0x3,_0x3858a4['styleName']);if(_0x3858a4[_0x32d94c(0x1d9)])_0x69802b+=pairF(0x32,_0x3858a4[_0x32d94c(0x1d9)]);const _0x56fd94=(_0x3858a4[_0x32d94c(0x193)]||0x0)&0xf;switch(_0x56fd94){case 0x0:case 0x1:_0x69802b+=pair(0x64,_0x32d94c(0x211)),_0x69802b+=writePoint3D(0xd,_0x3858a4[_0x32d94c(0x199)]),_0x69802b+=writePoint3D(0xe,_0x3858a4[_0x32d94c(0x1e5)]);if(_0x3858a4[_0x32d94c(0x17b)])_0x69802b+=pairF(0x34,_0x3858a4[_0x32d94c(0x17b)]);_0x56fd94===0x0&&(_0x69802b+=pair(0x64,_0x32d94c(0x15e)));break;case 0x2:_0x69802b+=pair(0x64,'AcDb3PointAngularDimension'),_0x69802b+=writePoint3D(0xd,_0x3858a4[_0x32d94c(0x199)]),_0x69802b+=writePoint3D(0xe,_0x3858a4[_0x32d94c(0x1e5)]);if(_0x3858a4[_0x32d94c(0x18d)])_0x69802b+=writePoint3D(0xf,_0x3858a4['point3']);break;case 0x3:case 0x4:_0x69802b+=pair(0x64,_0x56fd94===0x3?_0x32d94c(0x10c):_0x32d94c(0x1d0)),_0x69802b+=writePoint3D(0xf,_0x3858a4[_0x32d94c(0x18d)]||_0x3858a4[_0x32d94c(0x199)]);if(_0x3858a4[_0x32d94c(0x167)])_0x69802b+=pairF(0x28,_0x3858a4[_0x32d94c(0x167)]);break;case 0x5:_0x69802b+=pair(0x64,_0x32d94c(0x101)),_0x69802b+=writePoint3D(0xd,_0x3858a4[_0x32d94c(0x199)]),_0x69802b+=writePoint3D(0xe,_0x3858a4[_0x32d94c(0x1e5)]);if(_0x3858a4[_0x32d94c(0x18d)])_0x69802b+=writePoint3D(0xf,_0x3858a4['point3']);break;case 0x6:_0x69802b+=pair(0x64,'AcDbOrdinateDimension'),_0x69802b+=writePoint3D(0xd,_0x3858a4[_0x32d94c(0x199)]),_0x69802b+=writePoint3D(0xe,_0x3858a4[_0x32d94c(0x1e5)]);break;default:_0x69802b+=writePoint3D(0xd,_0x3858a4[_0x32d94c(0x199)]),_0x69802b+=writePoint3D(0xe,_0x3858a4[_0x32d94c(0x1e5)]);break;}return _0x69802b;}function writeLeaderEntity(_0x5abe32){const _0x5326ee=_0x4941;let _0x2d41a9=pair(0x64,_0x5326ee(0x1c2));if(_0x5abe32[_0x5326ee(0x15a)])_0x2d41a9+=pair(0x3,_0x5abe32[_0x5326ee(0x15a)]);if(_0x5abe32['arrowheadFlag']!==undefined)_0x2d41a9+=pairI(0x47,_0x5abe32[_0x5326ee(0x15c)]);if(_0x5abe32[_0x5326ee(0x10d)]!==undefined)_0x2d41a9+=pairI(0x48,_0x5abe32[_0x5326ee(0x10d)]);if(_0x5abe32['creationType']!==undefined)_0x2d41a9+=pairI(0x49,_0x5abe32['creationType']);if(_0x5abe32[_0x5326ee(0x1a6)]!==undefined)_0x2d41a9+=pairI(0x4a,_0x5abe32['hooklineDirectionFlag']);if(_0x5abe32['hooklineFlag']!==undefined)_0x2d41a9+=pairI(0x4b,_0x5abe32['hooklineFlag']);if(_0x5abe32[_0x5326ee(0x1ac)])_0x2d41a9+=pairF(0x28,_0x5abe32['textHeight']);if(_0x5abe32['textWidth'])_0x2d41a9+=pairF(0x29,_0x5abe32[_0x5326ee(0x1b6)]);const _0x7a50e4=_0x5abe32[_0x5326ee(0x1bf)]||[];_0x2d41a9+=pairI(0x4c,_0x7a50e4[_0x5326ee(0x1ee)]);for(const _0x435a35 of _0x7a50e4){_0x2d41a9+=writePoint3D(0xa,_0x435a35);}if(_0x5abe32[_0x5326ee(0x152)])_0x2d41a9+=pair(0x154,_0x5abe32[_0x5326ee(0x152)]);return _0x5abe32[_0x5326ee(0x16a)]&&(_0x2d41a9+=pairF(0xd2,_0x5abe32[_0x5326ee(0x16a)]['x']),_0x2d41a9+=pairF(0xdc,_0x5abe32[_0x5326ee(0x16a)]['y']),_0x2d41a9+=pairF(0xe6,_0x5abe32[_0x5326ee(0x16a)]['z'])),_0x5abe32[_0x5326ee(0x117)]&&(_0x2d41a9+=pairF(0xd3,_0x5abe32['horizontalDirection']['x']),_0x2d41a9+=pairF(0xdd,_0x5abe32[_0x5326ee(0x117)]['y']),_0x2d41a9+=pairF(0xe7,_0x5abe32[_0x5326ee(0x117)]['z'])),_0x2d41a9;}function writeMLeaderEntity(_0xb2367c){const _0x40392f=_0x4941;let _0x30f232=pair(0x64,_0x40392f(0x153));if(_0xb2367c[_0x40392f(0x15a)])_0x30f232+=pair(0x3,_0xb2367c['styleName']);if(_0xb2367c[_0x40392f(0x200)]!==undefined)_0x30f232+=pairI(0xaa,_0xb2367c[_0x40392f(0x200)]);if(_0xb2367c[_0x40392f(0x18e)])_0x30f232+=pair(0x130,_0xb2367c[_0x40392f(0x18e)]);if(_0xb2367c[_0x40392f(0x122)])_0x30f232+=pair(0x154,_0xb2367c[_0x40392f(0x122)]);if(_0xb2367c[_0x40392f(0x11e)])_0x30f232+=pairF(0x28,_0xb2367c[_0x40392f(0x11e)]);if(_0xb2367c[_0x40392f(0x131)])_0x30f232+=pairF(0x29,_0xb2367c[_0x40392f(0x131)]);if(_0xb2367c[_0x40392f(0x1ac)])_0x30f232+=pairF(0x2a,_0xb2367c[_0x40392f(0x1ac)]);if(_0xb2367c['leaderPoints'])for(const _0x1ab21e of _0xb2367c[_0x40392f(0x126)]){_0x30f232+=writePoint3D(0xa,_0x1ab21e);}return _0x30f232;}function writeHatchEntity(_0x2e39a7){const _0x36f399=_0x4941;let _0x195a9c=pair(0x64,_0x36f399(0x139));_0x195a9c+=pairF(0xa,0x0),_0x195a9c+=pairF(0x14,0x0),_0x195a9c+=pairF(0x1e,_0x2e39a7[_0x36f399(0x1f5)]||0x0),_0x195a9c+=writeExtrusion(_0x2e39a7[_0x36f399(0x1f1)]),_0x195a9c+=pair(0x2,_0x2e39a7['patternName']||''),_0x195a9c+=pairI(0x46,_0x2e39a7[_0x36f399(0x107)]?0x1:0x0),_0x195a9c+=pairI(0x47,_0x2e39a7['associative']?0x1:0x0);const _0x410e20=_0x2e39a7[_0x36f399(0x1cf)]||[];_0x195a9c+=pairI(0x5b,_0x410e20[_0x36f399(0x1ee)]);for(const _0x5d7263 of _0x410e20){_0x195a9c+=pairI(0x5c,_0x5d7263[_0x36f399(0x1fd)]||0x0);if(_0x5d7263[_0x36f399(0x128)]&&_0x5d7263['points'][_0x36f399(0x1ee)]>0x0){_0x195a9c+=pairI(0x5d,_0x5d7263[_0x36f399(0x128)][_0x36f399(0x1ee)]);for(const _0x5f06c5 of _0x5d7263['points']){_0x195a9c+=pairF(0xa,_0x5f06c5['x']),_0x195a9c+=pairF(0x14,_0x5f06c5['y']||0x0);}}}_0x195a9c+=pairI(0x4b,_0x2e39a7[_0x36f399(0x166)]||0x0),_0x195a9c+=pairI(0x4c,_0x2e39a7['patternType']||0x0);if(!_0x2e39a7[_0x36f399(0x107)]){if(_0x2e39a7[_0x36f399(0x1a5)])_0x195a9c+=pairF(0x34,_0x2e39a7[_0x36f399(0x1a5)]);if(_0x2e39a7[_0x36f399(0x18a)])_0x195a9c+=pairF(0x29,_0x2e39a7[_0x36f399(0x18a)]);}const _0x2e8bfe=_0x2e39a7[_0x36f399(0x106)]||[];_0x195a9c+=pairI(0x62,_0x2e8bfe[_0x36f399(0x1ee)]);for(const _0x1d59e8 of _0x2e8bfe){_0x195a9c+=pairF(0xa,_0x1d59e8['x']),_0x195a9c+=pairF(0x14,_0x1d59e8['y']||0x0);}return _0x195a9c;}function writeSplineEntity(_0x1d403b){const _0x5e46af=_0x4941;let _0x4f291b=pair(0x64,_0x5e46af(0x1d3));_0x1d403b[_0x5e46af(0x16a)]&&(_0x4f291b+=pairF(0xd2,_0x1d403b[_0x5e46af(0x16a)]['x']),_0x4f291b+=pairF(0xdc,_0x1d403b[_0x5e46af(0x16a)]['y']),_0x4f291b+=pairF(0xe6,_0x1d403b[_0x5e46af(0x16a)]['z']));let _0x2d4614=_0x1d403b['flags']||0x0;if(_0x1d403b[_0x5e46af(0x129)])_0x2d4614|=0x1;if(_0x1d403b[_0x5e46af(0x20b)])_0x2d4614|=0x2;if(_0x1d403b[_0x5e46af(0x125)])_0x2d4614|=0x4;if(_0x1d403b[_0x5e46af(0x13c)])_0x2d4614|=0x8;_0x4f291b+=pairI(0x46,_0x2d4614),_0x4f291b+=pairI(0x47,_0x1d403b[_0x5e46af(0x217)]||0x3);const _0x499118=_0x1d403b[_0x5e46af(0x1f4)]||[],_0x3d95b7=_0x1d403b[_0x5e46af(0x206)]||[],_0x42bbf8=_0x1d403b['fitPoints']||[];_0x4f291b+=pairI(0x48,_0x499118['length']),_0x4f291b+=pairI(0x49,_0x3d95b7['length']),_0x4f291b+=pairI(0x4a,_0x42bbf8[_0x5e46af(0x1ee)]);if(_0x1d403b['knotTolerance'])_0x4f291b+=pairF(0x2a,_0x1d403b[_0x5e46af(0x1bd)]);if(_0x1d403b[_0x5e46af(0x147)])_0x4f291b+=pairF(0x2b,_0x1d403b[_0x5e46af(0x147)]);if(_0x1d403b[_0x5e46af(0x172)])_0x4f291b+=pairF(0x2c,_0x1d403b[_0x5e46af(0x172)]);if(_0x1d403b[_0x5e46af(0x1a2)])_0x4f291b+=writePoint3D(0xc,_0x1d403b[_0x5e46af(0x1a2)]);if(_0x1d403b[_0x5e46af(0x1f0)])_0x4f291b+=writePoint3D(0xd,_0x1d403b[_0x5e46af(0x1f0)]);for(const _0x157c46 of _0x499118){_0x4f291b+=pairF(0x28,_0x157c46);}if(_0x1d403b[_0x5e46af(0x144)])for(const _0x5d93e5 of _0x1d403b[_0x5e46af(0x144)]){_0x4f291b+=pairF(0x29,_0x5d93e5);}for(const _0x493cb7 of _0x3d95b7){_0x4f291b+=writePoint3D(0xa,_0x493cb7);}for(const _0x3f7d0b of _0x42bbf8){_0x4f291b+=writePoint3D(0xb,_0x3f7d0b);}return _0x4f291b;}function writeSolidEntity(_0x59585b){const _0x2afcb6=_0x4941;let _0x5191bb=_0x2afcb6(0x1fb);if(_0x59585b[_0x2afcb6(0x1fd)]==='SOLID')_0x5191bb=_0x2afcb6(0x1fb);else {if(_0x59585b[_0x2afcb6(0x1fd)]===_0x2afcb6(0x124))_0x5191bb=_0x2afcb6(0x184);}let _0x5270fe=pair(0x64,_0x5191bb);const _0x43c69a=_0x59585b[_0x2afcb6(0x128)]||[];if(_0x43c69a[0x0])_0x5270fe+=writePoint3D(0xa,_0x43c69a[0x0]);if(_0x43c69a[0x1])_0x5270fe+=writePoint3D(0xb,_0x43c69a[0x1]);if(_0x43c69a[0x2])_0x5270fe+=writePoint3D(0xc,_0x43c69a[0x2]);if(_0x43c69a[0x3])_0x5270fe+=writePoint3D(0xd,_0x43c69a[0x3]);if(_0x59585b['thickness'])_0x5270fe+=pairF(0x27,_0x59585b[_0x2afcb6(0x1e9)]);return _0x5270fe+=writeExtrusion(_0x59585b[_0x2afcb6(0x1f1)]),_0x5270fe;}function write3DFaceEntity(_0x1850a0){const _0x40b617=_0x4941;let _0x72497a=pair(0x64,_0x40b617(0x1b0));const _0x40a905=_0x1850a0[_0x40b617(0x1bf)]||[];if(_0x40a905[0x0])_0x72497a+=writePoint3D(0xa,_0x40a905[0x0]);if(_0x40a905[0x1])_0x72497a+=writePoint3D(0xb,_0x40a905[0x1]);if(_0x40a905[0x2])_0x72497a+=writePoint3D(0xc,_0x40a905[0x2]);if(_0x40a905[0x3])_0x72497a+=writePoint3D(0xd,_0x40a905[0x3]);if(_0x1850a0[_0x40b617(0x1b4)])_0x72497a+=pairI(0x46,_0x1850a0['invisibleEdgeFlags']);return _0x72497a;}function writeRayEntity(_0x3cc992){const _0x142053=_0x4941,_0x48535d=_0x3cc992[_0x142053(0x1fd)]===_0x142053(0x19a)?'AcDbRay':_0x142053(0x12a);let _0x14eb4d=pair(0x64,_0x48535d);return _0x14eb4d+=writePoint3D(0xa,_0x3cc992[_0x142053(0x115)]),_0x14eb4d+=writePoint3D(0xb,_0x3cc992[_0x142053(0x17d)]),_0x14eb4d;}function writeViewportEntity(_0xe02b7c){const _0x42f125=_0x4941;let _0x329f22=pair(0x64,_0x42f125(0x12d));_0x329f22+=writePoint3D(0xa,_0xe02b7c[_0x42f125(0x130)]),_0x329f22+=pairF(0x28,_0xe02b7c[_0x42f125(0x164)]),_0x329f22+=pairF(0x29,_0xe02b7c[_0x42f125(0x14d)]);if(_0xe02b7c['id'])_0x329f22+=pairI(0x45,_0xe02b7c['id']);if(_0xe02b7c[_0x42f125(0x1ae)])_0x329f22+=writePoint2D(0xc,_0xe02b7c[_0x42f125(0x1ae)]);if(_0xe02b7c[_0x42f125(0x1c7)])_0x329f22+=writePoint2D(0xd,_0xe02b7c['snapBase']);if(_0xe02b7c[_0x42f125(0x140)])_0x329f22+=writePoint2D(0xe,_0xe02b7c['snapSpacing']);if(_0xe02b7c[_0x42f125(0x11f)])_0x329f22+=writePoint2D(0xf,_0xe02b7c[_0x42f125(0x11f)]);_0x329f22+=writePoint3D(0x10,_0xe02b7c[_0x42f125(0x20c)]),_0x329f22+=writePoint3D(0x11,_0xe02b7c[_0x42f125(0x112)]);if(_0xe02b7c['perspectiveLensLength'])_0x329f22+=pairF(0x2a,_0xe02b7c[_0x42f125(0x137)]);if(_0xe02b7c['frontClipPlane'])_0x329f22+=pairF(0x2b,_0xe02b7c['frontClipPlane']);if(_0xe02b7c[_0x42f125(0x198)])_0x329f22+=pairF(0x2c,_0xe02b7c[_0x42f125(0x198)]);if(_0xe02b7c[_0x42f125(0x1bc)])_0x329f22+=pairF(0x2d,_0xe02b7c['viewHeight']);if(_0xe02b7c[_0x42f125(0x146)])_0x329f22+=pairF(0x32,_0xe02b7c[_0x42f125(0x146)]);if(_0xe02b7c[_0x42f125(0x12f)])_0x329f22+=pairF(0x33,_0xe02b7c['viewTwistAngle']);if(_0xe02b7c[_0x42f125(0x11c)])_0x329f22+=pairI(0x44,_0xe02b7c[_0x42f125(0x11c)]);if(_0xe02b7c['frozenLayers'])for(const _0x22a2d1 of _0xe02b7c['frozenLayers']){_0x329f22+=pair(0x14b,_0x22a2d1);}if(_0xe02b7c[_0x42f125(0x11b)])_0x329f22+=pair(0x154,_0xe02b7c['clippingBoundary']);return _0x329f22;}function writeImageEntity(_0x5f03e5){const _0x18a0af=_0x4941;let _0x3683e4=pair(0x64,_0x5f03e5[_0x18a0af(0x1fd)]===_0x18a0af(0x1ec)?_0x18a0af(0x1a1):_0x18a0af(0x1ff));_0x3683e4+=writePoint3D(0xa,_0x5f03e5[_0x18a0af(0x203)]),_0x3683e4+=writePoint3D(0xb,_0x5f03e5[_0x18a0af(0x17a)]),_0x3683e4+=writePoint3D(0xc,_0x5f03e5[_0x18a0af(0x183)]),_0x3683e4+=pairF(0xd,_0x5f03e5[_0x18a0af(0x1bb)]?_0x5f03e5[_0x18a0af(0x1bb)]['u']:0x0),_0x3683e4+=pairF(0x17,_0x5f03e5[_0x18a0af(0x1bb)]?_0x5f03e5[_0x18a0af(0x1bb)]['v']:0x0);if(_0x5f03e5['imageDefHandle'])_0x3683e4+=pair(0x154,_0x5f03e5['imageDefHandle']);if(_0x5f03e5[_0x18a0af(0x143)])_0x3683e4+=pairI(0x46,_0x5f03e5[_0x18a0af(0x143)]);if(_0x5f03e5[_0x18a0af(0x1c4)])_0x3683e4+=pairI(0x47,_0x5f03e5[_0x18a0af(0x1c4)]);if(_0x5f03e5[_0x18a0af(0x1d5)]!==undefined)_0x3683e4+=pairI(0x118,_0x5f03e5[_0x18a0af(0x1d5)]);if(_0x5f03e5[_0x18a0af(0x1c1)]!==undefined)_0x3683e4+=pairI(0x119,_0x5f03e5['contrast']);if(_0x5f03e5[_0x18a0af(0x11d)]!==undefined)_0x3683e4+=pairI(0x11a,_0x5f03e5[_0x18a0af(0x11d)]);if(_0x5f03e5[_0x18a0af(0x1b9)])for(const _0xe79cb9 of _0x5f03e5[_0x18a0af(0x1b9)]){_0x3683e4+=pairF(0xe,_0xe79cb9['x']),_0x3683e4+=pairF(0x18,_0xe79cb9['y']||0x0);}return _0x3683e4;}function writeToleranceEntity(_0x2c9443){const _0x20d467=_0x4941;let _0x15912a=pair(0x64,_0x20d467(0x1cc));if(_0x2c9443[_0x20d467(0x15a)])_0x15912a+=pair(0x3,_0x2c9443[_0x20d467(0x15a)]);_0x15912a+=writePoint3D(0xa,_0x2c9443[_0x20d467(0x203)]);if(_0x2c9443['text'])_0x15912a+=pair(0x1,_0x2c9443[_0x20d467(0x18e)]);return _0x15912a+=writePoint3D(0xb,_0x2c9443[_0x20d467(0x17d)]),_0x15912a;}function _0x48d4(){const _0x2619b5=['LEADER','AcDbBlockReference','isEntity','dimensionType','acisDataString','rowCount','columnSpacing','CLASSES','backClipPlane','point1','RAY','MTEXT','LINE','instanceCount','AcDbRegion','MLEADER','SPLINE','AcDbWipeout','startTangent','XLINE','application/dxf','patternAngle','hooklineDirectionFlag','TABLE','AcDbDimension','tag','HELIX','AcDbHelix','textHeight','href','viewCenter','INSERT','AcDbFace','ENTITIES','linetypeScale','inPaperSpace','invisibleEdgeFlags','object','textWidth','edgeCreases','2673864CHnhQm','clippingVertices','drawingDirection','imageSize','viewHeight','knotTolerance','AcDbSymbolTable','vertices','attachmentPoint','contrast','AcDbLeader','plotStyleHandle','clippingType','rowSpacing','subclassMarker','snapBase','AcDbMline','SEQEND','BLOCK','code_','AcDbFcf','extra','AcDbEllipse','boundaryPaths','AcDbRadialDimension','undefined','output.dxf','AcDbSpline','startPoint','brightness','isArray','meshNVertexCount','endWidth','rotation','appName','rowHeights','turnHeight','handle','axisVector','alignmentPoint','join','columns','AcDbPoint','startWidth','columnCount','point2','TEXT','3DFACE','AcDbEntity','thickness','visible','bulge','WIPEOUT','AcDbCircle','length','endPoint','endTangent','extrusionDirection','hardPointer','createElement','knots','elevation','axisBasePoint','AcDbAttributeDefinition','vAlign','modelerFormat','xScale','AcDbTrace','turns','type','endAngle','AcDbRasterImage','contentType','constantWidth','entryName','insertionPoint','revokeObjectURL','handedness','controlPoints','edges','substring','AcDbOle2Frame','VERTEX','periodic','viewDirection','colorNumber','OLE2FRAME','AcDbSubDMesh','CLASS','AcDbAlignedDimension','tables','CIRCLE','subdivisionLevel','createObjectURL','meshMVertexCount','degree','AcDb3PointAngularDimension','hAlign','radius','keys','ARC','seedPoints','solid','startsWith','version','40pcehfy','3109832uGNkVx','AcDbDiametricDimension','pathType','styleHandle','948706jZABqN','ownerHandle','cppClassName','viewTarget','prompt','fs/promises','basePoint','classes','horizontalDirection','constraint','AcDb2dPolyline','lowerRightCorner','clippingBoundary','statusField','fade','doglegLength','gridSpacing','LWPOLYLINE','AcDb2dVertex','textStyleId','BLOCKS','3DSOLID','rational','leaderPoints','10986CrxIpJ','points','closed','AcDbXline','defaultStartWidth','attributes','AcDbViewport','elementCount','viewTwistAngle','center','arrowheadSize','oblique','wasProxy','versions','replace','header','perspectiveLensLength','POINT','AcDbHatch','lineSpacingStyle','widthFactor','planar','9758NZnwrv','hasAttributes','AcDbVertex','snapSpacing','STANDARD','flags','displayFlags','weights','linetypeName','snapAngle','controlPointTolerance','AcDbAttribute','startAngle','AcDbBody','SURFACE','columnWidths','height','848110IuoHqq','middleOfText','data','entries','annotationReference','AcDbMLeader','entities','toFixed','AcDbArc','name','writeDxfFile\x20仅支持\x20Node.js\x20环境,浏览器请用\x20downloadDxfFile()','460QBTIIF','styleName','lineweight','arrowheadFlag','click','AcDbRotatedDimension','ENDTAB','scale','POLYLINE','ATTDEF','softPointer','width','396TJJDDN','style','leaderLength','dxfRecord','concat','normal','defaultEndWidth','AcDbText','download','generationFlags','MESH','lineSpacing','tileMode','fitTolerance','HATCH','TRACE','MLINE','50HvXMIh','SECTION','2FGSMYh','angle','uVector','extensionLineAngle','HEADER','direction','majorAxisEndPoint','layer','upperLeftCorner','75393IQiUHx','DIMENSION','vVector','AcDb3dSolid','rows','blockName','round','TOLERANCE','trueColor','patternScale','EOF','ENDSEC','point3','text','AcDbMText'];_0x48d4=function(){return _0x2619b5;};return _0x48d4();}function writeHelixEntity(_0x2e96b9){const _0x353d36=_0x4941;let _0xb5523a=pair(0x64,_0x353d36(0x1ab));_0xb5523a+=writePoint3D(0xa,_0x2e96b9[_0x353d36(0x1f6)]),_0xb5523a+=writePoint3D(0xb,_0x2e96b9[_0x353d36(0x1d4)]),_0xb5523a+=writePoint3D(0xc,_0x2e96b9[_0x353d36(0x1de)]),_0xb5523a+=pairF(0x28,_0x2e96b9['radius']),_0xb5523a+=pairF(0x29,_0x2e96b9[_0x353d36(0x1fc)]),_0xb5523a+=pairF(0x2a,_0x2e96b9[_0x353d36(0x1dc)]);if(_0x2e96b9[_0x353d36(0x205)]!==undefined)_0xb5523a+=pairI(0x122,_0x2e96b9[_0x353d36(0x205)]);if(_0x2e96b9[_0x353d36(0x118)]!==undefined)_0xb5523a+=pairI(0x118,_0x2e96b9[_0x353d36(0x118)]);return _0xb5523a;}function writeMeshEntity(_0x6b02f1){const _0x5237fb=_0x4941;let _0x3ce859=pair(0x64,_0x5237fb(0x20f));_0x3ce859+=pairI(0x47,_0x6b02f1[_0x5237fb(0x109)]||0x2),_0x3ce859+=pairI(0x48,_0x6b02f1[_0x5237fb(0x214)]||0x0);const _0x1c426f=_0x6b02f1[_0x5237fb(0x1bf)]||[];_0x3ce859+=pairI(0x5b,_0x1c426f[_0x5237fb(0x1ee)]);for(const _0x6c59f5 of _0x1c426f){_0x3ce859+=writePoint3D(0xa,_0x6c59f5);}const _0xfa799f=_0x6b02f1['faces']||[];_0x3ce859+=pairI(0x5c,_0xfa799f[_0x5237fb(0x1ee)]);for(const _0x4863d6 of _0xfa799f){_0x3ce859+=pairI(0x5a,_0x4863d6);}const _0x570096=_0x6b02f1[_0x5237fb(0x207)]||[];_0x3ce859+=pairI(0x5d,_0x570096[_0x5237fb(0x1ee)]);for(const _0x2a571f of _0x570096){_0x3ce859+=pairI(0x5a,_0x2a571f);}const _0x3b4f31=_0x6b02f1[_0x5237fb(0x1b7)]||[];_0x3ce859+=pairI(0x5e,_0x3b4f31[_0x5237fb(0x1ee)]);for(const _0x35956d of _0x3b4f31){_0x3ce859+=pairF(0x8c,_0x35956d);}return _0x3ce859;}function writeRegionEntity(_0x40dd10){const _0x2cba03=_0x4941;let _0x2ec55a=_0x2cba03(0x19e);if(_0x40dd10[_0x2cba03(0x1fd)]==='BODY')_0x2ec55a=_0x2cba03(0x14a);else {if(_0x40dd10[_0x2cba03(0x1fd)]===_0x2cba03(0x14b))_0x2ec55a='AcDbSurface';}let _0x46b231=pair(0x64,_0x2ec55a);if(_0x40dd10['modelerFormat']!==undefined)_0x46b231+=pairI(0x46,_0x40dd10[_0x2cba03(0x1f9)]);const _0x237c42=_0x40dd10[_0x2cba03(0x194)]||(_0x40dd10['acisData']||[])[_0x2cba03(0x1e0)]('');if(_0x237c42){let _0x4ccc2c=_0x237c42;while(_0x4ccc2c[_0x2cba03(0x1ee)]>0xff){_0x46b231+=pair(0x3,_0x4ccc2c['substring'](0x0,0xff)),_0x4ccc2c=_0x4ccc2c['substring'](0xff);}_0x46b231+=pair(0x1,_0x4ccc2c);}return _0x46b231;}function writeOle2Entity(_0x5a490c){const _0x273b6b=_0x4941;let _0x589320=pair(0x64,_0x273b6b(0x209));_0x589320+=pairI(0x46,_0x5a490c['oleType']||0x0),_0x589320+=pairI(0x47,_0x5a490c[_0x273b6b(0x171)]||0x0),_0x589320+=writePoint3D(0xa,_0x5a490c[_0x273b6b(0x180)]),_0x589320+=writePoint3D(0xb,_0x5a490c[_0x273b6b(0x11a)]);if(_0x5a490c['binaryData'])for(const _0x3c640c of _0x5a490c['binaryData']){_0x589320+=pair(0x1,_0x3c640c);}return _0x589320;}function writeTableEntity(_0x37009b){const _0xf45616=_0x4941;let _0x2637b7=pair(0x64,_0xf45616(0x191));if(_0x37009b[_0xf45616(0x186)])_0x2637b7+=pair(0x2,_0x37009b[_0xf45616(0x186)]);_0x2637b7+=writePoint3D(0xa,_0x37009b[_0xf45616(0x203)]),_0x2637b7+=pair(0x64,'AcDbTable'),_0x2637b7+=writePoint3D(0xb,_0x37009b[_0xf45616(0x17d)]);if(_0x37009b[_0xf45616(0x185)])_0x2637b7+=pairI(0x5b,_0x37009b[_0xf45616(0x185)]);if(_0x37009b[_0xf45616(0x1e1)])_0x2637b7+=pairI(0x5c,_0x37009b[_0xf45616(0x1e1)]);if(_0x37009b[_0xf45616(0x1db)])for(const _0xdb5b04 of _0x37009b[_0xf45616(0x1db)]){_0x2637b7+=pairF(0x8e,_0xdb5b04);}if(_0x37009b[_0xf45616(0x14c)])for(const _0x52637f of _0x37009b[_0xf45616(0x14c)]){_0x2637b7+=pairF(0x8d,_0x52637f);}return _0x2637b7;}function writeMLineEntity(_0x17c37c){const _0x1fd33a=_0x4941;let _0x3f9d12=pair(0x64,_0x1fd33a(0x1c8));if(_0x17c37c['styleName'])_0x3f9d12+=pair(0x2,_0x17c37c[_0x1fd33a(0x15a)]);if(_0x17c37c[_0x1fd33a(0x10e)])_0x3f9d12+=pair(0x154,_0x17c37c[_0x1fd33a(0x10e)]);_0x3f9d12+=pairF(0x28,_0x17c37c[_0x1fd33a(0x160)]||0x1),_0x3f9d12+=pairI(0x46,_0x17c37c['justification']||0x0),_0x3f9d12+=pairI(0x47,_0x17c37c['flags']||0x0);const _0x3bfa1c=_0x17c37c[_0x1fd33a(0x1bf)]||[];_0x3f9d12+=pairI(0x48,_0x3bfa1c['length']);if(_0x17c37c[_0x1fd33a(0x12e)])_0x3f9d12+=pairI(0x49,_0x17c37c[_0x1fd33a(0x12e)]);_0x3f9d12+=writePoint3D(0xa,_0x17c37c[_0x1fd33a(0x1d4)]);_0x17c37c['normal']&&(_0x3f9d12+=pairF(0xd2,_0x17c37c['normal']['x']),_0x3f9d12+=pairF(0xdc,_0x17c37c[_0x1fd33a(0x16a)]['y']),_0x3f9d12+=pairF(0xe6,_0x17c37c['normal']['z']));for(const _0x22b3da of _0x3bfa1c){_0x3f9d12+=pairF(0xb,_0x22b3da['x']),_0x3f9d12+=pairF(0x15,_0x22b3da['y']),_0x3f9d12+=pairF(0x1f,_0x22b3da['z']||0x0);}return _0x3f9d12;}function writeGenericEntity(_0x1e43b6){const _0x51cd80=_0x4941;let _0x11b76b='';if(_0x1e43b6[_0x51cd80(0x150)])for(const [_0x3fee64,_0x420ba0]of Object['entries'](_0x1e43b6[_0x51cd80(0x150)])){if(_0x3fee64['startsWith']('code_')){const _0x1f5a4a=parseInt(_0x3fee64[_0x51cd80(0x135)](_0x51cd80(0x1cb),'')),_0x37a649=[]['concat'](_0x420ba0);for(const _0x2a7c25 of _0x37a649){_0x11b76b+=pair(_0x1f5a4a,_0x2a7c25);}}}return _0x11b76b;}function writeObjects(_0x30eaa6){const _0x154ed2=_0x4941;if(!_0x30eaa6||_0x30eaa6['length']===0x0)return '';let _0x8477ef=pair(0x0,_0x154ed2(0x177))+pair(0x2,'OBJECTS');for(const _0x160952 of _0x30eaa6){_0x8477ef+=pair(0x0,_0x160952[_0x154ed2(0x1fd)]);if(_0x160952[_0x154ed2(0x1dd)])_0x8477ef+=pair(0x5,_0x160952[_0x154ed2(0x1dd)]);if(_0x160952[_0x154ed2(0x110)])_0x8477ef+=pair(0x14a,_0x160952['ownerHandle']);if(_0x160952['name'])_0x8477ef+=pair(0x2,_0x160952[_0x154ed2(0x157)]);if(_0x160952[_0x154ed2(0x202)]){const _0x32b4c6=[][_0x154ed2(0x169)](_0x160952[_0x154ed2(0x202)]);for(const _0x36daef of _0x32b4c6){_0x8477ef+=pair(0x3,_0x36daef);}}if(_0x160952[_0x154ed2(0x163)]){const _0x3df86a=[][_0x154ed2(0x169)](_0x160952[_0x154ed2(0x163)]);for(const _0x260939 of _0x3df86a){_0x8477ef+=pair(0x15e,_0x260939);}}if(_0x160952['hardPointer']){const _0x402c9d=[][_0x154ed2(0x169)](_0x160952[_0x154ed2(0x1f2)]);for(const _0x5f61d3 of _0x402c9d){_0x8477ef+=pair(0x168,_0x5f61d3);}}for(const [_0x21020b,_0x5dff59]of Object[_0x154ed2(0x151)](_0x160952)){if(_0x21020b[_0x154ed2(0x108)]('code_')){const _0x2f8468=parseInt(_0x21020b[_0x154ed2(0x135)]('code_','')),_0xa80829=[]['concat'](_0x5dff59);for(const _0x3dee4e of _0xa80829){_0x8477ef+=pair(_0x2f8468,_0x3dee4e);}}}}return _0x8477ef+=pair(0x0,_0x154ed2(0x18c)),_0x8477ef;}function writeDxf(_0x27b5be){const _0x310415=_0x4941;let _0x3c4d98='';return _0x3c4d98+=writeHeader(_0x27b5be[_0x310415(0x136)]),_0x3c4d98+=writeClasses(_0x27b5be[_0x310415(0x116)]),_0x3c4d98+=writeTables(_0x27b5be[_0x310415(0x212)]),_0x3c4d98+=writeBlocks(_0x27b5be['blocks']),_0x3c4d98+=writeEntitiesSection(_0x27b5be[_0x310415(0x154)]),_0x3c4d98+=writeObjects(_0x27b5be['objects']),_0x3c4d98+=pair(0x0,_0x310415(0x18b)),_0x3c4d98;}async function writeDxfFile(_0x2e2c06,_0x2d4e2b){const _0x8756a4=_0x4941,_0x138ecf=writeDxf(_0x2e2c06);if(typeof process!==_0x8756a4(0x1d1)&&process[_0x8756a4(0x134)]?.['node']){const {writeFile:_0x107ed0}=await import(_0x8756a4(0x114));await _0x107ed0(_0x2d4e2b,_0x138ecf,'utf-8');}else throw new Error(_0x8756a4(0x158));}function downloadDxfFile(_0x1576c3,_0x1f14ff=_0x2f0375(0x1d2)){const _0x4be0a5=_0x2f0375,_0x3faabb=writeDxf(_0x1576c3),_0x483364=new Blob([_0x3faabb],{'type':_0x4be0a5(0x1a4)}),_0x7d66b6=URL[_0x4be0a5(0x215)](_0x483364),_0x8b48f=document[_0x4be0a5(0x1f3)]('a');_0x8b48f[_0x4be0a5(0x1ad)]=_0x7d66b6,_0x8b48f[_0x4be0a5(0x16d)]=_0x1f14ff,_0x8b48f[_0x4be0a5(0x15d)](),URL[_0x4be0a5(0x204)](_0x7d66b6);}
16
6
 
17
- function tokenize(dxfString) {
18
- const lines = dxfString.split(/\r?\n/);
19
- const pairs = [];
20
- for (let i = 0; i + 1 < lines.length; i += 2) {
21
- const code = parseInt(lines[i].trim(), 10);
22
- const value = lines[i + 1].trim();
23
- pairs.push({ code, value });
24
- }
25
- return pairs;
26
- }
27
-
28
- function autoConvert(code, value) {
29
- if (
30
- (code >= 10 && code <= 59) ||
31
- (code >= 110 && code <= 149) ||
32
- (code >= 210 && code <= 239) ||
33
- (code >= 460 && code <= 469) ||
34
- (code >= 1010 && code <= 1059)
35
- ) {
36
- return parseFloat(value);
37
- }
38
- if (
39
- (code >= 60 && code <= 79) ||
40
- (code >= 90 && code <= 99) ||
41
- (code >= 170 && code <= 179) ||
42
- (code >= 270 && code <= 289) ||
43
- (code >= 370 && code <= 389) ||
44
- (code >= 400 && code <= 409) ||
45
- (code >= 1060 && code <= 1079)
46
- ) {
47
- return parseInt(value, 10);
48
- }
49
- return value;
50
- }
51
-
52
- function splitSections(pairs) {
53
- const sections = {};
54
- let i = 0;
55
- while (i < pairs.length) {
56
- if (pairs[i].code === 0 && pairs[i].value === "SECTION") {
57
- i++;
58
- const sectionName = pairs[i].value;
59
- i++;
60
- const start = i;
61
- while (i < pairs.length && !(pairs[i].code === 0 && pairs[i].value === "ENDSEC")) {
62
- i++;
63
- }
64
- sections[sectionName] = pairs.slice(start, i);
65
- i++;
66
- } else {
67
- i++;
68
- }
69
- }
70
- return sections;
71
- }
72
-
73
- function parseHeader(pairs) {
74
- if (!pairs || pairs.length === 0) return {};
75
- const header = {};
76
- let i = 0;
77
- while (i < pairs.length) {
78
- if (pairs[i].code === 9) {
79
- const varName = pairs[i].value;
80
- i++;
81
- const values = {};
82
- while (i < pairs.length && pairs[i].code !== 9 && pairs[i].code !== 0) {
83
- values[pairs[i].code] = autoConvert(pairs[i].code, pairs[i].value);
84
- i++;
85
- }
86
- const keys = Object.keys(values);
87
- header[varName] = keys.length === 1 ? values[keys[0]] : values;
88
- } else {
89
- i++;
90
- }
91
- }
92
- return header;
93
- }
94
-
95
- function parseClasses(pairs) {
96
- if (!pairs || pairs.length === 0) return [];
97
- const classes = [];
98
- let i = 0;
99
- while (i < pairs.length) {
100
- if (pairs[i].code === 0 && pairs[i].value === "CLASS") {
101
- i++;
102
- const cls = {};
103
- while (i < pairs.length && pairs[i].code !== 0) {
104
- switch (pairs[i].code) {
105
- case 1: cls.dxfRecord = pairs[i].value; break;
106
- case 2: cls.cppClassName = pairs[i].value; break;
107
- case 3: cls.appName = pairs[i].value; break;
108
- case 90: cls.proxyCapabilities = parseInt(pairs[i].value, 10); break;
109
- case 91: cls.instanceCount = parseInt(pairs[i].value, 10); break;
110
- case 280: cls.wasProxy = parseInt(pairs[i].value, 10); break;
111
- case 281: cls.isEntity = parseInt(pairs[i].value, 10); break;
112
- default: cls[`code_${pairs[i].code}`] = pairs[i].value;
113
- }
114
- i++;
115
- }
116
- classes.push(cls);
117
- } else {
118
- i++;
119
- }
120
- }
121
- return classes;
122
- }
123
-
124
- function parseTables(pairs) {
125
- if (!pairs || pairs.length === 0) return {};
126
- const tables = {};
127
- let i = 0;
128
- while (i < pairs.length) {
129
- if (pairs[i].code === 0 && pairs[i].value === "TABLE") {
130
- i++;
131
- const tableName = pairs[i].value;
132
- i++;
133
- const start = i;
134
- while (i < pairs.length && !(pairs[i].code === 0 && pairs[i].value === "ENDTAB")) {
135
- i++;
136
- }
137
- tables[tableName] = parseTableEntries(tableName, pairs.slice(start, i));
138
- i++;
139
- } else {
140
- i++;
141
- }
142
- }
143
- return tables;
144
- }
145
-
146
- function parseTableEntries(tableName, pairs) {
147
- const entries = [];
148
- let i = 0;
149
- while (i < pairs.length) {
150
- if (pairs[i].code === 0) {
151
- const entryType = pairs[i].value;
152
- i++;
153
- const entry = { _type: entryType };
154
- while (i < pairs.length && pairs[i].code !== 0) {
155
- const code = pairs[i].code;
156
- const val = autoConvert(code, pairs[i].value);
157
- switch (code) {
158
- case 2: entry.name = val; break;
159
- case 5: entry.handle = val; break;
160
- case 6: entry.linetypeName = val; break;
161
- case 7: entry.styleName = val; break;
162
- case 62: entry.colorNumber = val; break;
163
- case 70: entry.flags = val; break;
164
- case 40: entry.height = val; break;
165
- case 41: entry.widthFactor = val; break;
166
- case 50: entry.angle = val; break;
167
- case 100: entry.subclassMarker = entry.subclassMarker ? [].concat(entry.subclassMarker, val) : val; break;
168
- case 330: entry.ownerHandle = val; break;
169
- case 370: entry.lineweight = val; break;
170
- case 390: entry.plotStyleHandle = val; break;
171
- default:
172
- if (entry[`code_${code}`] !== undefined) {
173
- entry[`code_${code}`] = [].concat(entry[`code_${code}`], val);
174
- } else {
175
- entry[`code_${code}`] = val;
176
- }
177
- }
178
- i++;
179
- }
180
- entries.push(entry);
181
- } else {
182
- i++;
183
- }
184
- }
185
- return entries;
186
- }
187
-
188
- function parseBlocks(pairs) {
189
- if (!pairs || pairs.length === 0) return [];
190
- const blocks = [];
191
- let i = 0;
192
- while (i < pairs.length) {
193
- if (pairs[i].code === 0 && pairs[i].value === "BLOCK") {
194
- i++;
195
- const block = { entities: [] };
196
- while (i < pairs.length && pairs[i].code !== 0) {
197
- switch (pairs[i].code) {
198
- case 2: block.name = pairs[i].value; break;
199
- case 3: block.name2 = pairs[i].value; break;
200
- case 5: block.handle = pairs[i].value; break;
201
- case 8: block.layer = pairs[i].value; break;
202
- case 10: block.basePointX = parseFloat(pairs[i].value); break;
203
- case 20: block.basePointY = parseFloat(pairs[i].value); break;
204
- case 30: block.basePointZ = parseFloat(pairs[i].value); break;
205
- case 70: block.flags = parseInt(pairs[i].value, 10); break;
206
- case 100: break;
207
- case 330: block.ownerHandle = pairs[i].value; break;
208
- default: block[`code_${pairs[i].code}`] = pairs[i].value;
209
- }
210
- i++;
211
- }
212
- const entityPairs = [];
213
- while (i < pairs.length && !(pairs[i].code === 0 && pairs[i].value === "ENDBLK")) {
214
- entityPairs.push(pairs[i]);
215
- i++;
216
- }
217
- if (entityPairs.length > 0) block.entities = parseEntityList(entityPairs);
218
- if (i < pairs.length) {
219
- i++;
220
- while (i < pairs.length && pairs[i].code !== 0) i++;
221
- }
222
- blocks.push(block);
223
- } else {
224
- i++;
225
- }
226
- }
227
- return blocks;
228
- }
229
-
230
- // ─────────────────── ENTITIES 解析 ───────────────────
231
-
232
- function parseEntityList(pairs) {
233
- const entities = [];
234
- let i = 0;
235
- while (i < pairs.length) {
236
- if (pairs[i].code === 0) {
237
- const entityType = pairs[i].value;
238
- i++;
239
- const entityPairs = [];
240
- while (i < pairs.length && pairs[i].code !== 0) {
241
- entityPairs.push(pairs[i]);
242
- i++;
243
- }
244
- const entity = parseOneEntity(entityType, entityPairs);
245
- if (entity) entities.push(entity);
246
- } else {
247
- i++;
248
- }
249
- }
250
- return entities;
251
- }
252
-
253
- function parseOneEntity(type, pairs) {
254
- const base = { type };
255
- for (const p of pairs) {
256
- switch (p.code) {
257
- case 5: base.handle = p.value; break;
258
- case 8: base.layer = p.value; break;
259
- case 6: base.linetypeName = p.value; break;
260
- case 48: base.linetypeScale = parseFloat(p.value); break;
261
- case 60: base.visible = parseInt(p.value, 10) === 0; break;
262
- case 62: base.colorNumber = parseInt(p.value, 10); break;
263
- case 67: base.inPaperSpace = parseInt(p.value, 10) === 1; break;
264
- case 330: base.ownerHandle = p.value; break;
265
- case 370: base.lineweight = parseInt(p.value, 10); break;
266
- case 420: base.trueColor = parseInt(p.value, 10); break;
267
- }
268
- }
269
- switch (type) {
270
- case "LINE": return parseLineEntity(base, pairs);
271
- case "LWPOLYLINE": return parseLWPolylineEntity(base, pairs);
272
- case "POLYLINE": return parsePolylineEntity(base, pairs);
273
- case "VERTEX": return parseVertexEntity(base, pairs);
274
- case "ARC": return parseArcEntity(base, pairs);
275
- case "CIRCLE": return parseCircleEntity(base, pairs);
276
- case "ELLIPSE": return parseEllipseEntity(base, pairs);
277
- case "POINT": return parsePointEntity(base, pairs);
278
- case "TEXT": return parseTextEntity(base, pairs);
279
- case "MTEXT": return parseMTextEntity(base, pairs);
280
- case "ATTRIB": return parseAttribEntity(base, pairs);
281
- case "ATTDEF": return parseAttribEntity(base, pairs);
282
- case "INSERT": return parseInsertEntity(base, pairs);
283
- case "DIMENSION": return parseDimensionEntity(base, pairs);
284
- case "LEADER": return parseLeaderEntity(base, pairs);
285
- case "MLEADER": return parseMLeaderEntity(base, pairs);
286
- case "HATCH": return parseHatchEntity(base, pairs);
287
- case "SPLINE": return parseSplineEntity(base, pairs);
288
- case "SOLID": case "3DSOLID": case "TRACE": return parseSolidEntity(base, pairs);
289
- case "3DFACE": return parse3DFaceEntity(base, pairs);
290
- case "RAY": case "XLINE": return parseRayEntity(base, pairs);
291
- case "VIEWPORT": return parseViewportEntity(base, pairs);
292
- case "IMAGE": case "WIPEOUT": return parseImageEntity(base, pairs);
293
- case "TOLERANCE": return parseToleranceEntity(base, pairs);
294
- case "HELIX": return parseHelixEntity(base, pairs);
295
- case "MESH": return parseMeshEntity(base, pairs);
296
- case "REGION": case "BODY": case "SURFACE": return parseRegionEntity(base, pairs);
297
- case "OLE2FRAME": return parseOle2Entity(base, pairs);
298
- case "TABLE": return parseTableEntity(base, pairs);
299
- case "MLINE": return parseMLineEntity(base, pairs);
300
- case "SEQEND": return base;
301
- default: return parseGenericEntity(base, pairs);
302
- }
303
- }
304
-
305
- // ── 以下所有实体解析器与你原来的完全一样,不需要任何改动 ──
306
- // (这里为了完整性全部保留)
307
-
308
- function parseLineEntity(base, pairs) {
309
- base.startPoint = { x: 0, y: 0, z: 0 };
310
- base.endPoint = { x: 0, y: 0, z: 0 };
311
- base.thickness = 0;
312
- base.extrusionDirection = { x: 0, y: 0, z: 1 };
313
- for (const p of pairs) {
314
- switch (p.code) {
315
- case 10: base.startPoint.x = parseFloat(p.value); break;
316
- case 20: base.startPoint.y = parseFloat(p.value); break;
317
- case 30: base.startPoint.z = parseFloat(p.value); break;
318
- case 11: base.endPoint.x = parseFloat(p.value); break;
319
- case 21: base.endPoint.y = parseFloat(p.value); break;
320
- case 31: base.endPoint.z = parseFloat(p.value); break;
321
- case 39: base.thickness = parseFloat(p.value); break;
322
- case 210: base.extrusionDirection.x = parseFloat(p.value); break;
323
- case 220: base.extrusionDirection.y = parseFloat(p.value); break;
324
- case 230: base.extrusionDirection.z = parseFloat(p.value); break;
325
- }
326
- }
327
- return base;
328
- }
329
-
330
- function parseLWPolylineEntity(base, pairs) {
331
- base.closed = false; base.constantWidth = 0; base.elevation = 0;
332
- base.thickness = 0; base.vertices = [];
333
- base.extrusionDirection = { x: 0, y: 0, z: 1 };
334
- let currentVertex = null;
335
- for (const p of pairs) {
336
- switch (p.code) {
337
- case 70: base.closed = (parseInt(p.value, 10) & 1) === 1; break;
338
- case 38: base.elevation = parseFloat(p.value); break;
339
- case 39: base.thickness = parseFloat(p.value); break;
340
- case 43: base.constantWidth = parseFloat(p.value); break;
341
- case 90: base.vertexCount = parseInt(p.value, 10); break;
342
- case 10:
343
- if (currentVertex) base.vertices.push(currentVertex);
344
- currentVertex = { x: parseFloat(p.value), y: 0, bulge: 0, startWidth: 0, endWidth: 0 };
345
- break;
346
- case 20: if (currentVertex) currentVertex.y = parseFloat(p.value); break;
347
- case 40: if (currentVertex) currentVertex.startWidth = parseFloat(p.value); break;
348
- case 41: if (currentVertex) currentVertex.endWidth = parseFloat(p.value); break;
349
- case 42: if (currentVertex) currentVertex.bulge = parseFloat(p.value); break;
350
- case 210: base.extrusionDirection.x = parseFloat(p.value); break;
351
- case 220: base.extrusionDirection.y = parseFloat(p.value); break;
352
- case 230: base.extrusionDirection.z = parseFloat(p.value); break;
353
- }
354
- }
355
- if (currentVertex) base.vertices.push(currentVertex);
356
- return base;
357
- }
358
-
359
- function parsePolylineEntity(base, pairs) {
360
- base.closed = false; base.is3DPolyline = false; base.is3DMesh = false;
361
- base.isPolyfaceMesh = false; base.meshMVertexCount = 0; base.meshNVertexCount = 0;
362
- base.defaultStartWidth = 0; base.defaultEndWidth = 0; base.elevation = 0;
363
- base.vertices = [];
364
- for (const p of pairs) {
365
- switch (p.code) {
366
- case 10: base.dummyX = parseFloat(p.value); break;
367
- case 20: base.dummyY = parseFloat(p.value); break;
368
- case 30: base.elevation = parseFloat(p.value); break;
369
- case 39: base.thickness = parseFloat(p.value); break;
370
- case 40: base.defaultStartWidth = parseFloat(p.value); break;
371
- case 41: base.defaultEndWidth = parseFloat(p.value); break;
372
- case 70: {
373
- const flags = parseInt(p.value, 10);
374
- base.closed = (flags & 1) === 1; base.is3DPolyline = (flags & 8) === 8;
375
- base.is3DMesh = (flags & 16) === 16; base.isPolyfaceMesh = (flags & 64) === 64;
376
- base.flags = flags; break;
377
- }
378
- case 71: base.meshMVertexCount = parseInt(p.value, 10); break;
379
- case 72: base.meshNVertexCount = parseInt(p.value, 10); break;
380
- case 210: (base.extrusionDirection = base.extrusionDirection || {}).x = parseFloat(p.value); break;
381
- case 220: (base.extrusionDirection = base.extrusionDirection || {}).y = parseFloat(p.value); break;
382
- case 230: (base.extrusionDirection = base.extrusionDirection || {}).z = parseFloat(p.value); break;
383
- }
384
- }
385
- return base;
386
- }
387
-
388
- function parseVertexEntity(base, pairs) {
389
- base.position = { x: 0, y: 0, z: 0 }; base.bulge = 0;
390
- base.startWidth = 0; base.endWidth = 0; base.flags = 0;
391
- for (const p of pairs) {
392
- switch (p.code) {
393
- case 10: base.position.x = parseFloat(p.value); break;
394
- case 20: base.position.y = parseFloat(p.value); break;
395
- case 30: base.position.z = parseFloat(p.value); break;
396
- case 40: base.startWidth = parseFloat(p.value); break;
397
- case 41: base.endWidth = parseFloat(p.value); break;
398
- case 42: base.bulge = parseFloat(p.value); break;
399
- case 70: base.flags = parseInt(p.value, 10); break;
400
- case 71: base.faceVertex1 = parseInt(p.value, 10); break;
401
- case 72: base.faceVertex2 = parseInt(p.value, 10); break;
402
- case 73: base.faceVertex3 = parseInt(p.value, 10); break;
403
- case 74: base.faceVertex4 = parseInt(p.value, 10); break;
404
- }
405
- }
406
- return base;
407
- }
408
-
409
- function parseArcEntity(base, pairs) {
410
- base.center = { x: 0, y: 0, z: 0 }; base.radius = 0;
411
- base.startAngle = 0; base.endAngle = 360; base.thickness = 0;
412
- base.extrusionDirection = { x: 0, y: 0, z: 1 };
413
- for (const p of pairs) {
414
- switch (p.code) {
415
- case 10: base.center.x = parseFloat(p.value); break;
416
- case 20: base.center.y = parseFloat(p.value); break;
417
- case 30: base.center.z = parseFloat(p.value); break;
418
- case 39: base.thickness = parseFloat(p.value); break;
419
- case 40: base.radius = parseFloat(p.value); break;
420
- case 50: base.startAngle = parseFloat(p.value); break;
421
- case 51: base.endAngle = parseFloat(p.value); break;
422
- case 210: base.extrusionDirection.x = parseFloat(p.value); break;
423
- case 220: base.extrusionDirection.y = parseFloat(p.value); break;
424
- case 230: base.extrusionDirection.z = parseFloat(p.value); break;
425
- }
426
- }
427
- return base;
428
- }
429
-
430
- function parseCircleEntity(base, pairs) {
431
- base.center = { x: 0, y: 0, z: 0 }; base.radius = 0; base.thickness = 0;
432
- base.extrusionDirection = { x: 0, y: 0, z: 1 };
433
- for (const p of pairs) {
434
- switch (p.code) {
435
- case 10: base.center.x = parseFloat(p.value); break;
436
- case 20: base.center.y = parseFloat(p.value); break;
437
- case 30: base.center.z = parseFloat(p.value); break;
438
- case 39: base.thickness = parseFloat(p.value); break;
439
- case 40: base.radius = parseFloat(p.value); break;
440
- case 210: base.extrusionDirection.x = parseFloat(p.value); break;
441
- case 220: base.extrusionDirection.y = parseFloat(p.value); break;
442
- case 230: base.extrusionDirection.z = parseFloat(p.value); break;
443
- }
444
- }
445
- return base;
446
- }
447
-
448
- function parseEllipseEntity(base, pairs) {
449
- base.center = { x: 0, y: 0, z: 0 };
450
- base.majorAxisEndPoint = { x: 0, y: 0, z: 0 };
451
- base.axisRatio = 1; base.startAngle = 0; base.endAngle = Math.PI * 2;
452
- base.extrusionDirection = { x: 0, y: 0, z: 1 };
453
- for (const p of pairs) {
454
- switch (p.code) {
455
- case 10: base.center.x = parseFloat(p.value); break;
456
- case 20: base.center.y = parseFloat(p.value); break;
457
- case 30: base.center.z = parseFloat(p.value); break;
458
- case 11: base.majorAxisEndPoint.x = parseFloat(p.value); break;
459
- case 21: base.majorAxisEndPoint.y = parseFloat(p.value); break;
460
- case 31: base.majorAxisEndPoint.z = parseFloat(p.value); break;
461
- case 40: base.axisRatio = parseFloat(p.value); break;
462
- case 41: base.startAngle = parseFloat(p.value); break;
463
- case 42: base.endAngle = parseFloat(p.value); break;
464
- case 210: base.extrusionDirection.x = parseFloat(p.value); break;
465
- case 220: base.extrusionDirection.y = parseFloat(p.value); break;
466
- case 230: base.extrusionDirection.z = parseFloat(p.value); break;
467
- }
468
- }
469
- return base;
470
- }
471
-
472
- function parsePointEntity(base, pairs) {
473
- base.position = { x: 0, y: 0, z: 0 }; base.thickness = 0;
474
- base.extrusionDirection = { x: 0, y: 0, z: 1 };
475
- for (const p of pairs) {
476
- switch (p.code) {
477
- case 10: base.position.x = parseFloat(p.value); break;
478
- case 20: base.position.y = parseFloat(p.value); break;
479
- case 30: base.position.z = parseFloat(p.value); break;
480
- case 39: base.thickness = parseFloat(p.value); break;
481
- case 50: base.angle = parseFloat(p.value); break;
482
- case 210: base.extrusionDirection.x = parseFloat(p.value); break;
483
- case 220: base.extrusionDirection.y = parseFloat(p.value); break;
484
- case 230: base.extrusionDirection.z = parseFloat(p.value); break;
485
- }
486
- }
487
- return base;
488
- }
489
-
490
- function parseTextEntity(base, pairs) {
491
- base.insertionPoint = { x: 0, y: 0, z: 0 }; base.alignmentPoint = { x: 0, y: 0, z: 0 };
492
- base.height = 0; base.text = ""; base.rotation = 0; base.xScale = 1;
493
- base.oblique = 0; base.styleName = "STANDARD"; base.generationFlags = 0;
494
- base.hAlign = 0; base.vAlign = 0; base.thickness = 0;
495
- base.extrusionDirection = { x: 0, y: 0, z: 1 };
496
- for (const p of pairs) {
497
- switch (p.code) {
498
- case 1: base.text = p.value; break; case 7: base.styleName = p.value; break;
499
- case 10: base.insertionPoint.x = parseFloat(p.value); break;
500
- case 20: base.insertionPoint.y = parseFloat(p.value); break;
501
- case 30: base.insertionPoint.z = parseFloat(p.value); break;
502
- case 11: base.alignmentPoint.x = parseFloat(p.value); break;
503
- case 21: base.alignmentPoint.y = parseFloat(p.value); break;
504
- case 31: base.alignmentPoint.z = parseFloat(p.value); break;
505
- case 39: base.thickness = parseFloat(p.value); break;
506
- case 40: base.height = parseFloat(p.value); break;
507
- case 41: base.xScale = parseFloat(p.value); break;
508
- case 50: base.rotation = parseFloat(p.value); break;
509
- case 51: base.oblique = parseFloat(p.value); break;
510
- case 71: base.generationFlags = parseInt(p.value, 10); break;
511
- case 72: base.hAlign = parseInt(p.value, 10); break;
512
- case 73: base.vAlign = parseInt(p.value, 10); break;
513
- case 210: base.extrusionDirection.x = parseFloat(p.value); break;
514
- case 220: base.extrusionDirection.y = parseFloat(p.value); break;
515
- case 230: base.extrusionDirection.z = parseFloat(p.value); break;
516
- }
517
- }
518
- return base;
519
- }
520
-
521
- function parseMTextEntity(base, pairs) {
522
- base.insertionPoint = { x: 0, y: 0, z: 0 }; base.direction = { x: 1, y: 0, z: 0 };
523
- base.height = 0; base.width = 0; base.text = ""; base.rotation = 0;
524
- base.styleName = "STANDARD"; base.attachmentPoint = 1; base.drawingDirection = 1;
525
- base.lineSpacing = 1; base.lineSpacingStyle = 1;
526
- base.extrusionDirection = { x: 0, y: 0, z: 1 };
527
- let textParts = [];
528
- for (const p of pairs) {
529
- switch (p.code) {
530
- case 1: textParts.push(p.value); break; case 3: textParts.push(p.value); break;
531
- case 7: base.styleName = p.value; break;
532
- case 10: base.insertionPoint.x = parseFloat(p.value); break;
533
- case 20: base.insertionPoint.y = parseFloat(p.value); break;
534
- case 30: base.insertionPoint.z = parseFloat(p.value); break;
535
- case 11: base.direction.x = parseFloat(p.value); break;
536
- case 21: base.direction.y = parseFloat(p.value); break;
537
- case 31: base.direction.z = parseFloat(p.value); break;
538
- case 40: base.height = parseFloat(p.value); break;
539
- case 41: base.width = parseFloat(p.value); break;
540
- case 44: base.lineSpacing = parseFloat(p.value); break;
541
- case 50: base.rotation = parseFloat(p.value); break;
542
- case 71: base.attachmentPoint = parseInt(p.value, 10); break;
543
- case 72: base.drawingDirection = parseInt(p.value, 10); break;
544
- case 73: base.lineSpacingStyle = parseInt(p.value, 10); break;
545
- case 210: base.extrusionDirection.x = parseFloat(p.value); break;
546
- case 220: base.extrusionDirection.y = parseFloat(p.value); break;
547
- case 230: base.extrusionDirection.z = parseFloat(p.value); break;
548
- }
549
- }
550
- base.text = textParts.join("");
551
- return base;
552
- }
553
-
554
- function parseAttribEntity(base, pairs) {
555
- base.insertionPoint = { x: 0, y: 0, z: 0 }; base.alignmentPoint = { x: 0, y: 0, z: 0 };
556
- base.height = 0; base.text = ""; base.tag = ""; base.prompt = "";
557
- base.rotation = 0; base.flags = 0; base.styleName = "STANDARD";
558
- for (const p of pairs) {
559
- switch (p.code) {
560
- case 1: base.text = p.value; break; case 2: base.tag = p.value; break;
561
- case 3: base.prompt = p.value; break; case 7: base.styleName = p.value; break;
562
- case 10: base.insertionPoint.x = parseFloat(p.value); break;
563
- case 20: base.insertionPoint.y = parseFloat(p.value); break;
564
- case 30: base.insertionPoint.z = parseFloat(p.value); break;
565
- case 11: base.alignmentPoint.x = parseFloat(p.value); break;
566
- case 21: base.alignmentPoint.y = parseFloat(p.value); break;
567
- case 31: base.alignmentPoint.z = parseFloat(p.value); break;
568
- case 40: base.height = parseFloat(p.value); break;
569
- case 41: base.xScale = parseFloat(p.value); break;
570
- case 50: base.rotation = parseFloat(p.value); break;
571
- case 70: base.flags = parseInt(p.value, 10); break;
572
- case 71: base.generationFlags = parseInt(p.value, 10); break;
573
- case 72: base.hAlign = parseInt(p.value, 10); break;
574
- case 73: base.vAlign = parseInt(p.value, 10); break;
575
- }
576
- }
577
- return base;
578
- }
579
-
580
- function parseInsertEntity(base, pairs) {
581
- base.blockName = ""; base.insertionPoint = { x: 0, y: 0, z: 0 };
582
- base.scale = { x: 1, y: 1, z: 1 }; base.rotation = 0;
583
- base.columnCount = 1; base.rowCount = 1; base.columnSpacing = 0; base.rowSpacing = 0;
584
- base.extrusionDirection = { x: 0, y: 0, z: 1 }; base.attributes = [];
585
- for (const p of pairs) {
586
- switch (p.code) {
587
- case 2: base.blockName = p.value; break;
588
- case 10: base.insertionPoint.x = parseFloat(p.value); break;
589
- case 20: base.insertionPoint.y = parseFloat(p.value); break;
590
- case 30: base.insertionPoint.z = parseFloat(p.value); break;
591
- case 41: base.scale.x = parseFloat(p.value); break;
592
- case 42: base.scale.y = parseFloat(p.value); break;
593
- case 43: base.scale.z = parseFloat(p.value); break;
594
- case 44: base.columnSpacing = parseFloat(p.value); break;
595
- case 45: base.rowSpacing = parseFloat(p.value); break;
596
- case 50: base.rotation = parseFloat(p.value); break;
597
- case 66: base.hasAttributes = parseInt(p.value, 10) === 1; break;
598
- case 70: base.columnCount = parseInt(p.value, 10); break;
599
- case 71: base.rowCount = parseInt(p.value, 10); break;
600
- case 210: base.extrusionDirection.x = parseFloat(p.value); break;
601
- case 220: base.extrusionDirection.y = parseFloat(p.value); break;
602
- case 230: base.extrusionDirection.z = parseFloat(p.value); break;
603
- }
604
- }
605
- return base;
606
- }
607
-
608
- function parseDimensionEntity(base, pairs) {
609
- base.blockName = ""; base.definitionPoint = { x: 0, y: 0, z: 0 };
610
- base.middleOfText = { x: 0, y: 0, z: 0 }; base.insertionPoint = { x: 0, y: 0, z: 0 };
611
- base.dimensionType = 0; base.text = ""; base.styleName = "STANDARD"; base.rotation = 0;
612
- base.point1 = { x: 0, y: 0, z: 0 }; base.point2 = { x: 0, y: 0, z: 0 };
613
- for (const p of pairs) {
614
- switch (p.code) {
615
- case 1: base.text = p.value; break; case 2: base.blockName = p.value; break;
616
- case 3: base.styleName = p.value; break;
617
- case 10: base.definitionPoint.x = parseFloat(p.value); break;
618
- case 20: base.definitionPoint.y = parseFloat(p.value); break;
619
- case 30: base.definitionPoint.z = parseFloat(p.value); break;
620
- case 11: base.middleOfText.x = parseFloat(p.value); break;
621
- case 21: base.middleOfText.y = parseFloat(p.value); break;
622
- case 31: base.middleOfText.z = parseFloat(p.value); break;
623
- case 13: base.point1.x = parseFloat(p.value); break;
624
- case 23: base.point1.y = parseFloat(p.value); break;
625
- case 33: base.point1.z = parseFloat(p.value); break;
626
- case 14: base.point2.x = parseFloat(p.value); break;
627
- case 24: base.point2.y = parseFloat(p.value); break;
628
- case 34: base.point2.z = parseFloat(p.value); break;
629
- case 40: base.leaderLength = parseFloat(p.value); break;
630
- case 50: base.rotation = parseFloat(p.value); break;
631
- case 70: base.dimensionType = parseInt(p.value, 10); break;
632
- case 71: base.attachmentPoint = parseInt(p.value, 10); break;
633
- }
634
- }
635
- return base;
636
- }
637
-
638
- function parseLeaderEntity(base, pairs) {
639
- base.styleName = "STANDARD"; base.arrowheadFlag = 1; base.pathType = 0;
640
- base.creationType = 0; base.hooklineFlag = 0; base.vertices = [];
641
- base.annotationReference = null;
642
- base.normal = { x: 0, y: 0, z: 1 }; base.horizontalDirection = { x: 1, y: 0, z: 0 };
643
- let currentX = null;
644
- for (const p of pairs) {
645
- switch (p.code) {
646
- case 3: base.styleName = p.value; break;
647
- case 10: currentX = parseFloat(p.value); break;
648
- case 20:
649
- if (currentX !== null) { base.vertices.push({ x: currentX, y: parseFloat(p.value), z: 0 }); currentX = null; } break;
650
- case 30: if (base.vertices.length > 0) base.vertices[base.vertices.length - 1].z = parseFloat(p.value); break;
651
- case 40: base.textHeight = parseFloat(p.value); break;
652
- case 41: base.textWidth = parseFloat(p.value); break;
653
- case 71: base.arrowheadFlag = parseInt(p.value, 10); break;
654
- case 72: base.pathType = parseInt(p.value, 10); break;
655
- case 73: base.creationType = parseInt(p.value, 10); break;
656
- case 76: base.vertexCount = parseInt(p.value, 10); break;
657
- case 340: base.annotationReference = p.value; break;
658
- }
659
- }
660
- return base;
661
- }
662
-
663
- function parseMLeaderEntity(base, pairs) {
664
- base.styleName = ""; base.text = ""; base.leaderPoints = [];
665
- base.contentType = 0; base.textStyleId = "";
666
- let currentX = null;
667
- for (const p of pairs) {
668
- switch (p.code) {
669
- case 3: base.styleName = p.value; break;
670
- case 304: base.text = p.value; break;
671
- case 170: base.contentType = parseInt(p.value, 10); break;
672
- case 340: base.textStyleId = p.value; break;
673
- case 10: currentX = parseFloat(p.value); break;
674
- case 20:
675
- if (currentX !== null) { base.leaderPoints.push({ x: currentX, y: parseFloat(p.value), z: 0 }); currentX = null; } break;
676
- case 30: if (base.leaderPoints.length > 0) base.leaderPoints[base.leaderPoints.length - 1].z = parseFloat(p.value); break;
677
- case 40: base.doglegLength = parseFloat(p.value); break;
678
- case 41: base.arrowheadSize = parseFloat(p.value); break;
679
- case 42: base.textHeight = parseFloat(p.value); break;
680
- }
681
- }
682
- return base;
683
- }
684
-
685
- function parseHatchEntity(base, pairs) {
686
- base.patternName = ""; base.solid = false; base.associative = false;
687
- base.style = 0; base.patternType = 0; base.patternAngle = 0; base.patternScale = 1;
688
- base.elevation = 0; base.extrusionDirection = { x: 0, y: 0, z: 1 };
689
- base.boundaryPaths = []; base.seedPoints = [];
690
- let readingBoundary = false; let currentPath = null;
691
- for (const p of pairs) {
692
- switch (p.code) {
693
- case 2: base.patternName = p.value; break;
694
- case 10: if (readingBoundary && currentPath) { currentPath.points = currentPath.points || []; currentPath.points.push({ x: parseFloat(p.value) }); } break;
695
- case 20: if (readingBoundary && currentPath && currentPath.points && currentPath.points.length > 0) currentPath.points[currentPath.points.length - 1].y = parseFloat(p.value); break;
696
- case 30: base.elevation = parseFloat(p.value); break;
697
- case 41: base.patternScale = parseFloat(p.value); break;
698
- case 52: base.patternAngle = parseFloat(p.value); break;
699
- case 70: base.solid = parseInt(p.value, 10) === 1; break;
700
- case 71: base.associative = parseInt(p.value, 10) === 1; break;
701
- case 75: base.style = parseInt(p.value, 10); break;
702
- case 76: base.patternType = parseInt(p.value, 10); break;
703
- case 91: readingBoundary = true; break;
704
- case 92: if (currentPath) base.boundaryPaths.push(currentPath); currentPath = { type: parseInt(p.value, 10), edges: [], points: [] }; break;
705
- case 93: if (currentPath) currentPath.edgeCount = parseInt(p.value, 10); break;
706
- case 97: if (currentPath) base.boundaryPaths.push(currentPath); currentPath = null; readingBoundary = false; break;
707
- case 210: base.extrusionDirection.x = parseFloat(p.value); break;
708
- case 220: base.extrusionDirection.y = parseFloat(p.value); break;
709
- case 230: base.extrusionDirection.z = parseFloat(p.value); break;
710
- }
711
- }
712
- if (currentPath) base.boundaryPaths.push(currentPath);
713
- return base;
714
- }
715
-
716
- function parseSplineEntity(base, pairs) {
717
- base.normal = { x: 0, y: 0, z: 1 }; base.degree = 3;
718
- base.closed = false; base.periodic = false; base.rational = false; base.planar = false;
719
- base.knotTolerance = 0.0000001; base.controlPointTolerance = 0.0000001;
720
- base.fitTolerance = 0.0000000001;
721
- base.startTangent = { x: 0, y: 0, z: 0 }; base.endTangent = { x: 0, y: 0, z: 0 };
722
- base.knots = []; base.weights = []; base.controlPoints = []; base.fitPoints = [];
723
- let cpX = null, fpX = null;
724
- for (const p of pairs) {
725
- switch (p.code) {
726
- case 10: cpX = parseFloat(p.value); break;
727
- case 20: if (cpX !== null) { base.controlPoints.push({ x: cpX, y: parseFloat(p.value), z: 0 }); cpX = null; } break;
728
- case 30: if (base.controlPoints.length > 0) base.controlPoints[base.controlPoints.length - 1].z = parseFloat(p.value); break;
729
- case 11: fpX = parseFloat(p.value); break;
730
- case 21: if (fpX !== null) { base.fitPoints.push({ x: fpX, y: parseFloat(p.value), z: 0 }); fpX = null; } break;
731
- case 31: if (base.fitPoints.length > 0) base.fitPoints[base.fitPoints.length - 1].z = parseFloat(p.value); break;
732
- case 12: base.startTangent.x = parseFloat(p.value); break;
733
- case 22: base.startTangent.y = parseFloat(p.value); break;
734
- case 32: base.startTangent.z = parseFloat(p.value); break;
735
- case 13: base.endTangent.x = parseFloat(p.value); break;
736
- case 23: base.endTangent.y = parseFloat(p.value); break;
737
- case 33: base.endTangent.z = parseFloat(p.value); break;
738
- case 40: base.knots.push(parseFloat(p.value)); break;
739
- case 41: base.weights.push(parseFloat(p.value)); break;
740
- case 42: base.knotTolerance = parseFloat(p.value); break;
741
- case 43: base.controlPointTolerance = parseFloat(p.value); break;
742
- case 44: base.fitTolerance = parseFloat(p.value); break;
743
- case 70: { const f = parseInt(p.value, 10); base.closed = (f & 1) === 1; base.periodic = (f & 2) === 2; base.rational = (f & 4) === 4; base.planar = (f & 8) === 8; base.flags = f; break; }
744
- case 71: base.degree = parseInt(p.value, 10); break;
745
- case 72: base.knotCount = parseInt(p.value, 10); break;
746
- case 73: base.controlPointCount = parseInt(p.value, 10); break;
747
- case 74: base.fitPointCount = parseInt(p.value, 10); break;
748
- case 210: base.normal.x = parseFloat(p.value); break;
749
- case 220: base.normal.y = parseFloat(p.value); break;
750
- case 230: base.normal.z = parseFloat(p.value); break;
751
- }
752
- }
753
- return base;
754
- }
755
-
756
- function parseSolidEntity(base, pairs) {
757
- base.points = [{ x: 0, y: 0, z: 0 }, { x: 0, y: 0, z: 0 }, { x: 0, y: 0, z: 0 }, { x: 0, y: 0, z: 0 }];
758
- base.thickness = 0; base.extrusionDirection = { x: 0, y: 0, z: 1 };
759
- for (const p of pairs) {
760
- switch (p.code) {
761
- case 10: base.points[0].x = parseFloat(p.value); break; case 20: base.points[0].y = parseFloat(p.value); break; case 30: base.points[0].z = parseFloat(p.value); break;
762
- case 11: base.points[1].x = parseFloat(p.value); break; case 21: base.points[1].y = parseFloat(p.value); break; case 31: base.points[1].z = parseFloat(p.value); break;
763
- case 12: base.points[2].x = parseFloat(p.value); break; case 22: base.points[2].y = parseFloat(p.value); break; case 32: base.points[2].z = parseFloat(p.value); break;
764
- case 13: base.points[3].x = parseFloat(p.value); break; case 23: base.points[3].y = parseFloat(p.value); break; case 33: base.points[3].z = parseFloat(p.value); break;
765
- case 39: base.thickness = parseFloat(p.value); break;
766
- case 210: base.extrusionDirection.x = parseFloat(p.value); break;
767
- case 220: base.extrusionDirection.y = parseFloat(p.value); break;
768
- case 230: base.extrusionDirection.z = parseFloat(p.value); break;
769
- }
770
- }
771
- return base;
772
- }
773
-
774
- function parse3DFaceEntity(base, pairs) {
775
- base.vertices = [{ x: 0, y: 0, z: 0 }, { x: 0, y: 0, z: 0 }, { x: 0, y: 0, z: 0 }, { x: 0, y: 0, z: 0 }];
776
- base.invisibleEdgeFlags = 0;
777
- for (const p of pairs) {
778
- switch (p.code) {
779
- case 10: base.vertices[0].x = parseFloat(p.value); break; case 20: base.vertices[0].y = parseFloat(p.value); break; case 30: base.vertices[0].z = parseFloat(p.value); break;
780
- case 11: base.vertices[1].x = parseFloat(p.value); break; case 21: base.vertices[1].y = parseFloat(p.value); break; case 31: base.vertices[1].z = parseFloat(p.value); break;
781
- case 12: base.vertices[2].x = parseFloat(p.value); break; case 22: base.vertices[2].y = parseFloat(p.value); break; case 32: base.vertices[2].z = parseFloat(p.value); break;
782
- case 13: base.vertices[3].x = parseFloat(p.value); break; case 23: base.vertices[3].y = parseFloat(p.value); break; case 33: base.vertices[3].z = parseFloat(p.value); break;
783
- case 70: base.invisibleEdgeFlags = parseInt(p.value, 10); break;
784
- }
785
- }
786
- return base;
787
- }
788
-
789
- function parseRayEntity(base, pairs) {
790
- base.basePoint = { x: 0, y: 0, z: 0 }; base.direction = { x: 1, y: 0, z: 0 };
791
- for (const p of pairs) {
792
- switch (p.code) {
793
- case 10: base.basePoint.x = parseFloat(p.value); break; case 20: base.basePoint.y = parseFloat(p.value); break; case 30: base.basePoint.z = parseFloat(p.value); break;
794
- case 11: base.direction.x = parseFloat(p.value); break; case 21: base.direction.y = parseFloat(p.value); break; case 31: base.direction.z = parseFloat(p.value); break;
795
- }
796
- }
797
- return base;
798
- }
799
-
800
- function parseViewportEntity(base, pairs) {
801
- base.center = { x: 0, y: 0, z: 0 }; base.width = 0; base.height = 0;
802
- base.viewTarget = { x: 0, y: 0, z: 0 }; base.viewDirection = { x: 0, y: 0, z: 1 };
803
- base.viewTwistAngle = 0; base.viewHeight = 0; base.viewCenter = { x: 0, y: 0 };
804
- base.perspectiveLensLength = 50; base.statusField = 0;
805
- base.clippingBoundary = null; base.frozenLayers = [];
806
- for (const p of pairs) {
807
- switch (p.code) {
808
- case 10: base.center.x = parseFloat(p.value); break; case 20: base.center.y = parseFloat(p.value); break; case 30: base.center.z = parseFloat(p.value); break;
809
- case 12: base.viewCenter.x = parseFloat(p.value); break; case 22: base.viewCenter.y = parseFloat(p.value); break;
810
- case 40: base.width = parseFloat(p.value); break; case 41: base.height = parseFloat(p.value); break;
811
- case 45: base.viewHeight = parseFloat(p.value); break;
812
- case 51: base.viewTwistAngle = parseFloat(p.value); break;
813
- case 68: base.statusField = parseInt(p.value, 10); break;
814
- case 69: base.id = parseInt(p.value, 10); break;
815
- case 331: base.frozenLayers.push(p.value); break;
816
- case 340: base.clippingBoundary = p.value; break;
817
- }
818
- }
819
- return base;
820
- }
821
-
822
- function parseImageEntity(base, pairs) {
823
- base.insertionPoint = { x: 0, y: 0, z: 0 }; base.uVector = { x: 1, y: 0, z: 0 };
824
- base.vVector = { x: 0, y: 1, z: 0 }; base.imageSize = { u: 0, v: 0 };
825
- base.imageDefHandle = ""; base.displayFlags = 0; base.clippingType = 0;
826
- base.brightness = 50; base.contrast = 50; base.fade = 0; base.clippingVertices = [];
827
- for (const p of pairs) {
828
- switch (p.code) {
829
- case 10: base.insertionPoint.x = parseFloat(p.value); break; case 20: base.insertionPoint.y = parseFloat(p.value); break; case 30: base.insertionPoint.z = parseFloat(p.value); break;
830
- case 13: base.imageSize.u = parseFloat(p.value); break; case 23: base.imageSize.v = parseFloat(p.value); break;
831
- case 14: base.clippingVertices.push({ x: parseFloat(p.value) }); break;
832
- case 24: if (base.clippingVertices.length > 0) base.clippingVertices[base.clippingVertices.length - 1].y = parseFloat(p.value); break;
833
- case 70: base.displayFlags = parseInt(p.value, 10); break;
834
- case 340: base.imageDefHandle = p.value; break;
835
- }
836
- }
837
- return base;
838
- }
839
-
840
- function parseToleranceEntity(base, pairs) {
841
- base.insertionPoint = { x: 0, y: 0, z: 0 }; base.direction = { x: 1, y: 0, z: 0 };
842
- base.styleName = "STANDARD"; base.text = "";
843
- for (const p of pairs) {
844
- switch (p.code) {
845
- case 1: base.text = p.value; break; case 3: base.styleName = p.value; break;
846
- case 10: base.insertionPoint.x = parseFloat(p.value); break; case 20: base.insertionPoint.y = parseFloat(p.value); break; case 30: base.insertionPoint.z = parseFloat(p.value); break;
847
- case 11: base.direction.x = parseFloat(p.value); break; case 21: base.direction.y = parseFloat(p.value); break; case 31: base.direction.z = parseFloat(p.value); break;
848
- }
849
- }
850
- return base;
851
- }
852
-
853
- function parseHelixEntity(base, pairs) {
854
- base.axisBasePoint = { x: 0, y: 0, z: 0 }; base.startPoint = { x: 0, y: 0, z: 0 };
855
- base.axisVector = { x: 0, y: 0, z: 1 }; base.radius = 0; base.turns = 1;
856
- base.turnHeight = 0; base.handedness = 0; base.constraint = 0;
857
- for (const p of pairs) {
858
- switch (p.code) {
859
- case 10: base.axisBasePoint.x = parseFloat(p.value); break; case 20: base.axisBasePoint.y = parseFloat(p.value); break; case 30: base.axisBasePoint.z = parseFloat(p.value); break;
860
- case 11: base.startPoint.x = parseFloat(p.value); break; case 21: base.startPoint.y = parseFloat(p.value); break; case 31: base.startPoint.z = parseFloat(p.value); break;
861
- case 40: base.radius = parseFloat(p.value); break; case 41: base.turns = parseFloat(p.value); break; case 42: base.turnHeight = parseFloat(p.value); break;
862
- case 290: base.handedness = parseInt(p.value, 10); break; case 280: base.constraint = parseInt(p.value, 10); break;
863
- }
864
- }
865
- return base;
866
- }
867
-
868
- function parseMeshEntity(base, pairs) {
869
- base.version = 2; base.subdivisionLevel = 0; base.vertices = [];
870
- base.faces = []; base.edges = []; base.edgeCreases = [];
871
- let currentX = null; let readingFaces = false; let readingEdges = false; let readingCreases = false;
872
- for (const p of pairs) {
873
- switch (p.code) {
874
- case 71: base.version = parseInt(p.value, 10); break;
875
- case 72: base.subdivisionLevel = parseInt(p.value, 10); break;
876
- case 91: readingFaces = false; break;
877
- case 92: readingFaces = true; break;
878
- case 93: readingEdges = true; readingFaces = false; break;
879
- case 94: readingCreases = true; readingEdges = false; break;
880
- case 95: readingCreases = false; break;
881
- case 10: currentX = parseFloat(p.value); break;
882
- case 20: if (currentX !== null) { base.vertices.push({ x: currentX, y: parseFloat(p.value), z: 0 }); currentX = null; } break;
883
- case 30: if (base.vertices.length > 0) base.vertices[base.vertices.length - 1].z = parseFloat(p.value); break;
884
- case 90: if (readingFaces) base.faces.push(parseInt(p.value, 10)); else if (readingEdges) base.edges.push(parseInt(p.value, 10)); break;
885
- case 140: if (readingCreases) base.edgeCreases.push(parseFloat(p.value)); break;
886
- }
887
- }
888
- return base;
889
- }
890
-
891
- function parseRegionEntity(base, pairs) {
892
- base.acisData = [];
893
- for (const p of pairs) { if (p.code === 1 || p.code === 3) base.acisData.push(p.value); if (p.code === 70) base.modelerFormat = parseInt(p.value, 10); }
894
- base.acisDataString = base.acisData.join("");
895
- return base;
896
- }
897
-
898
- function parseOle2Entity(base, pairs) {
899
- base.upperLeftCorner = { x: 0, y: 0, z: 0 }; base.lowerRightCorner = { x: 0, y: 0, z: 0 };
900
- base.oleType = 0; base.tileMode = 0;
901
- for (const p of pairs) {
902
- switch (p.code) {
903
- case 10: base.upperLeftCorner.x = parseFloat(p.value); break; case 20: base.upperLeftCorner.y = parseFloat(p.value); break;
904
- case 11: base.lowerRightCorner.x = parseFloat(p.value); break; case 21: base.lowerRightCorner.y = parseFloat(p.value); break;
905
- case 70: base.oleType = parseInt(p.value, 10); break; case 71: base.tileMode = parseInt(p.value, 10); break;
906
- case 1: case 3: base.binaryData = base.binaryData || []; base.binaryData.push(p.value); break;
907
- }
908
- }
909
- return base;
910
- }
911
-
912
- function parseTableEntity(base, pairs) {
913
- base.insertionPoint = { x: 0, y: 0, z: 0 }; base.blockName = "";
914
- base.direction = { x: 1, y: 0, z: 0 }; base.rows = 0; base.columns = 0;
915
- for (const p of pairs) {
916
- switch (p.code) {
917
- case 2: base.blockName = p.value; break;
918
- case 10: base.insertionPoint.x = parseFloat(p.value); break; case 20: base.insertionPoint.y = parseFloat(p.value); break;
919
- case 11: base.direction.x = parseFloat(p.value); break; case 21: base.direction.y = parseFloat(p.value); break;
920
- case 91: base.rows = parseInt(p.value, 10); break; case 92: base.columns = parseInt(p.value, 10); break;
921
- case 142: base.rowHeights = base.rowHeights || []; base.rowHeights.push(parseFloat(p.value)); break;
922
- case 141: base.columnWidths = base.columnWidths || []; base.columnWidths.push(parseFloat(p.value)); break;
923
- }
924
- }
925
- return base;
926
- }
927
-
928
- function parseMLineEntity(base, pairs) {
929
- base.styleName = "STANDARD"; base.scale = 1; base.justification = 0; base.flags = 0;
930
- base.startPoint = { x: 0, y: 0, z: 0 }; base.normal = { x: 0, y: 0, z: 1 }; base.vertices = [];
931
- let currentX = null;
932
- for (const p of pairs) {
933
- switch (p.code) {
934
- case 2: base.styleName = p.value; break;
935
- case 10: base.startPoint.x = parseFloat(p.value); break; case 20: base.startPoint.y = parseFloat(p.value); break; case 30: base.startPoint.z = parseFloat(p.value); break;
936
- case 11: currentX = parseFloat(p.value); break;
937
- case 21: if (currentX !== null) { base.vertices.push({ x: currentX, y: parseFloat(p.value), z: 0 }); currentX = null; } break;
938
- case 31: if (base.vertices.length > 0) base.vertices[base.vertices.length - 1].z = parseFloat(p.value); break;
939
- case 40: base.scale = parseFloat(p.value); break;
940
- case 70: base.justification = parseInt(p.value, 10); break;
941
- case 71: base.flags = parseInt(p.value, 10); break;
942
- case 72: base.vertexCount = parseInt(p.value, 10); break;
943
- case 340: base.styleHandle = p.value; break;
944
- case 210: base.normal.x = parseFloat(p.value); break; case 220: base.normal.y = parseFloat(p.value); break; case 230: base.normal.z = parseFloat(p.value); break;
945
- }
946
- }
947
- return base;
948
- }
949
-
950
- function parseGenericEntity(base, pairs) {
951
- base.data = {};
952
- for (const p of pairs) {
953
- const key = `code_${p.code}`;
954
- const val = autoConvert(p.code, p.value);
955
- if (base.data[key] !== undefined) base.data[key] = [].concat(base.data[key], val);
956
- else base.data[key] = val;
957
- }
958
- return base;
959
- }
960
-
961
- function parseObjects(pairs) {
962
- if (!pairs || pairs.length === 0) return [];
963
- const objects = []; let i = 0;
964
- while (i < pairs.length) {
965
- if (pairs[i].code === 0) {
966
- const objType = pairs[i].value; i++;
967
- const obj = { type: objType };
968
- while (i < pairs.length && pairs[i].code !== 0) {
969
- const code = pairs[i].code; const val = autoConvert(code, pairs[i].value);
970
- switch (code) {
971
- case 5: obj.handle = val; break; case 2: obj.name = val; break;
972
- case 3: obj.entryName = obj.entryName ? [].concat(obj.entryName, val) : val; break;
973
- case 330: obj.ownerHandle = val; break;
974
- case 350: obj.softPointer = obj.softPointer ? [].concat(obj.softPointer, val) : val; break;
975
- case 360: obj.hardPointer = obj.hardPointer ? [].concat(obj.hardPointer, val) : val; break;
976
- default: const key = `code_${code}`; if (obj[key] !== undefined) obj[key] = [].concat(obj[key], val); else obj[key] = val;
977
- }
978
- i++;
979
- }
980
- objects.push(obj);
981
- } else { i++; }
982
- }
983
- return objects;
984
- }
985
-
986
- function assemblePolylineVertices(entities) {
987
- const result = []; let currentPolyline = null;
988
- for (const entity of entities) {
989
- if (entity.type === "POLYLINE") { currentPolyline = entity; result.push(entity); }
990
- else if (entity.type === "VERTEX" && currentPolyline) {
991
- currentPolyline.vertices.push({ x: entity.position.x, y: entity.position.y, z: entity.position.z, bulge: entity.bulge, startWidth: entity.startWidth, endWidth: entity.endWidth, flags: entity.flags, faceVertex1: entity.faceVertex1, faceVertex2: entity.faceVertex2, faceVertex3: entity.faceVertex3, faceVertex4: entity.faceVertex4 });
992
- } else if (entity.type === "SEQEND") { currentPolyline = null; }
993
- else { currentPolyline = null; result.push(entity); }
994
- }
995
- return result;
996
- }
997
-
998
- function assembleInsertAttributes(entities) {
999
- const result = []; let currentInsert = null;
1000
- for (const entity of entities) {
1001
- if (entity.type === "INSERT" && entity.hasAttributes) { currentInsert = entity; result.push(entity); }
1002
- else if (entity.type === "ATTRIB" && currentInsert) { currentInsert.attributes.push(entity); }
1003
- else if (entity.type === "SEQEND") { currentInsert = null; }
1004
- else { currentInsert = null; result.push(entity); }
1005
- }
1006
- return result;
1007
- }
1008
-
1009
- // ─────────────────── 输入适配(关键改动部分) ───────────────────
1010
-
1011
- /**
1012
- * ★ 改动点: 从 URL 获取 DXF 文本
1013
- */
1014
- async function fetchDxfFromUrl(url) {
1015
- if (typeof fetch === "function") {
1016
- const resp = await fetch(url);
1017
- if (!resp.ok) throw new Error(`获取 DXF 失败: HTTP ${resp.status} — ${url}`);
1018
- return await resp.text();
1019
- }
1020
- // Node < 18 降级
1021
- if (typeof process !== "undefined" && process.versions?.node) {
1022
- const { default: http } = url.startsWith("https") ? await import('https') : await import('http');
1023
- return new Promise((resolve, reject) => {
1024
- http.get(url, (res) => {
1025
- if (res.statusCode !== 200) { reject(new Error(`HTTP ${res.statusCode}`)); return; }
1026
- let data = ""; res.setEncoding("utf-8");
1027
- res.on("data", (c) => (data += c)); res.on("end", () => resolve(data)); res.on("error", reject);
1028
- }).on("error", reject);
1029
- });
1030
- }
1031
- throw new Error("当前环境不支持 HTTP 请求");
1032
- }
1033
-
1034
- /**
1035
- * ★ 改动点: 读取本地文件,动态 import("fs")
1036
- */
1037
- async function readLocalFile(filePath) {
1038
- if (typeof process !== "undefined" && process.versions?.node) {
1039
- const { readFile } = await import('fs/promises');
1040
- return await readFile(filePath, "utf-8");
1041
- }
1042
- throw new Error("浏览器不支持读取本地路径,请用 URL 或 File 对象");
1043
- }
1044
-
1045
- // ─────────────────── 主入口 ───────────────────
1046
-
1047
- /**
1048
- * ★ 改动点: 支持 字符串 / 文件路径 / URL / File 对象
1049
- */
1050
- async function parseDxf(input) {
1051
- let dxfString;
1052
-
1053
- if (typeof Blob !== "undefined" && input instanceof Blob) {
1054
- dxfString = await input.text();
1055
- } else if (typeof input === "string") {
1056
- if (input.includes("\n") || input.includes("SECTION")) {
1057
- dxfString = input;
1058
- } else if (/^https?:\/\//i.test(input)) {
1059
- dxfString = await fetchDxfFromUrl(input);
1060
- } else {
1061
- dxfString = await readLocalFile(input);
1062
- }
1063
- } else {
1064
- throw new Error("parseDxf: 请传入 DXF 字符串、文件路径、URL 或 File 对象");
1065
- }
1066
-
1067
- const pairs = tokenize(dxfString);
1068
- const sections = splitSections(pairs);
1069
- const result = {
1070
- header: parseHeader(sections.HEADER),
1071
- classes: parseClasses(sections.CLASSES),
1072
- tables: parseTables(sections.TABLES),
1073
- blocks: parseBlocks(sections.BLOCKS),
1074
- entities: parseEntityList(sections.ENTITIES || []),
1075
- objects: parseObjects(sections.OBJECTS),
1076
- };
1077
- result.entities = assemblePolylineVertices(result.entities);
1078
- result.entities = assembleInsertAttributes(result.entities);
1079
- for (const block of result.blocks) {
1080
- if (block.entities && block.entities.length > 0) {
1081
- block.entities = assemblePolylineVertices(block.entities);
1082
- block.entities = assembleInsertAttributes(block.entities);
1083
- }
1084
- }
1085
- return result;
1086
- }
1087
-
1088
- /**
1089
- * ============================================================
1090
- * DXF 文件写入器
1091
- * 将 parseDxf() 输出的 JSON 数据结构写回 DXF 文本格式
1092
- * 支持所有 parser 中解析的实体类型
1093
- *
1094
- * ★ CJS → ESM 改动:
1095
- * ① writeDxfFile 内 require("fs") → await import("fs/promises")
1096
- * ② 末尾 module.exports → export
1097
- * ③ 新增 downloadDxfFile() 浏览器下载方法
1098
- * ============================================================
1099
- */
1100
-
1101
- // ─────────────────── 工具函数 ───────────────────
1102
-
1103
- /**
1104
- * 写入一对 group code + value
1105
- */
1106
- function pair(code, value) {
1107
- if (value === undefined || value === null) return "";
1108
- return ` ${code}\n${value}\n`;
1109
- }
1110
-
1111
- /** 写入浮点数,保留合理精度 */
1112
- function pairF(code, value) {
1113
- if (value === undefined || value === null) return "";
1114
- return pair(code, formatFloat(value));
1115
- }
1116
-
1117
- /** 格式化浮点数:去掉多余尾零,但至少保留一位小数 */
1118
- function formatFloat(v) {
1119
- if (typeof v !== "number" || isNaN(v)) return "0.0";
1120
- let s = v.toFixed(6);
1121
- s = s.replace(/(\.\d*?)0+$/, "$1");
1122
- if (s.endsWith(".")) s += "0";
1123
- return s;
1124
- }
1125
-
1126
- /** 写入整数 */
1127
- function pairI(code, value) {
1128
- if (value === undefined || value === null) return "";
1129
- return pair(code, Math.round(value));
1130
- }
1131
-
1132
- /** 写入 3D 点 (codeX, codeX+10, codeX+20) */
1133
- function writePoint3D(baseCode, point) {
1134
- if (!point) return "";
1135
- return (
1136
- pairF(baseCode, point.x) +
1137
- pairF(baseCode + 10, point.y) +
1138
- pairF(baseCode + 20, point.z)
1139
- );
1140
- }
1141
-
1142
- /** 写入 2D 点 */
1143
- function writePoint2D(baseCode, point) {
1144
- if (!point) return "";
1145
- return pairF(baseCode, point.x) + pairF(baseCode + 10, point.y);
1146
- }
1147
-
1148
- /** 写入挤出方向 (210/220/230) */
1149
- function writeExtrusion(ext) {
1150
- if (!ext) return "";
1151
- if (ext.x === 0 && ext.y === 0 && ext.z === 1) return "";
1152
- return pairF(210, ext.x) + pairF(220, ext.y) + pairF(230, ext.z);
1153
- }
1154
-
1155
- // ─────────────────── HEADER 写入 ───────────────────
1156
-
1157
- function writeHeader(header) {
1158
- if (!header || Object.keys(header).length === 0) return "";
1159
- let out = pair(0, "SECTION") + pair(2, "HEADER");
1160
-
1161
- for (const [varName, values] of Object.entries(header)) {
1162
- out += pair(9, varName);
1163
- if (typeof values === "object" && values !== null && !Array.isArray(values)) {
1164
- for (const [code, val] of Object.entries(values)) {
1165
- out += pair(parseInt(code), val);
1166
- }
1167
- } else {
1168
- out += pair(1, values);
1169
- }
1170
- }
1171
-
1172
- out += pair(0, "ENDSEC");
1173
- return out;
1174
- }
1175
-
1176
- // ─────────────────── CLASSES 写入 ───────────────────
1177
-
1178
- function writeClasses(classes) {
1179
- if (!classes || classes.length === 0) return "";
1180
- let out = pair(0, "SECTION") + pair(2, "CLASSES");
1181
-
1182
- for (const cls of classes) {
1183
- out += pair(0, "CLASS");
1184
- if (cls.dxfRecord) out += pair(1, cls.dxfRecord);
1185
- if (cls.cppClassName) out += pair(2, cls.cppClassName);
1186
- if (cls.appName) out += pair(3, cls.appName);
1187
- if (cls.proxyCapabilities !== undefined) out += pairI(90, cls.proxyCapabilities);
1188
- if (cls.instanceCount !== undefined) out += pairI(91, cls.instanceCount);
1189
- if (cls.wasProxy !== undefined) out += pairI(280, cls.wasProxy);
1190
- if (cls.isEntity !== undefined) out += pairI(281, cls.isEntity);
1191
- }
1192
-
1193
- out += pair(0, "ENDSEC");
1194
- return out;
1195
- }
1196
-
1197
- // ─────────────────── TABLES 写入 ───────────────────
1198
-
1199
- function writeTables(tables) {
1200
- if (!tables || Object.keys(tables).length === 0) return "";
1201
- let out = pair(0, "SECTION") + pair(2, "TABLES");
1202
-
1203
- for (const [tableName, entries] of Object.entries(tables)) {
1204
- out += pair(0, "TABLE");
1205
- out += pair(2, tableName);
1206
- if (entries.length > 0) {
1207
- const first = entries[0];
1208
- if (first.handle) out += pair(5, first.handle);
1209
- if (first.ownerHandle) out += pair(330, first.ownerHandle);
1210
- out += pair(100, "AcDbSymbolTable");
1211
- out += pairI(70, entries.length);
1212
- }
1213
-
1214
- for (const entry of entries) {
1215
- out += pair(0, entry._type || tableName);
1216
- if (entry.handle) out += pair(5, entry.handle);
1217
- if (entry.ownerHandle) out += pair(330, entry.ownerHandle);
1218
- if (entry.subclassMarker) {
1219
- const markers = [].concat(entry.subclassMarker);
1220
- for (const m of markers) {
1221
- out += pair(100, m);
1222
- }
1223
- }
1224
- if (entry.name) out += pair(2, entry.name);
1225
- if (entry.flags !== undefined) out += pairI(70, entry.flags);
1226
- if (entry.colorNumber !== undefined) out += pairI(62, entry.colorNumber);
1227
- if (entry.linetypeName) out += pair(6, entry.linetypeName);
1228
- if (entry.styleName) out += pair(7, entry.styleName);
1229
- if (entry.height) out += pairF(40, entry.height);
1230
- if (entry.widthFactor) out += pairF(41, entry.widthFactor);
1231
- if (entry.angle) out += pairF(50, entry.angle);
1232
- if (entry.lineweight !== undefined) out += pairI(370, entry.lineweight);
1233
- if (entry.plotStyleHandle) out += pair(390, entry.plotStyleHandle);
1234
-
1235
- if (entry.extra) {
1236
- for (const [key, val] of Object.entries(entry)) {
1237
- if (key.startsWith("code_")) {
1238
- const code = parseInt(key.replace("code_", ""));
1239
- const vals = [].concat(val);
1240
- for (const v of vals) {
1241
- out += pair(code, v);
1242
- }
1243
- }
1244
- }
1245
- }
1246
- }
1247
-
1248
- out += pair(0, "ENDTAB");
1249
- }
1250
-
1251
- out += pair(0, "ENDSEC");
1252
- return out;
1253
- }
1254
-
1255
- // ─────────────────── BLOCKS 写入 ───────────────────
1256
-
1257
- function writeBlocks(blocks) {
1258
- if (!blocks || blocks.length === 0) return "";
1259
- let out = pair(0, "SECTION") + pair(2, "BLOCKS");
1260
-
1261
- for (const block of blocks) {
1262
- out += pair(0, "BLOCK");
1263
- if (block.handle) out += pair(5, block.handle);
1264
- if (block.ownerHandle) out += pair(330, block.ownerHandle);
1265
- out += pair(100, "AcDbEntity");
1266
- if (block.layer) out += pair(8, block.layer);
1267
- out += pair(100, "AcDbBlockBegin");
1268
- if (block.name) out += pair(2, block.name);
1269
- if (block.flags !== undefined) out += pairI(70, block.flags);
1270
- out += pairF(10, block.basePointX || (block.basePoint && block.basePoint.x) || 0);
1271
- out += pairF(20, block.basePointY || (block.basePoint && block.basePoint.y) || 0);
1272
- out += pairF(30, block.basePointZ || (block.basePoint && block.basePoint.z) || 0);
1273
- if (block.name2 || block.name) out += pair(3, block.name2 || block.name);
1274
-
1275
- if (block.entities && block.entities.length > 0) {
1276
- out += writeEntityList(block.entities);
1277
- }
1278
-
1279
- out += pair(0, "ENDBLK");
1280
- if (block.handle) out += pair(5, block.handle);
1281
- if (block.ownerHandle) out += pair(330, block.ownerHandle);
1282
- out += pair(100, "AcDbEntity");
1283
- if (block.layer) out += pair(8, block.layer);
1284
- out += pair(100, "AcDbBlockEnd");
1285
- }
1286
-
1287
- out += pair(0, "ENDSEC");
1288
- return out;
1289
- }
1290
-
1291
- // ─────────────────── ENTITIES 写入 ───────────────────
1292
-
1293
- function writeEntityList(entities) {
1294
- let out = "";
1295
- for (const entity of entities) {
1296
- out += writeOneEntity(entity);
1297
- }
1298
- return out;
1299
- }
1300
-
1301
- function writeEntitiesSection(entities) {
1302
- if (!entities || entities.length === 0) return "";
1303
- let out = pair(0, "SECTION") + pair(2, "ENTITIES");
1304
- out += writeEntityList(entities);
1305
- out += pair(0, "ENDSEC");
1306
- return out;
1307
- }
1308
-
1309
- /** 写入通用实体头部字段 */
1310
- function writeCommonFields(entity) {
1311
- let out = "";
1312
- if (entity.handle) out += pair(5, entity.handle);
1313
- if (entity.ownerHandle) out += pair(330, entity.ownerHandle);
1314
- out += pair(100, "AcDbEntity");
1315
- if (entity.inPaperSpace) out += pairI(67, 1);
1316
- if (entity.layer) out += pair(8, entity.layer);
1317
- if (entity.linetypeName) out += pair(6, entity.linetypeName);
1318
- if (entity.colorNumber !== undefined && entity.colorNumber !== 0) out += pairI(62, entity.colorNumber);
1319
- if (entity.lineweight !== undefined) out += pairI(370, entity.lineweight);
1320
- if (entity.linetypeScale !== undefined && entity.linetypeScale !== 1) out += pairF(48, entity.linetypeScale);
1321
- if (entity.visible === false) out += pairI(60, 1);
1322
- if (entity.trueColor) out += pairI(420, entity.trueColor);
1323
- return out;
1324
- }
1325
-
1326
- /** 写入单个实体 */
1327
- function writeOneEntity(entity) {
1328
- if (!entity || !entity.type) return "";
1329
-
1330
- let out = pair(0, entity.type);
1331
- out += writeCommonFields(entity);
1332
-
1333
- switch (entity.type) {
1334
- case "LINE": out += writeLineEntity(entity); break;
1335
- case "LWPOLYLINE": out += writeLWPolylineEntity(entity); break;
1336
- case "POLYLINE": out += writePolylineEntity(entity); break;
1337
- case "ARC": out += writeArcEntity(entity); break;
1338
- case "CIRCLE": out += writeCircleEntity(entity); break;
1339
- case "ELLIPSE": out += writeEllipseEntity(entity); break;
1340
- case "POINT": out += writePointEntity(entity); break;
1341
- case "TEXT": out += writeTextEntity(entity); break;
1342
- case "MTEXT": out += writeMTextEntity(entity); break;
1343
- case "ATTRIB":
1344
- case "ATTDEF": out += writeAttribEntity(entity); break;
1345
- case "INSERT": out += writeInsertEntity(entity); break;
1346
- case "DIMENSION": out += writeDimensionEntity(entity); break;
1347
- case "LEADER": out += writeLeaderEntity(entity); break;
1348
- case "MLEADER": out += writeMLeaderEntity(entity); break;
1349
- case "HATCH": out += writeHatchEntity(entity); break;
1350
- case "SPLINE": out += writeSplineEntity(entity); break;
1351
- case "SOLID":
1352
- case "3DSOLID":
1353
- case "TRACE": out += writeSolidEntity(entity); break;
1354
- case "3DFACE": out += write3DFaceEntity(entity); break;
1355
- case "RAY":
1356
- case "XLINE": out += writeRayEntity(entity); break;
1357
- case "VIEWPORT": out += writeViewportEntity(entity); break;
1358
- case "IMAGE":
1359
- case "WIPEOUT": out += writeImageEntity(entity); break;
1360
- case "TOLERANCE": out += writeToleranceEntity(entity); break;
1361
- case "HELIX": out += writeHelixEntity(entity); break;
1362
- case "MESH": out += writeMeshEntity(entity); break;
1363
- case "REGION":
1364
- case "BODY":
1365
- case "SURFACE": out += writeRegionEntity(entity); break;
1366
- case "OLE2FRAME": out += writeOle2Entity(entity); break;
1367
- case "TABLE": out += writeTableEntity(entity); break;
1368
- case "MLINE": out += writeMLineEntity(entity); break;
1369
- case "SEQEND": break;
1370
- default: out += writeGenericEntity(entity); break;
1371
- }
1372
-
1373
- return out;
1374
- }
1375
-
1376
- // ─────────────────── 各实体写入器 ───────────────────
1377
-
1378
- function writeLineEntity(e) {
1379
- let out = pair(100, "AcDbLine");
1380
- if (e.thickness) out += pairF(39, e.thickness);
1381
- out += writePoint3D(10, e.startPoint);
1382
- out += writePoint3D(11, e.endPoint);
1383
- out += writeExtrusion(e.extrusionDirection);
1384
- return out;
1385
- }
1386
-
1387
- function writeLWPolylineEntity(e) {
1388
- let out = pair(100, "AcDbPolyline");
1389
- const verts = e.vertices || [];
1390
- out += pairI(90, verts.length);
1391
-
1392
- let flags = 0;
1393
- if (e.closed) flags |= 1;
1394
- out += pairI(70, flags);
1395
-
1396
- if (e.constantWidth) out += pairF(43, e.constantWidth);
1397
- if (e.elevation) out += pairF(38, e.elevation);
1398
- if (e.thickness) out += pairF(39, e.thickness);
1399
-
1400
- for (const v of verts) {
1401
- out += pairF(10, v.x);
1402
- out += pairF(20, v.y);
1403
- if (v.startWidth) out += pairF(40, v.startWidth);
1404
- if (v.endWidth) out += pairF(41, v.endWidth);
1405
- if (v.bulge) out += pairF(42, v.bulge);
1406
- }
1407
-
1408
- out += writeExtrusion(e.extrusionDirection);
1409
- return out;
1410
- }
1411
-
1412
- function writePolylineEntity(e) {
1413
- let out = pair(100, "AcDb2dPolyline");
1414
-
1415
- let flags = e.flags || 0;
1416
- if (e.closed) flags |= 1;
1417
- out += pairI(70, flags);
1418
-
1419
- out += pairF(10, 0);
1420
- out += pairF(20, 0);
1421
- if (e.elevation) out += pairF(30, e.elevation);
1422
- if (e.thickness) out += pairF(39, e.thickness);
1423
- if (e.defaultStartWidth) out += pairF(40, e.defaultStartWidth);
1424
- if (e.defaultEndWidth) out += pairF(41, e.defaultEndWidth);
1425
- if (e.meshMVertexCount) out += pairI(71, e.meshMVertexCount);
1426
- if (e.meshNVertexCount) out += pairI(72, e.meshNVertexCount);
1427
- out += writeExtrusion(e.extrusionDirection);
1428
-
1429
- if (e.vertices && e.vertices.length > 0) {
1430
- for (const v of e.vertices) {
1431
- out += pair(0, "VERTEX");
1432
- if (e.handle) out += pair(5, "");
1433
- out += pair(100, "AcDbEntity");
1434
- if (e.layer) out += pair(8, e.layer);
1435
- out += pair(100, "AcDbVertex");
1436
- out += pair(100, "AcDb2dVertex");
1437
- out += pairF(10, v.x);
1438
- out += pairF(20, v.y);
1439
- out += pairF(30, v.z || 0);
1440
- if (v.startWidth) out += pairF(40, v.startWidth);
1441
- if (v.endWidth) out += pairF(41, v.endWidth);
1442
- if (v.bulge) out += pairF(42, v.bulge);
1443
- if (v.flags) out += pairI(70, v.flags);
1444
- }
1445
- out += pair(0, "SEQEND");
1446
- out += pair(100, "AcDbEntity");
1447
- if (e.layer) out += pair(8, e.layer);
1448
- }
1449
-
1450
- return out;
1451
- }
1452
-
1453
- function writeArcEntity(e) {
1454
- let out = pair(100, "AcDbCircle");
1455
- if (e.thickness) out += pairF(39, e.thickness);
1456
- out += writePoint3D(10, e.center);
1457
- out += pairF(40, e.radius);
1458
- out += writeExtrusion(e.extrusionDirection);
1459
- out += pair(100, "AcDbArc");
1460
- out += pairF(50, e.startAngle);
1461
- out += pairF(51, e.endAngle);
1462
- return out;
1463
- }
1464
-
1465
- function writeCircleEntity(e) {
1466
- let out = pair(100, "AcDbCircle");
1467
- if (e.thickness) out += pairF(39, e.thickness);
1468
- out += writePoint3D(10, e.center);
1469
- out += pairF(40, e.radius);
1470
- out += writeExtrusion(e.extrusionDirection);
1471
- return out;
1472
- }
1473
-
1474
- function writeEllipseEntity(e) {
1475
- let out = pair(100, "AcDbEllipse");
1476
- out += writePoint3D(10, e.center);
1477
- out += writePoint3D(11, e.majorAxisEndPoint);
1478
- out += writeExtrusion(e.extrusionDirection);
1479
- out += pairF(40, e.axisRatio);
1480
- out += pairF(41, e.startAngle);
1481
- out += pairF(42, e.endAngle);
1482
- return out;
1483
- }
1484
-
1485
- function writePointEntity(e) {
1486
- let out = pair(100, "AcDbPoint");
1487
- out += writePoint3D(10, e.position);
1488
- if (e.thickness) out += pairF(39, e.thickness);
1489
- if (e.angle) out += pairF(50, e.angle);
1490
- out += writeExtrusion(e.extrusionDirection);
1491
- return out;
1492
- }
1493
-
1494
- function writeTextEntity(e) {
1495
- let out = pair(100, "AcDbText");
1496
- if (e.thickness) out += pairF(39, e.thickness);
1497
- out += writePoint3D(10, e.insertionPoint);
1498
- out += pairF(40, e.height);
1499
- out += pair(1, e.text);
1500
- if (e.rotation) out += pairF(50, e.rotation);
1501
- if (e.xScale && e.xScale !== 1) out += pairF(41, e.xScale);
1502
- if (e.oblique) out += pairF(51, e.oblique);
1503
- if (e.styleName && e.styleName !== "STANDARD") out += pair(7, e.styleName);
1504
- if (e.generationFlags) out += pairI(71, e.generationFlags);
1505
- if (e.hAlign) out += pairI(72, e.hAlign);
1506
- out += writePoint3D(11, e.alignmentPoint);
1507
- out += writeExtrusion(e.extrusionDirection);
1508
- out += pair(100, "AcDbText");
1509
- if (e.vAlign) out += pairI(73, e.vAlign);
1510
- return out;
1511
- }
1512
-
1513
- function writeMTextEntity(e) {
1514
- let out = pair(100, "AcDbMText");
1515
- out += writePoint3D(10, e.insertionPoint);
1516
- out += pairF(40, e.height);
1517
- if (e.width) out += pairF(41, e.width);
1518
- if (e.attachmentPoint) out += pairI(71, e.attachmentPoint);
1519
- if (e.drawingDirection) out += pairI(72, e.drawingDirection);
1520
-
1521
- const text = e.text || "";
1522
- if (text.length > 250) {
1523
- let remaining = text;
1524
- while (remaining.length > 250) {
1525
- out += pair(3, remaining.substring(0, 250));
1526
- remaining = remaining.substring(250);
1527
- }
1528
- out += pair(1, remaining);
1529
- } else {
1530
- out += pair(1, text);
1531
- }
1532
-
1533
- if (e.styleName && e.styleName !== "STANDARD") out += pair(7, e.styleName);
1534
- if (e.rotation) out += pairF(50, e.rotation);
1535
- if (e.lineSpacingStyle) out += pairI(73, e.lineSpacingStyle);
1536
- if (e.lineSpacing && e.lineSpacing !== 1) out += pairF(44, e.lineSpacing);
1537
- out += writePoint3D(11, e.direction);
1538
- out += writeExtrusion(e.extrusionDirection);
1539
- return out;
1540
- }
1541
-
1542
- function writeAttribEntity(e) {
1543
- const isAttdef = e.type === "ATTDEF";
1544
- let out = pair(100, isAttdef ? "AcDbAttributeDefinition" : "AcDbAttribute");
1545
- out += writePoint3D(10, e.insertionPoint);
1546
- out += pairF(40, e.height);
1547
- out += pair(1, e.text);
1548
- if (e.tag) out += pair(2, e.tag);
1549
- if (e.prompt) out += pair(3, e.prompt);
1550
- if (e.flags) out += pairI(70, e.flags);
1551
- if (e.rotation) out += pairF(50, e.rotation);
1552
- if (e.xScale && e.xScale !== 1) out += pairF(41, e.xScale);
1553
- if (e.styleName && e.styleName !== "STANDARD") out += pair(7, e.styleName);
1554
- if (e.generationFlags) out += pairI(71, e.generationFlags);
1555
- if (e.hAlign) out += pairI(72, e.hAlign);
1556
- if (e.vAlign) out += pairI(73, e.vAlign);
1557
- out += writePoint3D(11, e.alignmentPoint);
1558
- return out;
1559
- }
1560
-
1561
- function writeInsertEntity(e) {
1562
- let out = pair(100, "AcDbBlockReference");
1563
- if (e.hasAttributes) out += pairI(66, 1);
1564
- out += pair(2, e.blockName);
1565
- out += writePoint3D(10, e.insertionPoint);
1566
- if (e.scale) {
1567
- if (e.scale.x !== 1) out += pairF(41, e.scale.x);
1568
- if (e.scale.y !== 1) out += pairF(42, e.scale.y);
1569
- if (e.scale.z !== 1) out += pairF(43, e.scale.z);
1570
- }
1571
- if (e.rotation) out += pairF(50, e.rotation);
1572
- if (e.columnCount && e.columnCount !== 1) out += pairI(70, e.columnCount);
1573
- if (e.rowCount && e.rowCount !== 1) out += pairI(71, e.rowCount);
1574
- if (e.columnSpacing) out += pairF(44, e.columnSpacing);
1575
- if (e.rowSpacing) out += pairF(45, e.rowSpacing);
1576
- out += writeExtrusion(e.extrusionDirection);
1577
-
1578
- if (e.attributes && e.attributes.length > 0) {
1579
- for (const attr of e.attributes) {
1580
- out += writeOneEntity(attr);
1581
- }
1582
- out += pair(0, "SEQEND");
1583
- out += pair(100, "AcDbEntity");
1584
- if (e.layer) out += pair(8, e.layer);
1585
- }
1586
-
1587
- return out;
1588
- }
1589
-
1590
- function writeDimensionEntity(e) {
1591
- let out = pair(100, "AcDbDimension");
1592
- if (e.blockName) out += pair(2, e.blockName);
1593
- out += writePoint3D(10, e.definitionPoint);
1594
- out += writePoint3D(11, e.middleOfText);
1595
- if (e.dimensionType !== undefined) out += pairI(70, e.dimensionType);
1596
- if (e.attachmentPoint) out += pairI(71, e.attachmentPoint);
1597
- if (e.text) out += pair(1, e.text);
1598
- if (e.styleName && e.styleName !== "STANDARD") out += pair(3, e.styleName);
1599
- if (e.rotation) out += pairF(50, e.rotation);
1600
-
1601
- const dimType = (e.dimensionType || 0) & 0x0f;
1602
- switch (dimType) {
1603
- case 0:
1604
- case 1:
1605
- out += pair(100, "AcDbAlignedDimension");
1606
- out += writePoint3D(13, e.point1);
1607
- out += writePoint3D(14, e.point2);
1608
- if (e.extensionLineAngle) out += pairF(52, e.extensionLineAngle);
1609
- if (dimType === 0) {
1610
- out += pair(100, "AcDbRotatedDimension");
1611
- }
1612
- break;
1613
- case 2:
1614
- out += pair(100, "AcDb3PointAngularDimension");
1615
- out += writePoint3D(13, e.point1);
1616
- out += writePoint3D(14, e.point2);
1617
- if (e.point3) out += writePoint3D(15, e.point3);
1618
- break;
1619
- case 3:
1620
- case 4:
1621
- out += pair(100, dimType === 3 ? "AcDbDiametricDimension" : "AcDbRadialDimension");
1622
- out += writePoint3D(15, e.point3 || e.point1);
1623
- if (e.leaderLength) out += pairF(40, e.leaderLength);
1624
- break;
1625
- case 5:
1626
- out += pair(100, "AcDb3PointAngularDimension");
1627
- out += writePoint3D(13, e.point1);
1628
- out += writePoint3D(14, e.point2);
1629
- if (e.point3) out += writePoint3D(15, e.point3);
1630
- break;
1631
- case 6:
1632
- out += pair(100, "AcDbOrdinateDimension");
1633
- out += writePoint3D(13, e.point1);
1634
- out += writePoint3D(14, e.point2);
1635
- break;
1636
- default:
1637
- out += writePoint3D(13, e.point1);
1638
- out += writePoint3D(14, e.point2);
1639
- break;
1640
- }
1641
-
1642
- return out;
1643
- }
1644
-
1645
- function writeLeaderEntity(e) {
1646
- let out = pair(100, "AcDbLeader");
1647
- if (e.styleName) out += pair(3, e.styleName);
1648
- if (e.arrowheadFlag !== undefined) out += pairI(71, e.arrowheadFlag);
1649
- if (e.pathType !== undefined) out += pairI(72, e.pathType);
1650
- if (e.creationType !== undefined) out += pairI(73, e.creationType);
1651
- if (e.hooklineDirectionFlag !== undefined) out += pairI(74, e.hooklineDirectionFlag);
1652
- if (e.hooklineFlag !== undefined) out += pairI(75, e.hooklineFlag);
1653
- if (e.textHeight) out += pairF(40, e.textHeight);
1654
- if (e.textWidth) out += pairF(41, e.textWidth);
1655
-
1656
- const verts = e.vertices || [];
1657
- out += pairI(76, verts.length);
1658
- for (const v of verts) {
1659
- out += writePoint3D(10, v);
1660
- }
1661
-
1662
- if (e.annotationReference) out += pair(340, e.annotationReference);
1663
- if (e.normal) {
1664
- out += pairF(210, e.normal.x);
1665
- out += pairF(220, e.normal.y);
1666
- out += pairF(230, e.normal.z);
1667
- }
1668
- if (e.horizontalDirection) {
1669
- out += pairF(211, e.horizontalDirection.x);
1670
- out += pairF(221, e.horizontalDirection.y);
1671
- out += pairF(231, e.horizontalDirection.z);
1672
- }
1673
- return out;
1674
- }
1675
-
1676
- function writeMLeaderEntity(e) {
1677
- let out = pair(100, "AcDbMLeader");
1678
- if (e.styleName) out += pair(3, e.styleName);
1679
- if (e.contentType !== undefined) out += pairI(170, e.contentType);
1680
- if (e.text) out += pair(304, e.text);
1681
- if (e.textStyleId) out += pair(340, e.textStyleId);
1682
- if (e.doglegLength) out += pairF(40, e.doglegLength);
1683
- if (e.arrowheadSize) out += pairF(41, e.arrowheadSize);
1684
- if (e.textHeight) out += pairF(42, e.textHeight);
1685
-
1686
- if (e.leaderPoints) {
1687
- for (const pt of e.leaderPoints) {
1688
- out += writePoint3D(10, pt);
1689
- }
1690
- }
1691
- return out;
1692
- }
1693
-
1694
- function writeHatchEntity(e) {
1695
- let out = pair(100, "AcDbHatch");
1696
- out += pairF(10, 0);
1697
- out += pairF(20, 0);
1698
- out += pairF(30, e.elevation || 0);
1699
- out += writeExtrusion(e.extrusionDirection);
1700
- out += pair(2, e.patternName || "");
1701
- out += pairI(70, e.solid ? 1 : 0);
1702
- out += pairI(71, e.associative ? 1 : 0);
1703
-
1704
- const paths = e.boundaryPaths || [];
1705
- out += pairI(91, paths.length);
1706
- for (const path of paths) {
1707
- out += pairI(92, path.type || 0);
1708
-
1709
- if (path.points && path.points.length > 0) {
1710
- out += pairI(93, path.points.length);
1711
- for (const pt of path.points) {
1712
- out += pairF(10, pt.x);
1713
- out += pairF(20, pt.y || 0);
1714
- }
1715
- }
1716
- }
1717
-
1718
- out += pairI(75, e.style || 0);
1719
- out += pairI(76, e.patternType || 0);
1720
- if (!e.solid) {
1721
- if (e.patternAngle) out += pairF(52, e.patternAngle);
1722
- if (e.patternScale) out += pairF(41, e.patternScale);
1723
- }
1724
-
1725
- const seeds = e.seedPoints || [];
1726
- out += pairI(98, seeds.length);
1727
- for (const s of seeds) {
1728
- out += pairF(10, s.x);
1729
- out += pairF(20, s.y || 0);
1730
- }
1731
-
1732
- return out;
1733
- }
1734
-
1735
- function writeSplineEntity(e) {
1736
- let out = pair(100, "AcDbSpline");
1737
-
1738
- if (e.normal) {
1739
- out += pairF(210, e.normal.x);
1740
- out += pairF(220, e.normal.y);
1741
- out += pairF(230, e.normal.z);
1742
- }
1743
-
1744
- let flags = e.flags || 0;
1745
- if (e.closed) flags |= 1;
1746
- if (e.periodic) flags |= 2;
1747
- if (e.rational) flags |= 4;
1748
- if (e.planar) flags |= 8;
1749
- out += pairI(70, flags);
1750
-
1751
- out += pairI(71, e.degree || 3);
1752
-
1753
- const knots = e.knots || [];
1754
- const cps = e.controlPoints || [];
1755
- const fps = e.fitPoints || [];
1756
- out += pairI(72, knots.length);
1757
- out += pairI(73, cps.length);
1758
- out += pairI(74, fps.length);
1759
-
1760
- if (e.knotTolerance) out += pairF(42, e.knotTolerance);
1761
- if (e.controlPointTolerance) out += pairF(43, e.controlPointTolerance);
1762
- if (e.fitTolerance) out += pairF(44, e.fitTolerance);
1763
-
1764
- if (e.startTangent) out += writePoint3D(12, e.startTangent);
1765
- if (e.endTangent) out += writePoint3D(13, e.endTangent);
1766
-
1767
- for (const k of knots) {
1768
- out += pairF(40, k);
1769
- }
1770
- if (e.weights) {
1771
- for (const w of e.weights) {
1772
- out += pairF(41, w);
1773
- }
1774
- }
1775
- for (const cp of cps) {
1776
- out += writePoint3D(10, cp);
1777
- }
1778
- for (const fp of fps) {
1779
- out += writePoint3D(11, fp);
1780
- }
1781
-
1782
- return out;
1783
- }
1784
-
1785
- function writeSolidEntity(e) {
1786
- let subclass = "AcDbTrace";
1787
- if (e.type === "SOLID") subclass = "AcDbTrace";
1788
- else if (e.type === "3DSOLID") subclass = "AcDb3dSolid";
1789
-
1790
- let out = pair(100, subclass);
1791
-
1792
- const pts = e.points || [];
1793
- if (pts[0]) out += writePoint3D(10, pts[0]);
1794
- if (pts[1]) out += writePoint3D(11, pts[1]);
1795
- if (pts[2]) out += writePoint3D(12, pts[2]);
1796
- if (pts[3]) out += writePoint3D(13, pts[3]);
1797
- if (e.thickness) out += pairF(39, e.thickness);
1798
- out += writeExtrusion(e.extrusionDirection);
1799
- return out;
1800
- }
1801
-
1802
- function write3DFaceEntity(e) {
1803
- let out = pair(100, "AcDbFace");
1804
- const verts = e.vertices || [];
1805
- if (verts[0]) out += writePoint3D(10, verts[0]);
1806
- if (verts[1]) out += writePoint3D(11, verts[1]);
1807
- if (verts[2]) out += writePoint3D(12, verts[2]);
1808
- if (verts[3]) out += writePoint3D(13, verts[3]);
1809
- if (e.invisibleEdgeFlags) out += pairI(70, e.invisibleEdgeFlags);
1810
- return out;
1811
- }
1812
-
1813
- function writeRayEntity(e) {
1814
- const subclass = e.type === "RAY" ? "AcDbRay" : "AcDbXline";
1815
- let out = pair(100, subclass);
1816
- out += writePoint3D(10, e.basePoint);
1817
- out += writePoint3D(11, e.direction);
1818
- return out;
1819
- }
1820
-
1821
- function writeViewportEntity(e) {
1822
- let out = pair(100, "AcDbViewport");
1823
- out += writePoint3D(10, e.center);
1824
- out += pairF(40, e.width);
1825
- out += pairF(41, e.height);
1826
- if (e.id) out += pairI(69, e.id);
1827
- if (e.viewCenter) out += writePoint2D(12, e.viewCenter);
1828
- if (e.snapBase) out += writePoint2D(13, e.snapBase);
1829
- if (e.snapSpacing) out += writePoint2D(14, e.snapSpacing);
1830
- if (e.gridSpacing) out += writePoint2D(15, e.gridSpacing);
1831
- out += writePoint3D(16, e.viewDirection);
1832
- out += writePoint3D(17, e.viewTarget);
1833
- if (e.perspectiveLensLength) out += pairF(42, e.perspectiveLensLength);
1834
- if (e.frontClipPlane) out += pairF(43, e.frontClipPlane);
1835
- if (e.backClipPlane) out += pairF(44, e.backClipPlane);
1836
- if (e.viewHeight) out += pairF(45, e.viewHeight);
1837
- if (e.snapAngle) out += pairF(50, e.snapAngle);
1838
- if (e.viewTwistAngle) out += pairF(51, e.viewTwistAngle);
1839
- if (e.statusField) out += pairI(68, e.statusField);
1840
-
1841
- if (e.frozenLayers) {
1842
- for (const fl of e.frozenLayers) {
1843
- out += pair(331, fl);
1844
- }
1845
- }
1846
- if (e.clippingBoundary) out += pair(340, e.clippingBoundary);
1847
- return out;
1848
- }
1849
-
1850
- function writeImageEntity(e) {
1851
- let out = pair(100, e.type === "WIPEOUT" ? "AcDbWipeout" : "AcDbRasterImage");
1852
- out += writePoint3D(10, e.insertionPoint);
1853
- out += writePoint3D(11, e.uVector);
1854
- out += writePoint3D(12, e.vVector);
1855
- out += pairF(13, e.imageSize ? e.imageSize.u : 0);
1856
- out += pairF(23, e.imageSize ? e.imageSize.v : 0);
1857
- if (e.imageDefHandle) out += pair(340, e.imageDefHandle);
1858
- if (e.displayFlags) out += pairI(70, e.displayFlags);
1859
- if (e.clippingType) out += pairI(71, e.clippingType);
1860
- if (e.brightness !== undefined) out += pairI(280, e.brightness);
1861
- if (e.contrast !== undefined) out += pairI(281, e.contrast);
1862
- if (e.fade !== undefined) out += pairI(282, e.fade);
1863
-
1864
- if (e.clippingVertices) {
1865
- for (const cv of e.clippingVertices) {
1866
- out += pairF(14, cv.x);
1867
- out += pairF(24, cv.y || 0);
1868
- }
1869
- }
1870
- return out;
1871
- }
1872
-
1873
- function writeToleranceEntity(e) {
1874
- let out = pair(100, "AcDbFcf");
1875
- if (e.styleName) out += pair(3, e.styleName);
1876
- out += writePoint3D(10, e.insertionPoint);
1877
- if (e.text) out += pair(1, e.text);
1878
- out += writePoint3D(11, e.direction);
1879
- return out;
1880
- }
1881
-
1882
- function writeHelixEntity(e) {
1883
- let out = pair(100, "AcDbHelix");
1884
- out += writePoint3D(10, e.axisBasePoint);
1885
- out += writePoint3D(11, e.startPoint);
1886
- out += writePoint3D(12, e.axisVector);
1887
- out += pairF(40, e.radius);
1888
- out += pairF(41, e.turns);
1889
- out += pairF(42, e.turnHeight);
1890
- if (e.handedness !== undefined) out += pairI(290, e.handedness);
1891
- if (e.constraint !== undefined) out += pairI(280, e.constraint);
1892
- return out;
1893
- }
1894
-
1895
- function writeMeshEntity(e) {
1896
- let out = pair(100, "AcDbSubDMesh");
1897
- out += pairI(71, e.version || 2);
1898
- out += pairI(72, e.subdivisionLevel || 0);
1899
-
1900
- const verts = e.vertices || [];
1901
- out += pairI(91, verts.length);
1902
- for (const v of verts) {
1903
- out += writePoint3D(10, v);
1904
- }
1905
-
1906
- const faces = e.faces || [];
1907
- out += pairI(92, faces.length);
1908
- for (const f of faces) {
1909
- out += pairI(90, f);
1910
- }
1911
-
1912
- const edges = e.edges || [];
1913
- out += pairI(93, edges.length);
1914
- for (const ed of edges) {
1915
- out += pairI(90, ed);
1916
- }
1917
-
1918
- const creases = e.edgeCreases || [];
1919
- out += pairI(94, creases.length);
1920
- for (const c of creases) {
1921
- out += pairF(140, c);
1922
- }
1923
-
1924
- return out;
1925
- }
1926
-
1927
- function writeRegionEntity(e) {
1928
- let subclass = "AcDbRegion";
1929
- if (e.type === "BODY") subclass = "AcDbBody";
1930
- else if (e.type === "SURFACE") subclass = "AcDbSurface";
1931
-
1932
- let out = pair(100, subclass);
1933
- if (e.modelerFormat !== undefined) out += pairI(70, e.modelerFormat);
1934
-
1935
- const acisStr = e.acisDataString || (e.acisData || []).join("");
1936
- if (acisStr) {
1937
- let remaining = acisStr;
1938
- while (remaining.length > 255) {
1939
- out += pair(3, remaining.substring(0, 255));
1940
- remaining = remaining.substring(255);
1941
- }
1942
- out += pair(1, remaining);
1943
- }
1944
-
1945
- return out;
1946
- }
1947
-
1948
- function writeOle2Entity(e) {
1949
- let out = pair(100, "AcDbOle2Frame");
1950
- out += pairI(70, e.oleType || 0);
1951
- out += pairI(71, e.tileMode || 0);
1952
- out += writePoint3D(10, e.upperLeftCorner);
1953
- out += writePoint3D(11, e.lowerRightCorner);
1954
- if (e.binaryData) {
1955
- for (const bd of e.binaryData) {
1956
- out += pair(1, bd);
1957
- }
1958
- }
1959
- return out;
1960
- }
1961
-
1962
- function writeTableEntity(e) {
1963
- let out = pair(100, "AcDbBlockReference");
1964
- if (e.blockName) out += pair(2, e.blockName);
1965
- out += writePoint3D(10, e.insertionPoint);
1966
- out += pair(100, "AcDbTable");
1967
- out += writePoint3D(11, e.direction);
1968
- if (e.rows) out += pairI(91, e.rows);
1969
- if (e.columns) out += pairI(92, e.columns);
1970
- if (e.rowHeights) {
1971
- for (const rh of e.rowHeights) {
1972
- out += pairF(142, rh);
1973
- }
1974
- }
1975
- if (e.columnWidths) {
1976
- for (const cw of e.columnWidths) {
1977
- out += pairF(141, cw);
1978
- }
1979
- }
1980
- return out;
1981
- }
1982
-
1983
- function writeMLineEntity(e) {
1984
- let out = pair(100, "AcDbMline");
1985
- if (e.styleName) out += pair(2, e.styleName);
1986
- if (e.styleHandle) out += pair(340, e.styleHandle);
1987
- out += pairF(40, e.scale || 1);
1988
- out += pairI(70, e.justification || 0);
1989
- out += pairI(71, e.flags || 0);
1990
-
1991
- const verts = e.vertices || [];
1992
- out += pairI(72, verts.length);
1993
- if (e.elementCount) out += pairI(73, e.elementCount);
1994
-
1995
- out += writePoint3D(10, e.startPoint);
1996
-
1997
- if (e.normal) {
1998
- out += pairF(210, e.normal.x);
1999
- out += pairF(220, e.normal.y);
2000
- out += pairF(230, e.normal.z);
2001
- }
2002
-
2003
- for (const v of verts) {
2004
- out += pairF(11, v.x);
2005
- out += pairF(21, v.y);
2006
- out += pairF(31, v.z || 0);
2007
- }
2008
-
2009
- return out;
2010
- }
2011
-
2012
- /** 通用 / 未知实体写入 */
2013
- function writeGenericEntity(e) {
2014
- let out = "";
2015
- if (e.data) {
2016
- for (const [key, val] of Object.entries(e.data)) {
2017
- if (key.startsWith("code_")) {
2018
- const code = parseInt(key.replace("code_", ""));
2019
- const vals = [].concat(val);
2020
- for (const v of vals) {
2021
- out += pair(code, v);
2022
- }
2023
- }
2024
- }
2025
- }
2026
- return out;
2027
- }
2028
-
2029
- // ─────────────────── OBJECTS 写入 ───────────────────
2030
-
2031
- function writeObjects(objects) {
2032
- if (!objects || objects.length === 0) return "";
2033
- let out = pair(0, "SECTION") + pair(2, "OBJECTS");
2034
-
2035
- for (const obj of objects) {
2036
- out += pair(0, obj.type);
2037
- if (obj.handle) out += pair(5, obj.handle);
2038
- if (obj.ownerHandle) out += pair(330, obj.ownerHandle);
2039
- if (obj.name) out += pair(2, obj.name);
2040
- if (obj.entryName) {
2041
- const names = [].concat(obj.entryName);
2042
- for (const n of names) {
2043
- out += pair(3, n);
2044
- }
2045
- }
2046
- if (obj.softPointer) {
2047
- const ptrs = [].concat(obj.softPointer);
2048
- for (const p of ptrs) {
2049
- out += pair(350, p);
2050
- }
2051
- }
2052
- if (obj.hardPointer) {
2053
- const ptrs = [].concat(obj.hardPointer);
2054
- for (const p of ptrs) {
2055
- out += pair(360, p);
2056
- }
2057
- }
2058
- for (const [key, val] of Object.entries(obj)) {
2059
- if (key.startsWith("code_")) {
2060
- const code = parseInt(key.replace("code_", ""));
2061
- const vals = [].concat(val);
2062
- for (const v of vals) {
2063
- out += pair(code, v);
2064
- }
2065
- }
2066
- }
2067
- }
2068
-
2069
- out += pair(0, "ENDSEC");
2070
- return out;
2071
- }
2072
-
2073
- // ─────────────────── 主入口 ───────────────────
2074
-
2075
- /**
2076
- * 将 parseDxf() 输出的数据结构写回 DXF 文本格式
2077
- * @param {Object} dxfData - parseDxf() 返回的完整数据结构
2078
- * @returns {string} DXF 文本内容
2079
- */
2080
- function writeDxf(dxfData) {
2081
- let out = "";
2082
- out += writeHeader(dxfData.header);
2083
- out += writeClasses(dxfData.classes);
2084
- out += writeTables(dxfData.tables);
2085
- out += writeBlocks(dxfData.blocks);
2086
- out += writeEntitiesSection(dxfData.entities);
2087
- out += writeObjects(dxfData.objects);
2088
- out += pair(0, "EOF");
2089
- return out;
2090
- }
2091
-
2092
- /**
2093
- * ★ 改动点①: 写入文件 — 动态 import 替代 require
2094
- * @param {Object} dxfData - parseDxf() 返回的完整数据结构
2095
- * @param {string} filePath - 输出文件路径(仅 Node.js)
2096
- */
2097
- async function writeDxfFile(dxfData, filePath) {
2098
- const content = writeDxf(dxfData);
2099
- if (typeof process !== "undefined" && process.versions?.node) {
2100
- const { writeFile } = await import('fs/promises');
2101
- await writeFile(filePath, content, "utf-8");
2102
- } else {
2103
- throw new Error("writeDxfFile 仅支持 Node.js 环境,浏览器请用 downloadDxfFile()");
2104
- }
2105
- }
2106
-
2107
- /**
2108
- * ★ 改动点③: 浏览器下载
2109
- * @param {Object} dxfData - parseDxf() 返回的完整数据结构
2110
- * @param {string} [filename="output.dxf"] - 下载文件名
2111
- */
2112
- function downloadDxfFile(dxfData, filename = "output.dxf") {
2113
- const content = writeDxf(dxfData);
2114
- const blob = new Blob([content], { type: "application/dxf" });
2115
- const url = URL.createObjectURL(blob);
2116
- const a = document.createElement("a");
2117
- a.href = url;
2118
- a.download = filename;
2119
- a.click();
2120
- URL.revokeObjectURL(url);
2121
- }
7
+ (function(_0x57f58f,_0x27496b){var _0x3dc311=_0xad8c,_0x114d62=_0x57f58f();while(!![]){try{var _0x2dab9e=-parseInt(_0x3dc311(0x1d6))/0x1+-parseInt(_0x3dc311(0x1d2))/0x2+parseInt(_0x3dc311(0x1d7))/0x3*(-parseInt(_0x3dc311(0x1d0))/0x4)+parseInt(_0x3dc311(0x1d5))/0x5+-parseInt(_0x3dc311(0x1d4))/0x6+-parseInt(_0x3dc311(0x1d8))/0x7+-parseInt(_0x3dc311(0x1d3))/0x8*(-parseInt(_0x3dc311(0x1d1))/0x9);if(_0x2dab9e===_0x27496b)break;else _0x114d62['push'](_0x114d62['shift']());}catch(_0x53c061){_0x114d62['push'](_0x114d62['shift']());}}}(_0x5ed3,0x9eb98));function _0xad8c(_0x2bc13a,_0x4e6825){_0x2bc13a=_0x2bc13a-0x1d0;var _0x5ed3c2=_0x5ed3();var _0xad8c66=_0x5ed3c2[_0x2bc13a];return _0xad8c66;}function _0x5ed3(){var _0x32728f=['3921318xSNqoP','349716UcBuFc','56hSZznS','1282752sjObmH','589645PfoPEx','930241xJnwyl','494469wnJDCP','315385JMVgeK','28FAZLEJ'];_0x5ed3=function(){return _0x32728f;};return _0x5ed3();}
2122
8
 
2123
9
  exports.downloadDxfFile = downloadDxfFile;
2124
10
  exports.parseDxf = parseDxf;