[vtkusers] contour interpolation
sb
sbucc at hotmail.com
Tue May 21 11:24:10 EDT 2019
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
More information about the vtkusers
mailing list