OptCuts icon indicating copy to clipboard operation
OptCuts copied to clipboard

Mesh requirements to run OptCuts

Open lukkio88 opened this issue 5 years ago • 6 comments

Hi,

I've few scan meshes that I've remeshed and now I'm trying to run OptCuts to generate uv coordinates.

At first I got the error:

igl::opengl::glfw::Viewer usage:
  [drag]  Rotate scene
  A,a     Toggle animation (tight draw loop)
  F,f     Toggle face based
  I,i     Toggle invert normals
  L,l     Toggle wireframe
  O,o     Toggle orthographic/perspective projection
  T,t     Toggle filled faces
  Z       Snap to canonical view
  [,]     Toggle between rotation control types (trackball, two-axis
          valuator with fixed up, 2D mode with no rotation))
  <,>     Toggle between models
  ;       Toggle vertex labels
  :       Toggle face labels
Offline optimization mode
input mesh contains non-manifold edges or vertices
please cleanup the mesh and retry

So I took the mesh opened it in meshlab and removed the non manifold-edges and vertices. Then I run it again and I'm getting the error:

igl::opengl::glfw::Viewer usage:
  [drag]  Rotate scene
  A,a     Toggle animation (tight draw loop)
  F,f     Toggle face based
  I,i     Toggle invert normals
  L,l     Toggle wireframe
  O,o     Toggle orthographic/perspective projection
  T,t     Toggle filled faces
  Z       Snap to canonical view
  [,]     Toggle between rotation control types (trackball, two-axis
          valuator with fixed up, 2D mode with no rotation))
  <,>     Toggle between models
  ;       Toggle vertex labels
  :       Toggle face labels
Offline optimization mode
use b_d = 4.1
bijectivity ON
random 2-edge initial cut for closed surface
Error: Numerical issue.
***Element inversion detected: -0.0697798 < 0
mesh triangle count: 61691

But I have no clue what that error means. Is there's a specifc requirement for the mesh, because I can't figure how to clean up those scans after remeshing to lower the polycount and retopologize in order to run your tool.

Regards

lukkio88 avatar Jun 15 '20 17:06 lukkio88

So the second error is saying that the initial embedding is having inverted triangles due to numerical issue of Tutte's embedding algorithm, the program will automatically keep trying different "one-point cut" till the numerical issue go away. Did you wait for some extra trials? You can also try using 1 for the command line argument "initialCutOption", which initializes longer cut and will be less likely to have this issue. If it still didn't work, you may try using https://github.com/hankstag/progressive_embedding to get an initial embedding, and then use OptCuts with this gauranteed inversion-free initial embedding by choosing to use the input texture option.

liminchen avatar Jun 18 '20 13:06 liminchen

Hello, I have some .obj objects and I'm trying to apply optcuts to them. I keep getting the error input mesh contains non-manifold edges or vertices please cleanup the mesh and retry even after trying to clean them up in pymeshlab. I especially use the functions meshing_repair_non_manifold_edges and meshing_repair_non_manifold_vertices. I want to ask, if you have any best practice how to clear objects to be able to use optcuts. Thank you!

tobyy22 avatar Nov 04 '22 11:11 tobyy22

Sure. The mesh is edge-manifold if every edge is incident on one face (boundary) or two oppositely oriented faces. The mesh is vertex-manifold if the faces incident on each vertex form exactly one connected component, and all vertices are referenced. I don't know what meshlab do exactly. The best practice is to make sure an edge does not have more than 2 incident edges, there are no isolated vertices, no faces that are with the opposite normal to all its neighbors, not any faces are with exactly the same vertex indices and order, etc.

liminchen avatar Nov 05 '22 05:11 liminchen

The function we use to check whether a mesh is manifold is at https://github.com/libigl/libigl/blob/main/include/igl/is_vertex_manifold.h and https://github.com/libigl/libigl/blob/main/include/igl/is_edge_manifold.h

liminchen avatar Nov 05 '22 05:11 liminchen

Thanks for quick answer. And did you eventually find some method to manifold meshes? I would like to use Optcuts to unwrap meshes from the Shapenet dataset as a part of my project (I know they already have uv coordinates, but I would like to try to generate new ones with Optcuts). But pretty much all of them fail due to non manifoldness.

tobyy22 avatar Nov 08 '22 11:11 tobyy22

Sure, a possible way is to use fTetwild to generate tetrahedral meshes given the input of shapenet, and then take the surface of these generated tetrahedral meshes as the input to OptCuts. The surface mesh of fTetwild output must be manifold.

Best, Minchen

On Tue, Nov 8, 2022 at 3:04 AM tobiasvavroch @.***> wrote:

Thanks for quick answer. And did you eventually find some method to manifold meshes? I would like to use Optcuts to unwrap meshes from the Shapenet dataset as a part of my project (I know they already have uv coordinates, but I would like to try to generate new ones with Optcuts). But pretty much all of them fail due to non manifoldness.

— Reply to this email directly, view it on GitHub https://github.com/liminchen/OptCuts/issues/16#issuecomment-1307026568, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABU37N3RENVKUZIQQI6NIC3WHIXTPANCNFSM4N6LU33A . You are receiving this because you commented.Message ID: @.***>

liminchen avatar Nov 08 '22 16:11 liminchen