Skip to content

Commit 68080b8

Browse files
Merge pull request #140 from Geode-solutions/fix/update_polygon_sign_info
fix(NegativeElements): Updated code with polygon_area_sign from OpenG…
2 parents ef1a9b4 + 11a6a2f commit 68080b8

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <geode/basic/pimpl_impl.hpp>
2828
#include <geode/basic/uuid.hpp>
2929

30+
#include <geode/geometry/basic_objects/polygon.hpp>
3031
#include <geode/geometry/basic_objects/triangle.hpp>
3132
#include <geode/geometry/information.hpp>
3233
#include <geode/geometry/sign.hpp>
@@ -71,16 +72,8 @@ namespace geode
7172
private:
7273
bool polygon_has_negative_area( index_t polygon_id ) const
7374
{
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;
75+
return polygon_area_sign( mesh_.polygon( polygon_id ) )
76+
== Sign::negative;
8477
}
8578

8679
private:

0 commit comments

Comments
 (0)