Skip to content

Commit

Permalink
raise error if parameters of ellipse are invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Feb 2, 2017
1 parent 25496ad commit 1afa150
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Mod/Part/App/PrimitiveFeature.cpp
Expand Up @@ -1096,6 +1096,11 @@ short Ellipse::mustExecute() const

App::DocumentObjectExecReturn *Ellipse::execute(void)
{
if (this->MinorRadius.getValue() > this->MajorRadius.getValue())
return new App::DocumentObjectExecReturn("Minor radius greater than major radius");
if (this->MinorRadius.getValue() < Precision::Confusion())
return new App::DocumentObjectExecReturn("Minor radius of ellipse too small");

gp_Elips ellipse;
ellipse.SetMajorRadius(this->MajorRadius.getValue());
ellipse.SetMinorRadius(this->MinorRadius.getValue());
Expand Down

0 comments on commit 1afa150

Please sign in to comment.