[vtkusers] Generate triangulation from vertex and index info

David Doria daviddoria at gmail.com
Thu Sep 30 10:21:29 EDT 2010


On Thu, Sep 30, 2010 at 10:13 AM, Hugo Valdebenito <hugo at maptek.cl> wrote:

>
> Hi all
>
> With the delaunay2D (3D) schema, the distribution of triangles is not the
> same, depending of the input points order. If I already have the vetex and
> index definitions for the triangles, how can I make the triangulation?
>
> Hugo
>

If you already know the connectivity of the points, you can use this:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/Triangle

To add the next triangle, do

  vtkSmartPointer<vtkTriangle> triangle2 =
    vtkSmartPointer<vtkTriangle>::New();
  triangle2->GetPointIds()->SetId ( 0, triangle2p0id );
  triangle2->GetPointIds()->SetId ( 1, triangle2p1id );
  triangle2->GetPointIds()->SetId ( 2, triangle2p2id );
<http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/Triangle>
triangles->InsertNextCell
( triangle2 );

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100930/d85cc89d/attachment.htm>


More information about the vtkusers mailing list