Cellular solid generator.
NOTE: Cesogen is currently unreleased and under active development. It is made available only for the convenience of the author and for evaluation by readers and reviewers of the paper presenting it. All branches including the main branch may be rebased at any time and patches will be disregarded until an initial version is released.
Cesogen is a mesh generator for cellular solids and general signed distance functions (SDFs). It knows the SDFs of various primitive shapes and also triply periodic, minimal surface (TPMS)–like surfaces (TPMS-likes) — a kind of cellular solid — which it can combine via SDF operations like the standard mathematical transformations and boolean operators to finally generate a triangle mesh via the marching cubes algorithm.
The Cesogen utility is not packaged for any operating systems, so you must download, build and install it manually.
Cesogen depends on SBCL and various Common Lisp dependencies which may be fetched automatically. Fetching the dependencies depends on curl and tar, both of which are installed by default in Ubuntu, macOS and Windows. If curl is missing or of a version earlier than 7.67.0, which is possible on various Unix-likes, install it with a variant of
apt-get install curl # Debian
brew install curl # macOSInstall SBCL according to your platform:
apt-get install sbcl # Debian
brew install sbcl # macOS
winget install SBCL.SBCL # WindowsDownload and extract the latest commit of Cesogen:
curl https://git.sr.ht/~paulapatience/cesogen/archive/draft.tar.gz | tar -xzf-From within the extracted directory, fetch the Common Lisp dependencies:
sbcl --script scripts/passel-fetch.lisp -o ext -v qlfileOn Windows, tar may complain about the asdf-*/contrib/debug.lisp file.
It is a symbolic link which is not created, and it is unnecessary for
Cesogen.
Build the utility:
sbcl --script scripts/build.lispOn Linux you may also build Cesogen in a container, for which you will need Podman and make. Cesogen can be built statically, or linked against musl (for musl-based Linux distributions) or glibc (for most Linux distributions, including Ubuntu), with one of the following commands:
make container-static
make container-musl
make container-glibcGenerate a cubic gyroid, writing to file out.ply:
cesogen tpms.gyroidGenerate a spherical P surface, writing to file p.ply:
cesogen -o p.ply tpms.p ball intersectionGenerate a Neovius surface with a smaller cell size and more samples to improve the resolution:
cesogen -s 50^3 tpms.neovius scale 1/2Expand the bounds instead of shrinking the cell size to generate just as many, though larger, Neovius cells:
cesogen -s 50^3 -b -2,-2,-2,2,2,2 tpms.neoviusGenerate an F-RD endoskeleton:
cesogen tpms.frd offset 0.5And the corresponding exoskeleton:
cesogen tpms.frd offset 0.5 complementGenerate a gyroid shell:
cesogen tpms.gyroid shell 1And an eccentric version:
cesogen tpms.gyroid offset 0.4 shell 1Generate a P surface via its explicit expression:
cesogen expression 'cos(2pi*x)+cos(2pi*y)+cos(2pi*z)'Generate an hourglass-like object:
cesogen -b -1,-1,-1,1,1,1 \
cylinder scale 1/2 orient 1,0,0 move 0,-1,0 \
cylinder scale 1/2 orient 1,0,0 move 0,1,0 \
union complementAnother way to generate the same object:
cesogen -b -1,-1,-1,1,1,1 \
cylinder move 0,-2,0 cylinder move 0,2,0 union \
scale 1/2 orient 1,0,0 complementCesogen is documented in the cesogen(1) manual page (render
it with man -l cesogen.1 on a Unix-like), which is also available in
Markdown form.
Other cellular solid generators include:
- ScaffoldStructures
- MSLattice
- MiniSurf
- TPMS-Modeler (no accompanying paper)
- Scaffolder
- TPMS Designer
- RegionTPMS
- FLatt Pack
- TPMS Scaffold
- ASLI
- Microgen (no accompanying paper)
- MaSMaker
- Lattice_Karak
- TPMSgen (no accompanying paper)
- MD-TPMS
- TPMS Studio (no accompanying paper)
- TPMS_Scaffold_Generator
- LattGen
Of those, only Scaffolder and ASLI have command-line interfaces.
The API of the CESOGEN/FIELDS package is inspired by fogleman/sdf's, and some of the operations are implemented in the same way.
Some of the SDF formulas are from Inigo Quilez's list of signed distance functions.
The CESOGEN/PROXIMITY package contains a refactored port of parts of the MIT licensed, TriangleMeshDistance C++ library.
meshio was invaluable in developing and testing the CESOGEN/SERDES package.
This project is licensed under the MIT license (Expat).
Unless you explicitly state otherwise, any contribution intentionally submitted by you for inclusion in this project shall be licensed as above, without any additional terms or conditions.