Duplicate Brep

Hi,

I tried to duplicate a surface to a Headless temporary document. To do that i just add the duplicated brep

// surface already defined below as a Surface
Brep duplicate = surface.ToBrep().DuplicateBrep();

var tempDoc = RhinoDoc.CreateHeadless(null);
tempDoc.Objects.AddBrep(duplicate, attrs);
tempDoc.Save(filetemppath);

Whatever the surface (curved or non), i only get the oriented bounding box instead of the shape as follow

When debugging, the duplicated brep contains the complete geometry

I can’t explain why…?

Thanks for your help

Hi @Alican,

From your image, it appears your “surface” is trimmed, which means its really a Brep.

Also,

Brep duplicate = surface.ToBrep();

will make a copy - no reason for the second "DuplicateBrep` call.

You might want to post a sample 3dm file.

– Dale

Hi @dale

Thanks ! I got tangled…it works fine now !