# Bug with gcal multmatrix

5 messages
Open this post in threaded view
|

## Bug with gcal multmatrix

 The attached scad file renders very differently when you go "compile" vs "compile and render". It seems to be ignoring the final vector in the multmatrix. (you need a recent version of openscad, as it makes use of 2d minkowski) Cheers, Len. bracket.scad (1K) Download Attachment
Open this post in threaded view
|

## Re: Bug with gcal multmatrix

 Administrator On May 11, 2011, at 05:56 AM, Len Trigg wrote: > It seems to be ignoring the final vector in the multmatrix. > This is reproducible with the following slimmed-down example, also for older OpenSCAD versions: multmatrix(m = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, -0.02, 1]]) linear_extrude(height=20) circle(r=10); It looks like CGAL's Aff_transformation_3 doesn't support matrices containing shear. See transform.cc:298:         if (N.dim == 3) {                 CGAL_Aff_transformation t(                                 m[0], m[4], m[ 8], m[12],                                 m[1], m[5], m[ 9], m[13],                                 m[2], m[6], m[10], m[14], m[15]);                 N.p3.transform(t);         } We might have to implement out own transform functionality unless we can find something in CGAL supporting 4x4 matrices including shear.  -Marius
Open this post in threaded view
|

## Re: Bug with gcal multmatrix

 On 11 May 2011 20:21, Marius Kintel <[hidden email]> wrote: > It looks like CGAL's Aff_transformation_3 doesn't support matrices containing shear. I am not sure "shear" is the right term here 3D shear can be defined in terms of a 3x3 matrix so when put into a 4x4 matrix we don't care about the last column or last row: [     [1,Sxy,Sxz,0],     [Syx,1,Syz,0],     [Szx,Szy,1,0],     [0,0,0,1] ] See: http://www.cs.fit.edu/~wds/classes/cse5255/thesis/shear/shear.html#3dShearI think CGAL's assumption is that you will always have the final vector (row) set to [0,0,0,HW] where HW is variable. This reference might also be useful: http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Kernel_23_ref/Class_Aff_transformation_3.htmlI am wondering why the developers of CGAL would make such an assumption if it were indeed useful to be able to change the values of the final row to something other than 0. So my question to Len is what is your transformation trying to do? Regards Giles.