Add shading for shapes and the floor
This commit is contained in:
@@ -113,6 +113,9 @@ grahamEliminate xs = xs
|
||||
centroid :: Foldable t => t Point2 -> Point2
|
||||
centroid = L.fold $ (/) <$> L.Fold (+.+) (V2 0 0) id <*> L.genericLength
|
||||
|
||||
centroidNum :: (Fractional a ,Foldable t) => t a -> a
|
||||
centroidNum = L.fold $ (/) <$> L.Fold (+) 0 id <*> L.genericLength
|
||||
|
||||
shrinkPolyOnEdges :: Float -> [Point2] -> [Point2]
|
||||
shrinkPolyOnEdges x (p:q:ps) = map (shrinkVert x) . slideWindow 3 $ (p:q:ps) ++ [p,q]
|
||||
shrinkPolyOnEdges _ _ = error "too few vertices in polygon"
|
||||
|
||||
Reference in New Issue
Block a user