/* * Copyright 2022 Thomas Buck - thomas@xythobuz.de * Philipp Schönberger - mail@phschoen.de * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * See . */ use ; include ; include ; for(i = [0:len(switch_config)]) switch_holder_plate(switch_config[i],switch_case_extra_width); module line(c="blue",p1=[0,0,0],p2,d=1) { p1 = p1 *10; p2 = p2 *10; color(c) hull() { translate ( p1*2.54) sphere(d); translate ( p2*2.54) sphere(d); } y = acos( (( p1*2.54)-( p2*2.54))[1] / sqrt( (( p1*2.54)-( p2*2.54))[0] *((p1*2.54)-( p2*2.54))[0] + ((p1*2.54)-( p2*2.54))[1]*((p1*2.54)-( p2*2.54))[1])); x = acos( (( p1*2.54)-( p2*2.54))[1] / sqrt( (( p1*2.54)-( p2*2.54))[0] *((p1*2.54)-( p2*2.54))[0] + ((p1*2.54)-( p2*2.54))[1]*((p1*2.54)-( p2*2.54))[1])); echo([ p2*2.54, [0, atan((sqrt( ( ((p1-p2)*2.54 )[0]*((p1-p2)*2.54 )[0] + ((p1-p2)*2.54 )[1]*((p1-p2)*2.54 )[1] ) )/ ((p1-p2)*2.54 )[2] )), atan( ((p1-p2)*2.54 )[1] /((p1-p2)*2.54 )[0] ) ]]); } for(f=[0:5]) for(i = switch_config[1][f]) color(i[3]) translate(i[0]) rotate(i[1]) { cylinder(d=1, h =150); } // finger 1 line("red", [5.626412,4.890490,4.921143],[3.603139,5.951178,1.756010]); line("red", [5.626412,4.890490,4.921143],[3.601304,5.185127,1.597157]); line("red", [5.626412,4.859049,4.921143],[3.680820,4.407240,1.571830]); line("red", [5.626412,4.890490,4.921143],[3.686250,6.574620,2.042010]); // finger 2 line("green", [5.476960,5.040864,4.524379],[4.324486,6.084067,1.400235]); line("green", [5.476960,5.040864,4.524379],[4.328402,5.307730,1.240122]); line("green", [5.476960,5.040864,4.524379],[4.391585,4.517622,1.249485]); line("green", [5.476960,5.040864,4.524379],[4.510779,3.754514,1.427841]); line("green", [5.476960,5.040864,4.524379],[4.380041,6.806573,1.721562]); line("blue", [5.614666,5.194831,3.515830],[5.065645,6.200934,1.067919]); line("blue", [5.614666,5.194831,3.515830],[5.080251,5.408403,0.874860]); line("blue", [5.614666,5.194831,3.515830],[5.143544,4.896416,0.922400]); line("blue", [5.614666,5.194831,3.515830],[5.249757,3.838946,1.206208]); line("blue", [5.614666,5.194831,3.515830],[5.101057,6.901806,1.483988]); // finger 3 line("brown", [6.306084,5.091255,4.240877],[5.889712,6.192233,1.070680]); line("brown", [6.306084,5.091255,4.240877],[5.915799,5.415294,0.897474]); line("brown", [6.306084,5.091255,4.240877],[5.963534,4.620381,0.909720]); line("brown", [6.306084,5.091255,4.240877],[6.030270,3.851587,1.106739]); line("brown", [6.306084,5.091255,4.240877],[5.886720,6.908103,1.419731]); // finger 4 line("gray", [7.085053,4.987385,4.453756],[6.736145,5.156350,0.989659]); line("gray", [7.085053,4.987385,4.453756],[6.777004,4.371971,1.036648]); line("gray", [7.085053,4.987385,4.453756],[6.708940,6.659750,1.418630]); line("gray", [7.085053,4.987385,4.453756],[6.833560,3.618950,1.257760]); line("cyan", [7.736480,5.132073,3.684937],[7.569335,6.085933,1.084243]); line("cyan", [7.736480,5.132073,3.684937],[7.606606,5.316667,0.918996]); line("cyan", [7.736480,5.132073,3.684937],[7.654340,4.532530,0.976580]); line("cyan", [7.736480,5.132073,3.684937],[7.545530,6.778350,1.459020]);