[vtkusers] Add a plan to a vtkPolyData

Michael Jackson mike.jackson at bluequartz.net
Wed Jan 27 10:15:32 EST 2010


vtkAppendDataset and its decedents.
___________________________________________________________
Mike Jackson                      www.bluequartz.net
Principal Software Engineer       mike.jackson at bluequartz.net
BlueQuartz Software               Dayton, Ohio


On Jan 27, 2010, at 10:12 AM, Frantch wrote:

>
> Hello everybody,
>
> I would like to know how can I add a plane to a polydata ? because  
> ehre what
> I'm trying to do:
>
> I have a PolyData that I clip using vtkClipPolyData (clipping  
> function = ONE
> plane). I manage to clip it and to display the clipped part.  
> Unfortunately
> this clipped polydata
> has a missing plane... (the one who has been used to clip..) So as I  
> result
> I don't have a close polydata and.. it make wrong the calculation  
> that I'm
> doing after..
>
> So here what I did to create the missing plane: I use vtkCutter but
> vtkCutter creates lines where the cut function intersects the  
> polydata. So I
> will use
> vtkStrippers then to puts them together into polylines. I then pull  
> a trick
> and define polygons using the closed line segements that the stripper
> created..
>
> vtkCutter * cutEdges = vtkCutter::New();
>
> cutEdges->SetInput(myPolyData);
> cutEdges->SetCutFunction(plane);
> cutEdges->GenerateCutScalarsOn();
> cutEdges->SetValue(0, 0.5);
>
> vtkStripper * cutStrips = vtkStripper::New();
>
>
> cutStrips->SetInputConnection(cutEdges->GetOutputPort());
> cutStrips->Update();
> vtkPolyData * cutPoly = vtkPolyData::New();
> cutPoly->SetPoints(cutStrips->GetOutput()->GetPoints());
> cutPoly->SetPolys(cutStrips->GetOutput()->GetLines());
>
> // Triangle filter is robust enough to ignore the duplicate point at
> // the beginning and end of the polygons and triangulate them.
> vtkTriangleFilter * cutTriangles = vtkTriangleFilter::New();
> cutTriangles->SetInput(cutPoly);
> cutTriangles->Update();
>
> so cutTriangles is my missing plane.. How can I add that to my clipped
> polyData ?
>
> Regards,
> Francesco
> -- 
> View this message in context: http://old.nabble.com/Add-a-plan-to-a-vtkPolyData-tp27341078p27341078.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list