Tweak automatic girder placement
This commit is contained in:
@@ -88,6 +88,29 @@ girderZ h d w x y = colorSH red $ mconcat $
|
|||||||
ps = divideLineExact d xb yb
|
ps = divideLineExact d xb yb
|
||||||
qs = tail $ divideLineExact d xt yt
|
qs = tail $ divideLineExact d xt yt
|
||||||
|
|
||||||
|
girderVCapL
|
||||||
|
:: Float -- ^ "cap" size
|
||||||
|
-> Float -- ^ height
|
||||||
|
-> Float -- ^ distance between cross bars
|
||||||
|
-> Float -- ^ width
|
||||||
|
-> Point2 -> Point2 -> Shape
|
||||||
|
girderVCapL csize h d w x y = thinHighBar h (x -.- n) (x +.+ n)
|
||||||
|
<> girderV h d w x y
|
||||||
|
where
|
||||||
|
n = csize *.* vNormal (normalizeV (x -.- y))
|
||||||
|
|
||||||
|
girderVCapLR
|
||||||
|
:: Float -- ^ "cap" size
|
||||||
|
-> Float -- ^ height
|
||||||
|
-> Float -- ^ distance between cross bars
|
||||||
|
-> Float -- ^ width
|
||||||
|
-> Point2 -> Point2 -> Shape
|
||||||
|
girderVCapLR csize h d w x y = thinHighBar h (x -.- n) (x +.+ n)
|
||||||
|
<> thinHighBar h (y -.- n) (y +.+ n)
|
||||||
|
<> girderV h d w x y
|
||||||
|
where
|
||||||
|
n = csize *.* vNormal (normalizeV (x -.- y))
|
||||||
|
|
||||||
girderV
|
girderV
|
||||||
:: Float -- ^ height
|
:: Float -- ^ height
|
||||||
-> Float -- ^ distance between cross bars
|
-> Float -- ^ distance between cross bars
|
||||||
|
|||||||
@@ -109,13 +109,13 @@ addGirderLights rm = do
|
|||||||
midw = wiToFloat rm midi
|
midw = wiToFloat rm midi
|
||||||
extragirderpos = nub $ map (\(wi,hi) -> (wi - midi, hi)) lpis
|
extragirderpos = nub $ map (\(wi,hi) -> (wi - midi, hi)) lpis
|
||||||
extragirders = mapMaybe (\(i,hi) -> case i of
|
extragirders = mapMaybe (\(i,hi) -> case i of
|
||||||
x | x < 0 -> Just $ girderV 96 20 10 (V2 (midw - 10) (hiToFloat rm hi))
|
x | x < 0 -> Just $ girderVCapL 20 96 20 10 (V2 (midw - 10) (hiToFloat rm hi))
|
||||||
(V2 0 (hiToFloat rm hi))
|
(V2 0 (hiToFloat rm hi))
|
||||||
x | x > 0 -> Just $ girderV 96 20 10 (V2 (midw + 10) (hiToFloat rm hi))
|
x | x > 0 -> Just $ girderVCapL 20 96 20 10 (V2 (midw + 10) (hiToFloat rm hi))
|
||||||
(V2 w (hiToFloat rm hi))
|
(V2 w (hiToFloat rm hi))
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
) extragirderpos
|
) extragirderpos
|
||||||
return $ rm & rmPmnts .++~
|
return $ rm & rmPmnts .++~
|
||||||
(sps0 (PutShape $ colorSH black $ girderV 96 20 10 (V2 midw 0) (V2 midw h))
|
(sps0 (PutShape $ colorSH black $ girderVCapLR 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 (\p -> sps (PS p 0) (PutLS $ lsColPos 0.75 (V3 0 0 90))) lps
|
||||||
) ++ map (sps0 . PutShape . colorSH black) extragirders
|
) ++ map (sps0 . PutShape . colorSH black) extragirders
|
||||||
|
|||||||
Reference in New Issue
Block a user