<div dir="ltr"><div><div><div><div>I nead to reuse surface object,<br></div><div>my problem:<br></div><div>I have two object ,when one object collide another,contact points should delete;and surface again recounstruc.<br><br>


</div>at first ,I reconsturct suface with vtkmarching cube and save output of it as vtkpolydata<br></div>,when delete point from polydata,and surface is not  shown well,<br><br></div>my code is:<br><br>    vtkIdType nCounet = surface-&gt;GetOutput()-&gt;GetNumberOfPoints();<br>


   <br>  vtkPoints* points=surface-&gt;GetOutput()-&gt;GetPoints();<br>  vtkPolyData *polydata=surface-&gt;GetOutput();<br> vtkIdType a =polydata-&gt;GetNumberOfPoints();<br>//polydata-&gt;BuildLinks();<br>////  // Mark a cell as deleted.<br>


//  polydata-&gt;DeletePoint(1);<br>//  polydata-&gt;DeletePoint(2);<br>//    polydata-&gt;DeletePoint(3);<br>//  polydata-&gt;DeletePoint(4); <br>//  polydata-&gt;DeletePoint(5);<br>//  polydata-&gt;DeletePoint(6);<br>//  polydata-&gt;Update();<br>


//<br>for ( int i=0;i&lt;idx;i++) {<br>    //indexOfremovepoints save index of points collide and should remove!!<br>    ReallyDeletePoint(points, indexOfremovepoints[i]);<br><br><br>}<br>polydata-&gt;SetPoints(points);<br>


polydata-&gt;Update();<br>//surface-&gt;GetOutput()-&gt;GetPointData()-&gt;SetScalars(inarraySurface);<br>//cout&lt;&lt;&quot;number&quot;&lt;&lt;surface-&gt;GetOutput()-&gt;GetNumberOfPoints();<br>//surface-&gt;GetOutput()-&gt;DeletePoint(indexOfremovepoints[i);<br>


//surface-&gt;Update();<br>//nCounet = surface-&gt;GetOutput()-&gt;GetNumberOfPoints();<br>//surface-&gt;GetOutput()-&gt;SetPoints(points);<br><br>a =polydata-&gt;GetNumberOfPoints();<br>surface-&gt;SetOutput(polydata);<br>


    surface-&gt;Update();<br><br>   vtkNew&lt;vtkPolyDataMapper&gt; isoMapper;<br>    isoMapper-&gt;SetInput(surface); <br>    isoMapper-&gt;ScalarVisibilityOff();<br><br><br><br><br><br></div>what is Your option about problem?<br>


<br><div><div><div><div><div><div><div><div><br></div></div></div></div></div></div></div></div></div>