#============================================================* # test chain of cyls * #============================================================* # set units units #units scale name = mass uname = reducedMass value = 10000.0 # create cylinder #---------------- solid create name = c1 type = cylinder radius = 0.2 length = 1.0 \ center = [ 0 0.5 0 ] axis = [ 0 1 0 ] solid c1 color = [ 1 1 0 ] display = line solid create name = c2 type = cylinder radius = 0.2 length = 1.0 \ center = [ 0 1.5 0 ] axis = [ 0 1 0 ] solid c2 color = [ 1 0 1 ] display = line # create bodies #-------------- body create name = ground type = ground body create name = c1b type = rigid solid = c1 body create name = c2b type = rigid solid = c2 # create joints #-------------- joint create name = jnt1 type = weld cylinder = c1 distance = 0.0 \ axis = [ 0 0 1 ] #joint create name = jnt1 type = ball cylinder = c1 distance = 0.0 joint jnt1 color = [ 1 0 0 ] msize = 0.1 shading = flat show = true joint jnt1 bodies = { ground c1b } joint create name = jnt2 type = hinge cylinder = c2 distance = 0.0 \ axis = [ 0 0 1 ] joint jnt2 color = [ 0 1 0 ] msize = 0.1 shading = flat show = true joint jnt2 bodies = { c1b c2b } # create a rigid simulation #-------------------------- simulation create name = rsim type = rigid # set solver #----------- simulation rsim solver = ode simulation rsim momentum = on # add bodies #----------- simulation rsim add bodies = all # add joints #----------- simulation rsim add joints = all # add torsional spring #--------------------- body c1b add potential = cyl12Tpot1 type = torsion \ origin = [ 0 1 0 ] point1 = [0 0.5 0] point2 = [0.2 0.5 0] \ force_const = 100.0 \ color = [ 0.6 0.6 0.6 ] width = 2.0 show = true body c2b add potential = cyl12Tpot2 type = torsion \ point1 = [0 1.5 0] point2 = [0.2 1.5 0] force_const = 100.0 \ color = [ 1 0.6 0.6 ] width = 2.0 show = false simulation rsim add interaction = cyl12Tint \ body1 = c1b potential1 = cyl12Tpot1 \ body2 = c2b potential2 = cyl12Tpot2 \ time = { 0 10000 } # add forces #----------- force create name = force1 \ type = explicit \ point = [ 0 0.5 0 ] \ direction = [ 1 0 0 ] \ scale = 1.0 simulation rsim add force = force1 \ body = c2b \ time = { 0 1.0 } simulation rsim add trace name = trace1 \ point = [ 0 0.5 0 ] \ body = c1b # initialize simulation #---------------------- simulation rsim initialize simulation rsim time step = 0.03 graphics center point = [0.196045 1.36253 0.0197997]