# Maximum edge length for vtkAdaptiveSubdivisionFilter()

**URL:** https://discourse.vtk.org/t/maximum-edge-length-for-vtkadaptivesubdivisionfilter/5814
**Category:** Support
**Created:** [May 19, 2021, 10:21am UTC](https://discourse.vtk.org/t/maximum-edge-length-for-vtkadaptivesubdivisionfilter/5814 "2021-05-19T10:21:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ttsesm](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ttsesm/32/3424_2.png) [@ttsesm](https://discourse.vtk.org/u/ttsesm)
#### Post date: [May 19, 2021, 10:21am UTC](https://discourse.vtk.org/t/maximum-edge-length-for-vtkadaptivesubdivisionfilter/5814/1 "2021-05-19T10:21:40Z")

</div>

Hi,

I have two meshes with the following properties:

```auto
m_faces: 16640
m_points: 49920
m_area: 178.82696989147524

m1_faces: 8
m1_points: 24
m1_area: 1.440205667851934

```

Now I would like to subdivide `m1` so that it has approx. the same faces number as `m`, i.e. 16640. I am using the [vtkAdaptiveSubdivisionFilter()](https://vtk.org/doc/nightly/html/classvtkAdaptiveSubdivisionFilter.html) which according to the description:

> …is a filter that subdivides triangles based on maximum edge length and/or triangle area.

My question is how to get the maximum edge length, according to some trial and error I found that this needs to be around `0.02`. However, I couldn’t find any formulation that gives this number and is consistent on different meshes. Any idea how to calculate this maximum edge length each time (I would need a generic formulation since I would like to apply this on different meshes)?

Thanks.

---

<div class="post-metadata">

### Author: ![ttsesm](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ttsesm/32/3424_2.png) [@ttsesm](https://discourse.vtk.org/u/ttsesm)
#### Post date: [May 20, 2021, 12:44pm UTC](https://discourse.vtk.org/t/maximum-edge-length-for-vtkadaptivesubdivisionfilter/5814/2 "2021-05-20T12:44:34Z")

</div>

More specifically I found that the maximum edge length for the above example should be between `[0.0188-0.0265]`.

On another example with the following two meshes:

```auto
Sph1_faces: 390
Sph1_points: 1170
Sph1_area: 1.9251713393584104

Sph2_faces: 1722
Sph2_points: 5166
Sph2_area: 10.59400389764954

```

The given maximum edge length should be between `[0.089-0.09]`. I’ve tried also to play a bit with the other variable that can be set, i.e. the `maximum triangle area` but no luck. There is also the option to set the maximum number of triangles which as I understood needs to be combined with one of the maximum edge length or maximum triangle area parameters but then it creates some strange output with artifacts (missing triangles), see images below:

Initial mesh to be subdivided:

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

Output after I set the maximum number of triangles:

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

so you can see that some of the triangles are discarded.

To be honest, I am not quite sure how the vtkAdaptiveSubdivisionFilter() function works.
