Weird render mesh after Brep.Join

I’ve extracted a surface of a brep and after running the Join method it returns a brep with a weird rendermesh. Judging by the isocurves the surfaces look identical though, so what’s going on? How come I get a different render mesh? And how do I prevent that from happening?



220402 BrepRenderMesh.3dm (180.8 KB)

Use this script on original surface to recreate:

import rhinoscriptsyntax as rs
import Rhino
import scriptcontext as sc

def test_join():
obj = rs.GetObject(“Select plsrfs”)

if not obj:
    return
    

blist = []
brep = rs.coercebrep(obj)
blist.Add(brep)


jbrep = Rhino.Geometry.Brep.JoinBreps(blist,sc.doc.ActiveDoc.ModelAbsoluteTolerance)


sc.doc.ActiveDoc.Objects.AddBrep(jbrep[0])
rs.Redraw()

test_join()

@dale or whoever I should poke regarding this, Any idea?

Hi @siemen,

It looks like you are passing a single Brep to Brep.JoinBreps. Is this correct?

– Dale

In the example above, yes it is a single object. But that’s just because I took the problem out of a list of breps that I’m trying to join and not all are connected (it’s related to this topic)
Does it matter that it’s a single object though?

@dale any idea what’s causing this? Is this expected? Is the new surface equally usable as the old one? How should I go about cleaning up the render mesh?

Yes, you probably don’t want to pass a single Brep to Brep.JoinBreps, even though the method will let you. The method splits up edges, in preparation for joining with other edges. But since you don’t provide any other Breps, the results are not good.

– Dale

Hi @dale,

As I mentioned, this brep is part of a list that I just took out to show the problematic surface. When I add another object to it, the same problem occurs:

image
220420 BrepRenderMesh.3dm (120.3 KB)

import rhinoscriptsyntax as rs
import Rhino
import scriptcontext as sc

def test_join():
    
    objs = rs.GetObjects()
    
    if not objs:
        return
    
    
    blist = []
    for i in objs:
        brep = rs.coercebrep(i)
        blist.Add(brep)
    
    
    jbrep = Rhino.Geometry.Brep.JoinBreps(blist,sc.doc.ActiveDoc.ModelAbsoluteTolerance)
    
    for j in jbrep:
        sc.doc.ActiveDoc.Objects.AddBrep(j)
    rs.Redraw()

test_join()

Hi @siemen,

I’ve logged an issue so we can have a look at this.

https://mcneel.myjetbrains.com/youtrack/issue/RH-68363

Did you make this surface in Rhino, or did you import from some other source?

– Dale

I’m not 100% sure, since I receive this file from a client saying it’s causing problems with the plugin I made for them. I think it’s made in Rhino but I can double check with them.

@dale
Client thinks it was made by using DevSrf DevSrf | Food4Rhino - possibly an offset of the created surface.