From: Ian Jackson Date: Sun, 16 Sep 2012 13:16:07 +0000 (+0100) Subject: Merge branch 'master' of chiark:/u/ianmdlvl/reprap/play X-Git-Tag: filamentspool-v2-release~822 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=reprap-play.git;a=commitdiff_plain;h=2f3192186dfa30aba68ad655ac22fc63ca819f3a;hp=6fb7b061e2548d03b47224294d79f85fc3cfba66 Merge branch 'master' of chiark:/u/ianmdlvl/reprap/play --- diff --git a/.gitignore b/.gitignore index 5f3a3f4..77d64ee 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ light-bracket.stl *.aside *.stl +*,*.scad diff --git a/Makefile b/Makefile index d31e0a9..af3f76d 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,11 @@ SKEINFORGE=python $(HRR)/reprappro-software.git/skeinforge/skeinforge_applicatio CONFIG=slic3r-config.ini +AUTO_TOPLEVELS := $(foreach m, filamentspool, $(shell ./toplevel-find $m)) + +scads: $(addsuffix .scad, $(AUTO_TOPLEVELS)) +stls: $(addsuffix .stl, $(AUTO_TOPLEVELS)) + default: %.stl: %.scad @@ -20,3 +25,8 @@ default: ./$^ >$@.new && mv -f $@.new $@ dovecliptest.stl: doveclip.scad + +%.scad: toplevel-make Makefile toplevel-find + @echo ' write $@' + ./$< $@ >$@.new + @mv -f $@.new $@ diff --git a/filamentspool-armdoveclippin.scad b/filamentspool-armdoveclippin.scad deleted file mode 100644 index 036b958..0000000 --- a/filamentspool-armdoveclippin.scad +++ /dev/null @@ -1,2 +0,0 @@ -include -ArmDoveClipPin(); diff --git a/filamentspool-armend.scad b/filamentspool-armend.scad deleted file mode 100644 index fa64261..0000000 --- a/filamentspool-armend.scad +++ /dev/null @@ -1,2 +0,0 @@ -include -ArmEnd(); diff --git a/filamentspool-cup.scad b/filamentspool-cup.scad deleted file mode 100644 index 2459828..0000000 --- a/filamentspool-cup.scad +++ /dev/null @@ -1,2 +0,0 @@ -include -FilamentCup(); diff --git a/filamentspool-cupclip.scad b/filamentspool-cupclip.scad deleted file mode 100644 index f377b31..0000000 --- a/filamentspool-cupclip.scad +++ /dev/null @@ -1,2 +0,0 @@ -include -CupSecuringClip(); diff --git a/filamentspool.scad b/filamentspool.scad index 4c930fd..04e5c09 100644 --- a/filamentspool.scad +++ b/filamentspool.scad @@ -62,7 +62,7 @@ totalwidth = armendwallthick*2 + channelwidth; totalheight = channeldepth + armendbasethick; stalkwidth = prongwidth + prongstalkxwidth; -module ArmEnd(length=120){ +module ArmEnd(length=120){ ////toplevel translate([ratchettoothsmoothr, channelwidth/2, -armendbasethick]) { rotate([0,0,-90]) DoveClipPairBase(h=doveclipheight); @@ -122,7 +122,7 @@ module FilamentCupCup(){ } } -module FilamentCup() { +module FilamentCup() { ////toplevel FilamentCupHandle(); dx = cupbigrad + prongwidth; @@ -168,7 +168,7 @@ module CupSecuringClipSolidSmooth(xrad=0, xdepth=0){ } } -module CupSecuringClip(){ +module CupSecuringClip(){ ////toplevel wingswidth = wingspoke*2 + overclipthick*2 + overcliproundr*2 + totalwidth; difference(){ union(){ @@ -181,11 +181,11 @@ module CupSecuringClip(){ } } -module ArmDoveClipPin(){ +module ArmDoveClipPin(){ ////toplevel DoveClipPin(h=doveclipheight); } -module Hub(){ +module Hub(){ ////toplevel difference(){ cylinder($fn=60, h=hublthick, r=hubbigrad); translate([0,0,-1]) diff --git a/toplevel-find b/toplevel-find new file mode 100755 index 0000000..227bb73 --- /dev/null +++ b/toplevel-find @@ -0,0 +1,12 @@ +#!/usr/bin/perl -w +use strict; +@ARGV==1 or die; +my $base = $ARGV[0]; +$base =~ m/^\-/ and die; +open F, "$base.scad" or die $!; +while () { + next unless m#^\s*module\s+(\w+)\b.*////toplevel\b#; + print "$base,$1\n" or die $!; +} +close F or die $!; +close STDOUT or die $!; diff --git a/toplevel-make b/toplevel-make new file mode 100755 index 0000000..2df668b --- /dev/null +++ b/toplevel-make @@ -0,0 +1,10 @@ +#!/usr/bin/perl -w +use strict; +die unless @ARGV==1; +die unless $ARGV[0] =~ m/^(.+),(\w+)(?:\..*)?/; +my ($base,$obj) = ($1,$2); +print < +$obj(); +END +close STDOUT or die $!;