from compas.datastructures import Network for i in range(60): print() # Structure mdl = Structure(name='beam_simple', path=compas_vibro.TEMP + '/') # Elements filepath = os.path.join(compas_vibro.DATA, 'network_10x10.json') network = Network.from_json(filepath) mdl.add_nodes_elements_from_network(network=network, element_type='BeamElement', elset='elset_lines', axes={'ex': [0, 0, 1]}) # Materials mdl.add(ElasticIsotropic(name='mat_elastic', E=20 * 10**9, v=0.3, p=1500)) # Sets mdl.add_set(name='load_pts', selection=[15, 14], type='node') # Section mdl.add(CircularSection(name='cirsec', r=.05)) mdl.add( Properties(name='ep',
__copyright__ = 'Copyright 2018, BLOCK Research Group - ETH Zurich' __license__ = 'MIT License' __email__ = '*****@*****.**' # Structure mdl = Structure(name='beam_grid', path='C:/Temp/') # Beams beams = [i for i in rs.LayerNames() if i[:2] in ['BX', 'BY']] for beam in beams: network = rhino.network_from_lines(rs.ObjectsByLayer(beam)) axes = {'ex': [0, 1, 0]} if 'X' in beam else {'ex': [1, 0, 0]} mdl.add_nodes_elements_from_network(network=network, element_type='BeamElement', elset=beam, axes=axes) xyzs = [network.vertex_coordinates(i) for i in network.leaves()] ends = [mdl.check_node_exists(i) for i in xyzs] mdl.add_set('{0}_ends'.format(beam), type='node', selection=ends) # Sets rhino.add_sets_from_layers(mdl, layers=['lift_points'] + beams) # Materials mdl.add_material( ElasticIsotropic(name='mat_elastic', E=5 * 10**9, v=0.3, p=1000)) # Sections