diff options
-rw-r--r-- | shelves.hs | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -22,13 +22,10 @@ data Shelf = Shelf { | |||
22 | shelfSideDimX :: Inches | 22 | shelfSideDimX :: Inches |
23 | } | 23 | } |
24 | 24 | ||
25 | shelfDim :: Shelf -> V3 Inches | ||
26 | shelfDim Shelf{..} = V3 shelfLength shelfWidth shelfThickness | ||
27 | |||
28 | shelves' :: Shelf -> [(V3 Double, V3 Double)] | 25 | shelves' :: Shelf -> [(V3 Double, V3 Double)] |
29 | shelves' s@Shelf{..} = [(p, shelfDim s) | p <- shelvesPos] | 26 | shelves' Shelf{..} = [(p, V3 shelfLength shelfWidth shelfThickness) | p <- shelvesPos] |
30 | where | 27 | where |
31 | shelfHeight = (sum shelfHeights) + (shelfDim s ^. _z * (fromIntegral (length shelfHeights) + 1)) | 28 | shelfHeight = sum shelfHeights + (shelfThickness * (fromIntegral (length shelfHeights) + 1)) |
32 | 29 | ||
33 | shelfSideDim :: V3 Inches | 30 | shelfSideDim :: V3 Inches |
34 | shelfSideDim = V3 shelfSideDimX shelfWidth shelfHeight | 31 | shelfSideDim = V3 shelfSideDimX shelfWidth shelfHeight |