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: Impossible extrude bounding type: UP_TO_VERTEX

Evan_ReeseEvan_Reese Member Posts: 2,060 PRO
I'm stumped on why I'm getting this error and I'm not sure what it's trying to tell me. If I use the native extrude feature to do exactly what I think I'm doing with the code, it works. I'm re-writing my Captive Nut feature from scratch since the old one has some fundamental issues and I've gotten a lot better at Featurescript since then (thanks @Alex_Kempen for the encouragement to do so). The extrude in question is on line 335. Any help is appreciated.
https://cad.onshape.com/documents/d210fcf0f8b5e96ff2027adb/w/532b4113cecd2089664e73ab/e/0b87627129eb6f9c7141b4d5
Evan Reese / Principal and Industrial Designer with Ovyl
Website: ovyl.io

Answers

  • Alex_KempenAlex_Kempen Member Posts: 244 EDU
    The documentation for opExtrude states that BoundingType.UP_TO_VERTEX and BoundingType.SYMMETRIC are not supported. This is because opExtrude does not handle those bounding types directly; they are instead handled by the extrude feature, which automatically adjusts the opExtrude definition call for the aforementioned two cases (using the function transformExtrudeDefinitionForOpExtrude on line 251 of extrudeCommon). 
    In summary, instead of passing BoundingType.UP_TO_VERTEX into opExtrude, handle it before the opExtrude call:
    if (thisEndBoundType == BoundingType.UP_TO_VERTEX)
    {
        thisEndBoundType = BoundingType.BLIND;<br>    thisEndBoundDistance = evDistance(context, { 
                                   "side0" : pocketExtrudeFaces, 
                                   "side1" : thisEndBoundEntity 
                                 }).distance;
    }
    
    // opExtrude

    CS Student at UT Dallas
    Alex.Kempen@utdallas.edu
    Check out my FeatureScripts here:



  • MichaelPascoeMichaelPascoe Member Posts: 1,695 PRO
    edited November 2021
    This is similar to what Alex suggested. Here is a function that I use for up to entity. It will return the distance and positive or negative direction. It requires a plane to measure from, a plane slightly in the negative direction from that plane (0, 0, -0.00001) * inch. and either a point, face, or mate connector to measure up to. 

    function upToCalculation(id is Id, context is Context, upToDef, offsetDef, fromPlane, fromPlaneNegative, preset1)
    {
        var upToDistance= offsetDef;
        var entityDistance = 0 * inch;
    
        if (!isQueryEmpty(context, upToDef))
        {
            const signCompare = evDistance(context, {
                            "side0" : fromPlaneNegative,
                            "side1" : upToDef
                        }).distance;
    
            entityDistance = evDistance(context, {
                            "side0" : fromPlane,
                            "side1" : upToDef
                        }).distance;
    
            entityDistance = signCompare < entityDistance ? -entityDistance : entityDistance;
        }
    
        upToDistance = offsetDef - entityDistance + preset1;<br>
        return upToDistance;
    }


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎
  • Evan_ReeseEvan_Reese Member Posts: 2,060 PRO
    Thanks to both of you. I'm not wanting to just measure the dimension since I'm extruding faces that aren't parallel to one another, but I want them to all terminate at the same plane. I started with UP_TO_VERTEX because it seemed like a slightly easier solution and worked with the native extrude feature, but it's turning out to not be simple so I'm just making a plane (with opPlane) and using UP_TO_SURFACE instead. However, now I'm just getting an "@opExtrude: EXTRUDE_FAILED". I've tried recreating the same thing with native features and it seems to work ok. Any other ideas?
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • MichaelPascoeMichaelPascoe Member Posts: 1,695 PRO
    I'm not sure about the fix for that error, but a work around could be to extrude past then split and delete.

    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎
  • Evan_ReeseEvan_Reese Member Posts: 2,060 PRO
    I'm not sure about the fix for that error, but a work around could be to extrude past then split and delete.
    Thanks! I was actually considering that since BLIND works, and I'll do if I really get stuck, but I like to be pretty stubborn with some issues like this because I always learn a lot more by wrestling with it a bit.
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    I started with UP_TO_VERTEX because it seemed like a slightly easier solution and worked with the native extrude feature, but it's turning out to not be simple so I'm just making a plane (with opPlane) and using UP_TO_SURFACE instead. However, now I'm just getting an "@opExtrude: EXTRUDE_FAILED".
    You can try to pass face query as endBoundEntity, if it failes for plane body query
  • Evan_ReeseEvan_Reese Member Posts: 2,060 PRO
    I've tried EntityType.FACE and EntityType.BODY as well as UP_TO_SURFACE and UP_TO_FACE. Is that what you mean? I must just be doing something small wrong since this is how I did it before on the original Captive Nut feature. I'll dig into it when I have more time.
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    According to description UP_TO_FACE should handle both face and surface body end entity types. The difference can arise from the fact that face boundary can be treated as endless plane while body query boundary supposed to work only within plane surface body bounds.
Sign In or Register to comment.