# Local Coordinate System per each element for i in rs.ObjectsByLayer('elset_beams'): ez = subtract_vectors(rs.CurveEndPoint(i), rs.CurveStartPoint(i)) ex = normalize_vector(cross_vectors(ez, [0, 0, 1])) rs.ObjectName(i, '_{0}'.format(json.dumps({'ex': ex}))) #------------------------------------------------------------------------------- # Structure # For the path in the command below, select the location you prefer mdl = Structure(name='Nexorades', path='C:/TEMP/') #------------------------------------------------------------------------------- # Elements rhino.add_nodes_elements_from_layers(mdl, line_type='BeamElement', layers='elset_beams') #------------------------------------------------------------------------------- # Sets rhino.add_sets_from_layers(mdl, layers=['nset_support', 'nset_load']) #------------------------------------------------------------------------------- # Materials mdl.add(ElasticIsotropic(name='mat_elastic', E=11000000, v=10**(-5), p=0.01)) #------------------------------------------------------------------------------- # Sections mdl.add(CircularSection(name='sec_beam', r=0.2)) #-------------------------------------------------------------------------------
from compas_fea.structure import ShellSection from compas_fea.structure import ElementProperties from compas_fea.structure import PinnedDisplacement from compas_fea.structure import GravityLoad from compas_fea.structure import PointLoad from compas_fea.structure import AreaLoad from compas_fea.structure import GeneralStep from compas_fea.structure import BucklingStep from compas_fea.structure import ModalStep # Author(s): Andrew Liew (github.com/andrewliew) mdl = Structure(name='example_shell', path='C:/Temp/') rhino.add_nodes_elements_from_layers(mdl, mesh_type='ShellElement', layers='mesh') rhino.add_sets_from_layers(mdl, layers=['loads', 'supports', 'area']) #print(mdl.sets['loads']) #print(mdl.sets['supports']) #print(mdl.sets['area']) mdl.add(Concrete(name='concrete', fck=50)) #print(mdl.materials['concrete']) mdl.add(ShellSection(name='shell', t=0.100)) #print(mdl.sections['shell'])
import rhinoscriptsyntax as rs __author__ = ['Andrew Liew <*****@*****.**>'] __copyright__ = 'Copyright 2018, BLOCK Research Group - ETH Zurich' __license__ = 'MIT License' __email__ = '*****@*****.**' # Structure mdl = Structure(name='mesh_mould', path='C:/Temp/') # Elements rhino.add_nodes_elements_from_layers(mdl, mesh_type='ShellElement', layers=['elset_wall', 'elset_plinth']) # Sets rhino.add_sets_from_layers(mdl, layers=['nset_fixed']) # Materials mdl.add_materials([ Concrete(name='mat_concrete', fck=40), Steel(name='mat_rebar', fy=500, id='r')]) # Sections mdl.add_sections([ ShellSection(name='sec_wall', t=0.150),
from compas_fea.structure import Steel from compas_fea.structure import TrussSection from compas_fea.structure import Structure import rhinoscriptsyntax as rs # Author(s): Andrew Liew (github.com/andrewliew) # Structure mdl = Structure(name='mesh_planar', path='C:/Temp/') # Elements rhino.add_nodes_elements_from_layers(mdl, mesh_type='ShellElement', layers=['elset_mesh', 'elset_plates']) rhino.add_nodes_elements_from_layers(mdl, line_type='TrussElement', layers=['elset_tie']) # Sets rhino.add_sets_from_layers(mdl, layers=['nset_pin', 'nset_roller']) # Materials mdl.add([ Concrete(name='mat_concrete', fck=50), Steel(name='mat_steel', fy=460), ])
from compas_fea.structure import MassSection from compas_fea.structure import Structure # Author(s): # Francesco Ranaudo (github.com/nefelogeta) # Andrew Liew (github.com/andrewliew) # Structure mdl = Structure(name='mesh_modal_from_mesh', path='C:/Temp/') # Elements rhino.add_nodes_elements_from_layers(mdl, mesh_type='ShellElement', layers='elset_concrete', pA=100) rhino.add_nodes_elements_from_layers(mdl, mesh_type='MassElement', layers='elset_mass',pA=1000) # Sets rhino.add_sets_from_layers(mdl, layers='nset_pins') # Materials mdl.add(ElasticIsotropic(name='mat_concrete', E=40*10**9, v=0.2, p=2400)) # Sections mdl.add([ShellSection(name='sec_concrete', t=0.250), MassSection(name='sec_mass')])
from compas_fea.structure import TrussSection from math import pi import rhinoscriptsyntax as rs # Author(s): Andrew Liew (github.com/andrewliew) # Structure mdl = Structure(name='mesh_bridge', path='C:/Temp/') # Elements rhino.add_nodes_elements_from_layers(mdl, mesh_type='ShellElement', layers='elset_mesh') rhino.add_nodes_elements_from_layers(mdl, line_type='TrussElement', layers='elset_ties') rhino.add_nodes_elements_from_layers(mdl, line_type='BeamElement', layers='elset_ends') # Sets ymin, ymax = mdl.node_bounds()[1] nodes_top = [i for i, node in mdl.nodes.items() if node.y > ymax - 0.01] nodes_bot = [i for i, node in mdl.nodes.items() if node.y < ymin + 0.01] mdl.add_set(name='nset_top', type='node', selection=nodes_top) mdl.add_set(name='nset_bot', type='node', selection=nodes_bot)
# Author(s): Andrew Liew (github.com/andrewliew) # Structure mdl = Structure(name='block_strip', path='C:/Temp/') # Extrude rhino.mesh_extrude(mdl, guid=rs.ObjectsByLayer('base_mesh'), layers=5, thickness=0.010, blocks_name='elset_blocks', plot_blocks=0) # Elements rhino.add_nodes_elements_from_layers(mdl, line_type='BeamElement', layers='elset_beams') rhino.add_nodes_elements_from_layers(mdl, mesh_type='ShellElement', layers='elset_membranes') # Sets ymin, ymax = mdl.node_bounds()[1] top = [i for i, node in mdl.nodes.items() if node.y > ymax - 0.001] bot = [i for i, node in mdl.nodes.items() if node.y < ymin + 0.001] mdl.add_set(name='nset_top', type='node', selection=top) mdl.add_set(name='nset_bot', type='node', selection=bot) # Materials MPa = 10**6 GPa = 10**9
__copyright__ = 'Copyright 2018, BLOCK Research Group - ETH Zurich' __license__ = 'MIT License' __email__ = '*****@*****.**' # Structure mdl = Structure(name='beam_tree', path='C:/Temp/') # Elements layers = [ 'struts_mushroom', 'struts_bamboo', 'joints_mushroom', 'joints_bamboo', 'joints_grid' ] rhino.add_nodes_elements_from_layers(mdl, line_type='BeamElement', layers=layers) # Sets rhino.add_sets_from_layers(mdl, layers=['supports_bot', 'supports_top']) # Sections mdl.add_sections([ TrapezoidalSection(name='sec_mushroom', b1=0.001, b2=0.150, h=0.225), RectangularSection(name='sec_bamboo', b=0.020, h=0.100), RectangularSection(name='sec_joints', b=0.020, h=0.075) ]) # Materials
import rhinoscriptsyntax as rs __author__ = ['Andrew Liew <*****@*****.**>'] __copyright__ = 'Copyright 2018, BLOCK Research Group - ETH Zurich' __license__ = 'MIT License' __email__ = '*****@*****.**' # Structure mdl = Structure(name='mesh_floor', path='C:/Temp/') # Elements rhino.add_nodes_elements_from_layers(mdl, mesh_type='ShellElement', layers='elset_concrete') rhino.add_nodes_elements_from_layers(mdl, line_type='TrussElement', layers='elset_ties') # Sets layers = ['nset_corners', 'nset_corner1', 'nset_corner2'] rhino.add_sets_from_layers(mdl, layers=layers) # Materials mdl.add_materials([ Concrete(name='mat_concrete', fck=90), Steel(name='mat_steel', fy=355)]) # Sections
__copyright__ = 'Copyright 2018, BLOCK Research Group - ETH Zurich' __license__ = 'MIT License' __email__ = '*****@*****.**' # Structure mdl = Structure(name='spring_simple', path='C:/Temp/') # Elements springs = [ 'spring_bot_left', 'spring_bot_right', 'spring_top_left', 'spring_top_right' ] rhino.add_nodes_elements_from_layers(mdl, line_type='SpringElement', layers=springs) # Sets rhino.add_sets_from_layers(mdl, layers=['pins', 'middle']) # Sections mdl.add_section( SpringSection(name='spring_elastic', stiffness={'axial': 10000})) mdl.add_section(SpringSection(name='spring_soft', stiffness={'axial': 1000})) # Properties mdl.add_element_properties([
from compas_fea.structure import GeneralStep from compas_fea.structure import PinnedDisplacement from compas_fea.structure import PointLoad from compas_fea.structure import Structure from compas_fea.structure import TrussSection # Author(s): Andrew Liew (github.com/andrewliew) # Structure mdl = Structure(name='truss_tower', path='C:/Temp/') # Elements rhino.add_nodes_elements_from_layers(mdl, line_type='TrussElement', layers='elset_truss') # Sets rhino.add_sets_from_layers(mdl, layers=['nset_pins', 'nset_top']) # Materials mdl.add(ElasticIsotropic(name='mat_elastic', E=200 * 10**9, v=0.3, p=7850)) # Sections mdl.add(TrussSection(name='sec_truss', A=0.0001)) # Properties
import rhinoscriptsyntax as rs from math import pi # Author(s): Andrew Liew (github.com/andrewliew) # Structure mdl = Structure(name='mesh_floor', path='C:/Temp/') # Elements rhino.add_nodes_elements_from_layers(mdl, mesh_type='ShellElement', layers=['elset_ribs', 'elset_vault']) rhino.add_nodes_elements_from_layers(mdl, line_type='BeamElement', layers='elset_stiff') rhino.add_nodes_elements_from_layers(mdl, line_type='TrussElement', layers='elset_ties') # Sets rhino.add_sets_from_layers(mdl, layers=['nset_corner1', 'nset_corner2']) edges = [i for i in mdl.nodes if mdl.nodes[i].z < 0.001] mdl.add_set(name='nset_edges', type='node', selection=edges) # Materials mdl.add([ Concrete(name='mat_concrete', fck=90, fr=[1.16, 0.15]), Stiff(name='mat_stiff', E=10**12), Steel(name='mat_steel', fy=355),
# Author(s): Andrew Liew (github.com/andrewliew) p = 7850 A1 = 0.0008 A2 = 0.0005 A3 = 0.0001 # Structure mdl = Structure(name='truss_frame', path='C:/Temp/') # Elements rhino.add_nodes_elements_from_layers(mdl, line_type='TrussElement', layers='elset_main', pL=A1*p) rhino.add_nodes_elements_from_layers(mdl, line_type='TrussElement', layers='elset_diag', pL=A2*p) rhino.add_nodes_elements_from_layers(mdl, line_type='TrussElement', layers='elset_stays', pL=A3*p) # Sets rhino.add_sets_from_layers(mdl, layers=['nset_pins', 'nset_load_v', 'nset_load_h']) # Materials mdl.add(Steel(name='mat_steel', fy=355, p=p)) # Sections mdl.add([ TrussSection(name='sec_main', A=A1),