8a19e265cd
S10-A: B-Rep modeling 补齐 - fillet: 恒定半径滚动球倒圆(NURBS 曲面构建 + 相邻面裁剪) - chamfer: 等距倒角(平面偏移 + 倒角面构建) - shell: 完整抽壳(顶点偏移 + 内外面 + 开口侧壁) S10-B: STEP AP203/AP214 导入 - ISO 10303-21 解析器(1,424 行) - 支持 14 种几何实体 → NurbsCurve/NurbsSurface 转换 - 完整拓扑链:VERTEX_POINT → EDGE_CURVE → EDGE_LOOP → ADVANCED_FACE → CLOSED_SHELL → MANIFOLD_SOLID_BREP - 装配支持:NEXT_ASSEMBLY_USAGE_OCCURRENCE + CONTEXT_DEPENDENT_SHAPE_REPRESENTATION S10-C.1: STEP AP214 导出 - export_step / export_step_file - 曲线/曲面类型自动检测简化输出 S10-C.2: B-Rep 级布尔运算 - brep_union / brep_intersection / brep_difference - 面-面求交 + 内/外分类 + 面缝合 S10-C.3: B-Rep 工程验证 - ValidationResult: 水密性/悬边/自相交/方向一致性/欧拉示性数 测试: 5 个新测试文件,47 项测试(modeling/STEP导入/导出/布尔/验证) 修改: 7 files (+576/-47) | 新增: 13 files (4,141 行) 总计: +4,670 行
36 lines
1.0 KiB
C++
36 lines
1.0 KiB
C++
#pragma once
|
|
#include "vde/brep/brep.h"
|
|
#include <vector>
|
|
#include <string>
|
|
#include <limits>
|
|
|
|
namespace vde::brep {
|
|
|
|
/// Comprehensive validation result for B-Rep models.
|
|
struct ValidationResult {
|
|
bool valid = true;
|
|
std::vector<std::string> errors;
|
|
std::vector<std::string> warnings;
|
|
|
|
/// Fraction of edges with exactly 2 adjacent faces (1.0 = perfect)
|
|
double watertightness = 1.0;
|
|
|
|
/// Fraction of face pairs that don't intersect except at shared edges
|
|
double self_intersection_free = 1.0;
|
|
|
|
double min_edge_length = std::numeric_limits<double>::max();
|
|
double max_edge_length = 0.0;
|
|
size_t non_manifold_edges = 0;
|
|
size_t dangling_edges = 0;
|
|
size_t inconsistent_orientations = 0;
|
|
size_t total_edges = 0;
|
|
size_t total_faces = 0;
|
|
};
|
|
|
|
/// Perform comprehensive validation on a BrepModel.
|
|
/// Checks watertightness, orientation consistency, self-intersection,
|
|
/// edge length bounds, Euler characteristic, and closed shells.
|
|
[[nodiscard]] ValidationResult validate(const BrepModel& body);
|
|
|
|
} // namespace vde::brep
|