I ran into a group of problems and ask for help. First, I need to use the NonManifoldMerge command for the selected objects (Imprint between surfeaces (command)) on my video I call it without problems, but I don’t know how to call it using the Rhino C # API. After I need to make Mesh for these objects as shown in the video. Here is my code for creating a Mesh, but it still doesn’t appear in Rhino itself.
protected override Result RunCommand (RhinoDoc doc, RunMode mode)
{
doc.Views.RedrawEnabled = false;
List <ObjRef> objRef = new List <ObjRef> ();
using (GetObject go = new GetObject ())
{
go.SetCommandPrompt ("Select objects");
go.GeometryFilter = ObjectType.Surface;
go.GroupSelect = true;
go.GetMultiple (1, 0);
if (go.CommandResult ()! = Result.Success)
{
return go.CommandResult ();
}
for (int i = 0; i <go.ObjectCount; i ++)
{
objRef.Add (go.Object (i));
}
}
foreach (var item in objRef)
{
if (doc.Objects.Find (item.ObjectId) is RhinoObject rhinoObject)
{
MeshingParameters meshingParameters = new MeshingParameters
{
Tolerance = 0.01,
MaximumEdgeLength = 5
};
rhinoObject.CreateMeshes (MeshType.Render, meshingParameters, true);
}
}
}
doc.Views.RedrawEnabled = true;
doc.Views.Redraw ();
return Result.Success;
}
After I need to use the TriangulateMesh command using the Rhino C # API. If anyone has ideas on how to solve these problems, I will be very grateful in advance thanks))
I managed to make Mesh and Triangulate Mesh, but I don’t know how to call the NonManifoldMerge command in Rhino Api. How could this code be simplified? Thanks in advance))
Thanks for the quick response. If such a command does not exist in the Rhino API, but it works according to a certain algorithm. Could I implement the functionality of this command on my own? If possible, you could help implement this command.
Unfortunately, this did not help. Perhaps I was mistaken in something. By the way, the logic of the BolleanUnion command does not fit. NonmanifoldMerge is needed. Here is my code how MergeBreps implemented: