Grasshopper

algorithmic modeling for Rhino

I'm having a lot of issues with data matching. Basically I took a icosahedron and played with it. However, the stuff on each face of the icosahedron wants to match itself differently. So as you can see from my bloated definition, I had to explode and manipulate each branch/face.

From my geometry you can see there are pentagons and there are triangles. The yellow group is connecting the vertices to make likes, and the mint green group is making surfaces from those lines.

I had to explode the tree because the points and lines were all ordered differently for each face, and that made weird lofts, or the lines crisscross, so I had to go in and change numbers in the list item, or change the direction of lines in an attempt to normalize each face.

Please tell me there is a way to sort items in a list so that they are all the same, so that I don't have to explode it!

Views: 1984

Attachments:

Replies to This Discussion

I am a long way off expert, but I think you can do this sort of thing in a few different ways.

Straigtforward lists of data can be manipulated using ShiftList, SortList etc.

If you have data trees, there are ways to remap the data (PathMapper etc) and there's an excellent tutorial by David Rutten about path mapper on this forum somewhere.

And always look at whether you simply need to flatten your data to ba able to work with it.

For point lists I often use the PointNumber component to help visualise the data and the good old Panel component helps too!

When you see some of the elegant, compact definitions on here, there often seems to be some mystical foresight needed right from the first component but hopefully this jedi skill comes with practice!

Hi Martyn,

I do think the sort list would be the most elegant approach. I started to work towards a solution here.

What I have is a list of 6 points on 20 branch, I don't want to flatten it. In order to sort them, I figured I would take the 0 item on each branch and find the distance from it to its neighbors.

I got 5 distances, then I added 0 to the list to get 6 distances.

I sorted the list of points and then tried to find the 0, 2, and 4 indices and connect them to the 1,3, and 5 indices respectively.

If everything work out, which it hasn't, then you would see complete pentagons with no overlapping lines.

Would anyone be willing to take a look at my definition (which I cleaned up! It's not big anymore!)

and let me know what's wrong?

Thank you!

Attachments:

I'm not sure what your end result should be but this is how I would collect the points into Pentagon Groups

Attachments:

Hi Danny!

Thank you for giving it a shot. That is not exactly what I wanted. I'm sorry for not being descriptive enough. It's not so much grouping them into pentagons, as much as making lines that relate to triangles. You can see the triangles up in the first image of the post.

I think I figured it out though. When I sorted the points by distance, there were duplicate distances (ex. 0,1,2,3,3,5). So grasshopper picked among the duplicate distances which led to variation in my sorting.

I'm on Rhino4 so I got some errors when i opened your file. My first thoughts were that the way that the point sets are numbered didn't seem to have a nice pattern to them, and I was going to suggest trying to start with more uniformly patterned point numbers to make sorting through them easier... i.e. numbered 0 to 4 clockwise around the pentagons.

But then Mr Boyes just went and solved it anyway!

Tried to solve you question over lunch as the bigger code interested me but could not open that file so looked at your second simpler question and in the process seem to develop a way to maybe create your picture you first posted.

Hope this is some help.. and not seen as trying to be clever.

There are many ways to 'skin a cat'  as they say in GH.

Matt

Attachments:

Thank you Matt! That looks like what I needed.

It is a little complicated but in time I think I'll understand it.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service