diff options
Diffstat (limited to 'shelves.hs')
-rw-r--r-- | shelves.hs | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1,14 +1,14 @@ | |||
1 | import Text.Printf | ||
2 | import Linear.V3 | 1 | import Linear.V3 |
3 | import Control.Lens | 2 | import Control.Lens |
4 | import Data.List | 3 | import Data.List |
4 | import GenSCAD | ||
5 | 5 | ||
6 | shelf_thickness = 0.5 | 6 | shelf_thickness = 0.5 |
7 | shelf_width = 4 | 7 | shelf_width = 8 |
8 | shelf_length = 12 * 2 | 8 | shelf_length = 36 * 2 |
9 | shelf_dim = V3 shelf_length shelf_width shelf_thickness | 9 | shelf_dim = V3 shelf_length shelf_width shelf_thickness |
10 | 10 | ||
11 | shelf_heights = [8, 8, 8, 8, 8] | 11 | shelf_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)) |
34 | scad_place (p,d) = "translate([ " ++ _V32s(p) ++ " ]) { cube([ " ++ _V32s(d) ++ " ]);}" | 34 | --scad_place (p,d) = "translate([ " ++ _V32s(p) ++ " ]) { cube([ " ++ _V32s(d) ++ " ]);}" |
35 | genscad objs = concat $ map (++ "\n") $ map scad_place objs | 35 | --genscad objs = concat $ map (++ "\n") $ map scad_place objs |
36 | 36 | ||
37 | scadshelf = genscad $ shelves ++ sides | 37 | scadshelf = genscad $ shelves ++ sides |
38 | 38 | ||