Why using fillet?

Fillets are vitals when it deals with having realistic mechanical part. For tooling reasons, part are not likely to have sharp edges. In this post I’ll show how to use these techniques.Capture4Fillet1

Filet after Boolean fuse operation.

Here we create first a simple junction and then we recover the newly created edges:


    double l_cyl1 = 100;
    double r_cyl1 =  20;
    double l_cyl2 =  30;
    double r_cyl2 =   5;

    gp_Ax2 ax2_cyl1(gp_Pnt(0.,-l_cyl1 *0.5,0.),gp_Dir(0 ,1 ,0));
    gp_Ax2 ax2_cyl2;

    TopoDS_Shape cyl1 =
BRepPrimAPI_MakeCylinder(ax2_cyl1,r_cyl1,l_cyl1).Shape();
    TopoDS_Shape cyl2 =
BRepPrimAPI_MakeCylinder(ax2_cyl2,r_cyl2,l_cyl2).Shape();

    BRepAlgoAPI_Fuse fuseOp;
    TopTools_ListOfShape ToolShapes,ArgShapes;
    ArgShapes.Append(cyl1);
    ToolShapes.Append(cyl2);
    fuseOp.SetTools(ToolShapes);
    fuseOp.SetArguments(ArgShapes);
    fuseOp.Build();

    auto sectionEdges = fuseOp.SectionEdges();

Capture1Fillet1

Constant radius fillet.

Now it’s time to set fillet. In order to simplify, we will start with a constant fillet value:


BRepFilletAPI_MakeFillet filletOp(fuseOp.Shape());
double rFillet=1.;
for(auto edShape : sectionEdges){
TopoDS_Edge ed = TopoDS::Edge(edShape);//sectionEdges is la list of shapes,
//so a cast is required
filletOp.Add(rFillet,ed);
}
filletOp.Build();

Capture3Fillet1

Variable fillet radius value.

The process can be refined by choosing different radius value at edges extremities:


BRepFilletAPI_MakeFillet filletOp(fuseOp.Shape());

double rFillet[3] = {1. , 2. ,3.};

int iEd=0;

for(auto edShape : sectionEdges){

TopoDS_Edge ed = TopoDS::Edge(edShape);//sectionEdges is la list of shapes,

//so a cast is required

filletOp.Add(rFillet[iEd % 3],rFillet[(iEd+1) % 3],ed);

iEd++;

}

filletOp.Build();

Capture4Fillet1.PNG

The fillet control can be made also by using control laws but that’s the purpose of next post!