[vtkusers] Re : vtkBooleanOperationPolyDataFilter: SetOperationToDifference gives me strange results

Cory Quammen cquammen at cs.unc.edu
Thu May 24 07:17:46 EDT 2012


The boolean operations are tailored to find the boundaries of volumes
defined by boolean operations on the *volumes* defined by the input
meshes. That's why the inputs are required to be manifold. In
addition, the class assumes that any intersection between the two
input poly datas can be described by a set of line segments. This
makes breaking the input meshes into regions defining the union and
intersection boundaries relatively easy. In your case, the
intersection consists of a triangular mesh, and the boolean operation
filter isn't able to handle that case.

For the example you pose, perhaps you could compute the cell centers
from your meshes and use a point locator to determine if a cell from
one surface or the other is the only one present at a location?

Cory

On Thu, May 24, 2012 at 2:58 AM, Malsoaz James <jmalsoaz at yahoo.fr> wrote:
> This thread may help
>http://vtk.1045678.n5.nabble.com/Holes-in-mesh-after-vtkBooleanOperationPolyDataFilter-td5713284.html
>
> ________________________________
> De : Miguel Sotaquira <msotaquira at gmail.com>
> À : vtkusers at vtk.org
> Envoyé le : Jeudi 24 mai 2012 5h25
> Objet : [vtkusers] vtkBooleanOperationPolyDataFilter:
> SetOperationToDifference gives me strange results
>
> Hi everyone,
>
> I'm trying to compute an XOR boolean operation between two NON manifold
> surfaces (see figure http://shareimage.org/images/3s5diyk1oypdib5fvx80.png).
> The surface A is the white one (top panel of previous figure) and the
> surface B is the red one (bottom panel). B is simply a region extracted from
> A using vtkExtractPolyDataGeometry.
>
> Now I want to compute a boolean XOR between A and B in order to get C: the
> green colored surface. I'm using vtkBooleanOperationPolyDataFilter:
>
> vtkSmartPointer<vtkBooleanOperationPolyDataFilter> boolean
> = vtkSmartPointer<vtkBooleanOperationPolyDataFilter>::New();
> boolean->SetOperationToDifference();
> boolean->SetInput(0,meshA);
> boolean->SetInput(1,meshB);
> boolean->Update();
>
> vtkPolyData* meshC = boolean->GetOutput();
>
> However, when using this approach I obtain a surface like this (the blue
> one): http://shareimage.org/images/gva77uyrmog4n2j1ndo.png;  that clearly is
> not the expected XOR operation.
>
> I know I'm not using manifold surfaces (as explicitly required
> by vtkBooleanOperationPolyDataFilter) so I don't know if that's why I'm
> getting these results. If so, is there another way of computing this XOR
> operation?
>
> Thanks,
> Miguel
>
>
> _______________________________________________
> 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
>
>
>
> _______________________________________________
> 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