chiark / gitweb /
quacks-ingredients: -counts: Include spares in Base_White
[reprap-play.git] / treefoil.scad.pl
index b1ceecbec8400a3129e0aeffd953b0e3f234910d..ee233a948661e66ebc82cdb80d4dc94ac8d059ec 100755 (executable)
@@ -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 $!; }
 
@@ -36,3 +41,35 @@ o "}\n\n";
 while (<DATA>) { o $_ }
 
 __DATA__
+
+thick = 6;
+edgeu = 10;
+
+// calculated
+
+octa_long = thick;
+octa_short = octa_long / (1 + sqrt(2));
+
+module OctaThing() {
+    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();
+        }
+    }
+}
+
+rotate([0,0,45])
+  rotate([0,90,0])
+  Trace();
+
+