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;
break;
case ObjectType.Mesh:
m = (Rhino.Geometry.Mesh) o.Geometry;
break;
}
}
var ml = m.SplitDisjointPieces();
var geobase = new List<GeometryBase>();
geobase.Add(c);
geobase.AddRange(ml);
// 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;
}
doc.Objects.AddBrep(patchBr);
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?
Regards,
Jordy