[vtkusers] Solved - Weird Bounds after vtkCutter

Romain LEGUAY romain.leguay at gmail.com
Tue Nov 3 09:45:02 EST 2015


I tested on armadillo.obj too so this result is normal.

Thanks again!

Romain

PS: I have another question about saving the ouput polydata result (from
vtkContourTriangulator) inside a picture file (PNG for example) but I'm
going to open a new discussion.


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

>
>
> On Tue, Nov 3, 2015 at 9:11 AM, Romain LEGUAY <romain.leguay at gmail.com>
> wrote:
>
>> 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.
>>
>
> Yeah. The first plane cuts on the very edge of the object, yielding 0
> cells and 0 points. I tested this with your code on the armadillo.obj file
> that you can find with some Googling. Since there are no points, the bounds
> are left in their default invalid state.
>
> HTH,
> Cory
>
>
>> 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.
>>>
>>
>>
>> _______________________________________________
>> 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/bbf4e6bd/attachment.html>


More information about the vtkusers mailing list