下载地址:https://github.com/ZhangGaoxing/openscad-models/tree/master/BottleCap
代码:
module screw(r=){
for(g=[::]){
translate([cos(g)*r,sin(g)*r,(g)/])
rotate(a=[,,g])
cylinder(.,.,.,center=true,$fn=);
}
} module ring(h,r1,r2){
difference(){
cylinder(h,r1,r1,$fn=);
cylinder(h,r2,r2,$fn=);
}
} union(){
// Cylinder shell
difference(){
cylinder(,16.5,16.5,$fn=);
translate([,,])cylinder(,15.5,15.5,$fn=);
}
// Patterns on the shell
for(i=[:0.2:]){
rotate(i*/,[,,])
translate([,16.5,])
cylinder(,.,.,$fn=);
}
// Washer
translate([,,])ring(,12.5,);
translate([,,])ring(,14.5,);
// Screw
union(){
translate([,,])screw();
translate([,,])rotate([,,])screw();
translate([,,])rotate([,,])screw();
}
}
效果图: