Skip to content

Commit aedc4e4

Browse files
committed
fix(NegativeElements): Updated code with polygon_area_sign from OpenGeode.
1 parent ef1a9b4 commit aedc4e4

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/geode/inspector/criterion/negative_elements/surface_negative_elements.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,8 @@ namespace geode
7171
private:
7272
bool polygon_has_negative_area( index_t polygon_id ) const
7373
{
74-
if( mesh_.nb_polygon_vertices( polygon_id ) == 4 )
75-
{
76-
Triangle< dimension > triangle{
77-
mesh_.point( mesh_.polygon_vertex( { polygon_id, 0 } ) ),
78-
mesh_.point( mesh_.polygon_vertex( { polygon_id, 1 } ) ),
79-
mesh_.point( mesh_.polygon_vertex( { polygon_id, 2 } ) )
80-
};
81-
return triangle_area_sign( triangle ) == Sign::negative;
82-
}
83-
return mesh_.polygon_area( polygon_id ) < 0;
74+
return polygon_area_sign( mesh_.polygon( polygon_id ) )
75+
== Sign::negative;
8476
}
8577

8678
private:

0 commit comments

Comments
 (0)