creat sphere

how can I creat a sphere with the range :Latitude Angle

between 0 and 90 degree, and Longitude line Angle between 0 and 360 degree, and with a aixs as the sphere axis. Thank you!

Fabian Hachenberg's picture

you'll need to provide an x axis also, then you can do

gp_Ax1 anaxis = ...;
gp_Dir xaxis = ...;
Standard_Real radius = 1.0;
Standard_Real minLatitude = 0;
Standard_Real maxLatitute = PI*0.5;
Standard_Real minLongitude = 0;
Standard_Real maxLongitude = PI*2.0;
gp_Ax3 sphere_coordinate_system(anaxis.Location(), anaxis.Direction(), xaxis);
TopoDS_Face sphereface = BRepBuilderAPI_MakeFace(gp_Sph(sphere_coordinate_system, radius), minLongitude, maxLongitude, minLatitude, maxLatitude);

hr's picture

Thank you for your help. I have do it as you say, but why I get the whole sphere, not the semi sphere?

hr's picture

I got it ,thank you very much!