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.

Use opFillet for a sketch?

sören_svenssonsören_svensson Member Posts: 14
Hi,

I'm trying to use opFillet to fillet corners in a sketch but I'm only getting not really helpful errors like FILLET_FAIL_SMOOTH and FILLET_SELECT_EDGES.

Here's a current snippet (I've tried many variants)

    var outerSketch = newSketch(context, id + "outerSketch", {
            "sketchPlane" : qCreatedBy(makeId("Top"), EntityType.FACE)
        });

    var outerPoints = [
        vector(rightX, (angleCenterX + rightX) * tan(upperAngle)),
        ur,
        ul,
        vector(leftX, (angleCenterX + leftX) * tan(upperAngle))
        
    ];
    for(var i = 0; i < size(outerPoints); i += 1)
    {
        skLineSegment(outerSketch, "outer_line" ~ i,
        { "start" : outerPoints[i],
          "end" : outerPoints[(i + 1) % size(outerPoints)]
        });
    }
    
    // close sketch for outer race
    skSolve(outerSketch);

    var edges = [];
    edges = append(edges, qContainsPoint(qCreatedBy(id + "outer_line0", EntityType.EDGE), vector(rightX, definition.outer / 2, 0 * millimeter)));
    edges = append(edges, qContainsPoint(qCreatedBy(id + "outer_line1", EntityType.EDGE), vector(rightX, definition.outer / 2, 0 * millimeter)));
    debug(context, edges);
    opFillet(context, id + "fillet1", {
            "entities" : qUnion(edges),
            "radius" : 0.2 * millimeter
    });

Every example I've found uses opFillet on bodies and not sketches but there's a fillet command in the sketch UI so I assume it should work.



Best Answer

Answers

  • sören_svenssonsören_svensson Member Posts: 14
    Thanks for the answer!
  • Aaron_HooverAaron_Hoover Member Posts: 33 EDU
    Any chance the availability of opFillet in sketches has changed in the last couple years?
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,162
    @Aaron_Hoover

    The advice Ilya gives is still valid.  The "fillet" sketch tool actually alters the sketch code to push back the neighboring edges and insert an arc between them (with skArc).  Filleting after a thicken or extrude is a good option, as well as doing the calculations for the endpoint locations for skArc.  If you share your specific problem I may be able to give more specific advice.
    Jake Rosenfeld - Modeling Team
  • Aaron_HooverAaron_Hoover Member Posts: 33 EDU
    @Jake_Rosenfeld

    This is super helpful. I'm currently trying to create a FeatureScript to create a dovetail joint like in this "Halved Dovetail Corner" joint: https://cad.onshape.com/documents/f22179460c63ac8d20c705e1/w/411adc4bdfc59835797812ed/e/dd2666a629e40f017ce24997

    In fact, there are many joints in the 50 digital joints collection that could make use of a "2D" fillet that gets extruded and Boolean'd (unions and subtractions) appropriately. So, I'm seeking a solution that makes this code as simple (and reusable) as possible.

    Do you have any examples of using the skArc to create fillets? It seems arduous to have to compute endpoint locations for straight segments to ensure tangency (for example). 


  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 1,921
    edited October 2018
    @Aaron_Hoover you don’t need to calculate them precisely, you can add constraints and skSolve. See the Spur Gear example. https://cad.onshape.com/documents/5742c8cde4b06c68b362d748/w/b493e0cb681bbf9497d9f4b3/e/01a666571e625f8b819fd75b
    Neil Cooke, Director of Technical Marketing, Onshape Inc.
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 888
    I still think a solid fillet is likely to be easier...
    Ilya Baran \ Director of FeatureScript \ Onshape Inc
Sign In or Register to comment.