Grasshopper

algorithmic modeling for Rhino

Hi everyone,

I received a file with a series of panels made in Rhino and asked to make them into a list of value of their coordinates in (x,y,z) while grouping these values to their corresponding panel as I have simply done grouping them in paths in the picture below.

 

However, how can I have all the coordinates for each panels (paths) to list its coordinates in a counter clockwise order. Right now each panels are listing their coordinate sometimes clockwise sometimes counter-clockwise or sometimes in a weird x order, which I guess came from the fact that the panels were created separately in Rhino.

 

Thank you for helping

 

Cheers

Mark 

 

 

Views: 1483

Attachments:

Replies to This Discussion

Hallo (again) Mark,

In future, it might be good to post a sample Grasshopper (and Rhino) file here, makes it easier to figure out a solution. But for now, you can try the following steps:

  • Get the area-centroid point of the panel and create vectors from this point to all vertex points (Vector 2Pt component).
  • Calculate the angle between the first vector in the list with all the vectors in the list (Angle component).
  • Sort the list of vertices based on the angle.

This method might be a bit slow since you have to calculate the area-centroid of all the panel surfaces. As an alternative to area-centroid, you can try getting the polygon-center of the edge of the surfaces, it might be faster.

Or maybe, create a circle that fits through all the vertices, and get the center of this circle. Hmmm....maybe you can even sort the vertices along the circle using the Sort Along Curve component!

Cheers,

Sridevi

Hey Sridevi,

Thank you for you reply again! this is a good idea but I couldn't make the count to go fully counterclockwise. What I have thus far is

1) bottom left

2) bottom right

3) top left

4) top right

what I need is 1 2 4 3. I could just flip 3 and 4, but I'm afraid this specific customization wouldn't be effective to other surfaces as some twist and turns.

Also another problem is that it seems fine on a single surface but when I tried to set the surface to multiple surface it evaluates everything as if one surface. I hope it can evaluate every surface individually without having to copy and paste the same script.

 

Thank you for your great help

Cheers

Hey Mark,

Can you post a sample file here?

Cheers,

Sridevi

Not sure if this (screenshot) works, but you can give it a shot.

Here I added a plane in which the vector angles have to be calculated. I forgot to mention this step before.

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