from .linden import *
from .turtle import *
import bpy

class LSystemRunOperator(bpy.types.Operator):
    bl_idname = "lsystem.run"
    bl_label = "Run Operator"
    my_float: bpy.props.FloatProperty(name="Some Floating Point")
    
    def execute(self, context):
        it = context.scene.lsystem_iterations
        str_lsystem = context.scene.lsystem_lsystem
        bf = eval(str_lsystem)
        bf.iterate(it)
        orient = mathutils.Quaternion((1,0,0,0)) #identity quaternion
        orient = mathutils.Quaternion((0, 1, 0), math.radians(-90))
        pos = Vector([0, 0, 0])
        str_turtle = context.scene.lsystem_turtle
        turtle = eval(str_turtle)
        bf.add_to_scene(turtle)
        return {'FINISHED'}


