diff --git a/antenna.html b/antenna.html index 14deea2..8791876 100644 --- a/antenna.html +++ b/antenna.html @@ -36,24 +36,126 @@ var clock = new THREE.Clock(); var tick = 0; + class ViewManager { + // + constructor() { + // + } + + // + setAntennaType(antenna_type) { + // + if (antenna_type == "yagi") { + self.antenna = new YagiAntenna(); + // + } else { + // + } + + /* + const vertices = new Float32Array([ + -0.5, 0.0, 0.0, + 0.5, 0.0, 0.0 + ]); + */ + + const material = new THREE.LineBasicMaterial({ color: 0xffffff, linewidth: 1 }); + const line = new THREE.Line(geometry, material); + const antenna_view = new THREE.Group(); + + self.antenna.wires.forEach(wire => { + const vertices = new Float32Array(wire.length); + // Copy the vertex locations across into a Float32Array for the geometry: + wire.forEach(vertex, index => { + vertices[index] = vertex; + }); + // + const geometry = new THREE.BufferGeometry(); + geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3)); + // create a new wire with + const wire = new THREE.LineSegments(geometry, material); + antenna_view.add(wire); + }); + // Add the antenna into the scene: + scene.add(antenna_view); + } + } + + class AntennaBase { + // + constructor() { + // + } + + getWires() { + // + return self.wires; + } + } + + class DipoleH extends AntennaBase { + // + constructor() { + // + self.name = "Horizontal Dipole"; + self.wires = [[0.00, 0.00, -0.35], [0.00, 0.00, 0.35]]; + } + test() { + // + } + } + function Antennas() { // this.wire = []; this.antenna_types = { - 'order' : ['dipole_v'], + 'order' : ['dipole_h', 'dipole_v', 'monopole_v', 'inverted_v', 'inverted_l', 'loop_lrg_tri_h', 'quad'], 'antennas' : { 'dipole_v' : { + 'name' : "Vertical Dipole", 'wires' : [ [[0.00,-0.35, 0.00], [0.00, 0.35, 0.00]] ], }, 'dipole_h' : { + 'name' : "Horizontal Dipole", 'wires' : [ [[0.00, 0.00, -0.35], [0.00, 0.00, 0.35]] ], }, + 'monopole_v' : { + 'name' : "Vertical Monopole", + 'wires' : [ + [[0.00,-0.35, 0.00], [0.00, 0.35, 0.00]] + ], + }, + 'inverted_v' : { + 'name' : "Inverted Vee", + 'wires' : [ + [[0.00, 0.00, -0.35], [0.00, 0.35, 0.00], [0.00, 0.00, 0.35]] + ], + }, + 'inverted_l' : { + 'name' : "Inverted L", + 'wires' : [ + [[0.00, 0.00, -0.35], [0.00, 0.35, 0.00], [0.00, 0.00, 0.35]] + ], + }, + 'loop_lrg_tri_h' : { + 'name' : "Loop Large Triangle", + 'wires' : [ + [[0.00, 0.00, -0.35], [0.00, 0.35, 0.00], [0.00, 0.00, 0.35]] + ], + }, + 'quad' : { + 'name' : "Quad", + 'wires' : [ + [[0.00, 0.00, -0.35], [0.00, 0.35, 0.00], [0.00, 0.00, 0.35]] + ], + }, 'yagi_h' : { + 'name' : "Horizontal Yagi 5-element", 'wires' : [ [[-0.25, 0.00, -0.35], [-0.25, 0.00, 0.35]], // Reflector [[0.00, 0.00, -0.25], [0.00, 0.00, 0.25]], // Exciter @@ -144,6 +246,9 @@ const cubeFolder = gui.addFolder('Antenna Parameters'); var stringList = ["Dipole H", "Dipole V", "Yagi H"]; gui.add( parameters, 'w', stringList ).name('List'); + this.antenna_types['order'].forEach(element => { + gui.add(, ); + }); /* cubeFolder.add(cube.rotation, 'x', 0, Math.PI * 2) diff --git a/toroid.html b/toroid.html index b26aca0..2cb46e7 100644 --- a/toroid.html +++ b/toroid.html @@ -492,6 +492,7 @@ 'FT240x3' : { PN:'5943003801', A:61.0, B:35.55, C:38.1, W:318.0, CC:3.06, le:14.5, Ae:4.74, Ve:68.4, Al:3225.0 }, 'FT240x2' : { PN:'5943003801', A:61.0, B:35.55, C:25.4, W:212.0, CC:4.59, le:14.5, Ae:3.16, Ve:45.6, Al:2150.0 }, 'FT240' : { PN:'5943003801', A:61.0, B:35.55, C:12.7, W:106.0, CC:9.20, le:14.5, Ae:1.58, Ve:22.8, Al:1075.0 }, + 'FT154B' : { PN:'2643251002', A:39.10, B:16.75, C:22.2, W:104.0, CC:3.33, le:7.80, Ae:0.234, Ve:1.82, Al:1015.0 }, 'FT140' : { PN:'5943002701', A:35.55, B:23.00, C:12.7, W:33.0, CC:11.20, le:8.90, Ae:0.79, Ve:7.00, Al:885.0 }, 'FT125' : { PN:'5943001701', A:31.75, B:19.05, C:9.50, W:23.0, CC:12.90, le:7.60, Ae:0.59, Ve:4.50, Al:775.0 }, 'FT114' : { PN:'5943001001', A:29.00, B:19.00, C:7.50, W:13.0, CC:19.80, le:7.30, Ae:0.37, Ve:2.70, Al:510.0 },