[vtkusers] Interception or Subtract of two polyDatas
Jose Barreto
jose.de.paula at live.com
Thu Dec 7 10:55:50 EST 2017
Good afternoon guys,
I'm trying to pick up the interception between two polydatas, a cube and a
sphere.
I tried using vtkBooleanOperationPolyDataFilter and
vtkIntersectionPolyDataFilter
but the output of the two is empty.
the code for vtkIntersectionPolyDataFilter:
auto cubeSource = vtkSmartPointer<vtkCubeSource>::New();
cubeSource->SetXLength(size[0]);
cubeSource->SetYLength(size[1]);
cubeSource->SetZLength(size[2]);
cubeSource->Update();
auto sphereSource = vtkSmartPointer<vtkSphereSource>::New();
sphereSource->SetRadius(20);
sphereSource->Update();
auto intersectionPolyDataFilter =
vtkSmartPointer<vtkIntersectionPolyDataFilter>::New();
intersectionPolyDataFilter->SetInputConnection(0,
cubeSource->GetOutputPort());
intersectionPolyDataFilter->SetInputConnection(1,
sphereSource->GetOutputPort());
intersectionPolyDataFilter->Update();
But when I using two sphere the output is working.
vtkBooleanOperationPolyDataFilter and vtkIntersectionPolyDataFilter don't
work for the cube?
--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
More information about the vtkusers
mailing list