-
Notifications
You must be signed in to change notification settings - Fork 52
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
Shear angles do not calculate correctly #49
Comments
Any updates on this? I'm running into the same issue... the angles in the shear are off. [Edit] I had a quick look at the implementation of the Shear() module in the BIT lib file... shouldn't the line for the x angle, which is currently ? |
Yup, should be Moreover, there is another issue with shears (at least for compartments) stemming from the fact that the transformation is applied not on the cube corresponding to the compartment, but to a cube extending through the whole box that is then filled in again in later steps. In essence, this causes the z-translation that is meant to center the component before shearing to move the wrong amount. After undoing the translation, the component origin no longer line up with the center of the slanted face of the cube (which is what is intended according to documentation), but is off by an amount that is hard to account for unless you delve into the code. To fix this, I ended up writing this correction term:
or (once the transformation matrix is fixed as pointed out by @Bumblez:
You then add this term to your position:
This will reliably place the compartment at The same thing should work for shearing in the x-direction, but I haven't tested it. |
I haven’t had time to revisit the project, but feel free to submit PRs. On Apr 29, 2023, at 02:01, Jonne Mickelin Sätherblom ***@***.***> wrote:
Yup, should be 1/tan(x).
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Thanks! I can do the sin(x) -> tan(x) change in a few days and make a PR. I wanna sit down with pen and paper to confirm it's correct, though. The other problem relating to the positioning might be harder, since I haven't wrapped my head around how the internals work quite yet. (I don't know if you saw my big edit to my post since you're replying via email :) ) But I can take a stab at it. |
Two compartments in the attached file have the Shear parameter configured. One compartment (Cards) is configured in .scad at 45 but measures closer to 35° in the model. Another compartment (Privilege Tokens) is configured at 80 in .scad but measures 45° in the model.
Shear-Example.scad.txt
The text was updated successfully, but these errors were encountered: