Implement shading for more types of shapes (cylinders, boxes)

This commit is contained in:
2023-03-16 15:34:32 +00:00
parent 249262b2b6
commit 24c1264f96
7 changed files with 190 additions and 24 deletions
+8 -5
View File
@@ -19,11 +19,11 @@ shVfromList = id
{-# INLINE shEfromList #-}
shEfromList = id
data ShapeType = TopPrism { _prismSize :: Int }
-- | Surface { _surfaceSize :: Int}
| TopBox { _topBoxSize :: Int }
| TopCylinder { _topCylinderSize :: Int }
deriving (Eq, Ord, Show, Read)
--deriving stock Generic
--deriving anyclass Flat
-- for TopCylinder, the first vertex in _sfVs should be the center of the top
-- plane, the second should be the center of the bottom plane.
data Surface = Surface
{ _sfType :: ShapeType
@@ -38,7 +38,10 @@ makeLenses ''ShapeType
type Shape = [Surface]
nShapeVerxComp :: Int
nShapeVerxComp = 12
nShapeVerxComp = sum shapeVerxSizes
shapeVerxSizes :: [Int]
shapeVerxSizes = [4,4,4]
deriveJSON defaultOptions ''ShapeType
deriveJSON defaultOptions ''Surface