//this is how i organized my code and i hope it can help you understand my problem better.





#include <BOPAlgo_CellsBuilder.hxx>

class TopoDS_Shape;

BOPAlgo_CellsBuilder* cellsBuilder = new BOPAlgo_CellsBuilder;


//firstly I built 3 cones named shape1,shape2,shape3
//**Cone shape1 has a base radius of 110mm, a top radius of 100mm,
//    a height of 2000mm, with its origin at (0,0,0) and its axis aligned along the z-axis.
//**Cone shape2 has a base radius of 77mm, a top radius of 70mm,
//    a height of 1400mm, with its origin at (0,0,2000) and its axis passes 
//    through the origin and is obtained by rotating the z-axis around the x-axis by 25 degrees.
//**Cone shape3 has a base radius of 77mm, a top radius of 70mm,
//    a height of 1400mm, with its origin at (0,0,2000) and its axis passes 
//    through the origin and is obtained by rotating the z-axis around the x-axis by -25 degrees.
TopoDS_Shape shape1, shape2, shape3;

double tol = 1e-7;//I changed the value for several times and the result changed everytime but none of them was exactly correct.
cellsBuilder->SetNonDestructive(Standard_True);

//add shapes to be united
cellsBuilder->AddArgument(shape1);
cellsBuilder->AddArgument(shape2);
cellsBuilder->AddArgument(shape3);

//set tolerance
cellsBuilder->SetFuzzyValue(tol)

//make the 3 shapes into parts
cellsBuilder->Perform();

//keep all the parts in the result
cellsBuilder->AddAllToResult(1);

//remove internal boundaries like faces and edges that are not on the exterior of the combined shape
cellsBuiler->RemoveInternalBoundaries();

//get the final result
TopoDS_Shape resultShape = cellsBUilder->Shape();

//after these operations,resultShape should be the boolean union of shape1,2,3,
// and there should be no internal faces or edges in the shape but it did not work as expected.
 
