[OpenSCAD] multmatrix expands the input matrix to 4x4?

adrianv avm4 at cornell.edu
Tue Jul 2 12:52:04 EDT 2019

What is the actual behavior of multmatrix()?  

It appears that I can supply M, a list of lists such that the rows, M[i],
can be a list of any length, even zero.  If len(M[i])<4 then M[i] is
expanded to have length 4.  If len(M[i])>4 then the extra values are
ignored.  Furthermore, len(M) can be anything.  Unspecified values are
filled in to create an identity matrix, and extra ones are ignored.  So for
example, multmatrix([[3]]) will scale in the x direction by 3.  

Is this a correct interpretation?    Assuming I can rely on this behavior, I
can simplify code by not explicitly transforming 3x3 matrices into 4x4 ones.  

Sent from: http://forum.openscad.org/

More information about the Discuss mailing list