Merge branch 'pulley_drawing_efficiency' of https://github.com/martinbudden/NopSCADlib into martinbudden-pulley_drawing_efficiency

This commit is contained in:
Chris Palmer 2021-01-08 22:06:31 +00:00
commit 4b533cffd2
1 changed files with 17 additions and 15 deletions

View File

@ -108,24 +108,26 @@ module pulley(type) { //! Draw a pulley
cylinder(r = screw_radius(pulley_screw(type)), h = 100); cylinder(r = screw_radius(pulley_screw(type)), h = 100);
} }
color("silver") { color(silver) {
render() difference() { render_if(pulley_screw_z(type) < hl)
rotate_extrude() translate([r1, 0]) { difference() {
if(hl) rotate_extrude() translate([r1, 0]) {
square([pulley_hub_dia(type) / 2 - r1, hl]); if(hl)
square([pulley_hub_dia(type) / 2 - r1, hl]);
for(z = [pulley_hub_length(type), hl + ft + w]) for(z = [pulley_hub_length(type), hl + ft + w])
translate([0, z]) translate([0, z])
square([pulley_flange_dia(type) / 2 - r1, ft]); square([pulley_flange_dia(type) / 2 - r1, ft]);
}
if(pulley_screw_z(type) < hl)
screw_holes();
} }
if(pulley_screw_z(type) < hl) render_if(pulley_type(type)[0] == "T") // T5 pulleys have screw through the teeth
screw_holes(); difference() {
} core();
render() difference() { // T5 pulleys have screw through the teeth
core();
if(pulley_screw_z(type) > hl) if(pulley_screw_z(type) > hl)
screw_holes(); screw_holes();
} }
} }
} }