import * as THREE from 'three'; // corrector booster export function correctorbooster(length=140) { const CorrectorContiner = new THREE.Object3D(); const correctorObject = new THREE.Object3D(); // box esterno const correctormaterial = new THREE.MeshLambertMaterial({color: 0x4040b0}); const correctorgeometry = new THREE.BoxGeometry(140, 65, length); const d1mesh = new THREE.Mesh(correctorgeometry, correctormaterial); correctormaterial.flatShading = true; d1mesh.position.set(0, 0, 0); d1mesh.rotateX(Math.PI * 1.250); d1mesh.rotateY(Math.PI * 1.5); d1mesh.rotateZ(Math.PI * 1.25); d1mesh.position.set(0, 0, 0); correctorObject.add(d1mesh); // box lato1 const correctormaterial2 = new THREE.MeshLambertMaterial({color: 0x4040b0}); const correctorgeometry2 = new THREE.BoxGeometry(140, 20, 140 ); const d2mesh = new THREE.Mesh(correctorgeometry2, correctormaterial2); correctormaterial.flatShading = true; d2mesh.position.set(0, 0, 0); d2mesh.rotateX(Math.PI * 1.5); d2mesh.rotateY(Math.PI * 1); d2mesh.rotateZ(Math.PI * 1.5); d2mesh.position.set(-80, 37, 0); correctorObject.add(d2mesh); // box lato2 const correctormaterial3 = new THREE.MeshLambertMaterial({color: 0x4040b0}); const correctorgeometry3 = new THREE.BoxGeometry(140, 20, 140 ); const d3mesh = new THREE.Mesh(correctorgeometry3, correctormaterial3); correctormaterial.flatShading = true; d3mesh.position.set(0, 0, 0); d3mesh.rotateX(Math.PI * 1.5); d3mesh.rotateY(Math.PI * 1); d3mesh.rotateZ(Math.PI * 1.5); d3mesh.position.set(80, 37, 0); correctorObject.add(d3mesh); //Coil const d4geometry = new THREE.CylinderGeometry(30, 30, 140, 15); const correctormaterial4 = new THREE.MeshLambertMaterial({color: 0xc08000}); const d4mesh = new THREE.Mesh(d4geometry, correctormaterial4); d4mesh.rotateX(Math.PI * 1); d4mesh.rotateY(Math.PI * 1.0); d4mesh.rotateZ(Math.PI * 1.5); d4mesh.position.set(0, 100 , 0); correctorObject.add(d4mesh); correctorObject.position.set(0, -150, 0); correctorObject.scale.setX(3); correctorObject.scale.setY(3); CorrectorContiner.add(correctorObject); CorrectorContiner.rotateY(Math.PI * -1); return CorrectorContiner; }