@archilogic/floor-plan-sdk 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/fpe.d.ts +134 -20
- package/dist/fpe.js +1715 -1204
- package/dist/fpe.umd.cjs +3 -3
- package/package.json +1 -1
package/dist/fpe.js
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
/*!
|
|
5
|
-
Archilogic Floor Plan Engine SDK v5.0.
|
|
5
|
+
Archilogic Floor Plan Engine SDK v5.0.1 webgl build 240924-085335-1e9f3d
|
|
6
6
|
|
|
7
7
|
Copyright (c) 2024 Archilogic AG. All rights reserved.
|
|
8
8
|
|
|
@@ -39,7 +39,7 @@ function Se$1(e2) {
|
|
|
39
39
|
function Ce(e2) {
|
|
40
40
|
return x$3(e2, 180);
|
|
41
41
|
}
|
|
42
|
-
function ke(e2) {
|
|
42
|
+
function ke$1(e2) {
|
|
43
43
|
return x$3(e2, 180);
|
|
44
44
|
}
|
|
45
45
|
const T$1 = " ", S$4 = {
|
|
@@ -53,7 +53,7 @@ const T$1 = " ", S$4 = {
|
|
|
53
53
|
function A$1(e2, t2 = 1 / 2, n2 = 1 / 64) {
|
|
54
54
|
return !(e2 % t2) || t2 <= n2 ? [e2 / t2, 1 / t2] : A$1(e2, t2 / 2);
|
|
55
55
|
}
|
|
56
|
-
const H$
|
|
56
|
+
const H$5 = (e2 = 0, t2 = "metric", n2 = 3) => {
|
|
57
57
|
if (t2 === "imperial") {
|
|
58
58
|
const { feet: r2, inches: i2, fraction: s2, isNegative: a2 } = P(e2);
|
|
59
59
|
let c2 = "";
|
|
@@ -65,7 +65,7 @@ const H$4 = (e2 = 0, t2 = "metric", n2 = 3) => {
|
|
|
65
65
|
}
|
|
66
66
|
const o2 = Math.pow(10, n2);
|
|
67
67
|
return `${Math.round(e2 * o2) / o2}${T$1}${S$4.meters}`;
|
|
68
|
-
}, Me
|
|
68
|
+
}, Me = (e2 = 0, t2 = "metric", n2 = 0, o2 = true) => {
|
|
69
69
|
let r2 = "", i2 = "";
|
|
70
70
|
const s2 = Math.pow(10, n2);
|
|
71
71
|
if (t2 === "imperial") {
|
|
@@ -89,7 +89,7 @@ function ee({ fileName: e2, href: t2, ext: n2 }) {
|
|
|
89
89
|
style: "display:none;"
|
|
90
90
|
}), document.body.appendChild(o2), o2.click(), document.body.removeChild(o2);
|
|
91
91
|
}
|
|
92
|
-
function _e
|
|
92
|
+
function _e(e2) {
|
|
93
93
|
return e2.replace(/([A-Z])/g, (t2) => ` ${t2}`).replace(/^./, (t2) => t2.toUpperCase()).trim();
|
|
94
94
|
}
|
|
95
95
|
function te$2(e2) {
|
|
@@ -118,10 +118,10 @@ function oe(e2) {
|
|
|
118
118
|
function re(e2) {
|
|
119
119
|
return j$4(e2).match(/^#[a-f0-9]{6}$/i) !== null;
|
|
120
120
|
}
|
|
121
|
-
function Ge
|
|
121
|
+
function Ge(e2) {
|
|
122
122
|
return JSON.parse(JSON.stringify(e2));
|
|
123
123
|
}
|
|
124
|
-
function ie
|
|
124
|
+
function ie(...e2) {
|
|
125
125
|
let t2 = {};
|
|
126
126
|
for (const n2 of e2)
|
|
127
127
|
if (n2 instanceof Array)
|
|
@@ -130,18 +130,18 @@ function ie$1(...e2) {
|
|
|
130
130
|
for (const o2 of Object.entries(n2)) {
|
|
131
131
|
const r2 = o2[0];
|
|
132
132
|
let i2 = o2[1];
|
|
133
|
-
i2 instanceof Object && r2 in t2 && (i2 = ie
|
|
133
|
+
i2 instanceof Object && r2 in t2 && (i2 = ie(t2[r2], i2)), t2 = { ...t2, [r2]: i2 };
|
|
134
134
|
}
|
|
135
135
|
return t2;
|
|
136
136
|
}
|
|
137
|
-
function $$
|
|
137
|
+
function $$5() {
|
|
138
138
|
return typeof window < "u" && typeof navigator < "u" && typeof document < "u";
|
|
139
139
|
}
|
|
140
140
|
function fe() {
|
|
141
|
-
return $$
|
|
141
|
+
return $$5() && navigator.platform.toUpperCase().indexOf("MAC") >= 0;
|
|
142
142
|
}
|
|
143
143
|
function de$1() {
|
|
144
|
-
return !$$
|
|
144
|
+
return !$$5() || window.self === window.top ? false : !!// ancestorOrigins will fail in some older browsers
|
|
145
145
|
(window.location.ancestorOrigins && window.location.ancestorOrigins[0] || document.referrer);
|
|
146
146
|
}
|
|
147
147
|
de$1();
|
|
@@ -206,7 +206,7 @@ let tt$1 = class tt {
|
|
|
206
206
|
this.levels.includes("errors") && console.error(...t2);
|
|
207
207
|
}
|
|
208
208
|
};
|
|
209
|
-
function nt
|
|
209
|
+
function nt(e2, t2 = 4) {
|
|
210
210
|
const n2 = Math.pow(10, t2);
|
|
211
211
|
return Math.round((e2 + Number.EPSILON) * n2) / n2;
|
|
212
212
|
}
|
|
@@ -472,8 +472,8 @@ class SpaceAPI {
|
|
|
472
472
|
constructor(token, mocks = {}) {
|
|
473
473
|
__publicField(this, "connection");
|
|
474
474
|
this.connection = new Connection(token);
|
|
475
|
-
for (const [key,
|
|
476
|
-
this[key] =
|
|
475
|
+
for (const [key, fn] of Object.entries(mocks)) {
|
|
476
|
+
this[key] = fn;
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
479
|
async createFloor(floor) {
|
|
@@ -4531,10 +4531,10 @@ function polygonOffset(polygons, delta = 0.1, endType, skipCleaning) {
|
|
|
4531
4531
|
polygons = cleanPolygons(polygons);
|
|
4532
4532
|
delta = delta && typeof delta === "number" ? delta : DEFAULT_DELTA;
|
|
4533
4533
|
let _polygons = getClipperPolygons(polygons);
|
|
4534
|
-
let
|
|
4534
|
+
let co2 = new ClipperLib$1.ClipperOffset(2);
|
|
4535
4535
|
let solution = [];
|
|
4536
|
-
|
|
4537
|
-
|
|
4536
|
+
co2.AddPaths(_polygons, ClipperLib$1.JoinType.jtMiter, endType);
|
|
4537
|
+
co2.Execute(solution, delta);
|
|
4538
4538
|
return getPolygonsFromClipper(solution);
|
|
4539
4539
|
}
|
|
4540
4540
|
function polygonWithHolesOffset(polygonLists, delta = 0.1, endType = ClipperLib$1.EndType.etClosedPolygon) {
|
|
@@ -4542,10 +4542,10 @@ function polygonWithHolesOffset(polygonLists, delta = 0.1, endType = ClipperLib$
|
|
|
4542
4542
|
return { polygons: [], polyTree: [] };
|
|
4543
4543
|
}
|
|
4544
4544
|
let paths = polygonLists.flatMap(getClipperPolygons);
|
|
4545
|
-
let
|
|
4546
|
-
|
|
4545
|
+
let co2 = new ClipperLib$1.ClipperOffset(2);
|
|
4546
|
+
co2.AddPaths(paths, ClipperLib$1.JoinType.jtMiter, endType);
|
|
4547
4547
|
let clipperPolyTree = new ClipperLib$1.PolyTree();
|
|
4548
|
-
|
|
4548
|
+
co2.Execute(clipperPolyTree, delta);
|
|
4549
4549
|
return getPolyTreeAndPolygons(clipperPolyTree);
|
|
4550
4550
|
}
|
|
4551
4551
|
function polygonDifference(subjectPolygons, clipPolygons, subjectPathOpen) {
|
|
@@ -4664,9 +4664,9 @@ function create$6() {
|
|
|
4664
4664
|
return out;
|
|
4665
4665
|
}
|
|
4666
4666
|
function invert(out, a2) {
|
|
4667
|
-
var
|
|
4667
|
+
var aa2 = a2[0], ab = a2[1], ac = a2[2], ad = a2[3];
|
|
4668
4668
|
var atx = a2[4], aty = a2[5];
|
|
4669
|
-
var det =
|
|
4669
|
+
var det = aa2 * ad - ab * ac;
|
|
4670
4670
|
if (!det) {
|
|
4671
4671
|
return null;
|
|
4672
4672
|
}
|
|
@@ -4674,9 +4674,9 @@ function invert(out, a2) {
|
|
|
4674
4674
|
out[0] = ad * det;
|
|
4675
4675
|
out[1] = -ab * det;
|
|
4676
4676
|
out[2] = -ac * det;
|
|
4677
|
-
out[3] =
|
|
4677
|
+
out[3] = aa2 * det;
|
|
4678
4678
|
out[4] = (ac * aty - ad * atx) * det;
|
|
4679
|
-
out[5] = (ab * atx -
|
|
4679
|
+
out[5] = (ab * atx - aa2 * aty) * det;
|
|
4680
4680
|
return out;
|
|
4681
4681
|
}
|
|
4682
4682
|
function rotate(out, a2, rad) {
|
|
@@ -4916,10 +4916,19 @@ function cross(out, a2, b2) {
|
|
|
4916
4916
|
out[2] = ax * by - ay * bx;
|
|
4917
4917
|
return out;
|
|
4918
4918
|
}
|
|
4919
|
+
function transformMat4(out, a2, m2) {
|
|
4920
|
+
var x2 = a2[0], y2 = a2[1], z2 = a2[2];
|
|
4921
|
+
var w2 = m2[3] * x2 + m2[7] * y2 + m2[11] * z2 + m2[15];
|
|
4922
|
+
w2 = w2 || 1;
|
|
4923
|
+
out[0] = (m2[0] * x2 + m2[4] * y2 + m2[8] * z2 + m2[12]) / w2;
|
|
4924
|
+
out[1] = (m2[1] * x2 + m2[5] * y2 + m2[9] * z2 + m2[13]) / w2;
|
|
4925
|
+
out[2] = (m2[2] * x2 + m2[6] * y2 + m2[10] * z2 + m2[14]) / w2;
|
|
4926
|
+
return out;
|
|
4927
|
+
}
|
|
4919
4928
|
var len = length;
|
|
4920
4929
|
(function() {
|
|
4921
4930
|
var vec = create$3();
|
|
4922
|
-
return function(a2, stride, offset, count,
|
|
4931
|
+
return function(a2, stride, offset, count, fn, arg) {
|
|
4923
4932
|
var i2, l2;
|
|
4924
4933
|
if (!stride) {
|
|
4925
4934
|
stride = 3;
|
|
@@ -4936,7 +4945,7 @@ var len = length;
|
|
|
4936
4945
|
vec[0] = a2[i2];
|
|
4937
4946
|
vec[1] = a2[i2 + 1];
|
|
4938
4947
|
vec[2] = a2[i2 + 2];
|
|
4939
|
-
|
|
4948
|
+
fn(vec, vec, arg);
|
|
4940
4949
|
a2[i2] = vec[0];
|
|
4941
4950
|
a2[i2 + 1] = vec[1];
|
|
4942
4951
|
a2[i2 + 2] = vec[2];
|
|
@@ -4971,7 +4980,7 @@ function normalize$1(out, a2) {
|
|
|
4971
4980
|
}
|
|
4972
4981
|
(function() {
|
|
4973
4982
|
var vec = create$2();
|
|
4974
|
-
return function(a2, stride, offset, count,
|
|
4983
|
+
return function(a2, stride, offset, count, fn, arg) {
|
|
4975
4984
|
var i2, l2;
|
|
4976
4985
|
if (!stride) {
|
|
4977
4986
|
stride = 4;
|
|
@@ -4989,7 +4998,7 @@ function normalize$1(out, a2) {
|
|
|
4989
4998
|
vec[1] = a2[i2 + 1];
|
|
4990
4999
|
vec[2] = a2[i2 + 2];
|
|
4991
5000
|
vec[3] = a2[i2 + 3];
|
|
4992
|
-
|
|
5001
|
+
fn(vec, vec, arg);
|
|
4993
5002
|
a2[i2] = vec[0];
|
|
4994
5003
|
a2[i2 + 1] = vec[1];
|
|
4995
5004
|
a2[i2 + 2] = vec[2];
|
|
@@ -5153,7 +5162,7 @@ function transformMat2d(out, a2, m2) {
|
|
|
5153
5162
|
}
|
|
5154
5163
|
(function() {
|
|
5155
5164
|
var vec = create();
|
|
5156
|
-
return function(a2, stride, offset, count,
|
|
5165
|
+
return function(a2, stride, offset, count, fn, arg) {
|
|
5157
5166
|
var i2, l2;
|
|
5158
5167
|
if (!stride) {
|
|
5159
5168
|
stride = 2;
|
|
@@ -5169,7 +5178,7 @@ function transformMat2d(out, a2, m2) {
|
|
|
5169
5178
|
for (i2 = offset; i2 < l2; i2 += stride) {
|
|
5170
5179
|
vec[0] = a2[i2];
|
|
5171
5180
|
vec[1] = a2[i2 + 1];
|
|
5172
|
-
|
|
5181
|
+
fn(vec, vec, arg);
|
|
5173
5182
|
a2[i2] = vec[0];
|
|
5174
5183
|
a2[i2 + 1] = vec[1];
|
|
5175
5184
|
}
|
|
@@ -5504,13 +5513,13 @@ class CSG {
|
|
|
5504
5513
|
var f3 = [], b2 = [];
|
|
5505
5514
|
for (var i2 = 0; i2 < polygon.vertices.length; i2++) {
|
|
5506
5515
|
var j2 = (i2 + 1) % polygon.vertices.length;
|
|
5507
|
-
var
|
|
5516
|
+
var ti2 = types[i2], tj = types[j2];
|
|
5508
5517
|
var vi = polygon.vertices[i2], vj = polygon.vertices[j2];
|
|
5509
|
-
if (
|
|
5518
|
+
if (ti2 != BACK)
|
|
5510
5519
|
f3.push(vi);
|
|
5511
|
-
if (
|
|
5512
|
-
b2.push(
|
|
5513
|
-
if ((
|
|
5520
|
+
if (ti2 != FRONT)
|
|
5521
|
+
b2.push(ti2 != BACK ? vi.clone() : vi);
|
|
5522
|
+
if ((ti2 | tj) == SPANNING) {
|
|
5514
5523
|
var t2 = (this.w - this.normal.dot(vi.pos)) / this.normal.dot(vj.pos.minus(vi.pos));
|
|
5515
5524
|
var v2 = vi.interpolate(vj, t2);
|
|
5516
5525
|
f3.push(v2);
|
|
@@ -6017,15 +6026,15 @@ function middleInside(a2, b2) {
|
|
|
6017
6026
|
return inside;
|
|
6018
6027
|
}
|
|
6019
6028
|
function splitPolygon(a2, b2) {
|
|
6020
|
-
var a22 = new Node(a2.i, a2.x, a2.y), b22 = new Node(b2.i, b2.x, b2.y),
|
|
6029
|
+
var a22 = new Node(a2.i, a2.x, a2.y), b22 = new Node(b2.i, b2.x, b2.y), an = a2.next, bp = b2.prev;
|
|
6021
6030
|
a2.next = b2;
|
|
6022
6031
|
b2.prev = a2;
|
|
6023
|
-
a22.next =
|
|
6024
|
-
|
|
6032
|
+
a22.next = an;
|
|
6033
|
+
an.prev = a22;
|
|
6025
6034
|
b22.next = a22;
|
|
6026
6035
|
a22.prev = b22;
|
|
6027
|
-
|
|
6028
|
-
b22.prev =
|
|
6036
|
+
bp.next = b22;
|
|
6037
|
+
b22.prev = bp;
|
|
6029
6038
|
return b22;
|
|
6030
6039
|
}
|
|
6031
6040
|
function insertNode(i2, x2, y2, last) {
|
|
@@ -6664,6 +6673,40 @@ function resolveProfile(profile) {
|
|
|
6664
6673
|
}
|
|
6665
6674
|
return { points, segmentRanges };
|
|
6666
6675
|
}
|
|
6676
|
+
function getBoundingBox(vertices) {
|
|
6677
|
+
let boundingBox = {
|
|
6678
|
+
min: [Infinity, Infinity, Infinity],
|
|
6679
|
+
max: [-Infinity, -Infinity, -Infinity]
|
|
6680
|
+
};
|
|
6681
|
+
let x2, y2, z2;
|
|
6682
|
+
for (let i2 = 0; i2 < vertices.length; i2 += 3) {
|
|
6683
|
+
x2 = vertices[i2];
|
|
6684
|
+
y2 = vertices[i2 + 1];
|
|
6685
|
+
z2 = vertices[i2 + 2];
|
|
6686
|
+
boundingBox.min[0] = Math.min(boundingBox.min[0], x2);
|
|
6687
|
+
boundingBox.max[0] = Math.max(boundingBox.max[0], x2);
|
|
6688
|
+
boundingBox.min[1] = Math.min(boundingBox.min[1], y2);
|
|
6689
|
+
boundingBox.max[1] = Math.max(boundingBox.max[1], y2);
|
|
6690
|
+
boundingBox.min[2] = Math.min(boundingBox.min[2], z2);
|
|
6691
|
+
boundingBox.max[2] = Math.max(boundingBox.max[2], z2);
|
|
6692
|
+
}
|
|
6693
|
+
return boundingBox;
|
|
6694
|
+
}
|
|
6695
|
+
function getAxisAlignedBoundingBox$1({ min, max: max2, transform }) {
|
|
6696
|
+
if (transform.rotation === 0) {
|
|
6697
|
+
return {
|
|
6698
|
+
min: vec3Add(min, transform.position),
|
|
6699
|
+
max: vec3Add(max2, transform.position)
|
|
6700
|
+
};
|
|
6701
|
+
} else {
|
|
6702
|
+
let mTransform = getPositionRotationMatrix(transform.position, transform.rotation, transform.rotationAxis);
|
|
6703
|
+
const points = [[...min], [...max2], [min[0], min[1], max2[2]], [max2[0], max2[1], min[2]]];
|
|
6704
|
+
for (const point of points) {
|
|
6705
|
+
transformMat4(point, point, mTransform);
|
|
6706
|
+
}
|
|
6707
|
+
return getBoundingBox(points.flat());
|
|
6708
|
+
}
|
|
6709
|
+
}
|
|
6667
6710
|
class LayoutBoundary {
|
|
6668
6711
|
constructor() {
|
|
6669
6712
|
this.vertices = [];
|
|
@@ -6800,10 +6843,12 @@ function registerElement(layout, element) {
|
|
|
6800
6843
|
return;
|
|
6801
6844
|
}
|
|
6802
6845
|
layout.elementsById[element.id] = element;
|
|
6803
|
-
|
|
6846
|
+
const elementsByType = layout.elementsByType[element.type];
|
|
6847
|
+
if (!elementsByType) {
|
|
6848
|
+
logger$1.warn(`unrecognized layout element type: ${element.type}`);
|
|
6804
6849
|
layout.elementsByType[element.type] = [];
|
|
6805
6850
|
}
|
|
6806
|
-
|
|
6851
|
+
elementsByType.push(element);
|
|
6807
6852
|
let spaceGraph = layout.spaceGraph;
|
|
6808
6853
|
if (spaceGraph) {
|
|
6809
6854
|
if (element.type === "element:asset" && element.product && !spaceGraph.productsById[element.product.id]) {
|
|
@@ -6825,13 +6870,13 @@ function unregisterElement(layout, element) {
|
|
|
6825
6870
|
return;
|
|
6826
6871
|
}
|
|
6827
6872
|
delete layout.elementsById[element.id];
|
|
6828
|
-
|
|
6829
|
-
|
|
6873
|
+
const elementsByType = layout.elementsByType[element.type];
|
|
6874
|
+
const elementsByTypeIndex = elementsByType == null ? void 0 : elementsByType.indexOf(element);
|
|
6830
6875
|
if (!elementsByType || elementsByTypeIndex === -1) {
|
|
6831
6876
|
logger$1.error(`element ${element.id} not found in 'elements stored by type' record.`);
|
|
6832
6877
|
return;
|
|
6833
6878
|
}
|
|
6834
|
-
|
|
6879
|
+
elementsByType.splice(elementsByTypeIndex, 1);
|
|
6835
6880
|
let spaceGraph = layout.spaceGraph;
|
|
6836
6881
|
if (spaceGraph) {
|
|
6837
6882
|
spaceGraph.unregisterNode(element);
|
|
@@ -6902,33 +6947,6 @@ function deepMerge(dstObject, srcObject, options = {
|
|
|
6902
6947
|
let cloneObjects = options.cloneObjects ?? true;
|
|
6903
6948
|
doDeepMerge(dstObject, srcObject, "", { onNewKeys, copyScopes, cloneObjects });
|
|
6904
6949
|
}
|
|
6905
|
-
const layoutElementTypeValues = [
|
|
6906
|
-
// Boundary elements
|
|
6907
|
-
"element:ceiling",
|
|
6908
|
-
"element:floor",
|
|
6909
|
-
"element:boundaryWall",
|
|
6910
|
-
// Edge elements
|
|
6911
|
-
"element:curtainWall",
|
|
6912
|
-
"element:spaceDivider",
|
|
6913
|
-
"element:wall",
|
|
6914
|
-
// Opening elements
|
|
6915
|
-
"element:opening",
|
|
6916
|
-
// Transform elements
|
|
6917
|
-
"element:asset",
|
|
6918
|
-
"element:beam",
|
|
6919
|
-
"element:casework",
|
|
6920
|
-
"element:column",
|
|
6921
|
-
"element:door",
|
|
6922
|
-
"element:generic",
|
|
6923
|
-
"element:kitchen",
|
|
6924
|
-
"element:railing",
|
|
6925
|
-
"element:ramp",
|
|
6926
|
-
"element:roof",
|
|
6927
|
-
"element:slab",
|
|
6928
|
-
"element:stairs",
|
|
6929
|
-
"element:stairFlight",
|
|
6930
|
-
"element:window"
|
|
6931
|
-
];
|
|
6932
6950
|
class LayoutElementBase extends LayoutNodeBase {
|
|
6933
6951
|
constructor() {
|
|
6934
6952
|
super(...arguments);
|
|
@@ -6994,12 +7012,7 @@ class LayoutElementBase extends LayoutNodeBase {
|
|
|
6994
7012
|
}
|
|
6995
7013
|
}
|
|
6996
7014
|
function getElementsAtLinearPosition(edgeElement, u2, leftInclusive) {
|
|
6997
|
-
let
|
|
6998
|
-
let vertex1 = edge.vertices[0];
|
|
6999
|
-
let vertex2 = edge.vertices[1];
|
|
7000
|
-
let position1 = vertex1.position;
|
|
7001
|
-
let position2 = vertex2.position;
|
|
7002
|
-
let edgeLength = vec2Length(vec2Sub(position2, position1));
|
|
7015
|
+
let edgeLength = edgeElement.getAxisLength();
|
|
7003
7016
|
let childElements = [];
|
|
7004
7017
|
for (let childElement of edgeElement.elements) {
|
|
7005
7018
|
if (childElement.type === "element:opening") {
|
|
@@ -7020,24 +7033,168 @@ function getElementsAtLinearPosition(edgeElement, u2, leftInclusive) {
|
|
|
7020
7033
|
}
|
|
7021
7034
|
return childElements;
|
|
7022
7035
|
}
|
|
7036
|
+
function getVertexMap(edges) {
|
|
7037
|
+
var _a;
|
|
7038
|
+
const vertexMap = /* @__PURE__ */ new Map();
|
|
7039
|
+
for (const edge of edges) {
|
|
7040
|
+
for (const vertex2 of edge.vertices) {
|
|
7041
|
+
if (!vertexMap.has(vertex2)) vertexMap.set(vertex2, []);
|
|
7042
|
+
(_a = vertexMap.get(vertex2)) == null ? void 0 : _a.push(edge);
|
|
7043
|
+
}
|
|
7044
|
+
}
|
|
7045
|
+
return vertexMap;
|
|
7046
|
+
}
|
|
7023
7047
|
class LayoutEdgeElementBase extends LayoutElementBase {
|
|
7024
|
-
constructor(id, type2,
|
|
7048
|
+
constructor(id, type2, edges) {
|
|
7025
7049
|
super(id, type2);
|
|
7026
|
-
this.
|
|
7050
|
+
this.edges = [];
|
|
7051
|
+
this.vertices = [];
|
|
7052
|
+
this.edgesChanged = false;
|
|
7053
|
+
this.setEdges(edges);
|
|
7054
|
+
}
|
|
7055
|
+
setEdges(edges) {
|
|
7056
|
+
var _a, _b;
|
|
7057
|
+
if (!edges.length) {
|
|
7058
|
+
this.edges = [];
|
|
7059
|
+
this.vertices = [];
|
|
7060
|
+
return;
|
|
7061
|
+
} else if (edges.length === 1) {
|
|
7062
|
+
this.edges = [edges[0]];
|
|
7063
|
+
this.vertices = [edges[0].vertices[0], edges[0].vertices[1]];
|
|
7064
|
+
return;
|
|
7065
|
+
}
|
|
7066
|
+
const vertexMap = getVertexMap(edges);
|
|
7067
|
+
const orderedVertices = [];
|
|
7068
|
+
let firstEdge;
|
|
7069
|
+
let currentVertex;
|
|
7070
|
+
for (const [vertex2, connectedEdges] of vertexMap.entries()) {
|
|
7071
|
+
if (connectedEdges.length === 1) {
|
|
7072
|
+
firstEdge = connectedEdges[0];
|
|
7073
|
+
const oppositeVertex = firstEdge.vertices.find((v2) => v2 !== vertex2);
|
|
7074
|
+
if (((_a = vertexMap.get(oppositeVertex)) == null ? void 0 : _a.length) !== 2) {
|
|
7075
|
+
logger$1.error("Edge sequence is not continuous");
|
|
7076
|
+
return;
|
|
7077
|
+
}
|
|
7078
|
+
orderedVertices.push(vertex2, oppositeVertex);
|
|
7079
|
+
currentVertex = oppositeVertex;
|
|
7080
|
+
break;
|
|
7081
|
+
}
|
|
7082
|
+
}
|
|
7083
|
+
if (!firstEdge || !currentVertex) {
|
|
7084
|
+
logger$1.error("Unable to find start of edge sequence");
|
|
7085
|
+
return;
|
|
7086
|
+
}
|
|
7087
|
+
const orderedEdges = [firstEdge];
|
|
7088
|
+
let currentEdge = firstEdge;
|
|
7089
|
+
while (orderedEdges.length < edges.length) {
|
|
7090
|
+
const nextEdge = currentVertex && ((_b = vertexMap.get(currentVertex)) == null ? void 0 : _b.find((e2) => e2 !== currentEdge));
|
|
7091
|
+
if (!nextEdge) {
|
|
7092
|
+
logger$1.error("Edge sequence is not continuous");
|
|
7093
|
+
return;
|
|
7094
|
+
} else if (orderedEdges.includes(nextEdge)) {
|
|
7095
|
+
logger$1.error("Duplicate Edge in sequence", nextEdge.id, currentEdge.id);
|
|
7096
|
+
return;
|
|
7097
|
+
}
|
|
7098
|
+
const nextVertex = nextEdge.vertices.find((v2) => v2 !== currentVertex);
|
|
7099
|
+
orderedVertices.push(nextVertex);
|
|
7100
|
+
orderedEdges.push(nextEdge);
|
|
7101
|
+
currentVertex = nextVertex;
|
|
7102
|
+
currentEdge = nextEdge;
|
|
7103
|
+
}
|
|
7104
|
+
this.edges = orderedEdges;
|
|
7105
|
+
this.vertices = orderedVertices;
|
|
7106
|
+
this.edgesChanged = false;
|
|
7107
|
+
}
|
|
7108
|
+
verifyEdges() {
|
|
7109
|
+
if (this.edgesChanged && this.edges.length) {
|
|
7110
|
+
this.setEdges(this.edges);
|
|
7111
|
+
}
|
|
7027
7112
|
}
|
|
7028
7113
|
// Accessors
|
|
7114
|
+
getEdges() {
|
|
7115
|
+
return [...this.edges];
|
|
7116
|
+
}
|
|
7029
7117
|
getVertices() {
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
return [vertex1, vertex2];
|
|
7118
|
+
this.verifyEdges();
|
|
7119
|
+
return [...this.vertices];
|
|
7033
7120
|
}
|
|
7034
|
-
|
|
7035
|
-
|
|
7121
|
+
getStartVertex() {
|
|
7122
|
+
this.verifyEdges();
|
|
7123
|
+
return this.vertices[0];
|
|
7124
|
+
}
|
|
7125
|
+
getEndVertex() {
|
|
7126
|
+
this.verifyEdges();
|
|
7127
|
+
return this.vertices[this.vertices.length - 1];
|
|
7128
|
+
}
|
|
7129
|
+
getAxisPoints() {
|
|
7130
|
+
const startVertex = this.getStartVertex();
|
|
7131
|
+
const endVertex = this.getEndVertex();
|
|
7132
|
+
return [startVertex.position, endVertex.position];
|
|
7133
|
+
}
|
|
7134
|
+
getAxisLength() {
|
|
7135
|
+
const [start, end] = this.getAxisPoints();
|
|
7136
|
+
if (!start || !end) {
|
|
7137
|
+
return 0;
|
|
7138
|
+
}
|
|
7139
|
+
return vec2Length(vec2Sub(start, end));
|
|
7140
|
+
}
|
|
7141
|
+
getEdgeAtLinearPosition(u2) {
|
|
7142
|
+
if (u2 < 0 || u2 > 1) return;
|
|
7143
|
+
if (this.edges.length === 1) {
|
|
7144
|
+
return this.edges[0];
|
|
7145
|
+
}
|
|
7146
|
+
let axisLength = this.getAxisLength();
|
|
7147
|
+
if (!axisLength) {
|
|
7148
|
+
return;
|
|
7149
|
+
}
|
|
7150
|
+
let start = this.vertices[0].position;
|
|
7151
|
+
for (let i2 = 0; i2 < this.vertices.length - 1; i2++) {
|
|
7152
|
+
let position = this.vertices[i2 + 1].position;
|
|
7153
|
+
let linearPosition = vec2Distance(start, position) / axisLength;
|
|
7154
|
+
if (linearPosition >= u2) {
|
|
7155
|
+
return this.edges[i2];
|
|
7156
|
+
}
|
|
7157
|
+
}
|
|
7158
|
+
return;
|
|
7159
|
+
}
|
|
7160
|
+
getEdgesAtLinearSegment(u2, v2) {
|
|
7161
|
+
if (u2 > v2) return [];
|
|
7162
|
+
if (this.edges.length === 1) {
|
|
7163
|
+
return [this.edges[0]];
|
|
7164
|
+
}
|
|
7165
|
+
let axisLength = this.getAxisLength();
|
|
7166
|
+
if (!axisLength) {
|
|
7167
|
+
return [];
|
|
7168
|
+
}
|
|
7169
|
+
let edges = [];
|
|
7170
|
+
let start = this.vertices[0].position;
|
|
7171
|
+
let lastPosition = start;
|
|
7172
|
+
for (let i2 = 0; i2 < this.vertices.length - 1; i2++) {
|
|
7173
|
+
let nextPosition = this.vertices[i2 + 1].position;
|
|
7174
|
+
let lastLinearPosition = vec2Distance(start, lastPosition) / axisLength;
|
|
7175
|
+
let nextLinearPosition = vec2Distance(start, nextPosition) / axisLength;
|
|
7176
|
+
if (u2 <= lastLinearPosition && v2 >= nextLinearPosition) {
|
|
7177
|
+
edges.push(this.edges[i2]);
|
|
7178
|
+
} else if (u2 >= lastLinearPosition && u2 < nextLinearPosition) {
|
|
7179
|
+
edges.push(this.edges[i2]);
|
|
7180
|
+
} else if (v2 > lastLinearPosition && v2 <= nextLinearPosition) {
|
|
7181
|
+
edges.push(this.edges[i2]);
|
|
7182
|
+
}
|
|
7183
|
+
lastPosition = nextPosition;
|
|
7184
|
+
}
|
|
7185
|
+
return edges;
|
|
7186
|
+
}
|
|
7187
|
+
/**
|
|
7188
|
+
* @deprecated Use getEdges() instead of edge
|
|
7189
|
+
*/
|
|
7190
|
+
get edge() {
|
|
7191
|
+
logger$1.warn("Use getEdges() instead of edge");
|
|
7192
|
+
return this.edges[0] || null;
|
|
7036
7193
|
}
|
|
7037
7194
|
getAdjacentElementsByVertex() {
|
|
7038
7195
|
let adjacentElements = [[], []];
|
|
7039
|
-
for (let i2 = 0; i2 <
|
|
7040
|
-
let vertex2 = this.
|
|
7196
|
+
for (let i2 = 0; i2 < this.vertices.length; i2++) {
|
|
7197
|
+
let vertex2 = this.vertices[i2];
|
|
7041
7198
|
let vertexAdjacentElements = vertex2.edges.filter((edge) => edge.element && edge.element.id !== this.id).map((edge) => edge.element);
|
|
7042
7199
|
adjacentElements[i2] = vertexAdjacentElements;
|
|
7043
7200
|
}
|
|
@@ -7046,19 +7203,20 @@ class LayoutEdgeElementBase extends LayoutElementBase {
|
|
|
7046
7203
|
getAdjacentSpacesBySide() {
|
|
7047
7204
|
let adjacentSpaces = [[], []];
|
|
7048
7205
|
for (let i2 = 0; i2 < 2; i2++) {
|
|
7049
|
-
let sideAdjacentSpaces =
|
|
7206
|
+
let sideAdjacentSpaces = this.edges.filter((edge) => edge.spaces[i2]).map((edge) => edge.spaces[i2]);
|
|
7050
7207
|
adjacentSpaces[i2] = sideAdjacentSpaces;
|
|
7051
7208
|
}
|
|
7052
7209
|
return adjacentSpaces;
|
|
7053
7210
|
}
|
|
7054
7211
|
getSpaces() {
|
|
7055
7212
|
let spaces = [];
|
|
7056
|
-
let edge
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
|
|
7213
|
+
for (let edge of this.edges) {
|
|
7214
|
+
if (edge.spaces[0]) {
|
|
7215
|
+
spaces.push(edge.spaces[0]);
|
|
7216
|
+
}
|
|
7217
|
+
if (edge.spaces[1]) {
|
|
7218
|
+
spaces.push(edge.spaces[1]);
|
|
7219
|
+
}
|
|
7062
7220
|
}
|
|
7063
7221
|
return spaces;
|
|
7064
7222
|
}
|
|
@@ -7076,9 +7234,7 @@ function reverseOpeningElements(opening) {
|
|
|
7076
7234
|
}
|
|
7077
7235
|
}
|
|
7078
7236
|
function reverseEdgeElement(element) {
|
|
7079
|
-
let
|
|
7080
|
-
let [position1, position2] = edge.getPoints();
|
|
7081
|
-
let edgeLength = vec2Length(vec2Sub(position2, position1));
|
|
7237
|
+
let edgeLength = element.getAxisLength();
|
|
7082
7238
|
for (let childElement of element.elements) {
|
|
7083
7239
|
if (childElement.type !== "element:opening") {
|
|
7084
7240
|
continue;
|
|
@@ -7126,6 +7282,9 @@ class SpatialGraphEdge extends SpatialGraphNodeBase {
|
|
|
7126
7282
|
vertex2Updated = false;
|
|
7127
7283
|
}
|
|
7128
7284
|
this.layout.spatialGraph.graphChanged = true;
|
|
7285
|
+
if (this.element) {
|
|
7286
|
+
this.element.edgesChanged = true;
|
|
7287
|
+
}
|
|
7129
7288
|
if (vertex1Updated || vertex2Updated) {
|
|
7130
7289
|
this.emit("edge-set-vertices", this, { previousVertices: [previousVertex1, previousVertex2] });
|
|
7131
7290
|
}
|
|
@@ -7188,9 +7347,13 @@ class SpatialGraphEdge extends SpatialGraphNodeBase {
|
|
|
7188
7347
|
splitEdge.boundaryWalls[0] = this.boundaryWalls[0];
|
|
7189
7348
|
splitEdge.boundaryWalls[1] = this.boundaryWalls[1];
|
|
7190
7349
|
let splitElement;
|
|
7191
|
-
if (this.element) {
|
|
7350
|
+
if (this.element && options.elementId) {
|
|
7351
|
+
let currentWallEdges = this.element.getEdges();
|
|
7352
|
+
let newEdgeIndex = currentWallEdges.indexOf(this) + 1;
|
|
7353
|
+
let newEdges = [splitEdge, ...currentWallEdges.splice(newEdgeIndex)];
|
|
7354
|
+
this.element.setEdges(currentWallEdges);
|
|
7192
7355
|
let splitElementId = options.elementId ?? this.layout.getElementId(this.element);
|
|
7193
|
-
let splitElement2 = this.layout.createElement(this.element.type, splitElementId,
|
|
7356
|
+
let splitElement2 = this.layout.createElement(this.element.type, splitElementId, newEdges);
|
|
7194
7357
|
splitElement2.parameters = JSON.parse(JSON.stringify(this.element.parameters));
|
|
7195
7358
|
let edgeLength = vec2Length(vec2Sub(position2, position1));
|
|
7196
7359
|
let splitEdgeLength = vec2Length(vec2Sub(position2, position));
|
|
@@ -7211,6 +7374,10 @@ class SpatialGraphEdge extends SpatialGraphNodeBase {
|
|
|
7211
7374
|
}
|
|
7212
7375
|
}
|
|
7213
7376
|
}
|
|
7377
|
+
} else if (this.element) {
|
|
7378
|
+
const currentEdges = this.element.getEdges();
|
|
7379
|
+
this.element.setEdges([...currentEdges, splitEdge]);
|
|
7380
|
+
splitEdge.element = this.element;
|
|
7214
7381
|
}
|
|
7215
7382
|
if (updateSpaceBoundaries) {
|
|
7216
7383
|
for (let space of splitEdge.spaces) {
|
|
@@ -7357,7 +7524,23 @@ class SpatialGraphEdge extends SpatialGraphNodeBase {
|
|
|
7357
7524
|
if (edge.element && reverseEdge) {
|
|
7358
7525
|
reverseEdgeElement(edge.element);
|
|
7359
7526
|
}
|
|
7360
|
-
|
|
7527
|
+
this.setVertices(vertices[0], vertices[2]);
|
|
7528
|
+
if (this.element && this.element === edge.element) {
|
|
7529
|
+
const edges = this.element.getEdges();
|
|
7530
|
+
const edgeIndex = edges.indexOf(edge);
|
|
7531
|
+
edges.splice(edgeIndex, 1);
|
|
7532
|
+
this.element.setEdges(edges);
|
|
7533
|
+
edge.element = null;
|
|
7534
|
+
} else if (this.element && edge.element) {
|
|
7535
|
+
const edges = edge.element.getEdges();
|
|
7536
|
+
const edgeIndex = edges.indexOf(edge);
|
|
7537
|
+
edges.splice(edgeIndex, 1);
|
|
7538
|
+
let newEdges = [...this.element.getEdges(), ...edges];
|
|
7539
|
+
this.element.setEdges(newEdges);
|
|
7540
|
+
edge.element.setEdges([edge]);
|
|
7541
|
+
for (const edge2 of newEdges) {
|
|
7542
|
+
edge2.element = this.element;
|
|
7543
|
+
}
|
|
7361
7544
|
let edgeLength = vec2Length(vec2Sub(p2, p1));
|
|
7362
7545
|
let childElements = [...edge.element.elements];
|
|
7363
7546
|
for (let childElement of childElements) {
|
|
@@ -7370,7 +7553,6 @@ class SpatialGraphEdge extends SpatialGraphNodeBase {
|
|
|
7370
7553
|
parameters.position[0] += edgeLength;
|
|
7371
7554
|
}
|
|
7372
7555
|
}
|
|
7373
|
-
this.setVertices(vertices[0], vertices[2]);
|
|
7374
7556
|
if (updateSpaceBoundaries) {
|
|
7375
7557
|
for (let space of edge.spaces) {
|
|
7376
7558
|
if (!space) {
|
|
@@ -7423,6 +7605,17 @@ const defaultSpaceAttributes = {
|
|
|
7423
7605
|
usage: "generic",
|
|
7424
7606
|
program: "none"
|
|
7425
7607
|
};
|
|
7608
|
+
function openingAdjacentToSpace(space, opening) {
|
|
7609
|
+
const edgeElement = opening.parent;
|
|
7610
|
+
const elementLength = edgeElement.getAxisLength();
|
|
7611
|
+
const { position, dimensions } = opening.parameters;
|
|
7612
|
+
const openingStartPosition = position[0] / elementLength;
|
|
7613
|
+
const openingEndPosition = (position[0] + dimensions[0]) / elementLength;
|
|
7614
|
+
const edges = edgeElement.getEdgesAtLinearSegment(openingStartPosition, openingEndPosition);
|
|
7615
|
+
return edges.some((edge) => {
|
|
7616
|
+
return edge.spaces[0] === space || edge.spaces[1] === space;
|
|
7617
|
+
});
|
|
7618
|
+
}
|
|
7426
7619
|
class LayoutSpace extends LayoutNodeBase {
|
|
7427
7620
|
constructor(id, boundaries) {
|
|
7428
7621
|
super(id, LayoutSpaceTypeValue);
|
|
@@ -7506,11 +7699,6 @@ class LayoutSpace extends LayoutNodeBase {
|
|
|
7506
7699
|
}
|
|
7507
7700
|
}
|
|
7508
7701
|
getElements(types) {
|
|
7509
|
-
let openingAdjacentToSpace = (opening) => {
|
|
7510
|
-
let edgeElement = opening.parent;
|
|
7511
|
-
let edge = edgeElement.edge;
|
|
7512
|
-
return edge.spaces[0] === this || edge.spaces[1] === this;
|
|
7513
|
-
};
|
|
7514
7702
|
let elementTypes = types && (Array.isArray(types) ? types : [types]);
|
|
7515
7703
|
let elements = [];
|
|
7516
7704
|
let elementList = this.layout.getElementList();
|
|
@@ -7529,16 +7717,15 @@ class LayoutSpace extends LayoutNodeBase {
|
|
|
7529
7717
|
case "element:curtainWall":
|
|
7530
7718
|
case "element:spaceDivider":
|
|
7531
7719
|
case "element:wall":
|
|
7532
|
-
|
|
7533
|
-
adjacencyOrContainment = edge.spaces[0] === this || edge.spaces[1] === this;
|
|
7720
|
+
adjacencyOrContainment = element.getEdges().some((edge) => edge.spaces[0] === this || edge.spaces[1] === this);
|
|
7534
7721
|
break;
|
|
7535
7722
|
case "element:opening":
|
|
7536
|
-
adjacencyOrContainment = openingAdjacentToSpace(element);
|
|
7723
|
+
adjacencyOrContainment = openingAdjacentToSpace(this, element);
|
|
7537
7724
|
break;
|
|
7538
7725
|
case "element:door":
|
|
7539
7726
|
case "element:window":
|
|
7540
7727
|
let opening = element.parent;
|
|
7541
|
-
adjacencyOrContainment = openingAdjacentToSpace(opening);
|
|
7728
|
+
adjacencyOrContainment = openingAdjacentToSpace(this, opening);
|
|
7542
7729
|
break;
|
|
7543
7730
|
default:
|
|
7544
7731
|
let transformElement = element;
|
|
@@ -7658,9 +7845,11 @@ const defaultWallParameters = {
|
|
|
7658
7845
|
materials: { ...defaultWallMaterials }
|
|
7659
7846
|
};
|
|
7660
7847
|
class LayoutWall extends LayoutEdgeElementBase {
|
|
7661
|
-
constructor(id,
|
|
7662
|
-
super(id, LayoutWallTypeValue,
|
|
7663
|
-
edge
|
|
7848
|
+
constructor(id, edges) {
|
|
7849
|
+
super(id, LayoutWallTypeValue, edges);
|
|
7850
|
+
for (const edge of edges) {
|
|
7851
|
+
edge.element = this;
|
|
7852
|
+
}
|
|
7664
7853
|
this.parameters = JSON.parse(JSON.stringify(defaultWallParameters));
|
|
7665
7854
|
this.geometryProfile = {
|
|
7666
7855
|
valid: true,
|
|
@@ -7683,7 +7872,7 @@ class LayoutWall extends LayoutEdgeElementBase {
|
|
|
7683
7872
|
getBoundingBox() {
|
|
7684
7873
|
const min = [0, 0, 0];
|
|
7685
7874
|
const max2 = [0, 0, 0];
|
|
7686
|
-
const [start, end] = this.
|
|
7875
|
+
const [start, end] = this.getAxisPoints();
|
|
7687
7876
|
const radAngle = getAngleFromPoints(start, end);
|
|
7688
7877
|
const degAngle = radAngle / Math.PI * 180;
|
|
7689
7878
|
const transform = { position: start, rotation: -degAngle };
|
|
@@ -7942,10 +8131,12 @@ function assignBoundaryWallToEdges(boundaryWall) {
|
|
|
7942
8131
|
}
|
|
7943
8132
|
}
|
|
7944
8133
|
function assignEdgeElementToEdge(edgeElement) {
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
8134
|
+
for (const edge of edgeElement.getEdges()) {
|
|
8135
|
+
if (edge.element === null) {
|
|
8136
|
+
edge.element = edgeElement;
|
|
8137
|
+
} else if (edge.element !== edgeElement) {
|
|
8138
|
+
logger$1.error(`Edge ${edge.id} referenced by more than one edge element.`);
|
|
8139
|
+
}
|
|
7949
8140
|
}
|
|
7950
8141
|
}
|
|
7951
8142
|
function assignNodesToEdges(layout) {
|
|
@@ -8044,11 +8235,22 @@ function doInsertBoundaryElement(layout, boundaryElement) {
|
|
|
8044
8235
|
}
|
|
8045
8236
|
function doInsertEdgeElement(layout, edgeElement) {
|
|
8046
8237
|
let spatialGraph = layout.spatialGraph;
|
|
8047
|
-
|
|
8048
|
-
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
|
|
8238
|
+
const edges = edgeElement.getEdges();
|
|
8239
|
+
const edgeSet = new Set(edges);
|
|
8240
|
+
let newEdges = false;
|
|
8241
|
+
for (let i2 = 0; i2 < edges.length; i2++) {
|
|
8242
|
+
let edge = edges[i2];
|
|
8243
|
+
let existingEdge = spatialGraph.edgesById[edge.id];
|
|
8244
|
+
if (!existingEdge) {
|
|
8245
|
+
spatialGraph.insertEdge(edge);
|
|
8246
|
+
} else {
|
|
8247
|
+
newEdges = true;
|
|
8248
|
+
edgeSet.delete(edge);
|
|
8249
|
+
edgeSet.add(existingEdge);
|
|
8250
|
+
}
|
|
8251
|
+
}
|
|
8252
|
+
if (newEdges) {
|
|
8253
|
+
edgeElement.setEdges(Array.from(edgeSet));
|
|
8052
8254
|
}
|
|
8053
8255
|
assignEdgeElementToEdge(edgeElement);
|
|
8054
8256
|
}
|
|
@@ -8067,7 +8269,9 @@ function doInsertElement(layout, element) {
|
|
|
8067
8269
|
}
|
|
8068
8270
|
}
|
|
8069
8271
|
function doRemoveEdgeElement(edgeElement) {
|
|
8070
|
-
edgeElement.
|
|
8272
|
+
for (const edge of edgeElement.getEdges()) {
|
|
8273
|
+
edge.element = null;
|
|
8274
|
+
}
|
|
8071
8275
|
}
|
|
8072
8276
|
function doRemoveBoundaryElement(boundaryElement) {
|
|
8073
8277
|
switch (boundaryElement.type) {
|
|
@@ -8724,9 +8928,11 @@ const defaultCurtainWallParameters = {
|
|
|
8724
8928
|
materials: { ...defaultCurtainWallMaterials }
|
|
8725
8929
|
};
|
|
8726
8930
|
class LayoutCurtainWall extends LayoutEdgeElementBase {
|
|
8727
|
-
constructor(id,
|
|
8728
|
-
super(id, LayoutCurtainWallTypeValue,
|
|
8729
|
-
edge
|
|
8931
|
+
constructor(id, edges) {
|
|
8932
|
+
super(id, LayoutCurtainWallTypeValue, edges);
|
|
8933
|
+
for (const edge of edges) {
|
|
8934
|
+
edge.element = this;
|
|
8935
|
+
}
|
|
8730
8936
|
this.parameters = JSON.parse(JSON.stringify(defaultCurtainWallParameters));
|
|
8731
8937
|
}
|
|
8732
8938
|
setParameters(parameters) {
|
|
@@ -8739,16 +8945,18 @@ const defaultSpaceDividerParameters = {
|
|
|
8739
8945
|
materials: { ...defaultSpaceDividerMaterials }
|
|
8740
8946
|
};
|
|
8741
8947
|
class LayoutSpaceDivider extends LayoutEdgeElementBase {
|
|
8742
|
-
constructor(id,
|
|
8743
|
-
super(id, LayoutSpaceDividerTypeValue,
|
|
8744
|
-
edge
|
|
8948
|
+
constructor(id, edges) {
|
|
8949
|
+
super(id, LayoutSpaceDividerTypeValue, edges);
|
|
8950
|
+
for (const edge of edges) {
|
|
8951
|
+
edge.element = this;
|
|
8952
|
+
}
|
|
8745
8953
|
this.parameters = JSON.parse(JSON.stringify(defaultSpaceDividerParameters));
|
|
8746
8954
|
}
|
|
8747
8955
|
setParameters(parameters) {
|
|
8748
8956
|
super.setParameters(parameters);
|
|
8749
8957
|
}
|
|
8750
8958
|
getBoundingBox() {
|
|
8751
|
-
const [start, end] = this.
|
|
8959
|
+
const [start, end] = this.getAxisPoints();
|
|
8752
8960
|
const length2 = vec2Distance(start, end);
|
|
8753
8961
|
const radAngle = getAngleFromPoints(start, end);
|
|
8754
8962
|
const degAngle = radAngle / Math.PI * 180;
|
|
@@ -8770,10 +8978,7 @@ class LayoutOpeningElementBase extends LayoutElementBase {
|
|
|
8770
8978
|
function getOpeningTransform(wall, opening) {
|
|
8771
8979
|
let wallWidth = wall.parameters.width;
|
|
8772
8980
|
let wallOffset = wall.parameters.offset;
|
|
8773
|
-
let
|
|
8774
|
-
let vertex2 = wall.edge.vertices[1];
|
|
8775
|
-
let p1 = vertex1.position;
|
|
8776
|
-
let p2 = vertex2.position;
|
|
8981
|
+
let [p1, p2] = wall.getAxisPoints();
|
|
8777
8982
|
let v2 = vec2Sub(p2, p1);
|
|
8778
8983
|
let l2 = vec2Length(v2);
|
|
8779
8984
|
let u2 = opening.parameters.position[0] / l2;
|
|
@@ -9063,11 +9268,7 @@ function getDoorLeafGeometries(element) {
|
|
|
9063
9268
|
break;
|
|
9064
9269
|
case "garageDoor":
|
|
9065
9270
|
leafConfigurations.push({
|
|
9066
|
-
position: [
|
|
9067
|
-
frameThickness - doorCenter[0],
|
|
9068
|
-
leafHeight * (1 - openRatio),
|
|
9069
|
-
-doorCenter[1] + doorLeafOffset
|
|
9070
|
-
],
|
|
9271
|
+
position: [frameThickness - doorCenter[0], leafHeight * (1 - openRatio), -doorCenter[1] + doorLeafOffset],
|
|
9071
9272
|
rotation: 0,
|
|
9072
9273
|
dimensions: [leafLength, leafHeight * openRatio, doorLeafThickness]
|
|
9073
9274
|
});
|
|
@@ -9108,13 +9309,7 @@ function getDoorLeafGeometries(element) {
|
|
|
9108
9309
|
return geometries;
|
|
9109
9310
|
}
|
|
9110
9311
|
function createDoorGeometry(element) {
|
|
9111
|
-
let {
|
|
9112
|
-
height: openingHeight,
|
|
9113
|
-
length: openingLength,
|
|
9114
|
-
frameThickness,
|
|
9115
|
-
frameDepth,
|
|
9116
|
-
materials
|
|
9117
|
-
} = element.parameters;
|
|
9312
|
+
let { height: openingHeight, length: openingLength, frameThickness, frameDepth, materials } = element.parameters;
|
|
9118
9313
|
let geometryId = getGeometryId(element);
|
|
9119
9314
|
let geometryFrameTop = {
|
|
9120
9315
|
id: geometryId + "-frame-top",
|
|
@@ -9173,14 +9368,7 @@ function createGenericGeometry(element) {
|
|
|
9173
9368
|
element.emit("geometry-update", element);
|
|
9174
9369
|
}
|
|
9175
9370
|
function createRailingGeometry(element) {
|
|
9176
|
-
let {
|
|
9177
|
-
height,
|
|
9178
|
-
length: length2,
|
|
9179
|
-
width,
|
|
9180
|
-
segmentCount,
|
|
9181
|
-
segmentLength,
|
|
9182
|
-
materials
|
|
9183
|
-
} = element.parameters;
|
|
9371
|
+
let { height, length: length2, width, segmentCount, segmentLength, materials } = element.parameters;
|
|
9184
9372
|
let pailing = 0.01;
|
|
9185
9373
|
let stepCount;
|
|
9186
9374
|
if (segmentLength && segmentLength > 0) {
|
|
@@ -9258,12 +9446,7 @@ function createSlabGeometry(element) {
|
|
|
9258
9446
|
element.emit("geometry-update", element);
|
|
9259
9447
|
}
|
|
9260
9448
|
function getStraightStepGeometry(id, materials, stepConfiguration) {
|
|
9261
|
-
let {
|
|
9262
|
-
riser,
|
|
9263
|
-
tread,
|
|
9264
|
-
width,
|
|
9265
|
-
thickness
|
|
9266
|
-
} = stepConfiguration;
|
|
9449
|
+
let { riser, tread, width, thickness } = stepConfiguration;
|
|
9267
9450
|
return {
|
|
9268
9451
|
id,
|
|
9269
9452
|
type: "geometry:extrusion",
|
|
@@ -9291,13 +9474,7 @@ function getStraightStepGeometry(id, materials, stepConfiguration) {
|
|
|
9291
9474
|
};
|
|
9292
9475
|
}
|
|
9293
9476
|
function getStraightStairFlightGeometry(element, materials, stairsConfiguration) {
|
|
9294
|
-
let {
|
|
9295
|
-
stepCount,
|
|
9296
|
-
width,
|
|
9297
|
-
stepHeight,
|
|
9298
|
-
length: length2,
|
|
9299
|
-
stepThickness
|
|
9300
|
-
} = stairsConfiguration;
|
|
9477
|
+
let { stepCount, width, stepHeight, length: length2, stepThickness } = stairsConfiguration;
|
|
9301
9478
|
let geometryId = getGeometryId(element);
|
|
9302
9479
|
let stepLength = length2 / stepCount;
|
|
9303
9480
|
let start = [0, 0, 0];
|
|
@@ -9319,15 +9496,7 @@ function getStraightStairFlightGeometry(element, materials, stairsConfiguration)
|
|
|
9319
9496
|
};
|
|
9320
9497
|
}
|
|
9321
9498
|
function getSpiralStepGeometry(id, materials, stairsConfiguration) {
|
|
9322
|
-
let {
|
|
9323
|
-
stepThickness,
|
|
9324
|
-
stepHeight,
|
|
9325
|
-
angle,
|
|
9326
|
-
width,
|
|
9327
|
-
stepCount,
|
|
9328
|
-
radius,
|
|
9329
|
-
circulation
|
|
9330
|
-
} = stairsConfiguration;
|
|
9499
|
+
let { stepThickness, stepHeight, angle, width, stepCount, radius, circulation } = stairsConfiguration;
|
|
9331
9500
|
let centerRadius = radius - width / 2;
|
|
9332
9501
|
let length2 = Math.PI * angle / 180 * centerRadius;
|
|
9333
9502
|
let tread = length2 / stepCount;
|
|
@@ -9515,8 +9684,9 @@ function createStairFlightGeometry(element) {
|
|
|
9515
9684
|
}
|
|
9516
9685
|
function getGenerateWallJoins(wall) {
|
|
9517
9686
|
let joins = [false, false];
|
|
9518
|
-
|
|
9519
|
-
|
|
9687
|
+
let vertices = [wall.getStartVertex(), wall.getEndVertex()];
|
|
9688
|
+
for (let i2 = 0; i2 < vertices.length; i2++) {
|
|
9689
|
+
let vertex2 = vertices[i2];
|
|
9520
9690
|
let walls = vertex2.edges.filter((edge) => {
|
|
9521
9691
|
var _a;
|
|
9522
9692
|
return ((_a = edge.element) == null ? void 0 : _a.type) === "element:wall";
|
|
@@ -9534,8 +9704,8 @@ function getGenerateWallJoins(wall) {
|
|
|
9534
9704
|
joins[i2] = true;
|
|
9535
9705
|
break;
|
|
9536
9706
|
}
|
|
9537
|
-
let wallDirection =
|
|
9538
|
-
let connectedWallDirection = connectedWall.
|
|
9707
|
+
let wallDirection = vertices[1] === vertex2 ? 1 : -1;
|
|
9708
|
+
let connectedWallDirection = connectedWall.getStartVertex() === vertex2 ? 1 : -1;
|
|
9539
9709
|
let offsetRatio = wall.parameters.offset / wall.parameters.width;
|
|
9540
9710
|
let connectedOffsetRatio = connectedWall.parameters.offset / connectedWall.parameters.width;
|
|
9541
9711
|
let offsetDirectionMatch = wallDirection * offsetRatio === connectedWallDirection * connectedOffsetRatio;
|
|
@@ -9804,6 +9974,15 @@ class LayoutOpening extends LayoutOpeningElementBase {
|
|
|
9804
9974
|
}
|
|
9805
9975
|
}
|
|
9806
9976
|
}
|
|
9977
|
+
getBoundingBox(localTransform = false) {
|
|
9978
|
+
const { dimensions } = this.parameters;
|
|
9979
|
+
const parentWall = this.parent;
|
|
9980
|
+
const width = (parentWall == null ? void 0 : parentWall.parameters.width) || 0;
|
|
9981
|
+
const min = [0, 0, 0];
|
|
9982
|
+
const max2 = [dimensions[0], dimensions[1], width];
|
|
9983
|
+
const transform = localTransform ? this.getTransform() : this.getWorldTransform();
|
|
9984
|
+
return { min, max: max2, transform };
|
|
9985
|
+
}
|
|
9807
9986
|
getSpaces() {
|
|
9808
9987
|
if (!this.parent) {
|
|
9809
9988
|
logger$1.error(`Element ${this.id} does not have a parent.`);
|
|
@@ -10007,7 +10186,12 @@ const defaultColumnRectangleProfile = {
|
|
|
10007
10186
|
};
|
|
10008
10187
|
const defaultColumnPolygonProfile = {
|
|
10009
10188
|
type: "curve:polygon",
|
|
10010
|
-
points: [
|
|
10189
|
+
points: [
|
|
10190
|
+
[0, 0],
|
|
10191
|
+
[0.1, 0],
|
|
10192
|
+
[0.1, 0.1],
|
|
10193
|
+
[0, 0.1]
|
|
10194
|
+
]
|
|
10011
10195
|
};
|
|
10012
10196
|
const defaultColumnProfileByType = {
|
|
10013
10197
|
"curve:circle": { ...defaultColumnCircleProfile },
|
|
@@ -10087,7 +10271,12 @@ const defaultGenericRectangleProfile = {
|
|
|
10087
10271
|
};
|
|
10088
10272
|
const defaultGenericPolygonProfile = {
|
|
10089
10273
|
type: "curve:polygon",
|
|
10090
|
-
points: [
|
|
10274
|
+
points: [
|
|
10275
|
+
[0, 0],
|
|
10276
|
+
[1, 0],
|
|
10277
|
+
[1, 1],
|
|
10278
|
+
[0, 1]
|
|
10279
|
+
]
|
|
10091
10280
|
};
|
|
10092
10281
|
const defaultGenericProfileByType = {
|
|
10093
10282
|
"curve:circle": { ...defaultGenericCircleProfile },
|
|
@@ -10195,16 +10384,7 @@ function getSinkProduct(spaceGraph) {
|
|
|
10195
10384
|
return sink;
|
|
10196
10385
|
}
|
|
10197
10386
|
function createOrUpdateKitchenElements(element) {
|
|
10198
|
-
let {
|
|
10199
|
-
length: length2,
|
|
10200
|
-
width,
|
|
10201
|
-
height,
|
|
10202
|
-
wallCabinet,
|
|
10203
|
-
leftHighCabinetCount,
|
|
10204
|
-
rightHighCabinetCount,
|
|
10205
|
-
sinkElementSlot,
|
|
10206
|
-
materials
|
|
10207
|
-
} = element.parameters;
|
|
10387
|
+
let { length: length2, width, height, wallCabinet, leftHighCabinetCount, rightHighCabinetCount, sinkElementSlot, materials } = element.parameters;
|
|
10208
10388
|
let elementLength = Math.min(0.6, length2);
|
|
10209
10389
|
let wallCabinetBottom = 1.5;
|
|
10210
10390
|
let wallCabinetWidth = 0.45;
|
|
@@ -10397,7 +10577,12 @@ const defaultSlabRectangleProfile = {
|
|
|
10397
10577
|
};
|
|
10398
10578
|
const defaultSlabPolygonProfile = {
|
|
10399
10579
|
type: "curve:polygon",
|
|
10400
|
-
points: [
|
|
10580
|
+
points: [
|
|
10581
|
+
[0, 0],
|
|
10582
|
+
[1, 0],
|
|
10583
|
+
[1, 1],
|
|
10584
|
+
[0, 1]
|
|
10585
|
+
]
|
|
10401
10586
|
};
|
|
10402
10587
|
const defaultSlabProfileByType = {
|
|
10403
10588
|
"curve:circle": { ...defaultSlabCircleProfile },
|
|
@@ -10512,17 +10697,15 @@ function createOrUpdateStairsElements(element) {
|
|
|
10512
10697
|
}
|
|
10513
10698
|
});
|
|
10514
10699
|
stairFlightA.setTransform([0, 0, 0], 0);
|
|
10515
|
-
slab1.setParameters(
|
|
10516
|
-
{
|
|
10517
|
-
|
|
10518
|
-
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
|
|
10522
|
-
sides: materials.steps
|
|
10523
|
-
}
|
|
10700
|
+
slab1.setParameters({
|
|
10701
|
+
profile: { type: "curve:rectangle", dimensions: [width, width] },
|
|
10702
|
+
height: slabHeight,
|
|
10703
|
+
materials: {
|
|
10704
|
+
top: materials.tread,
|
|
10705
|
+
bottom: materials.steps,
|
|
10706
|
+
sides: materials.steps
|
|
10524
10707
|
}
|
|
10525
|
-
);
|
|
10708
|
+
});
|
|
10526
10709
|
slab1.setTransform([flightLength, height / 2 - slabHeight, 0], 0);
|
|
10527
10710
|
stairFlightB.setParameters({ stairFlightType: "straight", length: flightLength, width, height: height / 2 });
|
|
10528
10711
|
stairFlightB.setTransform([length2 - flightLength, height / 2, 0], 0);
|
|
@@ -10845,12 +11028,7 @@ class Layout2dView extends LayoutViewBase {
|
|
|
10845
11028
|
onNewKeys: {
|
|
10846
11029
|
allow: false
|
|
10847
11030
|
},
|
|
10848
|
-
copyScopes: [
|
|
10849
|
-
".style.byId",
|
|
10850
|
-
".style.byType",
|
|
10851
|
-
".style.byAttribute.program",
|
|
10852
|
-
".style.byAttribute.usage"
|
|
10853
|
-
],
|
|
11031
|
+
copyScopes: [".style.byId", ".style.byType", ".style.byAttribute.program", ".style.byAttribute.usage"],
|
|
10854
11032
|
cloneObjects: true
|
|
10855
11033
|
});
|
|
10856
11034
|
this.emit("view-parameters-change", this);
|
|
@@ -11260,6 +11438,48 @@ class Graph {
|
|
|
11260
11438
|
return null;
|
|
11261
11439
|
}
|
|
11262
11440
|
}
|
|
11441
|
+
const createByType = (map2) => {
|
|
11442
|
+
const byType = {};
|
|
11443
|
+
for (const key in map2) {
|
|
11444
|
+
byType[key] = [];
|
|
11445
|
+
}
|
|
11446
|
+
return byType;
|
|
11447
|
+
};
|
|
11448
|
+
const layoutElementTypeValues = {
|
|
11449
|
+
// Boundary elements
|
|
11450
|
+
"element:ceiling": LayoutBoundarySlab,
|
|
11451
|
+
"element:floor": LayoutBoundarySlab,
|
|
11452
|
+
"element:boundaryWall": LayoutBoundaryWall,
|
|
11453
|
+
// Edge elements
|
|
11454
|
+
"element:curtainWall": LayoutCurtainWall,
|
|
11455
|
+
"element:spaceDivider": LayoutSpaceDivider,
|
|
11456
|
+
"element:wall": LayoutWall,
|
|
11457
|
+
// Opening elements
|
|
11458
|
+
"element:opening": LayoutOpening,
|
|
11459
|
+
// Transform elements
|
|
11460
|
+
"element:asset": LayoutAsset,
|
|
11461
|
+
"element:beam": LayoutBeam,
|
|
11462
|
+
"element:casework": LayoutCasework,
|
|
11463
|
+
"element:column": LayoutColumn,
|
|
11464
|
+
"element:door": LayoutDoor,
|
|
11465
|
+
"element:generic": LayoutGeneric,
|
|
11466
|
+
"element:kitchen": LayoutKitchen,
|
|
11467
|
+
"element:railing": LayoutRailing,
|
|
11468
|
+
"element:ramp": LayoutRamp,
|
|
11469
|
+
"element:roof": LayoutRoof,
|
|
11470
|
+
"element:slab": LayoutSlab,
|
|
11471
|
+
"element:stairs": LayoutStairs,
|
|
11472
|
+
"element:stairFlight": LayoutStairFlight,
|
|
11473
|
+
"element:window": LayoutWindow
|
|
11474
|
+
};
|
|
11475
|
+
const layoutAnnotationTypeValues = {
|
|
11476
|
+
"annotation:floorPlanDxf": LayoutFloorPlanDxfAnnotation,
|
|
11477
|
+
"annotation:floorPlanImage": LayoutFloorPlanImageAnnotation
|
|
11478
|
+
};
|
|
11479
|
+
const layoutViewTypeValues = {
|
|
11480
|
+
"view:2d": Layout2dView,
|
|
11481
|
+
"view:3d": Layout3dView
|
|
11482
|
+
};
|
|
11263
11483
|
const LayoutTypeValue = "spatialStructure:layout";
|
|
11264
11484
|
class SpaceGraphLayout extends SpaceGraphSpatialStructureBase {
|
|
11265
11485
|
constructor(id) {
|
|
@@ -11269,18 +11489,15 @@ class SpaceGraphLayout extends SpaceGraphSpatialStructureBase {
|
|
|
11269
11489
|
this.spacesById = {};
|
|
11270
11490
|
this.elements = [];
|
|
11271
11491
|
this.elementsById = {};
|
|
11272
|
-
this.elementsByType =
|
|
11492
|
+
this.elementsByType = createByType(layoutElementTypeValues);
|
|
11273
11493
|
this.annotations = [];
|
|
11274
11494
|
this.annotationsById = {};
|
|
11275
|
-
this.annotationsByType =
|
|
11495
|
+
this.annotationsByType = createByType(layoutAnnotationTypeValues);
|
|
11276
11496
|
this.views = [];
|
|
11277
11497
|
this.viewsById = {};
|
|
11278
|
-
this.viewsByType =
|
|
11498
|
+
this.viewsByType = createByType(layoutViewTypeValues);
|
|
11279
11499
|
this.debugIds = false;
|
|
11280
11500
|
this.suggestedIds = {};
|
|
11281
|
-
for (let elementType of layoutElementTypeValues) {
|
|
11282
|
-
this.elementsByType[elementType] = [];
|
|
11283
|
-
}
|
|
11284
11501
|
this.spatialGraph = new LayoutSpatialGraph(this);
|
|
11285
11502
|
}
|
|
11286
11503
|
copyForClone(layout) {
|
|
@@ -11529,6 +11746,32 @@ class SpaceGraphLayout extends SpaceGraphSpatialStructureBase {
|
|
|
11529
11746
|
}
|
|
11530
11747
|
return id;
|
|
11531
11748
|
}
|
|
11749
|
+
getBoundingBox() {
|
|
11750
|
+
const transform = getBaseTransform3d();
|
|
11751
|
+
if (this.spaces.length === 0) {
|
|
11752
|
+
return {
|
|
11753
|
+
min: [0, 0, 0],
|
|
11754
|
+
max: [0, 0, 0],
|
|
11755
|
+
transform
|
|
11756
|
+
};
|
|
11757
|
+
}
|
|
11758
|
+
const vertices = [];
|
|
11759
|
+
for (const space of this.spaces) {
|
|
11760
|
+
const { min: min2, max: max22 } = space.getBoundingBox();
|
|
11761
|
+
vertices.push(min2, max22);
|
|
11762
|
+
}
|
|
11763
|
+
for (const element of this.getElementList()) {
|
|
11764
|
+
const boundingBoxWithTransform = element.getBoundingBox();
|
|
11765
|
+
const { min: min2, max: max22 } = getAxisAlignedBoundingBox$1(boundingBoxWithTransform);
|
|
11766
|
+
vertices.push(min2, max22);
|
|
11767
|
+
}
|
|
11768
|
+
const { min, max: max2 } = getBoundingBox(vertices.flat());
|
|
11769
|
+
return {
|
|
11770
|
+
min,
|
|
11771
|
+
max: max2,
|
|
11772
|
+
transform
|
|
11773
|
+
};
|
|
11774
|
+
}
|
|
11532
11775
|
}
|
|
11533
11776
|
const SpaceGraphFloorTypeValue = "spatialStructure:floor";
|
|
11534
11777
|
class SpaceGraphFloor extends SpaceGraphSpatialStructureBase {
|
|
@@ -11661,23 +11904,135 @@ E$3.prototype = {
|
|
|
11661
11904
|
};
|
|
11662
11905
|
tinyEmitter$2.exports = E$3;
|
|
11663
11906
|
var TinyEmitter$2 = tinyEmitter$2.exports.TinyEmitter = E$3;
|
|
11907
|
+
const layoutNodeTypeValues = {
|
|
11908
|
+
...layoutElementTypeValues,
|
|
11909
|
+
"spatialGraph:edge": SpatialGraphEdge,
|
|
11910
|
+
"spatialGraph:vertex": SpatialGraphVertex,
|
|
11911
|
+
"layout:space": LayoutSpace,
|
|
11912
|
+
"view:2d": Layout2dView,
|
|
11913
|
+
"view:3d": Layout3dView,
|
|
11914
|
+
"annotation:floorPlanDxf": LayoutFloorPlanDxfAnnotation,
|
|
11915
|
+
"annotation:floorPlanImage": LayoutFloorPlanImageAnnotation
|
|
11916
|
+
};
|
|
11917
|
+
class GeometryBase extends SpaceGraphNodeBase {
|
|
11918
|
+
constructor(id, type2) {
|
|
11919
|
+
super(id, type2);
|
|
11920
|
+
this.position = [0, 0, 0];
|
|
11921
|
+
this.rotation = 0;
|
|
11922
|
+
this.rotationAxis = [0, 1, 0];
|
|
11923
|
+
this.surfaces = {};
|
|
11924
|
+
this.materials = {};
|
|
11925
|
+
this.boundingBox = {
|
|
11926
|
+
min: [Infinity, Infinity, Infinity],
|
|
11927
|
+
max: [-Infinity, -Infinity, -Infinity]
|
|
11928
|
+
};
|
|
11929
|
+
}
|
|
11930
|
+
}
|
|
11931
|
+
class ParametricGeometryBase extends GeometryBase {
|
|
11932
|
+
constructor(id, type2) {
|
|
11933
|
+
super(id, type2);
|
|
11934
|
+
this.normals = "generator";
|
|
11935
|
+
this.uvs = "generator";
|
|
11936
|
+
this.geometries = [];
|
|
11937
|
+
}
|
|
11938
|
+
}
|
|
11939
|
+
const PlaneGeometryTypeValue = "geometry:plane";
|
|
11940
|
+
class PlaneGeometry extends ParametricGeometryBase {
|
|
11941
|
+
constructor(id) {
|
|
11942
|
+
super(id, PlaneGeometryTypeValue);
|
|
11943
|
+
this.normal = [0, 1, 0];
|
|
11944
|
+
this.size = 1;
|
|
11945
|
+
this.doubleSided = false;
|
|
11946
|
+
}
|
|
11947
|
+
}
|
|
11948
|
+
const CuboidGeometryTypeValue = "geometry:cuboid";
|
|
11949
|
+
class CuboidGeometry extends ParametricGeometryBase {
|
|
11950
|
+
constructor(id) {
|
|
11951
|
+
super(id, CuboidGeometryTypeValue);
|
|
11952
|
+
this.dimensions = [1, 1, 1];
|
|
11953
|
+
}
|
|
11954
|
+
}
|
|
11955
|
+
const SphereGeometryTypeValue = "geometry:sphere";
|
|
11956
|
+
class SphereGeometry extends ParametricGeometryBase {
|
|
11957
|
+
constructor(id) {
|
|
11958
|
+
super(id, SphereGeometryTypeValue);
|
|
11959
|
+
this.radius = 1;
|
|
11960
|
+
}
|
|
11961
|
+
}
|
|
11962
|
+
const ExtrusionGeometryTypeValue = "geometry:extrusion";
|
|
11963
|
+
class ExtrusionGeometry extends ParametricGeometryBase {
|
|
11964
|
+
constructor(id, profile) {
|
|
11965
|
+
super(id, ExtrusionGeometryTypeValue);
|
|
11966
|
+
this.height = 1;
|
|
11967
|
+
this.profile = profile;
|
|
11968
|
+
}
|
|
11969
|
+
}
|
|
11970
|
+
const MeshGeometryTypeValue = "geometry:mesh";
|
|
11971
|
+
class MeshGeometry extends GeometryBase {
|
|
11972
|
+
constructor(id) {
|
|
11973
|
+
super(id, MeshGeometryTypeValue);
|
|
11974
|
+
this.vertices = [];
|
|
11975
|
+
this.indices = [];
|
|
11976
|
+
this.normals = [];
|
|
11977
|
+
this.uvs = [];
|
|
11978
|
+
}
|
|
11979
|
+
}
|
|
11980
|
+
const UriGeometryTypeValue = "geometry:uri";
|
|
11981
|
+
class UriGeometry extends GeometryBase {
|
|
11982
|
+
constructor(id) {
|
|
11983
|
+
super(id, UriGeometryTypeValue);
|
|
11984
|
+
this.format = "data3d";
|
|
11985
|
+
this.uri = "";
|
|
11986
|
+
this.normals = "smooth";
|
|
11987
|
+
}
|
|
11988
|
+
}
|
|
11989
|
+
const geometriesTypeValues = {
|
|
11990
|
+
"geometry:plane": PlaneGeometry,
|
|
11991
|
+
"geometry:cuboid": CuboidGeometry,
|
|
11992
|
+
"geometry:sphere": SphereGeometry,
|
|
11993
|
+
"geometry:extrusion": ExtrusionGeometry,
|
|
11994
|
+
"geometry:mesh": MeshGeometry,
|
|
11995
|
+
"geometry:uri": UriGeometry
|
|
11996
|
+
};
|
|
11997
|
+
const spaceGraphMaterialTypeValues = {
|
|
11998
|
+
"material:embedded": SpaceGraphEmbeddedMaterial,
|
|
11999
|
+
"material:basic": SpaceGraphBasicMaterial,
|
|
12000
|
+
"material:color": SpaceGraphColorMaterial,
|
|
12001
|
+
"material:standard": SpaceGraphStandardMaterial
|
|
12002
|
+
};
|
|
12003
|
+
const spaceGraphProductTypeValues = {
|
|
12004
|
+
"product:static": SpaceGraphProduct
|
|
12005
|
+
};
|
|
12006
|
+
const spaceGraphRelationTypeValues = {
|
|
12007
|
+
"relation:group": GroupRelation
|
|
12008
|
+
};
|
|
12009
|
+
const spaceGraphNodeTypeValues = {
|
|
12010
|
+
...layoutNodeTypeValues,
|
|
12011
|
+
...geometriesTypeValues,
|
|
12012
|
+
...spaceGraphMaterialTypeValues,
|
|
12013
|
+
...spaceGraphProductTypeValues,
|
|
12014
|
+
...spaceGraphRelationTypeValues,
|
|
12015
|
+
"spatialStructure:building": SpaceGraphBuilding,
|
|
12016
|
+
"spatialStructure:floor": SpaceGraphFloor,
|
|
12017
|
+
"spatialStructure:layout": SpaceGraphLayout
|
|
12018
|
+
};
|
|
11664
12019
|
class SpaceGraph {
|
|
11665
12020
|
constructor() {
|
|
11666
12021
|
this.products = [];
|
|
11667
12022
|
this.productsById = {};
|
|
11668
|
-
this.productsByType =
|
|
12023
|
+
this.productsByType = createByType(spaceGraphProductTypeValues);
|
|
11669
12024
|
this.geometries = [];
|
|
11670
12025
|
this.geometriesById = {};
|
|
11671
|
-
this.geometriesByType =
|
|
12026
|
+
this.geometriesByType = createByType(geometriesTypeValues);
|
|
11672
12027
|
this.materials = [];
|
|
11673
12028
|
this.materialsById = {};
|
|
11674
|
-
this.materialsByType =
|
|
12029
|
+
this.materialsByType = createByType(spaceGraphMaterialTypeValues);
|
|
11675
12030
|
this.relations = [];
|
|
11676
12031
|
this.relationsById = {};
|
|
11677
|
-
this.relationsByType =
|
|
12032
|
+
this.relationsByType = createByType(spaceGraphRelationTypeValues);
|
|
11678
12033
|
this.nodes = [];
|
|
11679
12034
|
this.nodesById = {};
|
|
11680
|
-
this.nodesByType =
|
|
12035
|
+
this.nodesByType = createByType(spaceGraphNodeTypeValues);
|
|
11681
12036
|
this.spatialStructure = null;
|
|
11682
12037
|
this.emitter = new TinyEmitter$2();
|
|
11683
12038
|
}
|
|
@@ -11836,9 +12191,6 @@ class SpaceGraph {
|
|
|
11836
12191
|
let { geometries, geometriesById, geometriesByType } = this;
|
|
11837
12192
|
geometries.push(geometryJson);
|
|
11838
12193
|
geometriesById[geometryJson.id] = geometryJson;
|
|
11839
|
-
if (!geometriesByType[geometryJson.type]) {
|
|
11840
|
-
geometriesByType[geometryJson.type] = [];
|
|
11841
|
-
}
|
|
11842
12194
|
geometriesByType[geometryJson.type].push(geometryJson);
|
|
11843
12195
|
}
|
|
11844
12196
|
removeGeometry(geometryJson) {
|
|
@@ -12205,19 +12557,33 @@ function getBoundaryElement$1(layout, boundaryElementJson) {
|
|
|
12205
12557
|
logger$1.warn(`Invalid boundaries, skipping boundary wall ${boundaryElementJson.id}.`);
|
|
12206
12558
|
return;
|
|
12207
12559
|
}
|
|
12208
|
-
let boundaryElement = createElement$1(
|
|
12560
|
+
let boundaryElement = createElement$1(
|
|
12561
|
+
boundaryElementJson.type,
|
|
12562
|
+
boundaryElementJson.id,
|
|
12563
|
+
boundaries
|
|
12564
|
+
);
|
|
12209
12565
|
if (boundaryElementJson.parameters) {
|
|
12210
12566
|
boundaryElement.setParameters(boundaryElementJson.parameters);
|
|
12211
12567
|
}
|
|
12212
12568
|
return boundaryElement;
|
|
12213
12569
|
}
|
|
12214
12570
|
function getEdgeElement$1(layout, edgeElementJson) {
|
|
12215
|
-
let
|
|
12216
|
-
if (
|
|
12217
|
-
|
|
12218
|
-
|
|
12571
|
+
let edgeIds = [];
|
|
12572
|
+
if (Array.isArray(edgeElementJson.edge)) {
|
|
12573
|
+
edgeIds = edgeElementJson.edge;
|
|
12574
|
+
} else {
|
|
12575
|
+
edgeIds = [edgeElementJson.edge];
|
|
12219
12576
|
}
|
|
12220
|
-
let
|
|
12577
|
+
let edges = [];
|
|
12578
|
+
for (let edgeId of edgeIds) {
|
|
12579
|
+
let edge = layout.spatialGraph.edgesById[edgeId];
|
|
12580
|
+
if (!edge) {
|
|
12581
|
+
logger$1.warn(`Edge ${edgeElementJson.edge} not found, skipping edge element ${edgeElementJson.id}.`);
|
|
12582
|
+
return;
|
|
12583
|
+
}
|
|
12584
|
+
edges.push(edge);
|
|
12585
|
+
}
|
|
12586
|
+
let edgeElement = createElement$1(edgeElementJson.type, edgeElementJson.id, edges);
|
|
12221
12587
|
if (edgeElementJson.parameters) {
|
|
12222
12588
|
edgeElement.setParameters(edgeElementJson.parameters);
|
|
12223
12589
|
}
|
|
@@ -12260,7 +12626,9 @@ function getAsset$1(layout, assetJson, spaceGraph) {
|
|
|
12260
12626
|
}
|
|
12261
12627
|
asset.setProduct(product);
|
|
12262
12628
|
} else {
|
|
12263
|
-
logger$1.warn(
|
|
12629
|
+
logger$1.warn(
|
|
12630
|
+
`Layout not attached and space graph not passed as an argument, cannot find product ${assetJson.product}.`
|
|
12631
|
+
);
|
|
12264
12632
|
}
|
|
12265
12633
|
return asset;
|
|
12266
12634
|
}
|
|
@@ -12799,7 +13167,9 @@ function sortVertexEdges(graph) {
|
|
|
12799
13167
|
}
|
|
12800
13168
|
geometryFragmentProxies.push(geometryFragmentProxy);
|
|
12801
13169
|
}
|
|
12802
|
-
geometryFragmentProxies.sort(
|
|
13170
|
+
geometryFragmentProxies.sort(
|
|
13171
|
+
(geometryFragmentProxy1, geometryFragmentProxy2) => geometryFragmentProxy1.fragment.angle - geometryFragmentProxy2.fragment.angle
|
|
13172
|
+
);
|
|
12803
13173
|
vertex2.edges = geometryFragmentProxies.map((geometryFragmentProxy) => geometryFragmentProxy.edge);
|
|
12804
13174
|
}
|
|
12805
13175
|
}
|
|
@@ -13189,23 +13559,112 @@ function getPlanarGraphFromEdges(layout, edges) {
|
|
|
13189
13559
|
sortVertexEdges(graph);
|
|
13190
13560
|
return graph;
|
|
13191
13561
|
}
|
|
13562
|
+
function sortAndAlignEdges(edges) {
|
|
13563
|
+
var _a;
|
|
13564
|
+
if (edges.length === 0) return [];
|
|
13565
|
+
const vertexToEdgeKeys = {};
|
|
13566
|
+
for (const edge of edges) {
|
|
13567
|
+
for (const index of edge.indices) {
|
|
13568
|
+
vertexToEdgeKeys[index] ?? (vertexToEdgeKeys[index] = []);
|
|
13569
|
+
vertexToEdgeKeys[index].push(edge);
|
|
13570
|
+
}
|
|
13571
|
+
}
|
|
13572
|
+
let startIndex = ((_a = Object.entries(vertexToEdgeKeys).find(([, edges2]) => edges2.length === 1)) == null ? void 0 : _a[0]) || Object.keys(vertexToEdgeKeys)[0];
|
|
13573
|
+
const result = [];
|
|
13574
|
+
const used = /* @__PURE__ */ new Set();
|
|
13575
|
+
let currentVertex = parseInt(startIndex);
|
|
13576
|
+
let currentEdge = vertexToEdgeKeys[currentVertex][0];
|
|
13577
|
+
while (result.length < edges.length) {
|
|
13578
|
+
if (used.has(currentEdge)) {
|
|
13579
|
+
currentEdge = edges.find((e2) => !used.has(e2));
|
|
13580
|
+
if (!currentEdge) break;
|
|
13581
|
+
currentVertex = currentEdge.indices[0];
|
|
13582
|
+
continue;
|
|
13583
|
+
}
|
|
13584
|
+
const reverse = currentEdge.indices[0] !== currentVertex;
|
|
13585
|
+
result.push({ edge: currentEdge, reverse });
|
|
13586
|
+
used.add(currentEdge);
|
|
13587
|
+
const nextVertex = reverse ? currentEdge.indices[0] : currentEdge.indices[1];
|
|
13588
|
+
const nextEdge = vertexToEdgeKeys[nextVertex].find((e2) => !used.has(e2));
|
|
13589
|
+
if (nextEdge) {
|
|
13590
|
+
currentVertex = nextVertex;
|
|
13591
|
+
currentEdge = nextEdge;
|
|
13592
|
+
} else {
|
|
13593
|
+
currentEdge = edges.find((e2) => !used.has(e2));
|
|
13594
|
+
if (!currentEdge) break;
|
|
13595
|
+
currentVertex = currentEdge.indices[0];
|
|
13596
|
+
}
|
|
13597
|
+
}
|
|
13598
|
+
return result;
|
|
13599
|
+
}
|
|
13600
|
+
function mergeGraphEdgeProfiles(graphEdges) {
|
|
13601
|
+
const computedGeometries = graphEdges.map((edge) => edge.geometry.computed);
|
|
13602
|
+
const sortedEdges = sortAndAlignEdges(graphEdges);
|
|
13603
|
+
const computed = graphEdges[0].geometry.computed;
|
|
13604
|
+
const firstEdgeReverse = sortedEdges[0].reverse;
|
|
13605
|
+
const firstEdgeComputed = sortedEdges[0].edge.geometry.computed;
|
|
13606
|
+
const lastEdgeReverse = sortedEdges[sortedEdges.length - 1].reverse;
|
|
13607
|
+
const lastEdgeComputed = sortedEdges[sortedEdges.length - 1].edge.geometry.computed;
|
|
13608
|
+
const joinPoints1 = firstEdgeReverse ? firstEdgeComputed.joinPoints2 : firstEdgeComputed.joinPoints1;
|
|
13609
|
+
const joinPoints2 = lastEdgeReverse ? lastEdgeComputed.joinPoints1 : lastEdgeComputed.joinPoints2;
|
|
13610
|
+
const sidePoints1 = [];
|
|
13611
|
+
const sidePoints2 = [];
|
|
13612
|
+
for (const { edge, reverse } of sortedEdges) {
|
|
13613
|
+
const { computed: computed2 } = edge.geometry;
|
|
13614
|
+
if (reverse) {
|
|
13615
|
+
sidePoints1.unshift(...computed2.sidePoints2);
|
|
13616
|
+
sidePoints2.push(...computed2.sidePoints1);
|
|
13617
|
+
} else {
|
|
13618
|
+
sidePoints1.unshift(...computed2.sidePoints1);
|
|
13619
|
+
sidePoints2.push(...computed2.sidePoints2);
|
|
13620
|
+
}
|
|
13621
|
+
}
|
|
13622
|
+
const union = polygonUnion(computedGeometries.map((p2) => p2.points));
|
|
13623
|
+
let points;
|
|
13624
|
+
if (union.length === 1) {
|
|
13625
|
+
points = union[0];
|
|
13626
|
+
} else {
|
|
13627
|
+
points = polygonOffset(union, 1e-3)[0];
|
|
13628
|
+
}
|
|
13629
|
+
return {
|
|
13630
|
+
valid: computed.valid,
|
|
13631
|
+
skipped: computed.skipped,
|
|
13632
|
+
selfIntersecting: computed.selfIntersecting,
|
|
13633
|
+
sidePoints1: sidePoints1.slice(),
|
|
13634
|
+
sidePoints2: sidePoints2.slice(),
|
|
13635
|
+
joinPoints1: joinPoints1.slice(),
|
|
13636
|
+
joinPoints2: joinPoints2.slice(),
|
|
13637
|
+
points
|
|
13638
|
+
};
|
|
13639
|
+
}
|
|
13192
13640
|
function updateWallGeometryProfiles(graph) {
|
|
13641
|
+
var _a;
|
|
13642
|
+
let multiEdgeRecord = {};
|
|
13193
13643
|
for (let graphEdge of graph.edges) {
|
|
13194
13644
|
let edge = graphEdge.reference;
|
|
13195
13645
|
let element = edge.element;
|
|
13196
13646
|
if ((element == null ? void 0 : element.type) === "element:wall") {
|
|
13197
13647
|
let computed = graphEdge.geometry.computed;
|
|
13198
|
-
element.
|
|
13199
|
-
|
|
13200
|
-
|
|
13201
|
-
|
|
13202
|
-
|
|
13203
|
-
|
|
13204
|
-
|
|
13205
|
-
|
|
13206
|
-
|
|
13207
|
-
|
|
13208
|
-
|
|
13648
|
+
if (element.getEdges().length === 1) {
|
|
13649
|
+
element.geometryProfile = {
|
|
13650
|
+
valid: computed.valid,
|
|
13651
|
+
skipped: computed.skipped,
|
|
13652
|
+
selfIntersecting: computed.selfIntersecting,
|
|
13653
|
+
sidePoints1: computed.sidePoints1.slice(),
|
|
13654
|
+
sidePoints2: computed.sidePoints2.slice(),
|
|
13655
|
+
joinPoints1: computed.joinPoints1.slice(),
|
|
13656
|
+
joinPoints2: computed.joinPoints2.slice(),
|
|
13657
|
+
points: computed.points.slice()
|
|
13658
|
+
};
|
|
13659
|
+
element.emit("geometry-profile-update", element);
|
|
13660
|
+
} else {
|
|
13661
|
+
multiEdgeRecord[_a = element.id] ?? (multiEdgeRecord[_a] = []);
|
|
13662
|
+
multiEdgeRecord[element.id].push(graphEdge);
|
|
13663
|
+
if (multiEdgeRecord[element.id].length === element.getEdges().length) {
|
|
13664
|
+
element.geometryProfile = mergeGraphEdgeProfiles(multiEdgeRecord[element.id]);
|
|
13665
|
+
element.emit("geometry-profile-update", element);
|
|
13666
|
+
}
|
|
13667
|
+
}
|
|
13209
13668
|
}
|
|
13210
13669
|
}
|
|
13211
13670
|
}
|
|
@@ -13601,8 +14060,8 @@ var sphericalmercator = { exports: {} };
|
|
|
13601
14060
|
y2 = Math.pow(2, zoom) - 1 - y2;
|
|
13602
14061
|
}
|
|
13603
14062
|
var ll2 = [x2 * this.size, (+y2 + 1) * this.size];
|
|
13604
|
-
var
|
|
13605
|
-
var bbox = this.ll(ll2, zoom).concat(this.ll(
|
|
14063
|
+
var ur2 = [(+x2 + 1) * this.size, y2 * this.size];
|
|
14064
|
+
var bbox = this.ll(ll2, zoom).concat(this.ll(ur2, zoom));
|
|
13606
14065
|
if (srs === "900913") {
|
|
13607
14066
|
return this.convert(bbox, "900913");
|
|
13608
14067
|
} else {
|
|
@@ -13614,9 +14073,9 @@ var sphericalmercator = { exports: {} };
|
|
|
13614
14073
|
bbox = this.convert(bbox, "WGS84");
|
|
13615
14074
|
}
|
|
13616
14075
|
var ll2 = [bbox[0], bbox[1]];
|
|
13617
|
-
var
|
|
14076
|
+
var ur2 = [bbox[2], bbox[3]];
|
|
13618
14077
|
var px_ll = this.px(ll2, zoom);
|
|
13619
|
-
var px_ur = this.px(
|
|
14078
|
+
var px_ur = this.px(ur2, zoom);
|
|
13620
14079
|
var x2 = [Math.floor(px_ll[0] / this.size), Math.floor((px_ur[0] - 1) / this.size)];
|
|
13621
14080
|
var y2 = [Math.floor(px_ur[1] / this.size), Math.floor((px_ll[1] - 1) / this.size)];
|
|
13622
14081
|
var bounds = {
|
|
@@ -13666,7 +14125,7 @@ var sphericalmercator = { exports: {} };
|
|
|
13666
14125
|
}
|
|
13667
14126
|
})(sphericalmercator);
|
|
13668
14127
|
var sphericalmercatorExports = sphericalmercator.exports;
|
|
13669
|
-
const pt = /* @__PURE__ */ getDefaultExportFromCjs(sphericalmercatorExports);
|
|
14128
|
+
const pt$1 = /* @__PURE__ */ getDefaultExportFromCjs(sphericalmercatorExports);
|
|
13670
14129
|
const te$1 = {
|
|
13671
14130
|
work: {
|
|
13672
14131
|
name: "Work",
|
|
@@ -14204,196 +14663,196 @@ Object.keys(te$1).forEach((e2) => {
|
|
|
14204
14663
|
});
|
|
14205
14664
|
}), I$1[e2].category = Object.keys(n2);
|
|
14206
14665
|
});
|
|
14207
|
-
new pt({ size: 256 });
|
|
14208
|
-
var
|
|
14666
|
+
new pt$1({ size: 256 });
|
|
14667
|
+
var Li = 1e-6, G$1 = typeof Float32Array < "u" ? Float32Array : Array;
|
|
14209
14668
|
Math.hypot || (Math.hypot = function() {
|
|
14210
14669
|
for (var t2 = 0, e2 = arguments.length; e2--; )
|
|
14211
14670
|
t2 += arguments[e2] * arguments[e2];
|
|
14212
14671
|
return Math.sqrt(t2);
|
|
14213
14672
|
});
|
|
14214
|
-
function
|
|
14215
|
-
var t2 = new
|
|
14216
|
-
return
|
|
14673
|
+
function Mo() {
|
|
14674
|
+
var t2 = new G$1(9);
|
|
14675
|
+
return G$1 != Float32Array && (t2[1] = 0, t2[2] = 0, t2[3] = 0, t2[5] = 0, t2[6] = 0, t2[7] = 0), t2[0] = 1, t2[4] = 1, t2[8] = 1, t2;
|
|
14217
14676
|
}
|
|
14218
|
-
function
|
|
14219
|
-
var t2 = new
|
|
14220
|
-
return
|
|
14677
|
+
function We() {
|
|
14678
|
+
var t2 = new G$1(16);
|
|
14679
|
+
return G$1 != Float32Array && (t2[1] = 0, t2[2] = 0, t2[3] = 0, t2[4] = 0, t2[6] = 0, t2[7] = 0, t2[8] = 0, t2[9] = 0, t2[11] = 0, t2[12] = 0, t2[13] = 0, t2[14] = 0), t2[0] = 1, t2[5] = 1, t2[10] = 1, t2[15] = 1, t2;
|
|
14221
14680
|
}
|
|
14222
|
-
function
|
|
14681
|
+
function Do(t2, e2) {
|
|
14223
14682
|
return t2[0] = e2[0], t2[1] = e2[1], t2[2] = e2[2], t2[3] = e2[3], t2[4] = e2[4], t2[5] = e2[5], t2[6] = e2[6], t2[7] = e2[7], t2[8] = e2[8], t2[9] = e2[9], t2[10] = e2[10], t2[11] = e2[11], t2[12] = e2[12], t2[13] = e2[13], t2[14] = e2[14], t2[15] = e2[15], t2;
|
|
14224
14683
|
}
|
|
14225
|
-
function
|
|
14226
|
-
var m2 = new
|
|
14227
|
-
return m2[0] = t2, m2[1] = e2, m2[2] = r2, m2[3] =
|
|
14684
|
+
function Bo(t2, e2, r2, n2, i2, s2, o2, l2, a2, c2, f3, u2, d2, h2, p2, g2) {
|
|
14685
|
+
var m2 = new G$1(16);
|
|
14686
|
+
return m2[0] = t2, m2[1] = e2, m2[2] = r2, m2[3] = n2, m2[4] = i2, m2[5] = s2, m2[6] = o2, m2[7] = l2, m2[8] = a2, m2[9] = c2, m2[10] = f3, m2[11] = u2, m2[12] = d2, m2[13] = h2, m2[14] = p2, m2[15] = g2, m2;
|
|
14228
14687
|
}
|
|
14229
|
-
function
|
|
14688
|
+
function ko(t2, e2) {
|
|
14230
14689
|
if (t2 === e2) {
|
|
14231
|
-
var r2 = e2[1],
|
|
14232
|
-
t2[1] = e2[4], t2[2] = e2[8], t2[3] = e2[12], t2[4] = r2, t2[6] = e2[9], t2[7] = e2[13], t2[8] =
|
|
14690
|
+
var r2 = e2[1], n2 = e2[2], i2 = e2[3], s2 = e2[6], o2 = e2[7], l2 = e2[11];
|
|
14691
|
+
t2[1] = e2[4], t2[2] = e2[8], t2[3] = e2[12], t2[4] = r2, t2[6] = e2[9], t2[7] = e2[13], t2[8] = n2, t2[9] = s2, t2[11] = e2[14], t2[12] = i2, t2[13] = o2, t2[14] = l2;
|
|
14233
14692
|
} else
|
|
14234
14693
|
t2[0] = e2[0], t2[1] = e2[4], t2[2] = e2[8], t2[3] = e2[12], t2[4] = e2[1], t2[5] = e2[5], t2[6] = e2[9], t2[7] = e2[13], t2[8] = e2[2], t2[9] = e2[6], t2[10] = e2[10], t2[11] = e2[14], t2[12] = e2[3], t2[13] = e2[7], t2[14] = e2[11], t2[15] = e2[15];
|
|
14235
14694
|
return t2;
|
|
14236
14695
|
}
|
|
14237
|
-
function
|
|
14238
|
-
var r2 = e2[0],
|
|
14239
|
-
return
|
|
14696
|
+
function Vo(t2, e2) {
|
|
14697
|
+
var r2 = e2[0], n2 = e2[1], i2 = e2[2], s2 = e2[3], o2 = e2[4], l2 = e2[5], a2 = e2[6], c2 = e2[7], f3 = e2[8], u2 = e2[9], d2 = e2[10], h2 = e2[11], p2 = e2[12], g2 = e2[13], m2 = e2[14], y2 = e2[15], E3 = r2 * l2 - n2 * o2, I2 = r2 * a2 - i2 * o2, v2 = r2 * c2 - s2 * o2, w2 = n2 * a2 - i2 * l2, x2 = n2 * c2 - s2 * l2, S2 = i2 * c2 - s2 * a2, R2 = f3 * g2 - u2 * p2, T2 = f3 * m2 - d2 * p2, P2 = f3 * y2 - h2 * p2, A2 = u2 * m2 - d2 * g2, O2 = u2 * y2 - h2 * g2, F2 = d2 * y2 - h2 * m2, C2 = E3 * F2 - I2 * O2 + v2 * A2 + w2 * P2 - x2 * T2 + S2 * R2;
|
|
14698
|
+
return C2 ? (C2 = 1 / C2, t2[0] = (l2 * F2 - a2 * O2 + c2 * A2) * C2, t2[1] = (i2 * O2 - n2 * F2 - s2 * A2) * C2, t2[2] = (g2 * S2 - m2 * x2 + y2 * w2) * C2, t2[3] = (d2 * x2 - u2 * S2 - h2 * w2) * C2, t2[4] = (a2 * P2 - o2 * F2 - c2 * T2) * C2, t2[5] = (r2 * F2 - i2 * P2 + s2 * T2) * C2, t2[6] = (m2 * v2 - p2 * S2 - y2 * I2) * C2, t2[7] = (f3 * S2 - d2 * v2 + h2 * I2) * C2, t2[8] = (o2 * O2 - l2 * P2 + c2 * R2) * C2, t2[9] = (n2 * P2 - r2 * O2 - s2 * R2) * C2, t2[10] = (p2 * x2 - g2 * v2 + y2 * E3) * C2, t2[11] = (u2 * v2 - f3 * x2 - h2 * E3) * C2, t2[12] = (l2 * T2 - o2 * A2 - a2 * R2) * C2, t2[13] = (r2 * A2 - n2 * T2 + i2 * R2) * C2, t2[14] = (g2 * I2 - p2 * w2 - m2 * E3) * C2, t2[15] = (f3 * w2 - u2 * I2 + d2 * E3) * C2, t2) : null;
|
|
14240
14699
|
}
|
|
14241
|
-
function
|
|
14242
|
-
var
|
|
14243
|
-
return t2[0] =
|
|
14700
|
+
function Mi(t2, e2, r2) {
|
|
14701
|
+
var n2 = e2[0], i2 = e2[1], s2 = e2[2], o2 = e2[3], l2 = e2[4], a2 = e2[5], c2 = e2[6], f3 = e2[7], u2 = e2[8], d2 = e2[9], h2 = e2[10], p2 = e2[11], g2 = e2[12], m2 = e2[13], y2 = e2[14], E3 = e2[15], I2 = r2[0], v2 = r2[1], w2 = r2[2], x2 = r2[3];
|
|
14702
|
+
return t2[0] = I2 * n2 + v2 * l2 + w2 * u2 + x2 * g2, t2[1] = I2 * i2 + v2 * a2 + w2 * d2 + x2 * m2, t2[2] = I2 * s2 + v2 * c2 + w2 * h2 + x2 * y2, t2[3] = I2 * o2 + v2 * f3 + w2 * p2 + x2 * E3, I2 = r2[4], v2 = r2[5], w2 = r2[6], x2 = r2[7], t2[4] = I2 * n2 + v2 * l2 + w2 * u2 + x2 * g2, t2[5] = I2 * i2 + v2 * a2 + w2 * d2 + x2 * m2, t2[6] = I2 * s2 + v2 * c2 + w2 * h2 + x2 * y2, t2[7] = I2 * o2 + v2 * f3 + w2 * p2 + x2 * E3, I2 = r2[8], v2 = r2[9], w2 = r2[10], x2 = r2[11], t2[8] = I2 * n2 + v2 * l2 + w2 * u2 + x2 * g2, t2[9] = I2 * i2 + v2 * a2 + w2 * d2 + x2 * m2, t2[10] = I2 * s2 + v2 * c2 + w2 * h2 + x2 * y2, t2[11] = I2 * o2 + v2 * f3 + w2 * p2 + x2 * E3, I2 = r2[12], v2 = r2[13], w2 = r2[14], x2 = r2[15], t2[12] = I2 * n2 + v2 * l2 + w2 * u2 + x2 * g2, t2[13] = I2 * i2 + v2 * a2 + w2 * d2 + x2 * m2, t2[14] = I2 * s2 + v2 * c2 + w2 * h2 + x2 * y2, t2[15] = I2 * o2 + v2 * f3 + w2 * p2 + x2 * E3, t2;
|
|
14244
14703
|
}
|
|
14245
|
-
function
|
|
14246
|
-
var
|
|
14247
|
-
return t2[0] = 1 - (h2 + g2), t2[1] =
|
|
14704
|
+
function Go(t2, e2, r2) {
|
|
14705
|
+
var n2 = e2[0], i2 = e2[1], s2 = e2[2], o2 = e2[3], l2 = n2 + n2, a2 = i2 + i2, c2 = s2 + s2, f3 = n2 * l2, u2 = n2 * a2, d2 = n2 * c2, h2 = i2 * a2, p2 = i2 * c2, g2 = s2 * c2, m2 = o2 * l2, y2 = o2 * a2, E3 = o2 * c2;
|
|
14706
|
+
return t2[0] = 1 - (h2 + g2), t2[1] = u2 + E3, t2[2] = d2 - y2, t2[3] = 0, t2[4] = u2 - E3, t2[5] = 1 - (f3 + g2), t2[6] = p2 + m2, t2[7] = 0, t2[8] = d2 + y2, t2[9] = p2 - m2, t2[10] = 1 - (f3 + h2), t2[11] = 0, t2[12] = r2[0], t2[13] = r2[1], t2[14] = r2[2], t2[15] = 1, t2;
|
|
14248
14707
|
}
|
|
14249
|
-
function
|
|
14708
|
+
function Di(t2, e2) {
|
|
14250
14709
|
return t2[0] = e2[12], t2[1] = e2[13], t2[2] = e2[14], t2;
|
|
14251
14710
|
}
|
|
14252
|
-
function
|
|
14253
|
-
var r2 = e2[0],
|
|
14254
|
-
return t2[0] = Math.hypot(r2,
|
|
14711
|
+
function $o(t2, e2) {
|
|
14712
|
+
var r2 = e2[0], n2 = e2[1], i2 = e2[2], s2 = e2[4], o2 = e2[5], l2 = e2[6], a2 = e2[8], c2 = e2[9], f3 = e2[10];
|
|
14713
|
+
return t2[0] = Math.hypot(r2, n2, i2), t2[1] = Math.hypot(s2, o2, l2), t2[2] = Math.hypot(a2, c2, f3), t2;
|
|
14255
14714
|
}
|
|
14256
|
-
function
|
|
14257
|
-
var r2 = new
|
|
14258
|
-
|
|
14259
|
-
var
|
|
14260
|
-
return g2 > 0 ? (m2 = Math.sqrt(g2 + 1) * 2, t2[3] = 0.25 * m2, t2[0] = (
|
|
14715
|
+
function Bi(t2, e2) {
|
|
14716
|
+
var r2 = new G$1(3);
|
|
14717
|
+
$o(r2, e2);
|
|
14718
|
+
var n2 = 1 / r2[0], i2 = 1 / r2[1], s2 = 1 / r2[2], o2 = e2[0] * n2, l2 = e2[1] * i2, a2 = e2[2] * s2, c2 = e2[4] * n2, f3 = e2[5] * i2, u2 = e2[6] * s2, d2 = e2[8] * n2, h2 = e2[9] * i2, p2 = e2[10] * s2, g2 = o2 + f3 + p2, m2 = 0;
|
|
14719
|
+
return g2 > 0 ? (m2 = Math.sqrt(g2 + 1) * 2, t2[3] = 0.25 * m2, t2[0] = (u2 - h2) / m2, t2[1] = (d2 - a2) / m2, t2[2] = (l2 - c2) / m2) : o2 > f3 && o2 > p2 ? (m2 = Math.sqrt(1 + o2 - f3 - p2) * 2, t2[3] = (u2 - h2) / m2, t2[0] = 0.25 * m2, t2[1] = (l2 + c2) / m2, t2[2] = (d2 + a2) / m2) : f3 > p2 ? (m2 = Math.sqrt(1 + f3 - o2 - p2) * 2, t2[3] = (d2 - a2) / m2, t2[0] = (l2 + c2) / m2, t2[1] = 0.25 * m2, t2[2] = (u2 + h2) / m2) : (m2 = Math.sqrt(1 + p2 - o2 - f3) * 2, t2[3] = (l2 - c2) / m2, t2[0] = (d2 + a2) / m2, t2[1] = (u2 + h2) / m2, t2[2] = 0.25 * m2), t2;
|
|
14261
14720
|
}
|
|
14262
14721
|
function M$4() {
|
|
14263
|
-
var t2 = new
|
|
14264
|
-
return
|
|
14722
|
+
var t2 = new G$1(3);
|
|
14723
|
+
return G$1 != Float32Array && (t2[0] = 0, t2[1] = 0, t2[2] = 0), t2;
|
|
14265
14724
|
}
|
|
14266
|
-
function
|
|
14267
|
-
var e2 = new
|
|
14725
|
+
function $r(t2) {
|
|
14726
|
+
var e2 = new G$1(3);
|
|
14268
14727
|
return e2[0] = t2[0], e2[1] = t2[1], e2[2] = t2[2], e2;
|
|
14269
14728
|
}
|
|
14270
|
-
function
|
|
14271
|
-
var e2 = t2[0], r2 = t2[1],
|
|
14272
|
-
return Math.hypot(e2, r2,
|
|
14729
|
+
function Wo(t2) {
|
|
14730
|
+
var e2 = t2[0], r2 = t2[1], n2 = t2[2];
|
|
14731
|
+
return Math.hypot(e2, r2, n2);
|
|
14273
14732
|
}
|
|
14274
|
-
function
|
|
14275
|
-
var
|
|
14276
|
-
return
|
|
14733
|
+
function Ie(t2, e2, r2) {
|
|
14734
|
+
var n2 = new G$1(3);
|
|
14735
|
+
return n2[0] = t2, n2[1] = e2, n2[2] = r2, n2;
|
|
14277
14736
|
}
|
|
14278
|
-
function
|
|
14279
|
-
return t2[0] = e2, t2[1] = r2, t2[2] =
|
|
14737
|
+
function Uo(t2, e2, r2, n2) {
|
|
14738
|
+
return t2[0] = e2, t2[1] = r2, t2[2] = n2, t2;
|
|
14280
14739
|
}
|
|
14281
|
-
function
|
|
14740
|
+
function jo(t2, e2, r2) {
|
|
14282
14741
|
return t2[0] = e2[0] + r2[0], t2[1] = e2[1] + r2[1], t2[2] = e2[2] + r2[2], t2;
|
|
14283
14742
|
}
|
|
14284
|
-
function
|
|
14743
|
+
function Qr(t2, e2, r2) {
|
|
14285
14744
|
return t2[0] = e2[0] - r2[0], t2[1] = e2[1] - r2[1], t2[2] = e2[2] - r2[2], t2;
|
|
14286
14745
|
}
|
|
14287
|
-
function
|
|
14288
|
-
return t2[0] = e2[0] + r2[0] *
|
|
14746
|
+
function Ho(t2, e2, r2, n2) {
|
|
14747
|
+
return t2[0] = e2[0] + r2[0] * n2, t2[1] = e2[1] + r2[1] * n2, t2[2] = e2[2] + r2[2] * n2, t2;
|
|
14289
14748
|
}
|
|
14290
|
-
function
|
|
14291
|
-
var r2 = e2[0],
|
|
14749
|
+
function ne(t2, e2) {
|
|
14750
|
+
var r2 = e2[0], n2 = e2[1], i2 = e2[2], s2 = r2 * r2 + n2 * n2 + i2 * i2;
|
|
14292
14751
|
return s2 > 0 && (s2 = 1 / Math.sqrt(s2)), t2[0] = e2[0] * s2, t2[1] = e2[1] * s2, t2[2] = e2[2] * s2, t2;
|
|
14293
14752
|
}
|
|
14294
|
-
function
|
|
14753
|
+
function Jo(t2, e2) {
|
|
14295
14754
|
return t2[0] * e2[0] + t2[1] * e2[1] + t2[2] * e2[2];
|
|
14296
14755
|
}
|
|
14297
14756
|
function de(t2, e2, r2) {
|
|
14298
|
-
var
|
|
14299
|
-
return t2[0] =
|
|
14757
|
+
var n2 = e2[0], i2 = e2[1], s2 = e2[2], o2 = r2[0], l2 = r2[1], a2 = r2[2];
|
|
14758
|
+
return t2[0] = i2 * a2 - s2 * l2, t2[1] = s2 * o2 - n2 * a2, t2[2] = n2 * l2 - i2 * o2, t2;
|
|
14300
14759
|
}
|
|
14301
|
-
function
|
|
14302
|
-
var
|
|
14303
|
-
return o2 = o2 || 1, t2[0] = (r2[0] *
|
|
14760
|
+
function yn(t2, e2, r2) {
|
|
14761
|
+
var n2 = e2[0], i2 = e2[1], s2 = e2[2], o2 = r2[3] * n2 + r2[7] * i2 + r2[11] * s2 + r2[15];
|
|
14762
|
+
return o2 = o2 || 1, t2[0] = (r2[0] * n2 + r2[4] * i2 + r2[8] * s2 + r2[12]) / o2, t2[1] = (r2[1] * n2 + r2[5] * i2 + r2[9] * s2 + r2[13]) / o2, t2[2] = (r2[2] * n2 + r2[6] * i2 + r2[10] * s2 + r2[14]) / o2, t2;
|
|
14304
14763
|
}
|
|
14305
|
-
var Ue =
|
|
14764
|
+
var Ue = Qr, _o = Wo;
|
|
14306
14765
|
(function() {
|
|
14307
14766
|
var t2 = M$4();
|
|
14308
|
-
return function(e2, r2,
|
|
14767
|
+
return function(e2, r2, n2, i2, s2, o2) {
|
|
14309
14768
|
var l2, a2;
|
|
14310
|
-
for (r2 || (r2 = 3),
|
|
14769
|
+
for (r2 || (r2 = 3), n2 || (n2 = 0), i2 ? a2 = Math.min(i2 * r2 + n2, e2.length) : a2 = e2.length, l2 = n2; l2 < a2; l2 += r2)
|
|
14311
14770
|
t2[0] = e2[l2], t2[1] = e2[l2 + 1], t2[2] = e2[l2 + 2], s2(t2, t2, o2), e2[l2] = t2[0], e2[l2 + 1] = t2[1], e2[l2 + 2] = t2[2];
|
|
14312
14771
|
return e2;
|
|
14313
14772
|
};
|
|
14314
14773
|
})();
|
|
14315
|
-
function
|
|
14316
|
-
var t2 = new
|
|
14317
|
-
return
|
|
14774
|
+
function zo() {
|
|
14775
|
+
var t2 = new G$1(4);
|
|
14776
|
+
return G$1 != Float32Array && (t2[0] = 0, t2[1] = 0, t2[2] = 0, t2[3] = 0), t2;
|
|
14318
14777
|
}
|
|
14319
|
-
function
|
|
14320
|
-
var r2 = e2[0],
|
|
14321
|
-
return o2 > 0 && (o2 = 1 / Math.sqrt(o2)), t2[0] = r2 * o2, t2[1] =
|
|
14778
|
+
function Yo(t2, e2) {
|
|
14779
|
+
var r2 = e2[0], n2 = e2[1], i2 = e2[2], s2 = e2[3], o2 = r2 * r2 + n2 * n2 + i2 * i2 + s2 * s2;
|
|
14780
|
+
return o2 > 0 && (o2 = 1 / Math.sqrt(o2)), t2[0] = r2 * o2, t2[1] = n2 * o2, t2[2] = i2 * o2, t2[3] = s2 * o2, t2;
|
|
14322
14781
|
}
|
|
14323
14782
|
(function() {
|
|
14324
|
-
var t2 =
|
|
14325
|
-
return function(e2, r2,
|
|
14783
|
+
var t2 = zo();
|
|
14784
|
+
return function(e2, r2, n2, i2, s2, o2) {
|
|
14326
14785
|
var l2, a2;
|
|
14327
|
-
for (r2 || (r2 = 4),
|
|
14786
|
+
for (r2 || (r2 = 4), n2 || (n2 = 0), i2 ? a2 = Math.min(i2 * r2 + n2, e2.length) : a2 = e2.length, l2 = n2; l2 < a2; l2 += r2)
|
|
14328
14787
|
t2[0] = e2[l2], t2[1] = e2[l2 + 1], t2[2] = e2[l2 + 2], t2[3] = e2[l2 + 3], s2(t2, t2, o2), e2[l2] = t2[0], e2[l2 + 1] = t2[1], e2[l2 + 2] = t2[2], e2[l2 + 3] = t2[3];
|
|
14329
14788
|
return e2;
|
|
14330
14789
|
};
|
|
14331
14790
|
})();
|
|
14332
|
-
function
|
|
14333
|
-
var t2 = new
|
|
14334
|
-
return
|
|
14791
|
+
function at() {
|
|
14792
|
+
var t2 = new G$1(4);
|
|
14793
|
+
return G$1 != Float32Array && (t2[0] = 0, t2[1] = 0, t2[2] = 0), t2[3] = 1, t2;
|
|
14335
14794
|
}
|
|
14336
|
-
function
|
|
14795
|
+
function ki(t2, e2, r2) {
|
|
14337
14796
|
r2 = r2 * 0.5;
|
|
14338
|
-
var
|
|
14339
|
-
return t2[0] =
|
|
14797
|
+
var n2 = Math.sin(r2);
|
|
14798
|
+
return t2[0] = n2 * e2[0], t2[1] = n2 * e2[1], t2[2] = n2 * e2[2], t2[3] = Math.cos(r2), t2;
|
|
14340
14799
|
}
|
|
14341
|
-
function
|
|
14342
|
-
var
|
|
14343
|
-
return h2 =
|
|
14800
|
+
function Wr(t2, e2, r2, n2) {
|
|
14801
|
+
var i2 = e2[0], s2 = e2[1], o2 = e2[2], l2 = e2[3], a2 = r2[0], c2 = r2[1], f3 = r2[2], u2 = r2[3], d2, h2, p2, g2, m2;
|
|
14802
|
+
return h2 = i2 * a2 + s2 * c2 + o2 * f3 + l2 * u2, h2 < 0 && (h2 = -h2, a2 = -a2, c2 = -c2, f3 = -f3, u2 = -u2), 1 - h2 > Li ? (d2 = Math.acos(h2), p2 = Math.sin(d2), g2 = Math.sin((1 - n2) * d2) / p2, m2 = Math.sin(n2 * d2) / p2) : (g2 = 1 - n2, m2 = n2), t2[0] = g2 * i2 + m2 * a2, t2[1] = g2 * s2 + m2 * c2, t2[2] = g2 * o2 + m2 * f3, t2[3] = g2 * l2 + m2 * u2, t2;
|
|
14344
14803
|
}
|
|
14345
|
-
function
|
|
14346
|
-
var r2 = e2[0] + e2[4] + e2[8],
|
|
14804
|
+
function Ko(t2, e2) {
|
|
14805
|
+
var r2 = e2[0] + e2[4] + e2[8], n2;
|
|
14347
14806
|
if (r2 > 0)
|
|
14348
|
-
|
|
14807
|
+
n2 = Math.sqrt(r2 + 1), t2[3] = 0.5 * n2, n2 = 0.5 / n2, t2[0] = (e2[5] - e2[7]) * n2, t2[1] = (e2[6] - e2[2]) * n2, t2[2] = (e2[1] - e2[3]) * n2;
|
|
14349
14808
|
else {
|
|
14350
|
-
var
|
|
14351
|
-
e2[4] > e2[0] && (
|
|
14352
|
-
var s2 = (
|
|
14353
|
-
|
|
14809
|
+
var i2 = 0;
|
|
14810
|
+
e2[4] > e2[0] && (i2 = 1), e2[8] > e2[i2 * 3 + i2] && (i2 = 2);
|
|
14811
|
+
var s2 = (i2 + 1) % 3, o2 = (i2 + 2) % 3;
|
|
14812
|
+
n2 = Math.sqrt(e2[i2 * 3 + i2] - e2[s2 * 3 + s2] - e2[o2 * 3 + o2] + 1), t2[i2] = 0.5 * n2, n2 = 0.5 / n2, t2[3] = (e2[s2 * 3 + o2] - e2[o2 * 3 + s2]) * n2, t2[s2] = (e2[s2 * 3 + i2] + e2[i2 * 3 + s2]) * n2, t2[o2] = (e2[o2 * 3 + i2] + e2[i2 * 3 + o2]) * n2;
|
|
14354
14813
|
}
|
|
14355
14814
|
return t2;
|
|
14356
14815
|
}
|
|
14357
|
-
var
|
|
14816
|
+
var Vi = Yo;
|
|
14358
14817
|
(function() {
|
|
14359
|
-
var t2 = M$4(), e2 =
|
|
14360
|
-
return function(
|
|
14361
|
-
var o2 =
|
|
14362
|
-
return o2 < -0.999999 ? (de(t2, e2,
|
|
14818
|
+
var t2 = M$4(), e2 = Ie(1, 0, 0), r2 = Ie(0, 1, 0);
|
|
14819
|
+
return function(n2, i2, s2) {
|
|
14820
|
+
var o2 = Jo(i2, s2);
|
|
14821
|
+
return o2 < -0.999999 ? (de(t2, e2, i2), _o(t2) < 1e-6 && de(t2, r2, i2), ne(t2, t2), ki(n2, t2, Math.PI), n2) : o2 > 0.999999 ? (n2[0] = 0, n2[1] = 0, n2[2] = 0, n2[3] = 1, n2) : (de(t2, i2, s2), n2[0] = t2[0], n2[1] = t2[1], n2[2] = t2[2], n2[3] = 1 + o2, Vi(n2, n2));
|
|
14363
14822
|
};
|
|
14364
14823
|
})();
|
|
14365
14824
|
(function() {
|
|
14366
|
-
var t2 =
|
|
14367
|
-
return function(r2,
|
|
14368
|
-
return
|
|
14825
|
+
var t2 = at(), e2 = at();
|
|
14826
|
+
return function(r2, n2, i2, s2, o2, l2) {
|
|
14827
|
+
return Wr(t2, n2, o2, l2), Wr(e2, i2, s2, l2), Wr(r2, t2, e2, 2 * l2 * (1 - l2)), r2;
|
|
14369
14828
|
};
|
|
14370
14829
|
})();
|
|
14371
14830
|
(function() {
|
|
14372
|
-
var t2 =
|
|
14373
|
-
return function(e2, r2,
|
|
14374
|
-
return t2[0] =
|
|
14831
|
+
var t2 = Mo();
|
|
14832
|
+
return function(e2, r2, n2, i2) {
|
|
14833
|
+
return t2[0] = n2[0], t2[3] = n2[1], t2[6] = n2[2], t2[1] = i2[0], t2[4] = i2[1], t2[7] = i2[2], t2[2] = -r2[0], t2[5] = -r2[1], t2[8] = -r2[2], Vi(e2, Ko(e2, t2));
|
|
14375
14834
|
};
|
|
14376
14835
|
})();
|
|
14377
|
-
function
|
|
14378
|
-
var t2 = new
|
|
14379
|
-
return
|
|
14836
|
+
function jt() {
|
|
14837
|
+
var t2 = new G$1(2);
|
|
14838
|
+
return G$1 != Float32Array && (t2[0] = 0, t2[1] = 0), t2;
|
|
14380
14839
|
}
|
|
14381
14840
|
(function() {
|
|
14382
|
-
var t2 =
|
|
14383
|
-
return function(e2, r2,
|
|
14841
|
+
var t2 = jt();
|
|
14842
|
+
return function(e2, r2, n2, i2, s2, o2) {
|
|
14384
14843
|
var l2, a2;
|
|
14385
|
-
for (r2 || (r2 = 2),
|
|
14844
|
+
for (r2 || (r2 = 2), n2 || (n2 = 0), i2 ? a2 = Math.min(i2 * r2 + n2, e2.length) : a2 = e2.length, l2 = n2; l2 < a2; l2 += r2)
|
|
14386
14845
|
t2[0] = e2[l2], t2[1] = e2[l2 + 1], s2(t2, t2, o2), e2[l2] = t2[0], e2[l2 + 1] = t2[1];
|
|
14387
14846
|
return e2;
|
|
14388
14847
|
};
|
|
14389
14848
|
})();
|
|
14390
|
-
var
|
|
14391
|
-
let
|
|
14849
|
+
var Zo = Object.defineProperty, qo = (t2, e2, r2) => e2 in t2 ? Zo(t2, e2, { enumerable: true, configurable: true, writable: true, value: r2 }) : t2[e2] = r2, $$4 = (t2, e2, r2) => (qo(t2, typeof e2 != "symbol" ? e2 + "" : e2, r2), r2);
|
|
14850
|
+
let J$1 = class J {
|
|
14392
14851
|
constructor() {
|
|
14393
|
-
|
|
14852
|
+
$$4(this, "polygons", []);
|
|
14394
14853
|
}
|
|
14395
14854
|
clone() {
|
|
14396
|
-
var e2 = new
|
|
14855
|
+
var e2 = new J();
|
|
14397
14856
|
return e2.polygons = this.polygons.map(function(r2) {
|
|
14398
14857
|
return r2.clone();
|
|
14399
14858
|
}), e2;
|
|
@@ -14416,8 +14875,8 @@ let _$1 = class _ {
|
|
|
14416
14875
|
// +-------+ +-------+
|
|
14417
14876
|
//
|
|
14418
14877
|
union(e2) {
|
|
14419
|
-
var r2 = new
|
|
14420
|
-
return r2.clipTo(
|
|
14878
|
+
var r2 = new J.Node(this.clone().polygons), n2 = new J.Node(e2.clone().polygons);
|
|
14879
|
+
return r2.clipTo(n2), n2.clipTo(r2), n2.invert(), n2.clipTo(r2), n2.invert(), r2.build(n2.allPolygons()), J.fromPolygons(r2.allPolygons());
|
|
14421
14880
|
}
|
|
14422
14881
|
// Return a new CSG solid representing space in this solid but not in the
|
|
14423
14882
|
// solid `csg`. Neither this solid nor the solid `csg` are modified.
|
|
@@ -14434,8 +14893,8 @@ let _$1 = class _ {
|
|
|
14434
14893
|
// +-------+
|
|
14435
14894
|
//
|
|
14436
14895
|
subtract(e2) {
|
|
14437
|
-
var r2 = new
|
|
14438
|
-
return r2.invert(), r2.clipTo(
|
|
14896
|
+
var r2 = new J.Node(this.clone().polygons), n2 = new J.Node(e2.clone().polygons);
|
|
14897
|
+
return r2.invert(), r2.clipTo(n2), n2.clipTo(r2), n2.invert(), n2.clipTo(r2), n2.invert(), r2.build(n2.allPolygons()), r2.invert(), J.fromPolygons(r2.allPolygons());
|
|
14439
14898
|
}
|
|
14440
14899
|
// Return a new CSG solid representing space both this solid and in the
|
|
14441
14900
|
// solid `csg`. Neither this solid nor the solid `csg` are modified.
|
|
@@ -14452,8 +14911,8 @@ let _$1 = class _ {
|
|
|
14452
14911
|
// +-------+
|
|
14453
14912
|
//
|
|
14454
14913
|
intersect(e2) {
|
|
14455
|
-
var r2 = new
|
|
14456
|
-
return r2.invert(),
|
|
14914
|
+
var r2 = new J.Node(this.clone().polygons), n2 = new J.Node(e2.clone().polygons);
|
|
14915
|
+
return r2.invert(), n2.clipTo(r2), n2.invert(), r2.clipTo(n2), n2.clipTo(r2), r2.build(n2.allPolygons()), r2.invert(), J.fromPolygons(r2.allPolygons());
|
|
14457
14916
|
}
|
|
14458
14917
|
// Return a new CSG solid with solid and empty space switched. This solid is
|
|
14459
14918
|
// not modified.
|
|
@@ -14466,13 +14925,13 @@ let _$1 = class _ {
|
|
|
14466
14925
|
};
|
|
14467
14926
|
((t2) => {
|
|
14468
14927
|
function e2(f3) {
|
|
14469
|
-
var
|
|
14470
|
-
return
|
|
14928
|
+
var u2 = new t2();
|
|
14929
|
+
return u2.polygons = f3, u2;
|
|
14471
14930
|
}
|
|
14472
14931
|
t2.fromPolygons = e2;
|
|
14473
14932
|
function r2(f3) {
|
|
14474
14933
|
f3 = f3 || {};
|
|
14475
|
-
var
|
|
14934
|
+
var u2 = new t2.Vector(f3.center || [0, 0, 0]), d2 = f3.radius ? f3.radius.length ? f3.radius : [f3.radius, f3.radius, f3.radius] : [1, 1, 1];
|
|
14476
14935
|
return t2.fromPolygons([
|
|
14477
14936
|
[[0, 4, 6, 2], [-1, 0, 0]],
|
|
14478
14937
|
[[1, 3, 7, 5], [1, 0, 0]],
|
|
@@ -14482,47 +14941,47 @@ let _$1 = class _ {
|
|
|
14482
14941
|
[[4, 5, 7, 6], [0, 0, 1]]
|
|
14483
14942
|
].map(function(h2) {
|
|
14484
14943
|
return new t2.Polygon(h2[0].map(function(p2) {
|
|
14485
|
-
let g2 = p2 & 1 ? d2[0] : -d2[0], m2 = p2 & 2 ? d2[1] : -d2[1], y2 = p2 & 4 ? d2[2] : -d2[2],
|
|
14486
|
-
return new t2.Vertex(
|
|
14944
|
+
let g2 = p2 & 1 ? d2[0] : -d2[0], m2 = p2 & 2 ? d2[1] : -d2[1], y2 = p2 & 4 ? d2[2] : -d2[2], E3 = new t2.Vector(u2.x + g2, u2.y + m2, u2.z + y2);
|
|
14945
|
+
return new t2.Vertex(E3, new t2.Vector(h2[1]));
|
|
14487
14946
|
}));
|
|
14488
14947
|
}));
|
|
14489
14948
|
}
|
|
14490
14949
|
t2.cube = r2;
|
|
14491
|
-
function
|
|
14950
|
+
function n2(f3) {
|
|
14492
14951
|
f3 = f3 || {};
|
|
14493
|
-
var
|
|
14494
|
-
function y2(v2,
|
|
14495
|
-
v2 *= Math.PI * 2,
|
|
14952
|
+
var u2 = new t2.Vector(f3.center || [0, 0, 0]), d2 = f3.radius || 1, h2 = f3.slices || 16, p2 = f3.stacks || 8, g2 = [], m2;
|
|
14953
|
+
function y2(v2, w2) {
|
|
14954
|
+
v2 *= Math.PI * 2, w2 *= Math.PI;
|
|
14496
14955
|
var x2 = new t2.Vector(
|
|
14497
|
-
Math.cos(v2) * Math.sin(
|
|
14498
|
-
Math.cos(
|
|
14499
|
-
Math.sin(v2) * Math.sin(
|
|
14956
|
+
Math.cos(v2) * Math.sin(w2),
|
|
14957
|
+
Math.cos(w2),
|
|
14958
|
+
Math.sin(v2) * Math.sin(w2)
|
|
14500
14959
|
);
|
|
14501
|
-
m2.push(new t2.Vertex(
|
|
14960
|
+
m2.push(new t2.Vertex(u2.plus(x2.times(d2)), x2));
|
|
14502
14961
|
}
|
|
14503
|
-
for (var
|
|
14504
|
-
for (var
|
|
14505
|
-
m2 = [], y2(
|
|
14962
|
+
for (var E3 = 0; E3 < h2; E3++)
|
|
14963
|
+
for (var I2 = 0; I2 < p2; I2++)
|
|
14964
|
+
m2 = [], y2(E3 / h2, I2 / p2), I2 > 0 && y2((E3 + 1) / h2, I2 / p2), I2 < p2 - 1 && y2((E3 + 1) / h2, (I2 + 1) / p2), y2(E3 / h2, (I2 + 1) / p2), g2.push(new t2.Polygon(m2));
|
|
14506
14965
|
return t2.fromPolygons(g2);
|
|
14507
14966
|
}
|
|
14508
|
-
t2.sphere =
|
|
14509
|
-
function
|
|
14967
|
+
t2.sphere = n2;
|
|
14968
|
+
function i2(f3) {
|
|
14510
14969
|
f3 = f3 || {};
|
|
14511
|
-
var
|
|
14512
|
-
function
|
|
14513
|
-
var
|
|
14970
|
+
var u2 = new t2.Vector(f3.start || [0, -1, 0]), d2 = new t2.Vector(f3.end || [0, 1, 0]), h2 = d2.minus(u2), p2 = f3.radius || 1, g2 = f3.slices || 16, m2 = h2.unit(), y2 = Math.abs(m2.y) > 0.5, E3 = new t2.Vector(y2, !y2, 0).cross(m2).unit(), I2 = E3.cross(m2).unit(), v2 = new t2.Vertex(u2, m2.negated()), w2 = new t2.Vertex(d2, m2.unit()), x2 = [];
|
|
14971
|
+
function S2(A2, O2, F2) {
|
|
14972
|
+
var C2 = O2 * Math.PI * 2, j2 = E3.times(Math.cos(C2)).plus(I2.times(Math.sin(C2))), Q2 = u2.plus(h2.times(A2)).plus(j2.times(p2)), le = j2.times(1 - Math.abs(F2)).plus(m2.times(F2));
|
|
14514
14973
|
return new t2.Vertex(Q2, le);
|
|
14515
14974
|
}
|
|
14516
14975
|
for (var R2 = 0; R2 < g2; R2++) {
|
|
14517
14976
|
var T2 = R2 / g2, P2 = (R2 + 1) / g2;
|
|
14518
|
-
x2.push(new t2.Polygon([v2,
|
|
14977
|
+
x2.push(new t2.Polygon([v2, S2(0, T2, -1), S2(0, P2, -1)])), x2.push(new t2.Polygon([S2(0, P2, 0), S2(0, T2, 0), S2(1, T2, 0), S2(1, P2, 0)])), x2.push(new t2.Polygon([w2, S2(1, P2, 1), S2(1, T2, 1)]));
|
|
14519
14978
|
}
|
|
14520
14979
|
return t2.fromPolygons(x2);
|
|
14521
14980
|
}
|
|
14522
|
-
t2.cylinder =
|
|
14981
|
+
t2.cylinder = i2;
|
|
14523
14982
|
class s2 {
|
|
14524
|
-
constructor(
|
|
14525
|
-
|
|
14983
|
+
constructor(u2, d2, h2) {
|
|
14984
|
+
$$4(this, "x"), $$4(this, "y"), $$4(this, "z"), arguments.length == 3 ? (this.x = u2, this.y = d2, this.z = h2) : "x" in u2 ? (this.x = u2.x, this.y = u2.y, this.z = u2.z) : (this.x = u2[0], this.y = u2[1], this.z = u2[2]);
|
|
14526
14985
|
}
|
|
14527
14986
|
clone() {
|
|
14528
14987
|
return new t2.Vector(this.x, this.y, this.z);
|
|
@@ -14530,23 +14989,23 @@ let _$1 = class _ {
|
|
|
14530
14989
|
negated() {
|
|
14531
14990
|
return new t2.Vector(-this.x, -this.y, -this.z);
|
|
14532
14991
|
}
|
|
14533
|
-
plus(
|
|
14534
|
-
return new t2.Vector(this.x +
|
|
14992
|
+
plus(u2) {
|
|
14993
|
+
return new t2.Vector(this.x + u2.x, this.y + u2.y, this.z + u2.z);
|
|
14535
14994
|
}
|
|
14536
|
-
minus(
|
|
14537
|
-
return new t2.Vector(this.x -
|
|
14995
|
+
minus(u2) {
|
|
14996
|
+
return new t2.Vector(this.x - u2.x, this.y - u2.y, this.z - u2.z);
|
|
14538
14997
|
}
|
|
14539
|
-
times(
|
|
14540
|
-
return new t2.Vector(this.x *
|
|
14998
|
+
times(u2) {
|
|
14999
|
+
return new t2.Vector(this.x * u2, this.y * u2, this.z * u2);
|
|
14541
15000
|
}
|
|
14542
|
-
dividedBy(
|
|
14543
|
-
return new t2.Vector(this.x /
|
|
15001
|
+
dividedBy(u2) {
|
|
15002
|
+
return new t2.Vector(this.x / u2, this.y / u2, this.z / u2);
|
|
14544
15003
|
}
|
|
14545
|
-
dot(
|
|
14546
|
-
return this.x *
|
|
15004
|
+
dot(u2) {
|
|
15005
|
+
return this.x * u2.x + this.y * u2.y + this.z * u2.z;
|
|
14547
15006
|
}
|
|
14548
|
-
lerp(
|
|
14549
|
-
return this.plus(
|
|
15007
|
+
lerp(u2, d2) {
|
|
15008
|
+
return this.plus(u2.minus(this).times(d2));
|
|
14550
15009
|
}
|
|
14551
15010
|
length() {
|
|
14552
15011
|
return Math.sqrt(this.dot(this));
|
|
@@ -14554,18 +15013,18 @@ let _$1 = class _ {
|
|
|
14554
15013
|
unit() {
|
|
14555
15014
|
return this.dividedBy(this.length());
|
|
14556
15015
|
}
|
|
14557
|
-
cross(
|
|
15016
|
+
cross(u2) {
|
|
14558
15017
|
return new t2.Vector(
|
|
14559
|
-
this.y *
|
|
14560
|
-
this.z *
|
|
14561
|
-
this.x *
|
|
15018
|
+
this.y * u2.z - this.z * u2.y,
|
|
15019
|
+
this.z * u2.x - this.x * u2.z,
|
|
15020
|
+
this.x * u2.y - this.y * u2.x
|
|
14562
15021
|
);
|
|
14563
15022
|
}
|
|
14564
15023
|
}
|
|
14565
15024
|
t2.Vector = s2;
|
|
14566
15025
|
class o2 {
|
|
14567
|
-
constructor(
|
|
14568
|
-
|
|
15026
|
+
constructor(u2, d2) {
|
|
15027
|
+
$$4(this, "pos"), $$4(this, "normal"), this.pos = new t2.Vector(u2), this.normal = new t2.Vector(d2);
|
|
14569
15028
|
}
|
|
14570
15029
|
clone() {
|
|
14571
15030
|
return new t2.Vertex(this.pos.clone(), this.normal.clone());
|
|
@@ -14578,17 +15037,17 @@ let _$1 = class _ {
|
|
|
14578
15037
|
// Create a new vertex between this vertex and `other` by linearly
|
|
14579
15038
|
// interpolating all properties using a parameter of `t`. Subclasses should
|
|
14580
15039
|
// override this to interpolate additional properties.
|
|
14581
|
-
interpolate(
|
|
15040
|
+
interpolate(u2, d2) {
|
|
14582
15041
|
return new t2.Vertex(
|
|
14583
|
-
this.pos.lerp(
|
|
14584
|
-
this.normal.lerp(
|
|
15042
|
+
this.pos.lerp(u2.pos, d2),
|
|
15043
|
+
this.normal.lerp(u2.normal, d2)
|
|
14585
15044
|
);
|
|
14586
15045
|
}
|
|
14587
15046
|
}
|
|
14588
15047
|
t2.Vertex = o2;
|
|
14589
15048
|
class l2 {
|
|
14590
|
-
constructor(
|
|
14591
|
-
|
|
15049
|
+
constructor(u2, d2) {
|
|
15050
|
+
$$4(this, "normal"), $$4(this, "w"), this.normal = u2, this.w = d2;
|
|
14592
15051
|
}
|
|
14593
15052
|
clone() {
|
|
14594
15053
|
return new t2.Plane(this.normal.clone(), this.w);
|
|
@@ -14601,215 +15060,204 @@ let _$1 = class _ {
|
|
|
14601
15060
|
// `coplanarFront` or `coplanarBack` depending on their orientation with
|
|
14602
15061
|
// respect to this plane. Polygons in front or in back of this plane go into
|
|
14603
15062
|
// either `front` or `back`.
|
|
14604
|
-
splitPolygon(
|
|
14605
|
-
for (var m2 = 0, y2 = 1,
|
|
14606
|
-
var
|
|
14607
|
-
v2 |= R2,
|
|
15063
|
+
splitPolygon(u2, d2, h2, p2, g2) {
|
|
15064
|
+
for (var m2 = 0, y2 = 1, E3 = 2, I2 = 3, v2 = 0, w2 = [], x2 = 0; x2 < u2.vertices.length; x2++) {
|
|
15065
|
+
var S2 = this.normal.dot(u2.vertices[x2].pos) - this.w, R2 = S2 < -t2.Plane.EPSILON ? E3 : S2 > t2.Plane.EPSILON ? y2 : m2;
|
|
15066
|
+
v2 |= R2, w2.push(R2);
|
|
14608
15067
|
}
|
|
14609
15068
|
switch (v2) {
|
|
14610
15069
|
case m2:
|
|
14611
|
-
(this.normal.dot(
|
|
15070
|
+
(this.normal.dot(u2.plane.normal) > 0 ? d2 : h2).push(u2);
|
|
14612
15071
|
break;
|
|
14613
15072
|
case y2:
|
|
14614
|
-
p2.push(
|
|
14615
|
-
break;
|
|
14616
|
-
case I2:
|
|
14617
|
-
g2.push(c2);
|
|
15073
|
+
p2.push(u2);
|
|
14618
15074
|
break;
|
|
14619
15075
|
case E3:
|
|
14620
|
-
|
|
14621
|
-
|
|
14622
|
-
|
|
14623
|
-
|
|
15076
|
+
g2.push(u2);
|
|
15077
|
+
break;
|
|
15078
|
+
case I2:
|
|
15079
|
+
for (var T2 = [], P2 = [], x2 = 0; x2 < u2.vertices.length; x2++) {
|
|
15080
|
+
var A2 = (x2 + 1) % u2.vertices.length, O2 = w2[x2], F2 = w2[A2], C2 = u2.vertices[x2], j2 = u2.vertices[A2];
|
|
15081
|
+
if (O2 != E3 && T2.push(C2), O2 != y2 && P2.push(O2 != E3 ? C2.clone() : C2), (O2 | F2) == I2) {
|
|
15082
|
+
var S2 = (this.w - this.normal.dot(C2.pos)) / this.normal.dot(j2.pos.minus(C2.pos)), Q2 = C2.interpolate(j2, S2);
|
|
14624
15083
|
T2.push(Q2), P2.push(Q2.clone());
|
|
14625
15084
|
}
|
|
14626
15085
|
}
|
|
14627
|
-
T2.length >= 3 && p2.push(new t2.Polygon(T2,
|
|
15086
|
+
T2.length >= 3 && p2.push(new t2.Polygon(T2, u2.shared)), P2.length >= 3 && g2.push(new t2.Polygon(P2, u2.shared));
|
|
14628
15087
|
break;
|
|
14629
15088
|
}
|
|
14630
15089
|
}
|
|
14631
15090
|
}
|
|
14632
|
-
|
|
14633
|
-
var h2 =
|
|
15091
|
+
$$4(l2, "EPSILON", 1e-5), $$4(l2, "fromPoints", function(f3, u2, d2) {
|
|
15092
|
+
var h2 = u2.minus(f3).cross(d2.minus(f3)).unit();
|
|
14634
15093
|
return new t2.Plane(h2, h2.dot(f3));
|
|
14635
15094
|
}), t2.Plane = l2;
|
|
14636
15095
|
class a2 {
|
|
14637
|
-
constructor(
|
|
14638
|
-
|
|
15096
|
+
constructor(u2, d2) {
|
|
15097
|
+
$$4(this, "vertices"), $$4(this, "shared"), $$4(this, "plane"), this.vertices = u2, this.shared = d2, this.plane = t2.Plane.fromPoints(u2[0].pos, u2[1].pos, u2[2].pos);
|
|
14639
15098
|
}
|
|
14640
15099
|
clone() {
|
|
14641
|
-
var
|
|
15100
|
+
var u2 = this.vertices.map(function(d2) {
|
|
14642
15101
|
return d2.clone();
|
|
14643
15102
|
});
|
|
14644
|
-
return new t2.Polygon(
|
|
15103
|
+
return new t2.Polygon(u2, this.shared);
|
|
14645
15104
|
}
|
|
14646
15105
|
flip() {
|
|
14647
|
-
this.vertices.reverse().map(function(
|
|
14648
|
-
|
|
15106
|
+
this.vertices.reverse().map(function(u2) {
|
|
15107
|
+
u2.flip();
|
|
14649
15108
|
}), this.plane.flip();
|
|
14650
15109
|
}
|
|
14651
15110
|
}
|
|
14652
15111
|
t2.Polygon = a2;
|
|
14653
|
-
class
|
|
14654
|
-
constructor(
|
|
14655
|
-
|
|
15112
|
+
class c2 {
|
|
15113
|
+
constructor(u2) {
|
|
15114
|
+
$$4(this, "plane", null), $$4(this, "front", null), $$4(this, "back", null), $$4(this, "polygons", []), u2 && this.build(u2);
|
|
14656
15115
|
}
|
|
14657
15116
|
clone() {
|
|
14658
|
-
var
|
|
14659
|
-
return
|
|
15117
|
+
var u2 = new t2.Node();
|
|
15118
|
+
return u2.plane = this.plane && this.plane.clone(), u2.front = this.front && this.front.clone(), u2.back = this.back && this.back.clone(), u2.polygons = this.polygons.map(function(d2) {
|
|
14660
15119
|
return d2.clone();
|
|
14661
|
-
}),
|
|
15120
|
+
}), u2;
|
|
14662
15121
|
}
|
|
14663
15122
|
// Convert solid space to empty space and empty space to solid space.
|
|
14664
15123
|
invert() {
|
|
14665
|
-
for (var
|
|
15124
|
+
for (var u2, d2 = 0; d2 < this.polygons.length; d2++)
|
|
14666
15125
|
this.polygons[d2].flip();
|
|
14667
|
-
(
|
|
15126
|
+
(u2 = this.plane) == null || u2.flip(), this.front && this.front.invert(), this.back && this.back.invert();
|
|
14668
15127
|
var h2 = this.front;
|
|
14669
15128
|
this.front = this.back, this.back = h2;
|
|
14670
15129
|
}
|
|
14671
15130
|
// Recursively remove all polygons in `polygons` that are inside this BSP
|
|
14672
15131
|
// tree.
|
|
14673
|
-
clipPolygons(
|
|
15132
|
+
clipPolygons(u2) {
|
|
14674
15133
|
if (!this.plane)
|
|
14675
|
-
return
|
|
14676
|
-
for (var d2 = [], h2 = [], p2 = 0; p2 <
|
|
14677
|
-
this.plane.splitPolygon(
|
|
15134
|
+
return u2.slice();
|
|
15135
|
+
for (var d2 = [], h2 = [], p2 = 0; p2 < u2.length; p2++)
|
|
15136
|
+
this.plane.splitPolygon(u2[p2], d2, h2, d2, h2);
|
|
14678
15137
|
return this.front && (d2 = this.front.clipPolygons(d2)), this.back ? h2 = this.back.clipPolygons(h2) : h2 = [], d2.concat(h2);
|
|
14679
15138
|
}
|
|
14680
15139
|
// Remove all polygons in this BSP tree that are inside the other BSP tree
|
|
14681
15140
|
// `bsp`.
|
|
14682
|
-
clipTo(
|
|
14683
|
-
this.polygons =
|
|
15141
|
+
clipTo(u2) {
|
|
15142
|
+
this.polygons = u2.clipPolygons(this.polygons), this.front && this.front.clipTo(u2), this.back && this.back.clipTo(u2);
|
|
14684
15143
|
}
|
|
14685
15144
|
// Return a list of all polygons in this BSP tree.
|
|
14686
15145
|
allPolygons() {
|
|
14687
|
-
var
|
|
14688
|
-
return this.front && (
|
|
15146
|
+
var u2 = this.polygons.slice();
|
|
15147
|
+
return this.front && (u2 = u2.concat(this.front.allPolygons())), this.back && (u2 = u2.concat(this.back.allPolygons())), u2;
|
|
14689
15148
|
}
|
|
14690
15149
|
// Build a BSP tree out of `polygons`. When called on an existing tree, the
|
|
14691
15150
|
// new polygons are filtered down to the bottom of the tree and become new
|
|
14692
15151
|
// nodes there. Each set of polygons is partitioned using the first polygon
|
|
14693
15152
|
// (no heuristic is used to pick a good split).
|
|
14694
|
-
build(
|
|
14695
|
-
if (
|
|
14696
|
-
this.plane || (this.plane =
|
|
14697
|
-
for (var d2 = [], h2 = [], p2 = 0; p2 <
|
|
14698
|
-
this.plane.splitPolygon(
|
|
15153
|
+
build(u2) {
|
|
15154
|
+
if (u2.length) {
|
|
15155
|
+
this.plane || (this.plane = u2[0].plane.clone());
|
|
15156
|
+
for (var d2 = [], h2 = [], p2 = 0; p2 < u2.length; p2++)
|
|
15157
|
+
this.plane.splitPolygon(u2[p2], this.polygons, this.polygons, d2, h2);
|
|
14699
15158
|
d2.length && (this.front || (this.front = new t2.Node()), this.front.build(d2)), h2.length && (this.back || (this.back = new t2.Node()), this.back.build(h2));
|
|
14700
15159
|
}
|
|
14701
15160
|
}
|
|
14702
15161
|
}
|
|
14703
|
-
t2.Node =
|
|
14704
|
-
})(
|
|
14705
|
-
const
|
|
14706
|
-
function
|
|
15162
|
+
t2.Node = c2;
|
|
15163
|
+
})(J$1 || (J$1 = {}));
|
|
15164
|
+
const ye = J$1;
|
|
15165
|
+
function Qo(t2) {
|
|
14707
15166
|
return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
|
|
14708
15167
|
}
|
|
14709
|
-
var
|
|
14710
|
-
|
|
14711
|
-
|
|
14712
|
-
function
|
|
15168
|
+
var En = { exports: {} };
|
|
15169
|
+
En.exports = Qt;
|
|
15170
|
+
En.exports.default = Qt;
|
|
15171
|
+
function Qt(t2, e2, r2) {
|
|
14713
15172
|
r2 = r2 || 2;
|
|
14714
|
-
var
|
|
14715
|
-
if (!s2 || s2.next === s2.prev)
|
|
14716
|
-
|
|
14717
|
-
|
|
14718
|
-
|
|
14719
|
-
|
|
14720
|
-
|
|
14721
|
-
|
|
14722
|
-
|
|
14723
|
-
|
|
14724
|
-
|
|
14725
|
-
|
|
14726
|
-
function hn(t2, e2, r2, i2, n2) {
|
|
15173
|
+
var n2 = e2 && e2.length, i2 = n2 ? e2[0] * r2 : t2.length, s2 = $i(t2, 0, i2, r2, true), o2 = [];
|
|
15174
|
+
if (!s2 || s2.next === s2.prev) return o2;
|
|
15175
|
+
var l2, a2, c2, f3, u2, d2, h2;
|
|
15176
|
+
if (n2 && (s2 = il(t2, e2, s2, r2)), t2.length > 80 * r2) {
|
|
15177
|
+
l2 = c2 = t2[0], a2 = f3 = t2[1];
|
|
15178
|
+
for (var p2 = r2; p2 < i2; p2 += r2)
|
|
15179
|
+
u2 = t2[p2], d2 = t2[p2 + 1], u2 < l2 && (l2 = u2), d2 < a2 && (a2 = d2), u2 > c2 && (c2 = u2), d2 > f3 && (f3 = d2);
|
|
15180
|
+
h2 = Math.max(c2 - l2, f3 - a2), h2 = h2 !== 0 ? 32767 / h2 : 0;
|
|
15181
|
+
}
|
|
15182
|
+
return ct(s2, o2, r2, l2, a2, h2, 0), o2;
|
|
15183
|
+
}
|
|
15184
|
+
function $i(t2, e2, r2, n2, i2) {
|
|
14727
15185
|
var s2, o2;
|
|
14728
|
-
if (
|
|
14729
|
-
for (s2 = e2; s2 < r2; s2 +=
|
|
14730
|
-
o2 = Ni(s2, t2[s2], t2[s2 + 1], o2);
|
|
15186
|
+
if (i2 === rn(t2, e2, r2, n2) > 0)
|
|
15187
|
+
for (s2 = e2; s2 < r2; s2 += n2) o2 = ti(s2, t2[s2], t2[s2 + 1], o2);
|
|
14731
15188
|
else
|
|
14732
|
-
for (s2 = r2 -
|
|
14733
|
-
|
|
14734
|
-
return o2 && Xt(o2, o2.next) && (st(o2), o2 = o2.next), o2;
|
|
15189
|
+
for (s2 = r2 - n2; s2 >= e2; s2 -= n2) o2 = ti(s2, t2[s2], t2[s2 + 1], o2);
|
|
15190
|
+
return o2 && er(o2, o2.next) && (ft(o2), o2 = o2.next), o2;
|
|
14735
15191
|
}
|
|
14736
15192
|
function Se(t2, e2) {
|
|
14737
|
-
if (!t2)
|
|
14738
|
-
return t2;
|
|
15193
|
+
if (!t2) return t2;
|
|
14739
15194
|
e2 || (e2 = t2);
|
|
14740
|
-
var r2 = t2,
|
|
15195
|
+
var r2 = t2, n2;
|
|
14741
15196
|
do
|
|
14742
|
-
if (
|
|
14743
|
-
if (
|
|
14744
|
-
|
|
14745
|
-
i2 = true;
|
|
15197
|
+
if (n2 = false, !r2.steiner && (er(r2, r2.next) || D$1(r2.prev, r2, r2.next) === 0)) {
|
|
15198
|
+
if (ft(r2), r2 = e2 = r2.prev, r2 === r2.next) break;
|
|
15199
|
+
n2 = true;
|
|
14746
15200
|
} else
|
|
14747
15201
|
r2 = r2.next;
|
|
14748
|
-
while (
|
|
15202
|
+
while (n2 || r2 !== e2);
|
|
14749
15203
|
return e2;
|
|
14750
15204
|
}
|
|
14751
|
-
function
|
|
15205
|
+
function ct(t2, e2, r2, n2, i2, s2, o2) {
|
|
14752
15206
|
if (t2) {
|
|
14753
|
-
!o2 && s2 &&
|
|
14754
|
-
for (var l2 = t2, a2,
|
|
14755
|
-
if (a2 = t2.prev,
|
|
14756
|
-
e2.push(a2.i / r2 | 0), e2.push(t2.i / r2 | 0), e2.push(
|
|
15207
|
+
!o2 && s2 && cl(t2, n2, i2, s2);
|
|
15208
|
+
for (var l2 = t2, a2, c2; t2.prev !== t2.next; ) {
|
|
15209
|
+
if (a2 = t2.prev, c2 = t2.next, s2 ? tl(t2, n2, i2, s2) : el(t2)) {
|
|
15210
|
+
e2.push(a2.i / r2 | 0), e2.push(t2.i / r2 | 0), e2.push(c2.i / r2 | 0), ft(t2), t2 = c2.next, l2 = c2.next;
|
|
14757
15211
|
continue;
|
|
14758
15212
|
}
|
|
14759
|
-
if (t2 =
|
|
14760
|
-
o2 ? o2 === 1 ? (t2 =
|
|
15213
|
+
if (t2 = c2, t2 === l2) {
|
|
15214
|
+
o2 ? o2 === 1 ? (t2 = rl(Se(t2), e2, r2), ct(t2, e2, r2, n2, i2, s2, 2)) : o2 === 2 && nl(t2, e2, r2, n2, i2, s2) : ct(Se(t2), e2, r2, n2, i2, s2, 1);
|
|
14761
15215
|
break;
|
|
14762
15216
|
}
|
|
14763
15217
|
}
|
|
14764
15218
|
}
|
|
14765
15219
|
}
|
|
14766
|
-
function
|
|
14767
|
-
var e2 = t2.prev, r2 = t2,
|
|
14768
|
-
if (D$1(e2, r2,
|
|
14769
|
-
|
|
14770
|
-
|
|
14771
|
-
if (p2.x >= f3 && p2.x <= d2 && p2.y >= c2 && p2.y <= h2 && Me(n2, l2, s2, a2, o2, u2, p2.x, p2.y) && D$1(p2.prev, p2, p2.next) >= 0)
|
|
14772
|
-
return false;
|
|
15220
|
+
function el(t2) {
|
|
15221
|
+
var e2 = t2.prev, r2 = t2, n2 = t2.next;
|
|
15222
|
+
if (D$1(e2, r2, n2) >= 0) return false;
|
|
15223
|
+
for (var i2 = e2.x, s2 = r2.x, o2 = n2.x, l2 = e2.y, a2 = r2.y, c2 = n2.y, f3 = i2 < s2 ? i2 < o2 ? i2 : o2 : s2 < o2 ? s2 : o2, u2 = l2 < a2 ? l2 < c2 ? l2 : c2 : a2 < c2 ? a2 : c2, d2 = i2 > s2 ? i2 > o2 ? i2 : o2 : s2 > o2 ? s2 : o2, h2 = l2 > a2 ? l2 > c2 ? l2 : c2 : a2 > c2 ? a2 : c2, p2 = n2.next; p2 !== e2; ) {
|
|
15224
|
+
if (p2.x >= f3 && p2.x <= d2 && p2.y >= u2 && p2.y <= h2 && De(i2, l2, s2, a2, o2, c2, p2.x, p2.y) && D$1(p2.prev, p2, p2.next) >= 0) return false;
|
|
14773
15225
|
p2 = p2.next;
|
|
14774
15226
|
}
|
|
14775
15227
|
return true;
|
|
14776
15228
|
}
|
|
14777
|
-
function
|
|
14778
|
-
var
|
|
14779
|
-
if (D$1(
|
|
14780
|
-
|
|
14781
|
-
|
|
14782
|
-
if (E3.x >= h2 && E3.x <= g2 && E3.y >= p2 && E3.y <= m2 && E3 !== n2 && E3 !== o2 && Me(l2, f3, a2, c2, u2, d2, E3.x, E3.y) && D$1(E3.prev, E3, E3.next) >= 0 || (E3 = E3.prevZ, v2.x >= h2 && v2.x <= g2 && v2.y >= p2 && v2.y <= m2 && v2 !== n2 && v2 !== o2 && Me(l2, f3, a2, c2, u2, d2, v2.x, v2.y) && D$1(v2.prev, v2, v2.next) >= 0))
|
|
14783
|
-
return false;
|
|
15229
|
+
function tl(t2, e2, r2, n2) {
|
|
15230
|
+
var i2 = t2.prev, s2 = t2, o2 = t2.next;
|
|
15231
|
+
if (D$1(i2, s2, o2) >= 0) return false;
|
|
15232
|
+
for (var l2 = i2.x, a2 = s2.x, c2 = o2.x, f3 = i2.y, u2 = s2.y, d2 = o2.y, h2 = l2 < a2 ? l2 < c2 ? l2 : c2 : a2 < c2 ? a2 : c2, p2 = f3 < u2 ? f3 < d2 ? f3 : d2 : u2 < d2 ? u2 : d2, g2 = l2 > a2 ? l2 > c2 ? l2 : c2 : a2 > c2 ? a2 : c2, m2 = f3 > u2 ? f3 > d2 ? f3 : d2 : u2 > d2 ? u2 : d2, y2 = en(h2, p2, e2, r2, n2), E3 = en(g2, m2, e2, r2, n2), I2 = t2.prevZ, v2 = t2.nextZ; I2 && I2.z >= y2 && v2 && v2.z <= E3; ) {
|
|
15233
|
+
if (I2.x >= h2 && I2.x <= g2 && I2.y >= p2 && I2.y <= m2 && I2 !== i2 && I2 !== o2 && De(l2, f3, a2, u2, c2, d2, I2.x, I2.y) && D$1(I2.prev, I2, I2.next) >= 0 || (I2 = I2.prevZ, v2.x >= h2 && v2.x <= g2 && v2.y >= p2 && v2.y <= m2 && v2 !== i2 && v2 !== o2 && De(l2, f3, a2, u2, c2, d2, v2.x, v2.y) && D$1(v2.prev, v2, v2.next) >= 0)) return false;
|
|
14784
15234
|
v2 = v2.nextZ;
|
|
14785
15235
|
}
|
|
14786
|
-
for (;
|
|
14787
|
-
if (
|
|
14788
|
-
|
|
14789
|
-
E3 = E3.prevZ;
|
|
15236
|
+
for (; I2 && I2.z >= y2; ) {
|
|
15237
|
+
if (I2.x >= h2 && I2.x <= g2 && I2.y >= p2 && I2.y <= m2 && I2 !== i2 && I2 !== o2 && De(l2, f3, a2, u2, c2, d2, I2.x, I2.y) && D$1(I2.prev, I2, I2.next) >= 0) return false;
|
|
15238
|
+
I2 = I2.prevZ;
|
|
14790
15239
|
}
|
|
14791
|
-
for (; v2 && v2.z <=
|
|
14792
|
-
if (v2.x >= h2 && v2.x <= g2 && v2.y >= p2 && v2.y <= m2 && v2 !==
|
|
14793
|
-
return false;
|
|
15240
|
+
for (; v2 && v2.z <= E3; ) {
|
|
15241
|
+
if (v2.x >= h2 && v2.x <= g2 && v2.y >= p2 && v2.y <= m2 && v2 !== i2 && v2 !== o2 && De(l2, f3, a2, u2, c2, d2, v2.x, v2.y) && D$1(v2.prev, v2, v2.next) >= 0) return false;
|
|
14794
15242
|
v2 = v2.nextZ;
|
|
14795
15243
|
}
|
|
14796
15244
|
return true;
|
|
14797
15245
|
}
|
|
14798
|
-
function
|
|
14799
|
-
var
|
|
15246
|
+
function rl(t2, e2, r2) {
|
|
15247
|
+
var n2 = t2;
|
|
14800
15248
|
do {
|
|
14801
|
-
var
|
|
14802
|
-
!
|
|
14803
|
-
} while (
|
|
14804
|
-
return Se(
|
|
15249
|
+
var i2 = n2.prev, s2 = n2.next.next;
|
|
15250
|
+
!er(i2, s2) && Wi(i2, n2, n2.next, s2) && ut(i2, s2) && ut(s2, i2) && (e2.push(i2.i / r2 | 0), e2.push(n2.i / r2 | 0), e2.push(s2.i / r2 | 0), ft(n2), ft(n2.next), n2 = t2 = s2), n2 = n2.next;
|
|
15251
|
+
} while (n2 !== t2);
|
|
15252
|
+
return Se(n2);
|
|
14805
15253
|
}
|
|
14806
|
-
function
|
|
15254
|
+
function nl(t2, e2, r2, n2, i2, s2) {
|
|
14807
15255
|
var o2 = t2;
|
|
14808
15256
|
do {
|
|
14809
15257
|
for (var l2 = o2.next.next; l2 !== o2.prev; ) {
|
|
14810
|
-
if (o2.i !== l2.i &&
|
|
14811
|
-
var a2 =
|
|
14812
|
-
o2 = Se(o2, o2.next), a2 = Se(a2, a2.next),
|
|
15258
|
+
if (o2.i !== l2.i && dl(o2, l2)) {
|
|
15259
|
+
var a2 = Ui(o2, l2);
|
|
15260
|
+
o2 = Se(o2, o2.next), a2 = Se(a2, a2.next), ct(o2, e2, r2, n2, i2, s2, 0), ct(a2, e2, r2, n2, i2, s2, 0);
|
|
14813
15261
|
return;
|
|
14814
15262
|
}
|
|
14815
15263
|
l2 = l2.next;
|
|
@@ -14817,316 +15265,317 @@ function jo(t2, e2, r2, i2, n2, s2) {
|
|
|
14817
15265
|
o2 = o2.next;
|
|
14818
15266
|
} while (o2 !== t2);
|
|
14819
15267
|
}
|
|
14820
|
-
function
|
|
14821
|
-
var
|
|
15268
|
+
function il(t2, e2, r2, n2) {
|
|
15269
|
+
var i2 = [], s2, o2, l2, a2, c2;
|
|
14822
15270
|
for (s2 = 0, o2 = e2.length; s2 < o2; s2++)
|
|
14823
|
-
l2 = e2[s2] *
|
|
14824
|
-
for (
|
|
14825
|
-
r2 =
|
|
15271
|
+
l2 = e2[s2] * n2, a2 = s2 < o2 - 1 ? e2[s2 + 1] * n2 : t2.length, c2 = $i(t2, l2, a2, n2, false), c2 === c2.next && (c2.steiner = true), i2.push(fl(c2));
|
|
15272
|
+
for (i2.sort(sl), s2 = 0; s2 < i2.length; s2++)
|
|
15273
|
+
r2 = ol(i2[s2], r2);
|
|
14826
15274
|
return r2;
|
|
14827
15275
|
}
|
|
14828
|
-
function
|
|
15276
|
+
function sl(t2, e2) {
|
|
14829
15277
|
return t2.x - e2.x;
|
|
14830
15278
|
}
|
|
14831
|
-
function
|
|
14832
|
-
var r2 =
|
|
15279
|
+
function ol(t2, e2) {
|
|
15280
|
+
var r2 = ll(t2, e2);
|
|
14833
15281
|
if (!r2)
|
|
14834
15282
|
return e2;
|
|
14835
|
-
var
|
|
14836
|
-
return Se(
|
|
15283
|
+
var n2 = Ui(r2, t2);
|
|
15284
|
+
return Se(n2, n2.next), Se(r2, r2.next);
|
|
14837
15285
|
}
|
|
14838
|
-
function
|
|
14839
|
-
var r2 = e2,
|
|
15286
|
+
function ll(t2, e2) {
|
|
15287
|
+
var r2 = e2, n2 = t2.x, i2 = t2.y, s2 = -1 / 0, o2;
|
|
14840
15288
|
do {
|
|
14841
|
-
if (
|
|
14842
|
-
var l2 = r2.x + (
|
|
14843
|
-
if (l2 <=
|
|
15289
|
+
if (i2 <= r2.y && i2 >= r2.next.y && r2.next.y !== r2.y) {
|
|
15290
|
+
var l2 = r2.x + (i2 - r2.y) * (r2.next.x - r2.x) / (r2.next.y - r2.y);
|
|
15291
|
+
if (l2 <= n2 && l2 > s2 && (s2 = l2, o2 = r2.x < r2.next.x ? r2 : r2.next, l2 === n2))
|
|
14844
15292
|
return o2;
|
|
14845
15293
|
}
|
|
14846
15294
|
r2 = r2.next;
|
|
14847
15295
|
} while (r2 !== e2);
|
|
14848
|
-
if (!o2)
|
|
14849
|
-
|
|
14850
|
-
var a2 = o2, u2 = o2.x, f3 = o2.y, c2 = 1 / 0, d2;
|
|
15296
|
+
if (!o2) return null;
|
|
15297
|
+
var a2 = o2, c2 = o2.x, f3 = o2.y, u2 = 1 / 0, d2;
|
|
14851
15298
|
r2 = o2;
|
|
14852
15299
|
do
|
|
14853
|
-
|
|
15300
|
+
n2 >= r2.x && r2.x >= c2 && n2 !== r2.x && De(i2 < f3 ? n2 : s2, i2, c2, f3, i2 < f3 ? s2 : n2, i2, r2.x, r2.y) && (d2 = Math.abs(i2 - r2.y) / (n2 - r2.x), ut(r2, t2) && (d2 < u2 || d2 === u2 && (r2.x > o2.x || r2.x === o2.x && al(o2, r2))) && (o2 = r2, u2 = d2)), r2 = r2.next;
|
|
14854
15301
|
while (r2 !== a2);
|
|
14855
15302
|
return o2;
|
|
14856
15303
|
}
|
|
14857
|
-
function
|
|
15304
|
+
function al(t2, e2) {
|
|
14858
15305
|
return D$1(t2.prev, t2, e2.prev) < 0 && D$1(e2.next, t2, t2.next) < 0;
|
|
14859
15306
|
}
|
|
14860
|
-
function
|
|
14861
|
-
var
|
|
15307
|
+
function cl(t2, e2, r2, n2) {
|
|
15308
|
+
var i2 = t2;
|
|
14862
15309
|
do
|
|
14863
|
-
|
|
14864
|
-
while (
|
|
14865
|
-
|
|
15310
|
+
i2.z === 0 && (i2.z = en(i2.x, i2.y, e2, r2, n2)), i2.prevZ = i2.prev, i2.nextZ = i2.next, i2 = i2.next;
|
|
15311
|
+
while (i2 !== t2);
|
|
15312
|
+
i2.prevZ.nextZ = null, i2.prevZ = null, ul(i2);
|
|
14866
15313
|
}
|
|
14867
|
-
function
|
|
14868
|
-
var e2, r2,
|
|
15314
|
+
function ul(t2) {
|
|
15315
|
+
var e2, r2, n2, i2, s2, o2, l2, a2, c2 = 1;
|
|
14869
15316
|
do {
|
|
14870
15317
|
for (r2 = t2, t2 = null, s2 = null, o2 = 0; r2; ) {
|
|
14871
|
-
for (o2++,
|
|
15318
|
+
for (o2++, n2 = r2, l2 = 0, e2 = 0; e2 < c2 && (l2++, n2 = n2.nextZ, !!n2); e2++)
|
|
14872
15319
|
;
|
|
14873
|
-
for (a2 =
|
|
14874
|
-
l2 !== 0 && (a2 === 0 || !
|
|
14875
|
-
r2 =
|
|
15320
|
+
for (a2 = c2; l2 > 0 || a2 > 0 && n2; )
|
|
15321
|
+
l2 !== 0 && (a2 === 0 || !n2 || r2.z <= n2.z) ? (i2 = r2, r2 = r2.nextZ, l2--) : (i2 = n2, n2 = n2.nextZ, a2--), s2 ? s2.nextZ = i2 : t2 = i2, i2.prevZ = s2, s2 = i2;
|
|
15322
|
+
r2 = n2;
|
|
14876
15323
|
}
|
|
14877
|
-
s2.nextZ = null,
|
|
15324
|
+
s2.nextZ = null, c2 *= 2;
|
|
14878
15325
|
} while (o2 > 1);
|
|
14879
15326
|
return t2;
|
|
14880
15327
|
}
|
|
14881
|
-
function
|
|
14882
|
-
return t2 = (t2 - r2) *
|
|
15328
|
+
function en(t2, e2, r2, n2, i2) {
|
|
15329
|
+
return t2 = (t2 - r2) * i2 | 0, e2 = (e2 - n2) * i2 | 0, t2 = (t2 | t2 << 8) & 16711935, t2 = (t2 | t2 << 4) & 252645135, t2 = (t2 | t2 << 2) & 858993459, t2 = (t2 | t2 << 1) & 1431655765, e2 = (e2 | e2 << 8) & 16711935, e2 = (e2 | e2 << 4) & 252645135, e2 = (e2 | e2 << 2) & 858993459, e2 = (e2 | e2 << 1) & 1431655765, t2 | e2 << 1;
|
|
14883
15330
|
}
|
|
14884
|
-
function
|
|
15331
|
+
function fl(t2) {
|
|
14885
15332
|
var e2 = t2, r2 = t2;
|
|
14886
15333
|
do
|
|
14887
15334
|
(e2.x < r2.x || e2.x === r2.x && e2.y < r2.y) && (r2 = e2), e2 = e2.next;
|
|
14888
15335
|
while (e2 !== t2);
|
|
14889
15336
|
return r2;
|
|
14890
15337
|
}
|
|
14891
|
-
function
|
|
14892
|
-
return (
|
|
15338
|
+
function De(t2, e2, r2, n2, i2, s2, o2, l2) {
|
|
15339
|
+
return (i2 - o2) * (e2 - l2) >= (t2 - o2) * (s2 - l2) && (t2 - o2) * (n2 - l2) >= (r2 - o2) * (e2 - l2) && (r2 - o2) * (s2 - l2) >= (i2 - o2) * (n2 - l2);
|
|
14893
15340
|
}
|
|
14894
|
-
function
|
|
14895
|
-
return t2.next.i !== e2.i && t2.prev.i !== e2.i && !
|
|
14896
|
-
(
|
|
15341
|
+
function dl(t2, e2) {
|
|
15342
|
+
return t2.next.i !== e2.i && t2.prev.i !== e2.i && !pl(t2, e2) && // dones't intersect other edges
|
|
15343
|
+
(ut(t2, e2) && ut(e2, t2) && hl(t2, e2) && // locally visible
|
|
14897
15344
|
(D$1(t2.prev, t2, e2.prev) || D$1(t2, e2.prev, e2)) || // does not create opposite-facing sectors
|
|
14898
|
-
|
|
15345
|
+
er(t2, e2) && D$1(t2.prev, t2, t2.next) > 0 && D$1(e2.prev, e2, e2.next) > 0);
|
|
14899
15346
|
}
|
|
14900
15347
|
function D$1(t2, e2, r2) {
|
|
14901
15348
|
return (e2.y - t2.y) * (r2.x - e2.x) - (e2.x - t2.x) * (r2.y - e2.y);
|
|
14902
15349
|
}
|
|
14903
|
-
function
|
|
15350
|
+
function er(t2, e2) {
|
|
14904
15351
|
return t2.x === e2.x && t2.y === e2.y;
|
|
14905
15352
|
}
|
|
14906
|
-
function
|
|
14907
|
-
var
|
|
14908
|
-
return !!(
|
|
15353
|
+
function Wi(t2, e2, r2, n2) {
|
|
15354
|
+
var i2 = Ot(D$1(t2, e2, r2)), s2 = Ot(D$1(t2, e2, n2)), o2 = Ot(D$1(r2, n2, t2)), l2 = Ot(D$1(r2, n2, e2));
|
|
15355
|
+
return !!(i2 !== s2 && o2 !== l2 || i2 === 0 && Ft(t2, r2, e2) || s2 === 0 && Ft(t2, n2, e2) || o2 === 0 && Ft(r2, t2, n2) || l2 === 0 && Ft(r2, e2, n2));
|
|
14909
15356
|
}
|
|
14910
|
-
function
|
|
15357
|
+
function Ft(t2, e2, r2) {
|
|
14911
15358
|
return e2.x <= Math.max(t2.x, r2.x) && e2.x >= Math.min(t2.x, r2.x) && e2.y <= Math.max(t2.y, r2.y) && e2.y >= Math.min(t2.y, r2.y);
|
|
14912
15359
|
}
|
|
14913
|
-
function
|
|
15360
|
+
function Ot(t2) {
|
|
14914
15361
|
return t2 > 0 ? 1 : t2 < 0 ? -1 : 0;
|
|
14915
15362
|
}
|
|
14916
|
-
function
|
|
15363
|
+
function pl(t2, e2) {
|
|
14917
15364
|
var r2 = t2;
|
|
14918
15365
|
do {
|
|
14919
|
-
if (r2.i !== t2.i && r2.next.i !== t2.i && r2.i !== e2.i && r2.next.i !== e2.i &&
|
|
14920
|
-
return true;
|
|
15366
|
+
if (r2.i !== t2.i && r2.next.i !== t2.i && r2.i !== e2.i && r2.next.i !== e2.i && Wi(r2, r2.next, t2, e2)) return true;
|
|
14921
15367
|
r2 = r2.next;
|
|
14922
15368
|
} while (r2 !== t2);
|
|
14923
15369
|
return false;
|
|
14924
15370
|
}
|
|
14925
|
-
function
|
|
15371
|
+
function ut(t2, e2) {
|
|
14926
15372
|
return D$1(t2.prev, t2, t2.next) < 0 ? D$1(t2, e2, t2.next) >= 0 && D$1(t2, t2.prev, e2) >= 0 : D$1(t2, e2, t2.prev) < 0 || D$1(t2, t2.next, e2) < 0;
|
|
14927
15373
|
}
|
|
14928
|
-
function
|
|
14929
|
-
var r2 = t2,
|
|
15374
|
+
function hl(t2, e2) {
|
|
15375
|
+
var r2 = t2, n2 = false, i2 = (t2.x + e2.x) / 2, s2 = (t2.y + e2.y) / 2;
|
|
14930
15376
|
do
|
|
14931
|
-
r2.y > s2 != r2.next.y > s2 && r2.next.y !== r2.y &&
|
|
15377
|
+
r2.y > s2 != r2.next.y > s2 && r2.next.y !== r2.y && i2 < (r2.next.x - r2.x) * (s2 - r2.y) / (r2.next.y - r2.y) + r2.x && (n2 = !n2), r2 = r2.next;
|
|
14932
15378
|
while (r2 !== t2);
|
|
14933
|
-
return
|
|
15379
|
+
return n2;
|
|
14934
15380
|
}
|
|
14935
|
-
function
|
|
14936
|
-
var r2 = new
|
|
14937
|
-
return t2.next = e2, e2.prev = t2, r2.next =
|
|
15381
|
+
function Ui(t2, e2) {
|
|
15382
|
+
var r2 = new tn(t2.i, t2.x, t2.y), n2 = new tn(e2.i, e2.x, e2.y), i2 = t2.next, s2 = e2.prev;
|
|
15383
|
+
return t2.next = e2, e2.prev = t2, r2.next = i2, i2.prev = r2, n2.next = r2, r2.prev = n2, s2.next = n2, n2.prev = s2, n2;
|
|
14938
15384
|
}
|
|
14939
|
-
function
|
|
14940
|
-
var
|
|
14941
|
-
return
|
|
15385
|
+
function ti(t2, e2, r2, n2) {
|
|
15386
|
+
var i2 = new tn(t2, e2, r2);
|
|
15387
|
+
return n2 ? (i2.next = n2.next, i2.prev = n2, n2.next.prev = i2, n2.next = i2) : (i2.prev = i2, i2.next = i2), i2;
|
|
14942
15388
|
}
|
|
14943
|
-
function
|
|
15389
|
+
function ft(t2) {
|
|
14944
15390
|
t2.next.prev = t2.prev, t2.prev.next = t2.next, t2.prevZ && (t2.prevZ.nextZ = t2.nextZ), t2.nextZ && (t2.nextZ.prevZ = t2.prevZ);
|
|
14945
15391
|
}
|
|
14946
|
-
function
|
|
15392
|
+
function tn(t2, e2, r2) {
|
|
14947
15393
|
this.i = t2, this.x = e2, this.y = r2, this.prev = null, this.next = null, this.z = 0, this.prevZ = null, this.nextZ = null, this.steiner = false;
|
|
14948
15394
|
}
|
|
14949
|
-
|
|
14950
|
-
var
|
|
14951
|
-
if (
|
|
15395
|
+
Qt.deviation = function(t2, e2, r2, n2) {
|
|
15396
|
+
var i2 = e2 && e2.length, s2 = i2 ? e2[0] * r2 : t2.length, o2 = Math.abs(rn(t2, 0, s2, r2));
|
|
15397
|
+
if (i2)
|
|
14952
15398
|
for (var l2 = 0, a2 = e2.length; l2 < a2; l2++) {
|
|
14953
|
-
var
|
|
14954
|
-
o2 -= Math.abs(
|
|
15399
|
+
var c2 = e2[l2] * r2, f3 = l2 < a2 - 1 ? e2[l2 + 1] * r2 : t2.length;
|
|
15400
|
+
o2 -= Math.abs(rn(t2, c2, f3, r2));
|
|
14955
15401
|
}
|
|
14956
|
-
var
|
|
14957
|
-
for (l2 = 0; l2 <
|
|
14958
|
-
var d2 =
|
|
14959
|
-
|
|
15402
|
+
var u2 = 0;
|
|
15403
|
+
for (l2 = 0; l2 < n2.length; l2 += 3) {
|
|
15404
|
+
var d2 = n2[l2] * r2, h2 = n2[l2 + 1] * r2, p2 = n2[l2 + 2] * r2;
|
|
15405
|
+
u2 += Math.abs(
|
|
14960
15406
|
(t2[d2] - t2[p2]) * (t2[h2 + 1] - t2[d2 + 1]) - (t2[d2] - t2[h2]) * (t2[p2 + 1] - t2[d2 + 1])
|
|
14961
15407
|
);
|
|
14962
15408
|
}
|
|
14963
|
-
return o2 === 0 &&
|
|
15409
|
+
return o2 === 0 && u2 === 0 ? 0 : Math.abs((u2 - o2) / o2);
|
|
14964
15410
|
};
|
|
14965
|
-
function
|
|
14966
|
-
for (var
|
|
14967
|
-
|
|
14968
|
-
return
|
|
15411
|
+
function rn(t2, e2, r2, n2) {
|
|
15412
|
+
for (var i2 = 0, s2 = e2, o2 = r2 - n2; s2 < r2; s2 += n2)
|
|
15413
|
+
i2 += (t2[o2] - t2[s2]) * (t2[s2 + 1] + t2[o2 + 1]), o2 = s2;
|
|
15414
|
+
return i2;
|
|
14969
15415
|
}
|
|
14970
|
-
|
|
14971
|
-
for (var e2 = t2[0][0].length, r2 = { vertices: [], holes: [], dimensions: e2 },
|
|
14972
|
-
for (var s2 = 0; s2 < t2[
|
|
14973
|
-
for (var o2 = 0; o2 < e2; o2++)
|
|
14974
|
-
|
|
14975
|
-
n2 > 0 && (i2 += t2[n2 - 1].length, r2.holes.push(i2));
|
|
15416
|
+
Qt.flatten = function(t2) {
|
|
15417
|
+
for (var e2 = t2[0][0].length, r2 = { vertices: [], holes: [], dimensions: e2 }, n2 = 0, i2 = 0; i2 < t2.length; i2++) {
|
|
15418
|
+
for (var s2 = 0; s2 < t2[i2].length; s2++)
|
|
15419
|
+
for (var o2 = 0; o2 < e2; o2++) r2.vertices.push(t2[i2][s2][o2]);
|
|
15420
|
+
i2 > 0 && (n2 += t2[i2 - 1].length, r2.holes.push(n2));
|
|
14976
15421
|
}
|
|
14977
15422
|
return r2;
|
|
14978
15423
|
};
|
|
14979
|
-
var
|
|
14980
|
-
const
|
|
14981
|
-
class
|
|
15424
|
+
var gl = En.exports;
|
|
15425
|
+
const ri = /* @__PURE__ */ Qo(gl), ml = ["info", "warnings", "errors"];
|
|
15426
|
+
class yl extends tt$1 {
|
|
14982
15427
|
error(...e2) {
|
|
14983
15428
|
this.levels.includes("errors") && (e2.length > 0 && (e2[0] = "Internal error: " + e2[0]), console.error(...e2));
|
|
14984
15429
|
}
|
|
14985
15430
|
}
|
|
14986
|
-
let b$4 = new
|
|
14987
|
-
const
|
|
14988
|
-
const
|
|
14989
|
-
const
|
|
14990
|
-
const
|
|
14991
|
-
const
|
|
14992
|
-
function
|
|
15431
|
+
let b$4 = new yl(ml);
|
|
15432
|
+
const Ye = "material:color";
|
|
15433
|
+
const Xe = "material:standard";
|
|
15434
|
+
const rr = "material:embedded";
|
|
15435
|
+
const Pe = "material:basic";
|
|
15436
|
+
const ji = "default", Hi = [1, 1, 1], Il = [1, 1, 1], vl = 1, Ji = 1, te = [...Hi, Ji];
|
|
15437
|
+
function _i(t2, e2) {
|
|
14993
15438
|
return Number.isFinite(t2) ? t2 < 0 || t2 > 1 ? (b$4.warn(`Value out of range (0 to 1) in color literal: '${e2}'.`), false) : true : (b$4.warn(`Invalid float value in color literal: '${e2}'.`), false);
|
|
14994
15439
|
}
|
|
14995
|
-
function
|
|
15440
|
+
function bl(t2, e2) {
|
|
14996
15441
|
return Number.isInteger(t2) ? t2 < 0 || t2 > 255 ? (b$4.warn(`Value out of range (0 to 255) in color literal: '${e2}'.`), false) : true : (b$4.warn(`Invalid byte value in color literal: '${e2}'.`), false);
|
|
14997
15442
|
}
|
|
14998
|
-
function
|
|
15443
|
+
function zi(t2) {
|
|
14999
15444
|
if (t2.length < 3 || t2.length > 4)
|
|
15000
15445
|
return b$4.warn(`Invalid number of components in color literal: '${t2}'.`), te;
|
|
15001
15446
|
let e2 = t2.toString(), r2 = [0, 0, 0, 0];
|
|
15002
|
-
for (let
|
|
15003
|
-
let
|
|
15004
|
-
if (!
|
|
15447
|
+
for (let n2 = 0; n2 < t2.length; n2++) {
|
|
15448
|
+
let i2 = t2[n2];
|
|
15449
|
+
if (!_i(i2, e2))
|
|
15005
15450
|
return te;
|
|
15006
|
-
r2[
|
|
15451
|
+
r2[n2] = i2;
|
|
15007
15452
|
}
|
|
15008
15453
|
return t2.length === 3 && (r2[3] = te[3]), r2;
|
|
15009
15454
|
}
|
|
15010
|
-
function
|
|
15455
|
+
function Yi(t2) {
|
|
15011
15456
|
let e2 = t2.substring(1), r2 = parseInt(e2, 16);
|
|
15012
15457
|
if (isNaN(r2))
|
|
15013
15458
|
return b$4.warn(`Invalid hexadecimal color literal: '${t2}'.`), te;
|
|
15014
|
-
let
|
|
15459
|
+
let n2, i2, s2, o2;
|
|
15015
15460
|
if (e2.length === 3 ? r2 = r2 << 4 | 15 : e2.length === 6 && (r2 = r2 << 8 | 255), e2.length === 3 || e2.length === 4)
|
|
15016
|
-
|
|
15461
|
+
n2 = (r2 >> 12 & 15) / 15, i2 = (r2 >> 8 & 15) / 15, s2 = (r2 >> 4 & 15) / 15, o2 = (r2 & 15) / 15;
|
|
15017
15462
|
else if (e2.length === 6 || e2.length === 8)
|
|
15018
|
-
|
|
15463
|
+
n2 = (r2 >> 24 & 255) / 255, i2 = (r2 >> 16 & 255) / 255, s2 = (r2 >> 8 & 255) / 255, o2 = (r2 & 255) / 255;
|
|
15019
15464
|
else
|
|
15020
15465
|
return b$4.warn(`Invalid hexademical color literal length: '${t2}'.`), te;
|
|
15021
|
-
return [
|
|
15466
|
+
return [n2, i2, s2, o2];
|
|
15022
15467
|
}
|
|
15023
|
-
function
|
|
15468
|
+
function Ht(t2, e2) {
|
|
15024
15469
|
if (!t2.endsWith(")"))
|
|
15025
15470
|
return b$4.warn(`Missing closing parenthesis: '${t2}'.`), te;
|
|
15026
|
-
let r2 = e2 ? 5 : 4,
|
|
15027
|
-
if (
|
|
15471
|
+
let r2 = e2 ? 5 : 4, n2 = t2.substring(r2, t2.length - 1).split(",");
|
|
15472
|
+
if (n2.length < 3 || n2.length > 4 || n2.length === 3 && e2 || n2.length === 4 && !e2)
|
|
15028
15473
|
return b$4.warn(`Invalid number of components in color literal: '${t2}'.`), te;
|
|
15029
|
-
let
|
|
15474
|
+
let i2 = [0, 0, 0, 0];
|
|
15030
15475
|
for (let s2 = 0; s2 < 3; s2++) {
|
|
15031
|
-
let o2 =
|
|
15032
|
-
if (!
|
|
15476
|
+
let o2 = n2[s2], l2 = parseFloat(o2);
|
|
15477
|
+
if (!bl(l2, t2))
|
|
15033
15478
|
return te;
|
|
15034
|
-
|
|
15479
|
+
i2[s2] = l2 / 255;
|
|
15035
15480
|
}
|
|
15036
|
-
if (
|
|
15037
|
-
let s2 = parseFloat(
|
|
15038
|
-
if (!
|
|
15481
|
+
if (n2.length === 4) {
|
|
15482
|
+
let s2 = parseFloat(n2[3]);
|
|
15483
|
+
if (!_i(s2, t2))
|
|
15039
15484
|
return te;
|
|
15040
|
-
|
|
15485
|
+
i2[3] = s2;
|
|
15041
15486
|
} else
|
|
15042
|
-
|
|
15043
|
-
return
|
|
15487
|
+
i2[3] = te[3];
|
|
15488
|
+
return i2;
|
|
15044
15489
|
}
|
|
15045
|
-
function
|
|
15046
|
-
name: t2 =
|
|
15047
|
-
color: e2 =
|
|
15048
|
-
specularColor: r2 =
|
|
15049
|
-
specularCoefficient:
|
|
15050
|
-
opacity:
|
|
15490
|
+
function H$4({
|
|
15491
|
+
name: t2 = ji,
|
|
15492
|
+
color: e2 = Hi,
|
|
15493
|
+
specularColor: r2 = Il,
|
|
15494
|
+
specularCoefficient: n2 = vl,
|
|
15495
|
+
opacity: i2 = Ji,
|
|
15051
15496
|
reference: s2
|
|
15052
15497
|
} = {}) {
|
|
15053
|
-
return s2 ? { name: t2, reference: s2 } : { name: t2, color: [...e2], specularColor: [...r2], specularCoefficient:
|
|
15498
|
+
return s2 ? { name: t2, reference: s2 } : { name: t2, color: [...e2], specularColor: [...r2], specularCoefficient: n2, opacity: i2 };
|
|
15054
15499
|
}
|
|
15055
|
-
function
|
|
15500
|
+
function pt(t2, e2 = {}) {
|
|
15056
15501
|
if (Array.isArray(t2)) {
|
|
15057
|
-
let [r2,
|
|
15058
|
-
return
|
|
15502
|
+
let [r2, n2, i2, s2] = zi(t2);
|
|
15503
|
+
return H$4({ name: t2.toString(), color: [r2, n2, i2], opacity: s2 });
|
|
15059
15504
|
} else if (typeof t2 == "string") {
|
|
15060
|
-
let r2,
|
|
15505
|
+
let r2, n2, i2, s2;
|
|
15061
15506
|
if (t2 === "")
|
|
15062
|
-
return b$4.warn("Empty string not a valid color value."),
|
|
15063
|
-
if (t2 ===
|
|
15064
|
-
return
|
|
15507
|
+
return b$4.warn("Empty string not a valid color value."), H$4({ name: t2 });
|
|
15508
|
+
if (t2 === ji)
|
|
15509
|
+
return H$4();
|
|
15065
15510
|
if (t2.charAt(0) === "#")
|
|
15066
|
-
[r2,
|
|
15511
|
+
[r2, n2, i2, s2] = Yi(t2);
|
|
15067
15512
|
else if (t2.startsWith("rgb("))
|
|
15068
|
-
[r2,
|
|
15513
|
+
[r2, n2, i2, s2] = Ht(t2, false);
|
|
15069
15514
|
else if (t2.startsWith("rgba("))
|
|
15070
|
-
[r2,
|
|
15515
|
+
[r2, n2, i2, s2] = Ht(t2, true);
|
|
15071
15516
|
else if (t2.startsWith("asm:")) {
|
|
15072
15517
|
let o2 = t2.substring(4, t2.length);
|
|
15073
|
-
return
|
|
15518
|
+
return H$4({ name: t2, reference: o2 });
|
|
15074
15519
|
} else if (t2.startsWith("data3d:")) {
|
|
15075
15520
|
let o2 = t2.substring(7, t2.length);
|
|
15076
|
-
return
|
|
15521
|
+
return H$4({ name: t2, reference: o2 });
|
|
15077
15522
|
} else {
|
|
15078
15523
|
let o2 = e2[t2];
|
|
15079
15524
|
if (typeof o2 > "u")
|
|
15080
|
-
return b$4.warn(`Unknown material: '${t2}'.`),
|
|
15525
|
+
return b$4.warn(`Unknown material: '${t2}'.`), H$4();
|
|
15081
15526
|
{
|
|
15082
15527
|
let l2;
|
|
15083
15528
|
switch (o2.type) {
|
|
15084
|
-
case
|
|
15085
|
-
l2 =
|
|
15529
|
+
case Ye:
|
|
15530
|
+
l2 = H$4({
|
|
15531
|
+
name: t2,
|
|
15532
|
+
color: o2.color,
|
|
15533
|
+
specularColor: o2.color
|
|
15534
|
+
});
|
|
15086
15535
|
break;
|
|
15087
|
-
case
|
|
15088
|
-
l2 =
|
|
15536
|
+
case Xe:
|
|
15537
|
+
l2 = H$4({ name: t2, reference: o2.reference });
|
|
15089
15538
|
break;
|
|
15090
|
-
case
|
|
15091
|
-
b$4.warn("Embedded material not supported in materials section."), l2 =
|
|
15539
|
+
case rr:
|
|
15540
|
+
b$4.warn("Embedded material not supported in materials section."), l2 = H$4();
|
|
15092
15541
|
break;
|
|
15093
|
-
case
|
|
15094
|
-
let a2 = t2,
|
|
15095
|
-
l2 =
|
|
15542
|
+
case Pe:
|
|
15543
|
+
let a2 = t2, c2 = o2.colorDiffuse, f3 = o2.colorSpecular, u2 = o2.specularCoefficient, d2 = o2.opacity;
|
|
15544
|
+
l2 = H$4({ name: a2, color: c2, specularColor: f3, specularCoefficient: u2, opacity: d2 });
|
|
15096
15545
|
break;
|
|
15097
15546
|
default:
|
|
15098
|
-
b$4.warn(`Unknown material type ${o2.type}.`), l2 =
|
|
15547
|
+
b$4.warn(`Unknown material type ${o2.type}.`), l2 = H$4();
|
|
15099
15548
|
break;
|
|
15100
15549
|
}
|
|
15101
15550
|
return l2;
|
|
15102
15551
|
}
|
|
15103
15552
|
}
|
|
15104
|
-
return
|
|
15553
|
+
return H$4({ name: t2, color: [r2, n2, i2], opacity: s2 });
|
|
15105
15554
|
} else
|
|
15106
|
-
return b$4.warn(`Material can only be an array or a string: '${t2}'.`),
|
|
15555
|
+
return b$4.warn(`Material can only be an array or a string: '${t2}'.`), H$4();
|
|
15107
15556
|
}
|
|
15108
15557
|
const ue = "default";
|
|
15109
|
-
function
|
|
15110
|
-
return new Array(e2 - t2).fill(void 0).map((r2,
|
|
15558
|
+
function it(t2, e2) {
|
|
15559
|
+
return new Array(e2 - t2).fill(void 0).map((r2, n2) => t2 + n2);
|
|
15111
15560
|
}
|
|
15112
|
-
function
|
|
15113
|
-
let r2 = new Array(3 * e2.length),
|
|
15114
|
-
for (let
|
|
15115
|
-
let s2 = 3 * e2[
|
|
15116
|
-
r2[
|
|
15561
|
+
function wl(t2, e2) {
|
|
15562
|
+
let r2 = new Array(3 * e2.length), n2 = 0;
|
|
15563
|
+
for (let i2 = 0; i2 < e2.length; i2++) {
|
|
15564
|
+
let s2 = 3 * e2[i2];
|
|
15565
|
+
r2[n2++] = t2[s2], r2[n2++] = t2[s2 + 1], r2[n2++] = t2[s2 + 2];
|
|
15117
15566
|
}
|
|
15118
15567
|
return r2;
|
|
15119
15568
|
}
|
|
15120
|
-
function
|
|
15121
|
-
let
|
|
15569
|
+
function ni(t2, e2, r2) {
|
|
15570
|
+
let n2 = 3 * e2, i2 = new Array(n2 * r2.length), s2 = 0;
|
|
15122
15571
|
for (let o2 = 0; o2 < r2.length; o2++) {
|
|
15123
|
-
let l2 =
|
|
15124
|
-
for (let a2 = 0; a2 <
|
|
15125
|
-
|
|
15572
|
+
let l2 = n2 * r2[o2];
|
|
15573
|
+
for (let a2 = 0; a2 < n2; a2++)
|
|
15574
|
+
i2[s2++] = t2[l2++];
|
|
15126
15575
|
}
|
|
15127
|
-
return
|
|
15576
|
+
return i2;
|
|
15128
15577
|
}
|
|
15129
|
-
function
|
|
15578
|
+
function Sl(t2) {
|
|
15130
15579
|
let e2 = t2.surfaces ?? { [ue]: "all" }, r2 = t2.materials ?? { [ue]: "default" };
|
|
15131
15580
|
if (e2 && Object.keys(e2).length === 0)
|
|
15132
15581
|
b$4.warn("Empty 'surfaces' field not allowed.");
|
|
@@ -15137,173 +15586,183 @@ function fl(t2) {
|
|
|
15137
15586
|
else if (r2[ue])
|
|
15138
15587
|
Object.keys(r2).length > 1 && b$4.warn("Extraneous material assignments ignored.");
|
|
15139
15588
|
else {
|
|
15140
|
-
let
|
|
15141
|
-
for (let s2 of i2)
|
|
15142
|
-
r2[s2] || b$4.warn(`Surface '${s2}' not assigned a material, using default.`);
|
|
15143
|
-
let n2 = Object.keys(r2);
|
|
15589
|
+
let n2 = Object.keys(e2);
|
|
15144
15590
|
for (let s2 of n2)
|
|
15591
|
+
r2[s2] || b$4.warn(`Surface '${s2}' not assigned a material, using default.`);
|
|
15592
|
+
let i2 = Object.keys(r2);
|
|
15593
|
+
for (let s2 of i2)
|
|
15145
15594
|
e2[s2] || b$4.warn(`Surface '${s2}' not found.`);
|
|
15146
15595
|
}
|
|
15147
15596
|
return { surfaces: e2, materials: r2 };
|
|
15148
15597
|
}
|
|
15149
|
-
function
|
|
15150
|
-
let
|
|
15598
|
+
function Tl(t2, e2, r2) {
|
|
15599
|
+
let n2 = [], i2 = e2.faces, { surfaces: s2, materials: o2 } = Sl(t2);
|
|
15151
15600
|
for (let [l2, a2] of Object.entries(s2)) {
|
|
15152
15601
|
if (a2 !== "all" && !Array.isArray(a2) && typeof a2 != "object") {
|
|
15153
15602
|
b$4.warn(`Unknown face indices type, skipping surface '${l2}'.`);
|
|
15154
15603
|
continue;
|
|
15155
15604
|
}
|
|
15156
|
-
let
|
|
15605
|
+
let c2 = [];
|
|
15157
15606
|
if (t2.type === "geometry:mesh")
|
|
15158
15607
|
if (a2 === "all") {
|
|
15159
15608
|
let y2 = e2.indices.length / 3;
|
|
15160
|
-
|
|
15609
|
+
c2.push(...it(0, y2));
|
|
15161
15610
|
} else if (Array.isArray(a2))
|
|
15162
|
-
|
|
15611
|
+
c2.push(...a2);
|
|
15163
15612
|
else {
|
|
15164
|
-
let { start: y2, end:
|
|
15165
|
-
|
|
15613
|
+
let { start: y2, end: E3 } = a2;
|
|
15614
|
+
c2.push(...it(y2, E3));
|
|
15166
15615
|
}
|
|
15167
15616
|
else if (a2 === "all")
|
|
15168
|
-
for (let y2 of
|
|
15169
|
-
let { index:
|
|
15170
|
-
|
|
15617
|
+
for (let y2 of i2) {
|
|
15618
|
+
let { index: E3, count: I2 } = y2;
|
|
15619
|
+
c2.push(...it(E3, E3 + I2));
|
|
15171
15620
|
}
|
|
15172
15621
|
else if (Array.isArray(a2))
|
|
15173
15622
|
for (let y2 = 0; y2 < a2.length; y2++) {
|
|
15174
|
-
let
|
|
15175
|
-
|
|
15623
|
+
let E3 = a2[y2], I2 = i2[E3], { index: v2, count: w2 } = I2;
|
|
15624
|
+
c2.push(...it(v2, v2 + w2));
|
|
15176
15625
|
}
|
|
15177
15626
|
else {
|
|
15178
|
-
let { start: y2, end:
|
|
15179
|
-
for (let
|
|
15180
|
-
let v2 =
|
|
15181
|
-
|
|
15627
|
+
let { start: y2, end: E3 } = a2;
|
|
15628
|
+
for (let I2 = y2; I2 < E3; I2++) {
|
|
15629
|
+
let v2 = i2[I2], { index: w2, count: x2 } = v2;
|
|
15630
|
+
c2.push(...it(w2, w2 + x2));
|
|
15182
15631
|
}
|
|
15183
15632
|
}
|
|
15184
|
-
let { vertices: f3, indices:
|
|
15633
|
+
let { vertices: f3, indices: u2, normals: d2, uvs: h2 } = e2, p2;
|
|
15185
15634
|
o2[ue] ? p2 = o2[ue] : p2 = o2[l2] ?? "default";
|
|
15186
|
-
let g2 =
|
|
15635
|
+
let g2 = pt(p2, r2), m2 = {
|
|
15187
15636
|
name: l2,
|
|
15188
15637
|
vertices: f3,
|
|
15189
|
-
indices:
|
|
15638
|
+
indices: wl(u2, c2),
|
|
15190
15639
|
material: g2
|
|
15191
15640
|
};
|
|
15192
|
-
d2 && (m2.normals =
|
|
15641
|
+
d2 && (m2.normals = ni(d2, 3, c2)), h2 && (m2.uvs = ni(h2, 2, c2)), n2.push(m2);
|
|
15193
15642
|
}
|
|
15194
|
-
return
|
|
15643
|
+
return n2;
|
|
15195
15644
|
}
|
|
15196
|
-
function
|
|
15197
|
-
let
|
|
15198
|
-
for (let
|
|
15199
|
-
let s2 = t2 +
|
|
15200
|
-
|
|
15645
|
+
function Rl(t2, e2, r2) {
|
|
15646
|
+
let n2 = [];
|
|
15647
|
+
for (let i2 = 0; i2 < r2; i2++) {
|
|
15648
|
+
let s2 = t2 + i2 * e2;
|
|
15649
|
+
n2.push(s2);
|
|
15201
15650
|
}
|
|
15202
|
-
return
|
|
15651
|
+
return n2;
|
|
15203
15652
|
}
|
|
15204
|
-
function
|
|
15205
|
-
let
|
|
15206
|
-
for (let
|
|
15207
|
-
let s2 = t2[0] +
|
|
15208
|
-
|
|
15653
|
+
function Pl(t2, e2, r2) {
|
|
15654
|
+
let n2 = [];
|
|
15655
|
+
for (let i2 = 0; i2 < r2; i2++) {
|
|
15656
|
+
let s2 = t2[0] + i2 * e2[0], o2 = t2[1] + i2 * e2[1], l2 = t2[2] + i2 * e2[2];
|
|
15657
|
+
n2.push([s2, o2, l2]);
|
|
15209
15658
|
}
|
|
15210
|
-
return
|
|
15659
|
+
return n2;
|
|
15211
15660
|
}
|
|
15212
|
-
function
|
|
15661
|
+
function Nl(t2) {
|
|
15213
15662
|
if (Array.isArray(t2))
|
|
15214
15663
|
return [t2];
|
|
15215
15664
|
if (t2.type === "vector3:list")
|
|
15216
15665
|
return t2.list;
|
|
15217
15666
|
if (t2.type === "vector3:range") {
|
|
15218
|
-
let { start: e2, step: r2, count:
|
|
15219
|
-
return
|
|
15667
|
+
let { start: e2, step: r2, count: n2 } = t2.range;
|
|
15668
|
+
return Pl(e2, r2, n2);
|
|
15220
15669
|
} else
|
|
15221
15670
|
return b$4.warn(`Unknown position type: ${t2}`), [[0, 0, 0]];
|
|
15222
15671
|
}
|
|
15223
|
-
function
|
|
15672
|
+
function Al(t2) {
|
|
15224
15673
|
if (typeof t2 == "number")
|
|
15225
15674
|
return [t2];
|
|
15226
15675
|
if (t2.type === "number:list")
|
|
15227
15676
|
return t2.list;
|
|
15228
15677
|
if (t2.type === "number:range") {
|
|
15229
|
-
let { start: e2, step: r2, count:
|
|
15230
|
-
return
|
|
15678
|
+
let { start: e2, step: r2, count: n2 } = t2.range;
|
|
15679
|
+
return Rl(e2, r2, n2);
|
|
15231
15680
|
} else
|
|
15232
15681
|
return b$4.warn(`Unknown rotation type: ${t2}`), [0];
|
|
15233
15682
|
}
|
|
15234
|
-
function
|
|
15235
|
-
let r2 =
|
|
15236
|
-
for (let o2 = 0; o2 <
|
|
15237
|
-
let l2 = r2[Math.min(o2, r2.length - 1)], a2 =
|
|
15683
|
+
function Xi(t2, e2) {
|
|
15684
|
+
let r2 = Nl(t2), n2 = Al(e2), i2 = Math.max(r2.length, n2.length), s2 = [];
|
|
15685
|
+
for (let o2 = 0; o2 < i2; o2++) {
|
|
15686
|
+
let l2 = r2[Math.min(o2, r2.length - 1)], a2 = n2[Math.min(o2, n2.length - 1)];
|
|
15238
15687
|
s2.push({ position: l2, rotation: a2 });
|
|
15239
15688
|
}
|
|
15240
15689
|
return s2;
|
|
15241
15690
|
}
|
|
15242
|
-
function
|
|
15691
|
+
function ii(t2, e2, r2) {
|
|
15243
15692
|
return Math.abs(t2[0] - e2[0]) < r2 && Math.abs(t2[1] - e2[1]) < r2;
|
|
15244
15693
|
}
|
|
15245
|
-
function
|
|
15694
|
+
function Qi(t2) {
|
|
15246
15695
|
let e2 = 0;
|
|
15247
15696
|
for (let r2 = 0; r2 < t2.length; r2++) {
|
|
15248
|
-
let
|
|
15697
|
+
let n2 = r2, i2 = r2 < t2.length - 1 ? r2 + 1 : 0, s2 = t2[n2], o2 = t2[i2];
|
|
15249
15698
|
e2 += s2[0] * o2[1] - o2[0] * s2[1];
|
|
15250
15699
|
}
|
|
15251
15700
|
return e2 * 0.5;
|
|
15252
15701
|
}
|
|
15253
|
-
function
|
|
15254
|
-
return
|
|
15702
|
+
function ar(t2) {
|
|
15703
|
+
return Qi(t2) > 0;
|
|
15255
15704
|
}
|
|
15256
|
-
function
|
|
15257
|
-
let r2 = t2 * Math.PI / 180,
|
|
15258
|
-
return
|
|
15705
|
+
function ts(t2 = 0, e2 = [0, 1, 0]) {
|
|
15706
|
+
let r2 = t2 * Math.PI / 180, n2 = at();
|
|
15707
|
+
return ki(n2, e2, r2), n2;
|
|
15259
15708
|
}
|
|
15260
|
-
function
|
|
15709
|
+
function cr(t2, e2, r2) {
|
|
15261
15710
|
if (t2[0] !== 0 || t2[1] !== 0 || t2[2] !== 0 || e2 !== 0) {
|
|
15262
|
-
let
|
|
15263
|
-
return
|
|
15711
|
+
let n2 = We(), i2 = Ie(t2[0], t2[1], t2[2]), s2 = ts(e2, r2);
|
|
15712
|
+
return Go(n2, s2, i2), n2;
|
|
15264
15713
|
} else
|
|
15265
|
-
return
|
|
15714
|
+
return We();
|
|
15266
15715
|
}
|
|
15267
|
-
function
|
|
15716
|
+
function nn(t2, e2) {
|
|
15268
15717
|
let r2 = M$4();
|
|
15269
|
-
for (let
|
|
15270
|
-
r2[0] = t2[
|
|
15271
|
-
}
|
|
15272
|
-
function
|
|
15273
|
-
|
|
15274
|
-
|
|
15275
|
-
|
|
15276
|
-
|
|
15718
|
+
for (let n2 = 0; n2 < t2.length; n2 += 3)
|
|
15719
|
+
r2[0] = t2[n2], r2[1] = t2[n2 + 1], r2[2] = t2[n2 + 2], yn(r2, r2, e2), t2[n2] = r2[0], t2[n2 + 1] = r2[1], t2[n2 + 2] = r2[2];
|
|
15720
|
+
}
|
|
15721
|
+
function ns({
|
|
15722
|
+
position: t2 = [0, 0, 0],
|
|
15723
|
+
rotation: e2 = 0,
|
|
15724
|
+
rotationAxis: r2 = [0, 1, 0],
|
|
15725
|
+
name: n2,
|
|
15726
|
+
vertices: i2,
|
|
15727
|
+
indices: s2,
|
|
15728
|
+
normals: o2,
|
|
15729
|
+
uvs: l2,
|
|
15730
|
+
material: a2
|
|
15731
|
+
}) {
|
|
15732
|
+
let c2 = Xi(t2, e2), f3 = [], u2 = [], d2 = [], h2 = [], p2 = We();
|
|
15733
|
+
for (let m2 = 0; m2 < c2.length; m2++) {
|
|
15734
|
+
let y2 = c2[m2], { position: E3, rotation: I2 } = y2, v2 = cr(E3, I2, r2), w2 = i2.slice();
|
|
15735
|
+
nn(w2, v2);
|
|
15277
15736
|
let x2 = f3.length / 3;
|
|
15278
|
-
if (f3.push(...
|
|
15279
|
-
|
|
15280
|
-
let
|
|
15281
|
-
|
|
15737
|
+
if (f3.push(...w2), u2.push(...s2.map((S2) => x2 + S2)), Array.isArray(o2)) {
|
|
15738
|
+
Do(p2, v2), p2[12] = 0, p2[13] = 0, p2[14] = 0, ko(p2, p2), Vo(p2, p2);
|
|
15739
|
+
let S2 = o2.slice();
|
|
15740
|
+
nn(S2, p2), d2.push(...S2);
|
|
15282
15741
|
}
|
|
15283
15742
|
Array.isArray(l2) && h2.push(...l2);
|
|
15284
15743
|
}
|
|
15285
15744
|
let g2 = {
|
|
15286
|
-
name:
|
|
15745
|
+
name: n2,
|
|
15287
15746
|
vertices: f3,
|
|
15288
|
-
indices:
|
|
15747
|
+
indices: u2,
|
|
15289
15748
|
material: a2
|
|
15290
15749
|
};
|
|
15291
15750
|
return Array.isArray(o2) && (g2.normals = d2), Array.isArray(l2) && (g2.uvs = h2), g2;
|
|
15292
15751
|
}
|
|
15293
|
-
function
|
|
15752
|
+
function $l(t2) {
|
|
15294
15753
|
const e2 = 1 / Math.sqrt(2);
|
|
15295
|
-
let r2 = [0, 0, 0],
|
|
15296
|
-
|
|
15297
|
-
let s2 = Math.abs(
|
|
15298
|
-
return de(r2, s2, t2), de(
|
|
15299
|
-
}
|
|
15300
|
-
function
|
|
15301
|
-
let
|
|
15302
|
-
[-
|
|
15303
|
-
[
|
|
15304
|
-
[
|
|
15305
|
-
[-
|
|
15306
|
-
], { u: s2, v: o2, n: l2 } =
|
|
15754
|
+
let r2 = [0, 0, 0], n2 = [0, 0, 0], i2 = [0, 0, 0];
|
|
15755
|
+
ne(i2, t2);
|
|
15756
|
+
let s2 = Math.abs(i2[1]) < e2 ? Ie(0, 1, 0) : Ie(1, 0, 0);
|
|
15757
|
+
return de(r2, s2, t2), de(n2, t2, r2), ne(r2, r2), ne(n2, n2), { u: r2, v: n2, n: i2 };
|
|
15758
|
+
}
|
|
15759
|
+
function sn(t2, e2, r2) {
|
|
15760
|
+
let n2 = 0.5 * r2, i2 = [
|
|
15761
|
+
[-n2, -n2, 0],
|
|
15762
|
+
[n2, -n2, 0],
|
|
15763
|
+
[n2, n2, 0],
|
|
15764
|
+
[-n2, n2, 0]
|
|
15765
|
+
], { u: s2, v: o2, n: l2 } = $l(e2), a2 = t2, c2 = Bo(
|
|
15307
15766
|
s2[0],
|
|
15308
15767
|
s2[1],
|
|
15309
15768
|
s2[2],
|
|
@@ -15321,45 +15780,41 @@ function kr(t2, e2, r2) {
|
|
|
15321
15780
|
a2[2],
|
|
15322
15781
|
1
|
|
15323
15782
|
);
|
|
15324
|
-
for (let f3 of
|
|
15325
|
-
|
|
15326
|
-
return
|
|
15783
|
+
for (let f3 of i2)
|
|
15784
|
+
yn(f3, f3, c2);
|
|
15785
|
+
return i2;
|
|
15327
15786
|
}
|
|
15328
|
-
function
|
|
15787
|
+
function Ur(t2, e2, r2) {
|
|
15329
15788
|
e2[0] = t2[r2 + 0], e2[1] = t2[r2 + 1], e2[2] = t2[r2 + 2];
|
|
15330
15789
|
}
|
|
15331
|
-
function
|
|
15332
|
-
let r2 = [],
|
|
15333
|
-
for (let
|
|
15334
|
-
let d2 = o2[
|
|
15335
|
-
|
|
15336
|
-
let g2 = [
|
|
15337
|
-
|
|
15338
|
-
new me.Vertex(u2, {}),
|
|
15339
|
-
new me.Vertex(f3, {})
|
|
15340
|
-
];
|
|
15341
|
-
r2.push(new me.Polygon(g2, { id: i2, name: n2, material: l2 }));
|
|
15790
|
+
function Wl(t2, e2) {
|
|
15791
|
+
let r2 = [], n2 = t2.nextId++, { name: i2, vertices: s2, indices: o2, material: l2 } = e2, a2 = [0, 0, 0], c2 = [0, 0, 0], f3 = [0, 0, 0];
|
|
15792
|
+
for (let u2 = 0; u2 < o2.length; u2 += 3) {
|
|
15793
|
+
let d2 = o2[u2], h2 = o2[u2 + 1], p2 = o2[u2 + 2];
|
|
15794
|
+
Ur(s2, a2, 3 * d2), Ur(s2, c2, 3 * h2), Ur(s2, f3, 3 * p2);
|
|
15795
|
+
let g2 = [new ye.Vertex(a2, {}), new ye.Vertex(c2, {}), new ye.Vertex(f3, {})];
|
|
15796
|
+
r2.push(new ye.Polygon(g2, { id: n2, name: i2, material: l2 }));
|
|
15342
15797
|
}
|
|
15343
15798
|
return r2;
|
|
15344
15799
|
}
|
|
15345
|
-
function
|
|
15346
|
-
let t2 = Math.random(), e2 = Math.random(), r2 = Math.random(),
|
|
15347
|
-
return
|
|
15800
|
+
function Ul() {
|
|
15801
|
+
let t2 = Math.random(), e2 = Math.random(), r2 = Math.random(), n2 = Math.round(255 * t2).toString(16).padStart(2, "0"), i2 = Math.round(255 * e2).toString(16).padStart(2, "0"), s2 = Math.round(255 * r2).toString(16).padStart(2, "0"), o2 = "#" + n2 + i2 + s2;
|
|
15802
|
+
return H$4({ name: o2, color: [t2, e2, r2], opacity: 1 });
|
|
15348
15803
|
}
|
|
15349
|
-
function
|
|
15350
|
-
let
|
|
15804
|
+
function jl(t2, e2, { precision: r2 = void 0 } = {}) {
|
|
15805
|
+
let n2 = [], i2 = [], s2 = {};
|
|
15351
15806
|
for (let o2 = 0; o2 < e2.length; o2++) {
|
|
15352
|
-
let l2 = 3 * e2[o2], a2 = t2[l2],
|
|
15353
|
-
r2 !== void 0 && (a2 = nt
|
|
15354
|
-
let
|
|
15355
|
-
d2 === void 0 && (d2 =
|
|
15807
|
+
let l2 = 3 * e2[o2], a2 = t2[l2], c2 = t2[l2 + 1], f3 = t2[l2 + 2];
|
|
15808
|
+
r2 !== void 0 && (a2 = nt(a2, r2), c2 = nt(c2, r2), f3 = nt(f3, r2));
|
|
15809
|
+
let u2 = a2 + "_" + c2 + "_" + f3, d2 = s2[u2];
|
|
15810
|
+
d2 === void 0 && (d2 = n2.push(a2, c2, f3) / 3 - 1, s2[u2] = d2), i2.push(d2);
|
|
15356
15811
|
}
|
|
15357
|
-
return { vertices:
|
|
15812
|
+
return { vertices: n2, indices: i2 };
|
|
15358
15813
|
}
|
|
15359
|
-
function
|
|
15360
|
-
let s2 = t2.nextId++, { position: o2, normal: l2 } = e2, a2 =
|
|
15361
|
-
|
|
15362
|
-
let
|
|
15814
|
+
function Hl(t2, e2, r2, n2, i2 = 100) {
|
|
15815
|
+
let s2 = t2.nextId++, { position: o2, normal: l2 } = e2, a2 = pt(r2, n2), c2 = [0, 0, 0], f3 = [0, 0, 0];
|
|
15816
|
+
ne(c2, l2), Ho(f3, o2, c2, i2);
|
|
15817
|
+
let u2 = sn(o2, c2, i2), d2 = sn(f3, c2, i2), h2 = u2.concat(d2), p2 = [
|
|
15363
15818
|
[0, 1, 2, 3],
|
|
15364
15819
|
[4, 5, 6, 7],
|
|
15365
15820
|
[0, 4, 5, 1],
|
|
@@ -15369,120 +15824,140 @@ function Ol(t2, e2, r2, i2, n2 = 100) {
|
|
|
15369
15824
|
], g2 = [];
|
|
15370
15825
|
for (let m2 of p2) {
|
|
15371
15826
|
let y2 = [];
|
|
15372
|
-
for (let
|
|
15373
|
-
y2.push(new
|
|
15374
|
-
let
|
|
15375
|
-
g2.push(
|
|
15827
|
+
for (let I2 of m2)
|
|
15828
|
+
y2.push(new ye.Vertex(h2[I2], {}));
|
|
15829
|
+
let E3 = new ye.Polygon(y2, { id: s2, name: "", material: a2 });
|
|
15830
|
+
g2.push(E3);
|
|
15376
15831
|
}
|
|
15377
|
-
return
|
|
15832
|
+
return ye.fromPolygons(g2);
|
|
15378
15833
|
}
|
|
15379
|
-
function
|
|
15834
|
+
function on(t2, e2) {
|
|
15380
15835
|
let r2 = [];
|
|
15381
|
-
for (let
|
|
15382
|
-
let
|
|
15383
|
-
r2.push(...
|
|
15836
|
+
for (let n2 of e2) {
|
|
15837
|
+
let i2 = Wl(t2, n2);
|
|
15838
|
+
r2.push(...i2);
|
|
15384
15839
|
}
|
|
15385
|
-
return
|
|
15840
|
+
return ye.fromPolygons(r2);
|
|
15386
15841
|
}
|
|
15387
|
-
function
|
|
15388
|
-
let
|
|
15389
|
-
for (let s2 = 0; s2 <
|
|
15390
|
-
let o2 =
|
|
15842
|
+
function is(t2, { debugMode: e2 = false, sharedVertices: r2 = true } = {}) {
|
|
15843
|
+
let n2 = {}, { polygons: i2 } = t2;
|
|
15844
|
+
for (let s2 = 0; s2 < i2.length; s2++) {
|
|
15845
|
+
let o2 = i2[s2], l2 = o2.vertices.length;
|
|
15391
15846
|
if (l2 < 3) {
|
|
15392
15847
|
b$4.warn(`Skipping CSG polygon with '${l2}' '${l2 === 1 ? "vertex" : "vertices"}.`);
|
|
15393
15848
|
continue;
|
|
15394
15849
|
}
|
|
15395
15850
|
let a2 = [];
|
|
15396
15851
|
for (let f3 = 0; f3 < l2; f3++) {
|
|
15397
|
-
let
|
|
15398
|
-
a2.push(
|
|
15852
|
+
let u2 = o2.vertices[f3];
|
|
15853
|
+
a2.push(u2.pos.x, u2.pos.y, u2.pos.z);
|
|
15399
15854
|
}
|
|
15400
|
-
let
|
|
15855
|
+
let c2;
|
|
15401
15856
|
if (l2 === 3)
|
|
15402
|
-
|
|
15857
|
+
c2 = [0, 1, 2];
|
|
15403
15858
|
else {
|
|
15404
|
-
|
|
15859
|
+
c2 = [];
|
|
15405
15860
|
for (let f3 = 1; f3 < l2 - 1; f3++)
|
|
15406
|
-
|
|
15861
|
+
c2.push(0, f3, f3 + 1);
|
|
15407
15862
|
}
|
|
15408
15863
|
if (e2) {
|
|
15409
|
-
let f3 =
|
|
15410
|
-
|
|
15864
|
+
let f3 = Ul();
|
|
15865
|
+
n2[s2] = { name: f3.name, vertices: a2, indices: c2, material: f3 };
|
|
15411
15866
|
} else {
|
|
15412
|
-
let { id: f3, name:
|
|
15867
|
+
let { id: f3, name: u2, material: d2 } = o2.shared, h2 = n2[f3];
|
|
15413
15868
|
if (!h2)
|
|
15414
|
-
|
|
15869
|
+
n2[f3] = { name: u2, vertices: a2, indices: c2, material: d2 };
|
|
15415
15870
|
else {
|
|
15416
15871
|
let p2 = h2.vertices.length / 3;
|
|
15417
|
-
h2.vertices.push(...a2), h2.indices.push(...
|
|
15872
|
+
h2.vertices.push(...a2), h2.indices.push(...c2.map((g2) => p2 + g2));
|
|
15418
15873
|
}
|
|
15419
15874
|
}
|
|
15420
15875
|
}
|
|
15421
15876
|
if (r2)
|
|
15422
|
-
for (let s2 of Object.values(
|
|
15423
|
-
let { vertices: o2, indices: l2 } = s2, a2 =
|
|
15877
|
+
for (let s2 of Object.values(n2)) {
|
|
15878
|
+
let { vertices: o2, indices: l2 } = s2, a2 = jl(o2, l2);
|
|
15424
15879
|
s2.vertices = a2.vertices, s2.indices = a2.indices;
|
|
15425
15880
|
}
|
|
15426
|
-
return Object.values(
|
|
15881
|
+
return Object.values(n2);
|
|
15427
15882
|
}
|
|
15428
|
-
function
|
|
15429
|
-
let
|
|
15430
|
-
if (t2.material ? t2.materials ? b$4.warn("Cannot use 'material' and 'materials' at the same time.") :
|
|
15431
|
-
if (
|
|
15432
|
-
let s2 =
|
|
15883
|
+
function Jl(t2, e2, r2, n2) {
|
|
15884
|
+
let i2;
|
|
15885
|
+
if (t2.material ? t2.materials ? b$4.warn("Cannot use 'material' and 'materials' at the same time.") : i2 = { [ue]: t2.material } : t2.materials && (Object.keys(t2.materials).length === 0 ? b$4.warn("Empty 'materials' field not allowed.") : i2 = t2.materials), i2)
|
|
15886
|
+
if (i2[ue]) {
|
|
15887
|
+
let s2 = i2[ue], o2 = pt(s2, r2);
|
|
15433
15888
|
for (let l2 of e2)
|
|
15434
15889
|
l2.material = o2;
|
|
15435
|
-
Object.keys(
|
|
15890
|
+
Object.keys(i2).length > 1 && b$4.warn(`Extraneous material assignments to '${n2}' ignored.`);
|
|
15436
15891
|
} else
|
|
15437
|
-
for (let [s2, o2] of Object.entries(
|
|
15892
|
+
for (let [s2, o2] of Object.entries(i2)) {
|
|
15438
15893
|
let l2 = e2.find((a2) => a2.name === s2);
|
|
15439
15894
|
if (l2) {
|
|
15440
|
-
let a2 =
|
|
15895
|
+
let a2 = pt(o2, r2);
|
|
15441
15896
|
l2.material = a2;
|
|
15442
15897
|
} else
|
|
15443
|
-
b$4.warn(`Surface '${s2}' not found in geometry '${
|
|
15898
|
+
b$4.warn(`Surface '${s2}' not found in geometry '${n2}', skipping material assignment.`);
|
|
15444
15899
|
}
|
|
15445
15900
|
}
|
|
15446
|
-
function
|
|
15447
|
-
let
|
|
15901
|
+
function ss(t2, e2, r2, n2) {
|
|
15902
|
+
let i2, s2, o2, l2, a2;
|
|
15448
15903
|
if (typeof t2 == "string") {
|
|
15449
|
-
if (
|
|
15450
|
-
return b$4.warn(`Geometry '${
|
|
15904
|
+
if (i2 = t2, a2 = e2[i2], !a2)
|
|
15905
|
+
return b$4.warn(`Geometry '${i2}' not found.`), [];
|
|
15451
15906
|
s2 = [0, 0, 0], o2 = 0, l2 = [0, 1, 0];
|
|
15452
15907
|
} else {
|
|
15453
|
-
let
|
|
15454
|
-
if (typeof
|
|
15455
|
-
if (
|
|
15456
|
-
return b$4.warn(`Geometry '${
|
|
15908
|
+
let u2 = t2;
|
|
15909
|
+
if (typeof u2.geometry == "string") {
|
|
15910
|
+
if (i2 = u2.geometry, a2 = e2[i2], !a2)
|
|
15911
|
+
return b$4.warn(`Geometry '${i2}' not found.`), [];
|
|
15457
15912
|
} else
|
|
15458
|
-
a2 =
|
|
15459
|
-
s2 =
|
|
15913
|
+
a2 = u2.geometry;
|
|
15914
|
+
s2 = u2.position ?? [0, 0, 0], o2 = u2.rotation ?? 0, l2 = u2.rotationAxis ?? [0, 1, 0];
|
|
15460
15915
|
}
|
|
15461
|
-
if (
|
|
15916
|
+
if (n2.indexOf(a2) > -1)
|
|
15462
15917
|
return b$4.warn(`Cycle detected while resolving geometry '${a2.id}'.`), [];
|
|
15463
|
-
let
|
|
15464
|
-
typeof t2 != "string" && t2.type !== "csg:clip" &&
|
|
15918
|
+
let c2 = ln(a2, e2, r2, n2);
|
|
15919
|
+
typeof t2 != "string" && t2.type !== "csg:clip" && Jl(t2, c2, r2, a2.id);
|
|
15465
15920
|
let f3 = [];
|
|
15466
|
-
for (let
|
|
15467
|
-
let { name: d2, vertices: h2, indices: p2, normals: g2, uvs: m2, material: y2 } =
|
|
15468
|
-
|
|
15921
|
+
for (let u2 of c2) {
|
|
15922
|
+
let { name: d2, vertices: h2, indices: p2, normals: g2, uvs: m2, material: y2 } = u2, E3 = ns({
|
|
15923
|
+
position: s2,
|
|
15924
|
+
rotation: o2,
|
|
15925
|
+
rotationAxis: l2,
|
|
15926
|
+
name: d2,
|
|
15927
|
+
vertices: h2,
|
|
15928
|
+
indices: p2,
|
|
15929
|
+
normals: g2,
|
|
15930
|
+
uvs: m2,
|
|
15931
|
+
material: y2
|
|
15932
|
+
});
|
|
15933
|
+
f3.push(E3);
|
|
15469
15934
|
}
|
|
15470
15935
|
return f3;
|
|
15471
15936
|
}
|
|
15472
|
-
function
|
|
15473
|
-
let s2 =
|
|
15937
|
+
function _l(t2, e2, r2, n2, i2) {
|
|
15938
|
+
let s2 = ss(
|
|
15939
|
+
e2,
|
|
15940
|
+
r2,
|
|
15941
|
+
n2,
|
|
15942
|
+
i2
|
|
15943
|
+
);
|
|
15474
15944
|
return [...t2, ...s2];
|
|
15475
15945
|
}
|
|
15476
|
-
function
|
|
15477
|
-
let { plane:
|
|
15946
|
+
function zl(t2, e2, r2, n2) {
|
|
15947
|
+
let { plane: i2, material: s2 } = r2, o2 = on(t2, e2);
|
|
15478
15948
|
{
|
|
15479
|
-
let a2 =
|
|
15949
|
+
let a2 = Hl(t2, i2, s2, n2);
|
|
15480
15950
|
o2.polygons.length > 0 && (o2 = o2.subtract(a2));
|
|
15481
15951
|
}
|
|
15482
|
-
return
|
|
15952
|
+
return is(o2, { debugMode: false });
|
|
15483
15953
|
}
|
|
15484
|
-
function
|
|
15485
|
-
let o2 =
|
|
15954
|
+
function Yl(t2, e2, r2, n2, i2, s2) {
|
|
15955
|
+
let o2 = ss(
|
|
15956
|
+
r2,
|
|
15957
|
+
n2,
|
|
15958
|
+
i2,
|
|
15959
|
+
s2
|
|
15960
|
+
), l2 = on(t2, e2), a2 = on(t2, o2), c2 = [];
|
|
15486
15961
|
if (l2.polygons.length && a2.polygons.length) {
|
|
15487
15962
|
switch (r2.type) {
|
|
15488
15963
|
case "csg:subtract":
|
|
@@ -15495,41 +15970,59 @@ function Bl(t2, e2, r2, i2, n2, s2) {
|
|
|
15495
15970
|
l2 = l2.intersect(a2);
|
|
15496
15971
|
break;
|
|
15497
15972
|
}
|
|
15498
|
-
|
|
15973
|
+
c2 = is(l2, { debugMode: false });
|
|
15499
15974
|
}
|
|
15500
|
-
return
|
|
15975
|
+
return c2;
|
|
15501
15976
|
}
|
|
15502
|
-
function
|
|
15977
|
+
function Xl(t2, e2, r2, n2, i2) {
|
|
15503
15978
|
let s2 = { nextId: 0 }, o2 = t2.geometries ?? [];
|
|
15504
15979
|
for (let l2 of o2)
|
|
15505
|
-
typeof l2 == "string" || l2.type === "reference:geometry" ? e2 =
|
|
15980
|
+
typeof l2 == "string" || l2.type === "reference:geometry" ? e2 = _l(
|
|
15981
|
+
e2,
|
|
15982
|
+
l2,
|
|
15983
|
+
r2,
|
|
15984
|
+
n2,
|
|
15985
|
+
i2
|
|
15986
|
+
) : l2.type === "csg:clip" ? e2 = zl(
|
|
15987
|
+
s2,
|
|
15988
|
+
e2,
|
|
15989
|
+
l2,
|
|
15990
|
+
n2
|
|
15991
|
+
) : e2 = Yl(
|
|
15992
|
+
s2,
|
|
15993
|
+
e2,
|
|
15994
|
+
l2,
|
|
15995
|
+
r2,
|
|
15996
|
+
n2,
|
|
15997
|
+
i2
|
|
15998
|
+
);
|
|
15506
15999
|
return e2;
|
|
15507
16000
|
}
|
|
15508
|
-
function
|
|
16001
|
+
function Be(t2, e2, r2) {
|
|
15509
16002
|
e2[0] = t2[r2 + 0], e2[1] = t2[r2 + 1], e2[2] = t2[r2 + 2];
|
|
15510
16003
|
}
|
|
15511
|
-
function
|
|
16004
|
+
function ke(t2, e2, r2) {
|
|
15512
16005
|
t2[r2 + 0] = e2[0], t2[r2 + 1] = e2[1], t2[r2 + 2] = e2[2];
|
|
15513
16006
|
}
|
|
15514
|
-
function
|
|
15515
|
-
let r2 = new Array(3 * e2.length),
|
|
16007
|
+
function Kl(t2, e2) {
|
|
16008
|
+
let r2 = new Array(3 * e2.length), n2 = M$4(), i2 = M$4(), s2 = M$4(), o2 = M$4(), l2 = M$4(), a2 = M$4(), c2 = 0;
|
|
15516
16009
|
for (let f3 = 0; f3 < e2.length; f3 += 3) {
|
|
15517
|
-
let
|
|
15518
|
-
|
|
16010
|
+
let u2 = e2[f3], d2 = e2[f3 + 1], h2 = e2[f3 + 2];
|
|
16011
|
+
Be(t2, n2, 3 * u2), Be(t2, i2, 3 * d2), Be(t2, s2, 3 * h2), Ue(o2, i2, n2), Ue(l2, s2, n2), de(a2, o2, l2), ne(a2, a2), ke(r2, a2, c2 + 0), ke(r2, a2, c2 + 3), ke(r2, a2, c2 + 6), c2 += 9;
|
|
15519
16012
|
}
|
|
15520
16013
|
return r2;
|
|
15521
16014
|
}
|
|
15522
|
-
function
|
|
15523
|
-
let r2 = new Array(3 * e2.length),
|
|
16015
|
+
function Zl(t2, e2) {
|
|
16016
|
+
let r2 = new Array(3 * e2.length), n2 = M$4(), i2 = M$4(), s2 = M$4(), o2 = M$4(), l2 = M$4(), a2 = M$4(), c2 = e2.length / 3, f3 = new Array(c2), u2 = 0;
|
|
15524
16017
|
for (let p2 = 0; p2 < e2.length; p2 += 3) {
|
|
15525
16018
|
let g2 = e2[p2], m2 = e2[p2 + 1], y2 = e2[p2 + 2];
|
|
15526
|
-
|
|
16019
|
+
Be(t2, n2, 3 * g2), Be(t2, i2, 3 * m2), Be(t2, s2, 3 * y2), Ue(o2, i2, n2), Ue(l2, s2, n2), de(a2, o2, l2), ne(a2, a2), f3[u2++] = {
|
|
15527
16020
|
index1: g2,
|
|
15528
16021
|
index2: m2,
|
|
15529
16022
|
index3: y2,
|
|
15530
|
-
normal1:
|
|
15531
|
-
normal2:
|
|
15532
|
-
normal3:
|
|
16023
|
+
normal1: $r(a2),
|
|
16024
|
+
normal2: $r(a2),
|
|
16025
|
+
normal3: $r(a2)
|
|
15533
16026
|
};
|
|
15534
16027
|
}
|
|
15535
16028
|
let d2 = [];
|
|
@@ -15539,75 +16032,73 @@ function Vl(t2, e2) {
|
|
|
15539
16032
|
normal: M$4()
|
|
15540
16033
|
};
|
|
15541
16034
|
for (let p2 = 0; p2 < f3.length; p2++) {
|
|
15542
|
-
let g2 = f3[p2], { index1: m2, index2: y2, index3:
|
|
15543
|
-
d2[m2].normals.push(g2.normal1), d2[y2].normals.push(g2.normal2), d2[
|
|
16035
|
+
let g2 = f3[p2], { index1: m2, index2: y2, index3: E3 } = g2;
|
|
16036
|
+
d2[m2].normals.push(g2.normal1), d2[y2].normals.push(g2.normal2), d2[E3].normals.push(g2.normal3);
|
|
15544
16037
|
}
|
|
15545
16038
|
for (let p2 = 0; p2 < d2.length; p2++) {
|
|
15546
16039
|
let g2 = d2[p2], m2 = g2.normals.length;
|
|
15547
16040
|
if (m2 > 0) {
|
|
15548
16041
|
let y2 = g2.normal;
|
|
15549
|
-
|
|
15550
|
-
for (let
|
|
15551
|
-
|
|
15552
|
-
|
|
16042
|
+
Uo(y2, 0, 0, 0);
|
|
16043
|
+
for (let E3 = 0; E3 < m2; E3++)
|
|
16044
|
+
jo(y2, y2, g2.normals[E3]);
|
|
16045
|
+
ne(y2, y2);
|
|
15553
16046
|
}
|
|
15554
16047
|
}
|
|
15555
16048
|
let h2 = 0;
|
|
15556
16049
|
for (let p2 = 0; p2 < e2.length; p2 += 3) {
|
|
15557
|
-
let g2 = e2[p2], m2 = e2[p2 + 1], y2 = e2[p2 + 2],
|
|
15558
|
-
|
|
16050
|
+
let g2 = e2[p2], m2 = e2[p2 + 1], y2 = e2[p2 + 2], E3 = d2[g2].normal, I2 = d2[m2].normal, v2 = d2[y2].normal;
|
|
16051
|
+
ke(r2, E3, h2 + 0), ke(r2, I2, h2 + 3), ke(r2, v2, h2 + 6), h2 += 9;
|
|
15559
16052
|
}
|
|
15560
16053
|
return r2;
|
|
15561
16054
|
}
|
|
15562
|
-
function
|
|
16055
|
+
function jr(t2, e2, r2) {
|
|
15563
16056
|
e2[0] = t2[r2 + 0], e2[1] = t2[r2 + 1], e2[2] = t2[r2 + 2];
|
|
15564
16057
|
}
|
|
15565
|
-
function
|
|
15566
|
-
let r2 = new Array(2 * e2.length),
|
|
16058
|
+
function ql(t2, e2) {
|
|
16059
|
+
let r2 = new Array(2 * e2.length), n2 = M$4(), i2 = M$4(), s2 = M$4(), o2 = M$4(), l2 = M$4(), a2 = M$4(), c2 = 0;
|
|
15567
16060
|
for (let f3 = 0; f3 < e2.length; f3 += 3) {
|
|
15568
|
-
let
|
|
15569
|
-
|
|
16061
|
+
let u2 = e2[f3], d2 = e2[f3 + 1], h2 = e2[f3 + 2];
|
|
16062
|
+
jr(t2, n2, 3 * u2), jr(t2, i2, 3 * d2), jr(t2, s2, 3 * h2), Ue(o2, i2, n2), Ue(l2, s2, n2), de(a2, o2, l2), ne(a2, a2), a2[0] = Math.abs(a2[0]), a2[1] = Math.abs(a2[1]), a2[2] = Math.abs(a2[2]);
|
|
15570
16063
|
let p2, g2;
|
|
15571
|
-
a2[0] >= a2[1] && a2[0] >= a2[2] ? (p2 = 2, g2 = 1) : a2[1] >= a2[0] && a2[1] >= a2[2] ? (p2 = 0, g2 = 2) : (p2 = 0, g2 = 1), r2[
|
|
16064
|
+
a2[0] >= a2[1] && a2[0] >= a2[2] ? (p2 = 2, g2 = 1) : a2[1] >= a2[0] && a2[1] >= a2[2] ? (p2 = 0, g2 = 2) : (p2 = 0, g2 = 1), r2[c2++] = n2[p2], r2[c2++] = n2[g2], r2[c2++] = i2[p2], r2[c2++] = i2[g2], r2[c2++] = s2[p2], r2[c2++] = s2[g2];
|
|
15572
16065
|
}
|
|
15573
16066
|
return r2;
|
|
15574
16067
|
}
|
|
15575
|
-
function
|
|
15576
|
-
let r2 = new Array(2 * e2.length),
|
|
15577
|
-
for (let
|
|
15578
|
-
let s2 = 3 * e2[
|
|
15579
|
-
r2[
|
|
16068
|
+
function Ql(t2, e2) {
|
|
16069
|
+
let r2 = new Array(2 * e2.length), n2 = 0;
|
|
16070
|
+
for (let i2 = 0; i2 < e2.length; i2++) {
|
|
16071
|
+
let s2 = 3 * e2[i2], o2 = t2[s2], l2 = t2[s2 + 1], a2 = t2[s2 + 2], c2 = 0.5 + Math.atan2(o2, a2) / (2 * Math.PI), f3 = 0.5 + Math.asin(l2) / Math.PI;
|
|
16072
|
+
r2[n2++] = c2, r2[n2++] = f3;
|
|
15580
16073
|
}
|
|
15581
16074
|
return r2;
|
|
15582
16075
|
}
|
|
15583
|
-
function
|
|
15584
|
-
let { normal: e2, size: r2, doubleSided:
|
|
15585
|
-
|
|
15586
|
-
];
|
|
15587
|
-
return i2 && (o2 = o2.concat([0, 2, 1, 0, 3, 2]), l2.push({ index: 2, count: 2 })), { vertices: s2, indices: o2, faces: l2 };
|
|
16076
|
+
function ea(t2) {
|
|
16077
|
+
let { normal: e2, size: r2, doubleSided: n2 } = t2, s2 = sn([0, 0, 0], e2, r2).flat(), o2 = [0, 1, 2, 0, 2, 3], l2 = [{ index: 0, count: 2 }];
|
|
16078
|
+
return n2 && (o2 = o2.concat([0, 2, 1, 0, 3, 2]), l2.push({ index: 2, count: 2 })), { vertices: s2, indices: o2, faces: l2 };
|
|
15588
16079
|
}
|
|
15589
|
-
function
|
|
15590
|
-
let { dimensions: e2 } = t2, r2 = e2[0],
|
|
16080
|
+
function ta(t2) {
|
|
16081
|
+
let { dimensions: e2 } = t2, r2 = e2[0], n2 = e2[1], i2 = e2[2], s2 = [
|
|
15591
16082
|
// Top
|
|
15592
16083
|
0,
|
|
15593
|
-
i2,
|
|
15594
16084
|
n2,
|
|
15595
|
-
r2,
|
|
15596
16085
|
i2,
|
|
15597
|
-
n2,
|
|
15598
16086
|
r2,
|
|
16087
|
+
n2,
|
|
15599
16088
|
i2,
|
|
16089
|
+
r2,
|
|
16090
|
+
n2,
|
|
15600
16091
|
0,
|
|
15601
16092
|
0,
|
|
15602
|
-
|
|
16093
|
+
n2,
|
|
15603
16094
|
0,
|
|
15604
16095
|
// Bottom
|
|
15605
16096
|
0,
|
|
15606
16097
|
0,
|
|
15607
|
-
|
|
16098
|
+
i2,
|
|
15608
16099
|
r2,
|
|
15609
16100
|
0,
|
|
15610
|
-
|
|
16101
|
+
i2,
|
|
15611
16102
|
r2,
|
|
15612
16103
|
0,
|
|
15613
16104
|
0,
|
|
@@ -15662,85 +16153,83 @@ function Hl(t2) {
|
|
|
15662
16153
|
l2.push({ index: 2 * a2, count: 2 });
|
|
15663
16154
|
return { vertices: s2, indices: o2, faces: l2 };
|
|
15664
16155
|
}
|
|
15665
|
-
function
|
|
15666
|
-
let
|
|
15667
|
-
return [l2, a2,
|
|
16156
|
+
function ra(t2, e2, r2) {
|
|
16157
|
+
let n2 = Math.cos(e2), i2 = Math.sin(e2), s2 = Math.cos(r2), o2 = Math.sin(r2), l2 = t2 * i2 * s2, a2 = t2 * n2, c2 = t2 * i2 * o2;
|
|
16158
|
+
return [l2, a2, c2];
|
|
15668
16159
|
}
|
|
15669
|
-
function
|
|
15670
|
-
let
|
|
15671
|
-
o2.push(0,
|
|
15672
|
-
for (let
|
|
15673
|
-
let d2 = Math.PI *
|
|
16160
|
+
function na(t2) {
|
|
16161
|
+
let n2 = t2.radius, i2, s2, o2 = [], l2 = [], a2 = t2.uvs === "generator" ? [] : void 0;
|
|
16162
|
+
o2.push(0, n2, 0);
|
|
16163
|
+
for (let u2 = 1; u2 < 16; u2++) {
|
|
16164
|
+
let d2 = Math.PI * u2 / 16;
|
|
15674
16165
|
for (let h2 = 0; h2 < 16; h2++) {
|
|
15675
|
-
let p2 = 2 * Math.PI * h2 / 16, g2 =
|
|
16166
|
+
let p2 = 2 * Math.PI * h2 / 16, g2 = ra(n2, d2, p2);
|
|
15676
16167
|
o2.push(g2[0], g2[1], g2[2]);
|
|
15677
16168
|
}
|
|
15678
16169
|
}
|
|
15679
|
-
let
|
|
15680
|
-
|
|
15681
|
-
for (let
|
|
15682
|
-
let d2 = 1 +
|
|
16170
|
+
let c2 = o2.push(0, -n2, 0) / 3 - 1;
|
|
16171
|
+
i2 = 1, s2 = 1 - 1 / 16;
|
|
16172
|
+
for (let u2 = 0; u2 < 16; u2++) {
|
|
16173
|
+
let d2 = 1 + u2, h2 = 1 + (u2 + 1) % 16;
|
|
15683
16174
|
if (l2.push(0, h2, d2), a2) {
|
|
15684
|
-
let p2 = 1 -
|
|
15685
|
-
a2.push(m2,
|
|
16175
|
+
let p2 = 1 - u2 / 16, g2 = 1 - (u2 + 1) / 16, m2 = 0.5 * (p2 + g2);
|
|
16176
|
+
a2.push(m2, i2, g2, s2, p2, s2);
|
|
15686
16177
|
}
|
|
15687
16178
|
}
|
|
15688
|
-
for (let
|
|
16179
|
+
for (let u2 = 0; u2 < 14; u2++)
|
|
15689
16180
|
for (let d2 = 0; d2 < 16; d2++) {
|
|
15690
|
-
let h2 = 1 +
|
|
16181
|
+
let h2 = 1 + u2 * 16 + d2, p2 = 1 + u2 * 16 + (d2 + 1) % 16, g2 = 1 + (u2 + 1) * 16 + (d2 + 1) % 16, m2 = 1 + (u2 + 1) * 16 + d2;
|
|
15691
16182
|
if (l2.push(h2, p2, g2), l2.push(h2, g2, m2), a2) {
|
|
15692
|
-
let y2 = 1 - d2 / 16,
|
|
15693
|
-
a2.push(y2, I2, E3, I2,
|
|
16183
|
+
let y2 = 1 - d2 / 16, E3 = 1 - (u2 + 1) / 16, I2 = 1 - (d2 + 1) / 16, v2 = 1 - (u2 + 2) / 16;
|
|
16184
|
+
a2.push(y2, E3, I2, E3, I2, v2), a2.push(y2, E3, I2, v2, y2, v2);
|
|
15694
16185
|
}
|
|
15695
16186
|
}
|
|
15696
|
-
|
|
15697
|
-
for (let
|
|
15698
|
-
let d2 = 225 +
|
|
15699
|
-
if (l2.push(d2, h2,
|
|
15700
|
-
let p2 = 1 -
|
|
15701
|
-
a2.push(p2,
|
|
16187
|
+
i2 = 1 - 15 / 16, s2 = 0;
|
|
16188
|
+
for (let u2 = 0; u2 < 16; u2++) {
|
|
16189
|
+
let d2 = 225 + u2, h2 = 1 + 14 * 16 + (u2 + 1) % 16;
|
|
16190
|
+
if (l2.push(d2, h2, c2), a2) {
|
|
16191
|
+
let p2 = 1 - u2 / 16, g2 = 1 - (u2 + 1) / 16, m2 = 0.5 * (p2 + g2);
|
|
16192
|
+
a2.push(p2, i2, g2, i2, m2, s2);
|
|
15702
16193
|
}
|
|
15703
16194
|
}
|
|
15704
|
-
let f3 = [
|
|
15705
|
-
{ index: 0, count: l2.length / 3 }
|
|
15706
|
-
];
|
|
16195
|
+
let f3 = [{ index: 0, count: l2.length / 3 }];
|
|
15707
16196
|
return { vertices: o2, indices: l2, uvs: a2, faces: f3 };
|
|
15708
16197
|
}
|
|
15709
|
-
function
|
|
15710
|
-
let { vertices: e2, indices: r2, normals:
|
|
15711
|
-
return Array.isArray(
|
|
16198
|
+
function ia(t2) {
|
|
16199
|
+
let { vertices: e2, indices: r2, normals: n2, uvs: i2 } = t2, s2 = { vertices: e2, indices: r2, faces: [] };
|
|
16200
|
+
return Array.isArray(n2) && (s2.normals = n2), Array.isArray(i2) && (s2.uvs = i2), s2;
|
|
15712
16201
|
}
|
|
15713
|
-
const
|
|
15714
|
-
function
|
|
15715
|
-
let r2 = Math.ceil(
|
|
15716
|
-
const
|
|
15717
|
-
return Math.max(
|
|
16202
|
+
const sa = 48, oa = 12;
|
|
16203
|
+
function la(t2, e2) {
|
|
16204
|
+
let r2 = Math.ceil(sa / (Math.PI * 2) * t2 * e2);
|
|
16205
|
+
const n2 = Math.ceil(oa / (Math.PI * 2) * t2);
|
|
16206
|
+
return Math.max(n2, r2);
|
|
15718
16207
|
}
|
|
15719
|
-
function
|
|
15720
|
-
let r2 = e2 * Math.cos(t2),
|
|
15721
|
-
return [r2,
|
|
16208
|
+
function oi(t2, e2) {
|
|
16209
|
+
let r2 = e2 * Math.cos(t2), n2 = -e2 * Math.sin(t2);
|
|
16210
|
+
return [r2, n2];
|
|
15722
16211
|
}
|
|
15723
|
-
function
|
|
15724
|
-
let
|
|
16212
|
+
function os(t2, e2, r2, n2 = true) {
|
|
16213
|
+
let i2 = [], s2 = e2 - t2, o2 = la(Math.abs(s2), r2), l2 = s2 / o2;
|
|
15725
16214
|
for (let a2 = 0; a2 < o2; a2++) {
|
|
15726
|
-
let
|
|
15727
|
-
|
|
16215
|
+
let c2 = t2 + a2 * l2, f3 = oi(c2, r2);
|
|
16216
|
+
i2.push(f3);
|
|
15728
16217
|
}
|
|
15729
|
-
if (
|
|
15730
|
-
let a2 =
|
|
15731
|
-
|
|
16218
|
+
if (n2) {
|
|
16219
|
+
let a2 = oi(e2, r2);
|
|
16220
|
+
i2.push(a2);
|
|
15732
16221
|
}
|
|
15733
|
-
return
|
|
16222
|
+
return i2;
|
|
15734
16223
|
}
|
|
15735
|
-
function
|
|
16224
|
+
function aa(t2) {
|
|
15736
16225
|
let e2 = [];
|
|
15737
16226
|
switch (t2.type) {
|
|
15738
16227
|
case "curve:line":
|
|
15739
16228
|
e2.push(t2.start, t2.end);
|
|
15740
16229
|
break;
|
|
15741
16230
|
case "curve:arc":
|
|
15742
|
-
let r2 = Math.PI * t2.startAngle / 180,
|
|
15743
|
-
e2 =
|
|
16231
|
+
let r2 = Math.PI * t2.startAngle / 180, n2 = Math.PI * t2.endAngle / 180;
|
|
16232
|
+
e2 = os(r2, n2, t2.radius);
|
|
15744
16233
|
break;
|
|
15745
16234
|
case "curve:polyline":
|
|
15746
16235
|
e2 = t2.points;
|
|
@@ -15748,11 +16237,11 @@ function Kl(t2) {
|
|
|
15748
16237
|
}
|
|
15749
16238
|
return e2;
|
|
15750
16239
|
}
|
|
15751
|
-
function
|
|
16240
|
+
function vn(t2) {
|
|
15752
16241
|
let e2 = [], r2 = [];
|
|
15753
16242
|
switch (t2.type) {
|
|
15754
16243
|
case "curve:circle":
|
|
15755
|
-
e2 =
|
|
16244
|
+
e2 = os(0, 2 * Math.PI, t2.radius, false), r2.push({ index: 0, count: e2.length });
|
|
15756
16245
|
break;
|
|
15757
16246
|
case "curve:polygon":
|
|
15758
16247
|
e2 = t2.points;
|
|
@@ -15760,164 +16249,180 @@ function Qr(t2) {
|
|
|
15760
16249
|
r2.push({ index: f3, count: 1 });
|
|
15761
16250
|
break;
|
|
15762
16251
|
case "curve:rectangle":
|
|
15763
|
-
let { dimensions:
|
|
16252
|
+
let { dimensions: n2 } = t2, i2 = n2[0], s2 = n2[1];
|
|
15764
16253
|
e2 = [
|
|
15765
16254
|
[0, 0],
|
|
15766
16255
|
[0, s2],
|
|
15767
|
-
[
|
|
15768
|
-
[
|
|
16256
|
+
[i2, s2],
|
|
16257
|
+
[i2, 0]
|
|
15769
16258
|
];
|
|
15770
16259
|
for (let f3 = 0; f3 < e2.length; f3++)
|
|
15771
16260
|
r2.push({ index: f3, count: 1 });
|
|
15772
16261
|
break;
|
|
15773
16262
|
case "curve:composite":
|
|
15774
16263
|
const o2 = 1e-7;
|
|
15775
|
-
let l2, a2,
|
|
15776
|
-
for (let f3 = 0; f3 <
|
|
15777
|
-
let
|
|
15778
|
-
(f3 === 0 ? true :
|
|
16264
|
+
let l2, a2, c2 = t2.segments;
|
|
16265
|
+
for (let f3 = 0; f3 < c2.length; f3++) {
|
|
16266
|
+
let u2 = c2[f3], d2 = aa(u2), h2 = d2[0], p2 = d2[d2.length - 1];
|
|
16267
|
+
(f3 === 0 ? true : ii(h2, a2, o2)) || b$4.warn(`Composite curve segments ${f3} and ${f3 + 1} are not continuous.`), f3 === 0 && (l2 = h2), a2 = p2, r2.push({ index: e2.length, count: d2.length - 1 }), e2.push(...d2.slice(0, d2.length - 1));
|
|
15779
16268
|
}
|
|
15780
|
-
|
|
16269
|
+
c2.length > 0 && !ii(a2, l2, o2) && b$4.warn("Composite curve not closed.");
|
|
15781
16270
|
break;
|
|
15782
16271
|
}
|
|
15783
16272
|
return { points: e2, segmentRanges: r2 };
|
|
15784
16273
|
}
|
|
15785
|
-
function
|
|
15786
|
-
let
|
|
16274
|
+
function li(t2, e2, r2) {
|
|
16275
|
+
let n2 = r2.holes ?? [], i2 = r2.y ?? 0, s2 = r2.flipSide ?? false, o2 = t2, l2 = [], a2, c2 = 0;
|
|
15787
16276
|
for (let f3 = 0; f3 < o2.length; f3 += 2)
|
|
15788
|
-
l2[
|
|
15789
|
-
if (o2.length === 8 &&
|
|
16277
|
+
l2[c2++] = o2[f3], l2[c2++] = i2, l2[c2++] = o2[f3 + 1];
|
|
16278
|
+
if (o2.length === 8 && n2.length === 0)
|
|
15790
16279
|
a2 = (e2 ? s2 : !s2) ? [3, 0, 1, 1, 2, 3] : [1, 0, 3, 3, 2, 1];
|
|
15791
16280
|
else {
|
|
15792
|
-
if (
|
|
15793
|
-
let f3 = new Array(
|
|
15794
|
-
for (let
|
|
15795
|
-
f3[
|
|
15796
|
-
a2 =
|
|
16281
|
+
if (n2.length > 0) {
|
|
16282
|
+
let f3 = new Array(n2.length);
|
|
16283
|
+
for (let u2 = 0; u2 < n2.length; u2++)
|
|
16284
|
+
f3[u2] = o2.length / 2, o2 = o2.concat(n2[u2]);
|
|
16285
|
+
a2 = ri(o2, f3);
|
|
15797
16286
|
} else
|
|
15798
|
-
a2 =
|
|
16287
|
+
a2 = ri(o2);
|
|
15799
16288
|
if (!s2)
|
|
15800
16289
|
for (let f3 = 0; f3 < a2.length; f3 += 3) {
|
|
15801
|
-
let
|
|
15802
|
-
a2[f3] = a2[f3 + 2], a2[f3 + 2] =
|
|
16290
|
+
let u2 = a2[f3];
|
|
16291
|
+
a2[f3] = a2[f3 + 2], a2[f3 + 2] = u2;
|
|
15803
16292
|
}
|
|
15804
16293
|
}
|
|
15805
16294
|
return { vertices: l2, indices: a2 };
|
|
15806
16295
|
}
|
|
15807
|
-
function
|
|
15808
|
-
let r2 = t2.length / 6,
|
|
16296
|
+
function ca(t2, e2 = false) {
|
|
16297
|
+
let r2 = t2.length / 6, n2 = new Array(r2 * 2 * 3), i2 = 0;
|
|
15809
16298
|
for (let s2 = 0; s2 < r2; s2++)
|
|
15810
|
-
s2 === r2 - 1 ? e2 ? (i2
|
|
15811
|
-
return
|
|
16299
|
+
s2 === r2 - 1 ? e2 ? (n2[i2++] = s2, n2[i2++] = 0, n2[i2++] = r2, n2[i2++] = s2, n2[i2++] = r2, n2[i2++] = s2 + r2) : (n2[i2++] = r2, n2[i2++] = 0, n2[i2++] = s2, n2[i2++] = s2 + r2, n2[i2++] = r2, n2[i2++] = s2) : e2 ? (n2[i2++] = s2, n2[i2++] = s2 + 1, n2[i2++] = s2 + r2 + 1, n2[i2++] = s2, n2[i2++] = s2 + r2 + 1, n2[i2++] = s2 + r2) : (n2[i2++] = s2 + r2 + 1, n2[i2++] = s2 + 1, n2[i2++] = s2, n2[i2++] = s2 + r2, n2[i2++] = s2 + r2 + 1, n2[i2++] = s2);
|
|
16300
|
+
return n2;
|
|
15812
16301
|
}
|
|
15813
|
-
function
|
|
15814
|
-
let { profile: e2, height: r2 } = t2,
|
|
15815
|
-
f3.push(...a2.vertices), f3.push(...
|
|
15816
|
-
let
|
|
15817
|
-
p2.push(...
|
|
15818
|
-
let g2 =
|
|
16302
|
+
function ua(t2) {
|
|
16303
|
+
let { profile: e2, height: r2 } = t2, n2 = vn(e2), { points: i2, segmentRanges: s2 } = n2, o2 = i2.flat(), l2 = ar(i2), a2 = li(o2, l2, { y: r2, flipSide: false }), c2 = li(o2, l2, { y: 0, flipSide: true }), f3 = [];
|
|
16304
|
+
f3.push(...a2.vertices), f3.push(...c2.vertices);
|
|
16305
|
+
let u2 = a2.indices, d2 = c2.indices.map((E3) => E3 + i2.length), h2 = ca(f3, l2), p2 = [];
|
|
16306
|
+
p2.push(...u2), p2.push(...d2), p2.push(...h2);
|
|
16307
|
+
let g2 = u2.length / 3, m2 = [];
|
|
15819
16308
|
m2[0] = { index: 0, count: g2 }, m2[1] = { index: g2, count: g2 };
|
|
15820
16309
|
let y2 = 2 * g2;
|
|
15821
|
-
for (let
|
|
15822
|
-
let
|
|
15823
|
-
m2.push({ index:
|
|
16310
|
+
for (let E3 of s2) {
|
|
16311
|
+
let I2 = y2 + 2 * E3.index, v2 = 2 * E3.count;
|
|
16312
|
+
m2.push({ index: I2, count: v2 });
|
|
15824
16313
|
}
|
|
15825
16314
|
return { vertices: f3, indices: p2, faces: m2 };
|
|
15826
16315
|
}
|
|
15827
|
-
function
|
|
15828
|
-
var
|
|
16316
|
+
function ln(t2, e2, r2, n2 = []) {
|
|
16317
|
+
var i2;
|
|
15829
16318
|
let s2 = [], o2;
|
|
15830
16319
|
switch (t2.type) {
|
|
15831
16320
|
case "geometry:plane":
|
|
15832
|
-
o2 =
|
|
16321
|
+
o2 = ea(t2);
|
|
15833
16322
|
break;
|
|
15834
16323
|
case "geometry:cuboid":
|
|
15835
|
-
o2 =
|
|
16324
|
+
o2 = ta(t2);
|
|
15836
16325
|
break;
|
|
15837
16326
|
case "geometry:sphere":
|
|
15838
|
-
o2 =
|
|
16327
|
+
o2 = na(t2);
|
|
15839
16328
|
break;
|
|
15840
16329
|
case "geometry:extrusion":
|
|
15841
|
-
o2 =
|
|
16330
|
+
o2 = ua(t2);
|
|
15842
16331
|
break;
|
|
15843
16332
|
case "geometry:mesh":
|
|
15844
|
-
o2 =
|
|
16333
|
+
o2 = ia(t2);
|
|
15845
16334
|
break;
|
|
15846
16335
|
default:
|
|
15847
16336
|
return b$4.warn(`Invalid geometry type ${t2.type}.`), s2;
|
|
15848
16337
|
}
|
|
15849
|
-
s2 =
|
|
16338
|
+
s2 = Tl(t2, o2, r2), (t2.type === "geometry:plane" || t2.type === "geometry:cuboid" || t2.type === "geometry:sphere" || t2.type === "geometry:extrusion") && (i2 = t2.geometries) != null && i2.length && (n2.push(t2), s2 = Xl(
|
|
16339
|
+
t2,
|
|
16340
|
+
s2,
|
|
16341
|
+
e2,
|
|
16342
|
+
r2,
|
|
16343
|
+
n2
|
|
16344
|
+
), n2.pop());
|
|
15850
16345
|
let l2 = [];
|
|
15851
16346
|
for (let f3 of s2) {
|
|
15852
|
-
let { name:
|
|
16347
|
+
let { name: u2, vertices: d2, indices: h2, normals: p2, uvs: g2, material: m2 } = f3, { position: y2, rotation: E3, rotationAxis: I2 } = t2, v2 = ns({
|
|
16348
|
+
position: y2,
|
|
16349
|
+
rotation: E3,
|
|
16350
|
+
rotationAxis: I2,
|
|
16351
|
+
name: u2,
|
|
16352
|
+
vertices: d2,
|
|
16353
|
+
indices: h2,
|
|
16354
|
+
normals: p2,
|
|
16355
|
+
uvs: g2,
|
|
16356
|
+
material: m2
|
|
16357
|
+
});
|
|
15853
16358
|
l2.push(v2);
|
|
15854
16359
|
}
|
|
15855
16360
|
s2 = l2;
|
|
15856
16361
|
let a2 = t2.normals ?? "flat";
|
|
15857
16362
|
if (a2 === "flat" || a2 === "smooth")
|
|
15858
16363
|
for (let f3 of s2) {
|
|
15859
|
-
let { vertices:
|
|
15860
|
-
f3.normals = a2 === "flat" ?
|
|
16364
|
+
let { vertices: u2, indices: d2 } = f3;
|
|
16365
|
+
f3.normals = a2 === "flat" ? Kl(u2, d2) : Zl(u2, d2);
|
|
15861
16366
|
}
|
|
15862
|
-
let
|
|
15863
|
-
if (
|
|
16367
|
+
let c2 = t2.uvs ?? "automatic";
|
|
16368
|
+
if (c2 == "automatic" || c2 === "spherical")
|
|
15864
16369
|
for (let f3 of s2) {
|
|
15865
|
-
let { vertices:
|
|
15866
|
-
f3.uvs =
|
|
16370
|
+
let { vertices: u2, indices: d2 } = f3;
|
|
16371
|
+
f3.uvs = c2 === "automatic" ? ql(u2, d2) : Ql(u2, d2);
|
|
15867
16372
|
}
|
|
15868
16373
|
return s2;
|
|
15869
16374
|
}
|
|
15870
|
-
function
|
|
16375
|
+
function ur(t2) {
|
|
15871
16376
|
let e2 = {
|
|
15872
16377
|
min: [1 / 0, 1 / 0, 1 / 0],
|
|
15873
16378
|
max: [-1 / 0, -1 / 0, -1 / 0]
|
|
15874
|
-
}, r2,
|
|
16379
|
+
}, r2, n2, i2;
|
|
15875
16380
|
for (let s2 = 0; s2 < t2.length; s2 += 3)
|
|
15876
|
-
r2 = t2[s2],
|
|
16381
|
+
r2 = t2[s2], n2 = t2[s2 + 1], i2 = t2[s2 + 2], e2.min[0] = Math.min(e2.min[0], r2), e2.max[0] = Math.max(e2.max[0], r2), e2.min[1] = Math.min(e2.min[1], n2), e2.max[1] = Math.max(e2.max[1], n2), e2.min[2] = Math.min(e2.min[2], i2), e2.max[2] = Math.max(e2.max[2], i2);
|
|
15877
16382
|
return e2;
|
|
15878
16383
|
}
|
|
15879
|
-
var
|
|
15880
|
-
for (var
|
|
15881
|
-
|
|
15882
|
-
function
|
|
15883
|
-
let { position: r2, rotation:
|
|
15884
|
-
return e2 &&
|
|
16384
|
+
var W$1 = [];
|
|
16385
|
+
for (var Hr = 0; Hr < 256; ++Hr)
|
|
16386
|
+
W$1.push((Hr + 256).toString(16).substr(1));
|
|
16387
|
+
function Sn(t2, e2) {
|
|
16388
|
+
let { position: r2, rotation: n2, rotationAxis: i2 } = t2.getTransform(), s2 = cr(r2, n2, i2);
|
|
16389
|
+
return e2 && Mi(s2, e2, s2), s2;
|
|
15885
16390
|
}
|
|
15886
|
-
var
|
|
15887
|
-
function
|
|
16391
|
+
var Os = { exports: {} };
|
|
16392
|
+
function jn() {
|
|
15888
16393
|
}
|
|
15889
|
-
|
|
16394
|
+
jn.prototype = {
|
|
15890
16395
|
on: function(t2, e2, r2) {
|
|
15891
|
-
var
|
|
15892
|
-
return (
|
|
16396
|
+
var n2 = this.e || (this.e = {});
|
|
16397
|
+
return (n2[t2] || (n2[t2] = [])).push({
|
|
15893
16398
|
fn: e2,
|
|
15894
16399
|
ctx: r2
|
|
15895
16400
|
}), this;
|
|
15896
16401
|
},
|
|
15897
16402
|
once: function(t2, e2, r2) {
|
|
15898
|
-
var
|
|
15899
|
-
function
|
|
15900
|
-
|
|
16403
|
+
var n2 = this;
|
|
16404
|
+
function i2() {
|
|
16405
|
+
n2.off(t2, i2), e2.apply(r2, arguments);
|
|
15901
16406
|
}
|
|
15902
|
-
return
|
|
16407
|
+
return i2._ = e2, this.on(t2, i2, r2);
|
|
15903
16408
|
},
|
|
15904
16409
|
emit: function(t2) {
|
|
15905
|
-
var e2 = [].slice.call(arguments, 1), r2 = ((this.e || (this.e = {}))[t2] || []).slice(),
|
|
15906
|
-
for (
|
|
15907
|
-
r2[
|
|
16410
|
+
var e2 = [].slice.call(arguments, 1), r2 = ((this.e || (this.e = {}))[t2] || []).slice(), n2 = 0, i2 = r2.length;
|
|
16411
|
+
for (n2; n2 < i2; n2++)
|
|
16412
|
+
r2[n2].fn.apply(r2[n2].ctx, e2);
|
|
15908
16413
|
return this;
|
|
15909
16414
|
},
|
|
15910
16415
|
off: function(t2, e2) {
|
|
15911
|
-
var r2 = this.e || (this.e = {}),
|
|
15912
|
-
if (
|
|
15913
|
-
for (var s2 = 0, o2 =
|
|
15914
|
-
|
|
15915
|
-
return
|
|
16416
|
+
var r2 = this.e || (this.e = {}), n2 = r2[t2], i2 = [];
|
|
16417
|
+
if (n2 && e2)
|
|
16418
|
+
for (var s2 = 0, o2 = n2.length; s2 < o2; s2++)
|
|
16419
|
+
n2[s2].fn !== e2 && n2[s2].fn._ !== e2 && i2.push(n2[s2]);
|
|
16420
|
+
return i2.length ? r2[t2] = i2 : delete r2[t2], this;
|
|
15916
16421
|
}
|
|
15917
16422
|
};
|
|
15918
|
-
|
|
15919
|
-
|
|
15920
|
-
const
|
|
16423
|
+
Os.exports = jn;
|
|
16424
|
+
Os.exports.TinyEmitter = jn;
|
|
16425
|
+
const zp = ["SITE", "FACTORY", "NOTDEFINED"], Yp = [
|
|
15921
16426
|
"SINGLE_SWING_LEFT",
|
|
15922
16427
|
"SINGLE_SWING_RIGHT",
|
|
15923
16428
|
"DOUBLE_DOOR_SINGLE_SWING",
|
|
@@ -15936,7 +16441,7 @@ const gp = ["SITE", "FACTORY", "NOTDEFINED"], yp = [
|
|
|
15936
16441
|
"ROLLINGUP",
|
|
15937
16442
|
"USERDEFINED",
|
|
15938
16443
|
"NOTDEFINED"
|
|
15939
|
-
],
|
|
16444
|
+
], Xp = [
|
|
15940
16445
|
"ALUMINIUM",
|
|
15941
16446
|
"HIGH_GRADE_STEEL",
|
|
15942
16447
|
"STEEL",
|
|
@@ -15946,7 +16451,7 @@ const gp = ["SITE", "FACTORY", "NOTDEFINED"], yp = [
|
|
|
15946
16451
|
"PLASTIC",
|
|
15947
16452
|
"USERDEFINED",
|
|
15948
16453
|
"NOTDEFINED"
|
|
15949
|
-
],
|
|
16454
|
+
], Kp = [
|
|
15950
16455
|
"ACCESSORY_ASSEMBLY",
|
|
15951
16456
|
"ARCH",
|
|
15952
16457
|
"BEAM_GRID",
|
|
@@ -15958,7 +16463,7 @@ const gp = ["SITE", "FACTORY", "NOTDEFINED"], yp = [
|
|
|
15958
16463
|
"TRUSS",
|
|
15959
16464
|
"USERDEFINED",
|
|
15960
16465
|
"NOTDEFINED"
|
|
15961
|
-
],
|
|
16466
|
+
], Zp = ["INTERNAL", "EXTERNAL", "NOTDEFINED"], qp = ["HANDRAIL", "GUARDRAIL", "BALUSTRADE", "USERDEFINED", "NOTDEFINED"], Qp = ["FLOOR", "ROOF", "LANDING", "BASESLAB", "USERDEFINED", "NOTDEFINED"], eh = [
|
|
15962
16467
|
"STRAIGHT_RUN_STAIR",
|
|
15963
16468
|
"TWO_STRAIGHT_RUN_STAIR",
|
|
15964
16469
|
"QUARTER_WINDING_STAIR",
|
|
@@ -15975,7 +16480,7 @@ const gp = ["SITE", "FACTORY", "NOTDEFINED"], yp = [
|
|
|
15975
16480
|
"TWO_CURVED_RUN_STAIR",
|
|
15976
16481
|
"USERDEFINED",
|
|
15977
16482
|
"NOTDEFINED"
|
|
15978
|
-
],
|
|
16483
|
+
], xi = [
|
|
15979
16484
|
"ABSORBEDDOSEUNIT",
|
|
15980
16485
|
"AMOUNTOFSUBSTANCEUNIT",
|
|
15981
16486
|
"AREAUNIT",
|
|
@@ -16006,7 +16511,7 @@ const gp = ["SITE", "FACTORY", "NOTDEFINED"], yp = [
|
|
|
16006
16511
|
"TIMEUNIT",
|
|
16007
16512
|
"VOLUMEUNIT",
|
|
16008
16513
|
"USERDEFINED"
|
|
16009
|
-
],
|
|
16514
|
+
], th = [
|
|
16010
16515
|
"EXA",
|
|
16011
16516
|
"PETA",
|
|
16012
16517
|
"TERA",
|
|
@@ -16023,7 +16528,7 @@ const gp = ["SITE", "FACTORY", "NOTDEFINED"], yp = [
|
|
|
16023
16528
|
"PICO",
|
|
16024
16529
|
"FEMTO",
|
|
16025
16530
|
"ATTO"
|
|
16026
|
-
],
|
|
16531
|
+
], rh = [
|
|
16027
16532
|
"AMPERE",
|
|
16028
16533
|
"BECQUEREL",
|
|
16029
16534
|
"CANDELA",
|
|
@@ -16054,7 +16559,7 @@ const gp = ["SITE", "FACTORY", "NOTDEFINED"], yp = [
|
|
|
16054
16559
|
"VOLT",
|
|
16055
16560
|
"WATT",
|
|
16056
16561
|
"WEBER"
|
|
16057
|
-
],
|
|
16562
|
+
], Gt = {
|
|
16058
16563
|
// ApplicationDeveloper: IfcOrganization
|
|
16059
16564
|
// Version: IfcLabel
|
|
16060
16565
|
// ApplicationFullName: IfcLabel
|
|
@@ -16181,8 +16686,8 @@ const gp = ["SITE", "FACTORY", "NOTDEFINED"], yp = [
|
|
|
16181
16686
|
"IfcRoot",
|
|
16182
16687
|
"IfcTypeObject",
|
|
16183
16688
|
"IfcTypeProduct",
|
|
16184
|
-
{ name: "OperationType", type: "enum", oneOf:
|
|
16185
|
-
{ name: "ConstructionType", type: "enum", oneOf:
|
|
16689
|
+
{ name: "OperationType", type: "enum", oneOf: Yp },
|
|
16690
|
+
{ name: "ConstructionType", type: "enum", oneOf: Xp },
|
|
16186
16691
|
{ name: "ParameterTakesPrecedence", type: "boolean" },
|
|
16187
16692
|
{ name: "Sizeable", type: "boolean" }
|
|
16188
16693
|
],
|
|
@@ -16195,8 +16700,8 @@ const gp = ["SITE", "FACTORY", "NOTDEFINED"], yp = [
|
|
|
16195
16700
|
"IfcObject",
|
|
16196
16701
|
"IfcProduct",
|
|
16197
16702
|
"IfcElement",
|
|
16198
|
-
{ name: "AssemblyPlace", optional: true, type: "enum", oneOf:
|
|
16199
|
-
{ name: "PredefinedType", optional: true, type: "enum", oneOf:
|
|
16703
|
+
{ name: "AssemblyPlace", optional: true, type: "enum", oneOf: zp },
|
|
16704
|
+
{ name: "PredefinedType", optional: true, type: "enum", oneOf: Kp }
|
|
16200
16705
|
],
|
|
16201
16706
|
// SweptArea: IfcProfileDef
|
|
16202
16707
|
// Position: IfcAxis2Placement3D
|
|
@@ -16272,7 +16777,7 @@ const gp = ["SITE", "FACTORY", "NOTDEFINED"], yp = [
|
|
|
16272
16777
|
// UnitType: IfcUnitEnum
|
|
16273
16778
|
IfcNamedUnit: [
|
|
16274
16779
|
{ name: "Dimensions", type: "ref" },
|
|
16275
|
-
{ name: "UnitType", type: "enum", oneOf:
|
|
16780
|
+
{ name: "UnitType", type: "enum", oneOf: xi }
|
|
16276
16781
|
],
|
|
16277
16782
|
IFCOPENINGELEMENT: ["IfcRoot", "IfcObject", "IfcProduct", "IfcElement"],
|
|
16278
16783
|
// ENTITY IfcConnectedFaceSet
|
|
@@ -16391,7 +16896,7 @@ const gp = ["SITE", "FACTORY", "NOTDEFINED"], yp = [
|
|
|
16391
16896
|
"IfcObject",
|
|
16392
16897
|
"IfcProduct",
|
|
16393
16898
|
"IfcElement",
|
|
16394
|
-
{ name: "PredefinedType", type: "enum", oneOf:
|
|
16899
|
+
{ name: "PredefinedType", type: "enum", oneOf: qp }
|
|
16395
16900
|
],
|
|
16396
16901
|
// IFCMEASUREWITHUNIT
|
|
16397
16902
|
IFCRATIOMEASURE: [{ name: "Measure", type: "real" }],
|
|
@@ -16490,9 +16995,9 @@ const gp = ["SITE", "FACTORY", "NOTDEFINED"], yp = [
|
|
|
16490
16995
|
// Name: IfcSIUnitName
|
|
16491
16996
|
IFCSIUNIT: [
|
|
16492
16997
|
{ name: "asterisk", type: "value" },
|
|
16493
|
-
{ name: "UnitType", type: "enum", oneOf:
|
|
16494
|
-
{ name: "Prefix", type: "enum", optional: true, oneOf:
|
|
16495
|
-
{ name: "Name", type: "enum", optional: true, oneOf:
|
|
16998
|
+
{ name: "UnitType", type: "enum", oneOf: xi },
|
|
16999
|
+
{ name: "Prefix", type: "enum", optional: true, oneOf: th },
|
|
17000
|
+
{ name: "Name", type: "enum", optional: true, oneOf: rh }
|
|
16496
17001
|
],
|
|
16497
17002
|
// PredefinedType: OPTIONAL IfcSlabTypeEnum
|
|
16498
17003
|
IFCSLAB: [
|
|
@@ -16500,7 +17005,7 @@ const gp = ["SITE", "FACTORY", "NOTDEFINED"], yp = [
|
|
|
16500
17005
|
"IfcObject",
|
|
16501
17006
|
"IfcProduct",
|
|
16502
17007
|
"IfcElement",
|
|
16503
|
-
{ name: "PredefinedType", type: "enum", oneOf:
|
|
17008
|
+
{ name: "PredefinedType", type: "enum", oneOf: Qp }
|
|
16504
17009
|
],
|
|
16505
17010
|
// InteriorOrExteriorSpace: IfcInternalOrExternalEnum
|
|
16506
17011
|
// ElevationWithFlooring: OPTIONAL IfcLengthMeasure
|
|
@@ -16512,7 +17017,7 @@ const gp = ["SITE", "FACTORY", "NOTDEFINED"], yp = [
|
|
|
16512
17017
|
{
|
|
16513
17018
|
name: "InteriorOrExteriorSpace",
|
|
16514
17019
|
type: "enum",
|
|
16515
|
-
oneOf:
|
|
17020
|
+
oneOf: Zp
|
|
16516
17021
|
},
|
|
16517
17022
|
{ name: "ElevationWithFlooring", type: "real", optional: true }
|
|
16518
17023
|
],
|
|
@@ -16522,7 +17027,7 @@ const gp = ["SITE", "FACTORY", "NOTDEFINED"], yp = [
|
|
|
16522
17027
|
"IfcObject",
|
|
16523
17028
|
"IfcProduct",
|
|
16524
17029
|
"IfcElement",
|
|
16525
|
-
{ name: "ShapeType", type: "enum", oneOf:
|
|
17030
|
+
{ name: "ShapeType", type: "enum", oneOf: eh }
|
|
16526
17031
|
],
|
|
16527
17032
|
// NumberOfRiser: OPTIONAL INTEGER
|
|
16528
17033
|
// NumberOfTreads: OPTIONAL INTEGER
|
|
@@ -16606,22 +17111,21 @@ const gp = ["SITE", "FACTORY", "NOTDEFINED"], yp = [
|
|
|
16606
17111
|
// IfcPositiveLengthMeasure
|
|
16607
17112
|
]
|
|
16608
17113
|
};
|
|
16609
|
-
function
|
|
16610
|
-
var
|
|
16611
|
-
let e2 = t2 ? [t2] : Object.keys(
|
|
16612
|
-
for (let
|
|
16613
|
-
|
|
17114
|
+
function co(t2) {
|
|
17115
|
+
var n2;
|
|
17116
|
+
let e2 = t2 ? [t2] : Object.keys(Gt), r2 = {};
|
|
17117
|
+
for (let i2 of e2)
|
|
17118
|
+
Gt[i2] && (r2[i2] = [], (n2 = Gt[i2]) == null || n2.forEach((s2) => {
|
|
16614
17119
|
if (typeof s2 == "string") {
|
|
16615
|
-
if (!
|
|
17120
|
+
if (!Gt[s2])
|
|
16616
17121
|
throw new Error("Invalid type inheritance");
|
|
16617
|
-
let o2 =
|
|
16618
|
-
r2[
|
|
16619
|
-
} else
|
|
16620
|
-
Rp(s2) && r2[n2].push(s2);
|
|
17122
|
+
let o2 = co(s2)[s2];
|
|
17123
|
+
r2[i2].push(...o2);
|
|
17124
|
+
} else nh(s2) && r2[i2].push(s2);
|
|
16621
17125
|
}));
|
|
16622
17126
|
return r2;
|
|
16623
17127
|
}
|
|
16624
|
-
function
|
|
17128
|
+
function nh(t2) {
|
|
16625
17129
|
const e2 = [
|
|
16626
17130
|
"boolean",
|
|
16627
17131
|
"enum",
|
|
@@ -16643,18 +17147,18 @@ function Rp(t2) {
|
|
|
16643
17147
|
throw new Error("Invalid name " + t2.name);
|
|
16644
17148
|
return true;
|
|
16645
17149
|
}
|
|
16646
|
-
|
|
16647
|
-
function
|
|
16648
|
-
let
|
|
17150
|
+
co();
|
|
17151
|
+
function Br(t2, e2 = We(), r2 = /* @__PURE__ */ new Map(), n2 = true) {
|
|
17152
|
+
let i2 = [], s2 = t2.spaceGraph;
|
|
16649
17153
|
if ("geometries" in t2 && t2.geometries)
|
|
16650
17154
|
for (let o2 of t2.geometries) {
|
|
16651
|
-
let l2, a2,
|
|
17155
|
+
let l2, a2, c2, f3;
|
|
16652
17156
|
if (typeof o2 == "string") {
|
|
16653
17157
|
if (l2 = s2.geometriesById[o2], !l2) {
|
|
16654
17158
|
b$4.warn(`Geometry ${o2} not found.`);
|
|
16655
17159
|
continue;
|
|
16656
17160
|
}
|
|
16657
|
-
a2 = [0, 0, 0],
|
|
17161
|
+
a2 = [0, 0, 0], c2 = 0, f3 = [0, 1, 0];
|
|
16658
17162
|
} else {
|
|
16659
17163
|
if (o2.type !== "reference:geometry") {
|
|
16660
17164
|
b$4.warn(`Operation ${o2.type} not supported.`);
|
|
@@ -16668,62 +17172,62 @@ function mr(t2, e2 = Ge(), r2 = /* @__PURE__ */ new Map(), i2 = true) {
|
|
|
16668
17172
|
}
|
|
16669
17173
|
} else
|
|
16670
17174
|
l2 = d2;
|
|
16671
|
-
a2 = o2.position ?? [0, 0, 0],
|
|
17175
|
+
a2 = o2.position ?? [0, 0, 0], c2 = o2.rotation ?? 0, f3 = o2.rotationAxis ?? [0, 1, 0];
|
|
16672
17176
|
}
|
|
16673
|
-
let
|
|
16674
|
-
for (let d2 of
|
|
16675
|
-
let h2 =
|
|
16676
|
-
|
|
17177
|
+
let u2 = Xi(a2, c2);
|
|
17178
|
+
for (let d2 of u2) {
|
|
17179
|
+
let h2 = cr(d2.position, d2.rotation, f3);
|
|
17180
|
+
n2 && (h2 = Mi(We(), e2, h2));
|
|
16677
17181
|
let p2 = [];
|
|
16678
17182
|
if (l2.type === "geometry:uri" && l2.format === "data3d") {
|
|
16679
|
-
let y2 = r2.get(l2.uri),
|
|
16680
|
-
for (let
|
|
16681
|
-
let v2 = I2
|
|
16682
|
-
p2.push(...
|
|
17183
|
+
let y2 = r2.get(l2.uri), E3 = (y2 == null ? void 0 : y2.meshGeometries) || {};
|
|
17184
|
+
for (let I2 in E3) {
|
|
17185
|
+
let v2 = E3[I2];
|
|
17186
|
+
p2.push(...ln(v2, s2.geometriesById, s2.materialsById, []));
|
|
16683
17187
|
}
|
|
16684
17188
|
} else
|
|
16685
|
-
p2 =
|
|
16686
|
-
let g2 =
|
|
16687
|
-
|
|
17189
|
+
p2 = ln(l2, s2.geometriesById, s2.materialsById, []);
|
|
17190
|
+
let g2 = at(), m2 = M$4();
|
|
17191
|
+
Bi(g2, h2), Di(m2, h2);
|
|
16688
17192
|
for (let y2 of p2)
|
|
16689
|
-
|
|
16690
|
-
|
|
17193
|
+
nn(y2.vertices, h2);
|
|
17194
|
+
i2.push({ meshes: p2, rotation: g2, position: m2 });
|
|
16691
17195
|
}
|
|
16692
17196
|
}
|
|
16693
|
-
return
|
|
17197
|
+
return i2;
|
|
16694
17198
|
}
|
|
16695
|
-
var
|
|
16696
|
-
for (var
|
|
16697
|
-
|
|
16698
|
-
function
|
|
16699
|
-
let
|
|
16700
|
-
return
|
|
16701
|
-
}
|
|
16702
|
-
function
|
|
16703
|
-
let { indices: e2, vertices: r2 } = t2,
|
|
16704
|
-
for (let
|
|
16705
|
-
let d2 = r2[
|
|
16706
|
-
|
|
16707
|
-
}
|
|
16708
|
-
for (let
|
|
16709
|
-
let d2 = e2[
|
|
16710
|
-
|
|
17199
|
+
var U$1 = [];
|
|
17200
|
+
for (var Kr = 0; Kr < 256; ++Kr)
|
|
17201
|
+
U$1.push((Kr + 256).toString(16).substr(1));
|
|
17202
|
+
function Tg(t2, e2, r2) {
|
|
17203
|
+
let n2 = Ie(...t2), i2 = Ie(...e2), s2 = Ie(...r2), o2 = M$4(), l2 = M$4(), a2 = M$4();
|
|
17204
|
+
return Qr(o2, n2, s2), Qr(l2, i2, s2), de(a2, o2, l2), ne(a2, a2), [...a2];
|
|
17205
|
+
}
|
|
17206
|
+
function Io(t2) {
|
|
17207
|
+
let { indices: e2, vertices: r2 } = t2, n2 = [], i2 = [], s2 = [], o2 = ur(r2);
|
|
17208
|
+
for (let u2 = 0; u2 < r2.length; u2 += 3) {
|
|
17209
|
+
let d2 = r2[u2], h2 = r2[u2 + 1], p2 = r2[u2 + 2];
|
|
17210
|
+
n2.push([d2, h2, p2]), i2.push([d2, p2]);
|
|
17211
|
+
}
|
|
17212
|
+
for (let u2 = 0; u2 < e2.length; u2 += 3) {
|
|
17213
|
+
let d2 = e2[u2], h2 = e2[u2 + 1], p2 = e2[u2 + 2];
|
|
17214
|
+
Tg(n2[d2], n2[h2], n2[p2])[1] < 0.01 || s2.push([i2[d2], i2[h2], i2[p2]]);
|
|
16711
17215
|
}
|
|
16712
17216
|
let l2 = [], a2 = [[]];
|
|
16713
17217
|
if (!s2.length)
|
|
16714
17218
|
return { outlines: l2, holes: a2, boundingBox: o2 };
|
|
16715
|
-
let
|
|
16716
|
-
f3 = f3.filter((
|
|
16717
|
-
for (let
|
|
16718
|
-
|
|
17219
|
+
let c2 = polygonUnion(s2), f3 = cleanPolygons(c2, 15e-4);
|
|
17220
|
+
f3 = f3.filter((u2) => u2 && u2.length && polygonArea(u2) > 5e-4);
|
|
17221
|
+
for (let u2 of f3)
|
|
17222
|
+
ar(u2) ? a2[0].push(u2) : l2.push(u2);
|
|
16719
17223
|
return { outlines: l2, holes: a2, boundingBox: o2 };
|
|
16720
17224
|
}
|
|
16721
|
-
function
|
|
16722
|
-
let r2 = e2.applyElementMatrix ?
|
|
16723
|
-
for (let s2 of
|
|
17225
|
+
function Gg(t2, e2 = {}) {
|
|
17226
|
+
let r2 = e2.applyElementMatrix ? Sn(t2, e2.parentMatrix) : void 0, n2 = Br(t2, r2, e2.resources), i2 = [];
|
|
17227
|
+
for (let s2 of n2)
|
|
16724
17228
|
for (let o2 of s2.meshes)
|
|
16725
|
-
|
|
16726
|
-
return
|
|
17229
|
+
i2.push(Io(o2));
|
|
17230
|
+
return i2;
|
|
16727
17231
|
}
|
|
16728
17232
|
const REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
|
|
16729
17233
|
function validate(uuid) {
|
|
@@ -17888,7 +18392,7 @@ function getWallContours(layout) {
|
|
|
17888
18392
|
}
|
|
17889
18393
|
const _FloorPlanCore = class _FloorPlanCore2 {
|
|
17890
18394
|
constructor({ options = {} } = {}) {
|
|
17891
|
-
this.settings = Ge
|
|
18395
|
+
this.settings = Ge(defaultConfig);
|
|
17892
18396
|
this.fpeId = "fpe-" + Math.random().toString(36).replace(/[^a-z]+/g, "").substr(0, 3);
|
|
17893
18397
|
this.computed = {
|
|
17894
18398
|
wallContours: [],
|
|
@@ -17984,7 +18488,7 @@ const _FloorPlanCore = class _FloorPlanCore2 {
|
|
|
17984
18488
|
if (Ce(address == null ? void 0 : address.longitude)) {
|
|
17985
18489
|
this.location.longitude = address.longitude;
|
|
17986
18490
|
}
|
|
17987
|
-
if (ke(address == null ? void 0 : address.bearing)) {
|
|
18491
|
+
if (ke$1(address == null ? void 0 : address.bearing)) {
|
|
17988
18492
|
this.location.bearing = address.bearing;
|
|
17989
18493
|
}
|
|
17990
18494
|
if (!floorData.properties.defaultLayoutId) {
|
|
@@ -18005,10 +18509,10 @@ const _FloorPlanCore = class _FloorPlanCore2 {
|
|
|
18005
18509
|
* Change options after the floor plan engine instance has been created
|
|
18006
18510
|
*/
|
|
18007
18511
|
set(args = {}) {
|
|
18008
|
-
var _a, _b, _c, _d, _e2, _f, _g, _h,
|
|
18512
|
+
var _a, _b, _c, _d, _e2, _f, _g, _h, _i2;
|
|
18009
18513
|
const assetsAreHidden = (_a = this.settings.hideElements) == null ? void 0 : _a.includes("element:asset");
|
|
18010
|
-
let newSettings = Ge
|
|
18011
|
-
if (newSettings.theme) newSettings.theme = ie
|
|
18514
|
+
let newSettings = Ge(args);
|
|
18515
|
+
if (newSettings.theme) newSettings.theme = ie(defaultConfig.theme, newSettings.theme);
|
|
18012
18516
|
if (newSettings.ui) newSettings.ui = { ...defaultConfig.ui, ...newSettings.ui };
|
|
18013
18517
|
if (newSettings.api) newSettings.api = { ...defaultConfig.api, ...newSettings.api };
|
|
18014
18518
|
if (newSettings.units) newSettings.units = { ...defaultConfig.units, ...newSettings.units };
|
|
@@ -18034,7 +18538,7 @@ const _FloorPlanCore = class _FloorPlanCore2 {
|
|
|
18034
18538
|
if (assetsAreHidden && showAssets) loadAllAssetResources(this);
|
|
18035
18539
|
if (((_f = newSettings.theme) == null ? void 0 : _f.wallContours) && !((_g = this.computed.wallContours) == null ? void 0 : _g.length)) {
|
|
18036
18540
|
this.computed.wallContours = getWallContours(this.layout);
|
|
18037
|
-
} else if (!((_h = newSettings.theme) == null ? void 0 : _h.wallContours) && ((
|
|
18541
|
+
} else if (!((_h = newSettings.theme) == null ? void 0 : _h.wallContours) && ((_i2 = this.computed.wallContours) == null ? void 0 : _i2.length)) {
|
|
18038
18542
|
this.computed.wallContours = [];
|
|
18039
18543
|
}
|
|
18040
18544
|
}
|
|
@@ -18203,7 +18707,7 @@ function getElementAnnotations(element) {
|
|
|
18203
18707
|
return shapes;
|
|
18204
18708
|
}
|
|
18205
18709
|
function getShapesFromMesh(element) {
|
|
18206
|
-
const meshContours =
|
|
18710
|
+
const meshContours = Gg(element).sort((a2, b2) => {
|
|
18207
18711
|
if (a2.boundingBox.max[1] < b2.boundingBox.max[1]) return -1;
|
|
18208
18712
|
else return 1;
|
|
18209
18713
|
});
|
|
@@ -18743,7 +19247,7 @@ function getRoomStampContent(space, settings2) {
|
|
|
18743
19247
|
let areaStr;
|
|
18744
19248
|
switch (settings2.units.roomDimensions) {
|
|
18745
19249
|
case "area":
|
|
18746
|
-
areaStr = Me
|
|
19250
|
+
areaStr = Me(area2, settings2.units.system, settings2.units.areaDecimals);
|
|
18747
19251
|
break;
|
|
18748
19252
|
case "boundingBox":
|
|
18749
19253
|
default:
|
|
@@ -18751,7 +19255,7 @@ function getRoomStampContent(space, settings2) {
|
|
|
18751
19255
|
break;
|
|
18752
19256
|
}
|
|
18753
19257
|
let usageDisplay = "";
|
|
18754
|
-
if (!usageDisplay && usage !== "undefined") usageDisplay = _e
|
|
19258
|
+
if (!usageDisplay && usage !== "undefined") usageDisplay = _e(usage || "");
|
|
18755
19259
|
if (usageMapping !== void 0) {
|
|
18756
19260
|
if (typeof usageMapping !== "string") logger.warn("space label mapping has to be a string");
|
|
18757
19261
|
else if (usageMapping.length > 50)
|
|
@@ -19444,16 +19948,16 @@ var eventemitter3 = { exports: {} };
|
|
|
19444
19948
|
Events.prototype = /* @__PURE__ */ Object.create(null);
|
|
19445
19949
|
if (!new Events().__proto__) prefix = false;
|
|
19446
19950
|
}
|
|
19447
|
-
function EE(
|
|
19448
|
-
this.fn =
|
|
19951
|
+
function EE(fn, context2, once) {
|
|
19952
|
+
this.fn = fn;
|
|
19449
19953
|
this.context = context2;
|
|
19450
19954
|
this.once = once || false;
|
|
19451
19955
|
}
|
|
19452
|
-
function addListener(emitter, event,
|
|
19453
|
-
if (typeof
|
|
19956
|
+
function addListener(emitter, event, fn, context2, once) {
|
|
19957
|
+
if (typeof fn !== "function") {
|
|
19454
19958
|
throw new TypeError("The listener must be a function");
|
|
19455
19959
|
}
|
|
19456
|
-
var listener = new EE(
|
|
19960
|
+
var listener = new EE(fn, context2 || emitter, once), evt = prefix ? prefix + event : event;
|
|
19457
19961
|
if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
|
|
19458
19962
|
else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
|
|
19459
19963
|
else emitter._events[evt] = [emitter._events[evt], listener];
|
|
@@ -19544,27 +20048,27 @@ var eventemitter3 = { exports: {} };
|
|
|
19544
20048
|
}
|
|
19545
20049
|
return true;
|
|
19546
20050
|
};
|
|
19547
|
-
EventEmitter2.prototype.on = function on2(event,
|
|
19548
|
-
return addListener(this, event,
|
|
20051
|
+
EventEmitter2.prototype.on = function on2(event, fn, context2) {
|
|
20052
|
+
return addListener(this, event, fn, context2, false);
|
|
19549
20053
|
};
|
|
19550
|
-
EventEmitter2.prototype.once = function once(event,
|
|
19551
|
-
return addListener(this, event,
|
|
20054
|
+
EventEmitter2.prototype.once = function once(event, fn, context2) {
|
|
20055
|
+
return addListener(this, event, fn, context2, true);
|
|
19552
20056
|
};
|
|
19553
|
-
EventEmitter2.prototype.removeListener = function removeListener(event,
|
|
20057
|
+
EventEmitter2.prototype.removeListener = function removeListener(event, fn, context2, once) {
|
|
19554
20058
|
var evt = prefix ? prefix + event : event;
|
|
19555
20059
|
if (!this._events[evt]) return this;
|
|
19556
|
-
if (!
|
|
20060
|
+
if (!fn) {
|
|
19557
20061
|
clearEvent(this, evt);
|
|
19558
20062
|
return this;
|
|
19559
20063
|
}
|
|
19560
20064
|
var listeners = this._events[evt];
|
|
19561
20065
|
if (listeners.fn) {
|
|
19562
|
-
if (listeners.fn ===
|
|
20066
|
+
if (listeners.fn === fn && (!once || listeners.once) && (!context2 || listeners.context === context2)) {
|
|
19563
20067
|
clearEvent(this, evt);
|
|
19564
20068
|
}
|
|
19565
20069
|
} else {
|
|
19566
20070
|
for (var i2 = 0, events = [], length2 = listeners.length; i2 < length2; i2++) {
|
|
19567
|
-
if (listeners[i2].fn !==
|
|
20071
|
+
if (listeners[i2].fn !== fn || once && !listeners[i2].once || context2 && listeners[i2].context !== context2) {
|
|
19568
20072
|
events.push(listeners[i2]);
|
|
19569
20073
|
}
|
|
19570
20074
|
}
|
|
@@ -19613,15 +20117,15 @@ punycode$1.exports;
|
|
|
19613
20117
|
function error(type2) {
|
|
19614
20118
|
throw new RangeError(errors[type2]);
|
|
19615
20119
|
}
|
|
19616
|
-
function map2(array,
|
|
20120
|
+
function map2(array, fn) {
|
|
19617
20121
|
var length2 = array.length;
|
|
19618
20122
|
var result = [];
|
|
19619
20123
|
while (length2--) {
|
|
19620
|
-
result[length2] =
|
|
20124
|
+
result[length2] = fn(array[length2]);
|
|
19621
20125
|
}
|
|
19622
20126
|
return result;
|
|
19623
20127
|
}
|
|
19624
|
-
function mapDomain(string,
|
|
20128
|
+
function mapDomain(string, fn) {
|
|
19625
20129
|
var parts = string.split("@");
|
|
19626
20130
|
var result = "";
|
|
19627
20131
|
if (parts.length > 1) {
|
|
@@ -19630,7 +20134,7 @@ punycode$1.exports;
|
|
|
19630
20134
|
}
|
|
19631
20135
|
string = string.replace(regexSeparators, ".");
|
|
19632
20136
|
var labels = string.split(".");
|
|
19633
|
-
var encoded = map2(labels,
|
|
20137
|
+
var encoded = map2(labels, fn).join(".");
|
|
19634
20138
|
return result + encoded;
|
|
19635
20139
|
}
|
|
19636
20140
|
function ucs2decode(string) {
|
|
@@ -20120,9 +20624,9 @@ var doEval = function doEval2(name) {
|
|
|
20120
20624
|
} else if (name === "%AsyncGeneratorFunction%") {
|
|
20121
20625
|
value = getEvalledConstructor("async function* () {}");
|
|
20122
20626
|
} else if (name === "%AsyncGenerator%") {
|
|
20123
|
-
var
|
|
20124
|
-
if (
|
|
20125
|
-
value =
|
|
20627
|
+
var fn = doEval2("%AsyncGeneratorFunction%");
|
|
20628
|
+
if (fn) {
|
|
20629
|
+
value = fn.prototype;
|
|
20126
20630
|
}
|
|
20127
20631
|
} else if (name === "%AsyncIteratorPrototype%") {
|
|
20128
20632
|
var gen = doEval2("%AsyncGenerator%");
|
|
@@ -20384,8 +20888,8 @@ var hasDescriptors = hasPropertyDescriptors_1();
|
|
|
20384
20888
|
var gOPD = gopd$1;
|
|
20385
20889
|
var $TypeError$1 = type;
|
|
20386
20890
|
var $floor$1 = GetIntrinsic$2("%Math.floor%");
|
|
20387
|
-
var setFunctionLength = function setFunctionLength2(
|
|
20388
|
-
if (typeof
|
|
20891
|
+
var setFunctionLength = function setFunctionLength2(fn, length2) {
|
|
20892
|
+
if (typeof fn !== "function") {
|
|
20389
20893
|
throw new $TypeError$1("`fn` is not a function");
|
|
20390
20894
|
}
|
|
20391
20895
|
if (typeof length2 !== "number" || length2 < 0 || length2 > 4294967295 || $floor$1(length2) !== length2) {
|
|
@@ -20394,8 +20898,8 @@ var setFunctionLength = function setFunctionLength2(fn2, length2) {
|
|
|
20394
20898
|
var loose = arguments.length > 2 && !!arguments[2];
|
|
20395
20899
|
var functionLengthIsConfigurable = true;
|
|
20396
20900
|
var functionLengthIsWritable = true;
|
|
20397
|
-
if ("length" in
|
|
20398
|
-
var desc = gOPD(
|
|
20901
|
+
if ("length" in fn && gOPD) {
|
|
20902
|
+
var desc = gOPD(fn, "length");
|
|
20399
20903
|
if (desc && !desc.configurable) {
|
|
20400
20904
|
functionLengthIsConfigurable = false;
|
|
20401
20905
|
}
|
|
@@ -20407,7 +20911,7 @@ var setFunctionLength = function setFunctionLength2(fn2, length2) {
|
|
|
20407
20911
|
if (hasDescriptors) {
|
|
20408
20912
|
define(
|
|
20409
20913
|
/** @type {Parameters<define>[0]} */
|
|
20410
|
-
|
|
20914
|
+
fn,
|
|
20411
20915
|
"length",
|
|
20412
20916
|
length2,
|
|
20413
20917
|
true,
|
|
@@ -20416,13 +20920,13 @@ var setFunctionLength = function setFunctionLength2(fn2, length2) {
|
|
|
20416
20920
|
} else {
|
|
20417
20921
|
define(
|
|
20418
20922
|
/** @type {Parameters<define>[0]} */
|
|
20419
|
-
|
|
20923
|
+
fn,
|
|
20420
20924
|
"length",
|
|
20421
20925
|
length2
|
|
20422
20926
|
);
|
|
20423
20927
|
}
|
|
20424
20928
|
}
|
|
20425
|
-
return
|
|
20929
|
+
return fn;
|
|
20426
20930
|
};
|
|
20427
20931
|
(function(module) {
|
|
20428
20932
|
var bind3 = functionBind;
|
|
@@ -21283,15 +21787,15 @@ var isBuffer = function isBuffer2(obj) {
|
|
|
21283
21787
|
var combine = function combine2(a2, b2) {
|
|
21284
21788
|
return [].concat(a2, b2);
|
|
21285
21789
|
};
|
|
21286
|
-
var maybeMap = function maybeMap2(val,
|
|
21790
|
+
var maybeMap = function maybeMap2(val, fn) {
|
|
21287
21791
|
if (isArray$2(val)) {
|
|
21288
21792
|
var mapped = [];
|
|
21289
21793
|
for (var i2 = 0; i2 < val.length; i2 += 1) {
|
|
21290
|
-
mapped.push(
|
|
21794
|
+
mapped.push(fn(val[i2]));
|
|
21291
21795
|
}
|
|
21292
21796
|
return mapped;
|
|
21293
21797
|
}
|
|
21294
|
-
return
|
|
21798
|
+
return fn(val);
|
|
21295
21799
|
};
|
|
21296
21800
|
var utils$3 = {
|
|
21297
21801
|
arrayToObject,
|
|
@@ -24724,16 +25228,16 @@ class Rectangle {
|
|
|
24724
25228
|
const x0 = this.left, x1 = this.right, y0 = this.top, y1 = this.bottom;
|
|
24725
25229
|
if (x1 <= x0 || y1 <= y0)
|
|
24726
25230
|
return false;
|
|
24727
|
-
const lt = tempPoints$1[0].set(other.left, other.top), lb = tempPoints$1[1].set(other.left, other.bottom),
|
|
24728
|
-
if (
|
|
25231
|
+
const lt = tempPoints$1[0].set(other.left, other.top), lb = tempPoints$1[1].set(other.left, other.bottom), rt = tempPoints$1[2].set(other.right, other.top), rb = tempPoints$1[3].set(other.right, other.bottom);
|
|
25232
|
+
if (rt.x <= lt.x || lb.y <= lt.y)
|
|
24729
25233
|
return false;
|
|
24730
25234
|
const s2 = Math.sign(transform.a * transform.d - transform.b * transform.c);
|
|
24731
|
-
if (s2 === 0 || (transform.apply(lt, lt), transform.apply(lb, lb), transform.apply(
|
|
25235
|
+
if (s2 === 0 || (transform.apply(lt, lt), transform.apply(lb, lb), transform.apply(rt, rt), transform.apply(rb, rb), Math.max(lt.x, lb.x, rt.x, rb.x) <= x0 || Math.min(lt.x, lb.x, rt.x, rb.x) >= x1 || Math.max(lt.y, lb.y, rt.y, rb.y) <= y0 || Math.min(lt.y, lb.y, rt.y, rb.y) >= y1))
|
|
24732
25236
|
return false;
|
|
24733
25237
|
const nx = s2 * (lb.y - lt.y), ny = s2 * (lt.x - lb.x), n00 = nx * x0 + ny * y0, n10 = nx * x1 + ny * y0, n01 = nx * x0 + ny * y1, n11 = nx * x1 + ny * y1;
|
|
24734
25238
|
if (Math.max(n00, n10, n01, n11) <= nx * lt.x + ny * lt.y || Math.min(n00, n10, n01, n11) >= nx * rb.x + ny * rb.y)
|
|
24735
25239
|
return false;
|
|
24736
|
-
const mx = s2 * (lt.y -
|
|
25240
|
+
const mx = s2 * (lt.y - rt.y), my = s2 * (rt.x - lt.x), m00 = mx * x0 + my * y0, m10 = mx * x1 + my * y0, m01 = mx * x0 + my * y1, m11 = mx * x1 + my * y1;
|
|
24737
25241
|
return !(Math.max(m00, m10, m01, m11) <= mx * lt.x + my * lt.y || Math.min(m00, m10, m01, m11) >= mx * rb.x + my * rb.y);
|
|
24738
25242
|
}
|
|
24739
25243
|
/**
|
|
@@ -24894,8 +25398,8 @@ class Polygon {
|
|
|
24894
25398
|
let inside = false;
|
|
24895
25399
|
const length2 = this.points.length / 2;
|
|
24896
25400
|
for (let i2 = 0, j2 = length2 - 1; i2 < length2; j2 = i2++) {
|
|
24897
|
-
const
|
|
24898
|
-
|
|
25401
|
+
const xi2 = this.points[i2 * 2], yi = this.points[i2 * 2 + 1], xj = this.points[j2 * 2], yj = this.points[j2 * 2 + 1];
|
|
25402
|
+
yi > y2 != yj > y2 && x2 < (xj - xi2) * ((y2 - yi) / (yj - yi)) + xi2 && (inside = !inside);
|
|
24899
25403
|
}
|
|
24900
25404
|
return inside;
|
|
24901
25405
|
}
|
|
@@ -26069,8 +26573,8 @@ function mapType(gl2, type2) {
|
|
|
26069
26573
|
const typeNames = Object.keys(GL_TO_GLSL_TYPES);
|
|
26070
26574
|
GL_TABLE = {};
|
|
26071
26575
|
for (let i2 = 0; i2 < typeNames.length; ++i2) {
|
|
26072
|
-
const
|
|
26073
|
-
GL_TABLE[gl2[
|
|
26576
|
+
const tn2 = typeNames[i2];
|
|
26577
|
+
GL_TABLE[gl2[tn2]] = GL_TO_GLSL_TYPES[tn2];
|
|
26074
26578
|
}
|
|
26075
26579
|
}
|
|
26076
26580
|
return GL_TABLE[type2];
|
|
@@ -27355,12 +27859,12 @@ class TextureUvs {
|
|
|
27355
27859
|
* @param rotate - Rotation of frame, see {@link PIXI.groupD8}
|
|
27356
27860
|
*/
|
|
27357
27861
|
set(frame, baseFrame, rotate2) {
|
|
27358
|
-
const tw = baseFrame.width,
|
|
27862
|
+
const tw = baseFrame.width, th2 = baseFrame.height;
|
|
27359
27863
|
if (rotate2) {
|
|
27360
|
-
const w2 = frame.width / 2 / tw, h2 = frame.height / 2 /
|
|
27864
|
+
const w2 = frame.width / 2 / tw, h2 = frame.height / 2 / th2, cX = frame.x / tw + w2, cY = frame.y / th2 + h2;
|
|
27361
27865
|
rotate2 = groupD8.add(rotate2, groupD8.NW), this.x0 = cX + w2 * groupD8.uX(rotate2), this.y0 = cY + h2 * groupD8.uY(rotate2), rotate2 = groupD8.add(rotate2, 2), this.x1 = cX + w2 * groupD8.uX(rotate2), this.y1 = cY + h2 * groupD8.uY(rotate2), rotate2 = groupD8.add(rotate2, 2), this.x2 = cX + w2 * groupD8.uX(rotate2), this.y2 = cY + h2 * groupD8.uY(rotate2), rotate2 = groupD8.add(rotate2, 2), this.x3 = cX + w2 * groupD8.uX(rotate2), this.y3 = cY + h2 * groupD8.uY(rotate2);
|
|
27362
27866
|
} else
|
|
27363
|
-
this.x0 = frame.x / tw, this.y0 = frame.y /
|
|
27867
|
+
this.x0 = frame.x / tw, this.y0 = frame.y / th2, this.x1 = (frame.x + frame.width) / tw, this.y1 = frame.y / th2, this.x2 = (frame.x + frame.width) / tw, this.y2 = (frame.y + frame.height) / th2, this.x3 = frame.x / tw, this.y3 = (frame.y + frame.height) / th2;
|
|
27364
27868
|
this.uvsFloat32[0] = this.x0, this.uvsFloat32[1] = this.y0, this.uvsFloat32[2] = this.x1, this.uvsFloat32[3] = this.y1, this.uvsFloat32[4] = this.x2, this.uvsFloat32[5] = this.y2, this.uvsFloat32[6] = this.x3, this.uvsFloat32[7] = this.y3;
|
|
27365
27869
|
}
|
|
27366
27870
|
}
|
|
@@ -28064,9 +28568,9 @@ class FilterSystem {
|
|
|
28064
28568
|
* @param rect - second param
|
|
28065
28569
|
*/
|
|
28066
28570
|
transformAABB(matrix, rect) {
|
|
28067
|
-
const lt = tempPoints[0], lb = tempPoints[1],
|
|
28068
|
-
lt.set(rect.left, rect.top), lb.set(rect.left, rect.bottom),
|
|
28069
|
-
const x0 = Math.min(lt.x, lb.x,
|
|
28571
|
+
const lt = tempPoints[0], lb = tempPoints[1], rt = tempPoints[2], rb = tempPoints[3];
|
|
28572
|
+
lt.set(rect.left, rect.top), lb.set(rect.left, rect.bottom), rt.set(rect.right, rect.top), rb.set(rect.right, rect.bottom), matrix.apply(lt, lt), matrix.apply(lb, lb), matrix.apply(rt, rt), matrix.apply(rb, rb);
|
|
28573
|
+
const x0 = Math.min(lt.x, lb.x, rt.x, rb.x), y0 = Math.min(lt.y, lb.y, rt.y, rb.y), x1 = Math.max(lt.x, lb.x, rt.x, rb.x), y1 = Math.max(lt.y, lb.y, rt.y, rb.y);
|
|
28070
28574
|
rect.x = x0, rect.y = y0, rect.width = x1 - x0, rect.height = y1 - y0;
|
|
28071
28575
|
}
|
|
28072
28576
|
roundFrame(frame, resolution, bindingSourceFrame, bindingDestinationFrame, transform) {
|
|
@@ -30723,8 +31227,8 @@ class TickerListener {
|
|
|
30723
31227
|
* @param priority - The priority for emitting
|
|
30724
31228
|
* @param once - If the handler should fire once
|
|
30725
31229
|
*/
|
|
30726
|
-
constructor(
|
|
30727
|
-
this.next = null, this.previous = null, this._destroyed = false, this.fn =
|
|
31230
|
+
constructor(fn, context2 = null, priority = 0, once = false) {
|
|
31231
|
+
this.next = null, this.previous = null, this._destroyed = false, this.fn = fn, this.context = context2, this.priority = priority, this.once = once;
|
|
30728
31232
|
}
|
|
30729
31233
|
/**
|
|
30730
31234
|
* Simple compare function to figure out if a function and context match.
|
|
@@ -30733,8 +31237,8 @@ class TickerListener {
|
|
|
30733
31237
|
* @param context - The listener context
|
|
30734
31238
|
* @returns `true` if the listener match the arguments
|
|
30735
31239
|
*/
|
|
30736
|
-
match(
|
|
30737
|
-
return this.fn ===
|
|
31240
|
+
match(fn, context2 = null) {
|
|
31241
|
+
return this.fn === fn && this.context === context2;
|
|
30738
31242
|
}
|
|
30739
31243
|
/**
|
|
30740
31244
|
* Emit by calling the current function.
|
|
@@ -30810,8 +31314,8 @@ const _Ticker = class _Ticker2 {
|
|
|
30810
31314
|
* @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting
|
|
30811
31315
|
* @returns This instance of a ticker
|
|
30812
31316
|
*/
|
|
30813
|
-
add(
|
|
30814
|
-
return this._addListener(new TickerListener(
|
|
31317
|
+
add(fn, context2, priority = UPDATE_PRIORITY.NORMAL) {
|
|
31318
|
+
return this._addListener(new TickerListener(fn, context2, priority));
|
|
30815
31319
|
}
|
|
30816
31320
|
/**
|
|
30817
31321
|
* Add a handler for the tick event which is only execute once.
|
|
@@ -30820,8 +31324,8 @@ const _Ticker = class _Ticker2 {
|
|
|
30820
31324
|
* @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting
|
|
30821
31325
|
* @returns This instance of a ticker
|
|
30822
31326
|
*/
|
|
30823
|
-
addOnce(
|
|
30824
|
-
return this._addListener(new TickerListener(
|
|
31327
|
+
addOnce(fn, context2, priority = UPDATE_PRIORITY.NORMAL) {
|
|
31328
|
+
return this._addListener(new TickerListener(fn, context2, priority, true));
|
|
30825
31329
|
}
|
|
30826
31330
|
/**
|
|
30827
31331
|
* Internally adds the event handler so that it can be sorted by priority.
|
|
@@ -30854,10 +31358,10 @@ const _Ticker = class _Ticker2 {
|
|
|
30854
31358
|
* @param context - The listener context to be removed
|
|
30855
31359
|
* @returns This instance of a ticker
|
|
30856
31360
|
*/
|
|
30857
|
-
remove(
|
|
31361
|
+
remove(fn, context2) {
|
|
30858
31362
|
let listener = this._head.next;
|
|
30859
31363
|
for (; listener; )
|
|
30860
|
-
listener.match(
|
|
31364
|
+
listener.match(fn, context2) ? listener = listener.destroy() : listener = listener.next;
|
|
30861
31365
|
return this._head.next || this._cancelIfNeeded(), this;
|
|
30862
31366
|
}
|
|
30863
31367
|
/**
|
|
@@ -37312,9 +37816,9 @@ class EventBoundary {
|
|
|
37312
37816
|
* @param type - The type of upstream event to map.
|
|
37313
37817
|
* @param fn - The mapping method. The context of this function must be bound manually, if desired.
|
|
37314
37818
|
*/
|
|
37315
|
-
addEventMapping(type2,
|
|
37819
|
+
addEventMapping(type2, fn) {
|
|
37316
37820
|
this.mappingTable[type2] || (this.mappingTable[type2] = []), this.mappingTable[type2].push({
|
|
37317
|
-
fn
|
|
37821
|
+
fn,
|
|
37318
37822
|
priority: 0
|
|
37319
37823
|
}), this.mappingTable[type2].sort((a2, b2) => a2.priority - b2.priority);
|
|
37320
37824
|
}
|
|
@@ -37349,7 +37853,7 @@ class EventBoundary {
|
|
|
37349
37853
|
*/
|
|
37350
37854
|
hitTest(x2, y2) {
|
|
37351
37855
|
EventsTicker.pauseUpdate = true;
|
|
37352
|
-
const
|
|
37856
|
+
const fn = this._isPointerMoveEvent && this.enableGlobalMoveEvents ? "hitTestMoveRecursive" : "hitTestRecursive", invertedPath = this[fn](
|
|
37353
37857
|
this.rootTarget,
|
|
37354
37858
|
this.rootTarget.eventMode,
|
|
37355
37859
|
tempHitLocation.set(x2, y2),
|
|
@@ -38110,7 +38614,7 @@ const MOUSE_POINTER_ID = 1, TOUCH_TO_POINTER = {
|
|
|
38110
38614
|
normalizeToPointerData(event) {
|
|
38111
38615
|
const normalizedEvents = [];
|
|
38112
38616
|
if (this.supportsTouchEvents && event instanceof TouchEvent)
|
|
38113
|
-
for (let i2 = 0,
|
|
38617
|
+
for (let i2 = 0, li2 = event.changedTouches.length; i2 < li2; i2++) {
|
|
38114
38618
|
const touch = event.changedTouches[i2];
|
|
38115
38619
|
typeof touch.button > "u" && (touch.button = 0), typeof touch.buttons > "u" && (touch.buttons = 1), typeof touch.isPrimary > "u" && (touch.isPrimary = event.touches.length === 1 && event.type === "touchstart"), typeof touch.width > "u" && (touch.width = touch.radiusX || 1), typeof touch.height > "u" && (touch.height = touch.radiusY || 1), typeof touch.tiltX > "u" && (touch.tiltX = 0), typeof touch.tiltY > "u" && (touch.tiltY = 0), typeof touch.pointerType > "u" && (touch.pointerType = "touch"), typeof touch.pointerId > "u" && (touch.pointerId = touch.identifier || 0), typeof touch.pressure > "u" && (touch.pressure = touch.force || 0.5), typeof touch.twist > "u" && (touch.twist = 0), typeof touch.tangentialPressure > "u" && (touch.tangentialPressure = 0), typeof touch.layerX > "u" && (touch.layerX = touch.offsetX = touch.clientX), typeof touch.layerY > "u" && (touch.layerY = touch.offsetY = touch.clientY), touch.isNormalized = true, touch.type = event.type, normalizedEvents.push(touch);
|
|
38116
38620
|
}
|
|
@@ -40495,7 +40999,7 @@ class A extends f$1 {
|
|
|
40495
40999
|
this.update();
|
|
40496
41000
|
}
|
|
40497
41001
|
}
|
|
40498
|
-
const
|
|
41002
|
+
const _ = {
|
|
40499
41003
|
minWidth: null,
|
|
40500
41004
|
minHeight: null,
|
|
40501
41005
|
maxWidth: null,
|
|
@@ -40507,7 +41011,7 @@ class T extends f$1 {
|
|
|
40507
41011
|
constructor(t2, i2 = {}) {
|
|
40508
41012
|
super(t2);
|
|
40509
41013
|
o$1(this, "options");
|
|
40510
|
-
this.options = Object.assign({},
|
|
41014
|
+
this.options = Object.assign({}, _, i2), this.clamp();
|
|
40511
41015
|
}
|
|
40512
41016
|
resize() {
|
|
40513
41017
|
this.clamp();
|
|
@@ -41101,7 +41605,7 @@ const Q = {
|
|
|
41101
41605
|
trackpadPinch: false,
|
|
41102
41606
|
wheelZoom: true
|
|
41103
41607
|
};
|
|
41104
|
-
class
|
|
41608
|
+
class J2 extends f$1 {
|
|
41105
41609
|
constructor(t2, i2 = {}) {
|
|
41106
41610
|
super(t2);
|
|
41107
41611
|
o$1(this, "options");
|
|
@@ -41623,7 +42127,7 @@ class ht extends Container {
|
|
|
41623
42127
|
return this.plugins.add("follow", new F(this, t2, i2)), this;
|
|
41624
42128
|
}
|
|
41625
42129
|
wheel(t2) {
|
|
41626
|
-
return this.plugins.add("wheel", new
|
|
42130
|
+
return this.plugins.add("wheel", new J2(this, t2)), this;
|
|
41627
42131
|
}
|
|
41628
42132
|
animate(t2) {
|
|
41629
42133
|
return this.plugins.add("animate", new k$1(this, t2)), this;
|
|
@@ -41724,12 +42228,12 @@ class CursorCoordinates extends Helper {
|
|
|
41724
42228
|
if (!this.rootEl) return;
|
|
41725
42229
|
this.setData({
|
|
41726
42230
|
cursor: [
|
|
41727
|
-
H$
|
|
42231
|
+
H$5(
|
|
41728
42232
|
this.floorPlan.interaction.cursor[0],
|
|
41729
42233
|
this.floorPlan.settings.units.system,
|
|
41730
42234
|
this.floorPlan.settings.units.lengthDecimals
|
|
41731
42235
|
),
|
|
41732
|
-
H$
|
|
42236
|
+
H$5(
|
|
41733
42237
|
this.floorPlan.interaction.cursor[1],
|
|
41734
42238
|
this.floorPlan.settings.units.system,
|
|
41735
42239
|
this.floorPlan.settings.units.lengthDecimals
|
|
@@ -41928,7 +42432,14 @@ const defaults = {
|
|
|
41928
42432
|
tip: 15
|
|
41929
42433
|
};
|
|
41930
42434
|
class InfoWindow {
|
|
41931
|
-
constructor({
|
|
42435
|
+
constructor({
|
|
42436
|
+
width,
|
|
42437
|
+
height,
|
|
42438
|
+
position = [0, 0],
|
|
42439
|
+
html = "",
|
|
42440
|
+
closeButton = true,
|
|
42441
|
+
floorPlan
|
|
42442
|
+
} = {}) {
|
|
41932
42443
|
this._floorPlan = floorPlan;
|
|
41933
42444
|
this.position = position;
|
|
41934
42445
|
this.html = html;
|
|
@@ -42578,14 +43089,14 @@ function getPolygonShapes(contours = []) {
|
|
|
42578
43089
|
return [{ type: "curve:polygonWithHoles", polygons: contours }];
|
|
42579
43090
|
}
|
|
42580
43091
|
function getBoundingBoxContour(boundingBox) {
|
|
42581
|
-
const
|
|
42582
|
-
if (
|
|
43092
|
+
const bp = boundingBox;
|
|
43093
|
+
if (bp) {
|
|
42583
43094
|
let bb;
|
|
42584
43095
|
bb = [
|
|
42585
|
-
[
|
|
42586
|
-
[
|
|
42587
|
-
[
|
|
42588
|
-
[
|
|
43096
|
+
[bp.min[0], bp.min[2]],
|
|
43097
|
+
[bp.min[0], bp.max[2]],
|
|
43098
|
+
[bp.max[0], bp.max[2]],
|
|
43099
|
+
[bp.max[0], bp.min[2]]
|
|
42589
43100
|
];
|
|
42590
43101
|
return [bb];
|
|
42591
43102
|
} else {
|
|
@@ -43674,8 +44185,8 @@ const alignments = {
|
|
|
43674
44185
|
class Ticker {
|
|
43675
44186
|
constructor() {
|
|
43676
44187
|
this.methods = {};
|
|
43677
|
-
this.add = (name,
|
|
43678
|
-
this.methods[name] = { fn
|
|
44188
|
+
this.add = (name, fn, ctx) => {
|
|
44189
|
+
this.methods[name] = { fn, ctx };
|
|
43679
44190
|
};
|
|
43680
44191
|
this.remove = (name) => {
|
|
43681
44192
|
delete this.methods[name];
|
|
@@ -43769,10 +44280,10 @@ class WebGlView extends TinyEmitter {
|
|
|
43769
44280
|
let tickerMethods = Object.keys(this.ticker.methods).length;
|
|
43770
44281
|
if (this.viewportNeedsUpdate || tickerMethods) {
|
|
43771
44282
|
if ((_a = this.ticker) == null ? void 0 : _a.methods) {
|
|
43772
|
-
Object.values(this.ticker.methods).forEach(({ fn
|
|
43773
|
-
if (typeof
|
|
43774
|
-
if (ctx)
|
|
43775
|
-
else
|
|
44283
|
+
Object.values(this.ticker.methods).forEach(({ fn, ctx }) => {
|
|
44284
|
+
if (typeof fn !== "function") return;
|
|
44285
|
+
if (ctx) fn.call(ctx, deltaTime);
|
|
44286
|
+
else fn(deltaTime);
|
|
43776
44287
|
});
|
|
43777
44288
|
}
|
|
43778
44289
|
this._viewport.update(deltaTime);
|
|
@@ -44261,11 +44772,11 @@ class PolygonHelper extends Helper {
|
|
|
44261
44772
|
}
|
|
44262
44773
|
getLengthText(length2) {
|
|
44263
44774
|
const { units } = this.floorPlan.settings;
|
|
44264
|
-
return H$
|
|
44775
|
+
return H$5(length2, units.system, units.lengthDecimals);
|
|
44265
44776
|
}
|
|
44266
44777
|
getAreaText(area2) {
|
|
44267
44778
|
const { units } = this.floorPlan.settings;
|
|
44268
|
-
return Me
|
|
44779
|
+
return Me(area2, units.system, units.areaDecimals);
|
|
44269
44780
|
}
|
|
44270
44781
|
reset() {
|
|
44271
44782
|
this.drawing = false;
|