Cours:Fabrication : Différence entre versions
(→openscad) |
(→openscad) |
||
Ligne 8 : | Ligne 8 : | ||
https://www.apmep.fr/IMG/pdf/AtelierOpenSCAD.pdf | https://www.apmep.fr/IMG/pdf/AtelierOpenSCAD.pdf | ||
+ | |||
+ | |||
+ | ==fichiers pour coupe de robotique== | ||
+ | |||
+ | <source lang=c> | ||
+ | tailleCube=7.5; | ||
+ | isConge=1; | ||
+ | isPercage=1; | ||
+ | rayonPercage=1.5; | ||
+ | conge=0.25; | ||
+ | $fn=25; | ||
+ | |||
+ | module longeronX(nbCubes=3,posX=0,posY=0,posZ=0) | ||
+ | { | ||
+ | translate([posX*tailleCube,posY*tailleCube,posZ*tailleCube]) | ||
+ | rotate([0,0,0]) | ||
+ | longeron(nbCubes); | ||
+ | } | ||
+ | |||
+ | module longeronY(nbCubes=3,posX=0,posY=0,posZ=0) | ||
+ | { | ||
+ | translate([posX*tailleCube,posY*tailleCube,posZ*tailleCube]) | ||
+ | rotate([0,0,90]) | ||
+ | longeron(nbCubes); | ||
+ | } | ||
+ | |||
+ | module longeronZ(nbCubes=3,posX=0,posY=0,posZ=0) | ||
+ | { | ||
+ | translate([posX*tailleCube,posY*tailleCube,posZ*tailleCube]) | ||
+ | rotate([0,-90,0]) | ||
+ | longeron(nbCubes); | ||
+ | } | ||
+ | |||
+ | module longeron(nbCubes=3) | ||
+ | { | ||
+ | difference() | ||
+ | { | ||
+ | translate([-tailleCube/2,-tailleCube/2,-tailleCube/2]) | ||
+ | cube([tailleCube*nbCubes,tailleCube,tailleCube]); | ||
+ | if (isPercage==1) | ||
+ | { | ||
+ | for (i=[0:nbCubes-1]) | ||
+ | { | ||
+ | translate([i*tailleCube,0,0]) | ||
+ | rotate([0,0,0]) | ||
+ | trou(); | ||
+ | translate([i*tailleCube,0,0]) | ||
+ | rotate([90,0,0]) | ||
+ | trou(); | ||
+ | } | ||
+ | rotate([0,90,0]) | ||
+ | trou(nbCubes); | ||
+ | }} | ||
+ | } | ||
+ | |||
+ | |||
+ | module boite() | ||
+ | { | ||
+ | difference() | ||
+ | { | ||
+ | cube([tailleCube,tailleCube,tailleCube],center=true); | ||
+ | if (isPercage==1) | ||
+ | { | ||
+ | rotate([0,0,0]) | ||
+ | trou(); | ||
+ | rotate([90,0,0]) | ||
+ | trou(); | ||
+ | rotate([0,90,0]) | ||
+ | trou(); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | module trou(size=1) | ||
+ | { | ||
+ | translate([0,0,(size-1)*tailleCube/2]) | ||
+ | { | ||
+ | cylinder(h=tailleCube*size+2*conge, r=rayonPercage,center=true); | ||
+ | if (isConge==1) | ||
+ | { | ||
+ | translate([0,0,-tailleCube*size/2-conge]) | ||
+ | cylinder(h=2*conge, d1=(rayonPercage+2*conge)*2, | ||
+ | d2=(rayonPercage)*2); | ||
+ | translate([0,0,tailleCube*size/2-conge]) | ||
+ | cylinder(h=2*conge, d2=(rayonPercage+2*conge)*2, | ||
+ | d1=(rayonPercage)*2); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </source> |
Version du 18 novembre 2020 à 15:09
CharlyGraal
https://www.youtube.com/channel/UCZ2wggss-0usQrapW_bGplQ/videos
openscad
http://static.fablab-lannion.org/tutos/openscad/#/pageDeGarde
https://www.apmep.fr/IMG/pdf/AtelierOpenSCAD.pdf
fichiers pour coupe de robotique
tailleCube=7.5;
isConge=1;
isPercage=1;
rayonPercage=1.5;
conge=0.25;
$fn=25;
module longeronX(nbCubes=3,posX=0,posY=0,posZ=0)
{
translate([posX*tailleCube,posY*tailleCube,posZ*tailleCube])
rotate([0,0,0])
longeron(nbCubes);
}
module longeronY(nbCubes=3,posX=0,posY=0,posZ=0)
{
translate([posX*tailleCube,posY*tailleCube,posZ*tailleCube])
rotate([0,0,90])
longeron(nbCubes);
}
module longeronZ(nbCubes=3,posX=0,posY=0,posZ=0)
{
translate([posX*tailleCube,posY*tailleCube,posZ*tailleCube])
rotate([0,-90,0])
longeron(nbCubes);
}
module longeron(nbCubes=3)
{
difference()
{
translate([-tailleCube/2,-tailleCube/2,-tailleCube/2])
cube([tailleCube*nbCubes,tailleCube,tailleCube]);
if (isPercage==1)
{
for (i=[0:nbCubes-1])
{
translate([i*tailleCube,0,0])
rotate([0,0,0])
trou();
translate([i*tailleCube,0,0])
rotate([90,0,0])
trou();
}
rotate([0,90,0])
trou(nbCubes);
}}
}
module boite()
{
difference()
{
cube([tailleCube,tailleCube,tailleCube],center=true);
if (isPercage==1)
{
rotate([0,0,0])
trou();
rotate([90,0,0])
trou();
rotate([0,90,0])
trou();
}
}
}
module trou(size=1)
{
translate([0,0,(size-1)*tailleCube/2])
{
cylinder(h=tailleCube*size+2*conge, r=rayonPercage,center=true);
if (isConge==1)
{
translate([0,0,-tailleCube*size/2-conge])
cylinder(h=2*conge, d1=(rayonPercage+2*conge)*2,
d2=(rayonPercage)*2);
translate([0,0,tailleCube*size/2-conge])
cylinder(h=2*conge, d2=(rayonPercage+2*conge)*2,
d1=(rayonPercage)*2);
}
}
}