Nurbs divide with arcs similar arc length with minimal deviation

Hi all,

I am working on a method to divide an arbitrary curve (nurbs or otherwise) into tangent arcs with with similar arc length and minimal arc radius types and minimal deviation from the original curve.

See attached definition.

I am stuck at not being able to fully optimize the deviation - ideally I could get the deviation down - it is marked in the example file. I’d like it to be within 10mm while having maximum 5 arc radius types with the curves being around 1500mm (apart for the end curves which can be shorter).

As you’ll see - I’m using Galapagos and the arc divide from LunchBox currently. I think the issue is that since I’m using arc divide the points my new tangent arcs are springing from are locked to the original curve. If they could move around perhaps it could be closer but I’m not sure.

Also, for whatever reason, my Galapagos definition seems to be working in a way that I did not expect as I have to oscillate between the annealing and evolutionary solver to minimize the deviation currently - not sure why.

Any ideas are very much appreciated and happy thanksgiving!!

arc_rebuild_example.3dm (99.2 KB)

Nurbs-to-SimilarArcLengths_positiveCurvature_03.gh (52.4 KB)

You might have better luck with this RhinoCommon method:

Edit: It appears to work quite well with your original curves:


190724_CurveToArcsAndLines_GHPython_00(1).gh (27.7 KB)

Hi Anders - It works but the problem is it has too many arc types (total count of radius) and I don’t have good control of the arc length as the minimum and maximum length do not seem to have the desired effect (ie that if I set a minimum and maximum value the range of lengths that output can - and do - fall out of that range).

Any ideas?

Hi all any other ideas on how to improve on what my script is already doing (or to do it in another way). I have had some luck in letting galapagos decide where to start dividing the original curve up into equal portions and then letting my new arcs spring from one of those points.

However, it is still not quite there and I still think if there was a method which would allow me to build tangent arcs with a more best fit mentality rather than dividing up the original line that would get me closer. I assume this may take some scripting as each curve would need to build off the previous curve. I am thinking almost like a Kangaroo mentality to finding minimal surfaces with springs/etc.

Anyway - thanks for any ideas and to Anders to pointing out that Rhino Method - I had not known about it previously.