HalfEdge
- class compas.datastructures.HalfEdge(name=None, default_vertex_attributes=None, default_edge_attributes=None, default_face_attributes=None)[source]
Bases:
compas.datastructures.datastructure.Datastructure
Base half-edge data structure for representing the topology of open oor closed surface meshes.
- Parameters
name (str, optional) – The name of the graph. Defaults to “Graph”.
default_vertex_attributes (dict, optional) – Default values for vertex attributes.
default_edge_attributes (dict, optional) – Default values for edge attributes.
default_face_attributes (dict, optional) – Default values for face attributes.
- Attributes
attributes (dict) – Named attributes related to the data structure as a whole.
default_vertex_attributes (dict) – Named attributes and default values of the vertices of the data structure.
default_edge_attributes (dict) – Named attributes and default values of the edges of the data structure.
default_face_attributes (dict) – Named attributes and default values of the faces of the data structure.
name (str) – Name of the data structure. Defaults to the value of self.__class__.__name__.
data (dict) – The data representation of the data structure.
adjacency (dict) – Alias for self.halfedge.
Deprecated since version 0.17.0.
Attributes
DATASCHEMA
The schema of the data of this object.
JSONSCHEMANAME
adjacency
data
A data dict representing the mesh data structure for serialization.
name
The name of the data structure.
Inherited Attributes
JSONSCHEMA
The schema of the JSON representation of the data of this object.
dtype
The type of the object in the form of a '2-level' import and a class name.
guid
The globally unique identifier of the object.
jsondefinitions
Reusable schema definitions.
jsonstring
The representation of the object data in JSON format.
jsonvalidator
JSON schema validator for draft 7.
Methods
Add a face to the mesh object.
Add a vertex to the mesh object.
Clear all the mesh data.
Remove all unused vertices from the mesh object.
Delete a face from the mesh object.
Delete a vertex from the mesh and everything that is attached to it.
Get or set an attribute of an edge.
Get or set multiple attributes of an edge.
Find the two faces adjacent to an edge.
Find all edges on the same loop as a given edge.
A random sample of the edges.
Find all edges on the same strip as a given edge.
Iterate over the edges of the mesh.
Get or set an attribute of multiple edges.
Get or set multiple attributes of multiple edges.
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.
Calculate the Euler characteristic.
Find one half-edge over which two faces are adjacent.
Find all vertices over which two faces are adjacent.
Get or set an attribute of a face.
Get or set multiple attributes of a face.
Return triplets of face vertices forming the corners of the face.
Count the neighbors of a face.
The halfedges of a face.
Compute the maximum degree of all faces.
Compute the minimum degree of all faces.
Return the faces in the neighborhood of a face.
Return the neighbors of a face across its edges.
A random sample of the faces.
Return the n-th vertex after the specified vertex in a specific face.
Return the n-th vertex before the specified vertex in a specific face.
Return the n-th vertex before the specified vertex in a specific face.
Return the n-th vertex after the specified vertex in a specific face.
The vertices of a face.
Iterate over the faces of the mesh.
Get or set an attribute of multiple faces.
Get or set multiple attributes of multiple 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.
Calculate the genus.
Get the identifier of a random face.
Get the identifier of a random vertex of a specific face.
Get the identifier of a random vertex.
Get a list of identifiers of a random set of n vertices.
Find the face corresponding to a halfedge.
Find all edges on the same loop as the halfedge, in the direction of the halfedge.
Find all edges on the same strip as a given halfedge.
Verify that the mesh contains a specific edge.
Verify that a face is part of the mesh.
Verify that a halfedge is part of the mesh.
Verify that a vertex is in the mesh.
Returns a dictionary that maps the indices of a vertex list to keys in a vertex dictionary.
Returns a dictionary that maps the indices of a vertex list to keys in a vertex dictionary.
Verify that the mesh is closed.
Verify that an edge is on the boundary.
Verify that the mesh is empty.
Verify that a face is on a boundary.
Verify that the mesh is manifold.
Verify that the mesh is orientable.
Verify that the mesh consists of only quads.
Verify that the mesh is regular.
Verify that the mesh consists of only triangles.
Verify that the mesh is valid.
Verify that a vertex is connected.
Verify that a vertex is on a boundary.
Returns a dictionary that maps vertex dictionary keys to the corresponding index in a vertex list or array.
Count the number of edges in the mesh.
Count the number of faces in the mesh.
Count the number of vertices in the mesh.
Remove all unused vertices from the mesh object.
Print a summary of the mesh.
Unset the attribute of an edge.
Unset the attribute of a face.
Unset the attribute of a vertex.
Update the default edge attributes.
Update the default face attributes.
Update the default vertex attributes.
Get or set an attribute of a vertex.
Get or set multiple attributes of a vertex.
Count the neighbors of a vertex.
The faces connected to a vertex.
Returns a dictionary that maps vertex dictionary keys to the corresponding index in a vertex list or array.
Compute the maximum degree of all vertices.
Compute the minimum degree of all vertices.
Return the vertices in the neighborhood of a vertex.
Return the neighbors of a vertex.
A random sample of the vertices.
Iterate over the vertices of the mesh.
Get or set an attribute of multiple vertices.
Get or set multiple attributes of multiple vertices.
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.
Inherited Methods
Make an independent copy of the data object.
Construct an object of this type from the provided data.
Construct an object from serialized data contained in a JSON file.
Construct an object from serialized data contained in a JSON string.
Convert an object to its native data representation.
Serialize the data representation of an object to a JSON file.
Serialize the data representation of an object to a JSON string.
Validate the object's data against its data schema (self.DATASCHEMA).
Validate the object's data against its json schema (self.JSONSCHEMA).