Hi Cory,<div><br></div><div>Thanks for your answer. In the end I&#39;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">&lt;<a href="mailto:cquammen@cs.unc.edu" target="_blank">cquammen@cs.unc.edu</a>&gt;</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&#39;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&#39;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 &lt;<a href="mailto:jmalsoaz@yahoo.fr">jmalsoaz@yahoo.fr</a>&gt; wrote:<br>
&gt; This thread may help<br>
&gt; : <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>

&gt;<br>
&gt; ________________________________<br>
&gt; De : Miguel Sotaquira &lt;<a href="mailto:msotaquira@gmail.com">msotaquira@gmail.com</a>&gt;<br>
&gt; À : <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
&gt; Envoyé le : Jeudi 24 mai 2012 5h25<br>
&gt; Objet : [vtkusers] vtkBooleanOperationPolyDataFilter:<br>
&gt; SetOperationToDifference gives me strange results<br>
&gt;<br>
&gt; Hi everyone,<br>
&gt;<br>
&gt; I&#39;m trying to compute an XOR boolean operation between two NON manifold<br>
&gt; surfaces (see figure <a href="http://shareimage.org/images/3s5diyk1oypdib5fvx80.png" target="_blank">http://shareimage.org/images/3s5diyk1oypdib5fvx80.png</a>).<br>
&gt; The surface A is the white one (top panel of previous figure) and the<br>
&gt; surface B is the red one (bottom panel). B is simply a region extracted from<br>
&gt; A using vtkExtractPolyDataGeometry.<br>
&gt;<br>
&gt; Now I want to compute a boolean XOR between A and B in order to get C: the<br>
&gt; green colored surface. I&#39;m using vtkBooleanOperationPolyDataFilter:<br>
&gt;<br>
&gt; vtkSmartPointer&lt;vtkBooleanOperationPolyDataFilter&gt; boolean<br>
&gt; = vtkSmartPointer&lt;vtkBooleanOperationPolyDataFilter&gt;::New();<br>
&gt; boolean-&gt;SetOperationToDifference();<br>
&gt; boolean-&gt;SetInput(0,meshA);<br>
&gt; boolean-&gt;SetInput(1,meshB);<br>
&gt; boolean-&gt;Update();<br>
&gt;<br>
&gt; vtkPolyData* meshC = boolean-&gt;GetOutput();<br>
&gt;<br>
&gt; However, when using this approach I obtain a surface like this (the blue<br>
&gt; one): <a href="http://shareimage.org/images/gva77uyrmog4n2j1ndo.png" target="_blank">http://shareimage.org/images/gva77uyrmog4n2j1ndo.png</a>;  that clearly is<br>
&gt; not the expected XOR operation.<br>
&gt;<br>
&gt; I know I&#39;m not using manifold surfaces (as explicitly required<br>
&gt; by vtkBooleanOperationPolyDataFilter) so I don&#39;t know if that&#39;s why I&#39;m<br>
&gt; getting these results. If so, is there another way of computing this XOR<br>
&gt; operation?<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Miguel<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<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>