Skip to content

claudim/3DMesher

Repository files navigation

3D Mesher

A C++ library implementation of full automatic tool for 3D Meshing.

3DMesher can create a Tet-mesh or Hex-mesh using CGAL library.

3DMesher generates a Tet-mesh using CGAL implementation of Delaunay algorithm.

3DMesher generates a Hex-mesh using Univaq Hex mesh or Univaq Split from Tet algorithm.

Getting Started

Requirements

  1. clang++ 10.0 or higher or an equivalent compiler (gcc/g++ 9.x or higher)
  2. C++ 20
  3. CMake 3.16 or newer
  4. CGAL library 5.1 (https://www.cgal.org/releases.html)
  5. Verdict library(https://gitlab.kitware.com/verdict/verdict/-/tree/master)
  6. VTK library (https://gitlab.kitware.com/vtk/vtk.git)

Installing Requirements

Installing CGAL

  • on Ubuntu:

    sudo apt-get install libcgal-dev

  • on MAC:

    1. brew install cgal

    2. brew install cgal-qt5

    3. Export path:

      If you need to have qt first in your PATH run:

      echo 'export PATH="/usr/local/opt/qt5/bin:$PATH"' >> /Users/userName/.bash_profile

      For compilers to find qt you may need to set:

      export LDFLAGS="-L/usr/local/opt/qt/lib"

      export CPPFLAGS="-I/usr/local/opt/qt/include"

      For pkg-config to find qt you may need to set:

      export PKG_CONFIG_PATH="/usr/local/opt/qt/lib/pkgconfig"

    4. brew link cgal

    5. brew link qt5 --force

Installing Verdict library

To build with CMake after downloading Verdict library follow https://gitlab.kitware.com/verdict/verdict/-/blob/master/readme.md instructions:

  1. Set up a build directory
  2. Change to this directory
  3. Type ccmake /path/to/verdict but replace /path/to/verdict with the path to the directory containing this read-me file.
  4. Fill the required fields and press the 'c' key NB: This process is iterative; you may need to change values and reconfigure before continuing.
  5. When the 'g' option becomes available, press the 'g' key to generate the Makefile and exit CMake.
  6. Build with make
  7. Install with make install

Installing VTK library

To buid VTK library follow https://vtk.org/Wiki/VTK/Building instructions.

Building 3DMesher Univaq Hex Mesh

  • From terminal, move to the 3DMesher directory

  • Open CMakeLists.txt file, comment all set(SOURCE_FILES fileName.cpp) instructions; decomment set(SOURCE_FILES UnivaqHexMeshMain.cpp)

  • Create a build folder mkdir build

  • Navigate to the newly build folder cd build

  • Type cmake ..

  • Type make or make -j6

Usage of 3DMesher Univaq Hex Mesh

To use the executable:

  • Open terminal

  • Move to the build directory

  • Type

    ./3DMesher path/to/the/STLfile/filename.stl path/to/the/output/filename.vtk resolution

    or

    ./3DMesher path/to/the/STLfile/filename.stl path/to/the/output/filename.mesh resolution

    Example:

    ./3DMesher ../DataInput/bolt.stl ../MeshOutput/bolt.mesh 8

Building 3DMesher Univaq Split From Tet Hex Mesh

  • From terminal, move to the 3DMesher directory

  • Open CMakeLists.txt file, comment all set(SOURCE_FILES fileName.cpp) instructions; decomment set(SOURCE_FILES DelaunayTetMeshMain_Hex.cpp)

  • Create a build folder mkdir build

  • Navigate to the newly build folder cd build

  • Type cmake ..

  • Type make or make -j6

Usage of 3DMesher Univaq Split From Tet Hex Mesh

To use the executable:

  • Open terminal

  • Move to the build directory

  • Type

    ./3DMesher path/to/the/STLfile/filename.stl path/to/the/output/filename.vtk edge_dimension

    or

    ./3DMesher path/to/the/STLfile/filename.stl path/to/the/output/filename.mesh edge_dimension

    Example:

    ./3DMesher ../DataInput/bolt.stl ../MeshOutput/bolt.mesh 8

Building 3DMesher Tet Mesh

  • From terminal, move to the 3DMesher directory

  • Open CMakeLists.txt file, comment all set(SOURCE_FILES fileName.cpp) instructions; decomment set(SOURCE_FILES DelaunayTetMeshMain.cpp)

  • Create a build folder mkdir build

  • Navigate to the newly build folder cd build

  • Type cmake ..

  • Type make or make -j6

Usage of 3DMesher Tet Mesh

To use the executable:

  • Open terminal

  • Move to the build directory

  • Type

    ./3DMesher path/to/the/STLfile/filename.stl path/to/the/output/filename.mesh edge_dimension

    Example:

    ./3DMesher ../DataInput/bolt.stl ../MeshOutput/bolt.mesh 8

Create 3DMesher Documentation

Create Doxygen Documentation

  • Install Doxygen
  • Move to docs_doxygen directory
  • Type doxygen Doxyfile.in

Create Sphinx Documentation

  • Install Doxygen, Sphinx and Breathe
  • Move to docs_sphinx directory
  • Create _build directory
  • Create _static directory
  • Create _templates directory
  • Type make html from docs_sphinx directory

Authors

  • Claudia Di Marco
  • Riccardo Mantini

Releases

No releases published

Packages

No packages published

Languages