Hi @René_Corella ,
Regarding your earlier comment — “since you didn’t say that the mesh topology must be preserved…” — you are absolutely right, and that was an oversight on my part.
I actually do need to preserve mesh topology, because the color data attached to the mesh depends on its structure.
My initial thinking was too naïve: I separated the problem into two or three steps — detect the holes, fill them in any convenient way, and then simply convert everything back into a mesh. However, after further testing, I discovered that this approach is extremely difficult to execute reliably, and I will explain more below.
On your question — “what is a ‘proper mesh or geometry’ for your case?” — I should have clarified this earlier (apologies for not specifying it in my first post).
My goal is to reconstruct the sliced surface into a single, continuous, watertight planar mesh, while preserving per-vertex color attributes.
Regarding the suggestion of calling Fill Mesh Holes directly from Python:
I tried this route as well.
My workflow was:
- extract all naked edges,
- join them into curves and discard open ones,
- remove the largest loop (outer boundary),
- feed the remaining loops to FillMeshHoles.
The difficulty I encountered was reliably distinguishing inner boundaries from the outer boundary.
As a result, the function ended up filling every closed loop, which produced multiple overlapping filled meshes (as shown in the image).
Technically it fills the holes, but the result cannot be used as a proper single mesh.
I also experimented with Delaunay-based patching.
It fills the holes neatly and without overlap, but introduces entirely new triangulation, meaning the original color distribution cannot be preserved, which makes it unsuitable for my purposes.
I hope the explanations above help clarify the constraints of my case and answer your questions.
Thank you again for your time and for the effort you put into exploring this problem — I truly appreciate it.