chiark / gitweb /
bike-lipo-box: rotate again so glands are at front for viewing while printing
[reprap-play.git] / lemon-stand.scad.pl
index d63c0cdd8ff629cff9b6a03363eb0ca637087658..8c1d10f54338529a21998c8656a3db2ba2fdaa25 100755 (executable)
@@ -7,21 +7,26 @@ use IO::File;
 use Data::Dumper;
 use constant tau => pi*2;
 
-my $ellipse = 25;
-my $circle = 7;
-my $channel = 5;
-my $xscale = 35/25;
-my $N = 30; #180; # around ellipse
-my $M = 20; #80; # around each circle
+my $ellipse = 25 / 2;
+my $circle = 7 / 2;
+my $channelh = 3;
+my $channelw = 4;
+my $xscale = 35 / 25;
+my $N = 180; # around ellipse
+my $M = 80; # around each circle
 my @channeldistprops = (0, 1/3, 2/3);
 
+my $NMdiv = $ENV{'LEMONSTAND_COARSE'} || 1;
+
+$M /= $NMdiv;
+$N /= $NMdiv;
+
 print <<END;
 // -*- C -*-
 // *** AUTOGENERATED - DO NOT EDIT ***
 END
 
 print "torusyup = ", ($circle / sqrt(2)), ";\n";
-print "channelstopup = ", ($channel / sqrt(2)), ";\n";
 
 our @ellipse = map {
     my $theta = tau * $_ / $N;
@@ -132,7 +137,9 @@ sub channels(){
        print "  rotate([0,0,$angle*360/",tau,"])\n";
        print "  rotate([0,90,0])\n";
        print "  translate([0,0, -2*$circle])\n";
-       print "  cylinder(r=$channel, h=4*$circle, \$fn=$M);\n";
+       print "  scale([1, $channelw/$channelh/2, 1])\n";
+       print "  rotate([0,0,360/8/2])\n";
+       print "  cylinder(r=$channelh, h=4*$circle, \$fn=8);\n";
     }
     print "}\n";
 }
@@ -149,11 +156,7 @@ module Stand(){
     difference(){
        translate([0,0,torusyup])
            Torusy();
-       intersection(){
-           Channels();
-           translate([-200,-200,-50])
-               cube([400,400, 50+channelstopup]);
-       }
+       Channels();
        translate([-200,-200,-50])
            cube([400,400,50]);
     }