# How to set a circle?

I want to use particles to form a circle, and these particles are combined along the circumference of the circle. How do I set it?

## Question information

Language:
English Edit question
Status:
For:
Assignee:
No assignee Edit question
Last query:
 Revision history for this message Jan Stránský (honzik) said on 2022-04-12: #1

Hello,

once again, please read [1] and provide (much) more context and information.

Cheers
Jan

 Revision history for this message 孙灿 (suncan) said on 2022-04-20: #2

In a two-dimensional context, I need to use particles to form a ring, as if it were a tire. The particle radius is 0.05, now I need to use these particles with a radius of 0.05 to form a circle with a radius of 1, note that only a circle with a radius of 1 is composed, and there are no particles inside this circle, just like the tire, the material makes up the outer part of the tire, but not inside.

 Revision history for this message Jan Stránský (honzik) said on 2022-04-20 #3

Cheers
Jan

 Revision history for this message 孙灿 (suncan) said on 2022-04-20: #4

I saw another problem, but it wasn't solved very well and it turned out to not work.

 Revision history for this message 孙灿 (suncan) said on 2022-04-20: #5

The display result is: invalid syntax

 Revision history for this message Jan Stránský (honzik) said on 2022-04-20: #6

> but it wasn't solved very well and it turned out to not work

What you asked is solved in [2], #12. I have just tried it again and got excellent ring of spherical particles.
If it is not what you want, then describe your problem better.

> The display result is: invalid syntax

solution: fix the invalid syntax

If you want a better answer, provide a better question.
In this case, provide the code causing the error ([1], point 3) and complete error ([1], point 2)

Cheers
Jan

 Revision history for this message 孙灿 (suncan) said on 2022-04-24: #7

Can I use 0.bodies.append() for Generating ring. I think of facet.In addition，Can I use facetCylinder to generate a cylinder.

 Revision history for this message Jan Stránský (honzik) said on 2022-04-25: #8

> Can I use 0.bodies.append() for Generating ring.

depends on the definition of "Generating" etc.

Definitely you do not use 0.anything, you would get "SyntaxError: invalid decimal literal". Use O (unicode u004f [3]) instead of 0 (unicode u0030 [4])

From my point of view, O.bodies.append is for adding already generated particles to simulation, not the command for generating. Although it could be accepted that adding to simulation is a part of generating.

> The particle radius is 0.05, now I need to use these particles with a radius of 0.05 to form a circle with a radius of 1
> I think of facet

> I think of facet.In addition，Can I use facetCylinder to generate a cylinder.

Yes, using facetCylinder to create a cylinder made of facets is probably the best practice.

Cheers
Jan

 Revision history for this message 孙灿 (suncan) said on 2022-04-26: #9

> O.bodies.append is for adding already generated particles to simulation, not the command for generating. Although it could be accepted that adding to simulation is a part of generating.

I can see what you mean, but I find that I don't use O.bodies.append. In the run just now, I found that there was an error in my code, and this part of the code is as follows:

sp = pack.SpherePack()
sp.makeCloud((0, 0, 0), (1, 1, 1), rMean=.05, rRelFuzz=0)
sp.toSimulation()

I think there's something wrong with my code.

 Revision history for this message Jan Stránský (honzik) said on 2022-04-26: #10

> there's something wrong with my code

yes, as the error after running it suggest, there is SyntaxError: invalid syntax.
You have unbalanced brackets on the first line (different amount of left and right brackets), the interpreter then does not know how to interpret it.

What do you use for editing this python file? Any IDE or text editor for source codes should discover and emphasize this fact..

Cheers
Jan