Issue with rs.DuplicateMeshBorder

Hi!

Here is an issue I have with Rhino8 version of DuplicateMeshBorder, using IronPython for scripting. Here is what I get:


The contour is shown in purple. Instead of having one closed contour, i get 2 pieces of contour which I’m unable to rs.JoinCurve since there are some pieces of polyline (shown with red arrows) that prevent polylines from touching at their ends.

Here is the 3dm containing the mesh:
Bug_MeshBorder.3dm (106.7 KB)

In Rhino 7, these inputs give one closed contour. Here is the code I use, using the .3dm:

SplitMesh = rs.ObjectsByLayer(“SplitMesh”)[0]
MeshBorder = rs.DuplicateMeshBorder(SplitMesh)

Thank you!

The file uploaded is not a 3dm file.

Sorry for the mistake: The .3dm is now uploaded

I’m not sure why this works in Rhino 7 but not in 8. I can duplicate the problem just using the DupBorder command.

It looks like the problem is with the mesh itself, it has a few faces which should be joined, but have a naked edge between them. The outline curve that is in the document also shows this.

A way to fix this, is to run the MatchMeshEdge command prior to duplicating the border.

image

1 Like

Thank you, this works and is the fix I needed.

Speaking of MatchMeshEdge, I have an issue with it, as it does not produce exactly the same output each time, using the same inputs. This time, the behaviour is both with Rhino 7 & 8. Here is a link to a previous post about it. Do you have an idea what can be the problem?

Thanks again!

Hi!

Here is another case I struggle with, using rs.DuplicateMeshBorder. This time, I get an open contour either with Rhino 7 & 8, after having used MatchMeshEdge. Is there something I can try to fix that?

DuplicateMeshBorder_V2.3dm (57.0 KB)

Thank you!

Hi @Alexandre_Filiatraul,

Run Rhino’s MeshRepair command - it will describe the issues this mesh has.

– Dale

Thanks Dale. You’re right, my mesh has 2 non-manifold edges. The MeshRepair command do repair it successfully, but I would really need to get that without user interaction. Is there a way to do so using IronPython? So far, i’ve tried this, without success:

cmd = "_MeshRepair Selid " + str(SplitMesh) + “Enter Enter” # Manual only; and the scripts continues before the mesh is repaired!
rs.Command(cmd, echo=True)

Thank you!

Hi @Alexandre_Filiatraul,

The MeshRepair command is not scriptable. However, much of what the command does is exposed in RhinoCommon.

In your case, you might have a look at these:

Mesh.ExtractNonManifoldEdges

MeshFaceList.ExtractDuplicateFaces

– Dale