-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add orient parameter to slot() shape #89
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the orientation of the cylinders only won't work.
Simple example:
slot(r=5, h=3, l=20, orient=ORIENT_X);
Resulting solid:
I think you will have to arrange the whole object using orient_and_align() as soon as
orient != undef or align != undef
@@ -2121,12 +2121,13 @@ module interior_fillet(l=1.0, r=1.0, ang=90, overlap=0.01, orient=ORIENT_X, alig | |||
module slot( | |||
p1=undef, p2=undef, h=10, l=undef, | |||
r=undef, r1=undef, r2=undef, | |||
d=undef, d1=undef, d2=undef | |||
d=undef, d1=undef, d2=undef, | |||
orient=undef |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
orient=undef | |
align=V_CENTER, orient=ORIENT_Z |
) { | ||
r1 = get_radius(r1=r1, r=r, d1=d1, d=d, dflt=5); | ||
r2 = get_radius(r1=r2, r=r, d1=d2, d=d, dflt=5); | ||
sides = quantup(segs(max(r1, r2)), 4); | ||
hull() spread(p1=p1, p2=p2, l=l, n=2) cyl(l=h, r1=r1, r2=r2, center=true, $fn=sides); | ||
hull() spread(p1=p1, p2=p2, l=l, n=2) cyl(l=h, r1=r1, r2=r2, center=true, $fn=sides, orient=orient); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hull() spread(p1=p1, p2=p2, l=l, n=2) cyl(l=h, r1=r1, r2=r2, center=true, $fn=sides, orient=orient); | |
if (align!=V_CENTER || orient!=ORIENT_Z) { | |
orient_and_align(size=[l+2*r1, 2*r1, h], orient=orient, align=align, orig_orient=ORIENT_Z, orig_align=V_CENTER) | |
solid(); | |
} else { | |
solid(); | |
} | |
module solid() | |
{ | |
hull() spread(p1=p1, p2=p2, l=l, n=2) cyl(l=h, r1=r1, r2=r2, align=V_CENTER, orient=ORIENT_Z, $fn=sides); | |
} |
The
slot()
documentation said there should beorient
in there, but it was missing.