Trying boolean operation on a voronoi 2D Mesh

Hi, Thanks for your help in advance.

I’ve the following two polydata as shown in the figure I’m trying to do boolean operation on them, but it says that the voronoi mesh has non manfiold data, and there is no contact. How to fix that ?

vtkNew tri1;
tri1->SetInputData(vornoi_2d->GetOutput());
vtkNew clean1;
clean1->SetInputConnection(tri1->GetOutputPort());
clean1->Update();

vtkNew tri2;
tri2->SetInputData(polydata);
tri2->Update();
vtkNew clean2;
clean2->SetInputConnection(tri2->GetOutputPort());
clean2->Update();

vtkNew extrude;
extrude->SetInputData(clean2->GetOutput());
extrude->SetExtrusionTypeToNormalExtrusion();
extrude->SetVector(0, 0, 1);
extrude->SetScaleFactor(120.5);
extrude->Update();

vtkNew extrude_vornoi;
extrude_vornoi->SetInputData(clean1->GetOutput());
extrude_vornoi->SetExtrusionTypeToNormalExtrusion();
extrude_vornoi->SetVector(0, 0, 1);
extrude_vornoi->SetScaleFactor(120.5);
extrude_vornoi->Update();

vtkNew plyWriter;
plyWriter->SetFileName(“curve1.obj”);
plyWriter->SetInputData(extrude->GetOutput());
plyWriter->Write();

plyWriter->SetFileName(“curve2.obj”);
plyWriter->SetInputData(extrude_vornoi->GetOutput());
plyWriter->Write();

vtkPolyDataBooleanFilter* bf2 =
vtkPolyDataBooleanFilter::New();
bf2->SetInputConnection(0, extrude->GetOutputPort());
bf2->SetInputConnection(1, extrude_vornoi->GetOutputPort());
bf2->SetOperModeToDifference();
bf2->Update();

What I do in situations like this is load the data into ParaView and run the feature edges filter on each input polydata. It’s possible to identify feature edges this way… of course you can do it in VTK as well but sometimes an application like PV is much easier to debug with. Anyway, once you identify the feature edges we can figure out if it’s a voronoi issue, or something else.

@will.schroeder
Thanks so much for your fast reply.
Here is the two obj files… may be you can take a look also and I will take also in paraview
curve1.obj (253.7 KB)
curve2.obj (661.4 KB)

@will.schroeder


here is the output of feature edges…
it seems it’s true that there are non-manifold edges.
The question : How do I generate voronoi coherent with manifold edges ?

@will.schroeder
I tried to remove non manfiold edges, and it says in paraview there are no non-manifold edges there.
Here are the two meshes, however it still says that the voronoi mesh has non-manifold edges.
curve2.obj (75.9 KB)
curve1.obj (256.6 KB)