Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spacebar is always 6.25u, despite trying to change its u-size #159

Open
BoxingLaunch opened this issue Apr 21, 2022 · 2 comments
Open

Spacebar is always 6.25u, despite trying to change its u-size #159

BoxingLaunch opened this issue Apr 21, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@BoxingLaunch
Copy link

What version of OpenSCAD are you on?
2021.01

Describe the bug
The following OpenSCAD script produces a 6.25u spacebar, no matter what the u(u=XX) part is set to.

cherry_row() u(u=6.5) spacebar() key();

To Reproduce
Run this script:

include <./includes.scad>
cherry_row() u(u=6.5) spacebar() key();

Try changing 6.5 to any other number, and it doesn't change the size of the spacebar, because it's always made u=6.25.

Additional context
Making a keycap for the weird Logiteck G710+ keyboard with a 6.5u spacebar.

@BoxingLaunch
Copy link
Author

Found the solution: translate([0,0,0]) cherry_row() spacebar() u(u=6.5) key();

Swapped the u(u=XX) and the spacebar() functions.

Perhaps this could be better explained, or it could be changed so that it works in either order so others don't encounter this problem.

@rsheldiii
Copy link
Owner

I think a cursory explanation of this has been omitted from the readme over time. This library works by manipulating "special variables" that are then used to generate the keycap's shape; every lexical scope gets to override the value of the special functions, but a parent scope can't override a child's scope. All special variables have defaults so that a bare call to key() will still generate something, so there isn't a good way to tell when a special variable has already been modified.

I'll try and think of a better way to say that and add it to the readme

@rsheldiii rsheldiii added the enhancement New feature or request label Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants