Close mesh gaps

I’m trying to script ‘a close mesh thing,’ but it’s not working, what am I doing wrong?
Thanks in advance for your response.

I try to do it like in this post

20181017 problem fill mesh gaps (8.1 KB)

There is now mesh.FillHoles();

1 Like

Thank you.

I cannot find it at
How can I use it?

F5 gives me True, but not yet mesh closings (I do not know how to use it, it is my lack of knowledge of scripting).

It looks like it is new to Rhino 6. I don’t think it is available in Rhino 5.

Ah thank you!

Uhmm… hm… hm…
I have some difficulties with understanding how it works. It does not work in my case.
20181017 problem fill mesh gaps (13.5 KB)

Both Fill holes and the the polyline method are not always great, It really depends on the opening. It usually only works for things that are somewhat planar and doesn’t double back over itself. Similar to something like delaunay triangulation. Can you post your mesh?

You mean this with ‘mesh’ right (the one I previously posted before)?
20181017 problem fill mesh gaps (13.5 KB)

Some issues with yours is that you say a = filHoles, but you don’t actually have anything called a on the output. it would be like fillHoles = a instead, but the way you are doing it tests the boolean - so the output will be “true” that it filled. Your code should just be like the below screenshot. But as i said this kind of hole is not suitable for an auto algo (you will get the same results trying to do the polyline method as well). In this case you will need to devise your own method - personally i would split the geometry at the cplane and loft the naked edges together since it seems your geometry is mirrored across the cplane (world xy). (10.3 KB)

1 Like

Thank you for your response.
Ah, yeah the ‘a’ I knew about that, I saved it wrong accidently.

I see the back is filled, and also that it is not possible to fill the other gaps. Hmm… it is probably about the naked edges in my model that are not correct somehow.

Does their exist something like deleting the non-naked-edges you know of?

It is now mirrored, but it would eventually be more complex because of displacement between the mirrored ones

It has nothing to do with extra naked edges, you can remove them by welding (in this case I use mesh edit weld), The available auto fill algos just do not like that polyline, You will have to think of your own custom logic. As far as filling mesh holes there is no one good answer, it is one of those things where the solution is usually based on the specifics of the mesh. You might need to develop a component which tests for situations and based on them it decides which way to close it via if statements or switches. (if this doesn’t work, try this, and so on and so on)

1 Like

I tried it for a couple of hours to close the my mesh gaps. I cannot figure it out yet. Do you have an idea how to close the gaps from these start curves and points shown in the image (a component?)?

20181017 problem fill mesh gaps (23.3 KB)

20181017 problem fill mesh gaps (10.6 KB)



I was almost there… and yours works way better… :smiley:

I am so happy now :smiley:

For what its worth, this appears to be some limitation of the TriangulateClosedPolyline method:

181018_problemfillmeshgaps_TroubleShootAHD_' (8.9 KB)

Perhaps something for the McNeelies to have a look at? Or maybe it just wasn’t designed to handle cases such as this? Either way, you probably want to weld your edges and ensure that your normals are unified and such, before running either of the suggested algorithms:


Indeed, the FillHoles method has the same limitation (which I suspect uses the triangulate polyline behind the scenes)

1 Like

When working with it, I was not able to apply it on every case.

I’m now trying to script ‘a way to pop lines and keep the breps,’ but it’s not working successfully yet.
It might be a shorter shortcut than I previously tried. I now try to filter the breps with python, I think I am close, but could not let it work properly.

I now only leaves the lines instead of the breps I want.

20181019 python pop lines (10.5 KB)

I took the border curves of the meshes, rulesurfaced them, cleaned it with this below.
20181019 python pop lines (8.7 KB)

I tried to close my mesh gaps with my ‘python shortcut’ method. However, it is not closed. Do you know what I am doing wrong, the mesh seems closed to me.

The former to me given methods does not work in all my cases.

20181017 problem fill mesh gaps (17.7 KB)