Skip to content

Commit

Permalink
don't do collinear test for a triangle to be collapsed
Browse files Browse the repository at this point in the history
  • Loading branch information
sloriot committed Aug 17, 2023
1 parent d0b188b commit 5cc58a4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ void simplify_range(HalfedgeRange& halfedge_range,
{
const halfedge_descriptor prev_h = prev(h, tm);
const halfedge_descriptor next_h = next(h, tm);
const halfedge_descriptor prev_oh = prev(opposite(h, tm), tm);

// check that the border has at least 4 edges not to create degenerate volumes
if(border_size(h, tm) >= 4)
Expand All @@ -156,7 +157,7 @@ void simplify_range(HalfedgeRange& halfedge_range,
bool do_collapse = true;
for(halfedge_descriptor he : halfedges_around_target(h, tm))
{
if(he != h &&
if(he != prev_oh && // ignore the triangle incident to h that will disappear
!is_border(he, tm) &&
collinear(get(vpm, source(he, tm)), new_p, get(vpm, target(next(he,tm),tm))))
{
Expand Down

0 comments on commit 5cc58a4

Please sign in to comment.