Skip to content

A short implementation of blue noise sampling for triangle meshes

License

Notifications You must be signed in to change notification settings

marmakoide/mesh-blue-noise-sampling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mesh-blue-noise-sampling

This project demonstrates a simple yet efficient algorithm to compute a blue noise sampling of a triangle mesh. The number of sample can be set to any value. The algorithm is described in the paper Sample Elimination for Generating Poisson Disk Sample Sets by Cem Yuksel.

splash screen

Getting Started

Prerequisites

You will need

Running the demo

The demo

  1. loads an ASCII STL file (a file format for 3d triangle mesh) from the standard input
  2. generates a blue noise sampling of the mesh's surface
  3. displays the samples

Using one the sample STL files provided with the naive implementation demo

xzcat meshes/fox.stl.xz | python mesh-sampling.py

By default, 2048 samples are computed. You can select a different number of samples, say, 256, using a command-line switch

xzcat meshes/fox.stl.xz | python mesh-sampling.py -s256

Implementation notes

This implementation takes a shortcut, by considering Euclidean distances between samples in the 3d space, not geodesic path lengths on the mesh. In practice, for a dense enough sampling, this should have a neglible impact on the result. However, I plan to add an option to use proper geodesic path lengths.

The algorithm calls for a priority queue, while in this implementation, a plain sorted list is used.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

A short implementation of blue noise sampling for triangle meshes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages