Skip to content

A simple commandline utility to generate grid-based signed distance field (level set) generator from triangle meshes, using code from Robert Bridson's website.

License

Notifications You must be signed in to change notification settings

hamzamerzic/sdf-gen

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SDFGen

A utility for converting closed oriented triangle meshes into grid-based signed distance fields.

The output file format is:

<ni> <nj> <nk>

<origin_x> <origin_y> <origin_z>

<dx>

<value_1> <value_2> <value_3> [...]

  • (ni,nj,nk) are the integer dimensions of the resulting distance field.
  • (origin_x,origin_y,origin_z) is the 3D position of the grid origin.
  • dx is the grid spacing.
  • value_n are the signed distance data values, in ascending order of i, then j, then k. The output filename will match that of the input, with the OBJ suffix replaced with SDF.

Usage: SDFGen <filename> <dx> <padding>

Where:

  • filename specifies a Wavefront OBJ (text) file representing a triangle mesh (no quad or poly meshes allowed). File must use the suffix ".obj".
  • dx specifies the length of grid cell in the resulting distance field.
  • padding specifies the number of cells worth of padding between the object bound box and the boundary of the distance field grid. Minimum is 1.

Example output

Example python script is provided for parsing and visualizing the generated signed density field.

Example visual

About

A simple commandline utility to generate grid-based signed distance field (level set) generator from triangle meshes, using code from Robert Bridson's website.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 93.9%
  • Python 4.2%
  • CMake 1.7%
  • C 0.2%