Skip to content

perf(Intersections): use the parallel AABB self intersections - #197

Open
panquez wants to merge 2 commits into
nextfrom
perf/aabb-parallel-self-intersections
Open

panquez wants to merge 2 commits into
nextfrom
perf/aabb-parallel-self-intersections

Conversation

@panquez

@panquez panquez commented Sep 26, 2026

Copy link
Copy Markdown
Member

Summary

Ports the self-intersection checks to the new AABBTree::compute_self_element_bbox_intersections contract from Geode-solutions/OpenGeode#1335: a const, thread-safe test is passed in, and the kept pairs come back. Depends on OpenGeode#1335, which uses the same branch name so CI picks that build up.

Changes

  • SurfaceMeshIntersections: PolygonPolygonIntersection becomes a const test. Its result vector, mutex and stop_at_first_intersection flag are removed.
  • ModelMeshesIntersections:
    • The surface and line actions get a const self_intersect() method, passed through a small SelfIntersectionTest functor. It has to be a functor because -Werror=subobject-linkage rejects a lambda that captures an anonymous-namespace type. Their existing operator() stays for compute_other_element_bbox_intersections, which keeps the old contract.
    • ComponentOverlap becomes a predicate that always returns true.

Behaviour

  • mesh_has_self_intersections() and the self part of model_has_intersecting_surfaces() no longer stop at the first hit; the full search runs in parallel. On a valid mesh the work is the same as before.
  • The order of reported self-intersections is deterministic, but it is now the AABB's leaf order.

Results

next this PR
test-section, 20 threads 0.99 s 0.28 s
test-section, 2 cores 1.07 s 0.62 s
Suite, 20 threads 2.28 s 1.58 s
Suite, 2 cores 3.80 s 3.15 s

23/23 tests pass. Across 20 threads (two runs), 1 thread and 2 cores, every self-intersection call returned identical results.

🤖 Generated with Claude Code

Surface and model self-intersection checks give the AABB a const test
and use the returned pairs. The has-intersection checks no longer stop
at the first hit: the full search now runs in parallel.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@panquez
panquez requested a review from BotellaA September 26, 2026 12:56
@github-actions

Copy link
Copy Markdown

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v21.1.8) reports: 25 concern(s)
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:81:13: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'BRepLineSurfacesIntersection' of similar type ('const geode::uuid &') are easily swapped by mistake

       81 |             const geode::uuid& surface_id,
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       82 |             const geode::uuid& line_id )
          |             ~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:81:32: note: the first parameter in the range is 'surface_id'
       81 |             const geode::uuid& surface_id,
          |                                ^~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:82:32: note: the last parameter in the range is 'line_id'
       82 |             const geode::uuid& line_id )
          |                                ^~~~~~~
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:163:9: warning: [google-explicit-constructor]

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

      163 |         ModelIntersectionBase( const Model& model ) : model_( model ) {}
          |         ^
          |         explicit 
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:212:13: warning: [bugprone-easily-swappable-parameters]

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

      212 |             geode::index_t p1_id, geode::index_t p2_id ) const
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:212:28: note: the first parameter in the range is 'p1_id'
      212 |             geode::index_t p1_id, geode::index_t p2_id ) const
          |                            ^~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:212:50: note: the last parameter in the range is 'p2_id'
      212 |             geode::index_t p1_id, geode::index_t p2_id ) const
          |                                                  ^~~~~
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:254:17: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'triangles_common_vertices' of similar type ('const geode::PolygonVertices &') are easily swapped by mistake

      254 |                 const geode::PolygonVertices& t1_vertices,
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      255 |                 const geode::PolygonVertices& t2_vertices ) const
          |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:254:47: note: the first parameter in the range is 't1_vertices'
      254 |                 const geode::PolygonVertices& t1_vertices,
          |                                               ^~~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:255:47: note: the last parameter in the range is 't2_vertices'
      255 |                 const geode::PolygonVertices& t2_vertices ) const
          |                                               ^~~~~~~~~~~
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:430:58: warning: [readability-function-cognitive-complexity]

    function 'triangles_intersect' has cognitive complexity of 28 (threshold 10)

      430 |         ModelSurfacesIntersectionBase< geode::Section >::triangles_intersect(
          |                                                          ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:436:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      436 |         if( common_vertices.size() == 2 )
          |         ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:444:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      444 |             if( geode::segment_segment_intersection_detection< 2 >(
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:448:17: note: +1
      448 |                 || geode::segment_segment_intersection_detection< 2 >(
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:460:20: note: +1
      460 |                    || geode::point_triangle_position( t2_third_pt, triangle1 )
          |                    ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:463:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      463 |         for( const auto t1_edge_v : geode::LRange{ 3 } )
          |         ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:467:44: note: +2, including nesting penalty of 1, nesting level increased to 2
      467 |                 t1_vertices[t1_edge_v == 2 ? 0 : t1_edge_v + 1]
          |                                            ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:471:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      471 |             for( const auto t2_edge_v : geode::LRange{ 3 } )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:475:48: note: +3, including nesting penalty of 2, nesting level increased to 3
      475 |                     t2_vertices[t2_edge_v == 2 ? 0 : t2_edge_v + 1]
          |                                                ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:481:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      481 |                 if( edge_edge_inter.first == geode::POSITION::outside
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:482:21: note: +1
      482 |                     || edge_edge_inter.first == geode::POSITION::parallel )
          |                     ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:486:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      486 |                 if( common_vertices.size() != 1 )
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:494:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      494 |                 if( t1_edge_inter_pt_id == geode::NO_LID
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:495:21: note: +1
      495 |                     || t2_edge_inter_pt_id == geode::NO_LID )
          |                     ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:499:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      499 |                 if( edge1_vertices[t1_edge_inter_pt_id] != common_vertices[0][0]
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:500:21: note: +1
      500 |                     || edge2_vertices[t2_edge_inter_pt_id]
          |                     ^
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:510:24: warning: [readability-function-cognitive-complexity]

    function 'triangle_intersects_other' has cognitive complexity of 22 (threshold 10)

      510 |     [[nodiscard]] bool triangle_intersects_other(
          |                        ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:518:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      518 |         for( const auto v_id : geode::LRange{ 3 } )
          |         ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:520:42: note: +2, including nesting penalty of 1, nesting level increased to 2
      520 |             const auto v2_id = v_id == 2 ? 0 : v_id + 1;
          |                                          ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:524:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      524 |             if( intersection.first != geode::POSITION::outside )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:526:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      526 |                 if( common_vertices.size() != 1 )
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:534:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      534 |                 if( edge_inter_pt_id == geode::NO_LID
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:535:21: note: +1
      535 |                     || t2_inter_pt_id == geode::NO_LID )
          |                     ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:539:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      539 |                 if( t1_vertices[edge_inter_pt_id == 0 ? v_id : v2_id]
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:541:21: note: +1
      541 |                     || t2_vertices[t2_inter_pt_id]
          |                     ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:539:55: note: +3, including nesting penalty of 2, nesting level increased to 3
      539 |                 if( t1_vertices[edge_inter_pt_id == 0 ? v_id : v2_id]
          |                                                       ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:540:71: note: +3, including nesting penalty of 2, nesting level increased to 3
      540 |                         != common_vertices[0][t2_vertex_position == 0 ? 1 : 0]
          |                                                                       ^
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:510:24: warning: [readability-function-size]

    function 'triangle_intersects_other' exceeds recommended size/complexity thresholds

      510 |     [[nodiscard]] bool triangle_intersects_other(
          |                        ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:510:24: note: 6 parameters (threshold 4)
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:579:19: warning: [readability-suspicious-call-argument]

    1st argument 'triangle2' (passed to 'triangle1') looks like it might be swapped with the 2nd, 'triangle1' (passed to 'triangle2')

      579 |                || triangle_intersects_other( triangle2, triangle1, t2_vertices,
          |                   ^                          ~~~~~~~~~  ~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:510:24: note: in the call to 'triangle_intersects_other', declared here
      510 |     [[nodiscard]] bool triangle_intersects_other(
          |                        ^
      511 |         const geode::Triangle3D& triangle1,
          |                                  ~~~~~~~~~
      512 |         const geode::Triangle3D& triangle2,
          |                                  ~~~~~~~~~
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:579:19: warning: [readability-suspicious-call-argument]

    3rd argument 't2_vertices' (passed to 't1_vertices') looks like it might be swapped with the 4th, 't1_vertices' (passed to 't2_vertices')

      579 |                || triangle_intersects_other( triangle2, triangle1, t2_vertices,
          |                   ^                                                ~~~~~~~~~~~
      580 |                    t1_vertices, common_vertices, 0 );
          |                    ~~~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:510:24: note: in the call to 'triangle_intersects_other', declared here
      510 |     [[nodiscard]] bool triangle_intersects_other(
          |                        ^
      511 |         const geode::Triangle3D& triangle1,
      512 |         const geode::Triangle3D& triangle2,
      513 |         const geode::PolygonVertices& t1_vertices,
          |                                       ~~~~~~~~~~~
      514 |         const geode::PolygonVertices& t2_vertices,
          |                                       ~~~~~~~~~~~
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:621:9: warning: [modernize-use-nodiscard]

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

      621 |         bool lines_intersect( geode::index_t p1_id, geode::index_t p2_id ) const
          |         ^
          |         [[nodiscard]] 
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:679:9: warning: [google-explicit-constructor]

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

      679 |         Impl( const Model& model )
          |         ^
          |         explicit 
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:795:13: warning: [readability-function-cognitive-complexity]

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

      795 |             intersecting_polygons() const
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:798:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      798 |             for( const auto& surface : model_.active_surfaces() )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:800:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      800 |                 if( surface.mesh().nb_polygons() == 0 )
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:812:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      812 |             for( const auto& surface : model_.active_surfaces() )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:814:51: note: nesting level increased to 2
      814 |                 tasks.emplace_back( async::spawn( [this, &surface] {
          |                                                   ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:826:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      826 |                     for( const auto& [polygon1, polygon2] :
          |                     ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:840:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      840 |             for( const auto& components : surfaces_overlap )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:842:51: note: nesting level increased to 2
      842 |                 tasks.emplace_back( async::spawn( [this, &components] {
          |                                                   ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:858:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      858 |                     for( const auto& [polygon1, polygon2] :
          |                     ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:868:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      868 |             for( auto& task : async::when_all( tasks ).get() )
          |             ^
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:821:30: error: [clang-diagnostic-error]

    no matching member function for call to 'compute_self_element_bbox_intersections'

      818 |                         surfaces_model_tree_
          |                         ~~~~~~~~~~~~~~~~~~~~
      819 |                             .mesh_trees_[surfaces_model_tree_.mesh_tree_ids_.at(
          |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      820 |                                 surface.id() )]
          |                                 ~~~~~~~~~~~~~~~
      821 |                             .compute_self_element_bbox_intersections(
          |                             ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:814:68: note: while substituting into a lambda expression here
      814 |                 tasks.emplace_back( async::spawn( [this, &surface] {
          |                                                                    ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:688:40: note: in instantiation of function template specialization 'geode::ModelMeshesIntersections<geode::Section>::Impl::intersecting_polygons<(anonymous namespace)::OneModelSurfacesIntersection<geode::Section>>' requested here
      688 |             const auto intersections = intersecting_polygons<
          |                                        ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/OpenGeode-18.1.8-rc.1-ubuntu/include/geode/geometry/aabb.hpp:144:14: note: candidate function [with EvalIntersection = (anonymous namespace)::SelfIntersectionTest<(anonymous namespace)::OneModelSurfacesIntersection<geode::Section>>] not viable: expects an lvalue for 1st argument
      144 |         void compute_self_element_bbox_intersections(
          |              ^
      145 |             EvalIntersection& action ) const;
          |             ~~~~~~~~~~~~~~~~~~~~~~~~
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:838:22: error: [clang-diagnostic-error]

    no matching member function for call to 'compute_self_element_bbox_intersections'

      837 |                 surfaces_model_tree_.components_tree_
          |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      838 |                     .compute_self_element_bbox_intersections(
          |                     ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:688:40: note: in instantiation of function template specialization 'geode::ModelMeshesIntersections<geode::Section>::Impl::intersecting_polygons<(anonymous namespace)::OneModelSurfacesIntersection<geode::Section>>' requested here
      688 |             const auto intersections = intersecting_polygons<
          |                                        ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/OpenGeode-18.1.8-rc.1-ubuntu/include/geode/geometry/aabb.hpp:144:14: note: candidate function [with EvalIntersection = (anonymous namespace)::ComponentOverlap] not viable: expects an lvalue for 1st argument
      144 |         void compute_self_element_bbox_intersections(
          |              ^
      145 |             EvalIntersection& action ) const;
          |             ~~~~~~~~~~~~~~~~~~~~~~~~
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:878:13: warning: [readability-function-cognitive-complexity]

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

      878 |             intersecting_lines() const
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:883:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      883 |             for( const auto& line : model_.active_lines() )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:885:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      885 |                 if( line.mesh().nb_edges() == 0 )
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:895:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      895 |             for( const auto& line : model_.active_lines() )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:897:51: note: nesting level increased to 2
      897 |                 tasks.emplace_back( async::spawn( [this, &line] {
          |                                                   ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:911:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      911 |                     for( const auto& [edge1, edge2] : intersecting_elements )
          |                     ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:924:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      924 |             for( const auto& components : lines_overlap )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:926:51: note: nesting level increased to 2
      926 |                 tasks.emplace_back( async::spawn( [this, &components] {
          |                                                   ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:942:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      942 |                     for( const auto& [edge1, edge2] :
          |                     ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:952:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      952 |             for( auto& task : async::when_all( tasks ).get() )
          |             ^
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:905:30: error: [clang-diagnostic-error]

    no matching member function for call to 'compute_self_element_bbox_intersections'

      902 |                         lines_model_tree_
          |                         ~~~~~~~~~~~~~~~~~
      903 |                             .mesh_trees_[lines_model_tree_.mesh_tree_ids_.at(
          |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      904 |                                 line.id() )]
          |                                 ~~~~~~~~~~~~
      905 |                             .compute_self_element_bbox_intersections(
          |                             ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:897:65: note: while substituting into a lambda expression here
      897 |                 tasks.emplace_back( async::spawn( [this, &line] {
          |                                                                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:1068:9: note: in instantiation of member function 'geode::ModelMeshesIntersections<geode::Section>::Impl::intersecting_lines' requested here
     1068 |         ModelMeshesIntersections< Section >;
          |         ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/OpenGeode-18.1.8-rc.1-ubuntu/include/geode/geometry/aabb.hpp:144:14: note: candidate function [with EvalIntersection = (anonymous namespace)::SelfIntersectionTest<(anonymous namespace)::LineLineIntersection<geode::Section>>] not viable: expects an lvalue for 1st argument
      144 |         void compute_self_element_bbox_intersections(
          |              ^
      145 |             EvalIntersection& action ) const;
          |             ~~~~~~~~~~~~~~~~~~~~~~~~
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:922:22: error: [clang-diagnostic-error]

    no matching member function for call to 'compute_self_element_bbox_intersections'

      921 |                 lines_model_tree_.components_tree_
          |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      922 |                     .compute_self_element_bbox_intersections(
          |                     ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:1068:9: note: in instantiation of member function 'geode::ModelMeshesIntersections<geode::Section>::Impl::intersecting_lines' requested here
     1068 |         ModelMeshesIntersections< Section >;
          |         ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/OpenGeode-18.1.8-rc.1-ubuntu/include/geode/geometry/aabb.hpp:144:14: note: candidate function [with EvalIntersection = (anonymous namespace)::ComponentOverlap] not viable: expects an lvalue for 1st argument
      144 |         void compute_self_element_bbox_intersections(
          |              ^
      145 |             EvalIntersection& action ) const;
          |             ~~~~~~~~~~~~~~~~~~~~~~~~
  • src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:962:13: warning: [readability-function-cognitive-complexity]

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

      962 |             intersecting_lines_surfaces( const BRep& brep ) const
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:967:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      967 |             for( const auto& surface : brep.active_surfaces() )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:969:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      969 |                 if( surface.mesh().nb_polygons() == 0 )
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:977:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      977 |             for( const auto& line : brep.active_lines() )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:979:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      979 |                 if( line.mesh().nb_edges() == 0 )
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:987:13: note: +1, including nesting penalty of 0, nesting level increased to 1
      987 |             for( const auto& surface : brep.active_surfaces() )
          |             ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:992:17: note: +2, including nesting penalty of 1, nesting level increased to 2
      992 |                 for( const auto& line : brep.active_lines() )
          |                 ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:994:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      994 |                     if( brep.nb_embedding_blocks( line ) == 0 )
          |                     ^
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:1005:21: note: +3, including nesting penalty of 2, nesting level increased to 3
     1005 |                     for( const auto& element_pair :
          |                     ^
  • src/geode/inspector/inspection/criterion/intersections/surface_intersections.cpp:75:9: warning: [google-explicit-constructor]

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

       75 |         Impl( const SurfaceMesh< dimension >& mesh )
          |         ^
          |         explicit 
  • src/geode/inspector/inspection/criterion/intersections/surface_intersections.cpp:80:9: warning: [modernize-use-nodiscard]

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

       80 |         bool mesh_has_self_intersections() const
          |         ^
          |         [[nodiscard]] 
  • src/geode/inspector/inspection/criterion/intersections/surface_intersections.cpp:85:24: warning: [readability-simplify-boolean-expr]

    redundant boolean literal in conditional return statement

       83 |             if( intersections.empty() )
          |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |             return !static_cast<bool>(intersections.empty())
       84 |             {
          |             ~
       85 |                 return false;
          |                 ~~~~~~~^~~~~~
       86 |             }
          |             ~
       87 |             return true;
          |             ~~~~~~~~~~~
  • src/geode/inspector/inspection/criterion/intersections/surface_intersections.cpp:90:9: warning: [modernize-use-nodiscard]

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

       90 |         InspectionIssues< std::pair< index_t, index_t > >
          |         ^
          |         [[nodiscard]] 
  • src/geode/inspector/inspection/criterion/intersections/surface_intersections.cpp:108:9: warning: [modernize-use-nodiscard]

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

      108 |         std::vector< std::pair< index_t, index_t > >
          |         ^
          |         [[nodiscard]] 
  • src/geode/inspector/inspection/criterion/intersections/surface_intersections.cpp:113:20: error: [clang-diagnostic-error]

    no viable conversion from returned value of type 'void' to function return type 'std::vector<std::pair<index_t, index_t>>' (aka 'vector<pair<unsigned int, unsigned int>>')

      113 |             return surface_aabb.compute_self_element_bbox_intersections(
          |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      114 |                 action );
          |                 ~~~~~~~~
    /__w/OpenGeode-Inspector/OpenGeode-Inspector/src/geode/inspector/inspection/criterion/intersections/surface_intersections.cpp:148:9: note: in instantiation of member function 'geode::SurfaceMeshIntersections<2>::Impl::intersecting_polygons' requested here
      148 |         SurfaceMeshIntersections< 2 >;
          |         ^
    /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_vector.h:553:7: note: candidate constructor not viable: cannot convert argument of incomplete type 'void' to 'const vector<std::pair<unsigned int, unsigned int>> &' for 1st argument
      553 |       vector(const vector& __x)
          |       ^      ~~~~~~~~~~~~~~~~~
    /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_vector.h:572:7: note: candidate constructor not viable: cannot convert argument of incomplete type 'void' to 'vector<std::pair<unsigned int, unsigned int>> &&' for 1st argument
      572 |       vector(vector&&) noexcept = default;
          |       ^      ~~~~~~~~
    /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_vector.h:625:7: note: candidate constructor not viable: cannot convert argument of incomplete type 'void' to 'initializer_list<value_type>' (aka 'initializer_list<std::pair<unsigned int, unsigned int>>') for 1st argument
      625 |       vector(initializer_list<value_type> __l,
          |       ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_vector.h:497:7: note: explicit constructor is not a candidate
      497 |       vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
          |       ^
    /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_vector.h:510:7: note: explicit constructor is not a candidate
      510 |       vector(size_type __n, const allocator_type& __a = allocator_type())
          |       ^
  • src/geode/inspector/inspection/criterion/intersections/surface_intersections.cpp:119:14: warning: [cppcoreguidelines-use-default-member-init]

    use default member initializer for 'verbose_'

       76 |         bool verbose_;
          |              ^       
          |                      { false }

Have any feedback or feature suggestions? Share it here.

@BotellaA BotellaA left a comment

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 remove all false usage like mesh_has_self_intersections()? It may simplify the API?

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.

2 participants