# How to create volumetric mesh from stl files

**URL:** <https://discourse.slicer.org/t/how-to-create-volumetric-mesh-from-stl-files/6653>\
**Category:** Support\
**Created:** [April 30, 2019, 1:53pm UTC](https://discourse.slicer.org/t/how-to-create-volumetric-mesh-from-stl-files/6653 "2019-04-30T13:53:58Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tarun\_Choudhary](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tarun_choudhary/32/3594_2.png) [@Tarun\_Choudhary](https://discourse.slicer.org/u/Tarun_Choudhary)\
**Post date:** [April 30, 2019, 1:53pm UTC](https://discourse.slicer.org/t/how-to-create-volumetric-mesh-from-stl-files/6653/1 "2019-04-30T13:53:59Z")

</div>

Hi Andras,  
Many thanks for your reply. I tried importing stls in 3D slicer as per the instructions you mentioned but I am getting this error message when i click apply button.

Mesh generation using Cleaver is started in working directory: /tmp/Slicer-tarun/SegmentMesher/20190430\_130934\_055

Error: ‘NoneType’ object has no attribute ‘GetColorNode’

reference link : [https://discourse.vtk.org/t/vtk-polydata-to-imagedata/863/2](https://discourse.vtk.org/t/vtk-polydata-to-imagedata/863/2)

---

<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:** [April 30, 2019, 2:30pm UTC](https://discourse.slicer.org/t/how-to-create-volumetric-mesh-from-stl-files/6653/2 "2019-04-30T14:30:47Z")

</div>

Could you please copy the contents of the application log? (menu: Help / Report a bug)

Please also try if mesh generation succeeds if you follow steps described in the tutorial: [https://github.com/lassoan/SlicerSegmentMesher/blob/master/README.md#tutorial](https://github.com/lassoan/SlicerSegmentMesher/blob/master/README.md#tutorial)

---

<div class="post-metadata">

**Author:** ![Tarun\_Choudhary](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tarun_choudhary/32/3594_2.png) [@Tarun\_Choudhary](https://discourse.slicer.org/u/Tarun_Choudhary)\
**Post date:** [April 30, 2019, 2:43pm UTC](https://discourse.slicer.org/t/how-to-create-volumetric-mesh-from-stl-files/6653/4 "2019-04-30T14:43:00Z")

</div>

The log file is too long so posted only last few lines.

---

<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:** [April 30, 2019, 2:53pm UTC](https://discourse.slicer.org/t/how-to-create-volumetric-mesh-from-stl-files/6653/5 "2019-04-30T14:53:35Z")

</div>

Could you please upload the log to dropbox/onedrive/google drive and post the link?  
Please also try meshing on a simpler data set as described in the tutorial I referenced above.

---

<div class="post-metadata">

**Author:** ![Tarun\_Choudhary](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tarun_choudhary/32/3594_2.png) [@Tarun\_Choudhary](https://discourse.slicer.org/u/Tarun_Choudhary)\
**Post date:** [April 30, 2019, 3:07pm UTC](https://discourse.slicer.org/t/how-to-create-volumetric-mesh-from-stl-files/6653/6 "2019-04-30T15:07:50Z")

</div>

The uploaded log file is here:

> **[Slicer\_27931\_20190430\_140821.log](https://drive.google.com/file/d/1f9A5du8xvI1BRl5eZseeREqDKUXsBpwW/view?usp=sharing)**
>
> Google Drive file.

---

<div class="post-metadata">

**Author:** ![Tarun\_Choudhary](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tarun_choudhary/32/3594_2.png) [@Tarun\_Choudhary](https://discourse.slicer.org/u/Tarun_Choudhary)\
**Post date:** [April 30, 2019, 3:12pm UTC](https://discourse.slicer.org/t/how-to-create-volumetric-mesh-from-stl-files/6653/7 "2019-04-30T15:12:47Z")

</div>

Hi Andras,

The sample data in the example on the link talks about the scanned image data; I am not using any of the scanned image. My case is different, I have three stl files each having the cad geometry of a component. All three STLs make an assembly. And i want to make a voxel mesh of the assembly with each component having a unique material property.

Kind Regards,  
Tarun

---

<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:** [April 30, 2019, 3:18pm UTC](https://discourse.slicer.org/t/how-to-create-volumetric-mesh-from-stl-files/6653/8 "2019-04-30T15:18:25Z")

</div>

Do you need rectilinear grid? Once you have imported the meshes into a segmentation node, go to Data module, right-click on the segmentation node and click “Export visible segments to binary labelmap”. You can then save the exported labelmap as a 3D volume (in nrrd, mha, … format).

---

<div class="post-metadata">

**Author:** ![Tarun\_Choudhary](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tarun_choudhary/32/3594_2.png) [@Tarun\_Choudhary](https://discourse.slicer.org/u/Tarun_Choudhary)\
**Post date:** [April 30, 2019, 3:31pm UTC](https://discourse.slicer.org/t/how-to-create-volumetric-mesh-from-stl-files/6653/9 "2019-04-30T15:31:31Z")

</div>

Hi Andras,

I want to create Unstructured Grid from stls. Let me try this method which you described above.

---

<div class="post-metadata">

**Author:** ![Tarun\_Choudhary](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tarun_choudhary/32/3594_2.png) [@Tarun\_Choudhary](https://discourse.slicer.org/u/Tarun_Choudhary)\
**Post date:** [April 30, 2019, 3:47pm UTC](https://discourse.slicer.org/t/how-to-create-volumetric-mesh-from-stl-files/6653/10 "2019-04-30T15:47:34Z")

</div>

[https://drive.google.com/file/d/1HN-gBb3zPduAcE1zrKrax7k8QKx5nw9j/view?usp=sharing](https://drive.google.com/file/d/1HN-gBb3zPduAcE1zrKrax7k8QKx5nw9j/view?usp=sharing)  
[https://drive.google.com/file/d/1\_SasNmV1LBFIEgy3xxQiMiaVLrlZBofg/view?usp=sharing](https://drive.google.com/file/d/1_SasNmV1LBFIEgy3xxQiMiaVLrlZBofg/view?usp=sharing)  
[https://drive.google.com/file/d/1zIgdYqjZxXqjnbFJEkejfSUzpVTnyK3R/view?usp=sharing](https://drive.google.com/file/d/1zIgdYqjZxXqjnbFJEkejfSUzpVTnyK3R/view?usp=sharing)  
[https://drive.google.com/file/d/19LyzDfYdjOPqGB3cZci1A2jFUvlAKPmB/view?usp=sharing](https://drive.google.com/file/d/19LyzDfYdjOPqGB3cZci1A2jFUvlAKPmB/view?usp=sharing)  
[https://drive.google.com/file/d/1DLRLOHYuTcAGB5fiKbS-eUlRRwjhJeDM/view?usp=sharing](https://drive.google.com/file/d/1DLRLOHYuTcAGB5fiKbS-eUlRRwjhJeDM/view?usp=sharing)

---

<div class="post-metadata">

**Author:** ![Tarun\_Choudhary](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tarun_choudhary/32/3594_2.png) [@Tarun\_Choudhary](https://discourse.slicer.org/u/Tarun_Choudhary)\
**Post date:** [April 30, 2019, 3:49pm UTC](https://discourse.slicer.org/t/how-to-create-volumetric-mesh-from-stl-files/6653/11 "2019-04-30T15:49:05Z")

</div>

I have shared sample CAD files in form of .vtp (converted from stl). And I want to create voxel mesh of all three in one assembly with three different group of material.

---

<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:** [April 6, 2022, 5:24am UTC](https://discourse.slicer.org/t/how-to-create-volumetric-mesh-from-stl-files/6653/12 "2022-04-06T05:24:25Z")

</div>

A post was split to a new topic: [Segmentation from point cloud](https://discourse.slicer.org/t/segmentation-from-point-cloud/22843)
