<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10pt"><div style="" class=""><font style="" class="" size="2">Hello,</font></div><div style="" class=""><font style="" class="" size="2"><br style="" class=""></font></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal" class=""><font style="" class="" size="2"><br style="" class=""></font></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal"><font style="" class="" size="2">I have a question on how to perform a triangulation of 3d points with VTK.</font></div><div class="" style="color:rgb(0, 0,
0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal"><font style="" class="" size="2"><br style="" class=""></font></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal"><font style="" class="" size="2">So
I'd like to create a function which you give 3D points and that returns
you triangle coordinates from these points. (a list of sublists, each
list has 3 points (triangle coordiates)). -> function([...]) -> [[
, , ]....[ , , ]]</font></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal"><font style="" class="" size="2"><br style="" class=""></font></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal"><font style="" class="" size="2">To test the way to do so, i create points this way : </font></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal"><font style="" class="" size="2"><br style="" class=""></font></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida
Grande, sans-serif;background-color:transparent;font-style:normal"><font style="" class="" size="2"> vtkSmartPointer< vtkPoints > points =<br style="" class=""> vtkSmartPointer< vtkPoints > :: New();<br style="" class=""> points->InsertNextPoint(0, 0, 0);<br style="" class="">
points->InsertNextPoint(1, 0, 0);<br style="" class=""> points->InsertNextPoint(1, 1, 0);<br style="" class=""> points->InsertNextPoint(0, 1, 1);<br style="" class=""> points->InsertNextPoint(5, 5, 5);<br style="" class=""> points->InsertNextPoint(6, 5, 5);<br style="" class=""> points->InsertNextPoint(6, 6, 5);<br style="" class="">
points->InsertNextPoint(5, 6, 6);<br style="" class=""><br style="" class="">vtkSmartPointer< vtkPolyData> polydata =<br style="" class=""> vtkSmartPointer<vtkPolyData>::</font></div><div style="" class=""><font style="" class="" size="2">New();<br style="" class=""> polydata->SetPoints(points);<br style="" class=""><br style="" class="">To create triangulation, I use this code :<br style="" class=""><br style="" class=""></font><font style="" class="" size="2"><br style="" class=""><font style="" class="">vtkSmartPointer<vtkDelaunay3D> delaunay3D =<br style="" class=""> vtkSmartPointer<vtkDelaunay3D></font></font><div style="" class=""><font style="" class="" size="2">::New();<br style="" class=""> delaunay3D->SetInput(polydata)</font><font style="" class="" size="2">;<br style="" class="">
delaunay3D->SetAlpha(0.2);<br style="" class=""> delaunay3D->Update();<br style="" class=""><br style="" class="">From here, I'm lost. I do this, but it doesn't work :<br style="" class=""><br style="" class="">vtkSmartPointer<</font><div style="" class=""><font style="" class="" size="2">vtkTriangleFilter> triangleFilter =<br style="" class=""> vtkSmartPointer<</font><font style="" class="" size="2">vtkTriangleFilter>::New();<br style="" class=""><br style="" class=""></font></div><font style="" class="" size="2">triangleFilter-></font><div style="" class=""><font style="" class="" size="2">SetInputConnection(delaunay3D-</font><font style="" class="" size="2">>GetOutputPort());<br style="" class=""> triangleFilter->Update();<br style="" class=""></font>
</div><font style="" class="" size="2"><br style="" class="">Anybody has an idea of what is wrong in my code? Where is the mistake?<br style="" class="">Hope you can help me!<br style="" class=""><br style="" class="">Best regards,<br style="" class=""><br style="" class=""><br style="" class="">Pierre Starkov,<br style="" class="">Computer Science & Medical School Student,<br style="" class="">Geneva, Switzerland<br style="" class=""></font></div><font style="" class="" size="2"><br style="" class=""></font></div><div style="" class=""><br style="" class=""></div></div></body></html>