FormDiagram

class compas_tno.diagrams.FormDiagram[source]

Bases: compas_tna.diagrams.formdiagram.FormDiagram

The FormDiagram represents the projection of the internal force network within the structure.

The class imports the attributes and set ups from compas_tna.diagrams.FormDiagram and include some functionalities useful for the assessment of masonry structures. Most relevant edge and vertex attributes are listed below:

Attributes
  • * Vertex attributes

  • x (float) – x-coordinate of the vertex.

  • y (float) – y-coordinate of the vertex.

  • z (float) – z-coordinate of the vertex.

  • is_roller (bool) – Whether or not the attibute is set to be a roller. Takes only horizontal reaction.

  • tubmax (float) – Maximum allowable increase in the extrados

  • tlbmax (float) – Maximum allowable increase in the intradoss

  • tub_reac (float) – Maximum allowable increase in the horizontal projection of the reaction.

  • * Edge attributes

  • q (float) – Force density of an edge.

  • f (float) – Force magnitude of an edge.

  • is_ind (bool) – Whether or not the edge is an independent edge.

  • qmin (float) – The minimum force density magnitude.

  • qmax (float) – The maximum force density magnitude.

Examples

>>> from compas_tno.diagrams import FormDiagram
>>> data = {'type': 'fan_fd', 'xy_span': [[0, 10], [0, 10]], 'discretisation': [10, 10], 'fix': 'corners'}
>>> form = FormDiagram.from_library(data)

Methods

add_pz

_summary_

assign_inds

Assign manually independent edges to the pattern

build_complete_dual

Build the dual of the form diagram considering half-faces in the edges on the perimeter.

build_dual

Build the dual of the form diagram.

build_symmetry_map

Build the dictionary mapsym (i -> j) that associate one edge j per group of symmetry i.

create_arch

Construct a FormDiagram based on an arch linear discretisation.

create_circular_radial_form

Construct a circular radial FormDiagram with hoops not equally spaced in plan.

create_circular_radial_spaced_form

Construct a circular radial FormDiagram with hoops not equally spaced in plan, but equally spaced with regards to the projection on a hemisphere.

create_circular_spiral_form

Construct a circular radial FormDiagram with hoops not equally spaced in plan, but equally spaced with regards to the projection on a hemisphere.

create_cross_diagonal

Construct a FormDiagram based on a mixture of cross and fan discretiastion

create_cross_form

Construct a FormDiagram based on cross discretiastion with orthogonal arrangement and diagonal.

create_cross_with_diagonal

Construct a FormDiagram based on cross discretiastion with diagonals.

create_delta_form

Helper to construct a FormDiagram based on fan discretiastion with straight lines to the corners.

create_fan_form

Helper to construct a FormDiagram based on fan discretiastion with straight lines to the corners.

create_linear_form_diagram

Helper to create a arch linear form-diagram with equaly spaced (in 2D) nodes.

create_linear_form_diagram_sp_ep

Helper to create a arch linear form-diagram with equaly spaced (in 2D) nodes.

create_ortho_form

Helper to construct a FormDiagram based on a simple orthogonal discretisation.

create_parametric_form

Helper to construct a FormDiagram envelop that includes fan and cross diagrams.

delete_boundary_edges

Delete boundary edges on a diagram.

distance_target

Compute the squared vertical distance from a target.

fixed

Return the keys of the fixed vertices of the diagram.

fixed_x

Return the keys of the fixed-in-x vertices of the diagram.

fixed_y

Return the keys of the fixed-in-y vertices of the diagram.

from_assembly

from_library

Construct a FormDiagram the library of FormDiagrams available.

from_singular

Create form diagram from singular dense mesh.

from_skeleton

Create form diagram from compas_skeleton

from_triangle

Generates a Form Diagram from triangle

ind

Return the identifiers for the edges selected as independents on the diagram.

loadpath

Compute loadpath in the current configuration based on the force attributes stored in the FormDiagram.

lumped_swt

Returns the lumped selfweight on the nodes.

modify_diagram_boundary

Modify the diagram boundary adding the outer perimeter around the fixed vertices with edges having _is_edge False.

number_of_independents

Compute the number of independent edges.

number_of_real_edges

Return the identifiers for the edges selected as independents on the diagram.

number_of_supports

Compute the number of supports.

number_of_sym_edges

Compute the symmetric edges.

number_of_sym_supports

Compute the symmetric supports.

number_of_sym_vertices

Compute the symmetric vertices.

overview_forces

Print an overview of the forces in the Form Diagram.

plot

Plot a form diagram with a plotter with all the default settings.

q

Return the force densities q of the diagram.

restore_diagram_boundary

Remove faces of the diagram with area zero.

set_boundary_rollers

Set boundary vertices as rollers.

set_boundary_supports

Set all node on the boundary of a pattern as supports.

store_indset

Store the indset with the information about the independent edges (used within algorithms)

thrust

Computes the the (horizontal) thrust

tributary_dict

Make a tributary dictionary to help in the calculation of the tributary weights to the nodes afterwards.

tributary_matrices

Returns the Matrices used for computation of the tributary area.

update_f

Update attributes force f based on force densities q``and lengths ``l.

update_indset

Update the indset with the information about the independent edges (used within algorithms)

update_lumped_weights

Update the lumped weights based on the curent geometry of the thrust network The loads are computed based on the tributary area times the thickness times the density.

xy

Return the xy coordinates of the diagram.

Inherited Methods

ToString

Converts the instance to a string.

add_face

Add a face to the mesh object.

add_vertex

Add a vertex to the mesh object.

anchors

Vertices with is_anchor set to True.

area

Calculate the total mesh area.

bounding_box

Compute the (axis aligned) bounding box of a mesh.

bounding_box_xy

Compute the (axis aligned) bounding box of a projection of the mesh in the XY plane.

centroid

Calculate the mesh centroid.

clear

Clear all the mesh data.

collapse_edge

Collapse an edge to its first or second vertex, or to an intermediate point.

connected_components

Find the connected components of the mesh.

copy

Make an independent copy of the data object.

corners

Vertices with degree 2.

cull_vertices

Remove all unused vertices from the mesh object.

delete_face

Delete a face from the mesh object.

delete_vertex

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

draw

Draw the form diagram in Rhino.

dual

Construct the dual of a mesh.

dual_diagram

Construct the dual of the FormDiagram.

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_faces

Find the two faces adjacent to an edge.

edge_length

Return the length of an edge.

edge_loop

Find all edges on the same loop as a given edge.

edge_midpoint

Return the location of the midpoint of an edge.

edge_point

Return the location of a point along an edge.

edge_sample

A random sample of the edges.

edge_strip

Find all edges on the same strip as a given edge.

edge_vector

Return the vector of an edge.

edges

Iterate over the edges of the mesh.

edges_attribute

Get or set an attribute of multiple edges.

edges_attributes

Get or set multiple attributes of multiple edges.

edges_on_boundaries

Find the edges on all boundaries of the mesh.

edges_on_boundary

Find the edges on the longest boundary.

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.

euler

Calculate the Euler characteristic.

face_adjacency

Build a face adjacency dict.

face_adjacency_halfedge

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

face_adjacency_vertices

Find all vertices over which two faces are adjacent.

face_area

Compute the area of a face.

face_aspect_ratio

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

face_attribute

Get or set an attribute of a face.

face_attributes

Get or set multiple attributes of a face.

face_center

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

face_centroid

Compute the location of the centroid of a face.

face_coordinates

Compute the coordinates of the vertices of a face.

face_corners

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

face_curvature

Dimensionless face curvature.

face_degree

Count the neighbors of a face.

face_flatness

Compute the flatness of the mesh face.

face_halfedges

The halfedges of a face.

face_max_degree

Compute the maximum degree of all faces.

face_min_degree

Compute the minimum degree of all faces.

face_neighborhood

Return the faces in the neighborhood of a face.

face_neighbors

Return the neighbors of a face across its edges.

face_normal

Compute the normal of a face.

face_plane

A plane defined by the centroid and the normal of the face.

face_sample

A random sample of the faces.

face_skewness

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

face_vertex_after

Return the n-th vertex after the specified vertex in a specific face.

face_vertex_ancestor

Return the n-th vertex before the specified vertex in a specific face.

face_vertex_before

Return the n-th vertex before the specified vertex in a specific face.

face_vertex_descendant

Return the n-th vertex after the specified vertex in a specific face.

face_vertices

The vertices of a face.

faces

Iterate over the faces of the mesh.

faces_attribute

Get or set an attribute of multiple faces.

faces_attributes

Get or set multiple attributes of multiple faces.

faces_on_boundaries

Find the faces on all boundaries of the mesh.

faces_on_boundary

Find the faces on the longest boundary.

faces_where

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

faces_where_predicate

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

flip_cycles

Flip the cycle directions of all faces.

from_data

Construct an object of this type from the provided data.

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 FormDiagram from a list of lines described by start and end point coordinates.

from_mesh

Construct a FormDiagram from a Mesh.

from_meshgrid

Create a mesh from faces and vertices on a regular grid.

from_obj

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

from_off

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

from_ply

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

from_points

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

from_polygons

Construct a mesh from a series of polygons.

from_polyhedron

Construct a mesh from a platonic solid.

from_polylines

Construct mesh from polylines.

from_rhinolines

Construct a FormDiagram from a set of Rhino lines represented by their GUIDs.

from_rhinomesh

Construct a FormDiagram from a Rhino mesh represented by a guid.

from_rhinosurface

Construct a FormDiagram from a Rhino surface represented by its GUID.

from_shape

Construct a mesh from a primitive shape.

from_stl

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

from_vertices_and_faces

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

genus

Calculate the genus.

get_any_face

Get the identifier of a random face.

get_any_vertex

Get the identifier of a random vertex.

get_any_vertices

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

gkey_key

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

gkey_vertex

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

halfedge_after

Find the halfedge after the given halfedge in the same face.

halfedge_before

Find the halfedge before the given halfedge in the same face.

halfedge_face

Find the face corresponding to a halfedge.

halfedge_loop

Find all edges on the same loop as the halfedge, in the direction of the halfedge.

halfedge_strip

Find all edges on the same strip as a given halfedge.

has_edge

Verify that the mesh contains a specific edge.

has_face

Verify that a face is part of the mesh.

has_halfedge

Verify that a halfedge is part of the mesh.

has_vertex

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.

index_vertex

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

insert_vertex

Insert a vertex in the specified face.

is_closed

Verify that the mesh is closed.

is_connected

Verify that the mesh is connected.

is_edge_on_boundary

Verify that an edge is on the boundary.

is_empty

Verify that the mesh is empty.

is_face_on_boundary

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

Verify that a vertex is connected.

is_vertex_on_boundary

Verify that a vertex is on a boundary.

join

Add the vertices and faces of another mesh to the current mesh.

key_gkey

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

Vertices with degree 1.

merge_faces

Merge two faces of a mesh over their shared edge.

mesh_oriented_bounding_box_numpy

Compute the (axis aligned) bounding box of a mesh.

mesh_oriented_bounding_box_xy_numpy

Compute the (axis aligned) bounding box of a projection of the mesh in the XY plane.

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.

obb_numpy

Compute the (axis aligned) bounding box of a mesh.

obb_xy_numpy

Compute the (axis aligned) bounding box of a projection of the mesh in the XY plane.

quads_to_triangles

Convert all quadrilateral faces of a mesh to triangles by adding a diagonal edge.

remove_unused_vertices

Remove all unused vertices from the mesh object.

sha256

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

slice_plane

Slice a mesh with a plane and construct the resulting submeshes.

smooth_area

Smooth a mesh by moving each vertex to the barycenter of the centroids of the surrounding faces, weighted by area.

smooth_centroid

Smooth a mesh by moving every free vertex to the centroid of its neighbors.

split_edge

Split and edge by inserting a vertex along its length.

split_face

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

split_strip

Split the srip of faces corresponding to a given edge.

subdivide

Subdivide the input mesh.

summary

Print a summary of the mesh.

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 mesh as pairs of start and end point coordinates.

to_obj

Write the mesh to an OBJ file.

to_off

Write a mesh object to an OFF file.

to_ply

Write a mesh object to a PLY file.

to_points

Convert the mesh to a collection of points.

to_polygons

Convert the mesh to a collection of polygons.

to_polylines

Convert the mesh to a collection of polylines.

to_stl

Write a mesh to an STL file.

to_vertices_and_faces

Return the vertices and faces of a mesh.

transform

Transform a mesh.

transformed

Return a transformed copy of the mesh.

unify_cycles

Unify the cycle directions of all faces.

unset_edge_attribute

Unset the attribute of an edge.

unset_face_attribute

Unset the attribute of a face.

unset_vertex_attribute

Unset the attribute of a vertex.

update_boundaries

Update the boundaries to add outside faces.

update_default_edge_attributes

Update the default edge attributes.

update_default_face_attributes

Update the default face attributes.

update_default_vertex_attributes

Update the default vertex attributes.

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.

vertex_area

Compute the tributary area of a vertex.

vertex_attribute

Get or set an attribute of a vertex.

vertex_attributes

Get or set multiple attributes of a vertex.

vertex_coordinates

Return the coordinates of a vertex.

vertex_curvature

Dimensionless vertex curvature.

vertex_degree

Count the neighbors of a vertex.

vertex_edges

Find all edges connected to a given vertex.

vertex_faces

The faces connected to a vertex.

vertex_gkey

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

vertex_index

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

vertex_laplacian

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_neighborhood

Return the vertices in the neighborhood of a vertex.

vertex_neighborhood_centroid

Compute the centroid of the neighbors of a vertex.

vertex_neighbors

Return the neighbors of a vertex.

vertex_normal

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

vertex_sample

A random sample of the vertices.

vertices

Iterate over the vertices of the mesh.

vertices_attribute

Get or set an attribute of multiple vertices.

vertices_attributes

Get or set multiple attributes of multiple vertices.

vertices_on_boundaries

Find the vertices on all boundaries of the mesh.

vertices_on_boundary

Find the vertices on the longest boundary.

vertices_where

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

vertices_where_predicate

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