← Back to team overview

yade-users team mailing list archive

Re: [Question #403901]: Sample of pre-defined shaped particles

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,
yes, it is possible, something like

######################################################################
from yade import pack

def createAgglomerate(pos=Vector3.Zero,ori=Quaternion.Identity,**kw):
   pos = Vector3(pos)
   ori = Quaternion(ori)
   pred = pack.inAlignedBox((-5,-5,-5),(5,5,5))
   # pred could be any shape, see user's manual,
   # section "Constructive Solid Geometry"
   sphs = pack.regularHexa(pred,1,0,**kw)
   for sp in sphs:
  sp.state.pos = pos + ori*sp.state.pos
   return sphs

a1 = createAgglomerate(color=(1,0,0))
a2 = createAgglomerate((15,0,0),Quaternion((1,2,3),4),color=(0,1,0))
a3 = createAgglomerate((10,10,10),Quaternion((3,2,1),1),color=(0,0,1))
# ...
for a in (a1,a2,a3):
   O.bodies.append(a)
######################################################################

cheers
Jan


2016-11-09 1:32 GMT+01:00 bruna <question403901@xxxxxxxxxxxxxxxxxxxxx>:

> New question #403901 on Yade:
> https://answers.launchpad.net/yade/+question/403901
>
> Hello everybody!
>
> I would like to create a sample formed by particles that are sphere
> agglomerates with a determined shape (u-shaped).
> I was thinking that I could create the particle (that is a pattern) in a
> scritpt and them import it in another script as many times as necessary
> rotating and translating the copied particles.
> I don't know if it is possible or if it is an inteligente manner to do
> this.
>
> Does anybody knows a function that could help me or a better way to do
> this?
>
> Thanks a lot for your help and patience.
>
> Bruna.
>
> --
> 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@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

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