]> www.fi.muni.cz Git - things.git/commitdiff
simplified triangle
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Thu, 14 Jan 2021 17:08:05 +0000 (18:08 +0100)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Thu, 14 Jan 2021 17:08:05 +0000 (18:08 +0100)
quasar-triangle.scad

index 4ed5f32acbea3e874462a13cf1b502f1a83c0572..c3759df1cfa0dd98b78a068d004e1358717d349d 100644 (file)
@@ -24,28 +24,25 @@ module side_cube() {
                cube([infty, infty, body_h+2*eps]);
 }
 
+module left_side(w, h) {
+       for (i=[0:$children]) {
+               translate([w/2, 0, 0])
+               rotate([0, 0, 90+atan(w/(2*h))])
+               translate([infty/5, 0, 0])
+                       child(i);
+       }
+}
+
 module triangle(w, h) {
        intersection() {
                union() {
                        tbar();
-                       translate([w/2, 0, 0])
-                       rotate([0, 0, 90+atan(w/(2*h))])
-                       translate([infty/5, 0, 0])
-                               tbar();
-                       translate([-w/2, 0, 0])
-                       rotate([0, 0, -90-atan(w/(2*h))])
-                       translate([-infty/5, 0, 0])
-                               tbar();
+                       left_side(w, h) tbar();
+                       scale([-1, 1, 1]) left_side(w, h) tbar();
                }
                        side_cube();
-                       translate([w/2, 0, 0])
-                       rotate([0, 0, 90+atan(w/(2*h))])
-                       translate([infty/5, 0, 0])
-                               side_cube();
-                       translate([-w/2, 0, 0])
-                       rotate([0, 0, -90-atan(w/(2*h))])
-                       translate([-infty/5, 0, 0])
-                               side_cube();
+                       left_side(w, h) side_cube();
+                       scale([-1, 1, 1]) left_side(w, h) side_cube();
        }
 }