RebuildTrimsForV2 modifies Trim geometry

Hi!
After running the following code the trimming loops of the face are slightly modified. Why?

new_brep = brep.DuplicateBrep() # make a duplicate
face = new_brep.Faces[0] # select a BrepFace
surface = face.UnderlyingSurface().ToNurbsSurface() # get the surface geometry as nurbs
new_brep.RebuildTrimsForV2(face, surface) # rebuild trims for nurbs
face.ChangeSurface(new_brep.AddSurface(surface)) # replace the surface geometry
face.RebuildEdges(1e-5, True, True) # edges are changing! Why?

Hi @swg1975,

Why are you calling Brep.RebuildTrimsForV2? What are you trying to do and why?

– Dale

Hi Dale!

I want to modify the surface of a BrepFace (e.g. change degree, insert knots,…) by using face.ChangeSurface.

Hi @swg1975,

If you need to convert underlying surfaces to NURBS, you might just want to call Brep. MakeValidForV2.

Or perhaps I don’t understand what you want to do?

– Dale