mirror of
https://github.com/kennetek/gridfinity-rebuilt-openscad.git
synced 2024-12-22 06:43:25 +00:00
Add an affine_scale command
This commit is contained in:
parent
a0f7ad83bd
commit
dc4069b82d
1 changed files with 12 additions and 0 deletions
|
@ -161,6 +161,18 @@ function affine_translate(vector) = [
|
|||
[0, 0, 0, 1]
|
||||
];
|
||||
|
||||
/**
|
||||
* @brief Affine transformation matrix equivalent of `scale`
|
||||
* @param vector @see `scale`
|
||||
* @returns An affine transformation matrix for use with `multmatrix()`
|
||||
*/
|
||||
function affine_scale(vector) = [
|
||||
[vector.x, 0, 0, 0],
|
||||
[0, vector.y, 0, 0],
|
||||
[0, 0, vector.z, 0],
|
||||
[0, 0, 0, 1]
|
||||
];
|
||||
|
||||
/**
|
||||
* @brief Create a rectangle with rounded corners by sweeping a 2d object along a path.
|
||||
* Centered on origin.
|
||||
|
|
Loading…
Reference in a new issue