[vtkusers] VtkDelaunay2d Problem

Secolas UA secolasua at gmail.com
Wed May 23 18:14:40 EDT 2007


Hello All

I want to define a new triangulation for a polydata model, I've tried
vtkDelaunay2d but the new triangulation is quite wierd!
Is it possible to make a new triangle mesh? I'll add the code and two
images, one of the polydata and other of the delaunay model.
Can anyone help me?

Thanks in Advance
Ricardo Seco

vtkDelaunay2D *newMesh = vtkDelaunay2D::New();
    vtkPoints *newPoints = vtkPoints::New();
    vtkPolyData *newPoly = vtkPolyData::New();
    newPoints = polyData->GetPoints();
    newPoly->SetPoints(newPoints);
    newMesh->SetInput(newPoly);
    newMesh->Update();

    vtkPolyDataMapper *meshMapper = vtkPolyDataMapper::New();
    meshMapper->SetInput(newMesh->GetOutput());
    vtkActor *meshActor = vtkActor::New();
    meshActor->SetMapper(meshMapper);

    // Nova janela para rendering
    vtkRenderer *ren3 = vtkRenderer::New();
    vtkRenderWindow *renWin3 = vtkRenderWindow::New();

    renWin3->AddRenderer(ren3);
    ren3->SetBackground(1,1,1);
    ren3->AddActor(meshActor);
    renWin3->Render();

    vtkRenderWindowInteractor *iren3=vtkRenderWindowInteractor::New();
    iren3->SetRenderWindow(renWin3);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070523/7d9f1fb8/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: polydata.JPG
Type: image/jpeg
Size: 19935 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070523/7d9f1fb8/attachment.jpeg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: delaunay2d.JPG
Type: image/jpeg
Size: 14799 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070523/7d9f1fb8/attachment-0001.jpeg>


More information about the vtkusers mailing list