TopologyDiagram

class compas_cem.diagrams.TopologyDiagram(*args, **kwargs)[source]

Bases: compas_cem.diagrams.diagram.Diagram

The very heart of life.

Parameters
  • *args (list) – Arguments.

  • **kwargs (dict) – Keyword arguments.

Returns

topology (compas_cem.diagrams.Topology) – A form diagram.

Methods

ToString()

Show object representation as string in Rhino/Grasshopper.

add_edge(edge)

Adds a deviation or a trail edge.

add_load(load)

Applies a load.

add_node(node)

Adds double

add_support(support)

Adds a support.

adjacency_matrix([rtype])

Creates a node adjacency matrix from a Network datastructure.

auxiliary_trail_edges([data])

Iterates over the keys of all trail edges in the auxiliary trails.

auxiliary_trails()

Iterate over all the available auxiliary trails in the topology diagram.

build_trails([auxiliary_trails])

Automatically generate the trails in the topology diagram.

clear()

Clear all the network data.

complement([cls])

Generate the complement network of a network.

connected_deviation_edges(node)

Finds the deviation edges connected to a node.

connected_edges(key)

Return the edges connected to a node.

connected_trail_edges(node)

Finds the trail edges connected to a node.

connectivity_matrix([rtype])

Creates a connectivity matrix from a Network datastructure.

copy([cls])

Make an independent copy of the data object.

count_crossings()

Count the number of crossings (pairs of crossing edges) in the network.

degree(key)

Return the number of neighbors of a node.

degree_in(key)

Return the numer of incoming neighbors of a node.

degree_matrix([rtype])

Creates a node degree matrix from a Network datastructure.

degree_out(key)

Return the number of outgoing neighbors of a node.

delete_edge(u, v)

Delete an edge from the network.

delete_node(key)

Delete a node from the graph.

deviation_edges([data])

Iterates over the keys of all deviation edges.

edge_attribute(key, name[, value])

Get or set an attribute of an edge.

edge_attributes(key[, names, values])

Get or set multiple attributes of an edge.

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_force(edge)

Gets the force value at an edge.

edge_length(u, v)

Return the length of an edge.

edge_length_2(edge)

Gets the length of an edge.

edge_midpoint(u, v)

Return the location of the midpoint of an edge.

edge_point(u, v[, t])

Return the location of a point along an edge.

edge_sequence(edge)

Gets the sequence of the nodes of a given edge.

edge_vector(u, v)

Return the vector of an edge.

edges([data])

Iterate over the edges of the network.

edges_attribute(name[, value, keys])

Get or set an attribute of multiple edges.

edges_attributes([names, values, keys])

Get or set multiple attributes of multiple edges.

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.

embed_in_plane([fixed, straightline])

Embed the network in the plane.

find_crossings()

Identify all pairs of crossing edges in a network.

find_cycles([breakpoints])

Find the faces of a network.

from_data(data)

Construct an object of this type from the provided data.

from_edges(edges)

from_json(filepath)

Construct an object from serialized data contained in a JSON file.

from_jsonstring(string)

Construct an object from serialized data contained in a JSON string.

from_lines(lines[, precision])

Construct a network from a set of lines represented by their start and end point coordinates.

from_networkx(graph)

Create a new graph instance from a NetworkX DiGraph instance.

from_nodes_and_edges(nodes, edges)

Construct a network from nodes and edges.

from_obj(filepath[, precision])

Construct a network from the data contained in an OBJ file.

get_any_edge()

Get the identifier of a random edge.

get_any_edges(n)

Get the identifiers of a set of random edges.

get_any_node()

Get the identifier of a random node.

get_any_nodes(n[, exclude_leaves])

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

gkey(xyz)

Gets

gkey_key([precision])

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

has_edge(u, v[, directed])

Verify if the network contains a specific edge.

has_node(key)

Verify if a specific node is present in the network.

index_key()

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

index_uv()

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

is_auxiliary_trail_edge(edge)

Tests whether or not an edge is the edge of an auxiliary trail.

is_connected()

Verify that the network is connected.

is_crossed()

Verify if a network has crossing edges.

is_deviation_edge(edge)

Tests whether or not an edge is a deviation edge.

is_leaf(key)

Verify if a node is a leaf.

is_node_connected(key)

Verify if a specific node is connected.

is_node_loaded(node[, min_force])

Checks if there is a large-enough load applied to a node.

is_node_origin(node)

Checks if a node is an origin node.

is_node_support(node)

Checks if a node is a support.

is_planar()

Check if the network is planar.

is_planar_embedding()

Verify that a network is embedded in the plane without crossing edges.

is_trail_edge(edge)

Tests whether or not an edge is a trail edge.

is_xy()

Verify that a network lies in the XY plane.

key_gkey([precision])

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

key_index()

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

laplacian_matrix([normalize, rtype])

Construct a Laplacian matrix from a Network datastructure.

leaves()

Return all leaves of the network.

loaded_nodes([min_force])

Iterates over all the nodes with a large-enough load applied.

neighborhood(key[, ring])

Return the nodes in the neighborhood of a node.

neighbors(key)

Return the neighbors of a node.

neighbors_in(key)

Return the incoming neighbors of a node.

neighbors_out(key)

Return the outgoing neighbors of a node.

network_adjacency_matrix([rtype])

Creates a node adjacency matrix from a Network datastructure.

network_connectivity_matrix([rtype])

Creates a connectivity matrix from a Network datastructure.

network_degree_matrix([rtype])

Creates a node degree matrix from a Network datastructure.

network_embed_in_plane([fixed, straightline])

Embed the network in the plane.

network_is_planar()

Check if the network is planar.

network_is_planar_embedding()

Verify that a network is embedded in the plane without crossing edges.

network_laplacian_matrix([normalize, rtype])

Construct a Laplacian matrix from a Network datastructure.

node_attribute(key, name[, value])

Get or set an attribute of a node.

node_attributes(key[, names, values])

Get or set multiple attributes of a node.

node_coordinates(key[, axes])

Return the coordinates of a node.

node_exists(value)

Checks

node_gkey([precision])

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

node_key(value)

Gets

node_laplacian(key)

Return the vector from the node to the centroid of its 1-ring neighborhood.

node_load(node)

Gets the load applied at a node.

node_neighborhood_centroid(key)

Compute the centroid of the neighboring nodes.

node_sequence(node)

Gets the sequence a node is assigned to.

node_xyz(key[, xyz])

Gets or sets node coordinates.

nodes([data])

Iterate over the nodes of the network.

nodes_attribute(name[, value, keys])

Get or set an attribute of multiple nodes.

nodes_attributes([names, values, keys])

Get or set multiple attributes of multiple nodes.

nodes_where(conditions[, data])

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

nodes_where_predicate(predicate[, data])

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

number_of_auxiliary_trails()

Number of auxiliary trails in the topology diagram.

number_of_deviation_edges()

Number of deviation edges in the topology diagram.

number_of_edges()

Compute the number of edges of the network.

number_of_loaded_nodes()

Number of nodes in the topology diagram where a load is applied.

number_of_nodes()

Compute the number of nodes of the network.

number_of_support_nodes()

Number of nodes in the topology diagram with an assigned support.

number_of_trail_edges()

Number of trail edges in the topology diagram.

number_of_trails()

Number of trails in the topology diagram.

origin_nodes()

Starting nodes of all trails.

reaction_force(node)

Gets the reaction force vector at a node support.

sequence_max()

The largest sequence number.

sequences()

Iterate over the sequences in the diagram.

shortest_path(start, end)

Find the shortest path between two nodes of the network.

smooth([fixed, kmax, damping, callback, ...])

Smooth a network by moving every free node to the centroid of its neighbors.

split_edge(u, v[, t])

Split and edge by inserting a node along its length.

summary()

Print a summary of the graph.

support_nodes()

Nodes where a support has been assigned.

to_data()

Convert an object to its native data representation.

to_json(filepath[, pretty])

Serialize the data representation of an object to a JSON file.

to_jsonstring([pretty])

Serialize the data representation of an object to a JSON string.

to_lines()

Return the lines of the network as pairs of start and end point coordinates.

to_networkx()

Create a new NetworkX graph instance from a graph.

to_nodes_and_edges()

Return the nodes and edges of a network.

to_obj()

Write the network to an OBJ file.

to_points()

Return the coordinates of the network.

trail_edges([data])

Iterates over the keys of all trail edges.

trails()

Iterate over all the existing trails in the topology diagram.

transform(transformation)

Transform a network.

transformed(transformation)

Transform a copy of network.

unset_edge_attribute(key, name)

Unset the attribute of an edge.

unset_node_attribute(key, name)

Unset the attribute of a node.

update_dea([attr_dict])

Update the default edge attributes.

update_default_edge_attributes([attr_dict])

Update the default edge attributes.

update_default_node_attributes([attr_dict])

Update the default node attributes.

update_dna([attr_dict])

Update the default node attributes.

update_node_xyz(key, xyz)

Modifies

uv_index()

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

validate_data()

Validate the object's data against its data schema (self.DATASCHEMA).

validate_json()

Validate the object's data against its json schema (self.JSONSCHEMA).