[vtkusers] Segmentation fault with vtkBooleanOperationPolyDataFilter using 2 cylinders [HELP]

Cory Quammen cory.quammen at kitware.com
Wed Sep 16 09:14:34 EDT 2015


Hi Drak,

Two things:

1). You might want to try the master branch in VTK's git repository. There
have been some recent changes that might fix your problem.

2). Would it be possible to post a stack trace where your program crashes?
Or report radius values that lead to the crash?

Thanks,
Cory



On Wed, Aug 19, 2015 at 4:56 PM, Drak <draktharrblorf at gmail.com> wrote:

> I've noticed that by playing with the radius value and the resolution of
> the
> cylinder, the boolean operation filter may or may not crash
>
> Here is my code bellow.
>
>     // The outer cylinder
>     vtkCylinderSource * _cylinderSource1 = vtkCylinderSource::New();
>     _cylinderSource1->SetCenter(0, 0, 0);
>     _cylinderSource1->SetHeight(width);
>     _cylinderSource1->SetRadius(0.13);
>     _cylinderSource1->SetResolution(10);
>     _cylinderSource1->Update();
>
>     vtkTriangleFilter * _cylinder1Triangle = vtkTriangleFilter::New();
>     _cylinder1Triangle->SetInputData(_cylinderSource1->GetOutput());
>     _cylinder1Triangle->Update();
>
>     // The inner cylinder
>     vtkCylinderSource * _cylinderSource2 = vtkCylinderSource::New();
>     _cylinderSource2->SetCenter(0, 0, 0);
>     _cylinderSource2->SetHeight(width+0.01);
>     _cylinderSource2->SetRadius(0.001);
>     _cylinderSource2->SetResolution(20);
>     _cylinderSource2->Update();
>
>     vtkTriangleFilter * _cylinder2Triangle = vtkTriangleFilter::New();
>     _cylinder2Triangle->SetInputData(_cylinderSource2->GetOutput());
>     _cylinder2Triangle->Update();
>
>     vtkBooleanOperationPolyDataFilter * _filter =
> vtkBooleanOperationPolyDataFilter::New();
>     _filter->SetOperationToDifference();
>     _filter->SetInputData(0, _cylinder1Triangle->GetOutput());
>     _filter->SetInputData(1, _cylinder2Triangle->GetOutput());
>     _filter->Update(); // CRASH
>
> What should I do to make it work 100 % of the time? I don't care if I have
> sometimes weird holes, but I cannot accept to have crashes in my program :\
> .
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/Segmentation-fault-with-vtkBooleanOperationPolyDataFilter-using-2-cylinders-HELP-tp5733567.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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/20150916/a96dcbce/attachment.html>


More information about the vtkusers mailing list