mxcad 1.0.46 → 1.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mxcad.es.js +112 -112
- package/dist/mxcad.umd.js +33 -33
- package/package.json +3 -3
package/dist/mxcad.es.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import PD, { MrxDbgUiPrPoint as P, MxFun as m, store as R, MxPaintBrush as k, MrxDbgUiPrBaseReturn as h, MxDbCircleShape as
|
|
1
|
+
import PD, { MrxDbgUiPrPoint as P, MxFun as m, store as R, MxPaintBrush as k, MrxDbgUiPrBaseReturn as h, MxDbCircleShape as AD, MrxDbgUtils as RD, MxDbLine as K, MxDbPolyline as LD, MxDbCircleArc as V, Mx3PointArc as vD, MxDbEllipseShape as SD } from "mxdraw";
|
|
2
2
|
async function OD(B, D) {
|
|
3
3
|
const E = await (await fetch(B)).arrayBuffer();
|
|
4
4
|
return await WebAssembly.instantiate(E, D);
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function eD(B) {
|
|
7
7
|
return btoa(unescape(encodeURIComponent(B)));
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function tD(B) {
|
|
10
10
|
return decodeURIComponent(escape(atob(B)));
|
|
11
11
|
}
|
|
12
|
-
async function
|
|
12
|
+
async function iD({
|
|
13
13
|
blob: B,
|
|
14
14
|
filename: D = "",
|
|
15
15
|
types: C = [
|
|
@@ -50,15 +50,15 @@ async function tD({
|
|
|
50
50
|
console.error(E.name, E.message);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function rD(B, D) {
|
|
54
54
|
const C = document.createElement("a");
|
|
55
55
|
C.href = window.URL.createObjectURL(B), C.download = D, C.click();
|
|
56
56
|
}
|
|
57
57
|
const I = {
|
|
58
|
-
b64Encode:
|
|
59
|
-
b64Decode:
|
|
60
|
-
saveAsFileDialog:
|
|
61
|
-
downloadFile:
|
|
58
|
+
b64Encode: eD,
|
|
59
|
+
b64Decode: tD,
|
|
60
|
+
saveAsFileDialog: iD,
|
|
61
|
+
downloadFile: rD
|
|
62
62
|
};
|
|
63
63
|
async function jD() {
|
|
64
64
|
const B = new P();
|
|
@@ -80,7 +80,7 @@ async function jD() {
|
|
|
80
80
|
};
|
|
81
81
|
m.call("Mx_Text", F);
|
|
82
82
|
}
|
|
83
|
-
class GD extends
|
|
83
|
+
class GD extends AD {
|
|
84
84
|
getGripPoints() {
|
|
85
85
|
const { x: D, y: C, z: E } = this.center;
|
|
86
86
|
let F = new THREE.Vector3(D, C + this.radius, E), A = new THREE.Vector3(D, C - this.radius, E), e = new THREE.Vector3(D - this.radius, C, E), t = new THREE.Vector3(D + this.radius, C, E);
|
|
@@ -91,11 +91,11 @@ class GD extends FD {
|
|
|
91
91
|
return D === 0 && (this.center = E.add(C)), D === 1 && (this.radius = F.add(C).distanceTo(this.center)), D === 2 && (this.radius = A.add(C).distanceTo(this.center)), D === 3 && (this.radius = e.add(C).distanceTo(this.center)), D === 4 && (this.radius = t.add(C).distanceTo(this.center)), !0;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
const
|
|
94
|
+
const ED = (B) => {
|
|
95
95
|
const [D, C, E] = B, { x: F, y: A, z: e } = D, { x: t, y: r, z: i } = C, { x: o, y: a, z: c } = E, s = A * i - r * e - A * c + a * e + r * c - a * i, u = -(F * i - t * e - F * c + o * e + t * c - o * i), p = F * r - t * A - F * a + o * A + t * a - o * r, d = -(F * r * c - F * a * i - t * A * c + t * a * e + o * A * i - o * r * e), l = 2 * (t - F), y = 2 * (r - A), g = 2 * (i - e), S = F * F + A * A + e * e - t * t - r * r - i * i, x = 2 * (o - F), f = 2 * (a - A), M = 2 * (c - e), O = F * F + A * A + e * e - o * o - a * a - c * c, MD = -(u * g * O - u * M * S - y * p * O + y * M * d + f * p * S - f * g * d) / (s * y * M - s * f * g - l * u * M + l * f * p + x * u * g - x * y * p), kD = (s * g * O - s * M * S - l * p * O + l * M * d + x * p * S - x * g * d) / (s * y * M - s * f * g - l * u * M + l * f * p + x * u * g - x * y * p), TD = -(s * y * O - s * f * S - l * u * O + l * f * d + x * u * S - x * y * d) / (s * y * M - s * f * g - l * u * M + l * f * p + x * u * g - x * y * p);
|
|
96
96
|
return new THREE.Vector3(MD, kD, TD);
|
|
97
97
|
};
|
|
98
|
-
function
|
|
98
|
+
function sD() {
|
|
99
99
|
const B = new P();
|
|
100
100
|
let D = new GD();
|
|
101
101
|
k.use(D), D.closed = !1;
|
|
@@ -129,14 +129,14 @@ function rD() {
|
|
|
129
129
|
}), B.setMessage(`
|
|
130
130
|
\u6307\u5B9A\u5706\u4E0A\u7684\u7B2C\u4E8C\u4E2A\u70B9:`)), C === 1 && (t.push(B.value()), B.setUserDraw((u, p) => {
|
|
131
131
|
const [d, l] = t, y = u;
|
|
132
|
-
D.center =
|
|
132
|
+
D.center = ED([
|
|
133
133
|
d,
|
|
134
134
|
l,
|
|
135
135
|
y
|
|
136
136
|
]), D.radius = D.center.distanceTo(d), p.drawCustomEntity(D);
|
|
137
137
|
}), B.setMessage(`
|
|
138
138
|
\u6307\u5B9A\u5706\u4E0A\u7684\u7B2C\u4E09\u4E2A\u70B9:`)), C === 2)
|
|
139
|
-
return t.push(B.value()), D.center =
|
|
139
|
+
return t.push(B.value()), D.center = ED(t), D.radius = D.center.distanceTo(t[0]), m.getCurrentDraw().addMxEntity(D), !0;
|
|
140
140
|
C++;
|
|
141
141
|
}
|
|
142
142
|
};
|
|
@@ -186,7 +186,7 @@ function rD() {
|
|
|
186
186
|
);
|
|
187
187
|
}
|
|
188
188
|
R.events.on("MxDbEntityRegister", () => {
|
|
189
|
-
m.addCommand("Mx_Circle",
|
|
189
|
+
m.addCommand("Mx_Circle", sD);
|
|
190
190
|
});
|
|
191
191
|
var Y;
|
|
192
192
|
(function(B) {
|
|
@@ -303,7 +303,7 @@ class v extends L {
|
|
|
303
303
|
return n.App.CreateCloneObject(D);
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
class
|
|
306
|
+
class nD extends v {
|
|
307
307
|
constructor(D) {
|
|
308
308
|
super(D);
|
|
309
309
|
}
|
|
@@ -324,7 +324,7 @@ class W extends v {
|
|
|
324
324
|
}
|
|
325
325
|
explode() {
|
|
326
326
|
let D = this.imp.explode();
|
|
327
|
-
return new
|
|
327
|
+
return new cD(D);
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
class q extends W {
|
|
@@ -350,12 +350,12 @@ class q extends W {
|
|
|
350
350
|
return { val: this.imp.getPointAtDist(D), ret: n.getCallResult() };
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
class
|
|
353
|
+
class oD extends L {
|
|
354
354
|
constructor(D) {
|
|
355
355
|
super(D);
|
|
356
356
|
}
|
|
357
357
|
GetLayerTable() {
|
|
358
|
-
return new
|
|
358
|
+
return new nD(this.imp.GetLayerTable());
|
|
359
359
|
}
|
|
360
360
|
GetLinetypeTable() {
|
|
361
361
|
return new VD(this.imp.GetLinetypeTable());
|
|
@@ -364,7 +364,7 @@ class nD extends L {
|
|
|
364
364
|
return new ND(this.imp.GetTextStyleTable());
|
|
365
365
|
}
|
|
366
366
|
GetBlockTable() {
|
|
367
|
-
return new
|
|
367
|
+
return new pD(this.imp.GetBlockTable());
|
|
368
368
|
}
|
|
369
369
|
CurrentSpace() {
|
|
370
370
|
return new $(this.imp.CurrentSpace());
|
|
@@ -473,7 +473,7 @@ class j {
|
|
|
473
473
|
}, this.imp.saveFile(D);
|
|
474
474
|
}
|
|
475
475
|
GetDatabase() {
|
|
476
|
-
return new
|
|
476
|
+
return new oD(this.imp.GetDatabase());
|
|
477
477
|
}
|
|
478
478
|
GetSysVarString(D) {
|
|
479
479
|
return this.imp.GetSysVarString(D);
|
|
@@ -690,10 +690,10 @@ class KD {
|
|
|
690
690
|
return new _(E);
|
|
691
691
|
} else if (C == "McDbPolyline") {
|
|
692
692
|
let E = this.imp.ObjectIdToMdDbPolyline(D);
|
|
693
|
-
return new
|
|
693
|
+
return new uD(E);
|
|
694
694
|
} else if (C == "McDbCircle") {
|
|
695
695
|
let E = this.imp.ObjectIdToMdDbCircle(D);
|
|
696
|
-
return new
|
|
696
|
+
return new DD(E);
|
|
697
697
|
} else if (C == "McDbBlockReference") {
|
|
698
698
|
let E = this.imp.ObjectIdToMdDbBlockReference(D);
|
|
699
699
|
return new HD(E);
|
|
@@ -705,7 +705,7 @@ class KD {
|
|
|
705
705
|
return new XD(E);
|
|
706
706
|
} else if (C == "McDbMText") {
|
|
707
707
|
let E = this.imp.ObjectIdToMdDbMText(D);
|
|
708
|
-
return new
|
|
708
|
+
return new aD(E);
|
|
709
709
|
}
|
|
710
710
|
return console.log("Mx ObjectIdToObject error type:" + C), null;
|
|
711
711
|
}
|
|
@@ -819,7 +819,7 @@ class _ extends W {
|
|
|
819
819
|
this.imp.setVerticalMode(D);
|
|
820
820
|
}
|
|
821
821
|
}
|
|
822
|
-
class
|
|
822
|
+
class aD extends W {
|
|
823
823
|
constructor(D) {
|
|
824
824
|
super(D), D || this.initTempObject(new n.mxcadassemblyimp.MdDbMText());
|
|
825
825
|
}
|
|
@@ -860,7 +860,7 @@ class oD extends W {
|
|
|
860
860
|
this.imp.setContents(w.encodeToGb2312(D));
|
|
861
861
|
}
|
|
862
862
|
}
|
|
863
|
-
class
|
|
863
|
+
class DD extends q {
|
|
864
864
|
constructor(D) {
|
|
865
865
|
super(D), D || this.initTempObject(new n.mxcadassemblyimp.MdDbCircle());
|
|
866
866
|
}
|
|
@@ -880,7 +880,7 @@ class Z extends q {
|
|
|
880
880
|
this.imp.setRadius(D);
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
|
-
class
|
|
883
|
+
class uD extends q {
|
|
884
884
|
constructor(D) {
|
|
885
885
|
super(D), D || this.initTempObject(new n.mxcadassemblyimp.MdDbPolyline());
|
|
886
886
|
}
|
|
@@ -956,7 +956,7 @@ class HD extends W {
|
|
|
956
956
|
this.imp.setBlockTransform(D);
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
|
-
class
|
|
959
|
+
class lD extends W {
|
|
960
960
|
constructor(D) {
|
|
961
961
|
super(D);
|
|
962
962
|
}
|
|
@@ -1039,7 +1039,7 @@ class uD extends W {
|
|
|
1039
1039
|
this.imp.SetDimVarObjectId(D, C.id);
|
|
1040
1040
|
}
|
|
1041
1041
|
}
|
|
1042
|
-
class _D extends
|
|
1042
|
+
class _D extends lD {
|
|
1043
1043
|
constructor(D) {
|
|
1044
1044
|
super(D), D || this.initTempObject(new n.mxcadassemblyimp.MdDbAlignedDimension());
|
|
1045
1045
|
}
|
|
@@ -1068,7 +1068,7 @@ class _D extends uD {
|
|
|
1068
1068
|
this.imp.setOblique(D);
|
|
1069
1069
|
}
|
|
1070
1070
|
}
|
|
1071
|
-
class
|
|
1071
|
+
class cD extends L {
|
|
1072
1072
|
constructor(D) {
|
|
1073
1073
|
super(D), D || this.initTempObject(new n.mxcadassemblyimp.McDrawResbuf());
|
|
1074
1074
|
}
|
|
@@ -1088,7 +1088,7 @@ class lD extends L {
|
|
|
1088
1088
|
if (this.imp.AtObjectName(D) == "McDbMText") {
|
|
1089
1089
|
let E = this.imp.AtObjectMdDbMText(D);
|
|
1090
1090
|
if (E)
|
|
1091
|
-
return { val: new
|
|
1091
|
+
return { val: new aD(E), ret: n.getCallResult() };
|
|
1092
1092
|
}
|
|
1093
1093
|
return { val: void 0, ret: -1 };
|
|
1094
1094
|
}
|
|
@@ -1140,7 +1140,7 @@ class T {
|
|
|
1140
1140
|
return this.type != 2 && !this.id;
|
|
1141
1141
|
}
|
|
1142
1142
|
erase() {
|
|
1143
|
-
this.type == 1 ? m.getCurrentDraw().eraseMxEntity(this.id) : this.type == 0 &&
|
|
1143
|
+
this.type == 1 ? m.getCurrentDraw().eraseMxEntity(this.id) : this.type == 0 && CD.eraseEntity(this.id);
|
|
1144
1144
|
}
|
|
1145
1145
|
getMcDbObject() {
|
|
1146
1146
|
return this.type == 0 ? n.App.ObjectIdToObject(this.id) : null;
|
|
@@ -1197,8 +1197,8 @@ class qD {
|
|
|
1197
1197
|
this.imp || (this.imp = new n.mxcadassemblyimp.McDrawUtility());
|
|
1198
1198
|
}
|
|
1199
1199
|
}
|
|
1200
|
-
let
|
|
1201
|
-
class
|
|
1200
|
+
let CD = new qD();
|
|
1201
|
+
class dD extends L {
|
|
1202
1202
|
constructor(D) {
|
|
1203
1203
|
super(D);
|
|
1204
1204
|
}
|
|
@@ -1224,7 +1224,7 @@ class $ extends v {
|
|
|
1224
1224
|
}
|
|
1225
1225
|
newIterator(D = !0, C = !0) {
|
|
1226
1226
|
let E = this.imp.newIterator(D, C);
|
|
1227
|
-
return new
|
|
1227
|
+
return new dD(E);
|
|
1228
1228
|
}
|
|
1229
1229
|
get origin() {
|
|
1230
1230
|
return this.imp.origin();
|
|
@@ -1233,7 +1233,7 @@ class $ extends v {
|
|
|
1233
1233
|
this.imp.setOrigin(D);
|
|
1234
1234
|
}
|
|
1235
1235
|
}
|
|
1236
|
-
class
|
|
1236
|
+
class mD extends L {
|
|
1237
1237
|
constructor(D) {
|
|
1238
1238
|
super(D);
|
|
1239
1239
|
}
|
|
@@ -1251,7 +1251,7 @@ class dD extends L {
|
|
|
1251
1251
|
this.imp.start(D, C);
|
|
1252
1252
|
}
|
|
1253
1253
|
}
|
|
1254
|
-
class
|
|
1254
|
+
class pD extends v {
|
|
1255
1255
|
constructor(D) {
|
|
1256
1256
|
super(D), D || this.initTempObject(new n.mxcadassemblyimp.MdDbBlockTable());
|
|
1257
1257
|
}
|
|
@@ -1264,7 +1264,7 @@ class mD extends v {
|
|
|
1264
1264
|
}
|
|
1265
1265
|
newIterator(D = !0, C = !0) {
|
|
1266
1266
|
let E = this.imp.newIterator(D, C);
|
|
1267
|
-
return new
|
|
1267
|
+
return new mD(E);
|
|
1268
1268
|
}
|
|
1269
1269
|
add(D) {
|
|
1270
1270
|
return this.imp.add(D.getImp());
|
|
@@ -1290,7 +1290,7 @@ class $D extends L {
|
|
|
1290
1290
|
return new T(this.imp.item(D), 0);
|
|
1291
1291
|
}
|
|
1292
1292
|
}
|
|
1293
|
-
class XD extends
|
|
1293
|
+
class XD extends lD {
|
|
1294
1294
|
constructor(D) {
|
|
1295
1295
|
super(D), D || this.initTempObject(new n.mxcadassemblyimp.MdDbRotatedDimension());
|
|
1296
1296
|
}
|
|
@@ -1325,13 +1325,13 @@ class XD extends uD {
|
|
|
1325
1325
|
this.imp.setRotation(D);
|
|
1326
1326
|
}
|
|
1327
1327
|
}
|
|
1328
|
-
const
|
|
1328
|
+
const FD = () => R.state.MxFun.stopRunCommand();
|
|
1329
1329
|
function X(B, D, C, E) {
|
|
1330
1330
|
const F = B - C, A = D - E;
|
|
1331
1331
|
let e = 0;
|
|
1332
1332
|
return F == 0 ? e = Math.PI / 2 : e = Math.atan(Math.abs(A / F)), F < 0 && A >= 0 ? e = Math.PI - e : F < 0 && A < 0 ? e = Math.PI + e : F >= 0 && A < 0 && (e = Math.PI * 2 - e), e;
|
|
1333
1333
|
}
|
|
1334
|
-
async function
|
|
1334
|
+
async function hD() {
|
|
1335
1335
|
const B = new P();
|
|
1336
1336
|
let D = new K(), C = [];
|
|
1337
1337
|
B.setMessage(`
|
|
@@ -1350,10 +1350,10 @@ async function pD() {
|
|
|
1350
1350
|
(A) => {
|
|
1351
1351
|
if (A === h.kOk && (D = new K(), k.use(D), D.pt1 = E, D.pt2 = B.value(), E = D.pt2.clone(), C.push(D), F()), A === h.kKeyWord) {
|
|
1352
1352
|
if (B.isKeyWordPicked("E"))
|
|
1353
|
-
|
|
1353
|
+
FD();
|
|
1354
1354
|
else if (B.isKeyWordPicked("C")) {
|
|
1355
1355
|
const e = new K();
|
|
1356
|
-
return e.pt1 = E.clone(), e.pt2 = C[0].pt1.clone(), k.use(e), C.push(e), E = e.pt2.clone(),
|
|
1356
|
+
return e.pt1 = E.clone(), e.pt2 = C[0].pt1.clone(), k.use(e), C.push(e), E = e.pt2.clone(), FD(), { exit: !0 };
|
|
1357
1357
|
}
|
|
1358
1358
|
}
|
|
1359
1359
|
},
|
|
@@ -1407,7 +1407,7 @@ async function YD() {
|
|
|
1407
1407
|
}
|
|
1408
1408
|
}
|
|
1409
1409
|
R.events.on("MxDbEntityRegister", () => {
|
|
1410
|
-
m.addCommand("Mx_Line",
|
|
1410
|
+
m.addCommand("Mx_Line", hD), m.addCommand("Mx_TestDraw", JD), m.addCommand("Mx_Test_GetDim", YD);
|
|
1411
1411
|
});
|
|
1412
1412
|
async function QD() {
|
|
1413
1413
|
const B = new P();
|
|
@@ -1430,7 +1430,7 @@ async function QD() {
|
|
|
1430
1430
|
};
|
|
1431
1431
|
m.call("Mx_MText", F);
|
|
1432
1432
|
}
|
|
1433
|
-
async function
|
|
1433
|
+
async function wD() {
|
|
1434
1434
|
const B = new P(), D = new LD();
|
|
1435
1435
|
k.use(D), B.setMessage(`
|
|
1436
1436
|
\u6307\u5B9A\u8D77\u70B9:`);
|
|
@@ -1452,13 +1452,13 @@ async function hD() {
|
|
|
1452
1452
|
);
|
|
1453
1453
|
}
|
|
1454
1454
|
R.events.on("MxDbEntityRegister", () => {
|
|
1455
|
-
m.addCommand("Mx_Pline",
|
|
1455
|
+
m.addCommand("Mx_Pline", wD);
|
|
1456
1456
|
});
|
|
1457
|
-
async function
|
|
1457
|
+
async function yD() {
|
|
1458
1458
|
const B = new P();
|
|
1459
1459
|
B.setMessage(`
|
|
1460
1460
|
\u6307\u5B9A\u4E00\u70B9:`);
|
|
1461
|
-
let D = await B.go(), C = new
|
|
1461
|
+
let D = await B.go(), C = new DD();
|
|
1462
1462
|
C.setCenter(D.x, D.y, D.z);
|
|
1463
1463
|
let E = 5;
|
|
1464
1464
|
B.setUserDraw((F, A) => {
|
|
@@ -1472,7 +1472,7 @@ async function wD() {
|
|
|
1472
1472
|
\u6307\u5B9A\u4E8C\u70B9:`), await B.go(), B.drawReserve();
|
|
1473
1473
|
}
|
|
1474
1474
|
R.events.on("MxDbEntityRegister", () => {
|
|
1475
|
-
m.addCommand("Mx_Polygon",
|
|
1475
|
+
m.addCommand("Mx_Polygon", yD);
|
|
1476
1476
|
});
|
|
1477
1477
|
function ZD(B, D, C) {
|
|
1478
1478
|
const E = B.x, F = D.x, A = C.x, e = B.y, t = D.y, r = C.y, i = E - F, o = e - t, a = E - A, c = e - r, s = (E * E - F * F + (e * e - t * t)) / 2, u = (E * E - A * A + (e * e - r * r)) / 2, p = o * a - i * c, d = -(c * s - o * u) / p, l = -(i * u - a * s) / p;
|
|
@@ -1506,7 +1506,7 @@ const N = PD.MrxDbgUiPrBaseReturn, b = (B, D, C) => {
|
|
|
1506
1506
|
};
|
|
1507
1507
|
return E;
|
|
1508
1508
|
};
|
|
1509
|
-
class
|
|
1509
|
+
class BD extends AD {
|
|
1510
1510
|
constructor() {
|
|
1511
1511
|
super(), this._propertyDbKeys = [...this._propertyDbKeys, "bulge"];
|
|
1512
1512
|
}
|
|
@@ -1514,7 +1514,7 @@ class CD extends FD {
|
|
|
1514
1514
|
return "MxDbCircle";
|
|
1515
1515
|
}
|
|
1516
1516
|
create() {
|
|
1517
|
-
return new
|
|
1517
|
+
return new BD();
|
|
1518
1518
|
}
|
|
1519
1519
|
getArcBulge(D, C, E) {
|
|
1520
1520
|
const F = D.distanceTo(C);
|
|
@@ -1560,11 +1560,11 @@ class CD extends FD {
|
|
|
1560
1560
|
), this.startAngle = THREE.MathUtils.degToRad(t.angle), this.endAngle = THREE.MathUtils.degToRad(r.angle);
|
|
1561
1561
|
}
|
|
1562
1562
|
}
|
|
1563
|
-
async function
|
|
1563
|
+
async function bD() {
|
|
1564
1564
|
const B = new P();
|
|
1565
1565
|
B.setMessage(`
|
|
1566
1566
|
\u6307\u5B9A\u5706\u5F27\u7684\u8D77\u70B9:`), B.setKeyWords("[\u5706\u5FC3(C)]");
|
|
1567
|
-
let D = new
|
|
1567
|
+
let D = new BD();
|
|
1568
1568
|
D.closed = !1, k.use(D);
|
|
1569
1569
|
let C, E, F;
|
|
1570
1570
|
const A = b(
|
|
@@ -1682,9 +1682,9 @@ async function yD() {
|
|
|
1682
1682
|
A();
|
|
1683
1683
|
}
|
|
1684
1684
|
R.events.on("MxDbEntityRegister", () => {
|
|
1685
|
-
m.addCommand("Mx_Arc",
|
|
1685
|
+
m.addCommand("Mx_Arc", bD);
|
|
1686
1686
|
});
|
|
1687
|
-
function
|
|
1687
|
+
function gD() {
|
|
1688
1688
|
const B = new P(), D = new SD();
|
|
1689
1689
|
D.closed = !1, k.use(D), B.setMessage(`
|
|
1690
1690
|
\u6307\u5B9A\u692D\u5706\u7684\u8F74\u7AEF\u70B9`), B.setKeyWords("[\u4E2D\u5FC3\u70B9(C)]");
|
|
@@ -1741,16 +1741,16 @@ function bD() {
|
|
|
1741
1741
|
);
|
|
1742
1742
|
}
|
|
1743
1743
|
R.events.on("MxDbEntityRegister", () => {
|
|
1744
|
-
m.addCommand("Mx_EllipseArc",
|
|
1744
|
+
m.addCommand("Mx_EllipseArc", gD);
|
|
1745
1745
|
});
|
|
1746
|
-
async function
|
|
1747
|
-
(await
|
|
1746
|
+
async function xD() {
|
|
1747
|
+
(await CD.selectEnt(`
|
|
1748
1748
|
\u9009\u62E9\u5220\u9664\u5BF9\u8C61`)).forEach((D) => {
|
|
1749
1749
|
D.erase();
|
|
1750
1750
|
});
|
|
1751
1751
|
}
|
|
1752
1752
|
R.events.on("MxDbEntityRegister", () => {
|
|
1753
|
-
m.addCommand("Mx_Erase",
|
|
1753
|
+
m.addCommand("Mx_Erase", xD);
|
|
1754
1754
|
});
|
|
1755
1755
|
const BC = (B) => new Promise((D, C) => {
|
|
1756
1756
|
const E = document.createElement("script");
|
|
@@ -1759,7 +1759,7 @@ const BC = (B) => new Promise((D, C) => {
|
|
|
1759
1759
|
}, E.onerror = (F) => {
|
|
1760
1760
|
C(F);
|
|
1761
1761
|
};
|
|
1762
|
-
}),
|
|
1762
|
+
}), fD = async (B, D, C) => {
|
|
1763
1763
|
const { locateFile: E } = C, F = B + ".js", A = E(F);
|
|
1764
1764
|
return await BC(A), C.mainScriptUrlOrBlob = A, await window[D](C);
|
|
1765
1765
|
};
|
|
@@ -1812,7 +1812,7 @@ class G {
|
|
|
1812
1812
|
FC(a, t);
|
|
1813
1813
|
} else
|
|
1814
1814
|
console.error("createMxDraw3d canvas \u53C2\u6570\u4E0D\u6B63\u786E \u65E0\u6CD5\u83B7\u53D6\u5230canvas\u5143\u7D20");
|
|
1815
|
-
window.onresize = C, C(),
|
|
1815
|
+
window.onresize = C, C(), fD("mxdraw3d_min", "mxdraw3d", this).then(() => {
|
|
1816
1816
|
G.onloadWasmMxDraw3dModel && G.onloadWasmMxDraw3dModel(this), this.updateCanvasSize = t, this.open3DFile = (a) => {
|
|
1817
1817
|
const c = new FileReader();
|
|
1818
1818
|
c.onload = () => {
|
|
@@ -1826,14 +1826,14 @@ class G {
|
|
|
1826
1826
|
});
|
|
1827
1827
|
}
|
|
1828
1828
|
}
|
|
1829
|
-
const
|
|
1829
|
+
const Z = "1.0.48", eC = /unpkg\.com\/mxcad/.test(import.meta.url), tC = (B, D = self.location.href) => typeof process < "u" && process.env.NODE_ENV === "development" ? new URL(`/node_modules/mxcad/dist/wasm/2d/${B}`, import.meta.url || D).href : eC ? `https://unpkg.com/mxcad@${Z}/dist/wasm/2d-st/${B}` : `https://unpkg.com/mxcad@${Z}/dist/wasm/2d/${B}`, iC = (B, D = self.location.href) => typeof process < "u" && process.env.NODE_ENV === "development" ? new URL(`/node_modules/mxcad/dist/wasm/3d/${B}`, import.meta.url || D).href : `https://unpkg.com/mxcad@${Z}/dist/wasm/3d/${B}`;
|
|
1830
1830
|
let n;
|
|
1831
|
-
async function
|
|
1831
|
+
async function rC(B, D = tC, C) {
|
|
1832
1832
|
if (n || (n = new zD()), n.mxcadassemblyimp) {
|
|
1833
1833
|
B(n);
|
|
1834
1834
|
return;
|
|
1835
1835
|
}
|
|
1836
|
-
const F = await
|
|
1836
|
+
const F = await fD("mxdrawassembly_min", "mxdrawassembly", {
|
|
1837
1837
|
locateFile: D,
|
|
1838
1838
|
wasmBinary: C
|
|
1839
1839
|
});
|
|
@@ -1841,10 +1841,10 @@ async function iC(B, D = eC, C) {
|
|
|
1841
1841
|
let A = new F.McApp();
|
|
1842
1842
|
A.Init(), n.App.init(A), B(n);
|
|
1843
1843
|
}
|
|
1844
|
-
function
|
|
1844
|
+
function sC(B, D) {
|
|
1845
1845
|
return new Promise(async (C, E) => {
|
|
1846
1846
|
try {
|
|
1847
|
-
B.locateFile || (B.locateFile =
|
|
1847
|
+
B.locateFile || (B.locateFile = iC);
|
|
1848
1848
|
const F = new G(B);
|
|
1849
1849
|
G.onloadWasmMxDraw3dModel = () => {
|
|
1850
1850
|
C(F), D && D(F);
|
|
@@ -1854,87 +1854,87 @@ function rC(B, D) {
|
|
|
1854
1854
|
}
|
|
1855
1855
|
});
|
|
1856
1856
|
}
|
|
1857
|
-
const
|
|
1857
|
+
const oC = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1858
1858
|
__proto__: null,
|
|
1859
1859
|
fetchAndInstantiate: OD,
|
|
1860
|
-
b64Encode:
|
|
1861
|
-
b64Decode:
|
|
1862
|
-
saveAsFileDialog:
|
|
1863
|
-
downloadFile:
|
|
1860
|
+
b64Encode: eD,
|
|
1861
|
+
b64Decode: tD,
|
|
1862
|
+
saveAsFileDialog: iD,
|
|
1863
|
+
downloadFile: rD,
|
|
1864
1864
|
MxTools: I,
|
|
1865
1865
|
drawText: jD,
|
|
1866
|
-
drawCircle:
|
|
1867
|
-
drawLine:
|
|
1866
|
+
drawCircle: sD,
|
|
1867
|
+
drawLine: hD,
|
|
1868
1868
|
drawMText: QD,
|
|
1869
|
-
drawPolyLine:
|
|
1870
|
-
drawPolygon:
|
|
1871
|
-
drawArc:
|
|
1872
|
-
drawEllipticalArc:
|
|
1873
|
-
mxErase:
|
|
1869
|
+
drawPolyLine: wD,
|
|
1870
|
+
drawPolygon: yD,
|
|
1871
|
+
drawArc: bD,
|
|
1872
|
+
drawEllipticalArc: gD,
|
|
1873
|
+
mxErase: xD,
|
|
1874
1874
|
McObject: j,
|
|
1875
1875
|
McRxObject: L,
|
|
1876
|
-
McDbDatabase:
|
|
1877
|
-
McDbLayerTable:
|
|
1876
|
+
McDbDatabase: oD,
|
|
1877
|
+
McDbLayerTable: nD,
|
|
1878
1878
|
McDbEntity: W,
|
|
1879
1879
|
McDbCurve: q,
|
|
1880
1880
|
McDbLine: H,
|
|
1881
1881
|
McDbText: _,
|
|
1882
|
-
McDbCircle:
|
|
1882
|
+
McDbCircle: DD,
|
|
1883
1883
|
get McDb() {
|
|
1884
1884
|
return Q;
|
|
1885
1885
|
},
|
|
1886
|
-
McDrawUtility:
|
|
1886
|
+
McDrawUtility: CD,
|
|
1887
1887
|
McObjectId: T,
|
|
1888
|
-
McDrawResbuf:
|
|
1889
|
-
McDbPolyline:
|
|
1890
|
-
McDbBlockTable:
|
|
1891
|
-
McDbBlockTableIterator:
|
|
1888
|
+
McDrawResbuf: cD,
|
|
1889
|
+
McDbPolyline: uD,
|
|
1890
|
+
McDbBlockTable: pD,
|
|
1891
|
+
McDbBlockTableIterator: mD,
|
|
1892
1892
|
McDbBlockTableRecord: $,
|
|
1893
|
-
McDbBlockTableRecordIterator:
|
|
1893
|
+
McDbBlockTableRecordIterator: dD,
|
|
1894
1894
|
MxDraw3d: G,
|
|
1895
1895
|
get MxCpp() {
|
|
1896
1896
|
return n;
|
|
1897
1897
|
},
|
|
1898
|
-
loadMxCADassembly:
|
|
1899
|
-
loadMxCADassembly3d:
|
|
1898
|
+
loadMxCADassembly: rC,
|
|
1899
|
+
loadMxCADassembly3d: sC
|
|
1900
1900
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1901
1901
|
export {
|
|
1902
1902
|
Q as McDb,
|
|
1903
|
-
|
|
1904
|
-
|
|
1903
|
+
pD as McDbBlockTable,
|
|
1904
|
+
mD as McDbBlockTableIterator,
|
|
1905
1905
|
$ as McDbBlockTableRecord,
|
|
1906
|
-
|
|
1907
|
-
|
|
1906
|
+
dD as McDbBlockTableRecordIterator,
|
|
1907
|
+
DD as McDbCircle,
|
|
1908
1908
|
q as McDbCurve,
|
|
1909
|
-
|
|
1909
|
+
oD as McDbDatabase,
|
|
1910
1910
|
W as McDbEntity,
|
|
1911
|
-
|
|
1911
|
+
nD as McDbLayerTable,
|
|
1912
1912
|
H as McDbLine,
|
|
1913
|
-
|
|
1913
|
+
uD as McDbPolyline,
|
|
1914
1914
|
_ as McDbText,
|
|
1915
|
-
|
|
1916
|
-
|
|
1915
|
+
cD as McDrawResbuf,
|
|
1916
|
+
CD as McDrawUtility,
|
|
1917
1917
|
j as McObject,
|
|
1918
1918
|
T as McObjectId,
|
|
1919
1919
|
L as McRxObject,
|
|
1920
1920
|
n as MxCpp,
|
|
1921
1921
|
G as MxDraw3d,
|
|
1922
1922
|
I as MxTools,
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1923
|
+
tD as b64Decode,
|
|
1924
|
+
eD as b64Encode,
|
|
1925
|
+
oC as default,
|
|
1926
|
+
rD as downloadFile,
|
|
1927
|
+
bD as drawArc,
|
|
1928
|
+
sD as drawCircle,
|
|
1929
|
+
gD as drawEllipticalArc,
|
|
1930
|
+
hD as drawLine,
|
|
1931
1931
|
QD as drawMText,
|
|
1932
|
-
|
|
1933
|
-
|
|
1932
|
+
wD as drawPolyLine,
|
|
1933
|
+
yD as drawPolygon,
|
|
1934
1934
|
jD as drawText,
|
|
1935
1935
|
OD as fetchAndInstantiate,
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1936
|
+
rC as loadMxCADassembly,
|
|
1937
|
+
sC as loadMxCADassembly3d,
|
|
1938
|
+
xD as mxErase,
|
|
1939
|
+
iD as saveAsFileDialog
|
|
1940
1940
|
};
|