# How to extract the vertex coordinates of a polygon of a model in the current section?

**URL:** <https://discourse.slicer.org/t/how-to-extract-the-vertex-coordinates-of-a-polygon-of-a-model-in-the-current-section/24380>\
**Category:** Development\
**Tags:** python\
**Created:** [July 19, 2022, 1:32am UTC](https://discourse.slicer.org/t/how-to-extract-the-vertex-coordinates-of-a-polygon-of-a-model-in-the-current-section/24380 "2022-07-19T01:32:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)\
**Post date:** [July 19, 2022, 1:32am UTC](https://discourse.slicer.org/t/how-to-extract-the-vertex-coordinates-of-a-polygon-of-a-model-in-the-current-section/24380/1 "2022-07-19T01:32:42Z")

</div>

> [@Howto get a centroid of a section in a slice?](https://discourse.slicer.org/t/howto-get-a-centroid-of-a-section-in-a-slice/24339/6):
>
> the current question now becomes how to extract the vertex coordinates of a polygon of the current section. . .

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/6/f686d7554d6785d2dcfff1c76c2dd5743361c2e3.png)

I want to extract the vertex coordinates of a polygon of the model (blue) in the current slice…

@lassoan@pieper@Juicy@jamesobutler @jcfr @pieper

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 19, 2022, 7:18am UTC](https://discourse.slicer.org/t/how-to-extract-the-vertex-coordinates-of-a-polygon-of-a-model-in-the-current-section/24380/2 "2022-07-19T07:18:38Z")

</div>

You might be able to get the slice intersection actor from the model slice displayable manager, but most probably you need to use a VTK plane cut filter and set the slice as input cut plane and the model’s polydata as input polydata.

Note that center of gravity of the circumference points is not the same as the center of gravity of the cross-section of the object.

---

<div class="post-metadata">

**Author:** ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)\
**Post date:** [July 19, 2022, 4:47pm UTC](https://discourse.slicer.org/t/how-to-extract-the-vertex-coordinates-of-a-polygon-of-a-model-in-the-current-section/24380/3 "2022-07-19T16:47:12Z")

</div>

Lassoan教授，好吧。。。我想出来个笨拙的解决方案：

> Prof.Lassoan, okay. . . I came up with a clumsy solution:
> 
> ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/f/4f4806076a2457dc66b6bbecbdf3b6bc7445f458.jpeg)

不过这个解决方案有个问题：就是提取的点和点之间的距离不均匀。。。谁有好办法呢？

> However, there is a problem with this solution: the distance between the extracted points is not uniform. . . Who has a better solution?

Such As Weighted when calculating the average?
