From 21e9a6c6c4ff1afa84e122eb3c502ee9851bc1ca Mon Sep 17 00:00:00 2001 From: Pierre Anquez Date: Tue, 6 Jan 2026 10:01:59 +0100 Subject: [PATCH 1/3] fix(Topology): add try/catch to avoid exception failings --- .../inspector/topology/brep_topology.cpp | 43 ++++++++++++++++--- .../inspector/topology/section_topology.cpp | 40 +++++++++++++++-- 2 files changed, 72 insertions(+), 11 deletions(-) diff --git a/src/geode/inspector/topology/brep_topology.cpp b/src/geode/inspector/topology/brep_topology.cpp index 565fc444..eedfbbd8 100644 --- a/src/geode/inspector/topology/brep_topology.cpp +++ b/src/geode/inspector/topology/brep_topology.cpp @@ -178,19 +178,48 @@ namespace geode BRepTopologyInspectionResult result; async::parallel_invoke( [&result, &brep_topology_inspector] { - result.corners = - brep_topology_inspector.inspect_corners_topology(); + try + { + result.corners = + brep_topology_inspector.inspect_corners_topology(); + } + catch( OpenGeodeException& ) + { + return; + } }, [&result, &brep_topology_inspector] { - result.lines = - brep_topology_inspector.inspect_lines_topology(); + try + { + result.lines = + brep_topology_inspector.inspect_lines_topology(); + } + catch( OpenGeodeException& ) + { + return; + } }, [&result, &brep_topology_inspector] { - result.surfaces = - brep_topology_inspector.inspect_surfaces_topology(); + try + { + result.surfaces = + brep_topology_inspector.inspect_surfaces_topology(); + } + catch( OpenGeodeException& ) + { + return; + } }, [&result, &brep_topology_inspector] { - result.blocks = brep_topology_inspector.inspect_blocks(); + try + { + result.blocks = + brep_topology_inspector.inspect_blocks(); + } + catch( OpenGeodeException& ) + { + return; + } } ); add_unique_vertices_with_wrong_cmv_link( result ); return result; diff --git a/src/geode/inspector/topology/section_topology.cpp b/src/geode/inspector/topology/section_topology.cpp index be5ce65e..b2f66f20 100644 --- a/src/geode/inspector/topology/section_topology.cpp +++ b/src/geode/inspector/topology/section_topology.cpp @@ -23,6 +23,8 @@ #include +#include + #include #include @@ -170,10 +172,40 @@ namespace geode const SectionTopologyInspector& section_topology_inspector ) const { SectionTopologyInspectionResult result; - result.corners = - section_topology_inspector.inspect_corners_topology(); - result.lines = section_topology_inspector.inspect_lines_topology(); - result.surfaces = section_topology_inspector.inspect_surfaces(); + async::parallel_invoke( + [&result, §ion_topology_inspector] { + try + { + result.corners = section_topology_inspector + .inspect_corners_topology(); + } + catch( OpenGeodeException& ) + { + return; + } + }, + [&result, §ion_topology_inspector] { + try + { + result.lines = + section_topology_inspector.inspect_lines_topology(); + } + catch( OpenGeodeException& ) + { + return; + } + }, + [&result, §ion_topology_inspector] { + try + { + result.surfaces = + section_topology_inspector.inspect_surfaces(); + } + catch( OpenGeodeException& ) + { + return; + } + } ); add_unique_vertices_with_wrong_cmv_link( result ); return result; } From dc232ae8e25df12dff54f57dc921983cc3a57433 Mon Sep 17 00:00:00 2001 From: Pierre Anquez Date: Fri, 9 Jan 2026 16:21:28 +0100 Subject: [PATCH 2/3] Pr review --- .../inspector/topology/brep_topology.cpp | 53 ++++++------------- .../inspector/topology/section_topology.cpp | 41 +++++--------- 2 files changed, 29 insertions(+), 65 deletions(-) diff --git a/src/geode/inspector/topology/brep_topology.cpp b/src/geode/inspector/topology/brep_topology.cpp index eedfbbd8..68e3c01a 100644 --- a/src/geode/inspector/topology/brep_topology.cpp +++ b/src/geode/inspector/topology/brep_topology.cpp @@ -176,51 +176,30 @@ namespace geode const BRepTopologyInspector& brep_topology_inspector ) const { BRepTopologyInspectionResult result; - async::parallel_invoke( - [&result, &brep_topology_inspector] { - try - { + try + { + async::parallel_invoke( + [&result, &brep_topology_inspector] { result.corners = brep_topology_inspector.inspect_corners_topology(); - } - catch( OpenGeodeException& ) - { - return; - } - }, - [&result, &brep_topology_inspector] { - try - { + }, + [&result, &brep_topology_inspector] { result.lines = brep_topology_inspector.inspect_lines_topology(); - } - catch( OpenGeodeException& ) - { - return; - } - }, - [&result, &brep_topology_inspector] { - try - { + }, + [&result, &brep_topology_inspector] { result.surfaces = brep_topology_inspector.inspect_surfaces_topology(); - } - catch( OpenGeodeException& ) - { - return; - } - }, - [&result, &brep_topology_inspector] { - try - { + }, + [&result, &brep_topology_inspector] { result.blocks = brep_topology_inspector.inspect_blocks(); - } - catch( OpenGeodeException& ) - { - return; - } - } ); + } ); + } + catch( OpenGeodeException& ) + { + return; + } add_unique_vertices_with_wrong_cmv_link( result ); return result; } diff --git a/src/geode/inspector/topology/section_topology.cpp b/src/geode/inspector/topology/section_topology.cpp index b2f66f20..9adeda1f 100644 --- a/src/geode/inspector/topology/section_topology.cpp +++ b/src/geode/inspector/topology/section_topology.cpp @@ -172,40 +172,25 @@ namespace geode const SectionTopologyInspector& section_topology_inspector ) const { SectionTopologyInspectionResult result; - async::parallel_invoke( - [&result, §ion_topology_inspector] { - try - { + try + { + async::parallel_invoke( + [&result, §ion_topology_inspector] { result.corners = section_topology_inspector .inspect_corners_topology(); - } - catch( OpenGeodeException& ) - { - return; - } - }, - [&result, §ion_topology_inspector] { - try - { + }, + [&result, §ion_topology_inspector] { result.lines = section_topology_inspector.inspect_lines_topology(); - } - catch( OpenGeodeException& ) - { - return; - } - }, - [&result, §ion_topology_inspector] { - try - { + }, + [&result, §ion_topology_inspector] { result.surfaces = section_topology_inspector.inspect_surfaces(); - } - catch( OpenGeodeException& ) - { - return; - } - } ); + } ); + } + catch( OpenGeodeException& ) + { + } add_unique_vertices_with_wrong_cmv_link( result ); return result; } From 8d680204ace8562f78e12122a77460ac3a406c3e Mon Sep 17 00:00:00 2001 From: Pierre Anquez Date: Mon, 12 Jan 2026 14:16:32 +0100 Subject: [PATCH 3/3] fix compilation --- src/geode/inspector/topology/brep_topology.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/geode/inspector/topology/brep_topology.cpp b/src/geode/inspector/topology/brep_topology.cpp index 68e3c01a..87986c8e 100644 --- a/src/geode/inspector/topology/brep_topology.cpp +++ b/src/geode/inspector/topology/brep_topology.cpp @@ -198,7 +198,6 @@ namespace geode } catch( OpenGeodeException& ) { - return; } add_unique_vertices_with_wrong_cmv_link( result ); return result;