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

cylinder() is actually a cone #4404

Closed
nulcow opened this issue Nov 2, 2022 · 7 comments
Closed

cylinder() is actually a cone #4404

nulcow opened this issue Nov 2, 2022 · 7 comments

Comments

@nulcow
Copy link

nulcow commented Nov 2, 2022

The function cylinder(h, r1, center); produces a cone, not a cylinder. Please close this issue if the function is actually meant to produce a cone instead and different arguments are used for a cylinder. But even in that case, it is still unintuitive to have the cylinder() function produce both a cylinder and a cone depending on the arguments.

@nophead
Copy link
Member

nophead commented Nov 2, 2022

I think you want cylinder(h,r1, center = true)

I think the true is being taken as the second radius which would be almost a cone but with a flat point.

@nophead
Copy link
Member

nophead commented Nov 2, 2022

This works: cylinder(10, r = 3, center =true);

If you use r1 I think you also need to specify r2 or ir will default to 1.

@nulcow
Copy link
Author

nulcow commented Nov 2, 2022

Okay, I changed the second radius argument so now it's cylinder(5, 20, 20) and now it works fine

@nulcow nulcow closed this as completed Nov 2, 2022
@jordanbrown0
Copy link
Contributor

The documentation hints at this potential confusion, but is itself confusing. It says "Parameter names are optional if given in the order shown here", but does not clearly show an order. There's a list of parameters further down, but that comment is not correct for that list. You cannot say cylinder(h, r) and get what you expect; the second arg is taken as r1. (And r2 defaults to 1.)

The cheat sheet is similarly confusing; it implies that you can just say cylinder(h,r,center) or cylinder(h,d,center). Obviously those can't both work, even if the conflict with r1/r2 is addressed.

I almost always specify arguments by name, not position, so would say cylinder(h=5, r=20).

Cones are cylinders just like rectangular prisms are cubes and rectangles are squares :-)

@jordanbrown0
Copy link
Contributor

I think maybe the documentation intent is that "the order shown" is in the source sample three paragraphs down, but the intervening detailed text breaks that connection, at least for me.

@jordanbrown0
Copy link
Contributor

I have changed the documentation to move that source sample up.

@jordanbrown0
Copy link
Contributor

If you have questions, you might try the chat room. There are people active there very nearly 24 hours per day.
https://openscad.org/community.html#irc
https://web.libera.chat/?channel=#openscad

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

3 participants