# Fwd: fair() from polygon mesh processing package produces NaN points

4 messages
Open this post in threaded view
|

## Fwd: fair() from polygon mesh processing package produces NaN points

 Dear CGAL,I'm trying to use the fair() function in the polygon mesh processing package to fair the patch of a hole. I have the patch P, and I grabbed the N-rings of the vertices on the hole boundary to use as the constraint faces S. Denote the CGAL mesh M to be the union of P and S. I can then fair only the vertices of the patch using some pseudo-code like this:fair_vtsRange <- vts(P) \ vts(S) // S is not changing at allfair(M, fair_vtsRange, fairing_continuity(C)); // C = 0, 1, 2When C == 0, and the result looks fine (wireframe is shown):This shows the fair'ed patch and the constraint faces (used 10-rings, but even 1-ring would work).However I couldn't get fair() to produce any meaningful result when I set C = 1 or 2, no matter how big N-rings I have (below I also use 10-rings, which should be enough constraint).Meshlab gives me this error indicating the vertices of the patched region after fairing are invalid: "Warning mesh contains 92 vertices with NAN coords and 0 degenerate faces". Even though the hole appears to be not-patched, meshlab tells me there is 0 boundary. So the patch does exist, it's just the geometry is really bad.I know the fair() might be not be using the best linear solver and cotangent computation can give bad values if the angles are close to 0, but in this test example numerics should be fine.Any help is appreciated!- Yajie
Open this post in threaded view
|

## Re: Fwd: fair() from polygon mesh processing package produces NaN points

 Can you put a selfcontained program and data set on gidt.github.com pleaseOn 31 May 2019, at 00:09, Yajie Yan <[hidden email]> wrote:Dear CGAL,I'm trying to use the fair() function in the polygon mesh processing package to fair the patch of a hole. I have the patch P, and I grabbed the N-rings of the vertices on the hole boundary to use as the constraint faces S. Denote the CGAL mesh M to be the union of P and S. I can then fair only the vertices of the patch using some pseudo-code like this:fair_vtsRange <- vts(P) \ vts(S) // S is not changing at allfair(M, fair_vtsRange, fairing_continuity(C)); // C = 0, 1, 2When C == 0, and the result looks fine (wireframe is shown):This shows the fair'ed patch and the constraint faces (used 10-rings, but even 1-ring would work).However I couldn't get fair() to produce any meaningful result when I set C = 1 or 2, no matter how big N-rings I have (below I also use 10-rings, which should be enough constraint).Meshlab gives me this error indicating the vertices of the patched region after fairing are invalid: "Warning mesh contains 92 vertices with NAN coords and 0 degenerate faces". Even though the hole appears to be not-patched, meshlab tells me there is 0 boundary. So the patch does exist, it's just the geometry is really bad.I know the fair() might be not be using the best linear solver and cotangent computation can give bad values if the angles are close to 0, but in this test example numerics should be fine.Any help is appreciated!- Yajie