Revert "Turn Shape into a stream"

This reverts commit c7e720248d.
This commit is contained in:
2022-06-27 18:41:43 +01:00
parent c7e720248d
commit 03b37c4e7b
11 changed files with 32 additions and 42 deletions
+5 -5
View File
@@ -25,7 +25,7 @@ import qualified Data.Vector.Fusion.Stream.Monadic as VS
emptySH :: Shape
{-# INLINE emptySH #-}
emptySH = VS.empty
emptySH = mempty
-- - approximate a circle by a polygon with n*2 points of radius x
polyCirc :: Int -> Float -> [Point2]
@@ -45,7 +45,7 @@ prismPoly
-> [Point3]
-> Shape
{-# INLINE prismPoly #-}
prismPoly upps downps = VS.singleton $ ShapeObj (TopPrism n) (VS.fromList $ f upps downps)
prismPoly upps downps = [ShapeObj (TopPrism n) (VS.fromList $ f upps downps)]
where
n = length upps
f (a:as) (b:bs) = g a:g b:f as bs
@@ -58,7 +58,7 @@ upperPrismPoly
-> [Point2]
-> Shape
{-# INLINE upperPrismPoly #-}
upperPrismPoly h ps = VS.singleton $ ShapeObj (TopPrism n) (VS.fromList $ f ps)
upperPrismPoly h ps = [ShapeObj (TopPrism n) (VS.fromList $ f ps)]
where
n = length ps
g h' (V2 x y) = pairToSV (V3 x y h', black)
@@ -70,7 +70,7 @@ upperPrismPolyHalf
-> [Point2]
-> Shape
{-# INLINE upperPrismPolyHalf #-}
upperPrismPolyHalf h ps = VS.singleton $ ShapeObj (TopPrism n) (VS.fromList $ f upps downps)
upperPrismPolyHalf h ps = [ShapeObj (TopPrism n) (VS.fromList $ f upps downps)]
where
n = length ps
upps = map f' ps
@@ -94,7 +94,7 @@ overColSH = fmap . overColObj
overPosSHI :: (Point3 -> Point3) -> Shape -> Shape
{-# INLINE overPosSHI #-}
overPosSHI = VS.map . overPosObj
overPosSHI = fmap . overPosObj
translateSH :: Point3 -> Shape -> Shape
{-# INLINE translateSH #-}