Brep face count change on File3dm save

Continuing with the unit testing setup I’m working on, I run into an issue I would like to understand better.

The brep on the left is added to the document directly from the code.
The one on the right is the same geometry after passing through the File3dm.Write method… it’s clearly being simplified in the process…


When peeking in debug at the left side brep, before adding it to the document, it is actually a single surface. It’s the act of Rhino.RhinoDoc.ActiveDoc.Objects.Add(); which seem to modify it.

Why is it working like that?

You probably have crease splitting on. This can be toggled with the CreaseSplitting command. It is advised to leave it enabled, but it can be circumvented with the AddBrep method with the splitKinkySurfaces parameter set to false.