( nodes, depth, holes )
| 35 | } |
| 36 | |
| 37 | show( nodes, depth, holes ){ |
| 38 | const shape = this.nodesToShape( nodes ); |
| 39 | |
| 40 | if (holes){ |
| 41 | for( const [key, nodes] of Object.entries(holes)){ |
| 42 | const path = this.nodesToPath( nodes ); |
| 43 | shape.holes.push( path ); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | if ( this.mesh ){ |
| 48 | this.mesh.geometry.dispose(); |
| 49 | this.scene.remove( this.mesh ); |
| 50 | } |
| 51 | |
| 52 | const geometry = new ExtrudeGeometry( shape, { |
| 53 | depth, |
| 54 | bevelEnabled: false |
| 55 | }); |
| 56 | |
| 57 | this.mesh = new Mesh( geometry, this.material ); |
| 58 | this.scene.add( this.mesh ); |
| 59 | |
| 60 | const height = window.innerHeight; |
| 61 | const top = (height - 512) / 2; |
| 62 | this.container.style.top = `${top}px`; |
| 63 | |
| 64 | this.controls.target = this.getCenterPoint( this.mesh ); |
| 65 | this.camera.position.set( this.controls.target.x, this.controls.target.y, this.getCameraOffset( this.mesh ) ); |
| 66 | this.controls.update(); |
| 67 | |
| 68 | this.render(); |
| 69 | |
| 70 | this.on = true; |
| 71 | } |
| 72 | |
| 73 | hide(){ |
| 74 | this.container.style.top = "-600px"; |
nothing calls this directly
no test coverage detected