← Back to team overview

yade-users team mailing list archive

Re: [Question #294529]: random orientation of chained cylinders

 

Question #294529 on Yade changed:
https://answers.launchpad.net/yade/+question/294529

Anton Gladky proposed the following answer:
There is a peace of code which i used to generate a random orientation
of clumps in python-yade-script:

         oriBody = Quaternion(Vector3(1,0,0),random.random()*(pi/2))
         oriBody *= Quaternion(Vector3(0,1,0),random.random()*(pi/2))
         oriBody *= Quaternion(Vector3(0,0,1),random.random()*(pi/2))
         clpId,sphId =
O.bodies.appendClumped(bodiesHandling.spheresModify(pack1,shift=(x,y,z),orientation=oriBody,copy=True))

It can also be modified for any other body.

Ceers

Anton

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.