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.

opExtrude "endTranslationalOffset" issue

EvanReeseEvanReese Member, Mentor Posts: 2,135 ✭✭✭✭✭
edited December 2021 in FeatureScript
I'm working on a feature with an extrude and I'd like to imitate all of the end bound options of the native extrude feature. It's all working right except when I try to add an offset to an endBound entity. If I add any value but 0*inch to the endTranslationalOffset I get @opExtrude: EXTRUDE_FAILED. What might I be missing? Here's what the operation looks like:

opExtrude(context, id + "pocketExtrude", { "entities" : pocketExtrudeFaces, "direction" : pocketDirection, "endBound" : thisEndBoundType, "endBoundEntity" : thisEndBoundEntity, "endTranslationalOffset" : offsetDistance, "endDepth" : pocketDepth });


Evan Reese

Best Answer

  • EvanReeseEvanReese Member, Mentor Posts: 2,135 ✭✭✭✭✭
    Answer ✓
    As I understand it, flipping the offset direction is handled before the opExtrude by just making the offset value negative. The documentation says, "The translational offset between the extrude end cap and the end bound entity. The direction vector for this is the same as direction: negative values pull the end cap away from the bound entity when endDepth is positive."

    Your questions did prompted me to look again at the full list of entries though for opExtrude again it seems that I needed to add
    "isStartBoundOpposite" : false,
    
    which is working now. I'm not sure what this field is doing in my case, since I don't even have a start direction or bound or anything.
    Evan Reese

Answers

  • S1monS1mon Member Posts: 2,983 PRO
    At least in the native one, the direction sometimes seems counter-intuitive when there's an offset. I wonder if something as simple as flipping the direction might help? Isn't there also another direction when there's an offset involved?
  • EvanReeseEvanReese Member, Mentor Posts: 2,135 ✭✭✭✭✭
    Answer ✓
    As I understand it, flipping the offset direction is handled before the opExtrude by just making the offset value negative. The documentation says, "The translational offset between the extrude end cap and the end bound entity. The direction vector for this is the same as direction: negative values pull the end cap away from the bound entity when endDepth is positive."

    Your questions did prompted me to look again at the full list of entries though for opExtrude again it seems that I needed to add
    "isStartBoundOpposite" : false,
    
    which is working now. I'm not sure what this field is doing in my case, since I don't even have a start direction or bound or anything.
    Evan Reese
Sign In or Register to comment.