Commit Graph

3 Commits

Author SHA1 Message Date
茂之钳 6d3f8fc8b3 fix(sdf): use GE/LE instead of GT/LT for smooth blend bounds
CI / Build & Test (push) Failing after 37s
CI / Release Build (push) Failing after 29s
When d1==d2, smooth blend exactly hits k/4 bound at h=0.5, so
EXPECT_GE/EXPECT_LE are correct instead of EXPECT_GT/EXPECT_LT.
2026-07-24 07:02:52 +00:00
茂之钳 6a3c0d633e fix(sdf): correct difference test expected value
CI / Build & Test (push) Failing after 34s
CI / Release Build (push) Failing after 38s
op_difference(2.0, -3.0) = max(-2.0, -3.0) = -2.0, not -3.0
2026-07-24 07:02:26 +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