Refactor vault room

This commit is contained in:
2021-10-01 00:48:19 +01:00
parent 1414d08d88
commit 4b5a75f4af
5 changed files with 59 additions and 41 deletions
+18 -12
View File
@@ -47,11 +47,17 @@ diagonalLinesRect pa pb w d ang = zip lhsPoints $ map findDiPoint lhsPoints
]
yN = d * 0.5 *.* normalizeV (pa -.- pb)
highBar :: Float -> Point2 -> Point2 -> Shape
highBar h x y = translateSHz h $ colorSH orange $ upperPrismPoly 5
thinHighBar :: Float -> Point2 -> Point2 -> Shape
thinHighBar = highBar 3
thickHighBar :: Float -> Point2 -> Point2 -> Shape
thickHighBar = highBar 5
highBar :: Float -> Float -> Point2 -> Point2 -> Shape
highBar thickness h x y = translateSHz h $ colorSH orange $ upperPrismPoly thickness
[x +.+ n, y +.+ n, y -.- n, x -.- n]
where
n = 2.5 *.* normalizeV (vNormal (y -.- x))
n = 0.5 * thickness *.* normalizeV (vNormal (y -.- x))
highPipe :: Float -> Point2 -> Point2 -> Shape
highPipe h x y = colorSH orange $ prismPoly
@@ -67,10 +73,10 @@ girderZ
-> Float -- ^ width
-> Point2 -> Point2 -> Shape
girderZ h d w x y = colorSH red $ mconcat $
[ highBar h xt yt
, highBar h xb yb
[ thinHighBar h xt yt
, thinHighBar h xb yb
]
<> zipWith (highBar (h- 5)) ps qs
<> zipWith (thinHighBar (h- 1)) ps qs
where
n = w *.* normalizeV (vNormal $ y -.- x)
xb = x +.+ n
@@ -86,10 +92,10 @@ girderV
-> Float -- ^ width
-> Point2 -> Point2 -> Shape
girderV h d w x y = colorSH red $ mconcat $
[ highBar h xt yt
, highBar h xb yb
[ thinHighBar h xt yt
, thinHighBar h xb yb
]
<> zipWith (highBar (h- 5)) ps qs
<> zipWith (thinHighBar (h- 1)) ps qs
where
n = w *.* normalizeV (vNormal $ y -.- x)
xb = x +.+ n
@@ -109,10 +115,10 @@ girder
-> Float -- ^ width
-> Point2 -> Point2 -> Shape
girder h d w x y = colorSH red $ mconcat $
[ highBar h xt yt
, highBar h xb yb
[ thinHighBar h xt yt
, thinHighBar h xb yb
]
<> zipWith (highBar (h- 5)) ps qs
<> zipWith (thinHighBar (h- 1)) ps qs
where
n = w *.* normalizeV (vNormal $ y -.- x)
xb = x +.+ n