Hello All,
I have made this figure with 4 smaller circles connected by 2 concave arcs, 1 line and a convex arc.
As I decrease the radius of the convex arc it flips to the other side together with one small circle, like this:
Also, after I join these 8 pieces and then explode them, the result of explode is, somehow, 9 pieces and one of the smaller circles if broken in two.
These glitches are not super critical, but I wonder if knowledgeable people here could give me an idea what might explain this behavior, so I compose scripts more correctly.
Just saw this thread. Did you ever solve your problem? If not, I’d suggest taking my solution for the “tangent circles outside” and intersecting that circle with the two smaller circles you have. If you then shatter the large circle at these intersection points, you can sort the two segments by their length and always take the shorter arc, which should be the one you want.
Circle A B and given Radius R = 200
draw additional concentric circles with
R+rA
R-rA
around Center of A … same for B
the intersections of the “+r” and “-r” circles are already the searched center points.
some additional lines from the new Centers to the old Centers will give the start/endpoints of the searched arcs.
implementing above as c# script.
The script does not care about special cases (180-degree-arcs)
I tried to keep everything sorted. The order of input Circles matters.
I agree and your construction makes total sense.
But I have no clue how the version with 3 given circles is resolved - can’t wrap my head around the math formula that Ed proposed in his script.
Did not really solve.
I have a script that “kind of” works, but not really. Because the large curve flips to the wrong side par my 3rd image in the initial post.
the issue seems to be that when the radius of the large arc becomes small (below 280) and the tangent point goes past the “seam” of the small circle, for some reason the list item with index 0 starts to pick up the wrong fragment of the shattered arc:
i’ve put some effort in my script to keep the arcs sorted.
check the code, i wrote some comments.
(a) Basically with Vector-CrossProduct you can decide if a point is left or right of a line (in 2d).
(b) Rhinocommon intersection methods will provide the curve Parameter - I look at this as well to sort and pick the right Points.
(c) and - with a small performance disadvantage / laziness - I use StartPoint-PointOnArc-Endpoint to get the correct Arc.
The result of (1) - red group
do not trust the index it might change.
so you need to do some logic with the crossproduct to find the correct left or right-sided point.
same for the result of (2)
do not trust a fixed index.
again some logic to pick the correct result - i used (c) StartPoint-PointOnArc-Endpoint to get the correct Arc.
and as stuff get s complicated un unreadable quite fast - that s why I prefere to code it text-based.
Error (CS0246): The type or namespace name ‘CircleCircleIntersection’ could not be found (are you missing a using directive or an assembly reference?) (line 148)
Error (CS0117): ‘Rhino.Geometry.Intersect.Intersection’ does not contain a definition for ‘CircleCircle’ (line 148)
Error (CS0103): The name ‘CircleCircleIntersection’ does not exist in the current context (line 150)