summaryrefslogtreecommitdiff
path: root/shelves-pure.hs
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2019-03-13 02:45:14 -0400
committerAndrew Cady <d@jerkface.net>2019-03-13 02:45:14 -0400
commitd5b97772cdc98ef90e139c1554442938dbf242a8 (patch)
tree9b48be61b3fec14c71a0f4c6a20930c7328e2148 /shelves-pure.hs
parent138c0832d8d5904acacbc11237115d094a58c7ee (diff)
rm shelves-pure.hs
Diffstat (limited to 'shelves-pure.hs')
-rw-r--r--shelves-pure.hs52
1 files changed, 0 insertions, 52 deletions
diff --git a/shelves-pure.hs b/shelves-pure.hs
deleted file mode 100644
index 85873f7..0000000
--- a/shelves-pure.hs
+++ /dev/null
@@ -1,52 +0,0 @@
1import Linear.V3
2import Control.Lens
3import Data.List
4
5-- Karens Specifies:
6
7shelf_heights = [12, 10, 10, 10, 6, 6]
8shelf_length = 16
9shelf_depth = 6
10
11shelf_thickness = 0.5
12side_thickness = 0.5
13
14-- Behind Karen's Back
15
16shelf_height = sum shelf_heights
17
18sided = V3 side_thickness shelf_height shelf_depth
19shelfd = V3 shelf_length shelf_thickness shelf_depth
20
21
22sideps = [(V3 0 0 0), (V3 (sided ^. _x + shelfd ^. _x) 0 0)]
23
24shelf_ys = scanl (+) 0 shelf_heights
25shelfps = [(V3 x 0 0) | x <- shelf_ys]
26
27
28place_pieces poss piece_dim = [[(p, piece_dim)] |p <- poss]
29
30shelves = place_pieces shelfps shelfd
31sides = place_pieces sideps sided
32
33V32l v3 = [v3 ^. _x, v3 ^. _y, v3 ^. _z]
34V32s v3 = intercalate ", " (map show (v32l v3))
35scadplace obj = genscadstr (fst (head obj)) (snd (head obj))
36genscadstr p o = "translate([" ++ v32s p ++ "]) { cube([" ++ v32s o ++ "]); }"
37genscad ps = intercalate "" $ map scadplace ps
38
39
40
41--genscad ps = map printf "POS: %s DIM: %s\n" p d) ps)
42--genscad ps = ["P: " ++ (fst p) ++ " | O: " ++ (snd p) |p<-ps]
43--genscad ps = [fst(p) |p<-ps]
44--genscad ps = ["P: " ++ p ++ "D: " ++ d|(p,d) <- ps]
45--genscad ps = map ()
46
47main = print 1
48--main = print $ genscad (shelves ++ sides)
49
50
51
52