Hi;
I want to split the mesh like the MeshSplit Tool in c++, but I try this core:
CRhinoGetObject go;
go.SetCommandPrompt( L"select first mesh" );
go.SetGeometryFilter(CRhinoGetObject::mesh_object);
go.EnablePreSelect(FALSE);
go.EnableSubObjectSelect( FALSE );
go.EnableGroupSelect(TRUE);
go.GetObjects( 1, 0 );
int i, object_count = go.ObjectCount();
ON_SimpleArray<const ON_Mesh*> InMeshes0;
for( i = 0; i < object_count; i++ )
{
InMeshes0.Append(go.Object(i).Mesh());
}
CRhinoGetObject go1;
go1.SetCommandPrompt( L"select other mesh" );
go1.SetGeometryFilter(CRhinoGetObject::mesh_object);
go1.EnablePreSelect(FALSE);
go1.EnableSubObjectSelect( FALSE );
go.EnablePreSelect(false);
go1.EnableGroupSelect(TRUE);
go1.GetObjects( 1, 0 );
int object_count1 = go1.ObjectCount();
ON_SimpleArray<const ON_Mesh*> InMeshes1;
for( i = 0; i < object_count1; i++ )
{
InMeshes1.Append(go1.Object(i).Mesh());
}
double intersection_tolerance = ON_SQRT_EPSILON * 10;
double overlap_tolerance = ON_SQRT_EPSILON * 10;
ON_SimpleArray<ON_Mesh*> OutMeshes;
bool bSomethingHappened = false;
bool rc = RhinoMeshBooleanSplit(InMeshes0,InMeshes1,intersection_tolerance,overlap_tolerance,&bSomethingHappened,OutMeshes);
ON_Mesh out_mesh;
for(i = 0; i < OutMeshes.Count(); i++ )
{
RhinoApp().ActiveDoc()->AddMeshObject(*OutMeshes[i]);
}
RhinoApp().ActiveView()->Redraw();
return CRhinoCommand::success;
But the result is:
It just like the RhinoMeshBooleanIntersection, how can I do that ?