Hello, I have two questions.
- I’m trying to use VTKVornoi to generate a 2D Mesh of voronoi graph, and the results is like the following picture
vtkSmartPointer poly_voronoi = vtkSmartPointer::New();
int i = 0;
while (i < 1000)
{points_voronoi->InsertPoint(i, rand()%800, rand()%600,0); i++;
}
poly_voronoi->SetPoints(points_voronoi);
cout << poly_voronoi->GetNumberOfPoints();
vornoi_2d = vtkSmartPointer::New();vornoi_2d->SetInputData(poly_voronoi);
vornoi_2d->SetGenerateScalarsToNone();
vornoi_2d->SetGenerateScalarsToPointIds();
vornoi_2d->SetPointOfInterest(1);
vornoi_2d->SetMaximumNumberOfTileClips(10000);
vornoi_2d->GetLocator()->SetNumberOfPointsPerBucket(2);
vornoi_2d->SetGenerateVoronoiFlower(1);
vornoi_2d->Update();vtkNew plyWriter;
plyWriter->SetFileName(“curve.obj”);
plyWriter->SetInputData(vornoi_2d->GetOutput());
plyWriter->Write();
However I’m genearating 1000 points, the results look the same, did I miss something ?
- I would like to cut the voronoi mesh with another 2D mesh, would VTKBoolean operation works in that purpose, or it must use a 3D Mesh instead x,y,z ?