Use Base::toRadians() instead of manually converting

This commit is contained in:
Benjamin Nauck
2025-04-09 09:14:54 +02:00
parent 1f8c8043fc
commit 21fbf8e539
43 changed files with 129 additions and 106 deletions

View File

@@ -721,8 +721,8 @@ App::DocumentObjectExecReturn* FeatureExtrude::buildExtrusion(ExtrudeOptions opt
Part::ExtrusionParameters params;
params.dir = dir;
params.solid = makeface;
params.taperAngleFwd = this->TaperAngle.getValue() * pi / 180.0;
params.taperAngleRev = this->TaperAngle2.getValue() * pi / 180.0;
params.taperAngleFwd = Base::toRadians(this->TaperAngle.getValue());
params.taperAngleRev = Base::toRadians(this->TaperAngle2.getValue());
if (L2 == 0.0 && Midplane.getValue()) {
params.lengthFwd = L / 2;
params.lengthRev = L / 2;

View File

@@ -496,7 +496,7 @@ double Helix::safePitch()
}
}
double angle = Angle.getValue() / 180.0 * std::numbers::pi;
double angle = Base::toRadians(Angle.getValue());
gp_Dir direction(axisVec.x, axisVec.y, axisVec.z);
gp_Dir directionStart(startVec.x, startVec.y, startVec.z);
TopoDS_Shape sketchshape = getVerifiedFace();

View File

@@ -2245,7 +2245,7 @@ TopoDS_Shape Hole::makeThread(const gp_Vec& xDir, const gp_Vec& zDir, double len
// | base-sharpV Rmaj H
// the little adjustment of p1 and p4 is here to prevent coincidencies
double marginX = std::tan(62.5 * std::numbers::pi / 180.0) * marginZ;
double marginX = std::tan(Base::toRadians(62.5)) * marginZ;
gp_Pnt p1 = toPnt(
(RmajC - 5 * H / 6 + marginX) * xDir
@@ -2282,7 +2282,7 @@ TopoDS_Shape Hole::makeThread(const gp_Vec& xDir, const gp_Vec& zDir, double len
// | base-sharpV Rmaj
// the little adjustment of p1 and p4 is here to prevent coincidencies
double marginX = std::tan(60.0 * std::numbers::pi / 180.0) * marginZ;
double marginX = std::tan(Base::toRadians(60.0)) * marginZ;
gp_Pnt p1 = toPnt(
(RmajC - h + marginX) * xDir
+ marginZ * zDir

View File

@@ -40,6 +40,7 @@
#endif
#include <Base/Console.h>
#include <Base/Tools.h>
#include <Gui/Application.h>
#include <Mod/Part/App/Tools.h>
#include <Mod/Part/Gui/SoBrepFaceSet.h>
@@ -121,7 +122,7 @@ void ViewProviderAddSub::updateAddSubShapeIndicator() {
Standard_Real deflection = ((xMax-xMin)+(yMax-yMin)+(zMax-zMin))/300.0 * Deviation.getValue();
// create or use the mesh on the data structure
Standard_Real AngDeflectionRads = AngularDeflection.getValue() / 180.0 * std::numbers::pi;
Standard_Real AngDeflectionRads = Base::toRadians(AngularDeflection.getValue());
BRepMesh_IncrementalMesh(cShape, deflection, Standard_False, AngDeflectionRads, Standard_True);
// We must reset the location here because the transformation data

View File

@@ -48,6 +48,7 @@
#include <App/Document.h>
#include <Base/Console.h>
#include <Base/Tools.h>
#include <Gui/Application.h>
#include <Mod/Part/App/Tools.h>
#include <Mod/PartDesign/App/FeatureMultiTransform.h>
@@ -228,7 +229,7 @@ void ViewProviderTransformed::showRejectedShape(TopoDS_Shape shape)
// create or use the mesh on the data structure
// Note: This DOES have an effect on shape
Standard_Real AngDeflectionRads = AngularDeflection.getValue() / 180.0 * std::numbers::pi;
Standard_Real AngDeflectionRads = Base::toRadians(AngularDeflection.getValue());
BRepMesh_IncrementalMesh(shape, deflection, Standard_False, AngDeflectionRads, Standard_True);
// We must reset the location here because the transformation data