<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 10pt; ">Hi VTK users,</div><div style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 10pt; "><br></div><div style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 10pt; ">I'm using the vtkBooleanOperationPolyDataFilter to apply boolean operations to polydata. Unfortunately, I got unexpected results (holes in the mesh).</div><div style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 10pt; "><br></div><div style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 10pt; ">You can see here <a href="http://www.hostingpics.net/viewer.php?id=210273error.png" style="font-size: 10pt;
">http://www.hostingpics.net/viewer.php?id=210273error.png</a> an example.</div><div style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 10pt; ">I'm creating a cylinder, then I'm adding a cube and finally I'm adding another cylinder. The holes appear with the last operation.</div><div style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 10pt; "><br></div><div style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 10pt; "><br></div><div style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 10pt; ">Can someone explain me the reason(s) of these results ?</div><div style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 10pt; "><br></div><div style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 10pt; ">Here are my source code :</div><div><div><font face="Courier
New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkCylinderSource * cylinder1 = vtkCylinderSource::New();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cylinder1->SetCenter(0, 10, 0);</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cylinder1->SetHeight(50);</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cylinder1->SetRadius(5);</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cylinder1->SetResolution(100);</font></div><div><font face="Courier New, courier, monaco,
monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cylinder1->Update();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><br></font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkTriangleFilter * cylinder1Triangle = vtkTriangleFilter::New();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cylinder1Triangle->SetInput(cylinder1->GetOutput());</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cylinder1Triangle->Update();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><br></font></div><div><font face="Courier New,
courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cylinder1->Delete();</font></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 13px;"><br></span></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkCubeSource * cube = vtkCubeSource::New();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cube->SetCenter(0, 10, 0);</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cube->SetXLength(50);</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">
        </span>cube->SetYLength(20);</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cube->SetZLength(10);</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cube->Update();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><br></font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkTriangleFilter *cubeTriangle = vtkTriangleFilter::New();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cubeTriangle->SetInput(cube->GetOutput());</font></div><div><font face="Courier New, courier, monaco, monospace,
sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cubeTriangle->Update();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><br></font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cube->Delete();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><br></font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkCylinderSource * cylinder2 = vtkCylinderSource::New();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cylinder2->SetCenter(-25, 15, 0);</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span
class="Apple-tab-span" style="white-space:pre">        </span>cylinder2->SetHeight(30);</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cylinder2->SetRadius(3);</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cylinder2->SetResolution(100);</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cylinder2->Update();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><br></font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkTriangleFilter * cylinder2Triangle = vtkTriangleFilter::New();</font></div><div><font
face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cylinder2Triangle->SetInput(cylinder2->GetOutput());</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cylinder2Triangle->Update();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><br></font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cylinder2->Delete();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><br></font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkBooleanOperationPolyDataFilter * add1 =
vtkBooleanOperationPolyDataFilter::New();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>add1->SetOperationToUnion();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>add1->SetInput(0, cylinder1Triangle->GetOutput());</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>add1->SetInput(1, cubeTriangle->GetOutput());</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>add1->Update();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><br></font></div><div><font face="Courier New, courier, monaco,
monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cubeTriangle->Delete();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>cylinder1Triangle->Delete();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><br></font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkBooleanOperationPolyDataFilter * add = vtkBooleanOperationPolyDataFilter::New();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>add->SetOperationToUnion();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">
        </span>add->SetInput(0, add1->GetOutput());</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>add->SetInput(1, cylinder2Triangle->GetOutput());</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>add->Update();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><br></font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>add1->Delete();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><span class="Apple-tab-span" style="white-space: pre; ">        </span>cylinder2Triangle->Delete();</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif"
size="2"><br></font></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 13px; ">Am I doing something wrong in the use of vtkBooleanOperationPolyDataFilter ?</span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 13px; "><br></span></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2">Thank you.</font></div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2">Best</font></div></div></div></body></html>