@operato/scene-visualizer 10.0.0-beta.1 → 10.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editors/index.d.ts +2 -0
- package/dist/editors/index.js +10 -0
- package/dist/editors/index.js.map +1 -1
- package/dist/editors/property-editor-gltf-fill-targets.d.ts +5 -2
- package/dist/editors/property-editor-gltf-fill-targets.js +179 -77
- package/dist/editors/property-editor-gltf-fill-targets.js.map +1 -1
- package/dist/editors/property-editor-gltf-info.d.ts +25 -3
- package/dist/editors/property-editor-gltf-info.js +324 -73
- package/dist/editors/property-editor-gltf-info.js.map +1 -1
- package/dist/editors/property-editor-gltf-play-targets.d.ts +25 -0
- package/dist/editors/property-editor-gltf-play-targets.js +388 -0
- package/dist/editors/property-editor-gltf-play-targets.js.map +1 -0
- package/dist/editors/property-editor-location-increase-pattern.js +0 -4
- package/dist/editors/property-editor-location-increase-pattern.js.map +1 -1
- package/dist/editors/property-editor-stocker-location.d.ts +13 -0
- package/dist/editors/property-editor-stocker-location.js +151 -0
- package/dist/editors/property-editor-stocker-location.js.map +1 -0
- package/dist/editors/property-editor-stocker-ports.d.ts +8 -0
- package/dist/editors/property-editor-stocker-ports.js +112 -0
- package/dist/editors/property-editor-stocker-ports.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/rack-table-3d.js +1 -0
- package/dist/rack-table-3d.js.map +1 -1
- package/dist/rack-table.js +13 -0
- package/dist/rack-table.js.map +1 -1
- package/dist/rack.d.ts +13 -0
- package/dist/rack.js +100 -11
- package/dist/rack.js.map +1 -1
- package/dist/stock-hub.d.ts +25 -0
- package/dist/stock-hub.js +147 -0
- package/dist/stock-hub.js.map +1 -0
- package/dist/stock.d.ts +32 -0
- package/dist/stock.js +170 -73
- package/dist/stock.js.map +1 -1
- package/dist/stocker-3d.d.ts +23 -0
- package/dist/stocker-3d.js +352 -0
- package/dist/stocker-3d.js.map +1 -0
- package/dist/stocker-port-3d.d.ts +14 -0
- package/dist/stocker-port-3d.js +80 -0
- package/dist/stocker-port-3d.js.map +1 -0
- package/dist/{banner.d.ts → stocker-port.d.ts} +35 -25
- package/dist/stocker-port.js +123 -0
- package/dist/stocker-port.js.map +1 -0
- package/dist/{camera.d.ts → stocker.d.ts} +121 -30
- package/dist/stocker.js +370 -0
- package/dist/stocker.js.map +1 -0
- package/dist/templates/floor-plate.d.ts +18 -0
- package/dist/templates/floor-plate.js +19 -0
- package/dist/templates/floor-plate.js.map +1 -0
- package/dist/templates/index.d.ts +37 -38
- package/dist/templates/index.js +9 -1
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/rack-table.d.ts +2 -0
- package/dist/templates/rack-table.js +4 -2
- package/dist/templates/rack-table.js.map +1 -1
- package/dist/templates/stock-hub.d.ts +14 -0
- package/dist/templates/stock-hub.js +15 -0
- package/dist/templates/stock-hub.js.map +1 -0
- package/dist/templates/stocker-port.d.ts +17 -0
- package/dist/templates/stocker-port.js +17 -0
- package/dist/templates/stocker-port.js.map +1 -0
- package/dist/templates/stocker.d.ts +27 -0
- package/dist/templates/stocker.js +38 -0
- package/dist/templates/stocker.js.map +1 -0
- package/dist/templates/visualizer.js +1 -1
- package/dist/templates/visualizer.js.map +1 -1
- package/dist/visualizer.d.ts +2 -1
- package/dist/visualizer.js +63 -46
- package/dist/visualizer.js.map +1 -1
- package/icons/stock-hub.png +0 -0
- package/package.json +2 -2
- package/translations/en.json +6 -0
- package/translations/ja.json +5 -0
- package/translations/ko.json +6 -1
- package/translations/ms.json +5 -0
- package/translations/zh.json +5 -0
- package/dist/banner.js +0 -75
- package/dist/banner.js.map +0 -1
- package/dist/camera.js +0 -107
- package/dist/camera.js.map +0 -1
- package/dist/cube.d.ts +0 -241
- package/dist/cube.js +0 -37
- package/dist/cube.js.map +0 -1
- package/dist/cylinder.d.ts +0 -9
- package/dist/cylinder.js +0 -37
- package/dist/cylinder.js.map +0 -1
- package/dist/ellipse.d.ts +0 -5
- package/dist/ellipse.js +0 -20
- package/dist/ellipse.js.map +0 -1
- package/dist/gltf-object.d.ts +0 -249
- package/dist/gltf-object.js +0 -103
- package/dist/gltf-object.js.map +0 -1
- package/dist/html-overlay-element.d.ts +0 -1
- package/dist/html-overlay-element.js +0 -8
- package/dist/html-overlay-element.js.map +0 -1
- package/dist/light.d.ts +0 -14
- package/dist/light.js +0 -134
- package/dist/light.js.map +0 -1
- package/dist/polygon.d.ts +0 -17
- package/dist/polygon.js +0 -62
- package/dist/polygon.js.map +0 -1
- package/dist/rect.d.ts +0 -5
- package/dist/rect.js +0 -34
- package/dist/rect.js.map +0 -1
- package/dist/scene/component.d.ts +0 -1
- package/dist/scene/component.js +0 -29
- package/dist/scene/component.js.map +0 -1
- package/dist/sphere.d.ts +0 -9
- package/dist/sphere.js +0 -37
- package/dist/sphere.js.map +0 -1
- package/dist/sprite.d.ts +0 -238
- package/dist/sprite.js +0 -27
- package/dist/sprite.js.map +0 -1
- package/dist/text.d.ts +0 -1
- package/dist/text.js +0 -7
- package/dist/text.js.map +0 -1
- package/dist/three-container-editor.d.ts +0 -22
- package/dist/three-container-editor.js +0 -132
- package/dist/three-container-editor.js.map +0 -1
- package/dist/three-container.d.ts +0 -61
- package/dist/three-container.js +0 -371
- package/dist/three-container.js.map +0 -1
- package/dist/three-controls.d.ts +0 -111
- package/dist/three-controls.js +0 -414
- package/dist/three-controls.js.map +0 -1
- package/dist/three-layout.d.ts +0 -8
- package/dist/three-layout.js +0 -20
- package/dist/three-layout.js.map +0 -1
- package/dist/three-space.d.ts +0 -8
- package/dist/three-space.js +0 -58
- package/dist/three-space.js.map +0 -1
- package/dist/threed/common.d.ts +0 -22
- package/dist/threed/common.js +0 -19
- package/dist/threed/common.js.map +0 -1
- package/dist/threed/floor/floor.d.ts +0 -3
- package/dist/threed/floor/floor.js +0 -51
- package/dist/threed/floor/floor.js.map +0 -1
- package/dist/threed/html/elements.d.ts +0 -2
- package/dist/threed/html/elements.js +0 -21
- package/dist/threed/html/elements.js.map +0 -1
- package/dist/threed/index.d.ts +0 -16
- package/dist/threed/index.js +0 -17
- package/dist/threed/index.js.map +0 -1
- package/dist/threed/interfaces.d.ts +0 -15
- package/dist/threed/interfaces.js +0 -5
- package/dist/threed/interfaces.js.map +0 -1
- package/dist/threed/managers/camera-manager.d.ts +0 -14
- package/dist/threed/managers/camera-manager.js +0 -60
- package/dist/threed/managers/camera-manager.js.map +0 -1
- package/dist/threed/managers/controls-manager.d.ts +0 -50
- package/dist/threed/managers/controls-manager.js +0 -249
- package/dist/threed/managers/controls-manager.js.map +0 -1
- package/dist/threed/managers/event-manager3d.d.ts +0 -19
- package/dist/threed/managers/event-manager3d.js +0 -76
- package/dist/threed/managers/event-manager3d.js.map +0 -1
- package/dist/threed/managers/index.d.ts +0 -7
- package/dist/threed/managers/index.js +0 -7
- package/dist/threed/managers/index.js.map +0 -1
- package/dist/threed/managers/light-manager.d.ts +0 -7
- package/dist/threed/managers/light-manager.js +0 -37
- package/dist/threed/managers/light-manager.js.map +0 -1
- package/dist/threed/managers/renderer-manager.d.ts +0 -30
- package/dist/threed/managers/renderer-manager.js +0 -120
- package/dist/threed/managers/renderer-manager.js.map +0 -1
- package/dist/threed/managers/scene-manager.d.ts +0 -15
- package/dist/threed/managers/scene-manager.js +0 -48
- package/dist/threed/managers/scene-manager.js.map +0 -1
- package/dist/threed/managers/types.d.ts +0 -36
- package/dist/threed/managers/types.js +0 -2
- package/dist/threed/managers/types.js.map +0 -1
- package/dist/threed/real-object-camera-meshed.d.ts +0 -12
- package/dist/threed/real-object-camera-meshed.js +0 -49
- package/dist/threed/real-object-camera-meshed.js.map +0 -1
- package/dist/threed/real-object-camera.d.ts +0 -9
- package/dist/threed/real-object-camera.js +0 -31
- package/dist/threed/real-object-camera.js.map +0 -1
- package/dist/threed/real-object-dom-element.d.ts +0 -9
- package/dist/threed/real-object-dom-element.js +0 -48
- package/dist/threed/real-object-dom-element.js.map +0 -1
- package/dist/threed/real-object-dummy.d.ts +0 -6
- package/dist/threed/real-object-dummy.js +0 -11
- package/dist/threed/real-object-dummy.js.map +0 -1
- package/dist/threed/real-object-extrude.d.ts +0 -22
- package/dist/threed/real-object-extrude.js +0 -180
- package/dist/threed/real-object-extrude.js.map +0 -1
- package/dist/threed/real-object-gltf.d.ts +0 -16
- package/dist/threed/real-object-gltf.js +0 -105
- package/dist/threed/real-object-gltf.js.map +0 -1
- package/dist/threed/real-object-group.d.ts +0 -5
- package/dist/threed/real-object-group.js +0 -11
- package/dist/threed/real-object-group.js.map +0 -1
- package/dist/threed/real-object-mesh.d.ts +0 -13
- package/dist/threed/real-object-mesh.js +0 -73
- package/dist/threed/real-object-mesh.js.map +0 -1
- package/dist/threed/real-object-plane.d.ts +0 -5
- package/dist/threed/real-object-plane.js +0 -22
- package/dist/threed/real-object-plane.js.map +0 -1
- package/dist/threed/real-object-registry.d.ts +0 -7
- package/dist/threed/real-object-registry.js +0 -32
- package/dist/threed/real-object-registry.js.map +0 -1
- package/dist/threed/real-object-scene.d.ts +0 -21
- package/dist/threed/real-object-scene.js +0 -72
- package/dist/threed/real-object-scene.js.map +0 -1
- package/dist/threed/real-object-sprite-2d.d.ts +0 -14
- package/dist/threed/real-object-sprite-2d.js +0 -45
- package/dist/threed/real-object-sprite-2d.js.map +0 -1
- package/dist/threed/real-object-sprite.d.ts +0 -11
- package/dist/threed/real-object-sprite.js +0 -52
- package/dist/threed/real-object-sprite.js.map +0 -1
- package/dist/threed/real-object-text.d.ts +0 -15
- package/dist/threed/real-object-text.js +0 -66
- package/dist/threed/real-object-text.js.map +0 -1
- package/dist/threed/real-object.d.ts +0 -65
- package/dist/threed/real-object.js +0 -251
- package/dist/threed/real-object.js.map +0 -1
- package/dist/threed/texture/canvas-texture.d.ts +0 -4
- package/dist/threed/texture/canvas-texture.js +0 -49
- package/dist/threed/texture/canvas-texture.js.map +0 -1
- package/dist/threed/texture/text-texture.d.ts +0 -8
- package/dist/threed/texture/text-texture.js +0 -79
- package/dist/threed/texture/text-texture.js.map +0 -1
- package/dist/threed/three-dimensional-container.d.ts +0 -7
- package/dist/threed/three-dimensional-container.js +0 -2
- package/dist/threed/three-dimensional-container.js.map +0 -1
- package/dist/threed/utils/bound-uv-generator.d.ts +0 -16
- package/dist/threed/utils/bound-uv-generator.js +0 -42
- package/dist/threed/utils/bound-uv-generator.js.map +0 -1
- package/dist/threed/utils/dispose.d.ts +0 -2
- package/dist/threed/utils/dispose.js +0 -32
- package/dist/threed/utils/dispose.js.map +0 -1
- package/dist/wall.d.ts +0 -241
- package/dist/wall.js +0 -44
- package/dist/wall.js.map +0 -1
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { Component } from '@hatiolab/things-scene';
|
|
3
|
-
export declare function createCanvasTexture(component: Component): THREE.Texture;
|
|
4
|
-
export declare function renderCanvasTexture(canvas: HTMLCanvasElement, component: Component, scale: number): void;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { createCanvas } from '../html/elements.js';
|
|
3
|
-
function nextPowerOf2(n) {
|
|
4
|
-
var count = 0;
|
|
5
|
-
if (n && !(n & (n - 1))) {
|
|
6
|
-
return n;
|
|
7
|
-
}
|
|
8
|
-
while (n != 0) {
|
|
9
|
-
n >>= 1;
|
|
10
|
-
count += 1;
|
|
11
|
-
}
|
|
12
|
-
return 1 << count;
|
|
13
|
-
}
|
|
14
|
-
export function createCanvasTexture(component) {
|
|
15
|
-
var { lineWidth = 0 } = component.state;
|
|
16
|
-
var { width, height } = component.bounds;
|
|
17
|
-
width += lineWidth;
|
|
18
|
-
height += lineWidth;
|
|
19
|
-
// Factor for increasing image resolution.
|
|
20
|
-
// TODO to be able to redraw according to the change in zoom value.
|
|
21
|
-
const scale = 2; // component.realObject?.threeContainer?.zoom as number
|
|
22
|
-
var poweredWidth = nextPowerOf2(width * scale);
|
|
23
|
-
var poweredHeight = nextPowerOf2(height * scale);
|
|
24
|
-
let canvas = createCanvas(poweredWidth, poweredHeight);
|
|
25
|
-
var texture = new THREE.CanvasTexture(canvas);
|
|
26
|
-
renderCanvasTexture(canvas, component, scale);
|
|
27
|
-
texture.needsUpdate = true;
|
|
28
|
-
texture.wrapS = THREE.RepeatWrapping;
|
|
29
|
-
texture.wrapT = THREE.RepeatWrapping;
|
|
30
|
-
texture.offset.set(0, 1 - (height * scale) / poweredHeight);
|
|
31
|
-
texture.repeat.set((width * scale) / poweredWidth, (height * scale) / poweredHeight);
|
|
32
|
-
texture.magFilter = THREE.NearestFilter;
|
|
33
|
-
texture.minFilter = THREE.LinearFilter;
|
|
34
|
-
// texture.minFilter = THREE.LinearMipMapLinearFilter
|
|
35
|
-
texture.colorSpace = THREE.SRGBColorSpace;
|
|
36
|
-
return texture;
|
|
37
|
-
}
|
|
38
|
-
export function renderCanvasTexture(canvas, component, scale) {
|
|
39
|
-
var { lineWidth = 0 } = component.state;
|
|
40
|
-
var { left, top } = component.bounds;
|
|
41
|
-
left -= lineWidth / 2;
|
|
42
|
-
top -= lineWidth / 2;
|
|
43
|
-
let context = canvas.getContext('2d');
|
|
44
|
-
context.scale(scale, scale);
|
|
45
|
-
context.translate(-left, -top);
|
|
46
|
-
component.render(context);
|
|
47
|
-
component.postrender(context);
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=canvas-texture.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"canvas-texture.js","sourceRoot":"","sources":["../../../src/threed/texture/canvas-texture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,SAAS,YAAY,CAAC,CAAS;IAC7B,IAAI,KAAK,GAAG,CAAC,CAAA;IAEb,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,C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MAAM,GAAG,KAAK,CAAC,GAAG,aAAa,CAAC,CAAA;IACpF,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC,aAAa,CAAA;IACvC,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC,YAAY,CAAA;IACtC,qDAAqD;IACrD,OAAO,CAAC,UAAU,GAAG,KAAK,CAAC,cAAc,CAAA;IAEzC,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,MAAyB,EAAE,SAAoB,EAAE,KAAa;IAChG,IAAI,EAAE,SAAS,GAAG,CAAC,EAAE,GAAG,SAAS,CAAC,KAAK,CAAA;IACvC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC,MAAM,CAAA;IAEpC,IAAI,IAAI,SAAS,GAAG,CAAC,CAAA;IACrB,GAAG,IAAI,SAAS,GAAG,CAAC,CAAA;IAEpB,IAAI,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;IAErC,OAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IAC5B,OAAQ,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;IAC/B,SAAS,CAAC,MAAM,CAAC,OAAQ,CAAC,CAAA;IAC1B,SAAS,CAAC,UAAU,CAAC,OAAQ,CAAC,CAAA;AAChC,CAAC","sourcesContent":["import * as THREE from 'three'\nimport { Component } from '@hatiolab/things-scene'\n\nimport { createCanvas } from '../html/elements.js'\n\nfunction nextPowerOf2(n: number) {\n var count = 0\n\n if (n && !(n & (n - 1))) {\n return n\n }\n\n while (n != 0) {\n n >>= 1\n count += 1\n }\n\n return 1 << count\n}\n\nexport function createCanvasTexture(component: Component): THREE.Texture {\n var { lineWidth = 0 } = component.state\n var { width, height } = component.bounds\n\n width += lineWidth\n height += lineWidth\n\n // Factor for increasing image resolution.\n // TODO to be able to redraw according to the change in zoom value.\n const scale = 2 // component.realObject?.threeContainer?.zoom as number\n\n var poweredWidth = nextPowerOf2(width * scale)\n var poweredHeight = nextPowerOf2(height * scale)\n\n let canvas = createCanvas(poweredWidth, poweredHeight)\n\n var texture = new THREE.CanvasTexture(canvas)\n\n renderCanvasTexture(canvas, component, scale)\n\n texture.needsUpdate = true\n texture.wrapS = THREE.RepeatWrapping\n texture.wrapT = THREE.RepeatWrapping\n texture.offset.set(0, 1 - (height * scale) / poweredHeight)\n texture.repeat.set((width * scale) / poweredWidth, (height * scale) / poweredHeight)\n texture.magFilter = THREE.NearestFilter\n texture.minFilter = THREE.LinearFilter\n // texture.minFilter = THREE.LinearMipMapLinearFilter\n texture.colorSpace = THREE.SRGBColorSpace\n\n return texture\n}\n\nexport function renderCanvasTexture(canvas: HTMLCanvasElement, component: Component, scale: number) {\n var { lineWidth = 0 } = component.state\n var { left, top } = component.bounds\n\n left -= lineWidth / 2\n top -= lineWidth / 2\n\n let context = canvas.getContext('2d')\n\n context!.scale(scale, scale)\n context!.translate(-left, -top)\n component.render(context!)\n component.postrender(context!)\n}\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
export declare function fontStyle(bold: boolean, italic: boolean, fontSize: number, fontFamily: string): string;
|
|
3
|
-
export declare function drawTextTexture(canvas: HTMLCanvasElement, text: string, textStyle: any): void;
|
|
4
|
-
export declare function textTexture(text: string, width: number, height: number, textStyle: any): THREE.CanvasTexture;
|
|
5
|
-
export declare function textBounds(text: string, textStyle: any): {
|
|
6
|
-
width: number;
|
|
7
|
-
height: number;
|
|
8
|
-
};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { createCanvas } from '../html/elements.js';
|
|
3
|
-
export function fontStyle(bold, italic, fontSize, fontFamily) {
|
|
4
|
-
return [
|
|
5
|
-
['bold', bold],
|
|
6
|
-
['italic', italic],
|
|
7
|
-
[fontSize + 'px', true],
|
|
8
|
-
[fontFamily, true]
|
|
9
|
-
]
|
|
10
|
-
.filter(p => p[1])
|
|
11
|
-
.map(p => p[0])
|
|
12
|
-
.join(' ');
|
|
13
|
-
}
|
|
14
|
-
function nextPowerOf2(n) {
|
|
15
|
-
var count = 0;
|
|
16
|
-
if (n && !(n & (n - 1))) {
|
|
17
|
-
return n;
|
|
18
|
-
}
|
|
19
|
-
while (n != 0) {
|
|
20
|
-
n >>= 1;
|
|
21
|
-
count += 1;
|
|
22
|
-
}
|
|
23
|
-
return 1 << count;
|
|
24
|
-
}
|
|
25
|
-
export function drawTextTexture(canvas, text, textStyle) {
|
|
26
|
-
var { bold = false, italic = false, fontFamily = 'Serif', fontSize = 10, fontColor = 'black' } = textStyle || {};
|
|
27
|
-
var ctx = canvas.getContext('2d');
|
|
28
|
-
ctx.imageSmoothingEnabled = false;
|
|
29
|
-
ctx.fillStyle = fontColor;
|
|
30
|
-
ctx.strokeStyle = fontColor;
|
|
31
|
-
ctx.font = fontStyle(bold, italic, fontSize, fontFamily);
|
|
32
|
-
ctx.textBaseline = 'top';
|
|
33
|
-
ctx.textAlign = 'left';
|
|
34
|
-
ctx.fillText(String(text), 0, 0);
|
|
35
|
-
/* TODO multiline 시 검토 */
|
|
36
|
-
// var lineText = String(text).split('\n')
|
|
37
|
-
// lineText.forEach((t, i) => {
|
|
38
|
-
// ctx.fillText(t, 0, Number(i) * lineHeight)
|
|
39
|
-
// ctx.strokeText(t, 0, Number(i) * lineHeight)
|
|
40
|
-
// })
|
|
41
|
-
}
|
|
42
|
-
export function textTexture(text, width, height, textStyle) {
|
|
43
|
-
// TODO component.text의 heavy한 로직을 반복적으로 실행하지 않도록, 캐싱하자.
|
|
44
|
-
var poweredWidth = nextPowerOf2(width);
|
|
45
|
-
var poweredHeight = nextPowerOf2(height);
|
|
46
|
-
let canvas = createCanvas(poweredWidth, poweredHeight);
|
|
47
|
-
drawTextTexture(canvas, text, textStyle);
|
|
48
|
-
var texture = new THREE.CanvasTexture(canvas);
|
|
49
|
-
texture.needsUpdate = true;
|
|
50
|
-
texture.wrapS = THREE.RepeatWrapping;
|
|
51
|
-
texture.wrapT = THREE.RepeatWrapping;
|
|
52
|
-
texture.offset.set(0, 1 - height / poweredHeight);
|
|
53
|
-
texture.repeat.set(width / poweredWidth, height / poweredHeight);
|
|
54
|
-
texture.minFilter = THREE.LinearFilter;
|
|
55
|
-
return texture;
|
|
56
|
-
}
|
|
57
|
-
export function textBounds(text, textStyle) {
|
|
58
|
-
let { bold = false, italic = false, fontFamily = 'Serif', fontSize = 10, lineHeight = 'normal' } = textStyle || {};
|
|
59
|
-
if (text === undefined || text == '') {
|
|
60
|
-
text = ' ';
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
text = String(text);
|
|
64
|
-
}
|
|
65
|
-
let span = document.createElement('span');
|
|
66
|
-
span.style.font = fontStyle(bold, italic, fontSize, fontFamily);
|
|
67
|
-
span.style.lineHeight = String(lineHeight);
|
|
68
|
-
span.style.whiteSpace = 'pre';
|
|
69
|
-
span.style.position = 'absolute';
|
|
70
|
-
span.textContent = text;
|
|
71
|
-
document.body.appendChild(span);
|
|
72
|
-
let textBounds = span.getBoundingClientRect();
|
|
73
|
-
document.body.removeChild(span);
|
|
74
|
-
return {
|
|
75
|
-
width: textBounds.width,
|
|
76
|
-
height: textBounds.height
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=text-texture.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text-texture.js","sourceRoot":"","sources":["../../../src/threed/texture/text-texture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,MAAM,UAAU,SAAS,CAAC,IAAa,EAAE,MAAe,EAAE,QAAgB,EAAE,UAAkB;IAC5F,OAAO;QACL,CAAC,MAAM,EAAE,IAAI,CAAC;QACd,CAAC,QAAQ,EAAE,MAAM,CAAC;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S,IAAI,EAAE,CAAA;IAElH,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC;QACrC,IAAI,GAAG,GAAG,CAAA;IACZ,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;IACrB,CAAC;IAED,IAAI,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;IACzC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAA;IAC/D,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;IAC1C,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,KAAK,CAAA;IAC7B,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAA;IAChC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA;IAEvB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IAE/B,IAAI,UAAU,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAA;IAE7C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IAE/B,OAAO;QACL,KAAK,EAAE,UAAU,CAAC,KAAK;QACvB,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAA;AACH,CAAC","sourcesContent":["import * as THREE from 'three'\n\nimport { createCanvas } from '../html/elements.js'\n\nexport function fontStyle(bold: boolean, italic: boolean, fontSize: number, fontFamily: string): string {\n return [\n ['bold', bold],\n ['italic', italic],\n [fontSize + 'px', true],\n [fontFamily, true]\n ]\n .filter(p => p[1])\n .map(p => p[0])\n .join(' ')\n}\n\nfunction nextPowerOf2(n: number) {\n var count = 0\n\n if (n && !(n & (n - 1))) {\n return n\n }\n\n while (n != 0) {\n n >>= 1\n count += 1\n }\n\n return 1 << count\n}\n\nexport function drawTextTexture(canvas: HTMLCanvasElement, text: string, textStyle: any) {\n var { bold = false, italic = false, fontFamily = 'Serif', fontSize = 10, fontColor = 'black' } = textStyle || {}\n\n var ctx = canvas.getContext('2d')\n ctx!.imageSmoothingEnabled = false\n\n ctx!.fillStyle = fontColor\n ctx!.strokeStyle = fontColor\n ctx!.font = fontStyle(bold, italic, fontSize, fontFamily)\n ctx!.textBaseline = 'top'\n ctx!.textAlign = 'left'\n ctx!.fillText(String(text), 0, 0)\n\n /* TODO multiline 시 검토 */\n // var lineText = String(text).split('\\n')\n // lineText.forEach((t, i) => {\n // ctx.fillText(t, 0, Number(i) * lineHeight)\n // ctx.strokeText(t, 0, Number(i) * lineHeight)\n // })\n}\n\nexport function textTexture(text: string, width: number, height: number, textStyle: any) {\n // TODO component.text의 heavy한 로직을 반복적으로 실행하지 않도록, 캐싱하자.\n var poweredWidth = nextPowerOf2(width)\n var poweredHeight = nextPowerOf2(height)\n\n let canvas = createCanvas(poweredWidth, poweredHeight)\n\n drawTextTexture(canvas, text, textStyle)\n\n var texture = new THREE.CanvasTexture(canvas)\n\n texture.needsUpdate = true\n texture.wrapS = THREE.RepeatWrapping\n texture.wrapT = THREE.RepeatWrapping\n texture.offset.set(0, 1 - height / poweredHeight)\n texture.repeat.set(width / poweredWidth, height / poweredHeight)\n texture.minFilter = THREE.LinearFilter\n\n return texture\n}\n\nexport function textBounds(text: string, textStyle: any): { width: number; height: number } {\n let { bold = false, italic = false, fontFamily = 'Serif', fontSize = 10, lineHeight = 'normal' } = textStyle || {}\n\n if (text === undefined || text == '') {\n text = ' '\n } else {\n text = String(text)\n }\n\n let span = document.createElement('span')\n span.style.font = fontStyle(bold, italic, fontSize, fontFamily)\n span.style.lineHeight = String(lineHeight)\n span.style.whiteSpace = 'pre'\n span.style.position = 'absolute'\n span.textContent = text\n\n document.body.appendChild(span)\n\n let textBounds = span.getBoundingClientRect()\n\n document.body.removeChild(span)\n\n return {\n width: textBounds.width,\n height: textBounds.height\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"three-dimensional-container.js","sourceRoot":"","sources":["../../src/threed/three-dimensional-container.ts"],"names":[],"mappings":"","sourcesContent":["export interface ThreeDimensionalContainer {\n is3dContainer(): boolean\n get scene3d(): THREE.Scene | undefined\n get renderer3d(): THREE.WebGLRenderer | undefined\n get mixer(): THREE.AnimationMixer | undefined\n get zoom(): number | undefined\n}\n"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
type ExtrudedOptions = {
|
|
3
|
-
depth: number;
|
|
4
|
-
};
|
|
5
|
-
export declare class BoundUVGenerator {
|
|
6
|
-
bb?: THREE.Box2;
|
|
7
|
-
extrudedShape?: THREE.Shape;
|
|
8
|
-
extrudedOptions?: ExtrudedOptions;
|
|
9
|
-
setShape({ extrudedShape, extrudedOptions }: {
|
|
10
|
-
extrudedShape: THREE.Shape;
|
|
11
|
-
extrudedOptions: ExtrudedOptions;
|
|
12
|
-
}): void;
|
|
13
|
-
generateTopUV(geometry: THREE.BufferGeometry, vertices: number[], indexA: number, indexB: number, indexC: number): THREE.Vector2[];
|
|
14
|
-
generateSideWallUV(geometry: THREE.BufferGeometry, vertices: number[], indexA: number, indexB: number, indexC: number, indexD: number): THREE.Vector2[];
|
|
15
|
-
}
|
|
16
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
export class BoundUVGenerator {
|
|
3
|
-
setShape({ extrudedShape, extrudedOptions }) {
|
|
4
|
-
var _a;
|
|
5
|
-
this.extrudedShape = extrudedShape;
|
|
6
|
-
this.bb = new THREE.Box2();
|
|
7
|
-
this.bb.setFromPoints((_a = this.extrudedShape) === null || _a === void 0 ? void 0 : _a.extractPoints(0).shape);
|
|
8
|
-
this.extrudedOptions = extrudedOptions;
|
|
9
|
-
}
|
|
10
|
-
generateTopUV(geometry, vertices, indexA, indexB, indexC) {
|
|
11
|
-
const ax = vertices[indexA * 3], ay = vertices[indexA * 3 + 1], bx = vertices[indexB * 3], by = vertices[indexB * 3 + 1], cx = vertices[indexC * 3], cy = vertices[indexC * 3 + 1], bb = this.bb, //extrudedShape.getBoundingBox(),
|
|
12
|
-
bbx = bb.max.x - bb.min.x, bby = bb.max.y - bb.min.y;
|
|
13
|
-
return [
|
|
14
|
-
new THREE.Vector2((ax - bb.min.x) / bbx, 1.0 - (ay - bb.min.y) / bby),
|
|
15
|
-
new THREE.Vector2((bx - bb.min.x) / bbx, 1.0 - (by - bb.min.y) / bby),
|
|
16
|
-
new THREE.Vector2((cx - bb.min.x) / bbx, 1.0 - (cy - bb.min.y) / bby)
|
|
17
|
-
];
|
|
18
|
-
}
|
|
19
|
-
generateSideWallUV(geometry, vertices, indexA, indexB, indexC, indexD) {
|
|
20
|
-
var _a;
|
|
21
|
-
const ax = vertices[indexA * 3], ay = vertices[indexA * 3 + 1], az = vertices[indexA * 3 + 2], bx = vertices[indexB * 3], by = vertices[indexB * 3 + 1], bz = vertices[indexB * 3 + 2], cx = vertices[indexC * 3], cy = vertices[indexC * 3 + 1], cz = vertices[indexC * 3 + 2], dx = vertices[indexD * 3], dy = vertices[indexD * 3 + 1], dz = vertices[indexD * 3 + 2];
|
|
22
|
-
const amt = ((_a = this.extrudedOptions) === null || _a === void 0 ? void 0 : _a.depth) || 100, bb = this.bb, //extrudedShape.getBoundingBox(),
|
|
23
|
-
bbx = bb.max.x - bb.min.x, bby = bb.max.y - bb.min.y;
|
|
24
|
-
if (Math.abs(ay - by) < 0.01) {
|
|
25
|
-
return [
|
|
26
|
-
new THREE.Vector2(ax / bbx, 1.0 - az / amt),
|
|
27
|
-
new THREE.Vector2(bx / bbx, 1.0 - bz / amt),
|
|
28
|
-
new THREE.Vector2(cx / bbx, 1.0 - cz / amt),
|
|
29
|
-
new THREE.Vector2(dx / bbx, 1.0 - dz / amt)
|
|
30
|
-
];
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
return [
|
|
34
|
-
new THREE.Vector2(ay / bby, 1.0 - az / amt),
|
|
35
|
-
new THREE.Vector2(by / bby, 1.0 - bz / amt),
|
|
36
|
-
new THREE.Vector2(cy / bby, 1.0 - cz / amt),
|
|
37
|
-
new THREE.Vector2(dy / bby, 1.0 - dz / amt)
|
|
38
|
-
];
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=bound-uv-generator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bound-uv-generator.js","sourceRoot":"","sources":["../../../src/threed/utils/bound-uv-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,OAAO,gBAAgB;IAK3B,QAAQ,CAAC,EAAE,aAAa,EAAE,eAAe,EAAoE;;QAC3G,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;QAClC,IAAI,CAAC,EAAE,GAAG,IAAI,KAAK,CAAC,IAAI,EAAE,CAAA;QAE1B,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,MAAA,IAAI,CAAC,aAAa,0CAAE,aAAa,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;QACjE,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;IACxC,CAAC;IAED,aAAa,CAAC,QAA8B,EAAE,QAAkB,EAAE,MAAc,EAAE,MAAc,EAAE,MAAc;QAC9G,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,EAC7B,EAAE,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,EAC7B,EAAE,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,EACzB,EAAE,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,EAC7B,EAAE,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,EACzB,EAAE,GAAG,QAAQ,CAAC,MAAM,G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AO,CAAC,EAAE,GAAG,GAAG,EAAE,GAAG,GAAG,EAAE,GAAG,GAAG,CAAC;aAC5C,CAAA;QACH,CAAC;aAAM,CAAC;YACN,OAAO;gBACL,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,GAAG,GAAG,EAAE,GAAG,GAAG,EAAE,GAAG,GAAG,CAAC;gBAC3C,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,GAAG,GAAG,EAAE,GAAG,GAAG,EAAE,GAAG,GAAG,CAAC;gBAC3C,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,GAAG,GAAG,EAAE,GAAG,GAAG,EAAE,GAAG,GAAG,CAAC;gBAC3C,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,GAAG,GAAG,EAAE,GAAG,GAAG,EAAE,GAAG,GAAG,CAAC;aAC5C,CAAA;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["import * as THREE from 'three'\n\ntype ExtrudedOptions = {\n depth: number\n}\n\nexport class BoundUVGenerator {\n bb?: THREE.Box2\n extrudedShape?: THREE.Shape\n extrudedOptions?: ExtrudedOptions\n\n setShape({ extrudedShape, extrudedOptions }: { extrudedShape: THREE.Shape; extrudedOptions: ExtrudedOptions }) {\n this.extrudedShape = extrudedShape\n this.bb = new THREE.Box2()\n\n this.bb.setFromPoints(this.extrudedShape?.extractPoints(0).shape)\n this.extrudedOptions = extrudedOptions\n }\n\n generateTopUV(geometry: THREE.BufferGeometry, vertices: number[], indexA: number, indexB: number, indexC: number) {\n const ax = vertices[indexA * 3],\n ay = vertices[indexA * 3 + 1],\n bx = vertices[indexB * 3],\n by = vertices[indexB * 3 + 1],\n cx = vertices[indexC * 3],\n cy = vertices[indexC * 3 + 1],\n bb = this.bb!, //extrudedShape.getBoundingBox(),\n bbx = bb.max.x - bb.min.x,\n bby = bb.max.y - bb.min.y\n\n return [\n new THREE.Vector2((ax - bb.min.x) / bbx, 1.0 - (ay - bb.min.y) / bby),\n new THREE.Vector2((bx - bb.min.x) / bbx, 1.0 - (by - bb.min.y) / bby),\n new THREE.Vector2((cx - bb.min.x) / bbx, 1.0 - (cy - bb.min.y) / bby)\n ]\n }\n\n generateSideWallUV(\n geometry: THREE.BufferGeometry,\n vertices: number[],\n indexA: number,\n indexB: number,\n indexC: number,\n indexD: number\n ) {\n const ax = vertices[indexA * 3],\n ay = vertices[indexA * 3 + 1],\n az = vertices[indexA * 3 + 2],\n bx = vertices[indexB * 3],\n by = vertices[indexB * 3 + 1],\n bz = vertices[indexB * 3 + 2],\n cx = vertices[indexC * 3],\n cy = vertices[indexC * 3 + 1],\n cz = vertices[indexC * 3 + 2],\n dx = vertices[indexD * 3],\n dy = vertices[indexD * 3 + 1],\n dz = vertices[indexD * 3 + 2]\n\n const amt = this.extrudedOptions?.depth || 100,\n bb = this.bb!, //extrudedShape.getBoundingBox(),\n bbx = bb.max.x - bb.min.x,\n bby = bb.max.y - bb.min.y\n\n if (Math.abs(ay - by) < 0.01) {\n return [\n new THREE.Vector2(ax / bbx, 1.0 - az / amt),\n new THREE.Vector2(bx / bbx, 1.0 - bz / amt),\n new THREE.Vector2(cx / bbx, 1.0 - cz / amt),\n new THREE.Vector2(dx / bbx, 1.0 - dz / amt)\n ]\n } else {\n return [\n new THREE.Vector2(ay / bby, 1.0 - az / amt),\n new THREE.Vector2(by / bby, 1.0 - bz / amt),\n new THREE.Vector2(cy / bby, 1.0 - cz / amt),\n new THREE.Vector2(dy / bby, 1.0 - dz / amt)\n ]\n }\n }\n}\n"]}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const TEXTURE_KEYS = [
|
|
2
|
-
'map',
|
|
3
|
-
'normalMap',
|
|
4
|
-
'roughnessMap',
|
|
5
|
-
'metalnessMap',
|
|
6
|
-
'aoMap',
|
|
7
|
-
'emissiveMap',
|
|
8
|
-
'bumpMap',
|
|
9
|
-
'displacementMap',
|
|
10
|
-
'alphaMap',
|
|
11
|
-
'envMap',
|
|
12
|
-
'lightMap'
|
|
13
|
-
];
|
|
14
|
-
function disposeMaterial(material) {
|
|
15
|
-
for (const key of TEXTURE_KEYS) {
|
|
16
|
-
const texture = material[key];
|
|
17
|
-
texture === null || texture === void 0 ? void 0 : texture.dispose();
|
|
18
|
-
}
|
|
19
|
-
material.dispose();
|
|
20
|
-
}
|
|
21
|
-
export function disposeObject3D(obj) {
|
|
22
|
-
obj.traverse((child) => {
|
|
23
|
-
var _a;
|
|
24
|
-
(_a = child.geometry) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
25
|
-
if (child.material) {
|
|
26
|
-
const materials = Array.isArray(child.material) ? child.material : [child.material];
|
|
27
|
-
for (const m of materials)
|
|
28
|
-
disposeMaterial(m);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=dispose.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dispose.js","sourceRoot":"","sources":["../../../src/threed/utils/dispose.ts"],"names":[],"mappings":"AAEA,MAAM,YAAY,GAAG;IACnB,KAAK;IACL,WAAW;IACX,cAAc;IACd,cAAc;IACd,OAAO;IACP,aAAa;IACb,SAAS;IACT,iBAAiB;IACjB,UAAU;IACV,QAAQ;IACR,UAAU;CACF,CAAA;AAEV,SAAS,eAAe,CAAC,QAAwB;IAC/C,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAI,QAAgB,CAAC,GAAG,CAA8B,CAAA;QACnE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,EAAE,CAAA;IACpB,CAAC;IACD,QAAQ,CAAC,OAAO,EAAE,CAAA;AACpB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,GAAmB;IACjD,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAU,EAAE,EAAE;;QAC1B,MAAA,KAAK,CAAC,QAAQ,0CAAE,OAAO,EAAE,CAAA;QACzB,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;YACnF,KAAK,MAAM,CAAC,IAAI,SAAS;gBAAE,eAAe,CAAC,CAAC,CAAC,CAAA;QAC/C,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import * as THREE from 'three'\n\nconst TEXTURE_KEYS = [\n 'map',\n 'normalMap',\n 'roughnessMap',\n 'metalnessMap',\n 'aoMap',\n 'emissiveMap',\n 'bumpMap',\n 'displacementMap',\n 'alphaMap',\n 'envMap',\n 'lightMap'\n] as const\n\nfunction disposeMaterial(material: THREE.Material) {\n for (const key of TEXTURE_KEYS) {\n const texture = (material as any)[key] as THREE.Texture | undefined\n texture?.dispose()\n }\n material.dispose()\n}\n\nexport function disposeObject3D(obj: THREE.Object3D) {\n obj.traverse((child: any) => {\n child.geometry?.dispose()\n if (child.material) {\n const materials = Array.isArray(child.material) ? child.material : [child.material]\n for (const m of materials) disposeMaterial(m)\n }\n })\n}\n"]}
|
package/dist/wall.d.ts
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import { ComponentNature, Shape, RealObject, RealObjectMesh } from '@hatiolab/things-scene';
|
|
2
|
-
export declare class Wall3D extends RealObjectMesh {
|
|
3
|
-
buildGeometry(): void;
|
|
4
|
-
}
|
|
5
|
-
declare const Wall_base: (new (...args: any[]) => {
|
|
6
|
-
contains(x: any, y: any): boolean;
|
|
7
|
-
get path(): {
|
|
8
|
-
x: any;
|
|
9
|
-
y: any;
|
|
10
|
-
}[];
|
|
11
|
-
set path(path: {
|
|
12
|
-
x: any;
|
|
13
|
-
y: any;
|
|
14
|
-
}[]): any;
|
|
15
|
-
get anchors(): {
|
|
16
|
-
name: string;
|
|
17
|
-
position: {
|
|
18
|
-
x: any;
|
|
19
|
-
y: any;
|
|
20
|
-
};
|
|
21
|
-
}[];
|
|
22
|
-
get bounds(): any;
|
|
23
|
-
set bounds(bounds: any): any;
|
|
24
|
-
render(ctx: any): void;
|
|
25
|
-
_app: any;
|
|
26
|
-
_model: any;
|
|
27
|
-
_state: any;
|
|
28
|
-
_delta: any;
|
|
29
|
-
_animation: any;
|
|
30
|
-
_animate: any;
|
|
31
|
-
_parent: any;
|
|
32
|
-
_disposed: any;
|
|
33
|
-
_textHidden: any;
|
|
34
|
-
_text_substitutor: any;
|
|
35
|
-
_value_substitutor: any;
|
|
36
|
-
_mappings: any;
|
|
37
|
-
_realObject: import("@hatiolab/things-scene").IRealObject | undefined;
|
|
38
|
-
_cachedState: any;
|
|
39
|
-
updatedAt: any;
|
|
40
|
-
fontSize: any;
|
|
41
|
-
__cache__: any;
|
|
42
|
-
created(): void;
|
|
43
|
-
added(parent: any): void;
|
|
44
|
-
removed(parent: any): void;
|
|
45
|
-
ready(): Promise<void>;
|
|
46
|
-
touch(): void;
|
|
47
|
-
clearCache(...attrs: any[]): void;
|
|
48
|
-
removeSelf(completely: any): void;
|
|
49
|
-
resetAnimation(): void;
|
|
50
|
-
dispose(): void;
|
|
51
|
-
get nature(): import("@hatiolab/things-scene").ComponentNature;
|
|
52
|
-
get disposed(): boolean;
|
|
53
|
-
isLayer(): boolean;
|
|
54
|
-
isGroup(): boolean;
|
|
55
|
-
isContainer(): this is import("@hatiolab/things-scene/dist-types/types/component").Container;
|
|
56
|
-
isLine(): boolean;
|
|
57
|
-
isRoot(): boolean;
|
|
58
|
-
isRootModel(): boolean;
|
|
59
|
-
is3dish(): boolean;
|
|
60
|
-
isIn3DSpace(): boolean;
|
|
61
|
-
isTemplate(): boolean;
|
|
62
|
-
isHTMLElement(): boolean;
|
|
63
|
-
isConnectable(): boolean;
|
|
64
|
-
isIdentifiable(): boolean;
|
|
65
|
-
isPositionable(): boolean;
|
|
66
|
-
replaceRefids(replaceMap: any): void;
|
|
67
|
-
get(property: any): any;
|
|
68
|
-
set(props: any, propval?: any): any;
|
|
69
|
-
getState(property: any): any;
|
|
70
|
-
setState(props: any, propval?: any): any;
|
|
71
|
-
get model(): any;
|
|
72
|
-
get state(): any;
|
|
73
|
-
get hierarchy(): any;
|
|
74
|
-
get volatile(): never[];
|
|
75
|
-
_applyProps(target: any, props: any, options: any): any;
|
|
76
|
-
move(offset: {
|
|
77
|
-
x: number;
|
|
78
|
-
y: number;
|
|
79
|
-
}, ...args: boolean[]): void;
|
|
80
|
-
symmetryX(x?: number): void;
|
|
81
|
-
symmetryY(y: number): void;
|
|
82
|
-
adjustResize(bounds: import("@hatiolab/things-scene").BOUNDS, origin_bounds: import("@hatiolab/things-scene").BOUNDS, diagonal: boolean): any;
|
|
83
|
-
adjustRotation(rotation: number, step: boolean): any;
|
|
84
|
-
outline(progress: number): any;
|
|
85
|
-
get center(): import("@hatiolab/things-scene").POINT;
|
|
86
|
-
set center(p: import("@hatiolab/things-scene").POINT): any;
|
|
87
|
-
get location(): import("@hatiolab/things-scene").POINT;
|
|
88
|
-
set location(l: import("@hatiolab/things-scene").POINT): any;
|
|
89
|
-
get rotate(): import("@hatiolab/things-scene").POINT;
|
|
90
|
-
set rotate(r: import("@hatiolab/things-scene").POINT): any;
|
|
91
|
-
get dimension(): import("@hatiolab/things-scene").DIMENSION;
|
|
92
|
-
set dimension(d: import("@hatiolab/things-scene").DIMENSION): any;
|
|
93
|
-
get drawPath(): import("@hatiolab/things-scene").POINT[];
|
|
94
|
-
get rotatePoint(): import("@hatiolab/things-scene").POINT;
|
|
95
|
-
get mutable(): boolean;
|
|
96
|
-
get resizable(): boolean;
|
|
97
|
-
get rotatable(): boolean;
|
|
98
|
-
buildRealObject(): import("@hatiolab/things-scene").IRealObject | undefined;
|
|
99
|
-
get realObject(): import("@hatiolab/things-scene").IRealObject | undefined;
|
|
100
|
-
draw(context?: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
101
|
-
prerender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
102
|
-
postrender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
103
|
-
prepare(resolve: (component: import("@hatiolab/things-scene").Component) => void, reject: (reason: any) => void): void;
|
|
104
|
-
prepareIf(condition: boolean): void;
|
|
105
|
-
drawText(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
106
|
-
drawStroke(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
107
|
-
drawFill(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
108
|
-
get strokeStyle(): any;
|
|
109
|
-
set strokeStyle(v: any): any;
|
|
110
|
-
get fillStyle(): any;
|
|
111
|
-
set fillStyle(v: any): any;
|
|
112
|
-
get fontColor(): string;
|
|
113
|
-
set fontColor(v: string): any;
|
|
114
|
-
get rotation(): number;
|
|
115
|
-
set rotation(v: number): any;
|
|
116
|
-
get decorators(): string[];
|
|
117
|
-
get decotag(): string;
|
|
118
|
-
get hidden(): boolean;
|
|
119
|
-
set hidden(v: boolean): any;
|
|
120
|
-
get tag(): string;
|
|
121
|
-
set tag(v: string): any;
|
|
122
|
-
get appendum(): any;
|
|
123
|
-
set appendum(v: any): any;
|
|
124
|
-
defaultTextSubstitutor(): any;
|
|
125
|
-
textLines(context?: import("@hatiolab/things-scene").SceneRenderContext): any;
|
|
126
|
-
get font(): string;
|
|
127
|
-
get lineHeight(): number;
|
|
128
|
-
get textSubstitutor(): () => string;
|
|
129
|
-
get text(): string;
|
|
130
|
-
set text(v: string): any;
|
|
131
|
-
get textBounds(): import("@hatiolab/things-scene").BOUNDS;
|
|
132
|
-
get textRotation(): number;
|
|
133
|
-
get textHidden(): boolean;
|
|
134
|
-
set textHidden(v: boolean): any;
|
|
135
|
-
get hasTextProperty(): boolean;
|
|
136
|
-
animate(opts: import("@hatiolab/things-scene/dist-types/animation/interfaces").AnimationConfig): any;
|
|
137
|
-
effect(context: import("@hatiolab/things-scene").SceneRenderContext, model: any): any;
|
|
138
|
-
serialize(...others: any[]): any;
|
|
139
|
-
trim(): void;
|
|
140
|
-
closeScene(data: any): void;
|
|
141
|
-
delta(attr?: string | object, value?: any): any;
|
|
142
|
-
invalidate(): void;
|
|
143
|
-
get value(): any;
|
|
144
|
-
set value(v: any): any;
|
|
145
|
-
get data(): any;
|
|
146
|
-
set data(v: any): any;
|
|
147
|
-
set tap(v: any): any;
|
|
148
|
-
get mappings(): any[];
|
|
149
|
-
get retention(): number;
|
|
150
|
-
get animation(): import("@hatiolab/things-scene/dist-types/animation/interfaces").AnimationController | undefined;
|
|
151
|
-
get started(): boolean;
|
|
152
|
-
set started(v: boolean): any;
|
|
153
|
-
get controls(): import("@hatiolab/things-scene").Control[] | undefined;
|
|
154
|
-
findFirst(finder: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): any;
|
|
155
|
-
findAll(s: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): any;
|
|
156
|
-
capture(x: number, y: number, except?: (c: import("@hatiolab/things-scene").Component) => boolean): any;
|
|
157
|
-
findAnchor(name: string): any;
|
|
158
|
-
isDescendible(container: import("@hatiolab/things-scene").Component): any;
|
|
159
|
-
getContext(component?: unknown): any;
|
|
160
|
-
get root(): import("@hatiolab/things-scene").Component;
|
|
161
|
-
get rootModel(): import("@hatiolab/things-scene").Component;
|
|
162
|
-
get parent(): import("@hatiolab/things-scene").Component;
|
|
163
|
-
set parent(v: import("@hatiolab/things-scene").Component): any;
|
|
164
|
-
get scalable(): boolean;
|
|
165
|
-
get stuck(): boolean;
|
|
166
|
-
get capturable(): boolean;
|
|
167
|
-
get position(): string;
|
|
168
|
-
get origin(): string;
|
|
169
|
-
get offset(): import("@hatiolab/things-scene").POINT;
|
|
170
|
-
get app(): import("@hatiolab/things-scene").ApplicationContext;
|
|
171
|
-
drawEffect(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
172
|
-
prepareFill(resolve: Function, reject: Function): void;
|
|
173
|
-
prepareFillIf(condition: boolean): void;
|
|
174
|
-
onchangeFill(after: Record<string, any>, before: Record<string, any>): void;
|
|
175
|
-
drawImage(context: import("@hatiolab/things-scene").SceneRenderContext, image: HTMLImageElement, left: number, top: number, width: number, height: number): void;
|
|
176
|
-
mutateBounds(logic: ((bounds: import("@hatiolab/things-scene").BOUNDS) => import("@hatiolab/things-scene").BOUNDS | void) | null, context?: any): void;
|
|
177
|
-
mutatePath(beforeLogic: ((path: import("@hatiolab/things-scene").POINT[]) => import("@hatiolab/things-scene").POINT[] | void) | null, afterLogic: ((path: import("@hatiolab/things-scene").POINT[]) => import("@hatiolab/things-scene").POINT[] | void) | null, context?: any): void;
|
|
178
|
-
access(accessor: string, data: any): any;
|
|
179
|
-
substitute(template: string, data: any): any;
|
|
180
|
-
onchangeMappings(after: Record<string, any>, before: Record<string, any>): void;
|
|
181
|
-
onchangeData(after: Record<string, any>, before: Record<string, any>): void;
|
|
182
|
-
buildMappings(): void;
|
|
183
|
-
executeMappings(force?: boolean): void;
|
|
184
|
-
disposeMappings(): void;
|
|
185
|
-
ondropfile(transfered: FileList, files: string[]): void;
|
|
186
|
-
transcoordS2P(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
187
|
-
transcoordP2S(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
188
|
-
transcoordS2T(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
189
|
-
transcoordT2P(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
190
|
-
transcoordT2S(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
191
|
-
transcoordS2TR(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
192
|
-
transcoordS2O(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
193
|
-
transcoordC2S(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
194
|
-
transcoordS2C(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
195
|
-
toParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
196
|
-
fromParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
197
|
-
toScene(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
198
|
-
fromScene(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
199
|
-
toLocal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
200
|
-
toGlobal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
201
|
-
toOther(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
202
|
-
on(name: string | object, callback: Function, context?: any): any;
|
|
203
|
-
off(name?: string | object, callback?: Function, context?: any): any;
|
|
204
|
-
once(name: string | object, callback: Function, context?: any): any;
|
|
205
|
-
trigger(name: string, ...args: any[]): any;
|
|
206
|
-
delegate_on(delegator: any): any;
|
|
207
|
-
delegate_off(delegator: any): any;
|
|
208
|
-
onchange(after: Record<string, any>, before: Record<string, any>): void;
|
|
209
|
-
calculateBounds?(): void;
|
|
210
|
-
oncreate_element?(element: HTMLElement): void;
|
|
211
|
-
removeComponent(component: import("@hatiolab/things-scene").Component, ghost?: boolean): void;
|
|
212
|
-
addComponent(component: import("@hatiolab/things-scene").Component, ghost?: boolean): void;
|
|
213
|
-
insertComponentAt(component: import("@hatiolab/things-scene").Component, index: number, ghost?: boolean): void;
|
|
214
|
-
getOverlay(component: import("@hatiolab/things-scene").Component): HTMLElement | undefined;
|
|
215
|
-
findById(id: string): import("@hatiolab/things-scene").Component | undefined;
|
|
216
|
-
findByRefid(ref: string | number): import("@hatiolab/things-scene").Component | undefined;
|
|
217
|
-
findAllById(id: string): import("@hatiolab/things-scene").Component[];
|
|
218
|
-
resize(): void;
|
|
219
|
-
fit(type?: string): void;
|
|
220
|
-
get components(): import("@hatiolab/things-scene").Component[] | undefined;
|
|
221
|
-
get layout(): any;
|
|
222
|
-
get auxOverlay(): HTMLElement | undefined;
|
|
223
|
-
get isReady(): boolean;
|
|
224
|
-
get unitScale(): number;
|
|
225
|
-
get selected(): import("@hatiolab/things-scene").Component[];
|
|
226
|
-
set selected(_v: import("@hatiolab/things-scene").Component[]): any;
|
|
227
|
-
get focused(): import("@hatiolab/things-scene").Component | null;
|
|
228
|
-
set focused(_v: import("@hatiolab/things-scene").Component | null): any;
|
|
229
|
-
get hasSameParentForAllSelected(): boolean;
|
|
230
|
-
set hasSameParentForAllSelected(_v: boolean): any;
|
|
231
|
-
get fitMode(): string | undefined;
|
|
232
|
-
set fitMode(_v: string | undefined): any;
|
|
233
|
-
get element(): HTMLElement | null;
|
|
234
|
-
set element(_v: HTMLElement | null): any;
|
|
235
|
-
}) & typeof Shape;
|
|
236
|
-
export declare class Wall extends Wall_base {
|
|
237
|
-
is3dish(): boolean;
|
|
238
|
-
buildRealObject(): RealObject | undefined;
|
|
239
|
-
get nature(): ComponentNature;
|
|
240
|
-
}
|
|
241
|
-
export {};
|
package/dist/wall.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
4
|
-
*/
|
|
5
|
-
import { RectPath, Shape, sceneComponent, RealObjectMesh } from '@hatiolab/things-scene';
|
|
6
|
-
import * as THREE from 'three';
|
|
7
|
-
const NATURE = {
|
|
8
|
-
mutable: false,
|
|
9
|
-
resizable: true,
|
|
10
|
-
rotatable: true,
|
|
11
|
-
properties: [
|
|
12
|
-
{
|
|
13
|
-
type: 'number',
|
|
14
|
-
label: 'depth',
|
|
15
|
-
name: 'depth',
|
|
16
|
-
property: 'depth'
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
|
-
help: 'scene/component/wall'
|
|
20
|
-
};
|
|
21
|
-
export class Wall3D extends RealObjectMesh {
|
|
22
|
-
buildGeometry() {
|
|
23
|
-
var { width = 0, height = 0, depth = 0 } = this.component.state;
|
|
24
|
-
let geometry = new THREE.BoxGeometry(1, 1, 1);
|
|
25
|
-
geometry.scale(width, depth, height);
|
|
26
|
-
this.object3d.geometry = geometry;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
let Wall = class Wall extends RectPath(Shape) {
|
|
30
|
-
is3dish() {
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
buildRealObject() {
|
|
34
|
-
return new Wall3D(this);
|
|
35
|
-
}
|
|
36
|
-
get nature() {
|
|
37
|
-
return NATURE;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
Wall = __decorate([
|
|
41
|
-
sceneComponent('wall')
|
|
42
|
-
], Wall);
|
|
43
|
-
export { Wall };
|
|
44
|
-
//# sourceMappingURL=wall.js.map
|
package/dist/wall.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wall.js","sourceRoot":"","sources":["../src/wall.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,EAA+B,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAc,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACjI,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,OAAO;SAClB;KACF;IACD,IAAI,EAAE,sBAAsB;CAC7B,CAAA;AAED,MAAM,OAAO,MAAO,SAAQ,cAAc;IACxC,aAAa;QACX,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAA;QAE/D,IAAI,QAAQ,GAAG,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;QAC7C,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;QAEpC,IAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAA;IACnC,CAAC;CACF;AAGM,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,QAAQ,CAAC,KAAK,CAAC;IACvC,OAAO;QACL,OAAO,IAAI,CAAA;IACb,CAAC;IAED,eAAe;QACb,OAAO,IAAI,MAAM,CAAC,IAAW,CAAC,CAAA;IAChC,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CAAA;AAZY,IAAI;IADhB,cAAc,CAAC,MAAM,CAAC;GACV,IAAI,CAYhB","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\nimport { ComponentNature, Properties, RectPath, Shape, sceneComponent, RealObject, RealObjectMesh } from '@hatiolab/things-scene'\nimport * as THREE from 'three'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'number',\n label: 'depth',\n name: 'depth',\n property: 'depth'\n }\n ],\n help: 'scene/component/wall'\n}\n\nexport class Wall3D extends RealObjectMesh {\n buildGeometry() {\n var { width = 0, height = 0, depth = 0 } = this.component.state\n\n let geometry = new THREE.BoxGeometry(1, 1, 1)\n geometry.scale(width, depth, height)\n\n this.object3d.geometry = geometry\n }\n}\n\n@sceneComponent('wall')\nexport class Wall extends RectPath(Shape) {\n is3dish() {\n return true\n }\n\n buildRealObject(): RealObject | undefined {\n return new Wall3D(this as any)\n }\n\n get nature() {\n return NATURE\n }\n}\n"]}
|