Fix wall zoning

This commit is contained in:
2022-06-27 09:56:54 +01:00
parent 7778fb0403
commit 90af97ee22
15 changed files with 128 additions and 34 deletions
+23
View File
@@ -5,8 +5,12 @@ import Geometry
import Shape
import Quaternion
import Dodge.Data.ForegroundShape
import Dodge.Default.Foreground
import Data.List
import Data.Maybe
import Control.Lens
import ShapePicture
highDiagonalMesh
:: Point2
@@ -111,6 +115,25 @@ girderVCapLR csize h d w x y = thinHighBar h (x -.- n) (x +.+ n)
where
n = csize *.* vNormal (normalizeV (x -.- y))
girderV'
:: Float -- ^ "cap" size
-> Float -- ^ height
-> Float -- ^ distance between cross bars
-> Float -- ^ width
-> Point2 -> Point2 -> ForegroundShape
girderV' csize h d w x y = defaultForeground
& fsPos .~ m
& fsRad .~ dist m x'
& fsSPic .~ noPic sh
where
m = midPoint x y
x' = x - m
y' = y - m
sh = thinHighBar h (x' -.- n) (x' +.+ n)
<> thinHighBar h (y' -.- n) (y' +.+ n)
<> girderV h d w x' y'
n = csize *.* vNormal (normalizeV (x' -.- y'))
girderV
:: Float -- ^ height
-> Float -- ^ distance between cross bars
+4 -4
View File
@@ -151,13 +151,13 @@ addGirderLights rm = do
midw = wiToFloat rm midi
extragirderpos = nub $ map (\(wi,hi) -> (wi - midi, hi)) lpis
extragirders = mapMaybe (\(i,hi) -> case i of
x | x < 0 -> Just $ girderVCapL 20 96 20 10 (V2 (midw - 10) (hiToFloat rm hi))
x | x < 0 -> Just $ girderV' 20 96 20 10 (V2 (midw - 10) (hiToFloat rm hi))
(V2 0 (hiToFloat rm hi))
x | x > 0 -> Just $ girderVCapL 20 96 20 10 (V2 (midw + 10) (hiToFloat rm hi))
x | x > 0 -> Just $ girderV' 20 96 20 10 (V2 (midw + 10) (hiToFloat rm hi))
(V2 w (hiToFloat rm hi))
_ -> Nothing
) extragirderpos
return $ rm & rmPmnts .++~
(sps0 (PutShape $ colorSH black $ girderVCapLR 20 96 20 10 (V2 midw 0) (V2 midw h))
(sps0 (PutForeground $ girderV' 20 96 20 10 (V2 midw 0) (V2 midw h))
: map (\p -> sps (PS p 0) (PutLS $ lsColPos 0.75 (V3 0 0 90))) lps
) ++ map (sps0 . PutShape . colorSH black) extragirders
) ++ map (sps0 . PutForeground) extragirders