diff options
-rw-r--r-- | shelves-pure.hs | 52 |
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 @@ | |||
1 | import Linear.V3 | ||
2 | import Control.Lens | ||
3 | import Data.List | ||
4 | |||
5 | -- Karens Specifies: | ||
6 | |||
7 | shelf_heights = [12, 10, 10, 10, 6, 6] | ||
8 | shelf_length = 16 | ||
9 | shelf_depth = 6 | ||
10 | |||
11 | shelf_thickness = 0.5 | ||
12 | side_thickness = 0.5 | ||
13 | |||
14 | -- Behind Karen's Back | ||
15 | |||
16 | shelf_height = sum shelf_heights | ||
17 | |||
18 | sided = V3 side_thickness shelf_height shelf_depth | ||
19 | shelfd = V3 shelf_length shelf_thickness shelf_depth | ||
20 | |||
21 | |||
22 | sideps = [(V3 0 0 0), (V3 (sided ^. _x + shelfd ^. _x) 0 0)] | ||
23 | |||
24 | shelf_ys = scanl (+) 0 shelf_heights | ||
25 | shelfps = [(V3 x 0 0) | x <- shelf_ys] | ||
26 | |||
27 | |||
28 | place_pieces poss piece_dim = [[(p, piece_dim)] |p <- poss] | ||
29 | |||
30 | shelves = place_pieces shelfps shelfd | ||
31 | sides = place_pieces sideps sided | ||
32 | |||
33 | V32l v3 = [v3 ^. _x, v3 ^. _y, v3 ^. _z] | ||
34 | V32s v3 = intercalate ", " (map show (v32l v3)) | ||
35 | scadplace obj = genscadstr (fst (head obj)) (snd (head obj)) | ||
36 | genscadstr p o = "translate([" ++ v32s p ++ "]) { cube([" ++ v32s o ++ "]); }" | ||
37 | genscad 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 | |||
47 | main = print 1 | ||
48 | --main = print $ genscad (shelves ++ sides) | ||
49 | |||
50 | |||
51 | |||
52 | |||