From b106fffda29fa54b8bafc47cda82bef7687fe59d Mon Sep 17 00:00:00 2001 From: Lucio Zambon <lucio.zambon@elettra.eu> Date: Wed, 29 May 2024 00:14:48 +0000 Subject: [PATCH] Add new file --- components/src/rllrf.js | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 components/src/rllrf.js diff --git a/components/src/rllrf.js b/components/src/rllrf.js new file mode 100644 index 0000000..aab1a43 --- /dev/null +++ b/components/src/rllrf.js @@ -0,0 +1,44 @@ + import * as THREE from 'three'; + + // Low Level RF Rack + export function rllrf(width=800, height=1500, depth=600) { + const rllrf = new THREE.Object3D(); + const llrf_rackObject = new THREE.Object3D(); + + const materialGreyDark= new THREE.MeshLambertMaterial({color: 0x6a615c}); + const target = new THREE.MeshLambertMaterial({color: 0xfbe928}); + const materialDark= new THREE.MeshLambertMaterial({color: 0x000000}); + + // rack llrf + const rrgeometry = new THREE.BoxGeometry(width, height, depth); + const rrmesh = new THREE.Mesh(rrgeometry, materialGreyDark); + rrmesh.position.set( 0, 0 , -depth+290); + llrf_rackObject.add(rrmesh); + + //front yellow target + const Ftarget = new THREE.BoxGeometry(2, 90, 600); + const Ftargetmesh = new THREE.Mesh(Ftarget, target); + Ftargetmesh.position.set( -405, 640 , -300); + llrf_rackObject.add(Ftargetmesh); + //Rear yellow target + const Rtarget = new THREE.BoxGeometry(2, 90, 600); + const Rtargetmesh = new THREE.Mesh(Rtarget, target); + Rtargetmesh.position.set( 405, 640 , -300); + llrf_rackObject.add(Rtargetmesh); + + + //handle + const handlegeometry = new THREE.BoxGeometry(30, 300, 70); + const handlegeometrymesh = new THREE.Mesh(handlegeometry, materialDark); + handlegeometrymesh.position.set( -401, 0 , -550); + llrf_rackObject.add(handlegeometrymesh); + + + + + llrf_rackObject.rotateY(Math.PI); + llrf_rackObject.position.set(600, 750, -depth+500); + rllrf.add(llrf_rackObject); + + return rllrf; + } -- GitLab