Further strictifying

This commit is contained in:
2021-07-30 00:23:02 +02:00
parent bd8ef3f416
commit 2d8b27746c
33 changed files with 228 additions and 211 deletions
+11 -11
View File
@@ -20,9 +20,9 @@ highDiagonalMesh
-> Float -- ^ vertical distance between lines
-> Picture
highDiagonalMesh pa pb w d = setDepth (-0.2) $ pictures $
map (flip thickLine 3 . flat2) (diagonalLinesRect pb pa w d (3*pi/4))
map (flip thickLine 3 . tflat2) (diagonalLinesRect pb pa w d (3*pi/4))
++
map (flip thickLine 3 . flat2) (diagonalLinesRect pb pc (negate h) d (pi/4))
map (flip thickLine 3 . tflat2) (diagonalLinesRect pb pc (negate h) d (pi/4))
where
pc = pb +.+ w *.* normalizeV (vNormal (pb -.- pa))
h = dist pa pb
@@ -49,20 +49,20 @@ diagonalLinesRect pa pb w d ang = zip lhsPoints $ map findDiPoint lhsPoints
yN = d * 0.5 *.* normalizeV (pa -.- pb)
highPipe :: Float -> Point2 -> Point2 -> [Polyhedra]
highPipe h x@(xx,xy) y =
[ Polyhedron . map (map ( (,orange) . (+.+.+ (xx,xy,h))))
$ boxABC (a,b,0) (a',b',0) (0,0,5)
highPipe h x@(V2 xx xy) y =
[ Polyhedron . map (map ( (,orange) . (+.+.+ (V3 xx xy h))))
$ boxABC (V3 a b 0) (V3 a' b' 0) (V3 0 0 5)
]
where
(a,b) = y -.- x
(a',b') = 10 *.* normalizeV (vNormal (a,b))
(V2 a b) = y -.- x
(V2 a' b') = 10 *.* normalizeV (vNormal (V2 a b))
girderZ :: Float -> Point2 -> Point2 -> Picture
girderZ w x y = setDepth 50 $ color red $ pictures $
[ thickLine [xt,yt] 3
, thickLine [xb,yb] 3
]
++ map (flip thickLine 3 . flat2) ls
++ map (flip thickLine 3 . tflat2) ls
where
n = w *.* normalizeV (vNormal $ y -.- x)
xb = x +.+ n
@@ -78,8 +78,8 @@ girderV col w x y = setDepth 50 $ color col $ pictures $
[ thickLine [xt,yt] 3
, thickLine [xb,yb] 3
]
++ map (flip thickLine 3 . flat2) as'
++ map (flip thickLine 3 . flat2) bs'
++ map (flip thickLine 3 . tflat2) as'
++ map (flip thickLine 3 . tflat2) bs'
where
n = w *.* normalizeV (vNormal $ y -.- x)
xb = x +.+ n
@@ -97,7 +97,7 @@ girder col w x y = pictures $
[ thickLine [xt,yt] 3
, thickLine [xb,yb] 3
]
++ map (flip thickLine 3 . flat2) ls
++ map (flip thickLine 3 . tflat2) ls
)
: map (\p -> verticalPipe 1.5 col p 0 (-0.1)) [xb,xt,yb,yt]
where