Part: Use std::numeric_limits and std::numbers instead of defines

This commit is contained in:
Benjamin Nauck
2025-03-27 19:01:46 +01:00
parent 9086f0ff14
commit aad5e58955
38 changed files with 259 additions and 247 deletions

View File

@@ -200,6 +200,8 @@ bool Extrusion::fetchAxisLink(const App::PropertyLinkSub& axisLink, Base::Vector
ExtrusionParameters Extrusion::computeFinalParameters()
{
using std::numbers::pi;
ExtrusionParameters result;
Base::Vector3d dir;
switch (this->DirMode.getValue()) {
@@ -244,11 +246,11 @@ ExtrusionParameters Extrusion::computeFinalParameters()
result.solid = this->Solid.getValue();
result.taperAngleFwd = this->TaperAngle.getValue() * M_PI / 180.0;
if (fabs(result.taperAngleFwd) > M_PI * 0.5 - Precision::Angular())
result.taperAngleFwd = this->TaperAngle.getValue() * pi / 180.0;
if (fabs(result.taperAngleFwd) > pi * 0.5 - Precision::Angular())
throw Base::ValueError("Magnitude of taper angle matches or exceeds 90 degrees. That is too much.");
result.taperAngleRev = this->TaperAngleRev.getValue() * M_PI / 180.0;
if (fabs(result.taperAngleRev) > M_PI * 0.5 - Precision::Angular())
result.taperAngleRev = this->TaperAngleRev.getValue() * pi / 180.0;
if (fabs(result.taperAngleRev) > pi * 0.5 - Precision::Angular())
throw Base::ValueError("Magnitude of taper angle matches or exceeds 90 degrees. That is too much.");
result.faceMakerClass = this->FaceMakerClass.getValue();