# How to change fiber model to STL files for 3D printing

**URL:** <https://discourse.slicer.org/t/how-to-change-fiber-model-to-stl-files-for-3d-printing/1444>\
**Category:** Support\
**Tags:** diffusion, stl\
**Created:** [November 13, 2017, 2:30pm UTC](https://discourse.slicer.org/t/how-to-change-fiber-model-to-stl-files-for-3d-printing/1444 "2017-11-13T14:30:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Unique157](https://avatars.discourse-cdn.com/v4/letter/u/ea5d25/32.png) [@Unique157](https://discourse.slicer.org/u/Unique157)\
**Post date:** [November 13, 2017, 2:30pm UTC](https://discourse.slicer.org/t/how-to-change-fiber-model-to-stl-files-for-3d-printing/1444/1 "2017-11-13T14:30:14Z")

</div>

how to change fiber model to STL files for 3D printing??  
just like the question, i had convert the model to stl successfully before, but i cant finish it now with the software of the same version or latest version.  
i expect ur help ,my friends!

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [November 13, 2017, 3:07pm UTC](https://discourse.slicer.org/t/how-to-change-fiber-model-to-stl-files-for-3d-printing/1444/2 "2017-11-13T15:07:12Z")

</div>

Here is example Python code to export fiber bundles to PLY. If you need STL you could change `vtkPLYWriter` to `vtkSTLWriter`, then need to comment the following two lines because STL doesn’t support colors (as far as I understand).

[https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Export\_a\_fiber\_tracts\_to\_Blender.2C\_including\_color](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Export_a_fiber_tracts_to_Blender.2C_including_color)

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [November 13, 2017, 3:07pm UTC](https://discourse.slicer.org/t/how-to-change-fiber-model-to-stl-files-for-3d-printing/1444/3 "2017-11-13T15:07:59Z")

</div>

See also:

> [@About using the code of exporting a model with colors to Blender](https://discourse.slicer.org/t/about-using-the-code-of-exporting-a-model-with-colors-to-blender/299/2):
>
> I’ve fixed the obvious syntax errors (due to VTK library upgrades) in the [fiber tract export snippet](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Export_a_fiber_tracts_to_Blender.2C_including_color). If you export generic models (not fiber tracts) then you can either [export the whole scene as VRML](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Export_entire_scene_as_VRML) or [export a colored model to ply](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Export_model_to_Blender.2C_including_color_by_scalar).
