JavaSCAD - getting started

The first steps with the framework

There are only a few things you should do to be able to work with JavaSCAD.

Softwares

You will need only two softwares to work: your favourite Java IDE (eg. Eclipse) and OpenSCAD. Setting up your IDE is easy: just add the JavaSCAD jar file to your classpath and you are ready to go. OpenSCAD is even easier: you can use it with the default settings.

An effective process

Although everyone is different and everyone has his or her own favourite way of work, we will show you how we use JavaSCAD in this chapter.

First, you need a way to export your model or models as OpenSCAD file. This is very easy in JavaSCAD, you can use the SaveScadFiles class like this:

  new SaveScadFiles(new File("C:/temp")).
		addModel("logo.scad", new Logo()).
		saveScadFiles();

If you run this, it will export your Logo into the c:\temp\logo.scad file. Now if you drag and drop it into OpenSCAD (or open it from File menu) and press F5, which activates the Design menu Compile item, it will render your model. This is just a CSG rendering - like the rendering included into JavaSCAD - so it is very fast in most cases and always much faster the CGAL rendering, which is necessary for the STL export.

After you checked your model you most probably want to continue the development, but don't close OpenSCAD yet. If you change something in your model and run the above code again, then you can simply use the F4 function in OpenSCAD (Reload and Compile) to immediately see your model rendered again. But don't forget to run your application, because without it you won't see your changes naturally.

On sale