mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 01:37:53 -06:00
Bugfix: custom seam did not work for triangles that were exactly vertical
The projection algorithm was originally made for custom supports, so vertical triangles were not interesting. They are for seam. Instead of rewriting the algorithm and risking more bugs, the edge case is detected and the triangle is tilted slightly.
This commit is contained in:
parent
bd2cbea202
commit
1904b7b904
2 changed files with 32 additions and 26 deletions
|
@ -2845,6 +2845,11 @@ void PrintObject::project_and_append_custom_facets(
|
|||
if (! seam && tr_det_sign * z_comp > 0.)
|
||||
continue;
|
||||
|
||||
// The algorithm does not process vertical triangles, but it should for seam.
|
||||
// In that case, tilt the triangle a bit so the projection does not degenerate.
|
||||
if (seam && z_comp == 0.f)
|
||||
facet[0].x() += float(EPSILON);
|
||||
|
||||
// Sort the three vertices according to z-coordinate.
|
||||
std::sort(facet.begin(), facet.end(),
|
||||
[](const Vec3f& pt1, const Vec3f&pt2) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue