Hlint pass
This commit is contained in:
+6
-6
@@ -13,7 +13,7 @@ import Data.Bifunctor
|
||||
import Control.Lens
|
||||
|
||||
translateXY :: Float -> Float -> Polyhedra -> Polyhedra
|
||||
translateXY x y = pyFaces %~ (map $ map $ first $ tran)
|
||||
translateXY x y = pyFaces %~ map (map $ first tran)
|
||||
where
|
||||
tran (a,b,c) = (a+x,b+y,c)
|
||||
|
||||
@@ -37,13 +37,13 @@ findReverseEdge
|
||||
:: [(Point3,Point3,Point3)]
|
||||
-> (Point3,Point3,Point3)
|
||||
-> Maybe (Point3,Point3,Point3,Point3)
|
||||
findReverseEdge otherEdges (x,y,z) = fmap (\(_,_,n) -> (x,y,z,n))
|
||||
$ find (\(a,b,_) -> (x,y) == (b,a)) otherEdges
|
||||
findReverseEdge otherEdges (x,y,z) = (\(_,_,n) -> (x,y,z,n))
|
||||
<$> find (\(a,b,_) -> (x,y) == (b,a)) otherEdges
|
||||
|
||||
faceEdges :: [Point3] -> [(Point3,Point3,Point3)]
|
||||
faceEdges xs = map addNormal $ zip xs (tail xs ++ [head xs])
|
||||
faceEdges xs = zipWith addNormal xs (tail xs ++ [head xs])
|
||||
where
|
||||
addNormal (x,y) = (x,y,n)
|
||||
addNormal x y = (x,y,n)
|
||||
(a:b:c:_) = xs
|
||||
n = crossProd (b -.-.- a) (c -.-.- a)
|
||||
|
||||
@@ -93,7 +93,7 @@ polyToEdges = constructEdges . map (map fst) . _pyFaces
|
||||
|
||||
-- rendering for silhouette
|
||||
polyToRender :: Polyhedra -> [RenderType]
|
||||
polyToRender = map Render3 . map flat4 . polyToEdges
|
||||
polyToRender = map (Render3 . flat4) . polyToEdges
|
||||
-- rendering for shape
|
||||
polyToGeoRender :: Polyhedra -> [RenderType]
|
||||
polyToGeoRender = map (Render3 . polyToTris . map fst) . _pyFaces
|
||||
|
||||
Reference in New Issue
Block a user