Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix collapse test in snap #7651

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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