[vtkusers] Curvature based one moments

David.Pont at ForestResearch.co.nz David.Pont at ForestResearch.co.nz
Tue Jul 16 17:49:59 EDT 2002


Hi Jan,

>I have to ensure, that all triangles within the sphere Radius are
>connected with the central triangle.
>Does anyone know a fast and easy implementable method ?

What about this simplistic approach:

For each cell (triangles in your case)
  get its points    // cell->GetPointIds();
  for each point
    get the cells it belongs to    // dataset->GetPointCells( pid, cells );
     for each cell
       recurse for this connected cell...

There would be a lot of redundancy as this would identify the same cells
multiply, so you would have to keep a list of cell ids to avoid an infinite
loop (tracking back to the initial cell) and a lot of wasted time
(processing the same cells again). It is your call to decide when a cell is
within the radius (nearest point, centre, furtherest point...?), once a
cell is "out" that path from the original cell is terminated.
It sounds plausible, should be easy to implement, and even with the
overhead to check cell ids already visited (simple unsorted list?) it might
be ok for speed.

  regards, Dave Pont




More information about the vtkusers mailing list