A demo program written with C++/Qt to show offsetting of shapes comprised of line and arc segments. It also can perform boolean operations on these shapes.
It currently has three backends that natively support arc segments: CGAL (used by OpenSCAD), and Open CASCADE (used by FreeCAD), and CavalierContours (lesser known, mostly abandoned for a Rust rewrite).
There are five backends that approximate arcs with line segments: Clipper, Clipper2, Boost, and GEOS.
Mandatory dependencies:
Optional dependencies for different engines:
- CGAL v6.0.1
- Open CASCADE Technology v7.8.1
- CavalierContours CavalierContours (included as git sub-module)
- Clipper v6.4.2
- Clipper2 v2.0.1 (included via CMake FetchContent)
- Boost v1.83.0
- GEOS v3.13.1
NOTE: the version numbers are for reference, other versions may work too.
The relevant development packages to install on Debian 13 (trixie) are:
qtbase5-devlibcgal-devlibocct-modeling-algorithms-devandlibocct-modeling-data-devandlibocct-data-exchange-devlibpolyclipping-devlibboost-devlibgeos++-dev
Run the following commands in the top-level directory with the CMakeLists.txt file:
mkdir build
cd build
cmake .. -DUSE_GEOS=ON
cmake --build .
You can add one or more -DUSE_xxx=ON to enable various engines as backends:
-DUSE_CGAL=ONfor CGAL-DUSE_OCCT=ONfor OpenCASCADE-DUSE_CAVC=ONfor CavalierContours-DUSE_CLIPPER=ONfor Clipper-DUSE_CLIPPER2=ONfor Clipper2-DUSE_BOOST=ONfor Boost-DUSE_GEOS=ONfor GEOS
You can launch the built LineArcOffsetDemo executable that will be put in the build directory:
./LineArcOffsetDemo
An example of manually specifying the engine to use (useful if multiple engines are enabled):
./LineArcOffsetDemo --engine geos
Here are the various options:
--engine cgalfor CGAL--engine occtfor OpenCASCADE--engine cavcfor CavalierContours--engine clipperfor Clipper--engine clipper2for Clipper2--engine boostfor Boost--engine geosfor GEOS


