contour interpolation

classic Classic list List threaded Threaded
1 message Options
sb
Reply | Threaded
Open this post in threaded view
|

contour interpolation

sb
I'm completely new to vtk so bear with me if what I ask turns out to be
incredibly easy for the expert user. Believe me, I've searched everywhere
but I can't find a way to do what I need. So here's my problem:

I have a mesh, and I need to extract contours cutting it with planes at
regular intervals. I'm using vtkCutter + vtkStripper + vtkCleanPolyData to
obtain a list of points. So far so good, however I need these contours to be
resampled/interpolated so that each contour is returned as a fixed number of
points, equally spaced. Is there a way to do this in vtk: options to set on
vtkCutter, other filters that I can add?

I also have another question: on some meshes the contours run clockwise, on
others counter-clockwise, why? Of course I'm using the same planes, always
oriented in the direction of the positive X axis.

Thanks
---------------------------
my code:

vtkSmartPointer<vtkPolyData> intersection(vtkPlane& plane,
vtkSmartPointer<vtkPolyData> polydata)
{
    auto cutter = vtkSmartPointer<vtkCutter>::New();
    cutter->SetCutFunction(&plane);
    cutter->SetInputData(polydata);
    cutter->Update();

    auto cutStripper = vtkSmartPointer<vtkStripper>::New();
    cutStripper->SetInputConnection(cutter->GetOutputPort());
    cutStripper->Update();

    auto cleanPolyData = vtkSmartPointer<vtkCleanPolyData>::New();
    cleanPolyData->SetInputData(cutStripper->GetOutput());
    cleanPolyData->Update();

    vtkSmartPointer<vtkPolyData> contour = cleanPolyData->GetOutput();
    return contour;
}





--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers