# Exporting a model to STL with markups

**URL:** <https://discourse.slicer.org/t/exporting-a-model-to-stl-with-markups/26502>\
**Category:** Support\
**Created:** [November 30, 2022, 4:36am UTC](https://discourse.slicer.org/t/exporting-a-model-to-stl-with-markups/26502 "2022-11-30T04:36:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [November 30, 2022, 2:07pm UTC](https://discourse.slicer.org/t/exporting-a-model-to-stl-with-markups/26502/2 "2022-11-30T14:07:15Z")

</div>

You could use a Python snippet like this

```auto
fiducialNode = getNode('F')
import numpy as np
sphereSource = vtk.vtkSphereSource()
sphereSource.SetRadius(1)
for i in range(fiducialNode.GetNumberOfControlPoints()):
  p = np.zeros(3)
  fiducialNode.GetNthControlPointPosition(i, p)
  fiducialModel = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLModelNode', f'Model_{fiducialNode.GetName()}_{i}')
  sphereSource.SetCenter(p)
  polyData = vtk.vtkPolyData()
  sphereSource.Update()
  polyData.DeepCopy(sphereSource.GetOutput())
  fiducialModel.SetAndObservePolyData(polyData)

```

Please note you’ll need to replace the name of your fiducial node (in my example it is `F`) and set the sphere radius as desired.

Once you have the model nodes you can append them together in Dynamic Modeler module’s Append feature, then export to STL.

---

_[View the full topic](https://discourse.slicer.org/t/exporting-a-model-to-stl-with-markups/26502)._
