Code for computing beads (aka toolpaths, print-paths, print-trajectories) in a slice with varying width for minimizing underfill. This is the code developed for the publication
Variable-width contouring for additive manufacturing. Samuel Hornus, Tim Kuipers, Olivier Devillers, Monique Teillaud, Jonàs Martínez, Marc Glisse, Sylvain Lazard and Sylvain Lefebvre. ACM Transactions on Graphics 39(4) (Proc. SIGGRAPH 2020) [link]
Code and scripts for visualizing and analyzing variable-width GCode can be found here.
- Samuel Hornus (Inria, France)
- Tim Kuipers (Ultimaker, TU Delft, Netherlands)
Salim Perchy and Pierre Bedell also contributed to Windows- and plugin-specific code.
- CMAKE
- TCLAP http://tclap.sourceforge.net
- Clipper http://angusj.com/delphi/clipper.php
- If the
VWC_USE_CGAL_MEDIAL_AXIS
CMake option is checked, then the code depends on CGAL https://www.cgal.org - If both the
VWC_USE_BOOST_MEDIAL_AXIS
andVWC_USE_EXTERNAL_BOOST
CMake options are checked, then the code depends on BOOST - If the
VWC_USE_CAIRO_PDF
CMake option is checked, then the code depends on Cairo https://www.cairographics.org
For compiling the IceSL plugin:
If the VWC_MAKE_ICESL_PLUGIN
CMake option is checked, then the plugin
libVariableWidthContouring.so
is compiled.
This needs the icesl-interface
library sources to be copied (typically as a git repoitory) alongside the src
directory. (That library sources is not yet publicly available.)
It should work alright on macOS and Ubuntu.
mkdir build
cd build
cmake ..
make
You may have to adjust the CMakeLists.txt.
Please send us your pull
requests!
There is the VWC_USE_CAIRO_PDF
CMake option to disable the use of Cairo. Then no PDF is ever output.
If you compile with both VWC_USE_BOOST_MEDIAL_AXIS
and VWC_USE_CGAL_MEDIAL_AXIS
then a command-line option -b / --boost
is added to choose to use BOOST instead of the default CGAL for computing the medial axes.
fill -h
will give you a a lot of options.
The basic usage is fill -p input_file -o output_file
.
Without -o
just the PDF file input_file.pdf
is generated (unless --no-pdf
).
The input_file
starts with the minimal and maximal allowed bead width.
The rest is a sequence of polygonal closed curves.
Each curve starts with the number of sample points (on one line).
Then there is one sample per line.
Each sample gives x, y
.
The output_file
is a (textual) sequence of print paths.
Each print path start with the number of samples.
Then there is one sample per line.
Each sample gives x, y, radius (half width), tangent_x, tangent_y
.
The input/
directory has some sample input files.
The set of 300 input files in input/dataset/ is the one used in the paper and originates from the following work:
A framework for adaptive width control of dense contour-parallel toolpaths in fused deposition modeling. Tim Kuipers, Eugeni L. Doubrovski, Jun Wu, and Charlie C. L. Wang. 2020. Computer Aided Design, vol. 128. arXiv, DOI.
You can use this simple shell command:
for f in `ls ../input/*.txt ../input/dataset/*.txt`; do ./fill -p ${f}; done
This will generate one PDF file and store it alongside each input file. Each page shows the state of the medial axis and the new bead.
Copy the file libVariableWidthContouring.so
into icesl-plugins/
directory.