Mesh.Reduce option planar only

I would like to merge the coplanar mesh faces.
In Rhino there is a command ReduceMesh with the option “Planar only”:

image

In RhinoCommon I cannot find a corresponding option, neither in Mesh.Reduce nor in the ReduceMeshParameters.

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Mesh_Reduce.htm
https://developer.rhino3d.com/api/RhinoCommon/html/T_Rhino_Geometry_ReduceMeshParameters.htm

Can someone maybe give me a hint how this works?
Thanks a lot.

Hi @thomas.k,

Try the following:

var reduceParams = new ReduceMeshParameters
{
  AllowDistortion = !planarOnly,
};

– Dale

Hi @dale
Setting AllowDistortion=false works perfectly.
Thanks for the support!