compas_3gs.diagrams.EGI

class compas_3gs.diagrams.EGI[source]

Bases: compas_3gs.datastructures.mesh3gs.Mesh3gs

An EGI, represented as a mesh object.

An EGI is a topological (mesh) dual of a cell of a volmesh, with all of its elements represented on a unit sphere.

__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__()

Initialize self.

add_edge(u, v[, attr_dict])

add_face(vertices[, fkey, attr_dict])

Add a face to the mesh object.

add_vertex([key, attr_dict])

Add a vertex to the mesh object.

area()

Calculate the total mesh area.

boundaries()

Collect the mesh boundaries as lists of vertices.

centroid()

Calculate the mesh centroid.

clear(**kwattr)

Clear all the mesh data.

clear_facedict()

Clear only the faces.

clear_halfedgedict()

Clear only the half edges.

clear_vertexdict()

Clear only the vertices.

copy()

Make an independent copy of the mesh object.

cull_edges()

Remove all unused edges from the mesh object.

cull_vertices()

Remove all unused vertices from the mesh object.

datastructure_centroid()

Compute the centroid of the datastructure.

delete_face(fkey)

Delete a face from the mesh object.

delete_vertex(key)

Delete a vertex from the mesh and everything that is attached to it.

draw(**kwattr)

draw_edgelabels(**kwattr)

draw_edges(**kwattr)

draw_facelabels(**kwattr)

draw_faces(**kwattr)

draw_vertexlabels(**kwattr)

draw_vertices(**kwattr)

dump(filepath)

Dump the data representing the mesh to a file using Python’s built-in object serialisation.

dumps()

Dump the data representing the mesh to a string using Python’s built-in object serialisation.

edge_coordinates(u, v[, axes])

Return the coordinates of the start and end point of an edge.

edge_direction(u, v)

Return the direction vector of an edge.

edge_faces(u, v)

Find the two faces adjacent to an edge.

edge_label_name(u, v)

Get the name of an edge label.

edge_length(u, v)

Return the length of an edge.

edge_midpoint(u, v)

Return the location of the midpoint of an edge.

edge_name(u, v)

Get the name of an edge.

edge_point(u, v[, t])

Return the location of a point along an edge.

edge_vector(u, v)

Return the vector of an edge.

edges([data])

Iterate over the edges of the mesh.

edges_on_boundary([oriented])

Find the edges on the boundary.

edges_where(conditions[, data])

Get edges for which a certain condition or set of conditions is true.

edges_where_predicate(predicate[, data])

Get edges for which a certain condition or set of conditions is true using a lambda function.

euler()

Calculate the Euler characterisic.

face_adjacency_halfedge(f1, f2)

Find one half-edge over which two faces are adjacent.

face_adjacency_vertices(f1, f2)

Find all vertices over which two faces are adjacent.

face_area(fkey)

Compute the area of a face.

face_aspect_ratio(fkey)

Face aspect ratio as the ratio between the lengths of the maximum and minimum face edges.

face_center(fkey)

Compute the location of the center of mass of a face.

face_centroid(fkey)

Compute the location of the centroid of a face.

face_coordinates(fkey[, axes])

Compute the coordinates of the vertices of a face.

face_corners(fkey)

Return triplets of face vertices forming the corners of the face.

face_curvature(fkey)

Dimensionless face curvature as the maximum face vertex deviation from the best-fit plane of the face vertices divided by the average lengths of the face vertices to the face centroid.

face_degree(fkey)

Count the neighbors of a face.

face_flatness(fkey)

Compute the flatness of the mesh face.

face_halfedges(fkey)

The halfedges of a face.

face_label_name(fkey)

Get the name of a face label.

face_max_degree()

Compute the maximum degree of all faces.

face_min_degree()

Compute the minimum degree of all faces.

face_name(fkey)

Get the name of a face.

face_neighbors(fkey)

Return the neighbors of a face across its edges.

face_normal(fkey[, unitized])

Compute the normal of a face.

face_skewness(fkey)

Face skewness as the maximum absolute angular deviation from the ideal polygon angle.

face_vertex_ancestor(fkey, key)

Return the vertex before the specified vertex in a specific face.

face_vertex_descendant(fkey, key)

Return the vertex after the specified vertex in a specific face.

face_vertices(fkey)

The vertices of a face.

faces([data])

Iterate over the faces of the mesh.

faces_on_boundary()

Find the faces on the boundary.

faces_where(conditions[, data])

Get faces for which a certain condition or set of conditions is true.

faces_where_predicate(predicate[, data])

Get faces for which a certain condition or set of conditions is true using a lambda function.

from_data(data)

Construct a datastructure from structured data.

from_json(filepath)

Construct a datastructure from structured data contained in a json file.

from_lines(lines[, delete_boundary_face, …])

Construct a mesh object from a list of lines described by start and end point coordinates.

from_obj(filepath[, precision])

Construct a mesh object from the data described in an OBJ file.

from_off(filepath)

Construct a mesh object from the data described in a STL file.

from_pickle(filepath)

Construct a datastructure from serialised data contained in a pickle file.

from_ply(filepath)

Construct a mesh object from the data described in a PLY file.

from_points(points[, boundary, holes])

Construct a mesh from a delaunay triangulation of a set of points.

from_polygons(polygons[, precision])

Construct a mesh from a series of polygons.

from_polyhedron(f)

Construct a mesh from a platonic solid.

from_stl(filepath)

Construct a mesh object from the data described in a STL file.

from_vertices_and_faces(vertices, faces)

Construct a mesh object from a list of vertices and faces.

from_volmesh_cell(ckey, volmesh)

genus()

Calculate the genus.

get_any_edge()

Get the identifier of a random edge.

get_any_face()

Get the identifier of a random face.

get_any_face_vertex(fkey)

Get the identifier of a random vertex of a specific face.

get_any_vertex()

Get the identifier of a random vertex.

get_any_vertices(n[, exclude_leaves])

Get a list of identifiers of a random set of n vertices.

get_edge_attribute(key, name[, value])

Get the value of a named attribute of one edge.

get_edge_attributes(key, names[, values])

Get the value of a named attribute of one edge.

get_edges_attribute(name[, value, keys])

Get the value of a named attribute of multiple edges.

get_edges_attributes(names[, values, keys])

Get the values of multiple named attribute of multiple edges.

get_face_attribute(key, name[, value])

Get the value of a named attribute of one face.

get_face_attributes(key, names[, values])

Get the value of a named attribute of one face.

get_faces_attribute(keys, name[, value])

Get the value of a named attribute of multiple faces.

get_faces_attributes(keys, names[, values])

Get the values of multiple named attribute of multiple faces.

get_vertex_attribute(key, name[, value])

Get the value of a named attribute of one vertex.

get_vertex_attributes(key, names[, values])

Get the value of a named attribute of one vertex.

get_vertices_attribute(name[, value, keys])

Get the value of a named attribute of multiple vertices.

get_vertices_attributes(names[, values, keys])

Get the values of multiple named attribute of multiple vertices.

gkey_key([precision])

Returns a dictionary that maps geometric keys of a certain precision to the keys of the corresponding vertices.

has_edge(u, v[, directed])

Verify that the mesh contains a specific edge.

has_vertex(key)

Verify that a vertex is in the mesh.

index_key()

Returns a dictionary that maps the indices of a vertex list to keys in a vertex dictionary.

index_uv()

Returns a dictionary that maps edges in a list to the corresponding vertex key pairs.

insert_vertex(fkey[, key, xyz, return_fkeys])

Insert a vertex in the specified face.

is_edge_on_boundary(u, v)

Verify that an edge is on the boundary.

is_empty()

Boolean whether the mesh is empty.

is_face_on_boundary(key)

Verify that a face is on a boundary.

is_manifold()

Verify that the mesh is manifold.

is_orientable()

Verify that the mesh is orientable.

is_quadmesh()

Verify that the mesh consists of only quads.

is_regular()

Verify that the mesh is regular.

is_trimesh()

Verify that the mesh consists of only triangles.

is_valid()

Verify that the mesh is valid.

is_vertex_connected(key)

Verify that a vertex is connected.

is_vertex_on_boundary(key)

Verify that a vertex is on a boundary.

key_gkey([precision])

Returns a dictionary that maps vertex dictionary keys to the corresponding geometric key up to a certain precision.

key_index()

Returns a dictionary that maps vertex dictionary keys to the corresponding index in a vertex list or array.

leaves()

load(filepath)

Load serialised mesh data from a pickle file.

loads(s)

Load serialised mesh data from a pickle string.

mesh_split_face(fkey, u, v)

Split a face by inserting an edge between two specified vertices.

normal()

Calculate the average mesh normal.

number_of_edges()

Count the number of edges in the mesh.

number_of_faces()

Count the number of faces in the mesh.

number_of_vertices()

Count the number of vertices in the mesh.

plot([vertexcolor, edgecolor, facecolor, …])

Plot a 2D representation of the mesh.

set_edge_attribute(key, name, value)

Set one attribute of one edge.

set_edge_attributes(key, names, values)

Set multiple attributes of one edge.

set_edges_attribute(name, value[, keys])

Set one attribute of multiple edges.

set_edges_attributes(names, values[, keys])

Set multiple attributes of multiple edges.

set_face_attribute(key, name, value)

Set one attribute of one face.

set_face_attributes(key, names, values)

Set multiple attributes of one face.

set_faces_attribute(keys, name, value)

Set one attribute of multiple faces.

set_faces_attributes(keys, names, values)

Set multiple attributes of multiple faces.

set_vertex_attribute(key, name, value)

Set one attribute of one vertex.

set_vertex_attributes(key, names, values)

Set multiple attributes of one vertex.

set_vertices_attribute(name, value[, keys])

Set one attribute of multiple vertices.

set_vertices_attributes(names, values[, keys])

Set multiple attributes of multiple vertices.

summary()

Print a summary of the mesh.

to_data()

Returns a dictionary of structured data representing the data structure.

to_json(filepath[, pretty])

Serialise the structured data representing the data structure to json.

to_obj(filepath)

Write the mesh to an OBJ file.

to_pickle(filepath)

Serialised the structured data representing the data structure to a pickle file.

to_vertices_and_faces()

Return the vertices and faces of a mesh.

update_default_edge_attributes([attr_dict])

Update the default edge attributes (this also affects already existing edges).

update_default_face_attributes([attr_dict])

Update the default face attributes (this also affects already existing faces).

update_default_vertex_attributes([attr_dict])

Update the default vertex attributes (this also affects already existing vertices).

uv_index()

Returns a dictionary that maps edge keys (i.e.

vertex_area(key)

Compute the tributary area of a vertex.

vertex_coordinates(key[, axes])

Return the coordinates of a vertex.

vertex_curvature(vkey)

Dimensionless vertex curvature.

vertex_degree(key)

Count the neighbors of a vertex.

vertex_faces(key[, ordered, include_none])

The faces connected to a vertex.

vertex_label_name(key)

Get the name of a vertex label.

vertex_laplacian(key)

Compute the vector from a vertex to the centroid of its neighbors.

vertex_max_degree()

Compute the maximum degree of all vertices.

vertex_min_degree()

Compute the minimum degree of all vertices.

vertex_name(key)

Get the name of a vertex.

vertex_neighborhood(key[, ring])

Return the vertices in the neighborhood of a vertex.

vertex_neighborhood_centroid(key)

Compute the centroid of the neighbors of a vertex.

vertex_neighbors(key[, ordered])

Return the neighbors of a vertex.

vertex_normal(key)

Return the normal vector at the vertex as the weighted average of the normals of the neighboring faces.

vertex_update_xyz(vkey, xyz[, constrained])

vertices([data])

Iterate over the vertices of the mesh.

vertices_on_boundaries()

Find the vertices on all boundaries of the mesh.

vertices_on_boundary([ordered])

Find the vertices on the boundary.

vertices_where(conditions[, data])

Get vertices for which a certain condition or set of conditions is true.

vertices_where_predicate(predicate[, data])

Get vertices for which a certain condition or set of conditions is true using a lambda function.

Attributes

adjacency

data

dict – A data dict representing the mesh data structure for serialisation.

name

str – The name of the data structure.