# Delaunay triangulation numerically sensitive vtk-9.0.1 vtkDelaunay2D handle large numbers of points System.StackOverflowException

**URL:** https://discourse.vtk.org/t/delaunay-triangulation-numerically-sensitive-vtk-9-0-1-vtkdelaunay2d-handle-large-numbers-of-points-system-stackoverflowexception/5729
**Category:** Support
**Created:** [May 7, 2021, 9:32am UTC](https://discourse.vtk.org/t/delaunay-triangulation-numerically-sensitive-vtk-9-0-1-vtkdelaunay2d-handle-large-numbers-of-points-system-stackoverflowexception/5729 "2021-05-07T09:32:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![yaoganxingwei](https://discourse.vtk.org/user_avatar/discourse.vtk.org/yaoganxingwei/32/3361_2.png) [@yaoganxingwei](https://discourse.vtk.org/u/yaoganxingwei)
#### Post date: [May 7, 2021, 9:32am UTC](https://discourse.vtk.org/t/delaunay-triangulation-numerically-sensitive-vtk-9-0-1-vtkdelaunay2d-handle-large-numbers-of-points-system-stackoverflowexception/5729/1 "2021-05-07T09:32:09Z")

</div>

In VTK, Delaunay triangulation is numerically sensitive. The vtk-9.0.1 version of vtkDelaunay2D  
may not be robust enough to reliably handle large numbers of points(For example, 3 million points.). IDE pops up Exception Window: System.StackOverflowException. What is a good solution please?

---

<div class="post-metadata">

### Author: ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)
#### Post date: [May 7, 2021, 11:08am UTC](https://discourse.vtk.org/t/delaunay-triangulation-numerically-sensitive-vtk-9-0-1-vtkdelaunay2d-handle-large-numbers-of-points-system-stackoverflowexception/5729/2 "2021-05-07T11:08:14Z")

</div>

VTK’s Delaunay filters are reference implementations. At some point we will rewrite them for robustness (volunteers anyone?). In the meantime, for numerically sensitive data you’ll have to use another external package.

---

<div class="post-metadata">

### Author: ![yaoganxingwei](https://discourse.vtk.org/user_avatar/discourse.vtk.org/yaoganxingwei/32/3361_2.png) [@yaoganxingwei](https://discourse.vtk.org/u/yaoganxingwei)
#### Post date: [May 10, 2021, 9:22am UTC](https://discourse.vtk.org/t/delaunay-triangulation-numerically-sensitive-vtk-9-0-1-vtkdelaunay2d-handle-large-numbers-of-points-system-stackoverflowexception/5729/3 "2021-05-10T09:22:38Z")

</div>

![vtkDelaunay2D](https://discourse.vtk.org/uploads/default/original/2X/3/3d973d074da8489aa9e9d8dca35aa40d3284c159.png) ![SystemStackOverflowException](https://discourse.vtk.org/uploads/default/original/2X/0/0d7461d66116433cb68ae411e2e183f5afc9e658.png) ![StackOverflow](https://discourse.vtk.org/uploads/default/original/2X/1/1e1530f8cf703aa7d4b20903e5defa80fe98424e.jpeg) ![Mesh density changes with curvature](https://discourse.vtk.org/uploads/default/original/2X/a/ac11b24b99bffa6ec2b76eb13eff51d3043aa47a.jpeg)  
IDE pops up Exception Window: System.StackOverflowException, the reason for this Exception is that Delaunay triangulation is numerically sensitive ? Check the uploaded pictures carefully, thank you very much!  
In addition, I would like to increase the number of Delaunay triangulation operations on the detected object where the vertical height Z coordinate axis changes greatly. Conversely, reduce the Delaunay triangulation operation where the vertical height Z coordinate axis changes slightly. The operation principle mentioned above is similar to the meshing technique of the last uploaded picture. How to operate to achieve the purpose mentioned above, thank you very much!
