@realsee/dnalogel 3.49.7-alpha.0 → 3.49.8

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.
@@ -12,6 +12,11 @@ export declare class LightTag {
12
12
  * @default true
13
13
  */
14
14
  intersectCheck: boolean;
15
+ /**
16
+ * @description 模拟3D
17
+ * @default true
18
+ */
19
+ simulate3D: boolean;
15
20
  private tagWrapper;
16
21
  private five;
17
22
  private originPosition?;
@@ -1,6 +1,6 @@
1
- var m = Object.defineProperty;
2
- var h = (n, o, t) => o in n ? m(n, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[o] = t;
3
- var a = (n, o, t) => (h(n, typeof o != "symbol" ? o + "" : o, t), t);
1
+ var h = Object.defineProperty;
2
+ var m = (n, o, t) => o in n ? h(n, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[o] = t;
3
+ var l = (n, o, t) => (m(n, typeof o != "symbol" ? o + "" : o, t), t);
4
4
  import { BaseTag as g } from "./BaseTag.js";
5
5
  import * as c from "three";
6
6
  import "../../../shared-utils/Subscribe.js";
@@ -46,11 +46,11 @@ import "../../../shared-utils/five/getFloorIndex.js";
46
46
  import "../../../shared-utils/safeObj.js";
47
47
  import "../../utils/Cache.js";
48
48
  const b = new c.Vector2();
49
- class lt extends g {
49
+ class at extends g {
50
50
  constructor(t, e) {
51
51
  super(t, e);
52
- a(this, "__Object__");
53
- a(this, "requestIdleCallbackId");
52
+ l(this, "__Object__");
53
+ l(this, "requestIdleCallbackId");
54
54
  }
55
55
  /**
56
56
  * @description 展开自己,收起其他标签
@@ -65,18 +65,21 @@ class lt extends g {
65
65
  t.target === "TagPoint" && this.unfoldAndFoldOthers();
66
66
  }
67
67
  updateVisible() {
68
+ if (typeof window.requestIdleCallback == "undefined") {
69
+ super.updateVisible();
70
+ return;
71
+ }
68
72
  const t = () => {
69
73
  this.requestIdleCallbackId && cancelIdleCallback(this.requestIdleCallbackId), this.requestIdleCallbackId = requestIdleCallback(() => {
70
74
  super.updateVisible();
71
75
  });
72
76
  };
73
- typeof window.requestIdleCallback == "undefined" && super.updateVisible();
74
77
  let e = !1;
75
78
  requestIdleCallback(() => {
76
79
  e = !0;
77
80
  }), t(), setTimeout(() => {
78
- e || super.updateVisible();
79
- }, 50);
81
+ e || (this.requestIdleCallbackId && cancelIdleCallback(this.requestIdleCallbackId), super.updateVisible());
82
+ }, 200);
80
83
  }
81
84
  applyVisible() {
82
85
  var t, e, s, i;
@@ -103,10 +106,10 @@ class lt extends g {
103
106
  this.originPosition = t, this.position = t, this.cache.clear(), this.updateVisible(), this.updateScreenPosition(), this.updateZIndex(), this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] });
104
107
  }
105
108
  updateScreenPosition(t) {
106
- var l;
109
+ var a;
107
110
  if (this.stickType !== "2DPoint" && this.stickType !== "3DPoint")
108
111
  return;
109
- const { force: e = !1 } = t != null ? t : {}, s = e ? this.state.visible : this.currentVisible, i = (l = this.__Object__) != null ? l : {
112
+ const { force: e = !1 } = t != null ? t : {}, s = e ? this.state.visible : this.currentVisible, i = (a = this.__Object__) != null ? a : {
110
113
  timeoutId: void 0,
111
114
  inAnimation: !1
112
115
  };
@@ -145,5 +148,5 @@ class lt extends g {
145
148
  }
146
149
  }
147
150
  export {
148
- lt as PointTag
151
+ at as PointTag
149
152
  };
@@ -54,7 +54,7 @@ class M extends I {
54
54
  }
55
55
  class X extends C {
56
56
  constructor(e) {
57
- var s, r, c, a, g;
57
+ var s, r, c, g, a;
58
58
  super();
59
59
  h(this, "name", "LineMesh");
60
60
  h(this, "points");
@@ -72,9 +72,9 @@ class X extends C {
72
72
  dashScale: 40,
73
73
  opacity: (c = e == null ? void 0 : e.opacity) != null ? c : 1,
74
74
  transparent: !0,
75
- dashed: (a = e == null ? void 0 : e.dashed) != null ? a : !1
75
+ dashed: (g = e == null ? void 0 : e.dashed) != null ? g : !1
76
76
  }), n = new S({
77
- color: new u.Color((g = e == null ? void 0 : e.lineColor) != null ? g : b),
77
+ color: new u.Color((a = e == null ? void 0 : e.lineColor) != null ? a : b),
78
78
  linewidth: t.linewidth * 0.9,
79
79
  dashScale: t.dashScale,
80
80
  opacity: t.opacity * 0.7,
@@ -172,11 +172,11 @@ class X extends C {
172
172
  return [this.points[n - 1], t];
173
173
  }).filter(d).map((t) => D(this, t));
174
174
  i.forEach(([t, n], s) => {
175
- var a;
175
+ var g;
176
176
  const r = R(t, n);
177
- this.lengthDoms[s] = (a = this.lengthDoms[s]) != null ? a : (() => {
178
- const g = new x(this.five);
179
- return g.intersectCheck = !1, g;
177
+ this.lengthDoms[s] = (g = this.lengthDoms[s]) != null ? g : (() => {
178
+ const a = new x(this.five);
179
+ return a.intersectCheck = !1, a.simulate3D = !0, a;
180
180
  })(), this.lengthDoms[s].setPosition(r, [t, n]);
181
181
  const c = t.distanceTo(n).toFixed(2);
182
182
  this.lengthDoms[s].lengthDom !== c && (this.lengthDoms[s].lengthDom = c, c === "0.00" ? this.lengthDoms[s].container.innerHTML = "" : this.lengthDoms[s].container.innerHTML = v(c + "m"));
@@ -18,8 +18,8 @@ import { anyPositionToVector3 as P } from "../../shared-utils/positionToVector3.
18
18
  import { ColoredMesh as _ } from "../utils/three/ColoredMesh.js";
19
19
  import { getGeometryInfo as A } from "../../shared-utils/three/geometryUtil.js";
20
20
  import { LightTag as S } from "../../shared-utils/tag.js";
21
- import { getLengthHTML as M } from "../utils/Meshes/getLengthHTML.js";
22
- import { applyObjectMatrixWorld as B } from "../../shared-utils/three/applyObjectMatrixWorld.js";
21
+ import { getLengthHTML as D } from "../utils/Meshes/getLengthHTML.js";
22
+ import { applyObjectMatrixWorld as M } from "../../shared-utils/three/applyObjectMatrixWorld.js";
23
23
  const p = new l.BufferGeometry();
24
24
  p.name = "blankGeometry";
25
25
  p.isBlank = !0;
@@ -58,7 +58,7 @@ class G extends _ {
58
58
  }
59
59
  updateMatrixWorld(e) {
60
60
  if (super.updateMatrixWorld(e), this.center) {
61
- const s = B(this, this.center).toArray().join(",");
61
+ const s = M(this, this.center).toArray().join(",");
62
62
  s !== this.lastRenderAreaItem && (this.updateAreaItems(), this.lastRenderAreaItem = s);
63
63
  }
64
64
  }
@@ -66,9 +66,9 @@ class G extends _ {
66
66
  this._paramsStyle = h(h({}, this._paramsStyle), e), super.setStyle(this._paramsStyle), this.updateAreaItems();
67
67
  }
68
68
  setPoints(e) {
69
- var o;
69
+ var n;
70
70
  const s = e.map(P);
71
- this.points = s, this.geometry = (o = I(this.points, { checkLinesIntersect: !0 })) != null ? o : p, this.planeHelperNeedUpdate = !0, this.geometryInfoNeedUpdate = !0, this.updateAreaItems();
71
+ this.points = s, this.geometry = (n = I(this.points, { checkLinesIntersect: !0 })) != null ? n : p, this.planeHelperNeedUpdate = !0, this.geometryInfoNeedUpdate = !0, this.updateAreaItems();
72
72
  }
73
73
  /**
74
74
  * @description: 获取一个点投影在当前平面上的点
@@ -86,21 +86,21 @@ class G extends _ {
86
86
  this.points.length >= 3 ? this.planeHelper = new l.Plane().setFromCoplanarPoints(this.points[0], this.points[1], this.points[2]) : this.planeHelper = null, this.planeHelperNeedUpdate = !1;
87
87
  }
88
88
  updateAreaItems() {
89
- var o;
89
+ var n;
90
90
  const e = () => {
91
- var n;
92
- (n = this.areaDom) == null || n.destroy(), this.areaDom = void 0;
91
+ var o;
92
+ (o = this.areaDom) == null || o.destroy(), this.areaDom = void 0;
93
93
  };
94
94
  if (!this._paramsStyle.lengthEnable || !this.geometryInfo)
95
95
  return e();
96
96
  if (!this.five)
97
97
  return console.error("Five not found");
98
- this.areaDom = (o = this.areaDom) != null ? o : (() => {
99
- const n = new S(this.five);
100
- return n.intersectCheck = !1, n;
98
+ this.areaDom = (n = this.areaDom) != null ? n : (() => {
99
+ const o = new S(this.five);
100
+ return o.intersectCheck = !1, o.simulate3D = !0, o;
101
101
  })(), this.areaDom.setPosition(this.center);
102
102
  const s = this.geometryInfo.area.toFixed(2);
103
- s === "0.00" ? this.areaDom.container.innerHTML = "" : this.areaDom.container.innerHTML = M(s + "m²");
103
+ s === "0.00" ? this.areaDom.container.innerHTML = "" : this.areaDom.container.innerHTML = D(s + "m²");
104
104
  }
105
105
  }
106
106
  export {
@@ -98,5 +98,6 @@ function z(o, e) {
98
98
  });
99
99
  }
100
100
  export {
101
- Q as Box
101
+ Q as Box,
102
+ z as createBox
102
103
  };
@@ -94,5 +94,6 @@ function N(n, t) {
94
94
  });
95
95
  }
96
96
  export {
97
- X as Cylinder
97
+ X as Cylinder,
98
+ N as createCylinder
98
99
  };
@@ -132,5 +132,6 @@ function K(n, t, e) {
132
132
  };
133
133
  }
134
134
  export {
135
- ie as Line
135
+ ie as Line,
136
+ K as createLine
136
137
  };
@@ -85,5 +85,6 @@ function z(e, i) {
85
85
  });
86
86
  }
87
87
  export {
88
- D as Point
88
+ D as Point,
89
+ z as createPoint
89
90
  };
@@ -27,7 +27,7 @@ var R = (n, t, e) => new Promise((s, P) => {
27
27
  }, c = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(w, b);
28
28
  c((e = e.apply(n, t)).next());
29
29
  });
30
- import { PolylineWithDotsMesh as U, PolylineMesh as W } from "../../Meshes/Polyline.js";
30
+ import { PolylineMesh as U, PolylineWithDotsMesh as W } from "../../Meshes/Polyline.js";
31
31
  import { BaseObject as H } from "../Base/index.js";
32
32
  import * as d from "three";
33
33
  import { PolylineEditor as I } from "./Editor.js";
@@ -40,7 +40,7 @@ class Z extends H {
40
40
  y(this, "type", "Polyline");
41
41
  y(this, "polyLineMesh");
42
42
  y(this, "creatingObject");
43
- e && (this.polyLineMesh = new U(p(p({}, e.style), e)), this.add(this.polyLineMesh)), this.editor = new I(this);
43
+ e && (this.polyLineMesh = new W(p(p({}, e.style), e)), this.add(this.polyLineMesh)), this.editor = new I(this);
44
44
  }
45
45
  get data() {
46
46
  return M(p({}, this.baseData), {
@@ -79,7 +79,7 @@ class Z extends H {
79
79
  create(e) {
80
80
  return R(this, null, function* () {
81
81
  this.removeChildren();
82
- const s = new U(e);
82
+ const s = new W(e);
83
83
  this.polyLineMesh = s, this.add(this.polyLineMesh), this.creatingObject = q(s, this.pointSelector, e), yield this.creatingObject.finished, this.editor.enable();
84
84
  });
85
85
  }
@@ -89,9 +89,9 @@ function q(n, t, e) {
89
89
  const s = n.parent;
90
90
  if (!s)
91
91
  return;
92
- const { promise: P, resolve: w, reject: b } = _(), c = (x = e == null ? void 0 : e.limit) != null ? x : "none", o = new W(n.style);
92
+ const { promise: P, resolve: w, reject: b } = _(), c = (x = e == null ? void 0 : e.limit) != null ? x : "none", o = new U(n.style);
93
93
  s.add(o);
94
- const a = new W(M(p({}, n.style), { dashed: !0, lengthEnable: !1 }));
94
+ const a = new U(M(p({}, n.style), { dashed: !0, lengthEnable: !1 }));
95
95
  s.add(a), t.enable();
96
96
  const i = [];
97
97
  let r, l, v;
@@ -125,5 +125,6 @@ function q(n, t, e) {
125
125
  };
126
126
  }
127
127
  export {
128
- Z as Polyline
128
+ Z as Polyline,
129
+ q as createPolyline
129
130
  };
@@ -96,5 +96,6 @@ function D(i, e) {
96
96
  });
97
97
  }
98
98
  export {
99
- Q as Prism
99
+ Q as Prism,
100
+ D as createPrism
100
101
  };
@@ -14,6 +14,15 @@ import { Box } from './Objects/Box';
14
14
  import type { BuiltInData, BuiltInItem, Theme } from './typings';
15
15
  import { Line } from './Objects/Line';
16
16
  export type { SculptData } from './typings';
17
+ export { createPoint } from './Objects/Point';
18
+ export { createLine } from './Objects/Line';
19
+ export { createPolyline } from './Objects/Polyline';
20
+ export { createPolygon } from './Objects/Polygon';
21
+ export { createPrism } from './Objects/Prism';
22
+ export { createRectangle } from './Objects/Rectangle';
23
+ export { createCircle } from './Objects/Circle';
24
+ export { createCylinder } from './Objects/Cylinder';
25
+ export { createBox } from './Objects/Box';
17
26
  interface Data {
18
27
  items: Array<BuiltInData>;
19
28
  }
@@ -68,12 +77,7 @@ export declare class Sculpt extends Subscribe<Event> {
68
77
  id: string;
69
78
  type: string;
70
79
  } | {
71
- readonly points: [number, number, number][]; /**
72
- * @description: 点击事件
73
- * @param {MouseEvent} e 鼠标事件
74
- * @param {BuiltInItem} item 点击的物体
75
- * 返回 false 来禁用 Five 默认行为
76
- */
80
+ readonly points: [number, number, number][];
77
81
  readonly heightPoint: [number, number, number];
78
82
  readonly style: {
79
83
  readonly color: number;
@@ -18,7 +18,7 @@ let P = class {
18
18
  /**
19
19
  * @realsee/dnalogel 版本号
20
20
  */
21
- i(this, "VERSION", "3.49.7-alpha.0");
21
+ i(this, "VERSION", "3.49.8");
22
22
  i(this, "NAME");
23
23
  i(this, "five");
24
24
  i(this, "workUtil");