JSCAD User Group
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    V2 cylinders

    Scheduled Pinned Locked Moved Development Discussions
    4 Posts 3 Posters 2.9k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • z3devZ Offline
      z3dev
      last edited by

      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?

      z3devZ 1 Reply Last reply Reply Quote 0
      • z3devZ Offline
        z3dev @z3dev
        last edited by

        0_1558258628895_42929F1D-C41F-4D5A-825B-C4BD6D912100.png

        torejorgT 1 Reply Last reply Reply Quote 0
        • torejorgT Offline
          torejorg @z3dev
          last edited by

          @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.

          kaosat-devK 1 Reply Last reply Reply Quote 0
          • kaosat-devK Offline
            kaosat-dev @torejorg
            last edited by

            @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 something like this

            1 Reply Last reply Reply Quote 0

            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
            • First post
              Last post
            Powered by NodeBB | Contributors