<div dir="ltr">Hi all,<br><br>I have a mesh generated from vtkDiscreteMarchingCubes and processed through vtkDecimatePro and vtkWindowedSincPolyDataFilter. Now, I want to find the points/voxels inside this mesh. I am using vtkPolygon::PointInPolygon. But, the result is "1! for the all the points whichever falls with the bounds.<br>
<br>Here is the piece of code that I am using<br><br>(smoother is vtkWindowedSincPolyDataFilter)<br><br> int npts=smoother->GetOutput()-> GetPoints()->GetNumberOfPoints();// test point <br> //double n[3]={0.707, 0.707, 0};<br>
double n[3];<br><br> vtkSmartPointer<vtkPolygon> polygon =<br> vtkSmartPointer<vtkPolygon>::New();<br> <b><span style="color: rgb(204, 0, 0);">polygon->ComputeNormal(mapper->GetInput()->GetPoints()->GetNumberOfPoints(),</span><br style="color: rgb(204, 0, 0);">
<span style="color: rgb(204, 0, 0);"> static_cast<double*>(mapper->GetInput()->GetPoints()->GetData()->GetVoidPointer(0)), n); </span></b> <br><br> double bds[6];<br>
smoother->GetOutput()->GetBounds(bds); <br> qDebug()<< polygon->PointInPolygon(testIn,npts,<b><span style="color: rgb(255, 0, 0);">static_cast<double*>(mapper->GetInput()->GetPolys()->GetData()->GetVoidPointer(0)</span></b>),bds,n)<<"Result";<br>
<br>Are these two highlighted lines correct?<br><br>Many thanks<br><br>Jothy<br> </div>