All Projects → plut → ConstructiveGeometry.jl

plut / ConstructiveGeometry.jl

Licence: MIT license
Algorithms and syntax for building CSG objects within Julia.

Programming Languages

julia
2034 projects
TeX
3793 projects

Projects that are alternatives of or similar to ConstructiveGeometry.jl

navis
Python 3 library for analysis of neuroanatomical data
Stars: ✭ 68 (+151.85%)
Mutual labels:  meshes
PolyDraw
✳️ PTSource PolyDraw is a free 3D polygonal modeller for Windows x86 and x64, for creating or modifying 3D objects using a mesh of 3D points and parametric NURBS Curves .Exports and imports to over 40 formats including WebVR and 3D Printing.
Stars: ✭ 17 (-37.04%)
Mutual labels:  meshes
rabbit-hole
An experimental voxel engine.
Stars: ✭ 39 (+44.44%)
Mutual labels:  csg
gdstk
Gdstk (GDSII Tool Kit) is a C++/Python library for creation and manipulation of GDSII and OASIS files.
Stars: ✭ 171 (+533.33%)
Mutual labels:  cad
pykicad
Library for working with KiCAD file formats
Stars: ✭ 46 (+70.37%)
Mutual labels:  cad
CadZinho
Minimalist computer aided design (CAD) software
Stars: ✭ 75 (+177.78%)
Mutual labels:  cad
intersection-wasm
Mesh-Mesh and Triangle-Triangle Intersection tests based on the algorithm by Tomas Akenine-Möller
Stars: ✭ 17 (-37.04%)
Mutual labels:  meshes
CGoGN 2
n-dimensional Meshes with Combinatorial Maps
Stars: ✭ 19 (-29.63%)
Mutual labels:  meshes
rhioCAD
CAD, based on OpenCascade. parametric, parametric 3D modeler. Fork of NaroCAD.
Stars: ✭ 42 (+55.56%)
Mutual labels:  cad
noflo-cad
CAD solid modelling components for NoFlo
Stars: ✭ 19 (-29.63%)
Mutual labels:  cad
IsoMesh
IsoMesh is a group of related tools for Unity for converting meshes into signed distance field data, raymarching signed distance fields, and extracting signed distance field data back to meshes via surface nets or dual contouring.
Stars: ✭ 178 (+559.26%)
Mutual labels:  meshes
cadnano2
Cadnano2
Stars: ✭ 23 (-14.81%)
Mutual labels:  cad
JScad2d
Javascript Library for CAD 2D drawing from json file
Stars: ✭ 25 (-7.41%)
Mutual labels:  cad
foxtrot
A fast, experimental STEP file viewer
Stars: ✭ 151 (+459.26%)
Mutual labels:  cad
BodyParts3D
Clone of the BodyParts3D/Anatomography 3D model files
Stars: ✭ 32 (+18.52%)
Mutual labels:  meshes
Limbo
Library for VLSI CAD Design Useful parsers and solvers' api are implemented.
Stars: ✭ 84 (+211.11%)
Mutual labels:  cad
flowwie-freecad
Flowwie's FreeCAD ressources for everybody to learn computer aided design with the Open Source CAD software FreeCAD.
Stars: ✭ 214 (+692.59%)
Mutual labels:  cad
FC-Docker
Project to run FreeCAD in a cloud environment accessible via a web browser in a cloud environment.
Stars: ✭ 40 (+48.15%)
Mutual labels:  cad
curve cad
Blender Addon: Bezier Curve CAD Tools for CNC Milling & Laser Cutting
Stars: ✭ 107 (+296.3%)
Mutual labels:  cad
loop subdivision
A C++ implementing of Loop subdivision
Stars: ✭ 19 (-29.63%)
Mutual labels:  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:

  • CSG operations on a sphere and a cube;
  • Crown with fleur-de-lis; The images were rendered by the CairoMakie back-end. It is also possible to export a model as a .svg (for 2d shapes) or .stl (for 3d volumes) file.

The following features should be mostly working now:

  • 2d shapes: square, circle, polygon, path stroke;
  • 3d shapes: cube, sphere, cylinder, cone, explicit surface;
  • boolean operations, linear transformations;
  • 2d->3d extrusions (linear, cone, revolution, curvilinear);
  • 3d->2d projection and slicing;
  • convex hull and Minkowski sum (2d, 3d, mixed dimensions);
  • offset (2d and 3d);
  • surface decimation, refining, and Loop subdivision;
  • volume deformation using user-supplied functions;
  • import from STL and PLY, and export to STL, PLY and SVG.

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:

  • a more complete (and easier to use) programming language (e.g. a language which natively contains linear algebra is easier to use for constraint-based design);
  • the ability to link external libraries (e.g. defining surfaces as solutions of differential equations or least-square fits);
  • giving the user access to the internal representation of all 3d models (whereas OpenSCAD's modules are closed) for e.g. implementing custom deformations;
  • ease of extending the basic functions of the library (e.g. ultimately implementing Minkowski difference or swung volumes should not be too hard, and some form of splines should be possible too), whereas such attempts in OpenSCAD often lead to “rewriting OpenSCAD in OpenSCAD”;
  • file I/O is easier to implement (and in more formats);
  • IGL's triangulated surfaces are likely faster (and more adapted to CAD) than CGAL's Nef polyedra, although this package has not reached the “speed benchmarks” phase yet.

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:

  • add an annotation system to ease the design of complex models;
  • add an anchor system;
  • use splines and NURBs to define models.

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].