V2 cylinders
-
Folks,
One of the BIG goals of V2 is consistency across the API. However, there's an issue with cylinder(), and before making changes we thought a little discussion should take place.
The internal API for V1 Cylinder looks like this...
CSG.cylinder({start: [0, -5, 0], end: [0, 5, 0], radius: 3})
And on top of this, the SCAD-like API looks like this...
cylinder({h: 10, r: 3, center: true})
In order for V2 to be consistent, we would like to move to an API that centers the cylinder by default, and creates a cylinder with the given height and size (radius).
cylinder({height: 10, size: 3})
Personally, I have always wondered why start and end points were required, as translating and rotating a shape into place is far easier to understand.
There is one downside. The ability to create oblique cylinders will only be possible by extruding a circle from start to end points.
Thoughts?
-

-
@z3dev Maybe add an optional parameter for skew, skewing it along the x-axis? That would keep the api simple but add the option to make an oblique. I think the bottom circle should be kept centered, with the top skewed off-center.
-
@torejorg that is a very good point that we did not consider like that, but perhaps instead of having it as a parameter for cylinders we could (emphasis on "could") have a 'skew' operation (like translate & co), or even just leverage the transform (transformation by a 4x4 matrix) to achieve a similar result ? I am not aware of how limiting/acceptable that would be to be honest

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login