Fade2D Documentation pages v2.16.8
Delaunay Features
Getting Started with the Fade2D Library

Setup Instructions

Follow these steps to set up the Fade2D Library in your development environment:

  • Download Fade
  • Choose the right Fade Library
  • Compile the first example

Choosing the Right Fade Library

The Fade library is available in two specialized versions: one for 2D and another for 2.5D.

Fade2D (this page)

Fade2D is a classic 2D Delaunay triangulation library that offers the following features:

  • Polygon support through constraints and zones
  • Polygon Clipper (repair and cut tool)
  • Polygon offset computations
  • Boolean operations on polygons
  • Morphological opening and closing
  • Quality mesh generator
  • Voronoi Diagram
  • PDF and Postscript Writer to support development
Fade2D

Fade2.5D

Fade2.5D is an elevated Delaunay triangulation library for 2.5D point clouds. It extends the 2D version with a z-coordinate and additional algorithms designed for Digital Elevation Models (DEM), including:

  • Cut-and-fill algorithm
  • Cookie cutter operations
  • Ridge/valley optimization
  • Mesh smoothing function
  • Point cloud simplification algorithms
  • Fast ISO contour computation
  • Draping functionality
  • VTK 3D visualization
Fade2.5D

Although Fade2.5D can handle all tasks performed by Fade2D, using Fade2D for pure 2D triangulations is more efficient: it produces smaller binaries, consumes slightly less memory, and removes the need to specify the redundant z-coordinate as 0.

Compiling

Compiling and Linking the Library under Windows

  1. Open one of the Visual Studio example projects, e.g. examples_2D/vs2022_exampleProject/examples_2D.sln.
  2. Compile in x64/Release mode. The resulting executable examples_2D.exe will be placed in the x64/ directory.

When linking the triangulation library with your own project, the following table might be helpful:

Visual Studio IDE Platform Toolset
VS2010 v10 Toolset v100 or Windows 7.1 SDK
VS2012 v11 Toolset v110
VS2013 v12 Toolset v120
VS2015 v14 Toolset v140
VS2017 v15 Toolset v141
VS2019 v16 Toolset v142
VS2022 v17 Toolset v143

Compiling and Linking the Library under Linux and Mac

  1. Ensure that GMP is installed (required for compilation):
    $ sudo apt-get install libgmp10
  

This command works on Debian-based systems, including Ubuntu, Debian, and Raspbian.

  1. Navigate to one of the example directories, e.g., cd examples_2D.
  2. Edit the Makefile and uncomment one DISTRO line to select your platform (mac, or your Linux distribution).
  3. Type make to compile the example source code. The executable will be placed in the current directory.

Step-by-Step Articles with Practical C++ Examples

Below are links to articles that provide practical C++ examples using the Fade libraries. The corresponding source code is included in the download. Explore how to work with various features of the library, from basic triangulations to real-world applications:

Files in the Download Package

  • include_fade2d and include_fade25d
    Header files of the two libraries.
  • Win32 and x64
    This directory contains the DLL's for Windows 32-bit and 64-bit and it is the target directory for the executables of example code compiled with Visual Studio.
  • lib_${DISTRO}_${ARCHITECTURE}
    The shared library (*.so) for Linux/Apple developers.
  • examples_2D
    2D Example source code (*.cpp files) and Visual Studio projects.
  • examples_25D
    2.5D Example source code (*.cpp files) and Visual Studio projects.
  • examples_real
    Examples that solve real customer challenges.
  • doc
    Library Documentation in *.pdf format.

Troubleshooting

  • A supposed crash might simply be an exception thrown for good reason. Use try/catch blocks to investigate the cause.
  • When updating from a previous version, ensure that the header files are also updated.
  • Make sure you link to the correct DLL.
  • If the issue persists, it is crucial that you report it along with a minimal example that reproduces the problem. Bugs in a library are entirely unacceptable, and every effort is made to ensure they are identified and resolved without delay.