# Any curve to optimal arcs

I’m looking for solution to convert any curve to possible smallest amount of arcs. I know there is convert curve to arcs component but there is no enough input options to create smallest amount of arcs with optimal lengths.

I’ve found some threads at old forum:

There is @DavidRutten BiArcFitter.gh but it uses equal lengths of arcs.

Is there a way to optimize this script
crv_to_arcs_1.3dm (53.1 KB)
crv_to_arcs_1.gh (35.9 KB)

to be more automatic that it chooses the best length and radius values itself or at least just with tolerance or number of arcs.

When I make it without gh I’m using circes, tangents and trim.

I’ve also tried like this but I don’t know why tangent circle center isn’t where it should be.
crv_to_arcs_2.3dm (49.9 KB)
crv_to_arcs_2.gh (26.7 KB)

I will be grateful for any smallest hint.

Hello, it seems an interesting problem but did you test lunchbox_arcs_sample.gh in this discussion (you mention) ?

It uses genepool so if you choose just to put 6 gene it will give you a 5 (6-1) arcs approximation.

Thanks. It’s better but is it even possible to automate value selection at gene list? (e.g. depending on the control points of the input curve)

Yes it is possible I have done that. But not with my pc for 4 days

Can you describe where to start? Is it good idea to set start value of each slider on gene list and test average distance between points on input and output curves and then automatically correct values?
I’ve way to set the values of a GenePool within a script at old forum but solution is from 2013, so maybe there is easier way now.

A bit late, but whatever here an idea that could be developped. I choose to make mutliple bi-arc curves depending on the number on the number of bi-arc. The placement of bi-arc end depends upon the summation of the curvature. I choose the curve that has all mid points at a distance lower than a precision that you need to provide.
bi arc.gh (18.3 KB)

1 Like