@mlightcad/data-model 1.3.12 → 1.3.13
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/data-model.js
CHANGED
|
@@ -965,7 +965,7 @@ function Jh(i, t) {
|
|
|
965
965
|
function tu(i) {
|
|
966
966
|
return i == null ? !0 : Array.isArray(i) || typeof i == "string" ? i.length === 0 : i instanceof Map || i instanceof Set ? i.size === 0 : typeof i == "object" ? Object.keys(i).length === 0 : !1;
|
|
967
967
|
}
|
|
968
|
-
function
|
|
968
|
+
function Is(i, t) {
|
|
969
969
|
if (i === t)
|
|
970
970
|
return !0;
|
|
971
971
|
if (i == null || t == null)
|
|
@@ -980,7 +980,7 @@ function Ps(i, t) {
|
|
|
980
980
|
if (i.length !== t.length)
|
|
981
981
|
return !1;
|
|
982
982
|
for (let o = 0; o < i.length; o++)
|
|
983
|
-
if (!
|
|
983
|
+
if (!Is(i[o], t[o]))
|
|
984
984
|
return !1;
|
|
985
985
|
return !0;
|
|
986
986
|
}
|
|
@@ -991,7 +991,7 @@ function Ps(i, t) {
|
|
|
991
991
|
if (!Object.prototype.hasOwnProperty.call(
|
|
992
992
|
t,
|
|
993
993
|
o
|
|
994
|
-
) || !
|
|
994
|
+
) || !Is(
|
|
995
995
|
i[o],
|
|
996
996
|
t[o]
|
|
997
997
|
))
|
|
@@ -1050,7 +1050,7 @@ let eu = class Wo {
|
|
|
1050
1050
|
this._changing = !0, x || (this._previousAttributes = Os(this.attributes), this.changed = {});
|
|
1051
1051
|
const f = this.attributes, w = this.changed, b = this._previousAttributes;
|
|
1052
1052
|
for (const E in o)
|
|
1053
|
-
e = o[E],
|
|
1053
|
+
e = o[E], Is(f[E], e) || g.push(E), Is(b[E], e) ? delete w[E] : w[E] = e, h ? delete f[E] : f[E] = e;
|
|
1054
1054
|
if (!c) {
|
|
1055
1055
|
g.length && (this._pending = s);
|
|
1056
1056
|
for (let E = 0; E < g.length; E++)
|
|
@@ -1092,7 +1092,7 @@ let eu = class Wo {
|
|
|
1092
1092
|
const e = this._changing ? this._previousAttributes : this.attributes, s = {};
|
|
1093
1093
|
for (const o in t) {
|
|
1094
1094
|
const h = t[o];
|
|
1095
|
-
|
|
1095
|
+
Is(e[o], h) || (s[o] = h);
|
|
1096
1096
|
}
|
|
1097
1097
|
return s;
|
|
1098
1098
|
}
|
|
@@ -1919,7 +1919,7 @@ class ua {
|
|
|
1919
1919
|
}
|
|
1920
1920
|
}
|
|
1921
1921
|
const $o = "Load Database";
|
|
1922
|
-
class
|
|
1922
|
+
class Ie extends ru {
|
|
1923
1923
|
constructor(t, e) {
|
|
1924
1924
|
super(t.stage), this.data = t, this.progress = e;
|
|
1925
1925
|
}
|
|
@@ -1991,7 +1991,7 @@ class Zo {
|
|
|
1991
1991
|
Ho.getInstance().collect(h), this.progress = o;
|
|
1992
1992
|
const c = { value: 0 }, g = new nu();
|
|
1993
1993
|
g.setCompleteCallback(() => this.onFinished()), g.setErrorCallback((f) => this.onError(f)), g.addTask(
|
|
1994
|
-
new
|
|
1994
|
+
new Ie(
|
|
1995
1995
|
{
|
|
1996
1996
|
stage: "START",
|
|
1997
1997
|
step: 1,
|
|
@@ -2001,7 +2001,7 @@ class Zo {
|
|
|
2001
2001
|
o
|
|
2002
2002
|
)
|
|
2003
2003
|
), g.addTask(
|
|
2004
|
-
new
|
|
2004
|
+
new Ie(
|
|
2005
2005
|
{
|
|
2006
2006
|
stage: "PARSE",
|
|
2007
2007
|
step: 5,
|
|
@@ -2011,7 +2011,7 @@ class Zo {
|
|
|
2011
2011
|
o
|
|
2012
2012
|
)
|
|
2013
2013
|
), g.addTask(
|
|
2014
|
-
new
|
|
2014
|
+
new Ie(
|
|
2015
2015
|
{
|
|
2016
2016
|
stage: "FONT",
|
|
2017
2017
|
step: 5,
|
|
@@ -2024,7 +2024,7 @@ class Zo {
|
|
|
2024
2024
|
o
|
|
2025
2025
|
)
|
|
2026
2026
|
), g.addTask(
|
|
2027
|
-
new
|
|
2027
|
+
new Ie(
|
|
2028
2028
|
{
|
|
2029
2029
|
stage: "LTYPE",
|
|
2030
2030
|
step: 1,
|
|
@@ -2034,7 +2034,7 @@ class Zo {
|
|
|
2034
2034
|
o
|
|
2035
2035
|
)
|
|
2036
2036
|
), g.addTask(
|
|
2037
|
-
new
|
|
2037
|
+
new Ie(
|
|
2038
2038
|
{
|
|
2039
2039
|
stage: "STYLE",
|
|
2040
2040
|
step: 1,
|
|
@@ -2044,7 +2044,7 @@ class Zo {
|
|
|
2044
2044
|
o
|
|
2045
2045
|
)
|
|
2046
2046
|
), g.addTask(
|
|
2047
|
-
new
|
|
2047
|
+
new Ie(
|
|
2048
2048
|
{
|
|
2049
2049
|
stage: "DIMSTYLE",
|
|
2050
2050
|
step: 1,
|
|
@@ -2054,7 +2054,7 @@ class Zo {
|
|
|
2054
2054
|
o
|
|
2055
2055
|
)
|
|
2056
2056
|
), g.addTask(
|
|
2057
|
-
new
|
|
2057
|
+
new Ie(
|
|
2058
2058
|
{
|
|
2059
2059
|
stage: "LAYER",
|
|
2060
2060
|
step: 1,
|
|
@@ -2064,7 +2064,7 @@ class Zo {
|
|
|
2064
2064
|
o
|
|
2065
2065
|
)
|
|
2066
2066
|
), g.addTask(
|
|
2067
|
-
new
|
|
2067
|
+
new Ie(
|
|
2068
2068
|
{
|
|
2069
2069
|
stage: "VPORT",
|
|
2070
2070
|
step: 1,
|
|
@@ -2074,7 +2074,7 @@ class Zo {
|
|
|
2074
2074
|
o
|
|
2075
2075
|
)
|
|
2076
2076
|
), g.addTask(
|
|
2077
|
-
new
|
|
2077
|
+
new Ie(
|
|
2078
2078
|
{
|
|
2079
2079
|
stage: "HEADER",
|
|
2080
2080
|
step: 1,
|
|
@@ -2084,7 +2084,7 @@ class Zo {
|
|
|
2084
2084
|
o
|
|
2085
2085
|
)
|
|
2086
2086
|
), g.addTask(
|
|
2087
|
-
new
|
|
2087
|
+
new Ie(
|
|
2088
2088
|
{
|
|
2089
2089
|
stage: "BLOCK_RECORD",
|
|
2090
2090
|
step: 5,
|
|
@@ -2094,7 +2094,7 @@ class Zo {
|
|
|
2094
2094
|
o
|
|
2095
2095
|
)
|
|
2096
2096
|
), g.addTask(
|
|
2097
|
-
new
|
|
2097
|
+
new Ie(
|
|
2098
2098
|
{
|
|
2099
2099
|
stage: "OBJECT",
|
|
2100
2100
|
step: 5,
|
|
@@ -2104,7 +2104,7 @@ class Zo {
|
|
|
2104
2104
|
o
|
|
2105
2105
|
)
|
|
2106
2106
|
), g.addTask(
|
|
2107
|
-
new
|
|
2107
|
+
new Ie(
|
|
2108
2108
|
{
|
|
2109
2109
|
stage: "BLOCK",
|
|
2110
2110
|
step: 5,
|
|
@@ -2114,7 +2114,7 @@ class Zo {
|
|
|
2114
2114
|
o
|
|
2115
2115
|
)
|
|
2116
2116
|
), g.addTask(
|
|
2117
|
-
new
|
|
2117
|
+
new Ie(
|
|
2118
2118
|
{
|
|
2119
2119
|
stage: "ENTITY",
|
|
2120
2120
|
step: 100,
|
|
@@ -2130,7 +2130,7 @@ class Zo {
|
|
|
2130
2130
|
o
|
|
2131
2131
|
)
|
|
2132
2132
|
), g.addTask(
|
|
2133
|
-
new
|
|
2133
|
+
new Ie(
|
|
2134
2134
|
{
|
|
2135
2135
|
stage: "END",
|
|
2136
2136
|
step: 0,
|
|
@@ -2199,7 +2199,7 @@ class Zo {
|
|
|
2199
2199
|
throw new Error("Not impelemented yet!");
|
|
2200
2200
|
}
|
|
2201
2201
|
}
|
|
2202
|
-
var le, os, Qt, ne, ls, tr, ve, pr, er, $r, hs, us, Zr, Qr, cs, ds, ms, Oe, gr, Yt, Jr, ps, _t, ye, gs, xe, fs, fr, _r, rr, _s, tn, ze, vr, en, _i, vi, yr, xr, vs, ys, br, xs, yi, xi, he, wr, ue, Re, bi, wi, Ai, Si, Ar, Fe, rn, bs, nn, Be, Sr, De,
|
|
2202
|
+
var le, os, Qt, ne, ls, tr, ve, pr, er, $r, hs, us, Zr, Qr, cs, ds, ms, Oe, gr, Yt, Jr, ps, _t, ye, gs, xe, fs, fr, _r, rr, _s, tn, ze, vr, en, _i, vi, yr, xr, vs, ys, br, xs, yi, xi, he, wr, ue, Re, bi, wi, Ai, Si, Ar, Fe, rn, bs, nn, Be, Sr, De, Ir;
|
|
2203
2203
|
(le = {})[le.None = 0] = "None", le[le.Anonymous = 1] = "Anonymous", le[le.NonConstant = 2] = "NonConstant", le[le.Xref = 4] = "Xref", le[le.XrefOverlay = 8] = "XrefOverlay", le[le.ExternallyDependent = 16] = "ExternallyDependent", le[le.ResolvedOrDependent = 32] = "ResolvedOrDependent", le[le.ReferencedXref = 64] = "ReferencedXref";
|
|
2204
2204
|
(os = {})[os.BYBLOCK = 0] = "BYBLOCK", os[os.BYLAYER = 256] = "BYLAYER";
|
|
2205
2205
|
(Qt = {})[Qt.Rotated = 0] = "Rotated", Qt[Qt.Aligned = 1] = "Aligned", Qt[Qt.Angular = 2] = "Angular", Qt[Qt.Diameter = 3] = "Diameter", Qt[Qt.Radius = 4] = "Radius", Qt[Qt.Angular3Point = 5] = "Angular3Point", Qt[Qt.Ordinate = 6] = "Ordinate", Qt[Qt.ReferenceIsExclusive = 32] = "ReferenceIsExclusive", Qt[Qt.IsOrdinateXTypeFlag = 64] = "IsOrdinateXTypeFlag", Qt[Qt.IsCustomTextPositionFlag = 128] = "IsCustomTextPositionFlag";
|
|
@@ -2270,10 +2270,10 @@ function xt(i, t) {
|
|
|
2270
2270
|
if (!ot.length) throw Error("[parserGenerator::getObjectByPath] Invalid empty path");
|
|
2271
2271
|
let W = dt;
|
|
2272
2272
|
for (let ut = 0; ut < ot.length - 1; ++ut) {
|
|
2273
|
-
let st =
|
|
2273
|
+
let st = Ii(ot[ut]), Vt = Ii(ot[ut + 1]);
|
|
2274
2274
|
Object.prototype.hasOwnProperty.call(W, st) || (typeof Vt == "number" ? W[st] = [] : W[st] = {}), W = W[st];
|
|
2275
2275
|
}
|
|
2276
|
-
return [W,
|
|
2276
|
+
return [W, Ii(ot[ot.length - 1])];
|
|
2277
2277
|
}(o, b);
|
|
2278
2278
|
M && !L ? (Object.prototype.hasOwnProperty.call(D, B) || (D[B] = []), D[B].push(z)) : D[B] = z;
|
|
2279
2279
|
}
|
|
@@ -2282,7 +2282,7 @@ function xt(i, t) {
|
|
|
2282
2282
|
return t && Object.setPrototypeOf(o, t), c;
|
|
2283
2283
|
};
|
|
2284
2284
|
}
|
|
2285
|
-
function
|
|
2285
|
+
function Ii(i) {
|
|
2286
2286
|
let t = Number.parseInt(i);
|
|
2287
2287
|
return Number.isNaN(t) ? i : t;
|
|
2288
2288
|
}
|
|
@@ -2313,37 +2313,37 @@ function Qo(i, t) {
|
|
|
2313
2313
|
case 1040:
|
|
2314
2314
|
case 1070:
|
|
2315
2315
|
case 1071:
|
|
2316
|
-
h.push({ type:
|
|
2316
|
+
h.push({ type: Pr(i.code), value: i.value });
|
|
2317
2317
|
break;
|
|
2318
2318
|
case 1003:
|
|
2319
|
-
h.push({ name: "layer", type:
|
|
2319
|
+
h.push({ name: "layer", type: Pr(i.code), value: i.value });
|
|
2320
2320
|
break;
|
|
2321
2321
|
case 1005:
|
|
2322
|
-
h.push({ name: "handle", type:
|
|
2322
|
+
h.push({ name: "handle", type: Pr(i.code), value: i.value });
|
|
2323
2323
|
break;
|
|
2324
2324
|
case 1010:
|
|
2325
|
-
h.push({ type:
|
|
2325
|
+
h.push({ type: Pr(i.code), value: Rt(t) });
|
|
2326
2326
|
break;
|
|
2327
2327
|
case 1011:
|
|
2328
|
-
h.push({ name: "worldSpacePosition", type:
|
|
2328
|
+
h.push({ name: "worldSpacePosition", type: Pr(i.code), value: Rt(t) });
|
|
2329
2329
|
break;
|
|
2330
2330
|
case 1012:
|
|
2331
|
-
h.push({ name: "worldSpaceDisplacement", type:
|
|
2331
|
+
h.push({ name: "worldSpaceDisplacement", type: Pr(i.code), value: Rt(t) });
|
|
2332
2332
|
break;
|
|
2333
2333
|
case 1013:
|
|
2334
|
-
h.push({ name: "worldSpaceDirection", type:
|
|
2334
|
+
h.push({ name: "worldSpaceDirection", type: Pr(i.code), value: Rt(t) });
|
|
2335
2335
|
break;
|
|
2336
2336
|
case 1041:
|
|
2337
|
-
h.push({ name: "distance", type:
|
|
2337
|
+
h.push({ name: "distance", type: Pr(i.code), value: i.value });
|
|
2338
2338
|
break;
|
|
2339
2339
|
case 1042:
|
|
2340
|
-
h.push({ name: "scale", type:
|
|
2340
|
+
h.push({ name: "scale", type: Pr(i.code), value: i.value });
|
|
2341
2341
|
}
|
|
2342
2342
|
i = t.next();
|
|
2343
2343
|
}
|
|
2344
2344
|
return t.rewind(), e;
|
|
2345
2345
|
}
|
|
2346
|
-
function
|
|
2346
|
+
function Pr(i) {
|
|
2347
2347
|
switch (i) {
|
|
2348
2348
|
case 1e3:
|
|
2349
2349
|
case 1003:
|
|
@@ -2530,7 +2530,7 @@ function da(i, t, e) {
|
|
|
2530
2530
|
function hl(i, t, e) {
|
|
2531
2531
|
return t in i ? Object.defineProperty(i, t, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : i[t] = e, i;
|
|
2532
2532
|
}
|
|
2533
|
-
let
|
|
2533
|
+
let Iu = { textStyle: "STANDARD", extrusionDirection: { x: 0, y: 0, z: 1 }, rotation: 0 }, js = [{ code: 46, name: "annotationHeight", parser: y }, { code: 101, parser(i, t) {
|
|
2534
2534
|
(function(e) {
|
|
2535
2535
|
e.rewind();
|
|
2536
2536
|
let s = e.next();
|
|
@@ -2547,14 +2547,14 @@ class ul {
|
|
|
2547
2547
|
return this.parser(e, t, s), s;
|
|
2548
2548
|
}
|
|
2549
2549
|
constructor() {
|
|
2550
|
-
hl(this, "parser", xt(js,
|
|
2550
|
+
hl(this, "parser", xt(js, Iu));
|
|
2551
2551
|
}
|
|
2552
2552
|
}
|
|
2553
2553
|
function cl(i, t, e) {
|
|
2554
2554
|
return t in i ? Object.defineProperty(i, t, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : i[t] = e, i;
|
|
2555
2555
|
}
|
|
2556
2556
|
hl(ul, "ForEntityName", "MTEXT");
|
|
2557
|
-
let
|
|
2557
|
+
let Pu = { thickness: 0, rotation: 0, scale: 1, obliqueAngle: 0, textStyle: "STANDARD", textGenerationFlag: 0, horizontalJustification: 0, verticalJustification: 0, extrusionDirection: { x: 0, y: 0, z: 1 } }, Eu = [...js.slice(js.findIndex(({ name: i }) => i === "columnType"), js.findIndex(({ name: i }) => i === "subclassMarker") + 1), { code: 100 }, { code: 0, parser(i) {
|
|
2558
2558
|
if (!At(i, 0, "MTEXT")) return ca;
|
|
2559
2559
|
} }, { code: 2, name: "definitionTag", parser: y }, { code: 40, name: "annotationScale", parser: y }, { code: 10, name: "alignmentPoint", parser: j }, { code: 340, name: "secondaryAttributesHardId", parser: y }, { code: 70, name: "numberOfSecondaryAttributes", parser: y }, { code: 70, name: "isReallyLocked", parser: Bt }, { code: 70, name: "mtextFlag", parser: y }, { code: 280, name: "isDuplicatedEntriesKeep", parser: Bt }, { code: 100 }, { code: 280, name: "lockPositionFlag", parser: Bt }, { code: 210, name: "extrusionDirection", parser: j }, { code: 11, name: "alignmentPoint", parser: j }, { code: 74, name: "verticalJustification", parser: y }, { code: 72, name: "horizontalJustification", parser: y }, { code: 71, name: "textGenerationFlag", parser: y }, { code: 7, name: "textStyle", parser: y }, { code: 51, name: "obliqueAngle", parser: y }, { code: 41, name: "scale", parser: y }, { code: 50, name: "rotation", parser: y }, { code: 73 }, { code: 70, name: "attributeFlag", parser: y }, { code: 2, name: "tag", parser: y }, { code: 280 }, { code: 100, name: "subclassMarker", parser: y }, { code: 1, name: "text", parser: y }, { code: 40, name: "textHeight", parser: y }, { code: 10, name: "startPoint", parser: j }, { code: 39, name: "thickness", parser: y }, { code: 100 }, ...Ut];
|
|
2560
2560
|
class dl {
|
|
@@ -2563,7 +2563,7 @@ class dl {
|
|
|
2563
2563
|
return this.parser(e, t, s), s;
|
|
2564
2564
|
}
|
|
2565
2565
|
constructor() {
|
|
2566
|
-
cl(this, "parser", xt(Eu,
|
|
2566
|
+
cl(this, "parser", xt(Eu, Pu));
|
|
2567
2567
|
}
|
|
2568
2568
|
}
|
|
2569
2569
|
function ml(i, t, e) {
|
|
@@ -2754,7 +2754,7 @@ function Sl(i, t, e) {
|
|
|
2754
2754
|
return t in i ? Object.defineProperty(i, t, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : i[t] = e, i;
|
|
2755
2755
|
}
|
|
2756
2756
|
let Wu = { brightness: 50, contrast: 50, fade: 0, clippingBoundaryPath: [] }, Hu = [{ code: 290, name: "clipMode", parser: y }, { code: 14, name: "clippingBoundaryPath", isMultiple: !0, parser: j }, { code: 91, name: "countBoundaryPoints", parser: y }, { code: 71, name: "clippingBoundaryType", parser: y }, { code: 360, name: "imageDefReactorHandle", parser: y }, { code: 283, name: "fade", parser: y }, { code: 282, name: "contrast", parser: y }, { code: 281, name: "brightness", parser: y }, { code: 280, name: "isClipped", parser: Bt }, { code: 70, name: "flags", parser: y }, { code: 340, name: "imageDefHandle", parser: y }, { code: 13, name: "imageSize", parser: j }, { code: 12, name: "vPixel", parser: j }, { code: 11, name: "uPixel", parser: j }, { code: 10, name: "position", parser: j }, { code: 90, name: "version", parser: y }, { code: 100, name: "subclassMarker", parser: y }, ...Ut];
|
|
2757
|
-
class
|
|
2757
|
+
class Il {
|
|
2758
2758
|
parseEntity(t, e) {
|
|
2759
2759
|
let s = {};
|
|
2760
2760
|
return this.parser(e, t, s), s;
|
|
@@ -2763,10 +2763,10 @@ class Pl {
|
|
|
2763
2763
|
Sl(this, "parser", xt(Hu, Wu));
|
|
2764
2764
|
}
|
|
2765
2765
|
}
|
|
2766
|
-
function
|
|
2766
|
+
function Pl(i, t, e) {
|
|
2767
2767
|
return t in i ? Object.defineProperty(i, t, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : i[t] = e, i;
|
|
2768
2768
|
}
|
|
2769
|
-
Sl(
|
|
2769
|
+
Sl(Il, "ForEntityName", "IMAGE");
|
|
2770
2770
|
let Yu = { xScale: 1, yScale: 1, zScale: 1, rotation: 0, columnCount: 0, rowCount: 0, columnSpacing: 0, rowSpacing: 0, extrusionDirection: { x: 0, y: 0, z: 1 } }, qu = [{ code: 210, name: "extrusionDirection", parser: j }, { code: 45, name: "rowSpacing", parser: y }, { code: 44, name: "columnSpacing", parser: y }, { code: 71, name: "rowCount", parser: y }, { code: 70, name: "columnCount", parser: y }, { code: 50, name: "rotation", parser: y }, { code: 43, name: "zScale", parser: y }, { code: 42, name: "yScale", parser: y }, { code: 41, name: "xScale", parser: y }, { code: 10, name: "insertionPoint", parser: j }, { code: 2, name: "name", parser: y }, { code: 66, name: "isVariableAttributes", parser: Bt }, { code: 100, name: "subclassMarker", parser: y }, ...Ut];
|
|
2771
2771
|
class El {
|
|
2772
2772
|
parseEntity(t, e) {
|
|
@@ -2774,13 +2774,13 @@ class El {
|
|
|
2774
2774
|
return this.parser(e, t, s), s;
|
|
2775
2775
|
}
|
|
2776
2776
|
constructor() {
|
|
2777
|
-
|
|
2777
|
+
Pl(this, "parser", xt(qu, Yu));
|
|
2778
2778
|
}
|
|
2779
2779
|
}
|
|
2780
2780
|
function kl(i, t, e) {
|
|
2781
2781
|
return t in i ? Object.defineProperty(i, t, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : i[t] = e, i;
|
|
2782
2782
|
}
|
|
2783
|
-
|
|
2783
|
+
Pl(El, "ForEntityName", "INSERT");
|
|
2784
2784
|
let Xu = { isArrowheadEnabled: !0 }, Ku = [{ code: 213, name: "offsetFromAnnotation", parser: j }, { code: 212, name: "offsetFromBlock", parser: j }, { code: 211, name: "horizontalDirection", parser: j }, { code: 210, name: "normal", parser: j }, { code: 340, name: "associatedAnnotation", parser: y }, { code: 77, name: "byBlockColor", parser: y }, { code: 10, name: "vertices", parser: j, isMultiple: !0 }, { code: 76, name: "numberOfVertices", parser: y }, { code: 41, name: "textWidth", parser: y }, { code: 40, name: "textHeight", parser: y }, { code: 75, name: "isHooklineExists", parser: Bt }, { code: 74, name: "isHooklineSameDirection", parser: Bt }, { code: 73, name: "leaderCreationFlag", parser: y }, { code: 72, name: "isSpline", parser: Bt }, { code: 71, name: "isArrowheadEnabled", parser: Bt }, { code: 3, name: "styleName", parser: y }, { code: 100, name: "subclassMarker", parser: y }, ...Ut], Ml = class {
|
|
2785
2785
|
parseEntity(t, e) {
|
|
2786
2786
|
let s = {};
|
|
@@ -3393,7 +3393,7 @@ class sh {
|
|
|
3393
3393
|
}
|
|
3394
3394
|
}
|
|
3395
3395
|
nh(sh, "ForEntityName", "MULTILEADER");
|
|
3396
|
-
let
|
|
3396
|
+
let Ic = Object.fromEntries([rl, ll, dl, pl, fl, Ws, vl, xl, Il, El, Ml, Nl, Hs, Ll, ul, sh, zl, Bl, Ul, Gl, Wl, Yl, Xl, $l, Ys, al, Ql, Al, ma, qs, th, rh].map((i) => [i.ForEntityName, new i()]));
|
|
3397
3397
|
function ih(i, t) {
|
|
3398
3398
|
let e = [];
|
|
3399
3399
|
for (; !At(i, 0, "EOF"); ) {
|
|
@@ -3402,7 +3402,7 @@ function ih(i, t) {
|
|
|
3402
3402
|
t.rewind();
|
|
3403
3403
|
break;
|
|
3404
3404
|
}
|
|
3405
|
-
let s =
|
|
3405
|
+
let s = Ic[i.value];
|
|
3406
3406
|
if (s) {
|
|
3407
3407
|
let o = i.value;
|
|
3408
3408
|
i = t.next();
|
|
@@ -3414,7 +3414,7 @@ function ih(i, t) {
|
|
|
3414
3414
|
}
|
|
3415
3415
|
return e;
|
|
3416
3416
|
}
|
|
3417
|
-
function
|
|
3417
|
+
function Pc(i, t) {
|
|
3418
3418
|
let e = {};
|
|
3419
3419
|
for (; !At(i, 0, "EOF") && !At(i, 0, "ENDSEC"); ) {
|
|
3420
3420
|
if (At(i, 0, "BLOCK")) {
|
|
@@ -3513,7 +3513,7 @@ function Oc(i, t) {
|
|
|
3513
3513
|
let zn = [{ code: 100, name: "subclassMarker", parser: y }, { code: 330, name: "ownerObjectId", parser: y }, { code: 102, parser(i, t) {
|
|
3514
3514
|
for (; !At(i, 0, "EOF") && !At(i, 102, "}"); ) i = t.next();
|
|
3515
3515
|
} }, { code: 5, name: "handle", parser: y }], zc = xt([{ code: 310, name: "bmpPreview", parser: y }, { code: 281, name: "scalability", parser: y }, { code: 280, name: "explodability", parser: y }, { code: 70, name: "insertionUnits", parser: y }, { code: 340, name: "layoutObjects", parser: y }, { code: 2, name: "name", parser: y }, { code: 100, name: "subclassMarker", parser: y }, ...zn]), Rc = [{ name: "DIMPOST", code: 3 }, { name: "DIMAPOST", code: 4 }, { name: "DIMBLK_OBSOLETE", code: 5 }, { name: "DIMBLK1_OBSOLETE", code: 6 }, { name: "DIMBLK2_OBSOLETE", code: 7 }, { name: "DIMSCALE", code: 40, defaultValue: 1 }, { name: "DIMASZ", code: 41, defaultValue: 0.25 }, { name: "DIMEXO", code: 42, defaultValue: 0.625, defaultValueImperial: 0.0625 }, { name: "DIMDLI", code: 43, defaultValue: 3.75, defaultValueImperial: 0.38 }, { name: "DIMEXE", code: 44, defaultValue: 2.25, defaultValueImperial: 0.28 }, { name: "DIMRND", code: 45, defaultValue: 0 }, { name: "DIMDLE", code: 46, defaultValue: 0 }, { name: "DIMTP", code: 47, defaultValue: 0 }, { name: "DIMTM", code: 48, defaultValue: 0 }, { name: "DIMTXT", code: 140, defaultValue: 2.5, defaultValueImperial: 0.28 }, { name: "DIMCEN", code: 141, defaultValue: 2.5, defaultValueImperial: 0.09 }, { name: "DIMTSZ", code: 142, defaultValue: 0 }, { name: "DIMALTF", code: 143, defaultValue: 25.4 }, { name: "DIMLFAC", code: 144, defaultValue: 1 }, { name: "DIMTVP", code: 145, defaultValue: 0 }, { name: "DIMTFAC", code: 146, defaultValue: 1 }, { name: "DIMGAP", code: 147, defaultValue: 0.625, defaultValueImperial: 0.09 }, { name: "DIMALTRND", code: 148, defaultValue: 0 }, { name: "DIMTOL", code: 71, defaultValue: 0, defaultValueImperial: 1 }, { name: "DIMLIM", code: 72, defaultValue: 0 }, { name: "DIMTIH", code: 73, defaultValue: 0, defaultValueImperial: 1 }, { name: "DIMTOH", code: 74, defaultValue: 0, defaultValueImperial: 1 }, { name: "DIMSE1", code: 75, defaultValue: 0 }, { name: "DIMSE2", code: 76, defaultValue: 0 }, { name: "DIMTAD", code: 77, defaultValue: xo.Above, defaultValueImperial: xo.Center }, { name: "DIMZIN", code: 78, defaultValue: kn.Trailing, defaultValueImperial: kn.Feet }, { name: "DIMAZIN", code: 79, defaultValue: uu.None }, { name: "DIMALT", code: 170, defaultValue: 0 }, { name: "DIMALTD", code: 171, defaultValue: 3, defaultValueImperial: 2 }, { name: "DIMTOFL", code: 172, defaultValue: 1, defaultValueImperial: 0 }, { name: "DIMSAH", code: 173, defaultValue: 0 }, { name: "DIMTIX", code: 174, defaultValue: 0 }, { name: "DIMSOXD", code: 175, defaultValue: 0 }, { name: "DIMCLRD", code: 176, defaultValue: 0 }, { name: "DIMCLRE", code: 177, defaultValue: 0 }, { name: "DIMCLRT", code: 178, defaultValue: 0 }, { name: "DIMADEC", code: 179 }, { name: "DIMUNIT", code: 270 }, { name: "DIMDEC", code: 271, defaultValue: 2, defaultValueImperial: 4 }, { name: "DIMTDEC", code: 272, defaultValue: 2, defaultValueImperial: 4 }, { name: "DIMALTU", code: 273, defaultValue: 2 }, { name: "DIMALTTD", code: 274, defaultValue: 2, defaultValueImperial: 4 }, { name: "DIMAUNIT", code: 275, defaultValue: 0 }, { name: "DIMFRAC", code: 276, defaultValue: 0 }, { name: "DIMLUNIT", code: 277, defaultValue: 2 }, { name: "DIMDSEP", code: 278, defaultValue: ",", defaultValueImperial: "." }, { name: "DIMJUST", code: 280, defaultValue: cu.Center }, { name: "DIMSD1", code: 281, defaultValue: 0 }, { name: "DIMSD2", code: 282, defaultValue: 0 }, { name: "DIMTOLJ", code: 283, defaultValue: du.Center }, { name: "DIMTZIN", code: 284, defaultValue: kn.Trailing, defaultValueImperial: kn.Feet }, { name: "DIMALTZ", code: 285, defaultValue: kn.Trailing }, { name: "DIMALTTZ", code: 286, defaultValue: kn.Trailing }, { name: "DIMFIT", code: 287 }, { name: "DIMUPT", code: 288, defaultValue: 0 }, { name: "DIMATFIT", code: 289, defaultValue: 3 }, { name: "DIMTXSTY", code: 340 }, { name: "DIMLDRBLK", code: 341 }, { name: "DIMBLK", code: 342 }, { name: "DIMBLK1", code: 343 }, { name: "DIMBLK2", code: 344 }, { name: "DIMLWD", code: 371, defaultValue: -2 }, { name: "DIMLWD", code: 372, defaultValue: -2 }], Fc = xt([...Rc.map((i) => ({ ...i, parser: y })), { code: 70, name: "standardFlag", parser: y }, { code: 2, name: "name", parser: y }, { code: 100, name: "subclassMarker", parser: y }, { code: 105, name: "handle", parser: y }, ...zn.filter((i) => i.code !== 5)]), Bc = xt([{ code: 347, name: "materialObjectId", parser: y }, { code: 390, name: "plotStyleNameObjectId", parser: y }, { code: 370, name: "lineweight", parser: y }, { code: 290, name: "isPlotting", parser: Bt }, { code: 6, name: "lineType", parser: y }, { code: 62, name: "colorIndex", parser: y }, { code: 70, name: "standardFlag", parser: y }, { code: 2, name: "name", parser: y }, { code: 100, name: "subclassMarker", parser: y }, ...zn]);
|
|
3516
|
-
(
|
|
3516
|
+
(Ir = {})[Ir.NONE = 0] = "NONE", Ir[Ir.AbsoluteRotation = 1] = "AbsoluteRotation", Ir[Ir.TextEmbedded = 2] = "TextEmbedded", Ir[Ir.ShapeEmbedded = 4] = "ShapeEmbedded";
|
|
3517
3517
|
let Dc = xt([{ code: 9, name: "text", parser: y }, { code: 45, name: "offsetY", parser: y }, { code: 44, name: "offsetX", parser: y }, { code: 50, name: "rotation", parser: y }, { code: 46, name: "scale", parser: y }, { code: 340, name: "styleObjectId", parser: y }, { code: 75, name: "shapeNumber", parser: y }, { code: 74, name: "elementTypeFlag", parser: y }, { code: 49, name: "elementLength", parser: y }], { elementTypeFlag: 0, elementLength: 0 }), Uc = xt([{ code: 49, name: "pattern", parser(i, t) {
|
|
3518
3518
|
let e = {};
|
|
3519
3519
|
return Dc(i, t, e), e;
|
|
@@ -3625,14 +3625,14 @@ class qc extends EventTarget {
|
|
|
3625
3625
|
}
|
|
3626
3626
|
parseAll(t) {
|
|
3627
3627
|
let e = { header: {}, blocks: {}, entities: [], tables: {}, objects: { byName: {}, byTree: void 0 } }, s = t.next();
|
|
3628
|
-
for (; !At(s, 0, "EOF"); ) At(s, 0, "SECTION") && (At(s = t.next(), 2, "HEADER") ? (s = t.next(), e.header = kc(s, t)) : At(s, 2, "BLOCKS") ? (s = t.next(), e.blocks =
|
|
3628
|
+
for (; !At(s, 0, "EOF"); ) At(s, 0, "SECTION") && (At(s = t.next(), 2, "HEADER") ? (s = t.next(), e.header = kc(s, t)) : At(s, 2, "BLOCKS") ? (s = t.next(), e.blocks = Pc(s, t)) : At(s, 2, "ENTITIES") ? (s = t.next(), e.entities = ih(s, t)) : At(s, 2, "TABLES") ? (s = t.next(), e.tables = Hc(s, t)) : At(s, 2, "OBJECTS") && (s = t.next(), e.objects = Oc(s, t))), s = t.next();
|
|
3629
3629
|
return e;
|
|
3630
3630
|
}
|
|
3631
3631
|
constructor(t = new Yc()) {
|
|
3632
3632
|
super(), Ci(this, "_decoder", void 0), this._decoder = new TextDecoder(t.encoding, { fatal: t.encodingFailureFatal });
|
|
3633
3633
|
}
|
|
3634
3634
|
}
|
|
3635
|
-
const
|
|
3635
|
+
const Io = [
|
|
3636
3636
|
{ name: "AC1.2", value: 1 },
|
|
3637
3637
|
{ name: "AC1.40", value: 2 },
|
|
3638
3638
|
{ name: "AC1.50", value: 3 },
|
|
@@ -3725,14 +3725,14 @@ class Li {
|
|
|
3725
3725
|
*/
|
|
3726
3726
|
constructor(t) {
|
|
3727
3727
|
if (typeof t == "string") {
|
|
3728
|
-
const e =
|
|
3728
|
+
const e = Io.find((s) => s.name === t);
|
|
3729
3729
|
if (!e)
|
|
3730
3730
|
throw new Error(`Unknown DWG version name: ${t}`);
|
|
3731
3731
|
this.name = e.name, this.value = e.value;
|
|
3732
3732
|
return;
|
|
3733
3733
|
}
|
|
3734
3734
|
if (typeof t == "number") {
|
|
3735
|
-
const e =
|
|
3735
|
+
const e = Io.find((s) => s.value === t);
|
|
3736
3736
|
if (!e)
|
|
3737
3737
|
throw new Error(`Unknown DWG version value: ${t}`);
|
|
3738
3738
|
this.name = e.name, this.value = e.value;
|
|
@@ -4041,7 +4041,7 @@ const fe = [
|
|
|
4041
4041
|
"fe",
|
|
4042
4042
|
"ff"
|
|
4043
4043
|
];
|
|
4044
|
-
let
|
|
4044
|
+
let Po = 1234567;
|
|
4045
4045
|
const oh = Math.PI / 180, lh = 180 / Math.PI;
|
|
4046
4046
|
function Kc() {
|
|
4047
4047
|
const i = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0, e = Math.random() * 4294967295 | 0, s = Math.random() * 4294967295 | 0;
|
|
@@ -4084,8 +4084,8 @@ function sd(i) {
|
|
|
4084
4084
|
return i * (0.5 - Math.random());
|
|
4085
4085
|
}
|
|
4086
4086
|
function id(i) {
|
|
4087
|
-
i !== void 0 && (
|
|
4088
|
-
let t =
|
|
4087
|
+
i !== void 0 && (Po = i);
|
|
4088
|
+
let t = Po += 1831565813;
|
|
4089
4089
|
return t = Math.imul(t ^ t >>> 15, t | 1), t ^= t + Math.imul(t ^ t >>> 7, t | 61), ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
4090
4090
|
}
|
|
4091
4091
|
function ad(i) {
|
|
@@ -4829,7 +4829,7 @@ const zi = class mh {
|
|
|
4829
4829
|
* @returns Return this matrix
|
|
4830
4830
|
*/
|
|
4831
4831
|
scale(t, e) {
|
|
4832
|
-
return this.premultiply(
|
|
4832
|
+
return this.premultiply(Pi.makeScale(t, e)), this;
|
|
4833
4833
|
}
|
|
4834
4834
|
/**
|
|
4835
4835
|
* Rotate this matrix by the given angle (in radians).
|
|
@@ -4837,7 +4837,7 @@ const zi = class mh {
|
|
|
4837
4837
|
* @returns Return this matrix
|
|
4838
4838
|
*/
|
|
4839
4839
|
rotate(t) {
|
|
4840
|
-
return this.premultiply(
|
|
4840
|
+
return this.premultiply(Pi.makeRotation(-t)), this;
|
|
4841
4841
|
}
|
|
4842
4842
|
/**
|
|
4843
4843
|
* Translate this matrix by the given scalar values.
|
|
@@ -4846,7 +4846,7 @@ const zi = class mh {
|
|
|
4846
4846
|
* @returns Return this matrix
|
|
4847
4847
|
*/
|
|
4848
4848
|
translate(t, e) {
|
|
4849
|
-
return this.premultiply(
|
|
4849
|
+
return this.premultiply(Pi.makeTranslation(t, e)), this;
|
|
4850
4850
|
}
|
|
4851
4851
|
/**
|
|
4852
4852
|
* Set this matrix as a 2D translation transform:
|
|
@@ -4917,7 +4917,7 @@ const zi = class mh {
|
|
|
4917
4917
|
};
|
|
4918
4918
|
zi.IDENTITY = Object.freeze(new zi());
|
|
4919
4919
|
let ga = zi;
|
|
4920
|
-
const
|
|
4920
|
+
const Pi = /* @__PURE__ */ new ga(), Mn = 1e-6, se = 2 * Math.PI, S0 = {
|
|
4921
4921
|
x: 0,
|
|
4922
4922
|
y: 0
|
|
4923
4923
|
}, ph = {
|
|
@@ -5120,7 +5120,7 @@ function yd(i, t, e, s) {
|
|
|
5120
5120
|
), E = b[0] - w[0], M = b[1] - w[1], L = b[2] - w[2];
|
|
5121
5121
|
return g += Math.sqrt(E * E + M * M + L * L), g;
|
|
5122
5122
|
}
|
|
5123
|
-
function
|
|
5123
|
+
function I0(i) {
|
|
5124
5124
|
return i.map((t) => [...t]);
|
|
5125
5125
|
}
|
|
5126
5126
|
class un {
|
|
@@ -7968,7 +7968,7 @@ class Ms extends wh {
|
|
|
7968
7968
|
return this.getTangent(e);
|
|
7969
7969
|
}
|
|
7970
7970
|
}
|
|
7971
|
-
class
|
|
7971
|
+
class Ps extends Ms {
|
|
7972
7972
|
constructor(t, e, s, o, h) {
|
|
7973
7973
|
super();
|
|
7974
7974
|
const c = +(t !== void 0) + +(e !== void 0) + +(s !== void 0) + +(o !== void 0) + +(h !== void 0);
|
|
@@ -8174,7 +8174,7 @@ class Is extends Ms {
|
|
|
8174
8174
|
* @inheritdoc
|
|
8175
8175
|
*/
|
|
8176
8176
|
clone() {
|
|
8177
|
-
return new
|
|
8177
|
+
return new Ps(
|
|
8178
8178
|
this.center.clone(),
|
|
8179
8179
|
this.radius,
|
|
8180
8180
|
this._startAngle,
|
|
@@ -8212,7 +8212,7 @@ class Is extends Ms {
|
|
|
8212
8212
|
return e;
|
|
8213
8213
|
}
|
|
8214
8214
|
}
|
|
8215
|
-
class
|
|
8215
|
+
class Id extends bh {
|
|
8216
8216
|
/**
|
|
8217
8217
|
* Return new shape translated by given vector.
|
|
8218
8218
|
* Translation vector may be also defined by a pair of numbers.
|
|
@@ -8229,7 +8229,7 @@ class Pd extends bh {
|
|
|
8229
8229
|
return (this._box == null || this._boundingBoxNeedsUpdate) && (this._box = this.calculateBoundingBox(), this._boundingBoxNeedsUpdate = !1), this._box;
|
|
8230
8230
|
}
|
|
8231
8231
|
}
|
|
8232
|
-
class Ts extends
|
|
8232
|
+
class Ts extends Id {
|
|
8233
8233
|
}
|
|
8234
8234
|
class dn extends Ts {
|
|
8235
8235
|
/**
|
|
@@ -9139,7 +9139,7 @@ class Rn extends Ms {
|
|
|
9139
9139
|
let h = null;
|
|
9140
9140
|
if (s < e - 1 ? h = this._vertices[s + 1] : s == e - 1 && this.closed && (h = this._vertices[0]), h)
|
|
9141
9141
|
if (o.bulge) {
|
|
9142
|
-
const c = new
|
|
9142
|
+
const c = new Ps(o, h, o.bulge);
|
|
9143
9143
|
t += c.length;
|
|
9144
9144
|
} else
|
|
9145
9145
|
t += new Nt(o.x, o.y).distanceTo(h);
|
|
@@ -9212,7 +9212,7 @@ class Rn extends Ms {
|
|
|
9212
9212
|
if (h.bulge) {
|
|
9213
9213
|
let c = null;
|
|
9214
9214
|
if (o < s - 1 ? c = this._vertices[o + 1] : o == s - 1 && this.closed && (c = this._vertices[0]), c) {
|
|
9215
|
-
const g = new
|
|
9215
|
+
const g = new Ps(h, c, h.bulge).getPoints(t), x = g.length;
|
|
9216
9216
|
for (let f = 0; f < x; ++f) {
|
|
9217
9217
|
const w = g[f];
|
|
9218
9218
|
e.push(new Nt(w.x, w.y));
|
|
@@ -9303,7 +9303,7 @@ class ya extends Ms {
|
|
|
9303
9303
|
return new ya(this._start.clone(), this._end.clone());
|
|
9304
9304
|
}
|
|
9305
9305
|
}
|
|
9306
|
-
class
|
|
9306
|
+
class Pd extends Ms {
|
|
9307
9307
|
/**
|
|
9308
9308
|
* Create one loop by connected curves
|
|
9309
9309
|
* @param curves Input one array of connected curves
|
|
@@ -9675,9 +9675,9 @@ var Ah = { exports: {} };
|
|
|
9675
9675
|
break;
|
|
9676
9676
|
case D:
|
|
9677
9677
|
this.buf.b += "l";
|
|
9678
|
-
for (var A = r,
|
|
9679
|
-
var
|
|
9680
|
-
S =
|
|
9678
|
+
for (var A = r, I = A.h, S = null; I != null; ) {
|
|
9679
|
+
var P;
|
|
9680
|
+
S = I[0], I = I[1], P = S, this.serialize(P);
|
|
9681
9681
|
}
|
|
9682
9682
|
this.buf.b += "h";
|
|
9683
9683
|
break;
|
|
@@ -9730,8 +9730,8 @@ var Ah = { exports: {} };
|
|
|
9730
9730
|
break;
|
|
9731
9731
|
case 4:
|
|
9732
9732
|
if (Mt.__instanceof(r, so)) {
|
|
9733
|
-
var
|
|
9734
|
-
this.buf.b += "A", this.serializeString(
|
|
9733
|
+
var It = ut.getClassName(r);
|
|
9734
|
+
this.buf.b += "A", this.serializeString(It);
|
|
9735
9735
|
} else if (Mt.__instanceof(r, io))
|
|
9736
9736
|
this.buf.b += "B", this.serializeString(ut.getEnumName(r));
|
|
9737
9737
|
else {
|
|
@@ -9884,13 +9884,13 @@ var Ah = { exports: {} };
|
|
|
9884
9884
|
case 120:
|
|
9885
9885
|
throw new Q(this.unserialize());
|
|
9886
9886
|
case 99:
|
|
9887
|
-
var A = this.unserialize(),
|
|
9888
|
-
if (
|
|
9889
|
-
var S = ut.createEmptyInstance(
|
|
9887
|
+
var A = this.unserialize(), I = this.resolver.resolveClass(A);
|
|
9888
|
+
if (I == null) throw new Q("Class not found " + A);
|
|
9889
|
+
var S = ut.createEmptyInstance(I);
|
|
9890
9890
|
return this.cache.push(S), this.unserializeObject(S), S;
|
|
9891
9891
|
case 119:
|
|
9892
|
-
var
|
|
9893
|
-
if (k == null) throw new Q("Enum not found " +
|
|
9892
|
+
var P = this.unserialize(), k = this.resolver.resolveEnum(P);
|
|
9893
|
+
if (k == null) throw new Q("Enum not found " + P);
|
|
9894
9894
|
var T = this.unserializeEnum(k, this.unserialize());
|
|
9895
9895
|
return this.cache.push(T), T;
|
|
9896
9896
|
case 106:
|
|
@@ -9943,19 +9943,19 @@ var Ah = { exports: {} };
|
|
|
9943
9943
|
if (this.get(this.pos++) != 58 || this.length - this.pos < nt) throw new Q("Invalid bytes length");
|
|
9944
9944
|
var X = Wt.CODES;
|
|
9945
9945
|
X == null && (X = Wt.initCodes(), Wt.CODES = X);
|
|
9946
|
-
var gt = this.pos,
|
|
9947
|
-
jt = (nt >> 2) * 3 + (
|
|
9948
|
-
for (var Xt = gt + (nt -
|
|
9949
|
-
var Ae = X[ot.fastCodeAt(mt, gt++)],
|
|
9950
|
-
Dt.set(Kt++, Ae << 2 |
|
|
9946
|
+
var gt = this.pos, It = nt & 3, jt;
|
|
9947
|
+
jt = (nt >> 2) * 3 + (It >= 2 ? It - 1 : 0);
|
|
9948
|
+
for (var Xt = gt + (nt - It), Dt = Me.alloc(jt), Kt = 0; gt < Xt; ) {
|
|
9949
|
+
var Ae = X[ot.fastCodeAt(mt, gt++)], He = X[ot.fastCodeAt(mt, gt++)];
|
|
9950
|
+
Dt.set(Kt++, Ae << 2 | He >> 4);
|
|
9951
9951
|
var _e = X[ot.fastCodeAt(mt, gt++)];
|
|
9952
|
-
Dt.set(Kt++,
|
|
9952
|
+
Dt.set(Kt++, He << 4 | _e >> 2);
|
|
9953
9953
|
var ge = X[ot.fastCodeAt(mt, gt++)];
|
|
9954
9954
|
Dt.set(Kt++, _e << 6 | ge);
|
|
9955
9955
|
}
|
|
9956
|
-
if (
|
|
9956
|
+
if (It >= 2) {
|
|
9957
9957
|
var Se = X[ot.fastCodeAt(mt, gt++)], Le = X[ot.fastCodeAt(mt, gt++)];
|
|
9958
|
-
if (Dt.set(Kt++, Se << 2 | Le >> 4),
|
|
9958
|
+
if (Dt.set(Kt++, Se << 2 | Le >> 4), It == 3) {
|
|
9959
9959
|
var $e = X[ot.fastCodeAt(mt, gt++)];
|
|
9960
9960
|
Dt.set(Kt++, Le << 4 | $e >> 2);
|
|
9961
9961
|
}
|
|
@@ -9972,8 +9972,8 @@ var Ah = { exports: {} };
|
|
|
9972
9972
|
if (dr == null) throw new Q("Class not found " + Je);
|
|
9973
9973
|
return dr;
|
|
9974
9974
|
case 66:
|
|
9975
|
-
var
|
|
9976
|
-
if (qr == null) throw new Q("Enum not found " +
|
|
9975
|
+
var Pn = this.unserialize(), qr = this.resolver.resolveEnum(Pn);
|
|
9976
|
+
if (qr == null) throw new Q("Enum not found " + Pn);
|
|
9977
9977
|
return qr;
|
|
9978
9978
|
}
|
|
9979
9979
|
throw this.pos--, new Q("Invalid char " + this.buf.charAt(this.pos) + " at position " + this.pos);
|
|
@@ -10133,8 +10133,8 @@ var Ah = { exports: {} };
|
|
|
10133
10133
|
var _ = r.length, v = "[";
|
|
10134
10134
|
n += " ";
|
|
10135
10135
|
for (var A = 0; A < _; ) {
|
|
10136
|
-
var
|
|
10137
|
-
v += (
|
|
10136
|
+
var I = A++;
|
|
10137
|
+
v += (I > 0 ? "," : "") + Mt.__string_rec(r[I], n);
|
|
10138
10138
|
}
|
|
10139
10139
|
return v += "]", v;
|
|
10140
10140
|
}
|
|
@@ -10145,8 +10145,8 @@ var Ah = { exports: {} };
|
|
|
10145
10145
|
return C instanceof Q && (C = C.val), "???";
|
|
10146
10146
|
}
|
|
10147
10147
|
if (S != null && S != Object.toString && typeof S == "function") {
|
|
10148
|
-
var
|
|
10149
|
-
if (
|
|
10148
|
+
var P = r.toString();
|
|
10149
|
+
if (P != "[object Object]") return P;
|
|
10150
10150
|
}
|
|
10151
10151
|
var k = null, T = `{
|
|
10152
10152
|
`;
|
|
@@ -10321,8 +10321,8 @@ var Ah = { exports: {} };
|
|
|
10321
10321
|
var _ = r;
|
|
10322
10322
|
if (_.length + n > a.byteLength) throw new Q("set() outside of range");
|
|
10323
10323
|
for (var v = 0, A = _.length; v < A; ) {
|
|
10324
|
-
var
|
|
10325
|
-
a[
|
|
10324
|
+
var I = v++;
|
|
10325
|
+
a[I + n] = _[I];
|
|
10326
10326
|
}
|
|
10327
10327
|
} else throw new Q("TODO");
|
|
10328
10328
|
}, sr._subarray = function(r, n) {
|
|
@@ -10350,8 +10350,8 @@ var Ah = { exports: {} };
|
|
|
10350
10350
|
}, Et.linkAll = function(r, n) {
|
|
10351
10351
|
for (var a = function(d, p, _) {
|
|
10352
10352
|
if (d.length == 0 || Et.allFulfilled(d)) {
|
|
10353
|
-
for (var v, A = [],
|
|
10354
|
-
var S =
|
|
10353
|
+
for (var v, A = [], I = Ke(r)(); I.hasNext(); ) {
|
|
10354
|
+
var S = I.next();
|
|
10355
10355
|
A.push(S == p ? _ : S._val);
|
|
10356
10356
|
}
|
|
10357
10357
|
v = A, n.handleResolve(v);
|
|
@@ -10883,8 +10883,8 @@ var Ah = { exports: {} };
|
|
|
10883
10883
|
var a = this.min, l = this.max, u = r.min, d = r.max;
|
|
10884
10884
|
if (!this.intersects(r, n)) return null;
|
|
10885
10885
|
for (var p = [], _ = [], v = 0, A = this.dim; v < A; ) {
|
|
10886
|
-
var
|
|
10887
|
-
p.push(Math.min(l[
|
|
10886
|
+
var I = v++;
|
|
10887
|
+
p.push(Math.min(l[I], d[I])), _.push(Math.max(a[I], u[I]));
|
|
10888
10888
|
}
|
|
10889
10889
|
return new Te([_, p]);
|
|
10890
10890
|
},
|
|
@@ -11000,13 +11000,13 @@ var Ah = { exports: {} };
|
|
|
11000
11000
|
b["verb.core.CurveTriPoint"] = vn, vn.__name__ = ["verb", "core", "CurveTriPoint"], vn.prototype = {
|
|
11001
11001
|
__class__: vn
|
|
11002
11002
|
};
|
|
11003
|
-
var
|
|
11003
|
+
var je = function(r, n, a, l, u) {
|
|
11004
11004
|
u == null && (u = !1), l == null && (l = -1), this.uv = a, this.point = r, this.normal = n, this.id = l, this.degen = u;
|
|
11005
11005
|
};
|
|
11006
|
-
b["verb.core.SurfacePoint"] =
|
|
11007
|
-
return new
|
|
11008
|
-
},
|
|
11009
|
-
__class__:
|
|
11006
|
+
b["verb.core.SurfacePoint"] = je, je.__name__ = ["verb", "core", "SurfacePoint"], je.fromUv = function(r, n) {
|
|
11007
|
+
return new je(null, null, [r, n]);
|
|
11008
|
+
}, je.prototype = {
|
|
11009
|
+
__class__: je
|
|
11010
11010
|
};
|
|
11011
11011
|
var Cs = f.core.CurvePoint = function(r, n) {
|
|
11012
11012
|
this.u = r, this.pt = n;
|
|
@@ -11030,7 +11030,7 @@ var Ah = { exports: {} };
|
|
|
11030
11030
|
return -S.item1;
|
|
11031
11031
|
}), d, p = null;
|
|
11032
11032
|
p = function(S) {
|
|
11033
|
-
for (var
|
|
11033
|
+
for (var P, k = S.dimension, T = l.distanceFunction(r, S.kdPoint.point), O, C = [], F = 0, R = l.dim; F < R; )
|
|
11034
11034
|
F++, C.push(0);
|
|
11035
11035
|
O = C;
|
|
11036
11036
|
for (var U, V, q = function(K, tt) {
|
|
@@ -11043,14 +11043,14 @@ var Ah = { exports: {} };
|
|
|
11043
11043
|
(u.size() < n || T < u.peek().item1) && q(S, T);
|
|
11044
11044
|
return;
|
|
11045
11045
|
}
|
|
11046
|
-
S.right == null ?
|
|
11046
|
+
S.right == null ? P = S.left : S.left == null ? P = S.right : r[k] < S.kdPoint.point[k] ? P = S.left : P = S.right, p(P), (u.size() < n || T < u.peek().item1) && q(S, T), (u.size() < n || Math.abs(U) < u.peek().item1) && (P == S.left ? V = S.right : V = S.left, V != null && p(V));
|
|
11047
11047
|
}, d = p;
|
|
11048
11048
|
for (var _ = 0; _ < n; )
|
|
11049
11049
|
_++, u.push(new ee(null, a));
|
|
11050
11050
|
d(this.root);
|
|
11051
11051
|
for (var v = [], A = 0; A < n; ) {
|
|
11052
|
-
var
|
|
11053
|
-
u.content[
|
|
11052
|
+
var I = A++;
|
|
11053
|
+
u.content[I].item0 != null && v.push(new ee(u.content[I].item0.kdPoint, u.content[I].item1));
|
|
11054
11054
|
}
|
|
11055
11055
|
return v;
|
|
11056
11056
|
},
|
|
@@ -11100,8 +11100,8 @@ var Ah = { exports: {} };
|
|
|
11100
11100
|
_ = this.scoreFunction(v), _ < l && (p = d);
|
|
11101
11101
|
}
|
|
11102
11102
|
if (u < n) {
|
|
11103
|
-
var A = this.content[u],
|
|
11104
|
-
|
|
11103
|
+
var A = this.content[u], I = this.scoreFunction(A);
|
|
11104
|
+
I < (p == -1 ? l : _) && (p = u);
|
|
11105
11105
|
}
|
|
11106
11106
|
if (p != -1)
|
|
11107
11107
|
this.content[r] = this.content[p], this.content[p] = a, r = p;
|
|
@@ -11242,13 +11242,13 @@ var Ah = { exports: {} };
|
|
|
11242
11242
|
}, Lt.mult = function(r, n) {
|
|
11243
11243
|
var a, l, u, d, p, _, v, A;
|
|
11244
11244
|
a = r.length, l = n.length, u = n[0].length, d = [];
|
|
11245
|
-
for (var
|
|
11246
|
-
for (p = [], _ = r[
|
|
11247
|
-
for (v = _[l - 1] * n[l - 1][
|
|
11248
|
-
A = S - 1, v += _[S] * n[S][
|
|
11249
|
-
S == 0 && (v += _[0] * n[0][
|
|
11245
|
+
for (var I = a - 1, S = 0, P = 0; I >= 0; ) {
|
|
11246
|
+
for (p = [], _ = r[I], P = u - 1; P >= 0; ) {
|
|
11247
|
+
for (v = _[l - 1] * n[l - 1][P], S = l - 2; S >= 1; )
|
|
11248
|
+
A = S - 1, v += _[S] * n[S][P] + _[A] * n[A][P], S -= 2;
|
|
11249
|
+
S == 0 && (v += _[0] * n[0][P]), p[P] = v, P--;
|
|
11250
11250
|
}
|
|
11251
|
-
d[
|
|
11251
|
+
d[I] = p, I--;
|
|
11252
11252
|
}
|
|
11253
11253
|
return d;
|
|
11254
11254
|
}, Lt.add = function(r, n) {
|
|
@@ -11287,8 +11287,8 @@ var Ah = { exports: {} };
|
|
|
11287
11287
|
var u = a++;
|
|
11288
11288
|
n.push(function(d) {
|
|
11289
11289
|
for (var p, _ = [], v = 0, A = r.length; v < A; ) {
|
|
11290
|
-
var
|
|
11291
|
-
_.push(r[
|
|
11290
|
+
var I = v++;
|
|
11291
|
+
_.push(r[I][u]);
|
|
11292
11292
|
}
|
|
11293
11293
|
return p = _, p;
|
|
11294
11294
|
}());
|
|
@@ -11297,11 +11297,11 @@ var Ah = { exports: {} };
|
|
|
11297
11297
|
}, Lt.solve = function(r, n) {
|
|
11298
11298
|
return Lt.LUsolve(Lt.LU(r), n);
|
|
11299
11299
|
}, Lt.LUsolve = function(r, n) {
|
|
11300
|
-
var a, l, u = r.LU, d = u.length, p = n.slice(), _ = r.P, v, A,
|
|
11300
|
+
var a, l, u = r.LU, d = u.length, p = n.slice(), _ = r.P, v, A, I;
|
|
11301
11301
|
for (a = d - 1; a != -1; )
|
|
11302
11302
|
p[a] = n[a], --a;
|
|
11303
11303
|
for (a = 0; a < d; ) {
|
|
11304
|
-
for (v = _[a], _[a] != a && (
|
|
11304
|
+
for (v = _[a], _[a] != a && (I = p[a], p[a] = p[v], p[v] = I), A = u[a], l = 0; l < a; )
|
|
11305
11305
|
p[a] -= p[l] * A[l], ++l;
|
|
11306
11306
|
++a;
|
|
11307
11307
|
}
|
|
@@ -11312,11 +11312,11 @@ var Ah = { exports: {} };
|
|
|
11312
11312
|
}
|
|
11313
11313
|
return p;
|
|
11314
11314
|
}, Lt.LU = function(r) {
|
|
11315
|
-
for (var n, a, l, u, d, p, _, v, A,
|
|
11315
|
+
for (var n, a, l, u, d, p, _, v, A, I = [], S = 0, P = r.length; S < P; ) {
|
|
11316
11316
|
var k = S++;
|
|
11317
|
-
|
|
11317
|
+
I.push(r[k].slice());
|
|
11318
11318
|
}
|
|
11319
|
-
r =
|
|
11319
|
+
r = I;
|
|
11320
11320
|
var T = r.length, O = T - 1, C = [];
|
|
11321
11321
|
for (l = 0; l < T; ) {
|
|
11322
11322
|
for (_ = l, p = r[l], A = Math.abs(p[l]), a = l + 1; a < T; )
|
|
@@ -11356,11 +11356,11 @@ var Ah = { exports: {} };
|
|
|
11356
11356
|
var _ = re.getMinCoordOnAxis(n.points, n.faces[p], l);
|
|
11357
11357
|
u.push(new ee(_, p));
|
|
11358
11358
|
}
|
|
11359
|
-
u.sort(function(
|
|
11360
|
-
var T =
|
|
11359
|
+
u.sort(function(P, k) {
|
|
11360
|
+
var T = P.item0, O = k.item0;
|
|
11361
11361
|
return T == O ? 0 : T > O ? 1 : -1;
|
|
11362
11362
|
});
|
|
11363
|
-
for (var v = [], A = 0,
|
|
11363
|
+
for (var v = [], A = 0, I = u.length; A < I; ) {
|
|
11364
11364
|
var S = A++;
|
|
11365
11365
|
v.push(u[S].item1);
|
|
11366
11366
|
}
|
|
@@ -11383,7 +11383,7 @@ var Ah = { exports: {} };
|
|
|
11383
11383
|
}
|
|
11384
11384
|
return a;
|
|
11385
11385
|
}, re.triangleUVFromPoint = function(r, n, a) {
|
|
11386
|
-
var l = r.faces[n], u = r.points[l[0]], d = r.points[l[1]], p = r.points[l[2]], _ = r.uvs[l[0]], v = r.uvs[l[1]], A = r.uvs[l[2]],
|
|
11386
|
+
var l = r.faces[n], u = r.points[l[0]], d = r.points[l[1]], p = r.points[l[2]], _ = r.uvs[l[0]], v = r.uvs[l[1]], A = r.uvs[l[2]], I = m.sub(u, a), S = m.sub(d, a), P = m.sub(p, a), k = m.norm(m.cross(m.sub(u, d), m.sub(u, p))), T = m.norm(m.cross(S, P)) / k, O = m.norm(m.cross(P, I)) / k, C = m.norm(m.cross(I, S)) / k;
|
|
11387
11387
|
return m.add(m.mul(T, _), m.add(m.mul(O, v), m.mul(C, A)));
|
|
11388
11388
|
};
|
|
11389
11389
|
var Cr = function(r, n) {
|
|
@@ -11431,13 +11431,13 @@ var Ah = { exports: {} };
|
|
|
11431
11431
|
var d = n.length, p = r(n), _ = p, v;
|
|
11432
11432
|
if (isNaN(p)) throw new Q("uncmin: f(x0) is a NaN!");
|
|
11433
11433
|
a = Math.max(a, rt.EPSILON);
|
|
11434
|
-
var A,
|
|
11435
|
-
for (
|
|
11436
|
-
if (!m.all(m.finite(
|
|
11434
|
+
var A, I, S, P = Lt.identity(d), k = 0, T = [], O, C, F, R, U, V, q = "";
|
|
11435
|
+
for (I = l(n); k < u; ) {
|
|
11436
|
+
if (!m.all(m.finite(I))) {
|
|
11437
11437
|
q = "Gradient has Infinity or NaN";
|
|
11438
11438
|
break;
|
|
11439
11439
|
}
|
|
11440
|
-
if (A = m.neg(Lt.dot(
|
|
11440
|
+
if (A = m.neg(Lt.dot(P, I)), !m.all(m.finite(A))) {
|
|
11441
11441
|
q = "Search direction has Infinity or NaN";
|
|
11442
11442
|
break;
|
|
11443
11443
|
}
|
|
@@ -11445,7 +11445,7 @@ var Ah = { exports: {} };
|
|
|
11445
11445
|
q = "Newton step smaller than tol";
|
|
11446
11446
|
break;
|
|
11447
11447
|
}
|
|
11448
|
-
for (U = 1, v = m.dot(
|
|
11448
|
+
for (U = 1, v = m.dot(I, A), O = n; k < u && !(U * V < a); ) {
|
|
11449
11449
|
if (T = m.mul(U, A), O = m.add(n, T), _ = r(O), _ - p >= 0.1 * U * v || isNaN(_)) {
|
|
11450
11450
|
U *= 0.5, ++k;
|
|
11451
11451
|
continue;
|
|
@@ -11460,20 +11460,20 @@ var Ah = { exports: {} };
|
|
|
11460
11460
|
q = "maxit reached during line search";
|
|
11461
11461
|
break;
|
|
11462
11462
|
}
|
|
11463
|
-
S = l(O), C = m.sub(S,
|
|
11463
|
+
S = l(O), C = m.sub(S, I), R = m.dot(C, T), F = Lt.dot(P, C), P = Lt.sub(Lt.add(P, Lt.mul((R + m.dot(C, F)) / (R * R), Xe.tensor(T, T))), Lt.div(Lt.add(Xe.tensor(F, T), Xe.tensor(T, F)), R)), n = O, p = _, I = S, ++k;
|
|
11464
11464
|
}
|
|
11465
|
-
return new Kn(n, p,
|
|
11465
|
+
return new Kn(n, p, I, P, k, q);
|
|
11466
11466
|
}, Xe.numericalGradient = function(r, n) {
|
|
11467
11467
|
var a = n.length, l = r(n);
|
|
11468
11468
|
if (l == NaN) throw new Q("gradient: f(x) is a NaN!");
|
|
11469
|
-
for (var u = n.slice(0), d, p, _ = [], v, A = 1e-3,
|
|
11469
|
+
for (var u = n.slice(0), d, p, _ = [], v, A = 1e-3, I, S, P, k = 0, T, O, C, F = 0; F < a; )
|
|
11470
11470
|
for (var R = F++, U = Math.max(1e-6 * l, 1e-8); ; ) {
|
|
11471
11471
|
if (++k, k > 20) throw new Q("Numerical gradient fails");
|
|
11472
11472
|
if (u[R] = n[R] + U, d = r(u), u[R] = n[R] - U, p = r(u), u[R] = n[R], isNaN(d) || isNaN(p)) {
|
|
11473
11473
|
U /= 16;
|
|
11474
11474
|
continue;
|
|
11475
11475
|
}
|
|
11476
|
-
if (_[R] = (d - p) / (2 * U),
|
|
11476
|
+
if (_[R] = (d - p) / (2 * U), I = n[R] - U, S = n[R], P = n[R] + U, T = (d - l) / U, O = (l - p) / U, C = m.max([Math.abs(_[R]), Math.abs(l), Math.abs(d), Math.abs(p), Math.abs(I), Math.abs(S), Math.abs(P), 1e-8]), v = Math.min(m.max([Math.abs(T - _[R]), Math.abs(O - _[R]), Math.abs(T - O)]) / C, U / C), v > A) U /= 16;
|
|
11477
11477
|
else break;
|
|
11478
11478
|
}
|
|
11479
11479
|
return _;
|
|
@@ -11524,19 +11524,19 @@ var Ah = { exports: {} };
|
|
|
11524
11524
|
}, Ne.segmentClosestPoint = function(r, n, a, l, u) {
|
|
11525
11525
|
var d = m.sub(a, n), p = m.norm(d);
|
|
11526
11526
|
if (p < rt.EPSILON) return { u: l, pt: n };
|
|
11527
|
-
var _ = n, v = m.mul(1 / p, d), A = m.sub(r, _),
|
|
11528
|
-
return
|
|
11527
|
+
var _ = n, v = m.mul(1 / p, d), A = m.sub(r, _), I = m.dot(A, v);
|
|
11528
|
+
return I < 0 ? { u: l, pt: n } : I > p ? { u, pt: a } : { u: l + (u - l) * I / p, pt: m.add(_, m.mul(I, v)) };
|
|
11529
11529
|
};
|
|
11530
11530
|
var m = f.core.Vec = function() {
|
|
11531
11531
|
};
|
|
11532
11532
|
b["verb.core.Vec"] = m, m.__name__ = ["verb", "core", "Vec"], m.angleBetween = function(r, n) {
|
|
11533
11533
|
return Math.acos(m.dot(r, n) / (m.norm(r) * m.norm(n)));
|
|
11534
11534
|
}, m.positiveAngleBetween = function(r, n, a) {
|
|
11535
|
-
var l = m.cross(r, n), u = m.norm(r), d = m.norm(n), p = u * d, _ = m.dot(r, n), v = m.norm(l) / p, A = _ / p,
|
|
11536
|
-
return Math.abs(S) < rt.EPSILON || S > 0 ?
|
|
11535
|
+
var l = m.cross(r, n), u = m.norm(r), d = m.norm(n), p = u * d, _ = m.dot(r, n), v = m.norm(l) / p, A = _ / p, I = Math.atan2(v, A), S = m.dot(a, l);
|
|
11536
|
+
return Math.abs(S) < rt.EPSILON || S > 0 ? I : -I;
|
|
11537
11537
|
}, m.signedAngleBetween = function(r, n, a) {
|
|
11538
|
-
var l = m.cross(r, n), u = m.norm(r), d = m.norm(n), p = u * d, _ = m.dot(r, n), v = m.norm(l) / p, A = _ / p,
|
|
11539
|
-
return S > 0 ?
|
|
11538
|
+
var l = m.cross(r, n), u = m.norm(r), d = m.norm(n), p = u * d, _ = m.dot(r, n), v = m.norm(l) / p, A = _ / p, I = Math.atan2(v, A), S = m.dot(a, l);
|
|
11539
|
+
return S > 0 ? I : 2 * Math.PI - I;
|
|
11540
11540
|
}, m.angleBetweenNormalized2d = function(r, n) {
|
|
11541
11541
|
var a = r[0] * n[1] - r[1] * n[0];
|
|
11542
11542
|
return Math.atan2(a, m.dot(r, n));
|
|
@@ -11742,23 +11742,23 @@ var Ah = { exports: {} };
|
|
|
11742
11742
|
var a = yt.rationalSurfaceClosestParam(r, n);
|
|
11743
11743
|
return N.rationalSurfacePoint(r, a[0], a[1]);
|
|
11744
11744
|
}, yt.rationalSurfaceClosestParam = function(r, n) {
|
|
11745
|
-
for (var a = 5, l = 0, u, d = 1e-4, p = 5e-4, _, v = r.knotsU[0], A = $.last(r.knotsU),
|
|
11745
|
+
for (var a = 5, l = 0, u, d = 1e-4, p = 5e-4, _, v = r.knotsU[0], A = $.last(r.knotsU), I = r.knotsV[0], S = $.last(r.knotsV), P = yt.isRationalSurfaceClosed(r), k = yt.isRationalSurfaceClosed(r, !1), T, O = zt.rationalSurfaceAdaptive(r, new Lr()), C = 1 / 0, F = 0, R = O.points.length; F < R; ) {
|
|
11746
11746
|
var U = F++, V = O.points[U], q = m.normSquared(m.sub(n, V));
|
|
11747
11747
|
q < C && (C = q, T = O.uvs[U]);
|
|
11748
11748
|
}
|
|
11749
11749
|
for (var J = function(jt) {
|
|
11750
11750
|
return N.rationalSurfaceDerivatives(r, jt[0], jt[1], 2);
|
|
11751
11751
|
}, H = function(jt, Xt, Dt) {
|
|
11752
|
-
var Kt = Xt[1][0], Ae = Xt[0][1],
|
|
11752
|
+
var Kt = Xt[1][0], Ae = Xt[0][1], He = Xt[2][0], _e = Xt[0][2], ge = Xt[1][1], Se = Xt[1][1], Le = m.dot(Kt, Dt), $e = m.dot(Ae, Dt), lr = [-Le, -$e], Ze = m.dot(Kt, Kt) + m.dot(He, Dt), Qe = m.dot(Kt, Ae) + m.dot(ge, Dt), Je = m.dot(Kt, Ae) + m.dot(Se, Dt), dr = m.dot(Ae, Ae) + m.dot(_e, Dt), Pn = [[Ze, Qe], [Je, dr]], qr = Lt.solve(Pn, lr);
|
|
11753
11753
|
return m.add(qr, jt);
|
|
11754
11754
|
}; l < a; ) {
|
|
11755
11755
|
u = J(T), _ = m.sub(u[0][0], n);
|
|
11756
11756
|
var G = m.norm(_), K = m.dot(u[1][0], _), tt = m.norm(u[1][0]) * G, et = m.dot(u[0][1], _), it = m.norm(u[0][1]) * G, ht = K / tt, at = et / it, ct = G < d, nt = ht < p, mt = at < p;
|
|
11757
11757
|
if (ct && nt && mt) return T;
|
|
11758
11758
|
var X = H(T, u, _);
|
|
11759
|
-
X[0] < v ?
|
|
11760
|
-
var gt = m.norm(m.mul(X[0] - T[0], u[1][0])),
|
|
11761
|
-
if (gt +
|
|
11759
|
+
X[0] < v ? P ? X = [A - (X[0] - v), X[1]] : X = [v + rt.EPSILON, X[1]] : X[0] > A && (P ? X = [v + (X[0] - A), X[1]] : X = [A - rt.EPSILON, X[1]]), X[1] < I ? k ? X = [X[0], S - (X[1] - I)] : X = [X[0], I + rt.EPSILON] : X[1] > S && (k ? X = [X[0], I + (X[0] - S)] : X = [X[0], S - rt.EPSILON]);
|
|
11760
|
+
var gt = m.norm(m.mul(X[0] - T[0], u[1][0])), It = m.norm(m.mul(X[1] - T[1], u[0][1]));
|
|
11761
|
+
if (gt + It < d) return T;
|
|
11762
11762
|
T = X, l++;
|
|
11763
11763
|
}
|
|
11764
11764
|
return T;
|
|
@@ -11766,13 +11766,13 @@ var Ah = { exports: {} };
|
|
|
11766
11766
|
return N.rationalCurvePoint(r, yt.rationalCurveClosestParam(r, n));
|
|
11767
11767
|
}, yt.rationalCurveClosestParam = function(r, n) {
|
|
11768
11768
|
for (var a = 1 / 0, l = 0, u = zt.rationalCurveRegularSample(r, r.controlPoints.length * r.degree, !0), d = 0, p = u.length - 1; d < p; ) {
|
|
11769
|
-
var _ = d++, v = u[_][0], A = u[_ + 1][0],
|
|
11770
|
-
k < a && (a = k, l =
|
|
11769
|
+
var _ = d++, v = u[_][0], A = u[_ + 1][0], I = u[_].slice(1), S = u[_ + 1].slice(1), P = Ne.segmentClosestPoint(n, I, S, v, A), k = m.norm(m.sub(n, P.pt));
|
|
11770
|
+
k < a && (a = k, l = P.u);
|
|
11771
11771
|
}
|
|
11772
11772
|
for (var T = 5, O = 0, C, F = 1e-4, R = 5e-4, U, V = r.knots[0], q = $.last(r.knots), J = m.normSquared(m.sub(r.controlPoints[0], $.last(r.controlPoints))) < rt.EPSILON, H = l, G = function(X) {
|
|
11773
11773
|
return N.rationalCurveDerivatives(r, X, 2);
|
|
11774
|
-
}, K = function(X, gt,
|
|
11775
|
-
var jt = m.dot(gt[1],
|
|
11774
|
+
}, K = function(X, gt, It) {
|
|
11775
|
+
var jt = m.dot(gt[1], It), Xt = m.dot(gt[2], It), Dt = m.dot(gt[1], gt[1]), Kt = Xt + Dt;
|
|
11776
11776
|
return X - jt / Kt;
|
|
11777
11777
|
}; O < T; ) {
|
|
11778
11778
|
C = G(H), U = m.sub(C[0], n);
|
|
@@ -11801,9 +11801,9 @@ var Ah = { exports: {} };
|
|
|
11801
11801
|
if (n < 0) return r.knots[0];
|
|
11802
11802
|
var u;
|
|
11803
11803
|
if (l != null ? u = l : u = yt.rationalBezierCurveArcLength(r), n > u) return $.last(r.knots);
|
|
11804
|
-
var d = r.knots[0], p = 0, _ = $.last(r.knots), v = u, A = 0,
|
|
11804
|
+
var d = r.knots[0], p = 0, _ = $.last(r.knots), v = u, A = 0, I = 0, S;
|
|
11805
11805
|
for (a != null ? S = a : S = rt.TOLERANCE * 2; v - p > S; )
|
|
11806
|
-
A = (d + _) / 2,
|
|
11806
|
+
A = (d + _) / 2, I = yt.rationalBezierCurveArcLength(r, A), I > n ? (_ = A, v = I) : (d = A, p = I);
|
|
11807
11807
|
return (d + _) / 2;
|
|
11808
11808
|
}, yt.rationalCurveArcLength = function(r, n, a) {
|
|
11809
11809
|
a == null && (a = 16), n == null ? n = $.last(r.knots) : n = n;
|
|
@@ -11817,8 +11817,8 @@ var Ah = { exports: {} };
|
|
|
11817
11817
|
var l;
|
|
11818
11818
|
n == null ? l = $.last(r.knots) : l = n;
|
|
11819
11819
|
for (var u = (l - r.knots[0]) / 2, d = 0, p = r.degree + a, _, v, A = 0; A < p; ) {
|
|
11820
|
-
var
|
|
11821
|
-
_ = u * yt.Tvalues[p][
|
|
11820
|
+
var I = A++;
|
|
11821
|
+
_ = u * yt.Tvalues[p][I] + u + r.knots[0], v = N.rationalCurveDerivatives(r, _, 1), d += yt.Cvalues[p][I] * m.norm(v[1]);
|
|
11822
11822
|
}
|
|
11823
11823
|
return u * d;
|
|
11824
11824
|
};
|
|
@@ -11831,9 +11831,9 @@ var Ah = { exports: {} };
|
|
|
11831
11831
|
},
|
|
11832
11832
|
__class__: wn
|
|
11833
11833
|
};
|
|
11834
|
-
var
|
|
11834
|
+
var We = f.eval.Check = function() {
|
|
11835
11835
|
};
|
|
11836
|
-
b["verb.eval.Check"] =
|
|
11836
|
+
b["verb.eval.Check"] = We, We.__name__ = ["verb", "eval", "Check"], We.isValidKnotVector = function(r, n) {
|
|
11837
11837
|
if (r.length == 0 || r.length < (n + 1) * 2) return !1;
|
|
11838
11838
|
for (var a = $.first(r), l = 0, u = n + 1; l < u; ) {
|
|
11839
11839
|
var d = l++;
|
|
@@ -11844,23 +11844,23 @@ var Ah = { exports: {} };
|
|
|
11844
11844
|
var v = p++;
|
|
11845
11845
|
if (Math.abs(r[v] - a) > rt.EPSILON) return !1;
|
|
11846
11846
|
}
|
|
11847
|
-
return
|
|
11848
|
-
},
|
|
11847
|
+
return We.isNonDecreasing(r);
|
|
11848
|
+
}, We.isNonDecreasing = function(r) {
|
|
11849
11849
|
for (var n = $.first(r), a = 0, l = r.length; a < l; ) {
|
|
11850
11850
|
var u = a++;
|
|
11851
11851
|
if (r[u] < n - rt.EPSILON) return !1;
|
|
11852
11852
|
n = r[u];
|
|
11853
11853
|
}
|
|
11854
11854
|
return !0;
|
|
11855
|
-
},
|
|
11855
|
+
}, We.isValidNurbsCurveData = function(r) {
|
|
11856
11856
|
if (r.controlPoints == null) throw new Q("Control points array cannot be null!");
|
|
11857
11857
|
if (r.degree == null) throw new Q("Degree cannot be null!");
|
|
11858
11858
|
if (r.degree < 1) throw new Q("Degree must be greater than 1!");
|
|
11859
11859
|
if (r.knots == null) throw new Q("Knots cannot be null!");
|
|
11860
11860
|
if (r.knots.length != r.controlPoints.length + r.degree + 1) throw new Q("controlPoints.length + degree + 1 must equal knots.length!");
|
|
11861
|
-
if (!
|
|
11861
|
+
if (!We.isValidKnotVector(r.knots, r.degree)) throw new Q("Invalid knot vector format! Should begin with degree + 1 repeats and end with degree + 1 repeats!");
|
|
11862
11862
|
return r;
|
|
11863
|
-
},
|
|
11863
|
+
}, We.isValidNurbsSurfaceData = function(r) {
|
|
11864
11864
|
if (r.controlPoints == null) throw new Q("Control points array cannot be null!");
|
|
11865
11865
|
if (r.degreeU == null) throw new Q("DegreeU cannot be null!");
|
|
11866
11866
|
if (r.degreeV == null) throw new Q("DegreeV cannot be null!");
|
|
@@ -11870,7 +11870,7 @@ var Ah = { exports: {} };
|
|
|
11870
11870
|
if (r.knotsV == null) throw new Q("KnotsV cannot be null!");
|
|
11871
11871
|
if (r.knotsU.length != r.controlPoints.length + r.degreeU + 1) throw new Q("controlPointsU.length + degreeU + 1 must equal knotsU.length!");
|
|
11872
11872
|
if (r.knotsV.length != r.controlPoints[0].length + r.degreeV + 1) throw new Q("controlPointsV.length + degreeV + 1 must equal knotsV.length!");
|
|
11873
|
-
if (!
|
|
11873
|
+
if (!We.isValidKnotVector(r.knotsU, r.degreeU) || !We.isValidKnotVector(r.knotsV, r.degreeV)) throw new Q("Invalid knot vector format! Should begin with degree + 1 repeats and end with degree + 1 repeats!");
|
|
11874
11874
|
return r;
|
|
11875
11875
|
};
|
|
11876
11876
|
var oe = f.eval.Divide = function() {
|
|
@@ -11882,32 +11882,32 @@ var Ah = { exports: {} };
|
|
|
11882
11882
|
for (var p, _ = [], v = 0, A = u + 1; v < A; )
|
|
11883
11883
|
v++, _.push(n);
|
|
11884
11884
|
p = _;
|
|
11885
|
-
for (var
|
|
11885
|
+
for (var I = [], S = [], P = N.knotSpan(u, n, l), k = null, T = 0; T < d.length; ) {
|
|
11886
11886
|
var O = d[T];
|
|
11887
|
-
++T, k = ft.curveKnotRefine(new Gt(u, l, O), p),
|
|
11887
|
+
++T, k = ft.curveKnotRefine(new Gt(u, l, O), p), I.push(k.controlPoints.slice(0, P + 1)), S.push(k.controlPoints.slice(P + 1));
|
|
11888
11888
|
}
|
|
11889
|
-
var C = k.knots.slice(0,
|
|
11890
|
-
return a ? [new te(r.degreeU, u, r.knotsU.slice(), C,
|
|
11889
|
+
var C = k.knots.slice(0, P + u + 2), F = k.knots.slice(P + 1);
|
|
11890
|
+
return a ? [new te(r.degreeU, u, r.knotsU.slice(), C, I), new te(r.degreeU, u, r.knotsU.slice(), F, S)] : (I = Lt.transpose(I), S = Lt.transpose(S), [new te(u, r.degreeV, C, r.knotsV.slice(), I), new te(u, r.degreeV, F, r.knotsV.slice(), S)]);
|
|
11891
11891
|
}, oe.curveSplit = function(r, n) {
|
|
11892
11892
|
var a = r.degree;
|
|
11893
11893
|
r.controlPoints;
|
|
11894
11894
|
for (var l = r.knots, u, d = [], p = 0, _ = a + 1; p < _; )
|
|
11895
11895
|
p++, d.push(n);
|
|
11896
11896
|
u = d;
|
|
11897
|
-
var v = ft.curveKnotRefine(r, u), A = N.knotSpan(a, n, l),
|
|
11898
|
-
return [new Gt(a,
|
|
11897
|
+
var v = ft.curveKnotRefine(r, u), A = N.knotSpan(a, n, l), I = v.knots.slice(0, A + a + 2), S = v.knots.slice(A + 1), P = v.controlPoints.slice(0, A + 1), k = v.controlPoints.slice(A + 1);
|
|
11898
|
+
return [new Gt(a, I, P), new Gt(a, S, k)];
|
|
11899
11899
|
}, oe.rationalCurveByEqualArcLength = function(r, n) {
|
|
11900
11900
|
var a = yt.rationalCurveArcLength(r), l = a / n;
|
|
11901
11901
|
return oe.rationalCurveByArcLength(r, l);
|
|
11902
11902
|
}, oe.rationalCurveByArcLength = function(r, n) {
|
|
11903
|
-
var a = ft.decomposeCurveIntoBeziers(r), l = a.map(function(
|
|
11904
|
-
return yt.rationalBezierCurveArcLength(
|
|
11903
|
+
var a = ft.decomposeCurveIntoBeziers(r), l = a.map(function(P) {
|
|
11904
|
+
return yt.rationalBezierCurveArcLength(P);
|
|
11905
11905
|
}), u = m.sum(l), d = [new An(r.knots[0], 0)];
|
|
11906
11906
|
if (n > u) return d;
|
|
11907
|
-
for (var p = n, _ = 0, v = p, A = 0,
|
|
11907
|
+
for (var p = n, _ = 0, v = p, A = 0, I = 0, S; _ < a.length; ) {
|
|
11908
11908
|
for (A += l[_]; v < A + rt.EPSILON; )
|
|
11909
|
-
S = yt.rationalBezierCurveParamAtArcLength(a[_], v -
|
|
11910
|
-
|
|
11909
|
+
S = yt.rationalBezierCurveParamAtArcLength(a[_], v - I, rt.TOLERANCE, l[_]), d.push(new An(S, v)), v += p;
|
|
11910
|
+
I += l[_], _++;
|
|
11911
11911
|
}
|
|
11912
11912
|
return d;
|
|
11913
11913
|
};
|
|
@@ -11927,11 +11927,11 @@ var Ah = { exports: {} };
|
|
|
11927
11927
|
return m.cross(l[1][0], l[0][1]);
|
|
11928
11928
|
}, N.rationalSurfaceDerivatives = function(r, n, a, l) {
|
|
11929
11929
|
l == null && (l = 1);
|
|
11930
|
-
for (var u = N.surfaceDerivatives(r, n, a, l), d = N.rational2d(u), p = N.weight2d(u), _ = [], v = d[0][0].length, A = 0,
|
|
11930
|
+
for (var u = N.surfaceDerivatives(r, n, a, l), d = N.rational2d(u), p = N.weight2d(u), _ = [], v = d[0][0].length, A = 0, I = l + 1; A < I; ) {
|
|
11931
11931
|
var S = A++;
|
|
11932
11932
|
_.push([]);
|
|
11933
|
-
for (var
|
|
11934
|
-
for (var T =
|
|
11933
|
+
for (var P = 0, k = l - S + 1; P < k; ) {
|
|
11934
|
+
for (var T = P++, O = d[S][T], C = 1, F = T + 1; C < F; ) {
|
|
11935
11935
|
var R = C++;
|
|
11936
11936
|
m.subMulMutate(O, Ft.get(T, R) * p[0][R], _[S][T - R]);
|
|
11937
11937
|
}
|
|
@@ -11953,11 +11953,11 @@ var Ah = { exports: {} };
|
|
|
11953
11953
|
}, N.rationalCurveDerivatives = function(r, n, a) {
|
|
11954
11954
|
a == null && (a = 1);
|
|
11955
11955
|
for (var l = N.curveDerivatives(r, n, a), u = N.rational1d(l), d = N.weight1d(l), p = [], _ = 0, v = a + 1; _ < v; ) {
|
|
11956
|
-
for (var A = _++,
|
|
11956
|
+
for (var A = _++, I = u[A], S = 1, P = A + 1; S < P; ) {
|
|
11957
11957
|
var k = S++;
|
|
11958
|
-
m.subMulMutate(
|
|
11958
|
+
m.subMulMutate(I, Ft.get(A, k) * d[k], p[A - k]);
|
|
11959
11959
|
}
|
|
11960
|
-
m.mulMutate(1 / d[0],
|
|
11960
|
+
m.mulMutate(1 / d[0], I), p.push(I);
|
|
11961
11961
|
}
|
|
11962
11962
|
return p;
|
|
11963
11963
|
}, N.rationalCurvePoint = function(r, n) {
|
|
@@ -11966,13 +11966,13 @@ var Ah = { exports: {} };
|
|
|
11966
11966
|
var u = r.knotsU.length - r.degreeU - 2, d = r.knotsV.length - r.degreeV - 2;
|
|
11967
11967
|
return N.surfaceDerivativesGivenNM(u, d, r, n, a, l);
|
|
11968
11968
|
}, N.surfaceDerivativesGivenNM = function(r, n, a, l, u, d) {
|
|
11969
|
-
var p = a.degreeU, _ = a.degreeV, v = a.controlPoints, A = a.knotsU,
|
|
11970
|
-
if (!N.areValidRelations(p, v.length, A.length) || !N.areValidRelations(_, v[0].length,
|
|
11971
|
-
var S = v[0][0].length,
|
|
11972
|
-
d < p ?
|
|
11969
|
+
var p = a.degreeU, _ = a.degreeV, v = a.controlPoints, A = a.knotsU, I = a.knotsV;
|
|
11970
|
+
if (!N.areValidRelations(p, v.length, A.length) || !N.areValidRelations(_, v[0].length, I.length)) throw new Q("Invalid relations between control points, knot vector, and n");
|
|
11971
|
+
var S = v[0][0].length, P;
|
|
11972
|
+
d < p ? P = d : P = p;
|
|
11973
11973
|
var k;
|
|
11974
11974
|
d < _ ? k = d : k = _;
|
|
11975
|
-
for (var T = m.zeros3d(d + 1, d + 1, S), O = N.knotSpanGivenN(r, p, l, A), C = N.knotSpanGivenN(n, _, u,
|
|
11975
|
+
for (var T = m.zeros3d(d + 1, d + 1, S), O = N.knotSpanGivenN(r, p, l, A), C = N.knotSpanGivenN(n, _, u, I), F = N.derivativeBasisFunctionsGivenNI(O, l, p, r, A), R = N.derivativeBasisFunctionsGivenNI(C, u, _, n, I), U = m.zeros2d(_ + 1, S), V = 0, q = 0, J = P + 1; q < J; ) {
|
|
11976
11976
|
for (var H = q++, G = 0, K = _ + 1; G < K; ) {
|
|
11977
11977
|
var tt = G++;
|
|
11978
11978
|
U[tt] = m.zeros1d(S);
|
|
@@ -11987,8 +11987,8 @@ var Ah = { exports: {} };
|
|
|
11987
11987
|
var mt = ct++;
|
|
11988
11988
|
T[H][mt] = m.zeros1d(S);
|
|
11989
11989
|
for (var X = 0, gt = _ + 1; X < gt; ) {
|
|
11990
|
-
var
|
|
11991
|
-
m.addMulMutate(T[H][mt], R[mt][
|
|
11990
|
+
var It = X++;
|
|
11991
|
+
m.addMulMutate(T[H][mt], R[mt][It], U[It]);
|
|
11992
11992
|
}
|
|
11993
11993
|
}
|
|
11994
11994
|
}
|
|
@@ -11999,9 +11999,9 @@ var Ah = { exports: {} };
|
|
|
11999
11999
|
}, N.surfacePointGivenNM = function(r, n, a, l, u) {
|
|
12000
12000
|
var d = a.degreeU, p = a.degreeV, _ = a.controlPoints, v = a.knotsU, A = a.knotsV;
|
|
12001
12001
|
if (!N.areValidRelations(d, _.length, v.length) || !N.areValidRelations(p, _[0].length, A.length)) throw new Q("Invalid relations between control points, knot vector, and n");
|
|
12002
|
-
for (var
|
|
12002
|
+
for (var I = _[0][0].length, S = N.knotSpanGivenN(r, d, l, v), P = N.knotSpanGivenN(n, p, u, A), k = N.basisFunctionsGivenKnotSpanIndex(S, l, d, v), T = N.basisFunctionsGivenKnotSpanIndex(P, u, p, A), O = S - d, C = P, F = m.zeros1d(I), R = m.zeros1d(I), U = 0, V = p + 1; U < V; ) {
|
|
12003
12003
|
var q = U++;
|
|
12004
|
-
R = m.zeros1d(
|
|
12004
|
+
R = m.zeros1d(I), C = P - p + q;
|
|
12005
12005
|
for (var J = 0, H = d + 1; J < H; ) {
|
|
12006
12006
|
var G = J++;
|
|
12007
12007
|
m.addMulMutate(R, k[G], _[O + G][C]);
|
|
@@ -12010,19 +12010,19 @@ var Ah = { exports: {} };
|
|
|
12010
12010
|
}
|
|
12011
12011
|
return F;
|
|
12012
12012
|
}, N.curveRegularSamplePoints = function(r, n) {
|
|
12013
|
-
for (var a = N.curveDerivatives(r, r.knots[0], r.degree), l = 1 / n, u = l * l, d = a[0], p = m.mul(l, a[1]), _ = m.mul(u * 0.5, a[2]), v = m.mul(u * l * 0.5, a[3]), A = m.add(_, _),
|
|
12014
|
-
k++,
|
|
12015
|
-
return
|
|
12013
|
+
for (var a = N.curveDerivatives(r, r.knots[0], r.degree), l = 1 / n, u = l * l, d = a[0], p = m.mul(l, a[1]), _ = m.mul(u * 0.5, a[2]), v = m.mul(u * l * 0.5, a[3]), A = m.add(_, _), I = m.add(v, v), S = m.mul(0.3333333333333333, v), P = [], k = 0, T = n + 1; k < T; )
|
|
12014
|
+
k++, P.push(N.dehomogenize(d)), m.addAllMutate([d, p, _, S]), m.addAllMutate([p, A, v]), m.addAllMutate([A, I]), m.addAllMutate([_, v]);
|
|
12015
|
+
return P;
|
|
12016
12016
|
}, N.curveRegularSamplePoints2 = function(r, n) {
|
|
12017
|
-
for (var a = N.curveDerivatives(r, r.knots[0], r.degree), l = 1 / n, u = l * l, d = a[0], p = m.mul(l, a[1]), _ = m.mul(u * 0.5, a[2]), v = m.mul(u * l * 0.5, a[3]), A = m.add(_, _),
|
|
12018
|
-
k++,
|
|
12019
|
-
return
|
|
12017
|
+
for (var a = N.curveDerivatives(r, r.knots[0], r.degree), l = 1 / n, u = l * l, d = a[0], p = m.mul(l, a[1]), _ = m.mul(u * 0.5, a[2]), v = m.mul(u * l * 0.5, a[3]), A = m.add(_, _), I = m.add(v, v), S = m.mul(0.3333333333333333, v), P = [], k = 0, T = n + 1; k < T; )
|
|
12018
|
+
k++, P.push(N.dehomogenize(d)), m.addAllMutate([d, p, _, S]), m.addAllMutate([p, A, v]), m.addAllMutate([A, I]), m.addAllMutate([_, v]);
|
|
12019
|
+
return P;
|
|
12020
12020
|
}, N.rationalSurfaceRegularSampleDerivatives = function(r, n, a, l) {
|
|
12021
12021
|
for (var u = N.surfaceRegularSampleDerivatives(r, n, a, l), d = [], p = n + 1, _ = a + 1, v = l + 1, A = 0; A < p; ) {
|
|
12022
|
-
var
|
|
12022
|
+
var I = A++, S = [];
|
|
12023
12023
|
d.push(S);
|
|
12024
|
-
for (var
|
|
12025
|
-
for (var k =
|
|
12024
|
+
for (var P = 0; P < _; ) {
|
|
12025
|
+
for (var k = P++, T = u[I][k], O = N.rational2d(T), C = N.weight2d(T), F = [], R = O[0][0].length, U = 0; U < v; ) {
|
|
12026
12026
|
var V = U++;
|
|
12027
12027
|
F.push([]);
|
|
12028
12028
|
for (var q = 0, J = v - V; q < J; ) {
|
|
@@ -12049,12 +12049,12 @@ var Ah = { exports: {} };
|
|
|
12049
12049
|
}, N.surfaceRegularSampleDerivatives = function(r, n, a, l) {
|
|
12050
12050
|
var u = r.degreeU, d = r.degreeV, p = r.controlPoints, _ = r.knotsU, v = r.knotsV, A = p[0][0].length;
|
|
12051
12051
|
($.last(_) - _[0]) / n, ($.last(v) - v[0]) / a;
|
|
12052
|
-
for (var
|
|
12052
|
+
for (var I = N.regularlySpacedDerivativeBasisFunctions(u, _, n), S = I.item0, P = I.item1, k = N.regularlySpacedDerivativeBasisFunctions(d, v, a), T = k.item0, O = k.item1, C = [], F = n + 1, R = a + 1, U = 0; U < F; ) {
|
|
12053
12053
|
var V = U++, q = [];
|
|
12054
12054
|
C.push(q);
|
|
12055
12055
|
for (var J = 0; J < R; ) {
|
|
12056
12056
|
var H = J++;
|
|
12057
|
-
q.push(N.surfaceDerivativesGivenBasesKnotSpans(u, d, p, S[V], T[H],
|
|
12057
|
+
q.push(N.surfaceDerivativesGivenBasesKnotSpans(u, d, p, S[V], T[H], P[V], O[H], A, l));
|
|
12058
12058
|
}
|
|
12059
12059
|
}
|
|
12060
12060
|
return C;
|
|
@@ -12063,44 +12063,44 @@ var Ah = { exports: {} };
|
|
|
12063
12063
|
}, N.surfaceRegularSamplePoints = function(r, n, a) {
|
|
12064
12064
|
var l = r.degreeU, u = r.degreeV, d = r.controlPoints, p = r.knotsU, _ = r.knotsV, v = d[0][0].length;
|
|
12065
12065
|
($.last(p) - p[0]) / n, ($.last(_) - _[0]) / a;
|
|
12066
|
-
for (var A = N.regularlySpacedBasisFunctions(l, p, n),
|
|
12066
|
+
for (var A = N.regularlySpacedBasisFunctions(l, p, n), I = A.item0, S = A.item1, P = N.regularlySpacedBasisFunctions(u, _, a), k = P.item0, T = P.item1, O = [], C = n + 1, F = a + 1, R = 0; R < C; ) {
|
|
12067
12067
|
var U = R++, V = [];
|
|
12068
12068
|
O.push(V);
|
|
12069
12069
|
for (var q = 0; q < F; ) {
|
|
12070
12070
|
var J = q++;
|
|
12071
|
-
V.push(N.surfacePointGivenBasesKnotSpans(l, u, d,
|
|
12071
|
+
V.push(N.surfacePointGivenBasesKnotSpans(l, u, d, I[U], k[J], S[U], T[J], v));
|
|
12072
12072
|
}
|
|
12073
12073
|
}
|
|
12074
12074
|
return O;
|
|
12075
12075
|
}, N.regularlySpacedBasisFunctions = function(r, n, a) {
|
|
12076
|
-
for (var l = n.length - r - 2, u = ($.last(n) - n[0]) / a, d = [], p = [], _ = n[0], v = N.knotSpanGivenN(l, r, _, n), A = a + 1,
|
|
12077
|
-
for (
|
|
12076
|
+
for (var l = n.length - r - 2, u = ($.last(n) - n[0]) / a, d = [], p = [], _ = n[0], v = N.knotSpanGivenN(l, r, _, n), A = a + 1, I = 0; I < A; ) {
|
|
12077
|
+
for (I++; _ >= n[v + 1]; ) v++;
|
|
12078
12078
|
p.push(v), d.push(N.basisFunctionsGivenKnotSpanIndex(v, _, r, n)), _ += u;
|
|
12079
12079
|
}
|
|
12080
12080
|
return new ee(p, d);
|
|
12081
12081
|
}, N.regularlySpacedDerivativeBasisFunctions = function(r, n, a) {
|
|
12082
|
-
for (var l = n.length - r - 2, u = ($.last(n) - n[0]) / a, d = [], p = [], _ = n[0], v = N.knotSpanGivenN(l, r, _, n), A = a + 1,
|
|
12083
|
-
for (
|
|
12082
|
+
for (var l = n.length - r - 2, u = ($.last(n) - n[0]) / a, d = [], p = [], _ = n[0], v = N.knotSpanGivenN(l, r, _, n), A = a + 1, I = 0; I < A; ) {
|
|
12083
|
+
for (I++; _ >= n[v + 1]; ) v++;
|
|
12084
12084
|
p.push(v), d.push(N.derivativeBasisFunctionsGivenNI(v, _, r, l, n)), _ += u;
|
|
12085
12085
|
}
|
|
12086
12086
|
return new ee(p, d);
|
|
12087
12087
|
}, N.surfacePointGivenBasesKnotSpans = function(r, n, a, l, u, d, p, _) {
|
|
12088
|
-
for (var v = m.zeros1d(_), A,
|
|
12089
|
-
var T =
|
|
12088
|
+
for (var v = m.zeros1d(_), A, I = l - r, S = u - n, P = 0, k = n + 1; P < k; ) {
|
|
12089
|
+
var T = P++;
|
|
12090
12090
|
A = m.zeros1d(_);
|
|
12091
12091
|
for (var O = 0, C = r + 1; O < C; ) {
|
|
12092
12092
|
var F = O++;
|
|
12093
|
-
m.addMulMutate(A, d[F], a[
|
|
12093
|
+
m.addMulMutate(A, d[F], a[I + F][S]);
|
|
12094
12094
|
}
|
|
12095
12095
|
S++, m.addMulMutate(v, p[T], A);
|
|
12096
12096
|
}
|
|
12097
12097
|
return v;
|
|
12098
12098
|
}, N.surfaceDerivativesGivenBasesKnotSpans = function(r, n, a, l, u, d, p, _, v) {
|
|
12099
|
-
var A = a[0][0].length,
|
|
12100
|
-
v < r ?
|
|
12099
|
+
var A = a[0][0].length, I;
|
|
12100
|
+
v < r ? I = v : I = r;
|
|
12101
12101
|
var S;
|
|
12102
12102
|
v < n ? S = v : S = n;
|
|
12103
|
-
for (var
|
|
12103
|
+
for (var P = m.zeros3d(I + 1, S + 1, A), k = m.zeros2d(n + 1, A), T = 0, O = 0, C = I + 1; O < C; ) {
|
|
12104
12104
|
for (var F = O++, R = 0, U = n + 1; R < U; ) {
|
|
12105
12105
|
var V = R++;
|
|
12106
12106
|
k[V] = m.zeros1d(A);
|
|
@@ -12113,14 +12113,14 @@ var Ah = { exports: {} };
|
|
|
12113
12113
|
G < S ? T = G : T = S;
|
|
12114
12114
|
for (var K = 0, tt = T + 1; K < tt; ) {
|
|
12115
12115
|
var et = K++;
|
|
12116
|
-
|
|
12116
|
+
P[F][et] = m.zeros1d(A);
|
|
12117
12117
|
for (var it = 0, ht = n + 1; it < ht; ) {
|
|
12118
12118
|
var at = it++;
|
|
12119
|
-
m.addMulMutate(
|
|
12119
|
+
m.addMulMutate(P[F][et], p[et][at], k[at]);
|
|
12120
12120
|
}
|
|
12121
12121
|
}
|
|
12122
12122
|
}
|
|
12123
|
-
return
|
|
12123
|
+
return P;
|
|
12124
12124
|
}, N.curveDerivatives = function(r, n, a) {
|
|
12125
12125
|
var l = r.knots.length - r.degree - 2;
|
|
12126
12126
|
return N.curveDerivativesGivenN(l, r, n, a);
|
|
@@ -12129,10 +12129,10 @@ var Ah = { exports: {} };
|
|
|
12129
12129
|
if (!N.areValidRelations(u, d.length, p.length)) throw new Q("Invalid relations between control points, knot vector, and n");
|
|
12130
12130
|
var _ = d[0].length, v;
|
|
12131
12131
|
l < u ? v = l : v = u;
|
|
12132
|
-
for (var A = m.zeros2d(l + 1, _),
|
|
12133
|
-
for (var T =
|
|
12132
|
+
for (var A = m.zeros2d(l + 1, _), I = N.knotSpanGivenN(r, u, a, p), S = N.derivativeBasisFunctionsGivenNI(I, a, u, v, p), P = 0, k = v + 1; P < k; )
|
|
12133
|
+
for (var T = P++, O = 0, C = u + 1; O < C; ) {
|
|
12134
12134
|
var F = O++;
|
|
12135
|
-
m.addMulMutate(A[T], S[T][F], d[
|
|
12135
|
+
m.addMulMutate(A[T], S[T][F], d[I - u + F]);
|
|
12136
12136
|
}
|
|
12137
12137
|
return A;
|
|
12138
12138
|
}, N.curvePoint = function(r, n) {
|
|
@@ -12144,7 +12144,7 @@ var Ah = { exports: {} };
|
|
|
12144
12144
|
var l = n.degree, u = n.controlPoints, d = n.knots;
|
|
12145
12145
|
if (!N.areValidRelations(l, u.length, d.length))
|
|
12146
12146
|
throw new Q("Invalid relations between control points, knot Array, and n");
|
|
12147
|
-
for (var p = N.knotSpanGivenN(r, l, a, d), _ = N.basisFunctionsGivenKnotSpanIndex(p, a, l, d), v = m.zeros1d(u[0].length), A = 0,
|
|
12147
|
+
for (var p = N.knotSpanGivenN(r, l, a, d), _ = N.basisFunctionsGivenKnotSpanIndex(p, a, l, d), v = m.zeros1d(u[0].length), A = 0, I = l + 1; A < I; ) {
|
|
12148
12148
|
var S = A++;
|
|
12149
12149
|
m.addMulMutate(v, _[S], u[p - l + S]);
|
|
12150
12150
|
}
|
|
@@ -12154,10 +12154,10 @@ var Ah = { exports: {} };
|
|
|
12154
12154
|
return N.volumePointGivenNML(r, u, d, p, n, a, l);
|
|
12155
12155
|
}, N.volumePointGivenNML = function(r, n, a, l, u, d, p) {
|
|
12156
12156
|
if (!N.areValidRelations(r.degreeU, r.controlPoints.length, r.knotsU.length) || !N.areValidRelations(r.degreeV, r.controlPoints[0].length, r.knotsV.length) || !N.areValidRelations(r.degreeW, r.controlPoints[0][0].length, r.knotsW.length)) throw new Q("Invalid relations between control points and knot vector");
|
|
12157
|
-
for (var _ = r.controlPoints, v = r.degreeU, A = r.degreeV,
|
|
12157
|
+
for (var _ = r.controlPoints, v = r.degreeU, A = r.degreeV, I = r.degreeW, S = r.knotsU, P = r.knotsV, k = r.knotsW, T = _[0][0][0].length, O = N.knotSpanGivenN(n, v, u, S), C = N.knotSpanGivenN(a, A, d, P), F = N.knotSpanGivenN(l, I, p, k), R = N.basisFunctionsGivenKnotSpanIndex(O, u, v, S), U = N.basisFunctionsGivenKnotSpanIndex(C, d, A, P), V = N.basisFunctionsGivenKnotSpanIndex(F, p, I, k), q = O - v, J = m.zeros1d(T), H = m.zeros1d(T), G = m.zeros1d(T), K = 0, tt = I + 1; K < tt; ) {
|
|
12158
12158
|
var et = K++;
|
|
12159
12159
|
G = m.zeros1d(T);
|
|
12160
|
-
for (var it = F -
|
|
12160
|
+
for (var it = F - I + et, ht = 0, at = A + 1; ht < at; ) {
|
|
12161
12161
|
var ct = ht++;
|
|
12162
12162
|
H = m.zeros1d(T);
|
|
12163
12163
|
for (var nt = C - A + ct, mt = 0, X = v + 1; mt < X; ) {
|
|
@@ -12175,14 +12175,14 @@ var Ah = { exports: {} };
|
|
|
12175
12175
|
}, N.derivativeBasisFunctionsGivenNI = function(r, n, a, l, u) {
|
|
12176
12176
|
var d = m.zeros2d(a + 1, a + 1), p = m.zeros1d(a + 1), _ = m.zeros1d(a + 1), v = 0, A = 0;
|
|
12177
12177
|
d[0][0] = 1;
|
|
12178
|
-
for (var
|
|
12179
|
-
var
|
|
12180
|
-
p[
|
|
12181
|
-
for (var k = 0; k <
|
|
12178
|
+
for (var I = 1, S = a + 1; I < S; ) {
|
|
12179
|
+
var P = I++;
|
|
12180
|
+
p[P] = n - u[r + 1 - P], _[P] = u[r + P] - n, v = 0;
|
|
12181
|
+
for (var k = 0; k < P; ) {
|
|
12182
12182
|
var T = k++;
|
|
12183
|
-
d[
|
|
12183
|
+
d[P][T] = _[T + 1] + p[P - T], A = d[T][P - 1] / d[P][T], d[T][P] = v + _[T + 1] * A, v = p[P - T] * A;
|
|
12184
12184
|
}
|
|
12185
|
-
d[
|
|
12185
|
+
d[P][P] = v;
|
|
12186
12186
|
}
|
|
12187
12187
|
for (var O = m.zeros2d(l + 1, a + 1), C = m.zeros2d(2, a + 1), F = 0, R = 1, U = 0, V = 0, q = 0, J = 0, H = 0, G = 0, K = a + 1; G < K; ) {
|
|
12188
12188
|
var tt = G++;
|
|
@@ -12199,12 +12199,12 @@ var Ah = { exports: {} };
|
|
|
12199
12199
|
C[R][gt] = (C[F][gt] - C[F][gt - 1]) / d[q + 1][V + gt], U += C[R][gt] * d[V + gt][q];
|
|
12200
12200
|
}
|
|
12201
12201
|
ht <= q && (C[R][nt] = -C[F][nt - 1] / d[q + 1][ht], U += C[R][nt] * d[ht][q]), O[nt][ht] = U;
|
|
12202
|
-
var
|
|
12203
|
-
F = R, R =
|
|
12202
|
+
var It = F;
|
|
12203
|
+
F = R, R = It;
|
|
12204
12204
|
}
|
|
12205
12205
|
}
|
|
12206
12206
|
for (var jt = a, Xt = 1, Dt = l + 1; Xt < Dt; ) {
|
|
12207
|
-
for (var Kt = Xt++, Ae = 0,
|
|
12207
|
+
for (var Kt = Xt++, Ae = 0, He = a + 1; Ae < He; ) {
|
|
12208
12208
|
var _e = Ae++;
|
|
12209
12209
|
O[Kt][_e] *= jt;
|
|
12210
12210
|
}
|
|
@@ -12217,11 +12217,11 @@ var Ah = { exports: {} };
|
|
|
12217
12217
|
}, N.basisFunctionsGivenKnotSpanIndex = function(r, n, a, l) {
|
|
12218
12218
|
var u = m.zeros1d(a + 1), d = m.zeros1d(a + 1), p = m.zeros1d(a + 1), _ = 0, v = 0;
|
|
12219
12219
|
u[0] = 1;
|
|
12220
|
-
for (var A = 1,
|
|
12220
|
+
for (var A = 1, I = a + 1; A < I; ) {
|
|
12221
12221
|
var S = A++;
|
|
12222
12222
|
d[S] = n - l[r + 1 - S], p[S] = l[r + S] - n, _ = 0;
|
|
12223
|
-
for (var
|
|
12224
|
-
var k =
|
|
12223
|
+
for (var P = 0; P < S; ) {
|
|
12224
|
+
var k = P++;
|
|
12225
12225
|
v = u[k] / (p[k + 1] + d[S - k]), u[k] = _ + p[k + 1] * v, _ = d[S - k] * v;
|
|
12226
12226
|
}
|
|
12227
12227
|
u[S] = _;
|
|
@@ -12263,13 +12263,13 @@ var Ah = { exports: {} };
|
|
|
12263
12263
|
var a = r.length, l = r[0].length, u = [], d = 0, p = [], _;
|
|
12264
12264
|
n != null ? _ = n : _ = m.rep(r.length, 1);
|
|
12265
12265
|
for (var v = 0; v < a; ) {
|
|
12266
|
-
var A = v++,
|
|
12266
|
+
var A = v++, I = [];
|
|
12267
12267
|
p = r[A], d = _[A];
|
|
12268
12268
|
for (var S = 0; S < l; ) {
|
|
12269
|
-
var
|
|
12270
|
-
|
|
12269
|
+
var P = S++;
|
|
12270
|
+
I.push(p[P] * d);
|
|
12271
12271
|
}
|
|
12272
|
-
|
|
12272
|
+
I.push(d), u.push(I);
|
|
12273
12273
|
}
|
|
12274
12274
|
return u;
|
|
12275
12275
|
}, N.homogenize2d = function(r, n) {
|
|
@@ -12300,12 +12300,12 @@ var Ah = { exports: {} };
|
|
|
12300
12300
|
}), 3);
|
|
12301
12301
|
});
|
|
12302
12302
|
}, lt.surfacesAtPointWithEstimate = function(r, n, a, l, u) {
|
|
12303
|
-
var d, p, _, v, A,
|
|
12303
|
+
var d, p, _, v, A, I, S, P, k, T, O, C, F, R = 5, U = 0;
|
|
12304
12304
|
do {
|
|
12305
|
-
if (d = N.rationalSurfaceDerivatives(r, a[0], a[1], 1), p = d[0][0], v = d[1][0], A = d[0][1], _ = m.normalized(m.cross(v, A)),
|
|
12306
|
-
var V = m.normalized(m.cross(_, k)), q = m.dot(V, p), J = lt.threePlanes(_,
|
|
12305
|
+
if (d = N.rationalSurfaceDerivatives(r, a[0], a[1], 1), p = d[0][0], v = d[1][0], A = d[0][1], _ = m.normalized(m.cross(v, A)), I = m.dot(_, p), S = N.rationalSurfaceDerivatives(n, l[0], l[1], 1), P = S[0][0], T = S[1][0], O = S[0][1], k = m.normalized(m.cross(T, O)), C = m.dot(k, P), F = m.distSquared(p, P), F < u * u) break;
|
|
12306
|
+
var V = m.normalized(m.cross(_, k)), q = m.dot(V, p), J = lt.threePlanes(_, I, k, C, V, q);
|
|
12307
12307
|
if (J == null) throw new Q("panic!");
|
|
12308
|
-
var H = m.sub(J, p), G = m.sub(J,
|
|
12308
|
+
var H = m.sub(J, p), G = m.sub(J, P), K = m.cross(v, _), tt = m.cross(A, _), et = m.cross(T, k), it = m.cross(O, k), ht = m.dot(tt, H) / m.dot(tt, v), at = m.dot(K, H) / m.dot(K, A), ct = m.dot(it, G) / m.dot(it, T), nt = m.dot(et, G) / m.dot(et, O);
|
|
12309
12309
|
a = m.add([ht, at], a), l = m.add([ct, nt], l), U++;
|
|
12310
12310
|
} while (U < R);
|
|
12311
12311
|
return new Wn(a, l, p, F);
|
|
@@ -12318,14 +12318,14 @@ var Ah = { exports: {} };
|
|
|
12318
12318
|
}).filter(function(p) {
|
|
12319
12319
|
return m.distSquared(p.min.point, p.max.point) > rt.EPSILON;
|
|
12320
12320
|
}), function(p, _) {
|
|
12321
|
-
var v = m.sub(p.min.uv0, _.min.uv0), A = m.dot(v, v),
|
|
12321
|
+
var v = m.sub(p.min.uv0, _.min.uv0), A = m.dot(v, v), I = m.sub(p.max.uv0, _.max.uv0), S = m.dot(I, I), P = m.sub(p.min.uv0, _.max.uv0), k = m.dot(P, P), T = m.sub(p.max.uv0, _.min.uv0), O = m.dot(T, T);
|
|
12322
12322
|
return A < rt.EPSILON && S < rt.EPSILON || k < rt.EPSILON && O < rt.EPSILON;
|
|
12323
12323
|
});
|
|
12324
12324
|
return lt.makeMeshIntersectionPolylines(d);
|
|
12325
12325
|
}, lt.meshSlices = function(r, n, a, l) {
|
|
12326
|
-
for (var u = new Cr(r), d = u.boundingBox(), p = d.min[0], _ = d.min[1], v = d.max[0], A = d.max[1],
|
|
12327
|
-
var k = P
|
|
12328
|
-
++
|
|
12326
|
+
for (var u = new Cr(r), d = u.boundingBox(), p = d.min[0], _ = d.min[1], v = d.max[0], A = d.max[1], I = m.span(n, a, l), S = [], P = 0; P < I.length; ) {
|
|
12327
|
+
var k = I[P];
|
|
12328
|
+
++P;
|
|
12329
12329
|
var T = [[p, _, k], [v, _, k], [v, A, k], [p, A, k]], O = [[0, 0], [1, 0], [1, 1], [0, 1]], C = [[0, 1, 2], [0, 2, 3]], F = new qe(C, T, null, O);
|
|
12330
12330
|
S.push(lt.meshes(r, F, u));
|
|
12331
12331
|
}
|
|
@@ -12347,21 +12347,21 @@ var Ah = { exports: {} };
|
|
|
12347
12347
|
A != null && A.adj == null && (v.adj = A, A.adj = v);
|
|
12348
12348
|
}
|
|
12349
12349
|
}
|
|
12350
|
-
var
|
|
12350
|
+
var I = u.filter(function(R) {
|
|
12351
12351
|
return R.adj == null;
|
|
12352
12352
|
});
|
|
12353
|
-
|
|
12354
|
-
for (var S = [],
|
|
12355
|
-
var T =
|
|
12353
|
+
I.length == 0 && (I = u);
|
|
12354
|
+
for (var S = [], P = 0, k = !1; I.length != 0; ) {
|
|
12355
|
+
var T = I.pop();
|
|
12356
12356
|
if (!T.visited) {
|
|
12357
|
-
for (var O = [], C = T; C != null && !(C.visited || (C.visited = !0, C.opp.visited = !0, O.push(C),
|
|
12357
|
+
for (var O = [], C = T; C != null && !(C.visited || (C.visited = !0, C.opp.visited = !0, O.push(C), P += 2, C = C.opp.adj, C == T)); )
|
|
12358
12358
|
;
|
|
12359
12359
|
O.length > 0 && (O.push(O[O.length - 1].opp), S.push(O));
|
|
12360
12360
|
}
|
|
12361
|
-
if (
|
|
12361
|
+
if (I.length == 0 && u.length > 0 && (k || P < u.length)) {
|
|
12362
12362
|
k = !0;
|
|
12363
12363
|
var F = u.pop();
|
|
12364
|
-
|
|
12364
|
+
I.push(F);
|
|
12365
12365
|
}
|
|
12366
12366
|
}
|
|
12367
12367
|
return S;
|
|
@@ -12382,7 +12382,7 @@ var Ah = { exports: {} };
|
|
|
12382
12382
|
a == null && (a = 1e-3), l != null ? l = l : l = new ir(r), u != null ? u = u : u = new Nr(n);
|
|
12383
12383
|
var d = lt.boundingBoxTrees(l, u, a);
|
|
12384
12384
|
return $.unique(d.map(function(p) {
|
|
12385
|
-
var _ = p.item0, v = p.item1, A = $.first(_.knots),
|
|
12385
|
+
var _ = p.item0, v = p.item1, A = $.first(_.knots), I = $.last(_.knots), S = (A + I) / 2, P = $.first(v.knotsU), k = $.last(v.knotsU), T = $.first(v.knotsV), O = $.last(v.knotsV), C = [(P + k) / 2, (T + O) / 2];
|
|
12386
12386
|
return lt.curveAndSurfaceWithEstimate(_, v, [S].concat(C), a);
|
|
12387
12387
|
}).filter(function(p) {
|
|
12388
12388
|
return m.distSquared(p.curvePoint, p.surfacePoint) < a * a;
|
|
@@ -12392,11 +12392,11 @@ var Ah = { exports: {} };
|
|
|
12392
12392
|
}, lt.curveAndSurfaceWithEstimate = function(r, n, a, l) {
|
|
12393
12393
|
l == null && (l = 1e-3);
|
|
12394
12394
|
var u = function(v) {
|
|
12395
|
-
var A = N.rationalCurvePoint(r, v[0]),
|
|
12395
|
+
var A = N.rationalCurvePoint(r, v[0]), I = N.rationalSurfacePoint(n, v[1], v[2]), S = m.sub(A, I);
|
|
12396
12396
|
return m.dot(S, S);
|
|
12397
12397
|
}, d = function(v) {
|
|
12398
|
-
var A = N.rationalCurveDerivatives(r, v[0], 1),
|
|
12399
|
-
return [2 * m.dot(
|
|
12398
|
+
var A = N.rationalCurveDerivatives(r, v[0], 1), I = N.rationalSurfaceDerivatives(n, v[1], v[2], 1), S = m.sub(I[0][0], A[0]), P = m.mul(-1, A[1]), k = I[1][0], T = I[0][1];
|
|
12399
|
+
return [2 * m.dot(P, S), 2 * m.dot(k, S), 2 * m.dot(T, S)];
|
|
12400
12400
|
}, p = Xe.uncmin(u, a, l * l, d), _ = p.solution;
|
|
12401
12401
|
return new Gn(_[0], [_[1], _[2]], N.rationalCurvePoint(r, _[0]), N.rationalSurfacePoint(n, _[1], _[2]));
|
|
12402
12402
|
}, lt.polylineAndMesh = function(r, n, a) {
|
|
@@ -12405,8 +12405,8 @@ var Ah = { exports: {} };
|
|
|
12405
12405
|
++d;
|
|
12406
12406
|
var _ = p.item0, v = p.item1, A = lt.segmentWithTriangle(r.points[_], r.points[_ + 1], n.points, n.faces[v]);
|
|
12407
12407
|
if (A != null) {
|
|
12408
|
-
var
|
|
12409
|
-
u.push(new jn(
|
|
12408
|
+
var I = A.point, S = m.lerp(A.p, [r.params[_]], [r.params[_ + 1]])[0], P = re.triangleUVFromPoint(n, v, I);
|
|
12409
|
+
u.push(new jn(I, S, P, _, v));
|
|
12410
12410
|
}
|
|
12411
12411
|
}
|
|
12412
12412
|
return u;
|
|
@@ -12422,16 +12422,16 @@ var Ah = { exports: {} };
|
|
|
12422
12422
|
d.push(new ee(p.yield(), _.yield()));
|
|
12423
12423
|
continue;
|
|
12424
12424
|
} else if (v && !A) {
|
|
12425
|
-
var
|
|
12426
|
-
l.push(p), u.push(
|
|
12425
|
+
var I = _.split();
|
|
12426
|
+
l.push(p), u.push(I.item1), l.push(p), u.push(I.item0);
|
|
12427
12427
|
continue;
|
|
12428
12428
|
} else if (!v && A) {
|
|
12429
12429
|
var S = p.split();
|
|
12430
12430
|
l.push(S.item1), u.push(_), l.push(S.item0), u.push(_);
|
|
12431
12431
|
continue;
|
|
12432
12432
|
}
|
|
12433
|
-
var
|
|
12434
|
-
l.push(
|
|
12433
|
+
var P = p.split(), k = _.split();
|
|
12434
|
+
l.push(P.item1), u.push(k.item1), l.push(P.item1), u.push(k.item0), l.push(P.item0), u.push(k.item1), l.push(P.item0), u.push(k.item0);
|
|
12435
12435
|
}
|
|
12436
12436
|
}
|
|
12437
12437
|
return d;
|
|
@@ -12445,32 +12445,32 @@ var Ah = { exports: {} };
|
|
|
12445
12445
|
return Math.abs(u.u0 - d.u0) < a * 5;
|
|
12446
12446
|
});
|
|
12447
12447
|
}, lt.curvesWithEstimate = function(r, n, a, l, u) {
|
|
12448
|
-
var d = function(
|
|
12449
|
-
var k = N.rationalCurvePoint(r,
|
|
12448
|
+
var d = function(P) {
|
|
12449
|
+
var k = N.rationalCurvePoint(r, P[0]), T = N.rationalCurvePoint(n, P[1]), O = m.sub(k, T);
|
|
12450
12450
|
return m.dot(O, O);
|
|
12451
|
-
}, p = function(
|
|
12452
|
-
var k = N.rationalCurveDerivatives(r,
|
|
12451
|
+
}, p = function(P) {
|
|
12452
|
+
var k = N.rationalCurveDerivatives(r, P[0], 1), T = N.rationalCurveDerivatives(n, P[1], 1), O = m.sub(k[0], T[0]), C = k[1], F = m.mul(-1, T[1]);
|
|
12453
12453
|
return [2 * m.dot(C, O), 2 * m.dot(F, O)];
|
|
12454
|
-
}, _ = Xe.uncmin(d, [a, l], u * u, p), v = _.solution[0], A = _.solution[1],
|
|
12455
|
-
return new Hr(
|
|
12454
|
+
}, _ = Xe.uncmin(d, [a, l], u * u, p), v = _.solution[0], A = _.solution[1], I = N.rationalCurvePoint(r, v), S = N.rationalCurvePoint(n, A);
|
|
12455
|
+
return new Hr(I, S, v, A);
|
|
12456
12456
|
}, lt.triangles = function(r, n, a, l) {
|
|
12457
|
-
var u = r.faces[n], d = a.faces[l], p = re.getTriangleNorm(r.points, u), _ = re.getTriangleNorm(a.points, d), v = r.points[u[0]], A = a.points[d[0]],
|
|
12458
|
-
if (P == null) return null;
|
|
12459
|
-
var S = lt.clipRayInCoplanarTriangle(P, r, n);
|
|
12460
|
-
if (S == null) return null;
|
|
12461
|
-
var I = lt.clipRayInCoplanarTriangle(P, a, l);
|
|
12457
|
+
var u = r.faces[n], d = a.faces[l], p = re.getTriangleNorm(r.points, u), _ = re.getTriangleNorm(a.points, d), v = r.points[u[0]], A = a.points[d[0]], I = lt.planes(v, p, A, _);
|
|
12462
12458
|
if (I == null) return null;
|
|
12463
|
-
var
|
|
12459
|
+
var S = lt.clipRayInCoplanarTriangle(I, r, n);
|
|
12460
|
+
if (S == null) return null;
|
|
12461
|
+
var P = lt.clipRayInCoplanarTriangle(I, a, l);
|
|
12462
|
+
if (P == null) return null;
|
|
12463
|
+
var k = lt.mergeTriangleClipIntervals(S, P, r, n, a, l);
|
|
12464
12464
|
return k == null ? null : new we(new Tr(k.min.uv0, k.min.uv1, k.min.point, n, l), new Tr(k.max.uv0, k.max.uv1, k.max.point, n, l));
|
|
12465
12465
|
}, lt.clipRayInCoplanarTriangle = function(r, n, a) {
|
|
12466
|
-
for (var l = n.faces[a], u = [n.points[l[0]], n.points[l[1]], n.points[l[2]]], d = [n.uvs[l[0]], n.uvs[l[1]], n.uvs[l[2]]], p = [m.sub(d[1], d[0]), m.sub(d[2], d[1]), m.sub(d[0], d[2])], _ = [m.sub(u[1], u[0]), m.sub(u[2], u[1]), m.sub(u[0], u[2])], v = _.map(m.normalized), A = _.map(m.norm),
|
|
12467
|
-
var k =
|
|
12466
|
+
for (var l = n.faces[a], u = [n.points[l[0]], n.points[l[1]], n.points[l[2]]], d = [n.uvs[l[0]], n.uvs[l[1]], n.uvs[l[2]]], p = [m.sub(d[1], d[0]), m.sub(d[2], d[1]), m.sub(d[0], d[2])], _ = [m.sub(u[1], u[0]), m.sub(u[2], u[1]), m.sub(u[0], u[2])], v = _.map(m.normalized), A = _.map(m.norm), I = null, S = null, P = 0; P < 3; ) {
|
|
12467
|
+
var k = P++, T = u[k], O = v[k], C = lt.rays(T, O, r.origin, r.dir);
|
|
12468
12468
|
if (C != null) {
|
|
12469
12469
|
var F = C.u0, R = C.u1;
|
|
12470
|
-
F < -rt.EPSILON || F > A[k] + rt.EPSILON || ((
|
|
12470
|
+
F < -rt.EPSILON || F > A[k] + rt.EPSILON || ((I == null || R < I.u) && (I = new vn(R, m.onRay(r.origin, r.dir, R), m.onRay(d[k], p[k], F / A[k]))), (S == null || R > S.u) && (S = new vn(R, m.onRay(r.origin, r.dir, R), m.onRay(d[k], p[k], F / A[k]))));
|
|
12471
12471
|
}
|
|
12472
12472
|
}
|
|
12473
|
-
return S == null ||
|
|
12473
|
+
return S == null || I == null ? null : new we(I, S);
|
|
12474
12474
|
}, lt.mergeTriangleClipIntervals = function(r, n, a, l, u, d) {
|
|
12475
12475
|
if (n.min.u > r.max.u + rt.EPSILON || r.min.u > n.max.u + rt.EPSILON) return null;
|
|
12476
12476
|
var p;
|
|
@@ -12484,9 +12484,9 @@ var Ah = { exports: {} };
|
|
|
12484
12484
|
if (m.dot(u, u) < rt.EPSILON) return null;
|
|
12485
12485
|
var d = 0, p = Math.abs(u[0]), _ = Math.abs(u[1]), v = Math.abs(u[2]);
|
|
12486
12486
|
_ > p && (d = 1, p = _), v > p && (d = 2, p = v);
|
|
12487
|
-
var A,
|
|
12488
|
-
d == 0 ? (A = n[1],
|
|
12489
|
-
var k = -m.dot(r, n), T = -m.dot(a, l), O = A *
|
|
12487
|
+
var A, I, S, P;
|
|
12488
|
+
d == 0 ? (A = n[1], I = n[2], S = l[1], P = l[2]) : d == 1 ? (A = n[0], I = n[2], S = l[0], P = l[2]) : (A = n[0], I = n[1], S = l[0], P = l[1]);
|
|
12489
|
+
var k = -m.dot(r, n), T = -m.dot(a, l), O = A * P - I * S, C = (I * T - k * P) / O, F = (k * S - A * T) / O, R;
|
|
12490
12490
|
return d == 0 ? R = [0, C, F] : d == 1 ? R = [C, 0, F] : R = [C, F, 0], new _n(R, m.normalized(u));
|
|
12491
12491
|
}, lt.threePlanes = function(r, n, a, l, u, d) {
|
|
12492
12492
|
var p = m.cross(a, u), _ = m.dot(r, p);
|
|
@@ -12502,23 +12502,23 @@ var Ah = { exports: {} };
|
|
|
12502
12502
|
}
|
|
12503
12503
|
return u;
|
|
12504
12504
|
}, lt.segments = function(r, n, a, l, u) {
|
|
12505
|
-
var d = m.sub(n, r), p = Math.sqrt(m.dot(d, d)), _ = m.mul(1 / p, d), v = m.sub(l, a), A = Math.sqrt(m.dot(v, v)),
|
|
12505
|
+
var d = m.sub(n, r), p = Math.sqrt(m.dot(d, d)), _ = m.mul(1 / p, d), v = m.sub(l, a), A = Math.sqrt(m.dot(v, v)), I = m.mul(1 / A, v), S = lt.rays(r, _, a, I);
|
|
12506
12506
|
if (S != null) {
|
|
12507
|
-
var
|
|
12508
|
-
if (C < u * u) return new Hr(T, O,
|
|
12507
|
+
var P = Math.min(Math.max(0, S.u0 / p), 1), k = Math.min(Math.max(0, S.u1 / A), 1), T = m.onRay(r, d, P), O = m.onRay(a, v, k), C = m.distSquared(T, O);
|
|
12508
|
+
if (C < u * u) return new Hr(T, O, P, k);
|
|
12509
12509
|
}
|
|
12510
12510
|
return null;
|
|
12511
12511
|
}, lt.rays = function(r, n, a, l) {
|
|
12512
|
-
var u = m.dot(n, l), d = m.dot(n, a), p = m.dot(n, r), _ = m.dot(l, a), v = m.dot(l, r), A = m.dot(n, n),
|
|
12512
|
+
var u = m.dot(n, l), d = m.dot(n, a), p = m.dot(n, r), _ = m.dot(l, a), v = m.dot(l, r), A = m.dot(n, n), I = m.dot(l, l), S = A * I - u * u;
|
|
12513
12513
|
if (Math.abs(S) < rt.EPSILON) return null;
|
|
12514
|
-
var
|
|
12514
|
+
var P = u * (d - p) - A * (_ - v), k = P / S, T = (d - p + k * u) / A, O = m.onRay(r, n, T), C = m.onRay(a, l, k);
|
|
12515
12515
|
return new Hr(O, C, T, k);
|
|
12516
12516
|
}, lt.segmentWithTriangle = function(r, n, a, l) {
|
|
12517
|
-
var u = a[l[0]], d = a[l[1]], p = a[l[2]], _ = m.sub(d, u), v = m.sub(p, u), A = m.cross(_, v),
|
|
12517
|
+
var u = a[l[0]], d = a[l[1]], p = a[l[2]], _ = m.sub(d, u), v = m.sub(p, u), A = m.cross(_, v), I = m.sub(n, r), S = m.sub(r, u), P = -m.dot(A, S), k = m.dot(A, I);
|
|
12518
12518
|
if (Math.abs(k) < rt.EPSILON) return null;
|
|
12519
|
-
var T =
|
|
12519
|
+
var T = P / k;
|
|
12520
12520
|
if (T < 0 || T > 1) return null;
|
|
12521
|
-
var O = m.add(r, m.mul(T,
|
|
12521
|
+
var O = m.add(r, m.mul(T, I)), C = m.dot(_, v), F = m.dot(_, _), R = m.dot(v, v), U = m.sub(O, u), V = m.dot(U, _), q = m.dot(U, v), J = C * C - F * R;
|
|
12522
12522
|
if (Math.abs(J) < rt.EPSILON) return null;
|
|
12523
12523
|
var H = (C * q - R * V) / J, G = (C * V - F * q) / J;
|
|
12524
12524
|
return H > 1 + rt.EPSILON || G > 1 + rt.EPSILON || G < -rt.EPSILON || H < -rt.EPSILON || H + G > 1 + rt.EPSILON ? null : new Hn(O, H, G, T);
|
|
@@ -12532,7 +12532,7 @@ var Ah = { exports: {} };
|
|
|
12532
12532
|
};
|
|
12533
12533
|
b["verb.eval.Make"] = pt, pt.__name__ = ["verb", "eval", "Make"], pt.rationalTranslationalSurface = function(r, n) {
|
|
12534
12534
|
for (var a = N.rationalCurvePoint(n, $.first(n.knots)), l = $.first(n.knots), u = $.last(n.knots), d = 2 * n.controlPoints.length, p = (u - l) / (d - 1), _ = [], v = 0; v < d; ) {
|
|
12535
|
-
var A = v++,
|
|
12535
|
+
var A = v++, I = m.sub(N.rationalCurvePoint(n, l + A * p), a), S = ft.rationalCurveTransform(r, [[1, 0, 0, I[0]], [0, 1, 0, I[1]], [0, 0, 1, I[2]], [0, 0, 0, 1]]);
|
|
12536
12536
|
_.push(S);
|
|
12537
12537
|
}
|
|
12538
12538
|
return pt.loftedSurface(_);
|
|
@@ -12552,29 +12552,29 @@ var Ah = { exports: {} };
|
|
|
12552
12552
|
break;
|
|
12553
12553
|
}
|
|
12554
12554
|
}
|
|
12555
|
-
var
|
|
12556
|
-
p >= 0 && (
|
|
12555
|
+
var I = u + 1;
|
|
12556
|
+
p >= 0 && (I = I - d[p].mult);
|
|
12557
12557
|
var S;
|
|
12558
|
-
|
|
12559
|
-
var
|
|
12560
|
-
return Math.abs(n - $.first(l)) < rt.EPSILON ?
|
|
12558
|
+
I > 0 ? S = ft.surfaceKnotRefine(r, m.rep(I, n), a) : S = r;
|
|
12559
|
+
var P = N.knotSpan(u, n, l);
|
|
12560
|
+
return Math.abs(n - $.first(l)) < rt.EPSILON ? P = 0 : Math.abs(n - $.last(l)) < rt.EPSILON && (P = (a ? S.controlPoints[0].length : S.controlPoints.length) - 1), a ? new Gt(S.degreeU, S.knotsU, function(k) {
|
|
12561
12561
|
for (var T, O = [], C = 0, F = S.controlPoints; C < F.length; ) {
|
|
12562
12562
|
var R = F[C];
|
|
12563
|
-
++C, O.push(R[
|
|
12563
|
+
++C, O.push(R[P]);
|
|
12564
12564
|
}
|
|
12565
12565
|
return T = O, T;
|
|
12566
|
-
}()) : new Gt(S.degreeV, S.knotsV, S.controlPoints[
|
|
12566
|
+
}()) : new Gt(S.degreeV, S.knotsV, S.controlPoints[P]);
|
|
12567
12567
|
}, pt.loftedSurface = function(r, n) {
|
|
12568
12568
|
r = ft.unifyCurveKnotVectors(r);
|
|
12569
12569
|
var a = r[0].degree;
|
|
12570
12570
|
n == null && (n = 3), n > r.length - 1 && (n = r.length - 1);
|
|
12571
12571
|
for (var l = r[0].knots, u = [], d = [], p = 0, _ = r[0].controlPoints.length; p < _; ) {
|
|
12572
12572
|
var v = [p++], A = r.map(/* @__PURE__ */ function(S) {
|
|
12573
|
-
return function(
|
|
12574
|
-
return
|
|
12573
|
+
return function(P) {
|
|
12574
|
+
return P.controlPoints[S[0]];
|
|
12575
12575
|
};
|
|
12576
|
-
}(v)),
|
|
12577
|
-
d.push(
|
|
12576
|
+
}(v)), I = pt.rationalInterpCurve(A, n, !0);
|
|
12577
|
+
d.push(I.controlPoints), u = I.knots;
|
|
12578
12578
|
}
|
|
12579
12579
|
return new te(a, n, l, u, d);
|
|
12580
12580
|
}, pt.clonedCurve = function(r) {
|
|
@@ -12590,11 +12590,11 @@ var Ah = { exports: {} };
|
|
|
12590
12590
|
}, pt.fourPointSurface = function(r, n, a, l, u) {
|
|
12591
12591
|
u == null && (u = 3);
|
|
12592
12592
|
for (var d = u, p = [], _ = 0, v = u + 1; _ < v; ) {
|
|
12593
|
-
for (var A = _++,
|
|
12593
|
+
for (var A = _++, I = [], S = 0, P = u + 1; S < P; ) {
|
|
12594
12594
|
var k = S++, T = 1 - A / d, O = m.lerp(T, r, n), C = m.lerp(T, l, a), F = m.lerp(1 - k / d, O, C);
|
|
12595
|
-
F.push(1),
|
|
12595
|
+
F.push(1), I.push(F);
|
|
12596
12596
|
}
|
|
12597
|
-
p.push(
|
|
12597
|
+
p.push(I);
|
|
12598
12598
|
}
|
|
12599
12599
|
var R = m.rep(u + 1, 0), U = m.rep(u + 1, 1);
|
|
12600
12600
|
return new te(u, u, R.concat(U), R.concat(U), p);
|
|
@@ -12603,15 +12603,15 @@ var Ah = { exports: {} };
|
|
|
12603
12603
|
n = m.normalized(n), a = m.normalized(a), u < l && (u = 2 * Math.PI + l);
|
|
12604
12604
|
var _ = u - l, v = 0;
|
|
12605
12605
|
_ <= Math.PI / 2 ? v = 1 : _ <= Math.PI ? v = 2 : _ <= 3 * Math.PI / 2 ? v = 3 : v = 4;
|
|
12606
|
-
var A = _ / v,
|
|
12606
|
+
var A = _ / v, I = Math.cos(A / 2), S = m.add(r, m.add(m.mul(d * Math.cos(l), n), m.mul(p * Math.sin(l), a))), P = m.sub(m.mul(Math.cos(l), a), m.mul(Math.sin(l), n)), k = [], T = m.zeros1d(2 * v + 3), O = 0, C = l, F = m.zeros1d(v * 2);
|
|
12607
12607
|
k[0] = S, F[0] = 1;
|
|
12608
12608
|
for (var R = 1, U = v + 1; R < U; ) {
|
|
12609
12609
|
var V = R++;
|
|
12610
12610
|
C += A;
|
|
12611
12611
|
var q = m.add(r, m.add(m.mul(d * Math.cos(C), n), m.mul(p * Math.sin(C), a)));
|
|
12612
12612
|
F[O + 2] = 1, k[O + 2] = q;
|
|
12613
|
-
var J = m.sub(m.mul(Math.cos(C), a), m.mul(Math.sin(C), n)), H = lt.rays(S, m.mul(1 / m.norm(
|
|
12614
|
-
F[O + 1] =
|
|
12613
|
+
var J = m.sub(m.mul(Math.cos(C), a), m.mul(Math.sin(C), n)), H = lt.rays(S, m.mul(1 / m.norm(P), P), q, m.mul(1 / m.norm(J), J)), G = m.add(S, m.mul(H.u0, P));
|
|
12614
|
+
F[O + 1] = I, k[O + 1] = G, O += 2, V < v && (S = q, P = J);
|
|
12615
12615
|
}
|
|
12616
12616
|
for (var K = 2 * v + 1, tt = 0; tt < 3; ) {
|
|
12617
12617
|
var et = tt++;
|
|
@@ -12641,7 +12641,7 @@ var Ah = { exports: {} };
|
|
|
12641
12641
|
v++, _.push(1);
|
|
12642
12642
|
return p = _, new Gt(1, n, N.homogenize1d(r.slice(0), p));
|
|
12643
12643
|
}, pt.extrudedSurface = function(r, n, a) {
|
|
12644
|
-
for (var l = [[], [], []], u = [[], [], []], d = N.dehomogenize1d(a.controlPoints), p = N.weight1d(a.controlPoints), _ = m.mul(n, r), v = m.mul(0.5 * n, r), A = 0,
|
|
12644
|
+
for (var l = [[], [], []], u = [[], [], []], d = N.dehomogenize1d(a.controlPoints), p = N.weight1d(a.controlPoints), _ = m.mul(n, r), v = m.mul(0.5 * n, r), A = 0, I = d.length; A < I; ) {
|
|
12645
12645
|
var S = A++;
|
|
12646
12646
|
l[2][S] = d[S], l[1][S] = m.add(v, d[S]), l[0][S] = m.add(_, d[S]), u[0][S] = p[S], u[1][S] = p[S], u[2][S] = p[S];
|
|
12647
12647
|
}
|
|
@@ -12652,11 +12652,11 @@ var Ah = { exports: {} };
|
|
|
12652
12652
|
}, pt.revolvedSurface = function(r, n, a, l) {
|
|
12653
12653
|
var u = N.dehomogenize1d(r.controlPoints), d = N.weight1d(r.controlPoints), p, _;
|
|
12654
12654
|
l <= Math.PI / 2 ? (p = 1, _ = m.zeros1d(6 + 2 * (p - 1))) : l <= Math.PI ? (p = 2, _ = m.zeros1d(6 + 2 * (p - 1)), _[3] = _[4] = 0.5) : l <= 3 * Math.PI / 2 ? (p = 3, _ = m.zeros1d(6 + 2 * (p - 1)), _[3] = _[4] = 0.3333333333333333, _[5] = _[6] = 0.6666666666666666) : (p = 4, _ = m.zeros1d(6 + 2 * (p - 1)), _[3] = _[4] = 0.25, _[5] = _[6] = 0.5, _[7] = _[8] = 0.75);
|
|
12655
|
-
for (var v = l / p, A = 3 + 2 * (p - 1),
|
|
12656
|
-
var S =
|
|
12655
|
+
for (var v = l / p, A = 3 + 2 * (p - 1), I = 0; I < 3; ) {
|
|
12656
|
+
var S = I++;
|
|
12657
12657
|
_[S] = 0, _[A + S] = 1;
|
|
12658
12658
|
}
|
|
12659
|
-
for (var
|
|
12659
|
+
for (var P = Math.cos(v / 2), k = 0, T = m.zeros1d(p + 1), O = m.zeros1d(p + 1), C = m.zeros3d(2 * p + 1, u.length, 3), F = m.zeros2d(2 * p + 1, u.length), R = 1, U = p + 1; R < U; ) {
|
|
12660
12660
|
var V = R++;
|
|
12661
12661
|
k += v, O[V] = Math.cos(k), T[V] = Math.sin(k);
|
|
12662
12662
|
}
|
|
@@ -12671,10 +12671,10 @@ var Ah = { exports: {} };
|
|
|
12671
12671
|
var gt = m.sub(m.mul(O[mt], et), m.mul(T[mt], K));
|
|
12672
12672
|
if (tt == 0) C[at + 1][H] = G;
|
|
12673
12673
|
else {
|
|
12674
|
-
var
|
|
12674
|
+
var It = lt.rays(it, m.mul(1 / m.norm(ht), ht), X, m.mul(1 / m.norm(gt), gt)), jt = m.add(it, m.mul(It.u0, ht));
|
|
12675
12675
|
C[at + 1][H] = jt;
|
|
12676
12676
|
}
|
|
12677
|
-
F[at + 1][H] =
|
|
12677
|
+
F[at + 1][H] = P * d[H], at += 2, mt < p && (it = X, ht = gt);
|
|
12678
12678
|
}
|
|
12679
12679
|
}
|
|
12680
12680
|
return new te(2, r.degree, _, r.knots, N.homogenize2d(C, F));
|
|
@@ -12682,16 +12682,16 @@ var Ah = { exports: {} };
|
|
|
12682
12682
|
var u = pt.arc(r, m.mul(-1, n), a, l, 0, Math.PI);
|
|
12683
12683
|
return pt.revolvedSurface(u, r, n, 2 * Math.PI);
|
|
12684
12684
|
}, pt.conicalSurface = function(r, n, a, l, u) {
|
|
12685
|
-
var d = 2 * Math.PI, p = 1, _ = [m.add(a, m.mul(l, r)), m.add(a, m.mul(u, n))], v = [0, 0, 1, 1], A = [1, 1],
|
|
12686
|
-
return pt.revolvedSurface(
|
|
12685
|
+
var d = 2 * Math.PI, p = 1, _ = [m.add(a, m.mul(l, r)), m.add(a, m.mul(u, n))], v = [0, 0, 1, 1], A = [1, 1], I = new Gt(p, v, N.homogenize1d(_, A));
|
|
12686
|
+
return pt.revolvedSurface(I, a, r, d);
|
|
12687
12687
|
}, pt.rationalInterpCurve = function(r, n, a, l, u) {
|
|
12688
12688
|
if (a == null && (a = !1), n == null && (n = 3), r.length < n + 1) throw new Q("You need to supply at least degree + 1 points! You only supplied " + r.length + " points.");
|
|
12689
12689
|
for (var d = [0], p = 1, _ = r.length; p < _; ) {
|
|
12690
|
-
var v = p++, A = m.norm(m.sub(r[v], r[v - 1])),
|
|
12691
|
-
d.push(
|
|
12690
|
+
var v = p++, A = m.norm(m.sub(r[v], r[v - 1])), I = d[d.length - 1];
|
|
12691
|
+
d.push(I + A);
|
|
12692
12692
|
}
|
|
12693
|
-
for (var S = d[d.length - 1],
|
|
12694
|
-
var T =
|
|
12693
|
+
for (var S = d[d.length - 1], P = 0, k = d.length; P < k; ) {
|
|
12694
|
+
var T = P++;
|
|
12695
12695
|
d[T] = d[T] / S;
|
|
12696
12696
|
}
|
|
12697
12697
|
var O = m.rep(n + 1, 0), C = l != null && u != null, F;
|
|
@@ -12716,11 +12716,11 @@ var Ah = { exports: {} };
|
|
|
12716
12716
|
K.push(mt.concat(ct).concat(X));
|
|
12717
12717
|
}
|
|
12718
12718
|
if (C) {
|
|
12719
|
-
var gt = K[0].length - 2,
|
|
12720
|
-
$.spliceAndInsert(K, 1, 0,
|
|
12719
|
+
var gt = K[0].length - 2, It = [-1, 1].concat(m.zeros1d(gt)), jt = m.zeros1d(gt).concat([-1, 1]);
|
|
12720
|
+
$.spliceAndInsert(K, 1, 0, It), $.spliceAndInsert(K, K.length - 1, 0, jt);
|
|
12721
12721
|
}
|
|
12722
|
-
for (var Xt = r[0].length, Dt = [], Kt = (1 - G[G.length - n - 2]) / n, Ae = G[n + 1] / n,
|
|
12723
|
-
var _e = [
|
|
12722
|
+
for (var Xt = r[0].length, Dt = [], Kt = (1 - G[G.length - n - 2]) / n, Ae = G[n + 1] / n, He = 0; He < Xt; ) {
|
|
12723
|
+
var _e = [He++], ge;
|
|
12724
12724
|
if (!C) ge = r.map(/* @__PURE__ */ function(Je) {
|
|
12725
12725
|
return function(dr) {
|
|
12726
12726
|
return dr[Je[0]];
|
|
@@ -12777,13 +12777,13 @@ var Ah = { exports: {} };
|
|
|
12777
12777
|
++_, p.push(new we($.first(v.knots), $.last(v.knots)));
|
|
12778
12778
|
}
|
|
12779
12779
|
d = p;
|
|
12780
|
-
for (var A = 0,
|
|
12781
|
-
var S = A++,
|
|
12780
|
+
for (var A = 0, I = r.length; A < I; ) {
|
|
12781
|
+
var S = A++, P = [d[S].min];
|
|
12782
12782
|
r[S].knots = r[S].knots.map(/* @__PURE__ */ function(G) {
|
|
12783
12783
|
return function(K) {
|
|
12784
12784
|
return K - G[0];
|
|
12785
12785
|
};
|
|
12786
|
-
}(
|
|
12786
|
+
}(P));
|
|
12787
12787
|
}
|
|
12788
12788
|
for (var k = d.map(function(G) {
|
|
12789
12789
|
return G.max - G.min;
|
|
@@ -12810,7 +12810,7 @@ var Ah = { exports: {} };
|
|
|
12810
12810
|
return r > n ? r : n;
|
|
12811
12811
|
}, ft.curveElevateDegree = function(r, n) {
|
|
12812
12812
|
if (n <= r.degree) return r;
|
|
12813
|
-
var a = r.knots.length - r.degree - 2, l = r.degree, u = r.knots, d = r.controlPoints, p = n - r.degree, _ = r.controlPoints[0].length, v = m.zeros2d(l + p + 1, l + 1), A = [],
|
|
12813
|
+
var a = r.knots.length - r.degree - 2, l = r.degree, u = r.knots, d = r.controlPoints, p = n - r.degree, _ = r.controlPoints[0].length, v = m.zeros2d(l + p + 1, l + 1), A = [], I = [], S = [], P = a + l + 1, k = n, T = Math.floor(k / 2), O = [], C = [];
|
|
12814
12814
|
v[0][0] = 1, v[k][l] = 1;
|
|
12815
12815
|
for (var F = 1, R = T + 1; F < R; )
|
|
12816
12816
|
for (var U = F++, V = 1 / Ft.get(k, U), q = ft.imin(l, U), J = ft.imax(0, U - p), H = q + 1; J < H; ) {
|
|
@@ -12822,27 +12822,27 @@ var Ah = { exports: {} };
|
|
|
12822
12822
|
var at = it++;
|
|
12823
12823
|
v[tt][at] = v[k - tt][l - at];
|
|
12824
12824
|
}
|
|
12825
|
-
var ct = k + 1, nt = -1, mt = l, X = l + 1, gt = 1,
|
|
12825
|
+
var ct = k + 1, nt = -1, mt = l, X = l + 1, gt = 1, It = u[0];
|
|
12826
12826
|
O[0] = d[0];
|
|
12827
12827
|
for (var jt = 0, Xt = k + 1; jt < Xt; ) {
|
|
12828
12828
|
var Dt = jt++;
|
|
12829
|
-
C[Dt] =
|
|
12829
|
+
C[Dt] = It;
|
|
12830
12830
|
}
|
|
12831
12831
|
for (var Kt = 0, Ae = l + 1; Kt < Ae; ) {
|
|
12832
|
-
var
|
|
12833
|
-
A[
|
|
12832
|
+
var He = Kt++;
|
|
12833
|
+
A[He] = d[He];
|
|
12834
12834
|
}
|
|
12835
|
-
for (; X <
|
|
12836
|
-
for (var _e = X; X <
|
|
12835
|
+
for (; X < P; ) {
|
|
12836
|
+
for (var _e = X; X < P && u[X] == u[X + 1]; ) X = X + 1;
|
|
12837
12837
|
var ge = X - _e + 1, Se = u[X], Le = nt;
|
|
12838
12838
|
nt = l - ge;
|
|
12839
12839
|
var $e;
|
|
12840
12840
|
Le > 0 ? $e = Math.floor((Le + 2) / 2) : $e = 1;
|
|
12841
12841
|
var lr;
|
|
12842
12842
|
if (nt > 0 ? lr = Math.floor(k - (nt + 1) / 2) : lr = k, nt > 0) {
|
|
12843
|
-
for (var Ze = Se -
|
|
12844
|
-
Qe[Je - ge - 1] = Ze / (u[mt + Je] -
|
|
12845
|
-
for (var dr = 1,
|
|
12843
|
+
for (var Ze = Se - It, Qe = [], Je = l; Je > ge; )
|
|
12844
|
+
Qe[Je - ge - 1] = Ze / (u[mt + Je] - It), Je--;
|
|
12845
|
+
for (var dr = 1, Pn = nt + 1; dr < Pn; ) {
|
|
12846
12846
|
for (var qr = dr++, zh = nt - qr, ci = ge + qr, Xr = l; Xr >= ci; )
|
|
12847
12847
|
A[Xr] = m.add(m.mul(Qe[Xr - ci], A[Xr]), m.mul(1 - Qe[Xr - ci], A[Xr - 1])), Xr--;
|
|
12848
12848
|
S[zh] = A[l];
|
|
@@ -12850,37 +12850,37 @@ var Ah = { exports: {} };
|
|
|
12850
12850
|
}
|
|
12851
12851
|
for (var ao = $e, Rh = k + 1; ao < Rh; ) {
|
|
12852
12852
|
var En = ao++;
|
|
12853
|
-
|
|
12853
|
+
I[En] = m.zeros1d(_);
|
|
12854
12854
|
for (var Fh = ft.imin(l, En), oo = ft.imax(0, En - p), Bh = Fh + 1; oo < Bh; ) {
|
|
12855
12855
|
var lo = oo++;
|
|
12856
|
-
|
|
12856
|
+
I[En] = m.add(I[En], m.mul(v[En][lo], A[lo]));
|
|
12857
12857
|
}
|
|
12858
12858
|
}
|
|
12859
12859
|
if (Le > 1)
|
|
12860
|
-
for (var di = ct - 2, mi = ct, ho = Se -
|
|
12860
|
+
for (var di = ct - 2, mi = ct, ho = Se - It, Dh = (Se - C[ct - 1]) / ho, uo = 1; uo < Le; ) {
|
|
12861
12861
|
for (var pi = uo++, mr = di, Kr = mi, Br = Kr - ct + 1; Kr - mr > pi; ) {
|
|
12862
12862
|
if (mr < gt) {
|
|
12863
|
-
var Uh = (Se - C[mr]) / (
|
|
12863
|
+
var Uh = (Se - C[mr]) / (It - C[mr]);
|
|
12864
12864
|
O[mr] = m.lerp(Uh, O[mr], O[mr - 1]);
|
|
12865
12865
|
}
|
|
12866
12866
|
if (Kr >= $e) {
|
|
12867
12867
|
if (Kr - pi <= ct - k + Le) {
|
|
12868
12868
|
var Vh = (Se - C[Kr - pi]) / ho;
|
|
12869
|
-
|
|
12869
|
+
I[Br] = m.lerp(Vh, I[Br], I[Br + 1]);
|
|
12870
12870
|
}
|
|
12871
|
-
} else
|
|
12871
|
+
} else I[Br] = m.lerp(Dh, I[Br], I[Br + 1]);
|
|
12872
12872
|
mr = mr + 1, Kr = Kr - 1, Br = Br - 1;
|
|
12873
12873
|
}
|
|
12874
12874
|
di = di - 1, mi = mi + 1;
|
|
12875
12875
|
}
|
|
12876
12876
|
if (mt != l)
|
|
12877
12877
|
for (var co = 0, Gh = k - Le; co < Gh; )
|
|
12878
|
-
co++, C[ct] =
|
|
12878
|
+
co++, C[ct] = It, ct = ct + 1;
|
|
12879
12879
|
for (var mo = $e, jh = lr + 1; mo < jh; ) {
|
|
12880
12880
|
var Wh = mo++;
|
|
12881
|
-
O[gt] =
|
|
12881
|
+
O[gt] = I[Wh], gt = gt + 1;
|
|
12882
12882
|
}
|
|
12883
|
-
if (X <
|
|
12883
|
+
if (X < P) {
|
|
12884
12884
|
for (var po = 0; po < nt; ) {
|
|
12885
12885
|
var go = po++;
|
|
12886
12886
|
A[go] = S[go];
|
|
@@ -12889,7 +12889,7 @@ var Ah = { exports: {} };
|
|
|
12889
12889
|
var _o = fo++;
|
|
12890
12890
|
A[_o] = d[X - l + _o];
|
|
12891
12891
|
}
|
|
12892
|
-
mt = X, X = X + 1,
|
|
12892
|
+
mt = X, X = X + 1, It = Se;
|
|
12893
12893
|
} else
|
|
12894
12894
|
for (var vo = 0, Yh = k + 1; vo < Yh; ) {
|
|
12895
12895
|
var qh = vo++;
|
|
@@ -12917,8 +12917,8 @@ var Ah = { exports: {} };
|
|
|
12917
12917
|
var A = p[v];
|
|
12918
12918
|
++v, _ = ft.curveKnotRefine(new Gt(d, u, A), n), l.push(_.controlPoints);
|
|
12919
12919
|
}
|
|
12920
|
-
var
|
|
12921
|
-
return a ? new te(r.degreeU, r.degreeV, r.knotsU.slice(),
|
|
12920
|
+
var I = _.knots;
|
|
12921
|
+
return a ? new te(r.degreeU, r.degreeV, r.knotsU.slice(), I, l) : (l = Lt.transpose(l), new te(r.degreeU, r.degreeV, I, r.knotsV.slice(), l));
|
|
12922
12922
|
}, ft.decomposeCurveIntoBeziers = function(r) {
|
|
12923
12923
|
for (var n = r.degree, a = r.controlPoints, l = r.knots, u = yt.knotMultiplicities(l), d = n + 1, p = 0; p < u.length; ) {
|
|
12924
12924
|
var _ = u[p];
|
|
@@ -12928,20 +12928,20 @@ var Ah = { exports: {} };
|
|
|
12928
12928
|
}
|
|
12929
12929
|
}
|
|
12930
12930
|
l.length / d - 1;
|
|
12931
|
-
for (var
|
|
12932
|
-
var k = l.slice(
|
|
12933
|
-
S.push(new Gt(n, k, T)),
|
|
12931
|
+
for (var I = d * 2, S = [], P = 0; P < a.length; ) {
|
|
12932
|
+
var k = l.slice(P, P + I), T = a.slice(P, P + d);
|
|
12933
|
+
S.push(new Gt(n, k, T)), P += d;
|
|
12934
12934
|
}
|
|
12935
12935
|
return S;
|
|
12936
12936
|
}, ft.curveKnotRefine = function(r, n) {
|
|
12937
12937
|
if (n.length == 0) return pt.clonedCurve(r);
|
|
12938
|
-
for (var a = r.degree, l = r.controlPoints, u = r.knots, d = l.length - 1, p = d + a + 1, _ = n.length - 1, v = N.knotSpan(a, n[0], u), A = N.knotSpan(a, n[_], u),
|
|
12939
|
-
var T =
|
|
12940
|
-
|
|
12938
|
+
for (var a = r.degree, l = r.controlPoints, u = r.knots, d = l.length - 1, p = d + a + 1, _ = n.length - 1, v = N.knotSpan(a, n[0], u), A = N.knotSpan(a, n[_], u), I = [], S = [], P = 0, k = v - a + 1; P < k; ) {
|
|
12939
|
+
var T = P++;
|
|
12940
|
+
I[T] = l[T];
|
|
12941
12941
|
}
|
|
12942
12942
|
for (var O = A - 1, C = d + 1; O < C; ) {
|
|
12943
12943
|
var F = O++;
|
|
12944
|
-
|
|
12944
|
+
I[F + _ + 1] = l[F];
|
|
12945
12945
|
}
|
|
12946
12946
|
for (var R = 0, U = v + 1; R < U; ) {
|
|
12947
12947
|
var V = R++;
|
|
@@ -12953,27 +12953,27 @@ var Ah = { exports: {} };
|
|
|
12953
12953
|
}
|
|
12954
12954
|
for (var G = A + a - 1, K = A + a + _, tt = _; tt >= 0; ) {
|
|
12955
12955
|
for (; n[tt] <= u[G] && G > v; )
|
|
12956
|
-
|
|
12957
|
-
|
|
12956
|
+
I[K - a - 1] = l[G - a - 1], S[K] = u[G], K = K - 1, G = G - 1;
|
|
12957
|
+
I[K - a - 1] = I[K - a];
|
|
12958
12958
|
for (var et = 1, it = a + 1; et < it; ) {
|
|
12959
12959
|
var ht = et++, at = K - a + ht, ct = S[K + ht] - n[tt];
|
|
12960
|
-
Math.abs(ct) < rt.EPSILON ?
|
|
12960
|
+
Math.abs(ct) < rt.EPSILON ? I[at - 1] = I[at] : (ct = ct / (S[K + ht] - u[G - a + ht]), I[at - 1] = m.add(m.mul(ct, I[at - 1]), m.mul(1 - ct, I[at])));
|
|
12961
12961
|
}
|
|
12962
12962
|
S[K] = n[tt], K = K - 1, tt--;
|
|
12963
12963
|
}
|
|
12964
|
-
return new Gt(a, S,
|
|
12964
|
+
return new Gt(a, S, I);
|
|
12965
12965
|
}, ft.curveKnotInsert = function(r, n, a) {
|
|
12966
|
-
for (var l = r.degree, u = r.controlPoints, d = r.knots, p = 0, _ = u.length, v = N.knotSpan(l, n, d), A = [],
|
|
12967
|
-
var T =
|
|
12968
|
-
|
|
12966
|
+
for (var l = r.degree, u = r.controlPoints, d = r.knots, p = 0, _ = u.length, v = N.knotSpan(l, n, d), A = [], I = [], S = [], P = 1, k = v + 1; P < k; ) {
|
|
12967
|
+
var T = P++;
|
|
12968
|
+
I[T] = d[T];
|
|
12969
12969
|
}
|
|
12970
12970
|
for (var O = 1, C = a + 1; O < C; ) {
|
|
12971
12971
|
var F = O++;
|
|
12972
|
-
|
|
12972
|
+
I[v + F] = n;
|
|
12973
12973
|
}
|
|
12974
12974
|
for (var R = v + 1, U = d.length; R < U; ) {
|
|
12975
12975
|
var V = R++;
|
|
12976
|
-
|
|
12976
|
+
I[V + a] = d[V];
|
|
12977
12977
|
}
|
|
12978
12978
|
for (var q = 0, J = v - l + 1; q < J; ) {
|
|
12979
12979
|
var H = q++;
|
|
@@ -12991,8 +12991,8 @@ var Ah = { exports: {} };
|
|
|
12991
12991
|
var mt = ct++;
|
|
12992
12992
|
ht = v - l + mt;
|
|
12993
12993
|
for (var X = 0, gt = l - mt - p + 1; X < gt; ) {
|
|
12994
|
-
var
|
|
12995
|
-
at = (n - d[ht +
|
|
12994
|
+
var It = X++;
|
|
12995
|
+
at = (n - d[ht + It]) / (d[It + v + 1] - d[ht + It]), A[It] = m.add(m.mul(at, A[It + 1]), m.mul(1 - at, A[It]));
|
|
12996
12996
|
}
|
|
12997
12997
|
S[ht] = A[0], S[v + a - mt - p] = A[l - mt - p];
|
|
12998
12998
|
}
|
|
@@ -13000,7 +13000,7 @@ var Ah = { exports: {} };
|
|
|
13000
13000
|
var Dt = jt++;
|
|
13001
13001
|
S[Dt] = A[Dt - ht];
|
|
13002
13002
|
}
|
|
13003
|
-
return new Gt(l,
|
|
13003
|
+
return new Gt(l, I, S);
|
|
13004
13004
|
};
|
|
13005
13005
|
var zt = f.eval.Tess = function() {
|
|
13006
13006
|
};
|
|
@@ -13025,17 +13025,17 @@ var Ah = { exports: {} };
|
|
|
13025
13025
|
return r.controlPoints.map(N.dehomogenize);
|
|
13026
13026
|
return zt.rationalCurveAdaptiveSampleRange(r, r.knots[0], $.last(r.knots), n, a);
|
|
13027
13027
|
}, zt.rationalCurveAdaptiveSampleRange = function(r, n, a, l, u) {
|
|
13028
|
-
var d = N.rationalCurvePoint(r, n), p = N.rationalCurvePoint(r, a), _ = 0.5 + 0.2 * Math.random(), v = n + (a - n) * _, A = N.rationalCurvePoint(r, v),
|
|
13029
|
-
if (m.dot(
|
|
13030
|
-
var
|
|
13028
|
+
var d = N.rationalCurvePoint(r, n), p = N.rationalCurvePoint(r, a), _ = 0.5 + 0.2 * Math.random(), v = n + (a - n) * _, A = N.rationalCurvePoint(r, v), I = m.sub(d, p), S = m.sub(d, A);
|
|
13029
|
+
if (m.dot(I, I) < l && m.dot(S, S) > l || !Ne.threePointsAreFlat(d, A, p, l)) {
|
|
13030
|
+
var P = n + (a - n) * 0.5, k = zt.rationalCurveAdaptiveSampleRange(r, n, P, l, u), T = zt.rationalCurveAdaptiveSampleRange(r, P, a, l, u);
|
|
13031
13031
|
return k.slice(0, -1).concat(T);
|
|
13032
13032
|
} else return u ? [[n].concat(d), [a].concat(p)] : [d, p];
|
|
13033
13033
|
}, zt.rationalSurfaceNaive = function(r, n, a) {
|
|
13034
13034
|
n < 1 && (n = 1), a < 1 && (a = 1), r.degreeU, r.degreeV, r.controlPoints;
|
|
13035
|
-
for (var l = r.knotsU, u = r.knotsV, d = $.last(l) - l[0], p = $.last(u) - u[0], _ = d / n, v = p / a, A = [],
|
|
13036
|
-
for (var T =
|
|
13035
|
+
for (var l = r.knotsU, u = r.knotsV, d = $.last(l) - l[0], p = $.last(u) - u[0], _ = d / n, v = p / a, A = [], I = [], S = [], P = 0, k = n + 1; P < k; )
|
|
13036
|
+
for (var T = P++, O = 0, C = a + 1; O < C; ) {
|
|
13037
13037
|
var F = O++, R = T * _, U = F * v;
|
|
13038
|
-
|
|
13038
|
+
I.push([R, U]);
|
|
13039
13039
|
var V = N.rationalSurfaceDerivatives(r, R, U, 1), q = V[0][0];
|
|
13040
13040
|
A.push(q);
|
|
13041
13041
|
var J = m.normalized(m.cross(V[1][0], V[0][1]));
|
|
@@ -13046,32 +13046,32 @@ var Ah = { exports: {} };
|
|
|
13046
13046
|
var et = tt++, it = K * (a + 1) + et, ht = (K + 1) * (a + 1) + et, at = ht + 1, ct = it + 1, nt = [it, ht, at], mt = [it, at, ct];
|
|
13047
13047
|
H.push(nt), H.push(mt);
|
|
13048
13048
|
}
|
|
13049
|
-
return new qe(H, A, S,
|
|
13049
|
+
return new qe(H, A, S, I);
|
|
13050
13050
|
}, zt.divideRationalSurfaceAdaptive = function(r, n) {
|
|
13051
13051
|
n == null && (n = new Lr()), n.minDivsU != null ? n.minDivsU = n.minDivsU : n.minDivsU = 1, n.minDivsV != null ? n.minDivsU = n.minDivsV : n.minDivsU = 1, n.refine != null ? n.refine = n.refine : n.refine = !0;
|
|
13052
13052
|
var a = (r.controlPoints.length - 1) * 2, l = (r.controlPoints[0].length - 1) * 2, u;
|
|
13053
13053
|
n.minDivsU > a ? u = n.minDivsU = n.minDivsU : u = n.minDivsU = a;
|
|
13054
13054
|
var d;
|
|
13055
13055
|
n.minDivsV > l ? d = n.minDivsV = n.minDivsV : d = n.minDivsV = l;
|
|
13056
|
-
for (var p = $.last(r.knotsU), _ = r.knotsU[0], v = $.last(r.knotsV), A = r.knotsV[0],
|
|
13056
|
+
for (var p = $.last(r.knotsU), _ = r.knotsU[0], v = $.last(r.knotsV), A = r.knotsV[0], I = (p - _) / u, S = (v - A) / d, P = [], k = [], T = 0, O = d + 1; T < O; ) {
|
|
13057
13057
|
for (var C = T++, F = [], R = 0, U = u + 1; R < U; ) {
|
|
13058
|
-
var V = R++, q = _ +
|
|
13059
|
-
F.push(new
|
|
13058
|
+
var V = R++, q = _ + I * V, J = A + S * C, H = N.rationalSurfaceDerivatives(r, q, J, 1), G = m.normalized(m.cross(H[0][1], H[1][0]));
|
|
13059
|
+
F.push(new je(H[0][0], G, [q, J], -1, m.isZero(G)));
|
|
13060
13060
|
}
|
|
13061
13061
|
k.push(F);
|
|
13062
13062
|
}
|
|
13063
13063
|
for (var K = 0; K < d; )
|
|
13064
13064
|
for (var tt = K++, et = 0; et < u; ) {
|
|
13065
13065
|
var it = et++, ht = [k[d - tt - 1][it], k[d - tt - 1][it + 1], k[d - tt][it + 1], k[d - tt][it]];
|
|
13066
|
-
|
|
13066
|
+
P.push(new cr(r, ht));
|
|
13067
13067
|
}
|
|
13068
|
-
if (!n.refine) return
|
|
13068
|
+
if (!n.refine) return P;
|
|
13069
13069
|
for (var at = 0; at < d; )
|
|
13070
13070
|
for (var ct = at++, nt = 0; nt < u; ) {
|
|
13071
|
-
var mt = nt++, X = ct * u + mt, gt = zt.north(X, ct, mt, u, d,
|
|
13072
|
-
|
|
13071
|
+
var mt = nt++, X = ct * u + mt, gt = zt.north(X, ct, mt, u, d, P), It = zt.east(X, ct, mt, u, d, P), jt = zt.south(X, ct, mt, u, d, P), Xt = zt.west(X, ct, mt, u, d, P);
|
|
13072
|
+
P[X].neighbors = [jt, It, gt, Xt], P[X].divide(n);
|
|
13073
13073
|
}
|
|
13074
|
-
return
|
|
13074
|
+
return P;
|
|
13075
13075
|
}, zt.north = function(r, n, a, l, u, d) {
|
|
13076
13076
|
return n == 0 ? null : d[r - l];
|
|
13077
13077
|
}, zt.south = function(r, n, a, l, u, d) {
|
|
@@ -13100,7 +13100,7 @@ var Ah = { exports: {} };
|
|
|
13100
13100
|
var cr = f.core.AdaptiveRefinementNode = function(r, n, a) {
|
|
13101
13101
|
if (this.srf = r, a == null ? this.neighbors = [null, null, null, null] : this.neighbors = a, this.corners = n, this.corners == null) {
|
|
13102
13102
|
var l = r.knotsU[0], u = $.last(r.knotsU), d = r.knotsV[0], p = $.last(r.knotsV);
|
|
13103
|
-
this.corners = [
|
|
13103
|
+
this.corners = [je.fromUv(l, d), je.fromUv(u, d), je.fromUv(u, p), je.fromUv(l, p)];
|
|
13104
13104
|
}
|
|
13105
13105
|
};
|
|
13106
13106
|
b["verb.eval.AdaptiveRefinementNode"] = cr, cr.__name__ = ["verb", "eval", "AdaptiveRefinementNode"], cr.prototype = {
|
|
@@ -13122,7 +13122,7 @@ var Ah = { exports: {} };
|
|
|
13122
13122
|
},
|
|
13123
13123
|
evalSrf: function(r, n, a) {
|
|
13124
13124
|
var l = N.rationalSurfaceDerivatives(this.srf, r, n, 1), u = l[0][0], d = m.cross(l[0][1], l[1][0]), p = m.isZero(d);
|
|
13125
|
-
return p || (d = m.normalized(d)), a != null ? (a.degen = p, a.point = u, a.normal = d, a) : new
|
|
13125
|
+
return p || (d = m.normalized(d)), a != null ? (a.degen = p, a.point = u, a.normal = d, a) : new je(u, d, [r, n], -1, p);
|
|
13126
13126
|
},
|
|
13127
13127
|
getEdgeCorners: function(r) {
|
|
13128
13128
|
if (this.isLeaf()) return [this.corners[r]];
|
|
@@ -13229,17 +13229,17 @@ var Ah = { exports: {} };
|
|
|
13229
13229
|
var p = d++, _ = this.getAllCorners(p);
|
|
13230
13230
|
_.length == 2 && (u = p + 1);
|
|
13231
13231
|
for (var v = 0, A = _.length; v < A; ) {
|
|
13232
|
-
var
|
|
13233
|
-
a.push(_[
|
|
13232
|
+
var I = v++;
|
|
13233
|
+
a.push(_[I]);
|
|
13234
13234
|
}
|
|
13235
13235
|
}
|
|
13236
13236
|
for (var S = 0; S < a.length; ) {
|
|
13237
|
-
var
|
|
13238
|
-
if (++S,
|
|
13239
|
-
l.push(
|
|
13237
|
+
var P = a[S];
|
|
13238
|
+
if (++S, P.id != -1) {
|
|
13239
|
+
l.push(P.id);
|
|
13240
13240
|
continue;
|
|
13241
13241
|
}
|
|
13242
|
-
r.uvs.push(
|
|
13242
|
+
r.uvs.push(P.uv), r.points.push(P.point), r.normals.push(P.normal), P.id = n, l.push(n), n++;
|
|
13243
13243
|
}
|
|
13244
13244
|
if (a.length == 4)
|
|
13245
13245
|
return r.faces.push([l[0], l[3], l[1]]), r.faces.push([l[3], l[2], l[1]]), r;
|
|
@@ -13314,7 +13314,7 @@ var Ah = { exports: {} };
|
|
|
13314
13314
|
__class__: Sn
|
|
13315
13315
|
};
|
|
13316
13316
|
var Tt = f.geom.NurbsCurve = function(r) {
|
|
13317
|
-
this._data =
|
|
13317
|
+
this._data = We.isValidNurbsCurveData(r);
|
|
13318
13318
|
};
|
|
13319
13319
|
b["verb.geom.NurbsCurve"] = Tt, Tt.__name__ = ["verb", "geom", "NurbsCurve"], Tt.__interfaces__ = [Sn], Tt.byKnotsControlPointsWeights = function(r, n, a, l) {
|
|
13320
13320
|
return new Tt(new Gt(r, n.slice(), N.homogenize1d(a, l)));
|
|
@@ -13474,27 +13474,27 @@ var Ah = { exports: {} };
|
|
|
13474
13474
|
b["verb.geom.Circle"] = Zn, Zn.__name__ = ["verb", "geom", "Circle"], Zn.__super__ = zr, Zn.prototype = M(zr.prototype, {
|
|
13475
13475
|
__class__: Zn
|
|
13476
13476
|
});
|
|
13477
|
-
var
|
|
13477
|
+
var In = function() {
|
|
13478
13478
|
};
|
|
13479
|
-
b["verb.geom.ISurface"] =
|
|
13480
|
-
__class__:
|
|
13479
|
+
b["verb.geom.ISurface"] = In, In.__name__ = ["verb", "geom", "ISurface"], In.__interfaces__ = [bn], In.prototype = {
|
|
13480
|
+
__class__: In
|
|
13481
13481
|
};
|
|
13482
|
-
var
|
|
13483
|
-
this._data =
|
|
13482
|
+
var Pt = f.geom.NurbsSurface = function(r) {
|
|
13483
|
+
this._data = We.isValidNurbsSurfaceData(r);
|
|
13484
13484
|
};
|
|
13485
|
-
b["verb.geom.NurbsSurface"] =
|
|
13486
|
-
return new
|
|
13487
|
-
},
|
|
13488
|
-
return new
|
|
13489
|
-
},
|
|
13490
|
-
return new
|
|
13485
|
+
b["verb.geom.NurbsSurface"] = Pt, Pt.__name__ = ["verb", "geom", "NurbsSurface"], Pt.__interfaces__ = [In], Pt.byKnotsControlPointsWeights = function(r, n, a, l, u, d) {
|
|
13486
|
+
return new Pt(new te(r, n, a, l, N.homogenize2d(u, d)));
|
|
13487
|
+
}, Pt.byCorners = function(r, n, a, l) {
|
|
13488
|
+
return new Pt(pt.fourPointSurface(r, n, a, l));
|
|
13489
|
+
}, Pt.byLoftingCurves = function(r, n) {
|
|
13490
|
+
return new Pt(pt.loftedSurface(function(a) {
|
|
13491
13491
|
for (var l, u = [], d = 0; d < r.length; ) {
|
|
13492
13492
|
var p = r[d];
|
|
13493
13493
|
++d, u.push(p.asNurbs());
|
|
13494
13494
|
}
|
|
13495
13495
|
return l = u, l;
|
|
13496
13496
|
}(), n));
|
|
13497
|
-
},
|
|
13497
|
+
}, Pt.__super__ = $t, Pt.prototype = M($t.prototype, {
|
|
13498
13498
|
degreeU: function() {
|
|
13499
13499
|
return this._data.degreeU;
|
|
13500
13500
|
},
|
|
@@ -13517,7 +13517,7 @@ var Ah = { exports: {} };
|
|
|
13517
13517
|
return new te(this.degreeU(), this.degreeV(), this.knotsU(), this.knotsV(), N.homogenize2d(this.controlPoints(), this.weights()));
|
|
13518
13518
|
},
|
|
13519
13519
|
clone: function() {
|
|
13520
|
-
return new
|
|
13520
|
+
return new Pt(this.asNurbs());
|
|
13521
13521
|
},
|
|
13522
13522
|
domainU: function() {
|
|
13523
13523
|
return new we($.first(this._data.knotsU), $.last(this._data.knotsU));
|
|
@@ -13557,22 +13557,22 @@ var Ah = { exports: {} };
|
|
|
13557
13557
|
},
|
|
13558
13558
|
split: function(r, n) {
|
|
13559
13559
|
return n == null && (n = !1), oe.surfaceSplit(this._data, r, n).map(function(a) {
|
|
13560
|
-
return new
|
|
13560
|
+
return new Pt(a);
|
|
13561
13561
|
});
|
|
13562
13562
|
},
|
|
13563
13563
|
splitAsync: function(r, n) {
|
|
13564
13564
|
return n == null && (n = !1), wt.dispatchMethod(oe, "surfaceSplit", [this._data, r, n]).then(function(a) {
|
|
13565
13565
|
return a.map(function(l) {
|
|
13566
|
-
return new
|
|
13566
|
+
return new Pt(l);
|
|
13567
13567
|
});
|
|
13568
13568
|
});
|
|
13569
13569
|
},
|
|
13570
13570
|
reverse: function(r) {
|
|
13571
|
-
return r == null && (r = !1), new
|
|
13571
|
+
return r == null && (r = !1), new Pt(ft.surfaceReverse(this._data, r));
|
|
13572
13572
|
},
|
|
13573
13573
|
reverseAsync: function(r) {
|
|
13574
13574
|
return r == null && (r = !1), wt.dispatchMethod(ft, "surfaceReverse", [this._data, r]).then(function(n) {
|
|
13575
|
-
return new
|
|
13575
|
+
return new Pt(n);
|
|
13576
13576
|
});
|
|
13577
13577
|
},
|
|
13578
13578
|
isocurve: function(r, n) {
|
|
@@ -13602,19 +13602,19 @@ var Ah = { exports: {} };
|
|
|
13602
13602
|
return wt.dispatchMethod(zt, "rationalSurfaceAdaptive", [this._data, r]);
|
|
13603
13603
|
},
|
|
13604
13604
|
transform: function(r) {
|
|
13605
|
-
return new
|
|
13605
|
+
return new Pt(ft.rationalSurfaceTransform(this._data, r));
|
|
13606
13606
|
},
|
|
13607
13607
|
transformAsync: function(r) {
|
|
13608
13608
|
return wt.dispatchMethod(ft, "rationalSurfaceTransform", [this._data, r]).then(function(n) {
|
|
13609
|
-
return new
|
|
13609
|
+
return new Pt(n);
|
|
13610
13610
|
});
|
|
13611
13611
|
},
|
|
13612
|
-
__class__:
|
|
13612
|
+
__class__: Pt
|
|
13613
13613
|
});
|
|
13614
13614
|
var Qn = f.geom.ConicalSurface = function(r, n, a, l, u) {
|
|
13615
|
-
|
|
13615
|
+
Pt.call(this, pt.conicalSurface(r, n, a, l, u)), this._axis = r, this._xaxis = n, this._base = a, this._height = l, this._radius = u;
|
|
13616
13616
|
};
|
|
13617
|
-
b["verb.geom.ConicalSurface"] = Qn, Qn.__name__ = ["verb", "geom", "ConicalSurface"], Qn.__super__ =
|
|
13617
|
+
b["verb.geom.ConicalSurface"] = Qn, Qn.__name__ = ["verb", "geom", "ConicalSurface"], Qn.__super__ = Pt, Qn.prototype = M(Pt.prototype, {
|
|
13618
13618
|
axis: function() {
|
|
13619
13619
|
return this._axis;
|
|
13620
13620
|
},
|
|
@@ -13633,9 +13633,9 @@ var Ah = { exports: {} };
|
|
|
13633
13633
|
__class__: Qn
|
|
13634
13634
|
});
|
|
13635
13635
|
var Jn = f.geom.CylindricalSurface = function(r, n, a, l, u) {
|
|
13636
|
-
|
|
13636
|
+
Pt.call(this, pt.cylindricalSurface(r, n, a, l, u)), this._axis = r, this._xaxis = n, this._base = a, this._height = l, this._radius = u;
|
|
13637
13637
|
};
|
|
13638
|
-
b["verb.geom.CylindricalSurface"] = Jn, Jn.__name__ = ["verb", "geom", "CylindricalSurface"], Jn.__super__ =
|
|
13638
|
+
b["verb.geom.CylindricalSurface"] = Jn, Jn.__name__ = ["verb", "geom", "CylindricalSurface"], Jn.__super__ = Pt, Jn.prototype = M(Pt.prototype, {
|
|
13639
13639
|
axis: function() {
|
|
13640
13640
|
return this._axis;
|
|
13641
13641
|
},
|
|
@@ -13681,9 +13681,9 @@ var Ah = { exports: {} };
|
|
|
13681
13681
|
__class__: ts
|
|
13682
13682
|
});
|
|
13683
13683
|
var es = f.geom.ExtrudedSurface = function(r, n) {
|
|
13684
|
-
|
|
13684
|
+
Pt.call(this, pt.extrudedSurface(m.normalized(n), m.norm(n), r.asNurbs())), this._profile = r, this._direction = n;
|
|
13685
13685
|
};
|
|
13686
|
-
b["verb.geom.ExtrudedSurface"] = es, es.__name__ = ["verb", "geom", "ExtrudedSurface"], es.__super__ =
|
|
13686
|
+
b["verb.geom.ExtrudedSurface"] = es, es.__name__ = ["verb", "geom", "ExtrudedSurface"], es.__super__ = Pt, es.prototype = M(Pt.prototype, {
|
|
13687
13687
|
profile: function() {
|
|
13688
13688
|
return this._profile;
|
|
13689
13689
|
},
|
|
@@ -13726,9 +13726,9 @@ var Ah = { exports: {} };
|
|
|
13726
13726
|
__class__: rs
|
|
13727
13727
|
});
|
|
13728
13728
|
var ns = f.geom.RevolvedSurface = function(r, n, a, l) {
|
|
13729
|
-
|
|
13729
|
+
Pt.call(this, pt.revolvedSurface(r.asNurbs(), n, a, l)), this._profile = r, this._center = n, this._axis = a, this._angle = l;
|
|
13730
13730
|
};
|
|
13731
|
-
b["verb.geom.RevolvedSurface"] = ns, ns.__name__ = ["verb", "geom", "RevolvedSurface"], ns.__super__ =
|
|
13731
|
+
b["verb.geom.RevolvedSurface"] = ns, ns.__name__ = ["verb", "geom", "RevolvedSurface"], ns.__super__ = Pt, ns.prototype = M(Pt.prototype, {
|
|
13732
13732
|
profile: function() {
|
|
13733
13733
|
return this._profile;
|
|
13734
13734
|
},
|
|
@@ -13744,9 +13744,9 @@ var Ah = { exports: {} };
|
|
|
13744
13744
|
__class__: ns
|
|
13745
13745
|
});
|
|
13746
13746
|
var ss = f.geom.SphericalSurface = function(r, n) {
|
|
13747
|
-
|
|
13747
|
+
Pt.call(this, pt.sphericalSurface(r, [0, 0, 1], [1, 0, 0], n)), this._center = r, this._radius = n;
|
|
13748
13748
|
};
|
|
13749
|
-
b["verb.geom.SphericalSurface"] = ss, ss.__name__ = ["verb", "geom", "SphericalSurface"], ss.__super__ =
|
|
13749
|
+
b["verb.geom.SphericalSurface"] = ss, ss.__name__ = ["verb", "geom", "SphericalSurface"], ss.__super__ = Pt, ss.prototype = M(Pt.prototype, {
|
|
13750
13750
|
center: function() {
|
|
13751
13751
|
return this._center;
|
|
13752
13752
|
},
|
|
@@ -13756,9 +13756,9 @@ var Ah = { exports: {} };
|
|
|
13756
13756
|
__class__: ss
|
|
13757
13757
|
});
|
|
13758
13758
|
var is = f.geom.SweptSurface = function(r, n) {
|
|
13759
|
-
|
|
13759
|
+
Pt.call(this, pt.rationalTranslationalSurface(r.asNurbs(), n.asNurbs())), this._profile = r, this._rail = n;
|
|
13760
13760
|
};
|
|
13761
|
-
b["verb.geom.SweptSurface"] = is, is.__name__ = ["verb", "geom", "SweptSurface"], is.__super__ =
|
|
13761
|
+
b["verb.geom.SweptSurface"] = is, is.__name__ = ["verb", "geom", "SweptSurface"], is.__super__ = Pt, is.prototype = M(Pt.prototype, {
|
|
13762
13762
|
profile: function() {
|
|
13763
13763
|
return this._profile;
|
|
13764
13764
|
},
|
|
@@ -13826,12 +13826,12 @@ var Ah = { exports: {} };
|
|
|
13826
13826
|
try {
|
|
13827
13827
|
U();
|
|
13828
13828
|
} finally {
|
|
13829
|
-
|
|
13829
|
+
I(R), u = !1;
|
|
13830
13830
|
}
|
|
13831
13831
|
}
|
|
13832
13832
|
}
|
|
13833
13833
|
}
|
|
13834
|
-
function
|
|
13834
|
+
function I(R) {
|
|
13835
13835
|
delete l[R];
|
|
13836
13836
|
}
|
|
13837
13837
|
function S() {
|
|
@@ -13840,7 +13840,7 @@ var Ah = { exports: {} };
|
|
|
13840
13840
|
return process.nextTick(v(A, R)), R;
|
|
13841
13841
|
};
|
|
13842
13842
|
}
|
|
13843
|
-
function
|
|
13843
|
+
function P() {
|
|
13844
13844
|
if (r.postMessage && !r.importScripts) {
|
|
13845
13845
|
var R = !0, U = r.onmessage;
|
|
13846
13846
|
return r.onmessage = function() {
|
|
@@ -13883,7 +13883,7 @@ var Ah = { exports: {} };
|
|
|
13883
13883
|
};
|
|
13884
13884
|
}
|
|
13885
13885
|
var F = Object.getPrototypeOf && Object.getPrototypeOf(r);
|
|
13886
|
-
F = F && F.setTimeout ? F : r, {}.toString.call(r.process) === "[object process]" ? S() :
|
|
13886
|
+
F = F && F.setTimeout ? F : r, {}.toString.call(r.process) === "[object process]" ? S() : P() ? k() : r.MessageChannel ? T() : d && "onreadystatechange" in d.createElement("script") ? O() : C(), F.setImmediate = p, F.clearImmediate = I;
|
|
13887
13887
|
})(new Function("return this")()), qt.USE_CACHE = !1, qt.USE_ENUM_INDEX = !1, qt.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:", Wt.DEFAULT_RESOLVER = ut, Wt.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:", Ot.count = 0, ie.i64tmp = function(r) {
|
|
13888
13888
|
var n, a = new Vt(0, 0);
|
|
13889
13889
|
return n = a, n;
|
|
@@ -15072,7 +15072,7 @@ const Sa = class Sa extends Ee {
|
|
|
15072
15072
|
Sa.typeName = "Curve";
|
|
15073
15073
|
let ke = Sa;
|
|
15074
15074
|
var Ss = /* @__PURE__ */ ((i) => (i[i.SimplePoly = 0] = "SimplePoly", i[i.FitCurvePoly = 1] = "FitCurvePoly", i[i.QuadSplinePoly = 2] = "QuadSplinePoly", i[i.CubicSplinePoly = 3] = "CubicSplinePoly", i))(Ss || {});
|
|
15075
|
-
const
|
|
15075
|
+
const Ia = class Ia extends ke {
|
|
15076
15076
|
/**
|
|
15077
15077
|
* Creates a new empty 2d polyline entity.
|
|
15078
15078
|
*/
|
|
@@ -15203,10 +15203,10 @@ const Pa = class Pa extends ke {
|
|
|
15203
15203
|
), t.lines(e, this.lineStyle);
|
|
15204
15204
|
}
|
|
15205
15205
|
};
|
|
15206
|
-
|
|
15207
|
-
let Di =
|
|
15206
|
+
Ia.typeName = "2dPolyline";
|
|
15207
|
+
let Di = Ia;
|
|
15208
15208
|
var Nd = /* @__PURE__ */ ((i) => (i[i.Vertex = 0] = "Vertex", i[i.CurveFitVertex = 1] = "CurveFitVertex", i[i.SplineFitVertex = 8] = "SplineFitVertex", i[i.SplineCtlVertex = 9] = "SplineCtlVertex", i))(Nd || {});
|
|
15209
|
-
const
|
|
15209
|
+
const Pa = class Pa extends Ee {
|
|
15210
15210
|
/**
|
|
15211
15211
|
* Creates a new 2d vertex entity.
|
|
15212
15212
|
*/
|
|
@@ -15334,8 +15334,8 @@ const Ia = class Ia extends Ee {
|
|
|
15334
15334
|
draw(t) {
|
|
15335
15335
|
}
|
|
15336
15336
|
};
|
|
15337
|
-
|
|
15338
|
-
let Oo =
|
|
15337
|
+
Pa.typeName = "2dVertex";
|
|
15338
|
+
let Oo = Pa;
|
|
15339
15339
|
var $s = /* @__PURE__ */ ((i) => (i[i.SimplePoly = 0] = "SimplePoly", i[i.QuadSplinePoly = 1] = "QuadSplinePoly", i[i.CubicSplinePoly = 2] = "CubicSplinePoly", i))($s || {});
|
|
15340
15340
|
const Ea = class Ea extends ke {
|
|
15341
15341
|
/**
|
|
@@ -17772,7 +17772,7 @@ const Ra = class Ra extends ke {
|
|
|
17772
17772
|
};
|
|
17773
17773
|
Ra.typeName = "Line";
|
|
17774
17774
|
let qi = Ra;
|
|
17775
|
-
var
|
|
17775
|
+
var Ih = /* @__PURE__ */ ((i) => (i.ClosedFilled = "", i.Dot = "_DOT", i.DotSmall = "_DOTSMALL", i.DotBlank = "_DOTBLANK", i.Origin = "_ORIGIN", i.Origin2 = "_ORIGIN2", i.Open = "_OPEN", i.Open90 = "_OPEN90", i.Open30 = "_OPEN30", i.Closed = "_CLOSED", i.Small = "_SMALL", i.None = "_NONE", i.Oblique = "_OBLIQUE", i.BoxFilled = "_BOXFILLED", i.Box = "_BOXBLANK", i.ClosedBlank = "_CLOSEDBLANK", i.DatumBlank = "_DATUMBLANK", i.DatumFilled = "_DATUMFILLED", i.Integral = "_INTEGRAL", i.ArchTick = "_ARCHTICK", i))(Ih || {}), Gr = /* @__PURE__ */ ((i) => (i[i.LEFT_TO_RIGHT = 1] = "LEFT_TO_RIGHT", i[i.RIGHT_TO_LEFT = 2] = "RIGHT_TO_LEFT", i[i.TOP_TO_BOTTOM = 3] = "TOP_TO_BOTTOM", i[i.BOTTOM_TO_TOP = 4] = "BOTTOM_TO_TOP", i[i.BY_STYLE = 5] = "BY_STYLE", i))(Gr || {}), Pe = /* @__PURE__ */ ((i) => (i[i.TopLeft = 1] = "TopLeft", i[i.TopCenter = 2] = "TopCenter", i[i.TopRight = 3] = "TopRight", i[i.MiddleLeft = 4] = "MiddleLeft", i[i.MiddleCenter = 5] = "MiddleCenter", i[i.MiddleRight = 6] = "MiddleRight", i[i.BottomLeft = 7] = "BottomLeft", i[i.BottomCenter = 8] = "BottomCenter", i[i.BottomRight = 9] = "BottomRight", i))(Pe || {}), Ph = /* @__PURE__ */ ((i) => (i[i.OPTIMIZED_2D = 0] = "OPTIMIZED_2D", i[i.WIREFRAME = 1] = "WIREFRAME", i[i.HIDDEN_LINE = 2] = "HIDDEN_LINE", i[i.FLAT_SHADED = 3] = "FLAT_SHADED", i[i.GOURAUD_SHADED = 4] = "GOURAUD_SHADED", i[i.FLAT_SHADED_WITH_WIREFRAME = 5] = "FLAT_SHADED_WITH_WIREFRAME", i[i.GOURAUD_SHADED_WITH_WIREFRAME = 6] = "GOURAUD_SHADED_WITH_WIREFRAME", i))(Ph || {}), Eh = /* @__PURE__ */ ((i) => (i[i.NON_ORTHOGRAPHIC = 0] = "NON_ORTHOGRAPHIC", i[i.TOP = 1] = "TOP", i[i.BOTTOM = 2] = "BOTTOM", i[i.FRONT = 3] = "FRONT", i[i.BACK = 4] = "BACK", i[i.LEFT = 5] = "LEFT", i[i.RIGHT = 6] = "RIGHT", i))(Eh || {}), kh = /* @__PURE__ */ ((i) => (i[i.ONE_DISTANT_LIGHT = 0] = "ONE_DISTANT_LIGHT", i[i.TWO_DISTANT_LIGHTS = 1] = "TWO_DISTANT_LIGHTS", i))(kh || {});
|
|
17776
17776
|
class xa {
|
|
17777
17777
|
constructor() {
|
|
17778
17778
|
this._number = -1, this._id = "", this._groupId = "", this._centerPoint = new Y(), this._height = 0, this._width = 0, this._viewCenter = new Y(), this._viewHeight = 0;
|
|
@@ -17911,7 +17911,7 @@ const Fa = class Fa extends Ee {
|
|
|
17911
17911
|
* ```
|
|
17912
17912
|
*/
|
|
17913
17913
|
constructor() {
|
|
17914
|
-
super(), this._contents = "", this._height = 0, this._width = 0, this._lineSpacingFactor = 0.25, this._lineSpacingStyle = 0, this._backgroundFill = !1, this._backgroundFillColor = 13158600, this._backgroundFillTransparency = 1, this._backgroundScaleFactor = 1, this._rotation = 0, this._styleName = "", this._location = new Y(), this._attachmentPoint =
|
|
17914
|
+
super(), this._contents = "", this._height = 0, this._width = 0, this._lineSpacingFactor = 0.25, this._lineSpacingStyle = 0, this._backgroundFill = !1, this._backgroundFillColor = 13158600, this._backgroundFillTransparency = 1, this._backgroundScaleFactor = 1, this._rotation = 0, this._styleName = "", this._location = new Y(), this._attachmentPoint = Pe.TopLeft, this._direction = new Z(1, 0, 0), this._drawingDirection = Gr.LEFT_TO_RIGHT;
|
|
17915
17915
|
}
|
|
17916
17916
|
/**
|
|
17917
17917
|
* Gets the contents of the mtext object.
|
|
@@ -18174,15 +18174,15 @@ const Fa = class Fa extends Ee {
|
|
|
18174
18174
|
type: "enum",
|
|
18175
18175
|
editable: !0,
|
|
18176
18176
|
options: [
|
|
18177
|
-
{ label:
|
|
18178
|
-
{ label:
|
|
18179
|
-
{ label:
|
|
18180
|
-
{ label:
|
|
18181
|
-
{ label:
|
|
18182
|
-
{ label:
|
|
18183
|
-
{ label:
|
|
18184
|
-
{ label:
|
|
18185
|
-
{ label:
|
|
18177
|
+
{ label: Pe[1], value: 1 },
|
|
18178
|
+
{ label: Pe[2], value: 2 },
|
|
18179
|
+
{ label: Pe[3], value: 3 },
|
|
18180
|
+
{ label: Pe[4], value: 4 },
|
|
18181
|
+
{ label: Pe[5], value: 5 },
|
|
18182
|
+
{ label: Pe[6], value: 6 },
|
|
18183
|
+
{ label: Pe[7], value: 7 },
|
|
18184
|
+
{ label: Pe[8], value: 8 },
|
|
18185
|
+
{ label: Pe[9], value: 9 }
|
|
18186
18186
|
],
|
|
18187
18187
|
accessor: {
|
|
18188
18188
|
get: () => this.attachmentPoint,
|
|
@@ -18460,7 +18460,7 @@ const Rd = /* @__PURE__ */ new Z(), Da = class Da extends ti {
|
|
|
18460
18460
|
* @param numColumns - The number of columns in the table
|
|
18461
18461
|
*/
|
|
18462
18462
|
constructor(t, e, s) {
|
|
18463
|
-
super(t), this._attachmentPoint =
|
|
18463
|
+
super(t), this._attachmentPoint = Pe.TopLeft, this._numColumns = s, this._numRows = e, this._columnWidth = new Array(s), this._rowHeight = new Array(e), this._cells = new Array(e * s);
|
|
18464
18464
|
}
|
|
18465
18465
|
/**
|
|
18466
18466
|
* Gets or sets the cell alignment value for this table.
|
|
@@ -18673,7 +18673,7 @@ const Rd = /* @__PURE__ */ new Z(), Da = class Da extends ti {
|
|
|
18673
18673
|
E + z == this.numColumns && (o[c++] = E + M * (this.numColumns + 1) + z, o[c++] = dt);
|
|
18674
18674
|
const vt = -h[dt * 3 + 1] - e;
|
|
18675
18675
|
if (M + D == this.numRows && (o[c++] = E + (M + D) * (this.numColumns + 1) + D, o[c++] = E + (M + D) * (this.numColumns + 1)), o[c++] = E + (M + D) * (this.numColumns + 1), o[c++] = E + M * (this.numColumns + 1), L.text) {
|
|
18676
|
-
const ot = L.attachmentPoint || this.attachmentPoint ||
|
|
18676
|
+
const ot = L.attachmentPoint || this.attachmentPoint || Pe.MiddleCenter, W = this.getTableTextOffset(
|
|
18677
18677
|
ot,
|
|
18678
18678
|
B,
|
|
18679
18679
|
vt
|
|
@@ -19276,7 +19276,7 @@ const Ua = class Ua extends Ee {
|
|
|
19276
19276
|
rotation: this.rotation,
|
|
19277
19277
|
// MText draw text from top to bottom.
|
|
19278
19278
|
drawingDirection: Gr.BOTTOM_TO_TOP,
|
|
19279
|
-
attachmentPoint:
|
|
19279
|
+
attachmentPoint: Pe.BottomLeft
|
|
19280
19280
|
}, o = { ...this.getTextStyle(), color: this.rgbColor };
|
|
19281
19281
|
return t.mtext(s, o, e);
|
|
19282
19282
|
}
|
|
@@ -21250,7 +21250,7 @@ const Ka = class Ka extends Ee {
|
|
|
21250
21250
|
*/
|
|
21251
21251
|
getArrowName(t) {
|
|
21252
21252
|
const e = this.database.tables.blockTable.getIdAt(t);
|
|
21253
|
-
return e ? e.name.toUpperCase() :
|
|
21253
|
+
return e ? e.name.toUpperCase() : Ih.Closed;
|
|
21254
21254
|
}
|
|
21255
21255
|
};
|
|
21256
21256
|
Ka.typeName = "Dimension";
|
|
@@ -22332,7 +22332,7 @@ class Do {
|
|
|
22332
22332
|
});
|
|
22333
22333
|
}), e.add(x);
|
|
22334
22334
|
} else {
|
|
22335
|
-
const g = h, x = new
|
|
22335
|
+
const g = h, x = new Pd();
|
|
22336
22336
|
g.edges.forEach((f) => {
|
|
22337
22337
|
if (f.type == 1) {
|
|
22338
22338
|
const w = f;
|
|
@@ -22340,7 +22340,7 @@ class Do {
|
|
|
22340
22340
|
} else if (f.type == 2) {
|
|
22341
22341
|
const w = f;
|
|
22342
22342
|
x.add(
|
|
22343
|
-
new
|
|
22343
|
+
new Ps(
|
|
22344
22344
|
w.center,
|
|
22345
22345
|
w.radius,
|
|
22346
22346
|
kt.degToRad(w.startAngle || 0),
|
|
@@ -22564,6 +22564,229 @@ class Do {
|
|
|
22564
22564
|
return h;
|
|
22565
22565
|
}
|
|
22566
22566
|
}
|
|
22567
|
+
class Fn extends pn {
|
|
22568
|
+
/**
|
|
22569
|
+
* Creates a new AcDbSymbolTableRecord instance.
|
|
22570
|
+
*
|
|
22571
|
+
* @param attrs - Input attribute values for this symbol table record
|
|
22572
|
+
* @param defaultAttrs - Default values for attributes of this symbol table record
|
|
22573
|
+
*
|
|
22574
|
+
* @example
|
|
22575
|
+
* ```typescript
|
|
22576
|
+
* const record = new AcDbSymbolTableRecord({ name: 'MyRecord' });
|
|
22577
|
+
* ```
|
|
22578
|
+
*/
|
|
22579
|
+
constructor(t, e) {
|
|
22580
|
+
t = t || {}, ks(t, { name: "" }), super(t, e);
|
|
22581
|
+
}
|
|
22582
|
+
/**
|
|
22583
|
+
* Gets or sets the name of the symbol table record.
|
|
22584
|
+
*
|
|
22585
|
+
* This property corresponds to DXF group code 2 and is used for
|
|
22586
|
+
* identifying and referencing the symbol table record.
|
|
22587
|
+
*
|
|
22588
|
+
* @returns The name of the symbol table record
|
|
22589
|
+
*
|
|
22590
|
+
* @example
|
|
22591
|
+
* ```typescript
|
|
22592
|
+
* const recordName = record.name;
|
|
22593
|
+
* record.name = 'NewRecordName';
|
|
22594
|
+
* ```
|
|
22595
|
+
*/
|
|
22596
|
+
get name() {
|
|
22597
|
+
return this.getAttr("name");
|
|
22598
|
+
}
|
|
22599
|
+
set name(t) {
|
|
22600
|
+
this.setAttr("name", t);
|
|
22601
|
+
}
|
|
22602
|
+
}
|
|
22603
|
+
const jr = class jr extends Fn {
|
|
22604
|
+
/**
|
|
22605
|
+
* Returns true if the specified name is the name of the model space block table record.
|
|
22606
|
+
*
|
|
22607
|
+
* Model space is the primary drawing area where most entities are created.
|
|
22608
|
+
*
|
|
22609
|
+
* @param name - The name of one block table record.
|
|
22610
|
+
* @returns True if the specified name is the name of the model space block table record.
|
|
22611
|
+
*
|
|
22612
|
+
* @example
|
|
22613
|
+
* ```typescript
|
|
22614
|
+
* if (AcDbBlockTableRecord.isModelSapceName('*Model_Space')) {
|
|
22615
|
+
* console.log('This is the name of the model space block table record.');
|
|
22616
|
+
* }
|
|
22617
|
+
* ```
|
|
22618
|
+
*/
|
|
22619
|
+
static isModelSapceName(t) {
|
|
22620
|
+
return t.toLowerCase() == jr.MODEL_SPACE_NAME.toLowerCase();
|
|
22621
|
+
}
|
|
22622
|
+
/**
|
|
22623
|
+
* Returns true if the specified name is the name of a paper space block table record.
|
|
22624
|
+
*
|
|
22625
|
+
* Paper space is used for creating layouts for printing and plotting.
|
|
22626
|
+
*
|
|
22627
|
+
* @param name - The name of one block table record.
|
|
22628
|
+
* @returns True if the specified name is the name of a paper space block table record.
|
|
22629
|
+
*
|
|
22630
|
+
* @example
|
|
22631
|
+
* ```typescript
|
|
22632
|
+
* if (AcDbBlockTableRecord.isPaperSapceName('*Paper_Space1')) {
|
|
22633
|
+
* console.log('This is the name of the paper space block table record.');
|
|
22634
|
+
* }
|
|
22635
|
+
* ```
|
|
22636
|
+
*/
|
|
22637
|
+
static isPaperSapceName(t) {
|
|
22638
|
+
return t.toLowerCase().startsWith(jr.PAPER_SPACE_NAME_PREFIX.toLowerCase());
|
|
22639
|
+
}
|
|
22640
|
+
/**
|
|
22641
|
+
* Creates a new AcDbBlockTableRecord instance.
|
|
22642
|
+
*
|
|
22643
|
+
* @example
|
|
22644
|
+
* ```typescript
|
|
22645
|
+
* const blockRecord = new AcDbBlockTableRecord();
|
|
22646
|
+
* ```
|
|
22647
|
+
*/
|
|
22648
|
+
constructor() {
|
|
22649
|
+
super(), this._origin = new Y(), this._layoutId = "", this._entities = /* @__PURE__ */ new Map();
|
|
22650
|
+
}
|
|
22651
|
+
/**
|
|
22652
|
+
* Returns true if this is a model space block table record.
|
|
22653
|
+
*
|
|
22654
|
+
* Model space is the primary drawing area where most entities are created.
|
|
22655
|
+
*
|
|
22656
|
+
* @returns True if this is a model space block table record
|
|
22657
|
+
*
|
|
22658
|
+
* @example
|
|
22659
|
+
* ```typescript
|
|
22660
|
+
* if (blockRecord.isModelSapce) {
|
|
22661
|
+
* console.log('This is model space');
|
|
22662
|
+
* }
|
|
22663
|
+
* ```
|
|
22664
|
+
*/
|
|
22665
|
+
get isModelSapce() {
|
|
22666
|
+
return jr.isModelSapceName(this.name);
|
|
22667
|
+
}
|
|
22668
|
+
/**
|
|
22669
|
+
* Returns true if this is a paper space block table record.
|
|
22670
|
+
*
|
|
22671
|
+
* Paper space is used for creating layouts for printing and plotting.
|
|
22672
|
+
*
|
|
22673
|
+
* @returns True if this is a paper space block table record
|
|
22674
|
+
*
|
|
22675
|
+
* @example
|
|
22676
|
+
* ```typescript
|
|
22677
|
+
* if (blockRecord.isPaperSapce) {
|
|
22678
|
+
* console.log('This is paper space');
|
|
22679
|
+
* }
|
|
22680
|
+
* ```
|
|
22681
|
+
*/
|
|
22682
|
+
get isPaperSapce() {
|
|
22683
|
+
return jr.isPaperSapceName(this.name);
|
|
22684
|
+
}
|
|
22685
|
+
/**
|
|
22686
|
+
* Gets or sets the base point of the block in WCS coordinates.
|
|
22687
|
+
*
|
|
22688
|
+
* This point is the origin of the MCS (Model Coordinate System), which is the
|
|
22689
|
+
* local WCS for the entities within the block table record.
|
|
22690
|
+
*
|
|
22691
|
+
* @returns The origin point of the block
|
|
22692
|
+
*
|
|
22693
|
+
* @example
|
|
22694
|
+
* ```typescript
|
|
22695
|
+
* const origin = blockRecord.origin;
|
|
22696
|
+
* blockRecord.origin = new AcGePoint3d(10, 20, 0);
|
|
22697
|
+
* ```
|
|
22698
|
+
*/
|
|
22699
|
+
get origin() {
|
|
22700
|
+
return this._origin;
|
|
22701
|
+
}
|
|
22702
|
+
set origin(t) {
|
|
22703
|
+
this._origin.copy(t);
|
|
22704
|
+
}
|
|
22705
|
+
/**
|
|
22706
|
+
* Gets or sets the object ID of the associated AcDbLayout object in the Layouts dictionary.
|
|
22707
|
+
*
|
|
22708
|
+
* This property links the block table record to its corresponding layout object,
|
|
22709
|
+
* which defines the viewport configuration and display settings for the block.
|
|
22710
|
+
* For model space blocks, this is typically empty, while paper space blocks
|
|
22711
|
+
* have a corresponding layout ID.
|
|
22712
|
+
*
|
|
22713
|
+
* @returns The object ID of the associated layout
|
|
22714
|
+
*
|
|
22715
|
+
* @example
|
|
22716
|
+
* ```typescript
|
|
22717
|
+
* const layoutId = blockRecord.layoutId;
|
|
22718
|
+
* blockRecord.layoutId = 'some-layout-object-id';
|
|
22719
|
+
* ```
|
|
22720
|
+
*/
|
|
22721
|
+
get layoutId() {
|
|
22722
|
+
return this._layoutId;
|
|
22723
|
+
}
|
|
22724
|
+
set layoutId(t) {
|
|
22725
|
+
this._layoutId = t;
|
|
22726
|
+
}
|
|
22727
|
+
/**
|
|
22728
|
+
* Appends the specified entity or entities to this block table record.
|
|
22729
|
+
*
|
|
22730
|
+
* This method adds an entity to the block and sets up the necessary
|
|
22731
|
+
* relationships between the entity and the block table record.
|
|
22732
|
+
*
|
|
22733
|
+
* @param entity - The entity or entities to append to this block table record
|
|
22734
|
+
*
|
|
22735
|
+
* @example
|
|
22736
|
+
* ```typescript
|
|
22737
|
+
* const line = new AcDbLine();
|
|
22738
|
+
* blockRecord.appendEntity(line);
|
|
22739
|
+
* ```
|
|
22740
|
+
*/
|
|
22741
|
+
appendEntity(t) {
|
|
22742
|
+
if (Array.isArray(t))
|
|
22743
|
+
for (let e = 0; e < t.length; ++e) {
|
|
22744
|
+
const s = t[e];
|
|
22745
|
+
s.database = this.database, s.ownerId = this.objectId, this._entities.set(s.objectId, s);
|
|
22746
|
+
}
|
|
22747
|
+
else
|
|
22748
|
+
t.database = this.database, t.ownerId = this.objectId, this._entities.set(t.objectId, t);
|
|
22749
|
+
(this.isModelSapce || this.isPaperSapce) && this.database.events.entityAppended.dispatch({
|
|
22750
|
+
database: this.database,
|
|
22751
|
+
entity: t
|
|
22752
|
+
});
|
|
22753
|
+
}
|
|
22754
|
+
/**
|
|
22755
|
+
* Creates an iterator object that can be used to iterate over the entities in the block table record.
|
|
22756
|
+
*
|
|
22757
|
+
* @returns An iterator object that can be used to iterate over the entities
|
|
22758
|
+
*
|
|
22759
|
+
* @example
|
|
22760
|
+
* ```typescript
|
|
22761
|
+
* const iterator = blockRecord.newIterator();
|
|
22762
|
+
* for (const entity of iterator) {
|
|
22763
|
+
* console.log('Entity:', entity.type);
|
|
22764
|
+
* }
|
|
22765
|
+
* ```
|
|
22766
|
+
*/
|
|
22767
|
+
newIterator() {
|
|
22768
|
+
return new ua(this._entities);
|
|
22769
|
+
}
|
|
22770
|
+
/**
|
|
22771
|
+
* Searches for an entity in this block table record with the specified ID.
|
|
22772
|
+
*
|
|
22773
|
+
* @param id - The entity ID to search for
|
|
22774
|
+
* @returns The entity with the specified ID, or undefined if not found
|
|
22775
|
+
*
|
|
22776
|
+
* @example
|
|
22777
|
+
* ```typescript
|
|
22778
|
+
* const entity = blockRecord.getIdAt('some-entity-id');
|
|
22779
|
+
* if (entity) {
|
|
22780
|
+
* console.log('Found entity:', entity.type);
|
|
22781
|
+
* }
|
|
22782
|
+
* ```
|
|
22783
|
+
*/
|
|
22784
|
+
getIdAt(t) {
|
|
22785
|
+
return this._entities.get(t);
|
|
22786
|
+
}
|
|
22787
|
+
};
|
|
22788
|
+
jr.MODEL_SPACE_NAME = "*MODEL_SPACE", jr.PAPER_SPACE_NAME_PREFIX = "*PAPER_SPACE";
|
|
22789
|
+
let Ge = jr;
|
|
22567
22790
|
class ba extends pn {
|
|
22568
22791
|
/**
|
|
22569
22792
|
* Creates a new AcDbLayout instance.
|
|
@@ -23032,9 +23255,13 @@ class Wd {
|
|
|
23032
23255
|
* ```
|
|
23033
23256
|
*/
|
|
23034
23257
|
convertLayout(t, e) {
|
|
23035
|
-
var o;
|
|
23258
|
+
var o, h;
|
|
23036
23259
|
const s = new ba();
|
|
23037
|
-
|
|
23260
|
+
if (s.layoutName = t.layoutName, s.tabOrder = t.tabOrder, t.ownerObjectId ? s.blockTableRecordId = t.ownerObjectId : (o = e.tables.BLOCK_RECORD) == null || o.entries.some((c) => c.layoutObjects === t.handle ? (s.blockTableRecordId = c.handle, !0) : !1), !s.blockTableRecordId && t.layoutName === "Model") {
|
|
23261
|
+
const c = Ge.MODEL_SPACE_NAME;
|
|
23262
|
+
(h = e.tables.BLOCK_RECORD) == null || h.entries.some((g) => g.name.toUpperCase() === c ? (s.blockTableRecordId = g.handle, !0) : !1);
|
|
23263
|
+
}
|
|
23264
|
+
return s.limits.min.copy(t.minLimit), s.limits.max.copy(t.maxLimit), s.extents.min.copy(t.minExtent), s.extents.max.copy(t.maxExtent), this.processCommonAttrs(t, s), s;
|
|
23038
23265
|
}
|
|
23039
23266
|
/**
|
|
23040
23267
|
* Converts a DXF image definition object to an AcDbRasterImageDef.
|
|
@@ -23246,7 +23473,7 @@ class Yd {
|
|
|
23246
23473
|
function qd(i) {
|
|
23247
23474
|
return new Yd(i);
|
|
23248
23475
|
}
|
|
23249
|
-
class
|
|
23476
|
+
class P0 {
|
|
23250
23477
|
constructor() {
|
|
23251
23478
|
this.setupMessageHandler();
|
|
23252
23479
|
}
|
|
@@ -23477,7 +23704,7 @@ class Xd extends Zo {
|
|
|
23477
23704
|
const s = t.blocks;
|
|
23478
23705
|
for (const [o, h] of Object.entries(s)) {
|
|
23479
23706
|
let c = e.tables.blockTable.getAt(h.name);
|
|
23480
|
-
c || (c = new
|
|
23707
|
+
c || (c = new Ge(), c.objectId = h.handle, c.name = o, c.origin.copy(h.position), e.tables.blockTable.add(c)), h.entities && this.processEntitiesInBlock(h.entities, c);
|
|
23481
23708
|
}
|
|
23482
23709
|
}
|
|
23483
23710
|
/**
|
|
@@ -23516,7 +23743,7 @@ class Xd extends Zo {
|
|
|
23516
23743
|
var o;
|
|
23517
23744
|
const s = (o = t.tables.BLOCK_RECORD) == null ? void 0 : o.entries;
|
|
23518
23745
|
s && s.length > 0 && (e.tables.blockTable.removeAll(), s.forEach((h) => {
|
|
23519
|
-
const c = new
|
|
23746
|
+
const c = new Ge();
|
|
23520
23747
|
c.objectId = h.handle, c.name = h.name, c.layoutId = h.layoutObjects, e.tables.blockTable.add(c);
|
|
23521
23748
|
}));
|
|
23522
23749
|
}
|
|
@@ -24052,229 +24279,6 @@ class kr {
|
|
|
24052
24279
|
}));
|
|
24053
24280
|
}
|
|
24054
24281
|
}
|
|
24055
|
-
class Fn extends pn {
|
|
24056
|
-
/**
|
|
24057
|
-
* Creates a new AcDbSymbolTableRecord instance.
|
|
24058
|
-
*
|
|
24059
|
-
* @param attrs - Input attribute values for this symbol table record
|
|
24060
|
-
* @param defaultAttrs - Default values for attributes of this symbol table record
|
|
24061
|
-
*
|
|
24062
|
-
* @example
|
|
24063
|
-
* ```typescript
|
|
24064
|
-
* const record = new AcDbSymbolTableRecord({ name: 'MyRecord' });
|
|
24065
|
-
* ```
|
|
24066
|
-
*/
|
|
24067
|
-
constructor(t, e) {
|
|
24068
|
-
t = t || {}, ks(t, { name: "" }), super(t, e);
|
|
24069
|
-
}
|
|
24070
|
-
/**
|
|
24071
|
-
* Gets or sets the name of the symbol table record.
|
|
24072
|
-
*
|
|
24073
|
-
* This property corresponds to DXF group code 2 and is used for
|
|
24074
|
-
* identifying and referencing the symbol table record.
|
|
24075
|
-
*
|
|
24076
|
-
* @returns The name of the symbol table record
|
|
24077
|
-
*
|
|
24078
|
-
* @example
|
|
24079
|
-
* ```typescript
|
|
24080
|
-
* const recordName = record.name;
|
|
24081
|
-
* record.name = 'NewRecordName';
|
|
24082
|
-
* ```
|
|
24083
|
-
*/
|
|
24084
|
-
get name() {
|
|
24085
|
-
return this.getAttr("name");
|
|
24086
|
-
}
|
|
24087
|
-
set name(t) {
|
|
24088
|
-
this.setAttr("name", t);
|
|
24089
|
-
}
|
|
24090
|
-
}
|
|
24091
|
-
const jr = class jr extends Fn {
|
|
24092
|
-
/**
|
|
24093
|
-
* Returns true if the specified name is the name of the model space block table record.
|
|
24094
|
-
*
|
|
24095
|
-
* Model space is the primary drawing area where most entities are created.
|
|
24096
|
-
*
|
|
24097
|
-
* @param name - The name of one block table record.
|
|
24098
|
-
* @returns True if the specified name is the name of the model space block table record.
|
|
24099
|
-
*
|
|
24100
|
-
* @example
|
|
24101
|
-
* ```typescript
|
|
24102
|
-
* if (AcDbBlockTableRecord.isModelSapceName('*Model_Space')) {
|
|
24103
|
-
* console.log('This is the name of the model space block table record.');
|
|
24104
|
-
* }
|
|
24105
|
-
* ```
|
|
24106
|
-
*/
|
|
24107
|
-
static isModelSapceName(t) {
|
|
24108
|
-
return t.toLowerCase() == jr.MODEL_SPACE_NAME.toLowerCase();
|
|
24109
|
-
}
|
|
24110
|
-
/**
|
|
24111
|
-
* Returns true if the specified name is the name of a paper space block table record.
|
|
24112
|
-
*
|
|
24113
|
-
* Paper space is used for creating layouts for printing and plotting.
|
|
24114
|
-
*
|
|
24115
|
-
* @param name - The name of one block table record.
|
|
24116
|
-
* @returns True if the specified name is the name of a paper space block table record.
|
|
24117
|
-
*
|
|
24118
|
-
* @example
|
|
24119
|
-
* ```typescript
|
|
24120
|
-
* if (AcDbBlockTableRecord.isPaperSapceName('*Paper_Space1')) {
|
|
24121
|
-
* console.log('This is the name of the paper space block table record.');
|
|
24122
|
-
* }
|
|
24123
|
-
* ```
|
|
24124
|
-
*/
|
|
24125
|
-
static isPaperSapceName(t) {
|
|
24126
|
-
return t.toLowerCase().startsWith(jr.PAPER_SPACE_NAME_PREFIX.toLowerCase());
|
|
24127
|
-
}
|
|
24128
|
-
/**
|
|
24129
|
-
* Creates a new AcDbBlockTableRecord instance.
|
|
24130
|
-
*
|
|
24131
|
-
* @example
|
|
24132
|
-
* ```typescript
|
|
24133
|
-
* const blockRecord = new AcDbBlockTableRecord();
|
|
24134
|
-
* ```
|
|
24135
|
-
*/
|
|
24136
|
-
constructor() {
|
|
24137
|
-
super(), this._origin = new Y(), this._layoutId = "", this._entities = /* @__PURE__ */ new Map();
|
|
24138
|
-
}
|
|
24139
|
-
/**
|
|
24140
|
-
* Returns true if this is a model space block table record.
|
|
24141
|
-
*
|
|
24142
|
-
* Model space is the primary drawing area where most entities are created.
|
|
24143
|
-
*
|
|
24144
|
-
* @returns True if this is a model space block table record
|
|
24145
|
-
*
|
|
24146
|
-
* @example
|
|
24147
|
-
* ```typescript
|
|
24148
|
-
* if (blockRecord.isModelSapce) {
|
|
24149
|
-
* console.log('This is model space');
|
|
24150
|
-
* }
|
|
24151
|
-
* ```
|
|
24152
|
-
*/
|
|
24153
|
-
get isModelSapce() {
|
|
24154
|
-
return jr.isModelSapceName(this.name);
|
|
24155
|
-
}
|
|
24156
|
-
/**
|
|
24157
|
-
* Returns true if this is a paper space block table record.
|
|
24158
|
-
*
|
|
24159
|
-
* Paper space is used for creating layouts for printing and plotting.
|
|
24160
|
-
*
|
|
24161
|
-
* @returns True if this is a paper space block table record
|
|
24162
|
-
*
|
|
24163
|
-
* @example
|
|
24164
|
-
* ```typescript
|
|
24165
|
-
* if (blockRecord.isPaperSapce) {
|
|
24166
|
-
* console.log('This is paper space');
|
|
24167
|
-
* }
|
|
24168
|
-
* ```
|
|
24169
|
-
*/
|
|
24170
|
-
get isPaperSapce() {
|
|
24171
|
-
return jr.isPaperSapceName(this.name);
|
|
24172
|
-
}
|
|
24173
|
-
/**
|
|
24174
|
-
* Gets or sets the base point of the block in WCS coordinates.
|
|
24175
|
-
*
|
|
24176
|
-
* This point is the origin of the MCS (Model Coordinate System), which is the
|
|
24177
|
-
* local WCS for the entities within the block table record.
|
|
24178
|
-
*
|
|
24179
|
-
* @returns The origin point of the block
|
|
24180
|
-
*
|
|
24181
|
-
* @example
|
|
24182
|
-
* ```typescript
|
|
24183
|
-
* const origin = blockRecord.origin;
|
|
24184
|
-
* blockRecord.origin = new AcGePoint3d(10, 20, 0);
|
|
24185
|
-
* ```
|
|
24186
|
-
*/
|
|
24187
|
-
get origin() {
|
|
24188
|
-
return this._origin;
|
|
24189
|
-
}
|
|
24190
|
-
set origin(t) {
|
|
24191
|
-
this._origin.copy(t);
|
|
24192
|
-
}
|
|
24193
|
-
/**
|
|
24194
|
-
* Gets or sets the object ID of the associated AcDbLayout object in the Layouts dictionary.
|
|
24195
|
-
*
|
|
24196
|
-
* This property links the block table record to its corresponding layout object,
|
|
24197
|
-
* which defines the viewport configuration and display settings for the block.
|
|
24198
|
-
* For model space blocks, this is typically empty, while paper space blocks
|
|
24199
|
-
* have a corresponding layout ID.
|
|
24200
|
-
*
|
|
24201
|
-
* @returns The object ID of the associated layout
|
|
24202
|
-
*
|
|
24203
|
-
* @example
|
|
24204
|
-
* ```typescript
|
|
24205
|
-
* const layoutId = blockRecord.layoutId;
|
|
24206
|
-
* blockRecord.layoutId = 'some-layout-object-id';
|
|
24207
|
-
* ```
|
|
24208
|
-
*/
|
|
24209
|
-
get layoutId() {
|
|
24210
|
-
return this._layoutId;
|
|
24211
|
-
}
|
|
24212
|
-
set layoutId(t) {
|
|
24213
|
-
this._layoutId = t;
|
|
24214
|
-
}
|
|
24215
|
-
/**
|
|
24216
|
-
* Appends the specified entity or entities to this block table record.
|
|
24217
|
-
*
|
|
24218
|
-
* This method adds an entity to the block and sets up the necessary
|
|
24219
|
-
* relationships between the entity and the block table record.
|
|
24220
|
-
*
|
|
24221
|
-
* @param entity - The entity or entities to append to this block table record
|
|
24222
|
-
*
|
|
24223
|
-
* @example
|
|
24224
|
-
* ```typescript
|
|
24225
|
-
* const line = new AcDbLine();
|
|
24226
|
-
* blockRecord.appendEntity(line);
|
|
24227
|
-
* ```
|
|
24228
|
-
*/
|
|
24229
|
-
appendEntity(t) {
|
|
24230
|
-
if (Array.isArray(t))
|
|
24231
|
-
for (let e = 0; e < t.length; ++e) {
|
|
24232
|
-
const s = t[e];
|
|
24233
|
-
s.database = this.database, s.ownerId = this.objectId, this._entities.set(s.objectId, s);
|
|
24234
|
-
}
|
|
24235
|
-
else
|
|
24236
|
-
t.database = this.database, t.ownerId = this.objectId, this._entities.set(t.objectId, t);
|
|
24237
|
-
(this.isModelSapce || this.isPaperSapce) && this.database.events.entityAppended.dispatch({
|
|
24238
|
-
database: this.database,
|
|
24239
|
-
entity: t
|
|
24240
|
-
});
|
|
24241
|
-
}
|
|
24242
|
-
/**
|
|
24243
|
-
* Creates an iterator object that can be used to iterate over the entities in the block table record.
|
|
24244
|
-
*
|
|
24245
|
-
* @returns An iterator object that can be used to iterate over the entities
|
|
24246
|
-
*
|
|
24247
|
-
* @example
|
|
24248
|
-
* ```typescript
|
|
24249
|
-
* const iterator = blockRecord.newIterator();
|
|
24250
|
-
* for (const entity of iterator) {
|
|
24251
|
-
* console.log('Entity:', entity.type);
|
|
24252
|
-
* }
|
|
24253
|
-
* ```
|
|
24254
|
-
*/
|
|
24255
|
-
newIterator() {
|
|
24256
|
-
return new ua(this._entities);
|
|
24257
|
-
}
|
|
24258
|
-
/**
|
|
24259
|
-
* Searches for an entity in this block table record with the specified ID.
|
|
24260
|
-
*
|
|
24261
|
-
* @param id - The entity ID to search for
|
|
24262
|
-
* @returns The entity with the specified ID, or undefined if not found
|
|
24263
|
-
*
|
|
24264
|
-
* @example
|
|
24265
|
-
* ```typescript
|
|
24266
|
-
* const entity = blockRecord.getIdAt('some-entity-id');
|
|
24267
|
-
* if (entity) {
|
|
24268
|
-
* console.log('Found entity:', entity.type);
|
|
24269
|
-
* }
|
|
24270
|
-
* ```
|
|
24271
|
-
*/
|
|
24272
|
-
getIdAt(t) {
|
|
24273
|
-
return this._entities.get(t);
|
|
24274
|
-
}
|
|
24275
|
-
};
|
|
24276
|
-
jr.MODEL_SPACE_NAME = "*MODEL_SPACE", jr.PAPER_SPACE_NAME_PREFIX = "*PAPER_SPACE";
|
|
24277
|
-
let He = jr;
|
|
24278
24282
|
class Bn extends pn {
|
|
24279
24283
|
/**
|
|
24280
24284
|
* Creates a new AcDbSymbolTable instance.
|
|
@@ -24509,8 +24513,8 @@ class $d extends Bn {
|
|
|
24509
24513
|
* ```
|
|
24510
24514
|
*/
|
|
24511
24515
|
get modelSpace() {
|
|
24512
|
-
let t = this.getAt(
|
|
24513
|
-
return t || (t = new
|
|
24516
|
+
let t = this.getAt(Ge.MODEL_SPACE_NAME);
|
|
24517
|
+
return t || (t = new Ge(), t.name = Ge.MODEL_SPACE_NAME, this.add(t)), t;
|
|
24514
24518
|
}
|
|
24515
24519
|
/**
|
|
24516
24520
|
* Normalizes the specified block table record name if it is one paper spacce or model space
|
|
@@ -24522,10 +24526,10 @@ class $d extends Bn {
|
|
|
24522
24526
|
*/
|
|
24523
24527
|
normalizeName(t) {
|
|
24524
24528
|
let e = t;
|
|
24525
|
-
if (
|
|
24526
|
-
e =
|
|
24527
|
-
else if (
|
|
24528
|
-
const s =
|
|
24529
|
+
if (Ge.isModelSapceName(t))
|
|
24530
|
+
e = Ge.MODEL_SPACE_NAME;
|
|
24531
|
+
else if (Ge.isPaperSapceName(t)) {
|
|
24532
|
+
const s = Ge.PAPER_SPACE_NAME_PREFIX, o = t.substring(s.length);
|
|
24529
24533
|
e = s + o;
|
|
24530
24534
|
}
|
|
24531
24535
|
return e;
|
|
@@ -26724,7 +26728,7 @@ const o0 = {
|
|
|
26724
26728
|
viewTwistAngle: 0,
|
|
26725
26729
|
frozenLayers: [],
|
|
26726
26730
|
styleSheet: "",
|
|
26727
|
-
renderMode:
|
|
26731
|
+
renderMode: Ph.OPTIMIZED_2D,
|
|
26728
26732
|
viewMode: 0,
|
|
26729
26733
|
ucsIconSetting: 0,
|
|
26730
26734
|
ucsOrigin: new Y(0, 0, 0),
|
|
@@ -27093,7 +27097,7 @@ class h0 {
|
|
|
27093
27097
|
createLayout(t, e) {
|
|
27094
27098
|
const s = this.getWorkingDatabase(e), o = new ba();
|
|
27095
27099
|
o.layoutName = t, o.tabOrder = s.dictionaries.layouts.maxTabOrder;
|
|
27096
|
-
const h = new
|
|
27100
|
+
const h = new Ge();
|
|
27097
27101
|
return h.name = `*Paper_Space${o.tabOrder}`, s.tables.blockTable.add(h), s.dictionaries.layouts.setAt(t, o), this.events.layoutCreated.dispatch({
|
|
27098
27102
|
layout: o
|
|
27099
27103
|
}), { layout: o, btr: h };
|
|
@@ -27213,11 +27217,11 @@ export {
|
|
|
27213
27217
|
qo as AcDbAngleUnits,
|
|
27214
27218
|
Vi as AcDbArc,
|
|
27215
27219
|
Bo as AcDbArcDimension,
|
|
27216
|
-
|
|
27220
|
+
P0 as AcDbBaseWorker,
|
|
27217
27221
|
Yo as AcDbBatchProcessing,
|
|
27218
27222
|
ti as AcDbBlockReference,
|
|
27219
27223
|
$d as AcDbBlockTable,
|
|
27220
|
-
|
|
27224
|
+
Ge as AcDbBlockTableRecord,
|
|
27221
27225
|
Gi as AcDbCircle,
|
|
27222
27226
|
Xo as AcDbCodePage,
|
|
27223
27227
|
ke as AcDbCurve,
|
|
@@ -27295,7 +27299,7 @@ export {
|
|
|
27295
27299
|
be as AcGeBox2d,
|
|
27296
27300
|
Ct as AcGeBox3d,
|
|
27297
27301
|
Md as AcGeCatmullRomCurve3d,
|
|
27298
|
-
|
|
27302
|
+
Ps as AcGeCircArc2d,
|
|
27299
27303
|
Ln as AcGeCircArc3d,
|
|
27300
27304
|
Ms as AcGeCurve2d,
|
|
27301
27305
|
_a as AcGeEllipseArc2d,
|
|
@@ -27304,7 +27308,7 @@ export {
|
|
|
27304
27308
|
gd as AcGeGeometryUtil,
|
|
27305
27309
|
ya as AcGeLine2d,
|
|
27306
27310
|
dn as AcGeLine3d,
|
|
27307
|
-
|
|
27311
|
+
Pd as AcGeLoop2d,
|
|
27308
27312
|
kt as AcGeMathUtil,
|
|
27309
27313
|
ga as AcGeMatrix2d,
|
|
27310
27314
|
cn as AcGeMatrix3d,
|
|
@@ -27319,12 +27323,12 @@ export {
|
|
|
27319
27323
|
gh as AcGeTol,
|
|
27320
27324
|
Zt as AcGeVector2d,
|
|
27321
27325
|
Z as AcGeVector3d,
|
|
27322
|
-
|
|
27326
|
+
Ih as AcGiArrowType,
|
|
27323
27327
|
kh as AcGiDefaultLightingType,
|
|
27324
|
-
|
|
27328
|
+
Pe as AcGiMTextAttachmentPoint,
|
|
27325
27329
|
Gr as AcGiMTextFlowDirection,
|
|
27326
27330
|
Eh as AcGiOrthographicType,
|
|
27327
|
-
|
|
27331
|
+
Ph as AcGiRenderMode,
|
|
27328
27332
|
xa as AcGiViewport,
|
|
27329
27333
|
g0 as AcTrStringUtil,
|
|
27330
27334
|
lu as ByBlock,
|
|
@@ -27359,12 +27363,12 @@ export {
|
|
|
27359
27363
|
fd as generateUniformKnots,
|
|
27360
27364
|
Jh as has,
|
|
27361
27365
|
ch as intPartLength,
|
|
27362
|
-
|
|
27366
|
+
I0 as interpolateControlPoints,
|
|
27363
27367
|
Zc as inverseLerp,
|
|
27364
27368
|
cd as isBetween,
|
|
27365
27369
|
dd as isBetweenAngle,
|
|
27366
27370
|
tu as isEmpty,
|
|
27367
|
-
|
|
27371
|
+
Is as isEqual,
|
|
27368
27372
|
x0 as isImperialUnits,
|
|
27369
27373
|
y0 as isMetricUnits,
|
|
27370
27374
|
_h as isPointInPolygon,
|