diff --git a/src/brep/plugins/catia_fbb.cpp b/src/brep/plugins/catia_fbb.cpp index ab0dd611..1bf4f6dd 100644 --- a/src/brep/plugins/catia_fbb.cpp +++ b/src/brep/plugins/catia_fbb.cpp @@ -128,8 +128,9 @@ bool parse_vertices(const std::vector& d, } // namespace -bool extract_catia_fbb_mesh(const std::vector& main, - std::vector& bodies, std::string& error) { +static bool extract_catia_fbb_mesh_impl( + const std::vector& main, std::vector& bodies, + std::string& error, std::size_t depth) { // 1) 找最大连续 FBB run(stride 8)。 std::size_t fbb_start = 0; std::size_t fbb_count = 0; @@ -204,12 +205,12 @@ bool extract_catia_fbb_mesh(const std::vector& main, } if (packets.empty()) { // 最大 run 失败时,尝试后续 run(递归裁剪,避免多 population 误选)。 - if (fbb_start + 8 < main.size()) { + if (depth < 64 && fbb_start + 8 < main.size()) { std::vector tail(main.begin() + fbb_start + 8, main.end()); std::vector alt; std::string alt_error; - if (extract_catia_fbb_mesh(tail, alt, alt_error)) { + if (extract_catia_fbb_mesh_impl(tail, alt, alt_error, depth + 1)) { for (auto& b : alt) bodies.push_back(std::move(b)); error = alt_error; return true; @@ -270,4 +271,9 @@ bool extract_catia_fbb_mesh(const std::vector& main, return true; } +bool extract_catia_fbb_mesh(const std::vector& main, + std::vector& bodies, std::string& error) { + return extract_catia_fbb_mesh_impl(main, bodies, error, 0); +} + } // namespace vde::brep::native