Topography surface from contour lines (irregular area borders)

Hello!
I’m struggling with a grasshopper script to create a surface from contour lines imported from an Autocad file. The script works fine, when the area is rectangular or quadrangle (the green outline in the picture) but doesn’t work when it’s a polygon (the red outline).




contours to surface.gh (22.3 KB)

I don’t know why it happens. Is there some other function that would work with the irregular outline (instead of Divide Surface)? Or should I somehow divide the irregular surface into quadrangles? I also don’t know how to do that…

I attach the Rhino file in case it would be helpful to understand the problem: WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free

I would much appreciate any help. Thank you in advance!

use subd for approximate surface → it doesn’t follow the curve precisely, but close enough
contours to subd.gh (87.6 KB)

it take a while to calculate

1 Like

another method, using bounding box. the resulting surface needs to be trimmed.
in the gh file, there’s a trim method, but it takes a while - so enable it to see.
contours to surface_by_bbox.gh (26.0 KB)

1 Like

Thank you Adel! In my file there is a warning, did it run properly in your case? I was missing Pufferfish plugin but I installed it

Hi @Klaudia . What rhino version are you using?

If this is the second GH file then towards the top there is a scale component. Right now is set to scale by 1.1. try increasing it to 1.5 or so

I’m using Rhino 7

@Klaudia give a moment, i’ll convert the gh to rhino 7

1 Like

@Klaudia
there they are
contours to surface_by_bbox[r7].gh (30.2 KB)
contours to subd [R7].gh (86.3 KB)

1 Like

I’m not at my computer but I believe there is a much simpler way to do this/speed this up with divide curve, patch, pull curve to patch, and surface trim then list item index 0 to return the single largest surface aka your topo.

By using divide curve initially you can have better control over your point sampling and I would also add a cull duplicates node in there to get rid of any points within a very close tolerance before you send to patch node.

1 Like

Thank you Abel, now it works perfectly :slight_smile:

1 Like