[vtkusers] Weird Bounds after vtkCutter

Romain LEGUAY romain.leguay at gmail.com
Tue Nov 3 09:11:46 EST 2015


Thank you Cory for your answer.

I attach my code with the CMake file. Maybe my first cut on my mesh does
nothing because on other cut, the bound values seems quite good.

In this code, I first use vtkCutter then vtkContourTriangular but I have
the same result (the first cut give me some weird bounds).

Thanks again!

Romain


2015-11-03 14:47 GMT+01:00 Cory Quammen <cory.quammen at kitware.com>:

> Romain,
>
> I don't see anything wrong with the code you posted. Could you post a
> complete example that can be compiled and tested and which shows your
> problem?
>
> I tried using your cutter code with a vtkSphereSource instead of an OBJ
> reader and it seemed to work fine.
>
> Thanks,
> Cory
>
> On Tue, Nov 3, 2015 at 4:09 AM, Romain LEGUAY <romain.leguay at gmail.com>
> wrote:
>
>> Hello everyone,
>>
>> I applied the filter vtkCutter to a mesh and I want to get the bounds of
>> the result contours.
>>
>> The bounds of the mesh seem goods.
>>
>> When I display the vtkCutter output result, I see the expected result but
>> I obtained those bound values: xmin = ymin = zmin = 1.0, and xmax = ymax =
>> zmax = -1.0.
>>
>> I don't understand what I did wrong in my code:
>>
>> // Create a plane of the current Y-axis
>> vtkSmartPointer<vtkPlane> plane = vtkSmartPointer<vtkPlane>::New();
>> plane->SetOrigin(0,0,0);
>> plane->SetNormal(0,1,0);
>> // Cut the mesh -> contours creation
>> vtkSmartPointer<vtkCutter> cutter = vtkSmartPointer<vtkCutter>::New();
>> cutter->SetCutFunction(plane);
>> cutter->SetInputConnection(readerOBJ->GetOutputPort());
>> cutter->Update();
>>
>> double boundsCutter[6];
>> cutter->GetOutput()->GetBounds(boundsCutter); // [1.0, -1.0, 1.0, -1.0,
>> 1.0, -1.0]
>>
>>
>> Do I need to do another update?
>>
>> Thank you,
>>
>> Romain
>>
>> _______________________________________________
>> 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:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
>>
>
>
> --
> Cory Quammen
> R&D Engineer
> Kitware, Inc.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151103/bdd217d3/attachment.html>
-------------- next part --------------
cmake_minimum_required(VERSION 2.8)

PROJECT(ContourTriangular)

find_package(VTK REQUIRED)
include(${VTK_USE_FILE})

add_executable(ContourTriangular MACOSX_BUNDLE ContourTriangular)

if(VTK_LIBRARIES)
  target_link_libraries(ContourTriangular ${VTK_LIBRARIES})
else()
  target_link_libraries(ContourTriangular vtkHybrid vtkWidgets)
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ContourTriangular.cpp
Type: text/x-c++src
Size: 3994 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151103/bdd217d3/attachment.cpp>


More information about the vtkusers mailing list