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.

Fillet edges only on faces in extruded direction

richard_marcusrichard_marcus Member Posts: 11 EDU
Is there a query that will give me only the edges on a body that are in the extruded direction (i.e. perpendicular to the sketch plane)? I don't want to fillet anything on the end faces. Queries are still a little bit of a mystery to me.

This seems to work if I just extruded a body:

var ExtrudedEdges is Query = qSubtraction(qSubtraction(qCreatedBy(id + "extrude1", EntityType.EDGE), qCapEntity(id + "extrude1", true)), qCapEntity(id + "extrude1", false));

opFillet(context, id + "fillet1", {
                "entities" : ExtrudedEdges,
                "radius" : 0.5 * millimeter

However, if I have done other operations (such as boolean remove) on the body, the qCapEntity doesn't really work anymore since it references a feature creation not the body.
Any advice?

Best Answer

  • konstantin_shiriazdanovkonstantin_shiriazdanov Posts: 954 ✭✭✭✭✭
    Accepted Answer
    once i needed the same functionality, and i wrote a function
    function selectParallelEdges(context is Context, edges is Query, vector is Vector)


  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 954 ✭✭✭✭✭
    Accepted Answer
    once i needed the same functionality, and i wrote a function
    function selectParallelEdges(context is Context, edges is Query, vector is Vector)

  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,419
    edited August 2017
    Seems like you're doing pretty well with queries already!  You could try something like this:
            // Get the cap entities
            var caps = qUnion([qCapEntity(id + "extrude1", true), qCapEntity(id + "extrude1", false)]);
            // Filter for just the faces
            var capFaces = qEntityFilter(caps, EntityType.FACE);
            // Do something to the extruded body
            // Get all the edges on the body created by extrude1
            //    qCreatedBy(id + "extrude1", EntityType.EDGE) will only have the edges
            //    created by the extrude, so we do something more complicated
            var allEdges = qOwnedByBody(qCreatedBy(id + "extrude1", EntityType.BODY), EntityType.EDGE);
            // Get all the edges surrounding the cap faces
            var capEdges = qEdgeAdjacent(capFaces, EntityType.EDGE);
            // Subtract the cap geometry
            var desiredEdges = qSubtraction(allEdges, capEdges);
            // run opFillet on the desiredEdges
    Let me know if this works for you!

    Edit: Nice function Konstantin!
    Jake Rosenfeld - Modeling Team
  • emagdalenaC2iemagdalenaC2i Member, Developers Posts: 584 ✭✭✭✭✭
    If you are working with sheet metal parts you can use this in the selection to avoid that edges:

            annotation { "Name" : "Select two parallel edges that belong to the same planar face", "Filter" : (ActiveSheetMetal.NO && EntityType.EDGE && EdgeTopology.TWO_SIDED && GeometryType.LINE
                                || EntityType.EDGE && SheetMetalDefinitionEntityType.VERTEX
                                && ConstructionObject.NO && SketchObject.NO && ModifiableEntityOnly.YES),
                        "AdditionalBoxSelectFilter" : EntityType.EDGE,

    You can see an example here https://cad.onshape.com/documents/3d52520839c0fa3587798c0f/w/2c36a47f3c428c7a3f8e3a5f/e/acc8270b7d8719708565ee1e

    Just try to create a full round in a sheet metal part
    Un saludo,

    Eduardo Magdalena                           C2i Change 2 improve                           ☑ ¿Por qué no organizamos una reunión online?   
                                                                 Consulting Partner de Onshape                                      Averigua a quién conocemos en común

    Consulta mis cursos de Onshape en Español:
Sign In or Register to comment.