chiark / gitweb /
knifeblock: wip
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 30 Dec 2014 19:57:56 +0000 (19:57 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 30 Dec 2014 19:57:56 +0000 (19:57 +0000)
.gitignore
Makefile
knifeblock-knives-filter [new file with mode: 0755]
knifeblock-knives-trace.fig [new file with mode: 0644]
knifeblock.scad [new file with mode: 0644]

index 67460ba7c7c539932aa084746ac596ece6d04cbb..daf2a2d0fdc98e993f8429f9222623383ab9c3fb 100644 (file)
@@ -6,4 +6,6 @@ light-bracket.stl
 *,*.auto.scad
 .*.d
 *.tmp
 *,*.auto.scad
 .*.d
 *.tmp
+*.fig.bak
 funcs.scad
 funcs.scad
+knifeblock-knives-l?.dxf*
index d667e227ea737817417e323eb97b1efa28968ba7..ce63b8dc9dfc9a648a88c45fb098155500ccefed 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -56,6 +56,17 @@ stls:                $(addsuffix .auto.stl, $(AUTO_TOPLEVELS))
 
 dovecliptest.stl: doveclip.scad $(AUTO_INCS)
 
 
 dovecliptest.stl: doveclip.scad $(AUTO_INCS)
 
+KNIFEBLOCK_LAYERS=1 2 3 4 5 6
+KNIFEBLOCK_LAYER_FILES=$(foreach l,$(KNIFEBLOCK_LAYERS), \
+       knifeblock-knives-l$l.dxf)
+
+knifeblock-knives-layers: $(KNIFEBLOCK_LAYER_FILES)
+
+knifeblock-knives-l%.dxf: knifeblock-knives-filter knifeblock-knives-trace.fig
+               ./$< $* <$(filter %.fig, $^) >$@.tmp.fig
+               fig2dev -L eps <$@.tmp.fig >$@.tmp.eps
+               pstoedit -dt -f "dxf: -polyaslines -mm" $@.tmp.eps $@
+
 %:             %.pl
                ./$< >$@.tmp && mv -f $@.tmp $@
 
 %:             %.pl
                ./$< >$@.tmp && mv -f $@.tmp $@
 
diff --git a/knifeblock-knives-filter b/knifeblock-knives-filter
new file mode 100755 (executable)
index 0000000..0a353b2
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/perl -wn
+
+use strict;
+
+our $want;
+
+BEGIN {
+      $want = shift @ARGV;
+      die unless $want =~ m/^\d+$/;
+}
+
+our $drop;
+
+if (m/^\S/) {
+    $drop = 
+       m/^2 / ||
+       m/^3 \d+ \d+ \d+ (?!$want )\d+ /;
+}
+
+next if $drop;
+
+print or die $!;
diff --git a/knifeblock-knives-trace.fig b/knifeblock-knives-trace.fig
new file mode 100644 (file)
index 0000000..5019573
--- /dev/null
@@ -0,0 +1,60 @@
+#FIG 3.2  Produced by xfig version 3.2.5b
+Landscape
+Center
+Metric
+A4      
+100.00
+Single
+-2
+1200 2
+2 5 0 1 0 -1 50 -1 -1 0.000 0 0 -1 0 0 5
+       0 knifeblock-knives-photo.jpg
+        585 270 11557 270 11557 8499 585 8499 585 270
+3 1 0 1 2 7 40 -1 -1 0.000 0 0 0 21
+        5858 5445 6063 5290 6283 5115 6523 4865 6658 4670 6768 4510
+        6758 4405 6438 4365 5923 4315 5423 4295 4823 4290 4418 4300
+        4003 4335 3648 4380 3593 5170 3883 5190 4368 5185 4598 5160
+        4993 5075 5718 5365 5838 5435
+        1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+        1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+        1.000 1.000 1.000 1.000 1.000
+3 1 0 1 3 7 40 -1 -1 0.000 0 0 0 23
+        5878 6218 5318 6198 4858 6198 4463 6208 4118 6223 3908 6258
+        3908 6953 4293 6978 4668 6938 5078 6873 5693 7028 5718 7113
+        5783 7143 5873 7128 6028 7028 6243 6833 6453 6608 6583 6458
+        6638 6398 6598 6348 6548 6303 6418 6283 6033 6243
+        1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+        1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+        1.000 1.000 1.000 1.000 1.000 1.000 1.000
+3 1 0 1 1 7 40 -1 -1 0.000 0 0 0 20
+        5918 3753 6120 3555 6435 3285 6615 3060 6840 2745 6975 2520
+        6975 2475 6615 2430 5985 2385 5490 2355 4950 2340 4498 2360
+        3883 2385 3458 2425 3443 3430 3838 3435 4248 3410 5593 3723
+        5783 3858 5773 3848
+        1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+        1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+        1.000 1.000 1.000 1.000
+3 1 0 1 4 7 40 -1 -1 0.000 0 0 0 21
+        9223 2689 8811 2659 8398 2621 7993 2606 7603 2584 7228 2569
+        6861 2561 5871 2539 5121 3529 5818 3694 5991 3769 6583 3776
+        7206 3769 8113 3746 8826 3709 9298 3649 9816 3581 10311 3431
+        10551 3026 10243 2869 9606 2734
+        1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+        1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+        1.000 1.000 1.000 1.000 1.000
+3 1 0 1 5 7 40 -1 -1 0.000 0 0 0 19
+        7191 5366 8098 5329 8586 5291 9051 5194 9298 5119 9283 4676
+        9028 4616 8706 4594 8278 4549 7851 4534 7371 4534 6883 4511
+        6141 4511 5998 4744 5661 4969 5593 5366 6043 5351 6478 5366
+        7026 5374
+        1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+        1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+        1.000 1.000 1.000
+3 1 0 1 6 7 40 -1 -1 0.000 0 0 0 19
+        6816 7069 7191 7047 7558 6994 7896 6927 7993 6784 7993 6657
+        7881 6544 7611 6499 7356 6454 7093 6432 6838 6409 6561 6409
+        6096 6387 5901 6454 5578 6784 5668 7024 5811 7069 6141 7084
+        6388 7077
+        1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+        1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+        1.000 1.000 1.000
diff --git a/knifeblock.scad b/knifeblock.scad
new file mode 100644 (file)
index 0000000..0894de9
--- /dev/null
@@ -0,0 +1,18 @@
+// -*- C -*-
+//import(file="t.dxf");
+
+module ImportTemplate(l) {
+  import(file=str("knifeblock-knives-l",l,".dxf"), convexity=3);
+}
+
+module Knife(ix){
+  translate([0,50*ix,0]){
+    ImportTemplate(ix*2+1);
+    translate([0,0,10])
+      ImportTemplate(ix*2+4);
+  }
+}
+
+Knife(0);
+Knife(1);
+Knife(2);