Access to the global coordinates of polyhedra vertices

Asked by Ákos Orosz

Hi all,

I’m trying to create an oedometric test (yadedaily (2016.06a)), similar to the tutorial [1] with polyhedral particles. After gravitational deposition, to put the top plate exactly on the top of the pile, I have to access to the global coordinates of all vertices of polyhedral particles (and then find the highest). For this, I used:

ver=[i.shape.v for i in O.bodies if isinstance(i.shape,Polyhedra)]

It seems, it returns with local coordinates, instead of globals (as stated in the docs [2]). Can you help, how to get the global ones?

Thanks in advance,
Ákos

[1] https://yade-dem.org/doc/tutorial-examples.html#oedometric-test
[2] https://yade-dem.org/doc/yade.wrapper.html?highlight=v#yade.wrapper.Polyhedra.v

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Revision history for this message
Best Jan Stránský (honzik) said :
#1

Hi Ákos,

for single body, you have to multiply the vertex by orientation and add
position. It is then easy to do it in a loop.
##################
b = somePolyhedron
pos = b.state.pos
ori = b.state.ori
for vLocal in b.shape.v:
   vGlobal = pos + ori*vLocal
###################

cheers
Jan

2016-10-31 21:33 GMT+01:00 Ákos Orosz <email address hidden>
:

> New question #403684 on Yade:
> https://answers.launchpad.net/yade/+question/403684
>
> Hi all,
>
> I’m trying to create an oedometric test (yadedaily (2016.06a)), similar to
> the tutorial [1] with polyhedral particles. After gravitational deposition,
> to put the top plate exactly on the top of the pile, I have to access to
> the global coordinates of all vertices of polyhedral particles (and then
> find the highest). For this, I used:
>
> ver=[i.shape.v for i in O.bodies if isinstance(i.shape,Polyhedra)]
>
> It seems, it returns with local coordinates, instead of globals (as stated
> in the docs [2]). Can you help, how to get the global ones?
>
> Thanks in advance,
> Ákos
>
> [1] https://yade-dem.org/doc/tutorial-examples.html#oedometric-test
> [2] https://yade-dem.org/doc/yade.wrapper.html?highlight=v#yade.
> wrapper.Polyhedra.v
>
>
> --
> 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 : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Ákos Orosz (oakos) said :
#2

Thanks Jan Stránský, that solved my question.