2. Define Boundary Conditions

2.a Supports

Now you need to select the vertices on the three curving-out boundaries of the Pattern and set them as anchors. It's difficult to find the vertex key in this pattern. Thus, we will use interactive selection in Rhino.

# ==============================================================================
# Anchor Points
# ==============================================================================
anchors = []

guids = compas_rhino.select_points(message='Select Points to Anchor')
compas_rhino.rs.HideObjects(guids)
points = compas_rhino.get_point_coordinates(guids)
gkey_key_dict = pattern.gkey_key()
for pt in points:
    vkey = gkey_key_dict[geometric_key(pt)]
    anchors.append(vkey)
    pattern.vertex_attribute(vkey, 'is_anchor', True)

# ==============================================================================
# Serialization
# ==============================================================================
FILE_O = os.path.join(HERE, 'data', 'armadillo_pattern_anchor.json')
pattern.to_json(FILE_O)

# ==============================================================================
# Visualization
# ==============================================================================
artist.draw_vertices(vertices=anchors, color=(255, 0, 0))

2.b Relax Pattern

With all the boundary vertices fixed, the Pattern can be relaxed using the force density method with default force density of 1 in the edges. The primary purpose of Pattern relaxation is to reorient the edges of the Pattern so that the Pattern will already be in a good, equilibrated starting geometry which will be helpful during later stages of form finding.

Be aware of the difference: the attribute 'is_anchor' refers to support points for the actual TNA, vs. the attribute 'is_fixed' informs the pattern relaxation.

 # ==============================================================================
# Pattern Relaxation
# ==============================================================================
fixed = []
for bdr in pattern.vertices_on_boundaries():
    for vkey in bdr:
        fixed.append(vkey)
        pattern.vertex_attribute(vkey, 'is_fixed', True)

proxy = Proxy()
proxy.package = 'compas_tna.utilities'
patterndata = proxy.relax_boundary_openings_proxy(pattern.to_data(), fixed)
pattern = Pattern.from_data(patterndata)

# ==============================================================================
#  Serialization
# ==============================================================================
pattern.to_json(FILE_O)

Last updated