module Wumpus.Drawing.Paths.Illustrate
(
path_as_control_box
, path_with_control_points
) where
import Wumpus.Drawing.Paths.Base
import Wumpus.Basic.Kernel
import Wumpus.Core
import Wumpus.Core.Colour
import Data.Monoid
grey1 :: RGBi
grey1 = RGBi 200 200 200
path_as_control_box :: (Floating u, InterpretUnit u) => AbsPath u -> Graphic u
path_as_control_box path1 = pic1 `mappend` pic2
where
pic1 = localize (set_line_width 8 . stroke_colour grey1) $
renderPath_ OSTROKE path1
pic2 = localize (set_line_width 1 . stroke_colour black) $
renderPath_ OSTROKE $ deBezier path1
path_with_control_points :: (Floating u, InterpretUnit u) => AbsPath u -> Graphic u
path_with_control_points path1 = pic1 `mappend` pic2
where
pic1 = localize (fill_colour grey1) $
mconcat $ map (disk1 `at`) $ pathAllPoints path1
pic2 = localize (set_line_width 1 . stroke_colour black) $
renderPath_ OSTROKE path1
disk1 = dcDisk DRAW_FILL 3