-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 " 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";
-}
-
-channels();
-