Replace PutShape with PutForeground

This commit is contained in:
2022-06-27 14:30:08 +01:00
parent fec72cdf48
commit 0def31895f
11 changed files with 39 additions and 55 deletions
+7 -1
View File
@@ -5,6 +5,7 @@ import Picture
import Geometry
import Shape
import Quaternion
import Bound
--import Dodge.Data.ForegroundShape
import Dodge.Default.Foreground
@@ -12,6 +13,8 @@ import Data.List
import Data.Maybe
import Control.Lens
import ShapePicture
import Streaming
import qualified Streaming.Prelude as S
highDiagonalMesh
:: Point2
@@ -125,8 +128,11 @@ putShape sh = PutForeground $ defaultForeground
bnds = shapeBounds sh
m = midBounds bnds
shapePoints :: Shape -> Stream (Of Point2) Identity ()
shapePoints = S.each . concatMap (map (stripZ . _svPos) . _shVs)
shapeBounds :: Shape -> (Float,Float,Float,Float)
shapeBounds sh = undefined
shapeBounds = fromMaybe (0,0,0,0) . boundPoints . shapePoints
midBounds :: (Float,Float,Float,Float) -> Point2
midBounds (n,s,e,w) = V2 ((n + s)/2) ((e + w)/2)