Skip to content
Snippets Groups Projects
Commit d3a32949 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

catch OCC exception in addShape

parent c4f25e5d
No related branches found
No related tags found
No related merge requests found
......@@ -499,6 +499,7 @@ void GModel::addShape(std::string name, std::vector<double> &p,
else if(op == "Fuse" || op == "Union") o = OCC_Internals::Fuse;
else if(op == "Intersection") o = OCC_Internals::Intersection;
try{
if (name == "Sphere"){
if (p.size() != 4){
Msg::Error("4 parameters have to be defined for a sphere");
......@@ -550,6 +551,10 @@ void GModel::addShape(std::string name, std::vector<double> &p,
_occ_internals->buildGModel(this);
}
}
catch(Standard_Failure &err){
Msg::Error("%s", err.GetMessageString());
}
}
TopoDS_Shape GlueFaces (const TopoDS_Shape& theShape,
const Standard_Real theTolerance)
......
......@@ -48,7 +48,6 @@ class OCC_Internals {
void buildLists();
void removeAllDuplicates(const double &tolerance);
void Cone(const SPoint3 &p1, const SPoint3 &p2, const BooleanOperator &op);
void Box(const SPoint3 &p1, const SPoint3 &p2, const BooleanOperator &op);
void Sphere(const SPoint3 &center, const double &radius, const BooleanOperator &op);
void Cylinder(const SPoint3 &bottom_center, const SVector3 &dir, double R, double H,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment