Skip to content

Fix/aabb point distances - #1326

Merged
BotellaA merged 9 commits into
nextfrom
fix/aabb-point-distances
Sep 2, 2026
Merged

BotellaA merged 9 commits into
nextfrom
fix/aabb-point-distances

Conversation

@BotellaA

@BotellaA BotellaA commented Sep 2, 2026

Copy link
Copy Markdown
Member

No description provided.

@BotellaA
BotellaA requested a review from panquez September 2, 2026 08:43
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

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

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

       59 |     class GenericTriangle
          |           ^
  • include/geode/geometry/basic_objects/triangle.hpp:111:11: warning: [cppcoreguidelines-special-member-functions]

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

      111 |     class OwnerTriangle
          |           ^
  • include/geode/geometry/basic_objects/triangle.hpp:130:11: warning: [cppcoreguidelines-special-member-functions]

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

      130 |     class Triangle : public GenericTriangle< RefPoint< dimension >, dimension >
          |           ^
  • include/geode/geometry/basic_objects/triangle.hpp:140:9: warning: [google-explicit-constructor]

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

      140 |         Triangle( const OwnerTriangle< dimension >& other ) noexcept;
          |         ^
          |         explicit 
  • include/geode/geometry/detail/aabb_impl.hpp:94:9: warning: [google-explicit-constructor]

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

       94 |         Impl( absl::Span< const BoundingBox< dimension > > bboxes )
          |         ^
          |         explicit 
  • include/geode/geometry/detail/aabb_impl.hpp:100:31: warning: [readability-math-missing-parentheses]

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

      100 |                 tree_.resize( 2 * bboxes.size() - 1 );
          |                               ^~~~~~~~~~~~~~~~~
          |                               (                )
  • include/geode/geometry/detail/aabb_impl.hpp:118:57: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'get_recursive_iterators' of similar type ('index_t') are easily swapped by mistake

      118 |         [[nodiscard]] Iterator get_recursive_iterators( index_t node_index,
          |                                                         ^~~~~~~~~~~~~~~~~~~
      119 |             index_t element_begin,
          |             ~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:118:65: note: the first parameter in the range is 'node_index'
      118 |         [[nodiscard]] Iterator get_recursive_iterators( index_t node_index,
          |                                                                 ^~~~~~~~~~
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:119:21: note: the last parameter in the range is 'element_begin'
      119 |             index_t element_begin,
          |                     ^~~~~~~~~~~~~
  • include/geode/geometry/detail/aabb_impl.hpp:122:22: warning: [readability-identifier-length]

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

      122 |             Iterator it;
          |                      ^
  • include/geode/geometry/detail/aabb_impl.hpp:124:33: warning: [readability-math-missing-parentheses]

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

      124 |                 element_begin + ( element_end - element_begin ) / 2;
          |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                                 (                                  )
  • include/geode/geometry/detail/aabb_impl.hpp:167:33: warning: [readability-math-missing-parentheses]

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

      167 |                 element_begin + ( element_end - element_begin ) / 2;
          |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                                 (                                  )
  • include/geode/geometry/detail/aabb_impl.hpp:187:14: warning: [readability-function-cognitive-complexity]

    function 'closest_element_box_recursive' has cognitive complexity of 13 (threshold 10)

      187 |         void closest_element_box_recursive( const Point< dimension >& query,
          |              ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:203:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      203 |             if( is_leaf( element_begin, element_end ) )
          |             ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:208:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      208 |                 if( cur_squared_distance < squared_distance )
          |                 ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:224:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      224 |             if( squared_distance_left < squared_distance_right )
          |             ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:226:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      226 |                 if( squared_distance_left < squared_distance )
          |                 ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:232:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      232 |                 if( squared_distance_right < squared_distance )
          |                 ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:239:13: note: +1, nesting level increased to 1
      239 |             else
          |             ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:241:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      241 |                 if( squared_distance_right < squared_distance )
          |                 ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:247:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      247 |                 if( squared_distance_left < squared_distance )
          |                 ^
  • include/geode/geometry/detail/aabb_impl.hpp:187:14: warning: [readability-function-size]

    function 'closest_element_box_recursive' exceeds recommended size/complexity thresholds

      187 |         void closest_element_box_recursive( const Point< dimension >& query,
          |              ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:187:14: note: 7 parameters (threshold 4)
  • include/geode/geometry/detail/aabb_impl.hpp:215:24: warning: [readability-identifier-length]

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

      215 |             const auto it = get_recursive_iterators(
          |                        ^
  • include/geode/geometry/detail/aabb_impl.hpp:257:14: warning: [readability-function-size]

    function 'self_intersect_recursive' exceeds recommended size/complexity thresholds

      257 |         bool self_intersect_recursive( index_t node_index1,
          |              ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:257:14: note: 7 parameters (threshold 4)
  • include/geode/geometry/detail/aabb_impl.hpp:305:28: warning: [readability-identifier-length]

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

      305 |                 const auto it = get_recursive_iterators(
          |                            ^
  • include/geode/geometry/detail/aabb_impl.hpp:317:24: warning: [readability-identifier-length]

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

      317 |             const auto it = get_recursive_iterators(
          |                        ^
  • include/geode/geometry/detail/aabb_impl.hpp:331:14: warning: [readability-function-size]

    function 'other_intersect_recursive' exceeds recommended size/complexity thresholds

      331 |         bool other_intersect_recursive( index_t node_index1,
          |              ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:331:14: note: 8 parameters (threshold 4)
  • include/geode/geometry/detail/aabb_impl.hpp:369:28: warning: [readability-identifier-length]

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

      369 |                 const auto it = other_tree.impl_->get_recursive_iterators(
          |                            ^
  • include/geode/geometry/detail/aabb_impl.hpp:381:24: warning: [readability-identifier-length]

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

      381 |             const auto it = get_recursive_iterators(
          |                        ^
  • include/geode/geometry/detail/aabb_impl.hpp:395:14: warning: [readability-function-size]

    function 'generic_intersect_recursive' exceeds recommended size/complexity thresholds

      395 |         bool generic_intersect_recursive( const BOX_FILTER& box_filter,
          |              ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:395:14: note: 5 parameters (threshold 4)
  • include/geode/geometry/detail/aabb_impl.hpp:418:24: warning: [readability-identifier-length]

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

      418 |             const auto it = get_recursive_iterators(
          |                        ^
  • include/geode/geometry/detail/aabb_impl.hpp:437:28: warning: [readability-identifier-length]

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

      437 |                 const auto it = get_recursive_iterators(
          |                            ^
  • include/geode/geometry/detail/aabb_impl.hpp:455:14: warning: [readability-function-size]

    function 'containing_boxes_recursive' exceeds recommended size/complexity thresholds

      455 |         void containing_boxes_recursive( index_t node_index,
          |              ^
    /__w/OpenGeode/OpenGeode/include/geode/geometry/detail/aabb_impl.hpp:455:14: note: 5 parameters (threshold 4)
  • include/geode/geometry/detail/aabb_impl.hpp:475:24: warning: [readability-identifier-length]

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

      475 |             const auto it = get_recursive_iterators(
          |                        ^
  • src/geode/geometry/basic_objects/triangle.cpp:41:57: warning: [readability-function-cognitive-complexity]

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

       41 |     std::optional< geode::internal::PivotNormalResult > simple_pivot_and_normal(
          |                                                         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/basic_objects/triangle.cpp:47:9: note: +1, including nesting penalty of 0, nesting level increased to 1
       47 |         for( const auto pivot : geode::LRange{ 3 } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/basic_objects/triangle.cpp:49:46: note: +2, including nesting penalty of 1, nesting level increased to 2
       49 |             const auto next = pivot + 1 == 3 ? 0 : pivot + 1;
          |                                              ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/basic_objects/triangle.cpp:52:13: note: +2, including nesting penalty of 1, nesting level increased to 2
       52 |             if( result->lengths[pivot] < geode::GLOBAL_EPSILON )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/basic_objects/triangle.cpp:57:42: note: +2, including nesting penalty of 1, nesting level increased to 2
       57 |             const auto prev = pivot == 0 ? 2 : pivot - 1;
          |                                          ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/basic_objects/triangle.cpp:60:13: note: +2, including nesting penalty of 1, nesting level increased to 2
       60 |             if( length1 < geode::GLOBAL_EPSILON )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/basic_objects/triangle.cpp:67:13: note: +2, including nesting penalty of 1, nesting level increased to 2
       67 |             if( length > geode::GLOBAL_ANGULAR_EPSILON )
          |             ^
  • src/geode/geometry/basic_objects/triangle.cpp:112:47: warning: [cppcoreguidelines-avoid-magic-numbers]

    1. is a magic number; consider replacing it with a named constant
      112 |         return ( point0 + point1 + point2 ) / 3.;
          |                                               ^
  • src/geode/geometry/basic_objects/triangle.cpp:184:9: warning: [llvm-qualified-auto]

    'const auto max' can be declared as 'const auto *const max'

      184 |         const auto max = absl::c_max_element( result->lengths );
          |         ^~~~~~~~~~
          |         const auto *const 
  • src/geode/geometry/basic_objects/triangle.cpp:188:20: warning: [readability-identifier-length]

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

      188 |         const auto e1 = longest_e == 2 ? 0 : longest_e + 1;
          |                    ^
  • src/geode/geometry/basic_objects/triangle.cpp:190:20: warning: [readability-identifier-length]

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

      190 |         const auto e2 = e1 == 2 ? 0 : e1 + 1;
          |                    ^
  • 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:778:25: warning: [readability-identifier-length]

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

      778 |         for( const auto c : LRange{ dimension } )
          |                         ^

Have any feedback or feature suggestions? Share it here.

@BotellaA
BotellaA merged commit 58c00ee into next Sep 2, 2026
19 checks passed
@BotellaA
BotellaA deleted the fix/aabb-point-distances branch September 2, 2026 14:13
@BotellaA

BotellaA commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

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

The release is available on GitHub release

Your semantic-release bot 📦🚀

@BotellaA

BotellaA commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

🎉 This PR is included in version 18.1.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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