Hi Cory,<div><br></div><div>Thanks for your answer. In the end I'm thinking of using vtkKdTreePointLocator to iteratively find the points in mesh B present in mesh A, and then vtkCleanPolyData to remove those points.</div>
<div><br></div><div>Thanks,</div><div>Miguel<br><br><div class="gmail_quote">On Thu, May 24, 2012 at 1:17 PM, Cory Quammen <span dir="ltr"><<a href="mailto:cquammen@cs.unc.edu" target="_blank">cquammen@cs.unc.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The boolean operations are tailored to find the boundaries of volumes<br>
defined by boolean operations on the *volumes* defined by the input<br>
meshes. That's why the inputs are required to be manifold. In<br>
addition, the class assumes that any intersection between the two<br>
input poly datas can be described by a set of line segments. This<br>
makes breaking the input meshes into regions defining the union and<br>
intersection boundaries relatively easy. In your case, the<br>
intersection consists of a triangular mesh, and the boolean operation<br>
filter isn't able to handle that case.<br>
<br>
For the example you pose, perhaps you could compute the cell centers<br>
from your meshes and use a point locator to determine if a cell from<br>
one surface or the other is the only one present at a location?<br>
<br>
Cory<br>
<div class="HOEnZb"><div class="h5"><br>
On Thu, May 24, 2012 at 2:58 AM, Malsoaz James <<a href="mailto:jmalsoaz@yahoo.fr">jmalsoaz@yahoo.fr</a>> wrote:<br>
> This thread may help<br>
> : <a href="http://vtk.1045678.n5.nabble.com/Holes-in-mesh-after-vtkBooleanOperationPolyDataFilter-td5713284.html" target="_blank">http://vtk.1045678.n5.nabble.com/Holes-in-mesh-after-vtkBooleanOperationPolyDataFilter-td5713284.html</a><br>
><br>
> ________________________________<br>
> De : Miguel Sotaquira <<a href="mailto:msotaquira@gmail.com">msotaquira@gmail.com</a>><br>
> À : <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
> Envoyé le : Jeudi 24 mai 2012 5h25<br>
> Objet : [vtkusers] vtkBooleanOperationPolyDataFilter:<br>
> SetOperationToDifference gives me strange results<br>
><br>
> Hi everyone,<br>
><br>
> I'm trying to compute an XOR boolean operation between two NON manifold<br>
> surfaces (see figure <a href="http://shareimage.org/images/3s5diyk1oypdib5fvx80.png" target="_blank">http://shareimage.org/images/3s5diyk1oypdib5fvx80.png</a>).<br>
> The surface A is the white one (top panel of previous figure) and the<br>
> surface B is the red one (bottom panel). B is simply a region extracted from<br>
> A using vtkExtractPolyDataGeometry.<br>
><br>
> Now I want to compute a boolean XOR between A and B in order to get C: the<br>
> green colored surface. I'm using vtkBooleanOperationPolyDataFilter:<br>
><br>
> vtkSmartPointer<vtkBooleanOperationPolyDataFilter> boolean<br>
> = vtkSmartPointer<vtkBooleanOperationPolyDataFilter>::New();<br>
> boolean->SetOperationToDifference();<br>
> boolean->SetInput(0,meshA);<br>
> boolean->SetInput(1,meshB);<br>
> boolean->Update();<br>
><br>
> vtkPolyData* meshC = boolean->GetOutput();<br>
><br>
> However, when using this approach I obtain a surface like this (the blue<br>
> one): <a href="http://shareimage.org/images/gva77uyrmog4n2j1ndo.png" target="_blank">http://shareimage.org/images/gva77uyrmog4n2j1ndo.png</a>; that clearly is<br>
> not the expected XOR operation.<br>
><br>
> I know I'm not using manifold surfaces (as explicitly required<br>
> by vtkBooleanOperationPolyDataFilter) so I don't know if that's why I'm<br>
> getting these results. If so, is there another way of computing this XOR<br>
> operation?<br>
><br>
> Thanks,<br>
> Miguel<br>
><br>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Cory Quammen<br>
Research Associate<br>
Department of Computer Science<br>
The University of North Carolina at Chapel Hill<br>
</font></span></blockquote></div><br></div>