Grasshopper

algorithmic modeling for Rhino

hi all, I have a list of arcs, and I'm trying to sort them by their length, but whenever I use the sort command on the list of arcs, it converts the list of arcs into a list of numbers, which represent the lengths of the arcs.  I don't want to go about rebuilding the arcs, so is there an easier way of sorting the arcs by length?

Views: 881

Replies to This Discussion

If you want to sort by length, you'll have to compute the length. You can either do so specifically using the Length component or you can rely on the automatic conversion that happens when you plug arcs into a number parameter.

Just be sure to plug your original arcs into the second Sort component parameter to sort them synchronously along with the lengths.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Ok I thought that would work, but turns out it's a bit more complicated.  I need to keep the arcs in the same order.  so when I sort the list, it ruins the order of the arcs.  basically what I need to do is just delete the smaller arcs in the list.  I have a list of 6 arcs (that were generated from 3 circles that I split with points), and I need to grab the bigger circle of each arc.

Are these 6 arcs in a single list? Do they have the same radius but different angles? Do they have the same angles but different radii? Do you want to remove the three shortest arcs or the three arcs with the smallest angle domain?

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Heres the definition, this should clarify things.  look for the big yellow box at the bottom to see the part I'm having trouble with.

Attachments:

never mind, I figured it out.  the solution was just to average all the distances and then do a dispatch where the parameter was true if the length was larger then the average length.

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