fix(v1.0.1): 修复 VDE-018 — ssi_boolean.cpp 命名空间回归
CI / Build & Test (push) Failing after 16m49s
CI / Release Build (push) Failing after 16m56s
Build & Test / build-and-test (push) Has been cancelled
Build & Test / python-bindings (push) Has been cancelled

1. 删除不存在的 using vde::core::Transform3D/Plane3D
2. 移除两个过早关闭 vde::brep 命名空间的 } (原行431/946)
3. 移除匿名空间内重复的 extract_face_fragment/classify_point_adaptive 前向声明

GCC 10.2.1 -fsyntax-only 通过 (0 errors)
This commit is contained in:
茂之钳
2026-07-28 11:08:01 +08:00
parent d5c00a0406
commit 3966bd8a80
2 changed files with 69 additions and 10 deletions
+69
View File
@@ -0,0 +1,69 @@
# VDE-018: ssi_boolean.cpp regression — face_bounds ambiguity, mesh/curves lookup, enum values
- **ID**: VDE-018
- **Date**: 2026-07-28
- **Status**: Fixed
- **Severity**: Critical
- **Category**: COMPILE / GCC Compatibility
- **Source**: ViewDesign fea/viewdesign-engine branch
## Issue
The merge of VDE-016 fix (2f69f06) and the subsequent main branch update (ff4c8d3)
introduced a regression in `ssi_boolean.cpp` that breaks GCC builds. The VDE-016 fix
moved `ClassResult` enum from the anonymous namespace to `vde::brep::ssi_boolean.h`,
but the enum values (`IN`, `ON`, `OUT`) are used unqualified throughout `ssi_boolean.cpp`.
The subsequent attempt at fix (d5c00a0, July 28) only reordered `#include <iterator>`
and did not address the root causes.
## Build Errors (GCC/MSVC with /permissive-)
```
error: 'OUT' was not declared in this scope; did you mean 'vde::brep::OUT'?
error: 'IN' was not declared in this scope; did you mean 'vde::brep::IN'?
error: 'ON' was not declared in this scope; did you mean 'vde::brep::ON'?
error: call of overloaded 'face_bounds(const vde::brep::BrepModel&, int)' is ambiguous
- candidate 1: anonymous ns definition (line 434)
- candidate 2: vde::brep forward declaration (line 42)
error: 'get_mesh' was not declared in this scope
error: 'core' has not been declared (in 'core::exact_orient3d')
error: 'SSIBooleanResult' does not name a type
error: 'curves' is not a class, namespace, or enumeration
error: expected declaration before '}' token
```
## Root Causes
1. **ClassResult enum moved to header** (`ssi_boolean.h:51`) but values (IN/ON/OUT) used unqualified in anonymous namespace
2. **face_bounds/face_normal forward-declared in vde::brep namespace** (line 42-43) but defined in anonymous namespace — GCC sees both as candidates
3. **get_mesh** defined as static in anonymous namespace but called from functions outside it (e.g., `classify_face_fragment`)
4. **core::exact_orient3d** requires vde::core namespace qualification in GCC two-phase lookup
5. **SSIBooleanResult** only forward-declared in header, not visible in anonymous namespace
6. **curves::intersect_surfaces** lookup fails when `using namespace vde` not in scope
## Suggested Fix
**Root cause**: The merge of VDE-016 moved ClassResult from anonymous namespace to the public header, but `ssi_boolean.cpp` on main had three separate issues:
1. `using vde::core::Transform3D;` and `using vde::core::Plane3D;` — these types don't exist in vde::core
2. Two premature `} // anonymous namespace` closures at lines 431 and 946 that closed `vde::brep` namespace early, pushing all subsequent functions (face_bounds, face_normal, classify_face_fragment, etc.) to global scope where BrepModel was not visible
3. Duplicate forward declarations of `extract_face_fragment` and `classify_point_adaptive` inside the anonymous namespace that created ambiguity with the actual definitions in `vde::brep`
**Fix applied (v1.0.1)**:
1. Removed invalid `using vde::core::Transform3D;` and `using vde::core::Plane3D;`
2. Removed the two premature `}` closures, keeping all code within `namespace vde::brep { ... }`
3. Removed unused forward declarations from anonymous namespace
GCC 10.2.1 `-fsyntax-only` passes cleanly (0 errors).
## Known-Good Version
`ssi_boolean.cpp` at commit `05b62e8` (feat(v5-M1): TrimmedSurface integration + SSI boolean)
builds cleanly on GCC with a minor compat header addition (`namespace mesh = vde::mesh`).
## Current ViewDesign Workaround
Reverted `ssi_boolean.cpp` to 05b62e8. Only this one file is reverted; the other 48+
vde_brep .cpp files use latest API. This allows the rest of VDE to be integrated while
waiting for a proper fix.