New Custom Feature: Bounding Cylinder

joshtargo
joshtargo Member Posts: 695 EDU

I wanted to make primitive shapes of robot parts to play around with packaging. I found (and wrote) a Bounding Box FS, but there was nothing for Cylinders, and I now understand why. Determining the smallest cylinder that will completely enclose a group of bodies is non-trivial. Hopefully someone else finds this useful.

Link: Bounding Cylinder

image.png

Comments

  • EvanReese
    EvanReese Member, Mentor Posts: 3,099 PRO

    wow yeah I'm not sure how I'd even start to code that. Nice work! I added it to my toolbar. I did play with it a bit and for most things it nails it. There was some odd behavior in a few cases

    Nov-25-2024 07-18-44.gif
    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • joshtargo
    joshtargo Member Posts: 695 EDU

    Ooh, weird, can you link it so I can dig deeper?

    Thanks for playing around with it.

  • EvanReese
    EvanReese Member, Mentor Posts: 3,099 PRO

    Thanks for sharing it https://cad.onshape.com/documents/97390ad3b27148a19fa88b97/w/08a37718f659a4c928047de2/e/324740245d6d1ed5e302239e

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • joshtargo
    joshtargo Member Posts: 695 EDU

    I'm working on it, your test is apparently good for finding problems.

  • EvanReese
    EvanReese Member, Mentor Posts: 3,099 PRO

    haha, I'm just unlucky I guess

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • joshtargo
    joshtargo Member Posts: 695 EDU

    No, I'm just a bad coder. I needed edge cases.

  • EvanReese
    EvanReese Member, Mentor Posts: 3,099 PRO

    I've definitely run into times where everything seemed to work because I only tested with axes aligned with the world XYZ, and only found issues when I tried odd coordinate systems

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com