Skip to content
Snippets Groups Projects
  • Lucio Zambon's avatar
    Update 80 files · 0ee5780d
    Lucio Zambon authored
    - /components/src/beamlineDown.svg
    - /components/src/beamlineUP.js
    - /components/src/bending.svg
    - /components/src/blm.js
    - /components/src/blmplus.js
    - /components/src/bpm.js
    - /components/src/bpm.svg
    - /components/src/bst.js
    - /components/src/bst.svg
    - /components/src/cavity.js
    - /components/src/cavity.svg
    - /components/src/cavity_3hc.js
    - /components/src/cavity_3hc.svg
    - /components/src/cavity_3hcfast.js
    - /components/src/cavitylinac.js
    - /components/src/cavitylinac.svg
    - /components/src/chamber.js
    - /components/src/corrector.js
    - /components/src/corrector.svg
    - /components/src/correctorbooster.js
    - /components/src/correctorboosterfast.js
    - /components/src/correctorfast.js
    - /components/src/correctorfermi.js
    - /components/src/dipole.js
    - /components/src/dipolebooster.js
    - /components/src/dipoleboosterfast.js
    - /components/src/dipoleesrf.js
    - /components/src/dipolefast.js
    - /components/src/dipolefermi.js
    - /components/src/dipoleplus.js
    - /components/src/ellipticaltube.js
    - /components/sr...
    0ee5780d
rar1.js 2.06 KiB
	import * as THREE from 'three';


	// rar1 rack
	export function rar1(width=800, height=2500, depth=800) {
		const kly_rackObject = new THREE.Object3D();
	
		const materialGreyDark= new THREE.MeshLambertMaterial({color: 0x9d9d9d});
		const silvermaterial = new THREE.MeshLambertMaterial({color: 0xf0f0f0});
		
		// rack
		const lrgeometry = new THREE.BoxGeometry(width, height, depth);
		const lrmesh = new THREE.Mesh(lrgeometry, silvermaterial);
		lrmesh.position.set(0 , 0 , 0);
		kly_rackObject.add(lrmesh);
		
		//edge le		
		const rlegeometry = new THREE.BoxGeometry(width-750, height, depth-750);
		const rlemesh = new THREE.Mesh(rlegeometry, materialGreyDark);
		rlemesh.position.set( -425, 0 , -370);
		kly_rackObject.add(rlemesh);	
		
		//edge re		
		const rregeometry = new THREE.BoxGeometry(width-750, height, depth-750);
		const rremesh = new THREE.Mesh(rregeometry, materialGreyDark);
		rremesh.position.set( -425, 0 , 375);
		kly_rackObject.add(rremesh);		
		
		//edge ue		
		const ruegeometry = new THREE.BoxGeometry(width-750, height-2450, depth-50);
		const ruemesh = new THREE.Mesh(ruegeometry, materialGreyDark);
		ruemesh.position.set( -425, 1225 , 0);
		kly_rackObject.add(ruemesh);			
		
		//edge de		
		const rdegeometry = new THREE.BoxGeometry(width-750, height-2450, depth-50);
		const rdemesh = new THREE.Mesh(rdegeometry, materialGreyDark);
		rdemesh.position.set( -425, -1230 , 0);
		kly_rackObject.add(rdemesh);
		
		//base and texture
   		const drawer1geometry = new THREE.BoxGeometry(10, 2450, 750);
		const textureLoader = new THREE.TextureLoader();
		const texture = textureLoader.load('./components/rar1pic.jpg');
		texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
		texture.repeat.set(1, 1);
		const material = new THREE.MeshBasicMaterial({ map: texture });
		const gridgeometrymesh = new THREE.Mesh(drawer1geometry, material);
		gridgeometrymesh.rotateX(Math.PI * 1);
		gridgeometrymesh.rotateY(Math.PI * 1);
		gridgeometrymesh.rotateZ(Math.PI * 1);
		gridgeometrymesh.position.set( -400, 0 , 0);
		kly_rackObject.add(gridgeometrymesh);			
		
		return kly_rackObject;
	}