// Support pour le LCD 1602 du kit sunfounder RFID 1.0 // allviews base // LCD 1602 // allviews pcb // madisson old // allviews pcblong // madisson // viewopts pcblong brim5mm // allviews pcbproto // adafruit // allviews relay // relay kit sunfounder // allviews uln2003 // Motor control sunfoundere // testviews testbase testpcbproto testpcblong //// viewsopts brim5mm // h2 include lcd_width=36; lcd_length=80; pcb_length=72; pcb_width=46; thick=2; height=15; offset=2.5; ray1=3.5; ray2=1.5; pcbproto_length=81; pcbproto_width=30; pcbproto_offset=3; relay_length=34; relay_width=27; relay_height=9; uln2003_length=34; uln2003_width=32; uln2003_height=9; module tube(x,y,ray,height) { translate([x,y,0]){ cylinder(r=ray,h=height,$fn=40); } } module tubes(ray,height,width,length){ tube(offset,offset,ray,height); tube(length-offset,offset,ray,height); tube(length-offset,width-offset,ray,height); difference(){ tube(offset,width-offset,ray,height); r2=ray1*3; translate([-offset-1,width-r2-2*offset+0.5,-1]){ cube([r2,r2,height+2]); } } } module basecommon(length,width){ difference(){ union(){ cube([length,width,thick]); tubes(ray1,height,width,length); } union(){ translate([0,0,-1]){ w=7; w2=2*w; translate([w,w,0]) cube([length-w2,width-w2,thick+2]); tubes(ray2,height+2,width,length); translate([w/2,width/2,0]) cylinder(r=2,h=thick+2,$fn=40); translate([length-w/2,width/2,0]) cylinder(r=2,h=thick+2,$fn=40); translate([length/2,width-w/2,0]) cylinder(r=2,h=thick+2,$fn=40); translate([length/2,w/2,0]) cylinder(r=2,h=thick+2,$fn=40); } } } } module halftube(ray,height,width){ tube(offset,offset,ray,height); tube(offset,width-offset,ray,height); } module halfbasecommon(width){ length=10; difference(){ union(){ translate([-length/4,0,0]) cube([length,width,thick]); translate([0,1,0]) halftube(ray1,height,width-2); } union(){ translate([0,0,-1]){ translate([0,1,0]) halftube(ray2,height+2,width-2); translate([length/4,width/2,0]) cylinder(r=2,h=thick+2,$fn=40); } } } } module base(){ basecommon(lcd_length,lcd_width); } module pcb(){ basecommon(pcb_length,pcb_width); } module tube2(ray,height,width,length,off){ tube(off,width/2,ray,height); tube(length-off,width/2,ray,height); } module pcbproto(length,width,off){ difference(){ union(){ cube([length,width,thick]); tube2(ray1,height,width,length,off); } union(){ translate([0,0,-1]){ w=7; w2=2*w; translate([w,w,0]) cube([length-w2,width-w2,thick+2]); translate([length/2,width-w/2,0]) cylinder(r=2,h=thick+2,$fn=40); translate([length/2,w/2,0]) cylinder(r=2,h=thick+2,$fn=40); } translate([0,0,thick+1]) tube2(ray2,height+2,width,length,off); } } } module tube4(ray,height,width,length,off){ tube(off,off,ray,height); tube(off,width-off,ray,height); tube(length-off,off,ray,height); tube(length-off,width-off,ray,height); } module relay(length,width,height,off){ difference(){ union(){ cube([length,width,thick]); tube4(ray1,height,width,length,off); } union(){ translate([0,0,-1]){ w=7; w2=2*w; translate([w,w,0]) cube([length-w2,width-w2,thick+2]); translate([length/2,width-w/2,0]) cylinder(r=2,h=thick+2,$fn=40); translate([length/2,w/2,0]) cylinder(r=2,h=thick+2,$fn=40); } translate([0,0,thick+1]) tube4(ray2,height+2,width,length,off); } } } len_pcblong=48.5-3.5; module main_view(view){ if (view=="base"){ base(); }else if (view=="pcb"){ pcb(); }else if (view=="pcblong"){ halfbasecommon(len_pcblong); }else if (view=="testpcblong"){ translate([0,0,17]){ difference(){ cube([20,len_pcblong,1]); union(){ translate([3,3.5+0,-1]) cylinder(r=2,h=3,$fn=40); translate([3,3.5+37.5,-1]) cylinder(r=2,h=3,$fn=40); } } } halfbasecommon(len_pcblong); }else if (view=="pcbproto"){ pcbproto(pcbproto_length,pcbproto_width,pcbproto_offset); }else if (view=="relay"){ relay(relay_length,relay_width,relay_height,pcbproto_offset); }else if (view=="uln2003"){ relay(uln2003_length,uln2003_width,uln2003_height,pcbproto_offset); }else if (view=="testbase"){ intersection(){ translate([-1,-1,0]) cube([lcd_length+2,lcd_width+2,2]); translate([0,0,-thick+0.5]) base(); } }else if (view=="testpcbproto"){ intersection(){ translate([-1,-1,0]) cube([pcbproto_length+2,pcbproto_width+2,2]); translate([0,0,-thick+0.5]) pcbproto(pcbproto_length,pcbproto_width,pcbproto_offset); } } }