# Merging vtkpolydata and vtkpolydata issue / Add vtkpolydata to vtkpolydata failed / vtkBooleanOperation failed resulting in non-manifold

**URL:** https://discourse.vtk.org/t/merging-vtkpolydata-and-vtkpolydata-issue-add-vtkpolydata-to-vtkpolydata-failed-vtkbooleanoperation-failed-resulting-in-non-manifold/8191
**Category:** Support
**Created:** [April 1, 2022, 3:15am UTC](https://discourse.vtk.org/t/merging-vtkpolydata-and-vtkpolydata-issue-add-vtkpolydata-to-vtkpolydata-failed-vtkbooleanoperation-failed-resulting-in-non-manifold/8191 "2022-04-01T03:15:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hye00525](https://discourse.vtk.org/user_avatar/discourse.vtk.org/hye00525/32/4904_2.png) [@hye00525](https://discourse.vtk.org/u/hye00525)
#### Post date: [April 1, 2022, 3:15am UTC](https://discourse.vtk.org/t/merging-vtkpolydata-and-vtkpolydata-issue-add-vtkpolydata-to-vtkpolydata-failed-vtkbooleanoperation-failed-resulting-in-non-manifold/8191/1 "2022-04-01T03:15:59Z")

</div>

Hello,  
I am trying to add cone-shaped or triangular pyramid-shaped vtkpolydata fins to vtkpolydata at specific positions in polydata. (like picture below )

 ![image](https://discourse.vtk.org/uploads/default/original/2X/9/9e0c21bf924ca9d463970baf777a48f7bcbafb19.png)

I plan to print this stl using 3d print, and I have tried the vtkBooleanfilter, but failed to print due to the non-manifold issue, so I am asking if there is another good method.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/4/488551b99d48b8b82d68ff66950ab8a1b38ab020.png)

My trials-----

- Merging two vtkpolydata using vtkAppendfilter → 3d print was not possible (It looks like it’s merged, but is impossible to print because the vertex and face are configured separately)

- Merging two vtkpolydata using vtkBooleanfilter: 3d print impossible due to **non-manifold creation** (same issue as [this person]([https://discourse.vtk.org/t/the-result-of-boolean-operation-returns-non-manifold-surfaces](https://discourse.vtk.org/t/the-result-of-boolean-operation-returns-non-manifold-surfaces) /4018) )

- Using Ronald Romer’s vtkbool library: Since my project uses vtk-9, it was difficult to build and use. (Note [https://github.com/zippy84/vtkbool/pull/37](https://github.com/zippy84/vtkbool/pull/37))

Has anyone tried a similar approach?  
Any advice or code example would be great. Thank you.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [April 2, 2022, 1:55am UTC](https://discourse.vtk.org/t/merging-vtkpolydata-and-vtkpolydata-issue-add-vtkpolydata-to-vtkpolydata-failed-vtkbooleanoperation-failed-resulting-in-non-manifold/8191/2 "2022-04-02T01:55:48Z")

</div>

We have updated vtkbool to work with latest VTK master and fixed up its Python wrapping. It works very nicely, both in C++ and Python. It [can deal with fairly complex meshes for creating 3D-printable surgical guides](https://github.com/SlicerIGT/SlicerBoneReconstructionPlanner#screenshots):

[![](https://discourse.vtk.org/uploads/default/original/2X/5/50ea57a47549a98ebbe29498314bf037a4cb88e5.png) ](https://raw.githubusercontent.com/SlicerIGT/SlicerBoneReconstructionPlanner/main/BoneReconstructionPlanner/Resources/Screenshots/screenshotPatientSpecificSurgicalGuides.png)

The modified vtkbool code is available [here](https://github.com/PerkLab/SlicerSandbox/tree/master/CombineModels/Logic). We have not pushed our changes back to upstream because we are waiting for @jcfr’s VTK remote infrastructure to be ready. Until it is ready, you can use vtkbool in Slicer’s GUI, or in the virtual Python environment that Slicer provides, or in C++ Slicer modules, or (as a short-term workaround) just copy the files from our repository and use it in your C++ project.

At some point there was also a vtkbool Paraview plugin, but I don’t know if that is still available.

---

<div class="post-metadata">

### Author: ![hye00525](https://discourse.vtk.org/user_avatar/discourse.vtk.org/hye00525/32/4904_2.png) [@hye00525](https://discourse.vtk.org/u/hye00525)
#### Post date: [April 2, 2022, 6:30am UTC](https://discourse.vtk.org/t/merging-vtkpolydata-and-vtkpolydata-issue-add-vtkpolydata-to-vtkpolydata-failed-vtkbooleanoperation-failed-resulting-in-non-manifold/8191/3 "2022-04-02T06:30:32Z")

</div>

Thank you very much for your detailed explanation and code.  
I’ll try it. Have a nice day!
