# Scaling to 0.001 produces unexpected result

**URL:** https://discourse.vtk.org/t/scaling-to-0-001-produces-unexpected-result/2248
**Category:** Support
**Created:** [December 10, 2019, 1:39pm UTC](https://discourse.vtk.org/t/scaling-to-0-001-produces-unexpected-result/2248 "2019-12-10T13:39:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![idhamari](https://discourse.vtk.org/user_avatar/discourse.vtk.org/idhamari/32/1180_2.png) [@idhamari](https://discourse.vtk.org/u/idhamari)
#### Post date: [December 10, 2019, 1:39pm UTC](https://discourse.vtk.org/t/scaling-to-0-001-produces-unexpected-result/2248/1 "2019-12-10T13:39:55Z")

</div>

Dear all I am trying to scale a mesh to 0.001 but I get a mesh that does not look like the original one.

Here is the code I used:

```
    reader = vtk.vtkSTLReader()
    reader.SetFileName(inputFilename) 
    reader.Update()
    mTransform = vtk.vtkTransform()
    mTransformFilter = vtk.vtkTransformPolyDataFilter()
    mTransform.Scale(0.001,0.001,0.001)
    mTransformFilter.SetInputConnection(reader.GetOutputPort())
    mTransformFilter.SetTransform(mTransform)
    mTransformFilter.Update()
    writer = vtk.vtkSTLWriter() 
    writer.SetFileName(outputFilename) ;
    writer.SetInputConnection(mTransformFilter.GetOutputPort()) ;
    writer.Update()

```

Here are the scaled image using Slicer and the scaled image result using VTK code above:

![scaledSlicer](https://discourse.vtk.org/uploads/default/original/2X/8/88e937846b038be1b63167d9368ba34bf6059c01.png)

![scaledVTK](https://discourse.vtk.org/uploads/default/original/2X/3/3683973631029caf5642da99ff21de7e8a073ff6.png)

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [December 10, 2019, 9:35pm UTC](https://discourse.vtk.org/t/scaling-to-0-001-produces-unexpected-result/2248/2 "2019-12-10T21:35:07Z")

</div>

Can you share the input file?

How do the coordinate values look in the original and transformed STL files? (you can set format to ASCII to make the values in the file human-readable)

---

<div class="post-metadata">

### Author: ![idhamari](https://discourse.vtk.org/user_avatar/discourse.vtk.org/idhamari/32/1180_2.png) [@idhamari](https://discourse.vtk.org/u/idhamari)
#### Post date: [December 13, 2019, 11:40am UTC](https://discourse.vtk.org/t/scaling-to-0-001-produces-unexpected-result/2248/3 "2019-12-13T11:40:27Z")

</div>

Thanks @lassoan for your comment. I am not sure what happened, I probably was doing something wrong. The same code seems to work now. Here is the result:

![Screenshot%20from%202019-12-13%2012-38-52](https://discourse.vtk.org/uploads/default/original/2X/8/8b6b0038830e647526c1a90921ecb1fccd41d31c.png)
