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

[BUG] Slider anchors are incorrect #1515

Open
Skinner927 opened this issue Dec 4, 2024 · 0 comments
Open

[BUG] Slider anchors are incorrect #1515

Skinner927 opened this issue Dec 4, 2024 · 0 comments
Assignees

Comments

@Skinner927
Copy link

Skinner927 commented Dec 4, 2024

Describe the bug

  1. slider()'s anchor box is rotated 90 degrees, too tall (Z) and not wide enough (X).
  2. slider()'s default spin should match rail().

Code To Reproduce Bug

include <BOSL2/std.scad>
include <BOSL2/sliders.scad>

slider() show_anchors();

right(40) rail() show_anchors();

slider-broken2

Expected behavior

Anchors should lay correctly on slider() and it should be oriented the same as its matching rail().

Fix

I can make a PR if you prefer.

slider-fixed2

--- a/BOSL2/sliders.scad
+++ b/BOSL2/sliders.scad
@@ -38,12 +38,11 @@
 function slider(l=30, w=10, h=10, base=10, wall=5, ang=30, anchor=BOTTOM, spin=0, orient=UP) = no_function("slider");
 module slider(l=30, w=10, h=10, base=10, wall=5, ang=30, anchor=BOTTOM, spin=0, orient=UP)
 {
-    full_width = w + 2*wall;
+    full_width = w + 2*wall + 2*get_slop();
     full_height = h + base;

-    attachable(anchor,spin,orient, size=[full_width, l, h+2*base]) {
-        zrot(90)
-        down(base+h/2) {
+    attachable(anchor,spin,orient, size=[full_width, l, full_height]) {
+        down(full_height/2) {
             // Base
             cuboid([full_width, l, base-get_slop()], chamfer=2, edges=[FRONT,BACK], except_edges=BOT, anchor=BOTTOM);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants