Skip to content

feat(IspointInside): check if a point is inside a polygon#1240

Open
panquez wants to merge 11 commits intonextfrom
feat/insertion-in-meshed-brep
Open

feat(IspointInside): check if a point is inside a polygon#1240
panquez wants to merge 11 commits intonextfrom
feat/insertion-in-meshed-brep

Conversation

@panquez
Copy link
Copy Markdown
Member

@panquez panquez commented Mar 2, 2026

No description provided.

@panquez panquez requested a review from BotellaA March 2, 2026 16:28
Copy link
Copy Markdown
Member Author

@panquez panquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@panquez panquez requested a review from BenPinet March 2, 2026 16:30
@panquez panquez requested a review from BotellaA March 3, 2026 09:11
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

*
*/

#pragma once
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: avoid 'pragma once' directive; use include guards instead [portability-avoid-pragma-once]

#pragma once
^

#pragma once

#include <geode/geometry/common.hpp>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header common.hpp is not used directly [misc-include-cleaner]

Suggested change


namespace geode
{
FORWARD_DECLARATION_DIMENSION_CLASS( Point );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "FORWARD_DECLARATION_DIMENSION_CLASS" is directly included [misc-include-cleaner]

include/geode/geometry/is_point_inside.hpp:25:

- #include <geode/geometry/common.hpp>
+ #include "geode/basic/common.hpp"
+ #include <geode/geometry/common.hpp>

{
FORWARD_DECLARATION_DIMENSION_CLASS( Point );
FORWARD_DECLARATION_DIMENSION_CLASS( Polygon );
ALIAS_2D( Point );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "ALIAS_2D" is directly included [misc-include-cleaner]

    ALIAS_2D( Point );
    ^

* Find if point is inside a polygon.
* @param[in] point The point to rotate.
*/
[[nodiscard]] bool opengeode_geometry_api is_point_inside_polygon(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "opengeode_geometry_api" is directly included [misc-include-cleaner]

include/geode/geometry/is_point_inside.hpp:25:

- #include <geode/geometry/common.hpp>
+ #include "geode/geometry/opengeode_geometry_export.hpp"
+ #include <geode/geometry/common.hpp>

const geode::Point2D& p2 )
{
return ( p1.value( 0 ) - p0.value( 0 ) )
* ( p2.value( 1 ) - p0.value( 1 ) )
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]

Suggested change
* ( p2.value( 1 ) - p0.value( 1 ) )
return (( p1.value( 0 ) - p0.value( 0 ) )
* ( p2.value( 1 ) - p0.value( 1 ) ))

return ( p1.value( 0 ) - p0.value( 0 ) )
* ( p2.value( 1 ) - p0.value( 1 ) )
- ( p2.value( 0 ) - p0.value( 0 ) )
* ( p1.value( 1 ) - p0.value( 1 ) )
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]

Suggested change
* ( p1.value( 1 ) - p0.value( 1 ) )
- (( p2.value( 0 ) - p0.value( 0 ) )
* ( p1.value( 1 ) - p0.value( 1 ) ))


namespace geode
{
bool is_point_inside_polygon(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'is_point_inside_polygon' has cognitive complexity of 18 (threshold 10) [readability-function-cognitive-complexity]

    bool is_point_inside_polygon(
         ^
Additional context

src/geode/geometry/is_point_inside.cpp:49: +1, including nesting penalty of 0, nesting level increased to 1

        for( const auto polygon_vertex : geode::Range{ polygon.nb_vertices() } )
        ^

src/geode/geometry/is_point_inside.cpp:55: +2, including nesting penalty of 1, nesting level increased to 2

            if( v0.get().value( 1 ) <= point.value( 1 ) )
            ^

src/geode/geometry/is_point_inside.cpp:57: +3, including nesting penalty of 2, nesting level increased to 3

                if( v1.get().value( 1 ) > point.value( 1 ) )
                ^

src/geode/geometry/is_point_inside.cpp:59: +4, including nesting penalty of 3, nesting level increased to 4

                    if( is_left( v0, v1, point ) )
                    ^

src/geode/geometry/is_point_inside.cpp:65: +1, nesting level increased to 2

            else
            ^

src/geode/geometry/is_point_inside.cpp:67: +3, including nesting penalty of 2, nesting level increased to 3

                if( v1.get().value( 1 ) <= point.value( 1 ) )
                ^

src/geode/geometry/is_point_inside.cpp:69: +4, including nesting penalty of 3, nesting level increased to 4

                    if( !is_left( v0, v1, point ) )
                    ^

const auto& vertices = polygon.vertices();
for( const auto polygon_vertex : geode::Range{ polygon.nb_vertices() } )
{
const auto& v0 = vertices[polygon_vertex];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable name 'v0' is too short, expected at least 3 characters [readability-identifier-length]

            const auto& v0 = vertices[polygon_vertex];
                        ^

const auto& v0 = vertices[polygon_vertex];
const auto& next_polygon_vertex =
( polygon_vertex + 1 ) % vertices.size();
const auto& v1 = vertices[next_polygon_vertex];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable name 'v1' is too short, expected at least 3 characters [readability-identifier-length]

            const auto& v1 = vertices[next_polygon_vertex];
                        ^

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

std::optional< std::tuple< double,
geode::Point< dimension >,
geode::Point< dimension > > >
approximate_segment_segment_distance(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'approximate_segment_segment_distance' has cognitive complexity of 99 (threshold 10) [readability-function-cognitive-complexity]

        approximate_segment_segment_distance(
        ^
Additional context

src/geode/geometry/distance.cpp:502: +1, including nesting penalty of 0, nesting level increased to 1

        if( ac > bb )
        ^

src/geode/geometry/distance.cpp:504: +2, including nesting penalty of 1, nesting level increased to 2

            if( std::log2( std::abs( ac ) / std::abs( ac - bb ) ) > 20 )
            ^

src/geode/geometry/distance.cpp:511: +2, including nesting penalty of 1, nesting level increased to 2

            if( bte <= ctd ) // s <= 0
            ^

src/geode/geometry/distance.cpp:514: +3, including nesting penalty of 2, nesting level increased to 3

                if( e <= 0 ) // t <= 0
                ^

src/geode/geometry/distance.cpp:519: +4, including nesting penalty of 3, nesting level increased to 4

                    if( nd >= a )
                    ^

src/geode/geometry/distance.cpp:523: +1, nesting level increased to 4

                    else if( nd > 0 )
                         ^

src/geode/geometry/distance.cpp:529: +1, nesting level increased to 3

                else if( e < c ) // 0 < t < 1
                     ^

src/geode/geometry/distance.cpp:534: +1, nesting level increased to 3

                else // t >= 1
                ^

src/geode/geometry/distance.cpp:539: +4, including nesting penalty of 3, nesting level increased to 4

                    if( bmd >= a )
                    ^

src/geode/geometry/distance.cpp:543: +1, nesting level increased to 4

                    else if( bmd > 0 )
                         ^

src/geode/geometry/distance.cpp:550: +1, nesting level increased to 2

            else // s > 0
            ^

src/geode/geometry/distance.cpp:552: +3, including nesting penalty of 2, nesting level increased to 3

                if( std::log2( std::abs( bte ) / std::abs( bte - ctd ) ) > 20 )
                ^

src/geode/geometry/distance.cpp:557: +3, including nesting penalty of 2, nesting level increased to 3

                if( s >= det ) // s >= 1
                ^

src/geode/geometry/distance.cpp:562: +4, including nesting penalty of 3, nesting level increased to 4

                    if( bpe <= 0 ) // t <= 0
                    ^

src/geode/geometry/distance.cpp:567: +5, including nesting penalty of 4, nesting level increased to 5

                        if( nd <= 0 )
                        ^

src/geode/geometry/distance.cpp:571: +1, nesting level increased to 5

                        else if( nd < a )
                             ^

src/geode/geometry/distance.cpp:577: +1, nesting level increased to 4

                    else if( bpe < c ) // 0 < t < 1
                         ^

src/geode/geometry/distance.cpp:582: +1, nesting level increased to 4

                    else // t >= 1
                    ^

src/geode/geometry/distance.cpp:587: +5, including nesting penalty of 4, nesting level increased to 5

                        if( bmd <= 0 )
                        ^

src/geode/geometry/distance.cpp:591: +1, nesting level increased to 5

                        else if( bmd < a )
                             ^

src/geode/geometry/distance.cpp:598: +1, nesting level increased to 3

                else // 0 < s < 1
                ^

src/geode/geometry/distance.cpp:602: +4, including nesting penalty of 3, nesting level increased to 4

                    if( ate <= btd ) // t <= 0
                    ^

src/geode/geometry/distance.cpp:607: +5, including nesting penalty of 4, nesting level increased to 5

                        if( nd <= 0 )
                        ^

src/geode/geometry/distance.cpp:611: +1, nesting level increased to 5

                        else if( nd >= a )
                             ^

src/geode/geometry/distance.cpp:615: +1, nesting level increased to 5

                        else
                        ^

src/geode/geometry/distance.cpp:620: +1, nesting level increased to 4

                    else // t > 0
                    ^

src/geode/geometry/distance.cpp:622: +5, including nesting penalty of 4, nesting level increased to 5

                        if( std::log2( std::abs( ate ) / std::abs( ate - btd ) )
                        ^

src/geode/geometry/distance.cpp:628: +5, including nesting penalty of 4, nesting level increased to 5

                        if( t >= det ) // t >= 1
                        ^

src/geode/geometry/distance.cpp:633: +6, including nesting penalty of 5, nesting level increased to 6

                            if( bmd <= 0 )
                            ^

src/geode/geometry/distance.cpp:637: +1, nesting level increased to 6

                            else if( bmd >= a )
                                 ^

src/geode/geometry/distance.cpp:641: +1, nesting level increased to 6

                            else
                            ^

src/geode/geometry/distance.cpp:646: +1, nesting level increased to 5

                        else // 0 < t < 1
                        ^

src/geode/geometry/distance.cpp:656: +1, nesting level increased to 1

        else
        ^

src/geode/geometry/distance.cpp:676: +2, including nesting penalty of 1, nesting level increased to 2

            if( e <= 0 ) // t <= 0
            ^

src/geode/geometry/distance.cpp:681: +3, including nesting penalty of 2, nesting level increased to 3

                if( nd <= 0 ) // s <= 0
                ^

src/geode/geometry/distance.cpp:686: +1, nesting level increased to 3

                else if( nd >= a ) // s >= 1
                     ^

src/geode/geometry/distance.cpp:691: +1, nesting level increased to 3

                else // 0 < s < 1
                ^

src/geode/geometry/distance.cpp:697: +1, nesting level increased to 2

            else if( e >= c ) // t >= 1
                 ^

src/geode/geometry/distance.cpp:702: +3, including nesting penalty of 2, nesting level increased to 3

                if( bmd <= 0 ) // s <= 0
                ^

src/geode/geometry/distance.cpp:707: +1, nesting level increased to 3

                else if( bmd >= a ) // s >= 1
                     ^

src/geode/geometry/distance.cpp:712: +1, nesting level increased to 3

                else // 0 < s < 1
                ^

src/geode/geometry/distance.cpp:718: +1, nesting level increased to 2

            else // 0 < t < 1
            ^

src/geode/geometry/distance.cpp:733: +1, including nesting penalty of 0, nesting level increased to 1

        if( distance < geode::GLOBAL_EPSILON )
        ^

src/geode/geometry/distance.cpp:740: +1, including nesting penalty of 0, nesting level increased to 1

        if( distance_to_closest0 < geode::GLOBAL_EPSILON )
        ^

src/geode/geometry/distance.cpp:747: +1, including nesting penalty of 0, nesting level increased to 1

        if( distance_to_closest1 < geode::GLOBAL_EPSILON )
        ^

src/geode/geometry/distance.cpp:753: +1, including nesting penalty of 0, nesting level increased to 1

        if( distance_to_closest0 < distance )
        ^

src/geode/geometry/distance.cpp:755: +2, including nesting penalty of 1, nesting level increased to 2

            if( distance_to_closest1 < distance_to_closest0 )
            ^

src/geode/geometry/distance.cpp:764: +1, including nesting penalty of 0, nesting level increased to 1

        if( distance_to_closest1 < distance )
        ^

@BotellaA
Copy link
Copy Markdown
Member

BotellaA commented Mar 6, 2026

🎉 This PR is included in version 16.1.1-rc.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 12, 2026

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v20.1.8) reports: 15 concern(s)
  • include/geode/mesh/helpers/repair_polygon_orientations.hpp:43:15: error: [clang-diagnostic-error]

    no template named 'Span' in namespace 'absl'

       43 |         absl::Span< const index_t > polygons_to_reorient );
          |         ~~~~~~^
  • src/geode/geometry/is_point_inside.cpp:31:41: warning: [readability-identifier-length]

    parameter name 'p0' is too short, expected at least 3 characters

       31 |     bool is_left( const geode::Point2D& p0,
          |                                         ^
  • src/geode/geometry/is_point_inside.cpp:32:31: warning: [readability-identifier-length]

    parameter name 'p1' is too short, expected at least 3 characters

       32 |         const geode::Point2D& p1,
          |                               ^
  • src/geode/geometry/is_point_inside.cpp:33:31: warning: [readability-identifier-length]

    parameter name 'p2' is too short, expected at least 3 characters

       33 |         const geode::Point2D& p2 )
          |                               ^
  • src/geode/geometry/is_point_inside.cpp:45:10: warning: [readability-function-cognitive-complexity]

    function 'is_point_inside_polygon' has cognitive complexity of 18 (threshold 10)

       45 |     bool is_point_inside_polygon(
          |          ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/is_point_inside.cpp:50:9: note: +1, including nesting penalty of 0, nesting level increased to 1
       50 |         for( const auto polygon_vertex : geode::Range{ polygon.nb_vertices() } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/is_point_inside.cpp:56:13: note: +2, including nesting penalty of 1, nesting level increased to 2
       56 |             if( v0.get().value( 1 ) <= point.value( 1 ) )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/is_point_inside.cpp:58:17: note: +3, including nesting penalty of 2, nesting level increased to 3
       58 |                 if( v1.get().value( 1 ) > point.value( 1 ) )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/is_point_inside.cpp:60:21: note: +4, including nesting penalty of 3, nesting level increased to 4
       60 |                     if( is_left( v0, v1, point ) )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/is_point_inside.cpp:66:13: note: +1, nesting level increased to 2
       66 |             else
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/is_point_inside.cpp:68:17: note: +3, including nesting penalty of 2, nesting level increased to 3
       68 |                 if( v1.get().value( 1 ) <= point.value( 1 ) )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/is_point_inside.cpp:70:21: note: +4, including nesting penalty of 3, nesting level increased to 4
       70 |                     if( !is_left( v0, v1, point ) )
          |                     ^
  • src/geode/geometry/is_point_inside.cpp:52:25: warning: [readability-identifier-length]

    variable name 'v0' is too short, expected at least 3 characters

       52 |             const auto& v0 = vertices[polygon_vertex];
          |                         ^
  • src/geode/geometry/is_point_inside.cpp:55:25: warning: [readability-identifier-length]

    variable name 'v1' is too short, expected at least 3 characters

       55 |             const auto& v1 = vertices[next_polygon_vertex];
          |                         ^
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:48:9: warning: [google-explicit-constructor]

    single-argument constructors must be marked explicit to avoid unintentional implicit conversions

       48 |         PolygonOrientationChecker( const geode::SurfaceMesh< dimension >& mesh )
          |         ^
          |         explicit 
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:84:14: warning: [readability-function-cognitive-complexity]

    function 'process_polygon_queue' has cognitive complexity of 20 (threshold 10)

       84 |         void process_polygon_queue( absl::FixedArray< bool >& visited )
          |              ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:86:13: note: +1, including nesting penalty of 0, nesting level increased to 1
       86 |             while( !queue_.empty() )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:93:17: note: +2, including nesting penalty of 1, nesting level increased to 2
       93 |                 for( const auto e : geode::LIndices{ vertices } )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:97:21: note: +3, including nesting penalty of 2, nesting level increased to 3
       97 |                     if( !adj )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:101:66: note: +3, including nesting penalty of 2, nesting level increased to 3
      101 |                     const auto e_next = e == vertices.size() - 1 ? 0 : e + 1;
          |                                                                  ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:106:29: note: +1
      106 |                             && vertices[e_next] == adj_vertices[0] );
          |                             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:107:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      107 |                     if( visited[adj->polygon_id] )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:111:33: note: +4, including nesting penalty of 3, nesting level increased to 4
      111 |                                 ? cur_polygon_reorient
          |                                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:125:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      125 |                     if( reorient_polygon_[adj_polygon] )
          |                     ^
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:134:9: warning: [modernize-use-nodiscard]

    function 'get_bad_oriented_polygons' should be marked [[nodiscard]]

      134 |         absl::FixedArray< geode::index_t > get_bad_oriented_polygons() const
          |         ^
          |         [[nodiscard]] 
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:155:12: warning: [readability-identifier-naming]

    invalid case style for struct 'polygons_area_sign_info'

      155 |     struct polygons_area_sign_info
          |            ^~~~~~~~~~~~~~~~~~~~~~~
          |            PolygonsAreaSignInfo
      156 |     {
      157 |         polygons_area_sign_info( geode::index_t nb_init,
          |         ~~~~~~~~~~~~~~~~~~~~~~~
          |         PolygonsAreaSignInfo
      158 |             geode::index_t nb_polygons,
      159 |             geode::Sign sign_init )
      160 |             : nb_bad_polygons{ nb_init }, area_sign{ nb_polygons, sign_init }
      161 |         {
      162 |         }
      163 | 
      164 |         geode::index_t nb_bad_polygons;
      165 |         std::queue< geode::index_t > queue;
      166 |         absl::FixedArray< geode::Sign > area_sign;
      167 |     };
      168 | 
      169 |     polygons_area_sign_info compute_polygon_area_sign(
          |     ~~~~~~~~~~~~~~~~~~~~~~~
          |     PolygonsAreaSignInfo
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:157:34: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'polygons_area_sign_info' of similar type ('geode::index_t') are easily swapped by mistake

      157 |         polygons_area_sign_info( geode::index_t nb_init,
          |                                  ^~~~~~~~~~~~~~~~~~~~~~~
      158 |             geode::index_t nb_polygons,
          |             ~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:157:49: note: the first parameter in the range is 'nb_init'
      157 |         polygons_area_sign_info( geode::index_t nb_init,
          |                                                 ^~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:158:28: note: the last parameter in the range is 'nb_polygons'
      158 |             geode::index_t nb_polygons,
          |                            ^~~~~~~~~~~
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:193:10: warning: [readability-function-cognitive-complexity]

    function 'process_null_area_polygons' has cognitive complexity of 20 (threshold 10)

      193 |     void process_null_area_polygons( const geode::SurfaceMesh2D& mesh,
          |          ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:196:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      196 |         while( !area_sign_info.queue.empty() )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:200:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      200 |             for( const auto e :
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:204:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      204 |                 if( mesh.is_edge_on_border( edge ) )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:209:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      209 |                 if( area_sign_info.area_sign[adj.polygon_id]
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:218:25: note: +1
      218 |                         && vertices[1] == adj_vertices[0] );
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:219:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      219 |                 if( same_orientation )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:225:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      225 |                 if( area_sign_info.area_sign[adj.polygon_id]
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:231:17: note: +1, nesting level increased to 3
      231 |                 else
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:238:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      238 |             if( area_sign_info.area_sign[cur_polygon] == geode::Sign::zero )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:242:18: note: +1, nesting level increased to 2
      242 |             else if( area_sign_info.area_sign[cur_polygon]
          |                  ^
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:283:10: warning: [readability-function-cognitive-complexity]

    function 'reorient_bad_polygons' has cognitive complexity of 11 (threshold 10)

      283 |     void reorient_bad_polygons( geode::SurfaceMeshBuilder< dimension >& builder,
          |          ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:287:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      287 |         for( const auto p : bad_polygons )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:293:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      293 |             for( const auto v : geode::LRange{ mesh.nb_polygon_vertices( p ) } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:300:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      300 |             for( const auto v : geode::LRange{ mesh.nb_polygon_vertices( p ) } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:305:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      305 |             for( const auto v : geode::LRange{ mesh.nb_polygon_vertices( p ) } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:310:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      310 |                 if( adjacents[v] )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:315:17: note: +1, nesting level increased to 3
      315 |                 else
          |                 ^
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:342:10: warning: [misc-use-internal-linkage]

    function 'repair_polygons_orientations' can be made static or moved into an anonymous namespace to enforce internal linkage

      342 |     void repair_polygons_orientations( const SurfaceMesh< dimension >& mesh,
          |          ^
          |     static 

Have any feedback or feature suggestions? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants