krober10nd / simple_cgal

Perform serial and distributed memory MPI 2D/3D Delaunay triangulation with CGAL and Qhull.
MIT License
6 stars 2 forks source link

simple_cgal

A wrapper to perform 2D/3D Delaunay triangulation using CGAL with pybind11 and CMake. Supports distributed memory parallel Delaunay triangulation using (for now qhull)

Installation

  1. clone the repo: git clone https://github.com/krober10nd/simple_cgal.git
  2. pull the submodules: git submodule update --init --recursive
  3. run: pip install simple_cgal

Requirements

  1. CGAL>=5.0
  2. cmake>=2.8
  3. numpy>=1.0

How does it work?

 import random

 import numpy
 import simple_cgal

 import time

 num_points = 1000
 points = numpy.array([(random.random()*1.0, random.random()*1.0) for _ in range(num_points)])

 t1 = time.time()
 faces = simple_cgal.delaunay2(points[:,0],points[:,1])
 print('elapsed time is '+str(time.time()-t1))

 import matplotlib.pyplot as plt
 plt.triplot(points[:,0], points[:,1], faces)
 plt.show()