<div dir="ltr">Hi all,<div> I am trying to clip a polyline with vtk. currently I am able to find the point where I want to "snip" line. however when I attempt to do this it doesn't seem to work.</div><div><br></div><div>the approach I am taking is to edit the individual cell by storing the Ids and then updating them.</div><div><br></div><div><br></div><div><div> pts_ids = vtk.vtkIdList()</div><div> </div><div> cell = centerlines.GetCell(cellIds.GetId(0))</div><div> N_ids_cell = cell.GetPointIds().GetNumberOfIds()</div><div> for i in range(N_ids_cell):</div><div> pt_id_cell = cell.GetPointIds().GetId(i)</div><div> </div><div> #skip ids outside of the surface</div><div> if (n_out_idx < 0 and int(pt_id_cell) < mvidx):</div><div> continue</div><div> elif (n_out_idx > 0 and int(pt_id_cell) > mvidx):</div><div> continue</div><div> pts_ids.InsertNextId(pt_id_cell)</div><div> </div><div> print(N_ids_cell, pts_ids.GetNumberOfIds())</div><div> </div><div> cell.GetPointIds().SetNumberOfIds(pts_ids.GetNumberOfIds())</div><div> for i in range(pts_ids.GetNumberOfIds()):</div><div> cell.GetPointIds().SetId(i,pts_ids.GetId(i))</div><div><br></div><div>Regards,</div><div> ~Kurt</div>-- <br><div class="gmail_signature">Kurt Sansom<br></div>
</div></div>