Grasshopper

algorithmic modeling for Rhino

Hello,

I think the solution is quite simple but I can´t find the right way at the moment.

the case:

I have multiple lines that I want to divide into points with a set distance of 3.4m. I don´t need the last point since the distance between the last point of the division and the end point of the line is smaller than 3.4m.

so what is the easiest way to get rid of those points? I attched the file (I use the old version of GH for Rhino 4)

thanks in advance!

Andreas

Views: 491

Attachments:

Replies to This Discussion

Cull Index with the index set to -1.

--

David Rutten

david@mcneel.com

Thanks a lot. It worked. That was fast!

Another quick question. If i have a list of e.g. 12 values (points, lines etc) is it possible to extract the number of points and simply transform it into a single numeric value. So 12 lines -> a value: 12?

Bit trickier. You can often convert data to Text, which then allows you to see what sort of data type you had. But this doesn't always work. You can use a Match component to test the text against a wildcard pattern, which gives you False (=0) for text that doesn't match and True (=1) for text that does. You then have to add all of these boolean values together:

--

David Rutten

david@mcneel.com

Attachments:

thank you. i will give it a try.

Another way is simple casting, if you don't mind red components...

But I like David's solution better!

Cheers

Casting is problematic as it often works between different data types.

--

David Rutten

david@mcneel.com

I stumbled upon a problem with the first issue, deleting the last point...

The input is only a couple of points but the amout of culled points is very huge.

what did i do wrong?

Wrap should be set to True. Not have the points fed into it. 

ok, thanks. I don´t really get it though. What exactly is the "Wrap" for? What is the function?

Wrap allows a list to act continuously i.e the next point in the list after the last point is the first one and the previous point in the list before the first one is the last. Therefore if you have a list of 5 items 0,1,2,3,4 where 4 is the last item in the list and you have wrap set to True then 4 can be numbered as -1 or as 9

Think of a wrapped list as circular

ok, got it. Thanks for the help. Much appreciated.

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