Hi there, I’m trying to clip a cylinder in a stl read from a file.
But the thing is after cutting, the hole is hollow. What I expect is to have a closed surface inside (a tube). I tried different methods, but they seem not working. Does anyone know what solution may help? Thank you a lot!
Here is the code (the polydata below is read from a file)
vtkNew<vtkCylinder> cylinder;
cylinder->SetCenter(0.0, 0.0, 0.0);
cylinder->SetRadius(m_AccessHoleRadius);
vtkNew<vtkClipPolyData> clipper;
clipper->SetInputData(polydata);
clipper->SetClipFunction(cylinder);
clipper->SetValue(0);
clipper->Update();
vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
mapper->SetInputData(clipper->GetOutput());
m_Actor->SetMapper(mapper);
m_Actor->GetProperty()->SetDiffuse(GetNormalDiffuse());