cellcomplex.property_topomesh.topological_operations module

PropertyTopomesh Topological Operations

topomesh_flip_edge(topomesh, eid[, verbose, …])

Perform an edge flip operation on a triangular PropertyTopomesh

topomesh_split_edge(topomesh, eid[, …])

Perform an edge split operation on a PropertyTopomesh

topomesh_collapse_edge(topomesh, eid[, …])

Perform an edge collapse operation on a triangular PropertyTopomesh

topomesh_split_vertex(topomesh, pid[, …])

Perform an vertex split operation on a triangular PropertyTopomesh

cellcomplex.property_topomesh.topological_operations.topomesh_collapse_edge(topomesh, eid, kept_pid=None, manifold=True, verbose=False, debug=False, loglevel=0)[source]

Perform an edge collapse operation on a triangular PropertyTopomesh

The edge collapse operation merges the two vertices linked by a given mesh edge, suppressed the incident faces and links the remaining elements to preserve the topological consistency of the complex. The operation is performed only if the resulting mesh is valid.

>>>  •-----•-----•           •-----•-----•
>>>  |\   / \   /|           | \   |   / |
>>>  | \ /   \ / |           |   \ | /   |
>>>  •--•-----•--•    -->    •-----•-----•
>>>  | / \   / \ |           |   / | \   |
>>>  |/   \ /   \|           | /   |   \ |
>>>  •-----•-----•           •-----•-----•
Parameters
  • topomesh (cellcomplex.property_topomesh.PropertyTopomesh) – The structure on which to perform the operation

  • eid (unsigned int) – The ID of the edge element to collapse

  • kept_pid (unsigned int, optional) – The ID of the edge vertex that should be kept after collapse

  • manifold (bool) – Whether to consider the topomesh as a 2-manifold complex

Returns

Return type

None

Note

The PropertyTopomesh passed as argument is updated.

Warning

The PropertyTopomesh must be a triangular topomesh (cellcomplex.property_topomesh.analysis.is_triangular())

cellcomplex.property_topomesh.topological_operations.topomesh_flip_edge(topomesh, eid, verbose=False, debug=False, loglevel=0)[source]

Perform an edge flip operation on a triangular PropertyTopomesh

The edge flip operation changes the vertices of a mesh edge to the two opposite vertices of its adjacent triangles. Thel local topological configuration has to be valid for the operation to be performed.

>>>  •---•       •---•
>>>  |\  |       |  /|
>>>  | \ |  -->  | / |
>>>  |  \|       |/  |
>>>  •---•       •---•
Parameters
  • topomesh (cellcomplex.property_topomesh.PropertyTopomesh) – The structure on which to perform the operation

  • eid (unsigned int) – The ID of the edge element to flip

Returns

Return type

None

Note

The PropertyTopomesh passed as argument is updated.

Warning

The PropertyTopomesh must be a triangular topomesh (cellcomplex.property_topomesh.analysis.is_triangular())

cellcomplex.property_topomesh.topological_operations.topomesh_remove_boundary_vertex(topomesh, pid, verbose=False, debug=False, loglevel=0)[source]
cellcomplex.property_topomesh.topological_operations.topomesh_remove_interface_edge(topomesh, eid, verbose=False, debug=False, loglevel=0)[source]
cellcomplex.property_topomesh.topological_operations.topomesh_remove_interface_vertex(topomesh, pid, verbose=False, debug=False, loglevel=0)[source]
cellcomplex.property_topomesh.topological_operations.topomesh_remove_vertex(topomesh, pid, kept_fid=None, triangulate=True, verbose=False, debug=False, loglevel=0)[source]
cellcomplex.property_topomesh.topological_operations.topomesh_split_edge(topomesh, eid, split_adjacent_faces=True, verbose=False, debug=False, loglevel=0)[source]

Perform an edge split operation on a PropertyTopomesh

The edge split operation creates a new vertex in the middle of the splitted edge, and creates two new edges to link the middle vertex to the opposite vertices of the adjacent triangles. If the adjacent faces are not splitted, the mesh is no longer triangular. On the other hand, if the mesh is polygonal the splitting of the faces is not unique.

>>>  •---•       •---•
>>>  |\  |       |\ /|
>>>  | \ |  -->  | • |
>>>  |  \|       |/ \|
>>>  •---•       •---•
Parameters
  • topomesh (cellcomplex.property_topomesh.PropertyTopomesh) – The structure on which to perform the operation

  • eid (unsigned int) – The ID of the edge element to split

  • split_adjacent_faces (bool) – Whether to split the adjacent face elements

Returns

Return type

None

Note

The PropertyTopomesh passed as argument is updated.

Warning

If the PropertyTopomesh must is a triangular topomesh the split_adjacent_faces argument should be True

cellcomplex.property_topomesh.topological_operations.topomesh_split_triangle(topomesh, fid, verbose=False, debug=False, loglevel=0)[source]
cellcomplex.property_topomesh.topological_operations.topomesh_split_vertex(topomesh, pid, new_pid=None, splitting_axis=None, splitting_distance=None)[source]

Perform an vertex split operation on a triangular PropertyTopomesh

The vertex split operation replaces a mesh vertex by a pair of vertices linked by an edge, and creates the necessary higher degree elements to ensure to topological consistency of the complex. The split occurs in a given direction, with a given distance, that can both be estimated automatically given the local configuration of the mesh.

>>>  •-----•-----•           •-----•-----•
>>>  | \   |   / |           |\   / \   /|
>>>  |   \ | /   |           | \ /   \ / |
>>>  •-----•-----•    -->    •--•-----•--•
>>>  |   / | \   |           | / \   / \ |
>>>  | /   |   \ |           |/   \ /   \|
>>>  •-----•-----•           •-----•-----•
Parameters
  • topomesh (cellcomplex.property_topomesh.PropertyTopomesh) – The structure on which to perform the operation

  • pid (unsigned int) – The ID of the vertex element to split

  • new_pid (unsigned int, optional) – The ID of the new vertex inserted by the split

  • splitting_axis (numpy.ndarray, optional) – The 3D direction in which to perform the split

  • splitting_distance (:float, optional) – The length of the edge element resulting from the split

Returns

Return type

None

Note

The PropertyTopomesh passed as argument is updated.

Warning

The PropertyTopomesh must be a triangular topomesh (cellcomplex.property_topomesh.analysis.is_triangular())