# Cropped loaded meshes

**URL:** <https://shapeworks.discourse.group/t/cropped-loaded-meshes/385>\
**Category:** Uncategorized\
**Created:** [October 24, 2025, 3:57am UTC](https://shapeworks.discourse.group/t/cropped-loaded-meshes/385 "2025-10-24T03:57:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nynkevj](https://avatars.discourse-cdn.com/v4/letter/n/da6949/32.png) [@nynkevj](https://shapeworks.discourse.group/u/nynkevj)\
**Post date:** [October 24, 2025, 3:57am UTC](https://shapeworks.discourse.group/t/cropped-loaded-meshes/385/1 "2025-10-24T03:57:08Z")

</div>

Hi,

I used Shapeworks to create a statistical shape model of cartilage. At first my input was binary segmentations but now I am using a different dataset which has .stl meshes. I didn’t want to change my pipeline so I tried to load the meshes and convert them to binary segmentations with shape\_mesh = sw.Mesh(path\_to\_file) and then shape\_seg = shape\_mesh.toImage(). However, the meshes seem to get cut off on the sides. If I pad them, it just adds padding to the already cut off segmentations, is there any way I can avoid this?

Attached is an example of what is happening. The cropping is mainly visible on the left side of the segmentation.

Thanks!

 ![image](https://global.discourse-cdn.com/free1/uploads/shapeworks/original/1X/e19199bbbda97035b2d4dea03190181dc2d58ec1.jpeg)

---

<div class="post-metadata">

**Author:** ![amorris](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@amorris](https://shapeworks.discourse.group/u/amorris)\
**Post date:** [November 3, 2025, 9:17pm UTC](https://shapeworks.discourse.group/t/cropped-loaded-meshes/385/2 "2025-11-03T21:17:00Z")

</div>

The Mesh.toImage() shouldn’t cut off the segmentation. If you could provide a sample, perhaps we can fix it.

The toImage call does have parameters where you can give it a bounding box:

> **[Python API Reference - ShapeWorks](https://sciinstitute.github.io/ShapeWorks/latest/python/python-api.html#shapeworks_py.Mesh.toImage)**
>
> The official documentation of ShapeWorks

For example:

```python
mesh = Mesh(“femur.ply”)
bbox = mesh.boundingBox().pad(2.0)
mesh.toImage(bbox)

```
