VolMesh
- class compas.datastructures.VolMesh[source]
Bases:
Datastructure
Geometric implementation of a face data structure for volumetric meshes.
- Parameters:
- default_vertex_attributesdict, optional
Default values for vertex attributes.
- default_edge_attributesdict, optional
Default values for edge attributes.
- default_face_attributesdict, optional
Default values for face attributes.
- default_cell_attributesdict, optional
Default values for cell attributes.
- namestr, optional
The name of the volmesh.
- **kwargsdict, optional
Additional keyword arguments, which are stored in the attributes dict.
- Attributes:
- default_vertex_attributesdict[str, Any]
Default attributes of the vertices.
- default_edge_attributesdict[str, Any]
Default values for edge attributes.
- default_face_attributesdict[str, Any]
Default values for face attributes.
- default_cell_attributesdict[str, Any]
Default values for cell attributes.
Methods
Constructors
Construct an object of this type from a JSON file. |
|
Construct a volmesh object from the data described in an OBJ file. |
|
Construct a volmesh object from vertices and cells. |
Conversions
Construct a mesh object from from a cell of a volmesh. |
|
Return the vertices and faces of a cell. |
|
Convert an object to its native data representation and save it to a JSON file. |
|
Write the volmesh to an OBJ file. |
|
Return the vertices and cells of a volmesh. |
Builders and Modifiers
Add a cell to the volmesh object. |
|
Add a face to the volmesh object. |
|
Add a vertex to the volmesh object. |
|
Delete a cell from the volmesh. |
|
Delete a vertex from the volmesh and everything that is attached to it. |
|
Remove all unused vertices from the volmesh object. |
Accessors
Get the identifiers of a set of random cells. |
|
Iterate over the cells of the volmesh. |
|
Find the cells on the boundary. |
|
Get cells for which a certain condition or set of conditions is true. |
|
Get cells for which a certain condition or set of conditions is true using a lambda function. |
|
Get the identifiers of a set of random edges. |
|
Iterate over the edges of the volmesh. |
|
Get edges for which a certain condition or set of conditions is true. |
|
Get edges for which a certain condition or set of conditions is true using a lambda function. |
|
Get the identifiers of a set of random faces. |
|
"Iterate over the halffaces of the volmesh and yield faces. |
|
Get faces for which a certain condition or set of conditions is true. |
|
Get faces for which a certain condition or set of conditions is true using a lambda function. |
|
Iterate over the halffaces of the volmesh. |
|
Find the faces on the boundary. |
|
Get the identifiers of a set of random vertices. |
|
Iterate over the vertices of the volmesh. |
|
Find the vertices on the boundary. |
|
Get vertices for which a certain condition or set of conditions is true. |
|
Get vertices for which a certain condition or set of conditions is true using a lambda function. |
Attributes
Get or set an attribute of a cell. |
|
Get or set multiple attributes of a cell. |
|
Get or set an attribute of multiple cells. |
|
Get or set multiple attributes of multiple cells. |
|
Get or set an attribute of an edge. |
|
Get or set multiple attributes of an edge. |
|
Get or set an attribute of multiple edges. |
|
Get or set multiple attributes of multiple edges. |
|
Get or set an attribute of a face. |
|
Get or set multiple attributes of a face. |
|
Get or set an attribute of multiple faces. |
|
Get or set multiple attributes of multiple faces. |
|
Get or set an attribute of a vertex. |
|
Get or set multiple attributes of a vertex. |
|
Get or set an attribute of multiple vertices. |
|
Get or set multiple attributes of multiple vertices. |
|
Update the default cell attributes. |
|
Update the default edge attributes. |
|
Update the default face attributes. |
|
Update the default vertex attributes. |
|
Unset the attribute of a cell. |
|
Unset the attribute of an edge. |
|
Unset the attribute of a face. |
|
Unset the attribute of a vertex. |
Topology
Return all edges of a cell. |
|
Find the faces adjacent to a given face of a cell. |
|
The faces of a cell. |
|
Find the face corresponding to a specific halfedge of a cell. |
|
Find the opposite face corresponding to a specific halfedge of a cell. |
|
The halfedges of a cell. |
|
Find the neighbors of a given cell. |
|
Ordered faces connected to a vertex of a cell. |
|
Ordered vertex neighbors of a vertex of a cell. |
|
The vertices of a cell. |
|
Ordered cells around edge (u, v). |
|
Ordered halffaces around edge (u, v). |
|
The cell to which the halfface belongs to. |
|
The halfedges of a halfface. |
|
Return the halfface neighbors of a halfface that are on the same manifold. |
|
Return the halfface neighborhood of a halfface across their edges. |
|
The cell to which the opposite halfface belongs to. |
|
The opposite face of a face. |
|
Return the vertex before the specified vertex in a specific face. |
|
Return the vertex after the specified vertex in a specific face. |
|
The vertices of a halfface. |
|
Verify that the volmesh contains a directed edge (u, v). |
|
Verify that a face is part of the volmesh. |
|
Verify that a vertex is in the volmesh. |
|
Verify that a cell is on the boundary. |
|
Verify that an edge is on the boundary. |
|
Verify that a face is on the boundary. |
|
Verify that the volmesh is valid. |
|
Verify that a vertex is on a boundary. |
|
Count the number of faces in the volmesh. |
|
Count the number of edges in the volmesh. |
|
Count the number of faces in the volmesh. |
|
Count the number of vertices in the volmesh. |
|
Return all cells connected to a vertex. |
|
Count the neighbors of a vertex. |
|
Return all halffaces connected to a vertex. |
|
Compute the maximum degree of all vertices. |
|
Compute the minimum degree of all vertices. |
|
Return the vertex neighbors of a vertex. |
|
Return the vertices in the neighborhood of a vertex. |
Geometry
Compute the point at the center of mass of a cell. |
|
Compute the point at the centroid of a cell. |
|
Compute the points of the vertices of a cell. |
|
Construct a polyhedron from the vertices and faces of a cell. |
|
Return the normal vector at the vertex of a boundary cell as the weighted average of the normals of the neighboring faces. |
|
Return the direction vector of an edge. |
|
Return the end point of an edge. |
|
Return the length of an edge. |
|
Return the line representation of an edge. |
|
Return the vector of an edge. |
|
Return the start point of an edge. |
|
Compute the oriented area of a face. |
|
Compute the point at the center of mass of a face. |
|
Compute the point at the centroid of a face. |
|
Compute the coordinates of the vertices of a face. |
|
Compute the oriented normal of a face. |
|
Compute the points of the vertices of a face. |
|
Compute the polygon of a face. |
|
Return the coordinates of a vertex. |
|
Return the point representation of a vertex. |
Paths
Matrices
Mappings
Returns a dictionary that maps geometric keys of a certain precision to the keys of the corresponding vertices. |
|
Returns a dictionary that maps the indices of a vertex list to keys in the vertex dictionary. |
|
Returns a dictionary that maps vertex dictionary keys to the corresponding geometric key up to a certain precision. |
|
Returns a dictionary that maps vertex dictionary keys to the corresponding index in a vertex list or array. |
Utilities
Clear all the volmesh data. |
|
Make an independent copy of the data object. |