Geogram
Version 1.9.1
A programming library of geometric algorithms
|
Represents a 3D frame field, i.e. a function that associates a 3d orthonormal basis to each point in 3D space. More...
#include <geogram/mesh/mesh_frame_field.h>
Public Member Functions | |
FrameField () | |
Constructs a new uninitialized FrameField. | |
void | set_use_spatial_search (bool x) |
Specifies whether a spatial search structure should be created. More... | |
bool | load (const Mesh &M, bool volumetric, const std::string &filename) |
Loads a frame field from a file. More... | |
void | create_from_surface_mesh (const Mesh &M, bool volumetric, double sharp_angle_threshold=45.0) |
Creates a frame field that matches a given mesh. More... | |
index_t | get_nearest_frame_index (const double *p) const |
Gets the index of the frame nearest to a given point. More... | |
void | get_nearest_frame (const double *p, double *f) const |
Gets the frame nearest to a given point. More... | |
const vector< double > & | frames () const |
Gets the vector that contains all the frames coordinates. More... | |
Static Public Member Functions | |
static void | scale_frame_vector (double *frame, const vec3 &N, double s) |
static void | fix_frame (double *frame, const vec3 &N) |
Fixes a frame in such a way that it is orthogonal to a given vector. More... | |
Represents a 3D frame field, i.e. a function that associates a 3d orthonormal basis to each point in 3D space.
Definition at line 59 of file mesh_frame_field.h.
void GEO::FrameField::create_from_surface_mesh | ( | const Mesh & | M, |
bool | volumetric, | ||
double | sharp_angle_threshold = 45.0 |
||
) |
Creates a frame field that matches a given mesh.
The frames are interpolated from the sharp features of the mesh.
[in] | M | the input mesh |
[in] | volumetric | if true, the frame field is extrapolated to the tetrahedra of the mesh (using nearest neighbors for now) |
[in] | sharp_angle_threshold | angles smaller than this threshold (in degrees) are considered to be sharp features |
|
static |
Fixes a frame in such a way that it is orthogonal to a given vector.
Makes one of the frame vectors aligned with N
and the two other ones orthogonal to N.
[in,out] | frame | the frame to fix |
[in] | N | the normal vector to be preserved |
|
inline |
Gets the vector that contains all the frames coordinates.
Definition at line 150 of file mesh_frame_field.h.
|
inline |
Gets the frame nearest to a given point.
Cannot be used if set_use_spatial_search(false) was called.
[in] | p | the 3d coordinates of the point |
[out] | f | the 9 coordinates of the three vectors that compose the fram |
Definition at line 136 of file mesh_frame_field.h.
|
inline |
Gets the index of the frame nearest to a given point.
Cannot be used if set_use_spatial_search(false) was called.
[in] | p | the 3d coordinates of the point |
p
Definition at line 123 of file mesh_frame_field.h.
bool GEO::FrameField::load | ( | const Mesh & | M, |
bool | volumetric, | ||
const std::string & | filename | ||
) |
Loads a frame field from a file.
[in] | M | a tetrahedral mesh |
[in] | filename | name of the file that contains the frame vectors |
[in] | volumetric | if true, the frames are attached to the tets of M , else they are attached to the facets |
The file is supposed to be ASCII, with one vector per line. Alternatively, the frames can be attached to specified points. In this case, volumetric
is ignored, and the file has 12 scalars per line, that correspond to the coordinates of a point and the three vectors attached to the point.
true | on success |
false | otherwise |
|
inline |
Specifies whether a spatial search structure should be created.
If a spatial search structure is created, then the field can be queried at any 3D location using get_nearest_frame() / get_nearest_frame_index(), this is the default mode. Otherwise, get_nearest_frame() and get_nearest_frame_index() cannot be used.
[in] | x | true if spatial search should be used, false otherwise. |
Definition at line 78 of file mesh_frame_field.h.