D4. Hooks

We will screw the eye bolts into the beam, and zip-ties or steel wires to tension the knit.

start = list(mesh.edges_where({'seam': True}))[0]
loop = mesh.edge_loop(start)
lines = []

for (u, v) in loop: 
    if mesh.edge_attribute((u, v), 'hook') is True:
        hook = mesh.edge_midpoint(u, v)
        u_beam = mesh.vertex_attribute(u, 'beam_pt')
        v_beam = mesh.vertex_attribute(v, 'beam_pt')
        hook_beam = [(a + b) / 2 for a, b in zip(u_beam, v_beam)]
        
        artist = PointArtist(Point(*hook_beam), color=(0, 255, 0), layer="DF21_D3::Beam::Seam::Hooks")
        artist.draw()
        artist = PointArtist(Point(*hook_beam).transformed(T_local_xy), color=(0, 255, 0), layer="DF21_D3::Beam::Seam::Hooks_xy")
        artist.draw()
        
        lines.append(
            {'start': hook, 
             'end': hook_beam, 
             'color': (0, 0, 0)})

compas_rhino.draw_lines(lines, layer="DF21_D3::Beam::Seam::Zipties")

Last updated