下载地址:https://github.com/ZhangGaoxing/openscad-models/tree/master/Sprinkle

  代码:

module screw(r=){
for(g=[::]){
translate([cos(g)*r,sin(g)*r,(g)/])
rotate(a=[,,g])
cylinder(.,.,.,center=true,$fn=);
}
} module cylinderWithScrew(){
union(){
// Cylinder shell
difference(){
cylinder(,16.5,16.5,$fn=);
cylinder(,15.5,15.5,$fn=);
} // Screw
union(){
translate([,,])screw();
translate([,,])rotate([,,])screw();
translate([,,])rotate([,,])screw();
}
}
} module sprinklerWall(){
difference(){
cylinder(,,16.5,$fn=);
cylinder(,33.5,15.5,$fn=); rotate([,,])translate([,,])cylinder(,1.5,1.5,$fn=);
}
} module sprinklerBottom(){
difference(){
cylinder(,,,$fn=); cylinder(,,,$fn=); for(i=[:0.2:0.8]){
rotate(i*/0.8,[,,])
translate([,,])
cylinder(,,,$fn=);
} for(i=[:0.2:1.6]){
rotate(i*/1.6,[,,])
translate([,,])
cylinder(,,,$fn=);
} for(i=[:0.2:2.4]){
rotate(i*/2.4,[,,])
translate([,,])
cylinder(,,,$fn=);
} for(i=[:0.2:3.2]){
rotate(i*/3.2,[,,])
translate([,,])
cylinder(,,,$fn=);
} for(i=[:0.2:]){
rotate(i*/,[,,])
translate([,,])
cylinder(,,,$fn=);
}
}
} union(){
sprinklerBottom();
translate([,,])sprinklerWall();
translate([,,])cylinderWithScrew();
}

  效果图:

OpenSCAD 建模:矿泉水瓶花洒-LMLPHP

04-14 22:02