# how to use clump to make a desired shape

hello
i want to use clump to cerat a tetrahedron，can you give me some advice?

## Question information

Language:
English Edit question
Status:
For:
Assignee:
No assignee Edit question
Last query:
2019-08-23
2019-08-26
 lip (mr.xie) said on 2019-08-22: #1

by the way, when the clump is created, i want to replace sphere which created by function makeCloud() by the clump, as far as i know, clump is a tuple object, so it do not have positon attribute, which make it can not replace the sphere according to the positon of sphere, can you give me some advice to help me solve that problem, lookforward for your reply

 lip (mr.xie) said on 2019-08-22: #2

Comment to my first question:
sorry for my misrepresentation, what i mean is not use clump to create a tetrahedron, Instead, what i want is create a clump in the shape of a tetrahedron

 Jan Stránský (honzik) said on 2019-08-22: #3

> can you give me some advice?
> can you give me some advice to help me solve that problem

sure:
- spend a few more seconds / minutes to formulate the question and comments
- write understandable description
- did you mean clump of spheres? whose shape is approximatelly a tetrahedron?
- write understandably (e.g. read what you have written before posting):
- cerat ... create?
- positon ... position?
- split very long sentence (like your #1) into logical pieces, preferably using a period symbol for that [1].
- use question marks for questions
- write what you have tried, why you did not try anything if it is the case, what and why did not work ...

I can **guess** what you probably wanted, but since it is just guess, I do not want to spent time on the solution

> which make it can not replace the sphere according to the positon of sphere

here I cannot even guess ...

> i want to replace sphere which created by function makeCloud() by the clump

sphere? spheres?
which WERE created?
makeCloud() is what? SpherePack.makeCloud()? (with MWE [2] there would not be a need to ask)
a clump is composed of its elements, so basically you cannot replace the elements by something which should contain them..

> as far as i know, clump is a tuple object, so it do not have positon attribute,

clump may be a Shape instance [3], or a body having Clump shape is usually referred as a clump.
Definitely it is not a tuple

cheers
Jan

 lip (mr.xie) said on 2019-08-22: #4

dear Jan:
sorry for wasting your time because of my unclear expression.
i am glad to say that what you guess is exactly what i want to ask.
i have two questions:
question 1:
how to use clump of spheres to creat a clump of tetrahedral shapes
question 2:
once the clump of tetrahedral shapes is cerated, how can i replace spheres by it,the spheres are cerated by sp.makeCloud(),

 lip (mr.xie) said on 2019-08-22: #5

by the way, the clump means a clump body

 Jan Stránský (honzik) said on 2019-08-22: #6

> sorry for wasting your time because of my unclear expression.

there is no wasting, because I did not even try to help you :-)

1)
create / import particles occupying desired shape and call e.g. O.bodies.appendClumped.
The specific steps depends on your situation, which was not described much.. like what spheres you want.
uniform vs. PSD?
regular vs. random packing?
create new spheres for it or use existing spheres from larger assemblies?
...

2) it is really not clear what you want to do. A clump is formed by spheres, you cannot replace them (or, it would technically replace the clump itself).

cheers
Jan

 lip (mr.xie) said on 2019-08-23: #7

> uniform vs. PSD?
i want to use PSD

> create new spheres for it or use existing spheres from larger assemblies?
i want to create new spheres for it

> it is really not clear what you want to do.
what i want to do is that:
first,create a clump such as :
clump1=O.bodies.appendClumped([\
])
second,create a binary sphere particles system contained both big and small particles,like that:
sp=pack.SpherePack()
sp.makeCloud((0.2,0.2,2),(2.4,2.4,18),psdSizes=[0.1,0.1,0.4,0.4],psdCumm=(0.0,0.8,0.8,1),seed=1,porosity=1)
third, replace the big sphere particles by cerated clump,like that:
for r,c in sp:
if r>0.1:
....#replace the sphere by clump

 Bettina Suhr (bettina-suhr) said on 2019-08-26: #8

Dear lip,

You might want to check the “trunk/examples/clumps” folder , for examples how clumps are defined.

Regarding your question 2: read the replaceByClumps-example.py example. Here, makeCloud() is used to generate spheres, which are than replaced by clumps.

Regards,
Bettina