def PlantGL(scene): fn = tempfile.mktemp(suffix=".png") Viewer.frameGL.setBgColor(255, 255, 255) Viewer.animation(True) Viewer.display(scene) Viewer.saveSnapshot(fn, "png") img = Image(fn) os.unlink(fn) return img
def plot(axiom = '', lsystem = None): """ Plot a string """ if len(axiom) == 0: axiom = lsystem.axiom elif type(axiom) != AxialTree: if lsystem: lsystem.makeCurrent() axiom = AxialTree(axiom) if lsystem: lsystem.done() if (lsystem): Viewer.animation(False) lsystem.plot(axiom) else: plot(axiom) return (axiom,)
def plot(axiom='', lsystem=None): """ Plot a string """ if len(axiom) == 0: axiom = lsystem.axiom elif type(axiom) != AxialTree: if lsystem: lsystem.makeCurrent() axiom = AxialTree(axiom) if lsystem: lsystem.done() if (lsystem): Viewer.animation(False) lsystem.plot(axiom) else: plot(axiom) return (axiom, )
def animate(lsystem, timestep): """ Animate a lsystem """ if (lsystem): Viewer.animation(True) lsystem.animate(timestep * 0.01)
def animate(lsystem, timestep): """ Animate a lsystem """ if(lsystem): Viewer.animation(True) lsystem.animate(timestep * 0.01)