<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->GetOutput()->GetNumberOfPoints();<br>
<br> vtkPoints* points=surface->GetOutput()->GetPoints();<br> vtkPolyData *polydata=surface->GetOutput();<br> vtkIdType a =polydata->GetNumberOfPoints();<br>//polydata->BuildLinks();<br>//// // Mark a cell as deleted.<br>
// polydata->DeletePoint(1);<br>// polydata->DeletePoint(2);<br>// polydata->DeletePoint(3);<br>// polydata->DeletePoint(4); <br>// polydata->DeletePoint(5);<br>// polydata->DeletePoint(6);<br>// polydata->Update();<br>
//<br>for ( int i=0;i<idx;i++) {<br> //indexOfremovepoints save index of points collide and should remove!!<br> ReallyDeletePoint(points, indexOfremovepoints[i]);<br><br><br>}<br>polydata->SetPoints(points);<br>
polydata->Update();<br>//surface->GetOutput()->GetPointData()->SetScalars(inarraySurface);<br>//cout<<"number"<<surface->GetOutput()->GetNumberOfPoints();<br>//surface->GetOutput()->DeletePoint(indexOfremovepoints[i);<br>
//surface->Update();<br>//nCounet = surface->GetOutput()->GetNumberOfPoints();<br>//surface->GetOutput()->SetPoints(points);<br><br>a =polydata->GetNumberOfPoints();<br>surface->SetOutput(polydata);<br>
surface->Update();<br><br> vtkNew<vtkPolyDataMapper> isoMapper;<br> isoMapper->SetInput(surface); <br> isoMapper->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>