Skip to content

ferxinii/voronoi_3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Voronoi 3D

This code allows the construction of bounded 3D Voronoi diagrams inside an arbitrary polytope.

Given a set of seeds, the code first constructs the corresponding Delaunay triangulation using an iterative insertion flipping algorithm. Next, the dual Voronoi diagram is extracted. It is implemented in such a way that the Voronoi diagram is automatically bounded inside a specified polytope.

Example sphere 1 Example sphere 2

Example cube 1 Example cube 2

Complex example

In the following example, we see how the code has been used to generate secondary pulmonary lobules inside a lung geometry.

Example right lung Example left lung

Usage

The most high-level interface is in voronoi.h. The main function is construct_vd_from_txt. It reads the bounding polyhedron's coordinates from a .txt file, and generates inside of it a set of random seeds using the method of Poisson disc sampling with a user specified sizing function (local minimum distance between points). The output is the corresponding Voronoi diagram structure (vd_3d.h).

If the user needs to specify the seeds manually, they shall use lower-level already implemented functions.

References

Source for the Delaunay algorithm: Computing the 3D Voronoi Diagram Robustly: An Easy Explanation. Hugo Ledoux. Adaptive precision arithmetic: Adaptive Precision Floating-Point Arithmetic and Fast Robust Predicates for Computational Geometry. Jonathan Richard Shewchuk.

About

Construct bounded 3D Voronoi diagrams in C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published