<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
</head><body><p>Hello everyone!<br></p><p>I have a question about how to use the <em>vtkContourFilter</em> with an <em>unstructured</em> grid. <br></p><p>I have an unstructured grid where the values are stored at the center of the cells. So, before using the contour filter, I use the <em>CellDataToPointData</em> filter. The problem is that I do not see any output after using the contourFilter. I also tried to use <em>vtkImplicitModeller </em>to pre-process the grid, but the situation does not change.<br></p><p>The grid cells do contain values, since I can display them when I process for other tasks, but I did not manage to display isosurfaces.<br></p><p>Here it is my code:<br></p><p style="padding-left: 30px;"><em>// CELL TO POINT DATA<br></em></p><p style="padding-left: 30px;"><em>vtkSmartPointer<vtkCellDataToPointData> c2p {vtkSmartPointer<vtkCellDataToPointData>::New()};</em><br><em>c2p->SetInputData(grid); // grid is the unstructured grid I have created</em><br><em>c2p->Update();</em></p><p style="padding-left: 30px;"><em><br></em></p><p style="padding-left: 30px;"><em>// CONTOUR FILTER<br></em></p><p style="padding-left: 30px;"><em>vtkSmartPointer<vtkContourFilter> contourFilter = vtkSmartPointer<vtkContourFilter>::New();</em><br><em>contourFilter->SetInputConnection(c2p->GetOutputPort());</em></p><p style="padding-left: 30px;"><em>contourFilter->GenerateValues(10, c2p->GetOutput()->GetScalarRange());</em><br><em>contourFilter->Modified();</em><br><em>contourFilter->Update();</em></p><p style="padding-left: 30px;"><br></p><p style="padding-left: 30px;">// <em>MAPPER</em><br></p><p style="padding-left: 30px;"><em>vtkSmartPointer<vtkPolyDataMapper> contourMapper {vtkSmartPointer<vtkPolyDataMapper>::New()};</em><br><em>contourMapper->SetInputConnection(contourFilter->GetOutputPort());</em><br><em>contourMapper->Update();</em></p><p style="padding-left: 30px;"><br></p><p style="padding-left: 30px;">// VISUALIZATION<br></p><p style="padding-left: 30px;"><em>vtkSmartPointer<vtkActor> contourActor {vtkSmartPointer<vtkActor>::New()};</em><br><em>contourActor->SetMapper(contourMapper);</em><br></p><p style="padding-left: 30px;"><em>vtkSmartPointer<vtkRenderer> renderer {vtkSmartPointer<vtkRenderer>::New()};</em><br><em>contourActor->SetMapper(contourMapper);</em></p><p style="padding-left: 30px;"><em>renderer->AddActor(contourActor);</em></p><p style="padding-left: 30px;"><em><br></em></p><p style="">Do you have any suggestion? <br></p><p style="">Thanks a lot for the help!<br></p><p style="">Best,<br></p><p style="">Luca<br></p></body></html>