@realsee/dnalogel 3.48.7 → 3.49.0
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/CHANGELOG.md +6 -2
- package/dist/Sculpt/Meshes/Prism.d.ts +1 -0
- package/dist/index.cjs.js +30 -30
- package/dist/index.js +58 -62
- package/dist/index.umd.js +30 -30
- package/dist/shared-utils/Object3DHelper/Controller/RotateController.d.ts +0 -1
- package/dist/shared-utils/Object3DHelper/Controller/ScaleController.d.ts +1 -1
- package/dist/shared-utils/three/PointSelector/index.d.ts +2 -1
- package/dist/shared-utils/three/generatePolygonGeometry.d.ts +1 -1
- package/libs/Sculpt/Meshes/Prism.d.ts +1 -0
- package/libs/Sculpt/Meshes/Prism.js +47 -37
- package/libs/Sculpt/utils/Modules/Global.js +1 -1
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +57 -57
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.d.ts +0 -1
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.js +91 -97
- package/libs/shared-utils/Object3DHelper/Controller/ScaleController.d.ts +1 -1
- package/libs/shared-utils/Object3DHelper/Controller/ScaleController.js +34 -31
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/PointSelector/index.d.ts +2 -1
- package/libs/shared-utils/three/generatePolygonGeometry.d.ts +1 -1
- package/libs/shared-utils/three/generatePolygonGeometry.js +8 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -48,7 +48,7 @@ import Ip from "earcut";
|
|
|
48
48
|
import { GLTFLoader as Ep } from "@realsee/five/gltf-loader";
|
|
49
49
|
function Mp() {
|
|
50
50
|
console.debug(
|
|
51
|
-
"%c %c@realsee/dnalogel %cv3.
|
|
51
|
+
"%c %c@realsee/dnalogel %cv3.49.0",
|
|
52
52
|
[
|
|
53
53
|
"background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')",
|
|
54
54
|
"background-repeat: no-repeat",
|
|
@@ -8357,7 +8357,7 @@ let Hi = class {
|
|
|
8357
8357
|
/**
|
|
8358
8358
|
* @realsee/dnalogel 版本号
|
|
8359
8359
|
*/
|
|
8360
|
-
d(this, "VERSION", "3.
|
|
8360
|
+
d(this, "VERSION", "3.49.0");
|
|
8361
8361
|
d(this, "NAME");
|
|
8362
8362
|
d(this, "five");
|
|
8363
8363
|
d(this, "workUtil");
|
|
@@ -12252,11 +12252,9 @@ function Om(n, t) {
|
|
|
12252
12252
|
if (c !== 0)
|
|
12253
12253
|
return { start: e[c - 1], end: e[c] };
|
|
12254
12254
|
}).filter(Boolean);
|
|
12255
|
-
for (let l = 0; l < a.length; l++)
|
|
12256
|
-
|
|
12257
|
-
if (c && console.log("多边形边线相交", l, e), c)
|
|
12255
|
+
for (let l = 0; l < a.length; l++)
|
|
12256
|
+
if (cl(a[l], a.slice(l)))
|
|
12258
12257
|
return;
|
|
12259
|
-
}
|
|
12260
12258
|
}
|
|
12261
12259
|
const i = e.flatMap((a) => [a.x, a.y, a.z]), s = new y.Float32BufferAttribute(i, 3), o = Q1(e), r = new y.BufferGeometry();
|
|
12262
12260
|
return r.setAttribute("position", s), r.setIndex(o), r.name = "PolygonGeometry", r;
|
|
@@ -33224,11 +33222,47 @@ class Wk extends ro {
|
|
|
33224
33222
|
});
|
|
33225
33223
|
d(this, "mouseInfo");
|
|
33226
33224
|
d(this, "mousedownEventListenerDisposer");
|
|
33225
|
+
/**
|
|
33226
|
+
* @description: 拖动开始,找出拖的Direction
|
|
33227
|
+
*/
|
|
33228
|
+
d(this, "dragStart", (e) => {
|
|
33229
|
+
if (this.moveByMouseEnable || this.isDragging)
|
|
33230
|
+
return;
|
|
33231
|
+
const i = e == null ? void 0 : e.intersect;
|
|
33232
|
+
if (!i)
|
|
33233
|
+
return this.dragEnd();
|
|
33234
|
+
const s = (i == null ? void 0 : i.object).direction;
|
|
33235
|
+
if (!s)
|
|
33236
|
+
return this.dragEnd();
|
|
33237
|
+
const o = new y.Vector3(1, 0, 0).applyQuaternion(this.helperObject3D.quaternion), r = new y.Vector3(0, 1, 0).applyQuaternion(this.helperObject3D.quaternion), a = new y.Vector3(0, 0, 1).applyQuaternion(this.helperObject3D.quaternion), l = (() => {
|
|
33238
|
+
switch (s) {
|
|
33239
|
+
case "x":
|
|
33240
|
+
return o;
|
|
33241
|
+
case "y":
|
|
33242
|
+
return r;
|
|
33243
|
+
case "z":
|
|
33244
|
+
return a;
|
|
33245
|
+
}
|
|
33246
|
+
})(), c = i.point.clone(), h = new y.Line3(
|
|
33247
|
+
c.clone().sub(l.normalize()),
|
|
33248
|
+
c.clone().add(l.normalize())
|
|
33249
|
+
);
|
|
33250
|
+
this.startInfo = { startVectorProject: c, line: h }, this.helperObject3D.showDraggingHelper([s]), this.hooks.emit("moveStart"), this.isDragging = !0;
|
|
33251
|
+
});
|
|
33252
|
+
d(this, "dragging", (e) => {
|
|
33253
|
+
if (!this.isDragging || !this.startInfo)
|
|
33254
|
+
return;
|
|
33255
|
+
const i = "touches" in e ? e.touches[0].clientX : e.x, s = "touches" in e ? e.touches[0].clientY : e.y, o = jr(this.camera, { x: i, y: s }, this.container);
|
|
33256
|
+
return o ? (this.move(o), !1) : this.dragEnd();
|
|
33257
|
+
});
|
|
33258
|
+
d(this, "dragEnd", () => {
|
|
33259
|
+
this.isDragging && (this.startInfo = void 0, this.isDragging = !1, this.helperObject3D.show(), this.hooks.emit("moveEnd"));
|
|
33260
|
+
});
|
|
33227
33261
|
const i = this.helperObject3D;
|
|
33228
33262
|
this.hoverListener([i.xArrow, i.yArrow, i.zArrow]);
|
|
33229
|
-
const s = this.
|
|
33230
|
-
this.domEvents.addEventListener(this.helperObject3D, "mousedown",
|
|
33231
|
-
this.domEvents.removeEventListener(this.helperObject3D, "mousedown",
|
|
33263
|
+
const s = this.show.bind(this), o = this.hide.bind(this);
|
|
33264
|
+
this.domEvents.addEventListener(this.helperObject3D, "mousedown", this.dragStart), document.addEventListener("mousemove", this.dragging), document.addEventListener("mouseup", this.dragEnd), this.domEvents.addEventListener(this.helperObject3D, "touchstart", this.dragStart), document.addEventListener("touchmove", this.dragging), document.addEventListener("touchend", this.dragEnd), this.hooks.on("rotateStart", o), this.hooks.on("rotateEnd", s), this.hooks.on("scaleStart", o), this.hooks.on("scaleEnd", s), this.hooks.on("moveByMouseEnable", o), this.hooks.on("moveByMouseDisable", s), this.disposers.push(() => {
|
|
33265
|
+
this.domEvents.removeEventListener(this.helperObject3D, "mousedown", this.dragStart), document.removeEventListener("mousemove", this.dragging), document.removeEventListener("mouseup", this.dragEnd), this.domEvents.removeEventListener(this.helperObject3D, "touchstart", this.dragStart), document.removeEventListener("touchmove", this.dragging), document.removeEventListener("touchend", this.dragEnd), this.hooks.off("rotateStart", o), this.hooks.off("rotateEnd", s), this.hooks.off("scaleStart", o), this.hooks.off("scaleEnd", s), this.hooks.off("moveByMouseEnable", o), this.hooks.off("moveByMouseDisable", s);
|
|
33232
33266
|
}), this.moveByMouseEnable && this.moveByMouse();
|
|
33233
33267
|
}
|
|
33234
33268
|
get moveByMouseEnable() {
|
|
@@ -33284,39 +33318,6 @@ class Wk extends ro {
|
|
|
33284
33318
|
const { x: i, y: s } = e;
|
|
33285
33319
|
this.mouseInfo.x === i && this.mouseInfo.y === s && Date.now() - this.mouseInfo.mouseDownTimestamp < 500 && (this.disableMoveByMouse(), this.mouseInfo = void 0);
|
|
33286
33320
|
}
|
|
33287
|
-
/**
|
|
33288
|
-
* @description: 拖动开始,找出拖的Direction
|
|
33289
|
-
*/
|
|
33290
|
-
dragStart(e) {
|
|
33291
|
-
if (this.moveByMouseEnable || this.isDragging)
|
|
33292
|
-
return;
|
|
33293
|
-
const i = e == null ? void 0 : e.intersect;
|
|
33294
|
-
if (!i)
|
|
33295
|
-
return this.dragEnd();
|
|
33296
|
-
const s = (i == null ? void 0 : i.object).direction;
|
|
33297
|
-
if (!s)
|
|
33298
|
-
return this.dragEnd();
|
|
33299
|
-
const o = new y.Vector3(1, 0, 0).applyQuaternion(this.helperObject3D.quaternion), r = new y.Vector3(0, 1, 0).applyQuaternion(this.helperObject3D.quaternion), a = new y.Vector3(0, 0, 1).applyQuaternion(this.helperObject3D.quaternion), l = (() => {
|
|
33300
|
-
switch (s) {
|
|
33301
|
-
case "x":
|
|
33302
|
-
return o;
|
|
33303
|
-
case "y":
|
|
33304
|
-
return r;
|
|
33305
|
-
case "z":
|
|
33306
|
-
return a;
|
|
33307
|
-
}
|
|
33308
|
-
})(), c = i.point.clone(), h = new y.Line3(
|
|
33309
|
-
c.clone().sub(l.normalize()),
|
|
33310
|
-
c.clone().add(l.normalize())
|
|
33311
|
-
);
|
|
33312
|
-
this.startInfo = { startVectorProject: c, line: h }, this.helperObject3D.showDraggingHelper([s]), this.hooks.emit("moveStart"), this.isDragging = !0;
|
|
33313
|
-
}
|
|
33314
|
-
dragging(e) {
|
|
33315
|
-
if (!this.isDragging || !this.startInfo)
|
|
33316
|
-
return;
|
|
33317
|
-
const i = jr(this.camera, e, this.container);
|
|
33318
|
-
return i ? (this.move(i), !1) : this.dragEnd();
|
|
33319
|
-
}
|
|
33320
33321
|
move(e) {
|
|
33321
33322
|
if (!this.startInfo)
|
|
33322
33323
|
return this.dragEnd();
|
|
@@ -33325,9 +33326,6 @@ class Wk extends ro {
|
|
|
33325
33326
|
const c = o.position.clone().applyMatrix4(l);
|
|
33326
33327
|
this.hooks.emit("wantToMove", c) || (o.applyMatrix4(l), s.copy(r), this.internalHooks.emit("applyObjectPosition", { matrix: l }), this.hooks.emit("move", c));
|
|
33327
33328
|
}
|
|
33328
|
-
dragEnd() {
|
|
33329
|
-
this.isDragging && (this.startInfo = void 0, this.isDragging = !1, this.helperObject3D.show(), this.hooks.emit("moveEnd"));
|
|
33330
|
-
}
|
|
33331
33329
|
}
|
|
33332
33330
|
class Ds {
|
|
33333
33331
|
// eslint-disable-next-line max-params
|
|
@@ -33499,16 +33497,13 @@ class Kk extends ro {
|
|
|
33499
33497
|
const i = this.helperObject3D;
|
|
33500
33498
|
this.hoverListener([(c = i.xCircle) == null ? void 0 : c.circle, (h = i.yCircle) == null ? void 0 : h.circle, (u = i.zCircle) == null ? void 0 : u.circle].filter(Boolean));
|
|
33501
33499
|
const s = this.dragStart.bind(this), o = this.dragging.bind(this), r = this.dragEnd.bind(this), a = this.show.bind(this), l = this.hide.bind(this);
|
|
33502
|
-
this.domEvents.addEventListener(this.helperObject3D, "mousedown", s), document.addEventListener("mousemove", o), document.addEventListener("mouseup", r), this.hooks.on("moveStart", l), this.hooks.on("moveEnd", a), this.hooks.on("scaleStart", l), this.hooks.on("scaleEnd", a), this.hooks.on("moveByMouseEnable", l), this.hooks.on("moveByMouseDisable", a), this.
|
|
33503
|
-
this.domEvents.removeEventListener(this.helperObject3D, "mousedown", s), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.hooks.off("moveStart", l), this.hooks.off("moveEnd", a), this.hooks.off("scaleStart", l), this.hooks.off("scaleEnd", a), this.hooks.off("moveByMouseEnable", l), this.hooks.off("moveByMouseDisable", a);
|
|
33504
|
-
};
|
|
33500
|
+
this.domEvents.addEventListener(this.helperObject3D, "mousedown", s), document.addEventListener("mousemove", o), document.addEventListener("mouseup", r), this.domEvents.addEventListener(this.helperObject3D, "touchstart", s), document.addEventListener("touchmove", o), document.addEventListener("touchend", r), this.hooks.on("moveStart", l), this.hooks.on("moveEnd", a), this.hooks.on("scaleStart", l), this.hooks.on("scaleEnd", a), this.hooks.on("moveByMouseEnable", l), this.hooks.on("moveByMouseDisable", a), this.disposers.push(() => {
|
|
33501
|
+
this.domEvents.removeEventListener(this.helperObject3D, "mousedown", s), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.domEvents.removeEventListener(this.helperObject3D, "touchstart", s), document.removeEventListener("touchmove", o), document.removeEventListener("touchend", r), this.hooks.off("moveStart", l), this.hooks.off("moveEnd", a), this.hooks.off("scaleStart", l), this.hooks.off("scaleEnd", a), this.hooks.off("moveByMouseEnable", l), this.hooks.off("moveByMouseDisable", a);
|
|
33502
|
+
});
|
|
33505
33503
|
}
|
|
33506
33504
|
get rotateCenter() {
|
|
33507
33505
|
return this.helperObject3D.position.clone();
|
|
33508
33506
|
}
|
|
33509
|
-
// public initialHelperQuaternion() {
|
|
33510
|
-
// this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion)
|
|
33511
|
-
// }
|
|
33512
33507
|
setRotateAngle(e) {
|
|
33513
33508
|
const { x: i = 0, y: s = 0, z: o = 0 } = e, r = new y.Euler(Ga(i), Ga(s), Ga(o)), a = new y.Quaternion().setFromEuler(r);
|
|
33514
33509
|
if (this.hooks.emit("wantToRotate", a))
|
|
@@ -33516,9 +33511,6 @@ class Kk extends ro {
|
|
|
33516
33511
|
const { originObject3D: c, rotateCenter: h } = this;
|
|
33517
33512
|
Og(c, a, h), this.internalHooks.emit("setObjectRotate", a, h), this.hooks.emit("rotate", a), this.render();
|
|
33518
33513
|
}
|
|
33519
|
-
dispose() {
|
|
33520
|
-
this.removeListener(), super.dispose();
|
|
33521
|
-
}
|
|
33522
33514
|
onApplyOriginObjectRotate(e) {
|
|
33523
33515
|
this.isDragging || super.onApplyOriginObjectRotate(e);
|
|
33524
33516
|
}
|
|
@@ -33553,8 +33545,8 @@ class Kk extends ro {
|
|
|
33553
33545
|
dragging(e) {
|
|
33554
33546
|
if (!this.isDragging)
|
|
33555
33547
|
return;
|
|
33556
|
-
const i = jr(this.camera,
|
|
33557
|
-
return
|
|
33548
|
+
const i = "touches" in e ? e.touches[0].clientX : e.x, s = "touches" in e ? e.touches[0].clientY : e.y, o = jr(this.camera, { x: i, y: s }, this.container);
|
|
33549
|
+
return o ? (this.rotate(o), !1) : this.dragEnd();
|
|
33558
33550
|
}
|
|
33559
33551
|
rotate(e) {
|
|
33560
33552
|
if (!this.startInfo)
|
|
@@ -33807,8 +33799,8 @@ class s3 extends ro {
|
|
|
33807
33799
|
d(this, "dragging", (e) => {
|
|
33808
33800
|
if (!this.isDragging || !this.startInfo)
|
|
33809
33801
|
return;
|
|
33810
|
-
const i = jr(this.camera,
|
|
33811
|
-
return
|
|
33802
|
+
const i = "touches" in e ? e.touches[0].clientX : e.x, s = "touches" in e ? e.touches[0].clientY : e.y, o = jr(this.camera, { x: i, y: s }, this.container);
|
|
33803
|
+
return o ? (this.scale(o), !1) : this.dragEnd();
|
|
33812
33804
|
});
|
|
33813
33805
|
d(this, "scale", (e) => {
|
|
33814
33806
|
var c, h;
|
|
@@ -33824,7 +33816,10 @@ class s3 extends ro {
|
|
|
33824
33816
|
d(this, "dragEnd", () => {
|
|
33825
33817
|
this.isDragging && (this.startInfo = void 0, this.isDragging = !1, this.internalHooks.emit("initialHelperPosition"), this.hooks.emit("scaleEnd"));
|
|
33826
33818
|
});
|
|
33827
|
-
this.
|
|
33819
|
+
const i = this.show.bind(this), s = this.hide.bind(this);
|
|
33820
|
+
this.domEvents.addEventListener(this.helperObject3D, "mousedown", this.dragStart), document.addEventListener("mousemove", this.dragging), document.addEventListener("mouseup", this.dragEnd), this.domEvents.addEventListener(this.helperObject3D, "touchstart", this.dragStart), document.addEventListener("touchmove", this.dragging), document.addEventListener("touchend", this.dragEnd), this.hooks.on("rotateStart", s), this.hooks.on("rotateEnd", i), this.hooks.on("moveStart", s), this.hooks.on("moveEnd", i), this.hooks.on("moveByMouseEnable", s), this.hooks.on("moveByMouseDisable", i), this.disposers.push(() => {
|
|
33821
|
+
this.domEvents.removeEventListener(this.helperObject3D, "mousedown", this.dragStart), document.removeEventListener("mousemove", this.dragging), document.removeEventListener("mouseup", this.dragEnd), this.domEvents.removeEventListener(this.helperObject3D, "touchstart", this.dragStart), document.removeEventListener("touchmove", this.dragging), document.removeEventListener("touchend", this.dragEnd), this.hooks.off("rotateStart", s), this.hooks.off("rotateEnd", i), this.hooks.off("moveStart", s), this.hooks.off("moveEnd", i), this.hooks.off("moveByMouseEnable", s), this.hooks.off("moveByMouseDisable", i);
|
|
33822
|
+
});
|
|
33828
33823
|
}
|
|
33829
33824
|
initialHelperQuaternion() {
|
|
33830
33825
|
this.helperObject3D.initQuaternion();
|
|
@@ -36057,7 +36052,7 @@ class F3 {
|
|
|
36057
36052
|
get pointSelector() {
|
|
36058
36053
|
if (!this.inited)
|
|
36059
36054
|
throw new Error("Global not inited");
|
|
36060
|
-
return this._pointSelector ? this._pointSelector : (this._pointSelector = new Nm(this.five), this._pointSelector);
|
|
36055
|
+
return this._pointSelector ? this._pointSelector : (this._pointSelector = new Nm(this.five, { mode: "cursor" }), this._pointSelector);
|
|
36061
36056
|
}
|
|
36062
36057
|
get fiveDomEvents() {
|
|
36063
36058
|
if (!this.inited)
|
|
@@ -37303,6 +37298,7 @@ class pr extends jt {
|
|
|
37303
37298
|
d(this, "heightPoint");
|
|
37304
37299
|
d(this, "bottomPolygon", new gr());
|
|
37305
37300
|
d(this, "topPolygon", new gr());
|
|
37301
|
+
d(this, "paramStyle");
|
|
37306
37302
|
d(this, "edgePlanes", new jt());
|
|
37307
37303
|
this.topPolygon.name = "TopPolygon", this.bottomPolygon.name = "BottomPolygon", this.edgePlanes.name = "EdgePlanes", this.addIfNotExists(this.bottomPolygon), e && this.setPoints(e), e && this.setStyle(e);
|
|
37308
37304
|
}
|
|
@@ -37331,8 +37327,8 @@ class pr extends jt {
|
|
|
37331
37327
|
return this.bottomPolygon.lineColor;
|
|
37332
37328
|
}
|
|
37333
37329
|
setStyle(e) {
|
|
37334
|
-
this.bottomPolygon.setStyle(
|
|
37335
|
-
(i instanceof Ut || i instanceof mr) && i.setStyle(
|
|
37330
|
+
this.paramStyle = x(x({}, this.paramStyle), e), this.bottomPolygon.setStyle(this.paramStyle), this.topPolygon.setStyle(this.paramStyle), this.edgePlanes.children.forEach((i) => {
|
|
37331
|
+
(i instanceof Ut || i instanceof mr) && i.setStyle(this.paramStyle);
|
|
37336
37332
|
});
|
|
37337
37333
|
}
|
|
37338
37334
|
setPoints(e) {
|