Re: [Yade-users] [Question #402260]: Rotate pack
Question #402260 on Yade changed: https://answers.launchpad.net/yade/+question/402260 Status: Answered => Open Luis Barbosa is still having a problem: Hi, What about the use of this function [1]. It seems to work well, but in my case it is happening some conflict between "o.bodies.append" and "tosimulation", I think. [1] https://yade- dem.org/doc/yade.pack.html?highlight=rotate#yade._packSpheres.SpherePack.rotate Thanks -- You received this question notification because your team yade-users is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #402260]: Rotate pack
Question #402260 on Yade changed: https://answers.launchpad.net/yade/+question/402260 Status: Open => Answered Anton Gladky proposed the following answer: 2016-09-25 14:37 GMT+02:00 Luis Barbosa : > ag = > pack.regularHexa(pack.inSphere((0,0,r),r),oriBody,radius=rad,gap=gap,color=(0,0,1)) It looks like inSphere does not have orientation parameter [1]. That is logical, because there is no sense to rotate the sphere in general case. To escape such errors in the future, list parameters in "name=value" format: ag = pack.regularHexa(pack.inSphere((0,0,r),r),orientation=oriBody,radius=rad,gap=gap,color=(0,0,1)) So, you will get an error instead of silence. [1] https://yade- dem.org/doc/yade.pack.html?highlight=insphere#yade._packPredicates.inSphere Best regards Anton -- You received this question notification because your team yade-users is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
[Yade-users] [Question #402260]: Rotate pack
New question #402260 on Yade: https://answers.launchpad.net/yade/+question/402260 Hi, I'm creating a regular Hexa pack inSphere and removing randomicaly some particles. But I also would like to rotate the pack in each simulation. As follow: rad,gap=.0002,0 #particle radius and gap r=random.uniform(rmin, rmax) #aggregate radius random according to the class defined oriBody = Quaternion(Vector3(0,1,0),(pi/2)) #Rotation of the pack ag = pack.regularHexa(pack.inSphere((0,0,r),r),oriBody,radius=rad,gap=gap,color=(0,0,1)) a = len(ag) c = 0.25*a #percentage of maximum particle removal d = 0.135*a #percentage of minimum particle removal n=random.randint(int(d), int(c)) #number of spheres to exclude randomically #randomly remove spheres from packing for i in range(0,len(ag)-n): b = ag[random.randint(0,len(ag)-1)] O.bodies.append(b) ag.remove(b) The script is working well, however when I insert the rotation it doesn't work. I've tried using "ag.toSimulation(oriBody)", but also didn't work. Does someone know what is wrong? Thanks a lot, Luis -- You received this question notification because your team yade-users is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp