JavaSCAD

Our little model generator framework

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, a simple framework in Java. The basic concept is to represent the OpenSCAD primitive objects with a Java objects 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).

You can download the pre-compiled distribution package from here, the JavaDoc API is available from here and is also included in the package. You can download a simple tutorial - which is a parameterized Lego® brick creator - from here.

The easiest way to use this framework is to use Maven and add the following dependency to your project:

	<dependency>
		<groupId>eu.printingin3d.javascad</groupId>
		<artifactId>javascad</artifactId>
		<version>0.9.0.12</version>
	</dependency>

You can find the source code on GitHub. The library is under the GNU GPL licence v2. If you want to use the library in a commercial product contact us and we will find a solution.

If you have any comments, suggestions, improvements or questions regarding JavaSCAD feel free to contact us - especially if you have experience to compile or use it on other operating systems than Windows®.

Tutorials and other helping materials

Getting started with JavaSCAD.

Introduction of 3D primitives and transformations.

We uploaded several example code snippets to GitHub which you can use as a guide to see how we use the framework.

Changelog

v0.9.0.14

Adding import function

v0.9.0.13

Using Radius in Ring to further avoid doubles
Adding a convenient method to the Radius class

v0.9.0.12

First official release to the Maven Repository

v0.9.0.11

Adding POM changes for the Maven Repo release

v0.9.0.10

Fixing bugs and warnings

v0.9.0.9

Using Radius in even more places to further avoid doubles

v0.9.0.8

Adding inverse method to the BasicFunc (thus to Angle and Radius, not very useful for Radius though)

v0.9.0.7 - 2016-04-16

Adding Angle as the second step of reducing the extended usage of double (the change is not backward compatible)

v0.9.0.6

Added Radius as the first step of reducing the extended usage of double in the framework; Cylinder, Prism, Circle, and RoundedSquare has been modified accordingly
Changed the way alignment works - removing the boolean inside parameter and adding that to the AlignType enumeration instead

v0.9.0.5

Adding 2D Union
Adding CSG generation for LinearExtrude

v0.9.0.4

Adding xOnly and yOnly methods to the Coords2d class to make it consistent with Coords3d
Adding moves method with vararg param, to avoid the need of Arrays.asList every time
Adding two rotates methods similar to the moves methods
AnnotatedModelProvider ignores null result returned by ModelParts annotated methods
Adding toCSG functionality for LinearExtrude

v0.9.0.3

Adding text support
Adding Java8 support to the Maven build
Fixing some checkstyle errors to make it pass the CI build again

v0.9.0.2

Adding CSG generation code to the Polyhedron object

v0.9.0.1

Adding AnnotatedModelProvider for easier model creations

v0.9.0.0 - 2015-10-18

Adding missing JavaDOC comments, increasing test coverage and optimizing code generation
Introducing a new ancestor for the 3D coordinate classes (except Normal3d) to keep the basic functions in one place and consistent
Making the Abstract3dModel immutable
Replaced the Ant based build with Maven
Separated the color generation and the tag handling contexts. Removed the tag filtering from the toScad call - you can use subModel(context).toScad(colorContext) instead
Introducing the Abstract3dModel.subModel method
Fixed the boundary calculation for Polygon

rev20150405 - 2015-04-05

Added addModelTo method to Abstract3dModel
Adding more 2D functionalities: Circle, Polygon, RoundedSquare
Adding new 2D->3D extrusion: LinearExtrude
Extends existing 2D functionality: added move method to Abstract2dModel similar to the Abstract3dModel, but this time the descendants remained immutable - the method creates a new object for every call
Fixing inconsistent behavior of hashCode and equals methods for Abstract2d and Abstract3d
Removing the never user getParts method from IModelProvider

rev20150216 - 2015-02-16

Fixing the yesterday's feature, because that implementation was not working properly

rev20150215 - 2015-02-15

The addModel and subtractModel methods keep the moves and rotate operation for Union and Difference

rev20150201 - 2015-02-01

Fixing an error in Angles3d.rotate - the solution is not optimal, but I didn't find a better solution yet
Adding convenient methods to the Abstract3dModel to make it easier to create union and difference

rev20141201 - 2014-12-01

Introducing IModelProvider for complex objects
Introducing Support model
Fixing the EdgeCrossSolver problem - unfortunately that was not enough to make the generated STL manifold
Fixing the Slicer to add the cover even if tags are involved
Adding a useful method for the Triangle3d class to make the usage of Polyhedron object easier

rev20140822 - 2014-08-22

Added CSG rendering functionality. The idea and some parts of the code based on miho's Java CSG port (mihosoft.eu)
Added direct textual and binary STL export functionality. The idea and some parts of the code based on miho's Java CSG port (mihosoft.eu)
Added context to the scad and CSG generation
Added tags to the rendering
Added partial object generation via object tagging
Added colorization via object tagging
Added Polygon export functionality with colors via CSG rendering
Added FileExporterFactory to make the file export easier

rev20140315 - 2014-03-15

Adding color support
Added BoundedModel
Fixed the transitions of an empty model (such as new Union())
Removed the experimental Povray support
Fixed an error in the Difference boundary calculation in case the removed non-rotated Cube touched the original object
Taking a small step in the 2D subsystem: introducing Abstract2dModel and Square. These are used to the first 2D -> 3D projections: the Ring 3D object.

r450 - 2013-01-01

Adding a new constructor for the Cube to create the cuboid based on two corner of the cube
Adding a calculation of the boundary for Difference transition in the special case when the removed object is an unrotated Cube
Adding color support
Added BoundedModel
Minor bugfixes

r432 - 2013-08-29

Adding the ability to align to the middle of the model
Added the ability to align to a point
getSize and getAlignedValue methods have been added to Boundaries3d
Rotation has been fixed - the previous solution worked only in special cases

r426 - 2013-08-11

Adding Polyhedron support (thanks for Rob van der Veer for the contribution)
Adding POVRay rendering support - in an alpha state. Not stable, and not reliable yet

r412 - 2013-06-15

Make slicing more flexible

r405 - 2013-05-11

Add intersection operation
Adding rounding capability to the Abstract3dModel

r401 - 2013-04-28

Initial version

On sale