makeClumpCloud from regularHexa pack

Asked by bruna

Hi everyone!

I am trying to use makeClumpCloud using a clump c1 that I have created. This is the clump:
c1 = pack.regularHexa(pred,r,-.00000005,color=(.5,.5,.5))

When I use makeClumpCloud, yade returns this error:
TypeError: No registered converter was able to produce a C++ rvalue of type boost::shared_ptr<SpherePack> from this Python object of type list

I am trying this:
sp = pack.SpherePack()
sp.makeClumpCloud((0,0,0),(2,2,2),[c1])

My question is if makeClumpCloud accepts clumps that were made using the regularHexa package of spheres. If no, there is another manner to do a sample from a pre-created clump?

Thanks a lot!

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Hi, the answer is yes.

Please send working examples [1], not just isolated lines it is easier to test and answer.

Bruno

[1] https://yade-dem.org/wiki/Howtoask

Revision history for this message
Best Jan Stránský (honzik) said :
#2

Hello,

> TypeError: No registered converter was able to produce a C++ rvalue of type boost::shared_ptr<SpherePack> from this Python object of type list

as the error says, the function expect SpherePack, not just list of spheres. You can try something like (not tested):
###
c1 = pack.regularHexa(pred,r,-.00000005,color=(.5,.5,.5))
spc1 = SpherePack()
spc1.fromList(c1)
sp = pack.SpherePack()
sp.makeClumpCloud((0,0,0),(2,2,2),[spc1])
###

cheers
Jan

Revision history for this message
bruna (brunamot) said :
#3

Thanks Jan Stránský, that solved my question.