Grasshopper

algorithmic modeling for Rhino

Hi guys,

Is there a way to split a list when a "new line starts" as the image below indicates in blue? The grid is not regular so "flip matrix" would not work. I have also tried using distances to dispatch but faced another issue.

Many thanks,

Arthur

Views: 607

Replies to This Discussion

You can use this.

Order of points matter.

Attachments:

Absolutely brilliant!! 

Thanks so much Systemiq!

Two questions if you have time: 

-How does the C# script work?


int j = 0;
DataTree <Point3d> Tree = new DataTree<Point3d>();
{GH_Path Path = new GH_Path(j);
Tree.Add(x[0], Path);}

for(int i = 1;i <= x.Count - 1;i++)
{if (x[i].DistanceTo(x[i - 1]) > dist) j++;
GH_Path Path = new GH_Path(j);
Tree.Add(x[i], Path);
}
A = Tree;

 

-Can you use this to classify the polyline cells around the points?

It simply iterates through the points in the list, if there is a "row jump" (i.e. distance to previous point is > to some preset value) the current point is added in a new branch.

You can input the cells and they will get same data structure.

Attachments:

Excellent ! 

Merci beaucoup, ça marche comme sur des roulettes :)

This would be such a useful GH component !

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service