X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=lemon-stand.scad.pl;h=ecb6906c76101e2f56f72cf936d8f681e21d67a2;hb=f6ede18788a0a408f0b711a51a4c20a5a9eb2540;hp=84417f2377b54ea4fa1f3a8de058aaaddbb6e60b;hpb=287cc98bc3375dd3f3b72af14e3061f8aafca011;p=reprap-play.git diff --git a/lemon-stand.scad.pl b/lemon-stand.scad.pl index 84417f2..ecb6906 100755 --- a/lemon-stand.scad.pl +++ b/lemon-stand.scad.pl @@ -7,16 +7,20 @@ 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 = 180; # around ellipse +my $M = 80; # around each circle +my @channeldistprops = (0, 1/3, 2/3); + print < #$i=$ellipse[$i] $prorata $ellipse[$i+1]\n"; + return ( + (1-$prorata) * $ellipse[$i] + ($prorata) * $ellipse[$i+1], + $alongs[$i], + ); + } + die "$distprop ?"; +} + +sub channels(){ + print "module Channels(){\n"; + + foreach my $cdp ( + (map { 0.5 * $_ } @channeldistprops), + (map { 0.5 * ($_+1) } @channeldistprops), + ) { + my ($ctr, $along) = infodistprop($cdp); + my $angle = atan2(-$along->[0], $along->[1]); + print " translate(",scadvec($ctr),")\n"; + print " rotate([0,0,$angle*360/",tau,"])\n"; + print " rotate([0,90,0])\n"; + print " translate([0,0, -2*$circle])\n"; + print " rotate([0,0,360/8/2])\n"; + print " cylinder(r=$channel, h=4*$circle, \$fn=8);\n"; + } + print "}\n"; +} + +channels(); + while () { print }; STDOUT->error and die $!; STDOUT->flush or die $!; __DATA__ -Torusy(); +module Stand(){ + difference(){ + translate([0,0,torusyup]) + Torusy(); + Channels(); + translate([-200,-200,-50]) + cube([400,400,50]); + } +} +Stand();