← Back to team overview

yade-users team mailing list archive

[Question #277328]: Generating traingular wedge predicate for randomDensePack

 

New question #277328 on Yade:
https://answers.launchpad.net/yade/+question/277328

Hi all. I'm a new user of YADE and I'm currently trying to model an avalanche down a slope of variable angle (pi/6 - pi/3). I'm currently using yade.pack.randomDensePack to generate a box of particles to slide down the slope. However, I want to generate a wedge that matches the angle of the slope, essentially a triangular prism with the triangle being a vertical edge, a horizontal edge, and the diagonal edge, extended uniformly across the width of the ramp. I can't figure out how to do this using the existing tools.

Here is the existing code that I'm using to generate the box.

pred=pack.inAlignedBox((-.1,-.05,-.1),(.1,.05,0))
SpherePack=pack.randomDensePack(pred,spheresInCell=2000,radius=.005,rRelFuzz=0,color=(0,0,1),material="sand",returnSpherePack=True)
SpherePack.toSimulation()

I thought I could achieve the desired result by subtracting another inAlignedBox from the predicate like this...

pred=pack.inAlignedBox((-.1,-.05,-.1),(.1,.05,0))-pack.inAlignedBox((-.1,-.05,-.1),(.1,.05,0),orientation=Quaternion((1,0,0),pi/4))

...or something similar, but it doesn't work.

Please let me know what the easiest way to generate this triangular wedge predicate is.

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