18 Commits
Author SHA1 Message Date
hm 3d55e1a181 feat(sdf): CPU LBVH SDF sampling + OpenCL program cache (1.0.155) 2026-11-05 00:12:12 +08:00
hm b23271b8d7 fix(mesh,sdf,spatial,collision): 网格算子修复 + 缺失算法补齐(EPA / mesh→SDF / 细分)
网格:
- repair_mesh 早退(remove_duplicates 后直接 return,补洞/定向/去退化从不执行)
  修复为完整流水线:cube 带孔 boundary 4→0、watertight 0→1、体积 0.833→1.0。
- automatic_hole_filling 扇形绕向与退化闭合三角形修正(boundary 4→0、体积恢复)。
- 曲率 cotan 权重错用中心角 → 改为对边角 cotan,并修正 H=|L|/4A
  (单位球 avg|H| 41.08 → 1.0082)。
- alpha_shapes_surface API 内焊接+统一朝向(boundary 28 → 0)。
- QEM 简化增加折叠合法性/体积守卫(旧实现 80% 简化体积漂移 60.4%;仍为部分
  修复,深度保持待拓扑重写,见路线图)。
- 测地热法符号/尺度/质量矩阵归一化重写 + 源点钉零(立方体对角 0.970 → 1.589,
  解析 2.236;仍列路线图)。
- 新增 include/vde/mesh/subdivision.h + loop_subdivide(Loop 细分:cube
  F 12→48、V=26、boundary=0、Euler=2)。

SDF:
- cone SDF 重写(底面中心 -2.0→0、顶点上方 2.828→2.0、侧面/内部符号正确)。
- 新增 include/vde/sdf/sdf_from_mesh.h + sdf_from_mesh(最近点 + 射线奇偶符号):
  单位立方体 -0.5/0/+1.5、球面 ±1.0 内。

空间/碰撞:
- BVH query_range 叶层补三角形 AABB 精确测试(33 → 14 命中与暴力一致);
  query_knn 改精确点-三角形距离(小规模精确,随机 300 三角形用例仍待查→路线图)。
- GJK 距离重写为最近点单纯形(球间隙 1.736→1.000000),gjk_full 正确填充
  point_a/point_b。
- 新增 include/vde/collision/epa.h + epa_penetration(EPA 扩展多面体):
  重叠盒 depth=0.5、球 depth=0.5、分离 valid=false。

测试:test_mesh_repair / test_alpha_shapes / test_smooth / test_mesh_curvature /
test_geodesic / test_mesh_lod / test_sdf_primitives / test_sdf_to_mesh /
test_bvh / test_gjk 以及既有 test_mesh_robustness 全部通过(mesh 探针
PASS 59→71、FAIL 17→6、CRASH 1→0)。
2026-10-25 16:12:44 +08:00
hm b378b191da build(io/brep): VDE-006/013/067 依赖环解除 + 模块开关接线 + 裸 mesh:: 清理
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-006:新增集成层 vde_io 归集跨层 TU,依赖图变严格单向
io→brep→{sdf,mesh}→{curves,collision}→spatial→core→foundation,删除
-Wl,--start-group;BrepModel 桥接(brep_to_mesh/mesh_bridge)归 vde_brep。
移除兜底后暴露并修复两处反向依赖:core/icp.cpp→vde_spatial,
brep/parallel_boolean.cpp→vde::boolean(VDE_DEPS_brep 增 boolean)。

VDE-013:顶层解析 VDE_BUILD_*→VDE_ENABLE_*,VDE_DEPS_* 级联关闭,
src/ 与 tests/ 按 VDE_ENABLE_* 门控,使模块开关真正生效。

VDE-067:全仓裸 mesh:: 清理为完全限定名 vde::mesh::(正则命中 0)。

回归:全量构建 EXIT 0;test_icp/test_parallel_boolean/test_geometry_completion
全绿。既有缺陷(FEA 球面网格挂起、CAM in_range 哨兵、3MF 装配、时序竞态)
经取证与本批无关,记入 docs/reference/audit-feedback.md §5。
2026-10-07 06:39:07 +08:00
hm 780fd102f0 feat(sdf): VDE-141 SdfNode::hex_prism 支持独立半径/边数(radius,height,sides=6)
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
工厂原仅接收 height 且把 radius 硬绑等于 height。改为 hex_prism(radius,height,sides=6),SdfParams 增 sides;新增通用 regular_polygon_prism 精确 SDF(扇区折叠,sides=6 与旧 hex_prism 几何一致),evaluate 经其求值;bounds 半径随 radius/height 计算。python 绑定同步。

判别性测试 +7:test_sdf_tree 半径/高度独立、边数控截面、非法边数夹取;test_sdf_primitives 顶点共享、面法向精确距离。sdf 6 套全绿(tree 34、primitives 69、to_mesh 6、optimize 21、operations 33、gradient 51)。
2026-10-06 14:47:22 +08:00
茂之钳 8c2909f623 fix(VDE-479): implement scalar overloads for exact_predicates and single-point SDF convenience wrappers
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
- foundation/exact_predicates.h: add scalar (double) overloads for
  orient_2d, orient_3d, in_circle to avoid temporary Point object
  construction at the ViewDesign bridge layer
- sdf/sdf_torch.h: add evaluate_single() and gradient_single()
  convenience wrappers for single-point SDF queries
- VDE-479: mark items 2/3/4 as resolved (DWG comment already fixed,
  scalar overloads & single-point wrappers now implemented);
  item 1 (sdf_torch rename) remains Deferred by design
2026-08-05 04:47:27 +08:00
茂之钳 980cb32468 fix: remove remaining /* ... */ inside doxygen blocks
CI / Build & Test (push) Failing after 31s
CI / Release Build (push) Failing after 31s
2026-07-24 11:14:27 +00:00
茂之钳 ac4c4300ed docs: doxygen annotations for sdf + brep + capi 2026-07-24 11:09:45 +00:00
茂之钳 4c9ee4f760 docs: doxygen annotations for curves + mesh + sketch
CI / Build & Test (push) Failing after 29s
CI / Release Build (push) Failing after 38s
2026-07-24 11:04:04 +00:00
茂之钳 3064572072 fix: onion thickness — reapply correct formula
CI / Build & Test (push) Failing after 36s
CI / Release Build (push) Failing after 40s
2026-07-24 08:52:36 +00:00
茂之钳 2772c25aef fix: onion test expectations to standard abs(d)-thickness
CI / Build & Test (push) Failing after 45s
CI / Release Build (push) Failing after 36s
2026-07-24 08:50:55 +00:00
茂之钳 4660b186a1 fix: onion thickness, repeat boundary tie
CI / Build & Test (push) Failing after 31s
CI / Release Build (push) Failing after 31s
2026-07-24 08:49:24 +00:00
茂之钳 a323776fd3 fix: SDF nan/edge cases + B-Rep vertex index → ID fix + IGES 1-based DE + STEP cleanup
CI / Build & Test (push) Failing after 16m57s
CI / Release Build (push) Failing after 2m59s
2026-07-24 08:42:53 +00:00
茂之钳 b175db0342 feat(sdf): S12 — 可微分几何完整模块
CI / Build & Test (push) Failing after 39s
CI / Release Build (push) Failing after 32s
S12-A: 自动微分引擎
- sdf_gradient.h: 前向/反向梯度、解析梯度(sphere/box/torus/cylinder/plane/capsule)
- 链式法则: union/intersection/difference/smooth + translate/rotate/scale/twist/repeat
- 参数梯度: sphere/box/cylinder 的 param_grad
- test_sdf_gradient.cpp: 604 行测试

S12-B: 梯度驱动优化 + 应用
- sdf_optimize.h: 形状拟合/碰撞避免/可达性/对称检测/体积计算
- sdf_optimize.cpp: 682 行实现(数值梯度 + GradientDescent)
- test_sdf_optimize.cpp: 342 行,20 项测试

S12-C: PyTorch 集成 + Python
- sdf_torch.h/cpp: 批量 SDF 求值 + 梯度
- python/vde/sdf.py: 高级 Python API
- python/vde/torch_sdf.py: torch.autograd.Function
- test_sdf_torch_bridge.cpp: C++ 桥梁测试
2026-07-24 07:23:28 +00:00
茂之钳 08b5854c56 feat(sdf): S12-C PyTorch integration + Python bindings
CI / Build & Test (push) Failing after 16m59s
CI / Release Build (push) Failing after 42s
Add batch evaluation/gradient functions for SDF trees (sdf_torch.h/cpp).
Add sdf_gradient.h with finite-difference gradient utilities.
Add Python modules vde.sdf (high-level SDF API) and vde.torch_sdf (PyTorch autograd).
Add test_sdf_torch_bridge.cpp with batch eval/gradient tests.
Integrate into vde_sdf library and test suite.
2026-07-24 07:20:45 +00:00
茂之钳 89640cc33b fix: SdfNode constructor public for make_shared
CI / Build & Test (push) Failing after 37s
CI / Release Build (push) Failing after 37s
2026-07-24 07:10:17 +00:00
茂之钳 7c95dfa6fd fix: sdf — 移除重复 add_subdirectory,移除 C++20 <numbers>
CI / Build & Test (push) Failing after 31s
CI / Release Build (push) Failing after 31s
2026-07-24 07:05:57 +00:00
茂之钳 b7419a7881 feat(sdf): S11 — SDF 隐式建模完整模块
CI / Build & Test (push) Failing after 29s
CI / Release Build (push) Failing after 35s
S11-A: SDF 图元库
- 14 种基础形状(inline header)
- sphere/box/round_box/torus/capsule/cylinder/cone/plane/ellipsoid
- triangular_prism/hex_prism/link/wedge
- 2D 挤出(extrusion/extrusion_bounded/revolution)

S11-B: SDF 操作 + 域变形
- 锐利布尔: union/intersection/difference
- 平滑布尔: smooth_union/smooth_intersection/smooth_difference
- 修饰器: round/onion
- 域变形: repeat/mirror/rotate/translate/scale/twist/bend/elongate/displace/cheap_bend
- 24 项测试

S11-C: CSG 表达式树 + 网格转换 + Python 绑定
- SdfNode 树结构 — 工厂构造函数,递归求值
- sdf_to_mesh — 基于 marching_cubes 的 SDF→网格
- bind_sdf — pybind11 Python 绑定

文件: 14 文件,2,545 行(测试 1,296 行)
2026-07-24 07:04:55 +00:00
茂之钳 ebd29e2a21 feat(sdf): S11-B — SDF operations + domain deformations
CI / Build & Test (push) Failing after 38s
CI / Release Build (push) Failing after 31s
Add header-only SDF combinator operations and domain deformation
functions based on Inigo Quilez standard formulations:

Boolean operations:
- op_union (min), op_intersection (max), op_difference (max(-d1,d2))
- Smooth variants: op_smooth_union/intersection/difference with blend radius k
  with graceful fallback to sharp when k <= 0

Shape modifiers:
- op_round (d - r), op_onion (abs(d) - t/2)

Domain deformations (coordinate remapping):
- op_repeat (infinite grid repetition)
- op_mirror_x/y/z (with optional offset)
- op_rotate (Y-axis), op_translate, op_scale
- op_twist (Y-axis), op_bend, op_cheap_bend
- op_elongate, op_displace

All functions are inline in include/vde/sdf/sdf_operations.h.
Comprehensive unit tests in tests/sdf/test_sdf_operations.cpp covering
sharp/smooth booleans, modifiers, domain ops, and composition tests.
2026-07-24 07:02:03 +00:00