mesh_insert_vertex_on_edge
- compas.datastructures.mesh_insert_vertex_on_edge(mesh, u, v, vkey=None)[source]
Insert a vertex in the faces adjacent to an edge, between the two edge vertices.
If no vertex key is specified or if the key does not exist yet, a vertex is added and located at the edge midpoint. If the vertex key exists, the position is not modified.
- Parameters
u (hashable) – The first edge vertex.
v (hashable) – The second edge vertex.
vkey (hashable, optional) – The vertex key to insert. Default is add a new vertex at mid-edge.
- Returns
vkey (hashable) – The new vertex key.
Notes
For two faces adjacent to an edge (a, b) face_1 = [a, b, c] and face_2 = [b, a, d] applying mesh_insert_vertex_on_edge(mesh, a, b, e) yields the two new faces face_1 = [a, e, b, c] and face_2 = [b, e, a, d].
Examples
>>>