Techdraw: Use std::numeric_limits and std::numbers instead of defines
This commit is contained in:
@@ -385,6 +385,8 @@ std::vector<LineSet> DrawGeomHatch::getTrimmedLines(DrawViewPart* source,
|
||||
/* static */
|
||||
std::vector<TopoDS_Edge> DrawGeomHatch::makeEdgeOverlay(PATLineSpec hatchLine, Bnd_Box bBox, double scale, double rotation)
|
||||
{
|
||||
using std::numbers::pi;
|
||||
|
||||
const size_t MaxNumberOfEdges = Preferences::getPreferenceGroup("PAT")->GetInt("MaxSeg", 10000l);
|
||||
|
||||
std::vector<TopoDS_Edge> result;
|
||||
@@ -399,12 +401,12 @@ 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 * M_PI / 180.);
|
||||
origin.RotateZ(rotation * pi / 180.);
|
||||
|
||||
if (scale == 0. || interval == 0.)
|
||||
return {};
|
||||
|
||||
Base::Vector3d hatchDirection(cos(angle * M_PI / 180.), sin(angle * M_PI / 180.), 0.);
|
||||
Base::Vector3d hatchDirection(cos(angle * pi / 180.), sin(angle * pi / 180.), 0.);
|
||||
Base::Vector3d hatchPerpendicular(-hatchDirection.y, hatchDirection.x, 0.);
|
||||
Base::Vector3d hatchIntervalAndOffset = offset * hatchDirection + interval * hatchPerpendicular;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user