Classes | Functions

OpenTissue::sdf Namespace Reference

Classes

class  CollisionPolicy
class  Geometry
class  TopDownPolicy

Functions

template<typename mesh_type , typename grid_type , typename point_container >
void compute_point_sampling (mesh_type &mesh, grid_type const &phi, double edge_resolution, bool face_sampling, point_container &points)
template<typename sdf_geometry_type >
void debug_draw_bvh (sdf_geometry_type const &geometry, int depth)
template<typename sdf_geometry_type >
void debug_draw_sampling (sdf_geometry_type const &geometry)
template<typename mesh_type , typename grid_type , typename sdf_geometry_type >
void init_geometry (mesh_type &mesh, grid_type &phi, double edge_resolution, bool face_sampling, sdf_geometry_type &geometry)
template<typename mesh_type , typename sdf_geometry_type >
void semiauto_init_geometry (mesh_type &mesh, double edge_resolution, bool face_sampling, sdf_geometry_type &geometry, unsigned int max_resolution=64, bool use_gpu=true)
template<typename mesh_type , typename sdf_geometry_type >
void semiauto_init_geometry (mesh_type &mesh, double edge_resolution, bool face_sampling, sdf_geometry_type &geometry, double bandsize, unsigned int resolution, bool use_gpu=true)

Function Documentation

template<typename mesh_type , typename grid_type , typename point_container >
void OpenTissue::sdf::compute_point_sampling ( mesh_type mesh,
grid_type const &  phi,
double  edge_resolution,
bool  face_sampling,
point_container points 
)

Compute Point Sampling. This function tries to resample a mesh geometry to better fit the resolution of the corresponding signed distance map.

Parameters:
mesh The surface mesh from which a point sampling is computed.
phi The signed distance field corresponding to the specified mesh.
edge_resolution Threshold value, indicating the sampling resolution along edges. If zero it will be computed on the fly, to match the resolution of the signed distance map.
face_sampling Boolean flag indicating wheter face sampling is on or off.
points Upon return this argument holds the computed point sampling.
template<typename sdf_geometry_type >
void OpenTissue::sdf::debug_draw_bvh ( sdf_geometry_type const &  geometry,
int  depth 
)

BVH Debug Drawing Utility. This function can be used to draw sphere geometries at a specified depth level in the bounding volume hiearchy (BVH) of a signed distance field geometry.

Parameters:
geometry The signed distance field geometry.
depth The depth level of the BVH that should be drawn.
template<typename sdf_geometry_type >
void OpenTissue::sdf::debug_draw_sampling ( sdf_geometry_type const &  geometry  ) 

Sampling Debug Drawing Utility. This function can be used to draw point sampling of a signed distance field geometry.

Parameters:
geometry The signed distance field geometry.
template<typename mesh_type , typename grid_type , typename sdf_geometry_type >
void OpenTissue::sdf::init_geometry ( mesh_type mesh,
grid_type phi,
double  edge_resolution,
bool  face_sampling,
sdf_geometry_type &  geometry 
)

Initialize Distance Map Geometry.

The signed distance field and the mesh must be given wrt. the same coordinate frame system.

It is implicitly assumed that the coordinate frame is the body frame, and it is also assumed that the mesh and the signed distance field are in perfect alignment with each other.

Parameters:
mesh The surface mesh (corresponds to the zero-level set of phi).
phi The signed distance field of the specified surface mesh.
edge_resolution Threshold value, indicating the sampling resolution along edges. If zero it will be computed on the fly, to match the resolution of the signed distance map.
face_sampling Boolean flag indicating wheter face sampling is on or off.
geometry Upon return this argument holds the signed distance field geometry.
template<typename mesh_type , typename sdf_geometry_type >
void OpenTissue::sdf::semiauto_init_geometry ( mesh_type mesh,
double  edge_resolution,
bool  face_sampling,
sdf_geometry_type &  geometry,
unsigned int  max_resolution = 64,
bool  use_gpu = true 
)

Initialize signed distance field geometry.

This function is usefull if one do not have a pre-computed signed distance field. The function tries to find a reasonable resolution of a signed distance field and uses t4 cpu/gpu scan to compute the signed distance field.

Parameters:
mesh The surface mesh (corresponds to the zero-level set of the signed distance field).
edge_resolution Threshold value, indicating the sampling resolution along edges. If zero it will be computed on the fly, to match the resolution of the signed distance field.
face_sampling Boolean flag indicating whether face sampling is on or off.
geometry Upon return this argument holds the signed distance field geometry.
max_resolution This argument can be used to set a maximum upper limit on the resolution of the signed distance field. Default value is 64.
use_gpu Boolean flag indicating whether the gpu should be used to compute the signed distance field. Default value is true.
template<typename mesh_type , typename sdf_geometry_type >
void OpenTissue::sdf::semiauto_init_geometry ( mesh_type mesh,
double  edge_resolution,
bool  face_sampling,
sdf_geometry_type &  geometry,
double  bandsize,
unsigned int  resolution,
bool  use_gpu = true 
)

Initialize signed distance field geometry.

This function is usefull if one do not have a pre-computed signed distance field. The function used a pre-specified resolution and band-size and uses t4 gpu/cpu scan to compute the signed distance field.

Parameters:
mesh The surface mesh (corresponds to the zero-level set of the signed distance field).
edge_resolution Threshold value, indicating the sampling resolution along edges. If zero it will be computed on the fly, to match the resolution of the signed distance field.
face_sampling Boolean flag indicating whether face sampling is on or off.
geometry Upon return this argument holds the signed distance field geometry.
bandsize This argument can be used to set the size of a band enclosing the mesh.
resolution This argument can be used to set the wanted resolution of the resuling distance field.
use_gpu Boolean flag indicating whether the gpu should be used to compute the signed distance field. Default value is true.