def transf_interpret(cmd, smb, turtle): ls = lpy.Lstring(cmd) #print 'interpret', ls, cmd turtle.push() sc = lpy.turtle_partial_interpretation(ls, turtle) turtle.customGeometry(smb) turtle.pop()
def check_push_pop(lstring, res): global __push_string, __pop_string, __string_stack if not __push_string is None: __string_stack[__push_string] = lpy.Lstring(lstring) __push_string = None if not __pop_string is None: oldlstring = __string_stack[__pop_string] del __string_stack[__pop_string] __pop_string = None return oldlstring return res
def wrapped(lstring, *args): global __string_discarded, __last_string if __string_discarded: __string_discarded = False return __last_string res = endeach(lstring, *args) if __string_discarded: __string_discarded = False return __last_string __last_string = lpy.Lstring(lstring) return res
def get_lstring(self): if self.__derivationStep < len(self.__trees): return lpy.Lstring(self.__trees[self.__derivationStep]) return lpy.Lstring()
def test(): import openalea.lpy as lpy l = lpy.Lstring('FF(3)[+F][-(80)F]F') export_to_json(l, 'test.json')
def __check_discard_string(lstring): global __string_discarded, __last_string if __string_discarded: __string_discarded = False return __laststring __last_string = lpy.Lstring(lstring)
def smb_interpret(cmd, turtle): ls = lpy.Lstring(cmd) lpy.turtle_interpretation(ls, turtle)