Loading

JavaSCAD - Our little model generator framework

by printingin3d, published

JavaSCAD - Our little model generator framework by printingin3d May 2, 2013

Description

After we had been using OpenSCAD for months and learnt its limitations we decided we should write something which helps creating complex models. Our obvious choice was Java, because both of us are expert Java developers and the cross-platform support for Java is ideal to generate code for the equally cross-platform OpenSCAD.
This led to the creation of [JavaSCAD](http://www.printingin3d.eu/javascad), a simple framework in Java. The basic concept is to represent the OpenSCAD primitive objects with a Java object and build more complex ones from them. There is still ongoing development around JavaSCAD - for one thing it should be improved and addded more functionality and the other part is to include the OpenSCAD's 2D capabilities (the 3D features are already implemented).
Also uploaded a simple example about the current status - it's just a simple, parameterized Lego brick creator. Two brick is attached as well for those who want to see the result first.
Another example is the [gothic shelf](http://www.thingiverse.com/thing:65836), we published a few weeks ago.
Update: we just released the new version: r405 with two new features: intersection and rounding.
Update2: we just released yet another update: r426 with a new feature: polyhedron thanks for Rob van der Veer for the contribution; and a new rendering option: generation of POVRay output, which is still in a very alpha state.
Update3: yet another update with a few tweaks in the alignment abilities and fixing the rotation which was working only in special cases till now
Update4: finally we released the source code on [GitHub](https://github.com/printingin3d/javascad) under GNU GLP v2 licence. If you have any question don't hesitate to contact us!
Update5: new release with direct STL and (colored) PLY export functionality - the idea came and part of the code based on mihu's JavaCSG port. Tagging and much more: printingin3d.eu/javascad

Recent Comments

view all
Hello
A new version has been released which includes CSG generation based on mihu's JavaCSG. Thanks to him for the idea and the basic implementation.
Unfortunately the CSG generation is not necessary manifold (that's why OpenSCAD uses it only displaying the model, not for the STL rendering) and we haven't found any solution so far, so the STL and PLY export is mainly for displaying the model, the render remained in OpenSCAD.
Cool. Direct STL export was the main reason for developing it :)

Meanwhile I wrote a initial version of JavaFXScad: github.com/miho/JavaFXScad. Printing parts works flawless: thingiverse.com/make:71381 and thingiverse.com/make:71382

@all Please contribute to JavaCSG and JavaFXScad!
It was quite easy to move the codebase to Java7. Here it is: github.com/printingin3d/JavaCSG
It does export to STL directly, so I am more than interested to integrate this to JavaSCAD. As far as I see it won't be too hard to do, but we will see how it works out.

Liked By

view all

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag. Print Thing Tag
Any chance to access the code?
Currently we are still trying to decide the most appropriate licence which we could use to publish the source code. It turned out the originally planned GPL would be too restrictive and would prevent most of the customers to use our lib.

So, please give us some time and then we will publish the source code too.
Maybe interesting for you: I started my own JavaCSG library: github.com/miho/JavaCSG since I need it now.
Looks promising, but I have no intention to move to Java8 yet. So, if you don't mind, I'll try to downgrade it to Java7 and if it'll proven to be able to create STL output directly I'll merge it into my project.
Would be great if you do that Java8 -> Java7 port as a fork of JavaCSG on GitHub. There might be other users that still use Java 7 and would profit from that work.
It was quite easy to move the codebase to Java7. Here it is: github.com/printingin3d/JavaCSG
It does export to STL directly, so I am more than interested to integrate this to JavaSCAD. As far as I see it won't be too hard to do, but we will see how it works out.
Cool. Direct STL export was the main reason for developing it :)

Meanwhile I wrote a initial version of JavaFXScad: github.com/miho/JavaFXScad. Printing parts works flawless: thingiverse.com/make:71381 and thingiverse.com/make:71382

@all Please contribute to JavaCSG and JavaFXScad!
Hello
A new version has been released which includes CSG generation based on mihu's JavaCSG. Thanks to him for the idea and the basic implementation.
Unfortunately the CSG generation is not necessary manifold (that's why OpenSCAD uses it only displaying the model, not for the STL rendering) and we haven't found any solution so far, so the STL and PLY export is mainly for displaying the model, the render remained in OpenSCAD.
It depends on your goals. GPL promotes free software but limits adoption, BSD promotes adoption but doesn't promote free software (beyond your framework being free), etc.
Very cool. From reading about it, it sounds similar to PySCAD - use a real programming language to build an object and generate OpenSCAD to then render. Did I get that right?
Exactly. We didn't know about PySCAD, but it seems programmers think very similarly :-) We hope JavaSCAD will be at least as successful as PySCAD was.

The intention was to add convenient methods to the objects which saves us the lots of calculation which was needed in OpenSCAD (see the [Abstract3dModel.align](http://www.printingin3d.eu/javascad_api/eu/printingin3d/javascad/models/Abstract3dModel.html#align%28eu.printingin3d.javascad.models.Side,%20eu.printingin3d.javascad.models.Abstract3dModel,%20boolean%29) method in the documentation, which is the base class for all of the solid objects)
Nice! Now all we have to do is talk Tbuser into supporting alternatives to OpenSCAD on the Thingiverse Customizer! :-)
Top