Skip to content

Commit

Permalink
Prevent divide by zero issues
Browse files Browse the repository at this point in the history
  • Loading branch information
casperlamboo committed Jan 4, 2024
1 parent 3718ac9 commit 8890374
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/utils/ExtrusionLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,12 @@ struct ExtrusionLine
const auto dir = j2.p_ - j1.p_;
const auto normal = turn90CCW(dir);
const auto mag = vSize(normal);

if (mag <= 5)
{
continue;
}

poly.emplace_back(j1.p_ + normal * j1.w_ / mag);
poly.emplace_back(j2.p_ + normal * j2.w_ / mag);
}
Expand Down

0 comments on commit 8890374

Please sign in to comment.