@realsee/dnalogel 3.44.5 → 3.46.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 (162) hide show
  1. package/CHANGELOG.md +6 -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 +8 -2
  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 +29820 -29686
  27. package/dist/index.umd.js +49 -49
  28. package/dist/shared-utils/Utils/WorkUtil.d.ts +6 -6
  29. package/dist/shared-utils/tag.d.ts +6 -3
  30. package/libs/AreaMakerPlugin/Controller.js +150 -78
  31. package/libs/AreaMakerPlugin/index.js +76 -4
  32. package/libs/AreaMakerPlugin/utils/Item.js +190 -111
  33. package/libs/CSS3DRenderPlugin/Controller.js +89 -29
  34. package/libs/CSS3DRenderPlugin/index.js +75 -15
  35. package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +132 -58
  36. package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +181 -116
  37. package/libs/CruisePlugin/BaseController.js +121 -49
  38. package/libs/CruisePlugin/Move.js +73 -21
  39. package/libs/CruisePlugin/Work.js +98 -46
  40. package/libs/CruisePlugin/index.js +79 -27
  41. package/libs/CurrentPanoImagePlugin/Controller.js +176 -104
  42. package/libs/CurrentPanoImagePlugin/index.js +76 -4
  43. package/libs/GuideLinePlugin/Controller.js +82 -30
  44. package/libs/GuideLinePlugin/GuideLineItem.js +82 -30
  45. package/libs/GuideLinePlugin/GuideLineModeItem/index.js +3 -2
  46. package/libs/GuideLinePlugin/GuideLineModeItem.js +81 -29
  47. package/libs/GuideLinePlugin/index.js +79 -27
  48. package/libs/ModelMakerPlugin/Controller.js +140 -83
  49. package/libs/ModelMakerPlugin/index.js +75 -18
  50. package/libs/ModelTVVideoPlugin/Plugin.js +117 -57
  51. package/libs/ModelTVVideoPlugin/index.js +68 -8
  52. package/libs/Object3DHelperPlugin/Controller.js +54 -31
  53. package/libs/Object3DHelperPlugin/index.js +35 -13
  54. package/libs/PanoCompassPlugin/Controller.js +97 -42
  55. package/libs/PanoCompassPlugin/index.js +71 -16
  56. package/libs/PanoDoorLabelPlugin/BaseController.js +98 -26
  57. package/libs/PanoDoorLabelPlugin/Controller.js +187 -115
  58. package/libs/PanoDoorLabelPlugin/index.js +76 -4
  59. package/libs/PanoMeasurePlugin/Components/Controller0.js +141 -89
  60. package/libs/PanoMeasurePlugin/Components/Controller1.js +179 -127
  61. package/libs/PanoMeasurePlugin/Controller/EditController.js +125 -73
  62. package/libs/PanoMeasurePlugin/Controller/WatchController.js +167 -92
  63. package/libs/PanoMeasurePlugin/Controller/index.js +110 -65
  64. package/libs/PanoMeasurePlugin/Model/area.js +114 -38
  65. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +78 -0
  66. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +98 -46
  67. package/libs/PanoMeasurePlugin/index.js +77 -32
  68. package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +98 -20
  69. package/libs/PanoSpatialTagPlugin/Plugin.js +210 -150
  70. package/libs/PanoSpatialTagPlugin/index.js +66 -6
  71. package/libs/PanoTagPlugin/Components/Common/TagPoint.js +133 -53
  72. package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +295 -216
  73. package/libs/PanoTagPlugin/Components/Tag/index.js +257 -187
  74. package/libs/PanoTagPlugin/Components/TagContainer.js +157 -87
  75. package/libs/PanoTagPlugin/Components/TagItem.js +144 -74
  76. package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +73 -3
  77. package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +109 -39
  78. package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +105 -35
  79. package/libs/PanoTagPlugin/controller/Tag/PointTag.js +113 -43
  80. package/libs/PanoTagPlugin/controller/TagRender.js +132 -80
  81. package/libs/PanoTagPlugin/controller/TagUtil.js +136 -84
  82. package/libs/PanoTagPlugin/controller/index.js +113 -61
  83. package/libs/PanoTagPlugin/index.js +89 -37
  84. package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +121 -41
  85. package/libs/PanoVideoPlugin/Controller.js +137 -65
  86. package/libs/PanoVideoPlugin/VideoMeshController.js +149 -69
  87. package/libs/PanoVideoPlugin/index.js +82 -10
  88. package/libs/PipelinePlugin/Controller.js +199 -128
  89. package/libs/PipelinePlugin/index.js +76 -5
  90. package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +102 -22
  91. package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +95 -15
  92. package/libs/PipelinePlugin/utils/Objects/Pipe.js +136 -56
  93. package/libs/Sculpt/Meshes/Area.d.ts +1 -1
  94. package/libs/Sculpt/Meshes/Box.d.ts +1 -1
  95. package/libs/Sculpt/Meshes/Box.js +16 -15
  96. package/libs/Sculpt/Meshes/Circle.d.ts +1 -1
  97. package/libs/Sculpt/Meshes/Circle.js +1 -1
  98. package/libs/Sculpt/Meshes/CircleWithEdge.d.ts +1 -1
  99. package/libs/Sculpt/Meshes/Cylinder.js +8 -7
  100. package/libs/Sculpt/Meshes/Line.d.ts +8 -2
  101. package/libs/Sculpt/Meshes/Line.js +93 -65
  102. package/libs/Sculpt/Meshes/LineWithDots.d.ts +1 -1
  103. package/libs/Sculpt/Meshes/LineWithDots.js +26 -26
  104. package/libs/Sculpt/Meshes/Point.d.ts +1 -1
  105. package/libs/Sculpt/Meshes/Point.js +7 -6
  106. package/libs/Sculpt/Meshes/Polygon.js +1 -1
  107. package/libs/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
  108. package/libs/Sculpt/Meshes/Polyline.js +5 -4
  109. package/libs/Sculpt/Meshes/Prism.d.ts +1 -1
  110. package/libs/Sculpt/Meshes/Rectangle.js +3 -2
  111. package/libs/Sculpt/Meshes/RectangleWithEdge.d.ts +3 -4
  112. package/libs/Sculpt/Objects/Box/index.js +41 -43
  113. package/libs/Sculpt/Objects/Cylinder/index.js +35 -37
  114. package/libs/Sculpt/Objects/Line/Editor.d.ts +22 -0
  115. package/libs/Sculpt/Objects/Line/Editor.js +62 -0
  116. package/libs/Sculpt/Objects/Line/index.d.ts +33 -0
  117. package/libs/Sculpt/Objects/Line/index.js +107 -0
  118. package/libs/Sculpt/Objects/Point/index.d.ts +1 -1
  119. package/libs/Sculpt/Objects/Polygon/Editor.d.ts +2 -2
  120. package/libs/Sculpt/Objects/Polygon/Editor.js +5 -5
  121. package/libs/Sculpt/Objects/Polygon/index.d.ts +3 -2
  122. package/libs/Sculpt/Objects/Polygon/index.js +80 -80
  123. package/libs/Sculpt/Objects/Polyline/Editor.d.ts +3 -17
  124. package/libs/Sculpt/Objects/Polyline/Editor.js +10 -48
  125. package/libs/Sculpt/Objects/Polyline/index.d.ts +7 -6
  126. package/libs/Sculpt/Objects/Polyline/index.js +63 -58
  127. package/libs/Sculpt/Objects/Prism/index.js +56 -58
  128. package/libs/Sculpt/index.d.ts +5 -0
  129. package/libs/Sculpt/index.js +58 -48
  130. package/libs/Sculpt/typings/index.d.ts +11 -6
  131. package/libs/Sculpt/{utils/color.d.ts → typings/style.d.ts} +7 -0
  132. package/libs/Sculpt/typings/utils.type.d.ts +2 -0
  133. package/libs/Sculpt/utils/three/ColoredMesh.d.ts +1 -1
  134. package/libs/Sculpt/utils/three/ColoredMesh.js +15 -14
  135. package/libs/Sculpt/utils/three/rayOnLine.d.ts +3 -5
  136. package/libs/Sculpt/utils/three/rayOnLine.js +15 -14
  137. package/libs/base/BasePlugin.js +14 -13
  138. package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +131 -61
  139. package/libs/floorplan/MapviewFloorplanPlugin/index.js +75 -6
  140. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +129 -59
  141. package/libs/floorplan/ModelFloorplanPlugin/index.js +75 -5
  142. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +158 -86
  143. package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +76 -4
  144. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +151 -81
  145. package/libs/floorplan/TopviewFloorplanPlugin/index.js +75 -5
  146. package/libs/floorplan/index.js +1 -0
  147. package/libs/index.js +194 -192
  148. package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +1 -1
  149. package/libs/shared-utils/Object3DHelper/Controller/ScaleController.js +23 -23
  150. package/libs/shared-utils/Utils/WorkUtil.d.ts +6 -6
  151. package/libs/shared-utils/Utils/WorkUtil.js +8 -7
  152. package/libs/shared-utils/five/index.js +3 -2
  153. package/libs/shared-utils/five/lookObject.js +3 -2
  154. package/libs/shared-utils/logger.js +1 -1
  155. package/libs/shared-utils/tag.d.ts +6 -3
  156. package/libs/shared-utils/tag.js +38 -24
  157. package/libs/shared-utils/three/PointSelector/utils/PointSelectorHelper.js +15 -15
  158. package/libs/shared-utils/three/index.js +1 -0
  159. package/package.json +1 -1
  160. package/dist/Sculpt/typings/SimplifyDeep.d.ts +0 -3
  161. package/libs/Sculpt/typings/SimplifyDeep.d.ts +0 -3
  162. /package/libs/Sculpt/{utils/color.js → typings/style.js} +0 -0
@@ -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
  };
@@ -12,6 +12,7 @@ import { Circle } from './Objects/Circle';
12
12
  import { Cylinder } from './Objects/Cylinder';
13
13
  import { Box } from './Objects/Box';
14
14
  import type { BuiltInData, BuiltInItem, Theme } from './typings';
15
+ import { Line } from './Objects/Line';
15
16
  export type { SculptData } from './typings';
16
17
  interface Data {
17
18
  items: Array<BuiltInData>;
@@ -125,6 +126,10 @@ export declare class Sculpt extends Subscribe<Event> {
125
126
  * @description: 开始绘制点
126
127
  */
127
128
  createPoint(params?: Parameters<Point['create']>[0]): Promise<Point>;
129
+ /**
130
+ * @description: 开始绘制线段
131
+ */
132
+ createline(params?: Parameters<Line['create']>[0]): Promise<Line>;
128
133
  /**
129
134
  * @description: 开始绘制空间折线
130
135
  */