cablenet = Cablenet.from_obj(compas.get('faces.obj')) for key, attr in cablenet.vertices(True): attr['is_anchor'] = cablenet.vertex_degree(key) == 2 artist = CablenetArtist(cablenet, layer="Mesh::FD") draw() while True: selected = CablenetHelper.select_vertices(cablenet) if not selected: break if CablenetHelper.update_vertex_attributes(cablenet, selected): cablenet_fd(cablenet) draw() while True: selected = CablenetHelper.select_edges(cablenet) if not selected: break if CablenetHelper.update_edge_attributes(cablenet, selected): cablenet_fd(cablenet) draw() draw()
def update_edge_attributes(cablenet, settings): keys = CablenetHelper.select_edges(cablenet) if keys: return CablenetHelper.update_edge_attributes(cablenet, keys)
artist.draw_vertices() artist.draw_edges() artist.redraw() draw() while True: keys = CablenetHelper.select_vertices(cablenet) if not keys: break if CablenetHelper.update_vertex_attributes(cablenet, keys): cablenet_fd_alglib(cablenet) draw() while True: keys = CablenetHelper.select_edges(cablenet) if not keys: break if CablenetHelper.update_edge_attributes(cablenet, keys): cablenet_fd_alglib(cablenet) draw() artist.clear_layer() artist.draw_vertices() artist.draw_edges() artist.draw_forces(scale=0.05) artist.draw_loads() artist.draw_reactions() artist.redraw()