Conditionally rendered pulleys to speed up drawing.

This commit is contained in:
Martin Budden 2021-01-08 11:33:17 +00:00
parent 16c1eeef27
commit bd4f7b155b
1 changed files with 17 additions and 15 deletions

View File

@ -108,8 +108,9 @@ 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)
difference() {
rotate_extrude() translate([r1, 0]) { rotate_extrude() translate([r1, 0]) {
if(hl) if(hl)
square([pulley_hub_dia(type) / 2 - r1, hl]); square([pulley_hub_dia(type) / 2 - r1, hl]);
@ -121,7 +122,8 @@ module pulley(type) { //! Draw a pulley
if(pulley_screw_z(type) < hl) if(pulley_screw_z(type) < hl)
screw_holes(); screw_holes();
} }
render() difference() { // T5 pulleys have screw through the teeth render_if(pulley_type(type)[0] == "T") // T5 pulleys have screw through the teeth
difference() {
core(); core();
if(pulley_screw_z(type) > hl) if(pulley_screw_z(type) > hl)