@gui-chat-plugin/present3d 0.0.1 → 0.0.3
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/dist/core/index.d.ts +7 -7
- package/dist/core/plugin.d.ts +3 -3
- package/dist/core/samples.d.ts +1 -1
- package/dist/core/samples.d.ts.map +1 -1
- package/dist/core/types.d.ts +1 -1
- package/dist/core.cjs +1 -0
- package/dist/core.js +4 -4
- package/dist/index-B8W7aPbA.js +27687 -0
- package/dist/index-CIaq2DFf.cjs +4175 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -0
- package/dist/shapescript/evaluator.d.ts +1 -1
- package/dist/shapescript/parser.d.ts +1 -1
- package/dist/shapescript/toThreeJS.d.ts +1 -1
- package/dist/style.css +1 -0
- package/dist/vue/Preview.vue.d.ts +9 -0
- package/dist/vue/Preview.vue.d.ts.map +1 -0
- package/dist/vue/View.vue.d.ts +13 -0
- package/dist/vue/View.vue.d.ts.map +1 -0
- package/dist/vue/index.d.ts +12 -11
- package/dist/vue.cjs +82 -0
- package/dist/vue.js +247 -229
- package/package.json +30 -16
- package/dist/present3d.css +0 -1
- package/dist/toThreeJS-EXFMlO7B.js +0 -2171
package/dist/vue.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
|
|
5
|
-
import { Controls as Pt, Vector3 as E, MOUSE as C, TOUCH as x, Quaternion as B, Spherical as Q, Vector2 as P, Ray as Et, Plane as St, MathUtils as Dt } from "three";
|
|
6
|
-
const $ = { type: "change" }, F = { type: "start" }, ot = { type: "end" }, z = new Et(), J = new St(), Tt = Math.cos(70 * Dt.DEG2RAD), d = new E(), f = 2 * Math.PI, l = {
|
|
1
|
+
import { C as yt, V as w, M as x, T as O, Q as X, S as G, a as y, R as wt, P as Pt, b as Et, c as $, d as J, e as tt, W as et, A as it, D as st, G as Dt, p as z, f as Y, s as St, g as Tt } from "./index-B8W7aPbA.js";
|
|
2
|
+
import { h as pe, i as de } from "./index-B8W7aPbA.js";
|
|
3
|
+
import { defineComponent as ot, ref as M, computed as at, onMounted as nt, nextTick as q, onUnmounted as rt, watch as R, createElementBlock as Z, openBlock as K, createElementVNode as _, createCommentVNode as vt, toDisplayString as C, createTextVNode as k, withDirectives as Mt, vModelText as Rt } from "vue";
|
|
4
|
+
const B = { type: "change" }, F = { type: "start" }, ht = { type: "end" }, j = new wt(), Q = new Pt(), Ot = Math.cos(70 * Et.DEG2RAD), d = new w(), f = 2 * Math.PI, h = {
|
|
7
5
|
NONE: -1,
|
|
8
6
|
ROTATE: 0,
|
|
9
7
|
DOLLY: 1,
|
|
@@ -12,75 +10,112 @@ const $ = { type: "change" }, F = { type: "start" }, ot = { type: "end" }, z = n
|
|
|
12
10
|
TOUCH_PAN: 4,
|
|
13
11
|
TOUCH_DOLLY_PAN: 5,
|
|
14
12
|
TOUCH_DOLLY_ROTATE: 6
|
|
15
|
-
},
|
|
16
|
-
class
|
|
13
|
+
}, U = 1e-6;
|
|
14
|
+
class xt extends yt {
|
|
15
|
+
/**
|
|
16
|
+
* Constructs a new controls instance.
|
|
17
|
+
*
|
|
18
|
+
* @param {Object3D} object - The object that is managed by the controls.
|
|
19
|
+
* @param {?HTMLElement} domElement - The HTML element used for event listeners.
|
|
20
|
+
*/
|
|
17
21
|
constructor(t, e = null) {
|
|
18
|
-
super(t, e), this.state =
|
|
22
|
+
super(t, e), this.state = h.NONE, this.target = new w(), this.cursor = new w(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: x.ROTATE, MIDDLE: x.DOLLY, RIGHT: x.PAN }, this.touches = { ONE: O.ROTATE, TWO: O.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new w(), this._lastQuaternion = new X(), this._lastTargetPosition = new w(), this._quat = new X().setFromUnitVectors(t.up, new w(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new G(), this._sphericalDelta = new G(), this._scale = 1, this._panOffset = new w(), this._rotateStart = new y(), this._rotateEnd = new y(), this._rotateDelta = new y(), this._panStart = new y(), this._panEnd = new y(), this._panDelta = new y(), this._dollyStart = new y(), this._dollyEnd = new y(), this._dollyDelta = new y(), this._dollyDirection = new w(), this._mouse = new y(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Lt.bind(this), this._onPointerDown = Ct.bind(this), this._onPointerUp = At.bind(this), this._onContextMenu = Yt.bind(this), this._onMouseWheel = zt.bind(this), this._onKeyDown = Nt.bind(this), this._onTouchStart = It.bind(this), this._onTouchMove = Ut.bind(this), this._onMouseDown = kt.bind(this), this._onMouseMove = jt.bind(this), this._interceptControlDown = Zt.bind(this), this._interceptControlUp = Kt.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
19
23
|
}
|
|
20
|
-
connect() {
|
|
21
|
-
this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
|
|
24
|
+
connect(t) {
|
|
25
|
+
super.connect(t), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
|
|
22
26
|
}
|
|
23
27
|
disconnect() {
|
|
24
|
-
this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.domElement.removeEventListener("pointercancel", this._onPointerUp), this.domElement.removeEventListener("wheel", this._onMouseWheel), this.domElement.removeEventListener("contextmenu", this._onContextMenu), this.stopListenToKeyEvents(), this.domElement.getRootNode().removeEventListener("keydown", this._interceptControlDown, { capture: !0 }), this.domElement.style.touchAction = "auto";
|
|
28
|
+
this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.domElement.removeEventListener("pointercancel", this._onPointerUp), this.domElement.removeEventListener("wheel", this._onMouseWheel), this.domElement.removeEventListener("contextmenu", this._onContextMenu), this.stopListenToKeyEvents(), this.domElement.getRootNode().removeEventListener("keydown", this._interceptControlDown, { capture: !0 }), this.domElement.style.touchAction = "auto";
|
|
25
29
|
}
|
|
26
30
|
dispose() {
|
|
27
31
|
this.disconnect();
|
|
28
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Get the current vertical rotation, in radians.
|
|
35
|
+
*
|
|
36
|
+
* @return {number} The current vertical rotation, in radians.
|
|
37
|
+
*/
|
|
29
38
|
getPolarAngle() {
|
|
30
39
|
return this._spherical.phi;
|
|
31
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Get the current horizontal rotation, in radians.
|
|
43
|
+
*
|
|
44
|
+
* @return {number} The current horizontal rotation, in radians.
|
|
45
|
+
*/
|
|
32
46
|
getAzimuthalAngle() {
|
|
33
47
|
return this._spherical.theta;
|
|
34
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Returns the distance from the camera to the target.
|
|
51
|
+
*
|
|
52
|
+
* @return {number} The distance from the camera to the target.
|
|
53
|
+
*/
|
|
35
54
|
getDistance() {
|
|
36
55
|
return this.object.position.distanceTo(this.target);
|
|
37
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Adds key event listeners to the given DOM element.
|
|
59
|
+
* `window` is a recommended argument for using this method.
|
|
60
|
+
*
|
|
61
|
+
* @param {HTMLElement} domElement - The DOM element
|
|
62
|
+
*/
|
|
38
63
|
listenToKeyEvents(t) {
|
|
39
64
|
t.addEventListener("keydown", this._onKeyDown), this._domElementKeyEvents = t;
|
|
40
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Removes the key event listener previously defined with `listenToKeyEvents()`.
|
|
68
|
+
*/
|
|
41
69
|
stopListenToKeyEvents() {
|
|
42
70
|
this._domElementKeyEvents !== null && (this._domElementKeyEvents.removeEventListener("keydown", this._onKeyDown), this._domElementKeyEvents = null);
|
|
43
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Save the current state of the controls. This can later be recovered with `reset()`.
|
|
74
|
+
*/
|
|
44
75
|
saveState() {
|
|
45
76
|
this.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;
|
|
46
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Reset the controls to their state from either the last time the `saveState()`
|
|
80
|
+
* was called, or the initial state.
|
|
81
|
+
*/
|
|
47
82
|
reset() {
|
|
48
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(
|
|
83
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(B), this.update(), this.state = h.NONE;
|
|
49
84
|
}
|
|
50
85
|
update(t = null) {
|
|
51
86
|
const e = this.object.position;
|
|
52
|
-
d.copy(e).sub(this.target), d.applyQuaternion(this._quat), this._spherical.setFromVector3(d), this.autoRotate && this.state ===
|
|
87
|
+
d.copy(e).sub(this.target), d.applyQuaternion(this._quat), this._spherical.setFromVector3(d), this.autoRotate && this.state === h.NONE && this._rotateLeft(this._getAutoRotationAngle(t)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
|
|
53
88
|
let s = this.minAzimuthAngle, o = this.maxAzimuthAngle;
|
|
54
89
|
isFinite(s) && isFinite(o) && (s < -Math.PI ? s += f : s > Math.PI && (s -= f), o < -Math.PI ? o += f : o > Math.PI && (o -= f), s <= o ? this._spherical.theta = Math.max(s, Math.min(o, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (s + o) / 2 ? Math.max(s, this._spherical.theta) : Math.min(o, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
|
|
55
90
|
let n = !1;
|
|
56
91
|
if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
|
|
57
92
|
this._spherical.radius = this._clampDistance(this._spherical.radius);
|
|
58
93
|
else {
|
|
59
|
-
const
|
|
60
|
-
this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), n =
|
|
94
|
+
const l = this._spherical.radius;
|
|
95
|
+
this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), n = l != this._spherical.radius;
|
|
61
96
|
}
|
|
62
97
|
if (d.setFromSpherical(this._spherical), d.applyQuaternion(this._quatInverse), e.copy(this.target).add(d), this.object.lookAt(this.target), this.enableDamping === !0 ? (this._sphericalDelta.theta *= 1 - this.dampingFactor, this._sphericalDelta.phi *= 1 - this.dampingFactor, this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0), this._panOffset.set(0, 0, 0)), this.zoomToCursor && this._performCursorZoom) {
|
|
63
|
-
let
|
|
98
|
+
let l = null;
|
|
64
99
|
if (this.object.isPerspectiveCamera) {
|
|
65
100
|
const p = d.length();
|
|
66
|
-
|
|
67
|
-
const u = p -
|
|
101
|
+
l = this._clampDistance(p * this._scale);
|
|
102
|
+
const u = p - l;
|
|
68
103
|
this.object.position.addScaledVector(this._dollyDirection, u), this.object.updateMatrixWorld(), n = !!u;
|
|
69
104
|
} else if (this.object.isOrthographicCamera) {
|
|
70
|
-
const p = new
|
|
105
|
+
const p = new w(this._mouse.x, this._mouse.y, 0);
|
|
71
106
|
p.unproject(this.object);
|
|
72
107
|
const u = this.object.zoom;
|
|
73
108
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), n = u !== this.object.zoom;
|
|
74
|
-
const
|
|
75
|
-
|
|
109
|
+
const S = new w(this._mouse.x, this._mouse.y, 0);
|
|
110
|
+
S.unproject(this.object), this.object.position.sub(S).add(p), this.object.updateMatrixWorld(), l = d.length();
|
|
76
111
|
} else
|
|
77
112
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
78
|
-
|
|
113
|
+
l !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(l).add(this.object.position) : (j.origin.copy(this.object.position), j.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(j.direction)) < Ot ? this.object.lookAt(this.target) : (Q.setFromNormalAndCoplanarPoint(this.object.up, this.target), j.intersectPlane(Q, this.target))));
|
|
79
114
|
} else if (this.object.isOrthographicCamera) {
|
|
80
|
-
const
|
|
81
|
-
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)),
|
|
115
|
+
const l = this.object.zoom;
|
|
116
|
+
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), l !== this.object.zoom && (this.object.updateProjectionMatrix(), n = !0);
|
|
82
117
|
}
|
|
83
|
-
return this._scale = 1, this._performCursorZoom = !1, n || this._lastPosition.distanceToSquared(this.object.position) >
|
|
118
|
+
return this._scale = 1, this._performCursorZoom = !1, n || this._lastPosition.distanceToSquared(this.object.position) > U || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > U || this._lastTargetPosition.distanceToSquared(this.target) > U ? (this.dispatchEvent(B), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
84
119
|
}
|
|
85
120
|
_getAutoRotationAngle(t) {
|
|
86
121
|
return t !== null ? f / 60 * this.autoRotateSpeed * t : f / 60 / 60 * this.autoRotateSpeed;
|
|
@@ -121,8 +156,8 @@ class vt extends Pt {
|
|
|
121
156
|
if (!this.zoomToCursor)
|
|
122
157
|
return;
|
|
123
158
|
this._performCursorZoom = !0;
|
|
124
|
-
const s = this.domElement.getBoundingClientRect(), o = t - s.left, n = e - s.top,
|
|
125
|
-
this._mouse.x = o /
|
|
159
|
+
const s = this.domElement.getBoundingClientRect(), o = t - s.left, n = e - s.top, l = s.width, p = s.height;
|
|
160
|
+
this._mouse.x = o / l * 2 - 1, this._mouse.y = -(n / p) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
|
|
126
161
|
}
|
|
127
162
|
_clampDistance(t) {
|
|
128
163
|
return Math.max(this.minDistance, Math.min(this.maxDistance, t));
|
|
@@ -220,8 +255,8 @@ class vt extends Pt {
|
|
|
220
255
|
_handleTouchMoveDolly(t) {
|
|
221
256
|
const e = this._getSecondPointerPosition(t), s = t.pageX - e.x, o = t.pageY - e.y, n = Math.sqrt(s * s + o * o);
|
|
222
257
|
this._dollyEnd.set(0, n), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
|
|
223
|
-
const
|
|
224
|
-
this._updateZoomParameters(
|
|
258
|
+
const l = (t.pageX + e.x) * 0.5, p = (t.pageY + e.y) * 0.5;
|
|
259
|
+
this._updateZoomParameters(l, p);
|
|
225
260
|
}
|
|
226
261
|
_handleTouchMoveDollyPan(t) {
|
|
227
262
|
this.enableZoom && this._handleTouchMoveDolly(t), this.enablePan && this._handleTouchMovePan(t);
|
|
@@ -248,7 +283,7 @@ class vt extends Pt {
|
|
|
248
283
|
}
|
|
249
284
|
_trackPointer(t) {
|
|
250
285
|
let e = this._pointerPositions[t.pointerId];
|
|
251
|
-
e === void 0 && (e = new
|
|
286
|
+
e === void 0 && (e = new y(), this._pointerPositions[t.pointerId] = e), e.set(t.pageX, t.pageY);
|
|
252
287
|
}
|
|
253
288
|
_getSecondPointerPosition(t) {
|
|
254
289
|
const e = t.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
|
|
@@ -272,16 +307,16 @@ class vt extends Pt {
|
|
|
272
307
|
return t.ctrlKey && !this._controlActive && (s.deltaY *= 10), s;
|
|
273
308
|
}
|
|
274
309
|
}
|
|
275
|
-
function
|
|
276
|
-
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(i.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(i) && (this._addPointer(i), i.pointerType === "touch" ? this._onTouchStart(i) : this._onMouseDown(i)));
|
|
310
|
+
function Ct(i) {
|
|
311
|
+
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(i.pointerId), this.domElement.ownerDocument.addEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(i) && (this._addPointer(i), i.pointerType === "touch" ? this._onTouchStart(i) : this._onMouseDown(i)));
|
|
277
312
|
}
|
|
278
|
-
function
|
|
313
|
+
function Lt(i) {
|
|
279
314
|
this.enabled !== !1 && (i.pointerType === "touch" ? this._onTouchMove(i) : this._onMouseMove(i));
|
|
280
315
|
}
|
|
281
|
-
function
|
|
316
|
+
function At(i) {
|
|
282
317
|
switch (this._removePointer(i), this._pointers.length) {
|
|
283
318
|
case 0:
|
|
284
|
-
this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(
|
|
319
|
+
this.domElement.releasePointerCapture(i.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(ht), this.state = h.NONE;
|
|
285
320
|
break;
|
|
286
321
|
case 1:
|
|
287
322
|
const t = this._pointers[0], e = this._pointerPositions[t];
|
|
@@ -289,7 +324,7 @@ function Ot(i) {
|
|
|
289
324
|
break;
|
|
290
325
|
}
|
|
291
326
|
}
|
|
292
|
-
function
|
|
327
|
+
function kt(i) {
|
|
293
328
|
let t;
|
|
294
329
|
switch (i.button) {
|
|
295
330
|
case 0:
|
|
@@ -305,199 +340,190 @@ function xt(i) {
|
|
|
305
340
|
t = -1;
|
|
306
341
|
}
|
|
307
342
|
switch (t) {
|
|
308
|
-
case
|
|
343
|
+
case x.DOLLY:
|
|
309
344
|
if (this.enableZoom === !1) return;
|
|
310
|
-
this._handleMouseDownDolly(i), this.state =
|
|
345
|
+
this._handleMouseDownDolly(i), this.state = h.DOLLY;
|
|
311
346
|
break;
|
|
312
|
-
case
|
|
347
|
+
case x.ROTATE:
|
|
313
348
|
if (i.ctrlKey || i.metaKey || i.shiftKey) {
|
|
314
349
|
if (this.enablePan === !1) return;
|
|
315
|
-
this._handleMouseDownPan(i), this.state =
|
|
350
|
+
this._handleMouseDownPan(i), this.state = h.PAN;
|
|
316
351
|
} else {
|
|
317
352
|
if (this.enableRotate === !1) return;
|
|
318
|
-
this._handleMouseDownRotate(i), this.state =
|
|
353
|
+
this._handleMouseDownRotate(i), this.state = h.ROTATE;
|
|
319
354
|
}
|
|
320
355
|
break;
|
|
321
|
-
case
|
|
356
|
+
case x.PAN:
|
|
322
357
|
if (i.ctrlKey || i.metaKey || i.shiftKey) {
|
|
323
358
|
if (this.enableRotate === !1) return;
|
|
324
|
-
this._handleMouseDownRotate(i), this.state =
|
|
359
|
+
this._handleMouseDownRotate(i), this.state = h.ROTATE;
|
|
325
360
|
} else {
|
|
326
361
|
if (this.enablePan === !1) return;
|
|
327
|
-
this._handleMouseDownPan(i), this.state =
|
|
362
|
+
this._handleMouseDownPan(i), this.state = h.PAN;
|
|
328
363
|
}
|
|
329
364
|
break;
|
|
330
365
|
default:
|
|
331
|
-
this.state =
|
|
366
|
+
this.state = h.NONE;
|
|
332
367
|
}
|
|
333
|
-
this.state !==
|
|
368
|
+
this.state !== h.NONE && this.dispatchEvent(F);
|
|
334
369
|
}
|
|
335
|
-
function
|
|
370
|
+
function jt(i) {
|
|
336
371
|
switch (this.state) {
|
|
337
|
-
case
|
|
372
|
+
case h.ROTATE:
|
|
338
373
|
if (this.enableRotate === !1) return;
|
|
339
374
|
this._handleMouseMoveRotate(i);
|
|
340
375
|
break;
|
|
341
|
-
case
|
|
376
|
+
case h.DOLLY:
|
|
342
377
|
if (this.enableZoom === !1) return;
|
|
343
378
|
this._handleMouseMoveDolly(i);
|
|
344
379
|
break;
|
|
345
|
-
case
|
|
380
|
+
case h.PAN:
|
|
346
381
|
if (this.enablePan === !1) return;
|
|
347
382
|
this._handleMouseMovePan(i);
|
|
348
383
|
break;
|
|
349
384
|
}
|
|
350
385
|
}
|
|
351
|
-
function
|
|
352
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !==
|
|
386
|
+
function zt(i) {
|
|
387
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== h.NONE || (i.preventDefault(), this.dispatchEvent(F), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(ht));
|
|
353
388
|
}
|
|
354
|
-
function
|
|
389
|
+
function Nt(i) {
|
|
355
390
|
this.enabled !== !1 && this._handleKeyDown(i);
|
|
356
391
|
}
|
|
357
|
-
function
|
|
392
|
+
function It(i) {
|
|
358
393
|
switch (this._trackPointer(i), this._pointers.length) {
|
|
359
394
|
case 1:
|
|
360
395
|
switch (this.touches.ONE) {
|
|
361
|
-
case
|
|
396
|
+
case O.ROTATE:
|
|
362
397
|
if (this.enableRotate === !1) return;
|
|
363
|
-
this._handleTouchStartRotate(i), this.state =
|
|
398
|
+
this._handleTouchStartRotate(i), this.state = h.TOUCH_ROTATE;
|
|
364
399
|
break;
|
|
365
|
-
case
|
|
400
|
+
case O.PAN:
|
|
366
401
|
if (this.enablePan === !1) return;
|
|
367
|
-
this._handleTouchStartPan(i), this.state =
|
|
402
|
+
this._handleTouchStartPan(i), this.state = h.TOUCH_PAN;
|
|
368
403
|
break;
|
|
369
404
|
default:
|
|
370
|
-
this.state =
|
|
405
|
+
this.state = h.NONE;
|
|
371
406
|
}
|
|
372
407
|
break;
|
|
373
408
|
case 2:
|
|
374
409
|
switch (this.touches.TWO) {
|
|
375
|
-
case
|
|
410
|
+
case O.DOLLY_PAN:
|
|
376
411
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
377
|
-
this._handleTouchStartDollyPan(i), this.state =
|
|
412
|
+
this._handleTouchStartDollyPan(i), this.state = h.TOUCH_DOLLY_PAN;
|
|
378
413
|
break;
|
|
379
|
-
case
|
|
414
|
+
case O.DOLLY_ROTATE:
|
|
380
415
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
381
|
-
this._handleTouchStartDollyRotate(i), this.state =
|
|
416
|
+
this._handleTouchStartDollyRotate(i), this.state = h.TOUCH_DOLLY_ROTATE;
|
|
382
417
|
break;
|
|
383
418
|
default:
|
|
384
|
-
this.state =
|
|
419
|
+
this.state = h.NONE;
|
|
385
420
|
}
|
|
386
421
|
break;
|
|
387
422
|
default:
|
|
388
|
-
this.state =
|
|
423
|
+
this.state = h.NONE;
|
|
389
424
|
}
|
|
390
|
-
this.state !==
|
|
425
|
+
this.state !== h.NONE && this.dispatchEvent(F);
|
|
391
426
|
}
|
|
392
|
-
function
|
|
427
|
+
function Ut(i) {
|
|
393
428
|
switch (this._trackPointer(i), this.state) {
|
|
394
|
-
case
|
|
429
|
+
case h.TOUCH_ROTATE:
|
|
395
430
|
if (this.enableRotate === !1) return;
|
|
396
431
|
this._handleTouchMoveRotate(i), this.update();
|
|
397
432
|
break;
|
|
398
|
-
case
|
|
433
|
+
case h.TOUCH_PAN:
|
|
399
434
|
if (this.enablePan === !1) return;
|
|
400
435
|
this._handleTouchMovePan(i), this.update();
|
|
401
436
|
break;
|
|
402
|
-
case
|
|
437
|
+
case h.TOUCH_DOLLY_PAN:
|
|
403
438
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
404
439
|
this._handleTouchMoveDollyPan(i), this.update();
|
|
405
440
|
break;
|
|
406
|
-
case
|
|
441
|
+
case h.TOUCH_DOLLY_ROTATE:
|
|
407
442
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
408
443
|
this._handleTouchMoveDollyRotate(i), this.update();
|
|
409
444
|
break;
|
|
410
445
|
default:
|
|
411
|
-
this.state =
|
|
446
|
+
this.state = h.NONE;
|
|
412
447
|
}
|
|
413
448
|
}
|
|
414
|
-
function
|
|
449
|
+
function Yt(i) {
|
|
415
450
|
this.enabled !== !1 && i.preventDefault();
|
|
416
451
|
}
|
|
417
|
-
function
|
|
452
|
+
function Zt(i) {
|
|
418
453
|
i.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
419
454
|
}
|
|
420
|
-
function
|
|
455
|
+
function Kt(i) {
|
|
421
456
|
i.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
422
457
|
}
|
|
423
|
-
const
|
|
458
|
+
const Ft = { class: "present3d-container" }, Ht = { class: "header" }, Vt = { class: "controls" }, Wt = { class: "material-icons" }, Xt = { class: "material-icons" }, Gt = {
|
|
424
459
|
key: 0,
|
|
425
460
|
class: "error"
|
|
426
|
-
},
|
|
461
|
+
}, qt = { class: "script-source" }, Bt = ["disabled"], Qt = /* @__PURE__ */ ot({
|
|
427
462
|
__name: "View",
|
|
428
463
|
props: {
|
|
429
464
|
selectedResult: {}
|
|
430
465
|
},
|
|
431
466
|
emits: ["updateResult"],
|
|
432
467
|
setup(i, { emit: t }) {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
});
|
|
438
|
-
let y, m, w, r, b, S, L = [], D = null, M = null;
|
|
439
|
-
it(() => {
|
|
440
|
-
nt(), U(), W(), q(() => {
|
|
468
|
+
const e = i, s = t, o = M(e.selectedResult.data?.script ?? ""), n = M(null), l = M(null), p = M(!1), u = M(!0), S = at(() => o.value !== e.selectedResult.data?.script);
|
|
469
|
+
let b, m, g, r, P, E, T = [], D = null, L = null;
|
|
470
|
+
nt(() => {
|
|
471
|
+
ct(), I(), H(), q(() => {
|
|
441
472
|
V();
|
|
442
473
|
});
|
|
443
|
-
}),
|
|
444
|
-
|
|
445
|
-
}),
|
|
446
|
-
() =>
|
|
447
|
-
var a;
|
|
448
|
-
return (a = e.selectedResult.data) == null ? void 0 : a.script;
|
|
449
|
-
},
|
|
474
|
+
}), rt(() => {
|
|
475
|
+
ft();
|
|
476
|
+
}), R(
|
|
477
|
+
() => e.selectedResult.data?.script,
|
|
450
478
|
() => {
|
|
451
|
-
|
|
479
|
+
I();
|
|
452
480
|
}
|
|
453
|
-
),
|
|
454
|
-
|
|
455
|
-
}),
|
|
456
|
-
|
|
481
|
+
), R(p, () => {
|
|
482
|
+
I();
|
|
483
|
+
}), R(u, (a) => {
|
|
484
|
+
E && (E.visible = a);
|
|
457
485
|
});
|
|
458
|
-
function
|
|
486
|
+
function ct() {
|
|
459
487
|
if (!n.value) return;
|
|
460
|
-
|
|
461
|
-
const a = n.value.clientWidth,
|
|
462
|
-
m = new
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
const A = new
|
|
466
|
-
A.position.set(10, 10, 10),
|
|
467
|
-
|
|
468
|
-
}),
|
|
488
|
+
b = new $(), b.background = new J(1710618);
|
|
489
|
+
const a = n.value.clientWidth, c = n.value.clientHeight;
|
|
490
|
+
m = new tt(50, a / c, 0.1, 1e3), m.position.set(5, 5, 10), m.lookAt(0, 0, 0), g = new et({ antialias: !0 }), g.setSize(a, c), g.setPixelRatio(window.devicePixelRatio), n.value.appendChild(g.domElement), r = new xt(m, g.domElement), r.enableDamping = !0, r.dampingFactor = 0.05, r.addEventListener("change", W);
|
|
491
|
+
const v = new it(16777215, 0.6);
|
|
492
|
+
b.add(v);
|
|
493
|
+
const A = new st(16777215, 0.8);
|
|
494
|
+
A.position.set(10, 10, 10), b.add(A), E = new Dt(20, 20, 4473924, 2236962), E.visible = u.value, b.add(E), window.addEventListener("resize", N), L = new ResizeObserver(() => {
|
|
495
|
+
N();
|
|
496
|
+
}), L.observe(n.value);
|
|
469
497
|
}
|
|
470
|
-
function
|
|
498
|
+
function N() {
|
|
471
499
|
if (!n.value) return;
|
|
472
|
-
const a = n.value.clientWidth,
|
|
473
|
-
m.aspect = a /
|
|
500
|
+
const a = n.value.clientWidth, c = n.value.clientHeight;
|
|
501
|
+
m.aspect = a / c, m.updateProjectionMatrix(), g.setSize(a, c);
|
|
474
502
|
}
|
|
475
|
-
function
|
|
476
|
-
var a;
|
|
503
|
+
function I() {
|
|
477
504
|
try {
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
if (!
|
|
481
|
-
const
|
|
482
|
-
|
|
483
|
-
} catch (
|
|
484
|
-
|
|
505
|
+
T.forEach((A) => b.remove(A)), T = [];
|
|
506
|
+
const a = e.selectedResult.data?.script;
|
|
507
|
+
if (!a) return;
|
|
508
|
+
const c = z(a), v = Y(c, { wireframe: p.value });
|
|
509
|
+
b.add(v), T.push(v), l.value = null;
|
|
510
|
+
} catch (a) {
|
|
511
|
+
l.value = a instanceof Error ? a.message : "Unknown error", console.error("ShapeScript parse error:", a);
|
|
485
512
|
}
|
|
486
513
|
}
|
|
487
|
-
function
|
|
488
|
-
|
|
514
|
+
function H() {
|
|
515
|
+
P = requestAnimationFrame(H), r.update(), g.render(b, m);
|
|
489
516
|
}
|
|
490
|
-
function
|
|
517
|
+
function pt() {
|
|
491
518
|
m.position.set(5, 5, 10), m.lookAt(0, 0, 0), r.reset();
|
|
492
519
|
}
|
|
493
520
|
function V() {
|
|
494
|
-
|
|
495
|
-
if (!m || !r || !((T = (h = e.selectedResult) == null ? void 0 : h.viewState) != null && T.cameraState))
|
|
521
|
+
if (!m || !r || !e.selectedResult?.viewState?.cameraState)
|
|
496
522
|
return;
|
|
497
523
|
const a = e.selectedResult.viewState.cameraState;
|
|
498
524
|
a.position && m.position.set(a.position.x, a.position.y, a.position.z), a.target && r.target.set(a.target.x, a.target.y, a.target.z), m.updateProjectionMatrix(), r.update();
|
|
499
525
|
}
|
|
500
|
-
function
|
|
526
|
+
function dt() {
|
|
501
527
|
return {
|
|
502
528
|
position: {
|
|
503
529
|
x: m.position.x,
|
|
@@ -511,34 +537,34 @@ const Ut = { class: "present3d-container" }, Yt = { class: "header" }, Zt = { cl
|
|
|
511
537
|
}
|
|
512
538
|
};
|
|
513
539
|
}
|
|
514
|
-
function
|
|
540
|
+
function W() {
|
|
515
541
|
D !== null && clearTimeout(D), D = window.setTimeout(() => {
|
|
516
|
-
|
|
542
|
+
ut();
|
|
517
543
|
}, 500);
|
|
518
544
|
}
|
|
519
|
-
function
|
|
545
|
+
function ut() {
|
|
520
546
|
const a = {
|
|
521
547
|
...e.selectedResult,
|
|
522
548
|
viewState: {
|
|
523
|
-
cameraState:
|
|
549
|
+
cameraState: dt()
|
|
524
550
|
}
|
|
525
551
|
};
|
|
526
552
|
s("updateResult", a);
|
|
527
553
|
}
|
|
528
|
-
function
|
|
554
|
+
function mt() {
|
|
529
555
|
p.value = !p.value;
|
|
530
556
|
}
|
|
531
|
-
function
|
|
557
|
+
function _t() {
|
|
532
558
|
u.value = !u.value;
|
|
533
559
|
}
|
|
534
|
-
function
|
|
535
|
-
D !== null && clearTimeout(D),
|
|
560
|
+
function ft() {
|
|
561
|
+
D !== null && clearTimeout(D), P && cancelAnimationFrame(P), g && g.dispose(), r && (r.removeEventListener("change", W), r.dispose()), L && L.disconnect(), window.removeEventListener("resize", N);
|
|
536
562
|
}
|
|
537
|
-
function
|
|
563
|
+
function bt() {
|
|
538
564
|
}
|
|
539
|
-
function
|
|
565
|
+
function gt() {
|
|
540
566
|
try {
|
|
541
|
-
|
|
567
|
+
z(o.value);
|
|
542
568
|
const a = {
|
|
543
569
|
...e.selectedResult,
|
|
544
570
|
data: {
|
|
@@ -547,150 +573,142 @@ const Ut = { class: "present3d-container" }, Yt = { class: "header" }, Zt = { cl
|
|
|
547
573
|
};
|
|
548
574
|
s("updateResult", a);
|
|
549
575
|
} catch (a) {
|
|
550
|
-
|
|
576
|
+
l.value = a instanceof Error ? a.message : "Invalid ShapeScript", console.error("Script validation failed:", a);
|
|
551
577
|
}
|
|
552
578
|
}
|
|
553
|
-
return
|
|
554
|
-
() =>
|
|
555
|
-
var a;
|
|
556
|
-
return (a = e.selectedResult.data) == null ? void 0 : a.script;
|
|
557
|
-
},
|
|
579
|
+
return R(
|
|
580
|
+
() => e.selectedResult.data?.script,
|
|
558
581
|
(a) => {
|
|
559
582
|
a && (o.value = a);
|
|
560
583
|
}
|
|
561
|
-
),
|
|
584
|
+
), R(
|
|
562
585
|
() => e.selectedResult,
|
|
563
586
|
() => {
|
|
564
587
|
q(() => {
|
|
565
588
|
V();
|
|
566
589
|
});
|
|
567
590
|
}
|
|
568
|
-
), (a,
|
|
569
|
-
_("div",
|
|
570
|
-
_("h1", null,
|
|
571
|
-
_("div",
|
|
591
|
+
), (a, c) => (K(), Z("div", Ft, [
|
|
592
|
+
_("div", Ht, [
|
|
593
|
+
_("h1", null, C(i.selectedResult.title || "3D Visualization"), 1),
|
|
594
|
+
_("div", Vt, [
|
|
572
595
|
_("button", {
|
|
573
|
-
onClick:
|
|
596
|
+
onClick: pt,
|
|
574
597
|
class: "control-btn"
|
|
575
|
-
}, [...
|
|
598
|
+
}, [...c[1] || (c[1] = [
|
|
576
599
|
_("span", { class: "material-icons" }, "refresh", -1),
|
|
577
|
-
|
|
600
|
+
k(" Reset Camera ", -1)
|
|
578
601
|
])]),
|
|
579
602
|
_("button", {
|
|
580
|
-
onClick:
|
|
603
|
+
onClick: mt,
|
|
581
604
|
class: "control-btn"
|
|
582
605
|
}, [
|
|
583
|
-
_("span",
|
|
584
|
-
|
|
606
|
+
_("span", Wt, C(p.value ? "grid_off" : "grid_on"), 1),
|
|
607
|
+
c[2] || (c[2] = k(" Wireframe ", -1))
|
|
585
608
|
]),
|
|
586
609
|
_("button", {
|
|
587
|
-
onClick:
|
|
610
|
+
onClick: _t,
|
|
588
611
|
class: "control-btn"
|
|
589
612
|
}, [
|
|
590
|
-
_("span",
|
|
591
|
-
|
|
613
|
+
_("span", Xt, C(u.value ? "visibility_off" : "visibility"), 1),
|
|
614
|
+
c[3] || (c[3] = k(" Grid ", -1))
|
|
592
615
|
])
|
|
593
616
|
])
|
|
594
617
|
]),
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
])) :
|
|
618
|
+
l.value ? (K(), Z("div", Gt, [
|
|
619
|
+
c[4] || (c[4] = _("strong", null, "Parse Error:", -1)),
|
|
620
|
+
k(" " + C(l.value), 1)
|
|
621
|
+
])) : vt("", !0),
|
|
599
622
|
_("div", {
|
|
600
623
|
class: "viewport",
|
|
601
624
|
ref_key: "viewport",
|
|
602
625
|
ref: n
|
|
603
626
|
}, null, 512),
|
|
604
|
-
_("details",
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
"onUpdate:modelValue":
|
|
608
|
-
onInput:
|
|
627
|
+
_("details", qt, [
|
|
628
|
+
c[5] || (c[5] = _("summary", null, "Edit ShapeScript Source", -1)),
|
|
629
|
+
Mt(_("textarea", {
|
|
630
|
+
"onUpdate:modelValue": c[0] || (c[0] = (v) => o.value = v),
|
|
631
|
+
onInput: bt,
|
|
609
632
|
class: "script-editor",
|
|
610
633
|
spellcheck: "false"
|
|
611
634
|
}, null, 544), [
|
|
612
|
-
[
|
|
635
|
+
[Rt, o.value]
|
|
613
636
|
]),
|
|
614
637
|
_("button", {
|
|
615
|
-
onClick:
|
|
638
|
+
onClick: gt,
|
|
616
639
|
class: "apply-btn",
|
|
617
|
-
disabled: !
|
|
618
|
-
}, " Apply Changes ", 8,
|
|
640
|
+
disabled: !S.value
|
|
641
|
+
}, " Apply Changes ", 8, Bt)
|
|
619
642
|
])
|
|
620
643
|
]));
|
|
621
644
|
}
|
|
622
|
-
}),
|
|
645
|
+
}), lt = (i, t) => {
|
|
623
646
|
const e = i.__vccOpts || i;
|
|
624
647
|
for (const [s, o] of t)
|
|
625
648
|
e[s] = o;
|
|
626
649
|
return e;
|
|
627
|
-
},
|
|
650
|
+
}, $t = /* @__PURE__ */ lt(Qt, [["__scopeId", "data-v-daa337a0"]]), Jt = { class: "preview-container" }, te = { class: "preview-title" }, ee = /* @__PURE__ */ ot({
|
|
628
651
|
__name: "Preview",
|
|
629
652
|
props: {
|
|
630
653
|
result: {}
|
|
631
654
|
},
|
|
632
655
|
setup(i) {
|
|
633
|
-
const t = i, e =
|
|
634
|
-
let o, n,
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
}),
|
|
638
|
-
|
|
639
|
-
}),
|
|
640
|
-
() =>
|
|
641
|
-
var r;
|
|
642
|
-
return (r = t.result.data) == null ? void 0 : r.script;
|
|
643
|
-
},
|
|
656
|
+
const t = i, e = at(() => t.result.title || "3D Visualization"), s = M(null);
|
|
657
|
+
let o, n, l, p, u = null;
|
|
658
|
+
nt(() => {
|
|
659
|
+
S();
|
|
660
|
+
}), rt(() => {
|
|
661
|
+
g();
|
|
662
|
+
}), R(
|
|
663
|
+
() => t.result.data?.script,
|
|
644
664
|
() => {
|
|
645
665
|
m();
|
|
646
666
|
}
|
|
647
667
|
);
|
|
648
|
-
function
|
|
649
|
-
var r;
|
|
668
|
+
function S() {
|
|
650
669
|
if (s.value)
|
|
651
670
|
try {
|
|
652
|
-
o = new
|
|
653
|
-
const
|
|
654
|
-
n = new
|
|
655
|
-
const
|
|
656
|
-
o.add(
|
|
657
|
-
const
|
|
658
|
-
if (
|
|
659
|
-
const
|
|
660
|
-
u =
|
|
661
|
-
} catch (
|
|
662
|
-
console.error("Preview render error:",
|
|
671
|
+
o = new $(), o.background = new J(2763322);
|
|
672
|
+
const r = s.value.clientWidth || 200, P = s.value.clientHeight || 150;
|
|
673
|
+
n = new tt(50, r / P, 0.1, 1e3), n.position.set(4, 4, 8), n.lookAt(0, 0, 0), l = new et({ antialias: !0, alpha: !1 }), l.setSize(r, P), l.setPixelRatio(Math.min(window.devicePixelRatio, 2)), s.value.appendChild(l.domElement);
|
|
674
|
+
const E = new it(16777215, 0.6);
|
|
675
|
+
o.add(E);
|
|
676
|
+
const T = new st(16777215, 0.8);
|
|
677
|
+
if (T.position.set(5, 5, 5), o.add(T), !t.result.data?.script) return;
|
|
678
|
+
const D = z(t.result.data.script);
|
|
679
|
+
u = Y(D, { wireframe: !1 }), o.add(u), b();
|
|
680
|
+
} catch (r) {
|
|
681
|
+
console.error("Preview render error:", r);
|
|
663
682
|
}
|
|
664
683
|
}
|
|
665
|
-
function
|
|
666
|
-
p = requestAnimationFrame(
|
|
684
|
+
function b() {
|
|
685
|
+
p = requestAnimationFrame(b);
|
|
667
686
|
const r = Date.now() * 5e-4;
|
|
668
|
-
n.position.x = Math.cos(r) * 8, n.position.z = Math.sin(r) * 8, n.lookAt(0, 0, 0),
|
|
687
|
+
n.position.x = Math.cos(r) * 8, n.position.z = Math.sin(r) * 8, n.lookAt(0, 0, 0), l.render(o, n);
|
|
669
688
|
}
|
|
670
689
|
function m() {
|
|
671
|
-
|
|
672
|
-
if (!(!o || !((r = t.result.data) != null && r.script)))
|
|
690
|
+
if (!(!o || !t.result.data?.script))
|
|
673
691
|
try {
|
|
674
692
|
u && o.remove(u);
|
|
675
|
-
const
|
|
676
|
-
u =
|
|
677
|
-
} catch (
|
|
678
|
-
console.error("Preview reload error:",
|
|
693
|
+
const r = z(t.result.data.script);
|
|
694
|
+
u = Y(r, { wireframe: !1 }), o.add(u);
|
|
695
|
+
} catch (r) {
|
|
696
|
+
console.error("Preview reload error:", r);
|
|
679
697
|
}
|
|
680
698
|
}
|
|
681
|
-
function
|
|
682
|
-
p && cancelAnimationFrame(p),
|
|
699
|
+
function g() {
|
|
700
|
+
p && cancelAnimationFrame(p), l && l.dispose();
|
|
683
701
|
}
|
|
684
|
-
return (r,
|
|
702
|
+
return (r, P) => (K(), Z("div", Jt, [
|
|
685
703
|
_("div", {
|
|
686
704
|
ref_key: "previewViewport",
|
|
687
705
|
ref: s,
|
|
688
706
|
class: "preview-viewport"
|
|
689
707
|
}, null, 512),
|
|
690
|
-
_("div",
|
|
708
|
+
_("div", te, C(e.value), 1)
|
|
691
709
|
]));
|
|
692
710
|
}
|
|
693
|
-
}),
|
|
711
|
+
}), ie = /* @__PURE__ */ lt(ee, [["__scopeId", "data-v-75941188"]]), se = "present3D", oe = `Use the ${se} tool to create interactive 3D visualizations when the user requests:
|
|
694
712
|
- 3D models or shapes
|
|
695
713
|
- Mathematical visualizations (surfaces, functions, geometric patterns)
|
|
696
714
|
- Molecular or atomic structures
|
|
@@ -771,24 +789,24 @@ Shapes: cube, sphere, cylinder, cone, torus
|
|
|
771
789
|
CSG: union, difference, intersection, xor, stencil
|
|
772
790
|
Properties: position, rotation, size, color, opacity
|
|
773
791
|
|
|
774
|
-
Keep visualizations clear, well-organized, and leverage the full power of expressions and control flow.`,
|
|
775
|
-
...
|
|
776
|
-
viewComponent:
|
|
777
|
-
previewComponent:
|
|
778
|
-
samples:
|
|
779
|
-
systemPrompt:
|
|
780
|
-
},
|
|
792
|
+
Keep visualizations clear, well-organized, and leverage the full power of expressions and control flow.`, ae = {
|
|
793
|
+
...Tt,
|
|
794
|
+
viewComponent: $t,
|
|
795
|
+
previewComponent: ie,
|
|
796
|
+
samples: St,
|
|
797
|
+
systemPrompt: oe
|
|
798
|
+
}, he = { plugin: ae };
|
|
781
799
|
export {
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
800
|
+
ie as Preview,
|
|
801
|
+
oe as SYSTEM_PROMPT,
|
|
802
|
+
pe as TOOL_DEFINITION,
|
|
803
|
+
se as TOOL_NAME,
|
|
804
|
+
$t as View,
|
|
805
|
+
Y as astToThreeJS,
|
|
806
|
+
he as default,
|
|
807
|
+
de as executePresent3D,
|
|
808
|
+
z as parseShapeScript,
|
|
809
|
+
ae as plugin,
|
|
810
|
+
Tt as pluginCore,
|
|
811
|
+
St as samples
|
|
794
812
|
};
|