Revert "CAM: Add threshold for treating large-radius arcs as linear in simulator"

This reverts commit 0b35385f4a9416c58bda2353e912bf2539d21c6d.
This commit is contained in:
Billy Huddleston
2026-01-31 15:41:45 -05:00
committed by Max Wilfinger
parent bf83b9bfde
commit c98d077d91

View File

@@ -39,11 +39,6 @@ constexpr auto pi = std::numbers::pi_v<float>;
#define PY 1
#define PZ 2
// Maximum ratio of radius to chord length for treating arc as curved
// Ratios above this indicate the arc is essentially a straight line
// and should be treated as linear to avoid numerical precision issues
constexpr float ARC_LINEARIZATION_THRESHOLD = 100000.0f;
namespace MillSim
{
@@ -76,21 +71,9 @@ MillPathSegment::MillPathSegment(EndMill* _endmill, MillMotion* from, MillMotion
mXYAngle = atan2f(mDiff[PY], mDiff[PX]);
endmill = _endmill;
mStartAngRad = mStepAngRad = 0;
// Check if this is an arc motion and whether it should be treated as curved
bool isArc = IsArcMotion(to);
bool treatAsCurved = false;
if (isArc) {
mRadius = sqrtf(to->j * to->j + to->i * to->i);
// Check if arc is essentially a straight line by comparing radius to chord length
// When radius >> chord length, floating-point precision issues occur in angle calculations
treatAsCurved = (mRadius <= mXYDistance * ARC_LINEARIZATION_THRESHOLD);
}
if (treatAsCurved) {
if (IsArcMotion(to)) {
mMotionType = MTCurved;
mRadius = sqrtf(to->j * to->j + to->i * to->i);
mSmallRad = mRadius <= endmill->radius;
if (mSmallRad) {