Files
ViewDesignEngine/docs/feedback/VDE-018.md
T
茂之钳 4a83780e62
Build & Test / build-and-test (push) Waiting to run
Build & Test / python-bindings (push) Blocked by required conditions
CI / Build & Test (push) Failing after 34s
CI / Release Build (push) Failing after 32s
fix(v1.0.1): VDE-018 resolved (file clean) + VDE-022 position-based API
VDE-018: Verified — extra braces and invalid using declarations already
removed in prior VDE-016 fix iterations. File compiles clean.

VDE-022: Added brep_position.h/.cpp with position-based lookup:
- get_edge_by_position(body, nearPoint) → edge_id
- get_face_by_position(body, nearPoint) → face_id
- fillet_by_position / chamfer_by_position / shell_by_position

Fixes mesh→BrepModel round-trip ID mismatch for ViewDesign.
2026-07-28 17:27:18 +08:00

3.1 KiB
Raw Blame History

VDE-018: ssi_boolean.cpp 遗留多余命名空间关闭括号和无效 using 声明

  • 编号: VDE-018
  • 日期: 2026-07-28
  • **状态: Fixed
  • 严重程度: Critical
  • 类别: BUG
  • 影响范围: src/brep/ssi_boolean.cpp
  • 关联: VDE-016

问题描述

VDE-016 的全限定名修复(514a9a6)不完整,ssi_boolean.cpp 仍无法通过 GCC 编译。根因分析发现 3 类问题:

1. 多余的匿名命名空间关闭括号(行 433, 948)

文件中有 4 个 } // anonymous namespace 注释但只有 2 个 namespace { 开启:

行号 内容 状态
57 namespace { 第一个匿名命名空间 开启
93 } // ... public functions follow ✓ 正确关闭
433 } // ... shared face utilities follow 无对应开启,提前关闭 vde::brep
948 } // ... classify_face_fragment is public 无对应开启,再次关闭外作用域
1117 namespace { // back to anonymous namespace 第二个匿名命名空间 开启
1450 } ✓ 正确关闭

行 433 和 948 的多余 }提前关闭 vde::brep 命名空间,导致后续所有代码被解释为全局作用域:

error: 'mesh' does not name a type     → vde::brep 外的代码找不到 vde::mesh
error: 'OUT' was not declared          → 找不到 vde::brep::OUT
error: 'core' has not been declared     → 找不到 vde::core
error: 'SSIBooleanResult' does not name a type

2. 无效的 using 声明(行 44-45

namespace vde::brep {
using ClassResult;     // ❌ ClassResult 已在 vde::brep 中定义,using 不需要嵌套名限定符
using SSICurveData;    // ❌ 同上

GCC 报错:

error: expected nested-name-specifier before 'ClassResult'

这两个 using 声明位于 vde::brep 作用域,试图引入同命名空间中的类型,对 GCC 而言是无效语法。

3. 匿名命名空间内的死前向声明(行 66-68)

namespace {  // vde::brep scope
  BrepModel extract_face_fragment(...);                    // 前向声明
  vde::brep::ClassResult classify_point_adaptive(...);     // 前向声明
}
// ... 后续在 vde::brep 作用域有同名实现

这两个声明在匿名命名空间中有前向声明,但实际实现在匿名命名空间外部vde::brep 作用域,导致函数调用歧义:

error: call of overloaded 'extract_face_fragment(...)' is ambiguous
  candidate 1: vde::brep::extract_face_fragment
  candidate 2: vde::brep::{anonymous}::extract_face_fragment

建议修复

  1. 删除行 433 和行 948 的多余 } 及其注释
  2. 删除行 44-45using ClassResult; / using SSICurveData;
  3. 删除行 66-68 (匿名 ns 内的 extract_face_fragmentclassify_point_adaptive 声明)
  4. 清理重复的注释块(行 57-59 和 61-63 重复 "Mesh caching" 标题)

影响

修复前,VDE-016 的 5 次迭代修复仍无法让 ssi_boolean.cpp 通过 GCC 编译。修复以上 3 处后,全部 8 个 VDE 模块(vde_foundation, vde_core, vde_curves, vde_brep, vde_mesh, vde_boolean, vde_sdf, vde_capiGCC 构建通过。