# vtkTriangleFilter - Generate more triangles?

**URL:** https://discourse.vtk.org/t/vtktrianglefilter-generate-more-triangles/4169
**Category:** Support
**Created:** [September 7, 2020, 11:15pm UTC](https://discourse.vtk.org/t/vtktrianglefilter-generate-more-triangles/4169 "2020-09-07T23:15:09Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![MMoussa](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/779978/32.png) [@MMoussa](https://discourse.vtk.org/u/MMoussa)
#### Post date: [September 7, 2020, 11:15pm UTC](https://discourse.vtk.org/t/vtktrianglefilter-generate-more-triangles/4169/1 "2020-09-07T23:15:09Z")

</div>

I am using vtkTraingleFilter to triangulate a vtkUnstructuredGrid.

My goal is to generate a smooth color map. My understanding is that I need more triangles to do this. For example a linear quadrilateral is rendered with two triangles, but I want it to be rendered with say, eight.

How do I achieve this? I was hoping to simply increase the number of triangles that vtkTriangleFilter generates but that doesn’t seem possible. (I am using Activiz btw).

Smoothing after triangulating is not what I want either, as I don’t want smoothing along cell boundaries.

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.vtk.org/u/Kenichiro-Yoshimi)
#### Post date: [September 8, 2020, 4:31am UTC](https://discourse.vtk.org/t/vtktrianglefilter-generate-more-triangles/4169/2 "2020-09-08T04:31:48Z")

</div>

Hello,

I think the vtkLinearSubdivisionFilter is waht you are looking for. After triangulating, you can make use of vtkLinearSubdivisionFilter to get more triangles. Here is an example:  
[https://lorensen.github.io/VTKExamples/site/CSharp/Meshes/Subdivision/](https://lorensen.github.io/VTKExamples/site/CSharp/Meshes/Subdivision/)

---

<div class="post-metadata">

### Author: ![MMoussa](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/779978/32.png) [@MMoussa](https://discourse.vtk.org/u/MMoussa)
#### Post date: [September 8, 2020, 5:18am UTC](https://discourse.vtk.org/t/vtktrianglefilter-generate-more-triangles/4169/3 "2020-09-08T05:18:02Z")

</div>

Hi @Kenichiro-Yoshimi - thank you for taking the time to reply.

I think vtkLinearSubdivisionFilter will subdivide the triangles, but it’s not what I want exactly. Consider a standard linear isoparametric quadrilateral element. When twisted, it takes on a smooth shape due to the quadratic terms in the shape functions. However, VTK by default decides to use two triangles for this element, resulting in a kink. What I want is the triangulation to use more triangles, placing the extra vertices at positions evaluated using the shape function for that cell.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)
#### Post date: [September 15, 2020, 2:10pm UTC](https://discourse.vtk.org/t/vtktrianglefilter-generate-more-triangles/4169/4 "2020-09-15T14:10:27Z")

</div>

Look at [`vtkGeometryFilter`](https://vtk.org/doc/nightly/html/classvtkGeometryFilter.html). It has an option [`NonlinearSubdivisionLevel`](https://vtk.org/doc/nightly/html/classvtkGeometryFilter.html#a095dc968a1aaf6d02e1025cdfb6007fb) that you can set to control how refined each element (cell in VTK parlance) gets.

---

<div class="post-metadata">

### Author: ![MMoussa](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/779978/32.png) [@MMoussa](https://discourse.vtk.org/u/MMoussa)
#### Post date: [September 17, 2020, 11:35pm UTC](https://discourse.vtk.org/t/vtktrianglefilter-generate-more-triangles/4169/5 "2020-09-17T23:35:58Z")

</div>

Looks like that option is not available in VTK 8.2.0 (I am using Activiz) …
