CloseCrv along a polyline

Hi everyone, I’m making a topographic model and I’d like to close the curves, so I can create surfaces and extrude them. And I’d like to create a stepped model and not a Patch.

You can see when I use the CloseCRV command it creates new polylines that run point to point directly through the model. Does anyone know of a way to close the curves AND snap them to a perimeter line?


Hello - first, see if Join creates closed loops. Otherwise post a coupe of the curves.


Create a curve that represents the boundary of your model. Trim this curve with your topography curve, than join the remains of the boundary curve and the topography curve => closed curve

Unfortunately, join didn’t close the curves. How do you mean I should post a few of the curves? In what format?

Hello - Join, then if not closed, CloseCrv. Please post a Rhino file with a few of the problematic curves.


Would this method work even though the curves are in 3D and so each line has a different elevation?

Here you go…

a few lines.3dm (3.9 MB)

I see - you’ll need a script for this - I’ll see if I can make something that works.

@akeim I can make you a thing that returns both possible closed curves - is that useful? I am not sure how to decide, automatically, which one to give you, but I can do both. (2.5 KB)

To use the Python script use RunPythonScript, or a macro:

_-RunPythonScript "Full path to py file inside double-quotes"


1 Like

Yes, you would need a boundary curve for each elevation. It depends on the complexity of your model if doing it manually is acceptable or not. Maybe you could use Grasshopper.

1 Like

It would be pretty complex, so manually might not work. I’ve never used grasshopper before but it would be fun to learn.

Yes, gh can also help here I would think.


Pascal, that’s amazing! It worked quite well. The only thing is that the curves went the long way. Is there a way to make it close on the shorter side?

Hello - as I mentioned, it should give you both, I do not see how to know which one you want.


I see. So I was planning on making each of these surfaces and then extruding them all the same distance. I received this message likely because the circle closes both ways? What do you think?

Screen Shot 2021-09-23 at 5.03.27 PM

Hello - I would simply delete the ones you don’t want - a crossing selection in Top will get those - then, is there a problem with the reamining curves? If the orignal polylines self-intersect for example, that will cause this.

So, @akeim - some of your polylines extend past the circle and come back - my script assumes the end point is where you want to close them, it is up to you to have the curves set up as you want…


1 Like

I see - that makes sense. Thanks, Pascal!

Hi Pascal, is there a way to make it delete the initial curve during this process? As of now, you end up with three curves - one closed going one direction, one closed going the opposite direction, and the original open line. Any way to end up with just the closed lines and not the open lines?

Hello- @akeim - yes, updated above.


1 Like

Thanks, Pascal! I appreciate this.

@pascal it seems to be doing the same thing. what do you think?

Hello - set the command line option…