Search code examples
scaletransformopenscad

understanding the linear_extrude operator in OpenSCAD


In OpenSCAD, the linear_extrude operator takes a 2d shape and extrudes it into 3d, optionally twisting it.

For example:

linear_extrude(height = 40) {
  square(10);
}

However, I found in the wiki: linear_extrude(height = 30, center = true, convexity=10, scale=[1,2]) square([20,10],center=true);

This one makes the "square" (which is actually a rectangle) bigger as it goes, scaling from 1 to 2. But it does so only in one dimension. I can't find how to make both dimensions scale equally, much less both dimensions scale differently.

The purpose in this case is to create a container that is not square, but gets wider towards the opening, necessary for ice cubes and molds for example so the material inside falls out easily.


Solution

  • scale = [1,2] scales x with factor 1 and y with factor 2

    scale = 2 or scale = [2,2] scales both equally