# Use segmentations in CAD or FEM software

**URL:** https://discourse.slicer.org/t/use-segmentations-in-cad-or-fem-software/1626
**Category:** Support
**Tags:** segmentation
**Created:** [December 9, 2017, 1:21pm UTC](https://discourse.slicer.org/t/use-segmentations-in-cad-or-fem-software/1626 "2017-12-09T13:21:31Z")
**Posts on this page:** 1
**Showing post:** 34

<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: [August 2, 2018, 7:26am UTC](https://discourse.slicer.org/t/use-segmentations-in-cad-or-fem-software/1626/34 "2018-08-02T07:26:52Z")

</div>

I cannot really follow what you are trying to do, but you can find complete example of extracting submesh corresponding to a specific material [here](https://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/Graphics/Python/SingleYoungsMaterialInterface.py):

```
# Extract submeshes corresponding to 2 different material Ids
cellData.SetActiveScalars( "Material Id" )
threshold2 = vtkThreshold()
threshold2.SetInputData( mesh )
threshold2.SetInputArrayToProcess(0, 0, 0, vtkDataObject.FIELD_ASSOCIATION_CELLS, vtkDataSetAttributes.SCALARS );
threshold2.ThresholdByLower( 2 )
threshold2.Update()
meshMat2 = threshold2.GetOutput()
threshold3 = vtkThreshold()
threshold3.SetInputData( mesh )
threshold3.SetInputArrayToProcess(0, 0, 0, vtkDataObject.FIELD_ASSOCIATION_CELLS, vtkDataSetAttributes.SCALARS );
threshold3.ThresholdByUpper( 3 )
threshold3.Update()
meshMat3 = threshold3.GetOutput()
```

---

_[View the full topic](https://discourse.slicer.org/t/use-segmentations-in-cad-or-fem-software/1626)._
