# Fortran interface to vtk

**URL:** https://discourse.vtk.org/t/fortran-interface-to-vtk/1765
**Category:** Support
**Created:** [September 13, 2019, 7:32pm UTC](https://discourse.vtk.org/t/fortran-interface-to-vtk/1765 "2019-09-13T19:32:02Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kayarre](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kayarre/32/808_2.png) [@kayarre](https://discourse.vtk.org/u/kayarre)
#### Post date: [September 13, 2019, 7:32pm UTC](https://discourse.vtk.org/t/fortran-interface-to-vtk/1765/1 "2019-09-13T19:32:02Z")

</div>

I have been using python bindings to vtk and vtk for a few years now. I am now working on a legacy Fortran project and would like to have native access to the vtk library or something like it. does anyone have any suggestions?

An example would be able to pass a vtkPolyData like object to vtkFeatureEdges()

any thoughts on the best way to do this?

Regards,  
~Kurt

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [September 16, 2019, 4:08pm UTC](https://discourse.vtk.org/t/fortran-interface-to-vtk/1765/2 "2019-09-16T16:08:56Z")

</div>

It should be possible to write C++ code that acts as an adapter. Basically it would be necessary to write the adapter functions in C++, they would have to be declared ‘`extern "C"`’, and they would have to conform to the Fortran ABI. It could be done by someone who is familiar with calling C code from Fortran.

---

<div class="post-metadata">

### Author: ![kayarre](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kayarre/32/808_2.png) [@kayarre](https://discourse.vtk.org/u/kayarre)
#### Post date: [September 16, 2019, 4:12pm UTC](https://discourse.vtk.org/t/fortran-interface-to-vtk/1765/3 "2019-09-16T16:12:09Z")

</div>

Thank you @dgobbi That is essentially what I was thinking based on what I was seeing.
