← Back to team overview

yade-users team mailing list archive

Re: [Question #699286]: Scene radius must be positive - Ignoring value

 

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

    Status: Open => Answered

Karol Brzezinski proposed the following answer:
By expected radius, I just meant how big is your model. Let us say all
the particles should be contained in a box 1x1x1 m. So you expect them
to be no further than approx 2 meters. If your simulation exploded or
some of the particles leaked out of the box, the size of your model will
be much bigger (like 10 000 m) and you won't be able to see any details.
That is why, I advised removing the particles. If you want to keep only
the particles not further than two meters from the origin set maxDist =
2, and use the code that I proposed earlier. It will not fix your
simulation or anything, but you might be able to solve the visualization
problem (and discover that it is not the problem, the output of the
simulation is). Or instead of removing particles, you can just count the
particles further than a certain radius. It will not fix the
visualization issue, but it won't mess your simulation and give you the
answer "how bad is it?":

### 
maxDist = 2# change it to some distance representing expected size of your model
counter = 0
for b in O.bodies:
    if b.state.pos.norm()>maxDist:
        counter += 1
print('{:d} particles escaped from your box ;)'.format(counter))
###

Cheers,
Karol

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