Example #1
0
        The form diagram.
    zmax : float
        The maximum z-coordinate of all vertices of the equilibrium network.

    """
    formdata, scale = tna.vertical_from_zmax_proxy(form.to_data(), zmax)
    form.data = formdata
    return scale


# 1. make the form diagram from selected line elements

guids = compas_rhino.select_lines()
rs.HideObjects(guids)

form = FormDiagram.from_rhinolines(guids)
form.draw(layer='TNA::FormDiagram', clear_layer=True)

# 2. identify the supports

keys = DiagramHelper.select_vertices(form)

if keys:
    form.set_vertices_attributes(['is_anchor', 'is_fixed'], [True, True],
                                 keys=keys)
    form.draw(layer='TNA::FormDiagram', clear_layer=True)

# 3. update the boundaries
# Note: add only one foot per support to control the direction of the horizontal component
#       of the reaction force
* a Rhino mesh
* a Rhino surface
* a set of Rhino lines

"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import compas_rhino

from compas_tna.diagrams import FormDiagram

guid = compas_rhino.select_mesh()

f1 = FormDiagram.from_rhinomesh(guid, name='FromMesh')

f1.draw(layer='TNA::FormDiagram::Mesh')

guid = compas_rhino.select_surface()

f2 = FormDiagram.from_rhinosurface(guid, name='FromSurf')

f2.draw(layer='TNA::FormDiagram::Surface')

guids = compas_rhino.select_lines()

f3 = FormDiagram.from_rhinolines(guids, name='FromLines')

f3.draw(layer='TNA::FormDiagram::Lines')