append clump given a position and rotation

Asked by rhaven

Hi,
I have a set of 5 clumps and I would like to append them (multiple times, e.g. 1000 times) to a scene. I have a list of locations and would generate (random) rotations for each clump to be appended.

With O.bodies.append() I am able to append a list of spheres to the scene however, I cannot position or rotate them without modifying the original clump first.

I've taken a look at the examples/clumps/replaceByClumps-example.py which uses makeCloud to generate spheres, then uses replaceByClumps to replace each sphere with one of three clumpTemplates. This is quite similar to my goal, however, I do not want to scale the volume of the clumps.

Is there a way to append clumps or clumptemplates to a scene with a given location and rotation?

many thanks
Jesse

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Hi,
Every yade body has a position and an orientation, and you can set them as you like before or after appending to scene:
myClump.state.pos=...
myClump.state.ori=...

It may look as if it doesn't work if you look at the 3D view but after one time iteration they will be effectively moved/rotated.
I hope it helps.
Bruno

Can you help with this problem?

Provide an answer of your own, or ask rhaven for more information if necessary.

To post a message you must log in.