Exporting a model to STL with markups

Alternatively, you can use a glyph filter like this:

markup = getNode('F')
glyph = vtk.vtkSphereSource()
glyph.SetRadius(15.0)
glypher = vtk.vtkGlyph3D()
glypher.SetSourceConnection(glyph.GetOutputPort())
glypher.SetInputConnection(markup.GetCurveWorldConnection())
model = slicer.modules.models.logic().AddModel(glypher.GetOutputPort())
slicer.util.saveNode(model, "c:/tmp/something.stl")
2 Likes