Use Base::toRadians() instead of manually converting

This commit is contained in:
Benjamin Nauck
2025-04-09 09:14:54 +02:00
parent 5a1cdcfd11
commit f932c7e4e0
43 changed files with 129 additions and 106 deletions

View File

@@ -53,6 +53,7 @@
#include <Base/Converter.h>
#include <Base/FileInfo.h>
#include <Base/Parameter.h>
#include <Base/Tools.h>
#include "DrawGeomHatch.h"
#include "DrawGeomHatchPy.h" // generated from DrawGeomHatchPy.xml
@@ -402,12 +403,13 @@ std::vector<TopoDS_Edge> DrawGeomHatch::makeEdgeOverlay(PATLineSpec hatchLine, B
double interval = hatchLine.getInterval() * scale;
double offset = hatchLine.getOffset() * scale;
double angle = hatchLine.getAngle() + rotation;
origin.RotateZ(rotation * pi / 180.);
origin.RotateZ(Base::toRadians(rotation));
if (scale == 0. || interval == 0.)
return {};
Base::Vector3d hatchDirection(cos(angle * pi / 180.), sin(angle * pi / 180.), 0.);
const double hatchAngle = Base::toRadians(angle);
Base::Vector3d hatchDirection(cos(hatchAngle), sin(hatchAngle), 0.);
Base::Vector3d hatchPerpendicular(-hatchDirection.y, hatchDirection.x, 0.);
Base::Vector3d hatchIntervalAndOffset = offset * hatchDirection + interval * hatchPerpendicular;