zkrain / meshgen

This is a Python module wrapping the Advancing Front Surface Reconstruction algorithm from CGAL by using Ctypes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Meshgen

Cesar L. Pastrana, 2022

Introduction

Meshgen is Python module that uses Ctypes to wrap the Advancing Front Surface Reconstruction algorithm from the C++-based library CGAL to obtain a triangulated surface from a 3D set of points. The algorithm is valid for both convex and non-convex surfaces, as well as for open and closed surfaces. Importantly, the resulting triangulation is oriented.

Calling

Import the module, for instance via from meshgen import gentrimesh. For a set of N points defining the surface and organised as a numpy array r of Nx3 (with x, y and z in columns), the triangulation is obtained as:

tri, n_tri = gentrimesh(r)

Here tri is an int array of n_trix3, where the three columns indicate the indices in r defining a triangle.

Requirements

The libary is included as a Linux-based pre-compiled shared libary meshgen.so in the folder clib. For other Unix-based operative systems, the libary can be recompiled using the Makefile included in the folder, simply run make (MinGW can be used in Windows). It is necessary, both for compilation and execution of the module, to have CGAL and its dependencies installed on the system.

About

This is a Python module wrapping the Advancing Front Surface Reconstruction algorithm from CGAL by using Ctypes


Languages

Language:C++ 60.1%Language:Python 32.8%Language:Makefile 7.1%