# Draw Curve on Mesh with vtkContourWidget

**URL:** https://discourse.vtk.org/t/draw-curve-on-mesh-with-vtkcontourwidget/15504
**Category:** Support
**Tags:** code
**Created:** [April 16, 2025, 8:09am UTC](https://discourse.vtk.org/t/draw-curve-on-mesh-with-vtkcontourwidget/15504 "2025-04-16T08:09:28Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Suleyman\_Turkoglu](https://discourse.vtk.org/user_avatar/discourse.vtk.org/suleyman_turkoglu/32/9864_2.png) [@Suleyman\_Turkoglu](https://discourse.vtk.org/u/Suleyman_Turkoglu)
#### Post date: [April 16, 2025, 8:09am UTC](https://discourse.vtk.org/t/draw-curve-on-mesh-with-vtkcontourwidget/15504/1 "2025-04-16T08:09:28Z")

</div>

I can draw a curve using vtkContourWidget. The control points can be on the polydata, but I want the curve itself to be above the polydata. Is it possible to achieve that using vtkContourWidget?

---

<div class="post-metadata">

### Author: ![LucasGandel](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lucasgandel/32/1831_2.png) [@LucasGandel](https://discourse.vtk.org/u/LucasGandel)
#### Post date: [April 17, 2025, 6:27am UTC](https://discourse.vtk.org/t/draw-curve-on-mesh-with-vtkcontourwidget/15504/2 "2025-04-17T06:27:00Z")

</div>

Yes this can be controlled with vtkContourLineInterpolator. This example should help: [https://examples.vtk.org/site/Cxx/PolyData/PolygonalSurfaceContourLineInterpolator/](https://examples.vtk.org/site/Cxx/PolyData/PolygonalSurfaceContourLineInterpolator/)

---

<div class="post-metadata">

### Author: ![Suleyman\_Turkoglu](https://discourse.vtk.org/user_avatar/discourse.vtk.org/suleyman_turkoglu/32/9864_2.png) [@Suleyman\_Turkoglu](https://discourse.vtk.org/u/Suleyman_Turkoglu)
#### Post date: [April 17, 2025, 10:54am UTC](https://discourse.vtk.org/t/draw-curve-on-mesh-with-vtkcontourwidget/15504/3 "2025-04-17T10:54:44Z")

</div>

I tried this example, but the rendering is jagged because it passes over the edges of the triangles. For a smoother appearance, the curve needs to follow the surface instead of cutting across the triangle edges.

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

---

<div class="post-metadata">

### Author: ![LucasGandel](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lucasgandel/32/1831_2.png) [@LucasGandel](https://discourse.vtk.org/u/LucasGandel)
#### Post date: [April 17, 2025, 11:30am UTC](https://discourse.vtk.org/t/draw-curve-on-mesh-with-vtkcontourwidget/15504/4 "2025-04-17T11:30:05Z")

</div>

Right, I don’t know a better interpolator
