Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add possibility to rotate through custom rotation matrices #53
Copied from wolph's blog: https://w.wol.ph/about/#comment-174
First, many thanks for your numpy-stl module. Most helpful. I have one suggestion to make:
The only rotation you have enabled in your code is around an arbitrary axis (and a point), which is super helpful. I understand that you are using the rotation_matrix function which calculates the appropriate rotation matrix, which you then use to rotate the stl.
I would find it very useful (and powerful) to provide a second function that would allow a rotation around a user supplied rotation matrix.
What I am thinking is this:
This would allow for very easy chaining of matrices.
The work-around is very easy, but this seems like a really quick and useful addition…
In the past I used something like this, in which orient is the unit normal
Rotating according to a rotation matrix is as simple as taking the dot product of the data with the rotation matrix.