Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

New Feature: Multi-Mirror

EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭
edited December 2019 in FeatureScript
I often work with symmetrical designs in multi-part studios, and many times I have a number of parts to mirror across multiple planes. With the standard mirror feature, I have to use a new feature for each part x the number of planes to mirror about. That means if I have 3 parts to mirror about the top, right, and front planes, I'll need 9 mirror features. This feature can do it all in one go either using the world planes, or the 3 directions of a mate connector. Hopefully, someone else finds it useful too. You can find the feature here. I'm open to improvement suggestions if someone imagines a tweak that would open up a better workflow. note: this isn't meant to replace the standard mirror, since it only handles bodies and is a lot less flexible in certain ways, but it definitely solves a pain-point I've had since the Solidworks days.

Evan Reese

Comments

  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,938 PRO
    Oh, that's a good idea
  • TimRiceTimRice Member, Moderator, Onshape Employees Posts: 315
    Nice, I will use this a lot!
    Tim Rice | User Experience | Support 
    Onshape, Inc.
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    Bonus points awarded for building an icon that looks perfectly in keeping with the native features B)
    Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • bruce_williamsbruce_williams Member, Developers Posts: 842 EDU
    @Evan_Reese

    Very useful feature!   It would be nice to work on surfaces also if possible.
    www.accuratepattern.com
  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭
    @Evan_Reese

    Very useful feature!   It would be nice to work on surfaces also if possible.
    oooooh  :o that's a good idea.
    Evan Reese
  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭
    edited December 2019
    Bonus points awarded for building an icon that looks perfectly in keeping with the native features B)
    Owen S.
     B)B)B)
    Evan Reese
  • MichaelPascoeMichaelPascoe Member Posts: 2,012 PRO
    Whew, now this will save some time. 

    Thanks Evan!

    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴
  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭
    @MichaelPascoe
    This is one of my personal favorites. It cuts down so much repetitive work for certain designs. Shoutout to @MBartlett21 who helped me refactor the code to be much more concise.
    Evan Reese
  • MichaelPascoeMichaelPascoe Member Posts: 2,012 PRO
    Multi Mirror is now a part of my standard procedure! I used it today to create a mirrored plinth. Smooth.



    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴
  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭
    I'm so glad! I still get a kick out of it every time I use it. I often use it even when it's just one part and one mirror, so that it's easy to add parts to the feature later if I need to without messing up the IDs of things downstream.
    Evan Reese
  • robert_stilesrobert_stiles Member Posts: 116 PRO
    @Evan_Reese I have a question please... how come the version in your screen grab has a "new" or "self" Tab at the top?  And the version in the shared document does not? Or am I missing how to access this? 

    This seems very useful to me, as it saves a delete parts step. 
    Also, a key extra for me would be a "select all" option for the bodies to mirror. 
    This need also links into the need for the "new" or "self" tab. I'll explain :
    I often need a handed version in a configuration. Furthermore, its common for me to use a pattern feature. This means the number of bodies changes between configurations. Currently I have to create the highest pattern number I think I might ever need,
    - mirror it all
    - delete the original
    The problem here is if the number of bodies ever changes. If there are multiple part patterns controlled by multiple configurations, then I need to make all the possible parts across all the configurations and do the mirror at the end with the max number of bodies. Its not perfect 
    All this would be removed with the "new" or "self" tab, which I think removes the need for the delete step, and a select all bodies tick box. It would then simply grab everything in the parts studio, and hand it. 
    Even better would be a reset origin (essentially a transform of all the bodies selected) to re position the mirrored version to have the same insertion point as the non handed original version. 

    Is there a featurescript version with the "new"/"self" tab floating about? 
    Thanks
    Rob
  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭
    @robert_stiles
    I ended up developing it without the options, since the main use-case for me is always to merge things, and you can use the standard Mirror feature for everything else. If you want to, you could search through the previous versions in the version graph, and add an older version where it has that. I don't remember whether it ever worked or not. I don't plan on updating this one anytime soon.

    For your use case, it sounds like you might want to copy the code from the standard mirror feature and just modify it to automate your selections and delete stuff. Would that work?
    Evan Reese
  • S1monS1mon Member Posts: 3,039 PRO
    @Evan_Reese
    You might find the UI of the mirror feature in Plasticity interesting. See these videos:
    https://www.youtube.com/watch?v=Zf6cgg0X5F8&list=PLv8HciXoFYX-VGc-zqYQNLaWl8PuwIelI&index=211
    https://www.youtube.com/watch?v=rGEEvNZhesg&list=PLv8HciXoFYX-VGc-zqYQNLaWl8PuwIelI&index=23

    In addition to quickly choosing and/or translating the plane to mirror around (either using the manipulator or keyboard shortcuts), it has options for cutting the part first (enabled by default) and for performing a boolean union after the mirror operation. It doesn't have options to mirror more than one axis at a time.


  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭
    That is an interesting one. I like the idea of adding some manipulators that can be used to quickly pick which directions to mirror about. The cutting first thing would be handy for quick models (perfect for plasticity), but also enable sloppy behavior for cleaner models. Thanks for sharing the vids.
    Evan Reese
  • S1monS1mon Member Posts: 3,039 PRO
    Yes, cutting mostly makes sense when you're in a direct modeling mode (which is basically everything in Plasticity so far). Typically the reason you'd use that is that you've done some modeling on one side, and now you want to duplicate it across. Since Plasticity doesn't have history, every time you want to update a mirror, you can use this tool. Adding a mirror every time you add features in Onshape would be kinda sloppy. I wouldn't enable a cut option by default, but I would enable a boolean union by default.

    That said, there are occasions in Onshape (or other history based tools) when I start by modeling something across the mirror plane to guarantee that it will be continuous. Cutting that in half could be useful. In the model that's in my screenshot, I started by building the top surface in one piece and then added side, front, bottom and rear surfaces. I would likely do the same thing in Onshape, although I might have mirrored the side surfaces before joining them to the main body.
  • John_vd_WerffJohn_vd_Werff Member Posts: 65 PRO
    Great FS!
    Wish I had known about it earlier...
  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭
    Great FS!
    Wish I had known about it earlier...
    Thanks! I want to make sure to throw credit back to @MBartlett21. I wrote a bad version of the feature early in learning FeatureScript, and he pretty much re-wrote it to be good, hahaha. I've since done a bit more to improve performance.
    Evan Reese
  • eric_pestyeric_pesty Member Posts: 1,947 PRO
    This is such a useful feature, I sometimes forget that it doesn't work on sheet metal and I am sad every time I try!

  • martin_kopplowmartin_kopplow Member Posts: 529 PRO
    This FS is such an obvious accelerator for everything cube-shaped, that I wonder why this functionality hasn't made it into the factory toolset.
  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭
    Thanks, y'all. @eric_pesty does the standard Mirror tool work on sheet metal how you'd like this one to? I could add it to my backlog of things I might not get to  :D
    Evan Reese
  • eric_pestyeric_pesty Member Posts: 1,947 PRO
    edited February 27
    Thanks, y'all. @eric_pesty does the standard Mirror tool work on sheet metal how you'd like this one to? I could add it to my backlog of things I might not get to  :D
    The standard mirror tool does work, although it doesn't default to "add" (maybe that's the problem?) if MultiMirror use the mirror feature directly... I haven't actually looked at your code...
    I also haven't done any FS that deal with sheet metal but there seems to be some "weirdness" around it.

    I have one of these "maybe someday" backlog list too!

    Had a quick glance at your code and right of the bat it seems like it relies on "boolean" union, which is not supported for active sheet metal so that's probably where the issue is. It would probably require a different approach so likely not trivial to fix...

  • jelte_steur814jelte_steur814 Member Posts: 232 PRO
    BTW @Evan_Reese.
    Kudos's for this feature. I use it by default iso the native mirror feature.
  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭
    @jelte_steur814
    glad to hear it! The native tool is still better for some things for sure, but I do tend to reach for this one first.
    Evan Reese
Sign In or Register to comment.