<div dir="ltr"><div><div><div>Hi Steven, thank you for your reply.<br></div>I am using VTK 7.0. Are you using vtkCutter in different threads with the same input data? This is my case.<br><br></div> Thank you<br><br></div> Luca<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 14, 2017 at 6:08 PM, Hahn, Steven E. <span dir="ltr"><<a href="mailto:hahnse@ornl.gov" target="_blank">hahnse@ornl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="white" link="#0563C1" vlink="#954F72" lang="EN-US">
<div class="m_-5741933321825498830WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Hi Luca,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Are you using master? Last week I added a merge request making vtkCutter thread-safe.<br>
<br>
<a href="https://gitlab.kitware.com/vtk/vtk/merge_requests/2541" target="_blank">https://gitlab.kitware.com/<wbr>vtk/vtk/merge_requests/2541</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Steven<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-family:Calibri;color:black">From: </span>
</b><span style="font-family:Calibri;color:black">vtkusers <<a href="mailto:vtkusers-bounces@vtk.org" target="_blank">vtkusers-bounces@vtk.org</a>> on behalf of Luca Pallozzi Lavorante <<a href="mailto:lplavorante@gmail.com" target="_blank">lplavorante@gmail.com</a>><br>
<b>Date: </b>Tuesday, March 14, 2017 at 2:47 PM<br>
<b>To: </b>vtk <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>><br>
<b>Subject: </b>[vtkusers] Is vtkCutter thread-safe?<u></u><u></u></span></p>
</div><div><div class="h5">
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi vtkusers,<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">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>::<wbr>New();<br>
slice->SetOrigin(<wbr>slicePosition[i].x(), slicePosition[i].y(), slicePosition[i].z());<br>
slice->SetNormal(sliceNormal[<wbr>i].x(), sliceNormal[i].y(), sliceNormal[i].z());<br>
slice->Modified();<br>
<br>
vtkSmartPointer<vtkCutter> cutter = vtkSmartPointer<vtkCutter>::<wbr>New();<br>
cutter->SetInputData(m_data);<br>
cutter->GenerateTrianglesOff()<wbr>;<br>
cutter->ReleaseDataFlagOn();<br>
cutter->SetCutFunction(slice);<br>
cutter->Update();<br>
<br>
vtkSmartPointer<vtkPolyData> poly = vtkSmartPointer<vtkPolyData>::<wbr>New();<br>
poly->DeepCopy(cutter-><wbr>GetOutput());<br>
poly->Modified();<br>
polys[i] = poly;<br>
}<br>
<br>
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
Thank you in advance for any help.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> Luca Pallozzi Lavorante<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div></div></div>
</div>
</blockquote></div><br></div>