chiark / gitweb /
quacks-ingredients: -update-levels
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Feb 2020 20:31:37 +0000 (20:31 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Feb 2020 20:31:37 +0000 (20:31 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Makefile
quacks-ingredients-L1.scad [new file with mode: 0644]
quacks-ingredients-L2.scad [new file with mode: 0644]
quacks-ingredients-L3.scad [new file with mode: 0644]
quacks-ingredients-L4.scad [new file with mode: 0644]
quacks-ingredients-L5.scad [new file with mode: 0644]
quacks-ingredients-demos.scad [new file with mode: 0644]
quacks-ingredients-update-levels [new file with mode: 0755]
quacks-ingredients.scad

index 1426c4b2ba24c545a518a3f7437029a84aad332c..7979c36579ed7431cb9fac1f8e2f8e6e6001ef09 100644 (file)
--- a/Makefile
+++ b/Makefile
 FILAMENTSPOOL_AUTOS = filamentspool filamentspool-lt filamentspool-sm
 FILAMENTSPOOL_AUTOS += filamentspool-storarm3
 
-USING_AUTOS ?= $(FILAMENTSPOOL_AUTOS) xeno-drivebay-bracket dungeonquest-cone anke-gps-bracket cable-hole-trunking-cover anglepoise-neck crossbar-computer-led-mount wardrobe-hook knifeblock pandemic-counter pattress-boxes-3-cover bike-lipo-box earring-stand bike-stalk-led-mount sewing-table sewing-table-test sewing-table-jig maglite-holder poster-tube-lid poster-tube-lid-coarse fairphone-case fairphone-battery-case lock-inframe-bracket ksafe-base
+QUACKSES = $(addprefix quacks-ingredients-L, 1 2 3 4 5)
+QUACKS_SCADS = $(addsuffix .scad, $(QUACKSES))
+
+USING_AUTOS ?= $(FILAMENTSPOOL_AUTOS) xeno-drivebay-bracket dungeonquest-cone anke-gps-bracket cable-hole-trunking-cover anglepoise-neck crossbar-computer-led-mount wardrobe-hook knifeblock pandemic-counter pattress-boxes-3-cover bike-lipo-box earring-stand bike-stalk-led-mount sewing-table sewing-table-test sewing-table-jig maglite-holder poster-tube-lid poster-tube-lid-coarse fairphone-case fairphone-battery-case lock-inframe-bracket ksafe-base $(QUACKSES) quacks-ingredients-demos
 
 AUTO_INCS += sealing-box.scad sewing-table.scad \
-            poster-tube-lid-parametric.scad
+            poster-tube-lid-parametric.scad $(QUACKS_SCADS)
 
 include reprap-objects.make
 
@@ -119,6 +122,9 @@ lemon-stand.stl: lemon-stand.scad
 
 electron-token.stl: electron-token.scad
 
+quacks-scads: $(addsuffix .auto.scads, $(QUACKSES))
+quacks-scads: quacks-ingredients-demos.auto.scads
+
 .PRECIOUS: $(SCREWRECESSTEST_DXFS) $(SCREWRECESSTEST_DXFS) \
        $(foreach s,$(SCREWRECESSTEST_SIZES), \
                screw-recess-test-number-s$s.fig \
diff --git a/quacks-ingredients-L1.scad b/quacks-ingredients-L1.scad
new file mode 100644 (file)
index 0000000..220d95b
--- /dev/null
@@ -0,0 +1,4 @@
+$phase=1;
+module Token_L(){ Token_L1(); }
+//// toplevels-from:
+include <quacks-ingredients.scad>
diff --git a/quacks-ingredients-L2.scad b/quacks-ingredients-L2.scad
new file mode 100644 (file)
index 0000000..5e72d16
--- /dev/null
@@ -0,0 +1,4 @@
+$phase=2;
+module Token_L(){ Token_L2(); }
+//// toplevels-from:
+include <quacks-ingredients.scad>
diff --git a/quacks-ingredients-L3.scad b/quacks-ingredients-L3.scad
new file mode 100644 (file)
index 0000000..31ad703
--- /dev/null
@@ -0,0 +1,4 @@
+$phase=3;
+module Token_L(){ Token_L3(); }
+//// toplevels-from:
+include <quacks-ingredients.scad>
diff --git a/quacks-ingredients-L4.scad b/quacks-ingredients-L4.scad
new file mode 100644 (file)
index 0000000..989a046
--- /dev/null
@@ -0,0 +1,4 @@
+$phase=4;
+module Token_L(){ Token_L4(); }
+//// toplevels-from:
+include <quacks-ingredients.scad>
diff --git a/quacks-ingredients-L5.scad b/quacks-ingredients-L5.scad
new file mode 100644 (file)
index 0000000..6943e5b
--- /dev/null
@@ -0,0 +1,4 @@
+$phase=5;
+module Token_L(){ Token_L5(); }
+//// toplevels-from:
+include <quacks-ingredients.scad>
diff --git a/quacks-ingredients-demos.scad b/quacks-ingredients-demos.scad
new file mode 100644 (file)
index 0000000..2031370
--- /dev/null
@@ -0,0 +1,11 @@
+// -*- C -*-
+
+include <quacks-ingredients.scad>
+
+module Demo(){ ////toplevel
+  $nspots = 3;
+  color("red") { Token_L3(); }
+  color("white") { Token_L1(); Token_L5(); }
+  color("black") { Token_L2(); Token_L4(); }
+}
+
diff --git a/quacks-ingredients-update-levels b/quacks-ingredients-update-levels
new file mode 100755 (executable)
index 0000000..92723a5
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -e
+for l in 1 2 3 4 5; do
+       f=quacks-ingredients-L$l.scad
+       cat >$f.tmp <<END
+\$phase=$l;
+module Token_L(){ Token_L$l(); }
+//// toplevels-from:
+include <quacks-ingredients.scad>
+END
+       mv -f $f.tmp $f
+done
index 4205cd3184e2ef0c53e5bcdd82cc5f011545342e..5afdd19569f2e554955f41e9d0af5257006b7bba 100644 (file)
@@ -12,7 +12,6 @@ initial_layer_width = 0.750;
 final_layer_thick = 0.250;
 multicolour_post = 4;
 
-$nspots = 3;
 $spots_absent = false;
 $spots_plusgap = false;
 
@@ -87,12 +86,6 @@ module Token_L5(){
     Token_Spots();
 }
 
-module Demo(){ ////toplevel
-  color("red") { Token_L3(); }
-  color("white") { Token_L1(); Token_L5(); }
-  color("black") { Token_L2(); Token_L4(); }
-}
-
 module Frame(phase) {
   zs = [ initial_layer_thick,
         initial_layer_thick,
@@ -121,20 +114,8 @@ module Tests(){
   }
 }
 
-module Test_L1(){ ////toplevel
-  Frame(1); Tests() Token_L1();
-}
-module Test_L2(){ ////toplevel
-  Frame(2); Tests() Token_L2();
-}
-module Test_L3(){ ////toplevel
-  Frame(3); Tests() Token_L3();
-}
-module Test_L4(){ ////toplevel
-  Frame(4); Tests() Token_L4();
-}
-module Test_L5(){ ////toplevel
-  Frame(5); Tests() Token_L5();
+module Test_L() { ////toplevel
+  Frame($phase); Tests() Token_L();
 }
 
 //Demo();