# Python code model-to-model distance

**URL:** <https://discourse.slicer.org/t/python-code-model-to-model-distance/15593>\
**Category:** Support\
**Created:** [January 19, 2021, 4:09pm UTC](https://discourse.slicer.org/t/python-code-model-to-model-distance/15593 "2021-01-19T16:09:35Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [January 19, 2021, 11:40pm UTC](https://discourse.slicer.org/t/python-code-model-to-model-distance/15593/2 "2021-01-19T23:40:58Z")

</div>

The C++ source code for the model-to-model distance module is [here](https://github.com/NIRALUser/3DMetricTools/tree/master/ModelToModelDistance).

It uses the vtkDistancePolyDataFilter which also has a Python wrapper. I have a Python module that uses this filter [here](https://github.com/SlicerMorph/SlicerMorph/blob/4e7fcdf0a9e035cb66539ba140b8ba32a7413da8/MeshDistanceMeasurement/MeshDistanceMeasurement.py#L281) which may help as an example.

---

_[View the full topic](https://discourse.slicer.org/t/python-code-model-to-model-distance/15593)._
