TopologyDiagram

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

Bases: Diagram, MeshMixins

The very heart of life.

Parameters:
  • *args (list) – Arguments.

  • **kwargs (dict) – Keyword arguments.

Returns:

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

Methods

add_load

Applies a load.

add_support

Adds a support.

auxiliary_trail_edges

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

Automatically generate the trails in the topology diagram.

connected_deviation_edges

Finds the deviation edges connected to a node.

connected_trail_edges

Finds the trail edges connected to a node.

deviation_edges

Iterates over the keys of all the deviation edges in the diagram.

direct_deviation_edges

Iterates over the keys of all the direct deviation edges in the diagram.

edge_sequence

Gets the sequence of the nodes of a given edge.

has_trails

Check if the topology diagram has trails.

indirect_deviation_edges

Iterates over the keys of all indirect deviation edges in the diagram.

is_auxiliary_trail_edge

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

is_deviation_edge

Tests whether or not an edge is a deviation edge.

is_direct_deviation_edge

Tests if a deviation edge is direct.

is_indirect_deviation_edge

Tests if a deviation edge is indirect.

is_node_origin

Checks if a node is an origin node.

is_node_support

Tests if a node is a support node.

is_trail_edge

Tests whether or not an edge is a trail edge.

node_sequence

Gets the sequence a node is assigned to.

number_of_auxiliary_trails

The number of auxiliary trails in the topology diagram.

number_of_deviation_edges

The number of deviation edges in the topology diagram.

number_of_direct_deviation_edges

The number of direct deviation edges in the topology diagram.

number_of_indirect_deviation_edges

The number of direct deviation edges in the topology diagram.

number_of_sequences

The number of sequences in the topology diagram.

number_of_trail_edges

The number of trail edges in the topology diagram.

number_of_trails

The number of trails in the topology diagram.

origin_nodes

Starting nodes of all trails.

sequence_last

The key of the last sequence in the topology diagram.

sequences

Iterate over all the sequences in the topology diagram in ascending order.

shift_trail

Shift all the nodes in a trail to start at a given sequence.

trail

Gets the keys of the nodes in a trail.

trail_edges

Iterates over the keys of all the trail edges in the diagram.

trail_sequences

Create a mapping between topological sequences and the nodes in a trail.

trails

Iterate over all the existing trails in the topology diagram.

trails_sequences

Creates a mapping of mappings between the nodes of the trails and the sequences.

Inherited Methods

ToString

Converts the instance to a string.

add_edge

Adds a deviation or a trail edge.

add_node

Adds double

adjacency_matrix

Creates a node adjacency matrix from a Network datastructure.

clear

Clear all the network data.

complement

Generate the complement network of a network.

connected_edges

Return the edges connected to a node.

connectivity_matrix

Creates a connectivity matrix from a Network datastructure.

copy

Make an independent copy of the data object.

count_crossings

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

degree

Return the number of neighbors of a node.

degree_in

Return the numer of incoming neighbors of a node.

degree_matrix

Creates a node degree matrix from a Network datastructure.

degree_out

Return the number of outgoing neighbors of a node.

delete_edge

Delete an edge from the network.

delete_node

Delete a node from the graph.

edge_attribute

Get or set an attribute of an edge.

edge_attributes

Get or set multiple attributes of an edge.

edge_coordinates

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

edge_direction

Return the direction vector of an edge.

edge_force

Gets the force value at an edge.

edge_length

Return the length of an edge.

edge_length_2

Gets the length of an edge.

edge_midpoint

Return the location of the midpoint of an edge.

edge_plane

Gets the projection plane at an edge.

edge_point

Return the location of a point along an edge.

edge_sample

Get the identifiers of a set of random edges.

edge_vector

Return the vector of an edge.

edges

Iterate over the edges of the network.

edges_attribute

Get or set an attribute of multiple edges.

edges_attributes

Get or set multiple attributes of multiple edges.

edges_where

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

edges_where_predicate

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

embed_in_plane

Embed the network in the plane.

find_crossings

Identify all pairs of crossing edges in a network.

find_cycles

Find the faces of a network.

from_data

Construct an object of this type from the provided data.

from_dualquadmesh

Generate a topology diagram from the dual of a quad mesh.

from_edges

Create a new graph instance from information about the edges.

from_json

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

from_jsonstring

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

from_lines

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

from_networkx

Create a new graph instance from a NetworkX DiGraph instance.

from_nodes_and_edges

Construct a network from nodes and edges.

from_obj

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

from_pointcloud

Construct a network from random connections between the points of a pointcloud.

get_any_edge

Get the identifier of a random edge.

get_any_edges

Get the identifiers of a set of random edges.

get_any_node

Get the identifier of a random node.

get_any_nodes

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

gkey

Gets

gkey_key

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

has_edge

Verify if the network contains a specific edge.

has_node

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_connected

Verify that the network is connected.

is_crossed

Verify if a network has crossing edges.

is_edge_supported

Checks if any of the nodes of an edge is a support.

is_leaf

Verify if a node is a leaf.

is_node_connected

Verify if a specific node is connected.

is_node_loaded

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

is_planar

Check if the network is planar.

is_planar_embedding

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

is_xy

Verify that a network lies in the XY plane.

key_gkey

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 identifiers to their corresponding index in a node list or array.

laplacian_matrix

Construct a Laplacian matrix from a Network datastructure.

leaves

Return all leaves of the network.

loaded_nodes

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

neighborhood

Return the nodes in the neighborhood of a node.

neighbors

Return the neighbors of a node.

neighbors_in

Return the incoming neighbors of a node.

neighbors_out

Return the outgoing neighbors of a node.

network_adjacency_matrix

Creates a node adjacency matrix from a Network datastructure.

network_connectivity_matrix

Creates a connectivity matrix from a Network datastructure.

network_degree_matrix

Creates a node degree matrix from a Network datastructure.

network_embed_in_plane

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

Construct a Laplacian matrix from a Network datastructure.

node_attribute

Get or set an attribute of a node.

node_attributes

Get or set multiple attributes of a node.

node_coordinates

Return the coordinates of a node.

node_exists

Checks

node_gkey

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

node_key

Gets

node_laplacian

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

node_load

Gets the load applied at a node.

node_neighborhood_centroid

Compute the centroid of the neighboring nodes.

node_sample

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

node_xyz

Gets or sets node coordinates.

nodes

Iterate over the nodes of the network.

nodes_attribute

Get or set an attribute of multiple nodes.

nodes_attributes

Get or set multiple attributes of multiple nodes.

nodes_where

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

nodes_where_predicate

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

number_of_edges

Compute the number of edges of the graph.

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 graph.

number_of_support_nodes

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

reaction_force

Gets the reaction force vector at a node.

sha256

Compute a hash of the data for comparison during version control using the sha256 algorithm.

shortest_path

Find the shortest path between two nodes of the network.

smooth

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

split_edge

Split and edge by inserting a node along its length.

summary

Return 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

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

to_jsonstring

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.

transform

Transform a network.

transformed

Return a transformed copy of the network.

unset_edge_attribute

Unset the attribute of an edge.

unset_node_attribute

Unset the attribute of a node.

update_dea

Update the default edge attributes.

update_default_edge_attributes

Update the default edge attributes.

update_default_node_attributes

Update the default node attributes.

update_dna

Update the default node attributes.

update_node_xyz

Modifies

uv_index

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

validate_data

Validate the object's data against its data schema.

validate_json

Validate the object's data against its json schema.