Grasshopper

algorithmic modeling for Rhino

Hi all,

I am fairly new to GH, and I am trying to generate a workflow for my final year uni work.

I am currently generating a set of curves using Elk2 (GH plugin), which represents the centrelines of a motorway (aka Highway). However, the set of curves are combined in one list. I am trying to separate them based on their vector direction, but I am struggling.

As you can see on the image below, I have 33 curves.....

However, as you can see on the image below... there are two distinctive curves with opposing vector directions representing flow of traffic.

Ultimately I would like to bake them into two separate layers.

Thank you all :)

Views: 2186

Replies to This Discussion

Faris,  you can filter curves by the features key, there is posible to extrct and compare text.

The image is only as a guide, not a full solution:

if you need another thing, must providee more information.

Greetings

Marcelo,

Thank you for reply. That was somewhat helpful for post-processing data I am generating. I have managed to solve the question I had, and I thought I share it here.

  1. Divide curve to get the tangents (vector) of each curve as a list.
  2. Square root all the items within the tangents vector list. Therefore, every negative vector will return as a 'Null Vector'.
  3. As each curve is divided at least in two as the image illustrates below; using Cull Index, remove every 2nd sub-item of each item within the list.
  4. Run the list through two expression editors with the following test cases;

    if(x="Null Vector", "False", "True")
    if(x="Null Vector", "True", "False")

    Therefore, you will end up with two resultant lists representing each test cases.
  5. Using Cull Pattern, run the original list of curves with test cases, and join the curves. You will now have two curves, as illustrated in the image below. :)

definitition please?

HEEEEEEEEEEELP I need to separate a list of lines in the Y direction from a bunch of other lines in other directions

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service