summaryrefslogtreecommitdiff
path: root/shelves.hs
diff options
context:
space:
mode:
authorSteven <steven.vasilogianis@gmail.com>2019-03-12 19:25:41 -0400
committerSteven <steven.vasilogianis@gmail.com>2019-03-12 19:25:41 -0400
commit045e93425e9353d5537e8c14595db0a48377184e (patch)
tree155181c776af30e404d4101cf5c5d9e31f0cafa1 /shelves.hs
parent7040c5aa653f11487b1d52e3c7aefc1e41f57136 (diff)
lost track
Diffstat (limited to 'shelves.hs')
-rw-r--r--shelves.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/shelves.hs b/shelves.hs
index e78a5cc..0136e1c 100644
--- a/shelves.hs
+++ b/shelves.hs
@@ -1,14 +1,14 @@
1import Text.Printf
2import Linear.V3 1import Linear.V3
3import Control.Lens 2import Control.Lens
4import Data.List 3import Data.List
4import GenSCAD
5 5
6shelf_thickness = 0.5 6shelf_thickness = 0.5
7shelf_width = 4 7shelf_width = 8
8shelf_length = 12 * 2 8shelf_length = 36 * 2
9shelf_dim = V3 shelf_length shelf_width shelf_thickness 9shelf_dim = V3 shelf_length shelf_width shelf_thickness
10 10
11shelf_heights = [8, 8, 8, 8, 8] 11shelf_heights = [12, 10, 8, 8, 8, 8, 8]
12 12
13-- working algorithm doing the same as `scanl (+) 0 shelf_heights` 13-- working algorithm doing the same as `scanl (+) 0 shelf_heights`
14--acc [] = [0] 14--acc [] = [0]
@@ -31,8 +31,8 @@ sides = [(p, side_dim) | p <- sides_pos]
31 31
32_V32l v3 = [v3 ^. _x, v3 ^. _y, v3 ^. _z] 32_V32l v3 = [v3 ^. _x, v3 ^. _y, v3 ^. _z]
33_V32s v3 = intercalate ", " (map show (_V32l v3)) 33_V32s v3 = intercalate ", " (map show (_V32l v3))
34scad_place (p,d) = "translate([ " ++ _V32s(p) ++ " ]) { cube([ " ++ _V32s(d) ++ " ]);}" 34--scad_place (p,d) = "translate([ " ++ _V32s(p) ++ " ]) { cube([ " ++ _V32s(d) ++ " ]);}"
35genscad objs = concat $ map (++ "\n") $ map scad_place objs 35--genscad objs = concat $ map (++ "\n") $ map scad_place objs
36 36
37scadshelf = genscad $ shelves ++ sides 37scadshelf = genscad $ shelves ++ sides
38 38