Splitting a circle - weird result

This is odd - see attached code.

If I split a circle along a primary axis I get two results as expected…

…but offsetting the splitting line I get three results…

Strange??

Forum 1.dyn (18.4 KB)

1 Like

The answer can be demonstrated below which shows that a circle is actually a curve with coincident start and end point.

So I’m thinking I’ll have to create intersect points to place an arc by three points. Any suggestions?

Disable all geometry previews for the nodes currently on the graph, and then use a geometry.translate node to shift each node by a range of 0…8…4 and see what you get.

@BIMused you are right, it seems that a circle is actually a curve with coincident start and end point.
It means that if you cut along those points, you get 2 arcs (180° each one), otherwise you get 3 arcs.

If you are always splitting along the diameter (your line intersects the circle center), one solution could be to filter out the 180° Arc and recreate the second arc using the remainings 2 arcs:

Since the start-, and endpoint are the same, it’s one curve.
Therefor: a point at parameter 0,5 will be opposite of the startpoint thus splitting the cirle in 2.

1 Like

@Menno_Mekes good point, however the topic was about getting always 2 arcs when splitting a circle, no matter where is the line, and not how to find the line that is splitting a circle in just two equal parts.

What if I need to split with a line at 45°? Or with a line not intersecting the circle center?

I previously posted a solution for the case when the line is crossing the circle center, however it doesn’t work for a generic case. Here below is a better one, that should always work:

SplitCircles.dyn (32.0 KB)

2 Likes

Yes that will work. Here’s another solution that avoids the need to find intersects, noting that there needs to be some constraints around the offset direction, in this case negative, which is fine for my purposes…

Forum 2.dyn (11.2 KB)

@BIMused Yes that works too, but there are 2 problems:

  • You use GetItemAtIndex 1 and 2, however those indices are not always the one you need. I run some tests and saw that sometimes you need 0 and 2, or 0 and 1
    That is why I used the intersection method.

  • When you use JoinPolycurve, you get a polycurve made of 2 curves, that means that, for example, when you extrude those curves, you get a polysurface made of 2 sufarces.
    It might be a problem if you need to develop further your script. I used the arc recreation method for this reason.

You are right regarding the polyline, that is a fudge since what we’re looking for is a result of two arcs for any bisecting line.

In your example you will hit the same problem as you picked up in my code when you invert the inputs…


Here is a solution…
Forum 4.dyn (25.3 KB)

1 Like