Grasshopper

algorithmic modeling for Rhino

I have a list of numbers wich will be sorted and applied on a circle shape. the list should be relisted

however, after sorted and applied on the circle, when the item '11.736144'(smallest) is next to the item '12.014258'(bigest), a clif merges on the circle.(Please refer to the pic for the data below)

In my case, 11.736114 should follow 11.808308 and be followed by 11.845867.


In another word, how to make sure the two neighbours of every item are of most closest to this item?


Hope I've make it clear..

appreciate.

Views: 1837

Replies to This Discussion

Sorry but: Huh?

You want to sort a list of items?

You want to display the sorted list along a closed curve (i.e. a circle)?

You wonder why there is a huge jump where the smallest and largest item meet at the seam of the curve?... now you lost me.

Please see this picture.  The colums' heights represent the data. the buttom is an arc. 

 

In the uper graph, please imagin when the points a and b connect together, the shape of the whole thing is not Smooth now.

 

What the case is to make the graph as the lower one shows. When points a and b connect, the shape is smoothly.

 

Please forgive my stupid.

 

There is probably a better (optimal) solution:

But I think making each neighbor always the closest is  impossible (in most cases).

Don't think there is a better way. You could shuffle the list, split it in halves and sort both parts in different directions. The closest to a balanced distirbution will be if you sort first and then dispatch every other, as you did.

The closest as possible values actually are the ones directly above and below in a sorted list. Take any value on a side. There will always be two values on the other side that are closer or at least as close as the neighbours on this side. That would be the one directliy above and below in the original list, which were dispatched to the other half.

I agree.

What if one value is random chosen, and then other values are dispatched. Is possible to define the result under this procedure

I can't see where your randomly chosen value fits in. The lists always will have to wrap at the glabal max and min values. Any other way will again create jumps.

You could shift the balance of values so the lines do not look so symmetrical. Is that what you want?

It is possible; classic case of grasshopper counter-intuitive logic impeding the ability of its users to solve simple problems coding could do in a doddle. Do this:

1. Sort your list

2. Create a mask that takes all the odd data items (item 1, item 3, item 5....) , and the other all even to create two new data lists (item 0, item 2, item 3... etc)

3. Flip one of the new lists

4. merge the lists back together ensuring they have been sorted such that the highest value of the two new lists about to be re-merged are matching (so sort one ascending, the other decending)

Problem solved

If you took time to read the posts above, you would have realized thats exactly what was intuitively done with GH (and in about 30 seconds, time to open Rhino and launch GH included).

You seem to hate GH, I see 2 solutions:

1. learn and get used to it if you think it can be useful to you (so you can post constructive answers or interesting questions)

2. give up with it (and you can quit trolling here)

Problem solved

Well put... I agree!

Thank you for not using rude words... I probably would have.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service