yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #02008
Re: Get sphere radius from bodies
Hi Vaclav, thanks for showing us the commands. May I know why is Geometrical Model gone? actually im quite stuck at implementing my superquadratics...
Regards,
CWBoon
> From: eudoxos@xxxxxxxx
> To: yade-users@xxxxxxxxxxxxxxxxxxx
> Date: Mon, 30 Nov 2009 10:58:09 +0100
> Subject: Re: [Yade-users] Get sphere radius from bodies
>
>
> > Hi, all!
> >
> > Sorry for a simple question, but how can I get sphere radius from
> > bodies?
> > I can get sphere position as O.bodies[0].state.pos[0], but what about
> > radius?
> O.bodies[0].mold['radius'] (if it is a sphere, otherwise you get
> KeyError).
>
> The confusing thing is that InteractingGeometry is called "mold", based
> on my original simplification proposal: GeometricalModel->Shape,
> InteractingGeometry->Mold; since GeometricalModel is gone now, let's
> call it geom. It is more readable and there is no problem having both
> anyways.
>
> I added a "geom" alias for mold in last commit, so you can use
> O.bodies[0].geom['radius'] instead.
>
> PS. You can test sphericity in several ways:
>
> if O.bodies[0].geom.name=='Sphere' # test name of the InteractingGeometry instance
> 'radius' in O.bodies[0].geom.keys() # tests presence of the radius attribute
> if O.bodies[0].geom.has_key('radius') # this one should be a little faster
>
> Cheers, Vaclav
>
>
>
> >
> > Thank you.
> >
> > ______________________________
> >
> > Anton Gladkyy
> > _______________________________________________
> > 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
>
>
>
> _______________________________________________
> 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
_________________________________________________________________
New Windows 7: Simplify what you do everyday. Find the right PC for you.
http://windows.microsoft.com/shop
Follow ups
References