Understanding the Surface | Line Component

Good morning everyone,
I’d like to understand how the “Surface | Line” component works because it’s not giving me the expected results. Maybe I’m doing something wrong, and that’s why I’m writing this post.

Basically, I want it to generate the intersection points between the blue lines you see in the images and the extruded surfaces.

Can anyone help me?





If you add the script, it is easier to give some advice (otherwise we have to recreate it).

My advice is to just start simple: 2 surfaces + 1 line.
Output of Surf |Line component will give 2 points on output P.

1 Like

@Eef_Weenink Sure!
SURFACE_LINE.3dm (824.5 KB)
Intersection.gh (11.0 KB)

Hi Alessandro,

First, I would find the intersection points for each line separately (use Graft to place the lines in a separate branch). Once we get the intersection points, I would modify the data tree with Shift Tree to get four branches, where each list contains the intersection points for each line. Then, I will keep only the points that are placed on the lines.


Intersection-solved.gh (8.6 KB)

Hope this helps!

P.S. As a member of our course, feel free to post in our Skool group or send me a DM directly and I’d be happy to help you :slight_smile:

one important thing to keep in mind is that for Surface|Line intersections, Lines are infinite entities (not just as long as visualized on screen) which is the reason why these points are returned despite no Line being phisically there:

the second issue come sfrom the both the inputs being flat lists, so Lines/Surface are paired in the order they are found, and some of those do not return results because they actually don’t intersect the only surface they are computed with, for instance:

I’d suggest to not explode the curves before extruding them vertically, and use Brep|Curve intersection to get a result like

where you can easily identify which Brep and which Curve produced each intersection point from the data structure {A;B} which indicates {Brep_index ; Curve_index}

Intersection_Re.gh (11.7 KB)

1 Like

@howtograsshopper Hello Lazar, how are you?

I had tried to get in touch with Dusan, but next time I will contact you directly.
Thank you for replying! You know, I solved the problem by changing the component. I used “Surface | Curve” because, as @inno suggested, “Line” is an infinite geometry and wasn’t suitable for my case.
In fact, I also want to thank @inno because they helped me solve the problem!

In response to @inno , I wanted to say that I needed to explode the Brep into surfaces because I had to filter only the surfaces intersecting with the lines.
Anyway, if I used Graft and the “Surface | Line” component, I would still get some strange points due to the fact that “Line” is not the same as “Curve.” That’s why I tried to flatten the input list (I’ve only been using Grasshopper for a few months, so I’m still learning about data tree).

To conclude this never-ending post :smiley:, I thank both of you!

Good work!

1 Like