[vtkusers] Trying to perform boolean union between more than two polydatas

Cory Quammen cquammen at cs.unc.edu
Tue Apr 16 09:17:37 EDT 2013


The Update() after you call RemoveAllInputs() looks suspect to me. Try
removing it.

Cory

On Tue, Apr 16, 2013 at 8:10 AM, reaper84 <sankowski at gmail.com> wrote:
> I tested that idea and it works fine but when I'm trying to make a loop and
> perform union multiple times on the same function whole code breaks :/. This
> is part of my code:
>
>  vtkSmartPointer<vtkBooleanOperationPolyDataFilter> booleanOperation =
> vtkSmartPointer<vtkBooleanOperationPolyDataFilter>::New();
>  booleanOperation->SetOperationToUnion();
>  vtkSmartPointer<vtkBooleanOperationPolyDataFilter> booleanOperation1 =
> vtkSmartPointer<vtkBooleanOperationPolyDataFilter>::New();
>  booleanOperation1->SetOperationToUnion();
>
> int count_boolean = 0;
> .
> .
> some loop
> {
> .
> .
>  triangle->SetInput(tuber->GetOutput()); //this gives me another poly to add
> to union
>
>        if (count_boolean ==
> 0){booleanOperation->AddInput(0,triangle->GetOutput());}
>        else if (count_boolean ==
> 1){booleanOperation->AddInput(1,triangle->GetOutput());}
>        else if (count_boolean ==
> 2){booleanOperation1->AddInput(0,booleanOperation->GetOutput());
>
> booleanOperation1->AddInput(1,triangle->GetOutput());}
>        else
>            {
>            vtkSmartPointer<vtkPolyData> boolCopy =
> vtkSmartPointer<vtkPolyData>::New();
>            boolCopy = booleanOperation1->GetOutput();
>            boolCopy->Update();
>            booleanOperation1->RemoveAllInputs();
>            booleanOperation1->Update();
>            booleanOperation1->AddInput(0,boolCopy);
>            booleanOperation1->AddInput(1,triangle->GetOutput());
>            booleanOperation1->Update();
>            }
>        count_boolean++;
>        }
>
> Error: vtkStreamingDemandDrivenPipeline (0x32cf8a0): Input port 0 of
> algorithm vtkBooleanOperationPolyDataFilter(0x321e500) has 0 connections but
> is not optional.
>
> It seams like after removing inputs no new inputs are added...
> Could somebody give me a hint? Thanks!
>
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/Trying-to-perform-boolean-union-between-more-than-two-polydatas-tp5719330p5720081.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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



-- 
Cory Quammen
Research Associate
Department of Computer Science
The University of North Carolina at Chapel Hill



More information about the vtkusers mailing list