Thu, 01/09/2025 - 10:20
I tried to use the BRepAlgoAPI_Fuse operation to intersect two entities in OCCT, but when I tested it, I found that the interaction between the two entities would go wrong when they were in different positions?
I still haven't found a way to solve it.
The easy code is at the end of the document, and what is certain is that I use Common and
GProp_GProps massProps;
BRepGProp::VolumeProperties(inputSolid, massProps);
Such algorithms have verified that my SweptCutter and StartCutter are both quality entity structures.
But when I execute BRepAlgoAPI_Fuse FuseST(SweptCutter, StartCutter); In this line of code, I found that when the position of StartCutter is in pose1, that is, when it is tangent to the boundary of SweptCutter, the calculated result will form an empty shell, but after I move a short distance, I use the StartCutter at the position of pose3 to perform Fuse operations with SweptCutter, and the result is correct, as shown in the following file, I don't know how to solve such a problem now, Please help me.
Pose pose1 = Pose();
Pose pose2 = Pose();
pose1.setPosition(20., 20., 0.);
pose2.setPosition(25., 25., 4.);
SetCutter(cutterParam, cTpye);
TopoDS_Shape SweptCutter = CreateSweptVolume_BallHead(pose1, pose2);//Modeling algorithm that I edited myself
Pose pose3 = Pose();
pose3.setPosition(20.5, 20.5, 0.);
TopoDS_Shape StartCutter = CreateCutter(cutterParam, pose1);
TopoDS_Shape EndCutter = CreateCutter(cutterParam, pose2);
BRepAlgoAPI_Fuse FuseST(SweptCutter,StartCutter);
TopoDS_Shape FusedST = FuseST.Shape();
ShowShape(FusedST);
Fit();