[vtkusers] plane cut the 3-D mesh surface into contours

Quan Chen quanchen at gmail.com
Mon Apr 25 15:12:50 EDT 2005


I have constructed a 3-D mesh surface and want to obtain contours by using
plane cut.  I use vtkCutter class to do this.  However, the contour I got is
just a group of lines without correct ordering.  For example, a closed
contour would be like this 1->2, 2->3, 3->4, 4->1, but what I got was sth
like this: 1->2, 3->4, 2->3, 4->1.   I don't know if I express my problem
clearly.  Does anyone have similiar experience?
 
The code that I am using is listed here:
 
vtkPlane   *plane=vtkPlane::New();
plane->SetOrigin(0, 0, 0);
plane->SetNormal(1, 0, 0);
 
vtkCutter  *cutEdges=vtkCutter::New();
cutEdges->SetInput(vtkdata);
cutEdges->SetCutFunction(plane);
cutEdges->GenerateCutScalarsOn();
cutEdges->GenerateValues(10, 0, 50);
 
vtkPolyDataWriter *contourwriter=vtkPolyDataWriter::New();
contourwriter->SetFileName("contour.vtk");
contourwriter->SetInput(cutEdges->GetOutput());
contourwriter->Update();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050425/2fc3dd9a/attachment.htm>


More information about the vtkusers mailing list