summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2019-03-16 00:45:04 -0400
committerAndrew Cady <d@jerkface.net>2019-03-16 00:45:17 -0400
commit1377a427dd43a509b101484bab111422fd04c42c (patch)
tree924591000f6c00c46459041f15e3521407daed38
parent0ee05c63d5c022acb50065d6333fe56069be4d03 (diff)
simplify
-rw-r--r--shelves.hs7
1 files changed, 2 insertions, 5 deletions
diff --git a/shelves.hs b/shelves.hs
index 0ea28ee..c6364e1 100644
--- a/shelves.hs
+++ b/shelves.hs
@@ -22,13 +22,10 @@ data Shelf = Shelf {
22 shelfSideDimX :: Inches 22 shelfSideDimX :: Inches
23} 23}
24 24
25shelfDim :: Shelf -> V3 Inches
26shelfDim Shelf{..} = V3 shelfLength shelfWidth shelfThickness
27
28shelves' :: Shelf -> [(V3 Double, V3 Double)] 25shelves' :: Shelf -> [(V3 Double, V3 Double)]
29shelves' s@Shelf{..} = [(p, shelfDim s) | p <- shelvesPos] 26shelves' 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