3. Create FormDiagram

FormDiagram is the 2D projection of the thrust network, it is also represented by the mesh datastructure. The boundary condition information, such as the support locations and loading conditions, is inherited automatically from the Pattern. Any edges of the pattern, of which both endpoints are supports, are removed from the FormDiagram. Corners and pseudo faces of the Pattern are automatically processed during the creation of the FormDiagram, so as to generate the topological-dual ForceDiagram correctly.

Here, two new faces along the open boundaries are generated.

# ==============================================================================
# Import
# ==============================================================================
import os
from compas_rv2.datastructures import Pattern
from compas_rv2.datastructures import FormDiagram
from compas_rv2.rhino import FormArtist
from compas.rpc import Proxy

# ==============================================================================
# Create Pattern
# ==============================================================================
HERE = os.path.dirname(__file__)
FILE = os.path.join(HERE, 'data', 'barrel_vault_pattern.json')
pattern = Pattern.from_json(FILE)
anchors = list(pattern.vertices_where({'is_anchor': True}))

# ==============================================================================
#  Create Form
# ==============================================================================
form = FormDiagram.from_pattern(pattern)

# ==============================================================================
#  Visualization
# ==============================================================================
artist = FormArtist(form, layer="CSD2::form")
artist.clear_layer()
artist.draw_vertices(vertices=anchors, color=(255, 0, 0))
artist.draw_faces()
artist.draw_edges()

Pseudo faces have the face_attribute: _is_loaded = False. Pseudo edges have the edge_attribute: _is_edge = False. You can hide these faces and edges by the following code when you visualize the FormArtist.

# hide pseudofaces and edges
artist.draw_faces(faces=list(form.faces_where({'_is_loaded': True})))
artist.draw_edges(edges=list(form.edges_where({'_is_edge': True})))

Last updated