Added microswitch_size().

This commit is contained in:
Chris Palmer 2021-01-06 09:36:13 +00:00
parent 41a0723362
commit 800bb89921
2 changed files with 3 additions and 0 deletions

View File

@ -1778,6 +1778,7 @@ Used for limit switches.
|:--- |:--- |
| `microswitch_lower_extent(type)` | How far legs extend downwards |
| `microswitch_right_extent(type)` | How far legs extend right |
| `microswitch_size(type)` | Body size |
### Modules
| Module | Description |

View File

@ -41,6 +41,8 @@ function microswitch_button_clr(type)= type[14]; //! Button colour
function microswitch_lower_extent(type) = let(leg = microswitch_leg(type)) min([for(pos = microswitch_legs(type)) pos.y - leg.y / 2]); //! How far legs extend downwards
function microswitch_right_extent(type) = let(leg = microswitch_leg(type)) max([microswitch_length(type) / 2, for(pos = microswitch_legs(type)) pos.x + leg.x / 2]); //! How far legs extend right
function microswitch_size(type) = [microswitch_length(type), microswitch_width(type), microswitch_thickness(type)]; //! Body size
module microswitch_hole_positions(type) //! Place children at the hole positions
{
for(hole = microswitch_holes(type))