Refactor depth surface handling and unify depth sampling rules

- Removed the `always_vertex` parameter from `build_surface_camera` to streamline depth sampling for cutouts and ensure consistent behavior across depth plane and panorama.
- Updated depth sampling logic to ensure that all free boundary points, including the original frame of the depth plane, use neighboring face depth instead of their own texture sampling.
- Adjusted the depth mask deletion process to operate on faces rather than points, eliminating the need for additional cleanup of dangling edges.
- Ensured that the cutout rules are consistently applied across all relevant nodes, removing exceptions and simplifying the logic.
- Updated tests to verify the new behavior, ensuring that cutout points follow the depth of adjacent faces and that the original frame maintains its depth sampling.
- Refactored geometry handling in multiple depth-related nodes to improve clarity and maintainability.
This commit is contained in:
2026-09-16 16:30:56 +08:00
parent 7f69630371
commit c62ec2cd48
28 changed files with 880 additions and 173 deletions

View File

@@ -43,11 +43,11 @@
边界判据保持「只有一个相邻面」,再与「顶点越出对称面容差」求交,判断按顶点而非边的平均位置。落在对称面上的切口环在合并后已是共享边,再生成侧壁只会得到退化面或三面共享边。
### 两个两圈渐变平滑
### 切口环与衔接带两个平滑
`Seam Smooth` 与 `Fill Smooth` 语义对齐 `Boundary Smooth`:都只移动面内分量、锁定对称轴,并都把中心字段模糊两圈形成渐变。
`Seam Smooth` 与 `Fill Smooth` 都只移动面内分量、锁定对称轴。
`Seam Smooth` 作用于折叠后的切口环,减少切边的面内量化折线;`Fill Smooth` 作用于界外轮廓,即补面的外侧端点,按两圈渐变把轮廓向内部松弛,随后从平滑后的轮廓构建侧壁,因此侧壁自然跟随轮廓。补面的细分始终存在,不再以 `Fill Smooth > 0` 为开关;`Fill Smooth = 0` 只表示不平滑。
`Seam Smooth` 作用于折叠后的切口环,减少切边的面内量化折线,按两圈渐变衰减,并按 `pinned-geometry-smoothing` 的 `Pin Boundary` 与 `Pin Sharp` 处理。`Fill Smooth` 作用于 front 的衔接带,即界外轮廓与对称面上的切缝共同围出的边界带,按四圈渐变向内松弛,随后从平滑后的轮廓构建侧壁,因此侧壁自然跟随轮廓;衔接处不是网格边界,只保留 `Pin Sharp`。补面的细分始终存在,不再以 `Fill Smooth > 0` 为开关;`Fill Smooth = 0` 只表示不平滑。
两个平滑都在镜像之前完成,两半保持一致,且都与 Fill Sides 无关:关闭补面时 `Fill Smooth` 没有轮廓可作用,`Seam Smooth` 照常作用。

View File

@@ -6,7 +6,7 @@
- 对称节点的切口统一为「把越过对称面的顶点折叠到对称面,删除整体贴平的面与内部贴平边」,使零厚度与非零厚度输入的切边落在同一位置。
- 补面只连接不落在对称面上的边界边。落在对称面上的切口由镜像后的合并直接焊成接缝,不再生成侧壁。
- 新增 `Seam Smooth` 与重定义 `Fill Smooth`,都与上游 Boundary Smooth 同类:只移动面内分量、锁定对称轴,并按两圈渐变从切口环或界外轮廓向内部衰减。
- 新增 `Seam Smooth` 并重定义 `Fill Smooth`:两者都只移动面内分量、锁定对称轴;`Seam Smooth` 按两圈渐变松弛切口环,`Fill Smooth` 按四圈渐变松弛 front 的衔接带,锚点为界外轮廓与对称面上的切缝,因此对称轴上的点同样参与。
- 补面细分始终存在,不再以 `Fill Smooth > 0` 为开关;`Fill Smooth` 平滑界外轮廓,侧壁从平滑后的轮廓构建。
- 不引入布尔、裁切算子、细分或新增采样参数。

View File

@@ -66,7 +66,9 @@ Fill Sides 生成的侧壁 SHALL 只连接不落在对称面上的边界边,
### Requirement: 切边平滑独立控制
`Seam Smooth` SHALL 控制切口环的面内平滑次数,`Fill Smooth` SHALL 控制界外轮廓的面内平滑次数。两者都只移动面内分量并锁定对称轴坐标,影响范围按两圈渐变从中心向内部衰减。侧壁细分 SHALL 始终存在,不以 `Fill Smooth > 0` 为开关。`Seam Smooth` 为 0 SHALL 保持原始切口,`Fill Smooth` 为 0 SHALL 保持原始轮廓;两个参数 SHALL 互不影响,且都与 Fill Sides 独立。
`Seam Smooth` SHALL 控制切口环的面内平滑次数,`Fill Smooth` SHALL 控制 front 衔接带的面内平滑次数。两者都只移动面内分量并锁定对称轴坐标。侧壁细分 SHALL 始终存在,不以 `Fill Smooth > 0` 为开关。`Seam Smooth` 为 0 SHALL 保持原始切口,`Fill Smooth` 为 0 SHALL 保持原始轮廓;两个参数 SHALL 互不影响,且都与 Fill Sides 独立。
`Seam Smooth` 按切口环的两圈渐变衰减,切口环按 `pinned-geometry-smoothing` 的 `Pin Boundary` 与 `Pin Sharp` 处理。`Fill Smooth` 的锚点 SHALL 是 front 的完整边界带,即界外轮廓与对称面上的切缝,SHALL 按四圈渐变衰减并覆盖对称轴上的点;衔接处不是网格边界,因此 MUST NOT 套用 `Pin Boundary`,只保留 `Pin Sharp`。
#### Scenario: 切边平滑保持切口落在对称面
@@ -77,9 +79,15 @@ Fill Sides 生成的侧壁 SHALL 只连接不落在对称面上的边界边,
#### Scenario: 两个平滑参数互不影响
- **WHEN** 只改变 Fill Smooth 或只改变 Seam Smooth
- **THEN** 前者只改变界外轮廓及其侧壁,后者只改变切口环及其两圈渐变范围
- **THEN** 前者只改变衔接带及其侧壁,后者只改变切口环及其两圈渐变范围
- **AND** Seam Smooth 为 0 时切口保持原始形态,Fill Smooth 为 0 时轮廓保持原始形态且侧壁仍保持细分
#### Scenario: 衔接带覆盖对称轴
- **WHEN** Fill Smooth 大于 0
- **THEN** 界外轮廓与对称轴上的点都产生面内位移
- **AND** 位移从完整边界带向内按四圈渐变衰减
#### Scenario: 关闭补面仍可平滑切边
- **WHEN** Fill Sides 关闭且 Seam Smooth 大于 0

View File

@@ -9,15 +9,15 @@
## 2. 节点测试
- [ ] 2.1 断言输出不存在越过对称面的顶点、整体贴平面的面或四面共边
- [ ] 2.2 断言 Fill Sides 开启时网格封闭、边与顶点流形、镜像成立,并覆盖零厚度与非零厚度输入
- [ ] 2.3 断言 Fill Sides 关闭时切口自焊,落在对称面上的边没有开边
- [x] 2.1 断言输出不存在越过对称面的顶点、整体贴平面的面或四面共边
- [x] 2.2 断言 Fill Sides 开启时网格封闭、边与顶点流形、镜像成立,并覆盖零厚度与非零厚度输入
- [x] 2.3 断言 Fill Sides 关闭时切口自焊,落在对称面上的边没有开边
- [ ] 2.4 断言 Seam Smooth 大于 0 时切口对称轴坐标不漂移,且按两圈渐变影响切口邻域
- [ ] 2.5 断言节点组不含布尔节点,接口只新增 Seam Smooth
- [x] 2.5 断言节点组不含布尔节点,接口只新增 Seam Smooth
## 3. 验证
- [x] 3.1 运行 `uv run node-group build --skip-tests` 并确认资产重载校验通过
- [ ] 3.2 更新节点测试后运行 `uv run pytest tests/tools/nodes/test_cutout_symmetry.py`
- [ ] 3.3 运行受影响的 Cutout 对象创建测试
- [x] 3.2 更新节点测试后运行 `pytest tests/tools/nodes/test_cutout_symmetry.py`,全部通过
- [x] 3.3 运行受影响的 Cutout 对象创建测试
- [x] 3.4 记录样例上折叠前越界量分布,作为折面跨度的验证证据