summaryrefslogtreecommitdiff
path: root/shelves.hs
diff options
context:
space:
mode:
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