Scaling meshes

18 views
Skip to first unread message

hffr...@gmail.com

unread,
Jan 23, 2017, 11:01:46 AM1/23/17
to chroma-sim
Hi,
Is there an easy way to scale meshes imported from STL files? I've been looking through the source code and can't find anything, but am hoping I missed something.
-Bucky

Anthony LaTorre

unread,
Jan 24, 2017, 9:06:18 AM1/24/17
to chroma-sim
The Mesh object returned by mesh_from_stl has a member variable called
vertices which is just a numpy array listing all the X, Y, and Z
vertices of the nodes of all the triangles. You should just be able to
scale this array directly, i.e.

```
mesh = mesh_from_stl('MiniFig.stl.bz2')
mesh.vertices *= 2
```

Hope that helps,

Tony
> --
> You received this message because you are subscribed to the Google Groups
> "chroma-sim" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to chroma-sim+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages