how to specify certain bodies(spheres) to display?

Asked by behzad

Hi,

I was wondering how can we cut a sample in the view to look inside? I have assigned a certain colour for each coordination number (1,2,3,...) and I can see the particle's colour at the surfaces of the sample. But, I need to see inside particles as well without literally cutting the sample.

I can group particles with certain spatial positions, but the question is how can I remove some groups from the view?

Any idea?

Cheers,
Behzad

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
behzad
Solved:
Last query:
Last reply:
Revision history for this message
Jérôme Duriez (jduriez) said :
#1

Hi Behzad,

You have first to obtain the OpenGLRenderer [1] object that takes care of displaying things in Yade GUI, then make use of its attribute function hideBody() [2], passing as attribute the id of the bodies you do not want do display (one at once, I think)

Namely:

rend = yade.qt._GLViewer.Renderer() # see https://yade-dem.org/doc/yade.qt.html#yade.qt._GLViewer.Renderer
for b in yourListOfBodyWithSomeSpatialPositionsYouDoNotWantToDisplay:
    rend.hideBody(b.id)

I just learned it thanks to your question, so I hope it works !

Jerome

[1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.OpenGLRenderer
[2] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.OpenGLRenderer.hideBody

Revision history for this message
behzad (behzad-majidi) said :
#2

well, that's exactly what I wanted to do. Thanks!