Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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_svensson
Member Posts: 21 ✭✭
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)
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.
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.
Tagged:
0
Best Answer
-
ilya_baran Onshape Employees, Developers, HDM Posts: 1,202Unfortunately, the sketch fillet (and other sketch commands like trim, offset, etc.) are very different than features and are not accessible through FeatureScript at this time. I would suggest filleting the relevant edges once the sketch is turned into a solid.Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc5
Answers
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.
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).