Created
October 28, 2011 16:35
-
-
Save tian2992/1322704 to your computer and use it in GitHub Desktop.
Drawing With Shoebot as a Module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shoebot | |
from shoebot.core import CairoCanvas, CairoImageSink, NodeBot | |
outputfile = 'output.svg' | |
iterations = 1 | |
sink = CairoImageSink(outputfile, "svg", multifile = false) | |
canvas = CairoCanvas(sink, enable_cairo_queue=True) | |
bot = shoebot.core.NodeBot(canvas) | |
bot.size(150,150) | |
bot.fill(1,0,0) | |
bot.rect(10,10,100,100) | |
bot._canvas.flush(frame=0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I've done an update and it's possible to do this with less knowledge of the internals again now:
Not nessacarily the final API, but fairly quick to get going with..