Skip to content
Snippets Groups Projects
Commit 5fcb7691 authored by Amaury Johnen's avatar Amaury Johnen
Browse files

Merge branch 'master' into fixesByAmaury

parents 32b5e952 d47caf01
No related branches found
No related tags found
No related merge requests found
...@@ -1344,6 +1344,10 @@ bool OCC_Internals::_makeSphere(TopoDS_Solid &result, double xc, double yc, doub ...@@ -1344,6 +1344,10 @@ bool OCC_Internals::_makeSphere(TopoDS_Solid &result, double xc, double yc, doub
Msg::Error("Sphere radius should be positive"); Msg::Error("Sphere radius should be positive");
return false; return false;
} }
if(angle3 <= 0 || angle3 > 2 * M_PI){
Msg::Error("Cannot build sphere with angle <= 0 or angle > 2*Pi");
return false;
}
try{ try{
gp_Pnt p(xc, yc, zc); gp_Pnt p(xc, yc, zc);
BRepPrimAPI_MakeSphere s(p, radius, angle1, angle2, angle3); BRepPrimAPI_MakeSphere s(p, radius, angle1, angle2, angle3);
...@@ -1425,6 +1429,10 @@ bool OCC_Internals::_makeCylinder(TopoDS_Solid &result, double x, double y, doub ...@@ -1425,6 +1429,10 @@ bool OCC_Internals::_makeCylinder(TopoDS_Solid &result, double x, double y, doub
Msg::Error("Cannot build cylinder of zero height"); Msg::Error("Cannot build cylinder of zero height");
return false; return false;
} }
if(angle <= 0 || angle > 2 * M_PI){
Msg::Error("Cannot build cylinder with angle <= 0 or angle > 2*Pi");
return false;
}
try{ try{
gp_Pnt aP(x, y, z); gp_Pnt aP(x, y, z);
gp_Vec aV(dx / H, dy / H, dz / H); gp_Vec aV(dx / H, dy / H, dz / H);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment