Hi everyone,

I have a series curves, one up one according to Z-axis. However, the number of the curves is not continuous in Z-axis. How can I renumber the curves?

How I show curve number:

Thanks!

renumber.3dm (229.2 KB)

Hi everyone,

I have a series curves, one up one according to Z-axis. However, the number of the curves is not continuous in Z-axis. How can I renumber the curves?

How I show curve number:

Thanks!

renumber.3dm (229.2 KB)

if youâre bringing the curves from rhino in the first place, why not simply select them âin orderâ (bottom to top or vice versa)?

I canât open your R6 file in R5. What it looks like is that you want to sort the curves in Z-order? There are several ways to do that, easier done than explained.

Hereâs the general idea using planar curves I created: (internalized)

sort_curves_2019Jul10a.gh (10.1 KB)

Your curves, however, look more complicatedâŚ not planar and not all starting at the same place, so that could mix things upâŚ standby.

OK, I divided each curve into ten points and used their `Average` (roughly center) for the sorting. The âTree/List Viewerâ is just a trace tool for examining trees of geometry in a visual way.

sort_curves_2019Jul10b.gh (126.5 KB)

All curves internalized, no need for Rhino file.

P.S. To explain further, `Sort` is sorting Z values and the `Avr` points (âAâ input) and curves (âBâ input) get sorted in the same sequence as the âKâ (Keys) input.

Thatâs a great job, Joseph!!

Thank you so much for your kind and prompt help!

Well, this isnât infallible. Irregular curves could mix it up, requiring more effort to determine valid Z values to sort by. But this is the general idea.

The more I use it, the more I like it. Thanks again!

They `Loft` better when sorted, eh? But I see two areas that look ugly (twisted), even with âAlign sectionsâ enabled. Still needs work?

To get a clean `Loft`, I added an **Anemone** loop (white group) * after* sorting them in sequence. It flips each curve and adjusts its

sort_curves_2019Jul10c.gh (131.8 KB)

P.S. This is what `Loft` produces at three stages of the model. Left to right, below:

- raw curves, unsorted
- curves sorted by Z value of
`Avr`points - sorted curves after Anemone with matching directions and seams

2 Likes

WowâŚJoseph, your work is fantastic!! And thank you so much for your kindness! I really need some time to fully understand your code :).

1 Like

Hi Joseph,

Here is a new problem. As you see the pic, this kind of curves still has the problem of sorting. Coul you please help me have a look?

Thank you again!

curves.3dm (907.7 KB) sort_curves_problem0827.gh (28.4 KB) )

There is no magical best solution that leaps to mindâŚ Maybe sort the rings by the highest point on each ring? Seems to work, didnât check all possible cases.

sort_curves_problem_2019Aug28a.gh (28.8 KB)

1 Like

Hi Joseph, thank you so much!!

Actually I had the same idea (find the higest point) of youâŚ However, I canât realize it in GH :).

I think your method can be suitable for most my cases.

Nice job!