# Markups line projection on a model

**URL:** <https://discourse.slicer.org/t/markups-line-projection-on-a-model/28205>\
**Category:** Development\
**Created:** [March 7, 2023, 7:56am UTC](https://discourse.slicer.org/t/markups-line-projection-on-a-model/28205 "2023-03-07T07:56:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![soukup.la](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/soukup.la/32/17954_2.png) [@soukup.la](https://discourse.slicer.org/u/soukup.la)\
**Post date:** [March 7, 2023, 7:56am UTC](https://discourse.slicer.org/t/markups-line-projection-on-a-model/28205/1 "2023-03-07T07:56:56Z")

</div>

Hello,  
I have markups line which passes through the surface of the model. I’d like to shift endpoint to the model surface using python. Could you help me please?

Ladislav

 ![point_on_surface](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/d/4d0e4807430b988531452af0180cbd31b47a30d0.png)

---

<div class="post-metadata">

**Author:** ![soukup.la](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/soukup.la/32/17954_2.png) [@soukup.la](https://discourse.slicer.org/u/soukup.la)\
**Post date:** [March 9, 2023, 10:43am UTC](https://discourse.slicer.org/t/markups-line-projection-on-a-model/28205/2 "2023-03-09T10:43:59Z")

</div>

This works fine:

```
obbTree = vtk.vtkOBBTree()
obbTree.SetDataSet(modelNode.GetPolyData())
obbTree.BuildLocator()
pointsVTKintersection = vtk.vtkPoints()
code = obbTree.IntersectWithLine(startPoin, endPoint, pointsVTKintersection, None)
pointsVTKIntersectionData = pointsVTKintersection.GetData()
pointsIntersection = pointsVTKIntersectionData.GetTuple3(0)

```
