@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.
- package/CHANGELOG.md +6 -0
- package/dist/Sculpt/Meshes/Area.d.ts +1 -1
- package/dist/Sculpt/Meshes/Box.d.ts +1 -1
- package/dist/Sculpt/Meshes/Circle.d.ts +1 -1
- package/dist/Sculpt/Meshes/CircleWithEdge.d.ts +1 -1
- package/dist/Sculpt/Meshes/Line.d.ts +8 -2
- package/dist/Sculpt/Meshes/LineWithDots.d.ts +1 -1
- package/dist/Sculpt/Meshes/Point.d.ts +1 -1
- package/dist/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
- package/dist/Sculpt/Meshes/Prism.d.ts +1 -1
- package/dist/Sculpt/Meshes/RectangleWithEdge.d.ts +3 -4
- package/dist/Sculpt/Objects/Line/Editor.d.ts +22 -0
- package/dist/Sculpt/Objects/Line/index.d.ts +33 -0
- package/dist/Sculpt/Objects/Point/index.d.ts +1 -1
- package/dist/Sculpt/Objects/Polygon/Editor.d.ts +2 -2
- package/dist/Sculpt/Objects/Polygon/index.d.ts +3 -2
- package/dist/Sculpt/Objects/Polyline/Editor.d.ts +3 -17
- package/dist/Sculpt/Objects/Polyline/index.d.ts +7 -6
- package/dist/Sculpt/index.d.ts +5 -0
- package/dist/Sculpt/typings/index.d.ts +11 -6
- package/dist/Sculpt/{utils/color.d.ts → typings/style.d.ts} +7 -0
- package/dist/Sculpt/typings/utils.type.d.ts +2 -0
- package/dist/Sculpt/utils/three/ColoredMesh.d.ts +1 -1
- package/dist/Sculpt/utils/three/rayOnLine.d.ts +3 -5
- package/dist/index.cjs.js +56 -56
- package/dist/index.js +29820 -29686
- package/dist/index.umd.js +49 -49
- package/dist/shared-utils/Utils/WorkUtil.d.ts +6 -6
- package/dist/shared-utils/tag.d.ts +6 -3
- package/libs/AreaMakerPlugin/Controller.js +150 -78
- package/libs/AreaMakerPlugin/index.js +76 -4
- package/libs/AreaMakerPlugin/utils/Item.js +190 -111
- package/libs/CSS3DRenderPlugin/Controller.js +89 -29
- package/libs/CSS3DRenderPlugin/index.js +75 -15
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +132 -58
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +181 -116
- package/libs/CruisePlugin/BaseController.js +121 -49
- package/libs/CruisePlugin/Move.js +73 -21
- package/libs/CruisePlugin/Work.js +98 -46
- package/libs/CruisePlugin/index.js +79 -27
- package/libs/CurrentPanoImagePlugin/Controller.js +176 -104
- package/libs/CurrentPanoImagePlugin/index.js +76 -4
- package/libs/GuideLinePlugin/Controller.js +82 -30
- package/libs/GuideLinePlugin/GuideLineItem.js +82 -30
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +3 -2
- package/libs/GuideLinePlugin/GuideLineModeItem.js +81 -29
- package/libs/GuideLinePlugin/index.js +79 -27
- package/libs/ModelMakerPlugin/Controller.js +140 -83
- package/libs/ModelMakerPlugin/index.js +75 -18
- package/libs/ModelTVVideoPlugin/Plugin.js +117 -57
- package/libs/ModelTVVideoPlugin/index.js +68 -8
- package/libs/Object3DHelperPlugin/Controller.js +54 -31
- package/libs/Object3DHelperPlugin/index.js +35 -13
- package/libs/PanoCompassPlugin/Controller.js +97 -42
- package/libs/PanoCompassPlugin/index.js +71 -16
- package/libs/PanoDoorLabelPlugin/BaseController.js +98 -26
- package/libs/PanoDoorLabelPlugin/Controller.js +187 -115
- package/libs/PanoDoorLabelPlugin/index.js +76 -4
- package/libs/PanoMeasurePlugin/Components/Controller0.js +141 -89
- package/libs/PanoMeasurePlugin/Components/Controller1.js +179 -127
- package/libs/PanoMeasurePlugin/Controller/EditController.js +125 -73
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +167 -92
- package/libs/PanoMeasurePlugin/Controller/index.js +110 -65
- package/libs/PanoMeasurePlugin/Model/area.js +114 -38
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +78 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +98 -46
- package/libs/PanoMeasurePlugin/index.js +77 -32
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +98 -20
- package/libs/PanoSpatialTagPlugin/Plugin.js +210 -150
- package/libs/PanoSpatialTagPlugin/index.js +66 -6
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +133 -53
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +295 -216
- package/libs/PanoTagPlugin/Components/Tag/index.js +257 -187
- package/libs/PanoTagPlugin/Components/TagContainer.js +157 -87
- package/libs/PanoTagPlugin/Components/TagItem.js +144 -74
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +73 -3
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +109 -39
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +105 -35
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +113 -43
- package/libs/PanoTagPlugin/controller/TagRender.js +132 -80
- package/libs/PanoTagPlugin/controller/TagUtil.js +136 -84
- package/libs/PanoTagPlugin/controller/index.js +113 -61
- package/libs/PanoTagPlugin/index.js +89 -37
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +121 -41
- package/libs/PanoVideoPlugin/Controller.js +137 -65
- package/libs/PanoVideoPlugin/VideoMeshController.js +149 -69
- package/libs/PanoVideoPlugin/index.js +82 -10
- package/libs/PipelinePlugin/Controller.js +199 -128
- package/libs/PipelinePlugin/index.js +76 -5
- package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +102 -22
- package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +95 -15
- package/libs/PipelinePlugin/utils/Objects/Pipe.js +136 -56
- package/libs/Sculpt/Meshes/Area.d.ts +1 -1
- package/libs/Sculpt/Meshes/Box.d.ts +1 -1
- package/libs/Sculpt/Meshes/Box.js +16 -15
- package/libs/Sculpt/Meshes/Circle.d.ts +1 -1
- package/libs/Sculpt/Meshes/Circle.js +1 -1
- package/libs/Sculpt/Meshes/CircleWithEdge.d.ts +1 -1
- package/libs/Sculpt/Meshes/Cylinder.js +8 -7
- package/libs/Sculpt/Meshes/Line.d.ts +8 -2
- package/libs/Sculpt/Meshes/Line.js +93 -65
- package/libs/Sculpt/Meshes/LineWithDots.d.ts +1 -1
- package/libs/Sculpt/Meshes/LineWithDots.js +26 -26
- package/libs/Sculpt/Meshes/Point.d.ts +1 -1
- package/libs/Sculpt/Meshes/Point.js +7 -6
- package/libs/Sculpt/Meshes/Polygon.js +1 -1
- package/libs/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
- package/libs/Sculpt/Meshes/Polyline.js +5 -4
- package/libs/Sculpt/Meshes/Prism.d.ts +1 -1
- package/libs/Sculpt/Meshes/Rectangle.js +3 -2
- package/libs/Sculpt/Meshes/RectangleWithEdge.d.ts +3 -4
- package/libs/Sculpt/Objects/Box/index.js +41 -43
- package/libs/Sculpt/Objects/Cylinder/index.js +35 -37
- package/libs/Sculpt/Objects/Line/Editor.d.ts +22 -0
- package/libs/Sculpt/Objects/Line/Editor.js +62 -0
- package/libs/Sculpt/Objects/Line/index.d.ts +33 -0
- package/libs/Sculpt/Objects/Line/index.js +107 -0
- package/libs/Sculpt/Objects/Point/index.d.ts +1 -1
- package/libs/Sculpt/Objects/Polygon/Editor.d.ts +2 -2
- package/libs/Sculpt/Objects/Polygon/Editor.js +5 -5
- package/libs/Sculpt/Objects/Polygon/index.d.ts +3 -2
- package/libs/Sculpt/Objects/Polygon/index.js +80 -80
- package/libs/Sculpt/Objects/Polyline/Editor.d.ts +3 -17
- package/libs/Sculpt/Objects/Polyline/Editor.js +10 -48
- package/libs/Sculpt/Objects/Polyline/index.d.ts +7 -6
- package/libs/Sculpt/Objects/Polyline/index.js +63 -58
- package/libs/Sculpt/Objects/Prism/index.js +56 -58
- package/libs/Sculpt/index.d.ts +5 -0
- package/libs/Sculpt/index.js +58 -48
- package/libs/Sculpt/typings/index.d.ts +11 -6
- package/libs/Sculpt/{utils/color.d.ts → typings/style.d.ts} +7 -0
- package/libs/Sculpt/typings/utils.type.d.ts +2 -0
- package/libs/Sculpt/utils/three/ColoredMesh.d.ts +1 -1
- package/libs/Sculpt/utils/three/ColoredMesh.js +15 -14
- package/libs/Sculpt/utils/three/rayOnLine.d.ts +3 -5
- package/libs/Sculpt/utils/three/rayOnLine.js +15 -14
- package/libs/base/BasePlugin.js +14 -13
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +131 -61
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +75 -6
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +129 -59
- package/libs/floorplan/ModelFloorplanPlugin/index.js +75 -5
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +158 -86
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +76 -4
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +151 -81
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +75 -5
- package/libs/floorplan/index.js +1 -0
- package/libs/index.js +194 -192
- package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +1 -1
- package/libs/shared-utils/Object3DHelper/Controller/ScaleController.js +23 -23
- package/libs/shared-utils/Utils/WorkUtil.d.ts +6 -6
- package/libs/shared-utils/Utils/WorkUtil.js +8 -7
- package/libs/shared-utils/five/index.js +3 -2
- package/libs/shared-utils/five/lookObject.js +3 -2
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/tag.d.ts +6 -3
- package/libs/shared-utils/tag.js +38 -24
- package/libs/shared-utils/three/PointSelector/utils/PointSelectorHelper.js +15 -15
- package/libs/shared-utils/three/index.js +1 -0
- package/package.json +1 -1
- package/dist/Sculpt/typings/SimplifyDeep.d.ts +0 -3
- package/libs/Sculpt/typings/SimplifyDeep.d.ts +0 -3
- /package/libs/Sculpt/{utils/color.js → typings/style.js} +0 -0
|
@@ -1,54 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var r = (
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
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
|
|
51
|
-
this.draggingPoints.forEach((
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
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
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
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
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var a = (
|
|
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
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
|
|
17
|
+
c(e.next(r));
|
|
18
|
+
} catch (y) {
|
|
19
|
+
d(y);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, p = (r) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
|
|
23
|
+
c(e.throw(r));
|
|
24
|
+
} catch (y) {
|
|
25
|
+
d(y);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
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
|
|
31
|
-
import { PolylineWithDotsMesh as
|
|
32
|
-
import { BaseObject as
|
|
33
|
-
import * as
|
|
34
|
-
import { PolylineEditor as
|
|
35
|
-
import { vector3ToArray as
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
|
47
|
-
points:
|
|
47
|
+
return M(w({}, this.baseData), {
|
|
48
|
+
points: U(this.applyObjectMatrixWorld(this.polyLineMesh.points)),
|
|
48
49
|
style: {
|
|
49
|
-
lineColor: new
|
|
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
|
|
65
|
+
return L(this, null, function* () {
|
|
65
66
|
this.removeChildren();
|
|
66
|
-
const
|
|
67
|
-
this.polyLineMesh =
|
|
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
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
function k(i, t, e) {
|
|
73
|
+
var c;
|
|
74
|
+
const o = i.parent;
|
|
75
|
+
if (!o)
|
|
74
76
|
return;
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
|
85
|
-
n.setPoints([
|
|
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",
|
|
88
|
-
if (t.off("select",
|
|
89
|
-
return
|
|
90
|
-
|
|
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
|
-
|
|
100
|
+
G as Polyline
|
|
96
101
|
};
|
|
@@ -1,49 +1,48 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var p = (
|
|
6
|
-
for (var t in
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
C.call(
|
|
11
|
-
return
|
|
12
|
-
}, w = (
|
|
13
|
-
var d = (
|
|
14
|
-
var
|
|
15
|
-
var
|
|
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(
|
|
18
|
-
} catch (
|
|
19
|
-
n(
|
|
17
|
+
r(t.next(s));
|
|
18
|
+
} catch (h) {
|
|
19
|
+
n(h);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, m = (s) => {
|
|
22
22
|
try {
|
|
23
|
-
r(t.throw(
|
|
24
|
-
} catch (
|
|
25
|
-
n(
|
|
23
|
+
r(t.throw(s));
|
|
24
|
+
} catch (h) {
|
|
25
|
+
n(h);
|
|
26
26
|
}
|
|
27
|
-
}, r = (
|
|
28
|
-
r((t = t.apply(
|
|
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 {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
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
|
|
42
|
-
constructor(t,
|
|
43
|
-
super(t,
|
|
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
|
|
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
|
|
71
|
-
this.prismMesh = new x(t), this.add(this.prismMesh), yield
|
|
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
|
|
76
|
-
return
|
|
77
|
-
const t =
|
|
78
|
-
yield T(
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
const n =
|
|
82
|
-
return
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
if (!(
|
|
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
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
94
|
-
},
|
|
95
|
-
|
|
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
|
-
|
|
95
|
+
P(), t.remove(i), h(new Error("Cancelled"));
|
|
98
96
|
};
|
|
99
|
-
|
|
97
|
+
e.on("select", f), e.on("intersectionUpdate", y), e.on("disable", b);
|
|
100
98
|
});
|
|
101
99
|
});
|
|
102
100
|
}
|
|
103
101
|
export {
|
|
104
|
-
|
|
102
|
+
X as Prism
|
|
105
103
|
};
|
package/libs/Sculpt/index.d.ts
CHANGED
|
@@ -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
|
*/
|