@mlightcad/cad-simple-viewer 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +328 -255
- package/dist/index.umd.cjs +8 -7
- package/dist/mtext-renderer-worker.js +1110 -1101
- package/lib/app/AcApContext.js +1 -1
- package/lib/app/AcApContext.js.map +1 -1
- package/lib/editor/view/AcEdBaseView.d.ts +11 -7
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/editor/view/AcEdLayerInfo.d.ts +21 -0
- package/lib/editor/view/AcEdLayerInfo.d.ts.map +1 -0
- package/lib/editor/view/AcEdLayerInfo.js +2 -0
- package/lib/editor/view/AcEdLayerInfo.js.map +1 -0
- package/lib/editor/view/index.d.ts +1 -0
- package/lib/editor/view/index.d.ts.map +1 -1
- package/lib/editor/view/index.js +1 -0
- package/lib/editor/view/index.js.map +1 -1
- package/lib/view/AcTrScene.d.ts +10 -1
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +17 -0
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +9 -1
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +21 -1
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AcDbLayout as qe, AcCmEventManager as M, AcGePoint2d as S, AcGeBox2d as L, AcCmColor as Qe, AcGeBox3d as Ze, AcDbDatabase as ht, AcDbFileType as _e, AcGeMathUtil as lt, AcGeVector3d as fe, AcGeGeometryUtil as dt, AcGeVector2d as
|
|
1
|
+
import { AcDbLayout as qe, AcCmEventManager as M, AcGePoint2d as S, AcGeBox2d as L, AcCmColor as Qe, AcGeBox3d as Ze, AcDbDatabase as ht, AcDbFileType as _e, AcGeMathUtil as lt, AcGeVector3d as fe, AcGeGeometryUtil as dt, AcGeVector2d as Le, acdbHostApplicationServices as Je, AcDbViewport as Ke, AcDbRasterImage as et, AcDbRay as tt, AcDbXline as it, AcDbDatabaseConverter as ut, createWorkerApi as mt, AcDbLinetypeTableRecord as gt, AcDbTextStyleTableRecord as pt, AcDbDimStyleTableRecord as yt, AcDbLayerTableRecord as ft, AcDbViewportTableRecord as xt, AcDbBlockTableRecord as _t, AcDbBatchProcessing as bt, AcDbRasterImageDef as wt, AcDbArc as vt, AcDbCircle as St, AcDbEllipse as It, AcDbLine as Bt, AcGePoint3d as ze, AcDbSpline as Pe, AcDbPoint as Mt, AcDbTrace as At, AcDbPolyline as Re, AcDbHatch as Ct, AcGePolyline2d as Lt, AcGeLoop2d as Et, AcGeLine2d as Tt, AcGeCircArc2d as Dt, AcGeEllipseArc2d as zt, AcGeSpline3d as Oe, AcDbTable as Pt, AcDbText as Rt, AcDbMText as Ot, AcDbLeader as Vt, AcDbAlignedDimension as jt, AcDb3PointAngularDimension as Gt, AcDbOrdinateDimension as kt, AcDbRadialDimension as Ft, AcDbDiametricDimension as Nt, AcDbWipeout as Ut, AcDbBlockReference as Wt, AcDbDxfConverter as Xt, AcDbDatabaseConverterManager as Ve } from "@mlightcad/data-model";
|
|
2
2
|
import * as d from "three";
|
|
3
|
-
import { UnifiedRenderer as
|
|
4
|
-
import { mergeGeometries as
|
|
5
|
-
import { OrbitControls as
|
|
6
|
-
import { find as
|
|
7
|
-
import
|
|
8
|
-
class
|
|
3
|
+
import { UnifiedRenderer as $t, FontManager as J } from "@mlightcad/mtext-renderer";
|
|
4
|
+
import { mergeGeometries as Yt } from "three/examples/jsm/utils/BufferGeometryUtils.js";
|
|
5
|
+
import { OrbitControls as Ht } from "three/examples/jsm/controls/OrbitControls";
|
|
6
|
+
import { find as qt, findIndex as Qt, defaults as Zt } from "lodash-es";
|
|
7
|
+
import Jt from "three/examples/jsm/libs/stats.module";
|
|
8
|
+
class Kt {
|
|
9
9
|
/**
|
|
10
10
|
* Creates a new application context that binds a document with its view.
|
|
11
11
|
*
|
|
@@ -24,7 +24,7 @@ class Jt {
|
|
|
24
24
|
}), t.database.events.entityModified.addEventListener((i) => {
|
|
25
25
|
this.view.updateEntity(i.entity);
|
|
26
26
|
}), t.database.events.layerModified.addEventListener((i) => {
|
|
27
|
-
this._view.
|
|
27
|
+
this._view.updateLayer(i.layer);
|
|
28
28
|
}), t.database.events.headerSysVarChanged.addEventListener((i) => {
|
|
29
29
|
i.name == "pdmode" && this._view.rerenderPoints(i.database.pdmode);
|
|
30
30
|
}), t.database.events.dictObjetSet.addEventListener((i) => {
|
|
@@ -155,7 +155,7 @@ class j {
|
|
|
155
155
|
execute(e) {
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
class
|
|
158
|
+
class ei {
|
|
159
159
|
constructor(e) {
|
|
160
160
|
this._index = 0, this._commands = [], e.forEach((t) => {
|
|
161
161
|
const i = t.groupName;
|
|
@@ -272,7 +272,7 @@ const z = class z {
|
|
|
272
272
|
* stack.
|
|
273
273
|
*/
|
|
274
274
|
iterator() {
|
|
275
|
-
return new
|
|
275
|
+
return new ei(this._commandsByGroup);
|
|
276
276
|
}
|
|
277
277
|
/**
|
|
278
278
|
* Search through all of the global and untranslated names in all of the command groups in the command
|
|
@@ -336,7 +336,7 @@ const z = class z {
|
|
|
336
336
|
};
|
|
337
337
|
z.SYSTEMT_COMMAND_GROUP_NAME = "ACAD", z.DEFAUT_COMMAND_GROUP_NAME = "USER";
|
|
338
338
|
let A = z;
|
|
339
|
-
function
|
|
339
|
+
function ti(c) {
|
|
340
340
|
return { all: c = c || /* @__PURE__ */ new Map(), on: function(e, t) {
|
|
341
341
|
var i = c.get(e);
|
|
342
342
|
i ? i.push(t) : c.set(e, [t]);
|
|
@@ -352,15 +352,15 @@ function ei(c) {
|
|
|
352
352
|
});
|
|
353
353
|
} };
|
|
354
354
|
}
|
|
355
|
-
const V =
|
|
356
|
-
function
|
|
355
|
+
const V = ti();
|
|
356
|
+
function En(c) {
|
|
357
357
|
V.emit("message", {
|
|
358
358
|
message: c,
|
|
359
359
|
type: "warning"
|
|
360
360
|
});
|
|
361
361
|
}
|
|
362
362
|
var ce = /* @__PURE__ */ ((c) => (c[c.NoSpecialCursor = -1] = "NoSpecialCursor", c[c.Crosshair = 0] = "Crosshair", c[c.RectCursor = 1] = "RectCursor", c[c.RubberBand = 2] = "RubberBand", c[c.NotRotated = 3] = "NotRotated", c[c.TargetBox = 4] = "TargetBox", c[c.RotatedCrosshair = 5] = "RotatedCrosshair", c[c.CrosshairNoRotate = 6] = "CrosshairNoRotate", c[c.Invisible = 7] = "Invisible", c[c.EntitySelect = 8] = "EntitySelect", c[c.Parallelogram = 9] = "Parallelogram", c[c.EntitySelectNoPersp = 10] = "EntitySelectNoPersp", c[c.PkfirstOrGrips = 11] = "PkfirstOrGrips", c[c.CrosshairDashed = 12] = "CrosshairDashed", c[c.Grab = 13] = "Grab", c))(ce || {});
|
|
363
|
-
class
|
|
363
|
+
class ii {
|
|
364
364
|
/**
|
|
365
365
|
* Creates a new cursor manager instance.
|
|
366
366
|
*
|
|
@@ -509,7 +509,7 @@ class Ee {
|
|
|
509
509
|
});
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
class
|
|
512
|
+
class ni extends Ee {
|
|
513
513
|
/**
|
|
514
514
|
* Creates a new jig loop instance.
|
|
515
515
|
*
|
|
@@ -540,7 +540,7 @@ class ii extends Ee {
|
|
|
540
540
|
super.deactivate(), this.view.canvas.removeEventListener("mousemove", this.onMouseMove);
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
|
-
class
|
|
543
|
+
class si {
|
|
544
544
|
/**
|
|
545
545
|
* Creates a new jig instance for the specified view.
|
|
546
546
|
*
|
|
@@ -551,7 +551,7 @@ class ni {
|
|
|
551
551
|
constructor(e) {
|
|
552
552
|
this.onUpdate = () => {
|
|
553
553
|
this.update();
|
|
554
|
-
}, this._view = e, this._jigLoop = new
|
|
554
|
+
}, this._view = e, this._jigLoop = new ni(e), this._jigLoop.events.update.addEventListener(this.onUpdate);
|
|
555
555
|
}
|
|
556
556
|
/**
|
|
557
557
|
* Gets the view associated with this jig.
|
|
@@ -678,8 +678,8 @@ class ni {
|
|
|
678
678
|
update() {
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
|
-
const
|
|
682
|
-
class
|
|
681
|
+
const ri = 16777215, oi = "1px";
|
|
682
|
+
class ai extends Ee {
|
|
683
683
|
/**
|
|
684
684
|
* Creates a new box selector instance.
|
|
685
685
|
*
|
|
@@ -719,7 +719,7 @@ class oi extends Ee {
|
|
|
719
719
|
this.resolve(this.toWcs(r));
|
|
720
720
|
}
|
|
721
721
|
this.mouseDown = !1, this.mouseMove = !1, this.mouseDownPositionX = -1, this.mouseDownPositionY = -1;
|
|
722
|
-
}, this.container = e.canvas, this.color =
|
|
722
|
+
}, this.container = e.canvas, this.color = ri;
|
|
723
723
|
}
|
|
724
724
|
/**
|
|
725
725
|
* Activates the box selector.
|
|
@@ -757,7 +757,7 @@ class oi extends Ee {
|
|
|
757
757
|
drawRect(e, t) {
|
|
758
758
|
if (!this.boxDom) {
|
|
759
759
|
const s = new Qe();
|
|
760
|
-
s.color = this.color, this.boxDom = document.createElement("div"), this.boxDom.style.cssText = `position: absolute;border: ${
|
|
760
|
+
s.color = this.color, this.boxDom = document.createElement("div"), this.boxDom.style.cssText = `position: absolute;border: ${oi} solid ${s.cssColor};`, document.body.appendChild(this.boxDom);
|
|
761
761
|
}
|
|
762
762
|
this.setRectDomVisible(!0), e.x <= 0 && (e.x = 0), e.y <= 0 && (e.y = 0), t.x >= this.container.clientWidth - 2 && (t.x = this.container.clientWidth - 2), t.y >= this.container.clientHeight - 2 && (t.y = this.container.clientHeight - 2), this.boxDom.style.left = `${e.x}px`, this.boxDom.style.top = `${e.y}px`;
|
|
763
763
|
const i = Math.abs(t.x - e.x), n = Math.abs(t.y - e.y);
|
|
@@ -784,7 +784,7 @@ class oi extends Ee {
|
|
|
784
784
|
return t.expandByPoint(this.view.cwcs2Wcs(i)), t.expandByPoint(this.view.cwcs2Wcs(n)), t;
|
|
785
785
|
}
|
|
786
786
|
}
|
|
787
|
-
class
|
|
787
|
+
class ci extends Ee {
|
|
788
788
|
/**
|
|
789
789
|
* Creates a new point input instance.
|
|
790
790
|
*
|
|
@@ -812,14 +812,14 @@ class ai extends Ee {
|
|
|
812
812
|
super.deactivate(), this.view.canvas.removeEventListener("click", this.onClick);
|
|
813
813
|
}
|
|
814
814
|
}
|
|
815
|
-
class
|
|
815
|
+
class hi {
|
|
816
816
|
/**
|
|
817
817
|
* Creates a new editor instance for the specified view.
|
|
818
818
|
*
|
|
819
819
|
* @param view - The view that this editor will handle input for
|
|
820
820
|
*/
|
|
821
821
|
constructor(e) {
|
|
822
|
-
this._view = e, this._cursorManager = new
|
|
822
|
+
this._view = e, this._cursorManager = new ii();
|
|
823
823
|
}
|
|
824
824
|
/**
|
|
825
825
|
* Gets the currently active cursor type.
|
|
@@ -870,7 +870,7 @@ class ci {
|
|
|
870
870
|
* ```
|
|
871
871
|
*/
|
|
872
872
|
async getPoint() {
|
|
873
|
-
return await new
|
|
873
|
+
return await new ci(this._view).start();
|
|
874
874
|
}
|
|
875
875
|
/**
|
|
876
876
|
* Prompts the user to select entities using box selection.
|
|
@@ -894,10 +894,10 @@ class ci {
|
|
|
894
894
|
* ```
|
|
895
895
|
*/
|
|
896
896
|
async getSelection() {
|
|
897
|
-
return await new
|
|
897
|
+
return await new ai(this._view).start();
|
|
898
898
|
}
|
|
899
899
|
}
|
|
900
|
-
class
|
|
900
|
+
class li {
|
|
901
901
|
/**
|
|
902
902
|
* Creates a new selection set.
|
|
903
903
|
*
|
|
@@ -1009,8 +1009,8 @@ class hi {
|
|
|
1009
1009
|
}
|
|
1010
1010
|
}
|
|
1011
1011
|
}
|
|
1012
|
-
var
|
|
1013
|
-
class
|
|
1012
|
+
var O = /* @__PURE__ */ ((c) => (c[c.SELECTION = 0] = "SELECTION", c[c.PAN = 1] = "PAN", c))(O || {});
|
|
1013
|
+
class di {
|
|
1014
1014
|
/**
|
|
1015
1015
|
* Creates a new base view instance.
|
|
1016
1016
|
*
|
|
@@ -1031,7 +1031,7 @@ class li {
|
|
|
1031
1031
|
unhover: new M()
|
|
1032
1032
|
}, this._canvas = e;
|
|
1033
1033
|
const t = e.getBoundingClientRect();
|
|
1034
|
-
this._bbox = new Ze(), this._width = t.width, this._height = t.height, this._curPos = new S(), this._curScreenPos = new S(), this._selectionSet = new
|
|
1034
|
+
this._bbox = new Ze(), this._width = t.width, this._height = t.height, this._curPos = new S(), this._curScreenPos = new S(), this._selectionSet = new li(), this._editor = new hi(this), this._canvas.addEventListener("mousemove", (i) => this.onMouseMove(i)), this._canvas.addEventListener("mousedown", (i) => {
|
|
1035
1035
|
i.button === 1 && this._editor.setCursor(ce.Grab);
|
|
1036
1036
|
}), this._canvas.addEventListener("mouseup", (i) => {
|
|
1037
1037
|
i.button === 1 && this._editor.restoreCursor();
|
|
@@ -1184,7 +1184,7 @@ class li {
|
|
|
1184
1184
|
}, 500);
|
|
1185
1185
|
}
|
|
1186
1186
|
}
|
|
1187
|
-
class
|
|
1187
|
+
class ui {
|
|
1188
1188
|
/**
|
|
1189
1189
|
* Creates a new document instance with an empty database.
|
|
1190
1190
|
*
|
|
@@ -1307,7 +1307,7 @@ class di {
|
|
|
1307
1307
|
}
|
|
1308
1308
|
}
|
|
1309
1309
|
}
|
|
1310
|
-
class
|
|
1310
|
+
class Ie {
|
|
1311
1311
|
constructor() {
|
|
1312
1312
|
this._objectId = "", this._ownerId = "", this._layerName = "", this._visible = !0, this._userData = {}, this._box = new L(), this._svg = "";
|
|
1313
1313
|
}
|
|
@@ -1401,7 +1401,7 @@ class Se {
|
|
|
1401
1401
|
return this;
|
|
1402
1402
|
}
|
|
1403
1403
|
}
|
|
1404
|
-
class
|
|
1404
|
+
class mi extends Ie {
|
|
1405
1405
|
constructor(e) {
|
|
1406
1406
|
if (super(), e.closed)
|
|
1407
1407
|
this.svg = `
|
|
@@ -1415,7 +1415,7 @@ class ui extends Se {
|
|
|
1415
1415
|
this._box.min.copy(t.min), this._box.max.copy(t.max);
|
|
1416
1416
|
}
|
|
1417
1417
|
}
|
|
1418
|
-
class
|
|
1418
|
+
class gi extends Ie {
|
|
1419
1419
|
constructor(e) {
|
|
1420
1420
|
if (super(), e.closed)
|
|
1421
1421
|
this.svg = `
|
|
@@ -1431,7 +1431,7 @@ class mi extends Se {
|
|
|
1431
1431
|
this._box.min.copy(t.min), this._box.max.copy(t.max);
|
|
1432
1432
|
}
|
|
1433
1433
|
}
|
|
1434
|
-
class
|
|
1434
|
+
class pi extends Ie {
|
|
1435
1435
|
constructor(e) {
|
|
1436
1436
|
super();
|
|
1437
1437
|
const t = e.reduce(
|
|
@@ -1441,7 +1441,7 @@ class gi extends Se {
|
|
|
1441
1441
|
t && (this.svg = `<path d="${t}" />`);
|
|
1442
1442
|
}
|
|
1443
1443
|
}
|
|
1444
|
-
class
|
|
1444
|
+
class yi {
|
|
1445
1445
|
constructor() {
|
|
1446
1446
|
this._container = new Array(), this._bbox = new L();
|
|
1447
1447
|
}
|
|
@@ -1466,21 +1466,21 @@ class pi {
|
|
|
1466
1466
|
* @inheritdoc
|
|
1467
1467
|
*/
|
|
1468
1468
|
circularArc(e) {
|
|
1469
|
-
const t = new
|
|
1469
|
+
const t = new mi(e);
|
|
1470
1470
|
return this._container.push(t.svg), this._bbox.union(t.box), t;
|
|
1471
1471
|
}
|
|
1472
1472
|
/**
|
|
1473
1473
|
* @inheritdoc
|
|
1474
1474
|
*/
|
|
1475
1475
|
ellipticalArc(e) {
|
|
1476
|
-
const t = new
|
|
1476
|
+
const t = new gi(e);
|
|
1477
1477
|
return this._container.push(t.svg), this._bbox.union(t.box), t;
|
|
1478
1478
|
}
|
|
1479
1479
|
/**
|
|
1480
1480
|
* @inheritdoc
|
|
1481
1481
|
*/
|
|
1482
1482
|
lines(e, t) {
|
|
1483
|
-
const i = new
|
|
1483
|
+
const i = new pi(e);
|
|
1484
1484
|
return this._container.push(i.svg), this._bbox.union(i.box), i;
|
|
1485
1485
|
}
|
|
1486
1486
|
/**
|
|
@@ -1498,7 +1498,7 @@ class pi {
|
|
|
1498
1498
|
/**
|
|
1499
1499
|
* @inheritdoc
|
|
1500
1500
|
*/
|
|
1501
|
-
mtext(e, t) {
|
|
1501
|
+
mtext(e, t, i) {
|
|
1502
1502
|
return k;
|
|
1503
1503
|
}
|
|
1504
1504
|
/**
|
|
@@ -1534,8 +1534,8 @@ class pi {
|
|
|
1534
1534
|
</svg>`;
|
|
1535
1535
|
}
|
|
1536
1536
|
}
|
|
1537
|
-
const k = /* @__PURE__ */ new
|
|
1538
|
-
class
|
|
1537
|
+
const k = /* @__PURE__ */ new Ie();
|
|
1538
|
+
class fi {
|
|
1539
1539
|
/**
|
|
1540
1540
|
* Converts the current CAD drawing to SVG format and initiates download.
|
|
1541
1541
|
*
|
|
@@ -1552,7 +1552,7 @@ class yi {
|
|
|
1552
1552
|
* ```
|
|
1553
1553
|
*/
|
|
1554
1554
|
convert() {
|
|
1555
|
-
const e = C.instance.curDocument.database.tables.blockTable.modelSpace.newIterator(), t = new
|
|
1555
|
+
const e = C.instance.curDocument.database.tables.blockTable.modelSpace.newIterator(), t = new yi();
|
|
1556
1556
|
for (const i of e)
|
|
1557
1557
|
i.draw(t);
|
|
1558
1558
|
this.createFileAndDownloadIt(t.export());
|
|
@@ -1576,7 +1576,7 @@ class yi {
|
|
|
1576
1576
|
n.href = i, n.download = "example.svg", document.body.appendChild(n), n.click();
|
|
1577
1577
|
}
|
|
1578
1578
|
}
|
|
1579
|
-
class
|
|
1579
|
+
class xi extends j {
|
|
1580
1580
|
/**
|
|
1581
1581
|
* Executes the SVG conversion command.
|
|
1582
1582
|
*
|
|
@@ -1586,10 +1586,10 @@ class fi extends j {
|
|
|
1586
1586
|
* @param _context - The application context (unused in this command)
|
|
1587
1587
|
*/
|
|
1588
1588
|
execute(e) {
|
|
1589
|
-
new
|
|
1589
|
+
new fi().convert();
|
|
1590
1590
|
}
|
|
1591
1591
|
}
|
|
1592
|
-
class
|
|
1592
|
+
class _i extends j {
|
|
1593
1593
|
/**
|
|
1594
1594
|
* Executes the open file command.
|
|
1595
1595
|
*
|
|
@@ -1603,7 +1603,7 @@ class xi extends j {
|
|
|
1603
1603
|
V.emit("open-file", {});
|
|
1604
1604
|
}
|
|
1605
1605
|
}
|
|
1606
|
-
class
|
|
1606
|
+
class bi extends j {
|
|
1607
1607
|
/**
|
|
1608
1608
|
* Executes the quick new command.
|
|
1609
1609
|
*
|
|
@@ -1616,7 +1616,7 @@ class _i extends j {
|
|
|
1616
1616
|
C.instance.openUrl("https://cdn.jsdelivr.net/gh/mlight-lee/cad-data/templates/" + "acadiso.dxf");
|
|
1617
1617
|
}
|
|
1618
1618
|
}
|
|
1619
|
-
class
|
|
1619
|
+
class wi extends j {
|
|
1620
1620
|
/**
|
|
1621
1621
|
* Executes the select command.
|
|
1622
1622
|
*
|
|
@@ -1626,10 +1626,10 @@ class bi extends j {
|
|
|
1626
1626
|
* @param context - The application context containing the view
|
|
1627
1627
|
*/
|
|
1628
1628
|
execute(e) {
|
|
1629
|
-
e.view.mode =
|
|
1629
|
+
e.view.mode = O.SELECTION, e.view.setCursor(ce.Crosshair);
|
|
1630
1630
|
}
|
|
1631
1631
|
}
|
|
1632
|
-
class
|
|
1632
|
+
class vi extends j {
|
|
1633
1633
|
/**
|
|
1634
1634
|
* Executes the zoom to fit command.
|
|
1635
1635
|
*
|
|
@@ -1643,7 +1643,7 @@ class wi extends j {
|
|
|
1643
1643
|
e.view.zoomTo(new L(t.extmin, t.extmax), 1.1);
|
|
1644
1644
|
}
|
|
1645
1645
|
}
|
|
1646
|
-
class
|
|
1646
|
+
class Si extends si {
|
|
1647
1647
|
/**
|
|
1648
1648
|
* Creates a new zoom-to-box jig.
|
|
1649
1649
|
*
|
|
@@ -1664,7 +1664,7 @@ class vi extends ni {
|
|
|
1664
1664
|
await C.instance.editor.getSelection().then((e) => this.view.zoomTo(e, 1));
|
|
1665
1665
|
}
|
|
1666
1666
|
}
|
|
1667
|
-
class
|
|
1667
|
+
class Ii extends j {
|
|
1668
1668
|
/**
|
|
1669
1669
|
* Executes the zoom-to-box command.
|
|
1670
1670
|
*
|
|
@@ -1675,10 +1675,10 @@ class Si extends j {
|
|
|
1675
1675
|
* @returns Promise that resolves when the zoom operation completes
|
|
1676
1676
|
*/
|
|
1677
1677
|
async execute(e) {
|
|
1678
|
-
await new
|
|
1678
|
+
await new Si(e.view).drag();
|
|
1679
1679
|
}
|
|
1680
1680
|
}
|
|
1681
|
-
class
|
|
1681
|
+
class Bi extends j {
|
|
1682
1682
|
/**
|
|
1683
1683
|
* Executes the pan command.
|
|
1684
1684
|
*
|
|
@@ -1688,14 +1688,14 @@ class Ii extends j {
|
|
|
1688
1688
|
* @param context - The application context containing the view
|
|
1689
1689
|
*/
|
|
1690
1690
|
execute(e) {
|
|
1691
|
-
e.view.mode =
|
|
1691
|
+
e.view.mode = O.PAN, e.view.setCursor(ce.Grab);
|
|
1692
1692
|
}
|
|
1693
1693
|
}
|
|
1694
1694
|
var B;
|
|
1695
1695
|
(function(c) {
|
|
1696
1696
|
c[c.BeforeStart = 0] = "BeforeStart", c[c.EqualStart = 1] = "EqualStart", c[c.BetweenStartAndEnd = 2] = "BetweenStartAndEnd", c[c.EqualEnd = 3] = "EqualEnd", c[c.AfterEnd = 4] = "AfterEnd";
|
|
1697
1697
|
})(B || (B = {}));
|
|
1698
|
-
class
|
|
1698
|
+
class Mi {
|
|
1699
1699
|
pointsSame(e, t) {
|
|
1700
1700
|
return this.pointsSameX(e, t) && this.pointsSameY(e, t);
|
|
1701
1701
|
}
|
|
@@ -1703,7 +1703,7 @@ class Bi {
|
|
|
1703
1703
|
return this.pointsSameX(e, t) ? this.pointsSameY(e, t) ? 0 : e[1] < t[1] ? -1 : 1 : e[0] < t[0] ? -1 : 1;
|
|
1704
1704
|
}
|
|
1705
1705
|
}
|
|
1706
|
-
class nt extends
|
|
1706
|
+
class nt extends Mi {
|
|
1707
1707
|
constructor(e = 1e-10) {
|
|
1708
1708
|
super(), this.epsilon = e;
|
|
1709
1709
|
}
|
|
@@ -1953,7 +1953,7 @@ class ee {
|
|
|
1953
1953
|
return K(e, [0, 2, 1, 0, 2, 0, 0, 1, 1, 0, 0, 2, 0, 1, 2, 0], t);
|
|
1954
1954
|
}
|
|
1955
1955
|
}
|
|
1956
|
-
function
|
|
1956
|
+
function Ai(c, e, t) {
|
|
1957
1957
|
const i = [], n = [];
|
|
1958
1958
|
for (const s of c) {
|
|
1959
1959
|
let m = function(_, x, w) {
|
|
@@ -2019,7 +2019,7 @@ function Mi(c, e, t) {
|
|
|
2019
2019
|
}
|
|
2020
2020
|
return n;
|
|
2021
2021
|
}
|
|
2022
|
-
class
|
|
2022
|
+
class Ci {
|
|
2023
2023
|
constructor() {
|
|
2024
2024
|
this.list = [], this.nextSegmentId = 0, this.curVert = NaN;
|
|
2025
2025
|
}
|
|
@@ -2105,7 +2105,7 @@ class st {
|
|
|
2105
2105
|
}
|
|
2106
2106
|
buildLog(e) {
|
|
2107
2107
|
var t;
|
|
2108
|
-
return this.log = e ? new
|
|
2108
|
+
return this.log = e ? new Ci() : null, (t = this.log) === null || t === void 0 ? void 0 : t.list;
|
|
2109
2109
|
}
|
|
2110
2110
|
segments(e) {
|
|
2111
2111
|
const t = new ke(!0, this.geo, this.log);
|
|
@@ -2160,7 +2160,7 @@ class st {
|
|
|
2160
2160
|
}
|
|
2161
2161
|
polygon(e) {
|
|
2162
2162
|
return {
|
|
2163
|
-
regions:
|
|
2163
|
+
regions: Ai(e.segments, this.geo, this.log),
|
|
2164
2164
|
inverted: e.inverted
|
|
2165
2165
|
};
|
|
2166
2166
|
}
|
|
@@ -2365,7 +2365,7 @@ const T = [
|
|
|
2365
2365
|
24,
|
|
2366
2366
|
24,
|
|
2367
2367
|
25
|
|
2368
|
-
],
|
|
2368
|
+
], Li = /* @__PURE__ */ new Map([
|
|
2369
2369
|
[
|
|
2370
2370
|
2,
|
|
2371
2371
|
{
|
|
@@ -2810,12 +2810,12 @@ const T = [
|
|
|
2810
2810
|
}
|
|
2811
2811
|
]
|
|
2812
2812
|
]);
|
|
2813
|
-
class
|
|
2813
|
+
class R {
|
|
2814
2814
|
constructor() {
|
|
2815
2815
|
this._symbols = this.initialize();
|
|
2816
2816
|
}
|
|
2817
2817
|
static get instance() {
|
|
2818
|
-
return
|
|
2818
|
+
return R._instance || (R._instance = new R()), R._instance;
|
|
2819
2819
|
}
|
|
2820
2820
|
/**
|
|
2821
2821
|
* Return true if showing one point using THREE.Points
|
|
@@ -2833,13 +2833,13 @@ class O {
|
|
|
2833
2833
|
throw new Error(
|
|
2834
2834
|
`[AcTrPointSymbolCreator] Invalid point type value: '${e}'!`
|
|
2835
2835
|
);
|
|
2836
|
-
te.copy(t),
|
|
2836
|
+
te.copy(t), Fe.identity().makeTranslation(te), i.line = n.clone().applyMatrix4(Fe), (e == 32 || e == 64 || e == 96) && (i.point = new d.BufferGeometry().setFromPoints([te]));
|
|
2837
2837
|
}
|
|
2838
2838
|
return i;
|
|
2839
2839
|
}
|
|
2840
2840
|
initialize() {
|
|
2841
2841
|
const e = /* @__PURE__ */ new Map();
|
|
2842
|
-
return
|
|
2842
|
+
return Li.forEach((t, i) => {
|
|
2843
2843
|
const n = new d.BufferGeometry();
|
|
2844
2844
|
n.setAttribute(
|
|
2845
2845
|
"position",
|
|
@@ -2848,7 +2848,7 @@ class O {
|
|
|
2848
2848
|
}), e;
|
|
2849
2849
|
}
|
|
2850
2850
|
}
|
|
2851
|
-
const
|
|
2851
|
+
const Fe = /* @__PURE__ */ new d.Matrix4(), te = /* @__PURE__ */ new d.Vector3(), Ei = new d.Color(583902);
|
|
2852
2852
|
class we {
|
|
2853
2853
|
/**
|
|
2854
2854
|
* Clone given material(s)
|
|
@@ -2864,7 +2864,7 @@ class we {
|
|
|
2864
2864
|
}
|
|
2865
2865
|
return e.clone();
|
|
2866
2866
|
}
|
|
2867
|
-
static setMaterialColor(e, t =
|
|
2867
|
+
static setMaterialColor(e, t = Ei) {
|
|
2868
2868
|
if (Array.isArray(e)) {
|
|
2869
2869
|
e.forEach((i) => this.setMaterialColor(i, t));
|
|
2870
2870
|
return;
|
|
@@ -2948,8 +2948,8 @@ function Z(c, e) {
|
|
|
2948
2948
|
e.set(new c.constructor(c.buffer, 0, t));
|
|
2949
2949
|
}
|
|
2950
2950
|
}
|
|
2951
|
-
const
|
|
2952
|
-
class
|
|
2951
|
+
const Ne = /* @__PURE__ */ new d.Box3(), F = /* @__PURE__ */ new d.Vector3(), N = /* @__PURE__ */ new d.LineSegments(), le = [];
|
|
2952
|
+
class Ti extends d.LineSegments {
|
|
2953
2953
|
constructor(e = 1e3, t = e * 2, i) {
|
|
2954
2954
|
super(new d.BufferGeometry(), i), this.boundingBox = null, this.boundingSphere = null, this._geometryInfo = [], this._availableGeometryIds = [], this._nextIndexStart = 0, this._nextVertexStart = 0, this._geometryCount = 0, this._geometryInitialized = !1, this.frustumCulled = !1, this._maxVertexCount = e, this._maxIndexCount = t;
|
|
2955
2955
|
}
|
|
@@ -3038,7 +3038,7 @@ class Ei extends d.LineSegments {
|
|
|
3038
3038
|
resetGeometry(e) {
|
|
3039
3039
|
const t = this.getUserData();
|
|
3040
3040
|
this.reset();
|
|
3041
|
-
const i =
|
|
3041
|
+
const i = R.instance;
|
|
3042
3042
|
t.forEach((n) => {
|
|
3043
3043
|
if (n.position) {
|
|
3044
3044
|
const s = i.create(e, n.position);
|
|
@@ -3191,7 +3191,7 @@ class Ei extends d.LineSegments {
|
|
|
3191
3191
|
const s = new d.Box3(), r = i.index, o = i.attributes.position;
|
|
3192
3192
|
for (let a = n.start, h = n.start + n.count; a < h; a++) {
|
|
3193
3193
|
let l = a;
|
|
3194
|
-
r && (l = r.getX(l)), s.expandByPoint(
|
|
3194
|
+
r && (l = r.getX(l)), s.expandByPoint(F.fromBufferAttribute(o, l));
|
|
3195
3195
|
}
|
|
3196
3196
|
n.boundingBox = s;
|
|
3197
3197
|
}
|
|
@@ -3204,14 +3204,14 @@ class Ei extends d.LineSegments {
|
|
|
3204
3204
|
const i = this.geometry, n = this._geometryInfo[e];
|
|
3205
3205
|
if (n.boundingSphere === null) {
|
|
3206
3206
|
const s = new d.Sphere();
|
|
3207
|
-
this.getBoundingBoxAt(e,
|
|
3207
|
+
this.getBoundingBoxAt(e, Ne), Ne.getCenter(s.center);
|
|
3208
3208
|
const r = i.index, o = i.attributes.position;
|
|
3209
3209
|
let a = 0;
|
|
3210
3210
|
for (let h = n.start, l = n.start + n.count; h < l; h++) {
|
|
3211
3211
|
let m = h;
|
|
3212
|
-
r && (m = r.getX(m)),
|
|
3212
|
+
r && (m = r.getX(m)), F.fromBufferAttribute(o, m), a = Math.max(
|
|
3213
3213
|
a,
|
|
3214
|
-
s.center.distanceToSquared(
|
|
3214
|
+
s.center.distanceToSquared(F)
|
|
3215
3215
|
);
|
|
3216
3216
|
}
|
|
3217
3217
|
s.radius = Math.sqrt(a), n.boundingSphere = s;
|
|
@@ -3260,18 +3260,18 @@ class Ei extends d.LineSegments {
|
|
|
3260
3260
|
e.geometry.index = null, e.geometry.attributes = {}, e.geometry.setDrawRange(0, 1 / 0);
|
|
3261
3261
|
}
|
|
3262
3262
|
intersectWith(e, t, i) {
|
|
3263
|
-
this._initializeRaycastObject(
|
|
3263
|
+
this._initializeRaycastObject(N), this._intersectWith(e, t, i), this._resetRaycastObjectInfo(N);
|
|
3264
3264
|
}
|
|
3265
3265
|
_intersectWith(e, t, i) {
|
|
3266
3266
|
const n = this._geometryInfo[e];
|
|
3267
3267
|
if (!(!n.visible || !n.active))
|
|
3268
3268
|
if (n.bboxIntersectionCheck) {
|
|
3269
3269
|
const s = n.boundingBox;
|
|
3270
|
-
if (t.ray.intersectBox(s,
|
|
3271
|
-
const r = t.ray.origin.distanceTo(
|
|
3270
|
+
if (t.ray.intersectBox(s, F)) {
|
|
3271
|
+
const r = t.ray.origin.distanceTo(F);
|
|
3272
3272
|
i.push({
|
|
3273
3273
|
distance: r,
|
|
3274
|
-
point:
|
|
3274
|
+
point: F.clone(),
|
|
3275
3275
|
object: this,
|
|
3276
3276
|
face: null,
|
|
3277
3277
|
faceIndex: void 0,
|
|
@@ -3283,11 +3283,11 @@ class Ei extends d.LineSegments {
|
|
|
3283
3283
|
}
|
|
3284
3284
|
} else {
|
|
3285
3285
|
this._setRaycastObjectInfo(
|
|
3286
|
-
|
|
3286
|
+
N,
|
|
3287
3287
|
e,
|
|
3288
3288
|
n.start,
|
|
3289
3289
|
n.count
|
|
3290
|
-
),
|
|
3290
|
+
), N.raycast(t, le);
|
|
3291
3291
|
for (let s = 0, r = le.length; s < r; s++) {
|
|
3292
3292
|
const o = le[s];
|
|
3293
3293
|
o.object = this, o.batchId = e, o.objectId = n.objectId, i.push(o);
|
|
@@ -3297,10 +3297,10 @@ class Ei extends d.LineSegments {
|
|
|
3297
3297
|
}
|
|
3298
3298
|
raycast(e, t) {
|
|
3299
3299
|
const i = this._geometryInfo;
|
|
3300
|
-
this._initializeRaycastObject(
|
|
3300
|
+
this._initializeRaycastObject(N);
|
|
3301
3301
|
for (let n = 0, s = i.length; n < s; n++)
|
|
3302
3302
|
this._intersectWith(n, e, t);
|
|
3303
|
-
this._resetRaycastObjectInfo(
|
|
3303
|
+
this._resetRaycastObjectInfo(N);
|
|
3304
3304
|
}
|
|
3305
3305
|
copy(e) {
|
|
3306
3306
|
return super.copy(e), this.geometry = e.geometry.clone(), this.boundingBox = e.boundingBox !== null ? e.boundingBox.clone() : null, this.boundingSphere = e.boundingSphere !== null ? e.boundingSphere.clone() : null, this._geometryInfo = e._geometryInfo.map((t) => ({
|
|
@@ -3314,7 +3314,7 @@ class Ei extends d.LineSegments {
|
|
|
3314
3314
|
}
|
|
3315
3315
|
}
|
|
3316
3316
|
const Ue = /* @__PURE__ */ new d.Box3(), U = /* @__PURE__ */ new d.Vector3(), W = /* @__PURE__ */ new d.Mesh(), de = [];
|
|
3317
|
-
class
|
|
3317
|
+
class Di extends d.Mesh {
|
|
3318
3318
|
constructor(e = 1e3, t = e * 2, i) {
|
|
3319
3319
|
super(new d.BufferGeometry(), i), this.boundingBox = null, this.boundingSphere = null, this._geometryInfo = [], this._availableGeometryIds = [], this._nextIndexStart = 0, this._nextVertexStart = 0, this._geometryCount = 0, this._geometryInitialized = !1, this.frustumCulled = !1, this._maxVertexCount = e, this._maxIndexCount = t;
|
|
3320
3320
|
}
|
|
@@ -3649,7 +3649,7 @@ class Ti extends d.Mesh {
|
|
|
3649
3649
|
}
|
|
3650
3650
|
}
|
|
3651
3651
|
const We = /* @__PURE__ */ new d.Box3(), X = /* @__PURE__ */ new d.Vector3(), $ = /* @__PURE__ */ new d.Points(), ue = [];
|
|
3652
|
-
class
|
|
3652
|
+
class zi extends d.Points {
|
|
3653
3653
|
constructor(e = 1e3, t) {
|
|
3654
3654
|
super(new d.BufferGeometry(), t), this.boundingBox = null, this.boundingSphere = null, this._geometryInfo = [], this._availableGeometryIds = [], this._nextVertexStart = 0, this._geometryCount = 0, this._geometryInitialized = !1, this.frustumCulled = !1, this._maxVertexCount = e;
|
|
3655
3655
|
}
|
|
@@ -3937,7 +3937,7 @@ class Di extends d.Points {
|
|
|
3937
3937
|
return this.geometry.dispose(), this;
|
|
3938
3938
|
}
|
|
3939
3939
|
}
|
|
3940
|
-
class
|
|
3940
|
+
class Pi extends d.Group {
|
|
3941
3941
|
constructor() {
|
|
3942
3942
|
super(), this._pointBatches = /* @__PURE__ */ new Map(), this._pointSymbolBatches = /* @__PURE__ */ new Map(), this._lineBatches = /* @__PURE__ */ new Map(), this._lineWithIndexBatches = /* @__PURE__ */ new Map(), this._meshBatches = /* @__PURE__ */ new Map(), this._meshWithIndexBatches = /* @__PURE__ */ new Map(), this._entitiesMap = /* @__PURE__ */ new Map(), this._selectedObjects = new d.Group(), this._hoverObjects = new d.Group(), this.add(this._selectedObjects), this.add(this._hoverObjects);
|
|
3943
3943
|
}
|
|
@@ -4003,7 +4003,7 @@ class zi extends d.Group {
|
|
|
4003
4003
|
return e.summary.totalGeometrySize = e.line.indexed.geometrySize + e.line.nonIndexed.geometrySize + e.mesh.indexed.geometrySize + e.mesh.nonIndexed.geometrySize + e.point.indexed.geometrySize + e.point.nonIndexed.geometrySize, e.summary.totalMappingSize = e.line.indexed.mappingSize + e.line.nonIndexed.mappingSize + e.mesh.indexed.mappingSize + e.mesh.nonIndexed.mappingSize + e.point.indexed.mappingSize + e.point.nonIndexed.mappingSize, e;
|
|
4004
4004
|
}
|
|
4005
4005
|
rerenderPoints(e) {
|
|
4006
|
-
const t =
|
|
4006
|
+
const t = R.instance.create(e);
|
|
4007
4007
|
t.line && this._pointSymbolBatches.forEach((n) => {
|
|
4008
4008
|
n.resetGeometry(e);
|
|
4009
4009
|
});
|
|
@@ -4104,7 +4104,7 @@ class zi extends d.Group {
|
|
|
4104
4104
|
addLine(e, t) {
|
|
4105
4105
|
const i = e.material, n = this.getMatchedLineBatches(e);
|
|
4106
4106
|
let s = n.get(i.id);
|
|
4107
|
-
s == null && (s = new
|
|
4107
|
+
s == null && (s = new Ti(1e3, 2e3, i), n.set(i.id, s), this.add(s)), e.geometry.applyMatrix4(e.matrixWorld);
|
|
4108
4108
|
const r = s.addGeometry(e.geometry);
|
|
4109
4109
|
return s.setGeometryInfo(r, t), {
|
|
4110
4110
|
batchedObjectId: s.id,
|
|
@@ -4114,7 +4114,7 @@ class zi extends d.Group {
|
|
|
4114
4114
|
addMesh(e, t) {
|
|
4115
4115
|
const i = e.material, n = this.getMatchedMeshBatches(e);
|
|
4116
4116
|
let s = n.get(i.id);
|
|
4117
|
-
s == null && (s = new
|
|
4117
|
+
s == null && (s = new Di(1e3, 2e3, i), n.set(i.id, s), this.add(s)), e.geometry.applyMatrix4(e.matrixWorld);
|
|
4118
4118
|
const r = s.addGeometry(e.geometry);
|
|
4119
4119
|
return s.setGeometryInfo(r, t), {
|
|
4120
4120
|
batchedObjectId: s.id,
|
|
@@ -4124,7 +4124,7 @@ class zi extends d.Group {
|
|
|
4124
4124
|
addPoint(e, t) {
|
|
4125
4125
|
const i = e.material;
|
|
4126
4126
|
let n = this._pointBatches.get(i.id);
|
|
4127
|
-
n == null && (n = new
|
|
4127
|
+
n == null && (n = new zi(100, i), n.visible = e.visible, this._pointBatches.set(i.id, n), this.add(n)), e.geometry.applyMatrix4(e.matrixWorld);
|
|
4128
4128
|
const s = n.addGeometry(e.geometry);
|
|
4129
4129
|
return n.setGeometryInfo(s, t), {
|
|
4130
4130
|
batchedObjectId: n.id,
|
|
@@ -4331,26 +4331,47 @@ const ot = class H {
|
|
|
4331
4331
|
return H._instance || (H._instance = new H()), H._instance;
|
|
4332
4332
|
}
|
|
4333
4333
|
/**
|
|
4334
|
-
*
|
|
4334
|
+
* Render MText using the current mode asynchronously
|
|
4335
|
+
*/
|
|
4336
|
+
async asyncRenderMText(e, t, i = {
|
|
4337
|
+
byLayerColor: 16777215,
|
|
4338
|
+
byBlockColor: 16777215
|
|
4339
|
+
}) {
|
|
4340
|
+
if (!this._renderer)
|
|
4341
|
+
throw new Error("AcTrMTextRenderer not initialized!");
|
|
4342
|
+
const n = this._renderer.getMode();
|
|
4343
|
+
this._renderer.switchMode("main");
|
|
4344
|
+
const s = await this._renderer.asyncRenderMText(
|
|
4345
|
+
e,
|
|
4346
|
+
t,
|
|
4347
|
+
i
|
|
4348
|
+
);
|
|
4349
|
+
return this._renderer.switchMode(n), s;
|
|
4350
|
+
}
|
|
4351
|
+
/**
|
|
4352
|
+
* Render MText using the current mode synchronously
|
|
4335
4353
|
*/
|
|
4336
|
-
|
|
4354
|
+
syncRenderMText(e, t, i = {
|
|
4337
4355
|
byLayerColor: 16777215,
|
|
4338
4356
|
byBlockColor: 16777215
|
|
4339
4357
|
}) {
|
|
4340
4358
|
if (!this._renderer)
|
|
4341
4359
|
throw new Error("AcTrMTextRenderer not initialized!");
|
|
4342
|
-
|
|
4360
|
+
const n = this._renderer.getMode();
|
|
4361
|
+
this._renderer.switchMode("main");
|
|
4362
|
+
const s = this._renderer.syncRenderMText(
|
|
4343
4363
|
e,
|
|
4344
4364
|
t,
|
|
4345
4365
|
i
|
|
4346
4366
|
);
|
|
4367
|
+
return this._renderer.switchMode(n), s;
|
|
4347
4368
|
}
|
|
4348
4369
|
/**
|
|
4349
4370
|
* Initialize the renderer with worker URL
|
|
4350
4371
|
* @param workerUrl - URL to the worker script
|
|
4351
4372
|
*/
|
|
4352
4373
|
initialize(e) {
|
|
4353
|
-
this._renderer = new
|
|
4374
|
+
this._renderer = new $t("main", { workerUrl: e });
|
|
4354
4375
|
}
|
|
4355
4376
|
/**
|
|
4356
4377
|
* Dispose of the renderer and reset the singleton
|
|
@@ -4360,8 +4381,8 @@ const ot = class H {
|
|
|
4360
4381
|
}
|
|
4361
4382
|
};
|
|
4362
4383
|
ot._instance = null;
|
|
4363
|
-
let
|
|
4364
|
-
class
|
|
4384
|
+
let ve = ot;
|
|
4385
|
+
class Ri extends E {
|
|
4365
4386
|
constructor(e, t) {
|
|
4366
4387
|
super(t), e.forEach((i) => {
|
|
4367
4388
|
if (Array.isArray(i)) {
|
|
@@ -4524,7 +4545,7 @@ class ae {
|
|
|
4524
4545
|
return n.needsUpdate = !0, e;
|
|
4525
4546
|
}
|
|
4526
4547
|
}
|
|
4527
|
-
class
|
|
4548
|
+
class Vi extends E {
|
|
4528
4549
|
constructor(e, t, i) {
|
|
4529
4550
|
super(i);
|
|
4530
4551
|
let n;
|
|
@@ -4546,7 +4567,7 @@ class Ri extends E {
|
|
|
4546
4567
|
e.computeBoundingBox(), this.box = e.boundingBox;
|
|
4547
4568
|
}
|
|
4548
4569
|
}
|
|
4549
|
-
class
|
|
4570
|
+
class ji extends E {
|
|
4550
4571
|
constructor(e, t, i, n, s) {
|
|
4551
4572
|
super(s);
|
|
4552
4573
|
let r;
|
|
@@ -4560,21 +4581,42 @@ class Vi extends E {
|
|
|
4560
4581
|
ae.computeLineDistances(a), this.add(a);
|
|
4561
4582
|
}
|
|
4562
4583
|
}
|
|
4563
|
-
class
|
|
4564
|
-
constructor(e, t, i) {
|
|
4565
|
-
super(i), this._text = e, this._style = t;
|
|
4584
|
+
class Gi extends E {
|
|
4585
|
+
constructor(e, t, i, n = !1) {
|
|
4586
|
+
super(i), this._text = e, this._style = t, n || this.syncDraw();
|
|
4566
4587
|
}
|
|
4567
|
-
async
|
|
4568
|
-
const e =
|
|
4588
|
+
async syncDraw() {
|
|
4589
|
+
const e = ve.getInstance();
|
|
4569
4590
|
if (e)
|
|
4570
4591
|
try {
|
|
4571
4592
|
const t = this._style;
|
|
4572
|
-
this._mtext =
|
|
4593
|
+
this._mtext = e.syncRenderMText(this._text, t, {
|
|
4573
4594
|
byLayerColor: t.byLayerColor,
|
|
4574
4595
|
byBlockColor: t.byBlockColor
|
|
4575
|
-
}), this.
|
|
4596
|
+
}), this.add(this._mtext), this.flatten(), this.traverse((i) => {
|
|
4576
4597
|
i.userData.bboxIntersectionCheck = !0;
|
|
4577
|
-
})
|
|
4598
|
+
});
|
|
4599
|
+
} catch (t) {
|
|
4600
|
+
console.log(
|
|
4601
|
+
`Failed to render mtext '${this._text.text}' with the following error:
|
|
4602
|
+
`,
|
|
4603
|
+
t
|
|
4604
|
+
);
|
|
4605
|
+
}
|
|
4606
|
+
}
|
|
4607
|
+
async draw() {
|
|
4608
|
+
const e = ve.getInstance();
|
|
4609
|
+
if (e)
|
|
4610
|
+
try {
|
|
4611
|
+
const t = this._style;
|
|
4612
|
+
this._mtext = await e.asyncRenderMText(this._text, t, {
|
|
4613
|
+
byLayerColor: t.byLayerColor,
|
|
4614
|
+
byBlockColor: t.byBlockColor
|
|
4615
|
+
}).then((i) => {
|
|
4616
|
+
this._mtext = i, this.add(this._mtext), this.flatten(), this.traverse((n) => {
|
|
4617
|
+
n.userData.bboxIntersectionCheck = !0;
|
|
4618
|
+
});
|
|
4619
|
+
});
|
|
4578
4620
|
} catch (t) {
|
|
4579
4621
|
console.log(
|
|
4580
4622
|
`Failed to render mtext '${this._text.text}' with the following error:
|
|
@@ -4595,16 +4637,16 @@ class ji extends E {
|
|
|
4595
4637
|
return e != null && e.bigFont && e.bigFont.toUpperCase().startsWith("GB") ? "gbk" : "utf8";
|
|
4596
4638
|
}
|
|
4597
4639
|
}
|
|
4598
|
-
const
|
|
4599
|
-
class
|
|
4640
|
+
const ki = /* @__PURE__ */ new d.Vector3();
|
|
4641
|
+
class Fi extends E {
|
|
4600
4642
|
constructor(e, t, i) {
|
|
4601
4643
|
super(i);
|
|
4602
|
-
const n =
|
|
4644
|
+
const n = R.instance.create(
|
|
4603
4645
|
t.displayMode,
|
|
4604
4646
|
e
|
|
4605
4647
|
);
|
|
4606
4648
|
this.isShowPoint = n.point != null;
|
|
4607
|
-
const s = n.point ?? new d.BufferGeometry().setFromPoints([
|
|
4649
|
+
const s = n.point ?? new d.BufferGeometry().setFromPoints([ki.copy(e)]);
|
|
4608
4650
|
s.computeBoundingBox(), s.boundingBox && this.box.union(s.boundingBox);
|
|
4609
4651
|
const r = this.styleManager.getPointsMaterial(t.color), o = new d.Points(s, r);
|
|
4610
4652
|
if (o.userData.bboxIntersectionCheck = !0, o.visible = this.isShowPoint, this.add(o), n.line) {
|
|
@@ -4622,7 +4664,7 @@ class Ni extends E {
|
|
|
4622
4664
|
const s = e.getPoints(100), r = e.buildHierarchy(), o = [];
|
|
4623
4665
|
this.buildHatchGeometry(s, r, o);
|
|
4624
4666
|
let a;
|
|
4625
|
-
if (o.length > 0 && (a =
|
|
4667
|
+
if (o.length > 0 && (a = Yt(o)), !a || !a.getIndex() || ((n = a.getIndex()) == null ? void 0 : n.count) === 0)
|
|
4626
4668
|
console.warn("Failed to convert hatch boundaries!");
|
|
4627
4669
|
else {
|
|
4628
4670
|
a.computeBoundingBox(), this.box = a.boundingBox;
|
|
@@ -4736,7 +4778,7 @@ class Ni extends E {
|
|
|
4736
4778
|
return n;
|
|
4737
4779
|
}
|
|
4738
4780
|
}
|
|
4739
|
-
function
|
|
4781
|
+
function Ui(c, e, t, i, n = 0) {
|
|
4740
4782
|
const s = {
|
|
4741
4783
|
u_cameraZoom: t,
|
|
4742
4784
|
u_patternLines: { value: c },
|
|
@@ -4956,7 +4998,7 @@ function Fi(c, e, t, i, n = 0) {
|
|
|
4956
4998
|
clipping: !0
|
|
4957
4999
|
});
|
|
4958
5000
|
}
|
|
4959
|
-
class
|
|
5001
|
+
class Wi {
|
|
4960
5002
|
/**
|
|
4961
5003
|
* Creates line shader by given pattern.
|
|
4962
5004
|
* Note: remember to call line.computeLineDistances() in order to make it work!
|
|
@@ -5071,7 +5113,7 @@ const xe = class ne {
|
|
|
5071
5113
|
getLineShaderMaterial(e, t) {
|
|
5072
5114
|
if (e.pattern && e.pattern.length !== 0) {
|
|
5073
5115
|
const i = `${e.name}_${e.color}_${t}`;
|
|
5074
|
-
return this.lineShaderMaterials[i] || (this.lineShaderMaterials[i] =
|
|
5116
|
+
return this.lineShaderMaterials[i] || (this.lineShaderMaterials[i] = Wi.createLineShaderMaterial(
|
|
5075
5117
|
e.pattern,
|
|
5076
5118
|
e.color,
|
|
5077
5119
|
t,
|
|
@@ -5147,7 +5189,7 @@ const xe = class ne {
|
|
|
5147
5189
|
}
|
|
5148
5190
|
h.push(P);
|
|
5149
5191
|
}
|
|
5150
|
-
const m =
|
|
5192
|
+
const m = Ui(
|
|
5151
5193
|
h,
|
|
5152
5194
|
e.patternAngle,
|
|
5153
5195
|
ne.CameraZoomUniform,
|
|
@@ -5185,12 +5227,12 @@ const xe = class ne {
|
|
|
5185
5227
|
}
|
|
5186
5228
|
};
|
|
5187
5229
|
xe.CameraZoomUniform = { value: 1 }, xe.ViewportScaleUniform = { value: 1 }, xe.MaxFragmentUniforms = 1024;
|
|
5188
|
-
let
|
|
5189
|
-
class
|
|
5230
|
+
let Xi = xe;
|
|
5231
|
+
class $i {
|
|
5190
5232
|
constructor(e) {
|
|
5191
5233
|
this.events = {
|
|
5192
5234
|
fontNotFound: new M()
|
|
5193
|
-
}, this._renderer = e, this._styleManager = new
|
|
5235
|
+
}, this._renderer = e, this._styleManager = new Xi(), J.instance.events.fontNotFound.addEventListener((t) => {
|
|
5194
5236
|
this.events.fontNotFound.dispatch(t);
|
|
5195
5237
|
});
|
|
5196
5238
|
}
|
|
@@ -5294,13 +5336,13 @@ class Xi {
|
|
|
5294
5336
|
* @inheritdoc
|
|
5295
5337
|
*/
|
|
5296
5338
|
group(e) {
|
|
5297
|
-
return new
|
|
5339
|
+
return new Ri(e, this._styleManager);
|
|
5298
5340
|
}
|
|
5299
5341
|
/**
|
|
5300
5342
|
* @inheritdoc
|
|
5301
5343
|
*/
|
|
5302
5344
|
point(e, t) {
|
|
5303
|
-
return new
|
|
5345
|
+
return new Fi(e, t, this._styleManager);
|
|
5304
5346
|
}
|
|
5305
5347
|
/**
|
|
5306
5348
|
* @inheritdoc
|
|
@@ -5324,7 +5366,7 @@ class Xi {
|
|
|
5324
5366
|
* @inheritdoc
|
|
5325
5367
|
*/
|
|
5326
5368
|
lineSegments(e, t, i, n) {
|
|
5327
|
-
return new
|
|
5369
|
+
return new ji(
|
|
5328
5370
|
e,
|
|
5329
5371
|
t,
|
|
5330
5372
|
i,
|
|
@@ -5341,8 +5383,8 @@ class Xi {
|
|
|
5341
5383
|
/**
|
|
5342
5384
|
* @inheritdoc
|
|
5343
5385
|
*/
|
|
5344
|
-
mtext(e, t) {
|
|
5345
|
-
return new
|
|
5386
|
+
mtext(e, t, i) {
|
|
5387
|
+
return new Gi(e, t, this._styleManager, i);
|
|
5346
5388
|
}
|
|
5347
5389
|
/**
|
|
5348
5390
|
* @inheritdoc
|
|
@@ -5351,10 +5393,10 @@ class Xi {
|
|
|
5351
5393
|
return new Oi(e, t, this._styleManager);
|
|
5352
5394
|
}
|
|
5353
5395
|
linePoints(e, t = void 0) {
|
|
5354
|
-
return new
|
|
5396
|
+
return new Vi(e, t, this._styleManager);
|
|
5355
5397
|
}
|
|
5356
5398
|
}
|
|
5357
|
-
class
|
|
5399
|
+
class Yi {
|
|
5358
5400
|
constructor(e) {
|
|
5359
5401
|
this._camera = e;
|
|
5360
5402
|
}
|
|
@@ -5466,7 +5508,7 @@ class at {
|
|
|
5466
5508
|
viewChanged: new M()
|
|
5467
5509
|
}, this._renderer = e, this._width = t, this._height = i;
|
|
5468
5510
|
const n = this.createCamera();
|
|
5469
|
-
this._camera = new
|
|
5511
|
+
this._camera = new Yi(n), this._cameraControls = this.createCameraControls(), this._cameraControls.addEventListener("change", () => {
|
|
5470
5512
|
this.events.viewChanged.dispatch({ view: this });
|
|
5471
5513
|
}), this._raycaster = new d.Raycaster();
|
|
5472
5514
|
}
|
|
@@ -5559,9 +5601,9 @@ class at {
|
|
|
5559
5601
|
), this._raycaster.params.Line.threshold = t, this._raycaster.params.Points.threshold = t, this._raycaster;
|
|
5560
5602
|
}
|
|
5561
5603
|
zoomTo(e, t = 1.1) {
|
|
5562
|
-
const i = new
|
|
5604
|
+
const i = new Le();
|
|
5563
5605
|
e.getSize(i);
|
|
5564
|
-
const n = new
|
|
5606
|
+
const n = new Le();
|
|
5565
5607
|
e.getCenter(n);
|
|
5566
5608
|
const s = new d.Vector3(n.x, n.y, 0);
|
|
5567
5609
|
this._camera.position.set(n.x, n.y, this._camera.position.z), this._camera.lookAt(s), this._camera.setRotationFromEuler(new d.Euler(0, 0, 0));
|
|
@@ -5584,7 +5626,7 @@ class at {
|
|
|
5584
5626
|
return e.position.set(0, 0, 500), e.up.set(0, 1, 0), e.updateProjectionMatrix(), e;
|
|
5585
5627
|
}
|
|
5586
5628
|
createCameraControls() {
|
|
5587
|
-
const e = new
|
|
5629
|
+
const e = new Ht(
|
|
5588
5630
|
this._camera.internalCamera,
|
|
5589
5631
|
this._renderer.domElement
|
|
5590
5632
|
);
|
|
@@ -5593,7 +5635,7 @@ class at {
|
|
|
5593
5635
|
}, e.update(), e;
|
|
5594
5636
|
}
|
|
5595
5637
|
}
|
|
5596
|
-
class
|
|
5638
|
+
class Se extends at {
|
|
5597
5639
|
/**
|
|
5598
5640
|
* Calcuate the bounding box of this viewport in client window coordinate system
|
|
5599
5641
|
*/
|
|
@@ -5608,7 +5650,7 @@ class ve extends at {
|
|
|
5608
5650
|
* @param renderer Input renderer to draw this viewport view
|
|
5609
5651
|
*/
|
|
5610
5652
|
constructor(e, t, i) {
|
|
5611
|
-
const n =
|
|
5653
|
+
const n = Se.calculateViewportWindowBox(
|
|
5612
5654
|
e,
|
|
5613
5655
|
t
|
|
5614
5656
|
).size;
|
|
@@ -5631,7 +5673,7 @@ class ve extends at {
|
|
|
5631
5673
|
* @param scene Input the scene to render
|
|
5632
5674
|
*/
|
|
5633
5675
|
render(e) {
|
|
5634
|
-
const t =
|
|
5676
|
+
const t = Se.calculateViewportWindowBox(
|
|
5635
5677
|
this._parentView,
|
|
5636
5678
|
this._viewport
|
|
5637
5679
|
);
|
|
@@ -5651,36 +5693,36 @@ class ve extends at {
|
|
|
5651
5693
|
}
|
|
5652
5694
|
}
|
|
5653
5695
|
}
|
|
5654
|
-
const
|
|
5696
|
+
const Hi = (c) => new Ze(c.min, c.max), qi = (c) => new L(
|
|
5655
5697
|
c.min,
|
|
5656
5698
|
c.max
|
|
5657
|
-
),
|
|
5699
|
+
), Qi = (c) => new d.Box3(
|
|
5658
5700
|
c.min,
|
|
5659
5701
|
c.max
|
|
5660
|
-
),
|
|
5702
|
+
), Zi = (c) => new L(c.min, c.max), Ji = (c) => new d.Box2(
|
|
5661
5703
|
c.min,
|
|
5662
5704
|
c.max
|
|
5663
|
-
),
|
|
5705
|
+
), Ki = (c) => new L(c.min, c.max), en = (c) => {
|
|
5664
5706
|
const e = new d.Box3();
|
|
5665
5707
|
return e.min.set(c.min.x, c.min.y, 0), e.max.set(c.max.x, c.max.y, 0), e;
|
|
5666
|
-
},
|
|
5708
|
+
}, tn = {
|
|
5667
5709
|
/** Converts Three.js Box2 to CAD geometry AcGeBox2d */
|
|
5668
|
-
threeBo2dToGeBox2d:
|
|
5710
|
+
threeBo2dToGeBox2d: Zi,
|
|
5669
5711
|
/** Converts CAD geometry AcGeBox2d to Three.js Box2 */
|
|
5670
|
-
geBox2dToThreeBox2d:
|
|
5712
|
+
geBox2dToThreeBox2d: Ji,
|
|
5671
5713
|
/** Converts Three.js Box3 to CAD geometry AcGeBox3d */
|
|
5672
|
-
threeBox3dToGeBox3d:
|
|
5714
|
+
threeBox3dToGeBox3d: Hi,
|
|
5673
5715
|
/** Converts CAD geometry AcGeBox3d to Three.js Box3 */
|
|
5674
|
-
geBox3dToThreeBox3d:
|
|
5716
|
+
geBox3dToThreeBox3d: Qi,
|
|
5675
5717
|
/** Converts CAD geometry AcGeBox3d to CAD geometry AcGeBox2d */
|
|
5676
|
-
goBox3dToGeBox2d:
|
|
5718
|
+
goBox3dToGeBox2d: qi,
|
|
5677
5719
|
/** Converts Three.js Box3 to CAD geometry Box2d (ignores Z) */
|
|
5678
|
-
threeBox3dToGeBox2d:
|
|
5720
|
+
threeBox3dToGeBox2d: Ki,
|
|
5679
5721
|
/** Converts CAD geometry AcGeBox2d to Three.js Box3 (Z=0) */
|
|
5680
|
-
geBox2dToThreeBox3d:
|
|
5722
|
+
geBox2dToThreeBox3d: en
|
|
5681
5723
|
};
|
|
5682
|
-
var
|
|
5683
|
-
class
|
|
5724
|
+
var Be = /* @__PURE__ */ ((c) => (c[c.LEFT_BOTTOM = 0] = "LEFT_BOTTOM", c[c.LEFT_TOP = 1] = "LEFT_TOP", c[c.RIGHT_TOP = 2] = "RIGHT_TOP", c[c.RIGHT_BOTTOM = 4] = "RIGHT_BOTTOM", c))(Be || {});
|
|
5725
|
+
class nn extends d.Object3D {
|
|
5684
5726
|
/**
|
|
5685
5727
|
* Construct one instance of this gizmo
|
|
5686
5728
|
* @param camera Camera used in your canvas
|
|
@@ -5764,7 +5806,7 @@ class tn extends d.Object3D {
|
|
|
5764
5806
|
return r;
|
|
5765
5807
|
}
|
|
5766
5808
|
}
|
|
5767
|
-
function
|
|
5809
|
+
function sn(c, e) {
|
|
5768
5810
|
const t = e.font || "Helvetica", i = e.fontSize || 30, n = e.width || 200, s = e.height || 200, r = e.bgColor ? e.bgColor.join(", ") : "255, 255, 255, 1.0", o = e.color ? e.color.join(", ") : "0, 0, 0, 1.0", a = document.createElement("canvas");
|
|
5769
5811
|
a.width = n, a.height = s;
|
|
5770
5812
|
const h = a.getContext("2d");
|
|
@@ -5780,8 +5822,8 @@ function nn(c, e) {
|
|
|
5780
5822
|
const l = new d.Texture(a);
|
|
5781
5823
|
return l.minFilter = d.LinearFilter, l.needsUpdate = !0, l;
|
|
5782
5824
|
}
|
|
5783
|
-
function
|
|
5784
|
-
const e =
|
|
5825
|
+
function Me(c) {
|
|
5826
|
+
const e = sn(c, {
|
|
5785
5827
|
fontSize: 100,
|
|
5786
5828
|
font: "Arial Narrow, sans-serif",
|
|
5787
5829
|
color: [255, 255, 255, 1],
|
|
@@ -5789,16 +5831,16 @@ function Be(c) {
|
|
|
5789
5831
|
}), t = new d.SpriteMaterial({ map: e, transparent: !0 });
|
|
5790
5832
|
return new d.Sprite(t);
|
|
5791
5833
|
}
|
|
5792
|
-
|
|
5793
|
-
const
|
|
5794
|
-
pos:
|
|
5834
|
+
Be.RIGHT_TOP;
|
|
5835
|
+
const rn = {
|
|
5836
|
+
pos: Be.LEFT_BOTTOM,
|
|
5795
5837
|
size: 100,
|
|
5796
5838
|
hasZAxis: !0
|
|
5797
5839
|
};
|
|
5798
|
-
class
|
|
5840
|
+
class on extends nn {
|
|
5799
5841
|
constructor(e, t, i) {
|
|
5800
5842
|
const n = {
|
|
5801
|
-
...
|
|
5843
|
+
...rn,
|
|
5802
5844
|
...i
|
|
5803
5845
|
};
|
|
5804
5846
|
super(e, t, n.size, i.pos), this.hasZAxis = n.hasZAxis;
|
|
@@ -5813,7 +5855,7 @@ class rn extends tn {
|
|
|
5813
5855
|
vertexColors: !0,
|
|
5814
5856
|
toneMapped: !1
|
|
5815
5857
|
});
|
|
5816
|
-
this.axes = new d.LineSegments(o, a), this.axes.position.set(-1, -1, -1), this.add(this.axes), this.xText =
|
|
5858
|
+
this.axes = new d.LineSegments(o, a), this.axes.position.set(-1, -1, -1), this.add(this.axes), this.xText = Me("X"), this.xText.position.set(1.5, -1, -1), this.add(this.xText), this.yText = Me("Y"), this.yText.position.set(-1, 1.5, -1), this.add(this.yText), this.hasZAxis && (this.zText = Me("Z"), this.zText.position.set(-1, -1, 1.5), this.add(this.zText));
|
|
5817
5859
|
}
|
|
5818
5860
|
/**
|
|
5819
5861
|
* Set color of x-axis and y-axis
|
|
@@ -5840,7 +5882,7 @@ class rn extends tn {
|
|
|
5840
5882
|
this.axes.geometry.dispose(), this.axes.material.dispose(), this.xText.geometry.dispose(), this.xText.material.dispose(), this.yText.geometry.dispose(), this.yText.material.dispose(), this.hasZAxis && ((e = this.zText) == null || e.geometry.dispose(), (t = this.zText) == null || t.material.dispose());
|
|
5841
5883
|
}
|
|
5842
5884
|
}
|
|
5843
|
-
class
|
|
5885
|
+
class an extends at {
|
|
5844
5886
|
/**
|
|
5845
5887
|
* Construct one instance of this class.
|
|
5846
5888
|
*
|
|
@@ -5850,7 +5892,7 @@ class on extends at {
|
|
|
5850
5892
|
* @param height - Input height of this view in pixels
|
|
5851
5893
|
*/
|
|
5852
5894
|
constructor(e, t, i, n) {
|
|
5853
|
-
super(e, i, n), this._layoutBtrId = t, this._mode =
|
|
5895
|
+
super(e, i, n), this._layoutBtrId = t, this._mode = O.SELECTION, this._axesGizmo = this.createAxesGizmo(), this._viewportViews = /* @__PURE__ */ new Map();
|
|
5854
5896
|
}
|
|
5855
5897
|
/**
|
|
5856
5898
|
* Gets the block table record ID associated with this layout.
|
|
@@ -5868,9 +5910,9 @@ class on extends at {
|
|
|
5868
5910
|
return this._mode;
|
|
5869
5911
|
}
|
|
5870
5912
|
set mode(e) {
|
|
5871
|
-
e ==
|
|
5913
|
+
e == O.SELECTION ? this._cameraControls.mouseButtons = {
|
|
5872
5914
|
MIDDLE: d.MOUSE.PAN
|
|
5873
|
-
} : e ==
|
|
5915
|
+
} : e == O.PAN && (this._cameraControls.mouseButtons = {
|
|
5874
5916
|
LEFT: d.MOUSE.PAN
|
|
5875
5917
|
}), this._cameraControls.update(), this._mode = e;
|
|
5876
5918
|
}
|
|
@@ -5931,12 +5973,12 @@ class on extends at {
|
|
|
5931
5973
|
* @returns The configured axes gizmo instance
|
|
5932
5974
|
*/
|
|
5933
5975
|
createAxesGizmo() {
|
|
5934
|
-
return new
|
|
5976
|
+
return new on(
|
|
5935
5977
|
this._camera.internalCamera,
|
|
5936
5978
|
this._renderer.internalRenderer,
|
|
5937
5979
|
{
|
|
5938
5980
|
hasZAxis: !1,
|
|
5939
|
-
pos:
|
|
5981
|
+
pos: Be.LEFT_BOTTOM
|
|
5940
5982
|
}
|
|
5941
5983
|
);
|
|
5942
5984
|
}
|
|
@@ -5965,7 +6007,7 @@ class on extends at {
|
|
|
5965
6007
|
}
|
|
5966
6008
|
}
|
|
5967
6009
|
}
|
|
5968
|
-
class
|
|
6010
|
+
class cn {
|
|
5969
6011
|
/**
|
|
5970
6012
|
* Creates a new layout view manager instance.
|
|
5971
6013
|
* Initializes with no active layout and an empty collection of views.
|
|
@@ -6048,7 +6090,7 @@ class an {
|
|
|
6048
6090
|
(t = this.activeLayoutView) == null || t.render(e);
|
|
6049
6091
|
}
|
|
6050
6092
|
}
|
|
6051
|
-
function ct(c, e, t = 0, i = c.length - 1, n =
|
|
6093
|
+
function ct(c, e, t = 0, i = c.length - 1, n = hn) {
|
|
6052
6094
|
for (; i > t; ) {
|
|
6053
6095
|
if (i - t > 600) {
|
|
6054
6096
|
const a = i - t + 1, h = e - t + 1, l = Math.log(a), m = 0.5 * Math.exp(2 * l / 3), u = 0.5 * Math.sqrt(l * m * (a - m) / a) * (h - a / 2 < 0 ? -1 : 1), p = Math.max(t, Math.floor(e - h * m / a + u)), g = Math.min(i, Math.floor(e + (a - h) * m / a + u));
|
|
@@ -6067,10 +6109,10 @@ function ie(c, e, t) {
|
|
|
6067
6109
|
const i = c[e];
|
|
6068
6110
|
c[e] = c[t], c[t] = i;
|
|
6069
6111
|
}
|
|
6070
|
-
function
|
|
6112
|
+
function hn(c, e) {
|
|
6071
6113
|
return c < e ? -1 : c > e ? 1 : 0;
|
|
6072
6114
|
}
|
|
6073
|
-
class
|
|
6115
|
+
class ln {
|
|
6074
6116
|
constructor(e = 9) {
|
|
6075
6117
|
this._maxEntries = Math.max(4, e), this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4)), this.clear();
|
|
6076
6118
|
}
|
|
@@ -6085,7 +6127,7 @@ class hn {
|
|
|
6085
6127
|
for (; t; ) {
|
|
6086
6128
|
for (let r = 0; r < t.children.length; r++) {
|
|
6087
6129
|
const o = t.children[r], a = t.leaf ? n(o) : o;
|
|
6088
|
-
ye(e, a) && (t.leaf ? i.push(o) :
|
|
6130
|
+
ye(e, a) && (t.leaf ? i.push(o) : Ce(e, a) ? this._all(o, i) : s.push(o));
|
|
6089
6131
|
}
|
|
6090
6132
|
t = s.pop();
|
|
6091
6133
|
}
|
|
@@ -6099,7 +6141,7 @@ class hn {
|
|
|
6099
6141
|
for (let n = 0; n < t.children.length; n++) {
|
|
6100
6142
|
const s = t.children[n], r = t.leaf ? this.toBBox(s) : s;
|
|
6101
6143
|
if (ye(e, r)) {
|
|
6102
|
-
if (t.leaf ||
|
|
6144
|
+
if (t.leaf || Ce(e, r)) return !0;
|
|
6103
6145
|
i.push(s);
|
|
6104
6146
|
}
|
|
6105
6147
|
}
|
|
@@ -6141,11 +6183,11 @@ class hn {
|
|
|
6141
6183
|
let o, a, h;
|
|
6142
6184
|
for (; i || s.length; ) {
|
|
6143
6185
|
if (i || (i = s.pop(), a = s[s.length - 1], o = r.pop(), h = !0), i.leaf) {
|
|
6144
|
-
const l =
|
|
6186
|
+
const l = dn(e, i.children, t);
|
|
6145
6187
|
if (l !== -1)
|
|
6146
6188
|
return i.children.splice(l, 1), s.push(i), this._condense(s), this;
|
|
6147
6189
|
}
|
|
6148
|
-
!h && !i.leaf &&
|
|
6190
|
+
!h && !i.leaf && Ce(i, n) ? (s.push(i), r.push(o), o = 0, a = i, i = i.children[0]) : a ? (o++, i = a.children[o], h = !1) : i = null;
|
|
6149
6191
|
}
|
|
6150
6192
|
return this;
|
|
6151
6193
|
}
|
|
@@ -6192,7 +6234,7 @@ class hn {
|
|
|
6192
6234
|
for (; n.push(t), !(t.leaf || n.length - 1 === i); ) {
|
|
6193
6235
|
let s = 1 / 0, r = 1 / 0, o;
|
|
6194
6236
|
for (let a = 0; a < t.children.length; a++) {
|
|
6195
|
-
const h = t.children[a], l =
|
|
6237
|
+
const h = t.children[a], l = Ae(h), m = gn(e, h) - l;
|
|
6196
6238
|
m < r ? (r = m, s = l < s ? l : s, o = h) : m === r && l < s && (s = l, o = h);
|
|
6197
6239
|
}
|
|
6198
6240
|
t = o || t.children[0];
|
|
@@ -6218,14 +6260,14 @@ class hn {
|
|
|
6218
6260
|
_chooseSplitIndex(e, t, i) {
|
|
6219
6261
|
let n, s = 1 / 0, r = 1 / 0;
|
|
6220
6262
|
for (let o = t; o <= i - t; o++) {
|
|
6221
|
-
const a = se(e, 0, o, this.toBBox), h = se(e, o, i, this.toBBox), l =
|
|
6263
|
+
const a = se(e, 0, o, this.toBBox), h = se(e, o, i, this.toBBox), l = pn(a, h), m = Ae(a) + Ae(h);
|
|
6222
6264
|
l < s ? (s = l, n = o, r = m < r ? m : r) : l === s && m < r && (r = m, n = o);
|
|
6223
6265
|
}
|
|
6224
6266
|
return n || i - t;
|
|
6225
6267
|
}
|
|
6226
6268
|
// sorts node children by the best axis for split
|
|
6227
6269
|
_chooseSplitAxis(e, t, i) {
|
|
6228
|
-
const n = e.leaf ? this.compareMinX :
|
|
6270
|
+
const n = e.leaf ? this.compareMinX : un, s = e.leaf ? this.compareMinY : mn, r = this._allDistMargin(e, t, i, n), o = this._allDistMargin(e, t, i, s);
|
|
6229
6271
|
r < o && e.children.sort(n);
|
|
6230
6272
|
}
|
|
6231
6273
|
// total margin of all possible split distributions where each node is at least m full
|
|
@@ -6252,7 +6294,7 @@ class hn {
|
|
|
6252
6294
|
e[t].children.length === 0 ? t > 0 ? (i = e[t - 1].children, i.splice(i.indexOf(e[t]), 1)) : this.clear() : Y(e[t], this.toBBox);
|
|
6253
6295
|
}
|
|
6254
6296
|
}
|
|
6255
|
-
function
|
|
6297
|
+
function dn(c, e, t) {
|
|
6256
6298
|
if (!t) return e.indexOf(c);
|
|
6257
6299
|
for (let i = 0; i < e.length; i++)
|
|
6258
6300
|
if (t(c, e[i])) return i;
|
|
@@ -6272,26 +6314,26 @@ function se(c, e, t, i, n) {
|
|
|
6272
6314
|
function re(c, e) {
|
|
6273
6315
|
return c.minX = Math.min(c.minX, e.minX), c.minY = Math.min(c.minY, e.minY), c.maxX = Math.max(c.maxX, e.maxX), c.maxY = Math.max(c.maxY, e.maxY), c;
|
|
6274
6316
|
}
|
|
6275
|
-
function
|
|
6317
|
+
function un(c, e) {
|
|
6276
6318
|
return c.minX - e.minX;
|
|
6277
6319
|
}
|
|
6278
|
-
function
|
|
6320
|
+
function mn(c, e) {
|
|
6279
6321
|
return c.minY - e.minY;
|
|
6280
6322
|
}
|
|
6281
|
-
function
|
|
6323
|
+
function Ae(c) {
|
|
6282
6324
|
return (c.maxX - c.minX) * (c.maxY - c.minY);
|
|
6283
6325
|
}
|
|
6284
6326
|
function pe(c) {
|
|
6285
6327
|
return c.maxX - c.minX + (c.maxY - c.minY);
|
|
6286
6328
|
}
|
|
6287
|
-
function
|
|
6329
|
+
function gn(c, e) {
|
|
6288
6330
|
return (Math.max(e.maxX, c.maxX) - Math.min(e.minX, c.minX)) * (Math.max(e.maxY, c.maxY) - Math.min(e.minY, c.minY));
|
|
6289
6331
|
}
|
|
6290
|
-
function
|
|
6332
|
+
function pn(c, e) {
|
|
6291
6333
|
const t = Math.max(c.minX, e.minX), i = Math.max(c.minY, e.minY), n = Math.min(c.maxX, e.maxX), s = Math.min(c.maxY, e.maxY);
|
|
6292
6334
|
return Math.max(0, n - t) * Math.max(0, s - i);
|
|
6293
6335
|
}
|
|
6294
|
-
function
|
|
6336
|
+
function Ce(c, e) {
|
|
6295
6337
|
return c.minX <= e.minX && c.minY <= e.minY && e.maxX <= c.maxX && e.maxY <= c.maxY;
|
|
6296
6338
|
}
|
|
6297
6339
|
function ye(c, e) {
|
|
@@ -6316,13 +6358,13 @@ function Xe(c, e, t, i, n) {
|
|
|
6316
6358
|
ct(c, r, e, t, n), s.push(e, r, r, t);
|
|
6317
6359
|
}
|
|
6318
6360
|
}
|
|
6319
|
-
class
|
|
6361
|
+
class yn {
|
|
6320
6362
|
/**
|
|
6321
6363
|
* Construct one instance of this class
|
|
6322
6364
|
* @param name Input layer name
|
|
6323
6365
|
*/
|
|
6324
6366
|
constructor(e) {
|
|
6325
|
-
this._group = new
|
|
6367
|
+
this._group = new Pi(), this._name = e;
|
|
6326
6368
|
}
|
|
6327
6369
|
/**
|
|
6328
6370
|
* Layer name
|
|
@@ -6438,13 +6480,13 @@ class pn {
|
|
|
6438
6480
|
});
|
|
6439
6481
|
}
|
|
6440
6482
|
}
|
|
6441
|
-
class
|
|
6483
|
+
class fn {
|
|
6442
6484
|
/**
|
|
6443
6485
|
* Creates a new layout instance.
|
|
6444
6486
|
* Initializes the layout with empty collections and a spatial index.
|
|
6445
6487
|
*/
|
|
6446
6488
|
constructor() {
|
|
6447
|
-
this._group = new d.Group(), this._indexTree = new
|
|
6489
|
+
this._group = new d.Group(), this._indexTree = new ln(), this._box = new d.Box3(), this._layers = /* @__PURE__ */ new Map();
|
|
6448
6490
|
}
|
|
6449
6491
|
/**
|
|
6450
6492
|
* The internal THREE.js object to use by scene. This is internally used only. Try to avoid using it.
|
|
@@ -6688,17 +6730,23 @@ class yn {
|
|
|
6688
6730
|
*/
|
|
6689
6731
|
getLayer(e, t = !0) {
|
|
6690
6732
|
let i = this._layers.get(e);
|
|
6691
|
-
return i === void 0 && t && (i = new
|
|
6733
|
+
return i === void 0 && t && (i = new yn(e), this._layers.set(e, i), this._group.add(i.internalObject)), i;
|
|
6692
6734
|
}
|
|
6693
6735
|
}
|
|
6694
|
-
class
|
|
6736
|
+
class xn {
|
|
6695
6737
|
/**
|
|
6696
6738
|
* Creates a new CAD scene instance.
|
|
6697
6739
|
*
|
|
6698
6740
|
* Initializes the Three.js scene and layout management structures.
|
|
6699
6741
|
*/
|
|
6700
6742
|
constructor() {
|
|
6701
|
-
this._scene = new d.Scene(), this._layouts = /* @__PURE__ */ new Map(), this._activeLayoutBtrId = "", this._modelSpaceBtrId = "";
|
|
6743
|
+
this._scene = new d.Scene(), this._layers = /* @__PURE__ */ new Map(), this._layouts = /* @__PURE__ */ new Map(), this._activeLayoutBtrId = "", this._modelSpaceBtrId = "";
|
|
6744
|
+
}
|
|
6745
|
+
/**
|
|
6746
|
+
* The layers in this scene
|
|
6747
|
+
*/
|
|
6748
|
+
get layers() {
|
|
6749
|
+
return this._layers;
|
|
6702
6750
|
}
|
|
6703
6751
|
/**
|
|
6704
6752
|
* The layouts in this scene
|
|
@@ -6771,7 +6819,7 @@ class fn {
|
|
|
6771
6819
|
* @returns Return the newly created empty layout
|
|
6772
6820
|
*/
|
|
6773
6821
|
addEmptyLayout(e) {
|
|
6774
|
-
const t = new
|
|
6822
|
+
const t = new fn();
|
|
6775
6823
|
return this._layouts.set(e, t), this._scene.add(t.internalObject), t.visible = e == this._activeLayoutBtrId, t;
|
|
6776
6824
|
}
|
|
6777
6825
|
/**
|
|
@@ -6828,6 +6876,12 @@ class fn {
|
|
|
6828
6876
|
const t = this.activeLayout;
|
|
6829
6877
|
return t ? t == null ? void 0 : t.search(e) : [];
|
|
6830
6878
|
}
|
|
6879
|
+
addLayer(e) {
|
|
6880
|
+
this._layers.set(e.name, e);
|
|
6881
|
+
}
|
|
6882
|
+
updateLayer(e) {
|
|
6883
|
+
this._layers.set(e.name, e);
|
|
6884
|
+
}
|
|
6831
6885
|
/**
|
|
6832
6886
|
* Add one AutoCAD entity into this scene. If the layout associated with this entity doesn't exist,
|
|
6833
6887
|
* then create one layout, add this layout into this scene, and add the entity into the layout.
|
|
@@ -6874,7 +6928,7 @@ class fn {
|
|
|
6874
6928
|
const $e = {
|
|
6875
6929
|
background: 0
|
|
6876
6930
|
};
|
|
6877
|
-
class
|
|
6931
|
+
class _n extends di {
|
|
6878
6932
|
/**
|
|
6879
6933
|
* Creates a new 2D CAD viewer instance.
|
|
6880
6934
|
*
|
|
@@ -6892,7 +6946,7 @@ class xn extends li {
|
|
|
6892
6946
|
alpha: !0,
|
|
6893
6947
|
canvas: e.canvas
|
|
6894
6948
|
});
|
|
6895
|
-
t.canvas == null && (t.canvas = i.domElement), super(t.canvas), e.calculateSizeCallback && this.setCalculateSizeCallback(e.calculateSizeCallback), i.setPixelRatio(Math.min(window.devicePixelRatio, 2)), i.setSize(this.width, this.height), this._renderer = new
|
|
6949
|
+
t.canvas == null && (t.canvas = i.domElement), super(t.canvas), e.calculateSizeCallback && this.setCalculateSizeCallback(e.calculateSizeCallback), i.setPixelRatio(Math.min(window.devicePixelRatio, 2)), i.setSize(this.width, this.height), this._renderer = new $i(i);
|
|
6896
6950
|
const n = oe.instance.fontMapping;
|
|
6897
6951
|
this._renderer.setFontMapping(n), this._renderer.events.fontNotFound.addEventListener((s) => {
|
|
6898
6952
|
V.emit("font-not-found", {
|
|
@@ -6902,14 +6956,14 @@ class xn extends li {
|
|
|
6902
6956
|
}), this._scene = this.createScene(), this._renderer.setClearColor(t.background || 0), this._stats = this.createStats(oe.instance.isShowStats), oe.instance.events.modified.addEventListener((s) => {
|
|
6903
6957
|
s.key == "isShowStats" && this.toggleStatsVisibility(this._stats, s.value);
|
|
6904
6958
|
}), this.canvas.addEventListener("click", () => {
|
|
6905
|
-
this.mode ==
|
|
6959
|
+
this.mode == O.SELECTION && this.select();
|
|
6906
6960
|
}), document.addEventListener("keydown", (s) => {
|
|
6907
6961
|
s.code === "Escape" && this.selectionSet.clear();
|
|
6908
6962
|
}), Je().layoutManager.events.layoutSwitched.addEventListener(
|
|
6909
6963
|
(s) => {
|
|
6910
6964
|
this.activeLayoutBtrId = s.layout.blockTableRecordId;
|
|
6911
6965
|
}
|
|
6912
|
-
), this._missedImages = /* @__PURE__ */ new Map(), this._layoutViewManager = new
|
|
6966
|
+
), this._missedImages = /* @__PURE__ */ new Map(), this._layoutViewManager = new cn(), this.initialize(), this.onWindowResize(), this.animate(), this._isDirty = !0;
|
|
6913
6967
|
}
|
|
6914
6968
|
/**
|
|
6915
6969
|
* Initializes the viewer after renderer and camera are created.
|
|
@@ -6930,7 +6984,7 @@ class xn extends li {
|
|
|
6930
6984
|
*/
|
|
6931
6985
|
get mode() {
|
|
6932
6986
|
const e = this.activeLayoutView;
|
|
6933
|
-
return e ? e.mode :
|
|
6987
|
+
return e ? e.mode : O.SELECTION;
|
|
6934
6988
|
}
|
|
6935
6989
|
/**
|
|
6936
6990
|
* Sets the view mode (selection or pan).
|
|
@@ -7065,7 +7119,7 @@ class xn extends li {
|
|
|
7065
7119
|
*/
|
|
7066
7120
|
zoomToFit() {
|
|
7067
7121
|
if (this._scene.box) {
|
|
7068
|
-
const e =
|
|
7122
|
+
const e = tn.threeBox3dToGeBox2d(this._scene.box);
|
|
7069
7123
|
this.zoomTo(e), this._isDirty = !0;
|
|
7070
7124
|
}
|
|
7071
7125
|
}
|
|
@@ -7104,6 +7158,26 @@ class xn extends li {
|
|
|
7104
7158
|
const t = [];
|
|
7105
7159
|
this._scene.search(e).forEach((n) => t.push(n.id)), this.selectionSet.add(t);
|
|
7106
7160
|
}
|
|
7161
|
+
/**
|
|
7162
|
+
* @inheritdoc
|
|
7163
|
+
*/
|
|
7164
|
+
addLayer(e) {
|
|
7165
|
+
this._scene.addLayer({
|
|
7166
|
+
name: e.name,
|
|
7167
|
+
isFrozen: e.isFrozen,
|
|
7168
|
+
isOff: e.isOff
|
|
7169
|
+
});
|
|
7170
|
+
}
|
|
7171
|
+
/**
|
|
7172
|
+
* @inheritdoc
|
|
7173
|
+
*/
|
|
7174
|
+
updateLayer(e) {
|
|
7175
|
+
this._scene.updateLayer({
|
|
7176
|
+
name: e.name,
|
|
7177
|
+
isFrozen: e.isFrozen,
|
|
7178
|
+
isOff: e.isOff
|
|
7179
|
+
});
|
|
7180
|
+
}
|
|
7107
7181
|
/**
|
|
7108
7182
|
* @inheritdoc
|
|
7109
7183
|
*/
|
|
@@ -7127,7 +7201,7 @@ class xn extends li {
|
|
|
7127
7201
|
let t = [];
|
|
7128
7202
|
Array.isArray(e) ? t = e : t.push(e);
|
|
7129
7203
|
for (let i = 0; i < t.length; ++i) {
|
|
7130
|
-
const n = t[i], s = n.draw(this._renderer);
|
|
7204
|
+
const n = t[i], s = n.draw(this._renderer, !0);
|
|
7131
7205
|
s && (s.objectId = n.objectId, s.ownerId = n.ownerId, s.layerName = n.layer, s.visible = n.visibility, this._scene.update(s));
|
|
7132
7206
|
}
|
|
7133
7207
|
this._isDirty = !0, setTimeout(() => {
|
|
@@ -7177,13 +7251,13 @@ class xn extends li {
|
|
|
7177
7251
|
this._isDirty = this._scene.unhover([e]);
|
|
7178
7252
|
}
|
|
7179
7253
|
createScene() {
|
|
7180
|
-
const e = new
|
|
7254
|
+
const e = new xn();
|
|
7181
7255
|
return e.layouts.forEach((t) => {
|
|
7182
7256
|
t.setSnapObject(this.renderer.createObject());
|
|
7183
7257
|
}), e;
|
|
7184
7258
|
}
|
|
7185
7259
|
createStats(e) {
|
|
7186
|
-
const t = new
|
|
7260
|
+
const t = new Jt();
|
|
7187
7261
|
document.body.appendChild(t.dom);
|
|
7188
7262
|
const i = t.dom;
|
|
7189
7263
|
return i.style.position = "fixed", i.style.inset = "unset", i.style.bottom = "30px", i.style.right = "0px", this.toggleStatsVisibility(t, e), t;
|
|
@@ -7197,7 +7271,7 @@ class xn extends li {
|
|
|
7197
7271
|
*/
|
|
7198
7272
|
createLayoutViewIfNeeded(e) {
|
|
7199
7273
|
let t = this._layoutViewManager.getAt(e);
|
|
7200
|
-
return t == null && (t = new
|
|
7274
|
+
return t == null && (t = new an(
|
|
7201
7275
|
this._renderer,
|
|
7202
7276
|
e,
|
|
7203
7277
|
this.width,
|
|
@@ -7233,7 +7307,7 @@ class xn extends li {
|
|
|
7233
7307
|
if (i.number > 1) {
|
|
7234
7308
|
const r = this._layoutViewManager.getAt(i.ownerId);
|
|
7235
7309
|
if (r) {
|
|
7236
|
-
const o = new
|
|
7310
|
+
const o = new Se(
|
|
7237
7311
|
r,
|
|
7238
7312
|
i.toGiViewport(),
|
|
7239
7313
|
this._renderer
|
|
@@ -7249,7 +7323,7 @@ class xn extends li {
|
|
|
7249
7323
|
}
|
|
7250
7324
|
}
|
|
7251
7325
|
}
|
|
7252
|
-
class
|
|
7326
|
+
class bn {
|
|
7253
7327
|
/**
|
|
7254
7328
|
* Creates a new font loader instance.
|
|
7255
7329
|
*
|
|
@@ -7291,7 +7365,7 @@ class _n {
|
|
|
7291
7365
|
await this.getAvaiableFonts();
|
|
7292
7366
|
const t = [];
|
|
7293
7367
|
e.forEach((n) => {
|
|
7294
|
-
const s = n.toLowerCase(), r =
|
|
7368
|
+
const s = n.toLowerCase(), r = qt(this._avaiableFonts, (o) => Qt(o.name, (a) => a.toLowerCase() == s) >= 0);
|
|
7295
7369
|
r && t.push(r.url);
|
|
7296
7370
|
}), (await this._cadRenderer.loadFonts(t)).forEach((n) => {
|
|
7297
7371
|
n.status || V.emit("font-not-loaded", {
|
|
@@ -7318,7 +7392,7 @@ class C {
|
|
|
7318
7392
|
/** Fired when a document becomes active */
|
|
7319
7393
|
documentActivated: new M()
|
|
7320
7394
|
};
|
|
7321
|
-
const t = new
|
|
7395
|
+
const t = new ui();
|
|
7322
7396
|
t.database.events.openProgress.addEventListener((s) => {
|
|
7323
7397
|
V.emit("open-file-progress", {
|
|
7324
7398
|
database: t.database,
|
|
@@ -7331,8 +7405,8 @@ class C {
|
|
|
7331
7405
|
const i = () => ({
|
|
7332
7406
|
width: window.innerWidth,
|
|
7333
7407
|
height: window.innerHeight - 30
|
|
7334
|
-
}), n = new
|
|
7335
|
-
this._context = new
|
|
7408
|
+
}), n = new _n({ canvas: e, calculateSizeCallback: i });
|
|
7409
|
+
this._context = new Kt(n, t), this._fontLoader = new bn(n.renderer), Je().workingDatabase = t.database, this.registerCommands();
|
|
7336
7410
|
}
|
|
7337
7411
|
/**
|
|
7338
7412
|
* Creates the singleton instance with an optional canvas element.
|
|
@@ -7533,37 +7607,37 @@ class C {
|
|
|
7533
7607
|
A.SYSTEMT_COMMAND_GROUP_NAME,
|
|
7534
7608
|
"pan",
|
|
7535
7609
|
"pan",
|
|
7536
|
-
new
|
|
7610
|
+
new Bi()
|
|
7537
7611
|
), e.addCommand(
|
|
7538
7612
|
A.SYSTEMT_COMMAND_GROUP_NAME,
|
|
7539
7613
|
"select",
|
|
7540
7614
|
"select",
|
|
7541
|
-
new
|
|
7615
|
+
new wi()
|
|
7542
7616
|
), e.addCommand(
|
|
7543
7617
|
A.SYSTEMT_COMMAND_GROUP_NAME,
|
|
7544
7618
|
"zoom",
|
|
7545
7619
|
"zoom",
|
|
7546
|
-
new
|
|
7620
|
+
new vi()
|
|
7547
7621
|
), e.addCommand(
|
|
7548
7622
|
A.SYSTEMT_COMMAND_GROUP_NAME,
|
|
7549
7623
|
"zoomw",
|
|
7550
7624
|
"zoomw",
|
|
7551
|
-
new
|
|
7625
|
+
new Ii()
|
|
7552
7626
|
), e.addCommand(
|
|
7553
7627
|
A.SYSTEMT_COMMAND_GROUP_NAME,
|
|
7554
7628
|
"csvg",
|
|
7555
7629
|
"csvg",
|
|
7556
|
-
new
|
|
7630
|
+
new xi()
|
|
7557
7631
|
), e.addCommand(
|
|
7558
7632
|
A.SYSTEMT_COMMAND_GROUP_NAME,
|
|
7559
7633
|
"qnew",
|
|
7560
7634
|
"qnew",
|
|
7561
|
-
new
|
|
7635
|
+
new bi()
|
|
7562
7636
|
), e.addCommand(
|
|
7563
7637
|
A.SYSTEMT_COMMAND_GROUP_NAME,
|
|
7564
7638
|
"open",
|
|
7565
7639
|
"open",
|
|
7566
|
-
new
|
|
7640
|
+
new _i()
|
|
7567
7641
|
);
|
|
7568
7642
|
}
|
|
7569
7643
|
/**
|
|
@@ -7649,7 +7723,7 @@ class Ye {
|
|
|
7649
7723
|
* @returns Return the converted drawing database entity
|
|
7650
7724
|
*/
|
|
7651
7725
|
createEntity(e) {
|
|
7652
|
-
return e.type == "ARC" ? this.convertArc(e) : e.type == "CIRCLE" ? this.convertCirle(e) : e.type == "DIMENSION" ? this.convertDimension(e) : e.type == "ELLIPSE" ? this.convertEllipse(e) : e.type == "HATCH" ? this.convertHatch(e) : e.type == "IMAGE" ? this.convertImage(e) : e.type == "LEADER" ? this.convertLeader(e) : e.type == "LINE" ? this.convertLine(e) : e.type == "LWPOLYLINE" ? this.convertLWPolyline(e) : e.type == "MTEXT" ? this.convertMText(e) : e.type == "POINT" ? this.convertPoint(e) : e.type == "POLYLINE" ? this.convertPolyline(e) : e.type == "RAY" ? this.convertRay(e) : e.type == "SPLINE" ? this.convertSpline(e) : e.type == "ACAD_TABLE" ? this.convertTable(e) : e.type == "TEXT" ? this.convertText(e) : e.type == "SOLID" ? this.convertSolid(e) : e.type == "VIEWPORT" ? this.convertViewport(e) : e.type == "XLINE" ? this.convertXline(e) : e.type == "INSERT" ? this.convertBlockReference(e) : null;
|
|
7726
|
+
return e.type == "ARC" ? this.convertArc(e) : e.type == "CIRCLE" ? this.convertCirle(e) : e.type == "DIMENSION" ? this.convertDimension(e) : e.type == "ELLIPSE" ? this.convertEllipse(e) : e.type == "HATCH" ? this.convertHatch(e) : e.type == "IMAGE" ? this.convertImage(e) : e.type == "LEADER" ? this.convertLeader(e) : e.type == "LINE" ? this.convertLine(e) : e.type == "LWPOLYLINE" ? this.convertLWPolyline(e) : e.type == "MTEXT" ? this.convertMText(e) : e.type == "POINT" ? this.convertPoint(e) : e.type == "POLYLINE" ? this.convertPolyline(e) : e.type == "RAY" ? this.convertRay(e) : e.type == "SPLINE" ? this.convertSpline(e) : e.type == "ACAD_TABLE" ? this.convertTable(e) : e.type == "TEXT" ? this.convertText(e) : e.type == "SOLID" ? this.convertSolid(e) : e.type == "VIEWPORT" ? this.convertViewport(e) : e.type == "WIPEOUT" ? this.convertWipeout(e) : e.type == "XLINE" ? this.convertXline(e) : e.type == "INSERT" ? this.convertBlockReference(e) : null;
|
|
7653
7727
|
}
|
|
7654
7728
|
convertArc(e) {
|
|
7655
7729
|
return new vt(
|
|
@@ -7707,7 +7781,7 @@ class Ye {
|
|
|
7707
7781
|
), t.thickness = e.thickness, t;
|
|
7708
7782
|
}
|
|
7709
7783
|
convertLWPolyline(e) {
|
|
7710
|
-
const t = new
|
|
7784
|
+
const t = new Re();
|
|
7711
7785
|
return t.closed = !!(e.flag & 512), e.vertices.forEach((i, n) => {
|
|
7712
7786
|
t.addVertexAt(
|
|
7713
7787
|
n,
|
|
@@ -7719,7 +7793,7 @@ class Ye {
|
|
|
7719
7793
|
}), t;
|
|
7720
7794
|
}
|
|
7721
7795
|
convertPolyline(e) {
|
|
7722
|
-
const t = new
|
|
7796
|
+
const t = new Re();
|
|
7723
7797
|
return t.closed = !!(e.flag & 1), e.vertices.forEach((i, n) => {
|
|
7724
7798
|
t.addVertexAt(
|
|
7725
7799
|
n,
|
|
@@ -7769,7 +7843,7 @@ class Ye {
|
|
|
7769
7843
|
);
|
|
7770
7844
|
} else if (o.type == 3) {
|
|
7771
7845
|
const a = o;
|
|
7772
|
-
new
|
|
7846
|
+
new Le().subVectors(a.end, a.center);
|
|
7773
7847
|
const h = Math.sqrt(
|
|
7774
7848
|
Math.pow(a.end.x, 2) + Math.pow(a.end.y, 2)
|
|
7775
7849
|
), l = h * a.lengthOfMinorAxis;
|
|
@@ -7799,7 +7873,7 @@ class Ye {
|
|
|
7799
7873
|
let l = !0;
|
|
7800
7874
|
const m = a.controlPoints.map((u) => (u.weight == null && (l = !1), u.weight || 1));
|
|
7801
7875
|
r.add(
|
|
7802
|
-
new
|
|
7876
|
+
new Oe(
|
|
7803
7877
|
h,
|
|
7804
7878
|
a.knots,
|
|
7805
7879
|
l ? m : void 0
|
|
@@ -7811,7 +7885,7 @@ class Ye {
|
|
|
7811
7885
|
y: l.y,
|
|
7812
7886
|
z: 0
|
|
7813
7887
|
}));
|
|
7814
|
-
r.add(new
|
|
7888
|
+
r.add(new Oe(h, "Uniform"));
|
|
7815
7889
|
}
|
|
7816
7890
|
}
|
|
7817
7891
|
}), i.add(r);
|
|
@@ -7833,11 +7907,11 @@ class Ye {
|
|
|
7833
7907
|
}), t;
|
|
7834
7908
|
}
|
|
7835
7909
|
convertText(e) {
|
|
7836
|
-
const t = new
|
|
7910
|
+
const t = new Rt();
|
|
7837
7911
|
return t.textString = e.text, t.styleName = e.styleName, t.height = e.textHeight, t.position.copy(e.startPoint), t.rotation = e.rotation, t.oblique = e.obliqueAngle ?? 0, t.thickness = e.thickness, t.horizontalMode = e.halign, t.verticalMode = e.valign, t.widthFactor = e.xScale ?? 1, t;
|
|
7838
7912
|
}
|
|
7839
7913
|
convertMText(e) {
|
|
7840
|
-
const t = new
|
|
7914
|
+
const t = new Ot();
|
|
7841
7915
|
return t.contents = e.text, e.styleName != null && (t.styleName = e.styleName), t.height = e.textHeight, t.width = e.rectWidth, t.rotation = e.rotation || 0, t.location = e.insertionPoint, t.attachmentPoint = e.attachmentPoint, e.direction && (t.direction = new fe(e.direction)), t.drawingDirection = e.drawingDirection, t;
|
|
7842
7916
|
}
|
|
7843
7917
|
convertLeader(e) {
|
|
@@ -7869,14 +7943,14 @@ class Ye {
|
|
|
7869
7943
|
);
|
|
7870
7944
|
return this.processDimensionCommonAttrs(e, i), i;
|
|
7871
7945
|
} else if (e.subclassMarker == "AcDbRadialDimension") {
|
|
7872
|
-
const t = e, i = new
|
|
7946
|
+
const t = e, i = new Ft(
|
|
7873
7947
|
t.definitionPoint,
|
|
7874
7948
|
t.centerPoint,
|
|
7875
7949
|
t.leaderLength
|
|
7876
7950
|
);
|
|
7877
7951
|
return this.processDimensionCommonAttrs(e, i), i;
|
|
7878
7952
|
} else if (e.subclassMarker == "AcDbDiametricDimension") {
|
|
7879
|
-
const t = e, i = new
|
|
7953
|
+
const t = e, i = new Nt(
|
|
7880
7954
|
t.definitionPoint,
|
|
7881
7955
|
t.centerPoint,
|
|
7882
7956
|
t.leaderLength
|
|
@@ -7898,11 +7972,10 @@ class Ye {
|
|
|
7898
7972
|
const t = new et();
|
|
7899
7973
|
return this.processImage(e, t), t;
|
|
7900
7974
|
}
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
// }
|
|
7975
|
+
convertWipeout(e) {
|
|
7976
|
+
const t = new Ut();
|
|
7977
|
+
return this.processImage(e, t), t;
|
|
7978
|
+
}
|
|
7906
7979
|
convertViewport(e) {
|
|
7907
7980
|
const t = new Ke();
|
|
7908
7981
|
return t.number = e.viewportId, t.centerPoint.copy(e.viewportCenter), t.height = e.height, t.width = e.width, t.viewCenter.copy(e.displayCenter), t.viewHeight = e.viewHeight, t;
|
|
@@ -7916,7 +7989,7 @@ class Ye {
|
|
|
7916
7989
|
return t.basePoint.copy(e.firstPoint), t.unitDir.copy(e.unitDirection), t;
|
|
7917
7990
|
}
|
|
7918
7991
|
convertBlockReference(e) {
|
|
7919
|
-
const t = new
|
|
7992
|
+
const t = new Wt(e.name);
|
|
7920
7993
|
return e.insertionPoint && t.position.copy(e.insertionPoint), t.scaleFactors.x = e.xScale, t.scaleFactors.y = e.yScale, t.scaleFactors.z = e.zScale, t.rotation = e.rotation, t.normal.copy(e.extrusionDirection), t;
|
|
7921
7994
|
}
|
|
7922
7995
|
processDimensionCommonAttrs(e, t) {
|
|
@@ -7926,7 +7999,7 @@ class Ye {
|
|
|
7926
7999
|
t.layer = e.layer, t.objectId = e.handle.toString(), t.ownerId = e.ownerBlockRecordSoftId.toString(), e.lineType != null && (t.lineType = e.lineType), e.lineweight != null && (t.lineWeight = e.lineweight), e.lineTypeScale != null && (t.linetypeScale = e.lineTypeScale), e.color != null && (t.color.color = e.color), e.colorIndex != null && (t.color.colorIndex = e.colorIndex), e.colorName != null && (t.color.colorName = e.colorName), e.isVisible != null && (t.visibility = e.isVisible), e.transparency != null && (t.transparency = e.transparency);
|
|
7927
8000
|
}
|
|
7928
8001
|
}
|
|
7929
|
-
class
|
|
8002
|
+
class wn extends ut {
|
|
7930
8003
|
constructor(e = {}) {
|
|
7931
8004
|
super(e), e.useWorker = !0, e.parserWorkerUrl || (e.parserWorkerUrl = "/assets/libredwg-parser-worker.js");
|
|
7932
8005
|
}
|
|
@@ -8205,9 +8278,9 @@ class bn extends ut {
|
|
|
8205
8278
|
return i.flatMap((n) => t[n]);
|
|
8206
8279
|
}
|
|
8207
8280
|
}
|
|
8208
|
-
function
|
|
8281
|
+
function vn() {
|
|
8209
8282
|
try {
|
|
8210
|
-
const c = new
|
|
8283
|
+
const c = new Xt({
|
|
8211
8284
|
convertByEntityType: !1,
|
|
8212
8285
|
useWorker: !0,
|
|
8213
8286
|
parserWorkerUrl: "./assets/dxf-parser-worker.js"
|
|
@@ -8217,7 +8290,7 @@ function wn() {
|
|
|
8217
8290
|
console.error("Failed to register dxf converter: ", c);
|
|
8218
8291
|
}
|
|
8219
8292
|
try {
|
|
8220
|
-
const c = new
|
|
8293
|
+
const c = new wn({
|
|
8221
8294
|
convertByEntityType: !1,
|
|
8222
8295
|
useWorker: !0,
|
|
8223
8296
|
parserWorkerUrl: "./assets/libredwg-parser-worker.js"
|
|
@@ -8227,12 +8300,12 @@ function wn() {
|
|
|
8227
8300
|
console.error("Failed to register dwg converter: ", c);
|
|
8228
8301
|
}
|
|
8229
8302
|
}
|
|
8230
|
-
function
|
|
8231
|
-
|
|
8303
|
+
function Tn() {
|
|
8304
|
+
vn(), typeof window < "u" && !!window.location && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1") ? ve.getInstance().initialize(
|
|
8232
8305
|
"/assets/mtext-renderer-worker.js"
|
|
8233
|
-
) :
|
|
8306
|
+
) : ve.getInstance().initialize("./mtext-renderer-worker.js");
|
|
8234
8307
|
}
|
|
8235
|
-
const
|
|
8308
|
+
const Sn = {
|
|
8236
8309
|
isDebug: !1,
|
|
8237
8310
|
isShowCommandLine: !0,
|
|
8238
8311
|
isShowCoordinate: !0,
|
|
@@ -8430,35 +8503,35 @@ class oe {
|
|
|
8430
8503
|
*/
|
|
8431
8504
|
get settings() {
|
|
8432
8505
|
const e = localStorage.getItem(He), t = e == null ? {} : JSON.parse(e);
|
|
8433
|
-
return
|
|
8506
|
+
return Zt(t, Sn);
|
|
8434
8507
|
}
|
|
8435
8508
|
}
|
|
8436
8509
|
export {
|
|
8437
|
-
|
|
8438
|
-
|
|
8510
|
+
Kt as AcApContext,
|
|
8511
|
+
xi as AcApConvertToSvgCmd,
|
|
8439
8512
|
C as AcApDocManager,
|
|
8440
|
-
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
|
|
8444
|
-
|
|
8513
|
+
ui as AcApDocument,
|
|
8514
|
+
_i as AcApOpenCmd,
|
|
8515
|
+
Bi as AcApPanCmd,
|
|
8516
|
+
bi as AcApQNewCmd,
|
|
8517
|
+
wi as AcApSelectCmd,
|
|
8445
8518
|
oe as AcApSettingManager,
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
|
|
8519
|
+
vi as AcApZoomCmd,
|
|
8520
|
+
Ii as AcApZoomToBoxCmd,
|
|
8521
|
+
Si as AcApZoomToBoxJig,
|
|
8522
|
+
di as AcEdBaseView,
|
|
8450
8523
|
j as AcEdCommand,
|
|
8451
8524
|
A as AcEdCommandStack,
|
|
8452
8525
|
ce as AcEdCorsorType,
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8526
|
+
ii as AcEdCursorManager,
|
|
8527
|
+
si as AcEdJig,
|
|
8528
|
+
li as AcEdSelectionSet,
|
|
8529
|
+
O as AcEdViewMode,
|
|
8530
|
+
hi as AcEditor,
|
|
8531
|
+
_n as AcTrView2d,
|
|
8459
8532
|
$e as DEFAULT_VIEW_2D_OPTIONS,
|
|
8460
|
-
|
|
8533
|
+
En as acedAlert,
|
|
8461
8534
|
V as eventBus,
|
|
8462
|
-
|
|
8463
|
-
|
|
8535
|
+
vn as registerConverters,
|
|
8536
|
+
Tn as registerWorkers
|
|
8464
8537
|
};
|