// Petits trous mèche 7/64 // Gros trous mèche 9/64 pour rail dyn // Trous pour borne de masse mèche 11/64. Vis M4 70x10 // Vis pour attacher le rail DYN: 6-32 nylon insert lock nut. // allviews pdu guide-prise guide-disjoncteur // allviews devant capot capot-plat capot-guide1 capot-guide2 // allviews base base-plat base-guide1 base-guide2 base-guide3 base-attache // allviews assemblage-final // allviews assemblage-explose-1 assemblage-explose-5 // allviews angle-droit angle-gauche // testviews test-angle-droit // testviews devant-test base-guide-test base-guide-asm capot-guide-asm include module masse(name,thick,width,height,col){ color ("yellow") cube([width,thick/2,height]); translate([0,thick/2,0]) color ("green") cube([width,thick/2,height]); } module bloc(name,thick,width,height,col){ cube([width,thick,height]); } module bornier(name,thick,width,height,col){ color(col){ cube([width,thick,10]); translate([10,0,0]) cube([width-20,thick,height]); } } module bornier50A(name,thick,width,height,col){ bornier(name,thick,width,height,col); } module bornier100A(name,thick,width,height,col){ bornier(name,thick,width,height,col); } module disjoncteur_2P40A(name,thick,width,height,col){ color("white"){ cube([width,thick,height-15]); translate([10,0,0]) cube([width-20,thick,height]); } } module cap(name,thick,width,height,col){ color("white") cube([width,thick,height]); } module cap50A(name,thick,width,height,col){ cap(name,thick,width,height,col); } module cap100A(name,thick,width,height,col){ cap(name,thick,width,height,col); } module prisec13(name,thick,width,height,col){ color("black") translate([0,0,0])cube([width,thick,height]); } include module pdu(){ %translate([-110,0,0]) cube([pdu_depth,pdu_width,pdu_height]); color("orange") translate([-35/2,10,0]) cube([35,pdu_width-20,7.5]); pdugen(); } petit_trous=1.6; gros_trous=2; devant_thick=1.5; // Pour prise digikey module support_trous(len,nbtrous,trou_ray){ if(nbtrous > 0){ skip = len/(nbtrous+1); translate([sidesup/2,skip,-1]){ for (h=[0:nbtrous-1]){ translate([0,h*skip,0]) cylinder(r=trou_ray,h=6,$fn=40); } } } } module support_gen(len,nbtrous,thick,trou_ray){ difference(){ linear_extrude(thick){ off=1.5; s2=sidesup+off; polygon([[0,off],[sidesup,s2],[sidesup,len-s2],[0,len-off] ,[0,off]]); } support_trous(len,nbtrous,trou_ray); } } module support(len,nbtrous){ support_gen(len,nbtrous,1,petit_trous); } module base(){ difference(){ cube([pdu_width,pdu_depth,pdu_height]); translate([1,-1,1]) cube([pdu_width-2,pdu_depth+2,pdu_height+1]); } // Extrémités haut translate([0,0,pdu_height-1]) support(pdu_depth,2); translate([pdu_width,pdu_depth,pdu_height-1]) rotate([0,0,180]) support(pdu_depth,2); // plancher translate([0,0,0]) rotate([0,-90,-90]) support(pdu_width,3); translate([0,pdu_depth-1,0]) rotate([0,-90,-90]) support(pdu_width,3); // Cotés translate([0,1,0]) rotate([90,0,0]) support(pdu_height,1); translate([0,pdu_depth,0]) rotate([90,0,0]) support(pdu_height,1); translate([pdu_width,0,0]) rotate([90,0,180]) support(pdu_height,1); translate([pdu_width,pdu_depth,0]) rotate([90,0,180]) support(pdu_height,1); } slotthick=4; module base_slot(len,sub){ translate([sub,0,0]) cube([len-2*sub,slotthick,thguide+1+1]); } thguide=1.5; module base_plat(){ echo ("long=",pdu_width+pdu_height+pdu_height+sidesup+sidesup); echo ("large=",pdu_depth+sidesup+sidesup); echo ("long1=",pdu_width); echo ("sidesup=",sidesup); echo ("haut=",pdu_height); ray=2.5; difference(){ union(){ cube([pdu_width+pdu_height+pdu_height,pdu_depth,thguide]); // Supports de chaque coté translate([pdu_height,0,0]) rotate([0,0,-90]) support_gen(pdu_width,3,thguide,ray); translate([pdu_height+pdu_width,pdu_depth,0]) rotate([0,0,90]) support_gen(pdu_width,3,thguide,ray); // 4 supports normalement verticaux translate([0,0,0]) rotate([0,0,-90]) support_gen(pdu_height,1,thguide,ray); translate([pdu_height+pdu_width,0,0]) rotate([0,0,-90]) support_gen(pdu_height,1,thguide,ray); translate([pdu_height,pdu_depth,0]) rotate([0,0,90]) support_gen(pdu_height,1,thguide,ray); translate([pdu_height+pdu_width+pdu_height,pdu_depth,0]) rotate([0,0,90]) support_gen(pdu_height,1,thguide,ray); // Supports aux extrémités translate([0,0,1]) rotate([0,180,0]) support_gen(pdu_depth,2,thguide,ray); translate([pdu_height*2+pdu_width,0,0]) rotate([0,0,0]) support_gen(pdu_depth,2,thguide,ray); } translate([0,0,-1])union(){ // De chaque coté translate([pdu_height,0,0]) base_slot(pdu_width,50); translate([0,0,0]) base_slot(pdu_height,15); translate([pdu_height+pdu_width,0,0]) base_slot(pdu_height,15); translate([pdu_height,pdu_depth-slotthick,0]) base_slot(pdu_width,50); translate([0,pdu_depth-slotthick,0]) base_slot(pdu_height,15); translate([pdu_height+pdu_width,pdu_depth-slotthick,0]) base_slot(pdu_height,15); // Aux extrémités translate([slotthick,0,0]) rotate([0,0,90]) base_slot(pdu_depth,30); translate([pdu_height+pdu_width+pdu_height,0,0]) rotate([0,0,90]) base_slot(pdu_depth,30); // 2 panneaux verticaux translate([pdu_height+slotthick,0,0]) rotate([0,0,90]) base_slot(pdu_depth,30); translate([pdu_height+pdu_width,0,0]) rotate([0,0,90]) base_slot(pdu_depth,30); // Trous pour le rail dyn dynx=pdu_height+pdu_width/2-100/2; dyny=pdu_depth-60; translate([dynx,dyny,0]) cylinder(r=2,h=3,$fn=40); translate([dynx+100,dyny,0]) cylinder(r=2,h=3,$fn=40); // Trous pour la borne de masse massex=pdu_height+10+7/2; massey=pdu_depth-40; translate([massex,massey,0]) cylinder(r=2.2,h=3,$fn=40); translate([massex,massey-17,0]) cylinder(r=2.2,h=3,$fn=40); // Trou pour serre fil serrex=pdu_height+pdu_width+pdu_height/2+5; serrey=pdu_width-60; translate([serrex,serrey-17,0]) cylinder(r=8,h=3,$fn=40); // Trous du bas pour supports de coté translate([pdu_height-sidesup-5,0,0]) support_trous(pdu_depth,2,ray); translate([pdu_height+pdu_width+5,0,0]) support_trous(pdu_depth,2,ray); // Trous arrière pour supports de coté translate([pdu_height,pdu_depth-sidesup-5,0]) rotate([0,0,90]) support_trous(pdu_height,1,ray); translate([pdu_height+pdu_width,pdu_depth-5,0]) rotate([0,0,-90]) support_trous(pdu_height,1,ray); } } } module capot(plat,thick){ difference(){ union(){ cube([pdu_width,pdu_depth+devant_thick,thick]); if (plat){ translate([0,-pdu_height-1,0]) cube([pdu_width,pdu_height+1,thick]); }else{ cube([pdu_width,1,pdu_height+1]); } } translate([0,pdu_depth,0]) rotate([0,0,-90]) support_trous(pdu_width,3,gros_trous); if (plat){ translate([0,-pdu_height-1+sidesup,0]) rotate([0,0,-90]) support_trous(pdu_width,3,gros_trous); translate([0,-pdu_height-1,0]) rotate([0,0,0]) support_trous(pdu_height+1,1,gros_trous); translate([pdu_width-sidesup,-pdu_height-1,0]) rotate([0,0,0]) support_trous(pdu_height+1,1,gros_trous); translate ([0,0,-1]) base_slot(pdu_width,40); }else{ translate([0,0,pdu_height-sidesup]) rotate([0,-90,-90]) support_trous(pdu_width,3,gros_trous); translate([0,0,pdu_height+1]) rotate([-90,0,0]) support_trous(pdu_height+1,1,gros_trous); translate([pdu_width-sidesup,0,pdu_height+1]) rotate([-90,0,0]) support_trous(pdu_height+1,1,gros_trous); } translate([0,0,0]) rotate([0,0,0]) support_trous(pdu_depth,2,gros_trous); translate([pdu_width-sidesup,0,0]) rotate([0,0,0]) support_trous(pdu_depth,2,gros_trous); } } module devant(){ difference(){ cube([pdu_width,pdu_height,devant_thick]); width=32+1; height=24+1; thick=3; marge=sidesup+4; espace=pdu_width-marge*2; inter=(espace-nbprise*width)/(nbprise-1); echo ("inter=",inter); for (x=[0:nbprise-1]){ translate([marge+x*(width+inter),marge+10,-1]) cube([width,height,thick+2]); } translate([0,sidesup,0]) rotate([0,0,-90]) support_trous(pdu_width,3,gros_trous); translate([0,0,0]) rotate([0,0,0]) support_trous(pdu_height,1,gros_trous); translate([pdu_width-sidesup,0,0]) rotate([0,0,0]) support_trous(pdu_height,1,gros_trous); } translate([0,pdu_height-devant_thick,0]) rotate([0,-90,-90]) support_gen(pdu_width,3,1.5,petit_trous); } module fixation(offx,offray,height){ off=sidesup; pos1=pdu_depth/8; pos2=7*pdu_depth/8; for (y=[pos1-10,pos1,pos1+10,pos2-10,pos2,pos2+10]){ translate([offx,y+off,-1]) cylinder(r=2-offray,h=height,$fn=40); } } capot_cut=(pdu_depth+1+pdu_height+1)/2; module capot_guide1(){ intersection(){ cube([pdu_width,capot_cut,thguide]); difference(){ translate([0,pdu_height+1,0]) capot(true,thguide); translate([pdu_width-10,capot_cut-sidesup,0]) rotate([0,0,90]) fixation(5,0,thguide+2); // On enlève du plastique off=20; off2=off*2; translate([off,off,-1]) cube([pdu_width-off2,pdu_height-30,thguide+2]); translate([off,pdu_height+15,-1]) cube([pdu_width-off2,15,thguide+2]); } } } module capot_guide2(){ intersection(){ cube([pdu_width,capot_cut,thguide]); difference(){ diff=capot_cut-pdu_height-1; translate([0,-diff,0]) capot(true,thguide); translate([pdu_width-10,0,0]) rotate([0,0,90]) fixation(5,0,thguide+2); // On enlève du plastique off=20; off2=off*2; translate([off,off,-1]) cube([pdu_width-off2,capot_cut-off2,thguide+2]); } } } module assemblage(espace){ color("gray") base(); color("green") translate([pdu_width,-1.5-espace,0]) rotate([90,0,180]) devant(); color("red") translate([0,espace+1+pdu_depth,pdu_height+1+espace]) rotate([180,0,0]) capot(false,1); } offcut=pdu_height+sidesup*3; // Coupure pour les guides module base_attache(){ thick=2; intersection(){ cube([80,180,10]); union(){ translate([0,13,0]) cube([20,30,thick]); translate([0,126,0]) cube([20,30,thick]); reduit=0.6; translate([0,0,thick]) fixation(5,reduit,3.5); translate([0,0,thick]) fixation(15,reduit,3.5); } } } module base_guide1(){ intersection(){ cube([pdu_width-sidesup*4,pdu_depth+sidesup+sidesup,thguide]); union(){ difference(){ translate([-pdu_height-sidesup*2,sidesup,0]) base_plat(); offx=10; offy=20; offx2=2*offx; offy2=2*offy; translate([offx,offy,-1]) difference(){ cutw=pdu_width-sidesup*4-offx2; cube([cutw,pdu_depth-offy2+2*sidesup,thguide+2]); translate([0,pdu_depth-75,-1]) cube([20,10,thguide+4]); translate([cutw-20,pdu_depth-75,-1]) cube([20,10,thguide+4]); } fixation(5,0,3); fixation(pdu_width-sidesup*4-5,0,3); } translate([20,10,0]) rotate([0,0,50]) translate([0,0,0]) cube([pdu_width+30,15,thguide]); translate([pdu_width-sidesup*4,10,0]) rotate([0,0,40+90]) translate([10,0,0]) cube([pdu_width+30,15,thguide]); } } } module base_guide2(){ intersection(){ cube([offcut,pdu_depth+sidesup+sidesup,thguide]); union(){ difference(){ translate([sidesup,sidesup,0]) base_plat(); s2=sidesup*2; translate([s2,s2,-1]) cube([pdu_height-s2-5,pdu_depth-s2-4,3]); fixation(offcut-5,0,3); } } } } module base_guide3(){ intersection(){ cube([offcut,pdu_depth+sidesup+sidesup,thguide]); union(){ difference(){ translate([-pdu_height-pdu_width+2*sidesup,sidesup,0]) base_plat(); s2=sidesup*2; s3=sidesup*3+5; translate([s3,s2,-1]) cube([pdu_height-s2-4,pdu_depth-s2-7-32,3]); fixation(5,0,3); } } } } angle_thick=3; // Support de chaque coté pour attacher le PDU module angle_support(droit){ ajout=4; height=sidesup+5+ajout; thick=angle_thick; offz=droit ? 0 : -height; difference(){ union(){ cube([pdu_depth,height,thick]); translate([0,0,offz]) cube([pdu_depth,thick,height]); translate([pdu_depth-height,0,0]) cube([height,pdu_height+5+ajout,thick]); translate([0,0,offz]){ translate([pdu_depth-thick,0,0]) cube([thick,pdu_height+5+ajout,height]); } } union(){ // Trous vers le boitier translate([0,sidesup+5+ajout,0]) rotate([0,0,-90]) support_trous(pdu_depth,2,gros_trous); translate([pdu_depth-sidesup-5,5+ajout-3-1.5,0]) rotate([0,0,0]) support_trous(pdu_height,1,gros_trous); // Trous pour attacher à la tablette translate([0,0,offz]){ translate([0,thick,height-1]) rotate([0,90,-90]) support_trous(pdu_depth,4,2.5); translate([pdu_depth-thick,5,height-1]) rotate([0,90,0]) support_trous(pdu_height,3,2.5); } } } } module main_view(view){ if (view=="pdu"){ pdu(); }else if (view=="base"){ base(); }else if (view=="base-plat"){ translate([pdu_height+sidesup,pdu_depth+sidesup+sidesup+1,0]) base(); translate([sidesup,sidesup,0]) base_plat(); }else if (view=="base-guide1"){ rotate([0,0,90]) base_guide1(); }else if (view=="base-guide2"){ base_guide2(); }else if (view=="base-guide3"){ base_guide3(); }else if (view=="base-guide-asm"){ translate([pdu_height+sidesup*3+10,0,5]) rotate([0,180,0]) base_attache(); translate([pdu_height+sidesup,2*(pdu_depth+sidesup*2+10),0]) base(); translate([sidesup,pdu_depth+sidesup*2+20,0]) base_plat(); base_guide2(); skip=0; translate([offcut+skip,0,0]) base_guide1(); translate([pdu_height+pdu_width-sidesup+2*skip ,0,0]) base_guide3(); }else if (view=="base-guide-test"){ intersection(){ cube([100,51,1]); translate([0,0,0]) base_guide2(); } }else if (view=="base-attache"){ base_attache(); }else if (view=="capot"){ capot(false,1); }else if (view=="capot-plat"){ capot(true,1); }else if (view=="capot-guide1"){ capot_guide1(); }else if (view=="capot-guide2"){ capot_guide2(); }else if (view=="capot-guide-asm"){ translate([pdu_width+20,pdu_height+1,0]) capot(true,1); capot_guide1(); translate([0,capot_cut+1,0]) capot_guide2(); }else if (view=="devant"){ devant(); }else if (view=="devant-test"){ intersection(){ cube([90,39,devant_thick]); translate([-7,-7,0]) devant(); } }else if (view=="guide-prise"){ width=32+1; height=24+1; thick=3; inter=10; nb=4; difference(){ cube([nb*width+(nb+1)*inter,height+2*inter,thick]); for (x=[0:nb-1]){ translate([inter+x*(width+inter),inter,-1]) cube([width,height,thick+2]); } } }else if (view=="assemblage-explose-5"){ assemblage(5); }else if (view=="assemblage-explose-1"){ assemblage(1.5); }else if (view=="assemblage-final"){ assemblage(0); }else if (view=="guide-disjoncteur"){ width=35+1+1; len=45+1+1; thick=3; extra=7; difference(){ cube([len+extra*2,width+extra*2,thick]); translate([extra,extra,-1]) cube([len,width,thick+2]); } }else if (view=="angle-droit"){ angle_support(true); }else if (view=="angle-gauche"){ rotate([0,0,180]) translate([0,0,angle_thick]) rotate([180,0,0]) angle_support(false); }else if (view=="test-angle-droit"){ intersection(){ cube([pdu_depth,pdu_height+5,0.5]); angle_support(true); } } }