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.

Options

How can I optimize this FS?

EFishEFish Member Posts: 16 EDU
I am currently finishing up a Belt and Pulley generating FS for FRC and have noticed a few areas that add a lot of generation time, some I know why, but others I don't quite understand (such as line 350's extrude). If anyone has any suggestions on where I can optimize the FS, or if there are any tips on good optimization methods, I'd love to know! Thanks in advance!

Here is a link:
https://cad.onshape.com/documents/028ca8fb10baf53e1f6fce96/w/b1250a450d0ba88f0a8b1811/e/2a05bf271725b7afd76cabe0
FRC Team 2471 Designer - Alumni
Seattle Pacific University - Mechanical Engineering
efishg2020@gmail.com
Tagged:

Best Answer

  • Options
    Alex_KempenAlex_Kempen Member Posts: 244 EDU
    edited August 2021 Answer ✓
    :open_mouth: 
    https://cad.onshape.com/documents/9cffa92db8b62219498f89af/w/06b332ccabc9d2e0aa0abf88/e/99672d1e329b38e647d90146
    Don't mind me, I'm just pulling your leg.

    In terms of optimization, calling the onshape extrude feature is almost always less performant than calling opExtrude followed by opBoolean. The same goes for mirror; fortunately, you can make your own mirror pretty easily using mirrorAcross and opPattern (mirror is actually just an opPattern under the hood. The more you know!).

    Also, I see you're using sketch constraints, which are probably worse for performance when compared to just using math to figure out where things should go. The hardest part is doing the circle tangents, but you could probably figure those out by stealing the math from my FeatureScript posted above, or by taking advantage of the circle to circle function (which I stole from the official belt fs) here:
    https://cad.onshape.com/documents/4c21d0c3c89c0a81aadfdac6/w/a7ccf556a74ce09cd04151e0/e/2a1cde3849e2f7d4ef1b6676

    If you want to nerd out about FeatureScripts, I've also been doing a little thinking regarding updating my own belt FS. There's some cool advanced things that could be done, like adding support for multiple pulleys and maybe even adding savable pulley profiles. If you were interested, I would be totally down to collab and make something super cool. Just a thought.
    CS Student at UT Dallas
    Alex.Kempen@utdallas.edu
    Check out my FeatureScripts here:



Answers

  • Options
    EFishEFish Member Posts: 16 EDU
    Sorry, I didn't realize I posted this Community Support, there wasn't a dropdown to select the category like there is for Discussions.
    FRC Team 2471 Designer - Alumni
    Seattle Pacific University - Mechanical Engineering
    efishg2020@gmail.com
  • Options
    Alex_KempenAlex_Kempen Member Posts: 244 EDU
    edited August 2021 Answer ✓
    :open_mouth: 
    https://cad.onshape.com/documents/9cffa92db8b62219498f89af/w/06b332ccabc9d2e0aa0abf88/e/99672d1e329b38e647d90146
    Don't mind me, I'm just pulling your leg.

    In terms of optimization, calling the onshape extrude feature is almost always less performant than calling opExtrude followed by opBoolean. The same goes for mirror; fortunately, you can make your own mirror pretty easily using mirrorAcross and opPattern (mirror is actually just an opPattern under the hood. The more you know!).

    Also, I see you're using sketch constraints, which are probably worse for performance when compared to just using math to figure out where things should go. The hardest part is doing the circle tangents, but you could probably figure those out by stealing the math from my FeatureScript posted above, or by taking advantage of the circle to circle function (which I stole from the official belt fs) here:
    https://cad.onshape.com/documents/4c21d0c3c89c0a81aadfdac6/w/a7ccf556a74ce09cd04151e0/e/2a1cde3849e2f7d4ef1b6676

    If you want to nerd out about FeatureScripts, I've also been doing a little thinking regarding updating my own belt FS. There's some cool advanced things that could be done, like adding support for multiple pulleys and maybe even adding savable pulley profiles. If you were interested, I would be totally down to collab and make something super cool. Just a thought.
    CS Student at UT Dallas
    Alex.Kempen@utdallas.edu
    Check out my FeatureScripts here:



  • Options
    EFishEFish Member Posts: 16 EDU
    Thank you for the suggestions! I'll get to work on that. I'd love to work on something collaboratively, would definitely be an interesting experience and a good way to test the collaborative ability of Onshape in an FS production environment!
    FRC Team 2471 Designer - Alumni
    Seattle Pacific University - Mechanical Engineering
    efishg2020@gmail.com
Sign In or Register to comment.