# Problems using vtkContourWidget, vtkAppendPolyData, and vtkDelaunay3D

**URL:** https://discourse.vtk.org/t/problems-using-vtkcontourwidget-vtkappendpolydata-and-vtkdelaunay3d/1480
**Category:** Development
**Created:** [August 3, 2019, 8:59pm UTC](https://discourse.vtk.org/t/problems-using-vtkcontourwidget-vtkappendpolydata-and-vtkdelaunay3d/1480 "2019-08-03T20:59:27Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [August 5, 2019, 3:27am UTC](https://discourse.vtk.org/t/problems-using-vtkcontourwidget-vtkappendpolydata-and-vtkdelaunay3d/1480/2 "2019-08-05T03:27:24Z")

</div>

> [@at123](#):
>
> When I render the actor on ImagePlanesVTKWidget, I see a cylinder like object. I seems as if the first and last contours were used to create the render and it ignored the second contour (the smaller circle). What I wanted was a shape like an hour glass. How would I accomplish this?

It seems that a convex hull is generated, which is what vtkDelaunay3D is expected to do.

You can adjust alpha parameters on the vtkDelaunay3D filter, to make it generate concave objects, but it may make mesh generation fail. Alternatively, if the shape is just slightly concave then you may get away without using alpha shapes and applying vtkButterflySubdivisionFilter on the output.

You can try both these options in 3D Slicer’s Markups To Model module (install 3D Slicer and then in the Slicer extension manager install MarkupsToModel extension). Also, full source code is [here](https://github.com/SlicerIGT/SlicerMarkupsToModel/blob/master/MarkupsToModel/Logic/vtkSlicerMarkupsToModelClosedSurfaceGeneration.cxx). Short demo:

[![](https://discourse.vtk.org/uploads/default/original/2X/3/31f74b899980ead3a4b116e45bc91bb1b0e3d6e5.jpeg "New "Surface cut" and "Mask volume" tools for 3D Slicer segment editor") ](https://www.youtube.com/watch?v=xZwyW6SaoM4&t=88)

You may also try other surface reconstruction filters. Note that all these filters only use the points and ignore all the polygons.

You can make use of the polygons if the contours are defined on parallel planes. If you don’t need to keep the original point coordinates and geometry is simple (no branching, variable spacing, missing slices, etc.) then you might be able to use [vtkVoxelContoursToSurfaceFilter](https://vtk.org/doc/nightly/html/classvtkVoxelContoursToSurfaceFilter.html). To preserve original point coordinates and handle branching, allow keyhole technique for holes within contours, smooth end-capping, etc. you may use 3D Slicer’s [planar contour to closed surface converter](https://github.com/SlicerRt/SlicerRT/blob/master/DicomRtImportExport/ConversionRules/vtkPlanarContourToClosedSurfaceConversionRule.cxx) (it is used automatically when you import set of planar contour from DICOM RTSTRUCT objects).

---

_[View the full topic](https://discourse.vtk.org/t/problems-using-vtkcontourwidget-vtkappendpolydata-and-vtkdelaunay3d/1480)._
