Skip to content

fix(Segment): make segment.direction() return normalized direction - #1321

Merged
BotellaA merged 5 commits into
v18from
fix/remove_segment_normalized_direction
Aug 14, 2026
Merged

fix(Segment): make segment.direction() return normalized direction#1321
BotellaA merged 5 commits into
v18from
fix/remove_segment_normalized_direction

Conversation

@BenPinet

Copy link
Copy Markdown
Member

No description provided.

@BenPinet
BenPinet requested a review from panquez August 14, 2026 08:34
@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v21.1.8) reports: 430 concern(s)
  • include/geode/geometry/basic_objects/segment.hpp:42:11: warning: [cppcoreguidelines-special-member-functions]

    class 'GenericSegment' defines a copy constructor, a copy assignment operator, a move constructor and a move assignment operator but does not define a destructor

       42 |     class GenericSegment
          |           ^
  • include/geode/geometry/basic_objects/segment.hpp:72:11: warning: [cppcoreguidelines-special-member-functions]

    class 'OwnerSegment' defines a copy constructor, a copy assignment operator, a move constructor and a move assignment operator but does not define a destructor

       72 |     class OwnerSegment : public GenericSegment< Point< dimension >, dimension >
          |           ^
  • include/geode/geometry/basic_objects/segment.hpp:90:11: warning: [cppcoreguidelines-special-member-functions]

    class 'Segment' defines a copy constructor, a copy assignment operator, a move constructor and a move assignment operator but does not define a destructor

       90 |     class Segment : public GenericSegment< RefPoint< dimension >, dimension >
          |           ^
  • include/geode/geometry/basic_objects/segment.hpp:99:9: warning: [google-explicit-constructor]

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

       99 |         Segment( const OwnerSegment< dimension >& other ) noexcept;
          |         ^
          |         explicit 
  • src/geode/geometry/barycentric_coordinates.cpp:38:24: warning: [readability-identifier-length]

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

       38 |         const Vector3D v0{ vertices[0], vertices[1] };
          |                        ^
  • src/geode/geometry/barycentric_coordinates.cpp:39:24: warning: [readability-identifier-length]

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

       39 |         const Vector3D v1{ vertices[0], vertices[2] };
          |                        ^
  • src/geode/geometry/barycentric_coordinates.cpp:40:24: warning: [readability-identifier-length]

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

       40 |         const Vector3D v2{ vertices[0], vertices[3] };
          |                        ^
  • src/geode/geometry/barycentric_coordinates.cpp:41:24: warning: [readability-identifier-length]

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

       41 |         const Vector3D v3{ vertices[0], point };
          |                        ^
  • src/geode/geometry/barycentric_coordinates.cpp:42:20: warning: [readability-identifier-length]

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

       42 |         const auto a = v0.dot( v3 );
          |                    ^
  • src/geode/geometry/barycentric_coordinates.cpp:43:20: warning: [readability-identifier-length]

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

       43 |         const auto b = v0.dot( v0 );
          |                    ^
  • src/geode/geometry/barycentric_coordinates.cpp:44:20: warning: [readability-identifier-length]

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

       44 |         const auto c = v0.dot( v1 );
          |                    ^
  • src/geode/geometry/barycentric_coordinates.cpp:48:20: warning: [readability-identifier-length]

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

       48 |         const auto g = v1.dot( v2 );
          |                    ^
  • src/geode/geometry/barycentric_coordinates.cpp:49:20: warning: [readability-identifier-length]

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

       49 |         const auto h = v2.dot( v3 );
          |                    ^
  • src/geode/geometry/barycentric_coordinates.cpp:52:13: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations

       52 |             2 * c * d * g - b * g * g + i * b * f - i * c * c - d * d * f;
          |             ^~~~~~~~~~~~~
          |             (            )
  • src/geode/geometry/barycentric_coordinates.cpp:52:29: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations

       52 |             2 * c * d * g - b * g * g + i * b * f - i * c * c - d * d * f;
          |                             ^~~~~~~~~
          |                             (        )
  • src/geode/geometry/barycentric_coordinates.cpp:52:41: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations

       52 |             2 * c * d * g - b * g * g + i * b * f - i * c * c - d * d * f;
          |                                         ^~~~~~~~~
          |                                         (        )
  • src/geode/geometry/barycentric_coordinates.cpp:52:53: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations

       52 |             2 * c * d * g - b * g * g + i * b * f - i * c * c - d * d * f;
          |                                                     ^~~~~~~~~
          |                                                     (        )
  • src/geode/geometry/barycentric_coordinates.cpp:52:65: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations

       52 |             2 * c * d * g - b * g * g + i * b * f - i * c * c - d * d * f;
          |                                                                 ^~~~~~~~~~
          |                                                                 (        )
  • src/geode/geometry/barycentric_coordinates.cpp:56:28: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations

       56 |         const auto dg_ci = d * g - c * i;
          |                            ^~~~~
          |                            (    )
  • src/geode/geometry/barycentric_coordinates.cpp:56:36: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations

       56 |         const auto dg_ci = d * g - c * i;
          |                                    ^~~~~~
          |                                    (    )
  • src/geode/geometry/barycentric_coordinates.cpp:57:28: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations

       57 |         const auto cg_df = c * g - d * f;
          |                            ^~~~~
          |                            (    )
  • src/geode/geometry/barycentric_coordinates.cpp:57:36: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations

       57 |         const auto cg_df = c * g - d * f;
          |                                    ^~~~~~
          |                                    (    )
  • src/geode/geometry/barycentric_coordinates.cpp:58:28: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations

       58 |         const auto cd_bg = c * d - b * g;
          |                            ^~~~~
          |                            (    )
  • src/geode/geometry/barycentric_coordinates.cpp:58:36: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations

       58 |         const auto cd_bg = c * d - b * g;
          |                                    ^~~~~~
          |                                    (    )
  • src/geode/geometry/barycentric_coordinates.cpp:69:29: warning: [readability-function-cognitive-complexity]

    function 'safe_tetrahedron_barycentric_coordinates' has cognitive complexity of 21 (threshold 10)

       69 |     std::array< double, 4 > safe_tetrahedron_barycentric_coordinates(
          |                             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/barycentric_coordinates.cpp:76:9: note: +1, including nesting penalty of 0, nesting level increased to 1
       76 |         catch( const OpenGeodeException& )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/barycentric_coordinates.cpp:82:13: note: +2, including nesting penalty of 1, nesting level increased to 2
       82 |             for( const auto f : LRange{ 4 } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/barycentric_coordinates.cpp:84:40: note: +3, including nesting penalty of 2, nesting level increased to 3
       84 |                 const auto v0 = f == 3 ? 0 : f + 1;
          |                                        ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/barycentric_coordinates.cpp:85:41: note: +3, including nesting penalty of 2, nesting level increased to 3
       85 |                 const auto v1 = v0 == 3 ? 0 : v0 + 1;
          |                                         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/barycentric_coordinates.cpp:86:41: note: +3, including nesting penalty of 2, nesting level increased to 3
       86 |                 const auto v2 = v1 == 3 ? 0 : v1 + 1;
          |                                         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/barycentric_coordinates.cpp:89:17: note: +3, including nesting penalty of 2, nesting level increased to 3
       89 |                 if( area >= best_area )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/barycentric_coordinates.cpp:100:40: note: +2, including nesting penalty of 1, nesting level increased to 2
      100 |             const auto v0 = facet == 3 ? 0 : facet + 1;
          |                                        ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/barycentric_coordinates.cpp:101:37: note: +2, including nesting penalty of 1, nesting level increased to 2
      101 |             const auto v1 = v0 == 3 ? 0 : v0 + 1;
          |                                     ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/barycentric_coordinates.cpp:102:37: note: +2, including nesting penalty of 1, nesting level increased to 2
      102 |             const auto v2 = v1 == 3 ? 0 : v1 + 1;
          |                                     ^
  • src/geode/geometry/barycentric_coordinates.cpp:84:28: warning: [readability-identifier-length]

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

       84 |                 const auto v0 = f == 3 ? 0 : f + 1;
          |                            ^
  • src/geode/geometry/barycentric_coordinates.cpp:85:28: warning: [readability-identifier-length]

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

       85 |                 const auto v1 = v0 == 3 ? 0 : v0 + 1;
          |                            ^
  • src/geode/geometry/barycentric_coordinates.cpp:86:28: warning: [readability-identifier-length]

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

       86 |                 const auto v2 = v1 == 3 ? 0 : v1 + 1;
          |                            ^
  • src/geode/geometry/barycentric_coordinates.cpp:96:13: warning: [cppcoreguidelines-pro-type-member-init]

    uninitialized record type: 'lambdas'

       96 |             std::array< double, 4 > lambdas;
          |             ^                              
          |                                            {}
  • src/geode/geometry/barycentric_coordinates.cpp:100:24: warning: [readability-identifier-length]

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

      100 |             const auto v0 = facet == 3 ? 0 : facet + 1;
          |                        ^
  • src/geode/geometry/barycentric_coordinates.cpp:101:24: warning: [readability-identifier-length]

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

      101 |             const auto v1 = v0 == 3 ? 0 : v0 + 1;
          |                        ^
  • src/geode/geometry/barycentric_coordinates.cpp:102:24: warning: [readability-identifier-length]

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

      102 |             const auto v2 = v1 == 3 ? 0 : v1 + 1;
          |                        ^
  • src/geode/geometry/barycentric_coordinates.cpp:115:35: warning: [readability-identifier-length]

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

      115 |         const Vector< dimension > v0{ vertices[0], vertices[1] };
          |                                   ^
  • src/geode/geometry/barycentric_coordinates.cpp:116:35: warning: [readability-identifier-length]

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

      116 |         const Vector< dimension > v1{ vertices[0], vertices[2] };
          |                                   ^
  • src/geode/geometry/barycentric_coordinates.cpp:117:35: warning: [readability-identifier-length]

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

      117 |         const Vector< dimension > v2{ vertices[0], point };
          |                                   ^
  • src/geode/geometry/barycentric_coordinates.cpp:123:28: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations

      123 |         const auto denom = d00 * d11 - d01 * d01;
          |                            ^~~~~~~~~
          |                            (        )
  • src/geode/geometry/barycentric_coordinates.cpp:123:40: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations

      123 |         const auto denom = d00 * d11 - d01 * d01;
          |                                        ^~~~~~~~~~
          |                                        (        )
  • src/geode/geometry/barycentric_coordinates.cpp:134:29: warning: [readability-function-cognitive-complexity]

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

      134 |     std::array< double, 3 > safe_triangle_barycentric_coordinates(
          |                             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/barycentric_coordinates.cpp:142:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      142 |         catch( const OpenGeodeException& )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/barycentric_coordinates.cpp:148:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      148 |             for( const auto e : LRange{ 3 } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/barycentric_coordinates.cpp:151:37: note: +3, including nesting penalty of 2, nesting level increased to 3
      151 |                     vertices[e == 2 ? 0 : e + 1] };
          |                                     ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/barycentric_coordinates.cpp:153:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      153 |                 if( length >= best_length )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/barycentric_coordinates.cpp:165:31: note: +2, including nesting penalty of 1, nesting level increased to 2
      165 |             lambdas[edge == 2 ? 0 : edge + 1] = segment_lambdas[1];
          |                               ^
  • src/geode/geometry/barycentric_coordinates.cpp:160:13: warning: [cppcoreguidelines-pro-type-member-init]

    uninitialized record type: 'lambdas'

      160 |             std::array< double, 3 > lambdas;
          |             ^                              
          |                                            {}
  • src/geode/geometry/basic_objects/segment.cpp:72:38: warning: [cppcoreguidelines-avoid-magic-numbers]

    1. is a magic number; consider replacing it with a named constant
       72 |         return ( point0 + point1 ) / 2.;
          |                                      ^
  • src/geode/geometry/bounding_box.cpp:100:19: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations

      100 |                 + segment_extent * std::fabs( segment_direction.value( i ) );
          |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                   (                                                         )
  • src/geode/geometry/bounding_box.cpp:130:24: warning: [readability-identifier-length]

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

      130 |             const auto ii = i == 2 ? 0 : i + 1;
          |                        ^
  • src/geode/geometry/bounding_box.cpp:155:26: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations

      155 |         const auto rhs = box_half_extent.value( 0 )
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
          |                          (
      156 |                              * std::fabs( line.direction().value( 1 ) )
          |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                                                                        )
  • src/geode/geometry/bounding_box.cpp:157:28: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations

      157 |                          + box_half_extent.value( 1 )
          |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
          |                            (
      158 |                                * std::fabs( line.direction().value( 0 ) );
          |                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                                                                          )
  • src/geode/geometry/bounding_box.cpp:238:9: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'BoundingBox' of similar type ('Point') are easily swapped by mistake

      238 |         Point< dimension > min, Point< dimension > max )
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:238:28: note: the first parameter in the range is 'min'
      238 |         Point< dimension > min, Point< dimension > max )
          |                            ^~~
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:238:52: note: the last parameter in the range is 'max'
      238 |         Point< dimension > min, Point< dimension > max )
          |                                                    ^~~
  • src/geode/geometry/bounding_box.cpp:466:51: warning: [readability-function-cognitive-complexity]

    function 'intersects<3U>' has cognitive complexity of 14 (threshold 10)

      466 |     bool opengeode_geometry_api BoundingBox< 3 >::intersects< 3 >(
          |                                                   ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:470:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      470 |         for( const auto v : LRange{ 3 } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:472:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      472 |             if( contains( vertices[v].get() ) )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:477:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      477 |         if( !intersects( triangle.bounding_box() ) )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:490:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      490 |         if( !bbox_1d_projection( *this, triangle_normal )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:498:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      498 |         for( const auto i : LRange{ 3 } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:509:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      509 |             if( !triangle_interval.intersects( box_interval ) )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:516:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      516 |         for( const auto i0 : LRange{ 3 } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:518:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      518 |             for( const auto i1 : LRange{ 3 } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:526:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      526 |                 if( !triangle_interval.intersects( box_interval ) )
          |                 ^
  • src/geode/geometry/bounding_box.cpp:516:25: warning: [readability-identifier-length]

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

      516 |         for( const auto i0 : LRange{ 3 } )
          |                         ^
  • src/geode/geometry/bounding_box.cpp:518:29: warning: [readability-identifier-length]

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

      518 |             for( const auto i1 : LRange{ 3 } )
          |                             ^
  • src/geode/geometry/bounding_box.cpp:537:51: warning: [readability-function-cognitive-complexity]

    function 'epsilon_intersects<3U>' has cognitive complexity of 14 (threshold 10)

      537 |     bool opengeode_geometry_api BoundingBox< 3 >::epsilon_intersects< 3 >(
          |                                                   ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:541:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      541 |         for( const auto v : LRange{ 3 } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:543:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      543 |             if( epsilon_contains( vertices[v].get() ) )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:548:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      548 |         if( !epsilon_intersects( triangle.bounding_box() ) )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:561:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      561 |         if( !bbox_1d_projection( *this, triangle_normal )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:569:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      569 |         for( const auto i : LRange{ 3 } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:580:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      580 |             if( !triangle_interval.epsilon_intersects( box_interval ) )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:587:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      587 |         for( const auto i0 : LRange{ 3 } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:589:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      589 |             for( const auto i1 : LRange{ 3 } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/bounding_box.cpp:597:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      597 |                 if( !triangle_interval.epsilon_intersects( box_interval ) )
          |                 ^
  • src/geode/geometry/bounding_box.cpp:587:25: warning: [readability-identifier-length]

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

      587 |         for( const auto i0 : LRange{ 3 } )
          |                         ^
  • src/geode/geometry/bounding_box.cpp:589:29: warning: [readability-identifier-length]

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

      589 |             for( const auto i1 : LRange{ 3 } )
          |                             ^
  • src/geode/geometry/bounding_box.cpp:713:34: warning: [cppcoreguidelines-avoid-magic-numbers]

    1. is a magic number; consider replacing it with a named constant
      713 |         return ( min_ + max_ ) / 2.;
          |                                  ^
  • src/geode/geometry/bounding_box.cpp:750:25: warning: [readability-identifier-length]

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

      750 |         for( const auto c : LRange{ dimension } )
          |                         ^
  • src/geode/geometry/bounding_box.cpp:768:20: warning: [readability-identifier-naming]

    invalid case style for variable 'Pmin'

      768 |         const auto Pmin = point - min_;
          |                    ^~~~
          |                    pmin
      769 |         const auto Pmax = point - max_;
      770 |         auto inner_distance = std::numeric_limits< double >::max();
      771 |         for( const auto c : LRange{ dimension } )
      772 |         {
      773 |             const auto local_distance = std::min(
      774 |                 std::fabs( Pmin.value( c ) ), std::fabs( Pmax.value( c ) ) );
          |                            ~~~~
          |                            pmin
  • src/geode/geometry/bounding_box.cpp:769:20: warning: [readability-identifier-naming]

    invalid case style for variable 'Pmax'

      769 |         const auto Pmax = point - max_;
          |                    ^~~~
          |                    pmax
      770 |         auto inner_distance = std::numeric_limits< double >::max();
      771 |         for( const auto c : LRange{ dimension } )
      772 |         {
      773 |             const auto local_distance = std::min(
      774 |                 std::fabs( Pmin.value( c ) ), std::fabs( Pmax.value( c ) ) );
          |                                                          ~~~~
          |                                                          pmax
  • src/geode/geometry/bounding_box.cpp:771:25: warning: [readability-identifier-length]

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

      771 |         for( const auto c : LRange{ dimension } )
          |                         ^
  • src/geode/geometry/bounding_box.cpp:785:25: warning: [readability-identifier-length]

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

      785 |         for( const auto c : LRange{ dimension } )
          |                         ^
  • src/geode/geometry/distance.cpp:91:9: warning: [readability-use-std-min-max]

    use std::max instead of <=

       24 |         if( area2 <= 0 )
          |         ^~~~~~~~~~~~~~~~
          |         area2 = std::max<double>(area2, 0);
       25 |         {
          |         ~
       26 |             area2 = 0;
          |             ~~~~~~~~~~
       27 |         }
          |         ~
  • src/geode/geometry/distance.cpp:98:45: warning: [readability-identifier-length]

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

       98 |     void get_min_edge02( double a11, double b1, std::array< double, 2 >& p )
          |                                             ^
  • src/geode/geometry/distance.cpp:98:74: warning: [readability-identifier-length]

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

       98 |     void get_min_edge02( double a11, double b1, std::array< double, 2 >& p )
          |                                                                          ^
  • src/geode/geometry/distance.cpp:115:10: warning: [readability-function-size]

    function 'get_min_edge12' exceeds recommended size/complexity thresholds

      115 |     void get_min_edge12( double a01,
          |          ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:115:10: note: 6 parameters (threshold 4)
  • src/geode/geometry/distance.cpp:115:26: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'get_min_edge12' of similar type ('double') are easily swapped by mistake

      115 |     void get_min_edge12( double a01,
          |                          ^~~~~~~~~~~
      116 |         double a11,
          |         ~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:115:33: note: the first parameter in the range is 'a01'
      115 |     void get_min_edge12( double a01,
          |                                 ^~~
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:116:16: note: the last parameter in the range is 'a11'
      116 |         double a11,
          |                ^~~
  • src/geode/geometry/distance.cpp:117:16: warning: [readability-identifier-length]

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

      117 |         double b1,
          |                ^
  • src/geode/geometry/distance.cpp:118:9: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'get_min_edge12' of similar type ('double') are easily swapped by mistake

      118 |         double f10,
          |         ^~~~~~~~~~~
      119 |         double f01,
          |         ~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:118:16: note: the first parameter in the range is 'f10'
      118 |         double f10,
          |                ^~~
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:119:16: note: the last parameter in the range is 'f01'
      119 |         double f01,
          |                ^~~
  • src/geode/geometry/distance.cpp:120:34: warning: [readability-identifier-length]

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

      120 |         std::array< double, 2 >& p )
          |                                  ^
  • src/geode/geometry/distance.cpp:122:20: warning: [readability-identifier-length]

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

      122 |         const auto h0 = a01 + b1 - f10;
          |                    ^
  • src/geode/geometry/distance.cpp:129:24: warning: [readability-identifier-length]

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

      129 |             const auto h1 = a11 + b1 - f01;
          |                        ^
  • src/geode/geometry/distance.cpp:142:10: warning: [readability-function-size]

    function 'get_min_interior' exceeds recommended size/complexity thresholds

      142 |     void get_min_interior( const std::array< double, 2 >& p0,
          |          ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:142:10: note: 5 parameters (threshold 4)
  • src/geode/geometry/distance.cpp:142:59: warning: [readability-identifier-length]

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

      142 |     void get_min_interior( const std::array< double, 2 >& p0,
          |                                                           ^
  • src/geode/geometry/distance.cpp:143:16: warning: [readability-identifier-length]

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

      143 |         double h0,
          |                ^
  • src/geode/geometry/distance.cpp:144:40: warning: [readability-identifier-length]

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

      144 |         const std::array< double, 2 >& p1,
          |                                        ^
  • src/geode/geometry/distance.cpp:145:16: warning: [readability-identifier-length]

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

      145 |         double h1,
          |                ^
  • src/geode/geometry/distance.cpp:146:34: warning: [readability-identifier-length]

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

      146 |         std::array< double, 2 >& p )
          |                                  ^
  • src/geode/geometry/distance.cpp:150:16: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations

      150 |         p[0] = omz * p0[0] + z * p1[0];
          |                ^~~~~~~~~~~
          |                (          )
  • src/geode/geometry/distance.cpp:150:30: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations

      150 |         p[0] = omz * p0[0] + z * p1[0];
          |                              ^~~~~~~~~~
          |                              (        )
  • src/geode/geometry/distance.cpp:151:16: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations

      151 |         p[1] = omz * p0[1] + z * p1[1];
          |                ^~~~~~~~~~~
          |                (          )
  • src/geode/geometry/distance.cpp:151:30: warning: [readability-math-missing-parentheses]

    '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations

      151 |         p[1] = omz * p0[1] + z * p1[1];
          |                              ^~~~~~~~~~
          |                              (        )
  • src/geode/geometry/distance.cpp:196:42: warning: [readability-function-cognitive-complexity]

    function 'pivot_point_triangle_distance' has cognitive complexity of 44 (threshold 10)

      196 |     std::tuple< double, geode::Point3D > pivot_point_triangle_distance(
          |                                          ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:201:33: note: +1, including nesting penalty of 0, nesting level increased to 1
      201 |         const auto v1 = v0 == 2 ? 0 : v0 + 1;
          |                                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:202:33: note: +1, including nesting penalty of 0, nesting level increased to 1
      202 |         const auto v2 = v1 == 2 ? 0 : v1 + 1;
          |                                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:220:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      220 |         if( f00 >= 0 )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:222:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      222 |             if( f01 >= 0 )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:226:13: note: +1, nesting level increased to 2
      226 |             else
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:235:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      235 |                 if( h0 >= 0 )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:239:17: note: +1, nesting level increased to 3
      239 |                 else
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:242:21: note: +4, including nesting penalty of 3, nesting level increased to 4
      242 |                     if( h1 <= 0 )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:246:21: note: +1, nesting level increased to 4
      246 |                     else
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:253:14: note: +1, nesting level increased to 1
      253 |         else if( f01 <= 0 )
          |              ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:255:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      255 |             if( f10 <= 0 )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:260:13: note: +1, nesting level increased to 2
      260 |             else
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:268:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      268 |                 if( h0 >= 0 )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:272:17: note: +1, nesting level increased to 3
      272 |                 else
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:275:21: note: +4, including nesting penalty of 3, nesting level increased to 4
      275 |                     if( h1 <= 0 )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:279:21: note: +1, nesting level increased to 4
      279 |                     else
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:286:14: note: +1, nesting level increased to 1
      286 |         else if( f10 <= 0 )
          |              ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:296:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      296 |             if( h0 >= 0 )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:300:13: note: +1, nesting level increased to 2
      300 |             else
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:303:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      303 |                 if( h1 <= 0 )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:307:17: note: +1, nesting level increased to 3
      307 |                 else
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:313:9: note: +1, nesting level increased to 1
      313 |         else
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:321:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      321 |             if( h0 >= 0 )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:325:13: note: +1, nesting level increased to 2
      325 |             else
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:328:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      328 |                 if( h1 <= 0 )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:332:17: note: +1, nesting level increased to 3
      332 |                 else
          |                 ^
  • src/geode/geometry/distance.cpp:199:30: warning: [readability-identifier-length]

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

      199 |         geode::local_index_t v0 )
          |                              ^
  • src/geode/geometry/distance.cpp:201:20: warning: [readability-identifier-length]

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

      201 |         const auto v1 = v0 == 2 ? 0 : v0 + 1;
          |                    ^
  • src/geode/geometry/distance.cpp:202:20: warning: [readability-identifier-length]

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

      202 |         const auto v2 = v1 == 2 ? 0 : v1 + 1;
          |                    ^
  • src/geode/geometry/distance.cpp:210:20: warning: [readability-identifier-length]

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

      210 |         const auto b0 = -diff.dot( edge0 );
          |                    ^
  • src/geode/geometry/distance.cpp:211:20: warning: [readability-identifier-length]

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

      211 |         const auto b1 = -diff.dot( edge1 );
          |                    ^
  • src/geode/geometry/distance.cpp:217:9: warning: [cppcoreguidelines-pro-type-member-init]

    uninitialized record type: 'p'

      217 |         std::array< double, 2 > p0, p1, p;
          |         ^
    note: this fix will not be applied because it overlaps with another fix
  • src/geode/geometry/distance.cpp:217:9: warning: [cppcoreguidelines-pro-type-member-init]

    uninitialized record type: 'p0'

    note: this fix will not be applied because it overlaps with another fix
  • src/geode/geometry/distance.cpp:217:9: warning: [cppcoreguidelines-pro-type-member-init]

    uninitialized record type: 'p1'

    note: this fix will not be applied because it overlaps with another fix
  • src/geode/geometry/distance.cpp:217:9: warning: [readability-isolate-declaration]

    multiple declarations in a single statement reduces readability

      217 |         std::array< double, 2 > p0, p1, p;
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • src/geode/geometry/distance.cpp:217:33: warning: [readability-identifier-length]

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

      217 |         std::array< double, 2 > p0, p1, p;
          |                                 ^
  • src/geode/geometry/distance.cpp:217:37: warning: [readability-identifier-length]

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

      217 |         std::array< double, 2 > p0, p1, p;
          |                                     ^
  • src/geode/geometry/distance.cpp:218:9: warning: [readability-isolate-declaration]

    multiple declarations in a single statement reduces readability

      218 |         double dt1, h0, h1;
          |         ^~~~~~~~~~~~~~~~~~~
  • src/geode/geometry/distance.cpp:218:16: warning: [cppcoreguidelines-init-variables]

    variable 'dt1' is not initialized

      218 |         double dt1, h0, h1;
          |                ^
    note: this fix will not be applied because it overlaps with another fix
  • src/geode/geometry/distance.cpp:218:21: warning: [cppcoreguidelines-init-variables]

    variable 'h0' is not initialized

      218 |         double dt1, h0, h1;
          |                     ^
    note: this fix will not be applied because it overlaps with another fix
  • src/geode/geometry/distance.cpp:218:21: warning: [readability-identifier-length]

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

  • src/geode/geometry/distance.cpp:218:25: warning: [cppcoreguidelines-init-variables]

    variable 'h1' is not initialized

      218 |         double dt1, h0, h1;
          |                         ^
    note: this fix will not be applied because it overlaps with another fix
  • src/geode/geometry/distance.cpp:218:25: warning: [readability-identifier-length]

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

  • src/geode/geometry/distance.cpp:348:9: warning: [readability-function-cognitive-complexity]

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

      348 |         find_non_colocated_triangles_points( const geode::Triangle3D& triangle0,
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:356:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      356 |         for( const auto vertex0 : geode::LRange{ 3 } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:358:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      358 |             for( const auto vertex1 : geode::LRange{ 3 } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:360:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      360 |                 if( geode::point_point_distance(
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:373:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      373 |         for( const auto v : geode::LRange{ 3 } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:375:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      375 |             if( !colocated.first[v] )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:379:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      379 |             if( !colocated.second[v] )
          |             ^
  • src/geode/geometry/distance.cpp:388:9: warning: [readability-function-cognitive-complexity]

    function 'test_triangle_non_common_edges' has cognitive complexity of 15 (threshold 10)

      388 |         test_triangle_non_common_edges(
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:399:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      399 |         for( const auto v0 : geode::LRange{ 3 } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:401:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      401 |             if( v0 == non_colocated0 )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:407:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      407 |             for( const auto v1 : geode::LRange{ 3 } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:409:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      409 |                 if( v1 == non_colocated1 )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:417:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      417 |                 if( cur_pt0.inexact_equal( vertices0[v0] )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:418:21: note: +1
      418 |                     || cur_pt1.inexact_equal( vertices1[v1] ) )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:422:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      422 |                 if( cur_distance < min_distance )
          |                 ^
  • src/geode/geometry/distance.cpp:399:25: warning: [readability-identifier-length]

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

      399 |         for( const auto v0 : geode::LRange{ 3 } )
          |                         ^
  • src/geode/geometry/distance.cpp:407:29: warning: [readability-identifier-length]

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

      407 |             for( const auto v1 : geode::LRange{ 3 } )
          |                             ^
  • src/geode/geometry/distance.cpp:433:58: warning: [readability-function-cognitive-complexity]

    function 'test_close_triangles' has cognitive complexity of 12 (threshold 10)

      433 |     std::tuple< double, geode::Point3D, geode::Point3D > test_close_triangles(
          |                                                          ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:442:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      442 |         for( const auto vertex0 : non_colocated_points )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:444:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      444 |             for( const auto vertex1 : non_colocated_points )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:446:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      446 |                 if( vertex0 == vertex1 )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:450:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      450 |                 if( geode::point_point_distance( base_vertices[vertex0].get(),
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/distance.cpp:467:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      467 |                 if( cur_distance < min_distance )
          |                 ^
  • src/geode/geometry/distance.cpp:489:42: warning: [readability-identifier-naming]

    invalid case style for variable 'P1mP0'

      489 |         const geode::Vector< dimension > P1mP0{ segment0.vertices()[0],
          |                                          ^~~~~
          |                                          p1m_p0
      490 |             segment0.vertices()[1] };
      491 |         const geode::Vector< dimension > Q1mQ0{ segment1.vertices()[0],
      492 |             segment1.vertices()[1] };
      493 |         const geode::Vector< dimension > P0mQ0{ segment1.vertices()[0],
      494 |             segment0.vertices()[0] };
      495 |         const auto a = P1mP0.dot( P1mP0 );
          |                        ~~~~~      ~~~~~
          |                        p1m_p0     p1m_p0
      496 |         const auto b = P1mP0.dot( Q1mQ0 );
          |                        ~~~~~
          |                        p1m_p0
      497 |         const auto c = Q1mQ0.dot( Q1mQ0 );
      498 |         const auto d = P1mP0.dot( P0mQ0 );
          |                        ~~~~~
          |                        p1m_p0
  • src/geode/geometry/distance.cpp:491:42: warning: [readability-identifier-naming]

    invalid case style for variable 'Q1mQ0'

      491 |         const geode::Vector< dimension > Q1mQ0{ segment1.vertices()[0],
          |                                          ^~~~~
          |                                          q1m_q0
      492 |             segment1.vertices()[1] };
      493 |         const geode::Vector< dimension > P0mQ0{ segment1.vertices()[0],
      494 |             segment0.vertices()[0] };
      495 |         const auto a = P1mP0.dot( P1mP0 );
      496 |         const auto b = P1mP0.dot( Q1mQ0 );
          |                                   ~~~~~
          |                                   q1m_q0
      497 |         const auto c = Q1mQ0.dot( Q1mQ0 );
          |                        ~~~~~      ~~~~~
          |                        q1m_q0     q1m_q0
      498 |         const auto d = P1mP0.dot( P0mQ0 );
      499 |         const auto e = Q1mQ0.dot( P0mQ0 );
          |                        ~~~~~
          |                        q1m_q0
  • src/geode/geometry/distance.cpp:493:42: warning: [readability-identifier-naming]

    invalid case style for variable 'P0mQ0'

      493 |         const geode::Vector< dimension > P0mQ0{ segment1.vertices()[0],
          |                                          ^~~~~
          |                                          p0m_q0
      494 |             segment0.vertices()[0] };
      495 |         const auto a = P1mP0.dot( P1mP0 );
      496 |         const auto b = P1mP0.dot( Q1mQ0 );
      497 |         const auto c = Q1mQ0.dot( Q1mQ0 );
      498 |         const auto d = P1mP0.dot( P0mQ0 );
          |                                   ~~~~~
          |                                   p0m_q0
      499 |         const auto e = Q1mQ0.dot( P0mQ0 );
          |                                   ~~~~~
          |                                   p0m_q0
  • src/geode/geometry/distance.cpp:495:20: warning: [readability-identifier-length]

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

      495 |         const auto a = P1mP0.dot( P1mP0 );
          |                    ^
  • src/geode/geometry/distance.cpp:496:20: warning: [readability-identifier-length]

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

      496 |         const auto b = P1mP0.dot( Q1mQ0 );
          |                    ^
  • src/geode/geometry/distance.cpp:497:20: warning: [readability-identifier-length]

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

      497 |         const auto c = Q1mQ0.dot( Q1mQ0 );
          |                    ^
  • src/geode/geometry/distance.cpp:500:20: warning: [readability-identifier-length]

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

      500 |         const auto ac = a * c;
          |                    ^
  • src/geode/geometry/distance.cpp:501:20: warning: [readability-identifier-length]

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

      501 |         const auto bb = b * b;
          |                    ^
  • src/geode/geometry/distance.cpp:502:9: warning: [readability-isolate-declaration]

    multiple declarations in a single statement reduces readability

      502 |         double s, t, nd, bmd, bte, ctd, bpe, ate, btd;
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Have any feedback or feature suggestions? Share it here.

Comment thread src/geode/geometry/distance.cpp Outdated
Comment on lines +489 to +490
const auto P1mP0 = segment0.direction() * segment0.length();
const auto Q1mQ0 = segment1.direction() * segment1.length();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe better to create a vector (segment1.p0 -> segment1.p1) instead of doing the normalization then the denormalisation

Comment thread src/geode/geometry/distance.cpp Outdated
const InfiniteLine< dimension >& line )
{
const auto segDirection = segment.direction();
const auto segDirection = segment.direction() * segment.length();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same here

@BotellaA
BotellaA merged commit c343bf5 into v18 Aug 14, 2026
19 checks passed
@BotellaA
BotellaA deleted the fix/remove_segment_normalized_direction branch August 14, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants