Skip to content

JIGSAW is a Delaunay-based unstructured mesh generator for two- and three-dimensional geometries.

License

Notifications You must be signed in to change notification settings

jamesliu516/jigsaw-matlab

 
 

Repository files navigation

JIGSAW: An unstrutured mesh generator

     

JIGSAW is a computational library for unstructured mesh generation; designed to generate high-quality triangulations and polyhedral decompositions of general planar, surface and volumetric domains. JIGSAW includes both refinement-based algorithms for the construction of new meshes, as well as optimisation-driven techniques for the improvement of existing grids.

This package provides a MATLAB / OCTAVE based scripting interface to the underlying JIGSAW mesh generator, including a range of additional facilities for file I/O, mesh visualisation and post-processing operations.

JIGSAW has been compiled and tested on various 64-bit Linux , Windows and Mac based platforms.

Code Structure

JIGSAW is written as a header-only library in C++. Both a basic command-line interface and a C-format API are defined:

  JIGSAW::
  ├── MATLAB/OCTAVE utilities
  └── jigsaw
      ├── src -- JIGSAW src code
      ├── inc -- JIGSAW header files (for libjigsaw)
      ├── bin -- put JIGSAW exe binaries here
      ├── lib -- put JIGSAW lib binaries here
      ├── geo -- geometry definitions and input data
      ├── out -- default folder for JIGSAW output
      └── uni -- unit tests and libjigsaw example programs

Getting Started

The first step is to compile the code! The JIGSAW src can be found in ../jigsaw/src/.

JIGSAW is a header-only package - there is only the single main jigsaw.cpp file that simply #include's the rest of the library as headers. The resulting build process should be fairly straight-forward as a result. JIGSAW does not currently dependent on any external packages or libraries. To make use of JIGSAW's scripting interface, users are required to have access to a working MATLAB and/or OCTAVE installation.

On Linux/Mac

JIGSAW has been successfully built using various versions of the g++ and llvm compilers. Since the build process is a simple one-liner, there's no make script - instead:

g++ -std=c++11 -pedantic -Wall -s -O3 -flto -D NDEBUG -I libcpp -static-libstdc++ 
jigsaw.cpp -o jigsaw64r

can be used to build a JIGSAW executable, while:

g++ -std=c++11 -pedantic -Wall -O3 -flto -fPIC -D NDEBUG -I libcpp -static-libstdc++ 
jigsaw.cpp -shared -o libjigsaw64r.so

can be used to build a JIGSAW shared library. See the headers in ../jigsaw/inc/ for details on the API. The #define __lib_jigsaw directive in jigsaw.cpp toggles the source between executable and shared-library modes.

On Windows

JIGSAW has been successfully built using various versions of the msvc compiler. I do not provide a sample msvc project, but the following steps can be used to create one:

* Create a new, empty MSVC project.
* Import the jigsaw.cpp file, this contains the main() entry-point.
* Modify the MSVC project settings to include the "../src/" and "../src/libcpp/" directories.

Folder Structure

Once you have built the JIGSAW binaries, place them in the appropriate sub-folders in../jigsaw/bin/ and/or ../jigsaw/lib/ directories, so that they can be found by the unit tests in ../jigsaw/uni/.

Example Problems

After compiling and configuring the code, navigate to the JIGSAW installation directory in your MATLAB / OCTAVE environment and run the following set of example problems:

meshdemo(1); % build surface-meshes
meshdemo(2); % build volume-meshes
meshdemo(3); % preserve "sharp-features" in piecewise smooth domains
meshdemo(4); % build planar-meshes -- impose topological constraints
meshdemo(5); % build planar-meshes -- explore mesh-size controls
meshdemo(6); % mesh iso-surface geometry -- case 1
meshdemo(7); % mesh iso-surface geometry -- case 2

Additional information, documentation, online tutorials and references are available here. A repository of 3D surface models generated using JIGSAW can be found here.

License

This program may be freely redistributed under the condition that the copyright notices (including this entire header) are not removed, and no compensation is received through use of the software. Private, research, and institutional use is free. You may distribute modified versions of this code UNDER THE CONDITION THAT THIS CODE AND ANY MODIFICATIONS MADE TO IT IN THE SAME FILE REMAIN UNDER COPYRIGHT OF THE ORIGINAL AUTHOR, BOTH SOURCE AND OBJECT CODE ARE MADE FREELY AVAILABLE WITHOUT CHARGE, AND CLEAR NOTICE IS GIVEN OF THE MODIFICATIONS. Distribution of this code as part of a commercial system is permissible ONLY BY DIRECT ARRANGEMENT WITH THE AUTHOR. (If you are not directly supplying this code to a customer, and you are instead telling them how they can obtain it for free, then you are not required to make any arrangement with me.)

DISCLAIMER: Neither I nor: Columbia University, the Massachusetts Institute of Technology, the University of Sydney, nor the National Aeronautics and Space Administration warrant this code in any way whatsoever. This code is provided "as-is" to be used at your own risk.

Attribution!

If you make use of JIGSAW please make reference to the following. The algorithmic developments behind JIGSAW have been the subject of a number of publications, originally stemming from my PhD research at the University of Sydney:

[1] - Darren Engwirda: Generalised primal-dual grids for unstructured co-volume schemes, under review, https://arxiv.org/abs/1712.02657, 2017.

[2] - Darren Engwirda, Conforming Restricted Delaunay Mesh Generation for Piecewise Smooth Complexes, Procedia Engineering, Volume 163, Pages 84-96, ISSN 1877-7058, https://doi.org/10.1016/j.proeng.2016.11.024, 2016.

[3] - Darren Engwirda, Voronoi-based Point-placement for Three-dimensional Delaunay-refinement, Procedia Engineering, Volume 124, Pages 330-342, ISSN 1877-7058, http://dx.doi.org/10.1016/j.proeng.2015.10.143, 2015.

[4] - Darren Engwirda, David Ivers, Off-centre Steiner points for Delaunay-refinement on curved surfaces, Computer-Aided Design, Volume 72, Pages 157-171, ISSN 0010-4485, http://dx.doi.org/10.1016/j.cad.2015.10.007, 2016.

[5] - Darren Engwirda, Locally-optimal Delaunay-refinement and optimisation-based mesh generation, Ph.D. Thesis, School of Mathematics and Statistics, The University of Sydney, http://hdl.handle.net/2123/13148, 2014.

About

JIGSAW is a Delaunay-based unstructured mesh generator for two- and three-dimensional geometries.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 85.8%
  • PHP 5.7%
  • MATLAB 4.4%
  • SourcePawn 3.0%
  • C 1.1%