Mesh.CreateFromBrep fails

I know similar issues have been reported before.

I use these settings to mesh more than thousand solid Breps that I created before programatically.
Meshing fails on two of them.

two of four Breps fail to mesh in RhinoCommon.3dm (1.6 MB)

open Rhino.Geometry

let meshing =
    let m = MeshingParameters.FastRenderMesh  
    m.JaggedSeams <- false
    m.ClosedObjectPostProcess <- true

for guid in rs.ShownObjects() do
    let brep =  rs.CoerceBrep(guid)
    let mesh = new Mesh()
    Mesh.CreateFromBrep(brep,meshing) |> Seq.iter mesh.Append
    print mesh.IsValid

I could narrow the problem down a bit:

I am on Rhino 6.20.19322.20361

Hi @Goswin,

This code seems to produce closed meshes (no naked edges).

import Rhino
import scriptcontext as sc

def test_mesh_breps():
    filter = Rhino.DocObjects.ObjectType.Surface | Rhino.DocObjects.ObjectType.PolysrfFilter
    rc, objrefs = Rhino.Input.RhinoGet.GetMultipleObjects("Select surfaces and polysurfaces to mesh", False, filter)
    if rc != Rhino.Commands.Result.Success: 
    tol = sc.doc.ModelAbsoluteTolerance
    mp = Rhino.Geometry.MeshingParameters.Coarse
    mp.JaggedSeams = False

    for objref in objrefs:
        brep = objref.Brep()
        if brep:
            results = Rhino.Geometry.Mesh.CreateFromBrep(brep, mp)
            if results:
                mesh = Rhino.Geometry.Mesh()
                mesh.HealNakedEdges(tol * 100.0)


Does this help?

– Dale

thanks for your fast reply @dale, it helped !