From 81a72be23d2bbdcc2af3b26d85fa90c13c169108 Mon Sep 17 00:00:00 2001 From: LazyTong Date: Tue, 30 Jul 2024 18:12:30 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E6=89=A9?= =?UTF-8?q?=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/LazyTong/Cube.js | 1684 +++++++++++++++++++++++++++++++++++ 1 file changed, 1684 insertions(+) create mode 100644 extensions/LazyTong/Cube.js diff --git a/extensions/LazyTong/Cube.js b/extensions/LazyTong/Cube.js new file mode 100644 index 00000000..943026ad --- /dev/null +++ b/extensions/LazyTong/Cube.js @@ -0,0 +1,1684 @@ +const t = "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDgwIDgwIiB3aWR0aD0iODAiIGhlaWdodD0iODAiPjxzdHlsZT4uYXtmaWxsOiNlNjJ9LmJ7ZmlsbDojNmMwfS5je2ZpbGw6IzYzNn0uZHtmaWxsOiNlZDB9LmV7ZmlsbDojMzkwfTwvc3R5bGU+PHBhdGggY2xhc3M9ImEiIGQ9Im0xMS43IDIyLjNsMjguNi0xMy40djM1LjJsLTI4LjYgMTMuM3oiLz48cGF0aCBjbGFzcz0iYiIgZD0ibTY4LjMgMjIuNmwtMjgtMTMuN3YzNS4ybDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImMiIGQ9Im0zOS43IDcxLjFsLTI4LTEzLjcgMjguNi0xMy4zIDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImQiIGQ9Im02OC4zIDIyLjZsLTI4LTEzLjctMjguNiAxMy40IDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImIiIGQ9Im0xMS43IDIyLjNsMjggMTMuNnYzNS4ybC0yOC0xMy43eiIvPjxwYXRoIGNsYXNzPSJlIiBkPSJtNjguMyAyMi42bC0yOC42IDEzLjN2MzUuMmwyOC42LTEzLjR6Ii8+PC9zdmc+"; +void(window.tempExt = { + Extension: class { + constructor(e) { + this.objectList = {}, this.observer = null, this.runtime = e, this.canvas = () => { + try { + const { + canvas: e + } = this.runtime.renderer; + if (e instanceof HTMLCanvasElement) return e + } catch (e) { + return null + } + return null + }, this.cubeParent = () => { + try { + const { + canvas: e + } = this.runtime.renderer; + if (e instanceof HTMLCanvasElement) return e.parentElement + } catch (e) { + return console.error(e), null + } + return null + }, this.Cube = function() { + console.log("%cLazyTong's Cube\n \u3000 \u3000\u2583\u2586\u2588\u2587\u2584\u2596\n\u3000 \u3000 \u3000 \u259F\u25E4\u2596\u3000\u3000\u3000\u25E5\u2588\u258E\n \u3000 \u25E2\u25E4\u3000 \u2590\u3000\u3000\u3000 \u3000\u2590\u2589\n\u3000 \u2597\u25E4\u3000\u3000\u3000\u2582\u3000\u2597\u2596\u3000\u3000\u2595\u2588\u258E\n\u3000\u25E4\u3000\u2597\u2585\u2596\u25E5\u2584\u3000\u2580\u25E3\u3000\u3000\u2588\u258A\n\u2590\u3000\u2595\u258E\u25E5\u2596\u25E3\u25E4\u3000\u3000\u3000\u3000\u25E2\u2588\u2588\n\u2588\u25E3\u3000\u25E5\u2585\u2588\u2580\u3000\u3000\u3000\u3000\u2590\u2588\u2588\u25E4\n\u2590\u2588\u2599\u2582\u3000\u3000 \u3000\u25E2\u2588\u2588\u25E4\n\u25E5\u2588\u2588\u25E3\u3000\u3000\u3000\u3000\u25E2\u2584\u25E4\n \u3000\u3000\u2580\u2588\u2588\u2585\u2587\u2580\nVer 1.0.0\nhttps://lt.js.org ", "color:green;font-weight:bolder"); + let N = 2 * Math.PI, + c = function(t, a) { + for (let r in a) t[r] = a[r]; + return t + }, + s = function(t, a, r) { + return (a - t) * r + t + }, + R = function(e, t) { + return (e % t + t) % t + }, + o = function() {}, + u = {}; + u.begin = function(t) { + t.beginPath() + }, u.move = function(t, a, r) { + t.moveTo(r.x, r.y) + }, u.line = function(t, a, r) { + t.lineTo(r.x, r.y) + }, u.bezier = function(r, o, d, e, t) { + r.bezierCurveTo(d.x, d.y, e.x, e.y, t.x, t.y) + }, u.closePath = function(t) { + t.closePath() + }, u.setPath = function() {}, u.renderPath = function(a, r, o, e) { + this.begin(a, r), o.forEach(function(t) { + t.render(a, r, u) + }), e && this.closePath(a, r) + }, u.stroke = function(r, o, d, e, t) { + d && (r.strokeStyle = e, r.lineWidth = t, r.stroke()) + }, u.fill = function(a, r, o, e) { + o && (a.fillStyle = e, a.fill()) + }, u.end = function() {}; + let k = function(t) { + this.set(t) + }; + k.prototype.set = function(t) { + return this.x = t && t.x || 0, this.y = t && t.y || 0, this.z = t && t.z || 0, this + }, k.prototype.write = function(t) { + return t ? (this.x = null == t.x ? this.x : t.x, this.y = null == t.y ? this.y : t.y, this.z = null == t.z ? this.z : t.z, this) : this + }, k.prototype.rotate = function(t) { + if (t) return this.rotateZ(t.z), this.rotateY(t.y), this.rotateX(t.x), this + }, k.prototype.rotateZ = function(t) { + j(this, t, "x", "y") + }, k.prototype.rotateX = function(t) { + j(this, t, "y", "z") + }, k.prototype.rotateY = function(t) { + j(this, t, "x", "z") + }; + let j = function(l, a, e, t) { + if (a && 0 != a % N) { + let r = Math.cos(a), + o = Math.sin(a), + d = l[e], + p = l[t]; + l[e] = d * r - p * o, l[t] = p * r + d * o + } + }; + k.prototype.isSame = function(t) { + return !!t && this.x === t.x && this.y === t.y && this.z === t.z + }, k.prototype.add = function(t) { + return t ? (this.x += t.x || 0, this.y += t.y || 0, this.z += t.z || 0, this) : this + }, k.prototype.subtract = function(t) { + return t ? (this.x -= t.x || 0, this.y -= t.y || 0, this.z -= t.z || 0, this) : this + }, k.prototype.multiply = function(t) { + return null == t ? this : ("number" == typeof t ? (this.x *= t, this.y *= t, this.z *= t) : (this.x *= null == t.x ? 1 : t.x, this.y *= null == t.y ? 1 : t.y, this.z *= null == t.z ? 1 : t.z), this) + }, k.prototype.transform = function(t, a, r) { + return this.multiply(r), this.rotate(a), this.add(t), this + }, k.prototype.lerp = function(e, t) { + return this.x = s(this.x, e.x || 0, t), this.y = s(this.y, e.y || 0, t), this.z = s(this.z, e.z || 0, t), this + }, k.prototype.magnitude = function() { + let t = this.x * this.x + this.y * this.y + this.z * this.z; + return r(t) + }; + let r = function(t) { + return 1e-8 > Math.abs(t - 1) ? 1 : Math.sqrt(t) + }; + k.prototype.magnitude2d = function() { + let t = this.x * this.x + this.y * this.y; + return r(t) + }, k.prototype.copy = function() { + return new k(this) + }; + let a = { + x: 1, + y: 1, + z: 1 + }, + d = function(t) { + this.create(t || {}) + }; + d.prototype.create = function(t) { + this.children = [], c(this, this.constructor.defaults), this.setOptions(t), this.translate = new k(t.translate), this.rotate = new k(t.rotate), this.scale = new k(a).multiply(this.scale), this.origin = new k, this.renderOrigin = new k, this.addTo && this.addTo.addChild(this) + }, d.defaults = {}, d.optionKeys = Object.keys(d.defaults).concat(["rotate", "translate", "scale", "addTo"]), d.prototype.setOptions = function(t) { + let a = this.constructor.optionKeys; + for (let r in t) - 1 != a.indexOf(r) && (this[r] = t[r]) + }, d.prototype.addChild = function(t) { + -1 != this.children.indexOf(t) || (t.remove(), t.addTo = this, this.children.push(t)) + }, d.prototype.removeChild = function(e) { + let t = this.children.indexOf(e); - 1 != t && this.children.splice(t, 1) + }, d.prototype.remove = function() { + this.addTo && this.addTo.removeChild(this) + }, d.prototype.update = function() { + this.reset(), this.children.forEach(function(t) { + t.update() + }), this.transform(this.translate, this.rotate, this.scale) + }, d.prototype.reset = function() { + this.renderOrigin.set(this.origin) + }, d.prototype.transform = function(a, r, o) { + this.renderOrigin.transform(a, r, o), this.children.forEach(function(e) { + e.transform(a, r, o) + }) + }, d.prototype.updateGraph = function() { + this.update(), this.updateFlatGraph(), this.flatGraph.forEach(function(t) { + t.updateSortValue() + }), this.flatGraph.sort(d.shapeSorter) + }, d.shapeSorter = function(e, t) { + return e.sortValue - t.sortValue + }, Object.defineProperty(d.prototype, "flatGraph", { + get: function() { + return this._flatGraph || this.updateFlatGraph(), this._flatGraph + }, + set: function(t) { + this._flatGraph = t + } + }), d.prototype.updateFlatGraph = function() { + this.flatGraph = this.getFlatGraph() + }, d.prototype.getFlatGraph = function() { + let t = [this]; + return this.addChildFlatGraph(t) + }, d.prototype.addChildFlatGraph = function(t) { + return this.children.forEach(function(a) { + let r = a.getFlatGraph(); + Array.prototype.push.apply(t, r) + }), t + }, d.prototype.updateSortValue = function() { + this.sortValue = this.renderOrigin.z + }, d.prototype.render = function() {}, d.prototype.renderGraphCanvas = function(e) { + if (!e) throw new Error("[Cube]\u672A\u63D0\u4F9B\u6E32\u67D3\u4E0A\u4E0B\u6587"); + this.flatGraph.forEach(function(t) { + t.render(e, u) + }) + }, d.prototype.copy = function(a) { + let r = {}, + o = this.constructor.optionKeys; + o.forEach(function(t) { + r[t] = this[t] + }, this), c(r, a); + let t = this.constructor; + return new t(r) + }, d.prototype.copyGraph = function(t) { + let r = this.copy(t); + return this.children.forEach(function(t) { + t.copyGraph({ + addTo: r + }) + }), r + }, d.prototype.normalizeRotate = function() { + this.rotate.x = R(this.rotate.x, N), this.rotate.y = R(this.rotate.y, N), this.rotate.z = R(this.rotate.z, N) + }; + let T = function(a) { + return function(r) { + let t = function(t) { + this.create(t || {}) + }; + return t.prototype = Object.create(a.prototype), t.prototype.constructor = t, t.defaults = c({}, a.defaults), c(t.defaults, r), t.optionKeys = a.optionKeys.slice(0), Object.keys(t.defaults).forEach(function(e) { + 1 != !t.optionKeys.indexOf(e) && t.optionKeys.push(e) + }), t.subclass = T(t), t + } + }; + d.subclass = T(d); + let e = "undefined" != typeof window, + t = "mousedown", + l = "mousemove", + q = "mouseup"; + e && (window.PointerEvent ? (t = "pointerdown", l = "pointermove", q = "pointerup") : "ontouchstart" in window && (t = "touchstart", l = "touchmove", q = "touchend")); + let G = function(t) { + this.create(t || {}) + }; + G.prototype.create = function(e) { + this.onDragStart = e.onDragStart || o, this.onDragMove = e.onDragMove || o, this.onDragEnd = e.onDragEnd || o, this.bindDrag(e.startElement) + }, G.prototype.bindDrag = function(a) { + a = this.getQueryElement(a), a && (a.style.touchAction = "none", a.addEventListener(t, this)) + }, G.prototype.getQueryElement = function(t) { + return "string" == typeof t && (t = document.querySelector(t)), t + }, G.prototype.handleEvent = function(e) { + let t = this["on" + e.type]; + t && t.call(this, e) + }, G.prototype.onmousedown = G.prototype.onpointerdown = function(t) { + this.dragStart(t, t) + }, G.prototype.ontouchstart = function(t) { + this.dragStart(t, t.changedTouches[0]) + }, G.prototype.dragStart = function(t, r) { + t.preventDefault(), this.dragStartX = r.pageX, this.dragStartY = r.pageY, e && (window.addEventListener(l, this), window.addEventListener(q, this)), this.onDragStart(r) + }, G.prototype.ontouchmove = function(t) { + this.dragMove(t, t.changedTouches[0]) + }, G.prototype.onmousemove = G.prototype.onpointermove = function(t) { + this.dragMove(t, t) + }, G.prototype.dragMove = function(a, r) { + a.preventDefault(); + let o = r.pageX - this.dragStartX, + e = r.pageY - this.dragStartY; + this.onDragMove(r, o, e) + }, G.prototype.onmouseup = G.prototype.onpointerup = G.prototype.ontouchend = G.prototype.dragEnd = function() { + window.removeEventListener(l, this), window.removeEventListener(q, this), this.onDragEnd() + }; + let w = d.subclass({ + element: void 0, + centered: !0, + zoom: 1, + dragRotate: !1, + resize: !1, + onPrerender: o, + onDragStart: o, + onDragMove: o, + onDragEnd: o, + onResize: o + }); + c(w.prototype, G.prototype), w.prototype.create = function(t) { + d.prototype.create.call(this, t), G.prototype.create.call(this, t), this.setElement(this.element), this.setDragRotate(this.dragRotate), this.setResize(this.resize) + }, w.prototype.setElement = function(t) { + if (t = this.element, !t) throw new Error("[Cube]\u672A\u6307\u5B9A\u5143\u7D20"); + this.setCanvas(t) + }, w.prototype.setSize = function(a, r) { + a = Math.round(a), r = Math.round(r), this.setSizeCanvas(a, r) + }, w.prototype.setResize = function(t) { + this.resize = t, this.resizeListener || (this.resizeListener = this.onWindowResize.bind(this)), t ? (window.addEventListener("resize", this.resizeListener), this.onWindowResize()) : window.removeEventListener("resize", this.resizeListener) + }, w.prototype.onWindowResize = function() { + this.setMeasuredSize(), this.onResize(this.width, this.height) + }, w.prototype.setMeasuredSize = function() { + let o, d, r = "fullscreen" == this.resize; + if (r) o = window.innerWidth, d = window.innerHeight; + else { + let e = this.element.getBoundingClientRect(); + o = e.width, d = e.height + } + this.setSize(o, d) + }, w.prototype.renderGraph = function(t) { + this.renderGraphCanvas(t) + }, w.prototype.updateRenderGraph = function(t) { + this.updateGraph(), this.renderGraph(t) + }, w.prototype.setCanvas = function(t) { + this.element = t, this.ctx = this.element.getContext("2d"), this.setSizeCanvas(t.width, t.height) + }, w.prototype.setSizeCanvas = function(a, r) { + this.width = a, this.height = r; + let o = this.pixelRatio = window.devicePixelRatio || 1; + this.element.width = this.canvasWidth = a * o, this.element.height = this.canvasHeight = r * o; + let e = 1 < o && !this.resize; + e && (this.element.style.width = a + "px", this.element.style.height = r + "px") + }, w.prototype.renderGraphCanvas = function(t) { + t = t || this, this.prerenderCanvas(), d.prototype.renderGraphCanvas.call(t, this.ctx), this.postrenderCanvas() + }, w.prototype.prerenderCanvas = function() { + let o = this.ctx; + if (o.lineCap = "round", o.lineJoin = "round", o.clearRect(0, 0, this.canvasWidth, this.canvasHeight), o.save(), this.centered) { + let t = this.width / 2 * this.pixelRatio, + a = this.height / 2 * this.pixelRatio; + o.translate(t, a) + } + let e = this.pixelRatio * this.zoom; + o.scale(e, e), this.onPrerender(o) + }, w.prototype.postrenderCanvas = function() { + this.ctx.restore() + }, w.prototype.setDragRotate = function(t) { + t && (!0 === t && (t = this), this.dragRotate = t, this.bindDrag(this.element)) + }, w.prototype.dragStart = function() { + this.dragStartRX = this.dragRotate.rotate.x, this.dragStartRY = this.dragRotate.rotate.y, G.prototype.dragStart.apply(this, arguments) + }, w.prototype.dragMove = function(o, d) { + let e = d.pageX - this.dragStartX, + t = d.pageY - this.dragStartY, + a = Math.min(this.width, this.height); + this.dragRotate.rotate.x = this.dragStartRX - t / a * N, this.dragRotate.rotate.y = this.dragStartRY - e / a * N, G.prototype.dragMove.apply(this, arguments) + }; + let D = function(t, a, r) { + this.method = t, this.points = a.map(M), this.renderPoints = a.map(V), this.previousPoint = r, this.endRenderPoint = this.renderPoints[this.renderPoints.length - 1], "arc" == t && (this.controlPoints = [new k, new k]) + }, + M = function(t) { + return t instanceof k ? t : new k(t) + }, + V = function(t) { + return new k(t) + }; + D.prototype.reset = function() { + let a = this.points; + this.renderPoints.forEach(function(r, o) { + let e = a[o]; + r.set(e) + }) + }, D.prototype.transform = function(a, r, o) { + this.renderPoints.forEach(function(e) { + e.transform(a, r, o) + }) + }, D.prototype.render = function(t, a, r) { + return this[this.method](t, a, r) + }, D.prototype.move = function(t, a, r) { + return r.move(t, a, this.renderPoints[0]) + }, D.prototype.line = function(t, a, r) { + return r.line(t, a, this.renderPoints[0]) + }, D.prototype.bezier = function(o, d, l) { + let e = this.renderPoints[0], + t = this.renderPoints[1], + a = this.renderPoints[2]; + return l.bezier(o, d, e, t, a) + }; + let E = 9 / 16; + D.prototype.arc = function(p, T, l) { + let e = this.previousPoint, + t = this.renderPoints[0], + a = this.renderPoints[1], + r = this.controlPoints[0], + o = this.controlPoints[1]; + return r.set(e).lerp(t, E), o.set(a).lerp(t, E), l.bezier(p, T, r, o, a) + }; + let m = d.subclass({ + stroke: 1, + fill: !1, + color: "#333", + closed: !0, + visible: !0, + path: [{}], + front: { + z: 1 + }, + backface: !0 + }); + m.prototype.create = function(t) { + d.prototype.create.call(this, t), this.updatePath(), this.front = new k(t.front || this.front), this.renderFront = new k(this.front), this.renderNormal = new k + }; + let y = ["move", "line", "bezier", "arc"]; + m.prototype.updatePath = function() { + this.setPath(), this.updatePathCommands() + }, m.prototype.setPath = function() {}, m.prototype.updatePathCommands = function() { + let r; + this.pathCommands = this.path.map(function(o, d) { + let e = Object.keys(o), + t = e[0], + l = o[t], + c = 1 == e.length && -1 != y.indexOf(t); + c || (t = "line", l = o); + let i = "line" == t || "move" == t, + s = Array.isArray(l); + i && !s && (l = [l]), t = 0 === d ? "move" : t; + let p = new D(t, l, r); + return r = p.endRenderPoint, p + }) + }, m.prototype.reset = function() { + this.renderOrigin.set(this.origin), this.renderFront.set(this.front), this.pathCommands.forEach(function(t) { + t.reset() + }) + }, m.prototype.transform = function(a, r, o) { + this.renderOrigin.transform(a, r, o), this.renderFront.transform(a, r, o), this.renderNormal.set(this.renderOrigin).subtract(this.renderFront), this.pathCommands.forEach(function(e) { + e.transform(a, r, o) + }), this.children.forEach(function(e) { + e.transform(a, r, o) + }) + }, m.prototype.updateSortValue = function() { + let r = this.pathCommands.length, + d = this.pathCommands[0].endRenderPoint, + e = this.pathCommands[r - 1].endRenderPoint, + l = 2 < r && d.isSame(e); + l && (r -= 1); + let T = 0; + for (let e = 0; e < r; e++) T += this.pathCommands[e].endRenderPoint.z; + this.sortValue = T / r + }, m.prototype.render = function(t, a) { + let r = this.pathCommands.length; + if (this.visible && r && (this.isFacingBack = 0 < this.renderNormal.z, this.backface || !this.isFacingBack)) { + if (!a) throw new Error("[Cube]\u672A\u63D0\u4F9B\u6E32\u67D3\u5668"); + a.isCanvas && 1 == r ? this.renderCanvasDot(t, a) : this.renderPath(t, a) + } + }, m.prototype.renderCanvasDot = function(a) { + let r = this.getLineWidth(); + if (r) { + a.fillStyle = this.getRenderColor(); + let e = this.pathCommands[0].endRenderPoint; + a.beginPath(), a.arc(e.x, e.y, r / 2, 0, N), a.fill() + } + }, m.prototype.getLineWidth = function() { + return this.stroke ? !0 == this.stroke ? 1 : this.stroke : 0 + }, m.prototype.getRenderColor = function() { + let e = "string" == typeof this.backface && this.isFacingBack, + t = e ? this.backface : this.color; + return t + }, m.prototype.renderPath = function(o, d) { + let l, e = 2 == this.pathCommands.length && "line" == this.pathCommands[1].method, + t = !e && this.closed, + a = this.getRenderColor(); + d.renderPath(o, l, this.pathCommands, t), d.stroke(o, l, this.stroke, a, this.getLineWidth()), d.fill(o, l, this.fill, a), d.end(o, l) + }; + let h = d.subclass({ + updateSort: !1, + visible: !0 + }); + h.prototype.updateSortValue = function() { + let e = 0; + this.flatGraph.forEach(function(t) { + t.updateSortValue(), e += t.sortValue + }), this.sortValue = e / this.flatGraph.length, this.updateSort && this.flatGraph.sort(d.shapeSorter) + }, h.prototype.render = function(t, a) { + this.visible && this.flatGraph.forEach(function(r) { + r.render(t, a) + }) + }, h.prototype.updateFlatGraph = function() { + this.flatGraph = this.addChildFlatGraph([]) + }, h.prototype.getFlatGraph = function() { + return [this] + }; + let U = m.subclass({ + width: 1, + height: 1 + }); + U.prototype.setPath = function() { + let e = this.width / 2, + t = this.height / 2; + this.path = [{ + x: -e, + y: -t + }, { + x: e, + y: -t + }, { + x: e, + y: t + }, { + x: -e, + y: t + }] + }; + let X = m.subclass({ + width: 1, + height: 1, + cornerRadius: .25, + closed: !1 + }); + X.prototype.setPath = function() { + let d = this.width / 2, + l = this.height / 2, + T = Math.min(d, l), + e = Math.min(this.cornerRadius, T), + t = d - e, + a = l - e, + r = [{ + x: t, + y: -l + }, { + arc: [{ + x: d, + y: -l + }, { + x: d, + y: -a + }] + }]; + a && r.push({ + x: d, + y: a + }), r.push({ + arc: [{ + x: d, + y: l + }, { + x: t, + y: l + }] + }), t && r.push({ + x: -t, + y: l + }), r.push({ + arc: [{ + x: -d, + y: l + }, { + x: -d, + y: a + }] + }), a && r.push({ + x: -d, + y: -a + }), r.push({ + arc: [{ + x: -d, + y: -l + }, { + x: -t, + y: -l + }] + }), t && r.push({ + x: t, + y: -l + }), this.path = r + }; + let z = m.subclass({ + diameter: 1, + width: void 0, + height: void 0, + quarters: 4, + closed: !1 + }); + z.prototype.setPath = function() { + let a = null == this.width ? this.diameter : this.width, + r = null == this.height ? this.diameter : this.height, + o = a / 2, + e = r / 2; + this.path = [{ + x: 0, + y: -e + }, { + arc: [{ + x: o, + y: -e + }, { + x: o, + y: 0 + }] + }], 1 < this.quarters && this.path.push({ + arc: [{ + x: o, + y: e + }, { + x: 0, + y: e + }] + }), 2 < this.quarters && this.path.push({ + arc: [{ + x: -o, + y: e + }, { + x: -o, + y: 0 + }] + }), 3 < this.quarters && this.path.push({ + arc: [{ + x: -o, + y: -e + }, { + x: 0, + y: -e + }] + }) + }; + let b = m.subclass({ + sides: 3, + radius: .5 + }); + b.prototype.setPath = function() { + this.path = []; + for (let r = 0; r < this.sides; r++) { + let o = r / this.sides * N - N / 4, + e = Math.cos(o) * this.radius, + t = Math.sin(o) * this.radius; + this.path.push({ + x: e, + y: t + }) + } + }; + let g = z.subclass({ + fill: !0 + }); + g.prototype.create = function() { + z.prototype.create.apply(this, arguments), this.apex = new d({ + addTo: this, + translate: { + z: this.diameter / 2 + } + }), this.renderCentroid = new k + }, g.prototype.updateSortValue = function() { + this.renderCentroid.set(this.renderOrigin).lerp(this.apex.renderOrigin, 3 / 8), this.sortValue = this.renderCentroid.z + }, g.prototype.render = function(e, t) { + this.renderDome(e, t), z.prototype.render.apply(this, arguments) + }, g.prototype.renderDome = function(d, l) { + if (this.visible) { + let T = this.getDomeRenderElement(d, l), + e = Math.atan2(this.renderNormal.y, this.renderNormal.x), + t = this.diameter / 2 * this.renderNormal.magnitude(), + a = this.renderOrigin.x, + r = this.renderOrigin.y; + l.stroke(d, T, this.stroke, this.color, this.getLineWidth()), l.fill(d, T, this.fill, this.color), l.end(d, T) + } + }; + let f = h.subclass({ + color: "#333", + updateSort: !0 + }); + f.prototype.create = function() { + h.prototype.create.apply(this, arguments), this.pathCommands = [new D("move", [{}]), new D("line", [{}])] + }, f.prototype.render = function(e, t) { + this.renderCylinderSurface(e, t), h.prototype.render.apply(this, arguments) + }, f.prototype.renderCylinderSurface = function(d, l) { + if (this.visible) { + let T, e = this.frontBase, + t = this.rearBase, + a = e.renderNormal.magnitude(), + r = e.diameter * a + e.getLineWidth(); + this.pathCommands[0].renderPoints[0].set(e.renderOrigin), this.pathCommands[1].renderPoints[0].set(t.renderOrigin), l.renderPath(d, T, this.pathCommands), l.stroke(d, T, !0, this.color, r), l.end(d, T) + } + }, f.prototype.copyGraph = o; + let x = z.subclass(); + x.prototype.copyGraph = o; + let F = m.subclass({ + diameter: 1, + length: 1, + frontFace: void 0, + fill: !0 + }); + F.prototype.create = function() { + m.prototype.create.apply(this, arguments), this.group = new f({ + addTo: this, + color: this.color, + visible: this.visible + }); + let t = this.length / 2, + a = this.backface || !0; + this.frontBase = this.group.frontBase = new z({ + addTo: this.group, + diameter: this.diameter, + translate: { + z: t + }, + rotate: { + y: N / 2 + }, + color: this.color, + stroke: this.stroke, + fill: this.fill, + backface: this.frontFace || a, + visible: this.visible + }), this.rearBase = this.group.rearBase = this.frontBase.copy({ + translate: { + z: -t + }, + rotate: { + y: 0 + }, + backface: a + }) + }, F.prototype.render = function() {}, ["stroke", "fill", "color", "visible"].forEach(function(t) { + let a = "_" + t; + Object.defineProperty(F.prototype, t, { + get: function() { + return this[a] + }, + set: function(r) { + this[a] = r, this.frontBase && (this.frontBase[t] = r, this.rearBase[t] = r, this.group[t] = r) + } + }) + }); + let O = z.subclass({ + length: 1, + fill: !0 + }); + O.prototype.create = function() { + z.prototype.create.apply(this, arguments), this.apex = new d({ + addTo: this, + translate: { + z: this.length + } + }), this.renderApex = new k, this.renderCentroid = new k, this.tangentA = new k, this.tangentB = new k, this.surfacePathCommands = [new D("move", [{}]), new D("line", [{}]), new D("line", [{}])] + }, O.prototype.updateSortValue = function() { + this.renderCentroid.set(this.renderOrigin).lerp(this.apex.renderOrigin, 1 / 3), this.sortValue = this.renderCentroid.z + }, O.prototype.render = function(e, t) { + this.renderConeSurface(e, t), z.prototype.render.apply(this, arguments) + }, O.prototype.renderConeSurface = function(l, T) { + if (this.visible) { + this.renderApex.set(this.apex.renderOrigin).subtract(this.renderOrigin); + let e = this.renderNormal.magnitude(), + n = this.renderApex.magnitude2d(), + t = this.renderNormal.magnitude2d(), + a = Math.acos(t / e), + i = Math.sin(a), + c = this.diameter / 2 * e; + if (c * i < n) { + let e = Math.atan2(this.renderNormal.y, this.renderNormal.x) + N / 2, + t = Math.acos(c / (n / i)), + a = this.tangentA, + r = this.tangentB; + a.x = Math.cos(t) * c * i, a.y = Math.sin(t) * c, r.set(this.tangentA), r.y *= -1, a.rotateZ(e), r.rotateZ(e), a.add(this.renderOrigin), r.add(this.renderOrigin), this.setSurfaceRenderPoint(0, a), this.setSurfaceRenderPoint(1, this.apex.renderOrigin), this.setSurfaceRenderPoint(2, r); + let o = this.getSurfaceRenderElement(l, T); + T.renderPath(l, o, this.surfacePathCommands), T.stroke(l, o, this.stroke, this.color, this.getLineWidth()), T.fill(l, o, this.fill, this.color), T.end(l, o) + } + } + }, O.prototype.setSurfaceRenderPoint = function(t, a) { + let r = this.surfacePathCommands[t].renderPoints[0]; + r.set(a) + }; + let W = U.subclass(); + W.prototype.copyGraph = function() {}; + let Z = ["frontFace", "rearFace", "leftFace", "rightFace", "topFace", "bottomFace"], + C = c({}, m.defaults); + delete C.path, Z.forEach(function(t) { + C[t] = !0 + }), c(C, { + width: 1, + height: 1, + depth: 1, + fill: !0 + }); + let J = d.subclass(C); + return J.prototype.create = function(t) { + d.prototype.create.call(this, t), this.updatePath(), this.fill = this.fill + }, J.prototype.updatePath = function() { + Z.forEach(function(t) { + this[t] = this[t] + }, this) + }, Z.forEach(function(t) { + let a = "_" + t; + Object.defineProperty(J.prototype, t, { + get: function() { + return this[a] + }, + set: function(r) { + this[a] = r, this.setFace(t, r) + } + }) + }), J.prototype.setFace = function(a, r) { + let o = a + "Rect", + e = this[o]; + if (!r) return void this.removeChild(e); + let l = this.getFaceOptions(a); + l.color = "string" == typeof r ? r : this.color, e ? e.setOptions(l) : e = this[o] = new W(l), e.updatePath(), this.addChild(e) + }, J.prototype.getFaceOptions = function(e) { + return { + frontFace: { + width: this.width, + height: this.height, + translate: { + z: this.depth / 2 + } + }, + rearFace: { + width: this.width, + height: this.height, + translate: { + z: -this.depth / 2 + }, + rotate: { + y: N / 2 + } + }, + leftFace: { + width: this.depth, + height: this.height, + translate: { + x: -this.width / 2 + }, + rotate: { + y: -N / 4 + } + }, + rightFace: { + width: this.depth, + height: this.height, + translate: { + x: this.width / 2 + }, + rotate: { + y: N / 4 + } + }, + topFace: { + width: this.width, + height: this.depth, + translate: { + y: -this.height / 2 + }, + rotate: { + x: -N / 4 + } + }, + bottomFace: { + width: this.width, + height: this.depth, + translate: { + y: this.height / 2 + }, + rotate: { + x: N / 4 + } + } + } [e] + }, ["color", "stroke", "fill", "backface", "front", "visible"].forEach(function(a) { + let e = "_" + a; + Object.defineProperty(J.prototype, a, { + get: function() { + return this[e] + }, + set: function(r) { + this[e] = r, Z.forEach(function(o) { + let d = this[o + "Rect"], + e = "string" == typeof this[o]; + d && !("color" == a && e) && (d[a] = r) + }, this) + } + }) + }), { + init: w, + custom: m, + rect: U, + roundedRect: X, + ellipse: z, + polygon: b, + hemisphere: g, + cylinder: F, + cone: O, + box: J + } + }(), (null === this.canvas() || null === this.cubeParent()) && console.error("[Cube]\u65E0\u6CD5\u5B9A\u4F4D\u5230\u821E\u53F0"), (() => { + if (null !== this.canvas() && null !== this.cubeParent()) { + let a = document.createElement("canvas"); + a.setAttribute("id", "Cube"), a.setAttribute("width", this.canvas().width), a.setAttribute("height", this.canvas().height); + let e = a.style; + e.position = "absolute", e.left = "0%", e.top = "0%", this.cubeParent().appendChild(a), this.cubeScene = new this.Cube.init({ + element: document.getElementById("Cube") + }), new MutationObserver(() => { + for (let e in a.setAttribute("width", this.canvas().width), a.setAttribute("height", this.canvas().height), this.cubeScene = new this.Cube.init({ + element: document.getElementById("Cube") + }), this.objectList) this.cubeScene.addChild(this.objectList[e]); + this.cubeScene.updateRenderGraph() + }).observe(this.canvas(), { + attributes: !0 + }) + } + })(), this._formatMessage = e.getFormatMessage({ + "zh-cn": { + "Cube.name": "LazyTong\u7684\u7ACB\u65B9\u4F53", + "Cube.createRect": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A\u77E9\u5F62\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u5BBD[width]\u9AD8[height]\u989C\u8272[color]\u5927\u5C0F[stroke]%", + "Cube.createRoundedRect": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A\u5706\u89D2\u77E9\u5F62\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u5BBD[width]\u9AD8[height]\u989C\u8272[color]\u8FB9\u89D2\u5F27\u5EA6[radius]\u5927\u5C0F[stroke]%", + "Cube.createCircle": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A\u5706\u5F62\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u989C\u8272[color]\u534A\u5F84[diameter]\u5B8C\u6574\u6027[quarters]", + "Cube.createEllipse": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A\u692D\u5706\u5F62\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u5BBD[width]\u9AD8[height]\u989C\u8272[color]\u5927\u5C0F[stroke]%", + "Cube.createPolygon": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A[sides]\u8FB9\u5F62\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u5BBD[width]\u9AD8[height]\u989C\u8272[color]\u8FB9\u89D2\u5F27\u5EA6[radius]\u5927\u5C0F[stroke]%", + "Cube.createHemisphere": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A\u534A\u5706\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u989C\u8272[color]\u5730\u9762\u989C\u8272[backface]\u534A\u5F84[diameter]\u5927\u5C0F[stroke]%", + "Cube.createCone": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A\u5706\u9525\u4F53\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u989C\u8272[color]\u5730\u9762\u989C\u8272[backface]\u957F\u5EA6[length]\u534A\u5F84[diameter]\u5927\u5C0F[stroke]%", + "Cube.createCylinder": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A\u5706\u67F1\u4F53\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u989C\u8272[color]\u9876\u90E8\u989C\u8272[frontface]\u5730\u9762\u989C\u8272[backface]\u957F\u5EA6[length]\u5927\u5C0F[stroke]%", + "Cube.createBox": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A\u7ACB\u65B9\u4F53\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u5BBD[width]\u9AD8[height]\u5C3A\u5BF8[depth]\u989C\u8272[color]\u5DE6\u4FA7\u989C\u8272[leftface]\u53F3\u4FA7\u989C\u8272[rightface]\u9876\u90E8\u989C\u8272[topface]\u5730\u9762\u989C\u8272[bottomface]\u5927\u5C0F[stroke]%", + "Cube.createCustom": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A\u81EA\u5B9A\u4E49\u6A21\u578B\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u989C\u8272[color]\u8282\u70B9\u4F4D\u7F6E[path]\u8282\u70B9\u5927\u5C0F[stroke]%", + "Cube.deleteObject": "\u5220\u9664\u7269\u4F53[id]", + "Cube.getAttrib": "\u7269\u4F53[id]\u7684[type]", + "Cube.deleteAllObject": "\u5220\u9664\u6240\u6709\u7269\u4F53", + "Cube.getObjectNumbers": "\u7269\u4F53\u603B\u6570", + "Cube.getObjectList": "\u7269\u4F53ID\u5217\u8868", + "Cube.x": "X", + "Cube.y": "Y", + "Cube.z": "Z", + "Cube.width": "\u5BBD\u5EA6", + "Cube.height": "\u9AD8\u5EA6", + "Cube.color": "\u989C\u8272", + "Cube.stroke": "\u5927\u5C0F", + "Cube.quarters": "\u5B8C\u6574\u6027", + "Cube.cornerRadius": "\u8FB9\u89D2\u5F27\u5EA6", + "Cube.radius": "\u5F27\u5EA6", + "Cube.setRotate": "\u8BBE\u7F6E\u7269\u4F53[id]\u5728[type]\u4E0A\u65CB\u8F6C[rotate]\u5EA6", + "Cube.updateRender": "\u6E32\u67D3\u5F53\u524D\u8BBE\u7F6E\u7684\u7269\u4F53", + "Cube.docs": "\u62D3\u5C55\u6559\u7A0B", + "Cube.create": "\u521B\u5EFA\u7269\u4F53", + "Cube.modify": "\u4FEE\u6539\u7269\u4F53", + "Cube.info": "\u4FE1\u606F" + }, + en: { + "Cube.name": "LazyTong's Cube", + "Cube.createRect": "Create or Modify a Rectangle named[id], X[x]Y[y]Z[z] Width[width] Height[height] Color[color] Stroke[stroke]%", + "Cube.createRoundedRect": "Create or Modify a Rounded Rectangle named [id], X[x]Y[y]Z[z] Width[width] Height[height] Color[color] Corner Radius[radius] Stroke[stroke]%", + "Cube.createCircle": "Create or Modify a Circle named[id], X[x]Y[y]Z[z] Color[color] Diameter[diameter] Quarters[quarters]", + "Cube.createEllipse": "Create or Modify an Ellipse named[id], X[x]Y[y]Z[z] Width[width] Height[height] Color[color] Stroke[stroke]%", + "Cube.createPolygon": "Create or Modify a [sides] Polygon named [id], X[x]Y[y]Z[z] Width[width] Height[height] Color[color] Corner Radius[radius] Stroke[stroke]%", + "Cube.createHemisphere": "Create or Modify a Hemisphere named [id], X[x]Y[y]Z[z] Color[color] Backface Color[backface] Diameter[diameter] Stroke[stroke]%", + "Cube.createCone": "Create or Modify a Cone named[id], X[x]Y[y]Z[z] Color[color] Backface Color[backface] Length[length] Diameter[diameter] Stroke[stroke]%", + "Cube.createCylinder": "Create or Modify a Cylinder named[id], X[x]Y[y]Z[z] Color[color] Frontface Color[frontface] Backface Color[backface] Length[length] Stroke[stroke]%", + "Cube.createBox": "Create or Modify a Box named[id], X[x]Y[y]Z[z] Width[width] Height[height] Depth[depth] Color[color] Leftface Color[leftface] Rightface Color[rightface] Topface Color[topface] Bottomface Color[bottomface] Stroke[stroke]%", + "Cube.createCustom": "Create or Modify a Custom Model named[id], X[x]Y[y]Z[z] Color[color] Path[path] Stroke[stroke]%", + "Cube.deleteObject": "Delete Object[id]", + "Cube.getAttrib": "Get[type] of Object[id]", + "Cube.deleteAllObject": "Delete All Objects", + "Cube.getObjectNumbers": "Number of Objects", + "Cube.getObjectList": "List of Object IDs", + "Cube.x": "X", + "Cube.y": "Y", + "Cube.z": "Z", + "Cube.width": "width", + "Cube.height": "height", + "Cube.color": "color", + "Cube.stroke": "stroke", + "Cube.quarters": "quarters", + "Cube.cornerRadius": "corner radius", + "Cube.radius": "radius", + "Cube.setRotate": "Set the object[id]to rotate[rotate]degrees on[type]", + "Cube.updateRender": "Update Render with Current Object Settings", + "Cube.docs": "Extended Tutorial", + "Cube.create": "Creating objects", + "Cube.modify": "Modifying objects", + "Cube.info": "Information" + } + }) + } + formatMessage(e) { + return this._formatMessage({ + id: e, + default: e, + description: e + }) + } + getInfo() { + return { + id: "LazyTong.Cube", + name: this.formatMessage("Cube.name"), + blockIconURI: t, + menuIconURI: t, + color1: "#33cc33", + color2: "#669900", + blocks: [{ + blockType: "button", + text: this.formatMessage("Cube.docs"), + onClick: this.docs + }, `---${this.formatMessage("Cube.create")}`, { + opcode: "createRect", + blockType: "command", + text: this.formatMessage("Cube.createRect"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + width: { + type: "number", + defaultValue: "100" + }, + height: { + type: "number", + defaultValue: "20" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, { + opcode: "createRoundedRect", + blockType: "command", + text: this.formatMessage("Cube.createRoundedRect"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + width: { + type: "number", + defaultValue: "100" + }, + height: { + type: "number", + defaultValue: "20" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + radius: { + type: "number", + defaultValue: "1" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, { + opcode: "createCircle", + blockType: "command", + text: this.formatMessage("Cube.createCircle"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + diameter: { + type: "number", + defaultValue: "50" + }, + quarters: { + type: "number", + defaultValue: "4" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, { + opcode: "createEllipse", + blockType: "command", + text: this.formatMessage("Cube.createEllipse"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + width: { + type: "number", + defaultValue: "100" + }, + height: { + type: "number", + defaultValue: "20" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, { + opcode: "createPolygon", + blockType: "command", + text: this.formatMessage("Cube.createPolygon"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + width: { + type: "number", + defaultValue: "100" + }, + height: { + type: "number", + defaultValue: "20" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + sides: { + type: "number", + defaultValue: "3" + }, + radius: { + type: "number", + defaultValue: "1" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, { + opcode: "createHemisphere", + blockType: "command", + text: this.formatMessage("Cube.createHemisphere"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + diameter: { + type: "number", + defaultValue: "50" + }, + backface: { + type: "string", + defaultValue: "#33cc33" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, { + opcode: "createCone", + blockType: "command", + text: this.formatMessage("Cube.createCone"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + length: { + type: "number", + defaultValue: "50" + }, + diameter: { + type: "number", + defaultValue: "50" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + backface: { + type: "color", + defaultValue: "#33cc33" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, { + opcode: "createCylinder", + blockType: "command", + text: this.formatMessage("Cube.createCylinder"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + length: { + type: "number", + defaultValue: "50" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + frontface: { + type: "color", + defaultValue: "#33cc33" + }, + backface: { + type: "color", + defaultValue: "#33cc33" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, { + opcode: "createBox", + blockType: "command", + text: this.formatMessage("Cube.createBox"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + width: { + type: "number", + defaultValue: "100" + }, + height: { + type: "number", + defaultValue: "20" + }, + depth: { + type: "number", + defaultValue: "50" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + leftface: { + type: "color", + defaultValue: "#33cc33" + }, + rightface: { + type: "color", + defaultValue: "#33cc33" + }, + topface: { + type: "color", + defaultValue: "#33cc33" + }, + bottomface: { + type: "color", + defaultValue: "#33cc33" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, { + opcode: "createCustom", + blockType: "command", + text: this.formatMessage("Cube.createCustom"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + path: { + type: "string", + defaultValue: "{}" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, `---${this.formatMessage("Cube.modify")}`, { + opcode: "deleteObject", + blockType: "command", + text: this.formatMessage("Cube.deleteObject"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + } + } + }, { + opcode: "deleteAllObject", + blockType: "command", + text: this.formatMessage("Cube.deleteAllObject"), + arguments: {} + }, { + opcode: "setRotate", + blockType: "command", + text: this.formatMessage("Cube.setRotate"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + type: { + type: "string", + menu: "rotate" + }, + rotate: { + type: "number", + defaultValue: "10" + } + } + }, { + opcode: "updateRender", + blockType: "command", + text: this.formatMessage("Cube.updateRender"), + arguments: {} + }, `---${this.formatMessage("Cube.info")}`, { + opcode: "getAttrib", + blockType: "reporter", + text: this.formatMessage("Cube.getAttrib"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + type: { + type: "string", + menu: "attrib" + } + } + }, { + opcode: "getObjectList", + blockType: "reporter", + text: this.formatMessage("Cube.getObjectList"), + arguments: {} + }, { + opcode: "getObjectNumbers", + blockType: "reporter", + text: this.formatMessage("Cube.getObjectNumbers"), + arguments: {} + }], + menus: { + attrib: [{ + text: this.formatMessage("Cube.x"), + value: "x" + }, { + text: this.formatMessage("Cube.y"), + value: "y" + }, { + text: this.formatMessage("Cube.z"), + value: "z" + }, { + text: this.formatMessage("Cube.width"), + value: "width" + }, { + text: this.formatMessage("Cube.height"), + value: "height" + }, { + text: this.formatMessage("Cube.stroke"), + value: "stroke" + }, { + text: this.formatMessage("Cube.color"), + value: "color" + }, { + text: this.formatMessage("Cube.quarters"), + value: "quarters" + }, { + text: this.formatMessage("Cube.cornerRadius"), + value: "cornerRadius" + }, { + text: this.formatMessage("Cube.radius"), + value: "radius" + }], + rotate: [{ + text: this.formatMessage("Cube.x"), + value: "x" + }, { + text: this.formatMessage("Cube.y"), + value: "y" + }, { + text: this.formatMessage("Cube.z"), + value: "z" + }] + } + } + } + docs() { + let e = document.createElement("a"); + e.href = "https://lt.js.org/posts/20240718", e.rel = "noopener noreferrer", e.target = "_blank", e.click() + } + createRect(e) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.rect({ + width: +e.width, + height: +e.height, + stroke: +e.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +e.x, + y: +e.y, + z: +e.z + } + }), this.cubeScene.addChild(this.objectList[e.id])) + } + createRoundedRect(e) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.roundedRect({ + width: +e.width, + height: +e.height, + stroke: +e.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + cornerRadius: +e.radius, + translate: { + x: +e.x, + y: +e.y, + z: +e.z + } + }), this.cubeScene.addChild(this.objectList[e.id])) + } + createCircle(e) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.ellipse({ + stroke: +e.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + diameter: +e.diameter, + translate: { + x: +e.x, + y: +e.y, + z: +e.z + }, + quarters: +e.quarters + }), this.cubeScene.addChild(this.objectList[e.id])) + } + createEllipse(e) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.ellipse({ + width: +e.width, + height: +e.height, + stroke: +e.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +e.x, + y: +e.y, + z: +e.z + }, + quarters: +e.quarters + }), this.cubeScene.addChild(this.objectList[e.id])) + } + createPolygon(e) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.polygon({ + sides: +e.sides, + radius: +e.sides, + stroke: +e.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +e.x, + y: +e.y, + z: +e.z + } + }), this.cubeScene.addChild(this.objectList[e.id])) + } + createHemisphere(e) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.hemisphere({ + diameter: +e.diameter, + stroke: +e.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + backface: (() => /^#([0-9a-f]{6})$/i.test(e.backface) ? e.backface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +e.x, + y: +e.y, + z: +e.z + } + }), this.cubeScene.addChild(this.objectList[e.id])) + } + createCone(e) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.cone({ + diameter: +e.diameter, + stroke: +e.stroke / 100, + length: +e.length, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + backface: (() => /^#([0-9a-f]{6})$/i.test(e.backface) ? e.backface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +e.x, + y: +e.y, + z: +e.z + } + }), this.cubeScene.addChild(this.objectList[e.id])) + } + createCylinder(e) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.cylinder({ + diameter: +e.diameter, + stroke: +e.stroke / 100, + length: +e.length, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + backface: (() => /^#([0-9a-f]{6})$/i.test(e.backface) ? e.backface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + frontFace: (() => /^#([0-9a-f]{6})$/i.test(e.frontface) ? e.frontface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +e.x, + y: +e.y, + z: +e.z + } + }), this.cubeScene.addChild(this.objectList[e.id])) + } + createBox(e) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.box({ + width: +e.width, + height: +e.height, + depth: +e.depth, + stroke: +e.stroke / 100, + length: +e.length, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + leftFace: (() => /^#([0-9a-f]{6})$/i.test(e.leftface) ? e.leftface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + rightFace: (() => /^#([0-9a-f]{6})$/i.test(e.rightface) ? e.rightface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + topFace: (() => /^#([0-9a-f]{6})$/i.test(e.topface) ? e.topface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + bottomFace: (() => /^#([0-9a-f]{6})$/i.test(e.bottomface) ? e.bottomface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +e.x, + y: +e.y, + z: +e.z + } + }), this.cubeScene.addChild(this.objectList[e.id])) + } + createCustom(e) { + null !== this.canvas() && null !== this.cubeParent() && "{}" !== e.path && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.custom({ + stroke: +e.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + path: JSON.parse(e.path), + translate: { + x: +e.x, + y: +e.y, + z: +e.z + } + }), this.cubeScene.addChild(this.objectList[e.id])) + } + deleteObject(e) { + null !== this.cubeParent() && void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0) + } + deleteAllObject() { + if (null !== this.cubeParent()) { + for (let e in this.objectList) this.cubeScene.removeChild(this.objectList[e]); + this.objectList = {} + } + } + getAttrib(e) { + if (void 0 !== typeof this.objectList[e.id]) switch (e.type) { + case "x": + return "undefined" == typeof this.objectList[e.id].translate.x ? "" : this.objectList[e.id].translate.x; + case "y": + return "undefined" == typeof this.objectList[e.id].translate.y ? "" : this.objectList[e.id].translate.y; + case "z": + return "undefined" == typeof this.objectList[e.id].translate.z ? "" : this.objectList[e.id].translate.z; + case "width": + return "undefined" == typeof this.objectList[e.id].width ? "" : this.objectList[e.id].width; + case "height": + return "undefined" == typeof this.objectList[e.id].height ? "" : this.objectList[e.id].height; + case "color": + return "undefined" == typeof this.objectList[e.id].color ? "" : this.objectList[e.id].color; + case "stroke": + return "undefined" == typeof this.objectList[e.id].stroke ? "" : this.objectList[e.id].stroke; + case "quarters": + return "undefined" == typeof this.objectList[e.id].quarters ? "" : this.objectList[e.id].quarters; + case "cornerRadius": + return "undefined" == typeof this.objectList[e.id].cornerRadius ? "" : this.objectList[e.id].cornerRadius; + case "radius": + return "undefined" == typeof this.objectList[e.id].radius ? "" : this.objectList[e.id].radius; + default: + return ""; + } + } + getObjectNumbers() { + return Object.keys(this.objectList).length + } + setRotate(e) { + if (void 0 !== typeof this.objectList[e.id]) switch (e.type) { + case "x": + this.objectList[e.id].rotate.x = +e.rotate * (Math.PI / 180); + break; + case "y": + this.objectList[e.id].rotate.y = +e.rotate * (Math.PI / 180); + break; + case "z": + this.objectList[e.id].rotate.z = +e.rotate * (Math.PI / 180); + default: + } + } + getObjectList() { + return Object.keys(this.objectList) + } + updateRender() { + this.cubeScene.updateRenderGraph() + } + }, + info: { + name: "Cube.name", + description: "Cube.description", + extensionId: "LazyTong.Cube", + iconURL: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDYwMCAzNzIiIHdpZHRoPSI2MDAiIGhlaWdodD0iMzcyIiBmaWxsPSJ3aGl0ZSI+PGltYWdlIHdpZHRoPSIyNDAwIiBoZWlnaHQ9IjgwMCIgdHJhbnNmb3JtPSJtYXRyaXgoLjM2MiwwLDAsLjM2MiwtMTM1LDgyKSIgaHJlZj0iZGF0YTppbWFnZS9zdmcreG1sO2Jhc2U2NCxQSE4yWnlCNGJXeHVjejBpYUhSMGNEb3ZMM2QzZHk1M015NXZjbWN2TWpBd01DOXpkbWNpSUhabGNuTnBiMjQ5SWpFdU1TSWdlRzFzYm5NNmVHeHBibXM5SW1oMGRIQTZMeTkzZDNjdWR6TXViM0puTHpFNU9Ua3ZlR3hwYm1zaUlIaHRiRzV6T25OMloycHpQU0pvZEhSd09pOHZjM1puYW5NdVpHVjJMM04yWjJweklpQjJhV1YzUW05NFBTSXdJREFnTWp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FeE15dzRPUzQyTWpVc01UUTJOaTQyTmpZMk5qWTJOalkyTmpZM0xEazBRekUxTWpJdU1qSXlNakl5TWpJeU1qSXlNaXc1T0M0ek56VXNNVFUwTkM0ME5EUTBORFEwTkRRME5EUXpMREUyTGpnM05Td3hOakF3TERFd1F6RTJOVFV1TlRVMU5UVTFOVFUxTlRVMU55d3pMakV5TlN3eE5qYzNMamMzTnpjM056YzNOemMzTnpnc05qSXVNRFF4TmpZMk5qWTJOalkyTmpZMExERTNNek11TXpNek16TXpNek16TXpNek5TdzJNVU14TnpnNExqZzRPRGc0T0RnNE9EZzRPVEVzTlRrdU9UVTRNek16TXpNek16TXpNek0yTERFNE1URXVNVEV4TVRFeE1URXhNVEV4TERFdU5qWTJOalkyTmpZMk5qWTJOalkzTERFNE5qWXVOalkyTmpZMk5qWTJOalkyTnl3MVF6RTVNakl1TWpJeU1qSXlNakl5TWpJeU5DdzRMak16TXpNek16TXpNek16TXpNek1pd3hPVFEwTGpRME5EUTBORFEwTkRRME5EWXNOell1TVRZMk5qWTJOalkyTmpZMk5qY3NNakF3TUM0d01EQXdNREF3TURBd01EQXlMRGMzUXpJd05UVXVOVFUxTlRVMU5UVTFOVFUxTnl3M055NDRNek16TXpNek16TXpNek16TXl3eU1EYzNMamMzTnpjM056YzNOemMzT0N3eExqVXNNakV6TXk0ek16TXpNek16TXpNek16TTFMRGxETWpFNE9DNDRPRGc0T0RnNE9EZzRPRGtzTVRZdU5Td3lNakV4TGpFeE1URXhNVEV4TVRFeE1UTXNNVEV6TGpnek16TXpNek16TXpNek16TXpMREl5TmpZdU5qWTJOalkyTmpZMk5qWTNMREV4TTBNeU16SXlMakl5TWpJeU1qSXlNakl5TWpZc01URXlMakUyTmpZMk5qWTJOalkyTmpZM0xESXpNakF1TVRNNE9EZzRPRGc0T0RnNUxDMDFOQzQzT1RFMk5qWTJOalkyTmpZMk55d3lOREF3TERWRE1qUTNPUzQ0TmpFeE1URXhNVEV4TVRFc05qUXVOemt4TmpZMk5qWTJOalkyTmpjc016STFOQzR4TmpZMk5qWTJOalkyTmpZMUxESXhNeTQxTkRFMk5qWTJOalkyTmpZMk9Td3lOalV3TERRd01FTXlNRFExTGpnek16TXpNek16TXpNek16VXNOVGcyTGpRMU9ETXpNek16TXpNek16TXNNVFUyTGpJMUxEYzVOUzQ0TXpNek16TXpNek16TXpNMExDMDFNREFzT1RBd0lpQjBjbUZ1YzJadmNtMDlJbTFoZEhKcGVDZ3hMREFzTUN3eExEQXNNVEl3S1NJZ2IzQmhZMmwwZVQwaU1DNHdOU0krUEM5d1lYUm9Qanh3WVhSb0lHUTlJazB0TVRBc01UQkRNVGt1T0RZeE1URXhNVEV4TVRFeE1URXNNalF1TnpreE5qWTJOalkyTmpZMk5qWTRMRGMxTGpZNU5EUTBORFEwTkRRME5EUTJMRGszTGpnM05Td3hNek11TXpNek16TXpNek16TXpNek16UXNPREZETVRrd0xqazNNakl5TWpJeU1qSXlNakl6TERZMExqRXlOU3d5TVRFdU1URXhNVEV4TVRFeE1URXhNVFFzTFRVM0xqZzNOU3d5TmpZdU5qWTJOalkyTmpZMk5qWTJOeXd0TnpGRE16SXlMakl5TWpJeU1qSXlNakl5TWpJekxDMDROQzR4TWpVc016UTBMalEwTkRRME5EUTBORFEwTkRRMkxEVXVOekE0TXpNek16TXpNek16TXpNeUxEUXdNQ3d4T0VNME5UVXVOVFUxTlRVMU5UVTFOVFUxTlRRc016QXVNamt4TmpZMk5qWTJOalkyTmpZNExEUTNOeTQzTnpjM056YzNOemMzTnpjNExDMHhOaTR6TnpVc05UTXpMak16TXpNek16TXpNek16TXpRc0xURXlRelU0T0M0NE9EZzRPRGc0T0RnNE9EZzVMQzAzTGpZeU5TdzJNVEV1TVRFeE1URXhNVEV4TVRFeE1pdzBNUzR3T0RNek16TXpNek16TXpNek16WXNOalkyTGpZMk5qWTJOalkyTmpZMk5qY3NNemxETnpJeUxqSXlNakl5TWpJeU1qSXlNak1zTXpZdU9URTJOalkyTmpZMk5qWTJO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16TXpNek16TTJMREU0TVRFdU1URXhNVEV4TVRFeE1URXhMREV1TmpZMk5qWTJOalkyTmpZMk5qWTNMREU0TmpZdU5qWTJOalkyTmpZMk5qWTJOeXcxUXpFNU1qSXVNakl5TWpJeU1qSXlNakl5TkN3NExqTXpNek16TXpNek16TXpNek16TWl3eE9UUTBMalEwTkRRME5EUTBORFEwTkRZc056WXVNVFkyTmpZMk5qWTJOalkyTmpjc01qQXdNQzR3TURBd01EQXdNREF3TURBeUxEYzNRekl3TlRVdU5UVTFOVFUxTlRVMU5UVTFOeXczTnk0NE16TXpNek16TXpNek16TXpNeXd5TURjM0xqYzNOemMzTnpjM056YzNPQ3d4TGpVc01qRXpNeTR6TXpNek16TXpNek16TXpNMUxEbERNakU0T0M0NE9EZzRPRGc0T0RnNE9Ea3NNVFl1TlN3eU1qRXhMakV4TVRFeE1URXhNVEV4TVRNc01URXpMamd6TXpNek16TXpNek16TXpNekxESXlOall1TmpZMk5qWTJOalkyTmpZM0xERXhNME15TXpJeUxqSXlNakl5TWpJeU1qSXlNallzTVRFeUxqRTJOalkyTmpZMk5qWTJOalkzTERJek1qQXVNVE00T0RnNE9EZzRPRGc1TEMwMU5DNDNPVEUyTmpZMk5qWTJOalkyTnl3eU5EQXdMRFZETWpRM09TNDROakV4TVRFeE1URXhNVEVzTmpRdU56a3hOalkyTmpZMk5qWTJOamNzTXpJMU5DNHhOalkyTmpZMk5qWTJOalkxTERJeE15NDFOREUyTmpZMk5qWTJOalkyT1N3eU5qVXdMRFF3TUVNeU1EUTFMamd6TXpNek16TXpNek16TXpVc05UZzJMalExT0RNek16TXpNek16TXpNc01UVTJMakkxTERjNU5TNDRNek16TXpNek16TXpNek0wTEMwMU1EQXNPVEF3SWlCMGNtRnVjMlp2Y20wOUltMWhkSEpwZUNneExEQXNNQ3d4TERBc01qUXdLU0lnYjNCaFkybDBlVDBpTUM0ek55SStQQzl3WVhSb1BqeHdZWFJvSUdROUlrMHRNVEFzTVRCRE1Ua3VPRFl4TVRFeE1URXhNVEV4TVRFc01qUXVOemt4TmpZMk5qWTJOalkyTmpZNExEYzFMalk1TkRRME5EUTBORFEwTkRRMkxEazNMamczTlN3eE16TXVNek16TXpNek16TXpNek16TXpRc09ERkRNVGt3TGprM01qSXlNakl5TWpJeU1qSXpMRFkwTGpFeU5Td3lNVEV1TVRFeE1URXhNVEV4TVRFeE1UUXNMVFUzTGpnM05Td3lOall1TmpZMk5qWTJOalkyTmpZMk55d3ROekZETXpJeUxqSXlNakl5TWpJeU1qSXlNakl6TEMwNE5DNHhNalVzTXpRMExqUTBORFEwTkRRME5EUTBORFEyTERVdU56QTRNek16TXpNek16TXpNek15TERRd01Dd3hPRU0wTlRVdU5UVTFOVFUxTlRVMU5UVTFOVFFzTXpBdU1qa3hOalkyTmpZMk5qWTJOalk0TERRM055NDNOemMzTnpjM056YzNOemM0TEMweE5pNHpOelVzTlRNekxqTXpNek16TXpNek16TXpNelFzTFRFeVF6VTRPQzQ0T0RnNE9EZzRPRGc0T0RnNUxDMDNMall5TlN3Mk1URXVNVEV4TVRFeE1URXhNVEV4TWl3ME1TNHdPRE16TXpNek16TXpNek16TXpZc05qWTJMalkyTmpZMk5qWTJOalkyTmpjc016bEROekl5TGpJeU1qSXlNakl5TWpJeU1qTXNNell1T1RFMk5qWTJOalkyTmpZMk5qWTBMRGMwTkM0ME5EUTBORFEwTkRRME5EUTFMQzB5Tnl3NE1EQXNMVEl5UXpnMU5TNDFOVFUxTlRVMU5UVTFOVFUxTEMweE55dzROemN1TnpjM056YzNOemMzTnpjM09DdzJOQzQwTlRnek16TXpNek16TXpNek15dzVNek11TXpNek16TXpNek16TXpNek5DdzJNME01T0RndU9EZzRPRGc0T0RnNE9EZzRPU3cyTVM0MU5ERTJOalkyTmpZMk5qWTJOalFzTVRBeE1TNHhNVEV4TVRFeE1URXhNVEV5TEMwek1DNDJOalkyTmpZMk5qWTJOalkyTmpnc01UQTJOaTQyTmpZMk5qWTJOalkyTmpZM0xDMHlPVU14TVRJeUxqSXlNakl5TWpJeU1qSXlNaklzTFRJM0xqTXpNek16TXpNek16TXpNek16TWl3eE1UUTBMalEwTkRRME5EUTBORFEwTkRNc05qY3VNalVzTVRJd01DdzNNVU14TWpVMUxqVTFOVFUxTlRVMU5UVTFOVGNzTnpRdU56VXNNVEkzTnk0M056YzNOemMzTnpjM056YzRMQzB4TlM0M09URTJOalkyTmpZMk5qWTJOamdzTVRNek15NHpNek16TXpNek16TXpNek0xTEMweE1VTXhNemc0TGpnNE9EZzRPRGc0T0RnNE9URXNMVFl1TWpBNE16TXpNek16TXpNek16TXpMREUwTVRFdU1URXhNVEV4TVRFeE1URXhNeXc0T1M0Mk1qVXNNVFEyTmk0Mk5qWTJOalkyTmpZMk5qWTNMRGswUXpFMU1qSXVNakl5TWpJeU1qSXlNakl5TWl3NU9DNHpOelVzTVRVME5DNDBORFEwTkRRME5EUTBORFF6TERFMkxqZzNOU3d4TmpBd0xERXdRekUyTlRVdU5UVTFOVFUxTlRVMU5UVTFOeXd6TGpFeU5Td3hOamMzTGpjM056YzNOemMzTnpjM056Z3NOakl1TURReE5qWTJOalkyTmpZMk5qWTBMREUzTXpNdU16TXpNek16TXpNek16TXpOU3cyTVVNeE56ZzRMamc0T0RnNE9EZzRPRGc0T1RFc05Ua3VPVFU0TXpNek16TXpNek16TXpNMkxERTRNVEV1TVRFeE1URXhNVEV4TVRFeExERXVOalkyTmpZMk5qWTJOalkyTmpZM0xERTROall1TmpZMk5qWTJOalkyTmpZMk55dzFRekU1TWpJdU1qSXlNakl5TWpJeU1qSXlOQ3c0TGpNek16TXpNek16TXpNek16TXpNaXd4T1RRMExqUTBORFEwTkRRME5EUTBORFlzTnpZdU1UWTJOalkyTmpZMk5qWTJOamNzTWpBd01DNHdNREF3TURBd01EQXdNREF5TERjM1F6SXdOVFV1TlRVMU5UVTFOVFUxTlRVMU55dzNOeTQ0TXpNek16TXpNek16TXpNek15d3lNRGMzTGpjM056YzNOemMzTnpjM09Dd3hMalVzTWpF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VEV1TVRFeE1URXhNVEV4TVRFeE15dzRPUzQyTWpVc01UUTJOaTQyTmpZMk5qWTJOalkyTmpZM0xEazBRekUxTWpJdU1qSXlNakl5TWpJeU1qSXlNaXc1T0M0ek56VXNNVFUwTkM0ME5EUTBORFEwTkRRME5EUXpMREUyTGpnM05Td3hOakF3TERFd1F6RTJOVFV1TlRVMU5UVTFOVFUxTlRVMU55d3pMakV5TlN3eE5qYzNMamMzTnpjM056YzNOemMzTnpnc05qSXVNRFF4TmpZMk5qWTJOalkyTmpZMExERTNNek11TXpNek16TXpNek16TXpNek5TdzJNVU14TnpnNExqZzRPRGc0T0RnNE9EZzRPVEVzTlRrdU9UVTRNek16TXpNek16TXpNek0yTERFNE1URXVNVEV4TVRFeE1URXhNVEV4TERFdU5qWTJOalkyTmpZMk5qWTJOalkzTERFNE5qWXVOalkyTmpZMk5qWTJOalkyTnl3MVF6RTVNakl1TWpJeU1qSXlNakl5TWpJeU5DdzRMak16TXpNek16TXpNek16TXpNek1pd3hPVFEwTGpRME5EUTBORFEwTkRRME5EWXNOell1TVRZMk5qWTJOalkyTmpZMk5qY3NNakF3TUM0d01EQXdNREF3TURBd01EQXlMRGMzUXpJd05UVXVOVFUxTlRVMU5UVTFOVFUxTnl3M055NDRNek16TXpNek16TXpNek16TXl3eU1EYzNMamMzTnpjM056YzNOemMzT0N3eExqVXNNakV6TXk0ek16TXpNek16TXpNek16TTFMRGxETWpFNE9DNDRPRGc0T0RnNE9EZzRPRGtzTVRZdU5Td3lNakV4TGpFeE1URXhNVEV4TVRFeE1UTXNNVEV6TGpnek16TXpNek16TXpNek16TXpMREl5TmpZdU5qWTJOalkyTmpZMk5qWTNMREV4TTBNeU16SXlMakl5TWpJeU1qSXlNakl5TWpZc01URXlMakUyTmpZMk5qWTJOalkyTmpZM0xESXpNakF1TVRNNE9EZzRPRGc0T0RnNUxDMDFOQzQzT1RFMk5qWTJOalkyTmpZMk55d3lOREF3TERWRE1qUTNPUzQ0TmpFeE1URXhN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ZzBMamcwT0N3dE5USXVNamM1SUV3dE1DNDVORElzTFRFeUxqSTBNeUJNTFRBdU9UUXlMRGt6TGpJeE5TQk1PRFF1T0RRNExEVXpMakUzT1NCYUlpQm1hV3hzUFNJak16TTVPVEF3SWo0OEwzQmhkR2crUEM5emRtYysiLz48L3N2Zz4=", + insetIconURL: t, + featured: !0, + disabled: !1, + collaborator: "LazyTong @ Github", + doc: "https://lt.js.org/posts/20240718" + }, + l10n: { + "zh-cn": { + "Cube.name": "LazyTong\u7684\u7ACB\u65B9\u4F53", + "Cube.description": "\u6DFB\u52A0\u7ACB\u4F53\u56FE\u5F62\uFF01" + }, + en: { + "Cube.name": "LazyTong's Cube", + "Cube.description": "Create solid figure!" + } + } +}); From 373494e6eba94ef6ef8abf93a1fa5f28cab17086 Mon Sep 17 00:00:00 2001 From: LazyTong Date: Tue, 30 Jul 2024 18:18:24 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/LazyTong/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 extensions/LazyTong/README.md diff --git a/extensions/LazyTong/README.md b/extensions/LazyTong/README.md new file mode 100644 index 00000000..3a21bb77 --- /dev/null +++ b/extensions/LazyTong/README.md @@ -0,0 +1,3 @@ +这里是LazyTong的扩展仓库。存放了这些扩展: +- Cube.js:LazyTong的立方体 +- 等待更新… From c3c814b3c5d5763c3ae0084c313d06b938fc8964 Mon Sep 17 00:00:00 2001 From: LazyTong Date: Tue, 30 Jul 2024 20:28:12 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E7=A9=BF=E9=80=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/LazyTong/Cube.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/LazyTong/Cube.js b/extensions/LazyTong/Cube.js index 943026ad..a71468e8 100644 --- a/extensions/LazyTong/Cube.js +++ b/extensions/LazyTong/Cube.js @@ -833,7 +833,7 @@ void(window.tempExt = { let a = document.createElement("canvas"); a.setAttribute("id", "Cube"), a.setAttribute("width", this.canvas().width), a.setAttribute("height", this.canvas().height); let e = a.style; - e.position = "absolute", e.left = "0%", e.top = "0%", this.cubeParent().appendChild(a), this.cubeScene = new this.Cube.init({ + e.position = "absolute", e.left = "0%", e.top = "0%", e.pointerEvents = "none", this.cubeParent().appendChild(a), this.cubeScene = new this.Cube.init({ element: document.getElementById("Cube") }), new MutationObserver(() => { for (let e in a.setAttribute("width", this.canvas().width), a.setAttribute("height", this.canvas().height), this.cubeScene = new this.Cube.init({ @@ -1162,7 +1162,7 @@ void(window.tempExt = { defaultValue: "50" }, backface: { - type: "string", + type: "color", defaultValue: "#33cc33" }, color: { From 30c05b3319c25f58499e08344ddd2be422b7e337 Mon Sep 17 00:00:00 2001 From: LazyTong Date: Wed, 31 Jul 2024 17:45:59 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E6=96=87=E4=BB=B6=E7=9A=84=E6=94=AF=E6=8C=81=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=88=9E=E5=8F=B0=E5=A4=A7=E5=B0=8F=E7=BB=91?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/LazyTong/Cube.js | 1134 ++++++++++++++++++----------------- 1 file changed, 583 insertions(+), 551 deletions(-) diff --git a/extensions/LazyTong/Cube.js b/extensions/LazyTong/Cube.js index a71468e8..cd088e21 100644 --- a/extensions/LazyTong/Cube.js +++ b/extensions/LazyTong/Cube.js @@ -24,318 +24,318 @@ void(window.tempExt = { return null }, this.Cube = function() { console.log("%cLazyTong's Cube\n \u3000 \u3000\u2583\u2586\u2588\u2587\u2584\u2596\n\u3000 \u3000 \u3000 \u259F\u25E4\u2596\u3000\u3000\u3000\u25E5\u2588\u258E\n \u3000 \u25E2\u25E4\u3000 \u2590\u3000\u3000\u3000 \u3000\u2590\u2589\n\u3000 \u2597\u25E4\u3000\u3000\u3000\u2582\u3000\u2597\u2596\u3000\u3000\u2595\u2588\u258E\n\u3000\u25E4\u3000\u2597\u2585\u2596\u25E5\u2584\u3000\u2580\u25E3\u3000\u3000\u2588\u258A\n\u2590\u3000\u2595\u258E\u25E5\u2596\u25E3\u25E4\u3000\u3000\u3000\u3000\u25E2\u2588\u2588\n\u2588\u25E3\u3000\u25E5\u2585\u2588\u2580\u3000\u3000\u3000\u3000\u2590\u2588\u2588\u25E4\n\u2590\u2588\u2599\u2582\u3000\u3000 \u3000\u25E2\u2588\u2588\u25E4\n\u25E5\u2588\u2588\u25E3\u3000\u3000\u3000\u3000\u25E2\u2584\u25E4\n \u3000\u3000\u2580\u2588\u2588\u2585\u2587\u2580\nVer 1.0.0\nhttps://lt.js.org ", "color:green;font-weight:bolder"); - let N = 2 * Math.PI, - c = function(t, a) { - for (let r in a) t[r] = a[r]; - return t + let p = 2 * Math.PI, + n = function(e, t) { + for (let a in t) e[a] = t[a]; + return e }, - s = function(t, a, r) { - return (a - t) * r + t + i = function(e, t, a) { + return (t - e) * a + e }, - R = function(e, t) { - return (e % t + t) % t + c = function(a, e) { + return (a % e + e) % e }, - o = function() {}, - u = {}; - u.begin = function(t) { - t.beginPath() - }, u.move = function(t, a, r) { - t.moveTo(r.x, r.y) - }, u.line = function(t, a, r) { - t.lineTo(r.x, r.y) - }, u.bezier = function(r, o, d, e, t) { - r.bezierCurveTo(d.x, d.y, e.x, e.y, t.x, t.y) - }, u.closePath = function(t) { - t.closePath() - }, u.setPath = function() {}, u.renderPath = function(a, r, o, e) { - this.begin(a, r), o.forEach(function(t) { - t.render(a, r, u) - }), e && this.closePath(a, r) - }, u.stroke = function(r, o, d, e, t) { - d && (r.strokeStyle = e, r.lineWidth = t, r.stroke()) - }, u.fill = function(a, r, o, e) { - o && (a.fillStyle = e, a.fill()) - }, u.end = function() {}; - let k = function(t) { - this.set(t) + s = function() {}, + o = {}; + o.begin = function(e) { + e.beginPath() + }, o.move = function(e, t, a) { + e.moveTo(a.x, a.y) + }, o.line = function(e, t, a) { + e.lineTo(a.x, a.y) + }, o.bezier = function(a, r, o, d, e) { + a.bezierCurveTo(o.x, o.y, d.x, d.y, e.x, e.y) + }, o.closePath = function(e) { + e.closePath() + }, o.setPath = function() {}, o.renderPath = function(d, a, t, r) { + this.begin(d, a), t.forEach(function(e) { + e.render(d, a, o) + }), r && this.closePath(d, a) + }, o.stroke = function(a, r, o, d, e) { + o && (a.strokeStyle = d, a.lineWidth = e, a.stroke()) + }, o.fill = function(t, a, r, o) { + r && (t.fillStyle = o, t.fill()) + }, o.end = function() {}; + let N = function(e) { + this.set(e) }; - k.prototype.set = function(t) { - return this.x = t && t.x || 0, this.y = t && t.y || 0, this.z = t && t.z || 0, this - }, k.prototype.write = function(t) { - return t ? (this.x = null == t.x ? this.x : t.x, this.y = null == t.y ? this.y : t.y, this.z = null == t.z ? this.z : t.z, this) : this - }, k.prototype.rotate = function(t) { - if (t) return this.rotateZ(t.z), this.rotateY(t.y), this.rotateX(t.x), this - }, k.prototype.rotateZ = function(t) { - j(this, t, "x", "y") - }, k.prototype.rotateX = function(t) { - j(this, t, "y", "z") - }, k.prototype.rotateY = function(t) { - j(this, t, "x", "z") + N.prototype.set = function(e) { + return this.x = e && e.x || 0, this.y = e && e.y || 0, this.z = e && e.z || 0, this + }, N.prototype.write = function(e) { + return e ? (this.x = null == e.x ? this.x : e.x, this.y = null == e.y ? this.y : e.y, this.z = null == e.z ? this.z : e.z, this) : this + }, N.prototype.rotate = function(e) { + if (e) return this.rotateZ(e.z), this.rotateY(e.y), this.rotateX(e.x), this + }, N.prototype.rotateZ = function(e) { + R(this, e, "x", "y") + }, N.prototype.rotateX = function(e) { + R(this, e, "y", "z") + }, N.prototype.rotateY = function(e) { + R(this, e, "x", "z") }; - let j = function(l, a, e, t) { - if (a && 0 != a % N) { - let r = Math.cos(a), - o = Math.sin(a), - d = l[e], - p = l[t]; - l[e] = d * r - p * o, l[t] = p * r + d * o + let R = function(T, l, a, e) { + if (l && 0 != l % p) { + let t = Math.cos(l), + r = Math.sin(l), + o = T[a], + d = T[e]; + T[a] = o * t - d * r, T[e] = d * t + o * r } }; - k.prototype.isSame = function(t) { - return !!t && this.x === t.x && this.y === t.y && this.z === t.z - }, k.prototype.add = function(t) { - return t ? (this.x += t.x || 0, this.y += t.y || 0, this.z += t.z || 0, this) : this - }, k.prototype.subtract = function(t) { - return t ? (this.x -= t.x || 0, this.y -= t.y || 0, this.z -= t.z || 0, this) : this - }, k.prototype.multiply = function(t) { - return null == t ? this : ("number" == typeof t ? (this.x *= t, this.y *= t, this.z *= t) : (this.x *= null == t.x ? 1 : t.x, this.y *= null == t.y ? 1 : t.y, this.z *= null == t.z ? 1 : t.z), this) - }, k.prototype.transform = function(t, a, r) { - return this.multiply(r), this.rotate(a), this.add(t), this - }, k.prototype.lerp = function(e, t) { - return this.x = s(this.x, e.x || 0, t), this.y = s(this.y, e.y || 0, t), this.z = s(this.z, e.z || 0, t), this - }, k.prototype.magnitude = function() { - let t = this.x * this.x + this.y * this.y + this.z * this.z; - return r(t) + N.prototype.isSame = function(e) { + return !!e && this.x === e.x && this.y === e.y && this.z === e.z + }, N.prototype.add = function(e) { + return e ? (this.x += e.x || 0, this.y += e.y || 0, this.z += e.z || 0, this) : this + }, N.prototype.subtract = function(e) { + return e ? (this.x -= e.x || 0, this.y -= e.y || 0, this.z -= e.z || 0, this) : this + }, N.prototype.multiply = function(e) { + return null == e ? this : ("number" == typeof e ? (this.x *= e, this.y *= e, this.z *= e) : (this.x *= null == e.x ? 1 : e.x, this.y *= null == e.y ? 1 : e.y, this.z *= null == e.z ? 1 : e.z), this) + }, N.prototype.transform = function(e, t, a) { + return this.multiply(a), this.rotate(t), this.add(e), this + }, N.prototype.lerp = function(a, e) { + return this.x = i(this.x, a.x || 0, e), this.y = i(this.y, a.y || 0, e), this.z = i(this.z, a.z || 0, e), this + }, N.prototype.magnitude = function() { + let e = this.x * this.x + this.y * this.y + this.z * this.z; + return u(e) }; - let r = function(t) { - return 1e-8 > Math.abs(t - 1) ? 1 : Math.sqrt(t) + let u = function(e) { + return 1e-8 > Math.abs(e - 1) ? 1 : Math.sqrt(e) }; - k.prototype.magnitude2d = function() { - let t = this.x * this.x + this.y * this.y; - return r(t) - }, k.prototype.copy = function() { - return new k(this) + N.prototype.magnitude2d = function() { + let e = this.x * this.x + this.y * this.y; + return u(e) + }, N.prototype.copy = function() { + return new N(this) }; - let a = { + let r = { x: 1, y: 1, z: 1 }, - d = function(t) { - this.create(t || {}) + a = function(e) { + this.create(e || {}) }; - d.prototype.create = function(t) { - this.children = [], c(this, this.constructor.defaults), this.setOptions(t), this.translate = new k(t.translate), this.rotate = new k(t.rotate), this.scale = new k(a).multiply(this.scale), this.origin = new k, this.renderOrigin = new k, this.addTo && this.addTo.addChild(this) - }, d.defaults = {}, d.optionKeys = Object.keys(d.defaults).concat(["rotate", "translate", "scale", "addTo"]), d.prototype.setOptions = function(t) { - let a = this.constructor.optionKeys; - for (let r in t) - 1 != a.indexOf(r) && (this[r] = t[r]) - }, d.prototype.addChild = function(t) { - -1 != this.children.indexOf(t) || (t.remove(), t.addTo = this, this.children.push(t)) - }, d.prototype.removeChild = function(e) { - let t = this.children.indexOf(e); - 1 != t && this.children.splice(t, 1) - }, d.prototype.remove = function() { + a.prototype.create = function(e) { + this.children = [], n(this, this.constructor.defaults), this.setOptions(e), this.translate = new N(e.translate), this.rotate = new N(e.rotate), this.scale = new N(r).multiply(this.scale), this.origin = new N, this.renderOrigin = new N, this.addTo && this.addTo.addChild(this) + }, a.defaults = {}, a.optionKeys = Object.keys(a.defaults).concat(["rotate", "translate", "scale", "addTo"]), a.prototype.setOptions = function(e) { + let t = this.constructor.optionKeys; + for (let a in e) - 1 != t.indexOf(a) && (this[a] = e[a]) + }, a.prototype.addChild = function(e) { + -1 != this.children.indexOf(e) || (e.remove(), e.addTo = this, this.children.push(e)) + }, a.prototype.removeChild = function(a) { + let e = this.children.indexOf(a); - 1 != e && this.children.splice(e, 1) + }, a.prototype.remove = function() { this.addTo && this.addTo.removeChild(this) - }, d.prototype.update = function() { - this.reset(), this.children.forEach(function(t) { - t.update() + }, a.prototype.update = function() { + this.reset(), this.children.forEach(function(e) { + e.update() }), this.transform(this.translate, this.rotate, this.scale) - }, d.prototype.reset = function() { + }, a.prototype.reset = function() { this.renderOrigin.set(this.origin) - }, d.prototype.transform = function(a, r, o) { - this.renderOrigin.transform(a, r, o), this.children.forEach(function(e) { - e.transform(a, r, o) + }, a.prototype.transform = function(t, a, r) { + this.renderOrigin.transform(t, a, r), this.children.forEach(function(o) { + o.transform(t, a, r) }) - }, d.prototype.updateGraph = function() { - this.update(), this.updateFlatGraph(), this.flatGraph.forEach(function(t) { - t.updateSortValue() - }), this.flatGraph.sort(d.shapeSorter) - }, d.shapeSorter = function(e, t) { - return e.sortValue - t.sortValue - }, Object.defineProperty(d.prototype, "flatGraph", { + }, a.prototype.updateGraph = function() { + this.update(), this.updateFlatGraph(), this.flatGraph.forEach(function(e) { + e.updateSortValue() + }), this.flatGraph.sort(a.shapeSorter) + }, a.shapeSorter = function(a, e) { + return a.sortValue - e.sortValue + }, Object.defineProperty(a.prototype, "flatGraph", { get: function() { return this._flatGraph || this.updateFlatGraph(), this._flatGraph }, - set: function(t) { - this._flatGraph = t + set: function(e) { + this._flatGraph = e } - }), d.prototype.updateFlatGraph = function() { + }), a.prototype.updateFlatGraph = function() { this.flatGraph = this.getFlatGraph() - }, d.prototype.getFlatGraph = function() { - let t = [this]; - return this.addChildFlatGraph(t) - }, d.prototype.addChildFlatGraph = function(t) { - return this.children.forEach(function(a) { - let r = a.getFlatGraph(); - Array.prototype.push.apply(t, r) - }), t - }, d.prototype.updateSortValue = function() { + }, a.prototype.getFlatGraph = function() { + let e = [this]; + return this.addChildFlatGraph(e) + }, a.prototype.addChildFlatGraph = function(e) { + return this.children.forEach(function(t) { + let a = t.getFlatGraph(); + Array.prototype.push.apply(e, a) + }), e + }, a.prototype.updateSortValue = function() { this.sortValue = this.renderOrigin.z - }, d.prototype.render = function() {}, d.prototype.renderGraphCanvas = function(e) { - if (!e) throw new Error("[Cube]\u672A\u63D0\u4F9B\u6E32\u67D3\u4E0A\u4E0B\u6587"); - this.flatGraph.forEach(function(t) { - t.render(e, u) + }, a.prototype.render = function() {}, a.prototype.renderGraphCanvas = function(a) { + if (!a) throw new Error("[Cube]\u672A\u63D0\u4F9B\u6E32\u67D3\u4E0A\u4E0B\u6587"); + this.flatGraph.forEach(function(e) { + e.render(a, o) }) - }, d.prototype.copy = function(a) { - let r = {}, - o = this.constructor.optionKeys; - o.forEach(function(t) { - r[t] = this[t] - }, this), c(r, a); - let t = this.constructor; - return new t(r) - }, d.prototype.copyGraph = function(t) { - let r = this.copy(t); - return this.children.forEach(function(t) { - t.copyGraph({ - addTo: r + }, a.prototype.copy = function(e) { + let a = {}, + r = this.constructor.optionKeys; + r.forEach(function(e) { + a[e] = this[e] + }, this), n(a, e); + let o = this.constructor; + return new o(a) + }, a.prototype.copyGraph = function(e) { + let a = this.copy(e); + return this.children.forEach(function(e) { + e.copyGraph({ + addTo: a }) - }), r - }, d.prototype.normalizeRotate = function() { - this.rotate.x = R(this.rotate.x, N), this.rotate.y = R(this.rotate.y, N), this.rotate.z = R(this.rotate.z, N) + }), a + }, a.prototype.normalizeRotate = function() { + this.rotate.x = c(this.rotate.x, p), this.rotate.y = c(this.rotate.y, p), this.rotate.z = c(this.rotate.z, p) }; - let T = function(a) { - return function(r) { - let t = function(t) { - this.create(t || {}) + let d = function(e) { + return function(a) { + let r = function(e) { + this.create(e || {}) }; - return t.prototype = Object.create(a.prototype), t.prototype.constructor = t, t.defaults = c({}, a.defaults), c(t.defaults, r), t.optionKeys = a.optionKeys.slice(0), Object.keys(t.defaults).forEach(function(e) { - 1 != !t.optionKeys.indexOf(e) && t.optionKeys.push(e) - }), t.subclass = T(t), t + return r.prototype = Object.create(e.prototype), r.prototype.constructor = r, r.defaults = n({}, e.defaults), n(r.defaults, a), r.optionKeys = e.optionKeys.slice(0), Object.keys(r.defaults).forEach(function(t) { + 1 != !r.optionKeys.indexOf(t) && r.optionKeys.push(t) + }), r.subclass = d(r), r } }; - d.subclass = T(d); - let e = "undefined" != typeof window, - t = "mousedown", - l = "mousemove", - q = "mouseup"; - e && (window.PointerEvent ? (t = "pointerdown", l = "pointermove", q = "pointerup") : "ontouchstart" in window && (t = "touchstart", l = "touchmove", q = "touchend")); - let G = function(t) { - this.create(t || {}) + a.subclass = d(a); + let T = "undefined" != typeof window, + e = "mousedown", + k = "mousemove", + S = "mouseup"; + T && (window.PointerEvent ? (e = "pointerdown", k = "pointermove", S = "pointerup") : "ontouchstart" in window && (e = "touchstart", k = "touchmove", S = "touchend")); + let j = function(e) { + this.create(e || {}) }; - G.prototype.create = function(e) { - this.onDragStart = e.onDragStart || o, this.onDragMove = e.onDragMove || o, this.onDragEnd = e.onDragEnd || o, this.bindDrag(e.startElement) - }, G.prototype.bindDrag = function(a) { - a = this.getQueryElement(a), a && (a.style.touchAction = "none", a.addEventListener(t, this)) - }, G.prototype.getQueryElement = function(t) { - return "string" == typeof t && (t = document.querySelector(t)), t - }, G.prototype.handleEvent = function(e) { - let t = this["on" + e.type]; - t && t.call(this, e) - }, G.prototype.onmousedown = G.prototype.onpointerdown = function(t) { - this.dragStart(t, t) - }, G.prototype.ontouchstart = function(t) { - this.dragStart(t, t.changedTouches[0]) - }, G.prototype.dragStart = function(t, r) { - t.preventDefault(), this.dragStartX = r.pageX, this.dragStartY = r.pageY, e && (window.addEventListener(l, this), window.addEventListener(q, this)), this.onDragStart(r) - }, G.prototype.ontouchmove = function(t) { - this.dragMove(t, t.changedTouches[0]) - }, G.prototype.onmousemove = G.prototype.onpointermove = function(t) { - this.dragMove(t, t) - }, G.prototype.dragMove = function(a, r) { - a.preventDefault(); - let o = r.pageX - this.dragStartX, - e = r.pageY - this.dragStartY; - this.onDragMove(r, o, e) - }, G.prototype.onmouseup = G.prototype.onpointerup = G.prototype.ontouchend = G.prototype.dragEnd = function() { - window.removeEventListener(l, this), window.removeEventListener(q, this), this.onDragEnd() + j.prototype.create = function(t) { + this.onDragStart = t.onDragStart || s, this.onDragMove = t.onDragMove || s, this.onDragEnd = t.onDragEnd || s, this.bindDrag(t.startElement) + }, j.prototype.bindDrag = function(t) { + t = this.getQueryElement(t), t && (t.style.touchAction = "none", t.addEventListener(e, this)) + }, j.prototype.getQueryElement = function(e) { + return "string" == typeof e && (e = document.querySelector(e)), e + }, j.prototype.handleEvent = function(a) { + let e = this["on" + a.type]; + e && e.call(this, a) + }, j.prototype.onmousedown = j.prototype.onpointerdown = function(e) { + this.dragStart(e, e) + }, j.prototype.ontouchstart = function(e) { + this.dragStart(e, e.changedTouches[0]) + }, j.prototype.dragStart = function(e, t) { + e.preventDefault(), this.dragStartX = t.pageX, this.dragStartY = t.pageY, T && (window.addEventListener(k, this), window.addEventListener(S, this)), this.onDragStart(t) + }, j.prototype.ontouchmove = function(e) { + this.dragMove(e, e.changedTouches[0]) + }, j.prototype.onmousemove = j.prototype.onpointermove = function(e) { + this.dragMove(e, e) + }, j.prototype.dragMove = function(t, a) { + t.preventDefault(); + let r = a.pageX - this.dragStartX, + o = a.pageY - this.dragStartY; + this.onDragMove(a, r, o) + }, j.prototype.onmouseup = j.prototype.onpointerup = j.prototype.ontouchend = j.prototype.dragEnd = function() { + window.removeEventListener(k, this), window.removeEventListener(S, this), this.onDragEnd() }; - let w = d.subclass({ + let G = a.subclass({ element: void 0, centered: !0, zoom: 1, dragRotate: !1, resize: !1, - onPrerender: o, - onDragStart: o, - onDragMove: o, - onDragEnd: o, - onResize: o + onPrerender: s, + onDragStart: s, + onDragMove: s, + onDragEnd: s, + onResize: s }); - c(w.prototype, G.prototype), w.prototype.create = function(t) { - d.prototype.create.call(this, t), G.prototype.create.call(this, t), this.setElement(this.element), this.setDragRotate(this.dragRotate), this.setResize(this.resize) - }, w.prototype.setElement = function(t) { - if (t = this.element, !t) throw new Error("[Cube]\u672A\u6307\u5B9A\u5143\u7D20"); - this.setCanvas(t) - }, w.prototype.setSize = function(a, r) { - a = Math.round(a), r = Math.round(r), this.setSizeCanvas(a, r) - }, w.prototype.setResize = function(t) { - this.resize = t, this.resizeListener || (this.resizeListener = this.onWindowResize.bind(this)), t ? (window.addEventListener("resize", this.resizeListener), this.onWindowResize()) : window.removeEventListener("resize", this.resizeListener) - }, w.prototype.onWindowResize = function() { + n(G.prototype, j.prototype), G.prototype.create = function(e) { + a.prototype.create.call(this, e), j.prototype.create.call(this, e), this.setElement(this.element), this.setDragRotate(this.dragRotate), this.setResize(this.resize) + }, G.prototype.setElement = function(e) { + if (e = this.element, !e) throw new Error("[Cube]\u672A\u6307\u5B9A\u5143\u7D20"); + this.setCanvas(e) + }, G.prototype.setSize = function(e, t) { + e = Math.round(e), t = Math.round(t), this.setSizeCanvas(e, t) + }, G.prototype.setResize = function(e) { + this.resize = e, this.resizeListener || (this.resizeListener = this.onWindowResize.bind(this)), e ? (window.addEventListener("resize", this.resizeListener), this.onWindowResize()) : window.removeEventListener("resize", this.resizeListener) + }, G.prototype.onWindowResize = function() { this.setMeasuredSize(), this.onResize(this.width, this.height) - }, w.prototype.setMeasuredSize = function() { - let o, d, r = "fullscreen" == this.resize; - if (r) o = window.innerWidth, d = window.innerHeight; + }, G.prototype.setMeasuredSize = function() { + let t, a, e = "fullscreen" == this.resize; + if (e) t = window.innerWidth, a = window.innerHeight; else { - let e = this.element.getBoundingClientRect(); - o = e.width, d = e.height + let r = this.element.getBoundingClientRect(); + t = r.width, a = r.height } - this.setSize(o, d) - }, w.prototype.renderGraph = function(t) { - this.renderGraphCanvas(t) - }, w.prototype.updateRenderGraph = function(t) { - this.updateGraph(), this.renderGraph(t) - }, w.prototype.setCanvas = function(t) { - this.element = t, this.ctx = this.element.getContext("2d"), this.setSizeCanvas(t.width, t.height) - }, w.prototype.setSizeCanvas = function(a, r) { - this.width = a, this.height = r; - let o = this.pixelRatio = window.devicePixelRatio || 1; - this.element.width = this.canvasWidth = a * o, this.element.height = this.canvasHeight = r * o; - let e = 1 < o && !this.resize; - e && (this.element.style.width = a + "px", this.element.style.height = r + "px") - }, w.prototype.renderGraphCanvas = function(t) { - t = t || this, this.prerenderCanvas(), d.prototype.renderGraphCanvas.call(t, this.ctx), this.postrenderCanvas() - }, w.prototype.prerenderCanvas = function() { - let o = this.ctx; - if (o.lineCap = "round", o.lineJoin = "round", o.clearRect(0, 0, this.canvasWidth, this.canvasHeight), o.save(), this.centered) { - let t = this.width / 2 * this.pixelRatio, - a = this.height / 2 * this.pixelRatio; - o.translate(t, a) + this.setSize(t, a) + }, G.prototype.renderGraph = function(e) { + this.renderGraphCanvas(e) + }, G.prototype.updateRenderGraph = function(e) { + this.updateGraph(), this.renderGraph(e) + }, G.prototype.setCanvas = function(e) { + this.element = e, this.ctx = this.element.getContext("2d"), this.setSizeCanvas(e.width, e.height) + }, G.prototype.setSizeCanvas = function(t, a) { + this.width = t, this.height = a; + let r = this.pixelRatio = window.devicePixelRatio || 1; + this.element.width = this.canvasWidth = t * r, this.element.height = this.canvasHeight = a * r; + let o = 1 < r && !this.resize; + o && (this.element.style.width = t + "px", this.element.style.height = a + "px") + }, G.prototype.renderGraphCanvas = function(e) { + e = e || this, this.prerenderCanvas(), a.prototype.renderGraphCanvas.call(e, this.ctx), this.postrenderCanvas() + }, G.prototype.prerenderCanvas = function() { + let r = this.ctx; + if (r.lineCap = "round", r.lineJoin = "round", r.clearRect(0, 0, this.canvasWidth, this.canvasHeight), r.save(), this.centered) { + let e = this.width / 2 * this.pixelRatio, + t = this.height / 2 * this.pixelRatio; + r.translate(e, t) } - let e = this.pixelRatio * this.zoom; - o.scale(e, e), this.onPrerender(o) - }, w.prototype.postrenderCanvas = function() { + let t = this.pixelRatio * this.zoom; + r.scale(t, t), this.onPrerender(r) + }, G.prototype.postrenderCanvas = function() { this.ctx.restore() - }, w.prototype.setDragRotate = function(t) { - t && (!0 === t && (t = this), this.dragRotate = t, this.bindDrag(this.element)) - }, w.prototype.dragStart = function() { - this.dragStartRX = this.dragRotate.rotate.x, this.dragStartRY = this.dragRotate.rotate.y, G.prototype.dragStart.apply(this, arguments) - }, w.prototype.dragMove = function(o, d) { - let e = d.pageX - this.dragStartX, - t = d.pageY - this.dragStartY, - a = Math.min(this.width, this.height); - this.dragRotate.rotate.x = this.dragStartRX - t / a * N, this.dragRotate.rotate.y = this.dragStartRY - e / a * N, G.prototype.dragMove.apply(this, arguments) + }, G.prototype.setDragRotate = function(e) { + e && (!0 === e && (e = this), this.dragRotate = e, this.bindDrag(this.element)) + }, G.prototype.dragStart = function() { + this.dragStartRX = this.dragRotate.rotate.x, this.dragStartRY = this.dragRotate.rotate.y, j.prototype.dragStart.apply(this, arguments) + }, G.prototype.dragMove = function(r, o) { + let d = o.pageX - this.dragStartX, + e = o.pageY - this.dragStartY, + t = Math.min(this.width, this.height); + this.dragRotate.rotate.x = this.dragStartRX - e / t * p, this.dragRotate.rotate.y = this.dragStartRY - d / t * p, j.prototype.dragMove.apply(this, arguments) }; - let D = function(t, a, r) { - this.method = t, this.points = a.map(M), this.renderPoints = a.map(V), this.previousPoint = r, this.endRenderPoint = this.renderPoints[this.renderPoints.length - 1], "arc" == t && (this.controlPoints = [new k, new k]) + let w = function(e, t, a) { + this.method = e, this.points = t.map(D), this.renderPoints = t.map(M), this.previousPoint = a, this.endRenderPoint = this.renderPoints[this.renderPoints.length - 1], "arc" == e && (this.controlPoints = [new N, new N]) }, - M = function(t) { - return t instanceof k ? t : new k(t) + D = function(e) { + return e instanceof N ? e : new N(e) }, - V = function(t) { - return new k(t) + M = function(e) { + return new N(e) }; - D.prototype.reset = function() { - let a = this.points; - this.renderPoints.forEach(function(r, o) { - let e = a[o]; - r.set(e) + w.prototype.reset = function() { + let t = this.points; + this.renderPoints.forEach(function(a, r) { + let o = t[r]; + a.set(o) }) - }, D.prototype.transform = function(a, r, o) { - this.renderPoints.forEach(function(e) { - e.transform(a, r, o) + }, w.prototype.transform = function(t, a, r) { + this.renderPoints.forEach(function(o) { + o.transform(t, a, r) }) - }, D.prototype.render = function(t, a, r) { - return this[this.method](t, a, r) - }, D.prototype.move = function(t, a, r) { - return r.move(t, a, this.renderPoints[0]) - }, D.prototype.line = function(t, a, r) { - return r.line(t, a, this.renderPoints[0]) - }, D.prototype.bezier = function(o, d, l) { - let e = this.renderPoints[0], - t = this.renderPoints[1], - a = this.renderPoints[2]; - return l.bezier(o, d, e, t, a) + }, w.prototype.render = function(e, t, a) { + return this[this.method](e, t, a) + }, w.prototype.move = function(e, t, a) { + return a.move(e, t, this.renderPoints[0]) + }, w.prototype.line = function(e, t, a) { + return a.line(e, t, this.renderPoints[0]) + }, w.prototype.bezier = function(r, o, d) { + let l = this.renderPoints[0], + e = this.renderPoints[1], + t = this.renderPoints[2]; + return d.bezier(r, o, l, e, t) }; - let E = 9 / 16; - D.prototype.arc = function(p, T, l) { - let e = this.previousPoint, - t = this.renderPoints[0], - a = this.renderPoints[1], - r = this.controlPoints[0], - o = this.controlPoints[1]; - return r.set(e).lerp(t, E), o.set(a).lerp(t, E), l.bezier(p, T, r, o, a) + let V = 9 / 16; + w.prototype.arc = function(d, p, T) { + let l = this.previousPoint, + e = this.renderPoints[0], + t = this.renderPoints[1], + a = this.controlPoints[0], + r = this.controlPoints[1]; + return a.set(l).lerp(e, V), r.set(t).lerp(e, V), T.bezier(d, p, a, r, t) }; - let m = d.subclass({ + let E = a.subclass({ stroke: 1, fill: !1, color: "#333", @@ -347,402 +347,402 @@ void(window.tempExt = { }, backface: !0 }); - m.prototype.create = function(t) { - d.prototype.create.call(this, t), this.updatePath(), this.front = new k(t.front || this.front), this.renderFront = new k(this.front), this.renderNormal = new k + E.prototype.create = function(e) { + this.path = e, a.prototype.create.call(this, e), this.updatePath(), this.front = new N(e.front || this.front), this.renderFront = new N(this.front), this.renderNormal = new N }; - let y = ["move", "line", "bezier", "arc"]; - m.prototype.updatePath = function() { + let m = ["move", "line", "bezier", "arc"]; + E.prototype.updatePath = function() { this.setPath(), this.updatePathCommands() - }, m.prototype.setPath = function() {}, m.prototype.updatePathCommands = function() { - let r; - this.pathCommands = this.path.map(function(o, d) { - let e = Object.keys(o), - t = e[0], - l = o[t], - c = 1 == e.length && -1 != y.indexOf(t); - c || (t = "line", l = o); - let i = "line" == t || "move" == t, - s = Array.isArray(l); - i && !s && (l = [l]), t = 0 === d ? "move" : t; - let p = new D(t, l, r); - return r = p.endRenderPoint, p + }, E.prototype.setPath = function() {}, E.prototype.updatePathCommands = function() { + let a; + this.pathCommands = this.path.map(function(r, o) { + let d = Object.keys(r), + e = d[0], + T = r[e], + n = 1 == d.length && -1 != m.indexOf(e); + n || (e = "line", T = r); + let c = "line" == e || "move" == e, + i = Array.isArray(T); + c && !i && (T = [T]), e = 0 === o ? "move" : e; + let s = new w(e, T, a); + return a = s.endRenderPoint, s }) - }, m.prototype.reset = function() { - this.renderOrigin.set(this.origin), this.renderFront.set(this.front), this.pathCommands.forEach(function(t) { - t.reset() + }, E.prototype.reset = function() { + this.renderOrigin.set(this.origin), this.renderFront.set(this.front), this.pathCommands.forEach(function(e) { + e.reset() }) - }, m.prototype.transform = function(a, r, o) { - this.renderOrigin.transform(a, r, o), this.renderFront.transform(a, r, o), this.renderNormal.set(this.renderOrigin).subtract(this.renderFront), this.pathCommands.forEach(function(e) { - e.transform(a, r, o) - }), this.children.forEach(function(e) { - e.transform(a, r, o) + }, E.prototype.transform = function(t, a, r) { + this.renderOrigin.transform(t, a, r), this.renderFront.transform(t, a, r), this.renderNormal.set(this.renderOrigin).subtract(this.renderFront), this.pathCommands.forEach(function(o) { + o.transform(t, a, r) + }), this.children.forEach(function(o) { + o.transform(t, a, r) }) - }, m.prototype.updateSortValue = function() { - let r = this.pathCommands.length, - d = this.pathCommands[0].endRenderPoint, - e = this.pathCommands[r - 1].endRenderPoint, - l = 2 < r && d.isSame(e); - l && (r -= 1); - let T = 0; - for (let e = 0; e < r; e++) T += this.pathCommands[e].endRenderPoint.z; - this.sortValue = T / r - }, m.prototype.render = function(t, a) { - let r = this.pathCommands.length; - if (this.visible && r && (this.isFacingBack = 0 < this.renderNormal.z, this.backface || !this.isFacingBack)) { - if (!a) throw new Error("[Cube]\u672A\u63D0\u4F9B\u6E32\u67D3\u5668"); - a.isCanvas && 1 == r ? this.renderCanvasDot(t, a) : this.renderPath(t, a) + }, E.prototype.updateSortValue = function() { + let t = this.pathCommands.length, + a = this.pathCommands[0].endRenderPoint, + o = this.pathCommands[t - 1].endRenderPoint, + e = 2 < t && a.isSame(o); + e && (t -= 1); + let d = 0; + for (let a = 0; a < t; a++) d += this.pathCommands[a].endRenderPoint.z; + this.sortValue = d / t + }, E.prototype.render = function(e, t) { + let a = this.pathCommands.length; + if (this.visible && a && (this.isFacingBack = 0 < this.renderNormal.z, this.backface || !this.isFacingBack)) { + if (!t) throw new Error("[Cube]\u672A\u63D0\u4F9B\u6E32\u67D3\u5668"); + t.isCanvas && 1 == a ? this.renderCanvasDot(e, t) : this.renderPath(e, t) } - }, m.prototype.renderCanvasDot = function(a) { - let r = this.getLineWidth(); - if (r) { - a.fillStyle = this.getRenderColor(); - let e = this.pathCommands[0].endRenderPoint; - a.beginPath(), a.arc(e.x, e.y, r / 2, 0, N), a.fill() + }, E.prototype.renderCanvasDot = function(t) { + let a = this.getLineWidth(); + if (a) { + t.fillStyle = this.getRenderColor(); + let r = this.pathCommands[0].endRenderPoint; + t.beginPath(), t.arc(r.x, r.y, a / 2, 0, p), t.fill() } - }, m.prototype.getLineWidth = function() { + }, E.prototype.getLineWidth = function() { return this.stroke ? !0 == this.stroke ? 1 : this.stroke : 0 - }, m.prototype.getRenderColor = function() { - let e = "string" == typeof this.backface && this.isFacingBack, - t = e ? this.backface : this.color; - return t - }, m.prototype.renderPath = function(o, d) { - let l, e = 2 == this.pathCommands.length && "line" == this.pathCommands[1].method, - t = !e && this.closed, - a = this.getRenderColor(); - d.renderPath(o, l, this.pathCommands, t), d.stroke(o, l, this.stroke, a, this.getLineWidth()), d.fill(o, l, this.fill, a), d.end(o, l) + }, E.prototype.getRenderColor = function() { + let a = "string" == typeof this.backface && this.isFacingBack, + e = a ? this.backface : this.color; + return e + }, E.prototype.renderPath = function(r, o) { + let d, l = 2 == this.pathCommands.length && "line" == this.pathCommands[1].method, + e = !l && this.closed, + t = this.getRenderColor(); + o.renderPath(r, d, this.pathCommands, e), o.stroke(r, d, this.stroke, t, this.getLineWidth()), o.fill(r, d, this.fill, t), o.end(r, d) }; - let h = d.subclass({ + let y = a.subclass({ updateSort: !1, visible: !0 }); - h.prototype.updateSortValue = function() { - let e = 0; - this.flatGraph.forEach(function(t) { - t.updateSortValue(), e += t.sortValue - }), this.sortValue = e / this.flatGraph.length, this.updateSort && this.flatGraph.sort(d.shapeSorter) - }, h.prototype.render = function(t, a) { - this.visible && this.flatGraph.forEach(function(r) { - r.render(t, a) + y.prototype.updateSortValue = function() { + let r = 0; + this.flatGraph.forEach(function(e) { + e.updateSortValue(), r += e.sortValue + }), this.sortValue = r / this.flatGraph.length, this.updateSort && this.flatGraph.sort(a.shapeSorter) + }, y.prototype.render = function(e, t) { + this.visible && this.flatGraph.forEach(function(a) { + a.render(e, t) }) - }, h.prototype.updateFlatGraph = function() { + }, y.prototype.updateFlatGraph = function() { this.flatGraph = this.addChildFlatGraph([]) - }, h.prototype.getFlatGraph = function() { + }, y.prototype.getFlatGraph = function() { return [this] }; - let U = m.subclass({ + let h = E.subclass({ width: 1, height: 1 }); - U.prototype.setPath = function() { - let e = this.width / 2, - t = this.height / 2; + h.prototype.setPath = function() { + let a = this.width / 2, + e = this.height / 2; this.path = [{ - x: -e, - y: -t + x: -a, + y: -e }, { - x: e, - y: -t + x: a, + y: -e }, { - x: e, - y: t + x: a, + y: e }, { - x: -e, - y: t + x: -a, + y: e }] }; - let X = m.subclass({ + let U = E.subclass({ width: 1, height: 1, cornerRadius: .25, closed: !1 }); - X.prototype.setPath = function() { - let d = this.width / 2, - l = this.height / 2, - T = Math.min(d, l), - e = Math.min(this.cornerRadius, T), - t = d - e, - a = l - e, - r = [{ - x: t, - y: -l + U.prototype.setPath = function() { + let o = this.width / 2, + d = this.height / 2, + l = Math.min(o, d), + p = Math.min(this.cornerRadius, l), + e = o - p, + t = d - p, + a = [{ + x: e, + y: -d }, { arc: [{ - x: d, - y: -l + x: o, + y: -d }, { - x: d, - y: -a + x: o, + y: -t }] }]; - a && r.push({ - x: d, - y: a - }), r.push({ + t && a.push({ + x: o, + y: t + }), a.push({ arc: [{ - x: d, - y: l + x: o, + y: d }, { - x: t, - y: l + x: e, + y: d }] - }), t && r.push({ - x: -t, - y: l - }), r.push({ + }), e && a.push({ + x: -e, + y: d + }), a.push({ arc: [{ - x: -d, - y: l + x: -o, + y: d }, { - x: -d, - y: a + x: -o, + y: t }] - }), a && r.push({ - x: -d, - y: -a - }), r.push({ + }), t && a.push({ + x: -o, + y: -t + }), a.push({ arc: [{ - x: -d, - y: -l + x: -o, + y: -d }, { - x: -t, - y: -l + x: -e, + y: -d }] - }), t && r.push({ - x: t, - y: -l - }), this.path = r + }), e && a.push({ + x: e, + y: -d + }), this.path = a }; - let z = m.subclass({ + let X = E.subclass({ diameter: 1, width: void 0, height: void 0, quarters: 4, closed: !1 }); - z.prototype.setPath = function() { - let a = null == this.width ? this.diameter : this.width, - r = null == this.height ? this.diameter : this.height, - o = a / 2, - e = r / 2; + X.prototype.setPath = function() { + let t = null == this.width ? this.diameter : this.width, + a = null == this.height ? this.diameter : this.height, + r = t / 2, + o = a / 2; this.path = [{ x: 0, - y: -e + y: -o }, { arc: [{ - x: o, - y: -e + x: r, + y: -o }, { - x: o, + x: r, y: 0 }] }], 1 < this.quarters && this.path.push({ arc: [{ - x: o, - y: e + x: r, + y: o }, { x: 0, - y: e + y: o }] }), 2 < this.quarters && this.path.push({ arc: [{ - x: -o, - y: e + x: -r, + y: o }, { - x: -o, + x: -r, y: 0 }] }), 3 < this.quarters && this.path.push({ arc: [{ - x: -o, - y: -e + x: -r, + y: -o }, { x: 0, - y: -e + y: -o }] }) }; - let b = m.subclass({ + let z = E.subclass({ sides: 3, radius: .5 }); - b.prototype.setPath = function() { + z.prototype.setPath = function() { this.path = []; - for (let r = 0; r < this.sides; r++) { - let o = r / this.sides * N - N / 4, - e = Math.cos(o) * this.radius, - t = Math.sin(o) * this.radius; + for (let a = 0; a < this.sides; a++) { + let r = a / this.sides * p - p / 4, + o = Math.cos(r) * this.radius, + e = Math.sin(r) * this.radius; this.path.push({ - x: e, - y: t + x: o, + y: e }) } }; - let g = z.subclass({ + let b = X.subclass({ fill: !0 }); - g.prototype.create = function() { - z.prototype.create.apply(this, arguments), this.apex = new d({ + b.prototype.create = function() { + X.prototype.create.apply(this, arguments), this.apex = new a({ addTo: this, translate: { z: this.diameter / 2 } - }), this.renderCentroid = new k - }, g.prototype.updateSortValue = function() { + }), this.renderCentroid = new N + }, b.prototype.updateSortValue = function() { this.renderCentroid.set(this.renderOrigin).lerp(this.apex.renderOrigin, 3 / 8), this.sortValue = this.renderCentroid.z - }, g.prototype.render = function(e, t) { - this.renderDome(e, t), z.prototype.render.apply(this, arguments) - }, g.prototype.renderDome = function(d, l) { + }, b.prototype.render = function(a, e) { + this.renderDome(a, e), X.prototype.render.apply(this, arguments) + }, b.prototype.renderDome = function(o, d) { if (this.visible) { - let T = this.getDomeRenderElement(d, l), - e = Math.atan2(this.renderNormal.y, this.renderNormal.x), - t = this.diameter / 2 * this.renderNormal.magnitude(), - a = this.renderOrigin.x, - r = this.renderOrigin.y; - l.stroke(d, T, this.stroke, this.color, this.getLineWidth()), l.fill(d, T, this.fill, this.color), l.end(d, T) + let l = this.getDomeRenderElement(o, d), + p = Math.atan2(this.renderNormal.y, this.renderNormal.x), + e = this.diameter / 2 * this.renderNormal.magnitude(), + t = this.renderOrigin.x, + a = this.renderOrigin.y; + d.stroke(o, l, this.stroke, this.color, this.getLineWidth()), d.fill(o, l, this.fill, this.color), d.end(o, l) } }; - let f = h.subclass({ + let g = y.subclass({ color: "#333", updateSort: !0 }); - f.prototype.create = function() { - h.prototype.create.apply(this, arguments), this.pathCommands = [new D("move", [{}]), new D("line", [{}])] - }, f.prototype.render = function(e, t) { - this.renderCylinderSurface(e, t), h.prototype.render.apply(this, arguments) - }, f.prototype.renderCylinderSurface = function(d, l) { + g.prototype.create = function() { + y.prototype.create.apply(this, arguments), this.pathCommands = [new w("move", [{}]), new w("line", [{}])] + }, g.prototype.render = function(a, e) { + this.renderCylinderSurface(a, e), y.prototype.render.apply(this, arguments) + }, g.prototype.renderCylinderSurface = function(o, d) { if (this.visible) { - let T, e = this.frontBase, - t = this.rearBase, - a = e.renderNormal.magnitude(), - r = e.diameter * a + e.getLineWidth(); - this.pathCommands[0].renderPoints[0].set(e.renderOrigin), this.pathCommands[1].renderPoints[0].set(t.renderOrigin), l.renderPath(d, T, this.pathCommands), l.stroke(d, T, !0, this.color, r), l.end(d, T) + let l, p = this.frontBase, + e = this.rearBase, + t = p.renderNormal.magnitude(), + a = p.diameter * t + p.getLineWidth(); + this.pathCommands[0].renderPoints[0].set(p.renderOrigin), this.pathCommands[1].renderPoints[0].set(e.renderOrigin), d.renderPath(o, l, this.pathCommands), d.stroke(o, l, !0, this.color, a), d.end(o, l) } - }, f.prototype.copyGraph = o; - let x = z.subclass(); - x.prototype.copyGraph = o; - let F = m.subclass({ + }, g.prototype.copyGraph = s; + let f = X.subclass(); + f.prototype.copyGraph = s; + let x = E.subclass({ diameter: 1, length: 1, frontFace: void 0, fill: !0 }); - F.prototype.create = function() { - m.prototype.create.apply(this, arguments), this.group = new f({ + x.prototype.create = function() { + E.prototype.create.apply(this, arguments), this.group = new g({ addTo: this, color: this.color, visible: this.visible }); - let t = this.length / 2, - a = this.backface || !0; - this.frontBase = this.group.frontBase = new z({ + let e = this.length / 2, + t = this.backface || !0; + this.frontBase = this.group.frontBase = new X({ addTo: this.group, diameter: this.diameter, translate: { - z: t + z: e }, rotate: { - y: N / 2 + y: p / 2 }, color: this.color, stroke: this.stroke, fill: this.fill, - backface: this.frontFace || a, + backface: this.frontFace || t, visible: this.visible }), this.rearBase = this.group.rearBase = this.frontBase.copy({ translate: { - z: -t + z: -e }, rotate: { y: 0 }, - backface: a + backface: t }) - }, F.prototype.render = function() {}, ["stroke", "fill", "color", "visible"].forEach(function(t) { - let a = "_" + t; - Object.defineProperty(F.prototype, t, { + }, x.prototype.render = function() {}, ["stroke", "fill", "color", "visible"].forEach(function(e) { + let t = "_" + e; + Object.defineProperty(x.prototype, e, { get: function() { - return this[a] + return this[t] }, - set: function(r) { - this[a] = r, this.frontBase && (this.frontBase[t] = r, this.rearBase[t] = r, this.group[t] = r) + set: function(a) { + this[t] = a, this.frontBase && (this.frontBase[e] = a, this.rearBase[e] = a, this.group[e] = a) } }) }); - let O = z.subclass({ + let F = X.subclass({ length: 1, fill: !0 }); - O.prototype.create = function() { - z.prototype.create.apply(this, arguments), this.apex = new d({ + F.prototype.create = function() { + X.prototype.create.apply(this, arguments), this.apex = new a({ addTo: this, translate: { z: this.length } - }), this.renderApex = new k, this.renderCentroid = new k, this.tangentA = new k, this.tangentB = new k, this.surfacePathCommands = [new D("move", [{}]), new D("line", [{}]), new D("line", [{}])] - }, O.prototype.updateSortValue = function() { + }), this.renderApex = new N, this.renderCentroid = new N, this.tangentA = new N, this.tangentB = new N, this.surfacePathCommands = [new w("move", [{}]), new w("line", [{}]), new w("line", [{}])] + }, F.prototype.updateSortValue = function() { this.renderCentroid.set(this.renderOrigin).lerp(this.apex.renderOrigin, 1 / 3), this.sortValue = this.renderCentroid.z - }, O.prototype.render = function(e, t) { - this.renderConeSurface(e, t), z.prototype.render.apply(this, arguments) - }, O.prototype.renderConeSurface = function(l, T) { + }, F.prototype.render = function(a, e) { + this.renderConeSurface(a, e), X.prototype.render.apply(this, arguments) + }, F.prototype.renderConeSurface = function(d, l) { if (this.visible) { this.renderApex.set(this.apex.renderOrigin).subtract(this.renderOrigin); - let e = this.renderNormal.magnitude(), - n = this.renderApex.magnitude2d(), - t = this.renderNormal.magnitude2d(), - a = Math.acos(t / e), - i = Math.sin(a), - c = this.diameter / 2 * e; - if (c * i < n) { - let e = Math.atan2(this.renderNormal.y, this.renderNormal.x) + N / 2, - t = Math.acos(c / (n / i)), - a = this.tangentA, - r = this.tangentB; - a.x = Math.cos(t) * c * i, a.y = Math.sin(t) * c, r.set(this.tangentA), r.y *= -1, a.rotateZ(e), r.rotateZ(e), a.add(this.renderOrigin), r.add(this.renderOrigin), this.setSurfaceRenderPoint(0, a), this.setSurfaceRenderPoint(1, this.apex.renderOrigin), this.setSurfaceRenderPoint(2, r); - let o = this.getSurfaceRenderElement(l, T); - T.renderPath(l, o, this.surfacePathCommands), T.stroke(l, o, this.stroke, this.color, this.getLineWidth()), T.fill(l, o, this.fill, this.color), T.end(l, o) + let r = this.renderNormal.magnitude(), + T = this.renderApex.magnitude2d(), + e = this.renderNormal.magnitude2d(), + t = Math.acos(e / r), + n = Math.sin(t), + i = this.diameter / 2 * r; + if (i * n < T) { + let c = Math.atan2(this.renderNormal.y, this.renderNormal.x) + p / 2, + e = Math.acos(i / (T / n)), + t = this.tangentA, + a = this.tangentB; + t.x = Math.cos(e) * i * n, t.y = Math.sin(e) * i, a.set(this.tangentA), a.y *= -1, t.rotateZ(c), a.rotateZ(c), t.add(this.renderOrigin), a.add(this.renderOrigin), this.setSurfaceRenderPoint(0, t), this.setSurfaceRenderPoint(1, this.apex.renderOrigin), this.setSurfaceRenderPoint(2, a); + let r = this.getSurfaceRenderElement(d, l); + l.renderPath(d, r, this.surfacePathCommands), l.stroke(d, r, this.stroke, this.color, this.getLineWidth()), l.fill(d, r, this.fill, this.color), l.end(d, r) } } - }, O.prototype.setSurfaceRenderPoint = function(t, a) { - let r = this.surfacePathCommands[t].renderPoints[0]; - r.set(a) + }, F.prototype.setSurfaceRenderPoint = function(e, t) { + let a = this.surfacePathCommands[e].renderPoints[0]; + a.set(t) }; - let W = U.subclass(); - W.prototype.copyGraph = function() {}; - let Z = ["frontFace", "rearFace", "leftFace", "rightFace", "topFace", "bottomFace"], - C = c({}, m.defaults); - delete C.path, Z.forEach(function(t) { - C[t] = !0 - }), c(C, { + let O = h.subclass(); + O.prototype.copyGraph = function() {}; + let W = ["frontFace", "rearFace", "leftFace", "rightFace", "topFace", "bottomFace"], + Z = n({}, E.defaults); + delete Z.path, W.forEach(function(e) { + Z[e] = !0 + }), n(Z, { width: 1, height: 1, depth: 1, fill: !0 }); - let J = d.subclass(C); - return J.prototype.create = function(t) { - d.prototype.create.call(this, t), this.updatePath(), this.fill = this.fill - }, J.prototype.updatePath = function() { - Z.forEach(function(t) { - this[t] = this[t] + let C = a.subclass(Z); + return C.prototype.create = function(e) { + a.prototype.create.call(this, e), this.updatePath(), this.fill = this.fill + }, C.prototype.updatePath = function() { + W.forEach(function(e) { + this[e] = this[e] }, this) - }, Z.forEach(function(t) { - let a = "_" + t; - Object.defineProperty(J.prototype, t, { + }, W.forEach(function(e) { + let t = "_" + e; + Object.defineProperty(C.prototype, e, { get: function() { - return this[a] + return this[t] }, - set: function(r) { - this[a] = r, this.setFace(t, r) + set: function(a) { + this[t] = a, this.setFace(e, a) } }) - }), J.prototype.setFace = function(a, r) { - let o = a + "Rect", - e = this[o]; - if (!r) return void this.removeChild(e); - let l = this.getFaceOptions(a); - l.color = "string" == typeof r ? r : this.color, e ? e.setOptions(l) : e = this[o] = new W(l), e.updatePath(), this.addChild(e) - }, J.prototype.getFaceOptions = function(e) { + }), C.prototype.setFace = function(t, a) { + let r = t + "Rect", + o = this[r]; + if (!a) return void this.removeChild(o); + let d = this.getFaceOptions(t); + d.color = "string" == typeof a ? a : this.color, o ? o.setOptions(d) : o = this[r] = new O(d), o.updatePath(), this.addChild(o) + }, C.prototype.getFaceOptions = function(t) { return { frontFace: { width: this.width, @@ -758,7 +758,7 @@ void(window.tempExt = { z: -this.depth / 2 }, rotate: { - y: N / 2 + y: p / 2 } }, leftFace: { @@ -768,7 +768,7 @@ void(window.tempExt = { x: -this.width / 2 }, rotate: { - y: -N / 4 + y: -p / 4 } }, rightFace: { @@ -778,7 +778,7 @@ void(window.tempExt = { x: this.width / 2 }, rotate: { - y: N / 4 + y: p / 4 } }, topFace: { @@ -788,7 +788,7 @@ void(window.tempExt = { y: -this.height / 2 }, rotate: { - x: -N / 4 + x: -p / 4 } }, bottomFace: { @@ -798,47 +798,47 @@ void(window.tempExt = { y: this.height / 2 }, rotate: { - x: N / 4 + x: p / 4 } } - } [e] - }, ["color", "stroke", "fill", "backface", "front", "visible"].forEach(function(a) { - let e = "_" + a; - Object.defineProperty(J.prototype, a, { + } [t] + }, ["color", "stroke", "fill", "backface", "front", "visible"].forEach(function(t) { + let a = "_" + t; + Object.defineProperty(C.prototype, t, { get: function() { - return this[e] + return this[a] }, - set: function(r) { - this[e] = r, Z.forEach(function(o) { - let d = this[o + "Rect"], - e = "string" == typeof this[o]; - d && !("color" == a && e) && (d[a] = r) + set: function(l) { + this[a] = l, W.forEach(function(a) { + let r = this[a + "Rect"], + o = "string" == typeof this[a]; + r && !("color" == t && o) && (r[t] = l) }, this) } }) }), { - init: w, - custom: m, - rect: U, - roundedRect: X, - ellipse: z, - polygon: b, - hemisphere: g, - cylinder: F, - cone: O, - box: J + init: G, + custom: E, + rect: h, + roundedRect: U, + ellipse: X, + polygon: z, + hemisphere: b, + cylinder: x, + cone: F, + box: C } }(), (null === this.canvas() || null === this.cubeParent()) && console.error("[Cube]\u65E0\u6CD5\u5B9A\u4F4D\u5230\u821E\u53F0"), (() => { if (null !== this.canvas() && null !== this.cubeParent()) { - let a = document.createElement("canvas"); - a.setAttribute("id", "Cube"), a.setAttribute("width", this.canvas().width), a.setAttribute("height", this.canvas().height); - let e = a.style; - e.position = "absolute", e.left = "0%", e.top = "0%", e.pointerEvents = "none", this.cubeParent().appendChild(a), this.cubeScene = new this.Cube.init({ + let t = document.createElement("canvas"); + t.setAttribute("id", "Cube"), t.setAttribute("width", this.canvas().style.width), t.setAttribute("height", this.canvas().style.height); + let a = t.style; + a.position = "absolute", a.left = "0%", a.top = "0%", a.pointerEvents = "none", this.cubeParent().appendChild(t), this.cubeScene = new this.Cube.init({ element: document.getElementById("Cube") }), new MutationObserver(() => { - for (let e in a.setAttribute("width", this.canvas().width), a.setAttribute("height", this.canvas().height), this.cubeScene = new this.Cube.init({ + for (let a in t.setAttribute("width", this.canvas().style.width), t.setAttribute("height", this.canvas().style.height), this.cubeScene = new this.Cube.init({ element: document.getElementById("Cube") - }), this.objectList) this.cubeScene.addChild(this.objectList[e]); + }), this.objectList) this.cubeScene.addChild(this.objectList[a]); this.cubeScene.updateRenderGraph() }).observe(this.canvas(), { attributes: !0 @@ -877,7 +877,8 @@ void(window.tempExt = { "Cube.docs": "\u62D3\u5C55\u6559\u7A0B", "Cube.create": "\u521B\u5EFA\u7269\u4F53", "Cube.modify": "\u4FEE\u6539\u7269\u4F53", - "Cube.info": "\u4FE1\u606F" + "Cube.info": "\u4FE1\u606F", + "Cube.fileListEmpty": "\u65E0\u6587\u4EF6" }, en: { "Cube.name": "LazyTong's Cube", @@ -911,7 +912,8 @@ void(window.tempExt = { "Cube.docs": "Extended Tutorial", "Cube.create": "Creating objects", "Cube.modify": "Modifying objects", - "Cube.info": "Information" + "Cube.info": "Information", + "Cube.fileListEmpty": "no file" } }) } @@ -1343,14 +1345,14 @@ void(window.tempExt = { }, path: { type: "string", - defaultValue: "{}" + menu: "files" }, stroke: { type: "number", defaultValue: "100" } } - }, `---${this.formatMessage("Cube.modify")}`, { + }, `---${this.formatMessage("Cube.modify")}`, { opcode: "deleteObject", blockType: "command", text: this.formatMessage("Cube.deleteObject"), @@ -1388,7 +1390,7 @@ void(window.tempExt = { blockType: "command", text: this.formatMessage("Cube.updateRender"), arguments: {} - }, `---${this.formatMessage("Cube.info")}`, { + }, `---${this.formatMessage("Cube.info")}`, { opcode: "getAttrib", blockType: "reporter", text: this.formatMessage("Cube.getAttrib"), @@ -1445,6 +1447,26 @@ void(window.tempExt = { text: this.formatMessage("Cube.radius"), value: "radius" }], + files: { + acceptReporters: !0, + items: (() => { + try { + const e = this.runtime.getGandiAssetsFileList("json").map(e => ({ + text: e.fullName, + value: e.id + })); + return 1 > e.length ? [{ + text: this.formatMessage("Cube.fileListEmpty"), + value: "fileListEmpty" + }] : e + } catch (e) { + return [{ + text: this.formatMessage("Cube.fileListEmpty"), + value: "fileListEmpty" + }] + } + })() + }, rotate: [{ text: this.formatMessage("Cube.x"), value: "x" @@ -1590,17 +1612,24 @@ void(window.tempExt = { } }), this.cubeScene.addChild(this.objectList[e.id])) } - createCustom(e) { - null !== this.canvas() && null !== this.cubeParent() && "{}" !== e.path && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.custom({ - stroke: +e.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - path: JSON.parse(e.path), + createCustom(t) { + null !== this.canvas() && null !== this.cubeParent() && "{}" !== t.path && (void 0 !== this.objectList[t.id] && (this.cubeScene.removeChild(this.objectList[t.id]), this.objectList[t.id] = void 0), this.objectList[t.id] = new this.Cube.custom({ + stroke: +t.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(t.color) ? t.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + path: (() => { + let e = this.runtime.getGandiAssetsFileList().map(t => t.fullName); + return "fileListEmpty" == t.path | -1 == e.indexOf(t.path) | !Array.isArray(t.path) ? [] : JSON.parse((r => { + let e = ""; + for (let t = 0; t < r.length; t++) e += String.fromCharCode(r[t]); + return e + })(this.runtime.getGandiAssetById(t.path).asset.data)) + })(), translate: { - x: +e.x, - y: +e.y, - z: +e.z + x: +t.x, + y: +t.y, + z: +t.z } - }), this.cubeScene.addChild(this.objectList[e.id])) + }), this.cubeScene.addChild(this.objectList[t.id])) } deleteObject(e) { null !== this.cubeParent() && void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0) @@ -1665,10 +1694,13 @@ void(window.tempExt = { description: "Cube.description", extensionId: "LazyTong.Cube", iconURL: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDYwMCAzNzIiIHdpZHRoPSI2MDAiIGhlaWdodD0iMzcyIiBmaWxsPSJ3aGl0ZSI+PGltYWdlIHdpZHRoPSIyNDAwIiBoZWlnaHQ9IjgwMCIgdHJhbnNmb3JtPSJtYXRyaXgoLjM2MiwwLDAsLjM2MiwtMTM1LDgyKSIgaHJlZj0iZGF0YTppbWFnZS9zdmcreG1sO2Jhc2U2NCxQSE4yWnlCNGJXeHVjejBpYUhSMGNEb3ZMM2QzZHk1M015NXZjbWN2TWpBd01DOXpkbWNpSUhabGNuTnBiMjQ5SWpFdU1TSWdlRzFzYm5NNmVHeHBibXM5SW1oMGRIQTZMeTkzZDNjdWR6TXViM0puTHpFNU9Ua3ZlR3hwYm1zaUlIaHRiRzV6T25OMloycHpQU0pvZEhSd09pOHZjM1puYW5NdVpHVjJMM04yWjJweklpQjJhV1YzUW05NFBTSXdJREFnTWpRd01DQTRNREFpSUc5d1lXTnBkSGs5SWpFaVBqeGtaV1p6UGp4c2FXNWxZWEpIY21Ga2FXVnVkQ0I0TVQwaU5UQWxJaUI1TVQwaU1DVWlJSGd5UFNJMU1DVWlJSGt5UFNJeE1EQWxJaUJwWkQwaWMzTnpkWEptTFdkeVlXUWlQanh6ZEc5d0lITjBiM0F0WTI5c2IzSTlJbWh6YkNneU1EVXN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zNOemMzTnpnc05qSXVNRFF4TmpZMk5qWTJOalkyTmpZMExERTNNek11TXpNek16TXpNek16TXpNek5TdzJNVU14TnpnNExqZzRPRGc0T0RnNE9EZzRPVEVzTlRrdU9UVTRNek16TXpNek16TXpNek0yTERFNE1URXVNVEV4TVRFeE1URXhNVEV4TERFdU5qWTJOalkyTmpZMk5qWTJOalkzTERFNE5qWXVOalkyTmpZMk5qWTJOalkyTnl3MVF6RTVNakl1TWpJeU1qSXlNakl5TWpJeU5DdzRMak16TXpNek16TXpNek16TXpNek1pd3hPVFEwTGpRME5EUTBORFEwTkRRME5EWXNOell1TVRZMk5qWTJOalkyTmpZMk5qY3NNakF3TUM0d01EQXdNREF3TURBd01EQXlMRGMzUXpJd05UVXVOVFUxTlRVMU5UVTFOVFUxTnl3M055NDRNek16TXpNek16TXpNek16TXl3eU1EYzNMamMzTnpjM056YzNOemMzT0N3eExqVXNNakV6TXk0ek16TXpNek16TXpNek16TTFMRGxETWpFNE9DNDRPRGc0T0RnNE9EZzRPRGtzTVRZdU5Td3lNakV4TGpFeE1URXhNVEV4TVRFeE1UTXNNVEV6TGpnek16TXpNek16TXpNek16TXpMREl5TmpZdU5qWTJOalkyTmpZMk5qWTNMREV4TTBNeU16SXlMakl5TWpJeU1qSXlNakl5TWpZc01URXlMakUyTmpZMk5qWTJOalkyTmpZM0xESXpNakF1TVRNNE9EZzRPRGc0T0RnNUxDMDFOQzQzT1RFMk5qWTJOalkyTmpZMk55d3lOREF3TERWRE1qUTNPUzQ0TmpFeE1URXhNVEV4TVRFc05qUXVOemt4TmpZMk5qWTJOalkyTmpjc016STFOQzR4TmpZMk5qWTJOalkyTmpZMUxESXhNeTQxTkRFMk5qWTJOalkyTmpZMk9Td3lOalV3TERRd01FTXlNRFExTGpnek16TXpNek16TXpNek16VXNOVGcyTGpRMU9ETXpNek16TXpNek16TXNNVFUyTGpJMUxEYzVOUzQ0TXpNek16TXpNek16TXpNMExDMDFNREFzT1RBd0lpQjBjbUZ1Y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N3Mk1TNDFOREUyTmpZMk5qWTJOalkyTmpRc01UQXhNUzR4TVRFeE1URXhNVEV4TVRFeUxDMHpNQzQyTmpZMk5qWTJOalkyTmpZMk5qZ3NNVEEyTmk0Mk5qWTJOalkyTmpZMk5qWTNMQzB5T1VNeE1USXlMakl5TWpJeU1qSXlNakl5TWpJc0xUSTNMak16TXpNek16TXpNek16TXpNek1pd3hNVFEwTGpRME5EUTBORFEwTkRRME5ETXNOamN1TWpVc01USXdNQ3czTVVNeE1qVTFMalUxTlRVMU5UVTFOVFUxTlRjc056UXVOelVzTVRJM055NDNOemMzTnpjM056YzNOemM0TEMweE5TNDNPVEUyTmpZMk5qWTJOalkyTmpnc01UTXpNeTR6TXpNek16TXpNek16TXpNMUxDMHhNVU14TXpnNExqZzRPRGc0T0RnNE9EZzRPVEVzTFRZdU1qQTRNek16TXpNek16TXpNek16TERFME1URXVNVEV4TVRFeE1URXhNVEV4TXl3NE9TNDJNalVzTVRRMk5pNDJOalkyTmpZMk5qWTJOalkzTERrMFF6RTFNakl1TWpJeU1qSXlNakl5TWpJeU1pdzVPQzR6TnpVc01UVTBOQzQwTkRRME5EUTBORFEwTkRRekxERTJMamczTlN3eE5qQXdMREV3UXpFMk5UVXVOVFUxTlRVMU5UVTFOVFUxTnl3ekxqRXlOU3d4TmpjM0xqYzNOemMzTnpjM056YzNOemdzTmpJdU1EUXhOalkyTmpZMk5qWTJOalkwTERFM016TXVNek16TXpNek16TXpNek16TlN3Mk1VTXhOemc0TGpnNE9EZzRPRGc0T0RnNE9URXNOVGt1T1RVNE16TXpNek16TXpNek16TTJMREU0TVRFdU1URXhNVEV4TVRFeE1URXhMREV1TmpZMk5qWTJOalkyTmpZMk5qWTNMREU0TmpZdU5qWTJOalkyTmpZMk5qWTJOeXcxUXpFNU1qSXVNakl5TWpJeU1qSXlNakl5TkN3NExqTXpNek16TXpNek16TXpNek16TWl3eE9UUTBMalEwTkRRME5EUTBORFEwTkRZc056WXVNVFkyTmpZMk5qWTJOalkyTmpjc01qQXdNQzR3TURBd01EQXdNREF3TURBeUxEYzNRekl3TlRVdU5UVTFOVFUxTlRVMU5UVTFOeXczTnk0NE16TXpNek16TXpNek16TXpNeXd5TURjM0xqYzNOemMzTnpjM056YzNPQ3d4TGpVc01qRXpNeTR6TXpNek16TXpNek16TXpNMUxEbERNakU0T0M0NE9EZzRPRGc0T0RnNE9Ea3NNVFl1TlN3eU1qRXhMakV4TVRFeE1URXhNVEV4TVRNc01URXpMamd6TXpNek16TXpNek16TXpNekxESXlOall1TmpZMk5qWTJOalkyTmpZM0xERXhNME15TXpJeUxqSXlNakl5TWpJeU1qSXlNallzTVRFeUxqRTJOalkyTmpZMk5qWTJOalkzTERJek1qQXVNVE00T0RnNE9EZzRPRGc1TEMwMU5DNDNPVEUyTmpZMk5qWTJOalkyTnl3eU5EQXdMRFZETWpRM09TNDROakV4TVRFeE1URXhNVEVzTmpRdU56a3hOalkyTmpZMk5qWTJOamNzTXpJMU5DNHhOalkyTmpZMk5qWTJOalkxTERJeE15NDFOREUyTmpZMk5qWTJOalkyT1N3eU5qVXdMRFF3TUVNeU1EUTFMamd6TXpNek16TXpNek16TXpVc05UZzJMalExT0RNek16TXpNek16TXpNc01UVTJMakkxTERjNU5TNDRNek16TXpNek16TXpNek0wTEMwMU1EQXNPVEF3SWlCMGNtRnVjMlp2Y20wOUltMWhkSEpwZUNneExEQXNNQ3d4TERBc01qUXdLU0lnYjNCaFkybDBlVDBpTUM0ek55SStQQzl3WVhSb1BqeHdZWFJvSUdROUlrMHRNVEFzTVRCRE1Ua3VPRFl4TVRFeE1URXhNVEV4TVRFc01qUXVOemt4TmpZMk5qWTJOalkyTmpZNExEYzFMalk1TkRRME5EUTBORFEwTkRRMkxEazNMamczTlN3eE16TXVNek16TXpNek16TXpNek16TXpRc09ERkRNVGt3TGprM01qSXlNakl5TWpJeU1qSXpMRFkwTGpFeU5Td3lNVEV1TVRFeE1URXhNVEV4TVRFeE1UUXNMVFUzTGpnM05Td3lOall1TmpZMk5qWTJOalkyTmpZMk55d3ROekZETXpJeUxqSXlNakl5TWpJeU1qSXlNakl6TEMwNE5DNHhNalVzTXpRMExqUTBORFEwTkRRME5EUTBORFEyTERVdU56QTRNek16TXpNek16TXpNek15TERRd01Dd3hPRU0wTlRVdU5UVTFOVFUxTlRVMU5UVTFOVFFzTXpBdU1qa3hOalkyTmpZMk5qWTJOalk0TERRM055NDNOemMzTnpjM056YzNOemM0TEMweE5pNHpOelVzTlRNekxqTXpNek16TXpNek16TXpNelFzTFRFeVF6VTRPQzQ0T0RnNE9EZzRPRGc0T0RnNUxDMDNMall5TlN3Mk1URXVNVEV4TVRFeE1URXhNVEV4TWl3ME1TNHdPRE16TXpNek16TXpNek16TXpZc05qWTJMalkyTmpZMk5qWTJOalkyTmpjc016bEROekl5TGpJeU1qSXlNakl5TWpJeU1qTXNNell1T1RFMk5qWTJOalkyTmpZMk5qWTBMRGMwTkM0ME5EUTBORFEwTkRRME5EUTFMQzB5Tnl3NE1EQXNMVEl5UXpnMU5TNDFOVFUxTlRVMU5UVTFOVFUxTEMweE55dzROemN1TnpjM056YzNOemMzTnpjM09DdzJOQzQwTlRnek16TXpNek16TXpNek15dzVNek11TXpNek16TXpNek16TXpNek5DdzJNME01T0RndU9EZzRPRGc0T0RnNE9EZzRPU3cyTVM0MU5ERTJOalkyTmpZMk5qWTJOalFzTVRBeE1TNHhNVEV4TVRFeE1URXhNVEV5TEMwek1DNDJOalkyTmpZMk5qWTJOalkyTmpnc01UQTJOaTQyTmpZMk5qWTJOalkyTmpZM0xDMHlPVU14TVRJeUxqSXlNakl5TWpJeU1qSXlNaklzTFRJM0xqTXpNek16TXpNek16TXpNek16TWl3eE1UUTBMalEwTkRRME5EUTBORFEwTkRNc05qY3VNalVzTVRJd01DdzNNVU14TWpVMUxqVTFOVFUxTlRVMU5UVTFOVGNzTnpRdU56VXNNVEkzTnk0M056YzNOemMzTnpjM056YzRMQzB4TlM0M09URTJOalkyTmpZMk5qWTJOamdzTVRNek15NHpNek16TXpNek16TXpNek0xTEMweE1VTXhNemc0TGpnNE9EZzRPRGc0T0RnNE9URXNMVFl1TWpBNE16TXpNek16TXpNek16TXpMREUwTVRFdU1URXhNVEV4TVRFeE1URXhNeXc0T1M0Mk1qVXNNVFEyTmk0Mk5qWTJOalkyTmpZMk5qWTNMRGswUXpFMU1qSXVNakl5TWpJeU1qSXlNakl5TWl3NU9DNHpOelVzTVRVME5DNDBORFEwTkRRME5EUTBORFF6TERFMkxqZzNOU3d4TmpBd0xERXdRekUyTlRVdU5UVTFOVFUxTlRVMU5UVTFOeXd6TGpFeU5Td3hOamMzTGpjM056YzNOemMzTnpjM056Z3NOakl1TURReE5qWTJOalkyTmpZMk5qWTBMREUzTXpNdU16TXpNek16TXpNek16TXpOU3cyTVVNeE56ZzRMamc0T0RnNE9EZzRPRGc0T1RFc05Ua3VPVFU0TXpNek16TXpNek16TXpNMkxERTRNVEV1TVRFeE1URXhNVEV4TVRFeExERXVOalkyTmpZMk5qWTJOalkyTmpZM0xERTROall1TmpZMk5qWTJOalkyTmpZMk55dzFRekU1TWpJdU1qSXlNakl5TWpJeU1qSXlOQ3c0TGpNek16TXpNek16TXpNek16TXpNaXd4T1RRMExqUTBORFEwTkRRME5EUTBORFlzTnpZdU1UWTJOalkyTmpZMk5qWTJOamNzTWpBd01DNHdNREF3TURBd01EQXdNREF5TERjM1F6SXdOVFV1TlRVMU5UVTFOVFUxTlRVMU55dzNOeTQ0TXpNek16TXpNek16TXpNek15d3lNRGMzTGpjM056YzNOemMzTnpjM09Dd3hMalVzTWpFek15NHpNek16TXpNek16TXpNek0xTERsRE1qRTRPQzQ0T0RnNE9EZzRPRGc0T0Rrc01UWXVOU3d5TWpFeExqRXhNVEV4TVRFeE1URXhNVE1zTVRFekxqZ3pNek16TXpNek16TXpNek16TERJeU5qWXVOalkyTmpZMk5qWTJOalkzTERFeE0wTXlNekl5TGpJeU1qSXlNakl5TWpJeU1qWXNNVEV5TGpFMk5qWTJOal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TlN3eE5qYzNMamMzTnpjM056YzNOemMzTnpnc05qSXVNRFF4TmpZMk5qWTJOalkyTmpZMExERTNNek11TXpNek16TXpNek16TXpNek5TdzJNVU14TnpnNExqZzRPRGc0T0RnNE9EZzRPVEVzTlRrdU9UVTRNek16TXpNek16TXpNek0yTERFNE1URXVNVEV4TVRFeE1URXhNVEV4TERFdU5qWTJOalkyTmpZMk5qWTJOalkzTERFNE5qWXVOalkyTmpZMk5qWTJOalkyTnl3MVF6RTVNakl1TWpJeU1qSXlNakl5TWpJeU5DdzRMak16TXpNek16TXpNek16TXpNek1pd3hPVFEwTGpRME5EUTBORFEwTkRRME5EWXNOell1TVRZMk5qWTJOalkyTmpZMk5qY3NNakF3TUM0d01EQXdNREF3TURBd01EQXlMRGMzUXpJd05UVXVOVFUxTlRVMU5UVTFOVFUxTnl3M055NDRNek16TXpNek16TXpNek16TXl3eU1EYzNMamMzTnpjM056YzNOemMzT0N3eExqVXNNakV6TXk0ek16TXpNek16TXpNek16TTFMRGxETWpFNE9DNDRPRGc0T0RnNE9EZzRPRGtzTVRZdU5Td3lNakV4TGpFeE1URXhNVEV4TVRFeE1UTXNNVEV6TGpnek16TXpNek16TXpNek16TXpMREl5TmpZdU5qWTJOalkyTmpZMk5qWTNMREV4TTBNeU16SXlMakl5TWpJeU1qSXlNakl5TWpZc01URXlMakUyTmpZMk5qWTJOalkyTmpZM0xESXpNakF1TVRNNE9EZzRPRGc0T0RnNUxDMDFOQzQzT1RFMk5qWTJOalkyTmpZMk55d3lOREF3TERWRE1qUTNPUzQ0TmpFeE1URXhNVEV4TVRFc05qUXVOemt4TmpZMk5qWTJOalkyTmpjc016STFOQzR4TmpZMk5qWTJOalkyTmpZMUxESXhNeTQxTkRFMk5qWTJOalkyTmpZMk9Td3lOalV3TERRd01FTXlNRFExTGpnek16TXpNek16TXpNek16VXNOVGcyTGpRMU9ETXpNek16TXpNek16TXNNVFUyTGpJMUxEYzVOUzQ0TXpNek16TXpNek16TXpNMExDMDF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W9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDgwIDgwIiB3aWR0aD0iODAiIGhlaWdodD0iODAiPjxzdHlsZT4uYXtmaWxsOiNlNjJ9LmJ7ZmlsbDojNmMwfS5je2ZpbGw6IzYzNn0uZHtmaWxsOiNlZDB9LmV7ZmlsbDojMzkwfTwvc3R5bGU+PHBhdGggY2xhc3M9ImEiIGQ9Im0xMS43IDIyLjNsMjguNi0xMy40djM1LjJsLTI4LjYgMTMuM3oiLz48cGF0aCBjbGFzcz0iYiIgZD0ibTY4LjMgMjIuNmwtMjgtMTMuN3YzNS4ybDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImMiIGQ9Im0zOS43IDcxLjFsLTI4LTEzLjcgMjguNi0xMy4zIDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImQiIGQ9Im02OC4zIDIyLjZsLTI4LTEzLjctMjguNiAxMy40IDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImIiIGQ9Im0xMS43IDIyLjNsMjggMTMuNnYzNS4ybC0yOC0xMy43eiIvPjxwYXRoIGNsYXNzPSJlIiBkPSJtNjguMyAyMi42bC0yOC42IDEzLjN2MzUuMmwyOC42LTEzLjR6Ii8+PC9zdmc+", featured: !0, disabled: !1, - collaborator: "LazyTong @ Github", + collaboratorList: [{ + collaborator: "LazyTong @ Github", + collaboratorURL: "https://github.com/lazytong-tech" + }], doc: "https://lt.js.org/posts/20240718" }, l10n: { From 26d5739738cd512e12905457d6ef98a7e8c61b13 Mon Sep 17 00:00:00 2001 From: LazyTong Date: Sat, 3 Aug 2024 17:43:28 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=E5=8F=98?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/LazyTong/Cube.js | 3426 ++++++++++++++++++----------------- 1 file changed, 1728 insertions(+), 1698 deletions(-) diff --git a/extensions/LazyTong/Cube.js b/extensions/LazyTong/Cube.js index cd088e21..9e6fd389 100644 --- a/extensions/LazyTong/Cube.js +++ b/extensions/LazyTong/Cube.js @@ -1,1716 +1,1746 @@ -const t = "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDgwIDgwIiB3aWR0aD0iODAiIGhlaWdodD0iODAiPjxzdHlsZT4uYXtmaWxsOiNlNjJ9LmJ7ZmlsbDojNmMwfS5je2ZpbGw6IzYzNn0uZHtmaWxsOiNlZDB9LmV7ZmlsbDojMzkwfTwvc3R5bGU+PHBhdGggY2xhc3M9ImEiIGQ9Im0xMS43IDIyLjNsMjguNi0xMy40djM1LjJsLTI4LjYgMTMuM3oiLz48cGF0aCBjbGFzcz0iYiIgZD0ibTY4LjMgMjIuNmwtMjgtMTMuN3YzNS4ybDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImMiIGQ9Im0zOS43IDcxLjFsLTI4LTEzLjcgMjguNi0xMy4zIDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImQiIGQ9Im02OC4zIDIyLjZsLTI4LTEzLjctMjguNiAxMy40IDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImIiIGQ9Im0xMS43IDIyLjNsMjggMTMuNnYzNS4ybC0yOC0xMy43eiIvPjxwYXRoIGNsYXNzPSJlIiBkPSJtNjguMyAyMi42bC0yOC42IDEzLjN2MzUuMmwyOC42LTEzLjR6Ii8+PC9zdmc+"; -void(window.tempExt = { - Extension: class { - constructor(e) { - this.objectList = {}, this.observer = null, this.runtime = e, this.canvas = () => { - try { - const { - canvas: e - } = this.runtime.renderer; - if (e instanceof HTMLCanvasElement) return e - } catch (e) { - return null - } - return null - }, this.cubeParent = () => { - try { - const { - canvas: e - } = this.runtime.renderer; - if (e instanceof HTMLCanvasElement) return e.parentElement - } catch (e) { - return console.error(e), null - } - return null - }, this.Cube = function() { - console.log("%cLazyTong's Cube\n \u3000 \u3000\u2583\u2586\u2588\u2587\u2584\u2596\n\u3000 \u3000 \u3000 \u259F\u25E4\u2596\u3000\u3000\u3000\u25E5\u2588\u258E\n \u3000 \u25E2\u25E4\u3000 \u2590\u3000\u3000\u3000 \u3000\u2590\u2589\n\u3000 \u2597\u25E4\u3000\u3000\u3000\u2582\u3000\u2597\u2596\u3000\u3000\u2595\u2588\u258E\n\u3000\u25E4\u3000\u2597\u2585\u2596\u25E5\u2584\u3000\u2580\u25E3\u3000\u3000\u2588\u258A\n\u2590\u3000\u2595\u258E\u25E5\u2596\u25E3\u25E4\u3000\u3000\u3000\u3000\u25E2\u2588\u2588\n\u2588\u25E3\u3000\u25E5\u2585\u2588\u2580\u3000\u3000\u3000\u3000\u2590\u2588\u2588\u25E4\n\u2590\u2588\u2599\u2582\u3000\u3000 \u3000\u25E2\u2588\u2588\u25E4\n\u25E5\u2588\u2588\u25E3\u3000\u3000\u3000\u3000\u25E2\u2584\u25E4\n \u3000\u3000\u2580\u2588\u2588\u2585\u2587\u2580\nVer 1.0.0\nhttps://lt.js.org ", "color:green;font-weight:bolder"); - let p = 2 * Math.PI, - n = function(e, t) { - for (let a in t) e[a] = t[a]; - return e - }, - i = function(e, t, a) { - return (t - e) * a + e - }, - c = function(a, e) { - return (a % e + e) % e - }, - s = function() {}, - o = {}; - o.begin = function(e) { - e.beginPath() - }, o.move = function(e, t, a) { - e.moveTo(a.x, a.y) - }, o.line = function(e, t, a) { - e.lineTo(a.x, a.y) - }, o.bezier = function(a, r, o, d, e) { - a.bezierCurveTo(o.x, o.y, d.x, d.y, e.x, e.y) - }, o.closePath = function(e) { - e.closePath() - }, o.setPath = function() {}, o.renderPath = function(d, a, t, r) { - this.begin(d, a), t.forEach(function(e) { - e.render(d, a, o) - }), r && this.closePath(d, a) - }, o.stroke = function(a, r, o, d, e) { - o && (a.strokeStyle = d, a.lineWidth = e, a.stroke()) - }, o.fill = function(t, a, r, o) { - r && (t.fillStyle = o, t.fill()) - }, o.end = function() {}; - let N = function(e) { - this.set(e) - }; - N.prototype.set = function(e) { - return this.x = e && e.x || 0, this.y = e && e.y || 0, this.z = e && e.z || 0, this - }, N.prototype.write = function(e) { - return e ? (this.x = null == e.x ? this.x : e.x, this.y = null == e.y ? this.y : e.y, this.z = null == e.z ? this.z : e.z, this) : this - }, N.prototype.rotate = function(e) { - if (e) return this.rotateZ(e.z), this.rotateY(e.y), this.rotateX(e.x), this - }, N.prototype.rotateZ = function(e) { - R(this, e, "x", "y") - }, N.prototype.rotateX = function(e) { - R(this, e, "y", "z") - }, N.prototype.rotateY = function(e) { - R(this, e, "x", "z") - }; - let R = function(T, l, a, e) { - if (l && 0 != l % p) { - let t = Math.cos(l), - r = Math.sin(l), - o = T[a], - d = T[e]; - T[a] = o * t - d * r, T[e] = d * t + o * r - } - }; - N.prototype.isSame = function(e) { - return !!e && this.x === e.x && this.y === e.y && this.z === e.z - }, N.prototype.add = function(e) { - return e ? (this.x += e.x || 0, this.y += e.y || 0, this.z += e.z || 0, this) : this - }, N.prototype.subtract = function(e) { - return e ? (this.x -= e.x || 0, this.y -= e.y || 0, this.z -= e.z || 0, this) : this - }, N.prototype.multiply = function(e) { - return null == e ? this : ("number" == typeof e ? (this.x *= e, this.y *= e, this.z *= e) : (this.x *= null == e.x ? 1 : e.x, this.y *= null == e.y ? 1 : e.y, this.z *= null == e.z ? 1 : e.z), this) - }, N.prototype.transform = function(e, t, a) { - return this.multiply(a), this.rotate(t), this.add(e), this - }, N.prototype.lerp = function(a, e) { - return this.x = i(this.x, a.x || 0, e), this.y = i(this.y, a.y || 0, e), this.z = i(this.z, a.z || 0, e), this - }, N.prototype.magnitude = function() { - let e = this.x * this.x + this.y * this.y + this.z * this.z; - return u(e) - }; - let u = function(e) { - return 1e-8 > Math.abs(e - 1) ? 1 : Math.sqrt(e) - }; - N.prototype.magnitude2d = function() { - let e = this.x * this.x + this.y * this.y; - return u(e) - }, N.prototype.copy = function() { - return new N(this) - }; - let r = { - x: 1, - y: 1, - z: 1 - }, - a = function(e) { - this.create(e || {}) - }; - a.prototype.create = function(e) { - this.children = [], n(this, this.constructor.defaults), this.setOptions(e), this.translate = new N(e.translate), this.rotate = new N(e.rotate), this.scale = new N(r).multiply(this.scale), this.origin = new N, this.renderOrigin = new N, this.addTo && this.addTo.addChild(this) - }, a.defaults = {}, a.optionKeys = Object.keys(a.defaults).concat(["rotate", "translate", "scale", "addTo"]), a.prototype.setOptions = function(e) { - let t = this.constructor.optionKeys; - for (let a in e) - 1 != t.indexOf(a) && (this[a] = e[a]) - }, a.prototype.addChild = function(e) { - -1 != this.children.indexOf(e) || (e.remove(), e.addTo = this, this.children.push(e)) - }, a.prototype.removeChild = function(a) { - let e = this.children.indexOf(a); - 1 != e && this.children.splice(e, 1) - }, a.prototype.remove = function() { - this.addTo && this.addTo.removeChild(this) - }, a.prototype.update = function() { - this.reset(), this.children.forEach(function(e) { - e.update() - }), this.transform(this.translate, this.rotate, this.scale) - }, a.prototype.reset = function() { - this.renderOrigin.set(this.origin) - }, a.prototype.transform = function(t, a, r) { - this.renderOrigin.transform(t, a, r), this.children.forEach(function(o) { - o.transform(t, a, r) - }) - }, a.prototype.updateGraph = function() { - this.update(), this.updateFlatGraph(), this.flatGraph.forEach(function(e) { - e.updateSortValue() - }), this.flatGraph.sort(a.shapeSorter) - }, a.shapeSorter = function(a, e) { - return a.sortValue - e.sortValue - }, Object.defineProperty(a.prototype, "flatGraph", { - get: function() { - return this._flatGraph || this.updateFlatGraph(), this._flatGraph - }, - set: function(e) { - this._flatGraph = e - } - }), a.prototype.updateFlatGraph = function() { - this.flatGraph = this.getFlatGraph() - }, a.prototype.getFlatGraph = function() { - let e = [this]; - return this.addChildFlatGraph(e) - }, a.prototype.addChildFlatGraph = function(e) { - return this.children.forEach(function(t) { - let a = t.getFlatGraph(); - Array.prototype.push.apply(e, a) - }), e - }, a.prototype.updateSortValue = function() { - this.sortValue = this.renderOrigin.z - }, a.prototype.render = function() {}, a.prototype.renderGraphCanvas = function(a) { - if (!a) throw new Error("[Cube]\u672A\u63D0\u4F9B\u6E32\u67D3\u4E0A\u4E0B\u6587"); - this.flatGraph.forEach(function(e) { - e.render(a, o) - }) - }, a.prototype.copy = function(e) { - let a = {}, - r = this.constructor.optionKeys; - r.forEach(function(e) { - a[e] = this[e] - }, this), n(a, e); - let o = this.constructor; - return new o(a) - }, a.prototype.copyGraph = function(e) { - let a = this.copy(e); - return this.children.forEach(function(e) { - e.copyGraph({ - addTo: a +const icon = "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDgwIDgwIiB3aWR0aD0iODAiIGhlaWdodD0iODAiPjxzdHlsZT4uYXtmaWxsOiNlNjJ9LmJ7ZmlsbDojNmMwfS5je2ZpbGw6IzYzNn0uZHtmaWxsOiNlZDB9LmV7ZmlsbDojMzkwfTwvc3R5bGU+PHBhdGggY2xhc3M9ImEiIGQ9Im0xMS43IDIyLjNsMjguNi0xMy40djM1LjJsLTI4LjYgMTMuM3oiLz48cGF0aCBjbGFzcz0iYiIgZD0ibTY4LjMgMjIuNmwtMjgtMTMuN3YzNS4ybDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImMiIGQ9Im0zOS43IDcxLjFsLTI4LTEzLjcgMjguNi0xMy4zIDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImQiIGQ9Im02OC4zIDIyLjZsLTI4LTEzLjctMjguNiAxMy40IDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImIiIGQ9Im0xMS43IDIyLjNsMjggMTMuNnYzNS4ybC0yOC0xMy43eiIvPjxwYXRoIGNsYXNzPSJlIiBkPSJtNjguMyAyMi42bC0yOC42IDEzLjN2MzUuMmwyOC42LTEzLjR6Ii8+PC9zdmc+"; +void (window.tempExt = { + Extension: class { + constructor(e) { + this.objectList = {}, this.runtime = e, this.canvas = () => { + try { + const { + canvas: e + } = this.runtime.renderer; + if (e instanceof HTMLCanvasElement) return e + } catch (e) { + return null + } + return null + }, this.cubeParent = () => { + try { + const { + canvas: e + } = this.runtime.renderer; + if (e instanceof HTMLCanvasElement) return e.parentElement + } catch (e) { + return console.error(e), null + } + return null + }, this.Cube = function () { + console.log("%cLazyTong's Cube\n    ▃▆█▇▄▖\n      ▟◤▖   ◥█▎\n   ◢◤  ▐     ▐▉\n  ▗◤   ▂ ▗▖  ▕█▎\n ◤ ▗▅▖◥▄ ▀◣  █▊\n▐ ▕▎◥▖◣◤    ◢██\n█◣ ◥▅█▀    ▐██◤\n▐█▙▂    ◢██◤\n◥██◣    ◢▄◤\n   ▀██▅▇▀\nVer 1.0.2\nhttps://lt.js.org ", "color:green;font-weight:bolder"); + let p = 2 * Math.PI, + n = function (e, t) { + for (let a in t) e[a] = t[a]; + return e + }, + i = function (e, t, a) { + return (t - e) * a + e + }, + c = function (a, e) { + return (a % e + e) % e + }, + s = function () { + }, + o = {}; + o.begin = function (e) { + e.beginPath() + }, o.move = function (e, t, a) { + e.moveTo(a.x, a.y) + }, o.line = function (e, t, a) { + e.lineTo(a.x, a.y) + }, o.bezier = function (a, r, o, d, e) { + a.bezierCurveTo(o.x, o.y, d.x, d.y, e.x, e.y) + }, o.closePath = function (e) { + e.closePath() + }, o.setPath = function () { + }, o.renderPath = function (d, a, t, r) { + this.begin(d, a), t.forEach(function (e) { + e.render(d, a, o) + }), r && this.closePath(d, a) + }, o.stroke = function (a, r, o, d, e) { + o && (a.strokeStyle = d, a.lineWidth = e, a.stroke()) + }, o.fill = function (t, a, r, o) { + r && (t.fillStyle = o, t.fill()) + }, o.end = function () { + }; + let N = function (e) { + this.set(e) + }; + N.prototype.set = function (e) { + return this.x = e && e.x || 0, this.y = e && e.y || 0, this.z = e && e.z || 0, this + }, N.prototype.write = function (e) { + return e ? (this.x = null == e.x ? this.x : e.x, this.y = null == e.y ? this.y : e.y, this.z = null == e.z ? this.z : e.z, this) : this + }, N.prototype.rotate = function (e) { + if (e) return this.rotateZ(e.z), this.rotateY(e.y), this.rotateX(e.x), this + }, N.prototype.rotateZ = function (e) { + R(this, e, "x", "y") + }, N.prototype.rotateX = function (e) { + R(this, e, "y", "z") + }, N.prototype.rotateY = function (e) { + R(this, e, "x", "z") + }; + let R = function (T, l, a, e) { + if (l && 0 != l % p) { + let t = Math.cos(l), + r = Math.sin(l), + o = T[a], + d = T[e]; + T[a] = o * t - d * r, T[e] = d * t + o * r + } + }; + N.prototype.isSame = function (e) { + return !!e && this.x === e.x && this.y === e.y && this.z === e.z + }, N.prototype.add = function (e) { + return e ? (this.x += e.x || 0, this.y += e.y || 0, this.z += e.z || 0, this) : this + }, N.prototype.subtract = function (e) { + return e ? (this.x -= e.x || 0, this.y -= e.y || 0, this.z -= e.z || 0, this) : this + }, N.prototype.multiply = function (e) { + return null == e ? this : ("number" == typeof e ? (this.x *= e, this.y *= e, this.z *= e) : (this.x *= null == e.x ? 1 : e.x, this.y *= null == e.y ? 1 : e.y, this.z *= null == e.z ? 1 : e.z), this) + }, N.prototype.transform = function (e, t, a) { + return this.multiply(a), this.rotate(t), this.add(e), this + }, N.prototype.lerp = function (a, e) { + return this.x = i(this.x, a.x || 0, e), this.y = i(this.y, a.y || 0, e), this.z = i(this.z, a.z || 0, e), this + }, N.prototype.magnitude = function () { + let e = this.x * this.x + this.y * this.y + this.z * this.z; + return u(e) + }; + let u = function (e) { + return 1e-8 > Math.abs(e - 1) ? 1 : Math.sqrt(e) + }; + N.prototype.magnitude2d = function () { + let e = this.x * this.x + this.y * this.y; + return u(e) + }, N.prototype.copy = function () { + return new N(this) + }; + let r = { + x: 1, + y: 1, + z: 1 + }, + a = function (e) { + this.create(e || {}) + }; + a.prototype.create = function (e) { + this.children = [], n(this, this.constructor.defaults), this.setOptions(e), this.translate = new N(e.translate), this.rotate = new N(e.rotate), this.scale = new N(r).multiply(this.scale), this.origin = new N, this.renderOrigin = new N, this.addTo && this.addTo.addChild(this) + }, a.defaults = {}, a.optionKeys = Object.keys(a.defaults).concat(["rotate", "translate", "scale", "addTo"]), a.prototype.setOptions = function (e) { + let t = this.constructor.optionKeys; + for (let a in e) -1 != t.indexOf(a) && (this[a] = e[a]) + }, a.prototype.addChild = function (e) { + -1 != this.children.indexOf(e) || (e.remove(), e.addTo = this, this.children.push(e)) + }, a.prototype.removeChild = function (a) { + let e = this.children.indexOf(a); + -1 != e && this.children.splice(e, 1) + }, a.prototype.remove = function () { + this.addTo && this.addTo.removeChild(this) + }, a.prototype.update = function () { + this.reset(), this.children.forEach(function (e) { + e.update() + }), this.transform(this.translate, this.rotate, this.scale) + }, a.prototype.reset = function () { + this.renderOrigin.set(this.origin) + }, a.prototype.transform = function (t, a, r) { + this.renderOrigin.transform(t, a, r), this.children.forEach(function (o) { + o.transform(t, a, r) + }) + }, a.prototype.updateGraph = function () { + this.update(), this.updateFlatGraph(), this.flatGraph.forEach(function (e) { + e.updateSortValue() + }), this.flatGraph.sort(a.shapeSorter) + }, a.shapeSorter = function (a, e) { + return a.sortValue - e.sortValue + }, Object.defineProperty(a.prototype, "flatGraph", { + get: function () { + return this._flatGraph || this.updateFlatGraph(), this._flatGraph + }, + set: function (e) { + this._flatGraph = e + } + }), a.prototype.updateFlatGraph = function () { + this.flatGraph = this.getFlatGraph() + }, a.prototype.getFlatGraph = function () { + let e = [this]; + return this.addChildFlatGraph(e) + }, a.prototype.addChildFlatGraph = function (e) { + return this.children.forEach(function (t) { + let a = t.getFlatGraph(); + Array.prototype.push.apply(e, a) + }), e + }, a.prototype.updateSortValue = function () { + this.sortValue = this.renderOrigin.z + }, a.prototype.render = function () { + }, a.prototype.renderGraphCanvas = function (a) { + if (!a) throw new Error("[Cube]\u672A\u63D0\u4F9B\u6E32\u67D3\u4E0A\u4E0B\u6587"); + this.flatGraph.forEach(function (e) { + e.render(a, o) + }) + }, a.prototype.copy = function (e) { + let a = {}, + r = this.constructor.optionKeys; + r.forEach(function (e) { + a[e] = this[e] + }, this), n(a, e); + let o = this.constructor; + return new o(a) + }, a.prototype.copyGraph = function (e) { + let a = this.copy(e); + return this.children.forEach(function (e) { + e.copyGraph({ + addTo: a + }) + }), a + }, a.prototype.normalizeRotate = function () { + this.rotate.x = c(this.rotate.x, p), this.rotate.y = c(this.rotate.y, p), this.rotate.z = c(this.rotate.z, p) + }; + let d = function (e) { + return function (a) { + let r = function (e) { + this.create(e || {}) + }; + return r.prototype = Object.create(e.prototype), r.prototype.constructor = r, r.defaults = n({}, e.defaults), n(r.defaults, a), r.optionKeys = e.optionKeys.slice(0), Object.keys(r.defaults).forEach(function (t) { + 1 != !r.optionKeys.indexOf(t) && r.optionKeys.push(t) + }), r.subclass = d(r), r + } + }; + a.subclass = d(a); + let T = "undefined" != typeof window, + e = "mousedown", + k = "mousemove", + S = "mouseup"; + T && (window.PointerEvent ? (e = "pointerdown", k = "pointermove", S = "pointerup") : "ontouchstart" in window && (e = "touchstart", k = "touchmove", S = "touchend")); + let j = function (e) { + this.create(e || {}) + }; + j.prototype.create = function (t) { + this.onDragStart = t.onDragStart || s, this.onDragMove = t.onDragMove || s, this.onDragEnd = t.onDragEnd || s, this.bindDrag(t.startElement) + }, j.prototype.bindDrag = function (t) { + t = this.getQueryElement(t), t && (t.style.touchAction = "none", t.addEventListener(e, this)) + }, j.prototype.getQueryElement = function (e) { + return "string" == typeof e && (e = document.querySelector(e)), e + }, j.prototype.handleEvent = function (a) { + let e = this["on" + a.type]; + e && e.call(this, a) + }, j.prototype.onmousedown = j.prototype.onpointerdown = function (e) { + this.dragStart(e, e) + }, j.prototype.ontouchstart = function (e) { + this.dragStart(e, e.changedTouches[0]) + }, j.prototype.dragStart = function (e, t) { + e.preventDefault(), this.dragStartX = t.pageX, this.dragStartY = t.pageY, T && (window.addEventListener(k, this), window.addEventListener(S, this)), this.onDragStart(t) + }, j.prototype.ontouchmove = function (e) { + this.dragMove(e, e.changedTouches[0]) + }, j.prototype.onmousemove = j.prototype.onpointermove = function (e) { + this.dragMove(e, e) + }, j.prototype.dragMove = function (t, a) { + t.preventDefault(); + let r = a.pageX - this.dragStartX, + o = a.pageY - this.dragStartY; + this.onDragMove(a, r, o) + }, j.prototype.onmouseup = j.prototype.onpointerup = j.prototype.ontouchend = j.prototype.dragEnd = function () { + window.removeEventListener(k, this), window.removeEventListener(S, this), this.onDragEnd() + }; + let init = a.subclass({ + element: void 0, + centered: !0, + zoom: 1, + dragRotate: !1, + resize: !1, + onPrerender: s, + onDragStart: s, + onDragMove: s, + onDragEnd: s, + onResize: s + }); + n(init.prototype, j.prototype), init.prototype.create = function (e) { + a.prototype.create.call(this, e), j.prototype.create.call(this, e), this.setElement(this.element), this.setDragRotate(this.dragRotate), this.setResize(this.resize) + }, init.prototype.setElement = function (e) { + if (e = this.element, !e) throw new Error("[Cube]\u672A\u6307\u5B9A\u5143\u7D20"); + this.setCanvas(e) + }, init.prototype.setSize = function (e, t) { + e = Math.round(e), t = Math.round(t), this.setSizeCanvas(e, t) + }, init.prototype.setResize = function (e) { + this.resize = e, this.resizeListener || (this.resizeListener = this.onWindowResize.bind(this)), e ? (window.addEventListener("resize", this.resizeListener), this.onWindowResize()) : window.removeEventListener("resize", this.resizeListener) + }, init.prototype.onWindowResize = function () { + this.setMeasuredSize(), this.onResize(this.width, this.height) + }, init.prototype.setMeasuredSize = function () { + let t, a, e = "fullscreen" == this.resize; + if (e) t = window.innerWidth, a = window.innerHeight; + else { + let r = this.element.getBoundingClientRect(); + t = r.width, a = r.height + } + this.setSize(t, a) + }, init.prototype.renderGraph = function (e) { + this.renderGraphCanvas(e) + }, init.prototype.updateRenderGraph = function (e) { + this.updateGraph(), this.renderGraph(e) + }, init.prototype.setCanvas = function (e) { + this.element = e, this.ctx = this.element.getContext("2d"), this.setSizeCanvas(e.width, e.height) + }, init.prototype.setSizeCanvas = function (t, a) { + this.width = t, this.height = a; + let r = this.pixelRatio = window.devicePixelRatio || 1; + this.element.width = this.canvasWidth = t * r, this.element.height = this.canvasHeight = a * r; + let o = 1 < r && !this.resize; + o && (this.element.style.width = t + "px", this.element.style.height = a + "px") + }, init.prototype.renderGraphCanvas = function (e) { + e = e || this, this.prerenderCanvas(), a.prototype.renderGraphCanvas.call(e, this.ctx), this.postrenderCanvas() + }, init.prototype.prerenderCanvas = function () { + let r = this.ctx; + if (r.lineCap = "round", r.lineJoin = "round", r.clearRect(0, 0, this.canvasWidth, this.canvasHeight), r.save(), this.centered) { + let e = this.width / 2 * this.pixelRatio, + t = this.height / 2 * this.pixelRatio; + r.translate(e, t) + } + let t = this.pixelRatio * this.zoom; + r.scale(t, t), this.onPrerender(r) + }, init.prototype.postrenderCanvas = function () { + this.ctx.restore() + }, init.prototype.setDragRotate = function (e) { + e && (!0 === e && (e = this), this.dragRotate = e, this.bindDrag(this.element)) + }, init.prototype.dragStart = function () { + this.dragStartRX = this.dragRotate.rotate.x, this.dragStartRY = this.dragRotate.rotate.y, j.prototype.dragStart.apply(this, arguments) + }, init.prototype.dragMove = function (r, o) { + let d = o.pageX - this.dragStartX, + e = o.pageY - this.dragStartY, + t = Math.min(this.width, this.height); + this.dragRotate.rotate.x = this.dragStartRX - e / t * p, this.dragRotate.rotate.y = this.dragStartRY - d / t * p, j.prototype.dragMove.apply(this, arguments) + }; + let w = function (e, t, a) { + this.method = e, this.points = t.map(D), this.renderPoints = t.map(M), this.previousPoint = a, this.endRenderPoint = this.renderPoints[this.renderPoints.length - 1], "arc" == e && (this.controlPoints = [new N, new N]) + }, + D = function (e) { + return e instanceof N ? e : new N(e) + }, + M = function (e) { + return new N(e) + }; + w.prototype.reset = function () { + let t = this.points; + this.renderPoints.forEach(function (a, r) { + let o = t[r]; + a.set(o) + }) + }, w.prototype.transform = function (t, a, r) { + this.renderPoints.forEach(function (o) { + o.transform(t, a, r) + }) + }, w.prototype.render = function (e, t, a) { + return this[this.method](e, t, a) + }, w.prototype.move = function (e, t, a) { + return a.move(e, t, this.renderPoints[0]) + }, w.prototype.line = function (e, t, a) { + return a.line(e, t, this.renderPoints[0]) + }, w.prototype.bezier = function (r, o, d) { + let l = this.renderPoints[0], + e = this.renderPoints[1], + t = this.renderPoints[2]; + return d.bezier(r, o, l, e, t) + }; + let V = 9 / 16; + w.prototype.arc = function (d, p, T) { + let l = this.previousPoint, + e = this.renderPoints[0], + t = this.renderPoints[1], + a = this.controlPoints[0], + r = this.controlPoints[1]; + return a.set(l).lerp(e, V), r.set(t).lerp(e, V), T.bezier(d, p, a, r, t) + }; + let custom = a.subclass({ + stroke: 1, + fill: !1, + color: "#333", + closed: !0, + visible: !0, + path: [{}], + front: { + z: 1 + }, + backface: !0 + }); + custom.prototype.create = function (e) { + this.path = e, a.prototype.create.call(this, e), this.updatePath(), this.front = new N(e.front || this.front), this.renderFront = new N(this.front), this.renderNormal = new N + }; + let m = ["move", "line", "bezier", "arc"]; + custom.prototype.updatePath = function () { + this.setPath(), this.updatePathCommands() + }, custom.prototype.setPath = function () { + }, custom.prototype.updatePathCommands = function () { + let a; + this.pathCommands = this.path.map(function (r, o) { + let d = Object.keys(r), + e = d[0], + T = r[e], + n = 1 == d.length && -1 != m.indexOf(e); + n || (e = "line", T = r); + let c = "line" == e || "move" == e, + i = Array.isArray(T); + c && !i && (T = [T]), e = 0 === o ? "move" : e; + let s = new w(e, T, a); + return a = s.endRenderPoint, s + }) + }, custom.prototype.reset = function () { + this.renderOrigin.set(this.origin), this.renderFront.set(this.front), this.pathCommands.forEach(function (e) { + e.reset() + }) + }, custom.prototype.transform = function (t, a, r) { + this.renderOrigin.transform(t, a, r), this.renderFront.transform(t, a, r), this.renderNormal.set(this.renderOrigin).subtract(this.renderFront), this.pathCommands.forEach(function (o) { + o.transform(t, a, r) + }), this.children.forEach(function (o) { + o.transform(t, a, r) + }) + }, custom.prototype.updateSortValue = function () { + let t = this.pathCommands.length, + a = this.pathCommands[0].endRenderPoint, + o = this.pathCommands[t - 1].endRenderPoint, + e = 2 < t && a.isSame(o); + e && (t -= 1); + let d = 0; + for (let a = 0; a < t; a++) d += this.pathCommands[a].endRenderPoint.z; + this.sortValue = d / t + }, custom.prototype.render = function (e, t) { + let a = this.pathCommands.length; + if (this.visible && a && (this.isFacingBack = 0 < this.renderNormal.z, this.backface || !this.isFacingBack)) { + if (!t) throw new Error("[Cube]\u672A\u63D0\u4F9B\u6E32\u67D3\u5668"); + t.isCanvas && 1 == a ? this.renderCanvasDot(e, t) : this.renderPath(e, t) + } + }, custom.prototype.renderCanvasDot = function (t) { + let a = this.getLineWidth(); + if (a) { + t.fillStyle = this.getRenderColor(); + let r = this.pathCommands[0].endRenderPoint; + t.beginPath(), t.arc(r.x, r.y, a / 2, 0, p), t.fill() + } + }, custom.prototype.getLineWidth = function () { + return this.stroke ? !0 == this.stroke ? 1 : this.stroke : 0 + }, custom.prototype.getRenderColor = function () { + let a = "string" == typeof this.backface && this.isFacingBack, + e = a ? this.backface : this.color; + return e + }, custom.prototype.renderPath = function (r, o) { + let d, l = 2 == this.pathCommands.length && "line" == this.pathCommands[1].method, + e = !l && this.closed, + t = this.getRenderColor(); + o.renderPath(r, d, this.pathCommands, e), o.stroke(r, d, this.stroke, t, this.getLineWidth()), o.fill(r, d, this.fill, t), o.end(r, d) + }; + let y = a.subclass({ + updateSort: !1, + visible: !0 + }); + y.prototype.updateSortValue = function () { + let r = 0; + this.flatGraph.forEach(function (e) { + e.updateSortValue(), r += e.sortValue + }), this.sortValue = r / this.flatGraph.length, this.updateSort && this.flatGraph.sort(a.shapeSorter) + }, y.prototype.render = function (e, t) { + this.visible && this.flatGraph.forEach(function (a) { + a.render(e, t) + }) + }, y.prototype.updateFlatGraph = function () { + this.flatGraph = this.addChildFlatGraph([]) + }, y.prototype.getFlatGraph = function () { + return [this] + }; + let rect = custom.subclass({ + width: 1, + height: 1 + }); + rect.prototype.setPath = function () { + let a = this.width / 2, + e = this.height / 2; + this.path = [{ + x: -a, + y: -e + }, { + x: a, + y: -e + }, { + x: a, + y: e + }, { + x: -a, + y: e + }] + }; + let roundedEect = custom.subclass({ + width: 1, + height: 1, + cornerRadius: .25, + closed: !1 + }); + roundedEect.prototype.setPath = function () { + let o = this.width / 2, + d = this.height / 2, + l = Math.min(o, d), + p = Math.min(this.cornerRadius, l), + e = o - p, + t = d - p, + a = [{ + x: e, + y: -d + }, { + arc: [{ + x: o, + y: -d + }, { + x: o, + y: -t + }] + }]; + t && a.push({ + x: o, + y: t + }), a.push({ + arc: [{ + x: o, + y: d + }, { + x: e, + y: d + }] + }), e && a.push({ + x: -e, + y: d + }), a.push({ + arc: [{ + x: -o, + y: d + }, { + x: -o, + y: t + }] + }), t && a.push({ + x: -o, + y: -t + }), a.push({ + arc: [{ + x: -o, + y: -d + }, { + x: -e, + y: -d + }] + }), e && a.push({ + x: e, + y: -d + }), this.path = a + }; + let ellipse = custom.subclass({ + diameter: 1, + width: void 0, + height: void 0, + quarters: 4, + closed: !1 + }); + ellipse.prototype.setPath = function () { + let t = null == this.width ? this.diameter : this.width, + a = null == this.height ? this.diameter : this.height, + r = t / 2, + o = a / 2; + this.path = [{ + x: 0, + y: -o + }, { + arc: [{ + x: r, + y: -o + }, { + x: r, + y: 0 + }] + }], 1 < this.quarters && this.path.push({ + arc: [{ + x: r, + y: o + }, { + x: 0, + y: o + }] + }), 2 < this.quarters && this.path.push({ + arc: [{ + x: -r, + y: o + }, { + x: -r, + y: 0 + }] + }), 3 < this.quarters && this.path.push({ + arc: [{ + x: -r, + y: -o + }, { + x: 0, + y: -o + }] + }) + }; + let polygon = custom.subclass({ + sides: 3, + radius: .5 + }); + polygon.prototype.setPath = function () { + this.path = []; + for (let a = 0; a < this.sides; a++) { + let r = a / this.sides * p - p / 4, + o = Math.cos(r) * this.radius, + e = Math.sin(r) * this.radius; + this.path.push({ + x: o, + y: e + }) + } + }; + let hemisphere = ellipse.subclass({ + fill: !0 + }); + hemisphere.prototype.create = function () { + ellipse.prototype.create.apply(this, arguments), this.apex = new a({ + addTo: this, + translate: { + z: this.diameter / 2 + } + }), this.renderCentroid = new N + }, hemisphere.prototype.updateSortValue = function () { + this.renderCentroid.set(this.renderOrigin).lerp(this.apex.renderOrigin, 3 / 8), this.sortValue = this.renderCentroid.z + }, hemisphere.prototype.render = function (a, e) { + this.renderDome(a, e), ellipse.prototype.render.apply(this, arguments) + }, hemisphere.prototype.renderDome = function (o, d) { + if (this.visible) { + let l = this.getDomeRenderElement(o, d), + p = Math.atan2(this.renderNormal.y, this.renderNormal.x), + e = this.diameter / 2 * this.renderNormal.magnitude(), + t = this.renderOrigin.x, + a = this.renderOrigin.y; + d.stroke(o, l, this.stroke, this.color, this.getLineWidth()), d.fill(o, l, this.fill, this.color), d.end(o, l) + } + }; + let g = y.subclass({ + color: "#333", + updateSort: !0 + }); + g.prototype.create = function () { + y.prototype.create.apply(this, arguments), this.pathCommands = [new w("move", [{}]), new w("line", [{}])] + }, g.prototype.render = function (a, e) { + this.renderCylinderSurface(a, e), y.prototype.render.apply(this, arguments) + }, g.prototype.renderCylinderSurface = function (o, d) { + if (this.visible) { + let l, p = this.frontBase, + e = this.rearBase, + t = p.renderNormal.magnitude(), + a = p.diameter * t + p.getLineWidth(); + this.pathCommands[0].renderPoints[0].set(p.renderOrigin), this.pathCommands[1].renderPoints[0].set(e.renderOrigin), d.renderPath(o, l, this.pathCommands), d.stroke(o, l, !0, this.color, a), d.end(o, l) + } + }, g.prototype.copyGraph = s; + let f = ellipse.subclass(); + f.prototype.copyGraph = s; + let cylinder = custom.subclass({ + diameter: 1, + length: 1, + frontFace: void 0, + fill: !0 + }); + cylinder.prototype.create = function () { + custom.prototype.create.apply(this, arguments), this.group = new g({ + addTo: this, + color: this.color, + visible: this.visible + }); + let e = this.length / 2, + t = this.backface || !0; + this.frontBase = this.group.frontBase = new ellipse({ + addTo: this.group, + diameter: this.diameter, + translate: { + z: e + }, + rotate: { + y: p / 2 + }, + color: this.color, + stroke: this.stroke, + fill: this.fill, + backface: this.frontFace || t, + visible: this.visible + }), this.rearBase = this.group.rearBase = this.frontBase.copy({ + translate: { + z: -e + }, + rotate: { + y: 0 + }, + backface: t + }) + }, cylinder.prototype.render = function () { + }, ["stroke", "fill", "color", "visible"].forEach(function (e) { + let t = "_" + e; + Object.defineProperty(cylinder.prototype, e, { + get: function () { + return this[t] + }, + set: function (a) { + this[t] = a, this.frontBase && (this.frontBase[e] = a, this.rearBase[e] = a, this.group[e] = a) + } + }) + }); + let cone = ellipse.subclass({ + length: 1, + fill: !0 + }); + cone.prototype.create = function () { + ellipse.prototype.create.apply(this, arguments), this.apex = new a({ + addTo: this, + translate: { + z: this.length + } + }), this.renderApex = new N, this.renderCentroid = new N, this.tangentA = new N, this.tangentB = new N, this.surfacePathCommands = [new w("move", [{}]), new w("line", [{}]), new w("line", [{}])] + }, cone.prototype.updateSortValue = function () { + this.renderCentroid.set(this.renderOrigin).lerp(this.apex.renderOrigin, 1 / 3), this.sortValue = this.renderCentroid.z + }, cone.prototype.render = function (a, e) { + this.renderConeSurface(a, e), ellipse.prototype.render.apply(this, arguments) + }, cone.prototype.renderConeSurface = function (d, l) { + if (this.visible) { + this.renderApex.set(this.apex.renderOrigin).subtract(this.renderOrigin); + let r = this.renderNormal.magnitude(), + T = this.renderApex.magnitude2d(), + e = this.renderNormal.magnitude2d(), + t = Math.acos(e / r), + n = Math.sin(t), + i = this.diameter / 2 * r; + if (i * n < T) { + let c = Math.atan2(this.renderNormal.y, this.renderNormal.x) + p / 2, + e = Math.acos(i / (T / n)), + t = this.tangentA, + a = this.tangentB; + t.x = Math.cos(e) * i * n, t.y = Math.sin(e) * i, a.set(this.tangentA), a.y *= -1, t.rotateZ(c), a.rotateZ(c), t.add(this.renderOrigin), a.add(this.renderOrigin), this.setSurfaceRenderPoint(0, t), this.setSurfaceRenderPoint(1, this.apex.renderOrigin), this.setSurfaceRenderPoint(2, a); + let r = this.getSurfaceRenderElement(d, l); + l.renderPath(d, r, this.surfacePathCommands), l.stroke(d, r, this.stroke, this.color, this.getLineWidth()), l.fill(d, r, this.fill, this.color), l.end(d, r) + } + } + }, cone.prototype.setSurfaceRenderPoint = function (e, t) { + let a = this.surfacePathCommands[e].renderPoints[0]; + a.set(t) + }; + let O = rect.subclass(); + O.prototype.copyGraph = function () { + }; + let W = ["frontFace", "rearFace", "leftFace", "rightFace", "topFace", "bottomFace"], + Z = n({}, custom.defaults); + delete Z.path, W.forEach(function (e) { + Z[e] = !0 + }), n(Z, { + width: 1, + height: 1, + depth: 1, + fill: !0 + }); + let box = a.subclass(Z); + return box.prototype.create = function (e) { + a.prototype.create.call(this, e), this.updatePath(), this.fill = this.fill + }, box.prototype.updatePath = function () { + W.forEach(function (e) { + this[e] = this[e] + }, this) + }, W.forEach(function (e) { + let t = "_" + e; + Object.defineProperty(box.prototype, e, { + get: function () { + return this[t] + }, + set: function (a) { + this[t] = a, this.setFace(e, a) + } + }) + }), box.prototype.setFace = function (t, a) { + let r = t + "Rect", + o = this[r]; + if (!a) return void this.removeChild(o); + let d = this.getFaceOptions(t); + d.color = "string" == typeof a ? a : this.color, o ? o.setOptions(d) : o = this[r] = new O(d), o.updatePath(), this.addChild(o) + }, box.prototype.getFaceOptions = function (t) { + return { + frontFace: { + width: this.width, + height: this.height, + translate: { + z: this.depth / 2 + } + }, + rearFace: { + width: this.width, + height: this.height, + translate: { + z: -this.depth / 2 + }, + rotate: { + y: p / 2 + } + }, + leftFace: { + width: this.depth, + height: this.height, + translate: { + x: -this.width / 2 + }, + rotate: { + y: -p / 4 + } + }, + rightFace: { + width: this.depth, + height: this.height, + translate: { + x: this.width / 2 + }, + rotate: { + y: p / 4 + } + }, + topFace: { + width: this.width, + height: this.depth, + translate: { + y: -this.height / 2 + }, + rotate: { + x: -p / 4 + } + }, + bottomFace: { + width: this.width, + height: this.depth, + translate: { + y: this.height / 2 + }, + rotate: { + x: p / 4 + } + } + } [t] + }, ["color", "stroke", "fill", "backface", "front", "visible"].forEach(function (t) { + let a = "_" + t; + Object.defineProperty(box.prototype, t, { + get: function () { + return this[a] + }, + set: function (l) { + this[a] = l, W.forEach(function (a) { + let r = this[a + "Rect"], + o = "string" == typeof this[a]; + r && !("color" == t && o) && (r[t] = l) + }, this) + } + }) + }), { + init: init, + custom: custom, + rect: rect, + roundedRect: roundedEect, + ellipse: ellipse, + polygon: polygon, + hemisphere: hemisphere, + cylinder: cylinder, + cone: cone, + box: box + } + }(), (null === this.canvas() || null === this.cubeParent()) && console.error("[Cube]\u65E0\u6CD5\u5B9A\u4F4D\u5230\u821E\u53F0"), (() => { + if (null !== this.canvas() && null !== this.cubeParent()) { + let t = document.createElement("canvas"); + t.setAttribute("id", "Cube"), t.setAttribute("width", this.canvas().style.width), t.setAttribute("height", this.canvas().style.height); + let a = t.style; + a.position = "absolute", a.left = "0%", a.top = "0%", a.pointerEvents = "none", this.cubeParent().appendChild(t), this.cubeScene = new this.Cube.init({ + element: document.getElementById("Cube") + }), new MutationObserver(() => { + for (let a in t.setAttribute("width", this.canvas().style.width), t.setAttribute("height", this.canvas().style.height), this.cubeScene = new this.Cube.init({ + element: document.getElementById("Cube") + }), this.objectList) this.cubeScene.addChild(this.objectList[a]); + this.cubeScene.updateRenderGraph() + }).observe(this.canvas(), { + attributes: !0 + }); + window.runtime = this.runtime; + window.global = this; + } + })(), this._formatMessage = e.getFormatMessage({ + "zh-cn": { + "Cube.name": "LazyTong的立方体", + "Cube.createRect": "创建或修改一个矩形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]大小[stroke]%", + "Cube.createRoundedRect": "创建或修改一个圆角矩形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]边角弧度[radius]大小[stroke]%", + "Cube.createCircle": "创建或修改一个圆形并命名为[id],X[x]Y[y]Z[z]颜色[color]半径[diameter]完整性[quarters]", + "Cube.createEllipse": "创建或修改一个椭圆形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]大小[stroke]%", + "Cube.createPolygon": "创建或修改一个[sides]边形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]边角弧度[radius]大小[stroke]%", + "Cube.createHemisphere": "创建或修改一个半圆并命名为[id],X[x]Y[y]Z[z]颜色[color]地面颜色[backface]半径[diameter]大小[stroke]%", + "Cube.createCone": "创建或修改一个圆锥体并命名为[id],X[x]Y[y]Z[z]颜色[color]地面颜色[backface]长度[length]半径[diameter]大小[stroke]%", + "Cube.createCylinder": "创建或修改一个圆柱体并命名为[id],X[x]Y[y]Z[z]颜色[color]顶部颜色[frontface]地面颜色[backface]长度[length]大小[stroke]%", + "Cube.createBox": "创建或修改一个立方体并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]尺寸[depth]颜色[color]左侧颜色[leftface]右侧颜色[rightface]顶部颜色[topface]地面颜色[bottomface]大小[stroke]%", + "Cube.createCustom": "创建或修改一个自定义模型并命名为[id],X[x]Y[y]Z[z]颜色[color]节点位置[path]节点大小[stroke]%", + "Cube.deleteObject": "删除物体[id]", + "Cube.getAttrib": "物体[id]的[type]", + "Cube.deleteAllObject": "删除所有物体", + "Cube.getObjectNumbers": "物体总数", + "Cube.getObjectList": "物体ID列表", + "Cube.x": "X", + "Cube.y": "Y", + "Cube.z": "Z", + "Cube.width": "宽度", + "Cube.height": "高度", + "Cube.color": "颜色", + "Cube.stroke": "大小", + "Cube.quarters": "完整性", + "Cube.cornerRadius": "边角弧度", + "Cube.radius": "弧度", + "Cube.setRotate": "设置物体[id]在[type]上旋转[rotate]度", + "Cube.updateRender": "渲染当前设置的物体", + "Cube.docs": "拓展教程", + "Cube.create": "创建物体", + "Cube.modify": "修改物体", + "Cube.info": "信息", + "Cube.fileListEmpty": "无文件" + }, + en: { + "Cube.name": "LazyTong's Cube", + "Cube.createRect": "Create or Modify a Rectangle named[id], X[x]Y[y]Z[z] Width[width] Height[height] Color[color] Stroke[stroke]%", + "Cube.createRoundedRect": "Create or Modify a Rounded Rectangle named [id], X[x]Y[y]Z[z] Width[width] Height[height] Color[color] Corner Radius[radius] Stroke[stroke]%", + "Cube.createCircle": "Create or Modify a Circle named[id], X[x]Y[y]Z[z] Color[color] Diameter[diameter] Quarters[quarters]", + "Cube.createEllipse": "Create or Modify an Ellipse named[id], X[x]Y[y]Z[z] Width[width] Height[height] Color[color] Stroke[stroke]%", + "Cube.createPolygon": "Create or Modify a [sides] Polygon named [id], X[x]Y[y]Z[z] Width[width] Height[height] Color[color] Corner Radius[radius] Stroke[stroke]%", + "Cube.createHemisphere": "Create or Modify a Hemisphere named [id], X[x]Y[y]Z[z] Color[color] Backface Color[backface] Diameter[diameter] Stroke[stroke]%", + "Cube.createCone": "Create or Modify a Cone named[id], X[x]Y[y]Z[z] Color[color] Backface Color[backface] Length[length] Diameter[diameter] Stroke[stroke]%", + "Cube.createCylinder": "Create or Modify a Cylinder named[id], X[x]Y[y]Z[z] Color[color] Frontface Color[frontface] Backface Color[backface] Length[length] Stroke[stroke]%", + "Cube.createBox": "Create or Modify a Box named[id], X[x]Y[y]Z[z] Width[width] Height[height] Depth[depth] Color[color] Leftface Color[leftface] Rightface Color[rightface] Topface Color[topface] Bottomface Color[bottomface] Stroke[stroke]%", + "Cube.createCustom": "Create or Modify a Custom Model named[id], X[x]Y[y]Z[z] Color[color] Path[path] Stroke[stroke]%", + "Cube.deleteObject": "Delete Object[id]", + "Cube.getAttrib": "Get[type] of Object[id]", + "Cube.deleteAllObject": "Delete All Objects", + "Cube.getObjectNumbers": "Number of Objects", + "Cube.getObjectList": "List of Object IDs", + "Cube.x": "X", + "Cube.y": "Y", + "Cube.z": "Z", + "Cube.width": "width", + "Cube.height": "height", + "Cube.color": "color", + "Cube.stroke": "stroke", + "Cube.quarters": "quarters", + "Cube.cornerRadius": "corner radius", + "Cube.radius": "radius", + "Cube.setRotate": "Set the object[id]to rotate[rotate]degrees on[type]", + "Cube.updateRender": "Update Render with Current Object Settings", + "Cube.docs": "Extended Tutorial", + "Cube.create": "Creating objects", + "Cube.modify": "Modifying objects", + "Cube.info": "Information", + "Cube.fileListEmpty": "no file" + } }) - }), a - }, a.prototype.normalizeRotate = function() { - this.rotate.x = c(this.rotate.x, p), this.rotate.y = c(this.rotate.y, p), this.rotate.z = c(this.rotate.z, p) - }; - let d = function(e) { - return function(a) { - let r = function(e) { - this.create(e || {}) - }; - return r.prototype = Object.create(e.prototype), r.prototype.constructor = r, r.defaults = n({}, e.defaults), n(r.defaults, a), r.optionKeys = e.optionKeys.slice(0), Object.keys(r.defaults).forEach(function(t) { - 1 != !r.optionKeys.indexOf(t) && r.optionKeys.push(t) - }), r.subclass = d(r), r - } - }; - a.subclass = d(a); - let T = "undefined" != typeof window, - e = "mousedown", - k = "mousemove", - S = "mouseup"; - T && (window.PointerEvent ? (e = "pointerdown", k = "pointermove", S = "pointerup") : "ontouchstart" in window && (e = "touchstart", k = "touchmove", S = "touchend")); - let j = function(e) { - this.create(e || {}) - }; - j.prototype.create = function(t) { - this.onDragStart = t.onDragStart || s, this.onDragMove = t.onDragMove || s, this.onDragEnd = t.onDragEnd || s, this.bindDrag(t.startElement) - }, j.prototype.bindDrag = function(t) { - t = this.getQueryElement(t), t && (t.style.touchAction = "none", t.addEventListener(e, this)) - }, j.prototype.getQueryElement = function(e) { - return "string" == typeof e && (e = document.querySelector(e)), e - }, j.prototype.handleEvent = function(a) { - let e = this["on" + a.type]; - e && e.call(this, a) - }, j.prototype.onmousedown = j.prototype.onpointerdown = function(e) { - this.dragStart(e, e) - }, j.prototype.ontouchstart = function(e) { - this.dragStart(e, e.changedTouches[0]) - }, j.prototype.dragStart = function(e, t) { - e.preventDefault(), this.dragStartX = t.pageX, this.dragStartY = t.pageY, T && (window.addEventListener(k, this), window.addEventListener(S, this)), this.onDragStart(t) - }, j.prototype.ontouchmove = function(e) { - this.dragMove(e, e.changedTouches[0]) - }, j.prototype.onmousemove = j.prototype.onpointermove = function(e) { - this.dragMove(e, e) - }, j.prototype.dragMove = function(t, a) { - t.preventDefault(); - let r = a.pageX - this.dragStartX, - o = a.pageY - this.dragStartY; - this.onDragMove(a, r, o) - }, j.prototype.onmouseup = j.prototype.onpointerup = j.prototype.ontouchend = j.prototype.dragEnd = function() { - window.removeEventListener(k, this), window.removeEventListener(S, this), this.onDragEnd() - }; - let G = a.subclass({ - element: void 0, - centered: !0, - zoom: 1, - dragRotate: !1, - resize: !1, - onPrerender: s, - onDragStart: s, - onDragMove: s, - onDragEnd: s, - onResize: s - }); - n(G.prototype, j.prototype), G.prototype.create = function(e) { - a.prototype.create.call(this, e), j.prototype.create.call(this, e), this.setElement(this.element), this.setDragRotate(this.dragRotate), this.setResize(this.resize) - }, G.prototype.setElement = function(e) { - if (e = this.element, !e) throw new Error("[Cube]\u672A\u6307\u5B9A\u5143\u7D20"); - this.setCanvas(e) - }, G.prototype.setSize = function(e, t) { - e = Math.round(e), t = Math.round(t), this.setSizeCanvas(e, t) - }, G.prototype.setResize = function(e) { - this.resize = e, this.resizeListener || (this.resizeListener = this.onWindowResize.bind(this)), e ? (window.addEventListener("resize", this.resizeListener), this.onWindowResize()) : window.removeEventListener("resize", this.resizeListener) - }, G.prototype.onWindowResize = function() { - this.setMeasuredSize(), this.onResize(this.width, this.height) - }, G.prototype.setMeasuredSize = function() { - let t, a, e = "fullscreen" == this.resize; - if (e) t = window.innerWidth, a = window.innerHeight; - else { - let r = this.element.getBoundingClientRect(); - t = r.width, a = r.height - } - this.setSize(t, a) - }, G.prototype.renderGraph = function(e) { - this.renderGraphCanvas(e) - }, G.prototype.updateRenderGraph = function(e) { - this.updateGraph(), this.renderGraph(e) - }, G.prototype.setCanvas = function(e) { - this.element = e, this.ctx = this.element.getContext("2d"), this.setSizeCanvas(e.width, e.height) - }, G.prototype.setSizeCanvas = function(t, a) { - this.width = t, this.height = a; - let r = this.pixelRatio = window.devicePixelRatio || 1; - this.element.width = this.canvasWidth = t * r, this.element.height = this.canvasHeight = a * r; - let o = 1 < r && !this.resize; - o && (this.element.style.width = t + "px", this.element.style.height = a + "px") - }, G.prototype.renderGraphCanvas = function(e) { - e = e || this, this.prerenderCanvas(), a.prototype.renderGraphCanvas.call(e, this.ctx), this.postrenderCanvas() - }, G.prototype.prerenderCanvas = function() { - let r = this.ctx; - if (r.lineCap = "round", r.lineJoin = "round", r.clearRect(0, 0, this.canvasWidth, this.canvasHeight), r.save(), this.centered) { - let e = this.width / 2 * this.pixelRatio, - t = this.height / 2 * this.pixelRatio; - r.translate(e, t) - } - let t = this.pixelRatio * this.zoom; - r.scale(t, t), this.onPrerender(r) - }, G.prototype.postrenderCanvas = function() { - this.ctx.restore() - }, G.prototype.setDragRotate = function(e) { - e && (!0 === e && (e = this), this.dragRotate = e, this.bindDrag(this.element)) - }, G.prototype.dragStart = function() { - this.dragStartRX = this.dragRotate.rotate.x, this.dragStartRY = this.dragRotate.rotate.y, j.prototype.dragStart.apply(this, arguments) - }, G.prototype.dragMove = function(r, o) { - let d = o.pageX - this.dragStartX, - e = o.pageY - this.dragStartY, - t = Math.min(this.width, this.height); - this.dragRotate.rotate.x = this.dragStartRX - e / t * p, this.dragRotate.rotate.y = this.dragStartRY - d / t * p, j.prototype.dragMove.apply(this, arguments) - }; - let w = function(e, t, a) { - this.method = e, this.points = t.map(D), this.renderPoints = t.map(M), this.previousPoint = a, this.endRenderPoint = this.renderPoints[this.renderPoints.length - 1], "arc" == e && (this.controlPoints = [new N, new N]) - }, - D = function(e) { - return e instanceof N ? e : new N(e) - }, - M = function(e) { - return new N(e) - }; - w.prototype.reset = function() { - let t = this.points; - this.renderPoints.forEach(function(a, r) { - let o = t[r]; - a.set(o) - }) - }, w.prototype.transform = function(t, a, r) { - this.renderPoints.forEach(function(o) { - o.transform(t, a, r) - }) - }, w.prototype.render = function(e, t, a) { - return this[this.method](e, t, a) - }, w.prototype.move = function(e, t, a) { - return a.move(e, t, this.renderPoints[0]) - }, w.prototype.line = function(e, t, a) { - return a.line(e, t, this.renderPoints[0]) - }, w.prototype.bezier = function(r, o, d) { - let l = this.renderPoints[0], - e = this.renderPoints[1], - t = this.renderPoints[2]; - return d.bezier(r, o, l, e, t) - }; - let V = 9 / 16; - w.prototype.arc = function(d, p, T) { - let l = this.previousPoint, - e = this.renderPoints[0], - t = this.renderPoints[1], - a = this.controlPoints[0], - r = this.controlPoints[1]; - return a.set(l).lerp(e, V), r.set(t).lerp(e, V), T.bezier(d, p, a, r, t) - }; - let E = a.subclass({ - stroke: 1, - fill: !1, - color: "#333", - closed: !0, - visible: !0, - path: [{}], - front: { - z: 1 - }, - backface: !0 - }); - E.prototype.create = function(e) { - this.path = e, a.prototype.create.call(this, e), this.updatePath(), this.front = new N(e.front || this.front), this.renderFront = new N(this.front), this.renderNormal = new N - }; - let m = ["move", "line", "bezier", "arc"]; - E.prototype.updatePath = function() { - this.setPath(), this.updatePathCommands() - }, E.prototype.setPath = function() {}, E.prototype.updatePathCommands = function() { - let a; - this.pathCommands = this.path.map(function(r, o) { - let d = Object.keys(r), - e = d[0], - T = r[e], - n = 1 == d.length && -1 != m.indexOf(e); - n || (e = "line", T = r); - let c = "line" == e || "move" == e, - i = Array.isArray(T); - c && !i && (T = [T]), e = 0 === o ? "move" : e; - let s = new w(e, T, a); - return a = s.endRenderPoint, s - }) - }, E.prototype.reset = function() { - this.renderOrigin.set(this.origin), this.renderFront.set(this.front), this.pathCommands.forEach(function(e) { - e.reset() - }) - }, E.prototype.transform = function(t, a, r) { - this.renderOrigin.transform(t, a, r), this.renderFront.transform(t, a, r), this.renderNormal.set(this.renderOrigin).subtract(this.renderFront), this.pathCommands.forEach(function(o) { - o.transform(t, a, r) - }), this.children.forEach(function(o) { - o.transform(t, a, r) - }) - }, E.prototype.updateSortValue = function() { - let t = this.pathCommands.length, - a = this.pathCommands[0].endRenderPoint, - o = this.pathCommands[t - 1].endRenderPoint, - e = 2 < t && a.isSame(o); - e && (t -= 1); - let d = 0; - for (let a = 0; a < t; a++) d += this.pathCommands[a].endRenderPoint.z; - this.sortValue = d / t - }, E.prototype.render = function(e, t) { - let a = this.pathCommands.length; - if (this.visible && a && (this.isFacingBack = 0 < this.renderNormal.z, this.backface || !this.isFacingBack)) { - if (!t) throw new Error("[Cube]\u672A\u63D0\u4F9B\u6E32\u67D3\u5668"); - t.isCanvas && 1 == a ? this.renderCanvasDot(e, t) : this.renderPath(e, t) - } - }, E.prototype.renderCanvasDot = function(t) { - let a = this.getLineWidth(); - if (a) { - t.fillStyle = this.getRenderColor(); - let r = this.pathCommands[0].endRenderPoint; - t.beginPath(), t.arc(r.x, r.y, a / 2, 0, p), t.fill() - } - }, E.prototype.getLineWidth = function() { - return this.stroke ? !0 == this.stroke ? 1 : this.stroke : 0 - }, E.prototype.getRenderColor = function() { - let a = "string" == typeof this.backface && this.isFacingBack, - e = a ? this.backface : this.color; - return e - }, E.prototype.renderPath = function(r, o) { - let d, l = 2 == this.pathCommands.length && "line" == this.pathCommands[1].method, - e = !l && this.closed, - t = this.getRenderColor(); - o.renderPath(r, d, this.pathCommands, e), o.stroke(r, d, this.stroke, t, this.getLineWidth()), o.fill(r, d, this.fill, t), o.end(r, d) - }; - let y = a.subclass({ - updateSort: !1, - visible: !0 - }); - y.prototype.updateSortValue = function() { - let r = 0; - this.flatGraph.forEach(function(e) { - e.updateSortValue(), r += e.sortValue - }), this.sortValue = r / this.flatGraph.length, this.updateSort && this.flatGraph.sort(a.shapeSorter) - }, y.prototype.render = function(e, t) { - this.visible && this.flatGraph.forEach(function(a) { - a.render(e, t) - }) - }, y.prototype.updateFlatGraph = function() { - this.flatGraph = this.addChildFlatGraph([]) - }, y.prototype.getFlatGraph = function() { - return [this] - }; - let h = E.subclass({ - width: 1, - height: 1 - }); - h.prototype.setPath = function() { - let a = this.width / 2, - e = this.height / 2; - this.path = [{ - x: -a, - y: -e - }, { - x: a, - y: -e - }, { - x: a, - y: e - }, { - x: -a, - y: e - }] - }; - let U = E.subclass({ - width: 1, - height: 1, - cornerRadius: .25, - closed: !1 - }); - U.prototype.setPath = function() { - let o = this.width / 2, - d = this.height / 2, - l = Math.min(o, d), - p = Math.min(this.cornerRadius, l), - e = o - p, - t = d - p, - a = [{ - x: e, - y: -d - }, { - arc: [{ - x: o, - y: -d - }, { - x: o, - y: -t - }] - }]; - t && a.push({ - x: o, - y: t - }), a.push({ - arc: [{ - x: o, - y: d - }, { - x: e, - y: d - }] - }), e && a.push({ - x: -e, - y: d - }), a.push({ - arc: [{ - x: -o, - y: d - }, { - x: -o, - y: t - }] - }), t && a.push({ - x: -o, - y: -t - }), a.push({ - arc: [{ - x: -o, - y: -d - }, { - x: -e, - y: -d - }] - }), e && a.push({ - x: e, - y: -d - }), this.path = a - }; - let X = E.subclass({ - diameter: 1, - width: void 0, - height: void 0, - quarters: 4, - closed: !1 - }); - X.prototype.setPath = function() { - let t = null == this.width ? this.diameter : this.width, - a = null == this.height ? this.diameter : this.height, - r = t / 2, - o = a / 2; - this.path = [{ - x: 0, - y: -o - }, { - arc: [{ - x: r, - y: -o - }, { - x: r, - y: 0 - }] - }], 1 < this.quarters && this.path.push({ - arc: [{ - x: r, - y: o - }, { - x: 0, - y: o - }] - }), 2 < this.quarters && this.path.push({ - arc: [{ - x: -r, - y: o - }, { - x: -r, - y: 0 - }] - }), 3 < this.quarters && this.path.push({ - arc: [{ - x: -r, - y: -o - }, { - x: 0, - y: -o - }] - }) - }; - let z = E.subclass({ - sides: 3, - radius: .5 - }); - z.prototype.setPath = function() { - this.path = []; - for (let a = 0; a < this.sides; a++) { - let r = a / this.sides * p - p / 4, - o = Math.cos(r) * this.radius, - e = Math.sin(r) * this.radius; - this.path.push({ - x: o, - y: e + } + + formatMessage(e) { + return this._formatMessage({ + id: e, + default: e, + description: e }) - } - }; - let b = X.subclass({ - fill: !0 - }); - b.prototype.create = function() { - X.prototype.create.apply(this, arguments), this.apex = new a({ - addTo: this, - translate: { - z: this.diameter / 2 - } - }), this.renderCentroid = new N - }, b.prototype.updateSortValue = function() { - this.renderCentroid.set(this.renderOrigin).lerp(this.apex.renderOrigin, 3 / 8), this.sortValue = this.renderCentroid.z - }, b.prototype.render = function(a, e) { - this.renderDome(a, e), X.prototype.render.apply(this, arguments) - }, b.prototype.renderDome = function(o, d) { - if (this.visible) { - let l = this.getDomeRenderElement(o, d), - p = Math.atan2(this.renderNormal.y, this.renderNormal.x), - e = this.diameter / 2 * this.renderNormal.magnitude(), - t = this.renderOrigin.x, - a = this.renderOrigin.y; - d.stroke(o, l, this.stroke, this.color, this.getLineWidth()), d.fill(o, l, this.fill, this.color), d.end(o, l) - } - }; - let g = y.subclass({ - color: "#333", - updateSort: !0 - }); - g.prototype.create = function() { - y.prototype.create.apply(this, arguments), this.pathCommands = [new w("move", [{}]), new w("line", [{}])] - }, g.prototype.render = function(a, e) { - this.renderCylinderSurface(a, e), y.prototype.render.apply(this, arguments) - }, g.prototype.renderCylinderSurface = function(o, d) { - if (this.visible) { - let l, p = this.frontBase, - e = this.rearBase, - t = p.renderNormal.magnitude(), - a = p.diameter * t + p.getLineWidth(); - this.pathCommands[0].renderPoints[0].set(p.renderOrigin), this.pathCommands[1].renderPoints[0].set(e.renderOrigin), d.renderPath(o, l, this.pathCommands), d.stroke(o, l, !0, this.color, a), d.end(o, l) - } - }, g.prototype.copyGraph = s; - let f = X.subclass(); - f.prototype.copyGraph = s; - let x = E.subclass({ - diameter: 1, - length: 1, - frontFace: void 0, - fill: !0 - }); - x.prototype.create = function() { - E.prototype.create.apply(this, arguments), this.group = new g({ - addTo: this, - color: this.color, - visible: this.visible - }); - let e = this.length / 2, - t = this.backface || !0; - this.frontBase = this.group.frontBase = new X({ - addTo: this.group, - diameter: this.diameter, - translate: { - z: e - }, - rotate: { - y: p / 2 - }, - color: this.color, - stroke: this.stroke, - fill: this.fill, - backface: this.frontFace || t, - visible: this.visible - }), this.rearBase = this.group.rearBase = this.frontBase.copy({ - translate: { - z: -e - }, - rotate: { - y: 0 - }, - backface: t - }) - }, x.prototype.render = function() {}, ["stroke", "fill", "color", "visible"].forEach(function(e) { - let t = "_" + e; - Object.defineProperty(x.prototype, e, { - get: function() { - return this[t] - }, - set: function(a) { - this[t] = a, this.frontBase && (this.frontBase[e] = a, this.rearBase[e] = a, this.group[e] = a) - } - }) - }); - let F = X.subclass({ - length: 1, - fill: !0 - }); - F.prototype.create = function() { - X.prototype.create.apply(this, arguments), this.apex = new a({ - addTo: this, - translate: { - z: this.length - } - }), this.renderApex = new N, this.renderCentroid = new N, this.tangentA = new N, this.tangentB = new N, this.surfacePathCommands = [new w("move", [{}]), new w("line", [{}]), new w("line", [{}])] - }, F.prototype.updateSortValue = function() { - this.renderCentroid.set(this.renderOrigin).lerp(this.apex.renderOrigin, 1 / 3), this.sortValue = this.renderCentroid.z - }, F.prototype.render = function(a, e) { - this.renderConeSurface(a, e), X.prototype.render.apply(this, arguments) - }, F.prototype.renderConeSurface = function(d, l) { - if (this.visible) { - this.renderApex.set(this.apex.renderOrigin).subtract(this.renderOrigin); - let r = this.renderNormal.magnitude(), - T = this.renderApex.magnitude2d(), - e = this.renderNormal.magnitude2d(), - t = Math.acos(e / r), - n = Math.sin(t), - i = this.diameter / 2 * r; - if (i * n < T) { - let c = Math.atan2(this.renderNormal.y, this.renderNormal.x) + p / 2, - e = Math.acos(i / (T / n)), - t = this.tangentA, - a = this.tangentB; - t.x = Math.cos(e) * i * n, t.y = Math.sin(e) * i, a.set(this.tangentA), a.y *= -1, t.rotateZ(c), a.rotateZ(c), t.add(this.renderOrigin), a.add(this.renderOrigin), this.setSurfaceRenderPoint(0, t), this.setSurfaceRenderPoint(1, this.apex.renderOrigin), this.setSurfaceRenderPoint(2, a); - let r = this.getSurfaceRenderElement(d, l); - l.renderPath(d, r, this.surfacePathCommands), l.stroke(d, r, this.stroke, this.color, this.getLineWidth()), l.fill(d, r, this.fill, this.color), l.end(d, r) - } - } - }, F.prototype.setSurfaceRenderPoint = function(e, t) { - let a = this.surfacePathCommands[e].renderPoints[0]; - a.set(t) - }; - let O = h.subclass(); - O.prototype.copyGraph = function() {}; - let W = ["frontFace", "rearFace", "leftFace", "rightFace", "topFace", "bottomFace"], - Z = n({}, E.defaults); - delete Z.path, W.forEach(function(e) { - Z[e] = !0 - }), n(Z, { - width: 1, - height: 1, - depth: 1, - fill: !0 - }); - let C = a.subclass(Z); - return C.prototype.create = function(e) { - a.prototype.create.call(this, e), this.updatePath(), this.fill = this.fill - }, C.prototype.updatePath = function() { - W.forEach(function(e) { - this[e] = this[e] - }, this) - }, W.forEach(function(e) { - let t = "_" + e; - Object.defineProperty(C.prototype, e, { - get: function() { - return this[t] - }, - set: function(a) { - this[t] = a, this.setFace(e, a) - } - }) - }), C.prototype.setFace = function(t, a) { - let r = t + "Rect", - o = this[r]; - if (!a) return void this.removeChild(o); - let d = this.getFaceOptions(t); - d.color = "string" == typeof a ? a : this.color, o ? o.setOptions(d) : o = this[r] = new O(d), o.updatePath(), this.addChild(o) - }, C.prototype.getFaceOptions = function(t) { - return { - frontFace: { - width: this.width, - height: this.height, - translate: { - z: this.depth / 2 - } - }, - rearFace: { - width: this.width, - height: this.height, - translate: { - z: -this.depth / 2 - }, - rotate: { - y: p / 2 - } - }, - leftFace: { - width: this.depth, - height: this.height, - translate: { - x: -this.width / 2 - }, - rotate: { - y: -p / 4 - } - }, - rightFace: { - width: this.depth, - height: this.height, - translate: { - x: this.width / 2 - }, - rotate: { - y: p / 4 - } - }, - topFace: { - width: this.width, - height: this.depth, - translate: { - y: -this.height / 2 - }, - rotate: { - x: -p / 4 - } - }, - bottomFace: { - width: this.width, - height: this.depth, - translate: { - y: this.height / 2 - }, - rotate: { - x: p / 4 - } - } - } [t] - }, ["color", "stroke", "fill", "backface", "front", "visible"].forEach(function(t) { - let a = "_" + t; - Object.defineProperty(C.prototype, t, { - get: function() { - return this[a] - }, - set: function(l) { - this[a] = l, W.forEach(function(a) { - let r = this[a + "Rect"], - o = "string" == typeof this[a]; - r && !("color" == t && o) && (r[t] = l) - }, this) + } + + getInfo() { + return { + id: "LazyTong.Cube", + name: this.formatMessage("Cube.name"), + blockIconURI: icon, + menuIconURI: icon, + color1: "#33cc33", + color2: "#669900", + blocks: [{ + blockType: "button", + text: this.formatMessage("Cube.docs"), + onClick: this.docs + }, `---${this.formatMessage("Cube.create")}`, { + opcode: "createRect", + blockType: "command", + text: this.formatMessage("Cube.createRect"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + width: { + type: "number", + defaultValue: "100" + }, + height: { + type: "number", + defaultValue: "20" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, { + opcode: "createRoundedRect", + blockType: "command", + text: this.formatMessage("Cube.createRoundedRect"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + width: { + type: "number", + defaultValue: "100" + }, + height: { + type: "number", + defaultValue: "20" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + radius: { + type: "number", + defaultValue: "1" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, { + opcode: "createCircle", + blockType: "command", + text: this.formatMessage("Cube.createCircle"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + diameter: { + type: "number", + defaultValue: "50" + }, + quarters: { + type: "number", + defaultValue: "4" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, { + opcode: "createEllipse", + blockType: "command", + text: this.formatMessage("Cube.createEllipse"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + width: { + type: "number", + defaultValue: "100" + }, + height: { + type: "number", + defaultValue: "20" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, { + opcode: "createPolygon", + blockType: "command", + text: this.formatMessage("Cube.createPolygon"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + width: { + type: "number", + defaultValue: "100" + }, + height: { + type: "number", + defaultValue: "20" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + sides: { + type: "number", + defaultValue: "3" + }, + radius: { + type: "number", + defaultValue: "1" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, { + opcode: "createHemisphere", + blockType: "command", + text: this.formatMessage("Cube.createHemisphere"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + diameter: { + type: "number", + defaultValue: "50" + }, + backface: { + type: "color", + defaultValue: "#33cc33" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, { + opcode: "createCone", + blockType: "command", + text: this.formatMessage("Cube.createCone"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + length: { + type: "number", + defaultValue: "50" + }, + diameter: { + type: "number", + defaultValue: "50" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + backface: { + type: "color", + defaultValue: "#33cc33" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, { + opcode: "createCylinder", + blockType: "command", + text: this.formatMessage("Cube.createCylinder"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + length: { + type: "number", + defaultValue: "50" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + frontface: { + type: "color", + defaultValue: "#33cc33" + }, + backface: { + type: "color", + defaultValue: "#33cc33" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, { + opcode: "createBox", + blockType: "command", + text: this.formatMessage("Cube.createBox"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + width: { + type: "number", + defaultValue: "100" + }, + height: { + type: "number", + defaultValue: "20" + }, + depth: { + type: "number", + defaultValue: "50" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + leftface: { + type: "color", + defaultValue: "#33cc33" + }, + rightface: { + type: "color", + defaultValue: "#33cc33" + }, + topface: { + type: "color", + defaultValue: "#33cc33" + }, + bottomface: { + type: "color", + defaultValue: "#33cc33" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, { + opcode: "createCustom", + blockType: "command", + text: this.formatMessage("Cube.createCustom"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + x: { + type: "number", + defaultValue: "0" + }, + y: { + type: "number", + defaultValue: "0" + }, + z: { + type: "number", + defaultValue: "0" + }, + color: { + type: "color", + defaultValue: "#33cc33" + }, + path: { + type: "string", + menu: "files" + }, + stroke: { + type: "number", + defaultValue: "100" + } + } + }, `---${this.formatMessage("Cube.modify")}`, { + opcode: "deleteObject", + blockType: "command", + text: this.formatMessage("Cube.deleteObject"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + } + } + }, { + opcode: "deleteAllObject", + blockType: "command", + text: this.formatMessage("Cube.deleteAllObject"), + arguments: {} + }, { + opcode: "setRotate", + blockType: "command", + text: this.formatMessage("Cube.setRotate"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + type: { + type: "string", + menu: "rotate" + }, + rotate: { + type: "number", + defaultValue: "10" + } + } + }, { + opcode: "updateRender", + blockType: "command", + text: this.formatMessage("Cube.updateRender"), + arguments: {} + }, `---${this.formatMessage("Cube.info")}`, { + opcode: "getAttrib", + blockType: "reporter", + text: this.formatMessage("Cube.getAttrib"), + arguments: { + id: { + type: "string", + defaultValue: "lazytong" + }, + type: { + type: "string", + menu: "attrib" + } + } + }, { + opcode: "getObjectList", + blockType: "reporter", + text: this.formatMessage("Cube.getObjectList"), + arguments: {} + }, { + opcode: "getObjectNumbers", + blockType: "reporter", + text: this.formatMessage("Cube.getObjectNumbers"), + arguments: {} + }], + menus: { + attrib: [{ + text: this.formatMessage("Cube.x"), + value: "x" + }, { + text: this.formatMessage("Cube.y"), + value: "y" + }, { + text: this.formatMessage("Cube.z"), + value: "z" + }, { + text: this.formatMessage("Cube.width"), + value: "width" + }, { + text: this.formatMessage("Cube.height"), + value: "height" + }, { + text: this.formatMessage("Cube.stroke"), + value: "stroke" + }, { + text: this.formatMessage("Cube.color"), + value: "color" + }, { + text: this.formatMessage("Cube.quarters"), + value: "quarters" + }, { + text: this.formatMessage("Cube.cornerRadius"), + value: "cornerRadius" + }, { + text: this.formatMessage("Cube.radius"), + value: "radius" + }], + files: { + acceptReporters: !0, + items: (() => { + try { + const e = this.runtime.getGandiAssetsFileList("json").map(e => ({ + text: e.fullName, + value: e.id + })); + return 1 > e.length ? [{ + text: this.formatMessage("Cube.fileListEmpty"), + value: "fileListEmpty" + }] : e + } catch (e) { + return [{ + text: this.formatMessage("Cube.fileListEmpty"), + value: "fileListEmpty" + }] + } + })() + }, + rotate: [{ + text: this.formatMessage("Cube.x"), + value: "x" + }, { + text: this.formatMessage("Cube.y"), + value: "y" + }, { + text: this.formatMessage("Cube.z"), + value: "z" + }] + } } - }) - }), { - init: G, - custom: E, - rect: h, - roundedRect: U, - ellipse: X, - polygon: z, - hemisphere: b, - cylinder: x, - cone: F, - box: C } - }(), (null === this.canvas() || null === this.cubeParent()) && console.error("[Cube]\u65E0\u6CD5\u5B9A\u4F4D\u5230\u821E\u53F0"), (() => { - if (null !== this.canvas() && null !== this.cubeParent()) { - let t = document.createElement("canvas"); - t.setAttribute("id", "Cube"), t.setAttribute("width", this.canvas().style.width), t.setAttribute("height", this.canvas().style.height); - let a = t.style; - a.position = "absolute", a.left = "0%", a.top = "0%", a.pointerEvents = "none", this.cubeParent().appendChild(t), this.cubeScene = new this.Cube.init({ - element: document.getElementById("Cube") - }), new MutationObserver(() => { - for (let a in t.setAttribute("width", this.canvas().style.width), t.setAttribute("height", this.canvas().style.height), this.cubeScene = new this.Cube.init({ - element: document.getElementById("Cube") - }), this.objectList) this.cubeScene.addChild(this.objectList[a]); - this.cubeScene.updateRenderGraph() - }).observe(this.canvas(), { - attributes: !0 - }) + + docs() { + let e = document.createElement("a"); + e.href = "https://lt.js.org/posts/20240718", e.rel = "noopener noreferrer", e.target = "_blank", e.click() } - })(), this._formatMessage = e.getFormatMessage({ - "zh-cn": { - "Cube.name": "LazyTong\u7684\u7ACB\u65B9\u4F53", - "Cube.createRect": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A\u77E9\u5F62\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u5BBD[width]\u9AD8[height]\u989C\u8272[color]\u5927\u5C0F[stroke]%", - "Cube.createRoundedRect": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A\u5706\u89D2\u77E9\u5F62\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u5BBD[width]\u9AD8[height]\u989C\u8272[color]\u8FB9\u89D2\u5F27\u5EA6[radius]\u5927\u5C0F[stroke]%", - "Cube.createCircle": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A\u5706\u5F62\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u989C\u8272[color]\u534A\u5F84[diameter]\u5B8C\u6574\u6027[quarters]", - "Cube.createEllipse": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A\u692D\u5706\u5F62\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u5BBD[width]\u9AD8[height]\u989C\u8272[color]\u5927\u5C0F[stroke]%", - "Cube.createPolygon": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A[sides]\u8FB9\u5F62\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u5BBD[width]\u9AD8[height]\u989C\u8272[color]\u8FB9\u89D2\u5F27\u5EA6[radius]\u5927\u5C0F[stroke]%", - "Cube.createHemisphere": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A\u534A\u5706\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u989C\u8272[color]\u5730\u9762\u989C\u8272[backface]\u534A\u5F84[diameter]\u5927\u5C0F[stroke]%", - "Cube.createCone": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A\u5706\u9525\u4F53\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u989C\u8272[color]\u5730\u9762\u989C\u8272[backface]\u957F\u5EA6[length]\u534A\u5F84[diameter]\u5927\u5C0F[stroke]%", - "Cube.createCylinder": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A\u5706\u67F1\u4F53\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u989C\u8272[color]\u9876\u90E8\u989C\u8272[frontface]\u5730\u9762\u989C\u8272[backface]\u957F\u5EA6[length]\u5927\u5C0F[stroke]%", - "Cube.createBox": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A\u7ACB\u65B9\u4F53\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u5BBD[width]\u9AD8[height]\u5C3A\u5BF8[depth]\u989C\u8272[color]\u5DE6\u4FA7\u989C\u8272[leftface]\u53F3\u4FA7\u989C\u8272[rightface]\u9876\u90E8\u989C\u8272[topface]\u5730\u9762\u989C\u8272[bottomface]\u5927\u5C0F[stroke]%", - "Cube.createCustom": "\u521B\u5EFA\u6216\u4FEE\u6539\u4E00\u4E2A\u81EA\u5B9A\u4E49\u6A21\u578B\u5E76\u547D\u540D\u4E3A[id]\uFF0CX[x]Y[y]Z[z]\u989C\u8272[color]\u8282\u70B9\u4F4D\u7F6E[path]\u8282\u70B9\u5927\u5C0F[stroke]%", - "Cube.deleteObject": "\u5220\u9664\u7269\u4F53[id]", - "Cube.getAttrib": "\u7269\u4F53[id]\u7684[type]", - "Cube.deleteAllObject": "\u5220\u9664\u6240\u6709\u7269\u4F53", - "Cube.getObjectNumbers": "\u7269\u4F53\u603B\u6570", - "Cube.getObjectList": "\u7269\u4F53ID\u5217\u8868", - "Cube.x": "X", - "Cube.y": "Y", - "Cube.z": "Z", - "Cube.width": "\u5BBD\u5EA6", - "Cube.height": "\u9AD8\u5EA6", - "Cube.color": "\u989C\u8272", - "Cube.stroke": "\u5927\u5C0F", - "Cube.quarters": "\u5B8C\u6574\u6027", - "Cube.cornerRadius": "\u8FB9\u89D2\u5F27\u5EA6", - "Cube.radius": "\u5F27\u5EA6", - "Cube.setRotate": "\u8BBE\u7F6E\u7269\u4F53[id]\u5728[type]\u4E0A\u65CB\u8F6C[rotate]\u5EA6", - "Cube.updateRender": "\u6E32\u67D3\u5F53\u524D\u8BBE\u7F6E\u7684\u7269\u4F53", - "Cube.docs": "\u62D3\u5C55\u6559\u7A0B", - "Cube.create": "\u521B\u5EFA\u7269\u4F53", - "Cube.modify": "\u4FEE\u6539\u7269\u4F53", - "Cube.info": "\u4FE1\u606F", - "Cube.fileListEmpty": "\u65E0\u6587\u4EF6" - }, - en: { - "Cube.name": "LazyTong's Cube", - "Cube.createRect": "Create or Modify a Rectangle named[id], X[x]Y[y]Z[z] Width[width] Height[height] Color[color] Stroke[stroke]%", - "Cube.createRoundedRect": "Create or Modify a Rounded Rectangle named [id], X[x]Y[y]Z[z] Width[width] Height[height] Color[color] Corner Radius[radius] Stroke[stroke]%", - "Cube.createCircle": "Create or Modify a Circle named[id], X[x]Y[y]Z[z] Color[color] Diameter[diameter] Quarters[quarters]", - "Cube.createEllipse": "Create or Modify an Ellipse named[id], X[x]Y[y]Z[z] Width[width] Height[height] Color[color] Stroke[stroke]%", - "Cube.createPolygon": "Create or Modify a [sides] Polygon named [id], X[x]Y[y]Z[z] Width[width] Height[height] Color[color] Corner Radius[radius] Stroke[stroke]%", - "Cube.createHemisphere": "Create or Modify a Hemisphere named [id], X[x]Y[y]Z[z] Color[color] Backface Color[backface] Diameter[diameter] Stroke[stroke]%", - "Cube.createCone": "Create or Modify a Cone named[id], X[x]Y[y]Z[z] Color[color] Backface Color[backface] Length[length] Diameter[diameter] Stroke[stroke]%", - "Cube.createCylinder": "Create or Modify a Cylinder named[id], X[x]Y[y]Z[z] Color[color] Frontface Color[frontface] Backface Color[backface] Length[length] Stroke[stroke]%", - "Cube.createBox": "Create or Modify a Box named[id], X[x]Y[y]Z[z] Width[width] Height[height] Depth[depth] Color[color] Leftface Color[leftface] Rightface Color[rightface] Topface Color[topface] Bottomface Color[bottomface] Stroke[stroke]%", - "Cube.createCustom": "Create or Modify a Custom Model named[id], X[x]Y[y]Z[z] Color[color] Path[path] Stroke[stroke]%", - "Cube.deleteObject": "Delete Object[id]", - "Cube.getAttrib": "Get[type] of Object[id]", - "Cube.deleteAllObject": "Delete All Objects", - "Cube.getObjectNumbers": "Number of Objects", - "Cube.getObjectList": "List of Object IDs", - "Cube.x": "X", - "Cube.y": "Y", - "Cube.z": "Z", - "Cube.width": "width", - "Cube.height": "height", - "Cube.color": "color", - "Cube.stroke": "stroke", - "Cube.quarters": "quarters", - "Cube.cornerRadius": "corner radius", - "Cube.radius": "radius", - "Cube.setRotate": "Set the object[id]to rotate[rotate]degrees on[type]", - "Cube.updateRender": "Update Render with Current Object Settings", - "Cube.docs": "Extended Tutorial", - "Cube.create": "Creating objects", - "Cube.modify": "Modifying objects", - "Cube.info": "Information", - "Cube.fileListEmpty": "no file" + + createRect(args) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.rect({ + width: +args.width, + height: +args.height, + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +args.x, + y: +args.y, + z: +args.z + } + }), this.cubeScene.addChild(this.objectList[args.id])) } - }) - } - formatMessage(e) { - return this._formatMessage({ - id: e, - default: e, - description: e - }) - } - getInfo() { - return { - id: "LazyTong.Cube", - name: this.formatMessage("Cube.name"), - blockIconURI: t, - menuIconURI: t, - color1: "#33cc33", - color2: "#669900", - blocks: [{ - blockType: "button", - text: this.formatMessage("Cube.docs"), - onClick: this.docs - }, `---${this.formatMessage("Cube.create")}`, { - opcode: "createRect", - blockType: "command", - text: this.formatMessage("Cube.createRect"), - arguments: { - id: { - type: "string", - defaultValue: "lazytong" - }, - x: { - type: "number", - defaultValue: "0" - }, - y: { - type: "number", - defaultValue: "0" - }, - z: { - type: "number", - defaultValue: "0" - }, - width: { - type: "number", - defaultValue: "100" - }, - height: { - type: "number", - defaultValue: "20" - }, - color: { - type: "color", - defaultValue: "#33cc33" - }, - stroke: { - type: "number", - defaultValue: "100" - } - } - }, { - opcode: "createRoundedRect", - blockType: "command", - text: this.formatMessage("Cube.createRoundedRect"), - arguments: { - id: { - type: "string", - defaultValue: "lazytong" - }, - x: { - type: "number", - defaultValue: "0" - }, - y: { - type: "number", - defaultValue: "0" - }, - z: { - type: "number", - defaultValue: "0" - }, - width: { - type: "number", - defaultValue: "100" - }, - height: { - type: "number", - defaultValue: "20" - }, - color: { - type: "color", - defaultValue: "#33cc33" - }, - radius: { - type: "number", - defaultValue: "1" - }, - stroke: { - type: "number", - defaultValue: "100" - } - } - }, { - opcode: "createCircle", - blockType: "command", - text: this.formatMessage("Cube.createCircle"), - arguments: { - id: { - type: "string", - defaultValue: "lazytong" - }, - x: { - type: "number", - defaultValue: "0" - }, - y: { - type: "number", - defaultValue: "0" - }, - z: { - type: "number", - defaultValue: "0" - }, - diameter: { - type: "number", - defaultValue: "50" - }, - quarters: { - type: "number", - defaultValue: "4" - }, - color: { - type: "color", - defaultValue: "#33cc33" - }, - stroke: { - type: "number", - defaultValue: "100" - } - } - }, { - opcode: "createEllipse", - blockType: "command", - text: this.formatMessage("Cube.createEllipse"), - arguments: { - id: { - type: "string", - defaultValue: "lazytong" - }, - x: { - type: "number", - defaultValue: "0" - }, - y: { - type: "number", - defaultValue: "0" - }, - z: { - type: "number", - defaultValue: "0" - }, - width: { - type: "number", - defaultValue: "100" - }, - height: { - type: "number", - defaultValue: "20" - }, - color: { - type: "color", - defaultValue: "#33cc33" - }, - stroke: { - type: "number", - defaultValue: "100" - } - } - }, { - opcode: "createPolygon", - blockType: "command", - text: this.formatMessage("Cube.createPolygon"), - arguments: { - id: { - type: "string", - defaultValue: "lazytong" - }, - x: { - type: "number", - defaultValue: "0" - }, - y: { - type: "number", - defaultValue: "0" - }, - z: { - type: "number", - defaultValue: "0" - }, - width: { - type: "number", - defaultValue: "100" - }, - height: { - type: "number", - defaultValue: "20" - }, - color: { - type: "color", - defaultValue: "#33cc33" - }, - sides: { - type: "number", - defaultValue: "3" - }, - radius: { - type: "number", - defaultValue: "1" - }, - stroke: { - type: "number", - defaultValue: "100" - } - } - }, { - opcode: "createHemisphere", - blockType: "command", - text: this.formatMessage("Cube.createHemisphere"), - arguments: { - id: { - type: "string", - defaultValue: "lazytong" - }, - x: { - type: "number", - defaultValue: "0" - }, - y: { - type: "number", - defaultValue: "0" - }, - z: { - type: "number", - defaultValue: "0" - }, - diameter: { - type: "number", - defaultValue: "50" - }, - backface: { - type: "color", - defaultValue: "#33cc33" - }, - color: { - type: "color", - defaultValue: "#33cc33" - }, - stroke: { - type: "number", - defaultValue: "100" - } - } - }, { - opcode: "createCone", - blockType: "command", - text: this.formatMessage("Cube.createCone"), - arguments: { - id: { - type: "string", - defaultValue: "lazytong" - }, - x: { - type: "number", - defaultValue: "0" - }, - y: { - type: "number", - defaultValue: "0" - }, - z: { - type: "number", - defaultValue: "0" - }, - length: { - type: "number", - defaultValue: "50" - }, - diameter: { - type: "number", - defaultValue: "50" - }, - color: { - type: "color", - defaultValue: "#33cc33" - }, - backface: { - type: "color", - defaultValue: "#33cc33" - }, - stroke: { - type: "number", - defaultValue: "100" - } - } - }, { - opcode: "createCylinder", - blockType: "command", - text: this.formatMessage("Cube.createCylinder"), - arguments: { - id: { - type: "string", - defaultValue: "lazytong" - }, - x: { - type: "number", - defaultValue: "0" - }, - y: { - type: "number", - defaultValue: "0" - }, - z: { - type: "number", - defaultValue: "0" - }, - length: { - type: "number", - defaultValue: "50" - }, - color: { - type: "color", - defaultValue: "#33cc33" - }, - frontface: { - type: "color", - defaultValue: "#33cc33" - }, - backface: { - type: "color", - defaultValue: "#33cc33" - }, - stroke: { - type: "number", - defaultValue: "100" - } - } - }, { - opcode: "createBox", - blockType: "command", - text: this.formatMessage("Cube.createBox"), - arguments: { - id: { - type: "string", - defaultValue: "lazytong" - }, - x: { - type: "number", - defaultValue: "0" - }, - y: { - type: "number", - defaultValue: "0" - }, - z: { - type: "number", - defaultValue: "0" - }, - width: { - type: "number", - defaultValue: "100" - }, - height: { - type: "number", - defaultValue: "20" - }, - depth: { - type: "number", - defaultValue: "50" - }, - color: { - type: "color", - defaultValue: "#33cc33" - }, - leftface: { - type: "color", - defaultValue: "#33cc33" - }, - rightface: { - type: "color", - defaultValue: "#33cc33" - }, - topface: { - type: "color", - defaultValue: "#33cc33" - }, - bottomface: { - type: "color", - defaultValue: "#33cc33" - }, - stroke: { - type: "number", - defaultValue: "100" - } - } - }, { - opcode: "createCustom", - blockType: "command", - text: this.formatMessage("Cube.createCustom"), - arguments: { - id: { - type: "string", - defaultValue: "lazytong" - }, - x: { - type: "number", - defaultValue: "0" - }, - y: { - type: "number", - defaultValue: "0" - }, - z: { - type: "number", - defaultValue: "0" - }, - color: { - type: "color", - defaultValue: "#33cc33" - }, - path: { - type: "string", - menu: "files" - }, - stroke: { - type: "number", - defaultValue: "100" - } - } - }, `---${this.formatMessage("Cube.modify")}`, { - opcode: "deleteObject", - blockType: "command", - text: this.formatMessage("Cube.deleteObject"), - arguments: { - id: { - type: "string", - defaultValue: "lazytong" - } - } - }, { - opcode: "deleteAllObject", - blockType: "command", - text: this.formatMessage("Cube.deleteAllObject"), - arguments: {} - }, { - opcode: "setRotate", - blockType: "command", - text: this.formatMessage("Cube.setRotate"), - arguments: { - id: { - type: "string", - defaultValue: "lazytong" - }, - type: { - type: "string", - menu: "rotate" - }, - rotate: { - type: "number", - defaultValue: "10" - } - } - }, { - opcode: "updateRender", - blockType: "command", - text: this.formatMessage("Cube.updateRender"), - arguments: {} - }, `---${this.formatMessage("Cube.info")}`, { - opcode: "getAttrib", - blockType: "reporter", - text: this.formatMessage("Cube.getAttrib"), - arguments: { - id: { - type: "string", - defaultValue: "lazytong" - }, - type: { - type: "string", - menu: "attrib" - } - } - }, { - opcode: "getObjectList", - blockType: "reporter", - text: this.formatMessage("Cube.getObjectList"), - arguments: {} - }, { - opcode: "getObjectNumbers", - blockType: "reporter", - text: this.formatMessage("Cube.getObjectNumbers"), - arguments: {} - }], - menus: { - attrib: [{ - text: this.formatMessage("Cube.x"), - value: "x" - }, { - text: this.formatMessage("Cube.y"), - value: "y" - }, { - text: this.formatMessage("Cube.z"), - value: "z" - }, { - text: this.formatMessage("Cube.width"), - value: "width" - }, { - text: this.formatMessage("Cube.height"), - value: "height" - }, { - text: this.formatMessage("Cube.stroke"), - value: "stroke" - }, { - text: this.formatMessage("Cube.color"), - value: "color" - }, { - text: this.formatMessage("Cube.quarters"), - value: "quarters" - }, { - text: this.formatMessage("Cube.cornerRadius"), - value: "cornerRadius" - }, { - text: this.formatMessage("Cube.radius"), - value: "radius" - }], - files: { - acceptReporters: !0, - items: (() => { - try { - const e = this.runtime.getGandiAssetsFileList("json").map(e => ({ - text: e.fullName, - value: e.id - })); - return 1 > e.length ? [{ - text: this.formatMessage("Cube.fileListEmpty"), - value: "fileListEmpty" - }] : e - } catch (e) { - return [{ - text: this.formatMessage("Cube.fileListEmpty"), - value: "fileListEmpty" - }] - } - })() - }, - rotate: [{ - text: this.formatMessage("Cube.x"), - value: "x" - }, { - text: this.formatMessage("Cube.y"), - value: "y" - }, { - text: this.formatMessage("Cube.z"), - value: "z" - }] + + createRoundedRect(args) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.roundedRect({ + width: +args.width, + height: +args.height, + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + cornerRadius: +args.radius, + translate: { + x: +args.x, + y: +args.y, + z: +args.z + } + }), this.cubeScene.addChild(this.objectList[args.id])) } - } - } - docs() { - let e = document.createElement("a"); - e.href = "https://lt.js.org/posts/20240718", e.rel = "noopener noreferrer", e.target = "_blank", e.click() - } - createRect(e) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.rect({ - width: +e.width, - height: +e.height, - stroke: +e.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - translate: { - x: +e.x, - y: +e.y, - z: +e.z + + createCircle(args) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.ellipse({ + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + diameter: +args.diameter, + translate: { + x: +args.x, + y: +args.y, + z: +args.z + }, + quarters: +args.quarters + }), this.cubeScene.addChild(this.objectList[args.id])) } - }), this.cubeScene.addChild(this.objectList[e.id])) - } - createRoundedRect(e) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.roundedRect({ - width: +e.width, - height: +e.height, - stroke: +e.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - cornerRadius: +e.radius, - translate: { - x: +e.x, - y: +e.y, - z: +e.z + + createEllipse(args) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.ellipse({ + width: +args.width, + height: +args.height, + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +args.x, + y: +args.y, + z: +args.z + }, + quarters: +args.quarters + }), this.cubeScene.addChild(this.objectList[args.id])) } - }), this.cubeScene.addChild(this.objectList[e.id])) - } - createCircle(e) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.ellipse({ - stroke: +e.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - diameter: +e.diameter, - translate: { - x: +e.x, - y: +e.y, - z: +e.z - }, - quarters: +e.quarters - }), this.cubeScene.addChild(this.objectList[e.id])) - } - createEllipse(e) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.ellipse({ - width: +e.width, - height: +e.height, - stroke: +e.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - translate: { - x: +e.x, - y: +e.y, - z: +e.z - }, - quarters: +e.quarters - }), this.cubeScene.addChild(this.objectList[e.id])) - } - createPolygon(e) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.polygon({ - sides: +e.sides, - radius: +e.sides, - stroke: +e.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - translate: { - x: +e.x, - y: +e.y, - z: +e.z + + createPolygon(args) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.polygon({ + sides: +args.sides, + radius: +args.sides, + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +args.x, + y: +args.y, + z: +args.z + } + }), this.cubeScene.addChild(this.objectList[args.id])) } - }), this.cubeScene.addChild(this.objectList[e.id])) - } - createHemisphere(e) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.hemisphere({ - diameter: +e.diameter, - stroke: +e.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - backface: (() => /^#([0-9a-f]{6})$/i.test(e.backface) ? e.backface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - translate: { - x: +e.x, - y: +e.y, - z: +e.z + + createHemisphere(args) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.hemisphere({ + diameter: +args.diameter, + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + backface: (() => /^#([0-9a-f]{6})$/i.test(args.backface) ? args.backface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +args.x, + y: +args.y, + z: +args.z + } + }), this.cubeScene.addChild(this.objectList[args.id])) } - }), this.cubeScene.addChild(this.objectList[e.id])) - } - createCone(e) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.cone({ - diameter: +e.diameter, - stroke: +e.stroke / 100, - length: +e.length, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - backface: (() => /^#([0-9a-f]{6})$/i.test(e.backface) ? e.backface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - translate: { - x: +e.x, - y: +e.y, - z: +e.z + + createCone(args) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.cone({ + diameter: +args.diameter, + stroke: +args.stroke / 100, + length: +args.length, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + backface: (() => /^#([0-9a-f]{6})$/i.test(args.backface) ? args.backface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +args.x, + y: +args.y, + z: +args.z + } + }), this.cubeScene.addChild(this.objectList[args.id])) } - }), this.cubeScene.addChild(this.objectList[e.id])) - } - createCylinder(e) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.cylinder({ - diameter: +e.diameter, - stroke: +e.stroke / 100, - length: +e.length, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - backface: (() => /^#([0-9a-f]{6})$/i.test(e.backface) ? e.backface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - frontFace: (() => /^#([0-9a-f]{6})$/i.test(e.frontface) ? e.frontface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - translate: { - x: +e.x, - y: +e.y, - z: +e.z + + createCylinder(args) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.cylinder({ + diameter: +args.diameter, + stroke: +args.stroke / 100, + length: +args.length, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + backface: (() => /^#([0-9a-f]{6})$/i.test(args.backface) ? args.backface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + frontFace: (() => /^#([0-9a-f]{6})$/i.test(args.frontface) ? args.frontface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +args.x, + y: +args.y, + z: +args.z + } + }), this.cubeScene.addChild(this.objectList[args.id])) } - }), this.cubeScene.addChild(this.objectList[e.id])) - } - createBox(e) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.box({ - width: +e.width, - height: +e.height, - depth: +e.depth, - stroke: +e.stroke / 100, - length: +e.length, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - leftFace: (() => /^#([0-9a-f]{6})$/i.test(e.leftface) ? e.leftface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - rightFace: (() => /^#([0-9a-f]{6})$/i.test(e.rightface) ? e.rightface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - topFace: (() => /^#([0-9a-f]{6})$/i.test(e.topface) ? e.topface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - bottomFace: (() => /^#([0-9a-f]{6})$/i.test(e.bottomface) ? e.bottomface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - translate: { - x: +e.x, - y: +e.y, - z: +e.z + + createBox(args) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.box({ + width: +args.width, + height: +args.height, + depth: +args.depth, + stroke: +args.stroke / 100, + length: +args.length, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + leftFace: (() => /^#([0-9a-f]{6})$/i.test(args.leftface) ? args.leftface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + rightFace: (() => /^#([0-9a-f]{6})$/i.test(args.rightface) ? args.rightface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + topFace: (() => /^#([0-9a-f]{6})$/i.test(args.topface) ? args.topface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + bottomFace: (() => /^#([0-9a-f]{6})$/i.test(args.bottomface) ? args.bottomface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + translate: { + x: +args.x, + y: +args.y, + z: +args.z + } + }), this.cubeScene.addChild(this.objectList[args.id])) } - }), this.cubeScene.addChild(this.objectList[e.id])) - } - createCustom(t) { - null !== this.canvas() && null !== this.cubeParent() && "{}" !== t.path && (void 0 !== this.objectList[t.id] && (this.cubeScene.removeChild(this.objectList[t.id]), this.objectList[t.id] = void 0), this.objectList[t.id] = new this.Cube.custom({ - stroke: +t.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(t.color) ? t.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - path: (() => { - let e = this.runtime.getGandiAssetsFileList().map(t => t.fullName); - return "fileListEmpty" == t.path | -1 == e.indexOf(t.path) | !Array.isArray(t.path) ? [] : JSON.parse((r => { - let e = ""; - for (let t = 0; t < r.length; t++) e += String.fromCharCode(r[t]); - return e - })(this.runtime.getGandiAssetById(t.path).asset.data)) - })(), - translate: { - x: +t.x, - y: +t.y, - z: +t.z + + createCustom(args) { + null !== this.canvas() && null !== this.cubeParent() && "{}" !== args.path && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.custom({ + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + path: (() => { + let e = this.runtime.getGandiAssetsFileList().map(t => t.fullName); + return "fileListEmpty" == args.path | -1 == e.indexOf(args.path) | !Array.isArray(args.path) ? [] : JSON.parse((r => { + let e = ""; + for (let t = 0; t < r.length; t++) e += String.fromCharCode(r[t]); + return e + })(this.runtime.getGandiAssetById(args.path).asset.data)) + })(), + translate: { + x: +args.x, + y: +args.y, + z: +args.z + } + }), this.cubeScene.addChild(this.objectList[args.id])) } - }), this.cubeScene.addChild(this.objectList[t.id])) - } - deleteObject(e) { - null !== this.cubeParent() && void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0) - } - deleteAllObject() { - if (null !== this.cubeParent()) { - for (let e in this.objectList) this.cubeScene.removeChild(this.objectList[e]); - this.objectList = {} - } - } - getAttrib(e) { - if (void 0 !== typeof this.objectList[e.id]) switch (e.type) { - case "x": - return "undefined" == typeof this.objectList[e.id].translate.x ? "" : this.objectList[e.id].translate.x; - case "y": - return "undefined" == typeof this.objectList[e.id].translate.y ? "" : this.objectList[e.id].translate.y; - case "z": - return "undefined" == typeof this.objectList[e.id].translate.z ? "" : this.objectList[e.id].translate.z; - case "width": - return "undefined" == typeof this.objectList[e.id].width ? "" : this.objectList[e.id].width; - case "height": - return "undefined" == typeof this.objectList[e.id].height ? "" : this.objectList[e.id].height; - case "color": - return "undefined" == typeof this.objectList[e.id].color ? "" : this.objectList[e.id].color; - case "stroke": - return "undefined" == typeof this.objectList[e.id].stroke ? "" : this.objectList[e.id].stroke; - case "quarters": - return "undefined" == typeof this.objectList[e.id].quarters ? "" : this.objectList[e.id].quarters; - case "cornerRadius": - return "undefined" == typeof this.objectList[e.id].cornerRadius ? "" : this.objectList[e.id].cornerRadius; - case "radius": - return "undefined" == typeof this.objectList[e.id].radius ? "" : this.objectList[e.id].radius; - default: - return ""; - } - } - getObjectNumbers() { - return Object.keys(this.objectList).length - } - setRotate(e) { - if (void 0 !== typeof this.objectList[e.id]) switch (e.type) { - case "x": - this.objectList[e.id].rotate.x = +e.rotate * (Math.PI / 180); - break; - case "y": - this.objectList[e.id].rotate.y = +e.rotate * (Math.PI / 180); - break; - case "z": - this.objectList[e.id].rotate.z = +e.rotate * (Math.PI / 180); - default: - } - } - getObjectList() { - return Object.keys(this.objectList) - } - updateRender() { - this.cubeScene.updateRenderGraph() - } - }, - info: { - name: "Cube.name", - description: "Cube.description", - extensionId: "LazyTong.Cube", - iconURL: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDYwMCAzNzIiIHdpZHRoPSI2MDAiIGhlaWdodD0iMzcyIiBmaWxsPSJ3aGl0ZSI+PGltYWdlIHdpZHRoPSIyNDAwIiBoZWlnaHQ9IjgwMCIgdHJhbnNmb3JtPSJtYXRyaXgoLjM2MiwwLDAsLjM2MiwtMTM1LDgyKSIgaHJlZj0iZGF0YTppbWFnZS9zdmcreG1sO2Jhc2U2NCxQSE4yWn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VXNNVEl3TUN3M01VTXhNalUxTGpVMU5UVTFOVFUxTlRVMU5UY3NOelF1TnpVc01USTNOeTQzTnpjM056YzNOemMzTnpjNExDMHhOUzQzT1RFMk5qWTJOalkyTmpZMk5qZ3NNVE16TXk0ek16TXpNek16TXpNek16TTFMQzB4TVVNeE16ZzRMamc0T0RnNE9EZzRPRGc0T1RFc0xUWXVNakE0TXpNek16TXpNek16TXpNekxERTBNVEV1TVRFeE1URXhNVEV4TVRFeE15dzRPUzQyTWpVc01UUTJOaTQyTmpZMk5qWTJOalkyTmpZM0xEazBRekUxTWpJdU1qSXlNakl5TWpJeU1qSXlNaXc1T0M0ek56VXNNVFUwTkM0ME5EUTBORFEwTkRRME5EUXpMREUyTGpnM05Td3hOakF3TERFd1F6RTJOVFV1TlRVMU5UVTFOVFUxTlRVMU55d3pMakV5TlN3eE5qYzNMamMzTnpjM056YzNOemMzTnpnc05qSXVNRFF4TmpZMk5qWTJOalkyTmpZMExERTNNek11TXpNek16TXpNek16TXpNek5TdzJNVU14TnpnNExqZzRPRGc0T0RnNE9EZzRPVEVzTlRrdU9UVTRNek16TXpNek16TXpNek0yTERFNE1URXVNVEV4TVRFeE1URXhNVEV4TERFdU5qWTJOalkyTmpZMk5qWTJOalkzTERFNE5qWXVOalkyTmpZMk5qWTJOalkyTnl3MVF6RTVNakl1TWpJeU1qSXlNakl5TWpJeU5DdzRMak16TXpNek16TXpNek16TXpNek1pd3hPVFEwTGpRME5EUTBORFEwTkRRME5EWXNOell1TVRZMk5qWTJOalkyTmpZMk5qY3NNakF3TUM0d01EQXdNREF3TURBd01EQXlMRGMzUXpJd05UVXVOVFUxTlRVMU5UVTFOVFUxTnl3M055NDRNek16TXpNek16TXpNek16TXl3eU1EYzNMamMzTnpjM056YzNOemMzT0N3eExqVXNNakV6TXk0ek16TXpNek16TXpNek16TTFMRGxETWpFNE9DNDRPRGc0T0RnNE9EZzRPRGtzTVRZdU5Td3lNakV4TGpFeE1URXhNVEV4TVRFeE1UTXNNVEV6TGpnek16TXpNek16TXpNek16TXpMREl5TmpZdU5qWTJOalkyTmpZMk5qWTNMREV4TTBNeU16SXlMakl5TWpJeU1qSXlNakl5TWpZc01URXlMakUyTmpZMk5qWTJOalkyTmpZM0xESXpNakF1TVRNNE9EZzRPRGc0T0RnNUxDMDFOQzQzT1RFMk5qWTJOalkyTmpZMk55d3lOREF3TERWRE1qUTNPUzQ0TmpFeE1URXhNVEV4TVRFc05qUXVOemt4TmpZMk5qWTJOalkyTmpjc016STFOQzR4TmpZMk5qWTJOalkyTmpZMUxESXhNeTQxTkRFMk5qWTJOalkyTmpZMk9Td3lOalV3TERRd01FTXlNRFExTGpnek16TXpNek16TXpNek16VXNOVGcyTGpRMU9ETXpNek16TXpNek16TXNNVFUyTGpJMUxEYzVOUzQ0TXpNek16TXpNek16TXpNMExDMDFNREFzT1RBd0lpQjBjbUZ1YzJadmNtMDlJbTFoZEhKcGVDZ3hMREFzTUN3eExEQXNNVEl3S1NJZ2IzQmhZMmwwZVQwaU1DNHdOU0krUEM5d1lYUm9Qanh3WVhSb0lHUTlJazB0TVRBc01UQkRNVGt1T0RZeE1URXhNVEV4TVRFeE1URXNNalF1TnpreE5qWTJOalkyTmpZMk5qWTRMRGMxTGpZNU5EUTBORFEwTkRRME5EUTJMRGszTGpnM05Td3hNek11TXpNek16TXpNek16TXpNek16UXNPREZETVRrd0xqazNNakl5TWpJeU1qSXlNakl6TERZMExqRXlOU3d5TVRFdU1URXhNVEV4TVRFeE1URXhNVFFzTFRVM0xqZzNOU3d5TmpZdU5qWTJOalkyTmpZMk5qWTJOeXd0TnpGRE16SXlMakl5TWpJeU1qSXlNakl5TWpJekxDMDROQzR4TWpVc016UTBMalEwTkRRME5EUTBORFEwTkRRMkxEVXVOekE0TXpNek16TXpNek16TXpNeUxEUXdNQ3d4T0VNME5UVXVOVFUxTlRVMU5UVTFOVFUxTlRRc016QXVNamt4TmpZMk5qWTJOalkyTmpZNExEUTNOeTQzTnpjM056YzNOemMz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npVc01UVTBOQzQwTkRRME5EUTBORFEwTkRRekxERTJMamczTlN3eE5qQXdMREV3UXpFMk5UVXVOVFUxTlRVMU5UVTFOVFUxTnl3ekxqRXlOU3d4TmpjM0xqYzNOemMzTnpjM056YzNOemdzTmpJdU1EUXhOalkyTmpZMk5qWTJOalkwTERFM016TXVNek16TXpNek16TXpNek16TlN3Mk1VTXhOemc0TGpnNE9EZzRPRGc0T0RnNE9URXNOVGt1T1RVNE16TXpNek16TXpNek16TTJMREU0TVRFdU1URXhNVEV4TVRFeE1URXhMREV1TmpZMk5qWTJOalkyTmpZMk5qWTNMREU0TmpZdU5qWTJOalkyTmpZMk5qWTJOeXcxUXpFNU1qSXVNakl5TWpJeU1qSXlNakl5TkN3NExqTXpNek16TXpNek16TXpNek16TWl3eE9UUTBMalEwTkRRME5EUTBORFEwTkRZc056WXVNVFkyTmpZMk5qWTJOalkyTmpjc01qQXdNQzR3TURBd01EQXdNREF3TURBeUxEYzNRekl3TlRVdU5UVTFOVFUxTlRVMU5UVTFOeXczTnk0NE16TXpNek16TXpNek16TXpNeXd5TURjM0xqYzNOemMzTnpjM056YzNPQ3d4TGpVc01qRXpNeTR6TXpNek16TXpNek16TXpNMUxEbERNakU0T0M0NE9EZzRPRGc0T0RnNE9Ea3NNVFl1TlN3eU1qRXhMakV4TVRFeE1URXhNVEV4TVRNc01URXpMamd6TXpNek16TXpNek16TXpNekxESXlOall1TmpZMk5qWTJOalkyTmpZM0xERXhNME15TXpJeUxqSXlNakl5TWpJeU1qSXlNallzTVRFeUxqRTJOalkyTmpZMk5qWTJOalkzTERJek1qQXVNVE00T0RnNE9EZzRPRGc1TEMwMU5DNDNPVEUyTmpZMk5qWTJOalkyTnl3eU5EQXdMRFZETWpRM09TNDROakV4TVRFeE1URXhNVEVzTmpRdU56a3hOalkyTmpZMk5qWTJOamNzTXpJMU5DNHhOalkyTmpZMk5qWTJOalkxTERJeE15NDFOREUyTmpZMk5qWTJOalkyT1N3eU5qVXdMRFF3TUVNeU1EUTFMamd6TXpNek16TXpNek16TXpVc05UZzJMalExT0RNek16TXpNek16TXpNc01UVTJMakkxTERjNU5TNDRNek16TXpNek16TXpNek0wTEMwMU1EQXNPVEF3SWlCMGNtRnVjMlp2Y20wOUltMWhkSEpwZUNneExEQXNNQ3d4TERBc01qUXdLU0lnYjNCaFkybDBlVDBpTUM0ek55SStQQzl3WVhSb1BqeHdZWFJvSUdROUlrMHRNVEFzTVRCRE1Ua3VPRFl4TVRFeE1URXhNVEV4TVRFc01qUXVOemt4TmpZMk5qWTJOalkyTmpZNExEYzFMalk1TkRRME5EUTBORFEwTkRRMkxEazNMamczTlN3eE16TXVNek16TXpNek16TXpNek16TXpRc09ERkRNVGt3TGprM01qSXlNakl5TWpJeU1qSXpMRFkwTGpFeU5Td3lNVEV1TVRFeE1URXhNVEV4TVRFeE1UUXNMVFUzTGpnM05Td3lOall1TmpZMk5qWTJOalkyTmpZMk55d3ROekZETXpJeUxqSXlNakl5TWpJeU1qSXlNakl6TEMwNE5DNHhNalVzTXpRMExqUTBORFEwTkRRME5EUTBORFEyTERVdU56QTRNek16TXpNek16TXpNek15TERRd01Dd3hPRU0wTlRVdU5UVTFOVFUxTlRVMU5UVTFOVFFzTXpBdU1qa3hOalkyTmpZMk5qWTJOalk0TERRM055NDNOemMzTnpjM056YzNOemM0TEMweE5pNHpOelVzTlRNekxqTXpNek16TXpNek16TXpNelFzTFRFeVF6VTRPQzQ0T0RnNE9EZzRPRGc0T0RnNUxDMDNMall5TlN3Mk1URXVNVEV4TVRFeE1URXhNVEV4TWl3ME1TNHdPRE16TXpNek16TXpNek16TXpZc05qWTJMalkyTmpZMk5qWTJOalkyTmpjc016bEROekl5TGpJeU1qSXlNakl5TWpJeU1qTXNNell1T1RFMk5qWTJOalkyTmpZMk5qWTBMRGMwTkM0ME5EUTBORFEwTkRRME5EUTFMQzB5Tnl3NE1EQXNMVEl5UXpnMU5TNDFOVFUxTlRVMU5UVTFOVFUxTEMweE55dzROemN1TnpjM056YzNOemMzTnpjM09DdzJOQzQwTlRnek16TXpNek16TXpNek15dzVNek11TXpNek16TXpNek16TXpNek5DdzJNME01T0RndU9EZzRPRGc0T0RnNE9EZzRPU3cyTVM0MU5ERTJOalkyTmpZMk5qWTJOalFzTVRBeE1TNHhNVEV4TVRFeE1URXhNVEV5TEMwek1DNDJOalkyTmpZMk5qWTJOalkyTmpnc01UQTJOaTQyTmpZMk5qWTJOalkyTmpZM0xDMHlPVU14TVRJeUxqSXlNakl5TWpJeU1qSXlNaklzTFRJM0xqTXpNek16TXpNek16TXpNek16TWl3eE1UUTBMalEwTkRRME5EUTBORFEwTkRNc05qY3VNalVzTVRJd01DdzNNVU14TWpVMUxqVTFOVFUxTlRVMU5UVTFOVGNzTnpRdU56VXNNVEkzTnk0M056YzNOemMzTnpjM056YzRMQzB4TlM0M09URTJOalkyTmpZMk5qWTJOamdzTVRNek15NHpNek16TXpNek16TXpNek0xTEMweE1VTXhNemc0TGpnNE9EZzRPRGc0T0RnNE9URXNMVFl1TWpBNE16TXpNek16TXpNek16TXpMREUwTVRFdU1URXhNVEV4TVRFeE1URXhNeXc0T1M0Mk1qVXNNVFEyTmk0Mk5qWTJOalkyTmpZMk5qWTNMRGswUXpFMU1qSXVNakl5TWpJeU1qSXlNakl5TWl3NU9DNHpOelVzTVRVME5DNDBORFEwTkRRME5EUTBORFF6TERFMkxqZzNOU3d4TmpBd0xERXdRekUyTlRVdU5UVTFOVFUxTlRVMU5UVTFOeXd6TGpFeU5Td3hOamMzTGpjM056YzNOemMzTnpjM056Z3NOakl1TURReE5qWTJOalkyTmpZMk5qWTBMREUzTXpNdU16TXpNek16TXpNek16TXpOU3cyTVVNeE56ZzRMamc0T0RnNE9EZzRPRGc0T1RFc05Ua3VPVFU0TXpNek16TXpNek16TXpNMkxERTRNVEV1TVRFeE1URXhNVEV4TVRFeExERXVOalkyTmpZMk5qWTJOalkyTmpZM0xERTROall1TmpZMk5qWTJOalkyTmpZMk55dzFRekU1TWpJd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TkRRME5EUTBORE1zTmpjdU1qVXNNVEl3TUN3M01VTXhNalUxTGpVMU5UVTFOVFUxTlRVMU5UY3NOelF1TnpVc01USTNOeTQzTnpjM056YzNOemMzTnpjNExDMHhOUzQzT1RFMk5qWTJOalkyTmpZMk5qZ3NNVE16TXk0ek16TXpNek16TXpNek16TTFMQzB4TVVNeE16ZzRMamc0T0RnNE9EZzRPRGc0T1RFc0xUWXVNakE0TXpNek16TXpNek16TXpNekxERTBNVEV1TVRFeE1URXhNVEV4TVRFeE15dzRPUzQyTWpVc01UUTJOaTQyTmpZMk5qWTJOalkyTmpZM0xEazBRekUxTWpJdU1qSXlNakl5TWpJeU1qSXlNaXc1T0M0ek56VXNNVFUwTkM0ME5EUTBORFEwTkRRME5EUXpMREUyTGpnM05Td3hOakF3TERFd1F6RTJOVFV1TlRVMU5UVTFOVFUxTlRVMU55d3pMakV5TlN3eE5qYzNMamMzTnpjM056YzNOemMzTnpnc05qSXVNRFF4TmpZMk5qWTJOalkyTmpZMExERTNNek11TXpNek16TXpNek16TXpNek5TdzJNVU14TnpnNExqZzRPRGc0T0RnNE9EZzRPVEVzTlRrdU9UVTRNek16TXpNek16TXpNek0yTERFNE1URXVNVEV4TVRFeE1URXhNVEV4TERFdU5qWTJOalkyTmpZMk5qWTJOalkzTERFNE5qWXVOalkyTmpZMk5qWTJOalkyTnl3MVF6RTVNakl1TWpJeU1qSXlNakl5TWpJeU5DdzRMak16TXpNek16TXpNek16TXpNek1pd3hPVFEwTGpRME5EUTBORFEwTkRRME5EWXNOell1TVRZMk5qWTJOalkyTmpZMk5qY3NNakF3TUM0d01EQXdNREF3TURBd01EQXlMRGMzUXpJd05UVXVOVFUxTlRVMU5UVTFOVFUxTnl3M055NDRNek16TXpNek16TXpNek16TXl3eU1EYzNMamMzTnpjM056YzNOemMzT0N3eExqVXNNakV6TXk0ek16TXpNek16TXpNek16TTFMRGxETWpFNE9DNDRPRGc0T0RnNE9EZzRPRGtzTVRZdU5Td3lNakV4TG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ybC0yOC0xMy43eiIvPjxwYXRoIGNsYXNzPSJlIiBkPSJtNjguMyAyMi42bC0yOC42IDEzLjN2MzUuMmwyOC42LTEzLjR6Ii8+PC9zdmc+", - featured: !0, - disabled: !1, - collaboratorList: [{ - collaborator: "LazyTong @ Github", - collaboratorURL: "https://github.com/lazytong-tech" - }], - doc: "https://lt.js.org/posts/20240718" - }, - l10n: { - "zh-cn": { - "Cube.name": "LazyTong\u7684\u7ACB\u65B9\u4F53", - "Cube.description": "\u6DFB\u52A0\u7ACB\u4F53\u56FE\u5F62\uFF01" + + deleteObject(args) { + null !== this.cubeParent() && void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0) + } + + deleteAllObject() { + if (null !== this.cubeParent()) { + for (let e in this.objectList) this.cubeScene.removeChild(this.objectList[e]); + this.objectList = {} + } + } + + getAttrib(args) { + if (void 0 !== typeof this.objectList[args.id]) switch (args.type) { + case "x": + return "undefined" == typeof this.objectList[args.id].translate.x ? "" : this.objectList[args.id].translate.x; + case "y": + return "undefined" == typeof this.objectList[args.id].translate.y ? "" : this.objectList[args.id].translate.y; + case "z": + return "undefined" == typeof this.objectList[args.id].translate.z ? "" : this.objectList[args.id].translate.z; + case "width": + return "undefined" == typeof this.objectList[args.id].width ? "" : this.objectList[args.id].width; + case "height": + return "undefined" == typeof this.objectList[args.id].height ? "" : this.objectList[args.id].height; + case "color": + return "undefined" == typeof this.objectList[args.id].color ? "" : this.objectList[args.id].color; + case "stroke": + return "undefined" == typeof this.objectList[args.id].stroke ? "" : this.objectList[args.id].stroke; + case "quarters": + return "undefined" == typeof this.objectList[args.id].quarters ? "" : this.objectList[args.id].quarters; + case "cornerRadius": + return "undefined" == typeof this.objectList[args.id].cornerRadius ? "" : this.objectList[args.id].cornerRadius; + case "radius": + return "undefined" == typeof this.objectList[args.id].radius ? "" : this.objectList[args.id].radius; + default: + return ""; + } + } + + getObjectNumbers() { + return Object.keys(this.objectList).length + } + + setRotate(args) { + if (void 0 !== typeof this.objectList[args.id]) switch (args.type) { + case "x": + this.objectList[args.id].rotate.x = +args.rotate * (Math.PI / 180); + break; + case "y": + this.objectList[args.id].rotate.y = +args.rotate * (Math.PI / 180); + break; + case "z": + this.objectList[args.id].rotate.z = +args.rotate * (Math.PI / 180); + default: + } + } + + getObjectList() { + return Object.keys(this.objectList) + } + + updateRender() { + this.cubeScene.updateRenderGraph() + } + }, + info: { + name: "Cube.name", + description: "Cube.description", + extensionId: "LazyTong.Cube", + iconURL: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDYwMCAzNzIiIHdpZHRoPSI2MDAiIGhlaWdodD0iMzcyIiBmaWxsPSJ3aGl0ZSI+PGltYWdlIHdpZHRoPSIyNDAwIiBoZWlnaHQ9IjgwMCIgdHJhbnNmb3JtPSJtYXRyaXgoLjM2MiwwLDAsLjM2MiwtMTM1LDgyKSIgaHJlZj0iZGF0YTppbWFnZS9zdmcreG1sO2Jhc2U2NCxQSE4yWnlCNGJXeHVjejBpYUhSMGNEb3ZMM2QzZHk1M015NXZjbWN2TWpBd01DOXpkbWNpSUhabGNuTnBiMjQ5SWpFdU1TSWdlRzFzYm5NNmVHeHBibXM5SW1oMGRIQTZMeTkzZDNjdWR6TXViM0puTHpFNU9Ua3ZlR3hwYm1zaUlIaHRiRzV6T25OMloycHpQU0pvZEhSd09pOHZjM1puYW5NdVpHVjJMM04yWjJweklpQjJhV1YzUW05NFBTSXdJREFnTWpRd01DQTRNREFpSUc5d1lXTnBkSGs5SWpFaVBqeGtaV1p6UGp4c2FXNWxZWEpIY21Ga2FXVnVkQ0I0TVQwaU5UQWxJaUI1TVQwaU1DVWlJSGd5UFNJMU1DVWlJSGt5UFNJeE1EQWxJaUJwWkQwaWMzTnpkWEptTFdkeVlXUWlQanh6ZEc5d0lITjBiM0F0WTI5c2IzS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E5qYzNMamMzTnpjM056YzNOemMzTnpnc05qSXVNRFF4TmpZMk5qWTJOalkyTmpZMExERTNNek11TXpNek16TXpNek16TXpNek5TdzJNVU14TnpnNExqZzRPRGc0T0RnNE9EZzRPVEVzTlRrdU9UVTRNek16TXpNek16TXpNek0yTERFNE1URXVNVEV4TVRFeE1URXhNVEV4TERFdU5qWTJOalkyTmpZMk5qWTJOalkzTERFNE5qWXVOalkyTmpZMk5qWTJOalkyTnl3MVF6RTVNakl1TWpJeU1qSXlNakl5TWpJeU5DdzRMak16TXpNek16TXpNek16TXpNek1pd3hPVFEwTGpRME5EUTBORFEwTkRRME5EWXNOell1TVRZMk5qWTJOalkyTmpZMk5qY3NNakF3TUM0d01EQXdNREF3TURBd01EQXlMRGMzUXpJd05UVXVOVFUxTlRVMU5UVTFOVFUxTnl3M055NDRNek16TXpNek16TXpNek16TXl3eU1EYzNMamMzTnpjM056YzNOemMzT0N3eExqVXNNakV6TXk0ek16TXpNek16TXpNek16TTFMRGxETWpFNE9DNDRPRGc0T0RnNE9EZzRPRGtzTVRZdU5Td3lNakV4TGpFeE1URXhNVEV4TVRFeE1UTXNNVEV6TGpnek16TXpNek16TXpNek16TXpMREl5TmpZdU5qWTJOalkyTmpZMk5qWTNMREV4TTBNeU16SXlMakl5TWpJeU1qSXlNakl5TWpZc01URXlMakUyTmpZMk5qWTJOalkyTmpZM0xESXpNakF1TVRNNE9EZzRPRGc0T0RnNUxDMDFOQzQzT1RFMk5qWTJOalkyTmpZMk55d3lOREF3TERWRE1qUTNPUzQ0TmpFeE1URXhNVEV4TVRFc05qUXVOemt4TmpZMk5qWTJOalkyTmpjc016STFOQzR4TmpZMk5qWTJOalkyTmpZMUxESXhNeTQxTkRFMk5qWTJOalkyTmpZMk9Td3lOalV3TERRd01FTXlNRFExTGpnek16TXpNek16TXpNek16VXNOVGcyTGpRMU9ETXpNek16TXpNek16TXNNVFUyTGpJMUxEYzVOUzQ0TXpNek16TXpNek16TXpNMExDMDFNREFzT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0RnNE9EZzRPRGc0T1N3Mk1TNDFOREUyTmpZMk5qWTJOalkyTmpRc01UQXhNUzR4TVRFeE1URXhNVEV4TVRFeUxDMHpNQzQyTmpZMk5qWTJOalkyTmpZMk5qZ3NNVEEyTmk0Mk5qWTJOalkyTmpZMk5qWTNMQzB5T1VNeE1USXlMakl5TWpJeU1qSXlNakl5TWpJc0xUSTNMak16TXpNek16TXpNek16TXpNek1pd3hNVFEwTGpRME5EUTBORFEwTkRRME5ETXNOamN1TWpVc01USXdNQ3czTVVNeE1qVTFMalUxTlRVMU5UVTFOVFUxTlRjc056UXVOelVzTVRJM055NDNOemMzTnpjM056YzNOemM0TEMweE5TNDNPVEUyTmpZMk5qWTJOalkyTmpnc01UTXpNeTR6TXpNek16TXpNek16TXpNMUxDMHhNVU14TXpnNExqZzRPRGc0T0RnNE9EZzRPVEVzTFRZdU1qQTRNek16TXpNek16TXpNek16TERFME1URXVNVEV4TVRFeE1URXhNVEV4TXl3NE9TNDJNalVzTVRRMk5pNDJOalkyTmpZMk5qWTJOalkzTERrMFF6RTFNakl1TWpJeU1qSXlNakl5TWpJeU1pdzVPQzR6TnpVc01UVTBOQzQwTkRRME5EUTBORFEwTkRRekxERTJMamczTlN3eE5qQXdMREV3UXpFMk5UVXVOVFUxTlRVMU5UVTFOVFUxTnl3ekxqRXlOU3d4TmpjM0xqYzNOemMzTnpjM056YzNOemdzTmpJdU1EUXhOalkyTmpZMk5qWTJOalkwTERFM016TXVNek16TXpNek16TXpNek16TlN3Mk1VTXhOemc0TGpnNE9EZzRPRGc0T0RnNE9URXNOVGt1T1RVNE16TXpNek16TXpNek16TTJMREU0TVRFdU1URXhNVEV4TVRFeE1URXhMREV1TmpZMk5qWTJOalkyTmpZMk5qWTNMREU0TmpZdU5qWTJOalkyTmpZMk5qWTJOeXcxUXpFNU1qSXVNakl5TWpJeU1qSXlNakl5TkN3NExqTXpNek16TXpNek16TXpNek16TWl3eE9UUTBMalEwTkRRME5EUTBORFEwTkRZc056WXVNVFkyTmpZMk5qWTJOalkyTmpjc01qQXdNQzR3TURBd01EQXdNREF3TURBeUxEYzNRekl3TlRVdU5UVTFOVFUxTlRVMU5UVTFOeXczTnk0NE16TXpNek16TXpNek16TXpNeXd5TURjM0xqYzNOemMzTnpjM056YzNPQ3d4TGpVc01qRXpNeTR6TXpNek16TXpNek16TXpNMUxEbERNakU0T0M0NE9EZzRPRGc0T0RnNE9Ea3NNVFl1TlN3eU1qRXhMakV4TVRFeE1URXhNVEV4TVRNc01URXpMamd6TXpNek16TXpNek16TXpNekxESXlOall1TmpZMk5qWTJOalkyTmpZM0xERXhNME15TXpJeUxqSXlNakl5TWpJeU1qSXlNallzTVRFeUxqRTJOalkyTmpZMk5qWTJOalkzTERJek1qQXVNVE00T0RnNE9EZzRPRGc1TEMwMU5DNDNPVEUyTmpZMk5qWTJOalkyTnl3eU5EQXdMRFZETWpRM09TNDROakV4TVRFeE1URXhNVEVzTmpRdU56a3hOalkyTmpZMk5qWTJOamNzTXpJMU5DNHhOalkyTmpZMk5qWTJOalkxTERJeE15NDFOREUyTmpZMk5qWTJOalkyT1N3eU5qVXdMRFF3TUVNeU1EUTFMamd6TXpNek16TXpNek16TXpVc05UZzJMalExT0RNek16TXpNek16TXpNc01UVTJMakkxTERjNU5TNDRNek16TXpNek16TXpNek0wTEMwMU1EQXNPVEF3SWlCMGNtRnVjMlp2Y20wOUltMWhkSEpwZUNneExEQXNNQ3d4TERBc01qUXdLU0lnYjNCaFkybDBlVDBpTUM0ek55SStQQzl3WVhSb1BqeHdZWFJvSUdROUlrMHRNVEFzTVRCRE1Ua3VPRFl4TVRFeE1URXhNVEV4TVRFc01qUXVOemt4TmpZMk5qWTJOalkyTmpZNExEYzFMalk1TkRRME5EUTBORFEwTkRRMkxEazNMamczTlN3eE16TXVNek16TXpNek16TXpNek16TXpRc09ERkRNVGt3TGprM01qSXlNakl5TWpJeU1qSXpMRFkwTGpFeU5Td3lNVEV1TVRFeE1URXhNVEV4TVRFeE1UUXNMVFUzTGpnM05Td3lOall1TmpZMk5qWTJOalkyTmpZMk55d3ROekZETXpJeUxqSXlNakl5TWpJeU1qSXlNakl6TEMwNE5DNHhNalVzTXpRMExqUTBORFEwTkRRME5EUTBORFEyTERVdU56QTRNek16TXpNek16TXpNek15TERRd01Dd3hPRU0wTlRVdU5UVTFOVFUxTlRVMU5UVTFOVFFzTXpBdU1qa3hOalkyTmpZMk5qWTJOalk0TERRM055NDNOemMzTnpjM056YzNOemM0TEMweE5pNHpOelVzTlRNekxqTXpNek16TXpNek16TXpNelFzTFRFeVF6VTRPQzQ0T0RnNE9EZzRPRGc0T0RnNUxDMDNMall5TlN3Mk1URXVNVEV4TVRFeE1URXhNVEV4TWl3ME1TNHdPRE16TXpNek16TXpNek16TXpZc05qWTJMalkyTmpZMk5qWTJOalkyTmpjc016bEROekl5TGpJeU1qSXlNakl5TWpJeU1qTXNNell1T1RFMk5qWTJOalkyTmpZMk5qWTBMRGMwTkM0ME5EUTBORFEwTkRRME5EUTFMQzB5Tnl3NE1EQXNMVEl5UXpnMU5TNDFOVFUxTlRVMU5UVTFOVFUxTEMweE55dzROemN1TnpjM056YzNOemMzTnpjM09DdzJOQzQwTlRnek16TXpNek16TXpNek15dzVNek11TXpNek16TXpNek16TXpNek5DdzJNME01T0RndU9EZzRPRGc0T0RnNE9EZzRPU3cyTVM0MU5ERTJOalkyTmpZMk5qWTJOalFzTVRBeE1TNHhNVEV4TVRFeE1URXhNVEV5TEMwek1DNDJOalkyTmpZMk5qWTJOalkyTmpnc01UQTJOaTQyTmpZMk5qWTJOalkyTmpZM0xDMHlPVU14TVRJeUxqSXlNakl5TWpJeU1qSXlNaklzTFRJM0xqTXpNek16TXpNek16TXpNek16TWl3eE1UUTBMalEwTkRRME5EUTBORFEwTkRNc05qY3VNalVzTVRJd01DdzNNVU14TWpVMUxqVTFOVFUxTlRVMU5UVTFOVGNzTnpRdU56VXNNVEkzTnk0M056YzNOemMzTnpjM056YzRMQzB4TlM0M09URTJOalkyTmpZMk5qWTJOamdzTVRNek15NHpNek16TXpNek16TXpNek0xTEMweE1VTXhNemc0TGpnNE9EZzRPRGc0T0RnNE9URXNMVFl1TWpBNE16TXpNek16TXpNek16TXpMREUwTVRFdU1URXhNVEV4TVRFeE1URXhNeXc0T1M0Mk1qVXNNVFEyTmk0Mk5qWTJOalkyTmpZMk5qWTNMRGswUXpFMU1qSXVNakl5TWpJeU1qSXlNakl5TWl3NU9DNHpOelVzTVRVME5DNDBORFEwTkRRME5EUTBORFF6TERFMkxqZzNOU3d4TmpBd0xERXdRekUyTlRVdU5UVTFOVFUxTlRVMU5UVTFOeXd6TGpFeU5Td3hOamMzTGpjM056YzNOemMzTnpjM056Z3NOakl1TURReE5qWTJOalkyTmpZMk5qWTBMREUzTXpNdU16TXpNek16TXpNek16TXpOU3cyTVVNeE56ZzRMamc0T0RnNE9EZzRPRGc0T1RFc05Ua3VPVFU0TXpNek16TXpNek16TXpNMkxERTRNVEV1TVRFeE1URXhNVEV4TVRFeExERXVOalkyTmpZMk5qWTJOalkyTmpZM0xERTROall1TmpZMk5qWTJOalkyTmpZMk55dzFRekU1TWpJdU1qSXlNakl5TWpJeU1qSXlOQ3c0TGpNek16TXpNek16TXpNek16TXpNaXd4T1RRMExqUTBORFEwTkRRME5EUTBORFlzTnpZdU1UWTJOalkyTmpZMk5qWTJOamNzTWpBd01DNHdNREF3TURBd01EQXdNREF5TERjM1F6SXdOVFV1TlRVMU5UVTFOVFUxTlRVMU55dzNOeTQ0TXpNek16TXpNek16TXpNek15d3lNRGMzTGpjM056YzNOemMzTnpjM09Dd3hMalVzTWpFek15NHpNek16TXpNek16TXpNek0xTERsRE1qRTRPQzQ0T0RnNE9EZzRPRGc0T0Rrc01UWXVOU3d5TWpFeExqRXhNVEV4TVRFeE1URXhNVE1zTVRFekxqZ3pNek16TXpNek16TXpNek16TERJeU5qWXVOalkyTmpZMk5qWTJOalkzTERFeE0wTXlNekl5TGpJeU1qSXlNakl5TWpJeU1qWXNN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FUxTlRVMU55d3pMakV5TlN3eE5qYzNMamMzTnpjM056YzNOemMzTnpnc05qSXVNRFF4TmpZMk5qWTJOalkyTmpZMExERTNNek11TXpNek16TXpNek16TXpNek5TdzJNVU14TnpnNExqZzRPRGc0T0RnNE9EZzRPVEVzTlRrdU9UVTRNek16TXpNek16TXpNek0yTERFNE1URXVNVEV4TVRFeE1URXhNVEV4TERFdU5qWTJOalkyTmpZMk5qWTJOalkzTERFNE5qWXVOalkyTmpZMk5qWTJOalkyTnl3MVF6RTVNakl1TWpJeU1qSXlNakl5TWpJeU5DdzRMak16TXpNek16TXpNek16TXpNek1pd3hPVFEwTGpRME5EUTBORFEwTkRRME5EWXNOell1TVRZMk5qWTJOalkyTmpZMk5qY3NNakF3TUM0d01EQXdNREF3TURBd01EQXlMRGMzUXpJd05UVXVOVFUxTlRVMU5UVTFOVFUxTnl3M055NDRNek16TXpNek16TXpNek16TXl3eU1EYzNMamMzTnpjM056YzNOemMzT0N3eExqVXNNakV6TXk0ek16TXpNek16TXpNek16TTFMRGxETWpFNE9DNDRPRGc0T0RnNE9EZzRPRGtzTVRZdU5Td3lNakV4TGpFeE1URXhNVEV4TVRFeE1UTXNNVEV6TGpnek16TXpNek16TXpNek16TXpMREl5TmpZdU5qWTJOalkyTmpZMk5qWTNMREV4TTBNeU16SXlMakl5TWpJeU1qSXlNakl5TWpZc01URXlMakUyTmpZMk5qWTJOalkyTmpZM0xESXpNakF1TVRNNE9EZzRPRGc0T0RnNUxDMDFOQzQzT1RFMk5qWTJOalkyTmpZMk55d3lOREF3TERWRE1qUTNPUzQ0TmpFeE1URXhNVEV4TVRFc05qUXVOemt4TmpZMk5qWTJOalkyTmpjc016STFOQzR4TmpZMk5qWTJOalkyTmpZMUxESXhNeTQxTkRFMk5qWTJOalkyTmpZMk9Td3lOalV3TERRd01FTXlNRFExTGpnek16TXpNek16TXpNek16VXNOVGcyTGpRMU9ETXpNek16TXpNek16TXNNVFUyTGpJMUxEYzVOUzQ0TXpNek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orList: [{ + collaborator: "LazyTong @ Github", + collaboratorURL: "https://github.com/lazytong-tech" + }], + doc: "https://lt.js.org/posts/20240718" }, - en: { - "Cube.name": "LazyTong's Cube", - "Cube.description": "Create solid figure!" + l10n: { + "zh-cn": { + "Cube.name": "LazyTong的立方体 V1.0.2", + "Cube.description": "添加立体图形!" + }, + en: { + "Cube.name": "LazyTong's Cube V1.0.2", + "Cube.description": "Create solid figure!" + } } - } }); From 6cd5b7807b612f917c42cccfaf8c764da4588e4d Mon Sep 17 00:00:00 2001 From: LazyTong Date: Sun, 22 Sep 2024 16:53:47 +0800 Subject: [PATCH 6/8] Update Cube.js --- extensions/LazyTong/Cube.js | 709 +++++++++++++++++++----------------- 1 file changed, 374 insertions(+), 335 deletions(-) diff --git a/extensions/LazyTong/Cube.js b/extensions/LazyTong/Cube.js index 9e6fd389..d09378ee 100644 --- a/extensions/LazyTong/Cube.js +++ b/extensions/LazyTong/Cube.js @@ -1,8 +1,8 @@ -const icon = "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDgwIDgwIiB3aWR0aD0iODAiIGhlaWdodD0iODAiPjxzdHlsZT4uYXtmaWxsOiNlNjJ9LmJ7ZmlsbDojNmMwfS5je2ZpbGw6IzYzNn0uZHtmaWxsOiNlZDB9LmV7ZmlsbDojMzkwfTwvc3R5bGU+PHBhdGggY2xhc3M9ImEiIGQ9Im0xMS43IDIyLjNsMjguNi0xMy40djM1LjJsLTI4LjYgMTMuM3oiLz48cGF0aCBjbGFzcz0iYiIgZD0ibTY4LjMgMjIuNmwtMjgtMTMuN3YzNS4ybDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImMiIGQ9Im0zOS43IDcxLjFsLTI4LTEzLjcgMjguNi0xMy4zIDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImQiIGQ9Im02OC4zIDIyLjZsLTI4LTEzLjctMjguNiAxMy40IDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImIiIGQ9Im0xMS43IDIyLjNsMjggMTMuNnYzNS4ybC0yOC0xMy43eiIvPjxwYXRoIGNsYXNzPSJlIiBkPSJtNjguMyAyMi42bC0yOC42IDEzLjN2MzUuMmwyOC42LTEzLjR6Ii8+PC9zdmc+"; +const t = "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDgwIDgwIiB3aWR0aD0iODAiIGhlaWdodD0iODAiPjxzdHlsZT4uYXtmaWxsOiNlNjJ9LmJ7ZmlsbDojNmMwfS5je2ZpbGw6IzYzNn0uZHtmaWxsOiNlZDB9LmV7ZmlsbDojMzkwfTwvc3R5bGU+PHBhdGggY2xhc3M9ImEiIGQ9Im0xMS43IDIyLjNsMjguNi0xMy40djM1LjJsLTI4LjYgMTMuM3oiLz48cGF0aCBjbGFzcz0iYiIgZD0ibTY4LjMgMjIuNmwtMjgtMTMuN3YzNS4ybDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImMiIGQ9Im0zOS43IDcxLjFsLTI4LTEzLjcgMjguNi0xMy4zIDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImQiIGQ9Im02OC4zIDIyLjZsLTI4LTEzLjctMjguNiAxMy40IDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImIiIGQ9Im0xMS43IDIyLjNsMjggMTMuNnYzNS4ybC0yOC0xMy43eiIvPjxwYXRoIGNsYXNzPSJlIiBkPSJtNjguMyAyMi42bC0yOC42IDEzLjN2MzUuMmwyOC42LTEzLjR6Ii8+PC9zdmc+"; void (window.tempExt = { Extension: class { constructor(e) { - this.objectList = {}, this.runtime = e, this.canvas = () => { + this.objectList = {}, this.observer = null, this.runtime = e, this.canvas = () => { try { const { canvas: e @@ -23,7 +23,7 @@ void (window.tempExt = { } return null }, this.Cube = function () { - console.log("%cLazyTong's Cube\n    ▃▆█▇▄▖\n      ▟◤▖   ◥█▎\n   ◢◤  ▐     ▐▉\n  ▗◤   ▂ ▗▖  ▕█▎\n ◤ ▗▅▖◥▄ ▀◣  █▊\n▐ ▕▎◥▖◣◤    ◢██\n█◣ ◥▅█▀    ▐██◤\n▐█▙▂    ◢██◤\n◥██◣    ◢▄◤\n   ▀██▅▇▀\nVer 1.0.2\nhttps://lt.js.org ", "color:green;font-weight:bolder"); + console.log("%cLazyTong's Cube\n----------\n 銆€ 銆€鈻冣枂鈻堚枃鈻勨枛\n銆€ 銆€ 銆€ 鈻熲棨鈻栥€€銆€銆€鈼モ枅鈻嶾n 銆€ 鈼⑩棨銆€ 鈻愩€€銆€銆€ 銆€鈻愨枆\n銆€ 鈻椻棨銆€銆€銆€鈻傘€€鈻椻枛銆€銆€鈻曗枅鈻嶾n銆€鈼ゃ€€鈻椻枀鈻栤棩鈻勩€€鈻€鈼c€€銆€鈻堚枈\n鈻愩€€鈻曗枎鈼モ枛鈼b棨銆€銆€銆€銆€鈼⑩枅鈻圽n鈻堚棧銆€鈼モ枀鈻堚杸銆€銆€銆€銆€鈻愨枅鈻堚棨\n鈻愨枅鈻欌杺銆€銆€ 銆€鈼⑩枅鈻堚棨\n鈼モ枅鈻堚棧銆€銆€銆€銆€鈼⑩杽鈼n 銆€銆€鈻€鈻堚枅鈻呪枃鈻€\n----------\nVer 1.2\nhttps://lt.js.org ", "color:green;font-weight:bolder"); let p = 2 * Math.PI, n = function (e, t) { for (let a in t) e[a] = t[a]; @@ -76,7 +76,7 @@ void (window.tempExt = { R(this, e, "x", "z") }; let R = function (T, l, a, e) { - if (l && 0 != l % p) { + if (l && 0 !== l % p) { let t = Math.cos(l), r = Math.sin(l), o = T[a], @@ -121,9 +121,9 @@ void (window.tempExt = { this.children = [], n(this, this.constructor.defaults), this.setOptions(e), this.translate = new N(e.translate), this.rotate = new N(e.rotate), this.scale = new N(r).multiply(this.scale), this.origin = new N, this.renderOrigin = new N, this.addTo && this.addTo.addChild(this) }, a.defaults = {}, a.optionKeys = Object.keys(a.defaults).concat(["rotate", "translate", "scale", "addTo"]), a.prototype.setOptions = function (e) { let t = this.constructor.optionKeys; - for (let a in e) -1 != t.indexOf(a) && (this[a] = e[a]) + for (let a in e) -1 !== t.indexOf(a) && (this[a] = e[a]) }, a.prototype.addChild = function (e) { - -1 != this.children.indexOf(e) || (e.remove(), e.addTo = this, this.children.push(e)) + -1 !== this.children.indexOf(e) || (e.remove(), e.addTo = this, this.children.push(e)) }, a.prototype.removeChild = function (a) { let e = this.children.indexOf(a); -1 != e && this.children.splice(e, 1) @@ -166,7 +166,7 @@ void (window.tempExt = { this.sortValue = this.renderOrigin.z }, a.prototype.render = function () { }, a.prototype.renderGraphCanvas = function (a) { - if (!a) throw new Error("[Cube]\u672A\u63D0\u4F9B\u6E32\u67D3\u4E0A\u4E0B\u6587"); + if (!a) throw new Error("[Cube]鏈彁渚涙覆鏌撲笂涓嬫枃"); this.flatGraph.forEach(function (e) { e.render(a, o) }) @@ -194,7 +194,7 @@ void (window.tempExt = { this.create(e || {}) }; return r.prototype = Object.create(e.prototype), r.prototype.constructor = r, r.defaults = n({}, e.defaults), n(r.defaults, a), r.optionKeys = e.optionKeys.slice(0), Object.keys(r.defaults).forEach(function (t) { - 1 != !r.optionKeys.indexOf(t) && r.optionKeys.push(t) + 1 !== !r.optionKeys.indexOf(t) && r.optionKeys.push(t) }), r.subclass = d(r), r } }; @@ -234,52 +234,52 @@ void (window.tempExt = { }, j.prototype.onmouseup = j.prototype.onpointerup = j.prototype.ontouchend = j.prototype.dragEnd = function () { window.removeEventListener(k, this), window.removeEventListener(S, this), this.onDragEnd() }; - let init = a.subclass({ + let G = a.subclass({ element: void 0, - centered: !0, + centered: true, zoom: 1, - dragRotate: !1, - resize: !1, + dragRotate: false, + resize: false, onPrerender: s, onDragStart: s, onDragMove: s, onDragEnd: s, onResize: s }); - n(init.prototype, j.prototype), init.prototype.create = function (e) { + n(G.prototype, j.prototype), G.prototype.create = function (e) { a.prototype.create.call(this, e), j.prototype.create.call(this, e), this.setElement(this.element), this.setDragRotate(this.dragRotate), this.setResize(this.resize) - }, init.prototype.setElement = function (e) { - if (e = this.element, !e) throw new Error("[Cube]\u672A\u6307\u5B9A\u5143\u7D20"); + }, G.prototype.setElement = function (e) { + if (!this.element) throw new Error("[Cube]鏈寚瀹氬厓绱�"); this.setCanvas(e) - }, init.prototype.setSize = function (e, t) { + }, G.prototype.setSize = function (e, t) { e = Math.round(e), t = Math.round(t), this.setSizeCanvas(e, t) - }, init.prototype.setResize = function (e) { + }, G.prototype.setResize = function (e) { this.resize = e, this.resizeListener || (this.resizeListener = this.onWindowResize.bind(this)), e ? (window.addEventListener("resize", this.resizeListener), this.onWindowResize()) : window.removeEventListener("resize", this.resizeListener) - }, init.prototype.onWindowResize = function () { + }, G.prototype.onWindowResize = function () { this.setMeasuredSize(), this.onResize(this.width, this.height) - }, init.prototype.setMeasuredSize = function () { - let t, a, e = "fullscreen" == this.resize; + }, G.prototype.setMeasuredSize = function () { + let t, a, e = "fullscreen" === this.resize; if (e) t = window.innerWidth, a = window.innerHeight; else { let r = this.element.getBoundingClientRect(); t = r.width, a = r.height } this.setSize(t, a) - }, init.prototype.renderGraph = function (e) { + }, G.prototype.renderGraph = function (e) { this.renderGraphCanvas(e) - }, init.prototype.updateRenderGraph = function (e) { + }, G.prototype.updateRenderGraph = function (e) { this.updateGraph(), this.renderGraph(e) - }, init.prototype.setCanvas = function (e) { + }, G.prototype.setCanvas = function (e) { this.element = e, this.ctx = this.element.getContext("2d"), this.setSizeCanvas(e.width, e.height) - }, init.prototype.setSizeCanvas = function (t, a) { + }, G.prototype.setSizeCanvas = function (t, a) { this.width = t, this.height = a; let r = this.pixelRatio = window.devicePixelRatio || 1; this.element.width = this.canvasWidth = t * r, this.element.height = this.canvasHeight = a * r; let o = 1 < r && !this.resize; o && (this.element.style.width = t + "px", this.element.style.height = a + "px") - }, init.prototype.renderGraphCanvas = function (e) { + }, G.prototype.renderGraphCanvas = function (e) { e = e || this, this.prerenderCanvas(), a.prototype.renderGraphCanvas.call(e, this.ctx), this.postrenderCanvas() - }, init.prototype.prerenderCanvas = function () { + }, G.prototype.prerenderCanvas = function () { let r = this.ctx; if (r.lineCap = "round", r.lineJoin = "round", r.clearRect(0, 0, this.canvasWidth, this.canvasHeight), r.save(), this.centered) { let e = this.width / 2 * this.pixelRatio, @@ -288,27 +288,25 @@ void (window.tempExt = { } let t = this.pixelRatio * this.zoom; r.scale(t, t), this.onPrerender(r) - }, init.prototype.postrenderCanvas = function () { + }, G.prototype.postrenderCanvas = function () { this.ctx.restore() - }, init.prototype.setDragRotate = function (e) { - e && (!0 === e && (e = this), this.dragRotate = e, this.bindDrag(this.element)) - }, init.prototype.dragStart = function () { + }, G.prototype.setDragRotate = function (e) { + e && (true === e && (e = this), this.dragRotate = e, this.bindDrag(this.element)) + }, G.prototype.dragStart = function () { this.dragStartRX = this.dragRotate.rotate.x, this.dragStartRY = this.dragRotate.rotate.y, j.prototype.dragStart.apply(this, arguments) - }, init.prototype.dragMove = function (r, o) { + }, G.prototype.dragMove = function (r, o) { let d = o.pageX - this.dragStartX, e = o.pageY - this.dragStartY, t = Math.min(this.width, this.height); this.dragRotate.rotate.x = this.dragStartRX - e / t * p, this.dragRotate.rotate.y = this.dragStartRY - d / t * p, j.prototype.dragMove.apply(this, arguments) }; - let w = function (e, t, a) { - this.method = e, this.points = t.map(D), this.renderPoints = t.map(M), this.previousPoint = a, this.endRenderPoint = this.renderPoints[this.renderPoints.length - 1], "arc" == e && (this.controlPoints = [new N, new N]) - }, - D = function (e) { - return e instanceof N ? e : new N(e) - }, - M = function (e) { - return new N(e) - }; + let D = function (e) { + return e instanceof N ? e : new N(e) + }, M = function (e) { + return new N(e) + }, w = function (e, t, a) { + this.method = e, this.points = t.map(D), this.renderPoints = t.map(M), this.previousPoint = this.endRenderPoint = this.renderPoints[this.renderPoints.length - 1], "arc" === e && (this.controlPoints = [new N, new N]) + }; w.prototype.reset = function () { let t = this.points; this.renderPoints.forEach(function (a, r) { @@ -340,50 +338,54 @@ void (window.tempExt = { r = this.controlPoints[1]; return a.set(l).lerp(e, V), r.set(t).lerp(e, V), T.bezier(d, p, a, r, t) }; - let custom = a.subclass({ + let E = a.subclass({ stroke: 1, - fill: !1, + fill: false, color: "#333", - closed: !0, - visible: !0, + closed: true, + visible: true, path: [{}], front: { z: 1 }, - backface: !0 + backface: true }); - custom.prototype.create = function (e) { - this.path = e, a.prototype.create.call(this, e), this.updatePath(), this.front = new N(e.front || this.front), this.renderFront = new N(this.front), this.renderNormal = new N + E.prototype.create = function (e) { + this.path = e.path; + a.prototype.create.call(this, e); + this.updatePath(); + this.front = new N(e.front || this.front); + this.renderFront = new N(this.front); + this.renderNormal = new N }; let m = ["move", "line", "bezier", "arc"]; - custom.prototype.updatePath = function () { + E.prototype.updatePath = function () { this.setPath(), this.updatePathCommands() - }, custom.prototype.setPath = function () { - }, custom.prototype.updatePathCommands = function () { + }, E.prototype.setPath = function () { + }, E.prototype.updatePathCommands = function () { let a; this.pathCommands = this.path.map(function (r, o) { let d = Object.keys(r), e = d[0], T = r[e], - n = 1 == d.length && -1 != m.indexOf(e); + n = 1 === d.length && -1 !== m.indexOf(e); n || (e = "line", T = r); - let c = "line" == e || "move" == e, + let c = "line" === e || "move" === e, i = Array.isArray(T); c && !i && (T = [T]), e = 0 === o ? "move" : e; - let s = new w(e, T, a); - return a = s.endRenderPoint, s + return new w(e, T) }) - }, custom.prototype.reset = function () { + }, E.prototype.reset = function () { this.renderOrigin.set(this.origin), this.renderFront.set(this.front), this.pathCommands.forEach(function (e) { e.reset() }) - }, custom.prototype.transform = function (t, a, r) { + }, E.prototype.transform = function (t, a, r) { this.renderOrigin.transform(t, a, r), this.renderFront.transform(t, a, r), this.renderNormal.set(this.renderOrigin).subtract(this.renderFront), this.pathCommands.forEach(function (o) { o.transform(t, a, r) }), this.children.forEach(function (o) { o.transform(t, a, r) }) - }, custom.prototype.updateSortValue = function () { + }, E.prototype.updateSortValue = function () { let t = this.pathCommands.length, a = this.pathCommands[0].endRenderPoint, o = this.pathCommands[t - 1].endRenderPoint, @@ -392,34 +394,34 @@ void (window.tempExt = { let d = 0; for (let a = 0; a < t; a++) d += this.pathCommands[a].endRenderPoint.z; this.sortValue = d / t - }, custom.prototype.render = function (e, t) { + }, E.prototype.render = function (e, t) { let a = this.pathCommands.length; if (this.visible && a && (this.isFacingBack = 0 < this.renderNormal.z, this.backface || !this.isFacingBack)) { - if (!t) throw new Error("[Cube]\u672A\u63D0\u4F9B\u6E32\u67D3\u5668"); - t.isCanvas && 1 == a ? this.renderCanvasDot(e, t) : this.renderPath(e, t) + if (!t) throw new Error("[Cube]鏈彁渚涙覆鏌撳櫒"); + 1 === a ? this.renderCanvasDot(e, t) : this.renderPath(e, t) } - }, custom.prototype.renderCanvasDot = function (t) { + }, E.prototype.renderCanvasDot = function (t) { let a = this.getLineWidth(); if (a) { t.fillStyle = this.getRenderColor(); let r = this.pathCommands[0].endRenderPoint; t.beginPath(), t.arc(r.x, r.y, a / 2, 0, p), t.fill() } - }, custom.prototype.getLineWidth = function () { - return this.stroke ? !0 == this.stroke ? 1 : this.stroke : 0 - }, custom.prototype.getRenderColor = function () { + }, E.prototype.getLineWidth = function () { + return this.stroke ? true === this.stroke ? 1 : this.stroke : 0 + }, E.prototype.getRenderColor = function () { let a = "string" == typeof this.backface && this.isFacingBack, e = a ? this.backface : this.color; return e - }, custom.prototype.renderPath = function (r, o) { - let d, l = 2 == this.pathCommands.length && "line" == this.pathCommands[1].method, + }, E.prototype.renderPath = function (r, o) { + let d, l = 2 === this.pathCommands.length && "line" === this.pathCommands[1].method, e = !l && this.closed, t = this.getRenderColor(); o.renderPath(r, d, this.pathCommands, e), o.stroke(r, d, this.stroke, t, this.getLineWidth()), o.fill(r, d, this.fill, t), o.end(r, d) }; let y = a.subclass({ - updateSort: !1, - visible: !0 + updateSort: false, + visible: true }); y.prototype.updateSortValue = function () { let r = 0; @@ -435,11 +437,11 @@ void (window.tempExt = { }, y.prototype.getFlatGraph = function () { return [this] }; - let rect = custom.subclass({ + let h = E.subclass({ width: 1, height: 1 }); - rect.prototype.setPath = function () { + h.prototype.setPath = function () { let a = this.width / 2, e = this.height / 2; this.path = [{ @@ -456,13 +458,13 @@ void (window.tempExt = { y: e }] }; - let roundedEect = custom.subclass({ + let U = E.subclass({ width: 1, height: 1, cornerRadius: .25, - closed: !1 + closed: false }); - roundedEect.prototype.setPath = function () { + U.prototype.setPath = function () { let o = this.width / 2, d = this.height / 2, l = Math.min(o, d), @@ -519,14 +521,14 @@ void (window.tempExt = { y: -d }), this.path = a }; - let ellipse = custom.subclass({ + let X = E.subclass({ diameter: 1, width: void 0, height: void 0, quarters: 4, - closed: !1 + closed: false }); - ellipse.prototype.setPath = function () { + X.prototype.setPath = function () { let t = null == this.width ? this.diameter : this.width, a = null == this.height ? this.diameter : this.height, r = t / 2, @@ -568,11 +570,11 @@ void (window.tempExt = { }] }) }; - let polygon = custom.subclass({ + let z = E.subclass({ sides: 3, radius: .5 }); - polygon.prototype.setPath = function () { + z.prototype.setPath = function () { this.path = []; for (let a = 0; a < this.sides; a++) { let r = a / this.sides * p - p / 4, @@ -584,21 +586,21 @@ void (window.tempExt = { }) } }; - let hemisphere = ellipse.subclass({ - fill: !0 + let b = X.subclass({ + fill: true }); - hemisphere.prototype.create = function () { - ellipse.prototype.create.apply(this, arguments), this.apex = new a({ + b.prototype.create = function () { + X.prototype.create.apply(this, arguments), this.apex = new a({ addTo: this, translate: { z: this.diameter / 2 } }), this.renderCentroid = new N - }, hemisphere.prototype.updateSortValue = function () { + }, b.prototype.updateSortValue = function () { this.renderCentroid.set(this.renderOrigin).lerp(this.apex.renderOrigin, 3 / 8), this.sortValue = this.renderCentroid.z - }, hemisphere.prototype.render = function (a, e) { - this.renderDome(a, e), ellipse.prototype.render.apply(this, arguments) - }, hemisphere.prototype.renderDome = function (o, d) { + }, b.prototype.render = function (a, e) { + this.renderDome(a, e), X.prototype.render.apply(this, arguments) + }, b.prototype.renderDome = function (o, d) { if (this.visible) { let l = this.getDomeRenderElement(o, d), p = Math.atan2(this.renderNormal.y, this.renderNormal.x), @@ -610,7 +612,7 @@ void (window.tempExt = { }; let g = y.subclass({ color: "#333", - updateSort: !0 + updateSort: true }); g.prototype.create = function () { y.prototype.create.apply(this, arguments), this.pathCommands = [new w("move", [{}]), new w("line", [{}])] @@ -622,26 +624,26 @@ void (window.tempExt = { e = this.rearBase, t = p.renderNormal.magnitude(), a = p.diameter * t + p.getLineWidth(); - this.pathCommands[0].renderPoints[0].set(p.renderOrigin), this.pathCommands[1].renderPoints[0].set(e.renderOrigin), d.renderPath(o, l, this.pathCommands), d.stroke(o, l, !0, this.color, a), d.end(o, l) + this.pathCommands[0].renderPoints[0].set(p.renderOrigin), this.pathCommands[1].renderPoints[0].set(e.renderOrigin), d.renderPath(o, l, this.pathCommands), d.stroke(o, l, true, this.color, a), d.end(o, l) } }, g.prototype.copyGraph = s; - let f = ellipse.subclass(); + let f = X.subclass(); f.prototype.copyGraph = s; - let cylinder = custom.subclass({ + let x = E.subclass({ diameter: 1, length: 1, frontFace: void 0, - fill: !0 + fill: true }); - cylinder.prototype.create = function () { - custom.prototype.create.apply(this, arguments), this.group = new g({ + x.prototype.create = function () { + E.prototype.create.apply(this, arguments), this.group = new g({ addTo: this, color: this.color, visible: this.visible }); let e = this.length / 2, - t = this.backface || !0; - this.frontBase = this.group.frontBase = new ellipse({ + t = this.backface || true; + this.frontBase = this.group.frontBase = new X({ addTo: this.group, diameter: this.diameter, translate: { @@ -664,10 +666,10 @@ void (window.tempExt = { }, backface: t }) - }, cylinder.prototype.render = function () { + }, x.prototype.render = function () { }, ["stroke", "fill", "color", "visible"].forEach(function (e) { let t = "_" + e; - Object.defineProperty(cylinder.prototype, e, { + Object.defineProperty(x.prototype, e, { get: function () { return this[t] }, @@ -676,22 +678,22 @@ void (window.tempExt = { } }) }); - let cone = ellipse.subclass({ + let F = X.subclass({ length: 1, - fill: !0 + fill: true }); - cone.prototype.create = function () { - ellipse.prototype.create.apply(this, arguments), this.apex = new a({ + F.prototype.create = function () { + X.prototype.create.apply(this, arguments), this.apex = new a({ addTo: this, translate: { z: this.length } }), this.renderApex = new N, this.renderCentroid = new N, this.tangentA = new N, this.tangentB = new N, this.surfacePathCommands = [new w("move", [{}]), new w("line", [{}]), new w("line", [{}])] - }, cone.prototype.updateSortValue = function () { + }, F.prototype.updateSortValue = function () { this.renderCentroid.set(this.renderOrigin).lerp(this.apex.renderOrigin, 1 / 3), this.sortValue = this.renderCentroid.z - }, cone.prototype.render = function (a, e) { - this.renderConeSurface(a, e), ellipse.prototype.render.apply(this, arguments) - }, cone.prototype.renderConeSurface = function (d, l) { + }, F.prototype.render = function (a, e) { + this.renderConeSurface(a, e), X.prototype.render.apply(this, arguments) + }, F.prototype.renderConeSurface = function (d, l) { if (this.visible) { this.renderApex.set(this.apex.renderOrigin).subtract(this.renderOrigin); let r = this.renderNormal.magnitude(), @@ -710,33 +712,33 @@ void (window.tempExt = { l.renderPath(d, r, this.surfacePathCommands), l.stroke(d, r, this.stroke, this.color, this.getLineWidth()), l.fill(d, r, this.fill, this.color), l.end(d, r) } } - }, cone.prototype.setSurfaceRenderPoint = function (e, t) { + }, F.prototype.setSurfaceRenderPoint = function (e, t) { let a = this.surfacePathCommands[e].renderPoints[0]; a.set(t) }; - let O = rect.subclass(); + let O = h.subclass(); O.prototype.copyGraph = function () { }; let W = ["frontFace", "rearFace", "leftFace", "rightFace", "topFace", "bottomFace"], - Z = n({}, custom.defaults); + Z = n({}, E.defaults); delete Z.path, W.forEach(function (e) { - Z[e] = !0 + Z[e] = true }), n(Z, { width: 1, height: 1, depth: 1, - fill: !0 + fill: true }); - let box = a.subclass(Z); - return box.prototype.create = function (e) { + let C = a.subclass(Z); + return C.prototype.create = function (e) { a.prototype.create.call(this, e), this.updatePath(), this.fill = this.fill - }, box.prototype.updatePath = function () { + }, C.prototype.updatePath = function () { W.forEach(function (e) { this[e] = this[e] }, this) }, W.forEach(function (e) { let t = "_" + e; - Object.defineProperty(box.prototype, e, { + Object.defineProperty(C.prototype, e, { get: function () { return this[t] }, @@ -744,13 +746,13 @@ void (window.tempExt = { this[t] = a, this.setFace(e, a) } }) - }), box.prototype.setFace = function (t, a) { + }), C.prototype.setFace = function (t, a) { let r = t + "Rect", o = this[r]; if (!a) return void this.removeChild(o); let d = this.getFaceOptions(t); d.color = "string" == typeof a ? a : this.color, o ? o.setOptions(d) : o = this[r] = new O(d), o.updatePath(), this.addChild(o) - }, box.prototype.getFaceOptions = function (t) { + }, C.prototype.getFaceOptions = function (t) { return { frontFace: { width: this.width, @@ -812,7 +814,7 @@ void (window.tempExt = { } [t] }, ["color", "stroke", "fill", "backface", "front", "visible"].forEach(function (t) { let a = "_" + t; - Object.defineProperty(box.prototype, t, { + Object.defineProperty(C.prototype, t, { get: function () { return this[a] }, @@ -820,90 +822,97 @@ void (window.tempExt = { this[a] = l, W.forEach(function (a) { let r = this[a + "Rect"], o = "string" == typeof this[a]; - r && !("color" == t && o) && (r[t] = l) + r && !("color" === t && o) && (r[t] = l) }, this) } }) }), { - init: init, - custom: custom, - rect: rect, - roundedRect: roundedEect, - ellipse: ellipse, - polygon: polygon, - hemisphere: hemisphere, - cylinder: cylinder, - cone: cone, - box: box + init: G, + custom: E, + rect: h, + roundedRect: U, + ellipse: X, + polygon: z, + hemisphere: b, + cylinder: x, + cone: F, + box: C } - }(), (null === this.canvas() || null === this.cubeParent()) && console.error("[Cube]\u65E0\u6CD5\u5B9A\u4F4D\u5230\u821E\u53F0"), (() => { + }(), (null === this.canvas() || null === this.cubeParent()) && console.error("[Cube]鏃犳硶瀹氫綅鍒拌垶鍙�"), (() => { if (null !== this.canvas() && null !== this.cubeParent()) { let t = document.createElement("canvas"); t.setAttribute("id", "Cube"), t.setAttribute("width", this.canvas().style.width), t.setAttribute("height", this.canvas().style.height); let a = t.style; a.position = "absolute", a.left = "0%", a.top = "0%", a.pointerEvents = "none", this.cubeParent().appendChild(t), this.cubeScene = new this.Cube.init({ element: document.getElementById("Cube") + }), new MutationObserver(() => { + if (document.getElementById("Cube") == null) this.cubeParent().appendChild(t) + }).observe(document.body, { + childList: true, + subtree: true }), new MutationObserver(() => { for (let a in t.setAttribute("width", this.canvas().style.width), t.setAttribute("height", this.canvas().style.height), this.cubeScene = new this.Cube.init({ element: document.getElementById("Cube") }), this.objectList) this.cubeScene.addChild(this.objectList[a]); this.cubeScene.updateRenderGraph() }).observe(this.canvas(), { - attributes: !0 - }); - window.runtime = this.runtime; - window.global = this; + attributes: true + }) } - })(), this._formatMessage = e.getFormatMessage({ + })(); + window.cube = () => this.runtime; + this._formatMessage = e.getFormatMessage({ "zh-cn": { - "Cube.name": "LazyTong的立方体", - "Cube.createRect": "创建或修改一个矩形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]大小[stroke]%", - "Cube.createRoundedRect": "创建或修改一个圆角矩形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]边角弧度[radius]大小[stroke]%", - "Cube.createCircle": "创建或修改一个圆形并命名为[id],X[x]Y[y]Z[z]颜色[color]半径[diameter]完整性[quarters]", - "Cube.createEllipse": "创建或修改一个椭圆形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]大小[stroke]%", - "Cube.createPolygon": "创建或修改一个[sides]边形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]边角弧度[radius]大小[stroke]%", - "Cube.createHemisphere": "创建或修改一个半圆并命名为[id],X[x]Y[y]Z[z]颜色[color]地面颜色[backface]半径[diameter]大小[stroke]%", - "Cube.createCone": "创建或修改一个圆锥体并命名为[id],X[x]Y[y]Z[z]颜色[color]地面颜色[backface]长度[length]半径[diameter]大小[stroke]%", - "Cube.createCylinder": "创建或修改一个圆柱体并命名为[id],X[x]Y[y]Z[z]颜色[color]顶部颜色[frontface]地面颜色[backface]长度[length]大小[stroke]%", - "Cube.createBox": "创建或修改一个立方体并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]尺寸[depth]颜色[color]左侧颜色[leftface]右侧颜色[rightface]顶部颜色[topface]地面颜色[bottomface]大小[stroke]%", - "Cube.createCustom": "创建或修改一个自定义模型并命名为[id],X[x]Y[y]Z[z]颜色[color]节点位置[path]节点大小[stroke]%", - "Cube.deleteObject": "删除物体[id]", - "Cube.getAttrib": "物体[id]的[type]", - "Cube.deleteAllObject": "删除所有物体", - "Cube.getObjectNumbers": "物体总数", - "Cube.getObjectList": "物体ID列表", + "Cube.name": "LazyTong鐨勭珛鏂逛綋", + "Cube.createRect": "鍒涘缓鎴栦慨鏀逛竴涓煩褰㈠苟鍛藉悕涓篬id]锛孹[x]Y[y]Z[z]瀹絒width]楂榌height]棰滆壊[color]澶у皬[stroke]%", + "Cube.createRoundedRect": "鍒涘缓鎴栦慨鏀逛竴涓渾瑙掔煩褰㈠苟鍛藉悕涓篬id]锛孹[x]Y[y]Z[z]瀹絒width]楂榌height]棰滆壊[color]杈硅寮у害[radius]澶у皬[stroke]%", + "Cube.createCircle": "鍒涘缓鎴栦慨鏀逛竴涓渾褰㈠苟鍛藉悕涓篬id]锛孹[x]Y[y]Z[z]棰滆壊[color]鍗婂緞[diameter]瀹屾暣鎬quarters]", + "Cube.createEllipse": "鍒涘缓鎴栦慨鏀逛竴涓き鍦嗗舰骞跺懡鍚嶄负[id]锛孹[x]Y[y]Z[z]瀹絒width]楂榌height]棰滆壊[color]澶у皬[stroke]%", + "Cube.createPolygon": "鍒涘缓鎴栦慨鏀逛竴涓猍sides]杈瑰舰骞跺懡鍚嶄负[id]锛孹[x]Y[y]Z[z]瀹絒width]楂榌height]棰滆壊[color]杈硅寮у害[radius]澶у皬[stroke]%", + "Cube.createHemisphere": "鍒涘缓鎴栦慨鏀逛竴涓崐鍦嗗苟鍛藉悕涓篬id]锛孹[x]Y[y]Z[z]棰滆壊[color]鍦伴潰棰滆壊[backface]鍗婂緞[diameter]澶у皬[stroke]%", + "Cube.createCone": "鍒涘缓鎴栦慨鏀逛竴涓渾閿ヤ綋骞跺懡鍚嶄负[id]锛孹[x]Y[y]Z[z]棰滆壊[color]鍦伴潰棰滆壊[backface]闀垮害[length]鍗婂緞[diameter]澶у皬[stroke]%", + "Cube.createCylinder": "鍒涘缓鎴栦慨鏀逛竴涓渾鏌变綋骞跺懡鍚嶄负[id]锛孹[x]Y[y]Z[z]棰滆壊[color]椤堕儴棰滆壊[frontface]鍦伴潰棰滆壊[backface]闀垮害[length]澶у皬[stroke]%", + "Cube.createBox": "鍒涘缓鎴栦慨鏀逛竴涓珛鏂逛綋骞跺懡鍚嶄负[id]锛孹[x]Y[y]Z[z]瀹絒width]楂榌height]灏哄[depth]棰滆壊[color]宸︿晶棰滆壊[leftface]鍙充晶棰滆壊[rightface]椤堕儴棰滆壊[topface]鍦伴潰棰滆壊[bottomface]澶у皬[stroke]%", + "Cube.createCustom": "鍒涘缓鎴栦慨鏀逛竴涓猍closed]鑷畾涔夋ā鍨嬪苟鍛藉悕涓篬id]锛孹[x]Y[y]Z[z]棰滆壊[color]鑺傜偣浣嶇疆[path]鑺傜偣澶у皬[stroke]%", + "Cube.deleteObject": "鍒犻櫎鐗╀綋[id]", + "Cube.getAttrib": "鐗╀綋[id]鐨刐type]", + "Cube.deleteAllObject": "鍒犻櫎鎵€鏈夌墿浣�", + "Cube.getObjectNumbers": "鐗╀綋鎬绘暟", + "Cube.getObjectList": "鐗╀綋ID鍒楄〃", "Cube.x": "X", "Cube.y": "Y", "Cube.z": "Z", - "Cube.width": "宽度", - "Cube.height": "高度", - "Cube.color": "颜色", - "Cube.stroke": "大小", - "Cube.quarters": "完整性", - "Cube.cornerRadius": "边角弧度", - "Cube.radius": "弧度", - "Cube.setRotate": "设置物体[id]在[type]上旋转[rotate]度", - "Cube.updateRender": "渲染当前设置的物体", - "Cube.docs": "拓展教程", - "Cube.create": "创建物体", - "Cube.modify": "修改物体", - "Cube.info": "信息", - "Cube.fileListEmpty": "无文件" + "Cube.width": "瀹藉害", + "Cube.height": "楂樺害", + "Cube.color": "棰滆壊", + "Cube.stroke": "澶у皬", + "Cube.quarters": "瀹屾暣鎬�", + "Cube.cornerRadius": "杈硅寮у害", + "Cube.radius": "寮у害", + "Cube.setRotate": "璁剧疆鐗╀綋[id]鍦╗type]涓婃棆杞琜rotate]搴�", + "Cube.updateRender": "娓叉煋褰撳墠璁剧疆鐨勭墿浣�", + "Cube.docs": "鎷撳睍鏁欑▼", + "Cube.create": "鍒涘缓鐗╀綋", + "Cube.modify": "淇敼鐗╀綋", + "Cube.info": "淇℃伅", + "Cube.fileListEmpty": "鏃犳枃浠�", + "Cube.open": "寮€鏀剧殑", + "Cube.closed": "闂悎鐨�" }, en: { "Cube.name": "LazyTong's Cube", - "Cube.createRect": "Create or Modify a Rectangle named[id], X[x]Y[y]Z[z] Width[width] Height[height] Color[color] Stroke[stroke]%", - "Cube.createRoundedRect": "Create or Modify a Rounded Rectangle named [id], X[x]Y[y]Z[z] Width[width] Height[height] Color[color] Corner Radius[radius] Stroke[stroke]%", - "Cube.createCircle": "Create or Modify a Circle named[id], X[x]Y[y]Z[z] Color[color] Diameter[diameter] Quarters[quarters]", - "Cube.createEllipse": "Create or Modify an Ellipse named[id], X[x]Y[y]Z[z] Width[width] Height[height] Color[color] Stroke[stroke]%", - "Cube.createPolygon": "Create or Modify a [sides] Polygon named [id], X[x]Y[y]Z[z] Width[width] Height[height] Color[color] Corner Radius[radius] Stroke[stroke]%", - "Cube.createHemisphere": "Create or Modify a Hemisphere named [id], X[x]Y[y]Z[z] Color[color] Backface Color[backface] Diameter[diameter] Stroke[stroke]%", - "Cube.createCone": "Create or Modify a Cone named[id], X[x]Y[y]Z[z] Color[color] Backface Color[backface] Length[length] Diameter[diameter] Stroke[stroke]%", - "Cube.createCylinder": "Create or Modify a Cylinder named[id], X[x]Y[y]Z[z] Color[color] Frontface Color[frontface] Backface Color[backface] Length[length] Stroke[stroke]%", + "Cube.createRect": "Create or Modify a Rectangle named[id], X[x]Y[y]Z[z]Width[width]Height[height]Color[color]Stroke[stroke]%", + "Cube.createRoundedRect": "Create or Modify a Rounded Rectangle named[id], X[x]Y[y]Z[z]Width[width]Height[height]Color[color]Corner Radius[radius]Stroke[stroke]%", + "Cube.createCircle": "Create or Modify a Circle named[id], X[x]Y[y]Z[z]Color[color]Diameter[diameter]Quarters[quarters]", + "Cube.createEllipse": "Create or Modify an Ellipse named[id], X[x]Y[y]Z[z]Width[width]Height[height]Color[color]Stroke[stroke]%", + "Cube.createPolygon": "Create or Modify a[sides]Polygon named[id], X[x]Y[y]Z[z]Width[width]Height[height]Color[color]Corner Radius[radius]Stroke[stroke]%", + "Cube.createHemisphere": "Create or Modify a Hemisphere named[id], X[x]Y[y]Z[z]Color[color]Backface Color[backface]Diameter[diameter]Stroke[stroke]%", + "Cube.createCone": "Create or Modify a Cone named[id], X[x]Y[y]Z[z]Color[color]Backface Color[backface]Length[length]Diameter[diameter]Stroke[stroke]%", + "Cube.createCylinder": "Create or Modify a Cylinder named[id], X[x]Y[y]Z[z] Color[color]Frontface Color[frontface]Backface Color[backface]Length[length]Stroke[stroke]%", "Cube.createBox": "Create or Modify a Box named[id], X[x]Y[y]Z[z] Width[width] Height[height] Depth[depth] Color[color] Leftface Color[leftface] Rightface Color[rightface] Topface Color[topface] Bottomface Color[bottomface] Stroke[stroke]%", - "Cube.createCustom": "Create or Modify a Custom Model named[id], X[x]Y[y]Z[z] Color[color] Path[path] Stroke[stroke]%", + "Cube.createCustom": "Create or Modify a[closed]Custom Model named[id], X[x]Y[y]Z[z] Color[color] Path[path] Stroke[stroke]%", "Cube.deleteObject": "Delete Object[id]", - "Cube.getAttrib": "Get[type] of Object[id]", + "Cube.getAttrib": "Get[type]of Object[id]", "Cube.deleteAllObject": "Delete All Objects", "Cube.getObjectNumbers": "Number of Objects", "Cube.getObjectList": "List of Object IDs", @@ -923,7 +932,9 @@ void (window.tempExt = { "Cube.create": "Creating objects", "Cube.modify": "Modifying objects", "Cube.info": "Information", - "Cube.fileListEmpty": "no file" + "Cube.fileListEmpty": "no file", + "Cube.open": "open", + "Cube.closed": "closed" } }) } @@ -940,8 +951,8 @@ void (window.tempExt = { return { id: "LazyTong.Cube", name: this.formatMessage("Cube.name"), - blockIconURI: icon, - menuIconURI: icon, + blockIconURI: t, + menuIconURI: t, color1: "#33cc33", color2: "#669900", blocks: [{ @@ -1339,6 +1350,10 @@ void (window.tempExt = { type: "string", defaultValue: "lazytong" }, + closed: { + type: "boolean", + menu: "closed" + }, x: { type: "number", defaultValue: "0" @@ -1459,8 +1474,15 @@ void (window.tempExt = { text: this.formatMessage("Cube.radius"), value: "radius" }], + closed: [{ + text: this.formatMessage("Cube.open"), + value: false + }, { + text: this.formatMessage("Cube.closed"), + value: true + }], files: { - acceptReporters: !0, + acceptReporters: true, items: (() => { try { const e = this.runtime.getGandiAssetsFileList("json").map(e => ({ @@ -1495,168 +1517,175 @@ void (window.tempExt = { docs() { let e = document.createElement("a"); - e.href = "https://lt.js.org/posts/20240718", e.rel = "noopener noreferrer", e.target = "_blank", e.click() + e.href = "https://lt.js.org/posts/3ad4f6", e.rel = "noopener noreferrer", e.target = "_blank", e.click() } - createRect(args) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.rect({ - width: +args.width, - height: +args.height, - stroke: +args.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + createRect(e) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.rect({ + width: +e.width, + height: +e.height, + stroke: +e.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), translate: { - x: +args.x, - y: +args.y, - z: +args.z + x: +e.x, + y: +e.y, + z: +e.z } - }), this.cubeScene.addChild(this.objectList[args.id])) + }), this.cubeScene.addChild(this.objectList[e.id])) } - createRoundedRect(args) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.roundedRect({ - width: +args.width, - height: +args.height, - stroke: +args.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - cornerRadius: +args.radius, + createRoundedRect(e) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.roundedRect({ + width: +e.width, + height: +e.height, + stroke: +e.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + cornerRadius: +e.radius, translate: { - x: +args.x, - y: +args.y, - z: +args.z + x: +e.x, + y: +e.y, + z: +e.z } - }), this.cubeScene.addChild(this.objectList[args.id])) + }), this.cubeScene.addChild(this.objectList[e.id])) } - createCircle(args) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.ellipse({ - stroke: +args.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - diameter: +args.diameter, + createCircle(e) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.ellipse({ + stroke: +e.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + diameter: +e.diameter, translate: { - x: +args.x, - y: +args.y, - z: +args.z + x: +e.x, + y: +e.y, + z: +e.z }, - quarters: +args.quarters - }), this.cubeScene.addChild(this.objectList[args.id])) + quarters: +e.quarters + }), this.cubeScene.addChild(this.objectList[e.id])) } - createEllipse(args) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.ellipse({ - width: +args.width, - height: +args.height, - stroke: +args.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + createEllipse(e) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.ellipse({ + width: +e.width, + height: +e.height, + stroke: +e.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), translate: { - x: +args.x, - y: +args.y, - z: +args.z + x: +e.x, + y: +e.y, + z: +e.z }, - quarters: +args.quarters - }), this.cubeScene.addChild(this.objectList[args.id])) + quarters: +e.quarters + }), this.cubeScene.addChild(this.objectList[e.id])) } - createPolygon(args) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.polygon({ - sides: +args.sides, - radius: +args.sides, - stroke: +args.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + createPolygon(e) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.polygon({ + sides: +e.sides, + radius: +e.sides, + stroke: +e.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), translate: { - x: +args.x, - y: +args.y, - z: +args.z + x: +e.x, + y: +e.y, + z: +e.z } - }), this.cubeScene.addChild(this.objectList[args.id])) + }), this.cubeScene.addChild(this.objectList[e.id])) } - createHemisphere(args) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.hemisphere({ - diameter: +args.diameter, - stroke: +args.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - backface: (() => /^#([0-9a-f]{6})$/i.test(args.backface) ? args.backface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + createHemisphere(e) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.hemisphere({ + diameter: +e.diameter, + stroke: +e.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + backface: (() => /^#([0-9a-f]{6})$/i.test(e.backface) ? e.backface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), translate: { - x: +args.x, - y: +args.y, - z: +args.z + x: +e.x, + y: +e.y, + z: +e.z } - }), this.cubeScene.addChild(this.objectList[args.id])) + }), this.cubeScene.addChild(this.objectList[e.id])) } - createCone(args) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.cone({ - diameter: +args.diameter, - stroke: +args.stroke / 100, - length: +args.length, - color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - backface: (() => /^#([0-9a-f]{6})$/i.test(args.backface) ? args.backface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + createCone(e) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.cone({ + diameter: +e.diameter, + stroke: +e.stroke / 100, + length: +e.length, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + backface: (() => /^#([0-9a-f]{6})$/i.test(e.backface) ? e.backface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), translate: { - x: +args.x, - y: +args.y, - z: +args.z + x: +e.x, + y: +e.y, + z: +e.z } - }), this.cubeScene.addChild(this.objectList[args.id])) + }), this.cubeScene.addChild(this.objectList[e.id])) } - createCylinder(args) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.cylinder({ - diameter: +args.diameter, - stroke: +args.stroke / 100, - length: +args.length, - color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - backface: (() => /^#([0-9a-f]{6})$/i.test(args.backface) ? args.backface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - frontFace: (() => /^#([0-9a-f]{6})$/i.test(args.frontface) ? args.frontface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + createCylinder(e) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.cylinder({ + diameter: +e.diameter, + stroke: +e.stroke / 100, + length: +e.length, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + backface: (() => /^#([0-9a-f]{6})$/i.test(e.backface) ? e.backface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + frontFace: (() => /^#([0-9a-f]{6})$/i.test(e.frontface) ? e.frontface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), translate: { - x: +args.x, - y: +args.y, - z: +args.z + x: +e.x, + y: +e.y, + z: +e.z } - }), this.cubeScene.addChild(this.objectList[args.id])) + }), this.cubeScene.addChild(this.objectList[e.id])) } - createBox(args) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.box({ - width: +args.width, - height: +args.height, - depth: +args.depth, - stroke: +args.stroke / 100, - length: +args.length, - color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - leftFace: (() => /^#([0-9a-f]{6})$/i.test(args.leftface) ? args.leftface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - rightFace: (() => /^#([0-9a-f]{6})$/i.test(args.rightface) ? args.rightface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - topFace: (() => /^#([0-9a-f]{6})$/i.test(args.topface) ? args.topface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - bottomFace: (() => /^#([0-9a-f]{6})$/i.test(args.bottomface) ? args.bottomface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + createBox(e) { + null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.box({ + width: +e.width, + height: +e.height, + depth: +e.depth, + stroke: +e.stroke / 100, + length: +e.length, + color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + leftFace: (() => /^#([0-9a-f]{6})$/i.test(e.leftface) ? e.leftface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + rightFace: (() => /^#([0-9a-f]{6})$/i.test(e.rightface) ? e.rightface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + topFace: (() => /^#([0-9a-f]{6})$/i.test(e.topface) ? e.topface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + bottomFace: (() => /^#([0-9a-f]{6})$/i.test(e.bottomface) ? e.bottomface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), translate: { - x: +args.x, - y: +args.y, - z: +args.z + x: +e.x, + y: +e.y, + z: +e.z } - }), this.cubeScene.addChild(this.objectList[args.id])) + }), this.cubeScene.addChild(this.objectList[e.id])) } - createCustom(args) { - null !== this.canvas() && null !== this.cubeParent() && "{}" !== args.path && (void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0), this.objectList[args.id] = new this.Cube.custom({ - stroke: +args.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - path: (() => { - let e = this.runtime.getGandiAssetsFileList().map(t => t.fullName); - return "fileListEmpty" == args.path | -1 == e.indexOf(args.path) | !Array.isArray(args.path) ? [] : JSON.parse((r => { - let e = ""; - for (let t = 0; t < r.length; t++) e += String.fromCharCode(r[t]); - return e - })(this.runtime.getGandiAssetById(args.path).asset.data)) + createCustom(t) { + null !== this.canvas() && null !== this.cubeParent() && "{}" !== t.path && (void 0 !== this.objectList[t.id] && (this.cubeScene.removeChild(this.objectList[t.id]), this.objectList[t.id] = void 0), this.objectList[t.id] = new this.Cube.custom({ + stroke: +t.stroke / 100, + closed: (() => { + switch (t.closed) { + case true: + return true + case false: + return false + default: + return false + } })(), + color: (() => /^#([0-9a-f]{6})$/i.test(t.color) ? t.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + path: "fileListEmpty" === t.path ? [{ + x: 0, + y: 0, + z: 0 + }] : JSON.parse(String.fromCharCode.apply(null, this.runtime.getGandiAssetById(t.path).asset.data)), translate: { - x: +args.x, - y: +args.y, - z: +args.z + x: +t.x, + y: +t.y, + z: +t.z } - }), this.cubeScene.addChild(this.objectList[args.id])) + }), this.cubeScene.addChild(this.objectList[t.id])) } - deleteObject(args) { - null !== this.cubeParent() && void 0 !== this.objectList[args.id] && (this.cubeScene.removeChild(this.objectList[args.id]), this.objectList[args.id] = void 0) + deleteObject(e) { + null !== this.cubeParent() && void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0) } deleteAllObject() { @@ -1666,30 +1695,34 @@ void (window.tempExt = { } } - getAttrib(args) { - if (void 0 !== typeof this.objectList[args.id]) switch (args.type) { - case "x": - return "undefined" == typeof this.objectList[args.id].translate.x ? "" : this.objectList[args.id].translate.x; - case "y": - return "undefined" == typeof this.objectList[args.id].translate.y ? "" : this.objectList[args.id].translate.y; - case "z": - return "undefined" == typeof this.objectList[args.id].translate.z ? "" : this.objectList[args.id].translate.z; - case "width": - return "undefined" == typeof this.objectList[args.id].width ? "" : this.objectList[args.id].width; - case "height": - return "undefined" == typeof this.objectList[args.id].height ? "" : this.objectList[args.id].height; - case "color": - return "undefined" == typeof this.objectList[args.id].color ? "" : this.objectList[args.id].color; - case "stroke": - return "undefined" == typeof this.objectList[args.id].stroke ? "" : this.objectList[args.id].stroke; - case "quarters": - return "undefined" == typeof this.objectList[args.id].quarters ? "" : this.objectList[args.id].quarters; - case "cornerRadius": - return "undefined" == typeof this.objectList[args.id].cornerRadius ? "" : this.objectList[args.id].cornerRadius; - case "radius": - return "undefined" == typeof this.objectList[args.id].radius ? "" : this.objectList[args.id].radius; - default: - return ""; + getAttrib(e) { + try { + if (void 0 !== typeof this.objectList[e.id]) switch (e.type) { + case "x": + return "undefined" == typeof this.objectList[e.id].translate.x ? "NaN" : this.objectList[e.id].translate.x; + case "y": + return "undefined" == typeof this.objectList[e.id].translate.y ? "NaN" : this.objectList[e.id].translate.y; + case "z": + return "undefined" == typeof this.objectList[e.id].translate.z ? "NaN" : this.objectList[e.id].translate.z; + case "width": + return "undefined" == typeof this.objectList[e.id].width ? "NaN" : this.objectList[e.id].width; + case "height": + return "undefined" == typeof this.objectList[e.id].height ? "NaN" : this.objectList[e.id].height; + case "color": + return "undefined" == typeof this.objectList[e.id].color ? "NaN" : this.objectList[e.id].color; + case "stroke": + return "undefined" == typeof this.objectList[e.id].stroke ? "NaN" : this.objectList[e.id].stroke; + case "quarters": + return "undefined" == typeof this.objectList[e.id].quarters ? "NaN" : this.objectList[e.id].quarters; + case "cornerRadius": + return "undefined" == typeof this.objectList[e.id].cornerRadius ? "NaN" : this.objectList[e.id].cornerRadius; + case "radius": + return "undefined" == typeof this.objectList[e.id].radius ? "NaN" : this.objectList[e.id].radius; + default: + return "NaN"; + } + } catch (e) { + return "NaN" } } @@ -1697,17 +1730,19 @@ void (window.tempExt = { return Object.keys(this.objectList).length } - setRotate(args) { - if (void 0 !== typeof this.objectList[args.id]) switch (args.type) { + setRotate(e) { + if (void 0 !== typeof this.objectList[e.id]) switch (e.type) { case "x": - this.objectList[args.id].rotate.x = +args.rotate * (Math.PI / 180); + this.objectList[e.id].rotate.x = +e.rotate * (Math.PI / 180); break; case "y": - this.objectList[args.id].rotate.y = +args.rotate * (Math.PI / 180); + this.objectList[e.id].rotate.y = +e.rotate * (Math.PI / 180); break; case "z": - this.objectList[args.id].rotate.z = +args.rotate * (Math.PI / 180); + this.objectList[e.id].rotate.z = +e.rotate * (Math.PI / 180); + break; default: + break; } } @@ -1716,7 +1751,11 @@ void (window.tempExt = { } updateRender() { - this.cubeScene.updateRenderGraph() + try { + this.cubeScene.updateRenderGraph() + } catch (e) { + throw new Error('Cube: 娓叉煋鏃跺彂鐢熼敊璇�') + } } }, info: { @@ -1725,22 +1764,22 @@ void (window.tempExt = { extensionId: "LazyTong.Cube", iconURL: "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5DdzRMak16TXpNek16TXpNek16TXpNek1pd3hPVFEwTGpRME5EUTBORFEwTkRRME5EWXNOell1TVRZMk5qWTJOalkyTmpZMk5qY3NNakF3TUM0d01EQXdNREF3TURBd01EQXlMRGMzUXpJd05UVXVOVFUxTlRVMU5UVTFOVFUxTnl3M055NDRNek16TXpNek16TXpNek16TXl3eU1EYzNMamMzTnpjM056YzNOemMzT0N3eExqVXNNakV6TXk0ek16TXpNek16TXpNek16TTFMRGxETWpFNE9DNDRPRGc0T0RnNE9EZzRPRGtzTVRZdU5Td3lNakV4TGpFeE1URXhNVEV4TVRFeE1UTXNNVEV6TGpnek16TXpNek16TXpNek16TXpMREl5TmpZdU5qWTJOalkyTmpZMk5qWTNMREV4TTBNeU16SXlMakl5TWpJeU1qSXlNakl5TWpZc01URXlMakUyTmpZMk5qWTJOalkyTmpZM0xESXpNakF1TVRNNE9EZzRPRGc0T0RnNUxDMDFOQzQzT1RFMk5qWTJOalkyTmpZMk55d3lOREF3TERWRE1qUTNPUzQ0TmpFeE1URXhNVEV4TVRFc05qUXVOemt4TmpZMk5qWTJOalkyTmpjc016STFOQzR4TmpZMk5qWTJOalkyTmpZMUxESXhNeTQxTkRFMk5qWTJOalkyTmpZMk9Td3lOalV3TERRd01FTXlNRFExTGpnek16TXpNek16TXpNek16VXNOVGcyTGpRMU9ETXpNek16TXpNek16TXNNVFUyTGpJMUxEYzVOUzQ0TXpNek16TXpNek16TXpNMExDMDFNREFzT1RBd0lpQjBjbUZ1YzJadmNtMDlJbTFoZEhKcGVDZ3hMREFzTUN3eExEQXNNVEl3S1NJZ2IzQmhZMmwwZVQwaU1DNHdOU0krUEM5d1lYUm9Qanh3WVhSb0lHUTlJazB0TVRBc01UQkRNVGt1T0RZeE1URXhNVEV4TVRFeE1URXNNalF1TnpreE5qWTJOalkyTmpZMk5qWTRMRGMxTGpZNU5EUTBORFEwTkRRME5EUTJMRGszTGpnM05Td3hNek11TXpNek16TXpNek16TXpNek16UXNPREZETVRrd0x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eE1qVTFMalUxTlRVMU5UVTFOVFUxTlRjc056UXVOelVzTVRJM055NDNOemMzTnpjM056YzNOemM0TEMweE5TNDNPVEUyTmpZMk5qWTJOalkyTmpnc01UTXpNeTR6TXpNek16TXpNek16TXpNMUxDMHhNVU14TXpnNExqZzRPRGc0T0RnNE9EZzRPVEVzTFRZdU1qQTRNek16TXpNek16TXpNek16TERFME1URXVNVEV4TVRFeE1URXhNVEV4TXl3NE9TNDJNalVzTVRRMk5pNDJOalkyTmpZMk5qWTJOalkzTERrMFF6RTFNakl1TWpJeU1qSXlNakl5TWpJeU1pdzVPQzR6TnpVc01UVTBOQzQwTkRRME5EUTBORFEwTkRRekxERTJMamczTlN3eE5qQXdMREV3UXpFMk5UVXVOVFUxTlRVMU5UVTFOVFUxTnl3ekxqRXlOU3d4TmpjM0xqYzNOemMzTnpjM056YzNOemdzTmpJdU1EUXhOalkyTmpZMk5qWTJOalkwTERFM016TXVNek16TXpNek16TXpNek16TlN3Mk1VTXhOemc0TGpnNE9EZzRPRGc0T0RnNE9URXNOVGt1T1RVNE16TXpNek16TXpNek16TTJMREU0TVRFdU1URXhNVEV4TVRFeE1URXhMREV1TmpZMk5qWTJOalkyTmpZMk5qWTNMREU0TmpZdU5qWTJOalkyTmpZMk5qWTJOeXcxUXpFNU1qSXVNakl5TWpJeU1qSXlNakl5TkN3NExqTXpNek16TXpNek16TXpNek16TWl3eE9UUTBMalEwTkRRME5EUTBORFEwTkRZc056WXVNVFkyTmpZMk5qWTJOalkyTmpjc01qQXdNQzR3TURBd01EQXdNREF3TURBeUxEYzNRekl3TlRVdU5UVTFOVFUxTlRVMU5UVTFOeXczTnk0NE16TXpNek16TXpNek16TXpNeXd5TURjM0xqYzNOemMzTnpjM056YzNPQ3d4TGpVc01qRXpNeTR6TXpNek16TXpNek16TXpNMUxEbERNakU0T0M0NE9EZzRPRGc0T0RnNE9Ea3NNVFl1TlN3eU1qRXhMakV4TVRFeE1URXhNVEV4TVRNc01URXpMamd6TXpNek16TXpNek16TXpNekxESXlOall1TmpZMk5qWTJOalkyTmpZM0xERXhNME15TXpJeUxqSXlNakl5TWpJeU1qSXlNallzTVRFeUxqRTJOalkyTmpZMk5qWTJOalkzTERJek1qQXVNVE00T0RnNE9EZzRPRGc1TEMwMU5DNDNPVEUyTmpZMk5qWTJOalkyTnl3eU5EQXdMRFZETWpRM09TNDROakV4TVRFeE1URXhNVEVzTmpRdU56a3hOalkyTmpZMk5qWTJOamNzTXpJMU5DNHhOalkyTmpZMk5qWTJOalkxTERJeE15NDFOREUyTmpZMk5qWTJOalkyT1N3eU5qVXdMRFF3TUVNeU1EUTFMamd6TXpNek16TXpNek16TXpVc05UZzJMalExT0RNek16TXpNek16TXpNc01UVTJMakkxTERjNU5TNDRNek16TXpNek16TXpNek0wTEMwMU1EQXNPVEF3SWlCMGNtRnVjMlp2Y20wOUltMWhkSEpwZUNneExEQXNNQ3d4TERBc01qUXdLU0lnYjNCaFkybDBlVDBpTUM0ek55SStQQzl3WVhSb1BqeHdZWFJvSUdROUlrMHRNVEFzTVRCRE1Ua3VPRFl4TVRFeE1URXhNVEV4TVRFc01qUXVOemt4TmpZMk5qWTJOalkyTmpZNExEYzFMalk1TkRRME5EUTBORFEwTkRRMkxEazNMamczTlN3eE16TXVNek16TXpNek16TXpNek16TXpRc09ERkRNVGt3TGprM01qSXlNakl5TWpJeU1qSXpMRFkwTGpFeU5Td3lNVEV1TVRFeE1URXhNVEV4TVRFeE1UUXNMVFUzTGpnM05Td3lOall1TmpZMk5qWTJOalkyTmpZMk55d3ROekZETXpJeUxqSXlNakl5TWpJeU1qSXlNakl6TEMwNE5DNHhNalVzTXpRMExqUTBORFEwTkRRME5EUTBORFEyTERVdU56QTRNek16TXpNek16TXpNek15TERRd01Dd3hPRU0wTlRVdU5UVTFOVFUxTlRVMU5UVTFOVFFzTXpBdU1qa3hOalkyTmpZMk5qWTJOalk0TERRM055NDNOemMzTnpjM056YzNOemM0TEMweE5pNHpOelVzTlRNekxqTXpNek16TXpNek16TXpNelFzTFRFeVF6VTRPQzQ0T0RnNE9EZzRPRGc0T0RnNUxDMDNMall5TlN3Mk1URXVNVEV4TVRFeE1URXhNVEV4TWl3ME1TNHdPRE16TXpNek16TXpNek16TXpZc05qWTJMalkyTmpZMk5qWTJOalkyTmpjc016bEROekl5TGpJeU1qSXlNakl5TWpJeU1qTXNNell1T1RFMk5qWTJOalkyTmpZMk5qWTBMRGMwTkM0ME5EUTBORFEwTkRRME5EUTFMQzB5Tnl3NE1EQXNMVEl5UXpnMU5TNDFOVFUxTlRVMU5UVTFOVFUxTEMweE55dzROemN1TnpjM056YzNOemMzTnpjM09DdzJOQzQwTlRnek16TXpNek16TXpNek15dzVNek11TXpNek16TXpNek16TXpNek5DdzJNME01T0RndU9EZzRPRGc0T0RnNE9EZzRPU3cyTVM0MU5ERTJOalkyTmpZMk5qWTJOalFzTVRBeE1TNHhNVEV4TVRFeE1URXhNVEV5TEMwek1DNDJOalkyTmpZMk5qWTJOalkyTmpnc01UQTJOaTQyTmpZMk5qWTJOalkyTmpZM0xDMHlPVU14TVRJeUxqSXlNakl5TWpJeU1qSXlNaklzTFRJM0xqTXpNek16TXpNek16TXpNek16TWl3eE1UUTBMalEwTkRRME5EUTBORFEwTkRNc05qY3VNalVzTVRJd01DdzNNVU14TWpVMUxqVTFOVFUxTlRVMU5UVTFOVGNzTnpRdU56VXNNVEkzTnk0M056YzNOemMzTnpjM056YzRMQzB4TlM0M09URTJOalkyTmpZMk5qWTJOamdzTVRNek15NHpNek16TXpNek16TXpNek0xTEMweE1VTXhNemc0TGpnNE9EZzRPRGc0T0RnNE9URXNMVFl1TWpBNE16TXpNek16TXpNek16TXpMREUwTVRFdU1URXhNVEV4TVRFeE1URXhNeXc0T1M0Mk1qVXNNVFEyTmk0Mk5qWTJOalkyTmpZMk5qWTNMRGswUXpFMU1qSXVNakl5TWpJeU1qSXlNakl5TWl3NU9DNHpOelVzTVRVME5DNDBORFEwTkRRME5EUTBORFF6TERFMkxqZzNOU3d4TmpBd0xERXdRekUyTlRVdU5UVTFOVFUxTlRVMU5UVTFOeXd6TGpFeU5Td3hOamMzTGpjM056YzNOemMzTnpjM056Z3NOakl1TURReE5qWTJOalkyTmpZMk5qWTBMREUzTXpNdU16TXpNek16TXpNek16TXpOU3cyTVVNeE56ZzRMamc0T0RnNE9EZzRPRGc0T1RFc05Ua3VPVFU0TXpNek16TXpNek16TXpNMkxERTRNVEV1TVRFeE1URXhNVEV4TVRFeExERXVOalkyTmpZMk5qWTJOalkyTmpZM0xERTROall1TmpZMk5qWTJOalkyTmpZMk55dzFRekU1TWpJdU1qSXlNakl5TWpJeU1qSXlOQ3c0TGpNek16TXpNek16TXpNek16TXpNaXd4T1RRMExqUTBORFEwTkRRME5EUTBORFlzTnpZdU1UWTJOalkyTmpZMk5qWTJOamNzTWpBd01DNHdNREF3TURBd01EQXdNREF5TERjM1F6SXdOVFV1TlRVMU5UVTFOVFUxTlRVMU55dzNOeTQ0TXpNek16TXpNek16TXpNek15d3lNRGMzTGpjM056YzNOemMzTnpjM09Dd3hMalVzTWpFek15NHpNek16TXpNek16TXpNek0xTERsRE1qRTRPQzQ0T0RnNE9EZzRPRGc0T0Rrc01UWXVOU3d5TWpFeExqRXhNVEV4TVRFeE1URXhNVE1zTVRFekxqZ3pNek16TXpNek16TXpNek16TERJeU5qWXVOalkyTmpZMk5qWTJOalkzTERFeE0wTXlNekl5TGpJeU1qSXlNakl5TWpJeU1qWXNNVEV5TGpFMk5qWTJOalkyTmpZMk5qWTNMREl6TWpBdU1UTTRPRGc0T0RnNE9EZzVMQzAxTkM0M09URTJOalkyTmpZMk5qWTJOeXd5TkRBd0xEVkRNalEzT1M0NE5qRXhNVEV4TVRFeE1URXNOalF1TnpreE5qWTJOalkyTmpZMk5qY3NNekkxTkM0eE5qWTJOalkyTmpZMk5qWTFMREl4TXk0MU5ERTJOalkyTmpZMk5qWTJPU3d5TmpVd0xEUXdNRU15TURRMUxqZ3pNek16TXpNek16TXpNelVz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OaGNEMGljbTkxYm1RaUlITjBjbTlyWlMxc2FXNWxhbTlwYmowaWNtOTFibVFpSUdROUlrMDROQzQ0TkRnc0xUVXlMakkzT1NCTU1DNDVORElzTFRrekxqSXhOU0JNTFRnMExqZzBPQ3d0TlRNdU1UYzVJRXd0TUM0NU5ESXNMVEV5TGpJME15QmFJaUJtYVd4c1BTSWpSVVF3SWo0OEwzQmhkR2crUEhCaGRHZ2djM1J5YjJ0bExXeHBibVZqWVhBOUluSnZkVzVrSWlCemRISnZhMlV0YkdsdVpXcHZhVzQ5SW5KdmRXNWtJaUJrUFNKTkxUZzBMamcwT0N3dE5UTXVNVGM1SUV3dE1DNDVORElzTFRFeUxqSTBNeUJNTFRBdU9UUXlMRGt6TGpJeE5TQk1MVGcwTGpnME9DdzFNaTR5TnprZ1dpSWdabWxzYkQwaUl6WTJRME13TUNJK1BDOXdZWFJvUGp4d1lYUm9JSE4wY205clpTMXNhVzVsWTJGd1BTSnliM1Z1WkNJZ2MzUnliMnRsTFd4cGJtVnFiMmx1UFNKeWIzVnVaQ0lnWkQwaVRUZzBMamcwT0N3dE5USXVNamM1SUV3dE1DNDVORElzTFRFeUxqSTBNeUJNTFRBdU9UUXlMRGt6TGpJeE5TQk1PRFF1T0RRNExEVXpMakUzT1NCYUlpQm1hV3hzUFNJak16TTVPVEF3SWo0OEwzQmhkR2crUEM5emRtYysiLz48L3N2Zz4=", insetIconURL: t, - featured: !0, - disabled: !1, + featured: true, + disabled: false, collaboratorList: [{ collaborator: "LazyTong @ Github", - collaboratorURL: "https://github.com/lazytong-tech" + collaboratorURL: "https://lt.js.org" }], - doc: "https://lt.js.org/posts/20240718" + doc: "https://lt.js.org/posts/3ad4f6" }, l10n: { "zh-cn": { - "Cube.name": "LazyTong的立方体 V1.0.2", - "Cube.description": "添加立体图形!" + "Cube.name": "LazyTong鐨勭珛鏂逛綋 V1.2", + "Cube.description": "鍗囩淮鎵撳嚮锛�" }, en: { - "Cube.name": "LazyTong's Cube V1.0.2", - "Cube.description": "Create solid figure!" + "Cube.name": "LazyTong's Cube V1.2", + "Cube.description": "Dimensionality expansion strike!" } } }); From 073bf84d4cef47401de8b85f3e26ee92c5bd6232 Mon Sep 17 00:00:00 2001 From: LazyTong Date: Sun, 22 Sep 2024 16:57:40 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B9=B1=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/LazyTong/Cube.js | 80 ++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/extensions/LazyTong/Cube.js b/extensions/LazyTong/Cube.js index d09378ee..dbe4ed26 100644 --- a/extensions/LazyTong/Cube.js +++ b/extensions/LazyTong/Cube.js @@ -23,7 +23,7 @@ void (window.tempExt = { } return null }, this.Cube = function () { - console.log("%cLazyTong's Cube\n----------\n 銆€ 銆€鈻冣枂鈻堚枃鈻勨枛\n銆€ 銆€ 銆€ 鈻熲棨鈻栥€€銆€銆€鈼モ枅鈻嶾n 銆€ 鈼⑩棨銆€ 鈻愩€€銆€銆€ 銆€鈻愨枆\n銆€ 鈻椻棨銆€銆€銆€鈻傘€€鈻椻枛銆€銆€鈻曗枅鈻嶾n銆€鈼ゃ€€鈻椻枀鈻栤棩鈻勩€€鈻€鈼c€€銆€鈻堚枈\n鈻愩€€鈻曗枎鈼モ枛鈼b棨銆€銆€銆€銆€鈼⑩枅鈻圽n鈻堚棧銆€鈼モ枀鈻堚杸銆€銆€銆€銆€鈻愨枅鈻堚棨\n鈻愨枅鈻欌杺銆€銆€ 銆€鈼⑩枅鈻堚棨\n鈼モ枅鈻堚棧銆€銆€銆€銆€鈼⑩杽鈼n 銆€銆€鈻€鈻堚枅鈻呪枃鈻€\n----------\nVer 1.2\nhttps://lt.js.org ", "color:green;font-weight:bolder"); + console.log("%cLazyTong's Cube\n----------\n    ▃▆█▇▄▖\n      ▟◤▖   ◥█▎\n   ◢◤  ▐     ▐▉\n  ▗◤   ▂ ▗▖  ▕█▎\n ◤ ▗▅▖◥▄ ▀◣  █▊\n▐ ▕▎◥▖◣◤    ◢██\n█◣ ◥▅█▀    ▐██◤\n▐█▙▂    ◢██◤\n◥██◣    ◢▄◤\n   ▀██▅▇▀\n----------\nVer 1.2\nhttps://lt.js.org ", "color:green;font-weight:bolder"); let p = 2 * Math.PI, n = function (e, t) { for (let a in t) e[a] = t[a]; @@ -166,7 +166,7 @@ void (window.tempExt = { this.sortValue = this.renderOrigin.z }, a.prototype.render = function () { }, a.prototype.renderGraphCanvas = function (a) { - if (!a) throw new Error("[Cube]鏈彁渚涙覆鏌撲笂涓嬫枃"); + if (!a) throw new Error("[Cube]未提供渲染上下文"); this.flatGraph.forEach(function (e) { e.render(a, o) }) @@ -249,7 +249,7 @@ void (window.tempExt = { n(G.prototype, j.prototype), G.prototype.create = function (e) { a.prototype.create.call(this, e), j.prototype.create.call(this, e), this.setElement(this.element), this.setDragRotate(this.dragRotate), this.setResize(this.resize) }, G.prototype.setElement = function (e) { - if (!this.element) throw new Error("[Cube]鏈寚瀹氬厓绱�"); + if (!this.element) throw new Error("[Cube]未指定元素"); this.setCanvas(e) }, G.prototype.setSize = function (e, t) { e = Math.round(e), t = Math.round(t), this.setSizeCanvas(e, t) @@ -397,7 +397,7 @@ void (window.tempExt = { }, E.prototype.render = function (e, t) { let a = this.pathCommands.length; if (this.visible && a && (this.isFacingBack = 0 < this.renderNormal.z, this.backface || !this.isFacingBack)) { - if (!t) throw new Error("[Cube]鏈彁渚涙覆鏌撳櫒"); + if (!t) throw new Error("[Cube]未提供渲染器"); 1 === a ? this.renderCanvasDot(e, t) : this.renderPath(e, t) } }, E.prototype.renderCanvasDot = function (t) { @@ -838,7 +838,7 @@ void (window.tempExt = { cone: F, box: C } - }(), (null === this.canvas() || null === this.cubeParent()) && console.error("[Cube]鏃犳硶瀹氫綅鍒拌垶鍙�"), (() => { + }(), (null === this.canvas() || null === this.cubeParent()) && console.error("[Cube]无法定位到舞台"), (() => { if (null !== this.canvas() && null !== this.cubeParent()) { let t = document.createElement("canvas"); t.setAttribute("id", "Cube"), t.setAttribute("width", this.canvas().style.width), t.setAttribute("height", this.canvas().style.height); @@ -863,41 +863,41 @@ void (window.tempExt = { window.cube = () => this.runtime; this._formatMessage = e.getFormatMessage({ "zh-cn": { - "Cube.name": "LazyTong鐨勭珛鏂逛綋", - "Cube.createRect": "鍒涘缓鎴栦慨鏀逛竴涓煩褰㈠苟鍛藉悕涓篬id]锛孹[x]Y[y]Z[z]瀹絒width]楂榌height]棰滆壊[color]澶у皬[stroke]%", - "Cube.createRoundedRect": "鍒涘缓鎴栦慨鏀逛竴涓渾瑙掔煩褰㈠苟鍛藉悕涓篬id]锛孹[x]Y[y]Z[z]瀹絒width]楂榌height]棰滆壊[color]杈硅寮у害[radius]澶у皬[stroke]%", - "Cube.createCircle": "鍒涘缓鎴栦慨鏀逛竴涓渾褰㈠苟鍛藉悕涓篬id]锛孹[x]Y[y]Z[z]棰滆壊[color]鍗婂緞[diameter]瀹屾暣鎬quarters]", - "Cube.createEllipse": "鍒涘缓鎴栦慨鏀逛竴涓き鍦嗗舰骞跺懡鍚嶄负[id]锛孹[x]Y[y]Z[z]瀹絒width]楂榌height]棰滆壊[color]澶у皬[stroke]%", - "Cube.createPolygon": "鍒涘缓鎴栦慨鏀逛竴涓猍sides]杈瑰舰骞跺懡鍚嶄负[id]锛孹[x]Y[y]Z[z]瀹絒width]楂榌height]棰滆壊[color]杈硅寮у害[radius]澶у皬[stroke]%", - "Cube.createHemisphere": "鍒涘缓鎴栦慨鏀逛竴涓崐鍦嗗苟鍛藉悕涓篬id]锛孹[x]Y[y]Z[z]棰滆壊[color]鍦伴潰棰滆壊[backface]鍗婂緞[diameter]澶у皬[stroke]%", - "Cube.createCone": "鍒涘缓鎴栦慨鏀逛竴涓渾閿ヤ綋骞跺懡鍚嶄负[id]锛孹[x]Y[y]Z[z]棰滆壊[color]鍦伴潰棰滆壊[backface]闀垮害[length]鍗婂緞[diameter]澶у皬[stroke]%", - "Cube.createCylinder": "鍒涘缓鎴栦慨鏀逛竴涓渾鏌变綋骞跺懡鍚嶄负[id]锛孹[x]Y[y]Z[z]棰滆壊[color]椤堕儴棰滆壊[frontface]鍦伴潰棰滆壊[backface]闀垮害[length]澶у皬[stroke]%", - "Cube.createBox": "鍒涘缓鎴栦慨鏀逛竴涓珛鏂逛綋骞跺懡鍚嶄负[id]锛孹[x]Y[y]Z[z]瀹絒width]楂榌height]灏哄[depth]棰滆壊[color]宸︿晶棰滆壊[leftface]鍙充晶棰滆壊[rightface]椤堕儴棰滆壊[topface]鍦伴潰棰滆壊[bottomface]澶у皬[stroke]%", - "Cube.createCustom": "鍒涘缓鎴栦慨鏀逛竴涓猍closed]鑷畾涔夋ā鍨嬪苟鍛藉悕涓篬id]锛孹[x]Y[y]Z[z]棰滆壊[color]鑺傜偣浣嶇疆[path]鑺傜偣澶у皬[stroke]%", - "Cube.deleteObject": "鍒犻櫎鐗╀綋[id]", - "Cube.getAttrib": "鐗╀綋[id]鐨刐type]", - "Cube.deleteAllObject": "鍒犻櫎鎵€鏈夌墿浣�", - "Cube.getObjectNumbers": "鐗╀綋鎬绘暟", - "Cube.getObjectList": "鐗╀綋ID鍒楄〃", + "Cube.name": "LazyTong的立方体", + "Cube.createRect": "创建或修改一个矩形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]大小[stroke]%", + "Cube.createRoundedRect": "创建或修改一个圆角矩形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]边角弧度[radius]大小[stroke]%", + "Cube.createCircle": "创建或修改一个圆形并命名为[id],X[x]Y[y]Z[z]颜色[color]半径[diameter]完整性[quarters]", + "Cube.createEllipse": "创建或修改一个椭圆形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]大小[stroke]%", + "Cube.createPolygon": "创建或修改一个[sides]边形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]边角弧度[radius]大小[stroke]%", + "Cube.createHemisphere": "创建或修改一个半圆并命名为[id],X[x]Y[y]Z[z]颜色[color]地面颜色[backface]半径[diameter]大小[stroke]%", + "Cube.createCone": "创建或修改一个圆锥体并命名为[id],X[x]Y[y]Z[z]颜色[color]地面颜色[backface]长度[length]半径[diameter]大小[stroke]%", + "Cube.createCylinder": "创建或修改一个圆柱体并命名为[id],X[x]Y[y]Z[z]颜色[color]顶部颜色[frontface]地面颜色[backface]长度[length]大小[stroke]%", + "Cube.createBox": "创建或修改一个立方体并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]尺寸[depth]颜色[color]左侧颜色[leftface]右侧颜色[rightface]顶部颜色[topface]地面颜色[bottomface]大小[stroke]%", + "Cube.createCustom": "创建或修改一个[closed]自定义模型并命名为[id],X[x]Y[y]Z[z]颜色[color]节点位置[path]节点大小[stroke]%", + "Cube.deleteObject": "删除物体[id]", + "Cube.getAttrib": "物体[id]的[type]", + "Cube.deleteAllObject": "删除所有物体", + "Cube.getObjectNumbers": "物体总数", + "Cube.getObjectList": "物体ID列表", "Cube.x": "X", "Cube.y": "Y", "Cube.z": "Z", - "Cube.width": "瀹藉害", - "Cube.height": "楂樺害", - "Cube.color": "棰滆壊", - "Cube.stroke": "澶у皬", - "Cube.quarters": "瀹屾暣鎬�", - "Cube.cornerRadius": "杈硅寮у害", - "Cube.radius": "寮у害", - "Cube.setRotate": "璁剧疆鐗╀綋[id]鍦╗type]涓婃棆杞琜rotate]搴�", - "Cube.updateRender": "娓叉煋褰撳墠璁剧疆鐨勭墿浣�", - "Cube.docs": "鎷撳睍鏁欑▼", - "Cube.create": "鍒涘缓鐗╀綋", - "Cube.modify": "淇敼鐗╀綋", - "Cube.info": "淇℃伅", - "Cube.fileListEmpty": "鏃犳枃浠�", - "Cube.open": "寮€鏀剧殑", - "Cube.closed": "闂悎鐨�" + "Cube.width": "宽度", + "Cube.height": "高度", + "Cube.color": "颜色", + "Cube.stroke": "大小", + "Cube.quarters": "完整性", + "Cube.cornerRadius": "边角弧度", + "Cube.radius": "弧度", + "Cube.setRotate": "设置物体[id]在[type]上旋转[rotate]度", + "Cube.updateRender": "渲染当前设置的物体", + "Cube.docs": "拓展教程", + "Cube.create": "创建物体", + "Cube.modify": "修改物体", + "Cube.info": "信息", + "Cube.fileListEmpty": "无文件", + "Cube.open": "开放的", + "Cube.closed": "闭合的" }, en: { "Cube.name": "LazyTong's Cube", @@ -1754,7 +1754,7 @@ void (window.tempExt = { try { this.cubeScene.updateRenderGraph() } catch (e) { - throw new Error('Cube: 娓叉煋鏃跺彂鐢熼敊璇�') + throw new Error('Cube: 渲染时发生错误') } } }, @@ -1774,8 +1774,8 @@ void (window.tempExt = { }, l10n: { "zh-cn": { - "Cube.name": "LazyTong鐨勭珛鏂逛綋 V1.2", - "Cube.description": "鍗囩淮鎵撳嚮锛�" + "Cube.name": "LazyTong的立方体 V1.2", + "Cube.description": "升维打击!" }, en: { "Cube.name": "LazyTong's Cube V1.2", From 0f2380f8d2173538f54d8a26e68f2d42cf005ef1 Mon Sep 17 00:00:00 2001 From: LazyTong Date: Wed, 2 Oct 2024 20:37:02 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E8=A2=AB=E9=87=8D?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E7=9A=84=E5=8F=98=E9=87=8F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/LazyTong/Cube.js | 1573 ++++++++++++++++++----------------- 1 file changed, 799 insertions(+), 774 deletions(-) diff --git a/extensions/LazyTong/Cube.js b/extensions/LazyTong/Cube.js index dbe4ed26..36fe6510 100644 --- a/extensions/LazyTong/Cube.js +++ b/extensions/LazyTong/Cube.js @@ -1,8 +1,9 @@ -const t = "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIg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8+PHBhdGggY2xhc3M9ImMiIGQ9Im0zOS43IDcxLjFsLTI4LTEzLjcgMjguNi0xMy4zIDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImQiIGQ9Im02OC4zIDIyLjZsLTI4LTEzLjctMjguNiAxMy40IDI4IDEzLjZ6Ii8+PHBhdGggY2xhc3M9ImIiIGQ9Im0xMS43IDIyLjNsMjggMTMuNnYzNS4ybC0yOC0xMy43eiIvPjxwYXRoIGNsYXNzPSJlIiBkPSJtNjguMyAyMi42bC0yOC42IDEzLjN2MzUuMmwyOC42LTEzLjR6Ii8+PC9zdmc+'; void (window.tempExt = { Extension: class { constructor(e) { - this.objectList = {}, this.observer = null, this.runtime = e, this.canvas = () => { + console.log("%cLazyTong's Cube\n----------\n    ▃▆█▇▄▖\n      ▟◤▖   ◥█▎\n   ◢◤  ▐     ▐▉\n  ▗◤   ▂ ▗▖  ▕█▎\n ◤ ▗▅▖◥▄ ▀◣  █▊\n▐ ▕▎◥▖◣◤    ◢██\n█◣ ◥▅█▀    ▐██◤\n▐█▙▂    ◢██◤\n◥██◣    ◢▄◤\n   ▀██▅▇▀\n----------\nVer 1.2\nhttps://lt.js.org ", 'color:green;font-weight:bolder'); + this.instances = {}, this.runtime = e, this.canvas = () => { try { const { canvas: e @@ -12,71 +13,71 @@ void (window.tempExt = { return null } return null - }, this.cubeParent = () => { + }, this.parentElement = () => { try { const { canvas: e } = this.runtime.renderer; if (e instanceof HTMLCanvasElement) return e.parentElement } catch (e) { - return console.error(e), null + console.log(e); + return null } return null - }, this.Cube = function () { - console.log("%cLazyTong's Cube\n----------\n    ▃▆█▇▄▖\n      ▟◤▖   ◥█▎\n   ◢◤  ▐     ▐▉\n  ▗◤   ▂ ▗▖  ▕█▎\n ◤ ▗▅▖◥▄ ▀◣  █▊\n▐ ▕▎◥▖◣◤    ◢██\n█◣ ◥▅█▀    ▐██◤\n▐█▙▂    ◢██◤\n◥██◣    ◢▄◤\n   ▀██▅▇▀\n----------\nVer 1.2\nhttps://lt.js.org ", "color:green;font-weight:bolder"); - let p = 2 * Math.PI, - n = function (e, t) { + }, this.renderer = function () { + let tau = 2 * Math.PI, + extend = function (e, t) { for (let a in t) e[a] = t[a]; return e }, - i = function (e, t, a) { + lerp = function (e, t, a) { return (t - e) * a + e }, - c = function (a, e) { + modulo = function (a, e) { return (a % e + e) % e }, s = function () { }, - o = {}; - o.begin = function (e) { + canvasRenderer = {}; + canvasRenderer.begin = function (e) { e.beginPath() - }, o.move = function (e, t, a) { + }, canvasRenderer.move = function (e, t, a) { e.moveTo(a.x, a.y) - }, o.line = function (e, t, a) { + }, canvasRenderer.line = function (e, t, a) { e.lineTo(a.x, a.y) - }, o.bezier = function (a, r, o, d, e) { + }, canvasRenderer.bezier = function (a, r, o, d, e) { a.bezierCurveTo(o.x, o.y, d.x, d.y, e.x, e.y) - }, o.closePath = function (e) { + }, canvasRenderer.closePath = function (e) { e.closePath() - }, o.setPath = function () { - }, o.renderPath = function (d, a, t, r) { + }, canvasRenderer.setPath = function () { + }, canvasRenderer.renderPath = function (d, a, t, r) { this.begin(d, a), t.forEach(function (e) { - e.render(d, a, o) + e.render(d, a, canvasRenderer) }), r && this.closePath(d, a) - }, o.stroke = function (a, r, o, d, e) { + }, canvasRenderer.stroke = function (a, r, o, d, e) { o && (a.strokeStyle = d, a.lineWidth = e, a.stroke()) - }, o.fill = function (t, a, r, o) { + }, canvasRenderer.fill = function (t, a, r, o) { r && (t.fillStyle = o, t.fill()) - }, o.end = function () { + }, canvasRenderer.end = function () { }; - let N = function (e) { + let vector = function (e) { this.set(e) }; - N.prototype.set = function (e) { + vector.prototype.set = function (e) { return this.x = e && e.x || 0, this.y = e && e.y || 0, this.z = e && e.z || 0, this - }, N.prototype.write = function (e) { + }, vector.prototype.write = function (e) { return e ? (this.x = null == e.x ? this.x : e.x, this.y = null == e.y ? this.y : e.y, this.z = null == e.z ? this.z : e.z, this) : this - }, N.prototype.rotate = function (e) { + }, vector.prototype.rotate = function (e) { if (e) return this.rotateZ(e.z), this.rotateY(e.y), this.rotateX(e.x), this - }, N.prototype.rotateZ = function (e) { - R(this, e, "x", "y") - }, N.prototype.rotateX = function (e) { - R(this, e, "y", "z") - }, N.prototype.rotateY = function (e) { - R(this, e, "x", "z") + }, vector.prototype.rotateZ = function (e) { + R(this, e, 'x', 'y') + }, vector.prototype.rotateX = function (e) { + R(this, e, 'y', 'z') + }, vector.prototype.rotateY = function (e) { + R(this, e, 'x', 'z') }; let R = function (T, l, a, e) { - if (l && 0 !== l % p) { + if (l && 0 !== l % tau) { let t = Math.cos(l), r = Math.sin(l), o = T[a], @@ -84,157 +85,157 @@ void (window.tempExt = { T[a] = o * t - d * r, T[e] = d * t + o * r } }; - N.prototype.isSame = function (e) { + vector.prototype.isSame = function (e) { return !!e && this.x === e.x && this.y === e.y && this.z === e.z - }, N.prototype.add = function (e) { + }, vector.prototype.add = function (e) { return e ? (this.x += e.x || 0, this.y += e.y || 0, this.z += e.z || 0, this) : this - }, N.prototype.subtract = function (e) { + }, vector.prototype.subtract = function (e) { return e ? (this.x -= e.x || 0, this.y -= e.y || 0, this.z -= e.z || 0, this) : this - }, N.prototype.multiply = function (e) { - return null == e ? this : ("number" == typeof e ? (this.x *= e, this.y *= e, this.z *= e) : (this.x *= null == e.x ? 1 : e.x, this.y *= null == e.y ? 1 : e.y, this.z *= null == e.z ? 1 : e.z), this) - }, N.prototype.transform = function (e, t, a) { + }, vector.prototype.multiply = function (e) { + return null == e ? this : ('number' == typeof e ? (this.x *= e, this.y *= e, this.z *= e) : (this.x *= null == e.x ? 1 : e.x, this.y *= null == e.y ? 1 : e.y, this.z *= null == e.z ? 1 : e.z), this) + }, vector.prototype.transform = function (e, t, a) { return this.multiply(a), this.rotate(t), this.add(e), this - }, N.prototype.lerp = function (a, e) { - return this.x = i(this.x, a.x || 0, e), this.y = i(this.y, a.y || 0, e), this.z = i(this.z, a.z || 0, e), this - }, N.prototype.magnitude = function () { + }, vector.prototype.lerp = function (a, e) { + return this.x = lerp(this.x, a.x || 0, e), this.y = lerp(this.y, a.y || 0, e), this.z = lerp(this.z, a.z || 0, e), this + }, vector.prototype.magnitude = function () { let e = this.x * this.x + this.y * this.y + this.z * this.z; return u(e) }; let u = function (e) { return 1e-8 > Math.abs(e - 1) ? 1 : Math.sqrt(e) }; - N.prototype.magnitude2d = function () { + vector.prototype.magnitude2d = function () { let e = this.x * this.x + this.y * this.y; return u(e) - }, N.prototype.copy = function () { - return new N(this) + }, vector.prototype.copy = function () { + return new vector(this) }; - let r = { + let onePoint = { x: 1, y: 1, z: 1 }, - a = function (e) { + anchor = function (e) { this.create(e || {}) }; - a.prototype.create = function (e) { - this.children = [], n(this, this.constructor.defaults), this.setOptions(e), this.translate = new N(e.translate), this.rotate = new N(e.rotate), this.scale = new N(r).multiply(this.scale), this.origin = new N, this.renderOrigin = new N, this.addTo && this.addTo.addChild(this) - }, a.defaults = {}, a.optionKeys = Object.keys(a.defaults).concat(["rotate", "translate", "scale", "addTo"]), a.prototype.setOptions = function (e) { + anchor.prototype.create = function (e) { + this.children = [], extend(this, this.constructor.defaults), this.setOptions(e), this.translate = new vector(e.translate), this.rotate = new vector(e.rotate), this.scale = new vector(onePoint).multiply(this.scale), this.origin = new vector, this.renderOrigin = new vector, this.addTo && this.addTo.addChild(this) + }, anchor.defaults = {}, anchor.optionKeys = Object.keys(anchor.defaults).concat(['rotate', 'translate', 'scale', 'addTo']), anchor.prototype.setOptions = function (e) { let t = this.constructor.optionKeys; for (let a in e) -1 !== t.indexOf(a) && (this[a] = e[a]) - }, a.prototype.addChild = function (e) { + }, anchor.prototype.addChild = function (e) { -1 !== this.children.indexOf(e) || (e.remove(), e.addTo = this, this.children.push(e)) - }, a.prototype.removeChild = function (a) { + }, anchor.prototype.removeChild = function (a) { let e = this.children.indexOf(a); - -1 != e && this.children.splice(e, 1) - }, a.prototype.remove = function () { + -1 !== e && this.children.splice(e, 1) + }, anchor.prototype.remove = function () { this.addTo && this.addTo.removeChild(this) - }, a.prototype.update = function () { + }, anchor.prototype.update = function () { this.reset(), this.children.forEach(function (e) { e.update() }), this.transform(this.translate, this.rotate, this.scale) - }, a.prototype.reset = function () { + }, anchor.prototype.reset = function () { this.renderOrigin.set(this.origin) - }, a.prototype.transform = function (t, a, r) { + }, anchor.prototype.transform = function (t, a, r) { this.renderOrigin.transform(t, a, r), this.children.forEach(function (o) { o.transform(t, a, r) }) - }, a.prototype.updateGraph = function () { + }, anchor.prototype.updateGraph = function () { this.update(), this.updateFlatGraph(), this.flatGraph.forEach(function (e) { e.updateSortValue() - }), this.flatGraph.sort(a.shapeSorter) - }, a.shapeSorter = function (a, e) { + }), this.flatGraph.sort(anchor.shapeSorter) + }, anchor.shapeSorter = function (a, e) { return a.sortValue - e.sortValue - }, Object.defineProperty(a.prototype, "flatGraph", { + }, Object.defineProperty(anchor.prototype, 'flatGraph', { get: function () { return this._flatGraph || this.updateFlatGraph(), this._flatGraph }, set: function (e) { this._flatGraph = e } - }), a.prototype.updateFlatGraph = function () { + }), anchor.prototype.updateFlatGraph = function () { this.flatGraph = this.getFlatGraph() - }, a.prototype.getFlatGraph = function () { + }, anchor.prototype.getFlatGraph = function () { let e = [this]; return this.addChildFlatGraph(e) - }, a.prototype.addChildFlatGraph = function (e) { + }, anchor.prototype.addChildFlatGraph = function (e) { return this.children.forEach(function (t) { let a = t.getFlatGraph(); Array.prototype.push.apply(e, a) }), e - }, a.prototype.updateSortValue = function () { + }, anchor.prototype.updateSortValue = function () { this.sortValue = this.renderOrigin.z - }, a.prototype.render = function () { - }, a.prototype.renderGraphCanvas = function (a) { - if (!a) throw new Error("[Cube]未提供渲染上下文"); + }, anchor.prototype.render = function () { + }, anchor.prototype.renderGraphCanvas = function (a) { + if (!a) console.error('Cube: 未提供渲染上下文'); this.flatGraph.forEach(function (e) { - e.render(a, o) + e.render(a, canvasRenderer) }) - }, a.prototype.copy = function (e) { + }, anchor.prototype.copy = function (e) { let a = {}, r = this.constructor.optionKeys; r.forEach(function (e) { a[e] = this[e] - }, this), n(a, e); + }, this), extend(a, e); let o = this.constructor; return new o(a) - }, a.prototype.copyGraph = function (e) { + }, anchor.prototype.copyGraph = function (e) { let a = this.copy(e); return this.children.forEach(function (e) { e.copyGraph({ addTo: a }) }), a - }, a.prototype.normalizeRotate = function () { - this.rotate.x = c(this.rotate.x, p), this.rotate.y = c(this.rotate.y, p), this.rotate.z = c(this.rotate.z, p) + }, anchor.prototype.normalizeRotate = function () { + this.rotate.x = modulo(this.rotate.x, tau), this.rotate.y = modulo(this.rotate.y, tau), this.rotate.z = modulo(this.rotate.z, tau) }; let d = function (e) { return function (a) { let r = function (e) { this.create(e || {}) }; - return r.prototype = Object.create(e.prototype), r.prototype.constructor = r, r.defaults = n({}, e.defaults), n(r.defaults, a), r.optionKeys = e.optionKeys.slice(0), Object.keys(r.defaults).forEach(function (t) { + return r.prototype = Object.create(e.prototype), r.prototype.constructor = r, r.defaults = extend({}, e.defaults), extend(r.defaults, a), r.optionKeys = e.optionKeys.slice(0), Object.keys(r.defaults).forEach(function (t) { 1 !== !r.optionKeys.indexOf(t) && r.optionKeys.push(t) }), r.subclass = d(r), r } }; - a.subclass = d(a); - let T = "undefined" != typeof window, - e = "mousedown", - k = "mousemove", - S = "mouseup"; - T && (window.PointerEvent ? (e = "pointerdown", k = "pointermove", S = "pointerup") : "ontouchstart" in window && (e = "touchstart", k = "touchmove", S = "touchend")); - let j = function (e) { + anchor.subclass = d(anchor); + let T = 'undefined' != typeof window, + e = 'mousedown', + k = 'mousemove', + S = 'mouseup'; + T && (window.PointerEvent ? (e = 'pointerdown', k = 'pointermove', S = 'pointerup') : 'ontouchstart' in window && (e = 'touchstart', k = 'touchmove', S = 'touchend')); + let dragger = function (e) { this.create(e || {}) }; - j.prototype.create = function (t) { + dragger.prototype.create = function (t) { this.onDragStart = t.onDragStart || s, this.onDragMove = t.onDragMove || s, this.onDragEnd = t.onDragEnd || s, this.bindDrag(t.startElement) - }, j.prototype.bindDrag = function (t) { - t = this.getQueryElement(t), t && (t.style.touchAction = "none", t.addEventListener(e, this)) - }, j.prototype.getQueryElement = function (e) { - return "string" == typeof e && (e = document.querySelector(e)), e - }, j.prototype.handleEvent = function (a) { - let e = this["on" + a.type]; + }, dragger.prototype.bindDrag = function (t) { + t = this.getQueryElement(t), t && (t.style.touchAction = 'none', t.addEventListener(e, this)) + }, dragger.prototype.getQueryElement = function (e) { + return 'string' == typeof e && (e = document.querySelector(e)), e + }, dragger.prototype.handleEvent = function (a) { + let e = this['on' + a.type]; e && e.call(this, a) - }, j.prototype.onmousedown = j.prototype.onpointerdown = function (e) { + }, dragger.prototype.onmousedown = dragger.prototype.onpointerdown = function (e) { this.dragStart(e, e) - }, j.prototype.ontouchstart = function (e) { + }, dragger.prototype.ontouchstart = function (e) { this.dragStart(e, e.changedTouches[0]) - }, j.prototype.dragStart = function (e, t) { + }, dragger.prototype.dragStart = function (e, t) { e.preventDefault(), this.dragStartX = t.pageX, this.dragStartY = t.pageY, T && (window.addEventListener(k, this), window.addEventListener(S, this)), this.onDragStart(t) - }, j.prototype.ontouchmove = function (e) { + }, dragger.prototype.ontouchmove = function (e) { this.dragMove(e, e.changedTouches[0]) - }, j.prototype.onmousemove = j.prototype.onpointermove = function (e) { + }, dragger.prototype.onmousemove = dragger.prototype.onpointermove = function (e) { this.dragMove(e, e) - }, j.prototype.dragMove = function (t, a) { + }, dragger.prototype.dragMove = function (t, a) { t.preventDefault(); let r = a.pageX - this.dragStartX, o = a.pageY - this.dragStartY; this.onDragMove(a, r, o) - }, j.prototype.onmouseup = j.prototype.onpointerup = j.prototype.ontouchend = j.prototype.dragEnd = function () { + }, dragger.prototype.onmouseup = dragger.prototype.onpointerup = dragger.prototype.ontouchend = dragger.prototype.dragEnd = function () { window.removeEventListener(k, this), window.removeEventListener(S, this), this.onDragEnd() }; - let G = a.subclass({ + let init = anchor.subclass({ element: void 0, centered: true, zoom: 1, @@ -246,66 +247,66 @@ void (window.tempExt = { onDragEnd: s, onResize: s }); - n(G.prototype, j.prototype), G.prototype.create = function (e) { - a.prototype.create.call(this, e), j.prototype.create.call(this, e), this.setElement(this.element), this.setDragRotate(this.dragRotate), this.setResize(this.resize) - }, G.prototype.setElement = function (e) { - if (!this.element) throw new Error("[Cube]未指定元素"); + extend(init.prototype, dragger.prototype), init.prototype.create = function (e) { + anchor.prototype.create.call(this, e), dragger.prototype.create.call(this, e), this.setElement(this.element), this.setDragRotate(this.dragRotate), this.setResize(this.resize) + }, init.prototype.setElement = function (e) { + if (!this.element) console.error('Cube: 未指定元素'); this.setCanvas(e) - }, G.prototype.setSize = function (e, t) { + }, init.prototype.setSize = function (e, t) { e = Math.round(e), t = Math.round(t), this.setSizeCanvas(e, t) - }, G.prototype.setResize = function (e) { - this.resize = e, this.resizeListener || (this.resizeListener = this.onWindowResize.bind(this)), e ? (window.addEventListener("resize", this.resizeListener), this.onWindowResize()) : window.removeEventListener("resize", this.resizeListener) - }, G.prototype.onWindowResize = function () { + }, init.prototype.setResize = function (e) { + this.resize = e, this.resizeListener || (this.resizeListener = this.onWindowResize.bind(this)), e ? (window.addEventListener('resize', this.resizeListener), this.onWindowResize()) : window.removeEventListener('resize', this.resizeListener) + }, init.prototype.onWindowResize = function () { this.setMeasuredSize(), this.onResize(this.width, this.height) - }, G.prototype.setMeasuredSize = function () { - let t, a, e = "fullscreen" === this.resize; + }, init.prototype.setMeasuredSize = function () { + let t, a, e = 'fullscreen' === this.resize; if (e) t = window.innerWidth, a = window.innerHeight; else { let r = this.element.getBoundingClientRect(); t = r.width, a = r.height } this.setSize(t, a) - }, G.prototype.renderGraph = function (e) { + }, init.prototype.renderGraph = function (e) { this.renderGraphCanvas(e) - }, G.prototype.updateRenderGraph = function (e) { + }, init.prototype.updateRenderGraph = function (e) { this.updateGraph(), this.renderGraph(e) - }, G.prototype.setCanvas = function (e) { - this.element = e, this.ctx = this.element.getContext("2d"), this.setSizeCanvas(e.width, e.height) - }, G.prototype.setSizeCanvas = function (t, a) { + }, init.prototype.setCanvas = function (e) { + this.element = e, this.ctx = this.element.getContext('2d'), this.setSizeCanvas(e.width, e.height) + }, init.prototype.setSizeCanvas = function (t, a) { this.width = t, this.height = a; let r = this.pixelRatio = window.devicePixelRatio || 1; this.element.width = this.canvasWidth = t * r, this.element.height = this.canvasHeight = a * r; let o = 1 < r && !this.resize; - o && (this.element.style.width = t + "px", this.element.style.height = a + "px") - }, G.prototype.renderGraphCanvas = function (e) { - e = e || this, this.prerenderCanvas(), a.prototype.renderGraphCanvas.call(e, this.ctx), this.postrenderCanvas() - }, G.prototype.prerenderCanvas = function () { + o && (this.element.style.width = t + 'px', this.element.style.height = a + 'px') + }, init.prototype.renderGraphCanvas = function (e) { + e = e || this, this.prerenderCanvas(), anchor.prototype.renderGraphCanvas.call(e, this.ctx), this.postrenderCanvas() + }, init.prototype.prerenderCanvas = function () { let r = this.ctx; - if (r.lineCap = "round", r.lineJoin = "round", r.clearRect(0, 0, this.canvasWidth, this.canvasHeight), r.save(), this.centered) { + if (r.lineCap = 'round', r.lineJoin = 'round', r.clearRect(0, 0, this.canvasWidth, this.canvasHeight), r.save(), this.centered) { let e = this.width / 2 * this.pixelRatio, t = this.height / 2 * this.pixelRatio; r.translate(e, t) } let t = this.pixelRatio * this.zoom; r.scale(t, t), this.onPrerender(r) - }, G.prototype.postrenderCanvas = function () { + }, init.prototype.postrenderCanvas = function () { this.ctx.restore() - }, G.prototype.setDragRotate = function (e) { + }, init.prototype.setDragRotate = function (e) { e && (true === e && (e = this), this.dragRotate = e, this.bindDrag(this.element)) - }, G.prototype.dragStart = function () { - this.dragStartRX = this.dragRotate.rotate.x, this.dragStartRY = this.dragRotate.rotate.y, j.prototype.dragStart.apply(this, arguments) - }, G.prototype.dragMove = function (r, o) { + }, init.prototype.dragStart = function () { + this.dragStartRX = this.dragRotate.rotate.x, this.dragStartRY = this.dragRotate.rotate.y, dragger.prototype.dragStart.apply(this, arguments) + }, init.prototype.dragMove = function (r, o) { let d = o.pageX - this.dragStartX, e = o.pageY - this.dragStartY, t = Math.min(this.width, this.height); - this.dragRotate.rotate.x = this.dragStartRX - e / t * p, this.dragRotate.rotate.y = this.dragStartRY - d / t * p, j.prototype.dragMove.apply(this, arguments) + this.dragRotate.rotate.x = this.dragStartRX - e / t * tau, this.dragRotate.rotate.y = this.dragStartRY - d / t * tau, dragger.prototype.dragMove.apply(this, arguments) }; let D = function (e) { - return e instanceof N ? e : new N(e) + return e instanceof vector ? e : new vector(e) }, M = function (e) { - return new N(e) - }, w = function (e, t, a) { - this.method = e, this.points = t.map(D), this.renderPoints = t.map(M), this.previousPoint = this.endRenderPoint = this.renderPoints[this.renderPoints.length - 1], "arc" === e && (this.controlPoints = [new N, new N]) + return new vector(e) + }, w = function (e, t) { + this.method = e, this.points = t.map(D), this.renderPoints = t.map(M), this.previousPoint = this.endRenderPoint = this.renderPoints[this.renderPoints.length - 1], 'arc' === e && (this.controlPoints = [new vector, new vector]) }; w.prototype.reset = function () { let t = this.points; @@ -338,10 +339,10 @@ void (window.tempExt = { r = this.controlPoints[1]; return a.set(l).lerp(e, V), r.set(t).lerp(e, V), T.bezier(d, p, a, r, t) }; - let E = a.subclass({ + let custom = anchor.subclass({ stroke: 1, fill: false, - color: "#333", + color: '#333', closed: true, visible: true, path: [{}], @@ -350,42 +351,41 @@ void (window.tempExt = { }, backface: true }); - E.prototype.create = function (e) { + custom.prototype.create = function (e) { this.path = e.path; - a.prototype.create.call(this, e); + anchor.prototype.create.call(this, e); this.updatePath(); - this.front = new N(e.front || this.front); - this.renderFront = new N(this.front); - this.renderNormal = new N + this.front = new vector(e.front || this.front); + this.renderFront = new vector(this.front); + this.renderNormal = new vector }; - let m = ["move", "line", "bezier", "arc"]; - E.prototype.updatePath = function () { + let m = ['move', 'line', 'bezier', 'arc']; + custom.prototype.updatePath = function () { this.setPath(), this.updatePathCommands() - }, E.prototype.setPath = function () { - }, E.prototype.updatePathCommands = function () { - let a; + }, custom.prototype.setPath = function () { + }, custom.prototype.updatePathCommands = function () { this.pathCommands = this.path.map(function (r, o) { let d = Object.keys(r), e = d[0], T = r[e], n = 1 === d.length && -1 !== m.indexOf(e); - n || (e = "line", T = r); - let c = "line" === e || "move" === e, + n || (e = 'line', T = r); + let c = 'line' === e || 'move' === e, i = Array.isArray(T); - c && !i && (T = [T]), e = 0 === o ? "move" : e; + c && !i && (T = [T]), e = 0 === o ? 'move' : e; return new w(e, T) }) - }, E.prototype.reset = function () { + }, custom.prototype.reset = function () { this.renderOrigin.set(this.origin), this.renderFront.set(this.front), this.pathCommands.forEach(function (e) { e.reset() }) - }, E.prototype.transform = function (t, a, r) { + }, custom.prototype.transform = function (t, a, r) { this.renderOrigin.transform(t, a, r), this.renderFront.transform(t, a, r), this.renderNormal.set(this.renderOrigin).subtract(this.renderFront), this.pathCommands.forEach(function (o) { o.transform(t, a, r) }), this.children.forEach(function (o) { o.transform(t, a, r) }) - }, E.prototype.updateSortValue = function () { + }, custom.prototype.updateSortValue = function () { let t = this.pathCommands.length, a = this.pathCommands[0].endRenderPoint, o = this.pathCommands[t - 1].endRenderPoint, @@ -394,32 +394,31 @@ void (window.tempExt = { let d = 0; for (let a = 0; a < t; a++) d += this.pathCommands[a].endRenderPoint.z; this.sortValue = d / t - }, E.prototype.render = function (e, t) { + }, custom.prototype.render = function (e, t) { let a = this.pathCommands.length; if (this.visible && a && (this.isFacingBack = 0 < this.renderNormal.z, this.backface || !this.isFacingBack)) { - if (!t) throw new Error("[Cube]未提供渲染器"); + if (!t) console.error('Cube: 未提供渲染器'); 1 === a ? this.renderCanvasDot(e, t) : this.renderPath(e, t) } - }, E.prototype.renderCanvasDot = function (t) { + }, custom.prototype.renderCanvasDot = function (t) { let a = this.getLineWidth(); if (a) { t.fillStyle = this.getRenderColor(); let r = this.pathCommands[0].endRenderPoint; - t.beginPath(), t.arc(r.x, r.y, a / 2, 0, p), t.fill() + t.beginPath(), t.arc(r.x, r.y, a / 2, 0, tau), t.fill() } - }, E.prototype.getLineWidth = function () { + }, custom.prototype.getLineWidth = function () { return this.stroke ? true === this.stroke ? 1 : this.stroke : 0 - }, E.prototype.getRenderColor = function () { - let a = "string" == typeof this.backface && this.isFacingBack, - e = a ? this.backface : this.color; - return e - }, E.prototype.renderPath = function (r, o) { - let d, l = 2 === this.pathCommands.length && "line" === this.pathCommands[1].method, + }, custom.prototype.getRenderColor = function () { + let a = 'string' == typeof this.backface && this.isFacingBack; + return a ? this.backface : this.color + }, custom.prototype.renderPath = function (r, o) { + let d, l = 2 === this.pathCommands.length && 'line' === this.pathCommands[1].method, e = !l && this.closed, t = this.getRenderColor(); o.renderPath(r, d, this.pathCommands, e), o.stroke(r, d, this.stroke, t, this.getLineWidth()), o.fill(r, d, this.fill, t), o.end(r, d) }; - let y = a.subclass({ + let y = anchor.subclass({ updateSort: false, visible: true }); @@ -427,7 +426,7 @@ void (window.tempExt = { let r = 0; this.flatGraph.forEach(function (e) { e.updateSortValue(), r += e.sortValue - }), this.sortValue = r / this.flatGraph.length, this.updateSort && this.flatGraph.sort(a.shapeSorter) + }), this.sortValue = r / this.flatGraph.length, this.updateSort && this.flatGraph.sort(anchor.shapeSorter) }, y.prototype.render = function (e, t) { this.visible && this.flatGraph.forEach(function (a) { a.render(e, t) @@ -437,11 +436,11 @@ void (window.tempExt = { }, y.prototype.getFlatGraph = function () { return [this] }; - let h = E.subclass({ + let rect = custom.subclass({ width: 1, height: 1 }); - h.prototype.setPath = function () { + rect.prototype.setPath = function () { let a = this.width / 2, e = this.height / 2; this.path = [{ @@ -458,13 +457,13 @@ void (window.tempExt = { y: e }] }; - let U = E.subclass({ + let roundedRect = custom.subclass({ width: 1, height: 1, cornerRadius: .25, closed: false }); - U.prototype.setPath = function () { + roundedRect.prototype.setPath = function () { let o = this.width / 2, d = this.height / 2, l = Math.min(o, d), @@ -521,14 +520,14 @@ void (window.tempExt = { y: -d }), this.path = a }; - let X = E.subclass({ + let ellipse = custom.subclass({ diameter: 1, width: void 0, height: void 0, quarters: 4, closed: false }); - X.prototype.setPath = function () { + ellipse.prototype.setPath = function () { let t = null == this.width ? this.diameter : this.width, a = null == this.height ? this.diameter : this.height, r = t / 2, @@ -570,14 +569,14 @@ void (window.tempExt = { }] }) }; - let z = E.subclass({ + let polygon = custom.subclass({ sides: 3, radius: .5 }); - z.prototype.setPath = function () { + polygon.prototype.setPath = function () { this.path = []; for (let a = 0; a < this.sides; a++) { - let r = a / this.sides * p - p / 4, + let r = a / this.sides * tau - tau / 4, o = Math.cos(r) * this.radius, e = Math.sin(r) * this.radius; this.path.push({ @@ -586,21 +585,21 @@ void (window.tempExt = { }) } }; - let b = X.subclass({ + let hemisphere = ellipse.subclass({ fill: true }); - b.prototype.create = function () { - X.prototype.create.apply(this, arguments), this.apex = new a({ + hemisphere.prototype.create = function () { + ellipse.prototype.create.apply(this, arguments), this.apex = new anchor({ addTo: this, translate: { z: this.diameter / 2 } - }), this.renderCentroid = new N - }, b.prototype.updateSortValue = function () { + }), this.renderCentroid = new vector + }, hemisphere.prototype.updateSortValue = function () { this.renderCentroid.set(this.renderOrigin).lerp(this.apex.renderOrigin, 3 / 8), this.sortValue = this.renderCentroid.z - }, b.prototype.render = function (a, e) { - this.renderDome(a, e), X.prototype.render.apply(this, arguments) - }, b.prototype.renderDome = function (o, d) { + }, hemisphere.prototype.render = function (a, e) { + this.renderDome(a, e), ellipse.prototype.render.apply(this, arguments) + }, hemisphere.prototype.renderDome = function (o, d) { if (this.visible) { let l = this.getDomeRenderElement(o, d), p = Math.atan2(this.renderNormal.y, this.renderNormal.x), @@ -611,11 +610,11 @@ void (window.tempExt = { } }; let g = y.subclass({ - color: "#333", + color: '#333', updateSort: true }); g.prototype.create = function () { - y.prototype.create.apply(this, arguments), this.pathCommands = [new w("move", [{}]), new w("line", [{}])] + y.prototype.create.apply(this, arguments), this.pathCommands = [new w('move', [{}]), new w('line', [{}])] }, g.prototype.render = function (a, e) { this.renderCylinderSurface(a, e), y.prototype.render.apply(this, arguments) }, g.prototype.renderCylinderSurface = function (o, d) { @@ -627,30 +626,30 @@ void (window.tempExt = { this.pathCommands[0].renderPoints[0].set(p.renderOrigin), this.pathCommands[1].renderPoints[0].set(e.renderOrigin), d.renderPath(o, l, this.pathCommands), d.stroke(o, l, true, this.color, a), d.end(o, l) } }, g.prototype.copyGraph = s; - let f = X.subclass(); + let f = ellipse.subclass(); f.prototype.copyGraph = s; - let x = E.subclass({ + let cylinder = custom.subclass({ diameter: 1, length: 1, frontFace: void 0, fill: true }); - x.prototype.create = function () { - E.prototype.create.apply(this, arguments), this.group = new g({ + cylinder.prototype.create = function () { + custom.prototype.create.apply(this, arguments), this.group = new g({ addTo: this, color: this.color, visible: this.visible }); let e = this.length / 2, t = this.backface || true; - this.frontBase = this.group.frontBase = new X({ + this.frontBase = this.group.frontBase = new ellipse({ addTo: this.group, diameter: this.diameter, translate: { z: e }, rotate: { - y: p / 2 + y: tau / 2 }, color: this.color, stroke: this.stroke, @@ -666,10 +665,10 @@ void (window.tempExt = { }, backface: t }) - }, x.prototype.render = function () { - }, ["stroke", "fill", "color", "visible"].forEach(function (e) { - let t = "_" + e; - Object.defineProperty(x.prototype, e, { + }, cylinder.prototype.render = function () { + }, ['stroke', 'fill', 'color', 'visible'].forEach(function (e) { + let t = '_' + e; + Object.defineProperty(cylinder.prototype, e, { get: function () { return this[t] }, @@ -678,22 +677,22 @@ void (window.tempExt = { } }) }); - let F = X.subclass({ + let cone = ellipse.subclass({ length: 1, fill: true }); - F.prototype.create = function () { - X.prototype.create.apply(this, arguments), this.apex = new a({ + cone.prototype.create = function () { + ellipse.prototype.create.apply(this, arguments), this.apex = new anchor({ addTo: this, translate: { z: this.length } - }), this.renderApex = new N, this.renderCentroid = new N, this.tangentA = new N, this.tangentB = new N, this.surfacePathCommands = [new w("move", [{}]), new w("line", [{}]), new w("line", [{}])] - }, F.prototype.updateSortValue = function () { + }), this.renderApex = new vector, this.renderCentroid = new vector, this.tangentA = new vector, this.tangentB = new vector, this.surfacePathCommands = [new w('move', [{}]), new w('line', [{}]), new w('line', [{}])] + }, cone.prototype.updateSortValue = function () { this.renderCentroid.set(this.renderOrigin).lerp(this.apex.renderOrigin, 1 / 3), this.sortValue = this.renderCentroid.z - }, F.prototype.render = function (a, e) { - this.renderConeSurface(a, e), X.prototype.render.apply(this, arguments) - }, F.prototype.renderConeSurface = function (d, l) { + }, cone.prototype.render = function (a, e) { + this.renderConeSurface(a, e), ellipse.prototype.render.apply(this, arguments) + }, cone.prototype.renderConeSurface = function (d, l) { if (this.visible) { this.renderApex.set(this.apex.renderOrigin).subtract(this.renderOrigin); let r = this.renderNormal.magnitude(), @@ -703,7 +702,7 @@ void (window.tempExt = { n = Math.sin(t), i = this.diameter / 2 * r; if (i * n < T) { - let c = Math.atan2(this.renderNormal.y, this.renderNormal.x) + p / 2, + let c = Math.atan2(this.renderNormal.y, this.renderNormal.x) + tau / 2, e = Math.acos(i / (T / n)), t = this.tangentA, a = this.tangentB; @@ -712,33 +711,33 @@ void (window.tempExt = { l.renderPath(d, r, this.surfacePathCommands), l.stroke(d, r, this.stroke, this.color, this.getLineWidth()), l.fill(d, r, this.fill, this.color), l.end(d, r) } } - }, F.prototype.setSurfaceRenderPoint = function (e, t) { + }, cone.prototype.setSurfaceRenderPoint = function (e, t) { let a = this.surfacePathCommands[e].renderPoints[0]; a.set(t) }; - let O = h.subclass(); + let O = rect.subclass(); O.prototype.copyGraph = function () { }; - let W = ["frontFace", "rearFace", "leftFace", "rightFace", "topFace", "bottomFace"], - Z = n({}, E.defaults); + let W = ['frontFace', 'rearFace', 'leftFace', 'rightFace', 'topFace', 'bottomFace'], + Z = extend({}, custom.defaults); delete Z.path, W.forEach(function (e) { Z[e] = true - }), n(Z, { + }), extend(Z, { width: 1, height: 1, depth: 1, fill: true }); - let C = a.subclass(Z); - return C.prototype.create = function (e) { - a.prototype.create.call(this, e), this.updatePath(), this.fill = this.fill - }, C.prototype.updatePath = function () { + let box = anchor.subclass(Z); + return box.prototype.create = function (e) { + anchor.prototype.create.call(this, e), this.updatePath(), this.fill = this.fill + }, box.prototype.updatePath = function () { W.forEach(function (e) { this[e] = this[e] }, this) }, W.forEach(function (e) { - let t = "_" + e; - Object.defineProperty(C.prototype, e, { + let t = '_' + e; + Object.defineProperty(box.prototype, e, { get: function () { return this[t] }, @@ -746,13 +745,13 @@ void (window.tempExt = { this[t] = a, this.setFace(e, a) } }) - }), C.prototype.setFace = function (t, a) { - let r = t + "Rect", + }), box.prototype.setFace = function (t, a) { + let r = t + 'Rect', o = this[r]; if (!a) return void this.removeChild(o); let d = this.getFaceOptions(t); - d.color = "string" == typeof a ? a : this.color, o ? o.setOptions(d) : o = this[r] = new O(d), o.updatePath(), this.addChild(o) - }, C.prototype.getFaceOptions = function (t) { + d.color = 'string' == typeof a ? a : this.color, o ? o.setOptions(d) : o = this[r] = new O(d), o.updatePath(), this.addChild(o) + }, box.prototype.getFaceOptions = function (t) { return { frontFace: { width: this.width, @@ -768,7 +767,7 @@ void (window.tempExt = { z: -this.depth / 2 }, rotate: { - y: p / 2 + y: tau / 2 } }, leftFace: { @@ -778,7 +777,7 @@ void (window.tempExt = { x: -this.width / 2 }, rotate: { - y: -p / 4 + y: -tau / 4 } }, rightFace: { @@ -788,7 +787,7 @@ void (window.tempExt = { x: this.width / 2 }, rotate: { - y: p / 4 + y: tau / 4 } }, topFace: { @@ -798,7 +797,7 @@ void (window.tempExt = { y: -this.height / 2 }, rotate: { - x: -p / 4 + x: -tau / 4 } }, bottomFace: { @@ -808,860 +807,884 @@ void (window.tempExt = { y: this.height / 2 }, rotate: { - x: p / 4 + x: tau / 4 } } } [t] - }, ["color", "stroke", "fill", "backface", "front", "visible"].forEach(function (t) { - let a = "_" + t; - Object.defineProperty(C.prototype, t, { + }, ['color', 'stroke', 'fill', 'backface', 'front', 'visible'].forEach(function (t) { + let a = '_' + t; + Object.defineProperty(box.prototype, t, { get: function () { return this[a] }, set: function (l) { this[a] = l, W.forEach(function (a) { - let r = this[a + "Rect"], - o = "string" == typeof this[a]; - r && !("color" === t && o) && (r[t] = l) + let r = this[a + 'Rect'], + o = 'string' == typeof this[a]; + r && !('color' === t && o) && (r[t] = l) }, this) } }) }), { - init: G, - custom: E, - rect: h, - roundedRect: U, - ellipse: X, - polygon: z, - hemisphere: b, - cylinder: x, - cone: F, - box: C + init: args => new init(args), + createCustom: args => new custom(args), + createRect: args => new rect(args), + createRoundedRect: args => new roundedRect(args), + createEllipse: args => new ellipse(args), + createPolygon: args => new polygon(args), + createHemisphere: args => new hemisphere(args), + createCylinder: args => new cylinder(args), + createCone: args => new cone(args), + createBox: args => new box(args) } - }(), (null === this.canvas() || null === this.cubeParent()) && console.error("[Cube]无法定位到舞台"), (() => { - if (null !== this.canvas() && null !== this.cubeParent()) { - let t = document.createElement("canvas"); - t.setAttribute("id", "Cube"), t.setAttribute("width", this.canvas().style.width), t.setAttribute("height", this.canvas().style.height); + }(), (null === this.canvas()) && console.error('Cube: 无法定位到舞台'), (() => { + if (null !== this.canvas() && null !== this.parentElement()) { + let id = 'cube_' + Math.floor(16777215 * Math.random()).toString(16); + let t = document.createElement('canvas'); + t.setAttribute('id', id), t.setAttribute('width', this.canvas().style.width), t.setAttribute('height', this.canvas().style.height); let a = t.style; - a.position = "absolute", a.left = "0%", a.top = "0%", a.pointerEvents = "none", this.cubeParent().appendChild(t), this.cubeScene = new this.Cube.init({ - element: document.getElementById("Cube") + a.position = 'absolute', a.left = '0%', a.top = '0%', a.pointerEvents = 'none', this.parentElement().appendChild(t), this.stage = this.renderer.init({ + element: document.getElementById(id) }), new MutationObserver(() => { - if (document.getElementById("Cube") == null) this.cubeParent().appendChild(t) + if (document.getElementById(id) == null) this.parentElement().appendChild(t) }).observe(document.body, { childList: true, subtree: true }), new MutationObserver(() => { - for (let a in t.setAttribute("width", this.canvas().style.width), t.setAttribute("height", this.canvas().style.height), this.cubeScene = new this.Cube.init({ - element: document.getElementById("Cube") - }), this.objectList) this.cubeScene.addChild(this.objectList[a]); - this.cubeScene.updateRenderGraph() + for (let a in t.setAttribute('width', this.canvas().style.width), t.setAttribute('height', this.canvas().style.height), this.cubeScene = this.renderer.init({ + element: document.getElementById(id) + }), this.instances) this.stage.addChild(this.instances[a]); + this.stage.updateRenderGraph() }).observe(this.canvas(), { attributes: true }) } })(); - window.cube = () => this.runtime; this._formatMessage = e.getFormatMessage({ - "zh-cn": { - "Cube.name": "LazyTong的立方体", - "Cube.createRect": "创建或修改一个矩形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]大小[stroke]%", - "Cube.createRoundedRect": "创建或修改一个圆角矩形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]边角弧度[radius]大小[stroke]%", - "Cube.createCircle": "创建或修改一个圆形并命名为[id],X[x]Y[y]Z[z]颜色[color]半径[diameter]完整性[quarters]", - "Cube.createEllipse": "创建或修改一个椭圆形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]大小[stroke]%", - "Cube.createPolygon": "创建或修改一个[sides]边形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]边角弧度[radius]大小[stroke]%", - "Cube.createHemisphere": "创建或修改一个半圆并命名为[id],X[x]Y[y]Z[z]颜色[color]地面颜色[backface]半径[diameter]大小[stroke]%", - "Cube.createCone": "创建或修改一个圆锥体并命名为[id],X[x]Y[y]Z[z]颜色[color]地面颜色[backface]长度[length]半径[diameter]大小[stroke]%", - "Cube.createCylinder": "创建或修改一个圆柱体并命名为[id],X[x]Y[y]Z[z]颜色[color]顶部颜色[frontface]地面颜色[backface]长度[length]大小[stroke]%", - "Cube.createBox": "创建或修改一个立方体并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]尺寸[depth]颜色[color]左侧颜色[leftface]右侧颜色[rightface]顶部颜色[topface]地面颜色[bottomface]大小[stroke]%", - "Cube.createCustom": "创建或修改一个[closed]自定义模型并命名为[id],X[x]Y[y]Z[z]颜色[color]节点位置[path]节点大小[stroke]%", - "Cube.deleteObject": "删除物体[id]", - "Cube.getAttrib": "物体[id]的[type]", - "Cube.deleteAllObject": "删除所有物体", - "Cube.getObjectNumbers": "物体总数", - "Cube.getObjectList": "物体ID列表", - "Cube.x": "X", - "Cube.y": "Y", - "Cube.z": "Z", - "Cube.width": "宽度", - "Cube.height": "高度", - "Cube.color": "颜色", - "Cube.stroke": "大小", - "Cube.quarters": "完整性", - "Cube.cornerRadius": "边角弧度", - "Cube.radius": "弧度", - "Cube.setRotate": "设置物体[id]在[type]上旋转[rotate]度", - "Cube.updateRender": "渲染当前设置的物体", - "Cube.docs": "拓展教程", - "Cube.create": "创建物体", - "Cube.modify": "修改物体", - "Cube.info": "信息", - "Cube.fileListEmpty": "无文件", - "Cube.open": "开放的", - "Cube.closed": "闭合的" + 'zh-cn': { + 'Cube.name': 'LazyTong的立方体', + 'Cube.createRect': '创建或修改一个矩形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]大小[stroke]%', + 'Cube.createRoundedRect': '创建或修改一个圆角矩形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]边角弧度[radius]大小[stroke]%', + 'Cube.createCircle': '创建或修改一个圆形并命名为[id],X[x]Y[y]Z[z]颜色[color]半径[diameter]完整性[quarters]', + 'Cube.createEllipse': '创建或修改一个椭圆形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]大小[stroke]%', + 'Cube.createPolygon': '创建或修改一个[sides]边形并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]颜色[color]边角弧度[radius]大小[stroke]%', + 'Cube.createHemisphere': '创建或修改一个半圆并命名为[id],X[x]Y[y]Z[z]颜色[color]地面颜色[backface]半径[diameter]大小[stroke]%', + 'Cube.createCone': '创建或修改一个圆锥体并命名为[id],X[x]Y[y]Z[z]颜色[color]地面颜色[backface]长度[length]半径[diameter]大小[stroke]%', + 'Cube.createCylinder': '创建或修改一个圆柱体并命名为[id],X[x]Y[y]Z[z]颜色[color]顶部颜色[frontface]地面颜色[backface]长度[length]大小[stroke]%', + 'Cube.createBox': '创建或修改一个立方体并命名为[id],X[x]Y[y]Z[z]宽[width]高[height]尺寸[depth]颜色[color]左侧颜色[leftface]右侧颜色[rightface]顶部颜色[topface]地面颜色[bottomface]大小[stroke]%', + 'Cube.createCustom': '创建或修改一个[closed]自定义模型并命名为[id],X[x]Y[y]Z[z]颜色[color]节点位置[path]节点大小[stroke]%', + 'Cube.deleteObject': '删除物体[id]', + 'Cube.getAttrib': '物体[id]的[type]', + 'Cube.deleteAllObject': '删除所有物体', + 'Cube.getObjectNumbers': '物体总数', + 'Cube.getObjectList': '物体ID列表', + 'Cube.x': 'X', + 'Cube.y': 'Y', + 'Cube.z': 'Z', + 'Cube.rotateX': '在X上旋转的角度', + 'Cube.rotateY': '在Y上旋转的角度', + 'Cube.rotateZ': '在Z上旋转的角度', + 'Cube.width': '宽度', + 'Cube.height': '高度', + 'Cube.color': '颜色', + 'Cube.stroke': '大小', + 'Cube.quarters': '完整性', + 'Cube.cornerRadius': '边角弧度', + 'Cube.radius': '弧度', + 'Cube.setRotate': '设置物体[id]在[type]上旋转[rotate]度', + 'Cube.updateRender': '渲染当前设置的物体', + 'Cube.docs': '拓展教程', + 'Cube.refreshBlocks': '刷新积木', + 'Cube.create': '创建物体', + 'Cube.modify': '修改物体', + 'Cube.info': '信息', + 'Cube.fileListEmpty': '无文件', + 'Cube.open': '开放的', + 'Cube.closed': '闭合的' }, en: { - "Cube.name": "LazyTong's Cube", - "Cube.createRect": "Create or Modify a Rectangle named[id], X[x]Y[y]Z[z]Width[width]Height[height]Color[color]Stroke[stroke]%", - "Cube.createRoundedRect": "Create or Modify a Rounded Rectangle named[id], X[x]Y[y]Z[z]Width[width]Height[height]Color[color]Corner Radius[radius]Stroke[stroke]%", - "Cube.createCircle": "Create or Modify a Circle named[id], X[x]Y[y]Z[z]Color[color]Diameter[diameter]Quarters[quarters]", - "Cube.createEllipse": "Create or Modify an Ellipse named[id], X[x]Y[y]Z[z]Width[width]Height[height]Color[color]Stroke[stroke]%", - "Cube.createPolygon": "Create or Modify a[sides]Polygon named[id], X[x]Y[y]Z[z]Width[width]Height[height]Color[color]Corner Radius[radius]Stroke[stroke]%", - "Cube.createHemisphere": "Create or Modify a Hemisphere named[id], X[x]Y[y]Z[z]Color[color]Backface Color[backface]Diameter[diameter]Stroke[stroke]%", - "Cube.createCone": "Create or Modify a Cone named[id], X[x]Y[y]Z[z]Color[color]Backface Color[backface]Length[length]Diameter[diameter]Stroke[stroke]%", - "Cube.createCylinder": "Create or Modify a Cylinder named[id], X[x]Y[y]Z[z] Color[color]Frontface Color[frontface]Backface Color[backface]Length[length]Stroke[stroke]%", - "Cube.createBox": "Create or Modify a Box named[id], X[x]Y[y]Z[z] Width[width] Height[height] Depth[depth] Color[color] Leftface Color[leftface] Rightface Color[rightface] Topface Color[topface] Bottomface Color[bottomface] Stroke[stroke]%", - "Cube.createCustom": "Create or Modify a[closed]Custom Model named[id], X[x]Y[y]Z[z] Color[color] Path[path] Stroke[stroke]%", - "Cube.deleteObject": "Delete Object[id]", - "Cube.getAttrib": "Get[type]of Object[id]", - "Cube.deleteAllObject": "Delete All Objects", - "Cube.getObjectNumbers": "Number of Objects", - "Cube.getObjectList": "List of Object IDs", - "Cube.x": "X", - "Cube.y": "Y", - "Cube.z": "Z", - "Cube.width": "width", - "Cube.height": "height", - "Cube.color": "color", - "Cube.stroke": "stroke", - "Cube.quarters": "quarters", - "Cube.cornerRadius": "corner radius", - "Cube.radius": "radius", - "Cube.setRotate": "Set the object[id]to rotate[rotate]degrees on[type]", - "Cube.updateRender": "Update Render with Current Object Settings", - "Cube.docs": "Extended Tutorial", - "Cube.create": "Creating objects", - "Cube.modify": "Modifying objects", - "Cube.info": "Information", - "Cube.fileListEmpty": "no file", - "Cube.open": "open", - "Cube.closed": "closed" + 'Cube.name': "LazyTong's Cube", + 'Cube.createRect': 'Create or Modify a Rectangle named[id], X[x]Y[y]Z[z]Width[width]Height[height]Color[color]Stroke[stroke]%', + 'Cube.createRoundedRect': 'Create or Modify a Rounded Rectangle named[id], X[x]Y[y]Z[z]Width[width]Height[height]Color[color]Corner Radius[radius]Stroke[stroke]%', + 'Cube.createCircle': 'Create or Modify a Circle named[id], X[x]Y[y]Z[z]Color[color]Diameter[diameter]Quarters[quarters]', + 'Cube.createEllipse': 'Create or Modify an Ellipse named[id], X[x]Y[y]Z[z]Width[width]Height[height]Color[color]Stroke[stroke]%', + 'Cube.createPolygon': 'Create or Modify a[sides]Polygon named[id], X[x]Y[y]Z[z]Width[width]Height[height]Color[color]Corner Radius[radius]Stroke[stroke]%', + 'Cube.createHemisphere': 'Create or Modify a Hemisphere named[id], X[x]Y[y]Z[z]Color[color]Backface Color[backface]Diameter[diameter]Stroke[stroke]%', + 'Cube.createCone': 'Create or Modify a Cone named[id], X[x]Y[y]Z[z]Color[color]Backface Color[backface]Length[length]Diameter[diameter]Stroke[stroke]%', + 'Cube.createCylinder': 'Create or Modify a Cylinder named[id], X[x]Y[y]Z[z] Color[color]Frontface Color[frontface]Backface Color[backface]Length[length]Stroke[stroke]%', + 'Cube.createBox': 'Create or Modify a Box named[id], X[x]Y[y]Z[z] Width[width] Height[height] Depth[depth] Color[color] Leftface Color[leftface] Rightface Color[rightface] Topface Color[topface] Bottomface Color[bottomface] Stroke[stroke]%', + 'Cube.createCustom': 'Create or Modify a[closed]Custom Model named[id], X[x]Y[y]Z[z] Color[color] Path[path] Stroke[stroke]%', + 'Cube.deleteObject': 'Delete Object[id]', + 'Cube.getAttrib': 'Get[type]of Object[id]', + 'Cube.deleteAllObject': 'Delete All Objects', + 'Cube.getObjectNumbers': 'Number of Objects', + 'Cube.getObjectList': 'List of Object IDs', + 'Cube.x': 'X', + 'Cube.y': 'Y', + 'Cube.z': 'Z', + 'Cube.rotateX': 'the angle of rotation on X', + 'Cube.rotateY': 'the angle of rotation on Y', + 'Cube.rotateZ': 'the angle of rotation on Z', + 'Cube.width': 'width', + 'Cube.height': 'height', + 'Cube.color': 'color', + 'Cube.stroke': 'stroke', + 'Cube.quarters': 'quarters', + 'Cube.cornerRadius': 'corner radius', + 'Cube.radius': 'radius', + 'Cube.setRotate': 'Set the object[id]to rotate[rotate]degrees on[type]', + 'Cube.updateRender': 'Update Render with Current Object Settings', + 'Cube.docs': 'Extended Tutorial', + 'Cube.refreshBlocks': 'Refresh blocks', + 'Cube.create': 'Creating objects', + 'Cube.modify': 'Modifying objects', + 'Cube.info': 'Information', + 'Cube.fileListEmpty': 'no file', + 'Cube.open': 'open', + 'Cube.closed': 'closed' } }) } - formatMessage(e) { + formatMessage(args) { return this._formatMessage({ - id: e, - default: e, - description: e + id: args, + default: args, + description: args }) } getInfo() { + let id = 'cube_' + Math.floor(16777215 * Math.random()).toString(16); return { - id: "LazyTong.Cube", - name: this.formatMessage("Cube.name"), + id: 'LazyTong.Cube', + name: this.formatMessage('Cube.name'), blockIconURI: t, menuIconURI: t, - color1: "#33cc33", - color2: "#669900", + color1: '#33cc33', + color2: '#669900', blocks: [{ - blockType: "button", - text: this.formatMessage("Cube.docs"), + blockType: 'button', + text: this.formatMessage('Cube.docs'), onClick: this.docs - }, `---${this.formatMessage("Cube.create")}`, { - opcode: "createRect", - blockType: "command", - text: this.formatMessage("Cube.createRect"), + }, { + blockType: 'button', + text: this.formatMessage('Cube.refreshBlocks'), + onClick: () => { + this.runtime.extensionManager.refreshBlocks() + } + }, `---${this.formatMessage('Cube.create')}`, { + opcode: 'createRect', + blockType: 'command', + text: this.formatMessage('Cube.createRect'), arguments: { id: { - type: "string", - defaultValue: "lazytong" + type: 'string', + defaultValue: id }, x: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, y: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, z: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, width: { - type: "number", - defaultValue: "100" + type: 'number', + defaultValue: '100' }, height: { - type: "number", - defaultValue: "20" + type: 'number', + defaultValue: '20' }, color: { - type: "color", - defaultValue: "#33cc33" + type: 'color', + defaultValue: '#33cc33' }, stroke: { - type: "number", - defaultValue: "100" + type: 'number', + defaultValue: '100' } } }, { - opcode: "createRoundedRect", - blockType: "command", - text: this.formatMessage("Cube.createRoundedRect"), + opcode: 'createRoundedRect', + blockType: 'command', + text: this.formatMessage('Cube.createRoundedRect'), arguments: { id: { - type: "string", - defaultValue: "lazytong" + type: 'string', + defaultValue: id }, x: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, y: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, z: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, width: { - type: "number", - defaultValue: "100" + type: 'number', + defaultValue: '100' }, height: { - type: "number", - defaultValue: "20" + type: 'number', + defaultValue: '20' }, color: { - type: "color", - defaultValue: "#33cc33" + type: 'color', + defaultValue: '#33cc33' }, radius: { - type: "number", - defaultValue: "1" + type: 'number', + defaultValue: '1' }, stroke: { - type: "number", - defaultValue: "100" + type: 'number', + defaultValue: '100' } } }, { - opcode: "createCircle", - blockType: "command", - text: this.formatMessage("Cube.createCircle"), + opcode: 'createCircle', + blockType: 'command', + text: this.formatMessage('Cube.createCircle'), arguments: { id: { - type: "string", - defaultValue: "lazytong" + type: 'string', + defaultValue: id }, x: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, y: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, z: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, diameter: { - type: "number", - defaultValue: "50" + type: 'number', + defaultValue: '50' }, quarters: { - type: "number", - defaultValue: "4" + type: 'number', + defaultValue: '4' }, color: { - type: "color", - defaultValue: "#33cc33" + type: 'color', + defaultValue: '#33cc33' }, stroke: { - type: "number", - defaultValue: "100" + type: 'number', + defaultValue: '100' } } }, { - opcode: "createEllipse", - blockType: "command", - text: this.formatMessage("Cube.createEllipse"), + opcode: 'createEllipse', + blockType: 'command', + text: this.formatMessage('Cube.createEllipse'), arguments: { id: { - type: "string", - defaultValue: "lazytong" + type: 'string', + defaultValue: id }, x: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, y: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, z: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, width: { - type: "number", - defaultValue: "100" + type: 'number', + defaultValue: '100' }, height: { - type: "number", - defaultValue: "20" + type: 'number', + defaultValue: '20' }, color: { - type: "color", - defaultValue: "#33cc33" + type: 'color', + defaultValue: '#33cc33' }, stroke: { - type: "number", - defaultValue: "100" + type: 'number', + defaultValue: '100' } } }, { - opcode: "createPolygon", - blockType: "command", - text: this.formatMessage("Cube.createPolygon"), + opcode: 'createPolygon', + blockType: 'command', + text: this.formatMessage('Cube.createPolygon'), arguments: { id: { - type: "string", - defaultValue: "lazytong" + type: 'string', + defaultValue: id }, x: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, y: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, z: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, width: { - type: "number", - defaultValue: "100" + type: 'number', + defaultValue: '100' }, height: { - type: "number", - defaultValue: "20" + type: 'number', + defaultValue: '20' }, color: { - type: "color", - defaultValue: "#33cc33" + type: 'color', + defaultValue: '#33cc33' }, sides: { - type: "number", - defaultValue: "3" + type: 'number', + defaultValue: '3' }, radius: { - type: "number", - defaultValue: "1" + type: 'number', + defaultValue: '1' }, stroke: { - type: "number", - defaultValue: "100" + type: 'number', + defaultValue: '100' } } }, { - opcode: "createHemisphere", - blockType: "command", - text: this.formatMessage("Cube.createHemisphere"), + opcode: 'createHemisphere', + blockType: 'command', + text: this.formatMessage('Cube.createHemisphere'), arguments: { id: { - type: "string", - defaultValue: "lazytong" + type: 'string', + defaultValue: id }, x: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, y: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, z: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, diameter: { - type: "number", - defaultValue: "50" + type: 'number', + defaultValue: '50' }, backface: { - type: "color", - defaultValue: "#33cc33" + type: 'color', + defaultValue: '#33cc33' }, color: { - type: "color", - defaultValue: "#33cc33" + type: 'color', + defaultValue: '#33cc33' }, stroke: { - type: "number", - defaultValue: "100" + type: 'number', + defaultValue: '100' } } }, { - opcode: "createCone", - blockType: "command", - text: this.formatMessage("Cube.createCone"), + opcode: 'createCone', + blockType: 'command', + text: this.formatMessage('Cube.createCone'), arguments: { id: { - type: "string", - defaultValue: "lazytong" + type: 'string', + defaultValue: id }, x: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, y: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, z: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, length: { - type: "number", - defaultValue: "50" + type: 'number', + defaultValue: '50' }, diameter: { - type: "number", - defaultValue: "50" + type: 'number', + defaultValue: '50' }, color: { - type: "color", - defaultValue: "#33cc33" + type: 'color', + defaultValue: '#33cc33' }, backface: { - type: "color", - defaultValue: "#33cc33" + type: 'color', + defaultValue: '#33cc33' }, stroke: { - type: "number", - defaultValue: "100" + type: 'number', + defaultValue: '100' } } }, { - opcode: "createCylinder", - blockType: "command", - text: this.formatMessage("Cube.createCylinder"), + opcode: 'createCylinder', + blockType: 'command', + text: this.formatMessage('Cube.createCylinder'), arguments: { id: { - type: "string", - defaultValue: "lazytong" + type: 'string', + defaultValue: id }, x: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, y: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, z: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, length: { - type: "number", - defaultValue: "50" + type: 'number', + defaultValue: '50' }, color: { - type: "color", - defaultValue: "#33cc33" + type: 'color', + defaultValue: '#33cc33' }, frontface: { - type: "color", - defaultValue: "#33cc33" + type: 'color', + defaultValue: '#33cc33' }, backface: { - type: "color", - defaultValue: "#33cc33" + type: 'color', + defaultValue: '#33cc33' }, stroke: { - type: "number", - defaultValue: "100" + type: 'number', + defaultValue: '100' } } }, { - opcode: "createBox", - blockType: "command", - text: this.formatMessage("Cube.createBox"), + opcode: 'createBox', + blockType: 'command', + text: this.formatMessage('Cube.createBox'), arguments: { id: { - type: "string", - defaultValue: "lazytong" + type: 'string', + defaultValue: id }, x: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, y: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, z: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, width: { - type: "number", - defaultValue: "100" + type: 'number', + defaultValue: '100' }, height: { - type: "number", - defaultValue: "20" + type: 'number', + defaultValue: '20' }, depth: { - type: "number", - defaultValue: "50" + type: 'number', + defaultValue: '50' }, color: { - type: "color", - defaultValue: "#33cc33" + type: 'color', + defaultValue: '#33cc33' }, leftface: { - type: "color", - defaultValue: "#33cc33" + type: 'color', + defaultValue: '#33cc33' }, rightface: { - type: "color", - defaultValue: "#33cc33" + type: 'color', + defaultValue: '#33cc33' }, topface: { - type: "color", - defaultValue: "#33cc33" + type: 'color', + defaultValue: '#33cc33' }, bottomface: { - type: "color", - defaultValue: "#33cc33" + type: 'color', + defaultValue: '#33cc33' }, stroke: { - type: "number", - defaultValue: "100" + type: 'number', + defaultValue: '100' } } }, { - opcode: "createCustom", - blockType: "command", - text: this.formatMessage("Cube.createCustom"), + opcode: 'createCustom', + blockType: 'command', + text: this.formatMessage('Cube.createCustom'), arguments: { id: { - type: "string", - defaultValue: "lazytong" + type: 'string', + defaultValue: id }, closed: { - type: "boolean", - menu: "closed" + type: 'boolean', + menu: 'closed' }, x: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, y: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, z: { - type: "number", - defaultValue: "0" + type: 'number', + defaultValue: '0' }, color: { - type: "color", - defaultValue: "#33cc33" + type: 'color', + defaultValue: '#33cc33' }, path: { - type: "string", - menu: "files" + type: 'string', + menu: 'files' }, stroke: { - type: "number", - defaultValue: "100" + type: 'number', + defaultValue: '100' } } - }, `---${this.formatMessage("Cube.modify")}`, { - opcode: "deleteObject", - blockType: "command", - text: this.formatMessage("Cube.deleteObject"), + }, `---${this.formatMessage('Cube.modify')}`, { + opcode: 'deleteObject', + blockType: 'command', + text: this.formatMessage('Cube.deleteObject'), arguments: { id: { - type: "string", - defaultValue: "lazytong" + type: 'string', + defaultValue: id } } }, { - opcode: "deleteAllObject", - blockType: "command", - text: this.formatMessage("Cube.deleteAllObject"), + opcode: 'deleteAllObject', + blockType: 'command', + text: this.formatMessage('Cube.deleteAllObject'), arguments: {} }, { - opcode: "setRotate", - blockType: "command", - text: this.formatMessage("Cube.setRotate"), + opcode: 'setRotate', + blockType: 'command', + text: this.formatMessage('Cube.setRotate'), arguments: { id: { - type: "string", - defaultValue: "lazytong" + type: 'string', + defaultValue: id }, type: { - type: "string", - menu: "rotate" + type: 'string', + menu: 'rotate' }, rotate: { - type: "number", - defaultValue: "10" + type: 'angle', + defaultValue: '10' } } }, { - opcode: "updateRender", - blockType: "command", - text: this.formatMessage("Cube.updateRender"), + opcode: 'updateRender', + blockType: 'command', + text: this.formatMessage('Cube.updateRender'), arguments: {} - }, `---${this.formatMessage("Cube.info")}`, { - opcode: "getAttrib", - blockType: "reporter", - text: this.formatMessage("Cube.getAttrib"), + }, `---${this.formatMessage('Cube.info')}`, { + opcode: 'getAttrib', + blockType: 'reporter', + text: this.formatMessage('Cube.getAttrib'), arguments: { id: { - type: "string", - defaultValue: "lazytong" + type: 'string', + defaultValue: id }, type: { - type: "string", - menu: "attrib" + type: 'string', + menu: 'attrib' } } }, { - opcode: "getObjectList", - blockType: "reporter", - text: this.formatMessage("Cube.getObjectList"), + opcode: 'getObjectList', + blockType: 'reporter', + text: this.formatMessage('Cube.getObjectList'), arguments: {} }, { - opcode: "getObjectNumbers", - blockType: "reporter", - text: this.formatMessage("Cube.getObjectNumbers"), + opcode: 'getObjectNumbers', + blockType: 'reporter', + text: this.formatMessage('Cube.getObjectNumbers'), arguments: {} }], menus: { attrib: [{ - text: this.formatMessage("Cube.x"), - value: "x" + text: this.formatMessage('Cube.x'), + value: 'x' + }, { + text: this.formatMessage('Cube.y'), + value: 'y' + }, { + text: this.formatMessage('Cube.z'), + value: 'z' + }, { + text: this.formatMessage('Cube.rotateX'), + value: 'rotateX' }, { - text: this.formatMessage("Cube.y"), - value: "y" + text: this.formatMessage('Cube.rotateY'), + value: 'rotateY' }, { - text: this.formatMessage("Cube.z"), - value: "z" + text: this.formatMessage('Cube.rotateZ'), + value: 'rotateZ' }, { - text: this.formatMessage("Cube.width"), - value: "width" + text: this.formatMessage('Cube.width'), + value: 'width' }, { - text: this.formatMessage("Cube.height"), - value: "height" + text: this.formatMessage('Cube.height'), + value: 'height' }, { - text: this.formatMessage("Cube.stroke"), - value: "stroke" + text: this.formatMessage('Cube.stroke'), + value: 'stroke' }, { - text: this.formatMessage("Cube.color"), - value: "color" + text: this.formatMessage('Cube.color'), + value: 'color' }, { - text: this.formatMessage("Cube.quarters"), - value: "quarters" + text: this.formatMessage('Cube.quarters'), + value: 'quarters' }, { - text: this.formatMessage("Cube.cornerRadius"), - value: "cornerRadius" + text: this.formatMessage('Cube.cornerRadius'), + value: 'cornerRadius' }, { - text: this.formatMessage("Cube.radius"), - value: "radius" + text: this.formatMessage('Cube.radius'), + value: 'radius' }], closed: [{ - text: this.formatMessage("Cube.open"), + text: this.formatMessage('Cube.open'), value: false }, { - text: this.formatMessage("Cube.closed"), + text: this.formatMessage('Cube.closed'), value: true }], files: { acceptReporters: true, items: (() => { try { - const e = this.runtime.getGandiAssetsFileList("json").map(e => ({ + const e = this.runtime.getGandiAssetsFileList('json').map(e => ({ text: e.fullName, value: e.id })); return 1 > e.length ? [{ - text: this.formatMessage("Cube.fileListEmpty"), - value: "fileListEmpty" + text: this.formatMessage('Cube.fileListEmpty'), + value: 'fileListEmpty' }] : e } catch (e) { return [{ - text: this.formatMessage("Cube.fileListEmpty"), - value: "fileListEmpty" + text: this.formatMessage('Cube.fileListEmpty'), + value: 'fileListEmpty' }] } })() }, rotate: [{ - text: this.formatMessage("Cube.x"), - value: "x" + text: this.formatMessage('Cube.x'), + value: 'x' }, { - text: this.formatMessage("Cube.y"), - value: "y" + text: this.formatMessage('Cube.y'), + value: 'y' }, { - text: this.formatMessage("Cube.z"), - value: "z" + text: this.formatMessage('Cube.z'), + value: 'z' }] } } } docs() { - let e = document.createElement("a"); - e.href = "https://lt.js.org/posts/3ad4f6", e.rel = "noopener noreferrer", e.target = "_blank", e.click() + let e = document.createElement('a'); + e.href = 'https://lt.js.org/posts/3ad4f6', e.rel = 'noopener noreferrer', e.target = '_blank', e.click() } - createRect(e) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.rect({ - width: +e.width, - height: +e.height, - stroke: +e.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + createRect(args) { + null !== this.canvas() && null !== this.parentElement() && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createRect({ + width: +args.width, + height: +args.height, + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), translate: { - x: +e.x, - y: +e.y, - z: +e.z + x: +args.x, + y: +args.y, + z: +args.z } - }), this.cubeScene.addChild(this.objectList[e.id])) + }), this.stage.addChild(this.instances[args.id])) } - createRoundedRect(e) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.roundedRect({ - width: +e.width, - height: +e.height, - stroke: +e.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - cornerRadius: +e.radius, + createRoundedRect(args) { + null !== this.canvas() && null !== this.parentElement() && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createRoundedRect({ + width: +args.width, + height: +args.height, + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + cornerRadius: +args.radius, translate: { - x: +e.x, - y: +e.y, - z: +e.z + x: +args.x, + y: +args.y, + z: +args.z } - }), this.cubeScene.addChild(this.objectList[e.id])) + }), this.stage.addChild(this.instances[args.id])) } - createCircle(e) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.ellipse({ - stroke: +e.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - diameter: +e.diameter, + createCircle(args) { + null !== this.canvas() && null !== this.parentElement() && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createEllipse({ + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + diameter: +args.diameter, translate: { - x: +e.x, - y: +e.y, - z: +e.z + x: +args.x, + y: +args.y, + z: +args.z }, - quarters: +e.quarters - }), this.cubeScene.addChild(this.objectList[e.id])) + quarters: +args.quarters + }), this.stage.addChild(this.instances[args.id])) } - createEllipse(e) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.ellipse({ - width: +e.width, - height: +e.height, - stroke: +e.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + createEllipse(args) { + null !== this.canvas() && null !== this.parentElement() && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createEllipse({ + width: +args.width, + height: +args.height, + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), translate: { - x: +e.x, - y: +e.y, - z: +e.z + x: +args.x, + y: +args.y, + z: +args.z }, - quarters: +e.quarters - }), this.cubeScene.addChild(this.objectList[e.id])) + quarters: +args.quarters + }), this.stage.addChild(this.instances[args.id])) } - createPolygon(e) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.polygon({ - sides: +e.sides, - radius: +e.sides, - stroke: +e.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + createPolygon(args) { + null !== this.canvas() && null !== this.parentElement() && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createPolygon({ + sides: +args.sides, + radius: +args.sides, + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), translate: { - x: +e.x, - y: +e.y, - z: +e.z + x: +args.x, + y: +args.y, + z: +args.z } - }), this.cubeScene.addChild(this.objectList[e.id])) + }), this.stage.addChild(this.instances[args.id])) } - createHemisphere(e) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.hemisphere({ - diameter: +e.diameter, - stroke: +e.stroke / 100, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - backface: (() => /^#([0-9a-f]{6})$/i.test(e.backface) ? e.backface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + createHemisphere(args) { + null !== this.canvas() && null !== this.parentElement() && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createHemisphere({ + diameter: +args.diameter, + stroke: +args.stroke / 100, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + backface: (() => /^#([0-9a-f]{6})$/i.test(args.backface) ? args.backface : '#' + Math.floor(16777215 * Math.random()).toString(16))(), translate: { - x: +e.x, - y: +e.y, - z: +e.z + x: +args.x, + y: +args.y, + z: +args.z } - }), this.cubeScene.addChild(this.objectList[e.id])) + }), this.stage.addChild(this.instances[args.id])) } - createCone(e) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.cone({ - diameter: +e.diameter, - stroke: +e.stroke / 100, - length: +e.length, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - backface: (() => /^#([0-9a-f]{6})$/i.test(e.backface) ? e.backface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + createCone(args) { + null !== this.canvas() && null !== this.parentElement() && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createCone({ + diameter: +args.diameter, + stroke: +args.stroke / 100, + length: +args.length, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + backface: (() => /^#([0-9a-f]{6})$/i.test(args.backface) ? args.backface : '#' + Math.floor(16777215 * Math.random()).toString(16))(), translate: { - x: +e.x, - y: +e.y, - z: +e.z + x: +args.x, + y: +args.y, + z: +args.z } - }), this.cubeScene.addChild(this.objectList[e.id])) + }), this.stage.addChild(this.instances[args.id])) } - createCylinder(e) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.cylinder({ - diameter: +e.diameter, - stroke: +e.stroke / 100, - length: +e.length, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - backface: (() => /^#([0-9a-f]{6})$/i.test(e.backface) ? e.backface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - frontFace: (() => /^#([0-9a-f]{6})$/i.test(e.frontface) ? e.frontface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + createCylinder(args) { + null !== this.canvas() && null !== this.parentElement() && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createCylinder({ + diameter: +args.diameter, + stroke: +args.stroke / 100, + length: +args.length, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + backface: (() => /^#([0-9a-f]{6})$/i.test(args.backface) ? args.backface : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + frontFace: (() => /^#([0-9a-f]{6})$/i.test(args.frontface) ? args.frontface : '#' + Math.floor(16777215 * Math.random()).toString(16))(), translate: { - x: +e.x, - y: +e.y, - z: +e.z + x: +args.x, + y: +args.y, + z: +args.z } - }), this.cubeScene.addChild(this.objectList[e.id])) + }), this.stage.addChild(this.instances[args.id])) } - createBox(e) { - null !== this.canvas() && null !== this.cubeParent() && (void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0), this.objectList[e.id] = new this.Cube.box({ - width: +e.width, - height: +e.height, - depth: +e.depth, - stroke: +e.stroke / 100, - length: +e.length, - color: (() => /^#([0-9a-f]{6})$/i.test(e.color) ? e.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - leftFace: (() => /^#([0-9a-f]{6})$/i.test(e.leftface) ? e.leftface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - rightFace: (() => /^#([0-9a-f]{6})$/i.test(e.rightface) ? e.rightface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - topFace: (() => /^#([0-9a-f]{6})$/i.test(e.topface) ? e.topface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - bottomFace: (() => /^#([0-9a-f]{6})$/i.test(e.bottomface) ? e.bottomface : "#" + Math.floor(16777215 * Math.random()).toString(16))(), + createBox(args) { + null !== this.canvas() && null !== this.parentElement() && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createBox({ + width: +args.width, + height: +args.height, + depth: +args.depth, + stroke: +args.stroke / 100, + length: +args.length, + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + leftFace: (() => /^#([0-9a-f]{6})$/i.test(args.leftface) ? args.leftface : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + rightFace: (() => /^#([0-9a-f]{6})$/i.test(args.rightface) ? args.rightface : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + topFace: (() => /^#([0-9a-f]{6})$/i.test(args.topface) ? args.topface : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + bottomFace: (() => /^#([0-9a-f]{6})$/i.test(args.bottomface) ? args.bottomface : '#' + Math.floor(16777215 * Math.random()).toString(16))(), translate: { - x: +e.x, - y: +e.y, - z: +e.z + x: +args.x, + y: +args.y, + z: +args.z } - }), this.cubeScene.addChild(this.objectList[e.id])) + }), this.stage.addChild(this.instances[args.id])) } - createCustom(t) { - null !== this.canvas() && null !== this.cubeParent() && "{}" !== t.path && (void 0 !== this.objectList[t.id] && (this.cubeScene.removeChild(this.objectList[t.id]), this.objectList[t.id] = void 0), this.objectList[t.id] = new this.Cube.custom({ - stroke: +t.stroke / 100, + createCustom(args) { + null !== this.canvas() && args.path !== 'fileListEmpty' && null !== this.parentElement() && '{}' !== args.path && (void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0), this.instances[args.id] = this.renderer.createCustom({ + stroke: +args.stroke / 100, closed: (() => { - switch (t.closed) { + switch (args.closed) { case true: return true case false: @@ -1670,76 +1693,78 @@ void (window.tempExt = { return false } })(), - color: (() => /^#([0-9a-f]{6})$/i.test(t.color) ? t.color : "#" + Math.floor(16777215 * Math.random()).toString(16))(), - path: "fileListEmpty" === t.path ? [{ - x: 0, - y: 0, - z: 0 - }] : JSON.parse(String.fromCharCode.apply(null, this.runtime.getGandiAssetById(t.path).asset.data)), + color: (() => /^#([0-9a-f]{6})$/i.test(args.color) ? args.color : '#' + Math.floor(16777215 * Math.random()).toString(16))(), + path: JSON.parse(String.fromCharCode.apply(null, this.runtime.getGandiAssetById(args.path).asset.data)), translate: { - x: +t.x, - y: +t.y, - z: +t.z + x: +args.x, + y: +args.y, + z: +args.z } - }), this.cubeScene.addChild(this.objectList[t.id])) + }), this.stage.addChild(this.instances[args.id])) } - deleteObject(e) { - null !== this.cubeParent() && void 0 !== this.objectList[e.id] && (this.cubeScene.removeChild(this.objectList[e.id]), this.objectList[e.id] = void 0) + deleteObject(args) { + null !== this.parentElement() && void 0 !== this.instances[args.id] && (this.stage.removeChild(this.instances[args.id]), this.instances[args.id] = void 0) } deleteAllObject() { - if (null !== this.cubeParent()) { - for (let e in this.objectList) this.cubeScene.removeChild(this.objectList[e]); - this.objectList = {} + if (null !== this.parentElement()) { + for (let e in this.instances) this.stage.removeChild(this.instances[e]); + this.instances = {} } } - getAttrib(e) { + getAttrib(args) { try { - if (void 0 !== typeof this.objectList[e.id]) switch (e.type) { - case "x": - return "undefined" == typeof this.objectList[e.id].translate.x ? "NaN" : this.objectList[e.id].translate.x; - case "y": - return "undefined" == typeof this.objectList[e.id].translate.y ? "NaN" : this.objectList[e.id].translate.y; - case "z": - return "undefined" == typeof this.objectList[e.id].translate.z ? "NaN" : this.objectList[e.id].translate.z; - case "width": - return "undefined" == typeof this.objectList[e.id].width ? "NaN" : this.objectList[e.id].width; - case "height": - return "undefined" == typeof this.objectList[e.id].height ? "NaN" : this.objectList[e.id].height; - case "color": - return "undefined" == typeof this.objectList[e.id].color ? "NaN" : this.objectList[e.id].color; - case "stroke": - return "undefined" == typeof this.objectList[e.id].stroke ? "NaN" : this.objectList[e.id].stroke; - case "quarters": - return "undefined" == typeof this.objectList[e.id].quarters ? "NaN" : this.objectList[e.id].quarters; - case "cornerRadius": - return "undefined" == typeof this.objectList[e.id].cornerRadius ? "NaN" : this.objectList[e.id].cornerRadius; - case "radius": - return "undefined" == typeof this.objectList[e.id].radius ? "NaN" : this.objectList[e.id].radius; + if (void 0 !== typeof this.instances[args.id]) switch (args.type) { + case 'x': + return 'undefined' == typeof this.instances[args.id].translate.x ? 'NaN' : this.instances[args.id].translate.x; + case 'y': + return 'undefined' == typeof this.instances[args.id].translate.y ? 'NaN' : this.instances[args.id].translate.y; + case 'z': + return 'undefined' == typeof this.instances[args.id].translate.z ? 'NaN' : this.instances[args.id].translate.z; + case 'rotateX': + return 'undefined' == typeof this.instances[args.id].rotate.x ? 'NaN' : this.instances[args.id].rotate.x * (180 / Math.PI); + case 'rotateY': + return 'undefined' == typeof this.instances[args.id].rotate.y ? 'NaN' : this.instances[args.id].rotate.y * (180 / Math.PI); + case 'rotateZ': + return 'undefined' == typeof this.instances[args.id].rotate.z ? 'NaN' : this.instances[args.id].rotate.z * (180 / Math.PI); + case 'width': + return 'undefined' == typeof this.instances[args.id].width ? 'NaN' : this.instances[args.id].width; + case 'height': + return 'undefined' == typeof this.instances[args.id].height ? 'NaN' : this.instances[args.id].height; + case 'color': + return 'undefined' == typeof this.instances[args.id].color ? 'NaN' : this.instances[args.id].color; + case 'stroke': + return 'undefined' == typeof this.instances[args.id].stroke ? 'NaN' : this.instances[args.id].stroke; + case 'quarters': + return 'undefined' == typeof this.instances[args.id].quarters ? 'NaN' : this.instances[args.id].quarters; + case 'cornerRadius': + return 'undefined' == typeof this.instances[args.id].cornerRadius ? 'NaN' : this.instances[args.id].cornerRadius; + case 'radius': + return 'undefined' == typeof this.instances[args.id].radius ? 'NaN' : this.instances[args.id].radius; default: - return "NaN"; + return 'NaN'; } } catch (e) { - return "NaN" + return 'NaN' } } getObjectNumbers() { - return Object.keys(this.objectList).length + return Object.keys(this.instances).length } - setRotate(e) { - if (void 0 !== typeof this.objectList[e.id]) switch (e.type) { - case "x": - this.objectList[e.id].rotate.x = +e.rotate * (Math.PI / 180); + setRotate(args) { + if (void 0 !== typeof this.instances[args.id]) switch (args.type) { + case 'x': + this.instances[args.id].rotate.x = +args.rotate * (Math.PI / 180); break; - case "y": - this.objectList[e.id].rotate.y = +e.rotate * (Math.PI / 180); + case 'y': + this.instances[args.id].rotate.y = +args.rotate * (Math.PI / 180); break; - case "z": - this.objectList[e.id].rotate.z = +e.rotate * (Math.PI / 180); + case 'z': + this.instances[args.id].rotate.z = +args.rotate * (Math.PI / 180); break; default: break; @@ -1747,39 +1772,39 @@ void (window.tempExt = { } getObjectList() { - return Object.keys(this.objectList) + return Object.keys(this.instances) } updateRender() { try { - this.cubeScene.updateRenderGraph() + this.stage.updateRenderGraph() } catch (e) { - throw new Error('Cube: 渲染时发生错误') + console.error('Cube: 渲染时发生错误') } } }, info: { - name: "Cube.name", - description: "Cube.description", - extensionId: "LazyTong.Cube", - iconURL: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0Jve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TJOalkyTmpZMk5qUXNNVEF4TVM0eE1URXhNVEV4TVRFeE1URXlMQzB6TUM0Mk5qWTJOalkyTmpZMk5qWTJOamdzTVRBMk5pNDJOalkyTmpZMk5qWTJOalkzTEMweU9VTXhNVEl5TGpJeU1qSXlNakl5TWpJeU1qSXNMVEkzTGpNek16TXpNek16TXpNek16TXpNaXd4TVRRMExqUTBORFEwTkRRME5EUTBORE1zTmpjdU1qVXNNVEl3TUN3M01VTXhNalUxTGpVMU5UVTFOVFUxTlRVMU5UY3NOelF1TnpVc01USTNOeTQzTnpjM056YzNOemMzTnpjNExDMHhOUzQzT1RFMk5qWTJOalkyTmpZMk5qZ3NNVE16TXk0ek16TXpNek16TXpNek16TTFMQzB4TVVNeE16ZzRMamc0T0RnNE9EZzRPRGc0T1RFc0xUWXVNakE0TXpNek16TXpNek16TXpNekxERTBNVEV1TVRFeE1URXhNVEV4TVRFeE15dzRPUzQyTWpVc01UUTJOaTQyTmpZMk5qWTJOalkyTmpZM0xEazBRekUxTWpJdU1qSXlNakl5TWpJeU1qSXlNaXc1T0M0ek56VXNNVFUwTkM0ME5EUTBORFEwTkRRME5EUXpMREUyTGpnM05Td3hOakF3TERFd1F6RTJOVFV1TlRVMU5UVTFOVFUxTlRVMU55d3pMakV5TlN3eE5qYzNMamMzTnpjM056YzNOemMzTnpnc05qSXVNRFF4TmpZMk5qWTJOalkyTmpZMExERTNNek11TXpNek16TXpNek16TXpNek5TdzJNVU14TnpnNExqZzRPRGc0T0RnNE9EZzRPVEVzTlRrdU9UVTRNek16TXpNek16TXpNek0yTERFNE1URXVNVEV4TVRFeE1URXhNVEV4TERFdU5qWTJOalkyTmpZMk5qWTJOalkzTERFNE5qWXVOalkyTmpZMk5qWTJOalkyTnl3MVF6RTVNakl1TWpJeU1qSXlNakl5TWpJeU5DdzRMak16TXpNek16TXpNek16TXpNek1pd3hPVFEwTGpRME5EUTBORFEwTkRRME5EWXNOell1TVRZMk5qWTJOalkyTmpZMk5qY3NNakF3TUM0d01EQXdNREF3TURBd01EQXlMRGMzUXpJd05UVXVOVFUxTlRVMU5UVTFOVFUxTnl3M055NDRNek16TXpNek16TXpNek16TXl3eU1EYzNMamMzTnpjM056YzNOemMzT0N3eExqVXNNakV6TXk0ek16TXpNek16TXpNek16TTFMRGxETWpFNE9DNDRPRGc0T0RnNE9EZzRPRGtzTVRZdU5Td3lNakV4TGpFeE1URXhNVEV4TVRFeE1UTXNNVEV6TGpnek16TXpNek16TXpNek16TXpMREl5TmpZdU5qWTJOalkyTmpZMk5qWTNMREV4TTBNeU16SXlMakl5TWpJeU1qSXlNakl5TWpZc01URXlMakUyTmpZMk5qWTJOalkyTmpZM0xESXpNakF1TVRNNE9EZzRPRGc0T0RnNUxDMDFOQzQzT1RFMk5qWTJOalkyTmpZMk55d3lOREF3TERWRE1qUTNPUzQ0TmpFeE1URXhNVEV4TVRFc05qUXVOemt4TmpZMk5qWTJOalkyTmpjc016STFOQzR4TmpZMk5qWTJOalkyTmpZMUxESXhNeTQxTkRFMk5qWTJOalkyTmpZMk9Td3lOalV3TERRd01FTXlNRFExTGpnek16TXpNek16TXpNek16VXNOVGcyTGpRMU9ETXpNek16TXpNek16TXNNVFUyTGpJMUxEYzVOUzQ0TXpNek16TXpNek16TXpNMExDMDFNREFzT1RBd0lpQjBjbUZ1YzJadmNtMDlJbTFoZEhKcGVDZ3hMREFzTUN3eExEQXNNVEl3S1NJZ2IzQmhZMmwwZVQwaU1DNHdOU0krUEM5d1lYUm9Qanh3WVhSb0lHUTlJazB0TVRBc01UQkRNVGt1T0RZeE1URXhNVEV4TVRFeE1URXNNalF1TnpreE5qWTJOalkyTmpZMk5qWTRMRGMxTGpZNU5EUTBORFEwTkRRME5EUTJMRGszTGpnM05Td3hNek11TXpNek16TXpNek16TXpNek16UXNPREZETVRrd0xqazNNakl5TWpJeU1qSXlNakl6TERZMExqRXlOU3d5TVRFdU1URXhNVEV4TVRFeE1URXhNVFFzTFRVM0xqZzNOU3d5TmpZdU5qWTJ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alkyTmpnc01UTXpNeTR6TXpNek16TXpNek16TXpNMUxDMHhNVU14TXpnNExqZzRPRGc0T0RnNE9EZzRPVEVzTFRZdU1qQTRNek16TXpNek16TXpNek16TERFME1URXVNVEV4TVRFeE1URXhNVEV4TXl3NE9TNDJNalVzTVRRMk5pNDJOalkyTmpZMk5qWTJOalkzTERrMFF6RTFNakl1TWpJeU1qSXlNakl5TWpJeU1pdzVPQzR6TnpVc01UVTBOQzQwTkRRME5EUTBORFEwTkRRekxERTJMamczTlN3eE5qQXdMREV3UXpFMk5UVXVOVFUxTlRVMU5UVTFOVFUxTnl3ekxqRXlOU3d4TmpjM0xqYzNOemMzTnpjM056YzNOemdzTmpJdU1EUXhOalkyTmpZMk5qWTJOalkwTERFM016TXVNek16TXpNek16TXpNek16TlN3Mk1VTXhOemc0TGpnNE9EZzRPRGc0T0RnNE9URXNOVGt1T1RVNE16TXpNek16TXpNek16TTJMREU0TVRFdU1URXhNVEV4TVRFeE1URXhMREV1TmpZMk5qWTJOalkyTmpZMk5qWTNMREU0TmpZdU5qWTJOalkyTmpZMk5qWTJOeXcxUXpFNU1qSXVNakl5TWpJeU1qSXlNakl5TkN3NExqTXpNek16TXpNek16TXpNek16TWl3eE9UUTBMalEwTkRRME5EUTBORFEwTkRZc056WXVNVFkyTmpZMk5qWTJOalkyTmpjc01qQXdNQzR3TURBd01EQXdNREF3TURBeUxEYzNRekl3TlRVdU5UVTFOVFUxTlRVMU5UVTFOeXczTnk0NE16TXpNek16TXpNek16TXpNeXd5TURjM0xqYzNOemMzTnpjM056YzNPQ3d4TGpVc01qRXpNeTR6TXpNek16TXpNek16TXpNMUxEbERNakU0T0M0NE9EZzRPRGc0T0RnNE9Ea3NNVFl1TlN3eU1qRXhMakV4TVRFeE1URXhNVEV4TVRNc01URXpMamd6TXpNek16TXpNek16TXpNekxESXlOall1TmpZMk5qWTJOalkyTmpZM0xERXhNME15TXpJeUxqSXlNakl5TWpJeU1qSXlNallzTVRFeUxqRTJOalkyTmpZMk5qWTJOalkzTERJek1qQXVNVE00T0RnNE9EZzRPRGc1TEMwMU5DNDNPVEUyTmpZMk5qWTJOalkyTnl3eU5EQXdMRFZETWpRM09TNDROakV4TVRFeE1URXhNVEVzTmpRdU56a3hOalkyTmpZMk5qWTJOamNzTXpJMU5DNHhOalkyTmpZMk5qWTJOalkxTERJeE15NDFOREUyTmpZMk5qWTJOalkyT1N3eU5qVXdMRFF3TUVNeU1EUTFMamd6TXpNek16TXpNek16TXpVc05UZzJMalExT0RNek16TXpNek16TXpNc01UVTJMakkxTERjNU5TNDRNek16TXpNek16TXpNek0wTEMwMU1EQXNPVEF3SWlCMGNtRnVjMlp2Y20wOUltMWhkSEpwZUNneExEQXNNQ3d4TERBc01qUXdLU0lnYjNCaFkybDBlVDBpTUM0ek55SStQQzl3WVhSb1BqeHdZWFJvSUdROUlrMHRNVEFzTVRCRE1Ua3VPRFl4TVRFeE1URXhNVEV4TVRFc01qUXVOemt4TmpZMk5qWTJOalkyTmpZNExEYzFMalk1TkRRME5EUTBORFEwTkRRMkxEazNMamczTlN3eE16TXVNek16TXpNek16TXpNek16TXpRc09ERkRNVGt3TGprM01qSXlNakl5TWpJeU1qSXpMRFkwTGpFeU5Td3lNVEV1TVRFeE1URXhNVEV4TVRFeE1UUXNMVFUzTGpnM05Td3lOall1TmpZMk5qWTJOalkyTmpZMk55d3ROekZETXpJeUxqSXlNakl5TWpJeU1qSXlNakl6TEMwNE5DNHhNalVzTXpRMExqUTBORFEwTkRRME5EUTBORFEyTERVdU56QTRNek16TXpNek16TXpNek15TERRd01Dd3hPRU0wTlRVdU5UVTFOVFUxTlRVMU5UVTFOVFFzTXpBdU1qa3hOalkyTmpZMk5qWTJOalk0TERRM055NDNOemMzTnpjM056YzNOemM0TEMweE5pNHpOelVzTlRNekxqTXpNek16TXpNek16TXpNelFzTFRFeVF6VTRPQzQ0T0RnNE9EZzRPRGc0T0RnNUxDMDNMall5TlN3Mk1URXVNVEV4TVRFeE1URXhNVEV4TWl3ME1TNHdPRE16TXpNek16TXpNek16TXpZc05qWTJMalkyTmpZMk5qWTJOalkyTmpjc016bEROekl5TGpJeU1qSXlNakl5TWpJeU1qTXNNell1T1RFMk5qWTJOalkyTmpZMk5qWTBMRGMwTkM0ME5EUTBORFEwTkRRME5EUTFMQzB5Tnl3NE1EQXNMVEl5UXpnMU5TNDFOVFUxTlRVMU5UVTFOVFUxTEMweE55dzROemN1TnpjM056YzNOemMzTnpjM09DdzJOQzQwTlRnek16TXpNek16TXpNek15dzVNek11TXpNek16TXpNek16TXpNek5DdzJNME01T0RndU9EZzRPRGc0T0RnNE9EZzRPU3cyTVM0MU5ERTJOalkyTmpZMk5qWTJOalFzTVRBeE1TNHhNVEV4TVRFeE1URXhNVEV5TEMwek1DNDJOalkyTmpZMk5qWTJOalkyTmpnc01UQTJOaTQyTmpZMk5qWTJOalkyTmpZM0xDMHlPVU14TVRJeUxqSXlNakl5TWpJeU1qSXlNaklzTFRJM0xqTXpNek16TXpNek16TXpNek16TWl3eE1UUTBMalEwTkRRME5EUTBORFEwTkRNc05qY3VNalVzTVRJd01DdzNNVU14TWpVMUxqVTFOVFUxTlRVMU5UVTFOVGNzTnpRdU56VXNNVEkzTnk0M056YzNOemMzTnpjM056YzRMQzB4TlM0M09URTJOalkyTmpZMk5qWTJOamdzTVRNek15NHpNek16TXpNek16TXpNek0xTEMweE1VTXhNemc0TGpnNE9EZzRPRGc0T0RnNE9URXNMVFl1TWpBNE16TXpNek16TXpNek16TXpMREUwTVRFdU1URXhNVEV4TVRFeE1URXhNeXc0T1M0Mk1qVXNNVFEyTmk0Mk5qWTJOalkyTmpZMk5qWTNMRGswUXpFMU1qSXVNakl5TWpJeU1qSXlNakl5TWl3NU9DNHpOelVzTVRVME5DNDBORFEwTkRRME5EUTBORFF6TERFMkxqZzNOU3d4TmpBd0xERXdRekUyTlRVdU5UVTFOVFUxTlRVMU5UVTFOeXd6TGpFeU5Td3hOamMzTGpjM056YzNOemMzTnpjM056Z3NOakl1TURReE5qWTJOalkyTmpZMk5qWTBMREUzTXpNdU16TXpNek16TXpNek16TXpOU3cyTVVNeE56ZzRMamc0T0RnNE9EZzRPRGc0T1RFc05Ua3VPVFU0TXpNek16TXpNek16TXpNMkxERTRNVEV1TVRFeE1URXhNVEV4TVRFeExERXVOalkyTmpZMk5qWTJOalkyTmpZM0xERTROall1TmpZMk5qWTJOalkyTmpZMk55dzFRekU1TWpJdU1qSXlNakl5TWpJeU1qSXlOQ3c0TGpNek16TXpNek16TXpNek16TXpNaXd4T1RRMExqUTBORFEwTkRRME5EUTBORFlzTnpZdU1UWTJOalkyTmpZMk5qWTJOamNzTWpBd01DNHdNREF3TURBd01EQXdNREF5TERjM1F6SXdOVFV1TlRVMU5UVTFOVFUxTlRVMU55dzNOeTQ0TXpNek16TXpNek16TXpNek15d3lNRGMzTGpjM056YzNOemMzTnpjM09Dd3hMalVzTWpFek15NHpNek16TXpNek16TXpNek0xTERsRE1qRTRPQzQ0T0RnNE9EZzRPRGc0T0Rrc01UWXVOU3d5TWpFeExqRXhNVEV4TVRFeE1URXhNVE1zTVRFekxqZ3pNek16TXpNek16TXpNek16TERJeU5qWXVOalkyTmpZMk5qWTJOalkzTERFeE0wTXlNekl5TGpJeU1qSXlNakl5TWpJeU1qWXNNVEV5TGpFMk5qWTJOalkyTmpZMk5qWTNMREl6TWpBdU1UTTRPRGc0T0RnNE9EZzVMQzAxTkM0M09URTJOalkyTmpZMk5qWTJOeXd5TkRBd0xEVkRNalEzT1M0NE5qRXhNVEV4TVRFeE1URXNOalF1TnpreE5qWTJOalkyTmpZMk5qY3NNekkxTkM0eE5qWTJOalkyTmpZMk5qWTFMREl4TXk0MU5ERTJOalkyTmpZMk5qWTJPU3d5TmpVd0xEUXdNRU15TURRMUxqZ3pNek16TXpNek16TXpNelVzTlRnMkxqUTFPRE16TXpNek16TXpNek1zTVRVMkxqSTFMRGM1TlM0NE16TXpNek16TXpNek16TTBMQzAxTURBc09UQXdJaUIwY21GdWMyW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OVFUxTlRVMU5UY3NOelF1TnpVc01USTNOeTQzTnpjM056YzNOemMzTnpjNExDMHhOUzQzT1RFMk5qWTJOalkyTmpZMk5qZ3NNVE16TXk0ek16TXpNek16TXpNek16TTFMQzB4TVVNeE16ZzRMamc0T0RnNE9EZzRPRGc0T1RFc0xUWXVNakE0TXpNek16TXpNek16TXpNekxERTBNVEV1TVRFeE1URXhNVEV4TVRFeE15dzRPUzQyTWpVc01UUTJOaTQyTmpZMk5qWTJOalkyTmpZM0xEazBRekUxTWpJdU1qSXlNakl5TWpJeU1qSXlNaXc1T0M0ek56VXNNVFUwTkM0ME5EUTBORFEwTkRRME5EUXpMREUyTGpnM05Td3hOakF3TERFd1F6RTJOVFV1TlRVMU5UVTFOVFUxTlRVMU55d3pMakV5TlN3eE5qYzNMamMzTnpjM056YzNOemMzTnpnc05qSXVNRFF4TmpZMk5qWTJOalkyTmpZMExERTNNek11TXpNek16TXpNek16TXpNek5TdzJNVU14TnpnNExqZzRPRGc0T0RnNE9EZzRPVEVzTlRrdU9UVTRNek16TXpNek16TXpNek0yTERFNE1URXVNVEV4TVRFeE1URXhNVEV4TERFdU5qWTJOalkyTmpZMk5qWTJOalkzTERFNE5qWXVOalkyTmpZMk5qWTJOalkyTnl3MVF6RTVNakl1TWpJeU1qSXlNakl5TWpJeU5DdzRMak16TXpNek16TXpNek16TXpNek1pd3hPVFEwTGpRME5EUTBORFEwTkRRME5EWXNOell1TVRZMk5qWTJOalkyTmpZMk5qY3NNakF3TUM0d01EQXdNREF3TURBd01EQXlMRGMzUXpJd05UVXVOVFUxTlRVMU5UVTFOVFUxTnl3M055NDRNek16TXpNek16TXpNek16TXl3eU1EYzNMamMzTnpjM056YzNOemMzT0N3eExqVXNNakV6TXk0ek16TXpNek16TXpNek16TTFMRGxETWpFNE9DNDRPRGc0T0RnNE9EZzRPRGtzTVRZdU5Td3lNakV4TGpFeE1URXhNVEV4TVRFeE1UTXNNVEV6TGpnek16TXpNek16TXpNek16TXpMREl5T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xERTJMamczTlN3eE5qQXdMREV3UXpFMk5UVXVOVFUxTlRVMU5UVTFOVFUxTnl3ekxqRXlOU3d4TmpjM0xqYzNOemMzTnpjM056YzNOemdzTmpJdU1EUXhOalkyTmpZMk5qWTJOalkwTERFM016TXVNek16TXpNek16TXpNek16TlN3Mk1VTXhOemc0TGpnNE9EZzRPRGc0T0RnNE9URXNOVGt1T1RVNE16TXpNek16TXpNek16TTJMREU0TVRFdU1URXhNVEV4TVRFeE1URXhMREV1TmpZMk5qWTJOalkyTmpZMk5qWTNMREU0TmpZdU5qWTJOalkyTmpZMk5qWTJOeXcxUXpFNU1qSXVNakl5TWpJeU1qSXlNakl5TkN3NExqTXpNek16TXpNek16TXpNek16TWl3eE9UUTBMalEwTkRRME5EUTBORFEwTkRZc056WXVNVFkyTmpZMk5qWTJOalkyTmpjc01qQXdNQzR3TURBd01EQXdNREF3TURBeUxEYzNRekl3TlRVdU5UVTFOVFUxTlRVMU5UVTFOeXczTnk0NE16TXpNek16TXpNek16TXpNeXd5TURjM0xqYzNOemMzTnpjM056YzNPQ3d4TGpVc01qRXpNeTR6TXpNek16TXpNek16TXpNMUxEbERNakU0T0M0NE9EZzRPRGc0T0RnNE9Ea3NNVFl1TlN3eU1qRXhMakV4TVRFeE1URXhNVEV4TVRNc01URXpMamd6TXpNek16TXpNek16TXpNekxESXlOall1TmpZMk5qWTJOalkyTmpZM0xERXhNME15TXpJeUxqSXlNakl5TWpJeU1qSXlNallzTVRFeUxqRTJOalkyTmpZMk5qWTJOalkzTERJek1qQXVNVE00T0RnNE9EZzRPRGc1TEMwMU5DNDNPVEUyTmpZMk5qWTJOalkyTnl3eU5EQXdMRFZETWpRM09TNDROakV4TVRFeE1URXhNVEVzTmpRdU56a3hOalkyTmpZMk5qWTJOamNzTXpJMU5DNHhOalkyTmpZMk5qWTJOalkxTERJeE15NDFOREUyTmpZMk5qWTJOalkyT1N3eU5qVXdMRFF3TUVNeU1EUTFMamd6TXpNek16TXpNek16TXpVc05UZzJMalExT0RNek16TXpNek16TXpNc01UVTJMakkxTERjNU5TNDRNek16TXpNek16TXpNek0wTEMwMU1EQXNPVEF3SWlCMGNtRnVjMlp2Y20wOUltMWhkSEpwZUNneExEQXNNQ3d4TERBc01qUXdLU0lnYjNCaFkybDBlVDBpTUM0ek55SStQQzl3WVhSb1BqeHdZWFJvSUdROUlrMHRNVEFzTVRCRE1Ua3VPRFl4TVRFeE1URXhNVEV4TVRFc01qUXVOemt4TmpZMk5qWTJOalkyTmpZNExEYzFMalk1TkRRME5EUTBORFEwTkRRMkxEazNMamczTlN3eE16TXVNek16TXpNek16TXpNek16TXpRc09ERkRNVGt3TGprM01qSXlNakl5TWpJeU1qSXpMRFkwTGpFeU5Td3lNVEV1TVRFeE1URXhNVEV4TVRFeE1UUXNMVFUzTGpnM05Td3lOall1TmpZMk5qWTJOalkyTmpZMk55d3ROekZETXpJeUxqSXlNakl5TWpJeU1qSXlNakl6TEMwNE5DNHhNalVzTXpRMExqUTBORFEwTkRRME5EUTBORFEyTERVdU56QTRNek16TXpNek16TXpNek15TERRd01Dd3hPRU0wTlRVdU5UVTFOVFUxTlRVMU5UVTFOVFFzTXpBdU1qa3hOalkyTmpZMk5qWTJOalk0TERRM055NDNOemMzTnpjM056YzNOemM0TEMweE5pNHpOelVzTlRNekxqTXpNek16TXpNek16TXpNelFzTFRFeVF6VTRPQzQ0T0RnNE9EZzRPRGc0T0RnNUxDMDNMall5TlN3Mk1URXVNVEV4TVRFeE1URXhNVEV4TWl3ME1TNHdPRE16TXpNek16TXpNek16TXpZc05qWTJMalkyTmpZMk5qWTJOalkyTmpjc016bEROekl5TGpJeU1qSXlNakl5TWpJeU1qTXNNell1T1RFMk5qWTJOalkyTmpZMk5qWTBMRGMwTkM0ME5EUTBORFEwTkRRME5EUTFMQzB5Tnl3NE1EQXNMVEl5UXpnMU5TNDFOVFUxTlRVMU5UVTFOVFUxTEMweE55dzROemN1TnpjM056YzNOemMzTnpjM09DdzJOQzQwTlRnek16TXpNek16TXpNek15dzVNek11TXpNek16TXpNek16TXpNek5DdzJNME01T0RndU9EZzRPRGc0T0RnNE9EZzRPU3cyTVM0MU5ERTJOalkyTmpZMk5qWTJOalFzTVRBeE1TNHhNVEV4TVRFeE1URXhNVEV5TEMwek1DNDJOalkyTmpZMk5qWTJOalkyTmpnc01UQTJOaTQyTmpZMk5qWTJOalkyTmpZM0xDMHlPVU14TVRJeUxqSXlNakl5TWpJeU1qSXlNaklzTFRJM0xqTXpNek16TXpNek16TXpNek16TWl3eE1UUTBMalEwTkRRME5EUTBORFEwTkRNc05qY3VNalVzTVRJd01DdzNNVU14TWpVMUxqVTFOVFUxTlRVMU5UVTFOVGNzTnpRdU56VXNNVEkzTnk0M056YzNOemMzTnpjM056YzRMQzB4TlM0M09URTJOalkyTmpZMk5qWTJOamdzTVRNek15NHpNek16TXpNek16TXpNek0xTEMweE1VTXhNemc0TGpnNE9EZzRPRGc0T0RnNE9URXNMVFl1TWpBNE16TXpNek16TXpNek16TXpMREUwTVRFdU1URXhNVEV4TVRFeE1URXhNeXc0T1M0Mk1qVXNNVFEyTmk0Mk5qWTJOalkyTmpZMk5qWTNMRGswUXpFMU1qSXVNakl5TWpJeU1qSXlNakl5TWl3NU9DNHpOelVzTVRVME5DNDBORFEwTkRRME5EUTBORFF6TERFMkxqZzNOU3d4TmpBd0xERXdRekUyTlRVdU5UVTFOVFUxTlRVMU5UVTFOeXd6TGpFeU5Td3hOamMzTGpjM056YzNOemMzTnpjM056Z3NOakl1TURReE5qWTJOalkyTmpZMk5qWTBMREUzTXpNdU16TXpNek16TXpNek16TXpOU3cyTVVNeE56ZzRMamc0T0RnNE9EZzRPRGc0T1RFc05Ua3VPVFU0TXpNek16TXpNek16TXpNMkxERTRNVEV1TVRFeE1URXhNVEV4TVRFeExERXVOalkyTmpZMk5qWTJOalkyTmpZM0xERTROall1TmpZMk5qWTJOalkyTmpZMk55dzFRekU1TWpJdU1qSXlNakl5TWpJeU1qSXlOQ3c0TGpNek16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3M01VTXhNalUxTGpVMU5UVTFOVFUxTlRVMU5UY3NOelF1TnpVc01USTNOeTQzTnpjM056YzNOemMzTnpjNExDMHhOUzQzT1RFMk5qWTJOalkyTmpZMk5qZ3NNVE16TXk0ek16TXpNek16TXpNek16TTFMQzB4TVVNeE16ZzRMamc0T0RnNE9EZzRPRGc0T1RFc0xUWXVNakE0TXpNek16TXpNek16TXpNekxERTBNVEV1TVRFeE1URXhNVEV4TVRFeE15dzRPUzQyTWpVc01UUTJOaTQyTmpZMk5qWTJOalkyTmpZM0xEazBRekUxTWpJdU1qSXlNakl5TWpJeU1qSXlNaXc1T0M0ek56VXNNVFUwTkM0ME5EUTBORFEwTkRRME5EUXpMREUyTGpnM05Td3hOakF3TERFd1F6RTJOVFV1TlRVMU5UVTFOVFUxTlRVMU55d3pMakV5TlN3eE5qYzNMamMzTnpjM056YzNOemMzTnpnc05qSXVNRFF4TmpZMk5qWTJOalkyTmpZMExERTNNek11TXpNek16TXpNek16TXpNek5TdzJNVU14TnpnNExqZzRPRGc0T0RnNE9EZzRPVEVzTlRrdU9UVTRNek16TXpNek16TXpNek0yTERFNE1URXVNVEV4TVRFeE1URXhNVEV4TERFdU5qWTJOalkyTmpZMk5qWTJOalkzTERFNE5qWXVOalkyTmpZMk5qWTJOalkyTnl3MVF6RTVNakl1TWpJeU1qSXlNakl5TWpJeU5DdzRMak16TXpNek16TXpNek16TXpNek1pd3hPVFEwTGpRME5EUTBORFEwTkRRME5EWXNOell1TVRZMk5qWTJOalkyTmpZMk5qY3NNakF3TUM0d01EQXdNREF3TURBd01EQXlMRGMzUXpJd05UVXVOVFUxTlRVMU5UVTFOVFUxTnl3M055NDRNek16TXpNek16TXpNek16TXl3eU1EYzNMamMzTnpjM056YzNOemMzT0N3eExqVXNNakV6TXk0ek16TXpNek16TXpNek16TTFMRGxETWpFNE9DNDRPRGc0T0RnNE9EZzRPRGtzTVRZdU5Td3lNakV4TGpFeE1URXhNVEV4TVRFeE1UTXNNVEV6TGpn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TFRFeUxqSTBNeUJNTFRBdU9UUXlMRGt6TGpJeE5TQk1MVGcwTGpnME9DdzFNaTR5TnprZ1dpSWdabWxzYkQwaUl6WTJRME13TUNJK1BDOXdZWFJvUGp4d1lYUm9JSE4wY205clpTMXNhVzVsWTJGd1BTSnliM1Z1WkNJZ2MzUnliMnRsTFd4cGJtVnFiMmx1UFNKeWIzVnVaQ0lnWkQwaVRUZzBMamcwT0N3dE5USXVNamM1SUV3dE1DNDVORElzTFRFeUxqSTBNeUJNTFRBdU9UUXlMRGt6TGpJeE5TQk1PRFF1T0RRNExEVXpMakUzT1NCYUlpQm1hV3hzUFNJak16TTVPVEF3SWo0OEwzQmhkR2crUEM5emRtYysiLz48L3N2Zz4=', insetIconURL: t, featured: true, disabled: false, collaboratorList: [{ - collaborator: "LazyTong @ Github", - collaboratorURL: "https://lt.js.org" + collaborator: 'LazyTong @ Github', + collaboratorURL: 'https://lt.js.org' }], - doc: "https://lt.js.org/posts/3ad4f6" + doc: 'https://lt.js.org/posts/3ad4f6' }, l10n: { - "zh-cn": { - "Cube.name": "LazyTong的立方体 V1.2", - "Cube.description": "升维打击!" + 'zh-cn': { + 'Cube.name': 'LazyTong的立方体 V1.2', + 'Cube.description': '升维打击!' }, en: { - "Cube.name": "LazyTong's Cube V1.2", - "Cube.description": "Dimensionality expansion strike!" + 'Cube.name': "LazyTong's Cube V1.2", + 'Cube.description': 'Dimensionality expansion strike!' } } });