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.

Extrude BoundingType Problems

S1monS1mon Member Posts: 3,931 PRO
edited February 3 in FeatureScript

I'm working on an injection molded boss custom feature. I'm trying to get the bosses to extrude to the part with or without draft reliably. In doing so, I'm discovering weird things about UP_TO_NEXT or UP_TO_PART which are causing issues.

Here's a manual feature based version of this issue - if I use up to next or up to part, I get this weird face at the base of the boss where it's joining a complex wall. It doesn't matter if I add the draft in the feature or after, with this edge case, it always adds this surface where I don't want it. Is this a Parasolid bug?

image.png image.png

If I use Through all, it does the right thing:

image.png

Obviously I don't want the extra bit on the outside of the part, and I can use delete face with heal to solve this, but I will need to be clever with queries to grab all the right faces, and then hope that heal doesn't do anything stupid.

I feel like I saw something similar in how some (all)? of the rib features are implemented. Is this a normal way to work? Is it more robust than up to next or up to part?

Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn

Comments

  • ry_gbry_gb Member, csevp, pcbaevp Posts: 170 PRO

    That's definitely behavior I would've never expected…

    What happens when you try the Mounting Boss featurescript? Looking at the code, specifically at the extrudeBase function, they're just using Up to Body as the end condition.

    Ramon Yip | glassboard.com

  • S1monS1mon Member Posts: 3,931 PRO

    @ry_gb

    Very interesting. On further experimentation in regular Onshape, New vs Add both with Up to part, gives different results (besides the obvious boolean). With New, and Up to part, draft is treated differently. It seems like the most robust sequence is to extrude with add, then add draft after. I would have thought that adding draft while extruding would be better for topology challenges. It seems like the mounting boss feature is doing exactly that - so I'm really baffled.

    However when I try that in Onshape CAD with test cases where the undrafted cylinder doesn't overlap a tangent connected face, it does stuff like this (leaves a defect at the base of the boss on the left in this image):

    image.png

    Is there something I'm missing?

    Here's the setup in @NeilCooke 's Mounting boss feature for the main boss (which behaves well):

    var extrudeDefinition = {

        "entities" : qSketchRegion(id + ("sketch" ~ sketchId)),
    
        "endBound" : BoundingType.UP_TO_BODY,
    
        "endBoundEntityBody" : definition.booleanScope,
    
        "hasDraft" : definition.hasDraft,
    
        "draftAngle" : definition.draftAngle,
    
        "draftPullDirection" : false,
    
        "operationType" : NewBodyOperationType.ADD,
    
        "defaultScope" : false,
    
        "booleanScope" : definition.booleanScope
    
        };
    

    Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn

  • robert_morrisrobert_morris OS Professional, Developers Posts: 173 PRO

    I wrote the Mounting Boss featurescript that @ry_gb mentioned.

    I believe I based it on a script that Neil wrote, but added some additional options so it would be more like the version in SolidWorks.

    I wrote that quite a while ago, but I do remember having issues with the up-to-next end condition, which is why I used up-to-body in the script. That seemed to be a bit more reliable.

    When adding a draft to parts, I have seen it either fail or do some weird things when the drafted surface crosses over onto a new face, like what you are showing. Have you tried extruding up to part as New, with a slight offset into the part, then adding the draft, before using a boolean to join them?

  • S1monS1mon Member Posts: 3,931 PRO

    @robert_morris
    Sorry to misattribute that FS.

    After I followed your code (or more accurately, after I told Codex to review your code and try doing it that way) I'm getting better results. The thing that really confuses me is it seems like the behavior of up_to_next when calling extrude.fs is very different in these edge cases than the user feature Extrude.

    Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn

  • ry_gbry_gb Member, csevp, pcbaevp Posts: 170 PRO
    edited 4:34AM

    Have you looked at the source code for the document in the user feature Extrude? I wonder if any of the inputs is different. I doubt it, but I sometimes check that to make sure I'm on the right path. It's a bit of a jumbly mess because each feature is written out onto a single line of code with lots of "try" statements and maps, but I'm sure Codex could parse through it pretty easily.

    Ramon Yip | glassboard.com

  • S1monS1mon Member Posts: 3,931 PRO

    Thanks. I seem to have solved these issues with opExtrude and draft. Definitely running into other fun ones with opFillet.

    Thanks also to @Derek_Van_Allen_BD for the ideas around pointing an AI coding tool at a GitHub clone of the standard source. That’s been helpful for telling Codex to go review how various issues are handled by the first party features.

    Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn

  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 664 PRO

    It's been especially useful lately as I've been getting into more sheet metal scripts. Every function in some of those features is labeled as For Internal Onshape Use and doesn't come with a readme. I would have taken that label as an invitation anyway but it's helpful to vibe out a tester script to build my own documentation while I go grab a cup of coffee.

Sign In or Register to comment.