()
| 15 | |
| 16 | export class Preview{ |
| 17 | constructor(){ |
| 18 | this.scene = new Scene(); |
| 19 | this.scene.background = new Color( 0xAAAAAA ); |
| 20 | this.camera = new PerspectiveCamera( 40, 1, 0.1, 20 ); |
| 21 | this.camera.position.set( 0, 0, 3 ); |
| 22 | this.renderer = new WebGLRenderer( { antialias: true } ); |
| 23 | this.renderer.setSize( 512, 512 ); |
| 24 | this.light = new DirectionalLight( 0xFFFFFF, 3 ); |
| 25 | this.light.position.set( 1, 1, 1 ); |
| 26 | this.ambient = new HemisphereLight( 0xAAAAFF, 0x222255, 0.1 ); |
| 27 | this.scene.add( this.light ); |
| 28 | this.scene.add( this.ambient ); |
| 29 | this.container = document.getElementById("preview"); |
| 30 | this.container.appendChild( this.renderer.domElement ); |
| 31 | this.controls = new OrbitControls( this.camera, this.renderer.domElement ); |
| 32 | this.controls.addEventListener( "change", this.render.bind(this) ); |
| 33 | this.material = new MeshStandardMaterial( { color: 0x3333BB } );//, wireframe: true } ); |
| 34 | this.on = false; |
| 35 | } |
| 36 | |
| 37 | show( nodes, depth, holes ){ |
| 38 | const shape = this.nodesToShape( nodes ); |
nothing calls this directly
no outgoing calls
no test coverage detected