Turn shapeObject's vertices into a stream

This commit is contained in:
2022-06-27 17:47:03 +01:00
parent 8d5800d806
commit 673e9b11fc
7 changed files with 47 additions and 38 deletions
+11 -8
View File
@@ -7,15 +7,18 @@ module Shape.Data
where
import Geometry.Data
import qualified Data.Vector.Fusion.Stream.Monadic as VS
import Data.Vector.Fusion.Util
import Control.Lens
type Shape = [ShapeObj]
_shVertices :: Shape -> [ShapeV]
{-# INLINE _shVertices #-}
_shVertices = concatMap _shVs
shVList :: Shape -> [ShapeV]
{-# INLINE shVList #-}
shVList = _shVertices
--_shVertices :: Shape -> [ShapeV]
--{-# INLINE _shVertices #-}
--_shVertices = concatMap _shVs
--shVList :: Shape -> [ShapeV]
--{-# INLINE shVList #-}
--shVList = _shVertices
--shVList = DL.toList . _shVertices
{-# INLINE shVfromList #-}
@@ -27,9 +30,9 @@ shEfromList = id
data ShapeObj = ShapeObj
{ _shType :: ShapeType
, _shVs :: [ShapeV]
, _shVs :: VS.Stream IO ShapeV
}
deriving (Eq,Ord,Show)
deriving ()
newtype ShapeType = TopPrism Int
deriving (Eq,Ord,Show)