@operato/scene-visualizer 1.2.37 → 1.2.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/db.sqlite +0 -0
- package/dist/camera copy.d.ts +20 -0
- package/dist/camera copy.js +103 -0
- package/dist/camera copy.js.map +1 -0
- package/dist/camera.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/light.d.ts +15 -0
- package/dist/light.js +131 -0
- package/dist/light.js.map +1 -0
- package/dist/point-light.d.ts +14 -0
- package/dist/point-light.js +77 -0
- package/dist/point-light.js.map +1 -0
- package/dist/rack.d.ts +2 -2
- package/dist/stock.d.ts +1 -1
- package/dist/templates/index.d.ts +20 -0
- package/dist/templates/index.js +2 -0
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/light.d.ts +22 -0
- package/dist/templates/light.js +23 -0
- package/dist/templates/light.js.map +1 -0
- package/dist/templates/point-light.d.ts +22 -0
- package/dist/templates/point-light.js +23 -0
- package/dist/templates/point-light.js.map +1 -0
- package/dist/templates/sprite.js +1 -1
- package/dist/templates/sprite.js.map +1 -1
- package/dist/templates/wall copy.d.ts +19 -0
- package/dist/templates/wall copy.js +20 -0
- package/dist/templates/wall copy.js.map +1 -0
- package/dist/three-container.js +0 -18
- package/dist/three-container.js.map +1 -1
- package/dist/threed/real-object-camera-meshed.d.ts +1 -1
- package/dist/threed/real-object-dom-element.d.ts +1 -0
- package/dist/threed/real-object-dom-element.js +6 -0
- package/dist/threed/real-object-dom-element.js.map +1 -1
- package/dist/threed/real-object-extrude.d.ts +1 -1
- package/dist/threed/real-object-mesh.d.ts +2 -2
- package/dist/threed/real-object-sprite.d.ts +1 -0
- package/dist/threed/real-object-sprite.js +6 -0
- package/dist/threed/real-object-sprite.js.map +1 -1
- package/dist/threed/texture/canvas-texture.js +25 -7
- package/dist/threed/texture/canvas-texture.js.map +1 -1
- package/helps/scene/component/light.ko.md +12 -0
- package/helps/scene/component/light.md +12 -0
- package/helps/scene/component/light.zh.md +12 -0
- package/icons/light.png +0 -0
- package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +13 -3
- package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +15 -0
- package/logs/application-2023-05-23-21.log +6 -0
- package/logs/application-2023-05-24-21.log +6 -0
- package/logs/application-2023-05-25-00.log +20 -0
- package/logs/connections-2023-05-23-21.log +41 -0
- package/logs/connections-2023-05-24-21.log +41 -0
- package/logs/connections-2023-05-25-00.log +123 -0
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/light.ts +155 -0
- package/src/templates/index.ts +2 -0
- package/src/templates/light.ts +23 -0
- package/src/templates/sprite.ts +1 -1
- package/src/three-container.ts +0 -21
- package/src/threed/real-object-dom-element.ts +9 -4
- package/src/threed/real-object-sprite.ts +9 -0
- package/src/threed/texture/canvas-texture.ts +32 -6
- package/translations/en.json +6 -1
- package/translations/ko.json +6 -1
- package/translations/ms.json +6 -1
- package/translations/zh.json +6 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/logs/application-2023-05-20-07.log +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.2.39](https://github.com/things-scene/operato-scene/compare/v1.2.38...v1.2.39) (2023-05-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* add light component into 3d module ([110b312](https://github.com/things-scene/operato-scene/commit/110b3121a0ee6e65bd1cbcffb8254e16c0592460))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
## [1.2.37](https://github.com/things-scene/operato-scene/compare/v1.2.36...v1.2.37) (2023-05-21)
|
|
7
16
|
|
|
8
17
|
|
package/db.sqlite
CHANGED
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ComponentNature, Shape } from '@hatiolab/things-scene';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
import { RealObject } from './threed/real-object';
|
|
4
|
+
export declare class Camera3D extends RealObject<THREE.Mesh> {
|
|
5
|
+
camera?: THREE.PerspectiveCamera;
|
|
6
|
+
helper?: THREE.CameraHelper;
|
|
7
|
+
protected getObject3dInstance(): THREE.Mesh<THREE.BufferGeometry, THREE.Material | THREE.Material[]>;
|
|
8
|
+
updateCamera(): void;
|
|
9
|
+
build(): void;
|
|
10
|
+
}
|
|
11
|
+
declare const Camera_base: typeof Shape;
|
|
12
|
+
export declare class Camera extends Camera_base {
|
|
13
|
+
static _image: HTMLImageElement;
|
|
14
|
+
is3dish(): boolean;
|
|
15
|
+
static get image(): HTMLImageElement;
|
|
16
|
+
render(context: CanvasRenderingContext2D): void;
|
|
17
|
+
buildRealObject(): RealObject | undefined;
|
|
18
|
+
get nature(): ComponentNature;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { Component, RectPath, Shape } from '@hatiolab/things-scene';
|
|
5
|
+
import * as THREE from 'three';
|
|
6
|
+
import { RealObject } from './threed/real-object';
|
|
7
|
+
const DEFAULT = {
|
|
8
|
+
far: 100000,
|
|
9
|
+
fov: 80,
|
|
10
|
+
near: 1,
|
|
11
|
+
zoom: 1
|
|
12
|
+
};
|
|
13
|
+
const NATURE = {
|
|
14
|
+
mutable: false,
|
|
15
|
+
resizable: true,
|
|
16
|
+
rotatable: true,
|
|
17
|
+
properties: [
|
|
18
|
+
{
|
|
19
|
+
type: 'number',
|
|
20
|
+
label: 'near',
|
|
21
|
+
name: 'near'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: 'number',
|
|
25
|
+
label: 'far',
|
|
26
|
+
name: 'far'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: 'number',
|
|
30
|
+
label: 'fov',
|
|
31
|
+
name: 'fov'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: 'number',
|
|
35
|
+
label: 'zoom',
|
|
36
|
+
name: 'zoom'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: 'checkbox',
|
|
40
|
+
label: 'show-helper',
|
|
41
|
+
name: 'showHelper'
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
help: 'scene/component/camera'
|
|
45
|
+
};
|
|
46
|
+
export class Camera3D extends RealObject {
|
|
47
|
+
getObject3dInstance() {
|
|
48
|
+
return new THREE.Mesh();
|
|
49
|
+
}
|
|
50
|
+
updateCamera() {
|
|
51
|
+
var { near = DEFAULT.near, far = DEFAULT.far, fov = DEFAULT.fov, zoom = DEFAULT.zoom, showHelper } = this.component.state;
|
|
52
|
+
this.camera.far = far;
|
|
53
|
+
this.camera.fov = fov;
|
|
54
|
+
this.camera.near = near;
|
|
55
|
+
this.camera.zoom = zoom;
|
|
56
|
+
if (showHelper) {
|
|
57
|
+
if (!this.helper) {
|
|
58
|
+
this.helper = new THREE.CameraHelper(this.camera);
|
|
59
|
+
this.object3d.add(this.helper);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else if (this.helper) {
|
|
63
|
+
this.object3d.remove(this.helper);
|
|
64
|
+
delete this.helper;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
build() {
|
|
68
|
+
super.build();
|
|
69
|
+
var { width = 0, height = 0, depth = 0, fillStyle = 'lightgray' } = this.component.state;
|
|
70
|
+
this.object3d.geometry = new THREE.BoxGeometry(width, depth, height);
|
|
71
|
+
this.object3d.material = new THREE.MeshStandardMaterial({ color: fillStyle, side: THREE.FrontSide });
|
|
72
|
+
this.camera = new THREE.PerspectiveCamera();
|
|
73
|
+
this.camera.position.set(0, 0, 0);
|
|
74
|
+
this.object3d.add(this.camera);
|
|
75
|
+
this.object3d.lookAt(0, 0, 0);
|
|
76
|
+
this.updateCamera();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export class Camera extends RectPath(Shape) {
|
|
80
|
+
is3dish() {
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
static get image() {
|
|
84
|
+
if (!Camera._image) {
|
|
85
|
+
Camera._image = new Image();
|
|
86
|
+
Camera._image.src = new URL('../icons/camera-big.png', import.meta.url).href;
|
|
87
|
+
}
|
|
88
|
+
return Camera._image;
|
|
89
|
+
}
|
|
90
|
+
render(context) {
|
|
91
|
+
var { left, top, width, height } = this.bounds;
|
|
92
|
+
context.beginPath();
|
|
93
|
+
this.drawImage(context, Camera.image, left, top, width, height);
|
|
94
|
+
}
|
|
95
|
+
buildRealObject() {
|
|
96
|
+
return new Camera3D(this);
|
|
97
|
+
}
|
|
98
|
+
get nature() {
|
|
99
|
+
return NATURE;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
Component.register('camera', Camera);
|
|
103
|
+
//# sourceMappingURL=camera%20copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera copy.js","sourceRoot":"","sources":["../src/camera copy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAmB,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACpF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,MAAM,OAAO,GAAG;IACd,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,EAAE;IACP,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;CACR,CAAA;AAED,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,E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G,IAAI,KAAK,EAAE,CAAA;YAC3B,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,yBAAyB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;SAC7E;QAED,OAAO,MAAM,CAAC,MAAM,CAAA;IACtB,CAAC;IAED,MAAM,CAAC,OAAiC;QACtC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAE9C,OAAO,CAAC,SAAS,EAAE,CAAA;QACnB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;IACjE,CAAC;IAED,eAAe;QACb,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\nimport { Component, ComponentNature, RectPath, Shape } from '@hatiolab/things-scene'\nimport * as THREE from 'three'\nimport { RealObject } from './threed/real-object'\n\nconst DEFAULT = {\n far: 100000,\n fov: 80,\n near: 1,\n zoom: 1\n}\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'number',\n label: 'near',\n name: 'near'\n },\n {\n type: 'number',\n label: 'far',\n name: 'far'\n },\n {\n type: 'number',\n label: 'fov',\n name: 'fov'\n },\n {\n type: 'number',\n label: 'zoom',\n name: 'zoom'\n },\n {\n type: 'checkbox',\n label: 'show-helper',\n name: 'showHelper'\n }\n ],\n help: 'scene/component/camera'\n}\n\nexport class Camera3D extends RealObject<THREE.Mesh> {\n camera?: THREE.PerspectiveCamera\n helper?: THREE.CameraHelper\n\n protected getObject3dInstance() {\n return new THREE.Mesh()\n }\n\n updateCamera() {\n var {\n near = DEFAULT.near,\n far = DEFAULT.far,\n fov = DEFAULT.fov,\n zoom = DEFAULT.zoom,\n showHelper\n } = this.component.state\n\n this.camera!.far = far\n this.camera!.fov = fov\n this.camera!.near = near\n this.camera!.zoom = zoom\n\n if (showHelper) {\n if (!this.helper) {\n this.helper = new THREE.CameraHelper(this.camera!)\n this.object3d.add(this.helper)\n }\n } else if (this.helper) {\n this.object3d.remove(this.helper)\n delete this.helper\n }\n }\n\n build() {\n super.build()\n\n var { width = 0, height = 0, depth = 0, fillStyle = 'lightgray' } = this.component.state\n\n this.object3d.geometry = new THREE.BoxGeometry(width, depth, height)\n this.object3d.material = new THREE.MeshStandardMaterial({ color: fillStyle, side: THREE.FrontSide })\n\n this.camera = new THREE.PerspectiveCamera()\n this.camera.position.set(0, 0, 0)\n\n this.object3d.add(this.camera)\n this.object3d.lookAt(0, 0, 0)\n\n this.updateCamera()\n }\n}\n\nexport class Camera extends RectPath(Shape) {\n static _image: HTMLImageElement\n\n is3dish() {\n return true\n }\n\n static get image() {\n if (!Camera._image) {\n Camera._image = new Image()\n Camera._image.src = new URL('../icons/camera-big.png', import.meta.url).href\n }\n\n return Camera._image\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n this.drawImage(context, Camera.image, left, top, width, height)\n }\n\n buildRealObject(): RealObject | undefined {\n return new Camera3D(this)\n }\n\n get nature(): ComponentNature {\n return NATURE\n }\n}\n\nComponent.register('camera', Camera)\n"]}
|
package/dist/camera.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { RealObject } from './threed/real-object';
|
|
|
4
4
|
export declare class Camera3D extends RealObject<THREE.Mesh> {
|
|
5
5
|
camera?: THREE.PerspectiveCamera;
|
|
6
6
|
helper?: THREE.CameraHelper;
|
|
7
|
-
protected getObject3dInstance(): THREE.Mesh<THREE.BufferGeometry
|
|
7
|
+
protected getObject3dInstance(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>;
|
|
8
8
|
updateCamera(): void;
|
|
9
9
|
build(): void;
|
|
10
10
|
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,mBAAmB,CAAA;AAE1B,OAAO,QAAQ,CAAA;AACf,OAAO,wBAAwB,CAAA;AAE/B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAE7B,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,QAAQ,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport './scene/component'\n\nimport './text'\nimport './html-overlay-element'\n\nexport * from './threed'\nexport * from './gltf-object'\n\nexport * from './camera'\nexport * from './banner'\nexport * from './sprite'\nexport * from './cube'\nexport * from './cylinder'\nexport * from './desk'\nexport * from './ellipse'\nexport * from './polygon'\nexport * from './rack'\nexport * from './rack-table'\nexport * from './rack-table-cell'\nexport * from './rect'\nexport * from './sphere'\nexport * from './visualizer'\nexport * from './three-container'\nexport * from './wall'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,mBAAmB,CAAA;AAE1B,OAAO,QAAQ,CAAA;AACf,OAAO,wBAAwB,CAAA;AAE/B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAE7B,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport './scene/component'\n\nimport './text'\nimport './html-overlay-element'\n\nexport * from './threed'\nexport * from './gltf-object'\n\nexport * from './camera'\nexport * from './banner'\nexport * from './sprite'\nexport * from './cube'\nexport * from './cylinder'\nexport * from './desk'\nexport * from './ellipse'\nexport * from './polygon'\nexport * from './rack'\nexport * from './rack-table'\nexport * from './rack-table-cell'\nexport * from './rect'\nexport * from './sphere'\nexport * from './visualizer'\nexport * from './three-container'\nexport * from './wall'\nexport * from './light'\n"]}
|
package/dist/light.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Anchor, ComponentNature, Ellipse } from '@hatiolab/things-scene';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
import { RealObject } from './threed/real-object';
|
|
4
|
+
export declare class LightObject extends RealObject<THREE.Light> {
|
|
5
|
+
helper?: THREE.CameraHelper;
|
|
6
|
+
updatePointLight(): void;
|
|
7
|
+
protected getObject3dInstance(): THREE.Light;
|
|
8
|
+
update(): void;
|
|
9
|
+
}
|
|
10
|
+
export declare class PointLight extends Ellipse {
|
|
11
|
+
is3dish(): boolean;
|
|
12
|
+
buildRealObject(): RealObject | undefined;
|
|
13
|
+
get anchors(): Array<Anchor>;
|
|
14
|
+
get nature(): ComponentNature;
|
|
15
|
+
}
|
package/dist/light.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { Component, Ellipse } from '@hatiolab/things-scene';
|
|
5
|
+
import * as THREE from 'three';
|
|
6
|
+
import { RealObject } from './threed/real-object';
|
|
7
|
+
const NATURE = {
|
|
8
|
+
mutable: false,
|
|
9
|
+
resizable: true,
|
|
10
|
+
rotatable: true,
|
|
11
|
+
properties: [
|
|
12
|
+
{
|
|
13
|
+
type: 'select',
|
|
14
|
+
label: 'light-type',
|
|
15
|
+
name: 'lightType',
|
|
16
|
+
property: {
|
|
17
|
+
options: ['', 'point', 'directional']
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: 'number',
|
|
22
|
+
label: 'intensity',
|
|
23
|
+
name: 'intensity'
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: 'number',
|
|
27
|
+
label: 'distance',
|
|
28
|
+
name: 'distance'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: 'number',
|
|
32
|
+
label: 'decay',
|
|
33
|
+
name: 'decay'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
type: 'checkbox',
|
|
37
|
+
label: 'cast-shadow',
|
|
38
|
+
name: 'castShadow'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
type: 'number',
|
|
42
|
+
label: 'near',
|
|
43
|
+
name: 'near',
|
|
44
|
+
placeholder: '0.5'
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: 'number',
|
|
48
|
+
label: 'far',
|
|
49
|
+
name: 'far',
|
|
50
|
+
placeholder: '1000'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: 'number',
|
|
54
|
+
label: 'fov',
|
|
55
|
+
name: 'fov',
|
|
56
|
+
placeholder: '90'
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type: 'number',
|
|
60
|
+
label: 'zoom',
|
|
61
|
+
name: 'zoom',
|
|
62
|
+
placeholder: '1'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
type: 'checkbox',
|
|
66
|
+
label: 'show-helper',
|
|
67
|
+
name: 'showHelper'
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
help: 'scene/component/light'
|
|
71
|
+
};
|
|
72
|
+
export class LightObject extends RealObject {
|
|
73
|
+
updatePointLight() {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
var { lightType = 'point', distance = 0, // unlimited
|
|
76
|
+
intensity = 10, decay = 1, fillStyle: color = 'white', castShadow, near = 0.5, far = 1000, fov = 90, zoom = 1, showHelper } = this.component.state;
|
|
77
|
+
this.object3d.color = new THREE.Color(color);
|
|
78
|
+
if (lightType == 'point') {
|
|
79
|
+
;
|
|
80
|
+
this.object3d.distance = distance;
|
|
81
|
+
this.object3d.decay = decay;
|
|
82
|
+
}
|
|
83
|
+
this.object3d.intensity = intensity;
|
|
84
|
+
this.object3d.castShadow = castShadow;
|
|
85
|
+
if (castShadow) {
|
|
86
|
+
const camera = (_a = this.object3d.shadow) === null || _a === void 0 ? void 0 : _a.camera;
|
|
87
|
+
camera.far = far;
|
|
88
|
+
camera.near = near;
|
|
89
|
+
camera.fov = fov;
|
|
90
|
+
camera.zoom = zoom;
|
|
91
|
+
}
|
|
92
|
+
if (showHelper) {
|
|
93
|
+
const camera = (_b = this.object3d.shadow) === null || _b === void 0 ? void 0 : _b.camera;
|
|
94
|
+
if (!this.helper) {
|
|
95
|
+
this.helper = new THREE.CameraHelper(camera);
|
|
96
|
+
this.object3d.add(this.helper);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else if (this.helper) {
|
|
100
|
+
this.object3d.remove(this.helper);
|
|
101
|
+
delete this.helper;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
getObject3dInstance() {
|
|
105
|
+
var { lightType = 'point' } = this.component.state;
|
|
106
|
+
return lightType == 'point' ? new THREE.PointLight() : new THREE.DirectionalLight();
|
|
107
|
+
}
|
|
108
|
+
update() {
|
|
109
|
+
this.clear();
|
|
110
|
+
this.build();
|
|
111
|
+
this.updateDimension();
|
|
112
|
+
this.updateHidden();
|
|
113
|
+
this.updatePointLight();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
export class PointLight extends Ellipse {
|
|
117
|
+
is3dish() {
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
buildRealObject() {
|
|
121
|
+
return new LightObject(this);
|
|
122
|
+
}
|
|
123
|
+
get anchors() {
|
|
124
|
+
return [];
|
|
125
|
+
}
|
|
126
|
+
get nature() {
|
|
127
|
+
return NATURE;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
Component.register('light', PointLight);
|
|
131
|
+
//# sourceMappingURL=light.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"light.js","sourceRoot":"","sources":["../src/light.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAU,SAAS,EAAmB,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACpF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,aAAa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AAK,CAAA;QAElD,OAAO,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,gBAAgB,EAAE,CAAA;IACrF,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,KAAK,EAAE,CAAA;QACZ,IAAI,CAAC,KAAK,EAAE,CAAA;QAEZ,IAAI,CAAC,eAAe,EAAE,CAAA;QACtB,IAAI,CAAC,YAAY,EAAE,CAAA;QAEnB,IAAI,CAAC,gBAAgB,EAAE,CAAA;IACzB,CAAC;CACF;AAED,MAAM,OAAO,UAAW,SAAQ,OAAO;IACrC,OAAO;QACL,OAAO,IAAI,CAAA;IACb,CAAC;IAED,eAAe;QACb,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAED,IAAI,OAAO;QACT,OAAO,EAAE,CAAA;IACX,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\nimport { Anchor, Component, ComponentNature, Ellipse } from '@hatiolab/things-scene'\nimport * as THREE from 'three'\nimport { RealObject } from './threed/real-object'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'select',\n label: 'light-type',\n name: 'lightType',\n property: {\n options: ['', 'point', 'directional']\n }\n },\n {\n type: 'number',\n label: 'intensity',\n name: 'intensity'\n },\n {\n type: 'number',\n label: 'distance',\n name: 'distance'\n },\n {\n type: 'number',\n label: 'decay',\n name: 'decay'\n },\n {\n type: 'checkbox',\n label: 'cast-shadow',\n name: 'castShadow'\n },\n {\n type: 'number',\n label: 'near',\n name: 'near',\n placeholder: '0.5'\n },\n {\n type: 'number',\n label: 'far',\n name: 'far',\n placeholder: '1000'\n },\n {\n type: 'number',\n label: 'fov',\n name: 'fov',\n placeholder: '90'\n },\n {\n type: 'number',\n label: 'zoom',\n name: 'zoom',\n placeholder: '1'\n },\n {\n type: 'checkbox',\n label: 'show-helper',\n name: 'showHelper'\n }\n ],\n help: 'scene/component/light'\n}\n\nexport class LightObject extends RealObject<THREE.Light> {\n helper?: THREE.CameraHelper\n\n updatePointLight() {\n var {\n lightType = 'point',\n distance = 0, // unlimited\n intensity = 10,\n decay = 1,\n fillStyle: color = 'white',\n castShadow,\n near = 0.5,\n far = 1000,\n fov = 90,\n zoom = 1,\n showHelper\n } = this.component.state\n\n this.object3d!.color = new THREE.Color(color)\n if (lightType == 'point') {\n ;(this.object3d as THREE.PointLight)!.distance = distance\n ;(this.object3d as THREE.PointLight)!.decay = decay\n }\n this.object3d!.intensity = intensity\n this.object3d!.castShadow = castShadow\n if (castShadow) {\n const camera = this.object3d!.shadow?.camera as THREE.PerspectiveCamera\n camera.far = far\n camera.near = near\n camera.fov = fov\n camera.zoom = zoom\n }\n\n if (showHelper) {\n const camera = this.object3d!.shadow?.camera as THREE.PerspectiveCamera\n\n if (!this.helper) {\n this.helper = new THREE.CameraHelper(camera!)\n this.object3d.add(this.helper)\n }\n } else if (this.helper) {\n this.object3d.remove(this.helper)\n delete this.helper\n }\n }\n\n protected getObject3dInstance(): THREE.Light {\n var { lightType = 'point' } = this.component.state\n\n return lightType == 'point' ? new THREE.PointLight() : new THREE.DirectionalLight()\n }\n\n update() {\n this.clear()\n this.build()\n\n this.updateDimension()\n this.updateHidden()\n\n this.updatePointLight()\n }\n}\n\nexport class PointLight extends Ellipse {\n is3dish() {\n return true\n }\n\n buildRealObject(): RealObject | undefined {\n return new LightObject(this)\n }\n\n get anchors(): Array<Anchor> {\n return []\n }\n\n get nature(): ComponentNature {\n return NATURE\n }\n}\n\nComponent.register('light', PointLight)\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Anchor, ComponentNature, Ellipse } from '@hatiolab/things-scene';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
import { RealObject } from './threed/real-object';
|
|
4
|
+
export declare class PointLightObject extends RealObject<THREE.PointLight> {
|
|
5
|
+
updatePointLight(): void;
|
|
6
|
+
protected getObject3dInstance(): THREE.PointLight;
|
|
7
|
+
update(): void;
|
|
8
|
+
}
|
|
9
|
+
export declare class PointLight extends Ellipse {
|
|
10
|
+
is3dish(): boolean;
|
|
11
|
+
buildRealObject(): RealObject | undefined;
|
|
12
|
+
get anchors(): Array<Anchor>;
|
|
13
|
+
get nature(): ComponentNature;
|
|
14
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { Component, Ellipse } from '@hatiolab/things-scene';
|
|
5
|
+
import * as THREE from 'three';
|
|
6
|
+
import { RealObject } from './threed/real-object';
|
|
7
|
+
const DEFAULT = {
|
|
8
|
+
color: '0xffffff',
|
|
9
|
+
intensity: 100000,
|
|
10
|
+
distance: 0,
|
|
11
|
+
decay: 1,
|
|
12
|
+
castShadow: false
|
|
13
|
+
};
|
|
14
|
+
const NATURE = {
|
|
15
|
+
mutable: false,
|
|
16
|
+
resizable: true,
|
|
17
|
+
rotatable: true,
|
|
18
|
+
properties: [
|
|
19
|
+
{
|
|
20
|
+
type: 'number',
|
|
21
|
+
label: 'intensity',
|
|
22
|
+
name: 'intensity'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: 'number',
|
|
26
|
+
label: 'distance',
|
|
27
|
+
name: 'distance'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: 'number',
|
|
31
|
+
label: 'decay',
|
|
32
|
+
name: 'decay'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: 'checkbox',
|
|
36
|
+
label: 'cast-shadow',
|
|
37
|
+
name: 'castShadow'
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
help: 'scene/component/point-light'
|
|
41
|
+
};
|
|
42
|
+
export class PointLightObject extends RealObject {
|
|
43
|
+
updatePointLight() {
|
|
44
|
+
var { distance = DEFAULT.distance, intensity = DEFAULT.intensity, decay = DEFAULT.decay, fillStyle: color = DEFAULT.color, castShadow } = this.component.state;
|
|
45
|
+
this.object3d.color = new THREE.Color(color);
|
|
46
|
+
this.object3d.distance = distance;
|
|
47
|
+
this.object3d.intensity = intensity;
|
|
48
|
+
this.object3d.decay = decay;
|
|
49
|
+
this.object3d.castShadow = !!castShadow;
|
|
50
|
+
}
|
|
51
|
+
getObject3dInstance() {
|
|
52
|
+
return new THREE.PointLight();
|
|
53
|
+
}
|
|
54
|
+
update() {
|
|
55
|
+
this.clear();
|
|
56
|
+
this.build();
|
|
57
|
+
this.updateDimension();
|
|
58
|
+
this.updateHidden();
|
|
59
|
+
this.updatePointLight();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export class PointLight extends Ellipse {
|
|
63
|
+
is3dish() {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
buildRealObject() {
|
|
67
|
+
return new PointLightObject(this);
|
|
68
|
+
}
|
|
69
|
+
get anchors() {
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
get nature() {
|
|
73
|
+
return NATURE;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
Component.register('point-light', PointLight);
|
|
77
|
+
//# sourceMappingURL=point-light.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point-light.js","sourceRoot":"","sources":["../src/point-light.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAU,SAAS,EAAmB,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACpF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,MAAM,OAAO,GAAG;IACd,KAAK,EAAE,UAAU;IACjB,SAAS,EAAE,MAAM;IACjB,QAAQ,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nD,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,KAAK,EAAE,CAAA;QACZ,IAAI,CAAC,KAAK,EAAE,CAAA;QAEZ,IAAI,CAAC,eAAe,EAAE,CAAA;QACtB,IAAI,CAAC,YAAY,EAAE,CAAA;QAEnB,IAAI,CAAC,gBAAgB,EAAE,CAAA;IACzB,CAAC;CACF;AAED,MAAM,OAAO,UAAW,SAAQ,OAAO;IACrC,OAAO;QACL,OAAO,IAAI,CAAA;IACb,CAAC;IAED,eAAe;QACb,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAA;IACnC,CAAC;IAED,IAAI,OAAO;QACT,OAAO,EAAE,CAAA;IACX,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,UAAU,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\nimport { Anchor, Component, ComponentNature, Ellipse } from '@hatiolab/things-scene'\nimport * as THREE from 'three'\nimport { RealObject } from './threed/real-object'\n\nconst DEFAULT = {\n color: '0xffffff', // white color\n intensity: 100000,\n distance: 0, // unlimited\n decay: 1, //\n castShadow: false\n}\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'number',\n label: 'intensity',\n name: 'intensity'\n },\n {\n type: 'number',\n label: 'distance',\n name: 'distance'\n },\n {\n type: 'number',\n label: 'decay',\n name: 'decay'\n },\n {\n type: 'checkbox',\n label: 'cast-shadow',\n name: 'castShadow'\n }\n ],\n help: 'scene/component/point-light'\n}\n\nexport class PointLightObject extends RealObject<THREE.PointLight> {\n updatePointLight() {\n var {\n distance = DEFAULT.distance,\n intensity = DEFAULT.intensity,\n decay = DEFAULT.decay,\n fillStyle: color = DEFAULT.color,\n castShadow\n } = this.component.state\n\n this.object3d!.color = new THREE.Color(color)\n this.object3d!.distance = distance\n this.object3d!.intensity = intensity\n this.object3d!.decay = decay\n this.object3d!.castShadow = !!castShadow\n }\n\n protected getObject3dInstance(): THREE.PointLight {\n return new THREE.PointLight() as THREE.PointLight\n }\n\n update() {\n this.clear()\n this.build()\n\n this.updateDimension()\n this.updateHidden()\n\n this.updatePointLight()\n }\n}\n\nexport class PointLight extends Ellipse {\n is3dish() {\n return true\n }\n\n buildRealObject(): RealObject | undefined {\n return new PointLightObject(this)\n }\n\n get anchors(): Array<Anchor> {\n return []\n }\n\n get nature(): ComponentNature {\n return NATURE\n }\n}\n\nComponent.register('point-light', PointLight)\n"]}
|
package/dist/rack.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ export declare class Rack extends RealObject {
|
|
|
14
14
|
get rackTable(): RackTable | undefined;
|
|
15
15
|
get cz(): number;
|
|
16
16
|
static get boardMaterial(): THREE.MeshStandardMaterial;
|
|
17
|
-
get frame(): THREE.BufferGeometry | undefined;
|
|
18
|
-
get board(): THREE.BufferGeometry | undefined;
|
|
17
|
+
get frame(): THREE.BufferGeometry<THREE.NormalBufferAttributes> | undefined;
|
|
18
|
+
get board(): THREE.BufferGeometry<THREE.NormalBufferAttributes> | undefined;
|
|
19
19
|
build(): void;
|
|
20
20
|
createRackFrame(w: number, h: number, d: number): THREE.BufferGeometry;
|
|
21
21
|
createRackBoards(shelves: number, width: number, height: number, depth: number, shelfLocIds: string[]): THREE.BufferGeometry;
|
package/dist/stock.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare class Stock extends RealObject<THREE.Mesh> {
|
|
|
10
10
|
_focusedAt?: number;
|
|
11
11
|
model: Model;
|
|
12
12
|
constructor(component: Component, model: Model);
|
|
13
|
-
protected getObject3dInstance(): THREE.Mesh<THREE.BufferGeometry
|
|
13
|
+
protected getObject3dInstance(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>;
|
|
14
14
|
getMaterial(index: number): THREE.Material;
|
|
15
15
|
get visualizer(): Visualizer | undefined;
|
|
16
16
|
get stockMaterials(): THREE.Material[];
|
|
@@ -34,6 +34,26 @@ declare const _default: ({
|
|
|
34
34
|
rows: number;
|
|
35
35
|
columns: number;
|
|
36
36
|
};
|
|
37
|
+
} | {
|
|
38
|
+
type: string;
|
|
39
|
+
description: string;
|
|
40
|
+
group: string;
|
|
41
|
+
icon: string;
|
|
42
|
+
model: {
|
|
43
|
+
type: string;
|
|
44
|
+
rx: number;
|
|
45
|
+
ry: number;
|
|
46
|
+
cx: number;
|
|
47
|
+
cy: number;
|
|
48
|
+
zPos: number;
|
|
49
|
+
fillStyle: string;
|
|
50
|
+
strokeStyle: string;
|
|
51
|
+
alpha: number;
|
|
52
|
+
hidden: boolean;
|
|
53
|
+
lineWidth: number;
|
|
54
|
+
lineDash: string;
|
|
55
|
+
lineCap: string;
|
|
56
|
+
};
|
|
37
57
|
} | {
|
|
38
58
|
type: string;
|
|
39
59
|
description: string;
|
package/dist/templates/index.js
CHANGED
|
@@ -9,12 +9,14 @@ import sprite from './sprite';
|
|
|
9
9
|
import wall from './wall';
|
|
10
10
|
import desk from './desk';
|
|
11
11
|
import camera from './camera';
|
|
12
|
+
import light from './light';
|
|
12
13
|
import GLTFObject from './gltf-object';
|
|
13
14
|
export default [
|
|
14
15
|
threeContainer,
|
|
15
16
|
visualizer,
|
|
16
17
|
rackTable,
|
|
17
18
|
camera,
|
|
19
|
+
light,
|
|
18
20
|
cube,
|
|
19
21
|
cylinder,
|
|
20
22
|
sphere,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,gBAAgB,CAAA;AAC3C,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,SAAS,MAAM,cAAc,CAAA;AACpC,OAAO,IAAI,MAAM,QAAQ,CAAA;AACzB,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,MAAM,MAAM,UAAU,CAAA;AAC7B,OAAO,MAAM,MAAM,UAAU,CAAA;AAC7B,OAAO,MAAM,MAAM,UAAU,CAAA;AAC7B,OAAO,IAAI,MAAM,QAAQ,CAAA;AACzB,OAAO,IAAI,MAAM,QAAQ,CAAA;AACzB,OAAO,MAAM,MAAM,UAAU,CAAA;AAC7B,OAAO,UAAU,MAAM,eAAe,CAAA;AAEtC,eAAe;IACb,cAAc;IACd,UAAU;IACV,SAAS;IACT,MAAM;IACN,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,MAAM;IACN,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,UAAU;CACX,CAAA","sourcesContent":["import threeContainer from './3d-container'\nimport visualizer from './visualizer'\nimport rackTable from './rack-table'\nimport cube from './cube'\nimport cylinder from './cylinder'\nimport sphere from './sphere'\nimport banner from './banner'\nimport sprite from './sprite'\nimport wall from './wall'\nimport desk from './desk'\nimport camera from './camera'\nimport GLTFObject from './gltf-object'\n\nexport default [\n threeContainer,\n visualizer,\n rackTable,\n camera,\n cube,\n cylinder,\n sphere,\n sprite,\n banner,\n wall,\n desk,\n GLTFObject\n]\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,gBAAgB,CAAA;AAC3C,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,SAAS,MAAM,cAAc,CAAA;AACpC,OAAO,IAAI,MAAM,QAAQ,CAAA;AACzB,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,MAAM,MAAM,UAAU,CAAA;AAC7B,OAAO,MAAM,MAAM,UAAU,CAAA;AAC7B,OAAO,MAAM,MAAM,UAAU,CAAA;AAC7B,OAAO,IAAI,MAAM,QAAQ,CAAA;AACzB,OAAO,IAAI,MAAM,QAAQ,CAAA;AACzB,OAAO,MAAM,MAAM,UAAU,CAAA;AAC7B,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,UAAU,MAAM,eAAe,CAAA;AAEtC,eAAe;IACb,cAAc;IACd,UAAU;IACV,SAAS;IACT,MAAM;IACN,KAAK;IACL,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,MAAM;IACN,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,UAAU;CACX,CAAA","sourcesContent":["import threeContainer from './3d-container'\nimport visualizer from './visualizer'\nimport rackTable from './rack-table'\nimport cube from './cube'\nimport cylinder from './cylinder'\nimport sphere from './sphere'\nimport banner from './banner'\nimport sprite from './sprite'\nimport wall from './wall'\nimport desk from './desk'\nimport camera from './camera'\nimport light from './light'\nimport GLTFObject from './gltf-object'\n\nexport default [\n threeContainer,\n visualizer,\n rackTable,\n camera,\n light,\n cube,\n cylinder,\n sphere,\n sprite,\n banner,\n wall,\n desk,\n GLTFObject\n]\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
type: string;
|
|
3
|
+
description: string;
|
|
4
|
+
group: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
model: {
|
|
7
|
+
type: string;
|
|
8
|
+
rx: number;
|
|
9
|
+
ry: number;
|
|
10
|
+
cx: number;
|
|
11
|
+
cy: number;
|
|
12
|
+
zPos: number;
|
|
13
|
+
fillStyle: string;
|
|
14
|
+
strokeStyle: string;
|
|
15
|
+
alpha: number;
|
|
16
|
+
hidden: boolean;
|
|
17
|
+
lineWidth: number;
|
|
18
|
+
lineDash: string;
|
|
19
|
+
lineCap: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const icon = new URL('../../icons/light.png', import.meta.url).href;
|
|
2
|
+
export default {
|
|
3
|
+
type: 'light',
|
|
4
|
+
description: 'Light',
|
|
5
|
+
group: '3D' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,
|
|
6
|
+
icon,
|
|
7
|
+
model: {
|
|
8
|
+
type: 'light',
|
|
9
|
+
rx: 10,
|
|
10
|
+
ry: 10,
|
|
11
|
+
cx: 150,
|
|
12
|
+
cy: 150,
|
|
13
|
+
zPos: 1000,
|
|
14
|
+
fillStyle: '#fff',
|
|
15
|
+
strokeStyle: '#000',
|
|
16
|
+
alpha: 1,
|
|
17
|
+
hidden: false,
|
|
18
|
+
lineWidth: 1,
|
|
19
|
+
lineDash: 'solid',
|
|
20
|
+
lineCap: 'butt'
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=light.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"light.js","sourceRoot":"","sources":["../../src/templates/light.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,uBAAuB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEnE,eAAe;IACb,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,OAAO;IACpB,KAAK,EAAE,IAAI,CAAC,gGAAgG;IAC5G,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,GAAG;QACP,EAAE,EAAE,GAAG;QACP,IAAI,EAAE,IAAI;QACV,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,MAAM;QACnB,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,MAAM;KAChB;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/light.png', import.meta.url).href\n\nexport default {\n type: 'light',\n description: 'Light',\n group: '3D' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,\n icon,\n model: {\n type: 'light',\n rx: 10,\n ry: 10,\n cx: 150,\n cy: 150,\n zPos: 1000,\n fillStyle: '#fff',\n strokeStyle: '#000',\n alpha: 1,\n hidden: false,\n lineWidth: 1,\n lineDash: 'solid',\n lineCap: 'butt'\n }\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
type: string;
|
|
3
|
+
description: string;
|
|
4
|
+
group: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
model: {
|
|
7
|
+
type: string;
|
|
8
|
+
rx: number;
|
|
9
|
+
ry: number;
|
|
10
|
+
cx: number;
|
|
11
|
+
cy: number;
|
|
12
|
+
zPos: number;
|
|
13
|
+
fillStyle: string;
|
|
14
|
+
strokeStyle: string;
|
|
15
|
+
alpha: number;
|
|
16
|
+
hidden: boolean;
|
|
17
|
+
lineWidth: number;
|
|
18
|
+
lineDash: string;
|
|
19
|
+
lineCap: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const icon = new URL('../../icons/point-light.png', import.meta.url).href;
|
|
2
|
+
export default {
|
|
3
|
+
type: 'point-light',
|
|
4
|
+
description: 'Point Light',
|
|
5
|
+
group: '3D' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,
|
|
6
|
+
icon,
|
|
7
|
+
model: {
|
|
8
|
+
type: 'point-light',
|
|
9
|
+
rx: 50,
|
|
10
|
+
ry: 50,
|
|
11
|
+
cx: 150,
|
|
12
|
+
cy: 150,
|
|
13
|
+
zPos: 100,
|
|
14
|
+
fillStyle: '#fff',
|
|
15
|
+
strokeStyle: '#000',
|
|
16
|
+
alpha: 1,
|
|
17
|
+
hidden: false,
|
|
18
|
+
lineWidth: 1,
|
|
19
|
+
lineDash: 'solid',
|
|
20
|
+
lineCap: 'butt'
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=point-light.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point-light.js","sourceRoot":"","sources":["../../src/templates/point-light.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,6BAA6B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEzE,eAAe;IACb,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE,IAAI,CAAC,gGAAgG;IAC5G,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,aAAa;QACnB,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,GAAG;QACP,EAAE,EAAE,GAAG;QACP,IAAI,EAAE,GAAG;QACT,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,MAAM;QACnB,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,MAAM;KAChB;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/point-light.png', import.meta.url).href\n\nexport default {\n type: 'point-light',\n description: 'Point Light',\n group: '3D' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,\n icon,\n model: {\n type: 'point-light',\n rx: 50,\n ry: 50,\n cx: 150,\n cy: 150,\n zPos: 100,\n fillStyle: '#fff',\n strokeStyle: '#000',\n alpha: 1,\n hidden: false,\n lineWidth: 1,\n lineDash: 'solid',\n lineCap: 'butt'\n }\n}\n"]}
|