# How to triangulate a surface from point cloud

**URL:** https://discourse.vtk.org/t/how-to-triangulate-a-surface-from-point-cloud/2240
**Category:** Support
**Created:** [December 9, 2019, 3:58pm UTC](https://discourse.vtk.org/t/how-to-triangulate-a-surface-from-point-cloud/2240 "2019-12-09T15:58:12Z")
**Posts on this page:** 1
**Showing post:** 5

<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: [December 10, 2019, 9:05pm UTC](https://discourse.vtk.org/t/how-to-triangulate-a-surface-from-point-cloud/2240/5 "2019-12-10T21:05:44Z")

</div>

> [@Paulo\_Carvalho](#):
>
> VTK of course has such an algorithm in a class called `vtkDelaunay3D`

There are a couple of more, see for example:

- [https://lorensen.github.io/VTKExamples/site/Cxx/Points/ExtractSurface/](https://lorensen.github.io/VTKExamples/site/Cxx/Points/ExtractSurface/)
- [https://lorensen.github.io/VTKExamples/site/Cxx/Points/PoissonExtractSurface/](https://lorensen.github.io/VTKExamples/site/Cxx/Points/PoissonExtractSurface/)
- [https://lorensen.github.io/VTKExamples/site/Cxx/Points/PowercrustExtractSurface/](https://lorensen.github.io/VTKExamples/site/Cxx/Points/PowercrustExtractSurface/)
- [https://lorensen.github.io/VTKExamples/site/Cxx/Points/ExtractSurfaceDemo/](https://lorensen.github.io/VTKExamples/site/Cxx/Points/ExtractSurfaceDemo/)

> [@T4mmi](#):
>
> create cells from a uniform grid array of `z` coordinates

You may use [vtkDepthImageToPointCloud](https://vtk.org/doc/nightly/html/classvtkDepthImageToPointCloud.html) filter to create point cloud from your depth image.

> [@T4mmi](#):
>
> Anyway, I don’t have any other choice since VTK adapters does not seems to work as expected…

They work as expected. You just have to be careful not to delete or modify memory layout of a buffer that is used in both VTK and numpy (I don’t think they can notify each other about the change). In general, it is not worth spending a lot of time with maintaining a shared buffer and easier to just deep-copy the data instead. However, if performance is critical then using shared buffers may be the better choice, despite the additional complexity.

---

_[View the full topic](https://discourse.vtk.org/t/how-to-triangulate-a-surface-from-point-cloud/2240)._
