X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=treefoil.scad.pl;h=ee233a948661e66ebc82cdb80d4dc94ac8d059ec;hb=3c1da07f2c510b741d2a83025220c7c1b70aab44;hp=82b0c59b0feb8058b690f82d038edcdffc01e88a;hpb=0aab309501e2f387193d20aa8cc2d6402de47e4b;p=reprap-play.git diff --git a/treefoil.scad.pl b/treefoil.scad.pl index 82b0c59..ee233a9 100755 --- a/treefoil.scad.pl +++ b/treefoil.scad.pl @@ -1,5 +1,8 @@ #!/usr/bin/perl -w +# Use: +# - support X/Y dist 0.5mm + use strict; our $shape = <<'END'; @@ -7,6 +10,8 @@ xyyZZYYXYxxyzYYZXzzxyXXYXXXZxxxyyXXZyyyzXXzz zxxYYXXZXzzxyXXYZyyzxZZXZZZYzzzxxZZYxxxyZZyy yzzXXZZYZyyzxZZXYxxyzYYZYYYXyyyzzYYXzzzxYYxx END +# simple version (unknotted, [0,1,2]^3): +# YxxyzYYZXzzxyXXYZyyzxZZX sub o { print @_ or die $!; } @@ -37,7 +42,8 @@ while () { o $_ } __DATA__ -thick = 8; +thick = 6; +edgeu = 10; // calculated @@ -45,12 +51,25 @@ octa_long = thick; octa_short = octa_long / (1 + sqrt(2)); module OctaThing() { - foreach (r = [[0,0,0], [90,0,0], [0,90,0]]) { - rotate(r) - cube([ octa_short,octa_short, octa_long ], center=true); + hull(){ + for (r = [[0,0,0], [90,0,0], [0,90,0]]) { + rotate(r) + cube([ octa_short,octa_short, octa_long ], center=true); + } + } +} + +module TraceEdge(p,q) { + hull(){ + for (x=[p,q]) { + translate(x * edgeu) + OctaThing(); + } } } -OctaThing(); +rotate([0,0,45]) + rotate([0,90,0]) + Trace();