fibermesh tips

17 views
Skip to first unread message

Lyn Fong

unread,
Mar 25, 2010, 4:09:39 PM3/25/10
to cs224...@googlegroups.com
Hi guys, the following exchange may be useful to you in your endeavors:

a student asked about calculating C_target for border vertices.

Spike's answer:

Here's a way to compute C_target:
 
1. Compute the scalar curvature of the curve in some plane (more below)
2. Use that scalar curvature (or twice it, or half of it) as the target mean curvature.
 
Why compute the curvature in some PLANE rather than in space? Because you can assign a SIGN to it then (+ or -).
 
What plane? Well, let's suppose the points of the curve are X(i) = [x(i), y(i), z(i)], and you're computing at point i of the curve.
 
(o). If the curve is actually in a plane (like the first curve you drew to make the very first shape), compute the planar curvature (see steps iii and iv), using x and y rather than u and v.
 
i. Estimate the curve tangent by computing T = X[i+1] - X[i-1].
ii. build a plane-basis using (i) n, the unit surface normal at X[i], and (ii) t = T/ ||T||, the normalized tangent.
iii. compute the points of the curve in the (n, t) basis:  u(i) = n dot X[i]; v(i) = t dot X[i]. Alternatively: put all the X's into one tall array, with rows indexed by "i" and columns corresponding to x, y, and z. Multiply by the 3 x 2 matrix whose first column is n' and whose second is t' (where " ' " means "transpose"). This gets you an n x 2 array of points in (n, t) coordinates.
 
iv. Call these uv-pairs U(i) = (u(i), v(i))  [yeah, it's ugly]. Then you need to compute
  k =  (u' v'' - u'' v') / ( (u')^2 + (v')^2) ^ (3/2).
 
Here's how you estimate u': you say u'(i) = [u(i+1) - u(i-1)]/2.
And for u'', you say u''(i) = u(i+1) + u(i-1) - 2u(i)
 
Similar stuff for v. Use these to compute k.

--
-Lyn Fong

Lyn Fong

unread,
Mar 25, 2010, 4:48:14 PM3/25/10
to cs224...@googlegroups.com
Some more helpful stuff:
(quoted from Andrew Nealen, primary FiberMesh author -- hope you find
them useful)


I just stepped through our reference implementation of the
FiberMesh inflation algorithm. The stitched mesh is flat, but
we then offset all interior vertices (=non-boundary vertices)
along their respective
(normalized) normals with the average edge length of the
mesh. This way we overcome the curvature singularity along
the boundary curve.

From this initial mesh we compute the initial scalar mean curvatures,
using the area weighted cotan formula. Referees asked us to
call this "laplacian magnitudes" (the LMs), which we didn't
feel strongly enough about to put up a fight. But
essentially, these are indeed discrete scalar mean curvatures.

In the subsequent curvature diffusion step, we set the
Laplacian constraint weights, as well as the curvature
constraints along the boundary vertices to 1.0, but allow the
interior vertices scalar curvature values to vary more by
setting the constraint weight to 0.1.
I just tried setting the weights of the boundary curvature
constraints to 0.1 as well, which works almost as well as the
0.1/1.0 weights, but it takes more iterations to diffuse the
boundary curvatures into the interior, depending on how fine
the mesh is tessellated. This mesh dependence is a direct
result of using the graph Laplacian instead of the area
weighted Laplace/Beltrami operator. It's unfortunate, but
necessary for performance.

Schneider/Kobbelt essentially fix the boundary curvature in
their application, which makes sense in their setting (they
know the boundary geometry). Since we have only guessed a
boundary curvature from an initial offset from the flat mesh,
we allow these scalar curvature values to change, which is
why the setting of 0.1 for the weight on the boundary
constraints makes sense. This is what we meant with "Unlike
Schneider and Kobbelt, where the curvature is fixed at the
boundary, these initial target LMs are likely to change in
subsequent iterations", and we could have been clearer about
this in the paper :)

So, what we do in our code is simply fix the weights to 0.1
for interior vertices and 1.0 for boundary vertices in the
curvature diffusion step.

Then I recompute eta, the normals, the deltas, and finally v.

Sounds good. But, as so often, the weights need some
tweaking. For example, we have experienced better behavior
when weighting the third term in Eqn (10) (the edge
constraint term) with a value significantly smaller than 1.0.
In fact, the edge weights are mostly important for the
initial inflation, and can be pretty much ignored (i.e. set ot
zero) when there are "enough" control curves. Nonetheless, we
use a weight of 0.1 throughout all iterations for the edge
length constraints.


I think I missed a few details... The curvatures are constrained
on all mesh vertices in the diffusion step, not only on the
boundary (even when they are mostly zero in the first
diffusion step). Not constraining the interior curvatures
(i.e. setting their constraint weights to 0) can lead to very
unstable, oscillatory behavior, since the position
calculation "overshoots" the ideal result. Just to be clear,
I mean the weight on the 2nd term in Eqn (6) in the paper.

So, in Eqn 6 (which is the same as Eqn 8 -- used both for the
curvature diffusion and average edge length diffusion) you
need to separate the vertices into two sets: fixed (on
curves), and free. The weights for the first term (smoothness
term) are 1.0 for all vertices.
For the second term, use 1.0 for fixed vertices, and 0.1 for
free vertices. This works great for initial inflation, if you
have "guessed" some scalar curvature for the fixed vertices,
and set c=0 everywhere else. As previously mentioned, we
achieved this by simply offsetting the free vertices by the
average edge length in both directions. This is illustrated
on slide 8 of our siggraph slides here

http://www.cs.rutgers.edu/~nealen/research/fibermesh.ppt

In Eqn 10 we again use w=1.0 for the first term, w=100.0 for
the fixed position constraints, and a small weight w=0.01 (or
even 0.001) for the third term (the edge length constraints).
Anything larger than
0.01 will cause the mesh to self intersect during the initial
inflation. Maybe this is why you were seeing the "mountain range"
instead of a smooth surface. I'd suggest starting with
w_edgelen = 0.0, and increasing this value until you like the results.
--
-Lyn Fong

Marek Vondrak

unread,
Apr 13, 2010, 2:29:36 AM4/13/10
to cs224...@googlegroups.com
Hi Guys,

using the proper weights makes a big difference! I just coded the
inflation algorithm and used uniform weights for everything. And the
results were a disaster. The mesh even self-intersected, etc. I then
read this email and only changed the weights according to the advice
from Nealen and the results are great now.

-Marek

John F. Hughes

unread,
Apr 13, 2010, 6:20:28 AM4/13/10
to cs224...@googlegroups.com
Thanks, Marek.

I meant to say that I'd had similar experience last year when coding some of
this stuff, but completely forgot about it.

-Spike

> --
> To unsubscribe, reply using "remove me" as the subject.
>


Reply all
Reply to author
Forward
0 new messages