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

Feature Request: RoundRadius on CSG.roundedCylinder() #72

Closed
z3dev opened this issue Oct 1, 2015 · 4 comments
Closed

Feature Request: RoundRadius on CSG.roundedCylinder() #72

z3dev opened this issue Oct 1, 2015 · 4 comments

Comments

@z3dev
Copy link
Collaborator

z3dev commented Oct 1, 2015

This is a very useful function to make rounded cylinders of a given radius, but the rounded end of the cylinder should also be configurable. Currently, the rounded end of the cylinder is the same as the radius of the cylinder. But anything between 0 < rounded end radius <= radius is possible.

Parameters:
// start: start point of cylinder (default [0, -1, 0])
// end: end point of cylinder (default [0, 1, 0])
// radius: radius of cylinder (default 1), must be a scalar
// resolution: determines the number of polygons per 360 degree revolution (default 12)
// normal: a vector determining the starting angle for tesselation. Should be non-parallel to start.minus(end)

Add...
// roundedRadius: radius of rounded end of cylinder, default radius of cylinder

1

@bebbi
Copy link
Collaborator

bebbi commented Oct 1, 2015

That would be a reasonable addition. I don't have the time now, but do you want to take a stab at it? I would probably go about it by replacing the existing logic with something like this:

  1. create a path, using arc, with all params (radius, roundradius, height)
  2. convert to CAG using path.innerToCAG()
  3. rotateExtrude to CSG
    This way, if you want you could even expose the angle param of rotateExtrude as a sectorAngle argument for rounded cylinder pies.

@z3dev
Copy link
Collaborator Author

z3dev commented Oct 2, 2015

@bebbi thanks
My version was very similar, but I used solidFromSlices(). It's just a matter of following the points, and scaling the circle.

FYI, there seem to be issues with using rotateExtrude with a CAG that has a zero(0) X offset. The internal vertices seemed to be confused.

@bebbi
Copy link
Collaborator

bebbi commented Oct 2, 2015

From http://joostn.github.io/OpenJsCad/ docu:
// Note: for this to work, shape shouldn't have point in negative x space
If the CAG is valid and all x>=0 overall, it should work - if not, maybe you can open an issue with the example?

Again, please feel free to post PRs to csg.js I’m tight on time right now, so any help is appreciated.

On 02 Oct 2015, at 06:28, Z3 Development notifications@github.com wrote:

@bebbi thanks
My version was very similar, but I used solidFromSlices(). It's just a matter of following the points, and scaling the circle.

FYI, there seem to be issues with using rotateExtrude with a CAG that has a zero(0) X offset. The internal vertices seemed to be confused.


Reply to this email directly or view it on GitHub.

@z3dev
Copy link
Collaborator Author

z3dev commented Feb 26, 2017

This issue was moved to jscad/csg.js#21

@z3dev z3dev closed this as completed Feb 26, 2017
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