### discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

### Re: need help in understanding diff and children and placements

RW
Roger Whiteley
Mon, Jan 16, 2023 10:17 AM

The way I approach the impact of translate and rotate is to consider the
object upon which the transformations are to be executed:

Transformations are executed in reverse order -

SECOND            FIRST                          OBJECT

rotate ([0,0,10])   translate ([100,0,0])    cube ([10,10,10]);//   a
cube, transformed along X by 100 then rotated in Z

translate ([100,0,0]) rotate ([0,0,10])  cube ([10,10,10]);// a cube
rotated in Z by 10 degrees then transformed along X by 100

Which is why I use this form when editing [something discussed in Vol
93, Issue 30, search for Style Questions]

``````rotate ([0,0,10])

translate ([100,0,0])

cube ([10,10,10]);// a cube transformed in X then rotated
around the Z axis.
``````

The trick of putting a % in front of the object really helps when using
difference () in Preview mode, because the object shows up where its
positioned, which can explain why the result of difference () is not as
expected.

I found the semantics of Mathematics enormously difficult as a teenager,
because my brain works with pictures far more effectively than
descriptions -  OpenSCAD's brilliance is an instant result - OpenSCAD
would make a wonderful teaching tool for geometry..

The way I approach the impact of translate and rotate is to consider the object upon which the transformations are to be executed: Transformations are executed in reverse order -     SECOND            FIRST                          OBJECT rotate ([0,0,10])   translate ([100,0,0])    cube ([10,10,10]);//   a cube, transformed along X by 100 then rotated in Z translate ([100,0,0]) rotate ([0,0,10])  cube ([10,10,10]);// a cube rotated in Z by 10 degrees then transformed along X by 100 Which is why I use this form when editing [something discussed in Vol 93, Issue 30, search for Style Questions] rotate ([0,0,10])     translate ([100,0,0])         cube ([10,10,10]);// a cube transformed in X then rotated around the Z axis. The trick of putting a % in front of the object really helps when using difference () in Preview mode, because the object shows up where its positioned, which can explain why the result of difference () is not as expected. I found the semantics of Mathematics enormously difficult as a teenager, because my brain works with pictures far more effectively than descriptions -  OpenSCAD's brilliance is an instant result - OpenSCAD would make a wonderful teaching tool for geometry..
Replying to: