texture-driven-mesh-fitting

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Texture-Driven Mesh Fitting

纹理驱动的网格拟合

This skill fixes the common failure: a texture is mapped correctly, but the mesh silhouette underneath is wrong. The mesh adapts to the source contour; the texture is not stretched to hide a wrong mesh.
本方法可解决一个常见问题:纹理映射正确,但下方的网格轮廓却存在错误。 网格会适配源轮廓,而非通过拉伸纹理来掩盖网格的错误。

Preconditions

前置条件

  • Structural parts are segmented (
    source-part-segmentation
    ).
  • Each part has a contour/mask and, if textured, an atlas region (
    atlas-uv-fitting
    ).
  • The object is source-locked in front X/Z before depth is added.
  • Canonical view policy is resolved (
    multiview-constraint-solver
    ) if views conflict.
  • 结构部件已完成分割(
    source-part-segmentation
    )。
  • 每个部件都有轮廓/遮罩,若已添加纹理,则对应一个图集区域(
    atlas-uv-fitting
    )。
  • 对象在添加深度前已在X/Z前向轴上锁定源位置。
  • 若视图存在冲突,已通过
    multiview-constraint-solver
    解决规范视图策略问题。

Workflow

工作流程

  1. Extract source contour from the texture/wireframe region.
  2. Extract current mesh boundary in the same projected coordinate space.
  3. Build ordered contour correspondence by arc length, named landmarks, or seam/control points.
  4. Move boundary vertices to source contour positions.
  5. Move interior vertices by smooth interpolation, piecewise-affine warp, or thin-plate-spline style deformation.
  6. Preserve UV parameterization by remapping boundary-fitted local coordinates into the atlas rectangle.
  7. Re-render overlay; do not proceed to look-dev until texture-region silhouette passes.
  1. 从纹理/线框区域提取源轮廓。
  2. 在相同的投影坐标空间中提取当前网格边界。
  3. 通过弧长、命名标记点或接缝/控制点建立有序的轮廓对应关系。
  4. 将边界顶点移动到源轮廓位置。
  5. 通过平滑插值、分段仿射变形或薄板样条(thin-plate-spline)风格变形移动内部顶点。
  6. 通过将边界拟合后的局部坐标重新映射到图集矩形,保留UV参数化。
  7. 重新渲染叠加层;在纹理区域轮廓通过验证前,不要进入外观开发(look-dev)阶段。

Acceptance gates

验收标准

  • Per-part source/product bbox center and size within tolerance.
  • Boundary maximum sample error below tolerance after normalization.
  • Texture atlas region does not visibly bleed outside the fitted mesh in front view.
  • Named landmarks (
    leaf_tip
    ,
    base_left
    ,
    base_right
    ,
    face_corner
    , etc.) pass
    landmark-fit-repair
    .
  • 每个部件的源/产品包围盒(bbox)中心和尺寸在公差范围内。
  • 归一化后的边界采样最大误差低于公差值。
  • 正视图中,纹理图集区域未明显超出拟合后的网格范围。
  • 命名标记点(
    leaf_tip
    base_left
    base_right
    face_corner
    等)通过
    landmark-fit-repair
    验证。

Hard rules

硬性规则

  • If a texture crop has a different silhouette than the mesh, reshape the mesh first.
  • Do not use global UV stretching to hide geometry mismatch.
  • Boundary fitting must happen before side-depth/crown deformation.
  • Do not tune material/light to compensate for geometry/UV misfit.
  • 若纹理裁剪区域的轮廓与网格不同,先重塑网格。
  • 不要使用全局UV拉伸来掩盖几何形状不匹配的问题。
  • 边界拟合必须在侧部深度/顶部变形前进行。
  • 不要通过调整材质/灯光来弥补几何形状/UV的不匹配。

Scripts

脚本

  • scripts/contour_correspondence_report.py
    reports bbox, centroid, and sampled contour deltas between a source mask and a render/object mask.
  • scripts/contour_correspondence_report.py
    :用于报告源遮罩与渲染/对象遮罩之间的包围盒(bbox)、质心以及采样轮廓差值。

Sources distilled

参考来源总结

  • Piecewise-affine/landmark warping gives a practical mesh deformation model.
  • Thin-plate-spline style deformation is appropriate for smooth mascot/logo surfaces when landmarks are sparse.
  • Blender mesh vertices/UV layers can be edited directly; BMesh is useful for cleanup after deformation.
  • 分段仿射/标记点变形提供了实用的网格变形模型。
  • 当标记点稀疏时,薄板样条风格变形适用于平滑的吉祥物/标志表面。
  • 可直接编辑Blender网格顶点/UV层;变形后使用BMesh进行清理十分有用。