CodeKnight & SubDivHero
CodeKnight CodeKnight
Hey, I've been thinking about writing a script that tweaks edge loops to keep a silhouette within a 2% tolerance while also trimming triangle count. Got any ideas for a clean algorithm?
SubDivHero SubDivHero
Sure thing. Start by triangulating the whole mesh, then identify the silhouette edges from the current camera view. For each silhouette edge, measure the angle between its two faces; if the angle is over a small threshold, that edge is a candidate for a new edge loop. Sweep the mesh in layers: for every loop you add, collapse any faces that exceed your triangle‑count goal, but only if collapsing them doesn’t change the silhouette by more than 2 %. Keep a running count of triangles and stop when you hit the limit. To keep the math clean, store each edge loop’s influence in a small table so you can rollback a change that blows the silhouette tolerance. After you finish, run a quick cleanup pass to remove any degenerate faces. If you track the final triangle count and silhouette error, you can drop the model into your ranking spreadsheet and see where it lands. Happy tweaking.