[vtkusers] visualize vtkPolyData with CORONAL, SAGITALL and AXIAL planes

Andaharoo Andx_roo at live.com
Fri Jan 19 00:57:17 EST 2018


You can cut a vtkPolyData (a mesh) with a plane and display it with vtkCutter

vtkSmartPointer<vtkCutter> polyCutter = vtkSmartPointer<vtkCutter>::New();
polyCutter->SetCutFunction(Create a vtkPlane and set it here);
polyCutter->SetInputData(Poly Data Here);
polyCutter->Update();

vtkSmartPointer<vtkPolyDataMapper> mapper =
vtkSmartPointer<vtkPolyDataMapper>::New();
mapper->SetInputData(polyCutter->GetOutput());
mapper->ScalarVisibilityOff();
vtkSmartPointer<vtkActor> sliceActor = vtkSmartPointer<vtkActor>::New();
sliceActor->SetMappper(mapper);
sliceActor->GetProperty()->LightingOff();
sliceActor->GetProperty()->SetColor(1.0, 0.0, 0.0);
sliceActor->GetProperty()->SetLineWidth(2.0);

renderer->AddActor(sliceActor);



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html


More information about the vtkusers mailing list