@maqiuyao/dxf-viewer 0.2.19 → 0.2.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/dxf-viewer.cjs +2 -2
- package/dist/dxf-viewer.js +18 -46
- package/package.json +61 -61
package/dist/dxf-viewer.js
CHANGED
|
@@ -17000,7 +17000,7 @@ class pd {
|
|
|
17000
17000
|
case 290:
|
|
17001
17001
|
i.contextData.hasMText = e.value, e = t.next();
|
|
17002
17002
|
break;
|
|
17003
|
-
case
|
|
17003
|
+
case 304:
|
|
17004
17004
|
i.contextData.defaultTextContents = e.value, e = t.next();
|
|
17005
17005
|
break;
|
|
17006
17006
|
case 11:
|
|
@@ -17241,51 +17241,19 @@ class pd {
|
|
|
17241
17241
|
}
|
|
17242
17242
|
function Ne(c) {
|
|
17243
17243
|
const t = {};
|
|
17244
|
-
let e = c.lastReadGroup || c.next();
|
|
17244
|
+
let e = c.lastReadGroup || c.next(), i = !1, s = !1, n = !1, r = !1;
|
|
17245
17245
|
for (; !c.isEOF(); ) {
|
|
17246
|
-
|
|
17247
|
-
|
|
17248
|
-
|
|
17249
|
-
|
|
17250
|
-
|
|
17251
|
-
|
|
17252
|
-
|
|
17253
|
-
|
|
17254
|
-
|
|
17255
|
-
|
|
17256
|
-
|
|
17257
|
-
t.x = e.value;
|
|
17258
|
-
break;
|
|
17259
|
-
case 20:
|
|
17260
|
-
case 21:
|
|
17261
|
-
case 22:
|
|
17262
|
-
case 23:
|
|
17263
|
-
case 24:
|
|
17264
|
-
case 25:
|
|
17265
|
-
case 26:
|
|
17266
|
-
case 120:
|
|
17267
|
-
case 121:
|
|
17268
|
-
case 122:
|
|
17269
|
-
t.y = e.value;
|
|
17270
|
-
break;
|
|
17271
|
-
case 30:
|
|
17272
|
-
case 31:
|
|
17273
|
-
case 32:
|
|
17274
|
-
case 33:
|
|
17275
|
-
case 34:
|
|
17276
|
-
case 35:
|
|
17277
|
-
case 36:
|
|
17278
|
-
case 130:
|
|
17279
|
-
case 131:
|
|
17280
|
-
case 132:
|
|
17281
|
-
t.z = e.value;
|
|
17282
|
-
break;
|
|
17283
|
-
case 42:
|
|
17284
|
-
t.bulge = e.value;
|
|
17285
|
-
break;
|
|
17286
|
-
default:
|
|
17287
|
-
return t;
|
|
17288
|
-
}
|
|
17246
|
+
const a = e.code, o = a >= 10 && a <= 16 || a >= 110 && a <= 112, l = a >= 20 && a <= 26 || a >= 120 && a <= 122, h = a >= 30 && a <= 36 || a >= 130 && a <= 132;
|
|
17247
|
+
if (a === 42 && !r)
|
|
17248
|
+
t.bulge = e.value, r = !0;
|
|
17249
|
+
else if (o && !i)
|
|
17250
|
+
t.x = e.value, i = !0;
|
|
17251
|
+
else if (l && !s)
|
|
17252
|
+
t.y = e.value, s = !0;
|
|
17253
|
+
else if (h && !n)
|
|
17254
|
+
t.z = e.value, n = !0;
|
|
17255
|
+
else
|
|
17256
|
+
return t;
|
|
17289
17257
|
e = c.next();
|
|
17290
17258
|
}
|
|
17291
17259
|
return t;
|
|
@@ -34002,7 +33970,11 @@ class $o extends Pr {
|
|
|
34002
33970
|
} else
|
|
34003
33971
|
P.warn("[Viewer] Failed to get layout extent, going to use the calculated one..."), d = l.extent;
|
|
34004
33972
|
const u = l.extent;
|
|
34005
|
-
d && !u.isEmpty()
|
|
33973
|
+
if (d && !u.isEmpty()) {
|
|
33974
|
+
const f = d.max.x - d.min.x, m = d.max.y - d.min.y, b = u.max.x - u.min.x, y = u.max.y - u.min.y;
|
|
33975
|
+
b > 0 && y > 0 && b <= f * 0.5 && y <= m * 0.5 ? d = u.clone() : d.intersectsBox(u) ? d.union(u) : (P.warn("[Viewer] Layout extent from header is far from actual geometry, using computed bbox instead."), d = u.clone());
|
|
33976
|
+
}
|
|
33977
|
+
l.homeViewExtent = d, this.zoomToBBox(d);
|
|
34006
33978
|
}
|
|
34007
33979
|
const h = i.getLayoutLevelObject(e);
|
|
34008
33980
|
h && this.setLayoutHidableObjectArray(h), this.enableRender();
|
package/package.json
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@maqiuyao/dxf-viewer",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "基于 three.js 的 DXF 图纸 2D/3D 查看与对比库(Viewer2d / DxfCompareHelper)",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/dxf-viewer.cjs",
|
|
7
|
-
"module": "./dist/dxf-viewer.js",
|
|
8
|
-
"types": "./dist/src/dxfViewer/lib.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./dist/src/dxfViewer/lib.d.ts",
|
|
12
|
-
"import": "./dist/dxf-viewer.js",
|
|
13
|
-
"require": "./dist/dxf-viewer.cjs"
|
|
14
|
-
},
|
|
15
|
-
"./style.css": "./dist/assets/vite-project.css",
|
|
16
|
-
"./package.json": "./package.json"
|
|
17
|
-
},
|
|
18
|
-
"files": [
|
|
19
|
-
"dist"
|
|
20
|
-
],
|
|
21
|
-
"sideEffects": [
|
|
22
|
-
"*.css"
|
|
23
|
-
],
|
|
24
|
-
"keywords": [
|
|
25
|
-
"dxf",
|
|
26
|
-
"three",
|
|
27
|
-
"threejs",
|
|
28
|
-
"viewer",
|
|
29
|
-
"cad",
|
|
30
|
-
"compare",
|
|
31
|
-
"2d",
|
|
32
|
-
"3d"
|
|
33
|
-
],
|
|
34
|
-
"license": "MIT",
|
|
35
|
-
"author": "mxy",
|
|
36
|
-
"engines": {
|
|
37
|
-
"node": ">=18"
|
|
38
|
-
},
|
|
39
|
-
"peerDependencies": {
|
|
40
|
-
"three": ">=0.160.0"
|
|
41
|
-
},
|
|
42
|
-
"dependencies": {
|
|
43
|
-
"2d-polygon-self-intersections": "^1.3.1",
|
|
44
|
-
"3d-tiles-renderer": "^0.5.3",
|
|
45
|
-
"concaveman": "^2.0.0",
|
|
46
|
-
"i18next": "^26.4.2",
|
|
47
|
-
"js-base64": "^3.9.4",
|
|
48
|
-
"jsbi": "^4.3.2",
|
|
49
|
-
"lodash": "^4.18.1",
|
|
50
|
-
"loglevel": "^1.9.2",
|
|
51
|
-
"opentype.js": "^2.0.0",
|
|
52
|
-
"pako": "^3.0.2",
|
|
53
|
-
"poly-extrude": "^0.22.2",
|
|
54
|
-
"polybooljs": "^1.2.2",
|
|
55
|
-
"polygon-clipping": "^0.15.7",
|
|
56
|
-
"protobufjs": "^8.8.0"
|
|
57
|
-
},
|
|
58
|
-
"publishConfig": {
|
|
59
|
-
"access": "public"
|
|
60
|
-
}
|
|
61
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@maqiuyao/dxf-viewer",
|
|
3
|
+
"version": "0.2.20",
|
|
4
|
+
"description": "基于 three.js 的 DXF 图纸 2D/3D 查看与对比库(Viewer2d / DxfCompareHelper)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/dxf-viewer.cjs",
|
|
7
|
+
"module": "./dist/dxf-viewer.js",
|
|
8
|
+
"types": "./dist/src/dxfViewer/lib.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/src/dxfViewer/lib.d.ts",
|
|
12
|
+
"import": "./dist/dxf-viewer.js",
|
|
13
|
+
"require": "./dist/dxf-viewer.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./style.css": "./dist/assets/vite-project.css",
|
|
16
|
+
"./package.json": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"sideEffects": [
|
|
22
|
+
"*.css"
|
|
23
|
+
],
|
|
24
|
+
"keywords": [
|
|
25
|
+
"dxf",
|
|
26
|
+
"three",
|
|
27
|
+
"threejs",
|
|
28
|
+
"viewer",
|
|
29
|
+
"cad",
|
|
30
|
+
"compare",
|
|
31
|
+
"2d",
|
|
32
|
+
"3d"
|
|
33
|
+
],
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"author": "mxy",
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=18"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"three": ">=0.160.0"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"2d-polygon-self-intersections": "^1.3.1",
|
|
44
|
+
"3d-tiles-renderer": "^0.5.3",
|
|
45
|
+
"concaveman": "^2.0.0",
|
|
46
|
+
"i18next": "^26.4.2",
|
|
47
|
+
"js-base64": "^3.9.4",
|
|
48
|
+
"jsbi": "^4.3.2",
|
|
49
|
+
"lodash": "^4.18.1",
|
|
50
|
+
"loglevel": "^1.9.2",
|
|
51
|
+
"opentype.js": "^2.0.0",
|
|
52
|
+
"pako": "^3.0.2",
|
|
53
|
+
"poly-extrude": "^0.22.2",
|
|
54
|
+
"polybooljs": "^1.2.2",
|
|
55
|
+
"polygon-clipping": "^0.15.7",
|
|
56
|
+
"protobufjs": "^8.8.0"
|
|
57
|
+
},
|
|
58
|
+
"publishConfig": {
|
|
59
|
+
"access": "public"
|
|
60
|
+
}
|
|
61
|
+
}
|