Thu, 07/25/2019 - 12:24
Forums:
Hi everyone,
I want to apply fillets in TopoDS_Shape that produced from other basic shapes with the help of BRepAlgoAPI_Cut. I have include the code and some pictures
QString params = "27.2;21.7;28.6;28.6;2.8;2.8;11;20;15";
std::vector<double> parameters = splitParams(params);
double outDiaMain = parameters[0];
double outDiaTee = parameters[1];
double extrusionMain = parameters[2];
double extrusionTee = parameters[3];
double addThickMain = parameters[4];
double addThickTee = parameters[5];
double filletRadius = parameters[6];
double nomimalDiameterBig = parameters[7];
double nomimalDiameterSmall = parameters[8];
double angleRotation = 2 * uPi;
gp_Ax2 axisMain(gp_Pnt(-extrusionMain, 0., 0.), gp_Dir(1., 0., 0.));
gp_Ax2 axisTee(gp_Pnt(0., 0., 0.), gp_Dir(0., 1., 0.));
//main shape
TopoDS_Shape mainBranch = BRepPrimAPI_MakeCylinder(axisMain, outDiaMain / 2, extrusionMain * 2, angleRotation);
TopoDS_Shape teeBranch = BRepPrimAPI_MakeCylinder(axisTee, outDiaTee / 2, extrusionTee, angleRotation);
TopoDS_Shape regTee = BRepAlgoAPI_Fuse(mainBranch, teeBranch);
//main shape cuts
TopoDS_Shape mainBranchCut = BRepPrimAPI_MakeCylinder(axisMain, (outDiaMain - addThickMain * 2) / 2, extrusionMain * 2, angleRotation);
TopoDS_Shape regTeeCutMain = BRepAlgoAPI_Cut(regTee, mainBranchCut);
TopoDS_Shape teeBranchCut = BRepPrimAPI_MakeCylinder(axisTee, (outDiaTee - addThickTee * 2) / 2, extrusionTee, angleRotation);
TopoDS_Shape regTeeResult = BRepAlgoAPI_Cut(regTeeCutMain, teeBranchCut);
return regTeeResult; //to return the shape
TopoDS_Shape curveFromIntersectionShapes = BRepAlgoAPI_Section(mainBranch, teeBranch);
//return curveFromIntersectionShapes; //to return the edge produced
Attachments:
Fri, 07/26/2019 - 04:47
So like This?Use class BRepFilletAPI_MakeFillet?I dont understand your problem
Mon, 07/29/2019 - 12:35
Thanks for the reply.
Yes it is exactly like the image you uploaded.
I also use
but it seems that it cannot find the edge i want because it is a TopoDS_Compound object.
Fri, 07/26/2019 - 10:37
Hi George,
I have made a little example: FilletTest
It is C#, but easily converted to C++. Hope it helps.
Guido
Mon, 07/29/2019 - 12:39
Many thanks Guido!!!
I will inform you once i complete the task.