<div dir="ltr">I still don't fully understand the mechanism of the vtkDataSetAttributes copy flags when passing from a filter to another, is there some documentation anywhere? (appart from the doxygen)<div><br></div><div>And is someone familiar with the vtkDecimatePro to help me find a fix for the case of points insertion with normals?</div><div><br></div><div>Thanks</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-04-12 15:45 GMT+02:00 Xabi Riobe <span dir="ltr"><<a href="mailto:xabivtk@gmail.com" target="_blank">xabivtk@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr"><span class="">Hi,<div><br></div><div>I have a crash when using vtkDecimatePro (vtk 6.3) if my input has normals with the CopyNormals flag set to 0 (='off').</div><div><br></div><div>Attached is a reproductible case with its input.</div><div><br></div><div>The crash occurs at line 409:</div><div>outputPD->CopyData(meshPD,ptId,map[ptId]);<br></div><div><br></div><div>because it tries to access a part of a normals array that has not been computed properly due to the fact that it was marked with the flag to off.</div><div><br></div><div>The flag is set in vtkPolyDataNormals. A workaround is to set it back to on before the decimation, but i would like to understand what is the issue.</div><div><br></div><div>First, why this flag is not set back to On at the end of the normals filter (but other filters like vtkTransformPolyDataFilter will set it to off as well, producing the crash)?</div><div><br></div><div>And second, is there something to fix in vtkDecimatePro?</div><div><br></div><div><br></div><div>Thanks for your feedback</div><div><br></div><div><br></div></span><div>link to data (vtp): <b style="color:rgb(0,0,255);font-family:Arial;font-size:10pt"><a href="http://www.filedropper.com/mesh9" target="_blank">http://www.filedropper.com/mesh9</a></b></div><span class="">
<table>
</table><div><br></div><div><br></div><div><div>#include <vtkSmartPointer.h></div><div>#include <vtkXMLPolyDataReader.h></div><div>#include <vtkDecimatePro.h></div><div>#include <vtkPolyData.h></div><div>#include <vtkPolyDataNormals.h></div><div><br></div><div>int main ()</div><div>{</div><div> // Read the input polydata</div><div> vtkSmartPointer<vtkXMLPolyDataReader> reader = vtkSmartPointer<vtkXMLPolyDataReader>::New();</div><div> reader->SetFileName("./Mesh9.vtp");</div><div> reader->Update();</div><div><br></div><div> vtkSmartPointer<vtkPolyDataNormals> norm = vtkSmartPointer<vtkPolyDataNormals>::New();</div><div> norm->SetInputConnection(reader->GetOutputPort());</div><div> norm->ComputePointNormalsOn();</div><div> norm->Update();</div><div><br></div><div> const double reduction = 0.98;</div><div><br></div><div> vtkSmartPointer<vtkDecimatePro> decimate = vtkSmartPointer<vtkDecimatePro>::New();</div><div> decimate->SetInputConnection(norm->GetOutputPort());</div><div> decimate->SetTargetReduction(reduction);</div><div> decimate->PreserveTopologyOff();</div><div> decimate->Update();</div><div><br></div><div> return EXIT_SUCCESS;</div><div>}</div></div><div><br></div></span></div>
</div><br></div>
</blockquote></div><br></div>