diff --git a/Graphics/Implicit/Canon.hs b/Graphics/Implicit/Canon.hs index d7b58ec3..285ebc19 100644 --- a/Graphics/Implicit/Canon.hs +++ b/Graphics/Implicit/Canon.hs @@ -28,58 +28,66 @@ module Graphics.Implicit.Canon , rewriteUntilIrreducible ) where +import Linear + ( V2(V2) + , V3(V3) + , V4(V4) + ) + import Prelude ( Bool(True) , Eq((==)) , Maybe(Just) - , Num((*), (+)) + , Num + ( (*) + , (+) + ) , Ord((<)) + , length , ($) , (<$>) - , length ) -import Linear (V2(V2), V3(V3), V4(V4)) import Graphics.Implicit.Definitions - ( SharedObj - ( Empty - , Full - , Complement - , UnionR + ( ExtrudeMScale + ( C1 + , C2 + , Fn + ) + , SharedObj + ( Complement , DifferenceR + , EmbedBoxedObj + , Empty + , Full , IntersectR - , Translate - , Scale , Mirror , Outset + , Scale , Shell - , EmbedBoxedObj + , Translate + , UnionR , WithRounding ) , SymbolicObj2 - ( Square - , Circle + ( Circle , Polygon , Rotate2 - , Transform2 , Shared2 + , Square + , Transform2 ) , SymbolicObj3 ( Cube - , Sphere , Cylinder - , Rotate3 - , Transform3 , Extrude , ExtrudeM - , RotateExtrude , ExtrudeOnEdgeOf + , Rotate3 + , RotateExtrude , Shared3 - ) - , ExtrudeMScale - ( C1 - , C2 - , Fn + , Sphere + , Transform3 ) , hasZeroComponent ) @@ -89,7 +97,10 @@ import {-# SOURCE #-} Graphics.Implicit.Primitives , fullSpace ) -import Control.Lens (preview, (#)) +import Control.Lens + ( preview + , (#) + ) -- $setup -- >>> import Prelude (id, pure) @@ -166,12 +177,12 @@ fmapObj2 -> (forall obj f a . (Object obj f a) => obj -> obj) -- ^ Shared2|3 transformation -> SymbolicObj2 -> SymbolicObj2 -fmapObj2 f _ _ (Square v) = f $ Square v -fmapObj2 f _ _ (Circle r) = f $ Circle r -fmapObj2 f _ _ (Polygon ps) = f $ Polygon ps -fmapObj2 f g s (Rotate2 r o) = f $ Rotate2 r (fmapObj2 f g s o) +fmapObj2 f _ _ (Square v) = f $ Square v +fmapObj2 f _ _ (Circle r) = f $ Circle r +fmapObj2 f _ _ (Polygon ps) = f $ Polygon ps +fmapObj2 f g s (Rotate2 r o) = f $ Rotate2 r (fmapObj2 f g s o) fmapObj2 f g s (Transform2 m o) = f $ Transform2 m (fmapObj2 f g s o) -fmapObj2 f g s (Shared2 o) = fmapSharedObj (fmapObj2 f g s) s (Shared2 o) +fmapObj2 f g s (Shared2 o) = fmapSharedObj (fmapObj2 f g s) s (Shared2 o) -- | Map over @SymbolicObj3@ and its underlying shared objects --