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

This commit is contained in:
Benjamin Nauck
2025-03-27 19:02:24 +01:00
parent e8d836f390
commit b4eb28e50e
41 changed files with 355 additions and 225 deletions

View File

@@ -591,7 +591,7 @@ void SketchAnalysis::analyseMissingPointOnPointCoincident(double angleprecision)
if (fabs(tgv1 * tgv2) > fabs(cos(angleprecision))) {
vc.Type = Sketcher::Tangent;
}
else if (fabs(tgv1 * tgv2) < fabs(cos(M_PI / 2 - angleprecision))) {
else if (fabs(tgv1 * tgv2) < fabs(cos(std::numbers::pi / 2 - angleprecision))) {
vc.Type = Sketcher::Perpendicular;
}
}
@@ -726,7 +726,8 @@ void SketchAnalysis::makeMissingVerticalHorizontalOneByOne()
bool SketchAnalysis::checkVertical(Base::Vector3d dir, double angleprecision)
{
return (dir.x == 0. && dir.y != 0.) || (fabs(dir.y / dir.x) > tan(M_PI / 2 - angleprecision));
return (dir.x == 0. && dir.y != 0.)
|| (fabs(dir.y / dir.x) > tan(std::numbers::pi / 2 - angleprecision));
}
bool SketchAnalysis::checkHorizontal(Base::Vector3d dir, double angleprecision)