plut / ConstructiveGeometry.jl

Algorithms and syntax for building CSG objects within Julia.
MIT License
50 stars 2 forks source link
cad csg julia meshes meshing

ConstructiveGeometry

Documentation|Dev

Defining CSG objects from within Julia.

ConstructiveGeometry.jl provides functions for defining 2d shapes and 3d solids via basic primitives and CSG operations, as well as functions for displaying these objects and output to SVG or STL files.

It is possible to use this module to define basic 3d models. Examples are included in the examples subdirectory:

The following features should be mostly working now:

Global philosophy

This package defines both a structure for abstract­geometric objects and a way to convert such “ideal” objects to concrete meshes. These meshes are implemented as triangulated surfaces using the IGL graphics library.

Why write this when OpenSCAD exists?

Our goal is to replicate what OpenSCAD proved works well (a simple syntax for script-based CAD) while fixing some of the less-fun parts.

We believe that using Julia provides the following advantages:

On the other hand, one notable drawback of Julia (in particular with many dependencies) is the long “time-to-first-plot”. Once everything is loaded however, the second, third plots etc. are much faster.

Reaching feature-parity (at least for static designs) is one of the first goals of this package. The main missing part for this is the primitive text. On the other hand, this package already provides a few constructions absent from (base) OpenSCAD, such as 3d offsetting or surface sweep.

Future goals

Once this feature parity is achieved, we plan to move on to include more content (e.g. some of what is usually implemented library-side in OpenSCAD), such as:

Libraries used

Currently (as of 2021-08), ConstructiveGeometry.jl happily uses the following libraries:

Joining the project

This project is currently still at the “one-person effort” stage, although it is not indended that it remain here. There are multiple parts which could use some help; apart from the Todo-list above, even something as simple as playtesting the project would be appreciable help.