Patch different result Rhino Command and C#

Good day,

We somehow get different results when we use the Rhino Command Patch with the same settings and the C# command. Hereby an example, from left to right, input geometry, Rhino Patch Command, C# Result:

Hereby the Patch settings:

Hereby the Rhino File:
PatchBug_.3dm (230.3 KB)

And the C# code, select the Polyline + Mesh and run it in a C# command:

var selObj = doc.Objects.GetSelectedObjects(true, true).ToArray();

Rhino.Geometry.Curve c = null;
Rhino.Geometry.Mesh m = null;
foreach(var o in selObj)
    switch (o.ObjectType)
        case ObjectType.Curve:
            c = (Rhino.Geometry.Curve)o.Geometry;
        case ObjectType.Mesh:

            m = (Rhino.Geometry.Mesh) o.Geometry;

var ml = m.SplitDisjointPieces();
var geobase = new List<GeometryBase>();

// create patch
Brep patchBr = Brep.CreatePatch(geobase.ToArray(), null, 25, 75, true, true, 1, 11, 0.001, new bool[] { false, false, false, false }, 0.001);
if (patchBr == null)
    return Result.Success;

return Result.Success;

Just ignore the part where I split the disjoint mesh, because I tested it to see what happens, but same result.

Any ideas?



Hi @Jordy,

I’ve logged an issue so I can remember to dig into this.


– Dale

Hi @dale ,

Any tips or tricks for a work around to get this working? To get the same result as in Rhino? Do you do something specifically before the Rhino command?

Just thinking out loud to help our users as well.



Instead of using _Patch’s Stiffness value as an argument for CreatePatch’s flexibility parameter, try the reciprocal.