from kiva.image import GraphicsContext
from numpy import pi
gc = GraphicsContext((300, 300))
gc.set_fill_color((0.0, 0.0, 1.0))
gc.begin_path()
gc.move_to(100, 100)
gc.line_to(150, 200)
gc.line_to(200, 100)
gc.line_to(100, 150)
gc.line_to(200, 150)
gc.line_to(100, 100)
gc.close_path()
gc.clip()
gc.begin_path()
gc.arc(150, 150, 100, 0.0, 2 * pi)
gc.fill_path()
gc.save("star_clip.bmp")
This code should clip to a star-shape, but doesn't: