@realsee/dnalogel 3.44.5 → 3.45.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.
Files changed (91) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/dist/Sculpt/Meshes/Area.d.ts +1 -1
  3. package/dist/Sculpt/Meshes/Box.d.ts +1 -1
  4. package/dist/Sculpt/Meshes/Circle.d.ts +1 -1
  5. package/dist/Sculpt/Meshes/CircleWithEdge.d.ts +1 -1
  6. package/dist/Sculpt/Meshes/Line.d.ts +2 -1
  7. package/dist/Sculpt/Meshes/LineWithDots.d.ts +1 -1
  8. package/dist/Sculpt/Meshes/Point.d.ts +1 -1
  9. package/dist/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
  10. package/dist/Sculpt/Meshes/Prism.d.ts +1 -1
  11. package/dist/Sculpt/Meshes/RectangleWithEdge.d.ts +3 -4
  12. package/dist/Sculpt/Objects/Line/Editor.d.ts +22 -0
  13. package/dist/Sculpt/Objects/Line/index.d.ts +33 -0
  14. package/dist/Sculpt/Objects/Point/index.d.ts +1 -1
  15. package/dist/Sculpt/Objects/Polygon/Editor.d.ts +2 -2
  16. package/dist/Sculpt/Objects/Polygon/index.d.ts +3 -2
  17. package/dist/Sculpt/Objects/Polyline/Editor.d.ts +3 -17
  18. package/dist/Sculpt/Objects/Polyline/index.d.ts +7 -6
  19. package/dist/Sculpt/index.d.ts +5 -0
  20. package/dist/Sculpt/typings/index.d.ts +11 -6
  21. package/dist/Sculpt/{utils/color.d.ts → typings/style.d.ts} +7 -0
  22. package/dist/Sculpt/typings/utils.type.d.ts +2 -0
  23. package/dist/Sculpt/utils/three/ColoredMesh.d.ts +1 -1
  24. package/dist/Sculpt/utils/three/rayOnLine.d.ts +3 -5
  25. package/dist/index.cjs.js +56 -56
  26. package/dist/index.js +4272 -4171
  27. package/dist/index.umd.js +45 -45
  28. package/dist/shared-utils/Utils/WorkUtil.d.ts +6 -6
  29. package/libs/ModelMakerPlugin/Controller.js +1 -1
  30. package/libs/ModelMakerPlugin/index.js +1 -1
  31. package/libs/PanoMeasurePlugin/Components/Controller0.js +1 -1
  32. package/libs/PanoMeasurePlugin/Components/Controller1.js +1 -1
  33. package/libs/PanoMeasurePlugin/Controller/EditController.js +1 -1
  34. package/libs/PanoMeasurePlugin/Controller/index.js +1 -1
  35. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +1 -1
  36. package/libs/PanoMeasurePlugin/index.js +1 -1
  37. package/libs/Sculpt/Meshes/Area.d.ts +1 -1
  38. package/libs/Sculpt/Meshes/Box.d.ts +1 -1
  39. package/libs/Sculpt/Meshes/Box.js +10 -10
  40. package/libs/Sculpt/Meshes/Circle.d.ts +1 -1
  41. package/libs/Sculpt/Meshes/Circle.js +1 -1
  42. package/libs/Sculpt/Meshes/CircleWithEdge.d.ts +1 -1
  43. package/libs/Sculpt/Meshes/Cylinder.js +1 -1
  44. package/libs/Sculpt/Meshes/Line.d.ts +2 -1
  45. package/libs/Sculpt/Meshes/Line.js +55 -47
  46. package/libs/Sculpt/Meshes/LineWithDots.d.ts +1 -1
  47. package/libs/Sculpt/Meshes/LineWithDots.js +26 -26
  48. package/libs/Sculpt/Meshes/Point.d.ts +1 -1
  49. package/libs/Sculpt/Meshes/Point.js +1 -1
  50. package/libs/Sculpt/Meshes/Polygon.js +1 -1
  51. package/libs/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
  52. package/libs/Sculpt/Meshes/Prism.d.ts +1 -1
  53. package/libs/Sculpt/Meshes/RectangleWithEdge.d.ts +3 -4
  54. package/libs/Sculpt/Objects/Box/index.js +41 -43
  55. package/libs/Sculpt/Objects/Cylinder/index.js +35 -37
  56. package/libs/Sculpt/Objects/Line/Editor.d.ts +22 -0
  57. package/libs/Sculpt/Objects/Line/Editor.js +61 -0
  58. package/libs/Sculpt/Objects/Line/index.d.ts +33 -0
  59. package/libs/Sculpt/Objects/Line/index.js +107 -0
  60. package/libs/Sculpt/Objects/Point/index.d.ts +1 -1
  61. package/libs/Sculpt/Objects/Polygon/Editor.d.ts +2 -2
  62. package/libs/Sculpt/Objects/Polygon/Editor.js +5 -5
  63. package/libs/Sculpt/Objects/Polygon/index.d.ts +3 -2
  64. package/libs/Sculpt/Objects/Polygon/index.js +80 -80
  65. package/libs/Sculpt/Objects/Polyline/Editor.d.ts +3 -17
  66. package/libs/Sculpt/Objects/Polyline/Editor.js +10 -48
  67. package/libs/Sculpt/Objects/Polyline/index.d.ts +7 -6
  68. package/libs/Sculpt/Objects/Polyline/index.js +63 -58
  69. package/libs/Sculpt/Objects/Prism/index.js +56 -58
  70. package/libs/Sculpt/index.d.ts +5 -0
  71. package/libs/Sculpt/index.js +58 -48
  72. package/libs/Sculpt/typings/index.d.ts +11 -6
  73. package/libs/Sculpt/{utils/color.d.ts → typings/style.d.ts} +7 -0
  74. package/libs/Sculpt/typings/utils.type.d.ts +2 -0
  75. package/libs/Sculpt/utils/three/ColoredMesh.d.ts +1 -1
  76. package/libs/Sculpt/utils/three/ColoredMesh.js +1 -1
  77. package/libs/Sculpt/utils/three/rayOnLine.d.ts +3 -5
  78. package/libs/Sculpt/utils/three/rayOnLine.js +15 -14
  79. package/libs/base/BasePlugin.js +1 -1
  80. package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +3 -2
  81. package/libs/index.js +128 -126
  82. package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +1 -1
  83. package/libs/shared-utils/Object3DHelper/Controller/ScaleController.js +23 -23
  84. package/libs/shared-utils/Utils/WorkUtil.d.ts +6 -6
  85. package/libs/shared-utils/Utils/WorkUtil.js +8 -7
  86. package/libs/shared-utils/logger.js +1 -1
  87. package/libs/shared-utils/three/PointSelector/utils/PointSelectorHelper.js +15 -15
  88. package/package.json +1 -1
  89. package/dist/Sculpt/typings/SimplifyDeep.d.ts +0 -3
  90. package/libs/Sculpt/typings/SimplifyDeep.d.ts +0 -3
  91. /package/libs/Sculpt/{utils/color.js → typings/style.js} +0 -0
@@ -1,50 +1,52 @@
1
- var H = Object.defineProperty, T = Object.defineProperties;
2
- var j = Object.getOwnPropertyDescriptors;
3
- var b = Object.getOwnPropertySymbols;
4
- var A = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
5
- var g = (i, t, e) => t in i ? H(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, c = (i, t) => {
6
- for (var e in t || (t = {}))
7
- A.call(t, e) && g(i, e, t[e]);
8
- if (b)
9
- for (var e of b(t))
10
- D.call(t, e) && g(i, e, t[e]);
11
- return i;
12
- }, W = (i, t) => T(i, j(t));
13
- var m = (i, t, e) => (g(i, typeof t != "symbol" ? t + "" : t, e), e);
14
- var E = (i, t, e) => new Promise((r, s) => {
15
- var d = (o) => {
1
+ var F = Object.defineProperty, L = Object.defineProperties;
2
+ var N = Object.getOwnPropertyDescriptors;
3
+ var x = Object.getOwnPropertySymbols;
4
+ var O = Object.prototype.hasOwnProperty, U = Object.prototype.propertyIsEnumerable;
5
+ var u = (o, e, t) => e in o ? F(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, g = (o, e) => {
6
+ for (var t in e || (e = {}))
7
+ O.call(e, t) && u(o, t, e[t]);
8
+ if (x)
9
+ for (var t of x(e))
10
+ U.call(e, t) && u(o, t, e[t]);
11
+ return o;
12
+ }, j = (o, e) => L(o, N(e));
13
+ var y = (o, e, t) => (u(o, typeof e != "symbol" ? e + "" : e, t), t);
14
+ var T = (o, e, t) => new Promise((f, d) => {
15
+ var n = (l) => {
16
16
  try {
17
- n(e.next(o));
18
- } catch (a) {
19
- s(a);
17
+ h(t.next(l));
18
+ } catch (s) {
19
+ d(s);
20
20
  }
21
- }, l = (o) => {
21
+ }, p = (l) => {
22
22
  try {
23
- n(e.throw(o));
24
- } catch (a) {
25
- s(a);
23
+ h(t.throw(l));
24
+ } catch (s) {
25
+ d(s);
26
26
  }
27
- }, n = (o) => o.done ? r(o.value) : Promise.resolve(o.value).then(d, l);
28
- n((e = e.apply(i, t)).next());
27
+ }, h = (l) => l.done ? f(l.value) : Promise.resolve(l.value).then(n, p);
28
+ h((t = t.apply(o, e)).next());
29
29
  });
30
- import { hotkeys as L } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
31
- import { BaseObject as O } from "../Base/index.js";
32
- import { PolylineMesh as x } from "../../Meshes/Polyline.js";
33
- import { AreaMesh as M } from "../../Meshes/Area.js";
34
- import { PolygonEditor as U } from "./Editor.js";
35
- import { vector3ToArray as k } from "../../../shared-utils/three/vector3ToArray.js";
36
- class K extends O {
37
- constructor(e, r) {
38
- super(e, r);
39
- m(this, "type", "Polygon");
40
- m(this, "areaMesh");
41
- this.editor = new U(this), e && (this.areaMesh = new M(c(c({}, e.style), e)), this.add(this.areaMesh)), L("esc", () => {
30
+ import { hotkeys as k } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
31
+ import { BaseObject as z } from "../Base/index.js";
32
+ import * as P from "three";
33
+ import { PolylineMesh as A } from "../../Meshes/Polyline.js";
34
+ import { AreaMesh as V } from "../../Meshes/Area.js";
35
+ import { PolygonEditor as B } from "./Editor.js";
36
+ import { vector3ToArray as H } from "../../../shared-utils/three/vector3ToArray.js";
37
+ const D = new P.Vector3();
38
+ class X extends z {
39
+ constructor(t, f) {
40
+ super(t, f);
41
+ y(this, "type", "Polygon");
42
+ y(this, "areaMesh");
43
+ this.editor = new B(this), t && (this.areaMesh = new V(g(g({}, t.style), t)), this.add(this.areaMesh)), k("esc", () => {
42
44
  this.stopCreating();
43
45
  });
44
46
  }
45
47
  get data() {
46
- return W(c({}, this.baseData), {
47
- points: k(this.applyObjectMatrixWorld(this.areaMesh.points)),
48
+ return j(g({}, this.baseData), {
49
+ points: H(this.applyObjectMatrixWorld(this.areaMesh.points)),
48
50
  style: {
49
51
  color: this.areaMesh.color.getHex(),
50
52
  lineColor: this.areaMesh.lineColor.getHex(),
@@ -53,61 +55,59 @@ class K extends O {
53
55
  });
54
56
  }
55
57
  highlight() {
56
- var e;
57
- (e = this.areaMesh) == null || e.highlight();
58
+ var t;
59
+ (t = this.areaMesh) == null || t.highlight();
58
60
  }
59
61
  unhighlight() {
60
- var e;
61
- (e = this.areaMesh) == null || e.unhighlight();
62
+ var t;
63
+ (t = this.areaMesh) == null || t.unhighlight();
62
64
  }
63
- create(e) {
64
- return E(this, null, function* () {
65
- this.children.forEach((s) => {
66
- s.parent === this && this.remove(s);
65
+ create(t) {
66
+ return T(this, null, function* () {
67
+ this.children.forEach((d) => {
68
+ d.parent === this && this.remove(d);
67
69
  }), this.children.length = 0;
68
- const r = new M(e);
69
- this.areaMesh = r, this.add(this.areaMesh), yield B(this.areaMesh, this.pointSelector), this.editor.enable();
70
+ const f = new V(t);
71
+ this.areaMesh = f, this.add(this.areaMesh), yield I(this.areaMesh, this.pointSelector, t), this.editor.enable();
70
72
  });
71
73
  }
72
74
  }
73
- function B(i, t) {
74
- return new Promise((e, r) => {
75
- const s = i.parent;
76
- if (!s) {
77
- r(new Error("No container"));
75
+ function I(o, e, t) {
76
+ return new Promise((f, d) => {
77
+ var M;
78
+ const n = o.parent;
79
+ if (!n) {
80
+ d(new Error("No container"));
78
81
  return;
79
82
  }
80
- const d = new x({ dashed: !0, lineColor: i.lineColor, lineWidth: i.lineWidth });
81
- s == null || s.add(d);
82
- const l = new x({ dashed: !0, lineColor: i.lineColor, lineWidth: i.lineWidth });
83
- s == null || s.add(l), t.enable();
84
- const n = [];
85
- let o, a = !1;
86
- const u = (h) => {
87
- const f = n.length === 0 ? h.point : o.clone();
88
- n.push(f.clone()), i.setPoints(n, { closed: !1 }), a && (y(), e());
89
- }, P = (h) => {
90
- var v;
91
- if (!((v = i.points) != null && v.length) || !h)
83
+ const p = (M = t == null ? void 0 : t.limit) != null ? M : "none", h = new A({ dashed: !0, lineColor: o.lineColor, lineWidth: o.lineWidth });
84
+ n == null || n.add(h);
85
+ const l = new A({ dashed: !0, lineColor: o.lineColor, lineWidth: o.lineWidth });
86
+ n == null || n.add(l), e.enable();
87
+ const s = [];
88
+ let i, a, w = !1;
89
+ const C = (r) => {
90
+ const c = s.length === 0 ? r.point : i.clone();
91
+ s.push(c), o.setPoints(s, { closed: !1 }), w && (b(), f());
92
+ }, v = (r) => {
93
+ if (!(s != null && s.length) || !r)
92
94
  return;
93
- const f = n.at(-1).clone();
94
- if (i.points.length <= 2)
95
- o = h.point, d.setPoints([f, o]), s != null && s.children.includes(l) && s.remove(l);
96
- else {
97
- o = i.projectPoint(h.point);
98
- const p = i.points[0], C = 0.2;
99
- p.distanceTo(o) < C || p.distanceTo(h.point) < C ? (o = p, h.point.copy(p), t.pointSelectorHelper.updateWithIntersect(h, { emitEvent: !1 }), a = !0) : a = !1, l.setPoints([o, h.point]), s != null && s.children.includes(l) || s == null || s.add(l);
95
+ const c = s.at(-1).clone();
96
+ if (s.length < 3 && (p === "none" ? (i = r.point, h.setPoints([c, i])) : p === "xoz" ? (a = a != null ? a : new P.Plane().setFromNormalAndCoplanarPoint(new P.Vector3(0, 1, 0), s[0]), i = a.projectPoint(r.point, D), h.setPoints([c, i]), l.setPoints([i, r.point])) : p === "y" && (s.length === 1 ? (i = r.point, h.setPoints([c, i])) : (a = a != null ? a : new P.Plane().setFromCoplanarPoints(s[0], s[1], new P.Vector3(0, 1, 0).add(s[0])), i = a.projectPoint(r.point, D), h.setPoints([c, i]), l.setPoints([i, r.point])))), s.length >= 3) {
97
+ i = o.projectPoint(r.point);
98
+ const m = s[0], W = 0.2;
99
+ m.distanceTo(i) < W || m.distanceTo(r.point) < W ? (i = m, r.point.copy(m), e.pointSelectorHelper.updateWithIntersect(r, { emitEvent: !1 }), w = !0) : w = !1, h.setPoints([c, i]), l.setPoints([i, r.point]);
100
100
  }
101
- d.setPoints([f, o]), n.length >= 2 && i.setPoints([...n, o], { closed: !1 });
102
- }, y = () => {
103
- t.off("select", u), t.off("intersectionUpdate", P), t.off("disable", w), t.disable(), s == null || s.remove(d, l);
104
- }, w = () => {
105
- y(), s == null || s.remove(i, l, d), r(new Error("Cancelled"));
101
+ s.length >= 2 && o.setPoints([...s, i], { closed: !1 });
102
+ }, b = () => {
103
+ e.off("select", C), e.off("intersectionUpdate", v), e.off("disable", E), e.disable(), n == null || n.remove(h, l);
104
+ }, E = () => {
105
+ b(), n == null || n.remove(o, l, h), d(new Error("Cancelled"));
106
106
  };
107
- t.on("select", u), t.on("intersectionUpdate", P), t.on("disable", w);
107
+ e.on("select", C), e.on("intersectionUpdate", v), e.on("disable", E);
108
108
  });
109
109
  }
110
110
  export {
111
- K as Polygon,
112
- B as createPolygon
111
+ X as Polygon,
112
+ I as createPolygon
113
113
  };
@@ -1,22 +1,8 @@
1
- import { BaseEditor } from '../Base/Editor';
2
1
  import type { FiveDomEvent } from '../../../shared-utils/five/FiveDomEvents';
3
2
  import type { Polyline } from '.';
4
- import type * as THREE from 'three';
5
- import { PointMesh } from '../../Meshes/Point';
6
- export declare abstract class LineEditor<OriginObject extends THREE.Object3D = THREE.Object3D> extends BaseEditor<OriginObject> {
7
- protected draggingPoints: PointMesh[];
8
- protected get pointMeshes(): PointMesh[];
9
- abstract get points(): THREE.Vector3[];
10
- get pointHandles(): PointMesh[];
11
- constructor(originObject: OriginObject);
12
- enable(): void;
13
- disable(): void;
14
- protected onDragstart: (event: FiveDomEvent) => void;
15
- protected onDragend: (event: FiveDomEvent) => void;
16
- protected abstract onDrag(event: FiveDomEvent): void;
17
- }
18
- export declare class PolylineEditor extends LineEditor<Polyline> {
19
- get points(): THREE.Vector3[];
3
+ import { LineEditorAbstract } from '../Line/Editor';
4
+ export declare class PolylineEditor extends LineEditorAbstract<Polyline> {
5
+ get points(): import("three").Vector3[];
20
6
  constructor(originObject: Polyline);
21
7
  protected onDrag: (event: FiveDomEvent) => void;
22
8
  }
@@ -1,54 +1,17 @@
1
- var g = Object.defineProperty;
2
- var d = (s, e, t) => e in s ? g(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var r = (s, e, t) => (d(s, typeof e != "symbol" ? e + "" : e, t), t);
4
- import { BaseEditor as p } from "../Base/Editor.js";
5
- import { Sculpt as n } from "../../index.js";
6
- import { PointMesh as a } from "../../Meshes/Point.js";
7
- import { getIntersectByRaycaster as h } from "../../../shared-utils/five/getPosition.js";
8
- import "three";
9
- import "hammerjs";
10
- import "three/examples/jsm/renderers/CSS3DRenderer";
11
- import "@realsee/five/line";
12
- import "../../../shared-utils/three/THREESphere.js";
13
- import "animejs";
14
- import { notNil as l } from "../../../shared-utils/isNil.js";
15
- import "../../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
16
- class m extends p {
17
- constructor(t) {
18
- super(t);
19
- r(this, "draggingPoints", []);
20
- r(this, "onDragstart", (t) => {
21
- const i = t.target;
22
- this.draggingPoints = this.pointMeshes.filter((o) => o.position.equals(i.position));
23
- });
24
- r(this, "onDragend", (t) => {
25
- this.draggingPoints = [];
26
- });
27
- }
28
- get pointMeshes() {
29
- return this.children.filter((t) => t instanceof a);
30
- }
31
- get pointHandles() {
32
- return this.children;
33
- }
34
- enable() {
35
- super.enable(), this.points.filter(l).forEach((t) => {
36
- const i = new a();
37
- i.visible = !1, i.position.copy(t), i.draggable = !0, n.modules.fiveDomEvents.addEventListener(i, "drag", this.onDrag), n.modules.fiveDomEvents.addEventListener(i, "dragstart", this.onDragstart), n.modules.fiveDomEvents.addEventListener(i, "dragend", this.onDragend), this.add(i);
38
- });
39
- }
40
- disable() {
41
- super.disable(), this.removeChildren();
42
- }
43
- }
44
- class B extends m {
1
+ var n = Object.defineProperty;
2
+ var p = (o, i, t) => i in o ? n(o, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[i] = t;
3
+ var r = (o, i, t) => (p(o, typeof i != "symbol" ? i + "" : i, t), t);
4
+ import { Sculpt as g } from "../../index.js";
5
+ import { getIntersectByRaycaster as c } from "../../../shared-utils/five/getPosition.js";
6
+ import { LineEditorAbstract as a } from "../Line/Editor.js";
7
+ class d extends a {
45
8
  constructor(t) {
46
9
  super(t);
47
10
  r(this, "onDrag", (t) => {
48
11
  if (!this.draggingPoints || this.draggingPoints.length === 0)
49
12
  return;
50
- const i = h(n.modules.five, t.raycaster, { virtualPoint: !0 });
51
- this.draggingPoints.forEach((o) => o.position.copy(i.point)), this.originObject.polyLineMesh.setPoints(this.pointMeshes.map((o) => o.position));
13
+ const e = c(g.modules.five, t.raycaster, { virtualPoint: !0 });
14
+ this.draggingPoints.forEach((s) => s.position.copy(e.point)), this.originObject.polyLineMesh.setPoints(this.pointMeshes.map((s) => s.position));
52
15
  });
53
16
  }
54
17
  get points() {
@@ -56,6 +19,5 @@ class B extends m {
56
19
  }
57
20
  }
58
21
  export {
59
- m as LineEditor,
60
- B as PolylineEditor
22
+ d as PolylineEditor
61
23
  };
@@ -1,8 +1,8 @@
1
- import type { Color } from '../../../Object3DHelperPlugin';
2
1
  import { PolylineMesh, PolylineWithDotsMesh, type PolylineData, type PolylineStyle } from '../../Meshes/Polyline';
3
2
  import { BaseObject, type BaseImportData, type BaseObjectConfig } from '../Base';
4
3
  import type { PointSelector } from '../../../shared-utils/three/PointSelector';
5
4
  import type { LiteralString } from '../../../typings/utils.type';
5
+ import type { LimitPlaneConfig } from '../../typings/style';
6
6
  export interface PolylineImportData extends BaseImportData, PolylineData {
7
7
  type: LiteralString<'Polyline'>;
8
8
  style?: Partial<PolylineStyle>;
@@ -23,9 +23,10 @@ export declare class Polyline extends BaseObject<PolylineImportData> {
23
23
  constructor(data?: PolylineImportData, config?: Partial<BaseObjectConfig>);
24
24
  highlight(): void;
25
25
  unhighlight(): void;
26
- create(params?: {
27
- color?: Color;
28
- lineWidth?: number;
29
- }): Promise<void>;
26
+ create(params?: Partial<PolylineStyle & LimitPlaneConfig>): Promise<void>;
30
27
  }
31
- export declare function createPolyline(polyLineMesh: PolylineMesh, pointSelector: PointSelector): Promise<void>;
28
+ /**
29
+ * @description 绘制折线
30
+ * @param config.limit 限制折线绘制的平面; `xoz` 限制在水平面; `y` 限制垂直面; `none` 不限制;默认 `none`
31
+ */
32
+ export declare function createPolyline(polyLineMesh: PolylineMesh, pointSelector: PointSelector, config?: Partial<LimitPlaneConfig>): Promise<void>;
@@ -1,52 +1,53 @@
1
- var M = Object.defineProperty, C = Object.defineProperties;
2
- var L = Object.getOwnPropertyDescriptors;
3
- var m = Object.getOwnPropertySymbols;
4
- var v = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
5
- var d = (i, t, e) => t in i ? M(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, p = (i, t) => {
1
+ var j = Object.defineProperty, E = Object.defineProperties;
2
+ var V = Object.getOwnPropertyDescriptors;
3
+ var v = Object.getOwnPropertySymbols;
4
+ var A = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
5
+ var f = (i, t, e) => t in i ? j(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, w = (i, t) => {
6
6
  for (var e in t || (t = {}))
7
- v.call(t, e) && d(i, e, t[e]);
8
- if (m)
9
- for (var e of m(t))
10
- b.call(t, e) && d(i, e, t[e]);
7
+ A.call(t, e) && f(i, e, t[e]);
8
+ if (v)
9
+ for (var e of v(t))
10
+ D.call(t, e) && f(i, e, t[e]);
11
11
  return i;
12
- }, g = (i, t) => C(i, L(t));
13
- var y = (i, t, e) => (d(i, typeof t != "symbol" ? t + "" : t, e), e);
14
- var u = (i, t, e) => new Promise((n, l) => {
15
- var a = (o) => {
12
+ }, M = (i, t) => E(i, V(t));
13
+ var u = (i, t, e) => (f(i, typeof t != "symbol" ? t + "" : t, e), e);
14
+ var L = (i, t, e) => new Promise((o, d) => {
15
+ var a = (r) => {
16
16
  try {
17
- h(e.next(o));
18
- } catch (s) {
19
- l(s);
17
+ c(e.next(r));
18
+ } catch (y) {
19
+ d(y);
20
20
  }
21
- }, r = (o) => {
21
+ }, p = (r) => {
22
22
  try {
23
- h(e.throw(o));
24
- } catch (s) {
25
- l(s);
23
+ c(e.throw(r));
24
+ } catch (y) {
25
+ d(y);
26
26
  }
27
- }, h = (o) => o.done ? n(o.value) : Promise.resolve(o.value).then(a, r);
28
- h((e = e.apply(i, t)).next());
27
+ }, c = (r) => r.done ? o(r.value) : Promise.resolve(r.value).then(a, p);
28
+ c((e = e.apply(i, t)).next());
29
29
  });
30
- import { hotkeys as W } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
31
- import { PolylineWithDotsMesh as P, PolylineMesh as x } from "../../Meshes/Polyline.js";
32
- import { BaseObject as E } from "../Base/index.js";
33
- import * as j from "three";
34
- import { PolylineEditor as D } from "./Editor.js";
35
- import { vector3ToArray as H } from "../../../shared-utils/three/vector3ToArray.js";
36
- class q extends E {
37
- constructor(e, n) {
38
- super(e, n);
39
- y(this, "type", "Polyline");
40
- y(this, "polyLineMesh");
41
- e && (this.polyLineMesh = new P(p(p({}, e.style), e)), this.add(this.polyLineMesh)), this.editor = new D(this), W("esc", () => {
30
+ import { hotkeys as F } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
31
+ import { PolylineWithDotsMesh as W, PolylineMesh as b } from "../../Meshes/Polyline.js";
32
+ import { BaseObject as O } from "../Base/index.js";
33
+ import * as m from "three";
34
+ import { PolylineEditor as T } from "./Editor.js";
35
+ import { vector3ToArray as U } from "../../../shared-utils/three/vector3ToArray.js";
36
+ const x = new m.Vector3();
37
+ class G extends O {
38
+ constructor(e, o) {
39
+ super(e, o);
40
+ u(this, "type", "Polyline");
41
+ u(this, "polyLineMesh");
42
+ e && (this.polyLineMesh = new W(w(w({}, e.style), e)), this.add(this.polyLineMesh)), this.editor = new T(this), F("esc", () => {
42
43
  this.stopCreating();
43
44
  });
44
45
  }
45
46
  get data() {
46
- return g(p({}, this.baseData), {
47
- points: H(this.applyObjectMatrixWorld(this.polyLineMesh.points)),
47
+ return M(w({}, this.baseData), {
48
+ points: U(this.applyObjectMatrixWorld(this.polyLineMesh.points)),
48
49
  style: {
49
- lineColor: new j.Color(this.polyLineMesh.lineColor).getHex(),
50
+ lineColor: new m.Color(this.polyLineMesh.lineColor).getHex(),
50
51
  lineWidth: this.polyLineMesh.lineWidth,
51
52
  dashed: this.polyLineMesh.dashed
52
53
  }
@@ -61,36 +62,40 @@ class q extends E {
61
62
  (e = this.polyLineMesh) == null || e.unhighlight();
62
63
  }
63
64
  create(e) {
64
- return u(this, null, function* () {
65
+ return L(this, null, function* () {
65
66
  this.removeChildren();
66
- const n = new P(e);
67
- this.polyLineMesh = n, this.add(this.polyLineMesh), yield O(n, this.pointSelector), this.editor.enable();
67
+ const o = new W(e);
68
+ this.polyLineMesh = o, this.add(this.polyLineMesh), yield k(o, this.pointSelector, e), this.editor.enable();
68
69
  });
69
70
  }
70
71
  }
71
- function O(i, t) {
72
- const e = i.parent;
73
- if (!e)
72
+ function k(i, t, e) {
73
+ var c;
74
+ const o = i.parent;
75
+ if (!o)
74
76
  return;
75
- const n = new x({ dashed: !0, lineColor: i.lineColor, lineWidth: i.lineWidth });
76
- return e.add(n), t.enable(), new Promise((l, a) => {
77
- const r = [], h = (s) => {
78
- const c = s.point;
79
- r.push(c.clone()), i.setPoints(r);
80
- }, o = (s) => {
81
- var f;
82
- if (!((f = i.points) != null && f.length) || !s)
77
+ const d = (c = e == null ? void 0 : e.limit) != null ? c : "none", a = new b({ dashed: !0, lineColor: i.lineColor, lineWidth: i.lineWidth });
78
+ o.add(a);
79
+ const p = new b({ dashed: !0, lineColor: i.lineColor, lineWidth: i.lineWidth });
80
+ return o.add(p), t.enable(), new Promise((r, y) => {
81
+ const n = [];
82
+ let s, l;
83
+ const C = (h) => {
84
+ const P = n.length === 0 ? h.point : s.clone();
85
+ n.push(P), i.setPoints(n);
86
+ }, g = (h) => {
87
+ if (!(n != null && n.length) || !h)
83
88
  return;
84
- const c = r.at(-1).clone(), w = s.point;
85
- n.setPoints([c, w]);
89
+ const P = n.at(-1).clone();
90
+ d === "none" ? (s = h.point, a.setPoints([P, s])) : d === "xoz" ? (l = l != null ? l : new m.Plane().setFromNormalAndCoplanarPoint(new m.Vector3(0, 1, 0), n[0]), s = l.projectPoint(h.point, x), a.setPoints([P, s]), p.setPoints([s, h.point])) : d === "y" && (n.length === 1 ? (s = h.point, a.setPoints([P, s])) : (l = l != null ? l : new m.Plane().setFromCoplanarPoints(n[0], n[1], new m.Vector3(0, 1, 0).add(n[0])), s = l.projectPoint(h.point, x), a.setPoints([P, s]), p.setPoints([s, h.point])));
86
91
  };
87
- t.on("select", h), t.on("intersectionUpdate", o), t.on("disable", () => {
88
- if (t.off("select", h), t.off("intersectionUpdate", o), e.remove(n), r.length < 2)
89
- return e.remove(i), a(new Error("Cancelled"));
90
- l();
92
+ t.on("select", C), t.on("intersectionUpdate", g), t.on("disable", () => {
93
+ if (t.off("select", C), t.off("intersectionUpdate", g), o.remove(a), o.remove(p), n.length < 2)
94
+ return o.remove(i), y(new Error("Cancelled"));
95
+ r();
91
96
  });
92
97
  });
93
98
  }
94
99
  export {
95
- q as Polyline
100
+ G as Polyline
96
101
  };
@@ -1,49 +1,48 @@
1
- var v = Object.defineProperty, E = Object.defineProperties;
2
- var L = Object.getOwnPropertyDescriptors;
3
- var M = Object.getOwnPropertySymbols;
4
- var O = Object.prototype.hasOwnProperty, C = Object.prototype.propertyIsEnumerable;
5
- var p = (e, i, t) => i in e ? v(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, c = (e, i) => {
6
- for (var t in i || (i = {}))
7
- O.call(i, t) && p(e, t, i[t]);
8
- if (M)
9
- for (var t of M(i))
10
- C.call(i, t) && p(e, t, i[t]);
11
- return e;
12
- }, w = (e, i) => E(e, L(i));
13
- var d = (e, i, t) => (p(e, typeof i != "symbol" ? i + "" : i, t), t);
14
- var f = (e, i, t) => new Promise((s, n) => {
15
- var m = (o) => {
1
+ var E = Object.defineProperty, L = Object.defineProperties;
2
+ var O = Object.getOwnPropertyDescriptors;
3
+ var u = Object.getOwnPropertySymbols;
4
+ var v = Object.prototype.hasOwnProperty, C = Object.prototype.propertyIsEnumerable;
5
+ var p = (i, e, t) => e in i ? E(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, c = (i, e) => {
6
+ for (var t in e || (e = {}))
7
+ v.call(e, t) && p(i, t, e[t]);
8
+ if (u)
9
+ for (var t of u(e))
10
+ C.call(e, t) && p(i, t, e[t]);
11
+ return i;
12
+ }, w = (i, e) => L(i, O(e));
13
+ var d = (i, e, t) => (p(i, typeof e != "symbol" ? e + "" : e, t), t);
14
+ var g = (i, e, t) => new Promise((o, n) => {
15
+ var l = (s) => {
16
16
  try {
17
- r(t.next(o));
18
- } catch (a) {
19
- n(a);
17
+ r(t.next(s));
18
+ } catch (h) {
19
+ n(h);
20
20
  }
21
- }, l = (o) => {
21
+ }, m = (s) => {
22
22
  try {
23
- r(t.throw(o));
24
- } catch (a) {
25
- n(a);
23
+ r(t.throw(s));
24
+ } catch (h) {
25
+ n(h);
26
26
  }
27
- }, r = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(m, l);
28
- r((t = t.apply(e, i)).next());
27
+ }, r = (s) => s.done ? o(s.value) : Promise.resolve(s.value).then(l, m);
28
+ r((t = t.apply(i, e)).next());
29
29
  });
30
30
  import { BaseObject as W } from "../Base/index.js";
31
31
  import * as j from "three";
32
32
  import { createPolygon as T } from "../Polygon/index.js";
33
33
  import { PrismMesh as x } from "../../Meshes/Prism.js";
34
- import { Sculpt as U } from "../../index.js";
35
- import { LineMesh as k } from "../../Meshes/Line.js";
36
- import { PrismEditor as z } from "./Editor.js";
37
- import { hotkeys as A } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
38
- import { rayOnLine as B } from "../../utils/three/rayOnLine.js";
39
- import { getNormal as D } from "../../../shared-utils/three/getNormal.js";
34
+ import { LineMesh as U } from "../../Meshes/Line.js";
35
+ import { PrismEditor as k } from "./Editor.js";
36
+ import { hotkeys as z } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
37
+ import { rayOnLine as A } from "../../utils/three/rayOnLine.js";
38
+ import { getNormal as B } from "../../../shared-utils/three/getNormal.js";
40
39
  import { vector3ToArray as H } from "../../../shared-utils/three/vector3ToArray.js";
41
- class Z extends W {
42
- constructor(t, s) {
43
- super(t, s);
40
+ class X extends W {
41
+ constructor(t, o) {
42
+ super(t, o);
44
43
  d(this, "type", "Prism");
45
44
  d(this, "prismMesh");
46
- this.editor = new z(this), t && (this.prismMesh = new x(c(c({}, t.style), t)), this.add(this.prismMesh)), A("esc", () => {
45
+ this.editor = new k(this), t && (this.prismMesh = new x(c(c({}, t.style), t)), this.add(this.prismMesh)), z("esc", () => {
47
46
  this.stopCreating();
48
47
  });
49
48
  }
@@ -67,39 +66,38 @@ class Z extends W {
67
66
  (t = this.prismMesh) == null || t.unhighlight();
68
67
  }
69
68
  create(t) {
70
- return f(this, null, function* () {
71
- this.prismMesh = new x(t), this.add(this.prismMesh), yield N(this.prismMesh, this.pointSelector), this.editor.enable();
69
+ return g(this, null, function* () {
70
+ this.prismMesh = new x(t), this.add(this.prismMesh), yield D(this.prismMesh, this.pointSelector), this.editor.enable();
72
71
  });
73
72
  }
74
73
  }
75
- function N(e, i) {
76
- return f(this, null, function* () {
77
- const t = e.parent;
78
- yield T(e.bottomPolygon, i);
79
- const s = new k();
80
- s.name = "LineHelper", t.add(s);
81
- const n = e.bottomPolygon.points.at(-1), m = D(e.bottomPolygon.points).normalize(), l = n.clone().add(m.clone().multiplyScalar(10)), r = n.clone().sub(m.clone().multiplyScalar(10));
82
- return s.setPoints([l, r]), i.enable(), new Promise((o, a) => {
83
- const g = (h) => {
84
- y(), o();
85
- }, P = (h) => {
86
- if (!(h != null && h.raycaster))
74
+ function D(i, e) {
75
+ return g(this, null, function* () {
76
+ const t = i.parent;
77
+ yield T(i.bottomPolygon, e);
78
+ const o = new U();
79
+ o.name = "LineHelper", t.add(o);
80
+ const n = i.bottomPolygon.points.at(-1), l = B(i.bottomPolygon.points).normalize(), m = n.clone().add(l.clone().multiplyScalar(10)), r = n.clone().sub(l.clone().multiplyScalar(10));
81
+ return o.setPoints([m, r]), e.enable(), new Promise((s, h) => {
82
+ const f = (a) => {
83
+ P(), s();
84
+ }, y = (a) => {
85
+ if (!(a != null && a.raycaster))
87
86
  return;
88
- const u = B({
89
- cameraPosition: U.modules.five.camera.position,
90
- raycaster: h.raycaster,
91
- line: new j.Line3(l, r)
87
+ const M = A({
88
+ raycaster: a.raycaster,
89
+ line: new j.Line3(m, r)
92
90
  });
93
- u && e.setPoints({ heightPoint: u });
94
- }, y = () => {
95
- i.off("select", g), i.off("intersectionUpdate", P), i.off("disable", b), t.remove(s), i.disable();
91
+ M && i.setPoints({ heightPoint: M });
92
+ }, P = () => {
93
+ e.off("select", f), e.off("intersectionUpdate", y), e.off("disable", b), t.remove(o), e.disable();
96
94
  }, b = () => {
97
- y(), t.remove(e), a(new Error("Cancelled"));
95
+ P(), t.remove(i), h(new Error("Cancelled"));
98
96
  };
99
- i.on("select", g), i.on("intersectionUpdate", P), i.on("disable", b);
97
+ e.on("select", f), e.on("intersectionUpdate", y), e.on("disable", b);
100
98
  });
101
99
  });
102
100
  }
103
101
  export {
104
- Z as Prism
102
+ X as Prism
105
103
  };