Finish the 3D model for the led cube

This commit is contained in:
Aaron Mueller 2014-08-04 10:19:47 +02:00
parent a436628ce8
commit 92c57bd303
2 changed files with 1356 additions and 25 deletions

View file

@ -5,7 +5,8 @@
(defn print-scad [shape] (defn print-scad [shape]
(spit "threedvis.scad" (write-scad shape))) (spit "threedvis.scad" (write-scad shape)))
(defn led [] (defn led [edge]
(let [long-leg (cylinder 1.5 100)]
(union (union
(color [0.5 0.5 2] (color [0.5 0.5 2]
(difference (difference
@ -19,18 +20,27 @@
(translate [0 5 -30] (cylinder 1.5 50)) (translate [0 5 -30] (cylinder 1.5 50))
(translate [7 5 -60] (rotate (/ pi 4) [0 -1 0] (cylinder 1.5 20)))) (translate [7 5 -60] (rotate (/ pi 4) [0 -1 0] (cylinder 1.5 20))))
(translate [14 5 -122] (cylinder 1.5 110)) (translate [14 5 -122] (cylinder 1.5 110))
(union (rotate (/ pi 6) [0 1 0] (union
(translate [0 -5 -10] (cylinder 1.5 15)) (translate [4 -5 -10] (cylinder 1.5 15))
(translate [0 -44 -17] (rotate (/ pi 2) [1 0 0] (cylinder 1.5 80))))))) (if (not edge) (translate [4 -54 -17] (rotate (/ pi 2) [1 0 0] long-leg)))))
(if edge (translate [44 -4 -17] (rotate (/ pi 2) [0 1 0] long-leg)))))))
(defn one-pos [] (defn one-pos [endpos]
(union (union
(translate [0 0 0] (led)) (translate [0 0 0] (led endpos))
(translate [0 0 100] (led)) (translate [0 0 100] (led endpos))
(translate [0 0 200] (led)))) (translate [0 0 200] (led endpos))))
(defn one-column []
(union
(translate [0 0 0] (one-pos true))
(translate [0 100 0] (one-pos false))
(translate [0 200 0] (one-pos false))))
(print-scad (print-scad
(translate [-100 -100 -100]
(union (union
(translate [0 0 0] (one-pos)) (translate [0 0 0] (one-column))
(translate [0 100 0] (one-pos)) (translate [100 0 0] (one-column))
(translate [0 200 0] (one-pos)))) (translate [200 0 0] (one-column))
)))

1321
doc/threedvis/threedvis.scad Normal file

File diff suppressed because it is too large Load diff