# Divide a circle by angles

Hi guys, I need to model this section in gh. What I have to do is to divide the big circles by angles and draw little circles at the division points as in the picture. So I need to be able to change the number and also the position of the little circles changing the angle on each section. So the angle should be my parameter.
I don’t know if there is a function to split a circle by angle or if I should write an expression for that.
Can someone help me?
Thanks

Put in Grasshopper category.

1 Like

If the angles for each circle are equal:
2pi / angle = number of angles
Use this number to divide the circle

Like this?

circle.gh (14.8 KB)

It could work but in this way I can only change the value of the angle and not the position of the small circles. I mean, as you can see from the picture the small circles have a specific position and they are spaced of a certain angle. With your algorithm, if I change the angle, the circles will not have the right position. This is important because the external circles are not close in the lower part and I have to find the right position to cut them.
I hope I explained it well

Here you go.

circle.gh (18.7 KB)

A circle has a domain of 20*Pi. This means that if you want to rotate them let say 90 degrees, you put a factor of 5.00. For 180 degrees it will be 10.00. You use that relation to calculate the factor you need for the angle of adjustment you need.

ciao, I think the most important step is to organize the data structure in such a way it will be as easy/natural as possible for you to handle all the newly generated sections

for instance, for each new section you will have to [manually/excel] input/update these data:

if the circles names are always the same (C1-to-C6 in same order than their radius) then that column doesn’t matter (you can auto-generate names C(n), C(n+1)…C(last) )

another important variable that you want to control -as you just pointed out- is the alignment of each subdivision pattern
for each outer circle, something like “are the small-circles-patterns aligned to North (Y axis) or South (-Y axis)?”

and then you have another variable, which is “should I ignore any of the division-points that I have just generated?”
in this particular drawing, you are ignoring these bottom points:

is this pattern identical for each section? or will it change for next ones, so you might want to be able to control it?

of course, if you are generating 5 sections in total, then do whatever you want
but if you have to generate many of them, then I would consider of setting up a proper data structure

I had something more elaborate but it’s this simple, except for one thing. Your image lists six circles (radius and angles) but shows only four???

divide_circle_2021Feb4a.gh (13.0 KB)

Yes I deleted the 2 external circles because the image was too big and the numbers weren’t clear.
Now I give a look at your algorithm but looks pretty good.
Thanks

That is extremely misleading! The innermost circle doesn’t match your image and I may have wasted a lot of time throwing away a more complex approach that matched your half angle offsets on alternate rows.

I don’t think it’s wrong.
Anyway, this is the image with all the circumferences.
If I make it smaller it’s impossible to understand something. That’s why I cut it.

You need a bigger screen. That image is only 987 pixels wide, barely half of my screen width.

The hardest part was understanding exactly what you want. I hope I got it right this time around.

circles_v2.gh (18.8 KB)

P.S. Where are we digging?

1 Like

Thank you so much
It’s a tunnel in Italy but I’m doing a thesis on how model it in bim and because I’m not used to this software I’m learning how to do it.
Thank everyone for your help. I appreciate it

1 Like

Please take more care and effort in preparing questions for this forum, such as a GH file that includes the list of angles so we don’t each have to transcribe (type) them from an image. Maybe the half angle offsets were not necessary? I used them at first and then threw them away. You can modify the values in my text panel list but I have no way of knowing if that algorithm is correct?

1 Like

Have a step-step look at the components in the definitions we posted for you. See what component does what and try to understand the logic. That’s an easy way to learn

1 Like