# path = os.path.join(DATA, 'FABRIC', 'unrolled', SIDE, "{}.json".format(mesh.attributes['name'])) # mesh.to_json(path) # for mesh in NW_unrolled: # path = os.path.join(DATA, 'FABRIC', 'unrolled', SIDE, "{}.json".format(mesh.attributes['name'])) # mesh.to_json(path) # ============================================================================== # Visualize # ============================================================================== ARTIST = ShellArtist(None) for mesh in SOUTH_unrolled: points = [ mesh.vertex_coordinates(key) for key in mesh.vertices_on_boundary(ordered=True) ] polygon = offset_polygon(points, SEEM) polygons = [{'points': polygon + polygon[:1]}] ARTIST.mesh = mesh ARTIST.layer = "Unrolled::{}::{}".format(SIDE, mesh.attributes['name']) ARTIST.clear_layer() ARTIST.draw_faces() ARTIST.draw_facelabels(text={ key: "{}".format(attr['count']) for key, attr in mesh.faces(True) }) ARTIST.draw_polygons(polygons)
POLYGONS.append({ 'points': [box1[1], box2[1], box2[2], box1[2], box1[1]], 'color': (0, 0, 0) }) FRAMES += framelines(origin, xaxis, yaxis, zaxis, 'box') # ============================================================================== # Visualize # ============================================================================== ARTIST = ShellArtist(SHELL, layer="Scaffolding") ARTIST.clear_layer() ARTIST.layer = "Scaffolding::Anchors" ARTIST.clear_layer() ARTIST.draw_points(POINTS) ARTIST.layer = "Scaffolding::Connectors" ARTIST.clear_layer() ARTIST.draw_lines(LINES) ARTIST.layer = "Scaffolding::Beams" ARTIST.clear_layer() ARTIST.draw_polygons(POLYGONS) ARTIST.layer = "Scaffolding::Frames" ARTIST.clear_layer() ARTIST.draw_lines(FRAMES)