<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 &quot;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-&gt;GetOutput()-&gt; GetPoints()-&gt;GetNumberOfPoints();// test point <br>  //double n[3]={0.707, 0.707, 0};<br>
  double n[3];<br><br>   vtkSmartPointer&lt;vtkPolygon&gt; polygon =<br>            vtkSmartPointer&lt;vtkPolygon&gt;::New();<br>   <b><span style="color: rgb(204, 0, 0);">polygon-&gt;ComputeNormal(mapper-&gt;GetInput()-&gt;GetPoints()-&gt;GetNumberOfPoints(),</span><br style="color: rgb(204, 0, 0);">
<span style="color: rgb(204, 0, 0);">                               static_cast&lt;double*&gt;(mapper-&gt;GetInput()-&gt;GetPoints()-&gt;GetData()-&gt;GetVoidPointer(0)), n);      </span></b>         <br><br>    double bds[6];<br>
    smoother-&gt;GetOutput()-&gt;GetBounds(bds);                  <br>     qDebug()&lt;&lt; polygon-&gt;PointInPolygon(testIn,npts,<b><span style="color: rgb(255, 0, 0);">static_cast&lt;double*&gt;(mapper-&gt;GetInput()-&gt;GetPolys()-&gt;GetData()-&gt;GetVoidPointer(0)</span></b>),bds,n)&lt;&lt;&quot;Result&quot;;<br>
<br>Are these two highlighted lines correct?<br><br>Many thanks<br><br>Jothy<br>                    </div>