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.

rounding extruded edges on sides, not faces

adamohernadamohern Member, OS Professional Posts: 216 PRO
I'm extruding rectangles, and by trial and error I found that the following code does exactly what I want:

var filletCandidates = qCreatedBy(id + ("extrude" ~ i), EntityType.EDGE);
                var filletEdges = qUnion([
                        qNthElement(filletCandidates, 0),
                        qNthElement(filletCandidates, 1),
                        qNthElement(filletCandidates, 2),
                        qNthElement(filletCandidates, 3)
                    ]);
                opFillet(context, id + ("fillet1"), {
                            "entities" : filletEdges,
                            "radius" : definition.edgeRadius
                        });

This works for rectangular extrudes, because it just-so-happens that Onshape puts the extruded edges (the ones running normal to the sketch plane) first in the qNthElement() list. All I have to do is gather up the first four, and I know I've got all of the vertical edges.

Two questions:

1) Is there a cleaner way to do this in my situation?

2) Is there a generalized way to access all of the non-end-cap edges of an extrude regardless of profile shape?

Comments

  • jacob_kingeryjacob_kingery Member Posts: 39 EDU
    Have you seen qCapEntity()?  It takes in an id (e.g. id + ("extrude" ~ i)) and a boolean for whether to return the start or end cap entities (I don't see a way to get both at once).  Using a qSubtraction() between your filletCandidates and the results of the qCapEntity()s should give you just the non-cap edges.
  • adamohernadamohern Member, OS Professional Posts: 216 PRO
    Sounds promising! Will give this a shot. Many thanks!
  • adamohernadamohern Member, OS Professional Posts: 216 PRO
    Beautiful, Jacob. This worked for me. Thanks again.

    var filletCandidates = qCreatedBy(id + ("extrude" ~ i), EntityType.EDGE);
    var capEntities = qUnion([
        qCapEntity(id + ("extrude" ~ i), true),
        qCapEntity(id + ("extrude" ~ i), false)
        ]);
    
    var filletEdges = qSubtraction(filletCandidates, capEntities);
    
    opFillet(context, id + ("fillet1"), {
        "entities" : filletEdges,
        "radius" : definition.edgeRadius
        });
Sign In or Register to comment.