[vtkusers] Get contour boundary values from vtkCutter
David Gobbi
david.gobbi at gmail.com
Wed Mar 6 18:38:49 EST 2013
Hi Billy,
If you apply vtkStripper to the output data (i.e. after
cutting/contouring), it should give you exactly one line per contour.
- David
On Wed, Mar 6, 2013 at 4:21 PM, Billy Okal <okal.billy at gmail.com> wrote:
> Hi,
>
> Thanks for the suggestion, I tried the method you linked and it works, but
> generate a lot more lines that than the generated contours, typically
> hundreds when I try to generate say 10 contour lines. Do you know why?
>
> thanks
>
>
> On Wednesday, March 6, 2013 at 3:29 AM, Bill Lorensen wrote:
>
> see if this helps:
>
> http://vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ExtractPolyLinesFromPolyData
>
>
> On Tue, Mar 5, 2013 at 11:51 AM, Billy Okal <okal.billy at gmail.com> wrote:
>
> Hi All,
>
> I am new to VTK and I am trying to get the values of a mesh at a given
> contour/isosurface.
>
> I am getting the contours using the following
>
> vtkSmartPointer<vtkCutter> cutter = vtkSmartPointer<vtkCutter>::New();
> cutter->SetCutFunction(plane);
> cutter->SetGenerateCutScalars(1);
> #if VTK_MAJOR_VERSION <= 5
> cutter->SetInput(inputPolyData);
> #else
> cutter->SetInputData(inputPolyData);
> #endif
> cutter->GenerateValues(20, -distanceMin, distanceMax);
> vtkSmartPointer<vtkPolyDataMapper> cutterMapper =
> vtkSmartPointer<vtkPolyDataMapper>::New();
> cutterMapper->SetInputConnection( cutter->GetOutputPort());
> cutterMapper->ScalarVisibilityOff();
>
>
> But now I want to store the (x,y,z) positions of the mesh surface along each
> contour to an array of points. How can I do this? Is there any implemented
> utility to do this?
>
> thanks,
>
>
> billy
More information about the vtkusers
mailing list