// Fichero SoporteEnchufeInterruptor.scad // Proyecto: Robot Moveo // Descripción: soporte de enchufe e interruptor // Parámetros d_enc_int=20; // Distancia de enchufe a interruptor an_enc=20.5; // Ancho de hueco de enchufe lo_enc=28; // Largo de hueco de enchufe an_int=22.2; // Ancho de hueco de interruptor lo_int=27; // Largo de hueco de interruptor gr_sop=10; // Grosor del soporte d_tor_enc=40; // Distancia entre tornillos del enchufe dia_tor_enc=3; // Diámetro del tornillo del enchufe dia_tor_sop=4; // Diámetro del tornillo del soporte dia_cab_tor_sop=6.8; // Diámetro de la cabeza de ese tornillo pr_sop=30; // Profundidad de escuadra del soporte an_mar=7.9; // Ancho del marco alrededor de los elementos toler=0.2; // Tolerancia de medidas module tprism(l, w, h){ polyhedron( points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]], faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]] ); } ancho=an_int; if (an_enc > ancho) {ancho=an_enc;} echo(ancho); difference() { union() { cube([2*an_mar+4*dia_tor_enc+d_tor_enc+d_enc_int+lo_int,gr_sop,2*an_mar+ancho]); translate([0,gr_sop+pr_sop,2*an_mar+ancho]) rotate([0,180,180]) tprism(an_mar,pr_sop,2*an_mar+ancho); translate([an_mar+4*dia_tor_enc+d_tor_enc+d_enc_int+lo_int,gr_sop+pr_sop,2*an_mar+ancho]) rotate([0,180,180]) tprism(an_mar,pr_sop,2*an_mar+ancho); echo(2*an_mar+ancho); } // Hueco del enchufe translate([an_mar+(d_tor_enc-lo_enc)*0.5+2*dia_tor_enc,-0.5,an_mar+(ancho-an_enc)*0.5]) cube([lo_enc+toler,gr_sop+1,an_enc+toler]); // Huecos de tornillos del enchufe translate([an_mar+2*dia_tor_enc,-0.5,an_mar+ancho*0.5]) rotate([-90,0,0]) cylinder(d=dia_tor_enc+toler,h=gr_sop+1,$fn=100); translate([an_mar+2*dia_tor_enc+d_tor_enc,-0.5,an_mar+ancho*0.5]) rotate([-90,0,0]) cylinder(d=dia_tor_enc+toler,h=gr_sop+1,$fn=100); // Hueco del interruptor translate([an_mar+2*dia_tor_enc+d_tor_enc+d_enc_int,-0.5,an_mar]) cube([lo_int+toler,gr_sop+1,an_int+toler]); // Huecos de tornillos del soporte translate([an_mar*0.5,(gr_sop+pr_sop)*0.5,-0.5]) union() { cylinder(d=dia_tor_sop+toler,h=2*an_mar+ancho+1,$fn=100); cylinder(d=dia_cab_tor_sop+toler,h=ancho+1,$fn=100); } translate([an_mar+4*dia_tor_enc+d_tor_enc+d_enc_int+lo_int+an_mar*0.5,(gr_sop+pr_sop)*0.5,-0.5]) union() { cylinder(d=dia_tor_sop+toler,h=2*an_mar+ancho+1,$fn=100); cylinder(d=dia_cab_tor_sop+toler,h=ancho+1,$fn=100); } }