<div dir="ltr"><div><div>Hi vtkusers,<br><br></div>I have tried to generate N slices from a vtkUnstructuredGrid using vtkCutter and OpenMP. The code I used is below. slicePosition and sliceNormals are arrays of planes' positions and normals, whereas polys is an array of vtkPolyData used to store each cut for a later append operation using vtkAppendPolyData.<br><br>#pragma omp parallel for<br>    for (size_t i = 0; i < numSlices; ++i) {<br>        vtkSmartPointer<vtkPlane> slice = vtkSmartPointer<vtkPlane>::New();<br>        slice->SetOrigin(slicePosition[i].x(), slicePosition[i].y(), slicePosition[i].z());<br>        slice->SetNormal(sliceNormal[i].x(), sliceNormal[i].y(), sliceNormal[i].z());<br>        slice->Modified();<br><br>        vtkSmartPointer<vtkCutter> cutter = vtkSmartPointer<vtkCutter>::New();<br>        cutter->SetInputData(m_data);<br>        cutter->GenerateTrianglesOff();<br>        cutter->ReleaseDataFlagOn();<br>        cutter->SetCutFunction(slice);<br>        cutter->Update();<br><br>        vtkSmartPointer<vtkPolyData> poly =  vtkSmartPointer<vtkPolyData>::New();<br>        poly->DeepCopy(cutter->GetOutput());<br>        poly->Modified();<br>        polys[i] = poly;<br>    }<br><br><br></div><div>This code generates segmentation faults and I would like to know whether it is safe to create and deal with a different instance of vtkCutter in different threads, as I am trying to do with the macro '#pragma omp parallel for'. What I am trying to do is to slice my dataset using a set of parallel planes.<br></div><div><br>Thank you in advance for any help.<br><br></div><div>       Luca Pallozzi Lavorante<br></div><div><br></div></div>