can not see particles in "show 3D"

Asked by Leonard on 2019-08-28

Hi,
When I add spheres to a simulation, sometimes I can not see all the particles in every direction (situation 1), sometime I can only see all of them from some certain directions (situation 2), and sometimes a part of spheres are shown like a hole (situation 3), all these situations I have checked through "len(O.bodies) " to make sure that these spheres are existing. My yade version is 2018.02b with Ubuntu 18.04.
My script is as follow:
script1 which should be run firstly :
from yade import pack, plot
O.bodies.append(geom.facetBox((.5,.5,.5),(.5,.5,.5),wallMask=31))
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(1,1,1),rMean=.05,rRelFuzz=.5)
sp.toSimulation(color=[1,1,1])
Gl1_Sphere.quality=3
O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
 ),
 NewtonIntegrator(gravity=(0,0,-9.81),damping=0.4),
 PyRunner(command='checkUnbalanced()',realPeriod=2),

]
O.dt=.5*PWaveTimeStep()
O.trackEnergy=True
def checkUnbalanced():
 if unbalancedForce()<.05:
  O.pause()
        O.save('final.yade.bz2')
O.run()

script2 which should be run after script1, and you are expected to meet situation2 and situation3:
Gl1_Sphere.quality=3
O.load('final.yade.bz2')
for i in range(10):
 O.bodies.append(sphere((i,i,i), radius=0.5, color=[1, 0, 0]))

Thanks in advance!
Leonard

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Robert Caulk
Solved:
2019-08-30
Last query:
2019-08-30
Last reply:
2019-08-30
Best Robert Caulk (rcaulk) said : #1

Thanks for the proper MWE :-)

The solution, reload the 3D view.

Cheers,

Robert

Jérôme Duriez (jduriez) said : #2

Hi,

It has to do with "clipping planes" properties and (from my experience) the order of (inserting bodies) - (calling for the 3D view) operations (though I do not know the exact behavior)

For another MWE (which I can not fully interpret either..):

yade.qt.View()
O.bodies.append(sphere((0,0,0),1))
# go with the mouse through the GUI to "Display" - tick "clipPlaneActive 0" - set "clipPlaneSe3 0." to 1. - 1. - 1. for the pos, and you will make the sphere disappear.

Robert Caulk (rcaulk) said : #3

I am not sure the problem he mentions is to do with clipping planes. It is more of a rendering scale/orbit centering problem, if I had to describe it without any technical understanding of the 3D renderer source code. He has his spheres rendered at a small scale and the view displays them with a proper render scale orbit center, as soon as he adds these huge spheres spanning beyond the original render scale and orbit center, the view has trouble displaying the properly. By restarting the 3D view, it resets the scale and the orbit center.

Clipping planes on the other hand are used in the same manner as paraview "clips", it removes any visualization beyond a certain plane allowing the user to look inside the specimen.

Leonard (z2521899293) said : #4

Thanks Robert and jduriez,
Reload the 3D view can solve the problem with situation2 and situation3.
However,it seems that situation 1 can not be solved by reloading 3D view.
I am trying to make a MWE for you to diagnose, before it, could you please give me some clues to solve it?
Cheers!

Robert Caulk (rcaulk) said : #5

>I am trying to make a MWE for you to diagnose, before it, could you please give me some clues to solve it

As of right now, I am unable to recreate "Situation 1" using the MWE you posted. So the possible causes for "Situation 1" are endless.

Leonard (z2521899293) said : #6

Thanks Robert Caulk, that solved my question.