mxcad 1.0.0 → 1.0.3
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/LICENSE.md +9 -0
- package/README.md +60 -0
- package/dist/mxcad.d.ts +30 -0
- package/dist/mxcad.es.js +1270 -0
- package/dist/mxcad.umd.js +38 -0
- package/package.json +54 -27
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -5
- package/lib/utles/index.d.ts +0 -5
- package/lib/utles/index.js +0 -63
package/dist/mxcad.es.js
ADDED
|
@@ -0,0 +1,1270 @@
|
|
|
1
|
+
import { MxFun as I, MrxDbgUiPrPoint as ie, store as Ke, MxPaintBrush as le, MrxDbgUiPrBaseReturn as S, MxDbCircleShape as mt, MxDbLine as je, MxDbPolyline as Ot, MxDbRegularPolygon as Kt, MxDbEllipseShape as Vt } from "mxdraw";
|
|
2
|
+
async function kt(o, s) {
|
|
3
|
+
const n = await (await fetch(o)).arrayBuffer();
|
|
4
|
+
return await WebAssembly.instantiate(n, s);
|
|
5
|
+
}
|
|
6
|
+
function At(o) {
|
|
7
|
+
return btoa(unescape(encodeURIComponent(o)));
|
|
8
|
+
}
|
|
9
|
+
function wt(o) {
|
|
10
|
+
return decodeURIComponent(escape(atob(o)));
|
|
11
|
+
}
|
|
12
|
+
function vt(o) {
|
|
13
|
+
let s = JSON.stringify(o);
|
|
14
|
+
I.callCommand("MxCAD_SetEntityData", s);
|
|
15
|
+
}
|
|
16
|
+
const Ve = {
|
|
17
|
+
b64Encode: At,
|
|
18
|
+
b64Decode: wt,
|
|
19
|
+
setMcDbEntity: vt
|
|
20
|
+
}, Jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
21
|
+
__proto__: null,
|
|
22
|
+
fetchAndInstantiate: kt,
|
|
23
|
+
b64Encode: At,
|
|
24
|
+
b64Decode: wt,
|
|
25
|
+
setMcDbEntity: vt,
|
|
26
|
+
MxTools: Ve
|
|
27
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
28
|
+
function Ht() {
|
|
29
|
+
var o = (() => {
|
|
30
|
+
var s = typeof document < "u" && document.currentScript ? document.currentScript.src : void 0;
|
|
31
|
+
return typeof __filename < "u" && (s = s || __filename), function(l) {
|
|
32
|
+
l = l || {};
|
|
33
|
+
var n;
|
|
34
|
+
n || (n = typeof l < "u" ? l : {});
|
|
35
|
+
var f, _;
|
|
36
|
+
n.ready = new Promise(function(e, t) {
|
|
37
|
+
f = e, _ = t;
|
|
38
|
+
});
|
|
39
|
+
var p = Object.assign({}, n), E = typeof window == "object", m = typeof importScripts == "function", y = "", w, D, R, A, v, T;
|
|
40
|
+
typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string" ? (y = m ? xxxxx("path").dirname(y) + "/" : __dirname + "/", T = () => {
|
|
41
|
+
v || (A = xxxxx("fs"), v = xxxxx("path"));
|
|
42
|
+
}, w = function(e, t) {
|
|
43
|
+
return T(), e = v.normalize(e), A.readFileSync(e, t ? void 0 : "utf8");
|
|
44
|
+
}, R = (e) => (e = w(e, !0), e.buffer || (e = new Uint8Array(e)), e), D = (e, t, r) => {
|
|
45
|
+
T(), e = v.normalize(e), A.readFile(e, function(i, c) {
|
|
46
|
+
i ? r(i) : t(c.buffer);
|
|
47
|
+
});
|
|
48
|
+
}, 1 < process.argv.length && process.argv[1].replace(/\\/g, "/"), process.argv.slice(2), process.on("uncaughtException", function(e) {
|
|
49
|
+
throw e;
|
|
50
|
+
}), process.on("unhandledRejection", function(e) {
|
|
51
|
+
throw e;
|
|
52
|
+
}), n.inspect = function() {
|
|
53
|
+
return "[Emscripten Module object]";
|
|
54
|
+
}) : (E || m) && (m ? y = self.location.href : typeof document < "u" && document.currentScript && (y = document.currentScript.src), s && (y = s), y = y.indexOf("blob:") !== 0 ? y.substr(0, y.replace(/[?#].*/, "").lastIndexOf("/") + 1) : "", w = (e) => {
|
|
55
|
+
var t = new XMLHttpRequest();
|
|
56
|
+
return t.open("GET", e, !1), t.send(null), t.responseText;
|
|
57
|
+
}, m && (R = (e) => {
|
|
58
|
+
var t = new XMLHttpRequest();
|
|
59
|
+
return t.open("GET", e, !1), t.responseType = "arraybuffer", t.send(null), new Uint8Array(t.response);
|
|
60
|
+
}), D = (e, t, r) => {
|
|
61
|
+
var i = new XMLHttpRequest();
|
|
62
|
+
i.open("GET", e, !0), i.responseType = "arraybuffer", i.onload = () => {
|
|
63
|
+
i.status == 200 || i.status == 0 && i.response ? t(i.response) : r();
|
|
64
|
+
}, i.onerror = r, i.send(null);
|
|
65
|
+
});
|
|
66
|
+
var H = n.print || console.log.bind(console), b = n.printErr || console.warn.bind(console);
|
|
67
|
+
Object.assign(n, p), p = null;
|
|
68
|
+
function j(e) {
|
|
69
|
+
O || (O = {}), O[e] || (O[e] = 1, b(e));
|
|
70
|
+
}
|
|
71
|
+
var O, X;
|
|
72
|
+
n.wasmBinary && (X = n.wasmBinary), n.noExitRuntime, typeof WebAssembly != "object" && se("no native wasm support detected");
|
|
73
|
+
var V, N = !1, z = typeof TextDecoder < "u" ? new TextDecoder("utf8") : void 0;
|
|
74
|
+
function q(e, t, r) {
|
|
75
|
+
var i = t + r;
|
|
76
|
+
for (r = t; e[r] && !(r >= i); )
|
|
77
|
+
++r;
|
|
78
|
+
if (16 < r - t && e.buffer && z)
|
|
79
|
+
return z.decode(e.subarray(t, r));
|
|
80
|
+
for (i = ""; t < r; ) {
|
|
81
|
+
var c = e[t++];
|
|
82
|
+
if (c & 128) {
|
|
83
|
+
var u = e[t++] & 63;
|
|
84
|
+
if ((c & 224) == 192)
|
|
85
|
+
i += String.fromCharCode((c & 31) << 6 | u);
|
|
86
|
+
else {
|
|
87
|
+
var a = e[t++] & 63;
|
|
88
|
+
c = (c & 240) == 224 ? (c & 15) << 12 | u << 6 | a : (c & 7) << 18 | u << 12 | a << 6 | e[t++] & 63, 65536 > c ? i += String.fromCharCode(c) : (c -= 65536, i += String.fromCharCode(55296 | c >> 10, 56320 | c & 1023));
|
|
89
|
+
}
|
|
90
|
+
} else
|
|
91
|
+
i += String.fromCharCode(c);
|
|
92
|
+
}
|
|
93
|
+
return i;
|
|
94
|
+
}
|
|
95
|
+
function ue(e, t) {
|
|
96
|
+
return e ? q(J, e, t) : "";
|
|
97
|
+
}
|
|
98
|
+
function he(e, t, r, i) {
|
|
99
|
+
if (!(0 < i))
|
|
100
|
+
return 0;
|
|
101
|
+
var c = r;
|
|
102
|
+
i = r + i - 1;
|
|
103
|
+
for (var u = 0; u < e.length; ++u) {
|
|
104
|
+
var a = e.charCodeAt(u);
|
|
105
|
+
if (55296 <= a && 57343 >= a) {
|
|
106
|
+
var d = e.charCodeAt(++u);
|
|
107
|
+
a = 65536 + ((a & 1023) << 10) | d & 1023;
|
|
108
|
+
}
|
|
109
|
+
if (127 >= a) {
|
|
110
|
+
if (r >= i)
|
|
111
|
+
break;
|
|
112
|
+
t[r++] = a;
|
|
113
|
+
} else {
|
|
114
|
+
if (2047 >= a) {
|
|
115
|
+
if (r + 1 >= i)
|
|
116
|
+
break;
|
|
117
|
+
t[r++] = 192 | a >> 6;
|
|
118
|
+
} else {
|
|
119
|
+
if (65535 >= a) {
|
|
120
|
+
if (r + 2 >= i)
|
|
121
|
+
break;
|
|
122
|
+
t[r++] = 224 | a >> 12;
|
|
123
|
+
} else {
|
|
124
|
+
if (r + 3 >= i)
|
|
125
|
+
break;
|
|
126
|
+
t[r++] = 240 | a >> 18, t[r++] = 128 | a >> 12 & 63;
|
|
127
|
+
}
|
|
128
|
+
t[r++] = 128 | a >> 6 & 63;
|
|
129
|
+
}
|
|
130
|
+
t[r++] = 128 | a & 63;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return t[r] = 0, r - c;
|
|
134
|
+
}
|
|
135
|
+
var ye, K, J, M, Ee, ge;
|
|
136
|
+
function He() {
|
|
137
|
+
var e = V.buffer;
|
|
138
|
+
ye = e, n.HEAP8 = K = new Int8Array(e), n.HEAP16 = new Int16Array(e), n.HEAP32 = M = new Int32Array(e), n.HEAPU8 = J = new Uint8Array(e), n.HEAPU16 = new Uint16Array(e), n.HEAPU32 = new Uint32Array(e), n.HEAPF32 = Ee = new Float32Array(e), n.HEAPF64 = ge = new Float64Array(e);
|
|
139
|
+
}
|
|
140
|
+
var Ne, ze = [], Ge = [], Xe = [];
|
|
141
|
+
function Mt() {
|
|
142
|
+
var e = n.preRun.shift();
|
|
143
|
+
ze.unshift(e);
|
|
144
|
+
}
|
|
145
|
+
var oe = 0, fe = null;
|
|
146
|
+
n.preloadedImages = {}, n.preloadedAudios = {};
|
|
147
|
+
function se(e) {
|
|
148
|
+
throw n.onAbort && n.onAbort(e), e = "Aborted(" + e + ")", b(e), N = !0, e = new WebAssembly.RuntimeError(e + ". Build with -s ASSERTIONS=1 for more info."), _(e), e;
|
|
149
|
+
}
|
|
150
|
+
function $e() {
|
|
151
|
+
return $.startsWith("data:application/octet-stream;base64,");
|
|
152
|
+
}
|
|
153
|
+
var $;
|
|
154
|
+
if ($ = "mxdrawassembly_min.wasm.wasm", !$e()) {
|
|
155
|
+
var Ye = $;
|
|
156
|
+
$ = n.locateFile ? n.locateFile(Ye, y) : y + Ye;
|
|
157
|
+
}
|
|
158
|
+
function Ze() {
|
|
159
|
+
var e = $;
|
|
160
|
+
try {
|
|
161
|
+
if (e == $ && X)
|
|
162
|
+
return new Uint8Array(X);
|
|
163
|
+
if (R)
|
|
164
|
+
return R(e);
|
|
165
|
+
throw "both async and sync fetching of the wasm failed";
|
|
166
|
+
} catch (t) {
|
|
167
|
+
se(t);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
function Pt() {
|
|
171
|
+
if (!X && (E || m)) {
|
|
172
|
+
if (typeof fetch == "function" && !$.startsWith("file://"))
|
|
173
|
+
return fetch($, { credentials: "same-origin" }).then(function(e) {
|
|
174
|
+
if (!e.ok)
|
|
175
|
+
throw "failed to load wasm binary file at '" + $ + "'";
|
|
176
|
+
return e.arrayBuffer();
|
|
177
|
+
}).catch(function() {
|
|
178
|
+
return Ze();
|
|
179
|
+
});
|
|
180
|
+
if (D)
|
|
181
|
+
return new Promise(function(e, t) {
|
|
182
|
+
D($, function(r) {
|
|
183
|
+
e(new Uint8Array(r));
|
|
184
|
+
}, t);
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
return Promise.resolve().then(function() {
|
|
188
|
+
return Ze();
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
function Te(e) {
|
|
192
|
+
for (; 0 < e.length; ) {
|
|
193
|
+
var t = e.shift();
|
|
194
|
+
if (typeof t == "function")
|
|
195
|
+
t(n);
|
|
196
|
+
else {
|
|
197
|
+
var r = t.Da;
|
|
198
|
+
typeof r == "number" ? t.da === void 0 ? Qe(r)() : Qe(r)(t.da) : r(t.da === void 0 ? null : t.da);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
var _e = [];
|
|
203
|
+
function Qe(e) {
|
|
204
|
+
var t = _e[e];
|
|
205
|
+
return t || (e >= _e.length && (_e.length = e + 1), _e[e] = t = Ne.get(e)), t;
|
|
206
|
+
}
|
|
207
|
+
function Je(e, t) {
|
|
208
|
+
if (0 >= e)
|
|
209
|
+
return e;
|
|
210
|
+
var r = 32 >= t ? Math.abs(1 << t - 1) : Math.pow(2, t - 1);
|
|
211
|
+
return e >= r && (32 >= t || e > r) && (e = -2 * r + e), e;
|
|
212
|
+
}
|
|
213
|
+
function qe(e, t) {
|
|
214
|
+
return 0 <= e ? e : 32 >= t ? 2 * Math.abs(1 << t - 1) + e : Math.pow(2, t) + e;
|
|
215
|
+
}
|
|
216
|
+
function Ct(e, t) {
|
|
217
|
+
function r(Y) {
|
|
218
|
+
var Le = i;
|
|
219
|
+
return (Y === "double" || Y === "i64") && Le & 7 && (Le += 4), i = Le, Y === "double" ? (Y = Number(ge[i >> 3]), i += 8) : Y == "i64" ? (Y = [M[i >> 2], M[i + 4 >> 2]], i += 8) : (Y = M[i >> 2], i += 4), Y;
|
|
220
|
+
}
|
|
221
|
+
for (var i = t, c = [], u, a; ; ) {
|
|
222
|
+
var d = e;
|
|
223
|
+
if (u = K[e >> 0], u === 0)
|
|
224
|
+
break;
|
|
225
|
+
if (a = K[e + 1 >> 0], u == 37) {
|
|
226
|
+
var P = !1, x = t = !1, C = !1, te = !1;
|
|
227
|
+
e:
|
|
228
|
+
for (; ; ) {
|
|
229
|
+
switch (a) {
|
|
230
|
+
case 43:
|
|
231
|
+
P = !0;
|
|
232
|
+
break;
|
|
233
|
+
case 45:
|
|
234
|
+
t = !0;
|
|
235
|
+
break;
|
|
236
|
+
case 35:
|
|
237
|
+
x = !0;
|
|
238
|
+
break;
|
|
239
|
+
case 48:
|
|
240
|
+
if (C)
|
|
241
|
+
break e;
|
|
242
|
+
C = !0;
|
|
243
|
+
break;
|
|
244
|
+
case 32:
|
|
245
|
+
te = !0;
|
|
246
|
+
break;
|
|
247
|
+
default:
|
|
248
|
+
break e;
|
|
249
|
+
}
|
|
250
|
+
e++, a = K[e + 1 >> 0];
|
|
251
|
+
}
|
|
252
|
+
var k = 0;
|
|
253
|
+
if (a == 42)
|
|
254
|
+
k = r("i32"), e++, a = K[e + 1 >> 0];
|
|
255
|
+
else
|
|
256
|
+
for (; 48 <= a && 57 >= a; )
|
|
257
|
+
k = 10 * k + (a - 48), e++, a = K[e + 1 >> 0];
|
|
258
|
+
var L = !1, W = -1;
|
|
259
|
+
if (a == 46) {
|
|
260
|
+
if (W = 0, L = !0, e++, a = K[e + 1 >> 0], a == 42)
|
|
261
|
+
W = r("i32"), e++;
|
|
262
|
+
else
|
|
263
|
+
for (; a = K[e + 1 >> 0], !(48 > a || 57 < a); )
|
|
264
|
+
W = 10 * W + (a - 48), e++;
|
|
265
|
+
a = K[e + 1 >> 0];
|
|
266
|
+
}
|
|
267
|
+
switch (0 > W && (W = 6, L = !1), String.fromCharCode(a)) {
|
|
268
|
+
case "h":
|
|
269
|
+
if (a = K[e + 2 >> 0], a == 104) {
|
|
270
|
+
e++;
|
|
271
|
+
var B = 1;
|
|
272
|
+
} else
|
|
273
|
+
B = 2;
|
|
274
|
+
break;
|
|
275
|
+
case "l":
|
|
276
|
+
a = K[e + 2 >> 0], a == 108 ? (e++, B = 8) : B = 4;
|
|
277
|
+
break;
|
|
278
|
+
case "L":
|
|
279
|
+
case "q":
|
|
280
|
+
case "j":
|
|
281
|
+
B = 8;
|
|
282
|
+
break;
|
|
283
|
+
case "z":
|
|
284
|
+
case "t":
|
|
285
|
+
case "I":
|
|
286
|
+
B = 4;
|
|
287
|
+
break;
|
|
288
|
+
default:
|
|
289
|
+
B = null;
|
|
290
|
+
}
|
|
291
|
+
switch (B && e++, a = K[e + 1 >> 0], String.fromCharCode(a)) {
|
|
292
|
+
case "d":
|
|
293
|
+
case "i":
|
|
294
|
+
case "u":
|
|
295
|
+
case "o":
|
|
296
|
+
case "x":
|
|
297
|
+
case "X":
|
|
298
|
+
case "p":
|
|
299
|
+
d = a == 100 || a == 105, B = B || 4, u = r("i" + 8 * B), B == 8 && (u = a == 117 ? (u[0] >>> 0) + 4294967296 * (u[1] >>> 0) : (u[0] >>> 0) + 4294967296 * u[1]), 4 >= B && (u = (d ? Je : qe)(u & Math.pow(256, B) - 1, 8 * B));
|
|
300
|
+
var re = Math.abs(u);
|
|
301
|
+
if (d = "", a == 100 || a == 105)
|
|
302
|
+
var g = Je(u, 8 * B).toString(10);
|
|
303
|
+
else if (a == 117)
|
|
304
|
+
g = qe(u, 8 * B).toString(10), u = Math.abs(u);
|
|
305
|
+
else if (a == 111)
|
|
306
|
+
g = (x ? "0" : "") + re.toString(8);
|
|
307
|
+
else if (a == 120 || a == 88) {
|
|
308
|
+
if (d = x && u != 0 ? "0x" : "", 0 > u) {
|
|
309
|
+
for (u = -u, g = (re - 1).toString(16), re = [], x = 0; x < g.length; x++)
|
|
310
|
+
re.push((15 - parseInt(g[x], 16)).toString(16));
|
|
311
|
+
for (g = re.join(""); g.length < 2 * B; )
|
|
312
|
+
g = "f" + g;
|
|
313
|
+
} else
|
|
314
|
+
g = re.toString(16);
|
|
315
|
+
a == 88 && (d = d.toUpperCase(), g = g.toUpperCase());
|
|
316
|
+
} else
|
|
317
|
+
a == 112 && (re === 0 ? g = "(nil)" : (d = "0x", g = re.toString(16)));
|
|
318
|
+
if (L)
|
|
319
|
+
for (; g.length < W; )
|
|
320
|
+
g = "0" + g;
|
|
321
|
+
for (0 <= u && (P ? d = "+" + d : te && (d = " " + d)), g.charAt(0) == "-" && (d = "-" + d, g = g.substr(1)); d.length + g.length < k; )
|
|
322
|
+
t ? g += " " : C ? g = "0" + g : d = " " + d;
|
|
323
|
+
g = d + g, g.split("").forEach(function(Y) {
|
|
324
|
+
c.push(Y.charCodeAt(0));
|
|
325
|
+
});
|
|
326
|
+
break;
|
|
327
|
+
case "f":
|
|
328
|
+
case "F":
|
|
329
|
+
case "e":
|
|
330
|
+
case "E":
|
|
331
|
+
case "g":
|
|
332
|
+
case "G":
|
|
333
|
+
if (u = r("double"), isNaN(u))
|
|
334
|
+
g = "nan", C = !1;
|
|
335
|
+
else if (isFinite(u)) {
|
|
336
|
+
if (L = !1, B = Math.min(W, 20), (a == 103 || a == 71) && (L = !0, W = W || 1, B = parseInt(u.toExponential(B).split("e")[1], 10), W > B && -4 <= B ? (a = (a == 103 ? "f" : "F").charCodeAt(0), W -= B + 1) : (a = (a == 103 ? "e" : "E").charCodeAt(0), W--), B = Math.min(W, 20)), a == 101 || a == 69 ? (g = u.toExponential(B), /[eE][-+]\d$/.test(g) && (g = g.slice(0, -1) + "0" + g.slice(-1))) : (a == 102 || a == 70) && (g = u.toFixed(B), u === 0 && (0 > u || u === 0 && 1 / u === -1 / 0) && (g = "-" + g)), d = g.split("e"), L && !x)
|
|
337
|
+
for (; 1 < d[0].length && d[0].includes(".") && (d[0].slice(-1) == "0" || d[0].slice(-1) == "."); )
|
|
338
|
+
d[0] = d[0].slice(0, -1);
|
|
339
|
+
else
|
|
340
|
+
for (x && g.indexOf(".") == -1 && (d[0] += "."); W > B++; )
|
|
341
|
+
d[0] += "0";
|
|
342
|
+
g = d[0] + (1 < d.length ? "e" + d[1] : ""), a == 69 && (g = g.toUpperCase()), 0 <= u && (P ? g = "+" + g : te && (g = " " + g));
|
|
343
|
+
} else
|
|
344
|
+
g = (0 > u ? "-" : "") + "inf", C = !1;
|
|
345
|
+
for (; g.length < k; )
|
|
346
|
+
g = t ? g + " " : !C || g[0] != "-" && g[0] != "+" ? (C ? "0" : " ") + g : g[0] + "0" + g.slice(1);
|
|
347
|
+
97 > a && (g = g.toUpperCase()), g.split("").forEach(function(Y) {
|
|
348
|
+
c.push(Y.charCodeAt(0));
|
|
349
|
+
});
|
|
350
|
+
break;
|
|
351
|
+
case "s":
|
|
352
|
+
if (C = (P = r("i8*")) ? dt(P) : 6, L && (C = Math.min(C, W)), !t)
|
|
353
|
+
for (; C < k--; )
|
|
354
|
+
c.push(32);
|
|
355
|
+
if (P)
|
|
356
|
+
for (x = 0; x < C; x++)
|
|
357
|
+
c.push(J[P++ >> 0]);
|
|
358
|
+
else
|
|
359
|
+
c = c.concat(it(
|
|
360
|
+
"(null)".substr(0, C),
|
|
361
|
+
!0
|
|
362
|
+
));
|
|
363
|
+
if (t)
|
|
364
|
+
for (; C < k--; )
|
|
365
|
+
c.push(32);
|
|
366
|
+
break;
|
|
367
|
+
case "c":
|
|
368
|
+
for (t && c.push(r("i8")); 0 < --k; )
|
|
369
|
+
c.push(32);
|
|
370
|
+
t || c.push(r("i8"));
|
|
371
|
+
break;
|
|
372
|
+
case "n":
|
|
373
|
+
t = r("i32*"), M[t >> 2] = c.length;
|
|
374
|
+
break;
|
|
375
|
+
case "%":
|
|
376
|
+
c.push(u);
|
|
377
|
+
break;
|
|
378
|
+
default:
|
|
379
|
+
for (x = d; x < e + 2; x++)
|
|
380
|
+
c.push(K[x >> 0]);
|
|
381
|
+
}
|
|
382
|
+
e += 2;
|
|
383
|
+
} else
|
|
384
|
+
c.push(u), e += 1;
|
|
385
|
+
}
|
|
386
|
+
return c;
|
|
387
|
+
}
|
|
388
|
+
function be(e) {
|
|
389
|
+
if (!e || !e.callee || !e.callee.name)
|
|
390
|
+
return [null, "", ""];
|
|
391
|
+
var t = e.callee.name, r = "(", i = !0, c;
|
|
392
|
+
for (c in e) {
|
|
393
|
+
var u = e[c];
|
|
394
|
+
i || (r += ", "), i = !1, r = typeof u == "number" || typeof u == "string" ? r + u : r + ("(" + typeof u + ")");
|
|
395
|
+
}
|
|
396
|
+
return r += ")", e = (e = e.callee.caller) ? e.arguments : [], i && (r = ""), [e, t, r];
|
|
397
|
+
}
|
|
398
|
+
function Bt(e) {
|
|
399
|
+
e: {
|
|
400
|
+
var t = Error();
|
|
401
|
+
if (!t.stack) {
|
|
402
|
+
try {
|
|
403
|
+
throw Error();
|
|
404
|
+
} catch (W) {
|
|
405
|
+
t = W;
|
|
406
|
+
}
|
|
407
|
+
if (!t.stack) {
|
|
408
|
+
t = "(no stack trace available)";
|
|
409
|
+
break e;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
t = t.stack.toString();
|
|
413
|
+
}
|
|
414
|
+
t = t.slice(t.indexOf(`
|
|
415
|
+
`, Math.max(t.lastIndexOf("_emscripten_log"), t.lastIndexOf("_emscripten_get_callstack"))) + 1), e & 32 && j("EM_LOG_DEMANGLE is deprecated; ignoring"), e & 8 && typeof emscripten_source_map > "u" && (j('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.'), e = e ^ 8 | 16);
|
|
416
|
+
var r = null;
|
|
417
|
+
if (e & 128)
|
|
418
|
+
for (r = be(arguments); r[1].includes("_emscripten_"); )
|
|
419
|
+
r = be(r[0]);
|
|
420
|
+
var i = t.split(`
|
|
421
|
+
`);
|
|
422
|
+
t = "";
|
|
423
|
+
var c = RegExp("\\s*(.*?)@(.*?):([0-9]+):([0-9]+)"), u = RegExp("\\s*(.*?)@(.*):(.*)(:(.*))?"), a = RegExp("\\s*at (.*?) \\((.*):(.*):(.*)\\)"), d;
|
|
424
|
+
for (d in i) {
|
|
425
|
+
var P = i[d], x;
|
|
426
|
+
if ((x = a.exec(P)) && x.length == 5) {
|
|
427
|
+
P = x[1];
|
|
428
|
+
var C = x[2], te = x[3];
|
|
429
|
+
x = x[4];
|
|
430
|
+
} else if ((x = c.exec(P)) || (x = u.exec(P)), x && 4 <= x.length)
|
|
431
|
+
P = x[1], C = x[2], te = x[3], x = x[4] | 0;
|
|
432
|
+
else {
|
|
433
|
+
t += P + `
|
|
434
|
+
`;
|
|
435
|
+
continue;
|
|
436
|
+
}
|
|
437
|
+
var k = !1;
|
|
438
|
+
if (e & 8) {
|
|
439
|
+
var L = emscripten_source_map.Ia({
|
|
440
|
+
line: te,
|
|
441
|
+
ua: x
|
|
442
|
+
});
|
|
443
|
+
(k = L && L.source) && (e & 64 && (L.source = L.source.substring(L.source.replace(/\\/g, "/").lastIndexOf("/") + 1)), t += " at " + P + " (" + L.source + ":" + L.line + ":" + L.ua + `)
|
|
444
|
+
`);
|
|
445
|
+
}
|
|
446
|
+
(e & 16 || !k) && (e & 64 && (C = C.substring(C.replace(/\\/g, "/").lastIndexOf("/") + 1)), t += (k ? " = " + P : " at " + P) + " (" + C + ":" + te + ":" + x + `)
|
|
447
|
+
`), e & 128 && r[0] && (r[1] == P && 0 < r[2].length && (t = t.replace(/\s+$/, ""), t += " with values: " + r[1] + r[2] + `
|
|
448
|
+
`), r = be(r[0]));
|
|
449
|
+
}
|
|
450
|
+
return t = t.replace(/\s+$/, "");
|
|
451
|
+
}
|
|
452
|
+
function Dt(e) {
|
|
453
|
+
var t = e.getExtension("ANGLE_instanced_arrays");
|
|
454
|
+
t && (e.vertexAttribDivisor = function(r, i) {
|
|
455
|
+
t.vertexAttribDivisorANGLE(r, i);
|
|
456
|
+
}, e.drawArraysInstanced = function(r, i, c, u) {
|
|
457
|
+
t.drawArraysInstancedANGLE(r, i, c, u);
|
|
458
|
+
}, e.drawElementsInstanced = function(r, i, c, u, a) {
|
|
459
|
+
t.drawElementsInstancedANGLE(r, i, c, u, a);
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
function Rt(e) {
|
|
463
|
+
var t = e.getExtension("OES_vertex_array_object");
|
|
464
|
+
t && (e.createVertexArray = function() {
|
|
465
|
+
return t.createVertexArrayOES();
|
|
466
|
+
}, e.deleteVertexArray = function(r) {
|
|
467
|
+
t.deleteVertexArrayOES(r);
|
|
468
|
+
}, e.bindVertexArray = function(r) {
|
|
469
|
+
t.bindVertexArrayOES(r);
|
|
470
|
+
}, e.isVertexArray = function(r) {
|
|
471
|
+
return t.isVertexArrayOES(r);
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
function Tt(e) {
|
|
475
|
+
var t = e.getExtension("WEBGL_draw_buffers");
|
|
476
|
+
t && (e.drawBuffers = function(r, i) {
|
|
477
|
+
t.drawBuffersWEBGL(r, i);
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
var Ue = 1, xe = [], U = [], ee = [], Se = [], et = [1, 1, 2, 2, 4, 4, 4, 2, 3, 4, 8];
|
|
481
|
+
function ae(e) {
|
|
482
|
+
Ae || (Ae = e);
|
|
483
|
+
}
|
|
484
|
+
function me(e) {
|
|
485
|
+
for (var t = Ue++, r = e.length; r < t; r++)
|
|
486
|
+
e[r] = null;
|
|
487
|
+
return t;
|
|
488
|
+
}
|
|
489
|
+
function Fe(e) {
|
|
490
|
+
return 32 - Math.clz32(e === 0 ? 0 : e - 1);
|
|
491
|
+
}
|
|
492
|
+
function bt(e, t) {
|
|
493
|
+
e.fa || (e.fa = e.getContext, e.getContext = function(i, c) {
|
|
494
|
+
return (c = e.fa(i, c)) || (c = e.fa(i)), i == "webgl" == c instanceof WebGLRenderingContext ? c : null;
|
|
495
|
+
});
|
|
496
|
+
var r = 1 < t.na ? e.getContext("webgl2", t) : e.getContext("webgl", t);
|
|
497
|
+
return r ? St(r, t) : 0;
|
|
498
|
+
}
|
|
499
|
+
function St(e, t) {
|
|
500
|
+
var r = me(Se), i = { Ea: r, attributes: t, version: t.na, ba: e };
|
|
501
|
+
for (e.canvas && (e.canvas.ya = i), Se[r] = i, (typeof t.ma > "u" || t.ma) && Ft(i), i.oa = i.ba.getParameter(34921), i.X = [], e = 0; e < i.oa; e++)
|
|
502
|
+
i.X[e] = { enabled: !1, ea: !1, size: 0, type: 0, pa: 0, ga: 0, R: 0, ta: null };
|
|
503
|
+
for (e = Fe(2097152), i.U = [], i.qa = [], i.U.length = i.qa.length = e + 1, i.aa = [], i.ha = [], i.aa.length = i.ha.length = e + 1, i.S = [], i.S.length = e + 1, t = 0; t <= e; ++t) {
|
|
504
|
+
i.S[t] = null, i.U[t] = i.qa[t] = 0, i.aa[t] = [], i.ha[t] = [];
|
|
505
|
+
var c = i.aa[t], u = i.ha[t];
|
|
506
|
+
c.length = u.length = 64;
|
|
507
|
+
for (var a = 0; 64 > a; ++a)
|
|
508
|
+
c[a] = u[a] = null;
|
|
509
|
+
}
|
|
510
|
+
return r;
|
|
511
|
+
}
|
|
512
|
+
function Ft(e) {
|
|
513
|
+
if (e || (e = F), !e.xa) {
|
|
514
|
+
e.xa = !0;
|
|
515
|
+
var t = e.ba;
|
|
516
|
+
Dt(t), Rt(t), Tt(t), t.Ca = t.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"), t.Fa = t.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"), 2 <= e.version && (t.la = t.getExtension("EXT_disjoint_timer_query_webgl2")), (2 > e.version || !t.la) && (t.la = t.getExtension("EXT_disjoint_timer_query")), t.Ha = t.getExtension("WEBGL_multi_draw"), (t.getSupportedExtensions() || []).forEach(function(r) {
|
|
517
|
+
r.includes("lose_context") || r.includes("debug") || t.getExtension(r);
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
var Ae, F, We, Wt = ["default", "low-power", "high-performance"], It = [0, typeof document < "u" ? document : 0, typeof window < "u" ? window : 0];
|
|
522
|
+
function tt(e) {
|
|
523
|
+
return e.slice(-1) == "]" && e.lastIndexOf("[");
|
|
524
|
+
}
|
|
525
|
+
function nt(e) {
|
|
526
|
+
var t = h.va;
|
|
527
|
+
if (t) {
|
|
528
|
+
var r = t.V[e];
|
|
529
|
+
return typeof r == "number" && (t.V[e] = r = h.getUniformLocation(t, t.ra[e] + (0 < r ? "[" + r + "]" : ""))), r;
|
|
530
|
+
}
|
|
531
|
+
ae(1282);
|
|
532
|
+
}
|
|
533
|
+
for (var rt = [], h, Lt = new Float32Array(288), we = 0; 288 > we; ++we)
|
|
534
|
+
rt[we] = Lt.subarray(0, we + 1);
|
|
535
|
+
function it(e, t) {
|
|
536
|
+
for (var r = 0, i = 0; i < e.length; ++i) {
|
|
537
|
+
var c = e.charCodeAt(i);
|
|
538
|
+
55296 <= c && 57343 >= c && (c = 65536 + ((c & 1023) << 10) | e.charCodeAt(++i) & 1023), 127 >= c ? ++r : r = 2047 >= c ? r + 2 : 65535 >= c ? r + 3 : r + 4;
|
|
539
|
+
}
|
|
540
|
+
return r = Array(r + 1), e = he(e, r, 0, r.length), t && (r.length = e), r;
|
|
541
|
+
}
|
|
542
|
+
var jt = { c: function() {
|
|
543
|
+
se("");
|
|
544
|
+
}, a: function(e, t, r) {
|
|
545
|
+
t = Ct(t, r), t = q(t, 0), e & 24 && (t = t.replace(/\s+$/, ""), t += (0 < t.length ? `
|
|
546
|
+
` : "") + Bt(e)), e & 1 ? e & 4 ? console.error(t) : e & 2 ? console.warn(t) : e & 512 ? console.info(t) : e & 256 ? console.debug(t) : console.log(t) : e & 6 ? b(t) : H(t);
|
|
547
|
+
}, o: function(e, t, r) {
|
|
548
|
+
J.copyWithin(e, t, t + r);
|
|
549
|
+
}, n: function(e) {
|
|
550
|
+
var t = J.length;
|
|
551
|
+
if (e >>>= 0, 2147483648 < e)
|
|
552
|
+
return !1;
|
|
553
|
+
for (var r = 1; 4 >= r; r *= 2) {
|
|
554
|
+
var i = t * (1 + 0.2 / r);
|
|
555
|
+
i = Math.min(i, e + 100663296);
|
|
556
|
+
var c = Math;
|
|
557
|
+
i = Math.max(e, i), c = c.min.call(c, 2147483648, i + (65536 - i % 65536) % 65536);
|
|
558
|
+
e: {
|
|
559
|
+
try {
|
|
560
|
+
V.grow(c - ye.byteLength + 65535 >>> 16), He();
|
|
561
|
+
var u = 1;
|
|
562
|
+
break e;
|
|
563
|
+
} catch {
|
|
564
|
+
}
|
|
565
|
+
u = void 0;
|
|
566
|
+
}
|
|
567
|
+
if (u)
|
|
568
|
+
return !0;
|
|
569
|
+
}
|
|
570
|
+
return !1;
|
|
571
|
+
}, k: function(e, t) {
|
|
572
|
+
return t >>= 2, t = { alpha: !!M[t + 0], depth: !!M[t + 1], stencil: !!M[t + 2], antialias: !!M[t + 3], premultipliedAlpha: !!M[t + 4], preserveDrawingBuffer: !!M[t + 5], powerPreference: Wt[M[t + 6]], failIfMajorPerformanceCaveat: !!M[t + 7], na: M[t + 8], Ga: M[t + 9], ma: M[t + 10], wa: M[t + 11], Ja: M[t + 12], Ka: M[t + 13] }, e = 2 < e ? ue(e) : e, e = It[e] || (typeof document < "u" ? document.querySelector(e) : void 0), !e || t.wa ? 0 : bt(e, t);
|
|
573
|
+
}, e: function(e) {
|
|
574
|
+
return F = Se[e], n.za = h = F && F.ba, !e || h ? 0 : -5;
|
|
575
|
+
}, d: function(e, t) {
|
|
576
|
+
h.attachShader(U[e], ee[t]);
|
|
577
|
+
}, A: function(e, t, r) {
|
|
578
|
+
h.bindAttribLocation(U[e], t, ue(r));
|
|
579
|
+
}, b: function(e, t) {
|
|
580
|
+
e == 34962 ? h.ja = t : e == 34963 && (h.ka = t), e == 35051 ? h.Aa = t : e == 35052 && (h.Ba = t), h.bindBuffer(e, xe[t]);
|
|
581
|
+
}, f: function(e, t, r, i) {
|
|
582
|
+
2 <= F.version ? r ? h.bufferData(e, J, i, r, t) : h.bufferData(e, t, i) : h.bufferData(e, r ? J.subarray(r, r + t) : t, i);
|
|
583
|
+
}, v: function(e) {
|
|
584
|
+
h.clear(e);
|
|
585
|
+
}, w: function(e, t, r, i) {
|
|
586
|
+
h.clearColor(e, t, r, i);
|
|
587
|
+
}, t: function(e) {
|
|
588
|
+
h.compileShader(ee[e]);
|
|
589
|
+
}, j: function() {
|
|
590
|
+
var e = me(U), t = h.createProgram();
|
|
591
|
+
return t.name = e, t.$ = t.Y = t.Z = 0, t.ia = 1, U[e] = t, e;
|
|
592
|
+
}, C: function(e) {
|
|
593
|
+
var t = me(ee);
|
|
594
|
+
return ee[t] = h.createShader(e), t;
|
|
595
|
+
}, q: function(e, t, r, i) {
|
|
596
|
+
if (!h.ka) {
|
|
597
|
+
var c = 1 * et[r - 5120] * t, u = Fe(c), a = F.S[u];
|
|
598
|
+
a ? u = a : (a = h.getParameter(34965), F.S[u] = h.createBuffer(), h.bindBuffer(34963, F.S[u]), h.bufferData(34963, 1 << u, 35048), h.bindBuffer(34963, a), u = F.S[u]), h.bindBuffer(34963, u), h.bufferSubData(34963, 0, J.subarray(i, i + c)), i = 0;
|
|
599
|
+
}
|
|
600
|
+
for (We = !1, c = 0; c < F.oa; ++c)
|
|
601
|
+
if (u = F.X[c], u.ea && u.enabled) {
|
|
602
|
+
We = !0, a = u.ga, a = 0 < a ? t * a : u.size * et[u.type - 5120] * t;
|
|
603
|
+
var d = Fe(a), P = F.aa[d], x = F.U[d];
|
|
604
|
+
F.U[d] = F.U[d] + 1 & 63;
|
|
605
|
+
var C = P[x];
|
|
606
|
+
C ? d = C : (C = h.getParameter(34964), P[x] = h.createBuffer(), h.bindBuffer(34962, P[x]), h.bufferData(34962, 1 << d, 35048), h.bindBuffer(34962, C), d = P[x]), h.bindBuffer(34962, d), h.bufferSubData(34962, 0, J.subarray(u.R, u.R + a)), u.ta.call(h, c, u.size, u.type, u.pa, u.ga, 0);
|
|
607
|
+
}
|
|
608
|
+
h.drawElements(e, t, r, i), We && h.bindBuffer(34962, xe[h.ja]), h.ka || h.bindBuffer(34963, null);
|
|
609
|
+
}, s: function(e) {
|
|
610
|
+
F.X[e].enabled = !0, h.enableVertexAttribArray(e);
|
|
611
|
+
}, g: function(e, t) {
|
|
612
|
+
for (var r = 0; r < e; r++) {
|
|
613
|
+
var i = h.createBuffer(), c = i && me(xe);
|
|
614
|
+
i ? (i.name = c, xe[c] = i) : ae(1282), M[t + 4 * r >> 2] = c;
|
|
615
|
+
}
|
|
616
|
+
}, p: function() {
|
|
617
|
+
var e = h.getError() || Ae;
|
|
618
|
+
return Ae = 0, e;
|
|
619
|
+
}, x: function(e, t, r) {
|
|
620
|
+
if (r)
|
|
621
|
+
if (e >= Ue)
|
|
622
|
+
ae(1281);
|
|
623
|
+
else if (e = U[e], t == 35716)
|
|
624
|
+
e = h.getProgramInfoLog(e), e === null && (e = "(unknown error)"), M[r >> 2] = e.length + 1;
|
|
625
|
+
else if (t == 35719) {
|
|
626
|
+
if (!e.$)
|
|
627
|
+
for (t = 0; t < h.getProgramParameter(e, 35718); ++t)
|
|
628
|
+
e.$ = Math.max(e.$, h.getActiveUniform(e, t).name.length + 1);
|
|
629
|
+
M[r >> 2] = e.$;
|
|
630
|
+
} else if (t == 35722) {
|
|
631
|
+
if (!e.Y)
|
|
632
|
+
for (t = 0; t < h.getProgramParameter(e, 35721); ++t)
|
|
633
|
+
e.Y = Math.max(e.Y, h.getActiveAttrib(
|
|
634
|
+
e,
|
|
635
|
+
t
|
|
636
|
+
).name.length + 1);
|
|
637
|
+
M[r >> 2] = e.Y;
|
|
638
|
+
} else if (t == 35381) {
|
|
639
|
+
if (!e.Z)
|
|
640
|
+
for (t = 0; t < h.getProgramParameter(e, 35382); ++t)
|
|
641
|
+
e.Z = Math.max(e.Z, h.getActiveUniformBlockName(e, t).length + 1);
|
|
642
|
+
M[r >> 2] = e.Z;
|
|
643
|
+
} else
|
|
644
|
+
M[r >> 2] = h.getProgramParameter(e, t);
|
|
645
|
+
else
|
|
646
|
+
ae(1281);
|
|
647
|
+
}, l: function(e, t, r, i) {
|
|
648
|
+
e = h.getShaderInfoLog(ee[e]), e === null && (e = "(unknown error)"), t = 0 < t && i ? he(e, J, i, t) : 0, r && (M[r >> 2] = t);
|
|
649
|
+
}, m: function(e, t, r) {
|
|
650
|
+
r ? t == 35716 ? (e = h.getShaderInfoLog(ee[e]), e === null && (e = "(unknown error)"), M[r >> 2] = e ? e.length + 1 : 0) : t == 35720 ? (e = h.getShaderSource(ee[e]), M[r >> 2] = e ? e.length + 1 : 0) : M[r >> 2] = h.getShaderParameter(ee[e], t) : ae(1281);
|
|
651
|
+
}, i: function(e, t) {
|
|
652
|
+
if (t = ue(t), e = U[e]) {
|
|
653
|
+
var r = e, i = r.V, c = r.sa, u;
|
|
654
|
+
if (!i)
|
|
655
|
+
for (r.V = i = {}, r.ra = {}, u = 0; u < h.getProgramParameter(r, 35718); ++u) {
|
|
656
|
+
var a = h.getActiveUniform(r, u), d = a.name;
|
|
657
|
+
a = a.size;
|
|
658
|
+
var P = tt(d);
|
|
659
|
+
P = 0 < P ? d.slice(0, P) : d;
|
|
660
|
+
var x = r.ia;
|
|
661
|
+
for (r.ia += a, c[P] = [a, x], d = 0; d < a; ++d)
|
|
662
|
+
i[x] = d, r.ra[x++] = P;
|
|
663
|
+
}
|
|
664
|
+
if (r = e.V, i = 0, c = t, u = tt(t), 0 < u && (i = parseInt(t.slice(u + 1)) >>> 0, c = t.slice(0, u)), (c = e.sa[c]) && i < c[0] && (i += c[1], r[i] = r[i] || h.getUniformLocation(e, t)))
|
|
665
|
+
return i;
|
|
666
|
+
} else
|
|
667
|
+
ae(1281);
|
|
668
|
+
return -1;
|
|
669
|
+
}, z: function(e) {
|
|
670
|
+
e = U[e], h.linkProgram(e), e.V = 0, e.sa = {};
|
|
671
|
+
}, B: function(e, t, r, i) {
|
|
672
|
+
for (var c = "", u = 0; u < t; ++u) {
|
|
673
|
+
var a = i ? M[i + 4 * u >> 2] : -1;
|
|
674
|
+
c += ue(M[r + 4 * u >> 2], 0 > a ? void 0 : a);
|
|
675
|
+
}
|
|
676
|
+
h.shaderSource(ee[e], c);
|
|
677
|
+
}, h: function(e, t, r, i) {
|
|
678
|
+
if (2 <= F.version)
|
|
679
|
+
h.uniformMatrix4fv(nt(e), !!r, Ee, i >> 2, 16 * t);
|
|
680
|
+
else {
|
|
681
|
+
if (18 >= t) {
|
|
682
|
+
var c = rt[16 * t - 1], u = Ee;
|
|
683
|
+
i >>= 2;
|
|
684
|
+
for (var a = 0; a < 16 * t; a += 16) {
|
|
685
|
+
var d = i + a;
|
|
686
|
+
c[a] = u[d], c[a + 1] = u[d + 1], c[a + 2] = u[d + 2], c[a + 3] = u[d + 3], c[a + 4] = u[d + 4], c[a + 5] = u[d + 5], c[a + 6] = u[d + 6], c[a + 7] = u[d + 7], c[a + 8] = u[d + 8], c[a + 9] = u[d + 9], c[a + 10] = u[d + 10], c[a + 11] = u[d + 11], c[a + 12] = u[d + 12], c[a + 13] = u[d + 13], c[a + 14] = u[d + 14], c[a + 15] = u[d + 15];
|
|
687
|
+
}
|
|
688
|
+
} else
|
|
689
|
+
c = Ee.subarray(i >> 2, i + 64 * t >> 2);
|
|
690
|
+
h.uniformMatrix4fv(nt(e), !!r, c);
|
|
691
|
+
}
|
|
692
|
+
}, u: function(e) {
|
|
693
|
+
e = U[e], h.useProgram(e), h.va = e;
|
|
694
|
+
}, y: function(e) {
|
|
695
|
+
h.validateProgram(U[e]);
|
|
696
|
+
}, r: function(e, t, r, i, c, u) {
|
|
697
|
+
var a = F.X[e];
|
|
698
|
+
h.ja ? (a.ea = !1, h.vertexAttribPointer(e, t, r, !!i, c, u)) : (a.size = t, a.type = r, a.pa = i, a.ga = c, a.R = u, a.ea = !0, a.ta = function(d, P, x, C, te, k) {
|
|
699
|
+
this.vertexAttribPointer(d, P, x, C, te, k);
|
|
700
|
+
});
|
|
701
|
+
} };
|
|
702
|
+
(function() {
|
|
703
|
+
function e(c) {
|
|
704
|
+
n.asm = c.exports, V = n.asm.D, He(), Ne = n.asm.M, Ge.unshift(n.asm.E), oe--, n.monitorRunDependencies && n.monitorRunDependencies(oe), oe == 0 && fe && (c = fe, fe = null, c());
|
|
705
|
+
}
|
|
706
|
+
function t(c) {
|
|
707
|
+
e(c.instance);
|
|
708
|
+
}
|
|
709
|
+
function r(c) {
|
|
710
|
+
return Pt().then(function(u) {
|
|
711
|
+
return WebAssembly.instantiate(u, i);
|
|
712
|
+
}).then(function(u) {
|
|
713
|
+
return u;
|
|
714
|
+
}).then(c, function(u) {
|
|
715
|
+
b("failed to asynchronously prepare wasm: " + u), se(u);
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
var i = { a: jt };
|
|
719
|
+
if (oe++, n.monitorRunDependencies && n.monitorRunDependencies(oe), n.instantiateWasm)
|
|
720
|
+
try {
|
|
721
|
+
return n.instantiateWasm(
|
|
722
|
+
i,
|
|
723
|
+
e
|
|
724
|
+
);
|
|
725
|
+
} catch (c) {
|
|
726
|
+
return b("Module.instantiateWasm callback failed with error: " + c), !1;
|
|
727
|
+
}
|
|
728
|
+
return function() {
|
|
729
|
+
return X || typeof WebAssembly.instantiateStreaming != "function" || $e() || $.startsWith("file://") || typeof fetch != "function" ? r(t) : fetch($, { credentials: "same-origin" }).then(function(c) {
|
|
730
|
+
return WebAssembly.instantiateStreaming(c, i).then(t, function(u) {
|
|
731
|
+
return b("wasm streaming compile failed: " + u), b("falling back to ArrayBuffer instantiation"), r(t);
|
|
732
|
+
});
|
|
733
|
+
});
|
|
734
|
+
}().catch(_), {};
|
|
735
|
+
})(), n.___wasm_call_ctors = function() {
|
|
736
|
+
return (n.___wasm_call_ctors = n.asm.E).apply(null, arguments);
|
|
737
|
+
};
|
|
738
|
+
var ot = n._emscripten_bind_VoidPtr___destroy___0 = function() {
|
|
739
|
+
return (ot = n._emscripten_bind_VoidPtr___destroy___0 = n.asm.F).apply(null, arguments);
|
|
740
|
+
}, st = n._emscripten_bind_McObject_updateDisplay_2 = function() {
|
|
741
|
+
return (st = n._emscripten_bind_McObject_updateDisplay_2 = n.asm.G).apply(null, arguments);
|
|
742
|
+
}, ut = n._emscripten_bind_McObject_test_0 = function() {
|
|
743
|
+
return (ut = n._emscripten_bind_McObject_test_0 = n.asm.H).apply(null, arguments);
|
|
744
|
+
}, at = n._emscripten_bind_McApp_McApp_0 = function() {
|
|
745
|
+
return (at = n._emscripten_bind_McApp_McApp_0 = n.asm.I).apply(null, arguments);
|
|
746
|
+
}, ct = n._emscripten_bind_McApp_Init_0 = function() {
|
|
747
|
+
return (ct = n._emscripten_bind_McApp_Init_0 = n.asm.J).apply(null, arguments);
|
|
748
|
+
}, lt = n._emscripten_bind_McApp_CreateMxDraw_3 = function() {
|
|
749
|
+
return (lt = n._emscripten_bind_McApp_CreateMxDraw_3 = n.asm.K).apply(null, arguments);
|
|
750
|
+
}, ft = n._emscripten_bind_McApp___destroy___0 = function() {
|
|
751
|
+
return (ft = n._emscripten_bind_McApp___destroy___0 = n.asm.L).apply(null, arguments);
|
|
752
|
+
}, dt = n._strlen = function() {
|
|
753
|
+
return (dt = n._strlen = n.asm.N).apply(null, arguments);
|
|
754
|
+
};
|
|
755
|
+
n._malloc = function() {
|
|
756
|
+
return (n._malloc = n.asm.O).apply(null, arguments);
|
|
757
|
+
}, n._free = function() {
|
|
758
|
+
return (n._free = n.asm.P).apply(null, arguments);
|
|
759
|
+
};
|
|
760
|
+
var ve;
|
|
761
|
+
fe = function e() {
|
|
762
|
+
ve || Ie(), ve || (fe = e);
|
|
763
|
+
};
|
|
764
|
+
function Ie() {
|
|
765
|
+
function e() {
|
|
766
|
+
if (!ve && (ve = !0, n.calledRun = !0, !N)) {
|
|
767
|
+
if (Te(Ge), f(n), n.onRuntimeInitialized && n.onRuntimeInitialized(), n.postRun)
|
|
768
|
+
for (typeof n.postRun == "function" && (n.postRun = [n.postRun]); n.postRun.length; ) {
|
|
769
|
+
var t = n.postRun.shift();
|
|
770
|
+
Xe.unshift(t);
|
|
771
|
+
}
|
|
772
|
+
Te(Xe);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
if (!(0 < oe)) {
|
|
776
|
+
if (n.preRun)
|
|
777
|
+
for (typeof n.preRun == "function" && (n.preRun = [n.preRun]); n.preRun.length; )
|
|
778
|
+
Mt();
|
|
779
|
+
Te(ze), 0 < oe || (n.setStatus ? (n.setStatus("Running..."), setTimeout(function() {
|
|
780
|
+
setTimeout(function() {
|
|
781
|
+
n.setStatus("");
|
|
782
|
+
}, 1), e();
|
|
783
|
+
}, 1)) : e());
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
if (n.run = Ie, n.preInit)
|
|
787
|
+
for (typeof n.preInit == "function" && (n.preInit = [n.preInit]); 0 < n.preInit.length; )
|
|
788
|
+
n.preInit.pop()();
|
|
789
|
+
Ie();
|
|
790
|
+
function G() {
|
|
791
|
+
}
|
|
792
|
+
G.prototype = Object.create(G.prototype), G.prototype.constructor = G, G.prototype.T = G, G.W = {}, n.WrapperObject = G;
|
|
793
|
+
function Me(e) {
|
|
794
|
+
return (e || G).W;
|
|
795
|
+
}
|
|
796
|
+
n.getCache = Me;
|
|
797
|
+
function Pe(e, t) {
|
|
798
|
+
var r = Me(t), i = r[e];
|
|
799
|
+
return i || (i = Object.create((t || G).prototype), i.R = e, r[e] = i);
|
|
800
|
+
}
|
|
801
|
+
n.wrapPointer = Pe, n.castObject = function(e, t) {
|
|
802
|
+
return Pe(e.R, t);
|
|
803
|
+
}, n.NULL = Pe(0), n.destroy = function(e) {
|
|
804
|
+
if (!e.__destroy__)
|
|
805
|
+
throw "Error: Cannot destroy object. (Did you create it yourself?)";
|
|
806
|
+
e.__destroy__(), delete Me(e.T)[e.R];
|
|
807
|
+
}, n.compare = function(e, t) {
|
|
808
|
+
return e.R === t.R;
|
|
809
|
+
}, n.getPointer = function(e) {
|
|
810
|
+
return e.R;
|
|
811
|
+
}, n.getClass = function(e) {
|
|
812
|
+
return e.T;
|
|
813
|
+
};
|
|
814
|
+
var ce = 0, Ce = 0, Be = 0, De = [], Re = 0;
|
|
815
|
+
function pt() {
|
|
816
|
+
if (Re) {
|
|
817
|
+
for (var e = 0; e < De.length; e++)
|
|
818
|
+
n._free(De[e]);
|
|
819
|
+
De.length = 0, n._free(ce), ce = 0, Ce += Re, Re = 0;
|
|
820
|
+
}
|
|
821
|
+
ce || (Ce += 128, (ce = n._malloc(Ce)) || se(void 0)), Be = 0;
|
|
822
|
+
}
|
|
823
|
+
function ht(e, t) {
|
|
824
|
+
return ce || se(void 0), e = e.length * t.BYTES_PER_ELEMENT, e = e + 7 & -8, Be + e >= Ce ? (0 < e || se(void 0), Re += e, t = n._malloc(e), De.push(t)) : (t = ce + Be, Be += e), t;
|
|
825
|
+
}
|
|
826
|
+
function yt(e, t, r) {
|
|
827
|
+
switch (r >>>= 0, t.BYTES_PER_ELEMENT) {
|
|
828
|
+
case 2:
|
|
829
|
+
r >>>= 1;
|
|
830
|
+
break;
|
|
831
|
+
case 4:
|
|
832
|
+
r >>>= 2;
|
|
833
|
+
break;
|
|
834
|
+
case 8:
|
|
835
|
+
r >>>= 3;
|
|
836
|
+
}
|
|
837
|
+
for (var i = 0; i < e.length; i++)
|
|
838
|
+
t[r + i] = e[i];
|
|
839
|
+
}
|
|
840
|
+
function Et(e) {
|
|
841
|
+
if (typeof e == "object") {
|
|
842
|
+
var t = ht(e, ge);
|
|
843
|
+
return yt(e, ge, t), t;
|
|
844
|
+
}
|
|
845
|
+
return e;
|
|
846
|
+
}
|
|
847
|
+
function ne() {
|
|
848
|
+
throw "cannot construct a VoidPtr, no constructor in IDL";
|
|
849
|
+
}
|
|
850
|
+
ne.prototype = Object.create(G.prototype), ne.prototype.constructor = ne, ne.prototype.T = ne, ne.W = {}, n.VoidPtr = ne, ne.prototype.__destroy__ = function() {
|
|
851
|
+
ot(this.R);
|
|
852
|
+
};
|
|
853
|
+
function Z() {
|
|
854
|
+
throw "cannot construct a McObject, no constructor in IDL";
|
|
855
|
+
}
|
|
856
|
+
Z.prototype = Object.create(G.prototype), Z.prototype.constructor = Z, Z.prototype.T = Z, Z.W = {}, n.McObject = Z, Z.prototype.updateDisplay = function(e, t) {
|
|
857
|
+
var r = this.R;
|
|
858
|
+
return pt(), typeof e == "object" && (e = Et(e)), typeof t == "object" && (t = Et(t)), !!st(r, e, t);
|
|
859
|
+
}, Z.prototype.test = Z.prototype.test = function() {
|
|
860
|
+
ut(this.R);
|
|
861
|
+
};
|
|
862
|
+
function Q() {
|
|
863
|
+
this.R = at(), Me(Q)[this.R] = this;
|
|
864
|
+
}
|
|
865
|
+
return Q.prototype = Object.create(G.prototype), Q.prototype.constructor = Q, Q.prototype.T = Q, Q.W = {}, n.McApp = Q, Q.prototype.Init = function() {
|
|
866
|
+
ct(this.R);
|
|
867
|
+
}, Q.prototype.CreateMxDraw = function(e, t, r) {
|
|
868
|
+
var i = this.R;
|
|
869
|
+
if (pt(), e && typeof e == "object" && (e = e.R), t && typeof t == "object" && (t = t.R), r && typeof r == "object")
|
|
870
|
+
r = r.R;
|
|
871
|
+
else if (typeof r == "string") {
|
|
872
|
+
r = it(r);
|
|
873
|
+
var c = ht(r, K);
|
|
874
|
+
yt(r, K, c), r = c;
|
|
875
|
+
}
|
|
876
|
+
return Pe(lt(i, e, t, r), Z);
|
|
877
|
+
}, Q.prototype.__destroy__ = function() {
|
|
878
|
+
ft(this.R);
|
|
879
|
+
}, l.ready;
|
|
880
|
+
};
|
|
881
|
+
})();
|
|
882
|
+
return typeof exports == "object" && typeof module == "object" ? module.exports = o : typeof define == "function" && define.amd ? define([], function() {
|
|
883
|
+
return o;
|
|
884
|
+
}) : typeof exports == "object" && (exports.mxdrawassembly = o), o();
|
|
885
|
+
}
|
|
886
|
+
async function qt() {
|
|
887
|
+
const o = new ie();
|
|
888
|
+
o.setMessage(`
|
|
889
|
+
\u6307\u5B9A\u63D2\u5165\u4F4D\u7F6E:`);
|
|
890
|
+
let s = await o.go();
|
|
891
|
+
if (s == null)
|
|
892
|
+
return;
|
|
893
|
+
let l = "\u6D4B\u8BD5";
|
|
894
|
+
if (l.length <= 0)
|
|
895
|
+
return;
|
|
896
|
+
let n = I.screenCoordLong2Doc(50);
|
|
897
|
+
l = Ve.b64Encode(l);
|
|
898
|
+
const f = {
|
|
899
|
+
postx: s.x,
|
|
900
|
+
posty: s.y,
|
|
901
|
+
text: l,
|
|
902
|
+
height: n
|
|
903
|
+
};
|
|
904
|
+
I.call("Mx_Text", f);
|
|
905
|
+
}
|
|
906
|
+
class Nt extends mt {
|
|
907
|
+
getGripPoints() {
|
|
908
|
+
const { x: s, y: l, z: n } = this.center;
|
|
909
|
+
let f = new THREE.Vector3(s, l + this.radius, n), _ = new THREE.Vector3(s, l - this.radius, n), p = new THREE.Vector3(s - this.radius, l, n), E = new THREE.Vector3(s + this.radius, l, n);
|
|
910
|
+
return [this.center, f, _, p, E];
|
|
911
|
+
}
|
|
912
|
+
moveGripPointsAt(s, l) {
|
|
913
|
+
const [n, f, _, p, E] = this.getGripPoints();
|
|
914
|
+
return s === 0 && (this.center = n.add(l)), s === 1 && (this.radius = f.add(l).distanceTo(this.center)), s === 2 && (this.radius = _.add(l).distanceTo(this.center)), s === 3 && (this.radius = p.add(l).distanceTo(this.center)), s === 4 && (this.radius = E.add(l).distanceTo(this.center)), !0;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
const gt = (o) => {
|
|
918
|
+
const [s, l, n] = o, { x: f, y: _, z: p } = s, { x: E, y: m, z: y } = l, { x: w, y: D, z: R } = n, A = _ * y - m * p - _ * R + D * p + m * R - D * y, v = -(f * y - E * p - f * R + w * p + E * R - w * y), T = f * m - E * _ - f * D + w * _ + E * D - w * m, H = -(f * m * R - f * D * y - E * _ * R + E * D * p + w * _ * y - w * m * p), b = 2 * (E - f), j = 2 * (m - _), O = 2 * (y - p), X = f * f + _ * _ + p * p - E * E - m * m - y * y, V = 2 * (w - f), N = 2 * (D - _), z = 2 * (R - p), q = f * f + _ * _ + p * p - w * w - D * D - R * R, ue = -(v * O * q - v * z * X - j * T * q + j * z * H + N * T * X - N * O * H) / (A * j * z - A * N * O - b * v * z + b * N * T + V * v * O - V * j * T), he = (A * O * q - A * z * X - b * T * q + b * z * H + V * T * X - V * O * H) / (A * j * z - A * N * O - b * v * z + b * N * T + V * v * O - V * j * T), ye = -(A * j * q - A * N * X - b * v * q + b * N * H + V * v * X - V * j * H) / (A * j * z - A * N * O - b * v * z + b * N * T + V * v * O - V * j * T);
|
|
919
|
+
return new THREE.Vector3(ue, he, ye);
|
|
920
|
+
};
|
|
921
|
+
function zt() {
|
|
922
|
+
const o = new ie();
|
|
923
|
+
let s = new Nt();
|
|
924
|
+
le.use(s), s.closed = !1;
|
|
925
|
+
let l = 0, n = "default", f = !0;
|
|
926
|
+
const _ = () => {
|
|
927
|
+
o.setUserDraw(
|
|
928
|
+
(A, v) => {
|
|
929
|
+
s.radius = f ? s.center.distanceTo(A) : s.center.distanceTo(A) / 2, v.drawCustomEntity(s), v.drawLine(s.center, A);
|
|
930
|
+
}
|
|
931
|
+
);
|
|
932
|
+
}, p = (A) => {
|
|
933
|
+
if (n === "default") {
|
|
934
|
+
if (A === S.kOk) {
|
|
935
|
+
if (l === 0)
|
|
936
|
+
o.setMessage(`
|
|
937
|
+
\u6307\u5B9A\u5706\u7684\u534A\u5F84:`), o.setKeyWords("[\u76F4\u5F84(D)]"), s.center = o.value(), _();
|
|
938
|
+
else if (l === 1)
|
|
939
|
+
return I.getCurrentDraw().addMxEntity(s), !0;
|
|
940
|
+
l++;
|
|
941
|
+
}
|
|
942
|
+
A === S.kKeyWord && o.isKeyWordPicked("D") && (f = !1, _(), o.setMessage(`
|
|
943
|
+
\u6307\u5B9A\u5706\u7684\u76F4\u5F84:`), o.setKeyWords(""));
|
|
944
|
+
}
|
|
945
|
+
};
|
|
946
|
+
let E = [];
|
|
947
|
+
const m = (A) => {
|
|
948
|
+
if (n === "3P" && (o.setMessage(`
|
|
949
|
+
\u6307\u5B9A\u5706\u4E0A\u7684\u7B2C\u4E00\u4E2A\u70B9:`), A === S.kOk)) {
|
|
950
|
+
if (l === 0 && (E.push(o.value()), o.setUserDraw((v, T) => {
|
|
951
|
+
T.drawLine(E[0], v);
|
|
952
|
+
}), o.setMessage(`
|
|
953
|
+
\u6307\u5B9A\u5706\u4E0A\u7684\u7B2C\u4E8C\u4E2A\u70B9:`)), l === 1 && (E.push(o.value()), o.setUserDraw((v, T) => {
|
|
954
|
+
const [H, b] = E, j = v;
|
|
955
|
+
s.center = gt([H, b, j]), s.radius = s.center.distanceTo(H), T.drawCustomEntity(s);
|
|
956
|
+
}), o.setMessage(`
|
|
957
|
+
\u6307\u5B9A\u5706\u4E0A\u7684\u7B2C\u4E09\u4E2A\u70B9:`)), l === 2)
|
|
958
|
+
return E.push(o.value()), s.center = gt(E), s.radius = s.center.distanceTo(E[0]), I.getCurrentDraw().addMxEntity(s), !0;
|
|
959
|
+
l++;
|
|
960
|
+
}
|
|
961
|
+
};
|
|
962
|
+
let y;
|
|
963
|
+
const w = (A, v) => {
|
|
964
|
+
new THREE.Line3(A, v).getCenter(s.center), s.radius = v.distanceTo(A) / 2;
|
|
965
|
+
}, D = (A) => {
|
|
966
|
+
if (n === "2P" && (o.setMessage(`
|
|
967
|
+
\u6307\u5B9A\u5706\u76F4\u5F84\u7684\u7B2C\u4E00\u4E2A\u7AEF\u70B9:`), A === S.kOk)) {
|
|
968
|
+
if (l === 0 && (y = o.value(), o.setUserDraw((v, T) => {
|
|
969
|
+
w(y, v), T.drawCustomEntity(s), T.drawLine(y, v);
|
|
970
|
+
}), o.setMessage(`
|
|
971
|
+
\u6307\u5B9A\u5706\u76F4\u5F84\u7684\u7B2C\u4E8C\u4E2A\u7AEF\u70B9:`)), l === 1)
|
|
972
|
+
return w(y, o.value()), I.getCurrentDraw().addMxEntity(s), !0;
|
|
973
|
+
l++;
|
|
974
|
+
}
|
|
975
|
+
}, R = (A) => {
|
|
976
|
+
if (n === "T") {
|
|
977
|
+
if (o.setMessage(`
|
|
978
|
+
\u6307\u5B9A\u5BF9\u8C61\u4E0E\u5706\u7684\u7B2C\u4E00\u4E2A\u5207\u70B9:`), A === S.kOk) {
|
|
979
|
+
if (l === 0) {
|
|
980
|
+
const v = o.value();
|
|
981
|
+
console.log(v), I.getCurrentDraw();
|
|
982
|
+
}
|
|
983
|
+
l++;
|
|
984
|
+
}
|
|
985
|
+
return !0;
|
|
986
|
+
}
|
|
987
|
+
};
|
|
988
|
+
o.setMessage(`
|
|
989
|
+
\u6307\u5B9A\u5706\u7684\u5706\u5FC3\u6216[\u4E09\u70B9(3P)/\u4E24\u70B9(2P)/\u5207\u70B9\u3001\u5207\u70B9\u3001\u534A\u5F84(T)]:`), o.setKeyWords("3P 2P T"), o.goWhile((A) => {
|
|
990
|
+
if (A === S.kKeyWord && (o.isKeyWordPicked("3P") ? n = "3P" : o.isKeyWordPicked("2P") ? n = "2P" : o.isKeyWordPicked("T") && (n = "T")), p(A))
|
|
991
|
+
return { exit: !0 };
|
|
992
|
+
if (m(A))
|
|
993
|
+
return { exit: !0 };
|
|
994
|
+
if (D(A))
|
|
995
|
+
return { exit: !0 };
|
|
996
|
+
if (R(A))
|
|
997
|
+
return { exit: !0 };
|
|
998
|
+
}, (A) => {
|
|
999
|
+
A === S.kCancel && I.getCurrentDraw().addMxEntity(s);
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
1002
|
+
Ke.events.on("MxDbEntityRegister", () => {
|
|
1003
|
+
I.addCommand("Mx_Circle", zt);
|
|
1004
|
+
});
|
|
1005
|
+
const _t = () => Ke.state.MxFun.stopRunCommand();
|
|
1006
|
+
function pe(o, s, l, n) {
|
|
1007
|
+
const f = o - l, _ = s - n;
|
|
1008
|
+
let p = 0;
|
|
1009
|
+
return f == 0 ? p = Math.PI / 2 : p = Math.atan(Math.abs(_ / f)), f < 0 && _ >= 0 ? p = Math.PI - p : f < 0 && _ < 0 ? p = Math.PI + p : f >= 0 && _ < 0 && (p = Math.PI * 2 - p), p;
|
|
1010
|
+
}
|
|
1011
|
+
async function Gt() {
|
|
1012
|
+
const o = new ie();
|
|
1013
|
+
let s = new je(), l = [];
|
|
1014
|
+
o.setMessage(`
|
|
1015
|
+
\u6307\u5B9A\u7B2C\u4E00\u70B9:`);
|
|
1016
|
+
let n = await o.go();
|
|
1017
|
+
o.setUserDraw((_, p) => {
|
|
1018
|
+
l.forEach((E) => {
|
|
1019
|
+
p.drawCustomEntity(E);
|
|
1020
|
+
}), p.drawLine(n, _);
|
|
1021
|
+
});
|
|
1022
|
+
const f = () => {
|
|
1023
|
+
o.setMessage(`
|
|
1024
|
+
\u6307\u5B9A\u4E0B\u4E00\u4E2A\u70B9:`), l.length > 1 ? o.setKeyWords("[\u9000\u51FA(E)/\u95ED\u5408(C)/\u653E\u5F03(U)]") : o.setKeyWords("[\u9000\u51FA(E)/\u653E\u5F03(U)]");
|
|
1025
|
+
};
|
|
1026
|
+
f(), o.goWhile((_) => {
|
|
1027
|
+
if (_ === S.kOk && (s = new je(), le.use(s), s.pt1 = n, s.pt2 = o.value(), n = s.pt2.clone(), l.push(s), f()), _ === S.kKeyWord)
|
|
1028
|
+
if (o.isKeyWordPicked("E"))
|
|
1029
|
+
_t();
|
|
1030
|
+
else if (o.isKeyWordPicked("C")) {
|
|
1031
|
+
const p = new je();
|
|
1032
|
+
return p.pt1 = n.clone(), p.pt2 = l[0].pt1.clone(), le.use(p), l.push(p), n = p.pt2.clone(), _t(), { exit: !0 };
|
|
1033
|
+
} else
|
|
1034
|
+
o.isKeyWordPicked("U") && l.length > 0 && (n = l.pop()?.pt1.clone());
|
|
1035
|
+
}, (_) => {
|
|
1036
|
+
if (_ === S.kCancel)
|
|
1037
|
+
return l.forEach((p) => {
|
|
1038
|
+
I.getCurrentDraw().addMxEntity(p);
|
|
1039
|
+
}), { exit: !0 };
|
|
1040
|
+
});
|
|
1041
|
+
}
|
|
1042
|
+
Ke.events.on("MxDbEntityRegister", () => {
|
|
1043
|
+
I.addCommand("Mx_Line", Gt);
|
|
1044
|
+
});
|
|
1045
|
+
async function Ut() {
|
|
1046
|
+
const o = new ie();
|
|
1047
|
+
o.setMessage(`
|
|
1048
|
+
\u6307\u5B9A\u63D2\u5165\u4F4D\u7F6E:`);
|
|
1049
|
+
let s = await o.go();
|
|
1050
|
+
if (s == null)
|
|
1051
|
+
return;
|
|
1052
|
+
let l = `\u6D4B\u8BD5
|
|
1053
|
+
\u6D4B\u8BD5`;
|
|
1054
|
+
if (l.length <= 0)
|
|
1055
|
+
return;
|
|
1056
|
+
let n = I.screenCoordLong2Doc(50);
|
|
1057
|
+
l = Ve.b64Encode(l);
|
|
1058
|
+
const f = {
|
|
1059
|
+
postx: s.x,
|
|
1060
|
+
posty: s.y,
|
|
1061
|
+
text: l,
|
|
1062
|
+
height: n
|
|
1063
|
+
};
|
|
1064
|
+
I.call("Mx_MText", f);
|
|
1065
|
+
}
|
|
1066
|
+
async function en() {
|
|
1067
|
+
const o = new ie(), s = new Ot();
|
|
1068
|
+
le.use(s), o.setMessage(`
|
|
1069
|
+
\u6307\u5B9A\u8D77\u70B9:`);
|
|
1070
|
+
let l;
|
|
1071
|
+
o.setUserDraw((n, f) => {
|
|
1072
|
+
f.drawCustomEntity(s), l && f.drawLine(l, n);
|
|
1073
|
+
}), o.goWhile((n) => {
|
|
1074
|
+
if (n === S.kOk) {
|
|
1075
|
+
const f = o.value();
|
|
1076
|
+
s.points.push(o.value()), l = f, o.setMessage(`
|
|
1077
|
+
\u6307\u5B9A\u4E0B\u4E00\u4E2A\u70B9:`), o.setKeyWords("[\u5706\u5F27(A)/\u5BBD\u5EA6(W)]");
|
|
1078
|
+
} else
|
|
1079
|
+
n === S.kKeyWord && (o.isKeyWordPicked("A"), o.isKeyWordPicked("W"));
|
|
1080
|
+
}, (n) => {
|
|
1081
|
+
n === S.kCancel && I.getCurrentDraw().addMxEntity(s);
|
|
1082
|
+
});
|
|
1083
|
+
}
|
|
1084
|
+
async function tn() {
|
|
1085
|
+
const o = new ie();
|
|
1086
|
+
let s = new Kt();
|
|
1087
|
+
le.use(s), o.setMessage(`
|
|
1088
|
+
\u8F93\u5165\u8FB9\u7684\u6570\u76EE<5>:`);
|
|
1089
|
+
let l = 3, n = [l];
|
|
1090
|
+
for (; l < 25; )
|
|
1091
|
+
n.push(l++);
|
|
1092
|
+
o.setKeyWords(n.join(" "));
|
|
1093
|
+
let f = 0;
|
|
1094
|
+
o.goWhile((_) => {
|
|
1095
|
+
if (_ === S.kOk)
|
|
1096
|
+
if (f === 1)
|
|
1097
|
+
s.centerPoint = o.value(), o.setMessage(`
|
|
1098
|
+
[\u5185\u63A5\u4E8E\u5706(I)/\u5916\u5207\u4E8E\u5706(C)]<\u5916\u5207>:`), o.setKeyWords("I C");
|
|
1099
|
+
else if (f === 2)
|
|
1100
|
+
o.setMessage(`
|
|
1101
|
+
\u6307\u5B9A\u8FB9\u7684\u7B2C\u4E8C\u4E2A\u7AEF\u70B9:`), f++;
|
|
1102
|
+
else {
|
|
1103
|
+
if (f === 3)
|
|
1104
|
+
return o.setMessage(`
|
|
1105
|
+
\u6307\u5B9A\u8FB9\u7684\u7B2C\u4E8C\u4E2A\u7AEF\u70B9:`), { exit: !0 };
|
|
1106
|
+
if (f === 4)
|
|
1107
|
+
return s.otherPoint = o.value(), I.getCurrentDraw().addMxEntity(s), { exit: !0 };
|
|
1108
|
+
f === 5 && o.setMessage(`
|
|
1109
|
+
\u5916\u5207\u4E8E\u5706(C)\u65E0\u6CD5\u7ED8\u5236:`);
|
|
1110
|
+
}
|
|
1111
|
+
if (_ === S.kKeyWord) {
|
|
1112
|
+
const p = o.keyWordPicked(), E = Number(p);
|
|
1113
|
+
!Number.isNaN(E) && f === 0 && (s.sidesNumber = E, o.setMessage(`
|
|
1114
|
+
\u6307\u5B9A\u6B63\u591A\u8FB9\u5F62\u7684\u4E2D\u5FC3\u70B9\u6216 [\u8FB9(E)]:`), o.setKeyWords("E"), f++), f === 1 && (o.isKeyWordPicked("E") && (o.setMessage(`
|
|
1115
|
+
\u6307\u5B9A\u8FB9\u7684\u7B2C\u4E00\u4E2A\u7AEF\u70B9:`), f++), o.isKeyWordPicked("I") ? (o.setUserDraw((m, y) => {
|
|
1116
|
+
s.otherPoint = m, y.drawCustomEntity(s);
|
|
1117
|
+
}), o.setMessage(`
|
|
1118
|
+
\u6307\u5B9A\u5706\u7684\u534A\u5F84:`), f++, f++, f++) : o.isKeyWordPicked("C") && (o.setMessage(`
|
|
1119
|
+
\u5916\u5207\u4E8E\u5706(C)\u65E0\u6CD5\u7ED8\u5236:`), f++, f++, f++, f++));
|
|
1120
|
+
}
|
|
1121
|
+
});
|
|
1122
|
+
}
|
|
1123
|
+
function Xt(o, s, l) {
|
|
1124
|
+
const n = o.x, f = s.x, _ = l.x, p = o.y, E = s.y, m = l.y, y = n - f, w = p - E, D = n - _, R = p - m, A = (n * n - f * f + (p * p - E * E)) / 2, v = (n * n - _ * _ + (p * p - m * m)) / 2, T = w * D - y * R, H = -(R * A - w * v) / T, b = -(y * v - D * A) / T;
|
|
1125
|
+
return new THREE.Vector3(H, b, 0);
|
|
1126
|
+
}
|
|
1127
|
+
function $t(o, s) {
|
|
1128
|
+
const l = o.x, n = o.y, f = s.x, _ = s.y;
|
|
1129
|
+
return Math.sqrt((l - f) * (l - f) + (n - _) * (n - _));
|
|
1130
|
+
}
|
|
1131
|
+
function Yt(o, s, l) {
|
|
1132
|
+
let n;
|
|
1133
|
+
o < l ? n = l - o : n = l - o + 360;
|
|
1134
|
+
let f;
|
|
1135
|
+
return o < s ? f = s - o : f = s - o + 360, f > n;
|
|
1136
|
+
}
|
|
1137
|
+
function Oe(o, s, l) {
|
|
1138
|
+
const n = o.x, f = s.x, _ = o.y, p = s.y;
|
|
1139
|
+
let E, m, y;
|
|
1140
|
+
return E = (_ - p) / l, m = (n - f) / l, m >= 0.99999 && (m = 0.99999), m <= -0.99999 && (m = -0.99999), y = Math.acos(m), y = y / Math.PI * 180, E < -0.05 && (y = 360 - y), {
|
|
1141
|
+
sin: E,
|
|
1142
|
+
cos: m,
|
|
1143
|
+
angle: y
|
|
1144
|
+
};
|
|
1145
|
+
}
|
|
1146
|
+
const de = (o, s, l) => {
|
|
1147
|
+
const n = () => {
|
|
1148
|
+
o.go((f) => {
|
|
1149
|
+
if (f === S.kKeyWord && l() && n(), f === S.kOk && s() && n(), f === S.kNone && n(), f === S.kCancel)
|
|
1150
|
+
return { exit: !0 };
|
|
1151
|
+
});
|
|
1152
|
+
};
|
|
1153
|
+
return n;
|
|
1154
|
+
};
|
|
1155
|
+
class ke extends mt {
|
|
1156
|
+
bulge = 0;
|
|
1157
|
+
constructor() {
|
|
1158
|
+
super(), this._propertyDbKeys = [...this._propertyDbKeys, "bulge"];
|
|
1159
|
+
}
|
|
1160
|
+
getTypeName() {
|
|
1161
|
+
return "MxDbCircle";
|
|
1162
|
+
}
|
|
1163
|
+
create() {
|
|
1164
|
+
return new ke();
|
|
1165
|
+
}
|
|
1166
|
+
getArcBulge(s, l, n) {
|
|
1167
|
+
const f = s.distanceTo(l);
|
|
1168
|
+
let E = 2 * new THREE.Line3(s, l).getCenter(new THREE.Vector3()).distanceTo(n) / f;
|
|
1169
|
+
return E > 0.9999 && E < 1.0001 ? E = 1 : E < -0.9999 && E > -1.0001 ? E = -1 : Math.abs(E) < 1e-10 && (E = 0), E;
|
|
1170
|
+
}
|
|
1171
|
+
getArcMidPoint(s, l, n, f, _) {
|
|
1172
|
+
const p = s, E = n * Math.PI / 180;
|
|
1173
|
+
let m = f * Math.PI / 180;
|
|
1174
|
+
const y = new THREE.Vector3(), w = new THREE.Vector3();
|
|
1175
|
+
y.x = p.x + l * Math.cos(E), y.y = p.y + l * Math.sin(E), w.x = p.x + l * Math.cos(m), w.y = p.y + l * Math.sin(m);
|
|
1176
|
+
const D = l;
|
|
1177
|
+
(_ ? n < f : n > f) && (m += Math.PI * 2);
|
|
1178
|
+
const R = new THREE.Vector3();
|
|
1179
|
+
return R.x = p.x + D * Math.cos((E + m) / 2), R.y = p.y + D * Math.sin((E + m) / 2), this.bulge = this.getArcBulge(y, w, R), [y, R, w, this.center];
|
|
1180
|
+
}
|
|
1181
|
+
getGripPoints() {
|
|
1182
|
+
return this.getArcMidPoint(this.center, this.radius, THREE.MathUtils.radToDeg(this.startAngle), THREE.MathUtils.radToDeg(this.endAngle), this.clockwise);
|
|
1183
|
+
}
|
|
1184
|
+
moveGripPointsAt(s, l) {
|
|
1185
|
+
if (s === 3)
|
|
1186
|
+
return this.center.add(l), !0;
|
|
1187
|
+
const n = this.getGripPoints();
|
|
1188
|
+
return this.upDatePoints(n, s, l), !0;
|
|
1189
|
+
}
|
|
1190
|
+
upDatePoints(s, l, n) {
|
|
1191
|
+
s[l].add(n);
|
|
1192
|
+
const [f, _, p] = s;
|
|
1193
|
+
this.center = Xt(f, p, _), this.radius = $t(_, this.center);
|
|
1194
|
+
const E = Oe(f, this.center, this.radius), m = Oe(p, this.center, this.radius), y = Oe(_, this.center, this.radius);
|
|
1195
|
+
this.clockwise = Yt(m.angle, E.angle, y.angle), this.startAngle = THREE.MathUtils.degToRad(E.angle), this.endAngle = THREE.MathUtils.degToRad(m.angle);
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
function Zt() {
|
|
1199
|
+
const o = new ie(), s = new ke();
|
|
1200
|
+
s.closed = !1, o.go(() => {
|
|
1201
|
+
s.center = o.value(), o.setUserDraw((l, n) => {
|
|
1202
|
+
s.startAngle = pe(l.x, l.y, s.center.x, s.center.y), s.radius = s.center.distanceTo(l), n.drawLine(l, s.center);
|
|
1203
|
+
}), o.go(() => {
|
|
1204
|
+
o.setUserDraw((l, n) => {
|
|
1205
|
+
s.endAngle = pe(l.x, l.y, s.center.x, s.center.y), n.drawLine(l, s.center), n.drawCustomEntity(s);
|
|
1206
|
+
}), o.go(() => {
|
|
1207
|
+
I.getCurrentDraw().addMxEntity(s);
|
|
1208
|
+
});
|
|
1209
|
+
});
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
async function nn() {
|
|
1213
|
+
return Zt();
|
|
1214
|
+
}
|
|
1215
|
+
function rn() {
|
|
1216
|
+
const o = new ie(), s = new Vt();
|
|
1217
|
+
s.closed = !1, le.use(s), o.setMessage(`
|
|
1218
|
+
\u6307\u5B9A\u692D\u5706\u7684\u8F74\u7AEF\u70B9`), o.setKeyWords("[\u4E2D\u5FC3\u70B9(C)]");
|
|
1219
|
+
let l, n = new THREE.Vector3();
|
|
1220
|
+
de(o, () => {
|
|
1221
|
+
l = o.value(), o.setUserDraw((y, w) => {
|
|
1222
|
+
const D = new THREE.Line3(l, y);
|
|
1223
|
+
D.getCenter(n), s.center = n, s.xRadius = D.distance() / 2, s.yRadius = s.xRadius, s.rotation = pe(y.x, y.y, n.x, n.y), w.drawLine(y, l);
|
|
1224
|
+
}), o.setMessage(`
|
|
1225
|
+
\u6307\u5B9A\u692D\u5706\u5F27\u8F74\u7684\u53E6\u4E00\u4E2A\u7AEF\u70B9:`), o.setKeyWords(""), _();
|
|
1226
|
+
}, () => {
|
|
1227
|
+
})();
|
|
1228
|
+
const _ = de(o, () => {
|
|
1229
|
+
o.setUserDraw((y, w) => {
|
|
1230
|
+
s.yRadius = n.distanceTo(y), w.drawLine(n, y), w.drawCustomEntity(s);
|
|
1231
|
+
}), o.setMessage(`
|
|
1232
|
+
\u6307\u5B9A\u53E6\u4E00\u6761\u534A\u8F74\u957F\u5EA6`), o.setKeyWords(""), p();
|
|
1233
|
+
}, () => {
|
|
1234
|
+
}), p = de(o, () => {
|
|
1235
|
+
o.setMessage(`
|
|
1236
|
+
\u6307\u5B9A\u8D77\u59CB\u89D2\u5EA6`), o.setKeyWords(""), o.setUserDraw((y, w) => {
|
|
1237
|
+
s.startAngle = pe(y.x, y.y, n.x, n.y) - s.rotation, w.drawLine(n, y), w.drawCustomEntity(s);
|
|
1238
|
+
}), E();
|
|
1239
|
+
}, () => {
|
|
1240
|
+
}), E = de(o, () => {
|
|
1241
|
+
o.setUserDraw((y, w) => {
|
|
1242
|
+
s.endAngle = pe(y.x, y.y, n.x, n.y) - s.rotation, w.drawLine(n, y), w.drawCustomEntity(s);
|
|
1243
|
+
}), o.setMessage(`
|
|
1244
|
+
\u6307\u5B9A\u7EC8\u6B62\u89D2\u5EA6`), o.setKeyWords(""), m();
|
|
1245
|
+
}, () => {
|
|
1246
|
+
}), m = de(o, () => {
|
|
1247
|
+
I.getCurrentDraw().addMxEntity(s);
|
|
1248
|
+
}, () => {
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1251
|
+
let xt;
|
|
1252
|
+
function on(o) {
|
|
1253
|
+
console.log(new URL(document.location.href).href), Ht().then((s) => {
|
|
1254
|
+
let l = new s.McApp();
|
|
1255
|
+
l.Init(), xt = s, xt.McApp = l, o();
|
|
1256
|
+
});
|
|
1257
|
+
}
|
|
1258
|
+
export {
|
|
1259
|
+
xt as MxCpp,
|
|
1260
|
+
nn as drawArc,
|
|
1261
|
+
zt as drawCircle,
|
|
1262
|
+
rn as drawEllipticalArc,
|
|
1263
|
+
Gt as drawLine,
|
|
1264
|
+
Ut as drawMText,
|
|
1265
|
+
en as drawPolyLine,
|
|
1266
|
+
tn as drawPolygon,
|
|
1267
|
+
qt as drawText,
|
|
1268
|
+
on as loadMxdrawassembly,
|
|
1269
|
+
Jt as tools
|
|
1270
|
+
};
|