# Fit sphere to points

**URL:** <https://discourse.slicer.org/t/fit-sphere-to-points/32820>\
**Category:** Development\
**Created:** [November 14, 2023, 8:24pm UTC](https://discourse.slicer.org/t/fit-sphere-to-points/32820 "2023-11-14T20:24:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben.rodwell](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ben.rodwell/32/80368_2.png) [@ben.rodwell](https://discourse.slicer.org/u/ben.rodwell)\
**Post date:** [November 14, 2023, 8:24pm UTC](https://discourse.slicer.org/t/fit-sphere-to-points/32820/1 "2023-11-14T20:24:12Z")

</div>

I am trying to fir a sphere between 4 control points using the script below. I have set my four points using the markups module and when I run the script in the python interactor it generates a new model in the models module but it is not visible and so I am just wondering what I am doing wrong and how do I actually use this script to generate a sphere?

[Script repository: Specify a sphere by multiple control points](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository/markups.html#specify-a-sphere-by-multiple-control-points)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/3/036158325b5c8aa549a26206f6a726a856316dbe.png)

---

<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:** [November 14, 2023, 8:25pm UTC](https://discourse.slicer.org/t/fit-sphere-to-points/32820/2 "2023-11-14T20:25:33Z")

</div>

All you need to do is to replace `pointListNode` by the node that stores your input points (e.g., `pointListNode=getNode('F')`) and then copy-paste the example code from the script repository.

---

<div class="post-metadata">

**Author:** ![ben.rodwell](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ben.rodwell/32/80368_2.png) [@ben.rodwell](https://discourse.slicer.org/u/ben.rodwell)\
**Post date:** [November 15, 2023, 2:14am UTC](https://discourse.slicer.org/t/fit-sphere-to-points/32820/3 "2023-11-15T02:14:26Z")

</div>

Hi Andras, thanks a bunch for your help, I realize now that I was using separate markup points instead of putting them all into a single points list which was causing my issue earlier!
