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
+5 -5
View File
@@ -125,14 +125,14 @@ putShape sh = PutForeground $ defaultForeground
& fsRad .~ radBounds bnds
& fsSPic .~ noPic (uncurryV translateSHf (-m) $ sh)
where
bnds = shapeBounds sh
bnds = (0,0,0,0) -- shapeBounds sh
m = midBounds bnds
shapePoints :: Shape -> Stream (Of Point2) Identity ()
shapePoints = S.each . concatMap (map (stripZ . _svPos) . _shVs)
--shapePoints :: Shape -> Stream (Of Point2) Identity ()
--shapePoints = S.each . concatMap (map (stripZ . _svPos) . _shVs)
shapeBounds :: Shape -> (Float,Float,Float,Float)
shapeBounds = fromMaybe (0,0,0,0) . boundPoints . shapePoints
--shapeBounds :: Shape -> (Float,Float,Float,Float)
--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)