import java.io.File;
//import de.grogra.util.MimeType;
//import de.grogra.pf.io.ObjectSourceImpl;
//import de.grogra.imp.View;
//import de.grogra.imp3d.View3D;


int step = 0;
private static final String PATH = "/home/mhenke/Downloads/b/";

module A(float len) extends Sphere(0.1).(setShader(GREEN));

protected void init () [
	Axiom ==> A(1);
	
	{
		step = 0;
	}
]

public void run () [
	A(x) ==> F(x) [RU(30) RH(90) A(x*0.8)] [RU(-30) RH(90) A(x*0.8)];
	
	{
		/*
		//for use only with GroIMP version below 1.5
		View view = (View) View3D.getDefaultView(workbench()).getPanel();
		workbench().export(new ObjectSourceImpl(view, "view", view.getFlavor(), 
			view.getWorkbench().getRegistry().getRootRegistry(), null), 
			new MimeType ("image/vnd.dxf", null), 
			new File(PATH+"0000"+step+".dxf"));
		*/
		
		//since GroIMP v.1.5
		//
		export3DScene(PATH+"0000"+step+".dxf", "dxf");
		// or with a file object as first parameter
		export3DScene(new File(PATH+"0000"+step+".dxf"), "dxf");
		
		step++;
	}
]
