diff --git a/components/src/sip.js b/components/src/sip.js new file mode 100644 index 0000000000000000000000000000000000000000..24aac6d94d4a2fc160447f6e956f7eaceeac977a --- /dev/null +++ b/components/src/sip.js @@ -0,0 +1,61 @@ +// jshint esversion: 6 + import * as THREE from 'three'; + + export function sip(param) { + const sipContiner = new THREE.Object3D(); + const sipObject = new THREE.Object3D(); + + //cylinder + const cylgeometry = new THREE.CylinderGeometry(25, 25, 50, 15); + const cylmaterial = new THREE.MeshLambertMaterial({color: 0xc7c7c7}); + const cylmesh = new THREE.Mesh(cylgeometry, cylmaterial); + cylmesh.rotateX(Math.PI * 1); + cylmesh.rotateY(Math.PI * 1.0); + cylmesh.rotateZ(Math.PI * 1.5); + cylmesh.position.set(0, 0 , 0); + sipObject.add(cylmesh); + + // connect + const vlvgeometry = new THREE.BoxGeometry(30, 50, 30 ); + const vlv1mesh = new THREE.Mesh(vlvgeometry, cylmaterial); + vlv1mesh.position.set(0, -30, 0); + sipObject.add(vlv1mesh); + + // box + const boxmaterial = new THREE.MeshLambertMaterial({color: 0xb6b6b6}); + const boxgeometry = new THREE.BoxGeometry(60, 80, 120 ); + const boxmesh = new THREE.Mesh(boxgeometry, boxmaterial); + boxmesh.position.set(0, -90, 0); + sipObject.add(boxmesh); + + // blackbox1 + const bb1material = new THREE.MeshLambertMaterial({color: 0x000000}); + const bb1geometry = new THREE.BoxGeometry(60, 80, 10 ); + const bb1mesh = new THREE.Mesh(bb1geometry, bb1material); + bb1mesh.position.set(0, -90, -65); + sipObject.add(bb1mesh); + + // blackbox2 + const bb2geometry = new THREE.BoxGeometry(60, 80, 10 ); + const bb2mesh = new THREE.Mesh(bb2geometry, bb1material); + bb2mesh.position.set(0, -90, 65); + sipObject.add(bb2mesh); + + // border + const bordergeometry = new THREE.BoxGeometry(61, 81, 1 ); + const bordermesh = new THREE.Mesh(bordergeometry, bb1material); + bordermesh.position.set(0, -90, 0); + sipObject.add(bordermesh); + + + sipObject.scale.setX(1); + sipObject.scale.setY(1); + sipObject.scale.setZ(1); + sipObject.position.set(0, 0, 0); + sipContiner.add(sipObject); + sipContiner.rotateY(Math.PI * -1); + + + return sipContiner; + } +