Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative scalings #31

Open
alackofcolor opened this issue Mar 25, 2020 · 3 comments
Open

Negative scalings #31

alackofcolor opened this issue Mar 25, 2020 · 3 comments

Comments

@alackofcolor
Copy link

Using your decompose44 function, it correctly picks out the scaling factors, but doesn't seem to handle negative scalings. That is, reflections. Any way it could be modified to account for negative scalings? For example, the following matrix

A = np.array([[-2, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]])

should give

sx = -2
sy = 1
sz = 1

Thanks.

@LoiseauNicolas
Copy link

I got the same problem, what is the right way to have a positiv scale ?

@matthew-brett
Copy link
Owner

Sorry to be so slow. Just in case you're still interested, this is what I get:

[ins] In [6]: transforms3d.affines.decompose(A)                                                                        
Out[6]: 
(array([0, 0, 0]),
 array([[1., 0., 0.],
        [0., 1., 0.],
        [0., 0., 1.]]),
 array([-2.,  1.,  1.]),
 array([0., 0., 0.]))

Not so for you?

@matthew-brett
Copy link
Owner

@alackofcolor @LoiseauNicolas - checking back here - what do you get for my code above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants