![]() |
Polyhedral-net Splines
|
General helper functions for mesh processing. More...
Functions | |
| int | Helper::get_vert_valence (const MeshType &a_Mesh, const VertexHandle &a_VertexHandle) |
| Get the vert valence object. | |
| bool | Helper::is_vert_3_valence (const MeshType &a_Mesh, const VertexHandle &a_VertexHandle) |
| Checks if the valence of the given vertex is 3. | |
| bool | Helper::is_vert_4_valence (const MeshType &a_Mesh, const VertexHandle &a_VertexHandle) |
| Checks if the valence of the given vertex is 4. | |
| bool | Helper::is_vert_5_valence (const MeshType &a_Mesh, const VertexHandle &a_VertexHandle) |
| Checks if the valence of the given vertex is 5. | |
| bool | Helper::are_verts_of_face_all_4_valence (const MeshType &a_Mesh, const FaceHandle &a_FaceHandle) |
| Checks if all the vertices of the given face are 4-valence. | |
| bool | Helper::is_vert_in_face (const MeshType &a_Mesh, const FaceHandle &a_FaceHandle, const VertexHandle &a_VertHandle) |
| Check if the given vertex is one of the vertices in face. | |
| bool | Helper::is_polar_surrounding_vert (const MeshType &a_Mesh, const VertexHandle &a_VertexHandle, bool only_regular, int max_valence) |
| Checks if the given vertex could be a polar surrounding vertex. A polar patch must be surrounded by quads. Check if the surrounding faces are all quads except the two triangles that belong to the polar point. | |
| bool | Helper::is_polar (const MeshType &a_Mesh, const VertexHandle &a_VertexHandle, bool only_regular, int max_valence, int surrounding_max_valence) |
| Checks if the given vertex could be a polar point. A polar point is defined as a vertex that is surrounded by triangles. The neighborhood around the triangles should be all quads. Also checks if the surrounding vertices are also valid polar surrounding vertices. | |
| VertexHandle | Helper::find_polar_vertex (const MeshType &mesh, VertexHandle outerVH) |
| Given a vertex that is potintially a vertex surrounding a polar point, find the polar point vertex. | |
| void | Helper::set_vert_vector_to_default (const int a_Size, std::vector< VertexHandle > &a_VertexHandles) |
| Set the vert vector to default object. | |
| std::vector< FaceHandle > | Helper::get_faces_around_vert_counterclock (const MeshType &a_Mesh, const VertexHandle &a_VertHandle) |
| Get the faces around vert counterclock object. | |
| std::vector< FaceHandle > | Helper::get_two_layers_faces_around_vert (const MeshType &a_Mesh, const VertexHandle &a_VertHandle) |
| Get first and second layers of faces aroumnd the vert (unordered) ex: | |
| std::vector< VertexHandle > | Helper::get_two_layers_verts_around_vert (const MeshType &a_Mesh, const VertexHandle &a_VertHandle) |
| Get first and second layers of verts around the given vert (unordered). The layout does not need to be regular. | |
| std::vector< VertexHandle > | Helper::get_first_layers_verts_around_vert (const MeshType &a_Mesh, const VertexHandle &a_VertHandle) |
| Get first layer of verts around the given vert. The layout does not need to be regular. | |
| std::vector< VertexHandle > | Helper::get_surrounding_verts (const MeshType &a_Mesh, const VertexHandle &a_VertHandle) |
| Get surrounding verts around the given vert (unordered) | |
| std::vector< FaceHandle > | Helper::get_second_layer_faces_around_vert (const MeshType &a_Mesh, const VertexHandle &a_VertHandle) |
| Get second layer of faces around the given vert (unordered). The layout does not need to be regular. | |
| bool | Helper::is_marked (const MeshType &a_Mesh, const VertexHandle &a_VertHandle) |
| Check if the given vertex is marked. A marked vertex is determined by the bool named property "marked_status" on a vertex. | |
| void | Helper::mark_vert (MeshType &a_Mesh, const VertexHandle &a_VertHandle) |
| Mark the given vertex. A marked vertex is determined by the bool named property "marked_status" on a vertex. | |
| bool | Helper::is_triangle (const MeshType &a_Mesh, const FaceHandle &a_FaceHandle) |
| Check if the given face is a triangle. | |
| bool | Helper::is_quad (const MeshType &a_Mesh, const FaceHandle &a_FaceHandle) |
| Check if the given face is a quad. | |
| bool | Helper::is_pentagon (const MeshType &a_Mesh, const FaceHandle &a_FaceHandle) |
| Check if the given face is a pentagon. | |
| bool | Helper::is_hexagon (const MeshType &a_Mesh, const FaceHandle &a_FaceHandle) |
| Check if the given face is a hexagon. | |
| std::vector< FaceHandle > | Helper::init_neighbor_faces (const MeshType &a_Mesh, const FaceHandle &a_FaceHandle) |
| Initialize the neighbor faces of the given face. | |
| bool | Helper::has_7_neighbor_faces (const std::vector< FaceHandle > &a_NBFaceHandles) |
| Check if the number of neighbor faces is 7. | |
| bool | Helper::has_8_neighbor_faces (const std::vector< FaceHandle > &a_NBFaceHandles) |
| Check if the number of neighbor faces is 8. | |
| bool | Helper::has_9_neighbor_faces (const std::vector< FaceHandle > &a_NBFaceHandles) |
| Check if the number of neighbor faces is 9. | |
| bool | Helper::are_faces_all_quads (const MeshType &a_Mesh, const std::vector< FaceHandle > &a_FaceHandles) |
| Check if all the given faces are quads. | |
| bool | Helper::is_only_surrounded_by_quad (const MeshType &a_Mesh, const VertexHandle &a_VertHandle) |
| Check if the given vertex is only surrounded by quads. | |
| int | Helper::get_num_of_verts_for_face (const MeshType &a_Mesh, const FaceHandle &a_FaceHandle) |
| Get the number of vertices for the given face. | |
| int | Helper::get_num_of_neighbor_faces (const std::vector< FaceHandle > &a_NBFaceHandles) |
| Get the number of neighbor faces for the given neighborhood. | |
| std::vector< VertexHandle > | Helper::get_verts_of_face (const MeshType &a_Mesh, const FaceHandle &a_FaceHandle) |
| Get the vertices of the given face. | |
| std::vector< VertexHandle > | Helper::get_verts_of_faces (const MeshType &a_Mesh, const std::vector< FaceHandle > &a_FaceHandles) |
| Get the vertices of the given faces. | |
| int | Helper::num_of_quads (const MeshType &a_Mesh, std::vector< FaceHandle > a_FaceHandles) |
| Given a neighborhood of faces, count how many quads are there. | |
| int | Helper::num_of_triangles (const MeshType &a_Mesh, std::vector< FaceHandle > a_FaceHandles) |
| Given a neighborhood of faces, count how many triangles are there. | |
| std::vector< FaceHandle > | Helper::get_second_layer_faces_around_face (const MeshType &a_Mesh, const FaceHandle &a_FaceHandle) |
| Get the second layer of faces around the given face (unordered). Output faces do not include the first layer faces. | |
| bool | Helper::is_marked (const MeshType &a_Mesh, const FaceHandle &a_FaceHandle) |
| Check if the given face is marked. A marked face is determined by the bool named property "marked_status" on a face. | |
| void | Helper::mark_face_verts (MeshType &a_Mesh, const FaceHandle &a_FaceHandle) |
| Mark all the vertices of the given face. A marked vertex is determined by the bool named property "marked_status" on a vertex. | |
| void | Helper::mark_face (MeshType &a_Mesh, const FaceHandle &a_FaceHandle) |
| Mark the given face. A marked face is determined by the bool named property "marked_status" on a face. | |
| Vec3d | Helper::verthandles_to_point_vec (const MeshType &a_Mesh, const VertexHandle &a_VertHandle) |
| Convert a vertex handle to a 3D point vector. | |
| Matrix | Helper::verthandles_to_points_mat (const MeshType &a_Mesh, const std::vector< VertexHandle > &a_VertHandle) |
| Convert a vector of vertex handles to a Matrix of 3D points. | |
| Patch | Helper::points_mat_to_patch (const Matrix &a_PointMat) |
| Convert a Matrix of 3D points to a Patch. | |
| Patch | Helper::points_mat_to_patch (const int a_PatchDegU, const int a_PatchDegV, const Matrix &a_PointMat) |
| Convert a Matrix of 3D points to a Patch. The U and V degree of the patch are the same. | |
| Patch | Helper::points_mat_to_patch (const int a_PatchDegU, const int a_PatchDegV, const std::string a_Group, const Matrix &a_PointMat) |
| Convert a Matrix of 3D points to a Patch. | |
| Patch | Helper::points_mat_to_patch (const int a_PatchDegU, const int a_PatchDegV, const std::string a_Group, const Matrix &a_PointMat, const int a_StartIndex) |
| Convert a Matrix of 3D points to a Patch. | |
| std::vector< Patch > | Helper::points_mat_to_patches (const int a_NumOfPatch, const std::string a_Group, const Matrix &a_PointMat) |
| Convert a Matrix of 3D points to multiple Patch es. | |
| std::vector< Patch > | Helper::points_mat_to_patches (const int a_PatchDegU, const int a_PatchDegV, const std::string a_Group, const Matrix &a_PointMat) |
| Convert a Matrix of 3D points to multiple Patch es. | |
| template<typename T> | |
| std::vector< T > | Helper::duplicate_vector (int a_Times, const std::vector< T > &a_Vector) |
| Duplicate a vector multiple times. | |
General helper functions for mesh processing.
| bool Helper::are_faces_all_quads | ( | const MeshType & | a_Mesh, |
| const std::vector< FaceHandle > & | a_FaceHandles ) |
Check if all the given faces are quads.
| a_Mesh | The mesh containing the faces |
| a_FaceHandles | The vector of face handles |
| bool Helper::are_verts_of_face_all_4_valence | ( | const MeshType & | a_Mesh, |
| const FaceHandle & | a_FaceHandle ) |
Checks if all the vertices of the given face are 4-valence.
| a_Mesh | The mesh containing the face |
| a_FaceHandle | The face handle |
| std::vector< T > Helper::duplicate_vector | ( | int | a_Times, |
| const std::vector< T > & | a_Vector ) |
Duplicate a vector multiple times.
| T | The type of the vector elements |
| a_Times | The number of times to duplicate the vector |
| a_Vector | The vector to be duplicated |
| VertexHandle Helper::find_polar_vertex | ( | const MeshType & | mesh, |
| VertexHandle | outerVH ) |
Given a vertex that is potintially a vertex surrounding a polar point, find the polar point vertex.
| mesh | The mesh containing the vertex |
| outerVH | The vertex handle of the potential polar surrounding vertex |
| std::vector< FaceHandle > Helper::get_faces_around_vert_counterclock | ( | const MeshType & | a_Mesh, |
| const VertexHandle & | a_VertHandle ) |
Get the faces around vert counterclock object.
| a_Mesh | The mesh containing the vertex |
| a_VertHandle | The vertex handle |
| std::vector< VertexHandle > Helper::get_first_layers_verts_around_vert | ( | const MeshType & | a_Mesh, |
| const VertexHandle & | a_VertHandle ) |
Get first layer of verts around the given vert. The layout does not need to be regular.
ex:
| a_Mesh | The mesh containing the vertex |
| a_VertHandle | The vertex handle |
| int Helper::get_num_of_neighbor_faces | ( | const std::vector< FaceHandle > & | a_NBFaceHandles | ) |
Get the number of neighbor faces for the given neighborhood.
| a_NBFaceHandles | The vector of neighbor face handles |
| int Helper::get_num_of_verts_for_face | ( | const MeshType & | a_Mesh, |
| const FaceHandle & | a_FaceHandle ) |
Get the number of vertices for the given face.
| a_Mesh | The mesh containing the face |
| a_FaceHandle | The face handle |
| std::vector< FaceHandle > Helper::get_second_layer_faces_around_face | ( | const MeshType & | a_Mesh, |
| const FaceHandle & | a_FaceHandle ) |
Get the second layer of faces around the given face (unordered). Output faces do not include the first layer faces.
ex:
| a_Mesh | The mesh containing the face |
| a_FaceHandle | The face handle |
| std::vector< FaceHandle > Helper::get_second_layer_faces_around_vert | ( | const MeshType & | a_Mesh, |
| const VertexHandle & | a_VertHandle ) |
Get second layer of faces around the given vert (unordered). The layout does not need to be regular.
ex:
| a_Mesh | The mesh containing the vertex |
| a_VertHandle | The vertex handle |
| std::vector< VertexHandle > Helper::get_surrounding_verts | ( | const MeshType & | a_Mesh, |
| const VertexHandle & | a_VertHandle ) |
Get surrounding verts around the given vert (unordered)
| a_Mesh | The mesh containing the vertex |
| a_VertHandle | The vertex handle |
| std::vector< FaceHandle > Helper::get_two_layers_faces_around_vert | ( | const MeshType & | a_Mesh, |
| const VertexHandle & | a_VertHandle ) |
Get first and second layers of faces aroumnd the vert (unordered) ex:
| a_Mesh | The mesh containing the vertex |
| a_VertHandle | The vertex handle |
| std::vector< VertexHandle > Helper::get_two_layers_verts_around_vert | ( | const MeshType & | a_Mesh, |
| const VertexHandle & | a_VertHandle ) |
Get first and second layers of verts around the given vert (unordered). The layout does not need to be regular.
ex:
| a_Mesh | The mesh containing the vertex |
| a_VertHandle | The vertex handle |
| int Helper::get_vert_valence | ( | const MeshType & | a_Mesh, |
| const VertexHandle & | a_VertexHandle ) |
Get the vert valence object.
| a_Mesh | The mesh containing the vertex |
| a_VertexHandle | The vertex handle |
| std::vector< VertexHandle > Helper::get_verts_of_face | ( | const MeshType & | a_Mesh, |
| const FaceHandle & | a_FaceHandle ) |
Get the vertices of the given face.
| a_Mesh | The mesh containing the face |
| a_FaceHandle | The face handle |
| std::vector< VertexHandle > Helper::get_verts_of_faces | ( | const MeshType & | a_Mesh, |
| const std::vector< FaceHandle > & | a_FaceHandles ) |
Get the vertices of the given faces.
| a_Mesh | The mesh containing the faces |
| a_FaceHandles | The vector of face handles |
| bool Helper::has_7_neighbor_faces | ( | const std::vector< FaceHandle > & | a_NBFaceHandles | ) |
Check if the number of neighbor faces is 7.
| a_NBFaceHandles | The vector of neighbor face handles |
| bool Helper::has_8_neighbor_faces | ( | const std::vector< FaceHandle > & | a_NBFaceHandles | ) |
Check if the number of neighbor faces is 8.
| a_NBFaceHandles | The vector of neighbor face handles |
| bool Helper::has_9_neighbor_faces | ( | const std::vector< FaceHandle > & | a_NBFaceHandles | ) |
Check if the number of neighbor faces is 9.
| a_NBFaceHandles | The vector of neighbor face handles |
| std::vector< FaceHandle > Helper::init_neighbor_faces | ( | const MeshType & | a_Mesh, |
| const FaceHandle & | a_FaceHandle ) |
Initialize the neighbor faces of the given face.
| a_Mesh | The mesh containing the face |
| a_FaceHandle | The face handle |
| bool Helper::is_hexagon | ( | const MeshType & | a_Mesh, |
| const FaceHandle & | a_FaceHandle ) |
Check if the given face is a hexagon.
| a_Mesh | The mesh containing the face |
| a_FaceHandle | The face handle |
| bool Helper::is_marked | ( | const MeshType & | a_Mesh, |
| const FaceHandle & | a_FaceHandle ) |
Check if the given face is marked. A marked face is determined by the bool named property "marked_status" on a face.
| a_Mesh | The mesh containing the face |
| a_FaceHandle | The face handle |
| bool Helper::is_marked | ( | const MeshType & | a_Mesh, |
| const VertexHandle & | a_VertHandle ) |
Check if the given vertex is marked. A marked vertex is determined by the bool named property "marked_status" on a vertex.
| a_Mesh | The mesh containing the vertex |
| a_VertHandle | The vertex handle |
| bool Helper::is_only_surrounded_by_quad | ( | const MeshType & | a_Mesh, |
| const VertexHandle & | a_VertHandle ) |
Check if the given vertex is only surrounded by quads.
| a_Mesh | The mesh containing the vertex |
| a_VertHandle | The vertex handle |
| bool Helper::is_pentagon | ( | const MeshType & | a_Mesh, |
| const FaceHandle & | a_FaceHandle ) |
Check if the given face is a pentagon.
| a_Mesh | The mesh containing the face |
| a_FaceHandle | The face handle |
| bool Helper::is_polar | ( | const MeshType & | a_Mesh, |
| const VertexHandle & | a_VertexHandle, | ||
| bool | only_regular, | ||
| int | max_valence, | ||
| int | surrounding_max_valence ) |
Checks if the given vertex could be a polar point. A polar point is defined as a vertex that is surrounded by triangles. The neighborhood around the triangles should be all quads. Also checks if the surrounding vertices are also valid polar surrounding vertices.
| a_Mesh | The mesh containing the vertex |
| a_VertexHandle | The vertex handle of the potential polar point |
| only_regular | If true, only 4-valence surrounding polar vertex will be considered |
| max_valence | The maximum valence of the polar vertex. The minimum valence is 3. |
| surrounding_max_valence | The maximum valence of the surrounding vertex. |
| bool Helper::is_polar_surrounding_vert | ( | const MeshType & | a_Mesh, |
| const VertexHandle & | a_VertexHandle, | ||
| bool | only_regular, | ||
| int | max_valence ) |
Checks if the given vertex could be a polar surrounding vertex. A polar patch must be surrounded by quads. Check if the surrounding faces are all quads except the two triangles that belong to the polar point.
| a_Mesh | The mesh containing the vertex |
| a_VertexHandle | The vertex handle of the potential polar surrounding vertex |
| only_regular | If true, only 4-valence vertex will be considered |
| max_valence | The maximum valence of the vertex. The minimum valence is 3. |
| bool Helper::is_quad | ( | const MeshType & | a_Mesh, |
| const FaceHandle & | a_FaceHandle ) |
Check if the given face is a quad.
| a_Mesh | The mesh containing the face |
| a_FaceHandle | The face handle |
| bool Helper::is_triangle | ( | const MeshType & | a_Mesh, |
| const FaceHandle & | a_FaceHandle ) |
Check if the given face is a triangle.
| a_Mesh | The mesh containing the face |
| a_FaceHandle | The face handle |
| bool Helper::is_vert_3_valence | ( | const MeshType & | a_Mesh, |
| const VertexHandle & | a_VertexHandle ) |
Checks if the valence of the given vertex is 3.
| a_Mesh | The mesh containing the vertex |
| a_VertexHandle | The vertex handle |
| bool Helper::is_vert_4_valence | ( | const MeshType & | a_Mesh, |
| const VertexHandle & | a_VertexHandle ) |
Checks if the valence of the given vertex is 4.
| a_Mesh | The mesh containing the vertex |
| a_VertexHandle | The vertex handle |
| bool Helper::is_vert_5_valence | ( | const MeshType & | a_Mesh, |
| const VertexHandle & | a_VertexHandle ) |
Checks if the valence of the given vertex is 5.
| a_Mesh | The mesh containing the vertex |
| a_VertexHandle | The vertex handle |
| bool Helper::is_vert_in_face | ( | const MeshType & | a_Mesh, |
| const FaceHandle & | a_FaceHandle, | ||
| const VertexHandle & | a_VertHandle ) |
Check if the given vertex is one of the vertices in face.
| a_Mesh | The mesh containing the face and vertex |
| a_FaceHandle | The face handle |
| a_VertHandle | The vertex handle |
| void Helper::mark_face | ( | MeshType & | a_Mesh, |
| const FaceHandle & | a_FaceHandle ) |
Mark the given face. A marked face is determined by the bool named property "marked_status" on a face.
| a_Mesh | The mesh containing the face |
| a_FaceHandle | The face handle |
| void Helper::mark_face_verts | ( | MeshType & | a_Mesh, |
| const FaceHandle & | a_FaceHandle ) |
Mark all the vertices of the given face. A marked vertex is determined by the bool named property "marked_status" on a vertex.
| a_Mesh | The mesh containing the face |
| a_FaceHandle | The face handle |
| void Helper::mark_vert | ( | MeshType & | a_Mesh, |
| const VertexHandle & | a_VertHandle ) |
Mark the given vertex. A marked vertex is determined by the bool named property "marked_status" on a vertex.
| a_Mesh | The mesh containing the vertex |
| a_VertHandle | The vertex handle |
| int Helper::num_of_quads | ( | const MeshType & | a_Mesh, |
| std::vector< FaceHandle > | a_FaceHandles ) |
Given a neighborhood of faces, count how many quads are there.
| a_Mesh | The mesh containing the faces |
| a_FaceHandles | The vector of face handles |
| int Helper::num_of_triangles | ( | const MeshType & | a_Mesh, |
| std::vector< FaceHandle > | a_FaceHandles ) |
Given a neighborhood of faces, count how many triangles are there.
| a_Mesh | The mesh containing the faces |
| a_FaceHandles | The vector of face handles |
| void Helper::set_vert_vector_to_default | ( | const int | a_Size, |
| std::vector< VertexHandle > & | a_VertexHandles ) |
Set the vert vector to default object.
| a_Size | The size of the vector to be initialized to. |
| a_VertexHandles | The vertex handle vector to be initialized. |
| Vec3d Helper::verthandles_to_point_vec | ( | const MeshType & | a_Mesh, |
| const VertexHandle & | a_VertHandle ) |
Convert a vertex handle to a 3D point vector.
| a_Mesh | The mesh containing the vertex |
| a_VertHandle | The vertex handle |
| Matrix Helper::verthandles_to_points_mat | ( | const MeshType & | a_Mesh, |
| const std::vector< VertexHandle > & | a_VertHandle ) |