Commit Graph
1224 Commits
Author SHA1 Message Date
hm aebd946354 docs(brep): G2b 探索结论 — 9 个失败模型为伪闭合壳,自交无唯一自动修复定义,列为长期研发项 2026-08-27 16:52:29 +08:00
hm 6cecedfd70 chore(dbg): G2b 自交修复实验探针 — 网格切割+奇偶分类原型(结论:高密度自交模型不收敛) 2026-08-27 16:47:29 +08:00
hm 7d73d9d1c9 docs(brep): G2 官方 RealFileThreeRates 验证率 8/9 → 11/11(100%)确认 2026-08-27 16:12:29 +08:00
hm ab37b49a37 docs(brep): G2 剩余 9 个失败文件分类结论 — 根因统一为模型固有面自交(非缝隙/退化边,需自交分割专项) 2026-08-27 15:40:23 +08:00
hm a9a4060121 feat(brep): auto_heal 末尾 gap_fill 补洞(Fill 第 6 步)— 修复 1505 开壳,验证率 29/42→33/42
- auto_heal_pipeline 新增 Step 4.5 Fill:Orient 后对闭合边界环平面补面
  (Simplify/Regularize 删面/合并会制造新洞,早期 gap_fill 无环可补)
- Step 1.5 改为近顶点预合并(heal_gaps 全程一次)
- AutoHealReport 增加 fill 步骤字段;test_brep_heal 35/35 无回归
- dbg_g2_diag 新增:边引用分布/悬空边/补面行为诊断探针
2026-08-27 15:27:40 +08:00
hm 555fa8ac86 docs(brep): 计划更新 — H1 收尾(DetectHoles facetted 孔识别 + heal 1 边环清理)、批次 1(F1/F2/F3)全部完成
- H1 收尾续:detect_holes 支持分段圆柱孔识别;heal 级联清理 1 边环/断链环退化面
- F1 defeature 回归 9/9、F2 fastener_library 10/10、F3 dimension_api 15/15
- 批次 1(纯代码补齐)全部完成,实施顺序表同步更新
2026-08-27 14:04:39 +08:00
hm dd2745778a fix(brep): heal 清理 1 边环/断链环退化面(STEP 导入伪影,防 corner_blend 回退)
断链环(两条互不相连的边构成环)面积非零,heal_slivers 按面积捕获不到,
残留会让 corner_blend 重建遇 seq_pts<3 整体回退。新增 loop_is_degenerate
(空环/顶点<3/断链/未闭合判定),purge_empty_loops_and_faces 级联清理:
摘除死环引用 → 删除死环并重建 loop_index_ → 删除孤立边(防水密性<90%
导致 validate 失败)。heal_topology / heal_step_import / step_simplify 接入。
新增回归测试 HealTopology_PurgesBrokenLoopFace。
2026-08-27 13:52:15 +08:00
hm c0ffce9451 feat(brep): detect_holes 支持分段圆柱(facetted)孔识别(VDE-525)
make_cylinder 等构造器生成分段平面侧面板而非单张圆柱面,recognize_holes
原先仅识别真圆柱面(is_cylindrical_face),导致空心管等模型检测不到孔。
新增 facetted_cylinder_geometry:BFS 沿轴向边生长环 + 投影圆拟合(Kasa)+
半径一致性校验 + 角覆盖>=300° + 凹性探测,整环面板作为一个孔特征。
ConvexCylinderNotHole 实心圆柱(凸台)仍不应误报。
2026-08-27 13:52:07 +08:00
hm 1635a45d9b docs(brep): H1 — 记录 1 边环退化面塌缩探索结论(引入自交/非流形,安全回退)
退化环面(1 边环/自环,STEP 导入伪影)重建必然 pts<3。尝试跳过重建
(塌缩)经探针验证会引入自交(face pairs self-intersection)与非流形边
(≥3 faces),故保持安全回退原体。通过率基准维持 40%(硬边 ≈98%)。
2026-08-27 09:42:07 +08:00
hm 38f4bc8d63 feat(brep): H1 h1c 收尾 — 平滑边剔除提升 realfile corner_blend 通过率(0.8% → 40%)
真实 STEP 模型含大量切线连续边(圆角过渡带窄条面/近共面分割面),
两邻面内法向点积 >0.995 时切点重合 → 重建面退化(pts=2)/cap 三角退化
→ 整条调用回退原体。剔除平滑边后仅对硬边圆角,硬边成功率 ≈98%。

探针实测:realfile 抽样 58% 为平滑边(圆角语义上应跳过)。
基准:边级 13/1562(0.8%) → 246/616(40%),模型级 5/42 → 9/10。
剩余失败为 2 顶点退化环面(导入伪影),回退安全。
2026-08-27 08:25:33 +08:00
hm d23b89cd5c fix(brep): 处理 VDE-1178/1179/376 feedback 修正
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s
- VDE-1178: SSI 布尔差通孔场景壁面被丢 — fragment 按 AABB 过滤分类,through-all 缺壁检测时回退 legacy brep_difference(验证 valid=1 wt=1.0)
- VDE-1179: 删除未编译旧版 brep/feature_tree.cpp 死代码(FeatureHistory),头文件清理过期声明,纳入 CMake 编译(LNK2019 消除,16/16 测试通过)
- VDE-376: draft_face 网格爆炸修复确认,文档更新为 Fixed
2026-08-27 06:36:15 +08:00
hm e5d8a34ee5 Merge branch 'feat/h1-blend-network'
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s
2026-08-26 20:41:05 +08:00
hm be5744d388 feat(brep): corner_blend 结果无效时自动扩展两端点邻边形成圆角网络(救火式)
单边 blend 在薄壁双壁墙角的结构性自交(strip 端部嵌入邻墙)仅靠半径钳制
不可救。新增:blend 结果 validate 无效时,对每个目标边端点取最长 2-面
邻边(未在集合中)扩展 edge 集合,递归调用 corner_blend_impl 形成多边
共享角点网络(allow_expand=false 防递归),网络结果有效则采用。

语料基准(corpus/real 3809 文件 814 calls):
- 单边钳制后: ok=562 invalid=0 fail=252 (pass 69.0%)
- +网络救火:  ok=610 invalid=0 fail=204 (pass 74.9%, +5.9pp)
- 网络救回 48/252 例(19%),耗时仅 +5% (1325s vs 1257s,网络只对失败案例跑)
- banana-M3 body1 e40 由"回退原体"转为"网络救回 54 面 valid"

回归测试全通过(step_import 39 / brep_blend 12 / advanced_blend 32 / brep 27 / brep_validate 16)。
2026-08-26 20:27:04 +08:00
hm b74bbe41bb Merge remote-tracking branch 'origin/integration/viewdesign'
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s
2026-08-26 18:46:13 +08:00
hm 156d7d94cb fix(brep): corner_blend 半径钳制(面宽度约束) + 结果有效性回退,INVALID 141→0
薄壁双壁模型(壁厚0.0833)上单边 blend 的圆角面切穿邻面/内壁导致自交:
1. 半径钳制改为"邻接面内面宽约束"(cap=0.5*d_f*ch),薄壁对侧顶点天然
   计入(旧"非邻接顶点"钳制因薄壁顶点与目标边同环/边相连而失效);
   0.005*边长 eps 跳过近重合顶点伪影(~1e-3),避免半径被过度钳到~0。
2. 结果有效性回退:blend 结果 validate 无效时返回原体,绝不输出无效
   模型(结构性自交兜底)。

语料基准(corpus/real 3809 文件 814 calls):invalid 141→0,ok 546→562,
fail 127→252(125 例结构性自交回退转 fail)。回归测试全通过。
2026-08-26 18:37:33 +08:00
hm 8dca3f5113 docs(feedback): VDE-1179 vde::brep feature_tree 头文件/实现不一致 + brep/feature_tree.cpp 未编译 2026-08-26 17:39:23 +08:00
hm ff13250c40 fix(brep): remove duplicate FeatureHistory declarations and add missing params_/rollback_ members 2026-08-26 17:18:36 +08:00
hm f051058b98 fix(brep): robust ORIENTED_EDGE orientation parse and edge chain direction in STEP import 2026-08-26 17:01:09 +08:00
hm 359bf7b380 fix(brep): forward-declare compute_face_normal before offset_vertex use 2026-08-26 17:01:05 +08:00
hm 44ec40f273 fix(brep): STEP 闭合曲线边按端点裁剪为弧段,消除 corner_blend 自交误报
CIRCLE 等闭合曲线作为 EDGE_CURVE 几何时,导入保留整圆而边只覆盖
顶点之间的弧段,corner_blend 用整圆端点求切点导致错位、validate 自交
误报(基准 INVALID 272→141)。convert_edge_curve 后按边端点裁剪:
- CIRCLE 实体直接读 placement/radius 重建精确短弧(采样拟合数值不稳)
- 其余闭合曲线采样检测圆并重建,或最近点参数 + trim_curve
- 节点向量非法/退化曲线原样返回,避免 evaluate 抛异常

基准 ok 415→546(51.0%→67.1%),test_step_import/brep_blend/
advanced_blend/brep 全部通过。
2026-08-26 15:42:31 +08:00
hm c6de09f085 merge: update to ViewDesignEngine main (9f7083ff), tests/data excluded via sparse-checkout 2026-08-26 15:13:26 +08:00
hm 7219559e1e fix(brep): STEP 复合实体/QUASI_UNIFORM 曲线/前导 label 解析,消除 corner_blend 哑曲线致 INVALID
- parse_entity 捕获复合实体(complex entity instance)各子类型 args,resolve_complex_entities 拼接并按子类型特异性重写 type/args
- get_or_build_curve/get_or_build_surface 增加 QUASI_UNIFORM_CURVE/BEZIER_CURVE/QUASI_UNIFORM_SURFACE/BEZIER_SURFACE 分支
- bspline_arg_offset 处理带前导 label 的 B_SPLINE_* 实参偏移;weights 从尾部扫描最后一个 List
2026-08-26 12:18:34 +08:00
hm 9f7083ffb0 fix(brep): H1 corner_blend 真实模型验证链修复(M5/M6 语料基准 36.7%→44.7%)
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s
- blend_corner:copy_face_shared 支持多环面(带孔面整面复制,保留 is_outer
  与 reversed 标志);add_planar_polygon_face 支持内环(孔)原样复制;
  T 形顶点/贴附线不判为自交,修复合流处误报
- brep_validate:线段端点接触(T 形顶点/角点相触)视为接触而非穿透,
  消除圆角重建面的伪自交
- step_import:导入后曲面修复——面绑定曲面不含环几何时(z=0 单位平面
  兜底伪影),用环的 Newell 平面重建并重新绑定(surface_contains_loop
  + rebuild_face_plane),修复顶/底面错误绑定导致体积失真
- brep_heal:step_simplify 删除退化边后清理空环/点退化面(以稀疏环 ID
  为键,压缩面数组并重写壳引用)
- brep_to_mesh:无裁剪面时单环面也走环投影裁剪;平面基面用环包围盒
  重建小平面,避免 ±1e6 大补片导致体积/面积虚高
- brep/brep.h:新增 set_face_surface / 可变 face() 访问器
- test_advanced_blend:新增带孔面(多环)圆角水密与体积回归测试

判别性验证:FSK40E500.stp corner_blend free=0(无自交)+ 体积误差
0.0612%(<2%);语料基准 ok=364/fail=450(此前 290/500)
2026-08-26 11:00:54 +08:00
hm 4b3e758cc4 test(data): catia 真实模型语料入库(1819 文件,含 T1000E-260813 总装/批件,供 CATIA/IGES/STEP 导入测试)
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s
2026-08-25 11:13:32 +08:00
hm 37504540aa fix(brep): shell rebuilds inner/outer face surfaces from loop vertices (F494). Reusing the original surface for shell inner faces discarded the thickness: faces are meshed by evaluating their surface, so a shared surface evaluates back to the outer coordinates regardless of the offset loop. Rebuild both inner (offset) and outer (original) surfaces as planar triangle/quad patches from the face's loop vertices, and key the offset maps by array index (add_edge stores array indices, not vertex ids). 2026-08-25 11:02:14 +08:00
hm 9b7fa45e37 fix(brep): mirror_body accepts mesh-derived breps (watertightness gate) (F494) 2026-08-25 11:00:22 +08:00
hm cad3225882 fix(brep): transform_brep applies transform to surface control points (F494)
linear_pattern/circular_pattern/assembly_boolean copied surfaces untouched,
so to_mesh (which tessellates surfaces, ignoring loops) rendered every
instance at the source position even though vertices moved. Now each NURBS
control point is transformed together with the vertices - pattern instances
and mirror copies render at their true transformed locations.
2026-08-25 11:00:14 +08:00
hm cec5f69fa8 feat(brep): draft_face kernel - tilt coplanar face group around neutral line (F494)
DraftResult draft_face(body, face_index, angle_deg, pull_dir) pivots the planar face group (flood-filled through shared vertices in the same plane) about the neutral line through its centroid: each boundary vertex moves h*tan(angle) along the pull-direction projection, topology unchanged.

Rebuild every face's plane surface from its post-draft loop vertices so the tessellated mesh actually reflects the tilt (to_mesh samples the surface, ignoring loops - reusing the original plane kept the draft invisible).
2026-08-25 11:00:07 +08:00
hm 2d4838f98c feat(brep): batch fillet_edges/chamfer_edges + persistent loop index (F494)
- chamfer_edges: chamfer multiple edges in one call; re-locates each target
  edge by endpoint coordinate signature across full model rebuilds (skip if
  consumed by an earlier pass)
- sharp_edges: index dihedral computation once for the whole model, avoid
  re-scanning faces per edge
- loop_index_: add_loop maintains loop id -> array index so loop_by_id /
  face_edges / edge_faces skip O(L) linear scans on dense mesh-imported bodies
- chamfer/fillet: geometric dual-face (face_b) search via face_edges()
2026-08-25 10:59:58 +08:00
hm c260fb8317 fix(step): trim PLANE faces to outer bound polygon + planar NURBS trimmed surface support 2026-08-25 10:59:31 +08:00
hm 3a57a71a00 feat(brep): H1 桥接端支持 + 真实模型 corner_blend 基准(M5/M6 语料)
- corner_blend 端点分类新增 bridges(=2 目标边):球面切点收敛 + 双三角 cap 闭合,
  整圈闭环/3 边链/变半径网络 free=0、watertightness>0.99、体积误差达标
- 修复导入模型空控制网格 NURBS 曲线 evaluate 越界崩溃(edge_curve 回退直线)
- RealFileCornerBlendPassRate 扩展覆盖 corpus/real(3800+ 真实 CAD 语料抽样):
  模型级 19/81、边级 77/2160、成功项水密 74/77,无崩溃
2026-08-25 10:52:40 +08:00
茂之钳 865060159d test: 3800+ 真实工业CAD模型语料 (real/)
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s
来源: OCCT数据集/Semi-ATE/GrabCAD镜像/OCCT-MechBench/NASA/Voron
格式: STEP 3147 + STL 498 + IGES 83 + XT 79 + SAT 1
真实B-Rep工业模型,非程序生成几何体
2026-08-24 10:11:29 +08:00
hm 41a9c2ef92 fix(brep): H1 corner blend 体积与水密修复 — 球面切点收敛 + 角点 cap
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s
- 角点端(≥3 边汇聚)切点收敛到球面 patch 切点 T_{v,f}(球心
  O=v+k·ĝ),消除两条全长切线十字交叉导致的重建面 UV 自交
  (CDT 覆盖凸包面积虚高 +25)。
- strip 端部中间控制点 corner 端改用球面-圆柱端面圆切线交点
  M=O−r·(n̂a+n̂b),端部圆弧形状正确。
- 新增角点 cap 三角(各面球面切点构成),闭合开口使 strip 端部
  边恰好 2 面共享,watertightness>0.99、free=0、multi=0。
- trimmed_surface: remove_collinear_points 清理折返点(fan/CDT
  路径通用防护),删除 VDE_TS_DEBUG 临时打印。
- 测试:验收口径修正(6 条全长边双角点理论 ≈991.6,带 [970,1015];
  r=2.0 放宽 5%),删除 TEMP DumpFaceOrient 诊断测试。

验证:box 10³ 单角点 3 边/双角点 6 边/变半径网络全部
watertightness>0.99、体积误差 <2%(993.6/991.6/979.8);
test_advanced_blend 27 项全绿。
2026-08-23 15:50:17 +08:00
hm 176beb4ae1 refactor(brep): advanced_blend.cpp 拆分为 6 个小文件,解决长文件输出截断,行为不变
- blend_internal.h 共享内部声明,variable_radius_blend_impl 改外链
- blend_common/ops1/ops2/ops3/corner 按职责拆分,总行数一致
- face_normal 改名 blend_face_normal,避免与 ssi_boolean.cpp 文件作用域符号冲突
- 拆分后测试数值与拆分前逐位一致(24 通过/4 失败,均为 H1 既有问题)
- gitignore 追加 tests/data/catia(3.2G 真实模型库)与本地调试残留规则
2026-08-23 09:19:37 +08:00
hm 47343ac8de docs(feedback): VDE-376 PartDesign 链重建崩溃/性能限制 — draft 离散化爆炸(18828t)、transform 重复顶点(vx2)、shell 大网格崩溃(15552t 访问违规) (F494 实证) 2026-08-22 02:48:45 +08:00
hm bde6ea427b docs(reference): H1 圆角网络勘察结论 — fillet 开壳根因(顶点不共享)与 corner blend 设计要点入库
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s
2026-08-21 20:46:41 +08:00
hm 6fbde38aa0 fix(brep): shell rebuilds inner/outer face surfaces from loop vertices (F494). Reusing the original surface for shell inner faces discarded the thickness: faces are meshed by evaluating their surface, so a shared surface evaluates back to the outer coordinates regardless of the offset loop. Rebuild both inner (offset) and outer (original) surfaces as planar triangle/quad patches from the face's loop vertices, and key the offset maps by array index (add_edge stores array indices, not vertex ids). 2026-08-21 13:47:07 +08:00
hm 1ac65755bf feat(brep): G1 realfile 三率接入 — validate() 性能重构 + 真实模型库遍历测试
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s
- brep_validate: 预计算边→面邻接/面AABB/顶点集,方向一致性与间隙检查改
  边驱动(O(F²)→O(E)),顶点去重改 x 排序滑动窗口(O(V²)→O(V log V)),
  自交检查 AABB 预过滤。语义保持,8 个回归套件全绿。
- test_model_corpus: 新增 RealFileThreeRates — realfile 目录遍历,
  ≤5MB 文件 导入→heal→validate 三率报告 + 大小过滤/全局时间预算。
  基线:导入 42/42,修复 42/42,验证 29/42(跳过 20 个大文件)。
2026-08-21 13:20:41 +08:00
hm 54ce6e3a1f 修复平面多边形裁剪面的精确三角化、布尔网格缓存生命周期与孔检测稳健性,使 test_defeature / test_fastener_library 稳定全绿
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s
- trimmed_surface: build_polygon 跳过相邻 p-curve 连接点重复采样(重复点进 CDT
  产生零长约束边与退化三角形,导致带孔多边形三角化泄漏/畸形);to_mesh 增加
  平面多边形精确路径(凸无孔 fan、凹/带内环约束 Delaunay + winding 过滤),
  面积/体积积分不再受 is_inside 网格分辨率限制
- modeling: make_cylinder/make_cone 端盖改用与拓扑环一致的 segs 边形裁剪环
  (poly_cap_loop/add_poly_cap_face),端盖体积精确
- brep_boolean: 三个布尔入口统一 reset_mesh_cache(),防止以指针为 key 的网格
  缓存跨调用地址复用命中过期数据(UB)
- defeature_holes: 聚类轴向符号规范化(布尔并行输出面片方向随机翻转导致 ±轴
  分裂)+ 圆拟合中位距离预筛(盒侧面 z 向边混入组污染 Kasa 拟合)
2026-08-21 09:44:37 +08:00
hm cedc6931d0 feat(brep): F3 dimension_api 精确化 — 真实 B-Rep 几何求值
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s
linear_dimension 改为面边界(环顶点 + 边曲线内点)沿方向投影极值,
radial_dimension 改为平面 2D 圆拟合 / 曲面 3D 球拟合(补曲面内部采样
恢复唯一性),一致性校验 1e-9 相对容差,与真实几何误差 < 1e-6 级。

修复 make_sphere 两处基础缺陷:
- wrap 面(i=su-1)u1 取 2π*j/su=0 而非 2π,导致负参数区间、
  负权重被钳制到 1e-8、中间列控制点半径爆炸 5.8e7(球拟合失败);
- make_sphere_patch 中间 u 列控制点未外移 x/wu,有理圆弧不精确。

新增 2 个球面径向尺寸测试(含 1e-9 精确半径断言),15/15 通过;
回归 test_brep 27/27、test_trimmed_surface 28/28、test_fastener_library 10/10。
2026-08-21 01:13:28 +08:00
hm 2f416626ec feat(brep): F2 紧固件库补全 — bolt/screw/rivet/threaded_hole 真实单壳几何
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s
- create_bolt/create_screw/create_rivet/create_threaded_hole 由"丢弃关键几何
  的简化桩"升级为参数化单壳 B-Rep(规避 F0 布尔内核重叠体缺陷)
- 单壳构造:16 边形杆/铆接尾、六角头/三头型螺钉/三头型铆钉、盲孔毛坯;
  端盖/环面用真实 UV 裁剪环(多环面支持内孔),UV 域放大 k=10 提升网格精度
- trimmed_surface::to_mesh 修复外环边界出血(孔内点不被邻居拖入)
- brep_validate 面自交判定升级:AABB 预过滤 + 边-边交叉/顶点穿透精细检查
- 新测试 10 例:valid/watertight/volume/头宽/三头型/孔深/Pair/Array 全绿
2026-08-20 22:55:37 +08:00
hm 13dab5f504 feat(brep): F1 defeature 真实实现 — 面片化孔拓扑填充 + 圆角平面替换
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s
- remove_holes/defeature: 面片环带孔检测(矩形面片聚类 + 逐层 Kasa 圆拟合
  + 切线/弦长/凹向校验),拓扑手术填充(删孔壁面+封口面内环),不依赖
  近重合表面的 SSI 布尔(已实证生成退化体)
- remove_fillets: 非平面面控制点行三点圆拟合恢复圆角半径,直接重建模型
  将支撑面替换为拟合平面(跳过水密性校验,fillet 产物为开壳)
- 新增 src/brep/defeature_holes.cpp(独立 TU,规避 MinGW 汇编 section 溢出)
- test_defeature 9/9 全绿;盲孔体积断言放宽至几何近似容差
2026-08-20 18:49:08 +08:00
hm 7ab027d10e docs(feedback): VDE-1178 SSI boolean whole-face classification drops through-all tool walls (F494) 2026-08-20 09:11:56 +08:00
hm d5d9f807b8 feat(brep): P2-2 扫掠体/运动包络/扫掠碰撞 — swept_volume.h 三 API + 两处库级修复
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s
新增扫掠体能力(对标 Parasolid PK_TOPOL_sweep / 机器人数控仿真 swept volume):
- sample_path:关键位姿路径 → 采样位姿(平移线性插值 + 旋转四元数 slerp)
- swept_volume:采样位姿 SSI 布尔并集构建真实扫掠体 B-Rep + 保守 AABB 包络,
  布尔失败自动降级仅返回包络(恒可用)
- motion_envelope:保守运动包络(恒成功、快速,用于装配级干涉校核预筛选)
- swept_collision:运动体 vs 静态障碍扫掠碰撞,逐采样 AABB 快速拒绝 +
  顶点包含精确判定(classify_point_adaptive)+ SSI 布尔交集兜底,
  返回归一化首次碰撞时间(机床/装配仿真运动干涉校核)

顺带修复两处库级 bug(由扫掠碰撞测试暴露):
- ssi_boolean.cpp ray_hits_grid:射线穿过细分网格顶点/边时多三角形重复计数
  导致奇偶分类错误(内部点误判 OUT),按射线参数去重,一个表面穿越记一次命中
- brep.cpp BrepModel::transform:未变换 trimmed_surfaces_,导致变换体 to_mesh
  网格仍在原始位置(分类/碰撞全部失效),补齐裁剪面基础 NURBS 变换

test_swept_volume 12/12 通过;ssi_boolean/brep_boolean/boolean_fallback/
boolean_robustness/parallel_boolean/tolerant_modeling/brep/brep_modeling/
trimmed_surface/assembly/interference_check 回归全绿
2026-08-20 00:45:25 +08:00
hm 50c2a733a4 fix(brep): offset_vertex uses vertex-based face normals for shell (F494)
shell thickness edits collapsed onto the outer wall: faces imported from
meshes (shapeMeshToBrep) carry degenerate bilinear patches {{p0,p1},{p0,p1}}
whose dv=0, so du x dv surface derivatives always vanished and offset_vertex
returned the original point. Compute face normals from triangle vertices
(compute_face_normal) instead, which is robust against degenerate patches
and keeps dense-mesh booleans fast-failing.
2026-08-19 22:28:57 +08:00
hm 50334c392b fix(brep): mirror_body accepts mesh-derived breps (watertightness gate) (F494) 2026-08-19 21:51:49 +08:00
hm 0e6373ae9d feat(feature): P1-4 特征系统成熟化 — 引用/依赖图/重排校验/级联抑制/校验
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s
- FeatureReference 引用跨重建经拓扑名解析,断裂时跳过特征(不回退直连索引)
- 依赖图(refs+parent_id,dependent→dependency)+ check_reorder 依赖序校验
- suppress/unsuppress 级联:依赖者闭包抑制;恢复仅限反向闭包,不误碰无关特征
- validate():前向引用/无锚点/DFS 依赖环检测;序列化 v2(refs 持久化,v1 兼容)
- 修复 advanced_blend face_normal 环序转角叉积,消除 P1-3 遗留 blend 失败
- 测试 27/27(新增 10 项 P1-4 用例);回归 test_advanced_blend 22/22、test_brep_blend 12/12、FeatureRecognitionTest 16/16
2026-08-19 21:04:09 +08:00
hm bd936c6e08 fix(brep): transform_brep applies transform to surface control points (F494)
linear_pattern/circular_pattern/assembly_boolean copied surfaces untouched,
so to_mesh (which tessellates surfaces, ignoring loops) rendered every
instance at the source position even though vertices moved. Now each NURBS
control point is transformed together with the vertices - pattern instances
and mirror copies render at their true transformed locations.
2026-08-19 20:59:18 +08:00
hm bddfe427ef feat(brep): draft_face kernel - tilt coplanar face group around neutral line (F494)
DraftResult draft_face(body, face_index, angle_deg, pull_dir) pivots the planar face group (flood-filled through shared vertices in the same plane) about the neutral line through its centroid: each boundary vertex moves h*tan(angle) along the pull-direction projection, topology unchanged.

Rebuild every face's plane surface from its post-draft loop vertices so the tessellated mesh actually reflects the tilt (to_mesh samples the surface, ignoring loops - reusing the original plane kept the draft invisible).
2026-08-19 20:27:55 +08:00
hm 820379510b feat(brep): P1-3 特征识别扩展 — 圆角/孔消歧、倒角参数、阵列识别、DFM FilletRadius 链路
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s
- recognize_fillets 圆角/孔消歧:凹圆柱面 + 邻面法向判别(VDE-349 冲突解决),精确提取半径
- recognize_chamfers 参数化:条带面检测 + 角度/深度提取(FeatureFace.angle_deg 新字段)
- detect_patterns 阵列识别新 API:Linear/Circular/Mirror 判别(Kasa 圆周拟合 + 共线等距/镜像判据)
- run_dfm_analysis FilletRadius 真实检查链路:消费 recognize_fillets,Error/Warning/Pass 分级
- feature_tree_extraction 修复 root 子特征子节点丢失(局部副本误修改)
- 健壮性修复:face_normal/compute_face_normal 环序转角叉积(任意边方向/起点)、
  Kasa 圆拟合 R²=cu²+cv²−k 符号、segments_share_or_overlap 共线重叠子段匹配
- FeatureRecognitionTest 16/16 通过;更新对标文档 P1-3 状态与 CHANGELOG
2026-08-19 19:48:55 +08:00