how to draw a Spherical cap in occ

in my example £¬i want to build a Spherical cap£¬the following is my code£¬however£¬the result is a
Spherical cap with a bottom face£¨see figure 1£©.any one can tell me how to delete the bottom face£¿

TopoDS_Shape theSphere = BRepPrimAPI_MakeSphere(gp_Pnt(0,0,0),50);
gp_Pnt P1 (0, 0, 30);
gp_Dir aDir (0, 0, 1);
Handle(Geom_Plane) aPlane = new Geom_Plane(P1, aDir);
TopoDS_Face face1 = BRepBuilderAPI_MakeFace(aPlane->Pln());
TopoDS_Shape half1 = BRepPrimAPI_MakeHalfSpace(face1,gp_Pnt(0,0,-100)).Solid();
TopoDS_Shape resultShape;
TopoDS_Shape ShapeCut = BRepAlgoAPI_Cut(theSphere,half1);

Attachments: 
Sharjith Naramparambath's picture

IMHO, it would be easier to use BRepPrimAPI_MakeSphere with the angular limits set and obtaining the result as a shell.

zhushunlai2012's picture

it is true. strange to me why i did not think and try in this way