[tuhopuu-devel] LSCM -- triangulating before conformal mapping

Jean-Luc Peurière tuhopuu-devel@blender.org
Mon, 12 Apr 2004 18:39:34 +0200


Hi Bjornmoose, hi all

Because of the LCSM algorithm working only on tris, you said i could 
contribute by making the quad->tris parts and back, knowing that uv 
must be kept in sync (mface, tface). From there I have some questions :

- Do I am in the truth when I understand the parametrisation will be 
applied independantly on each chart ?

- if I understand correctly "Least Squares Conformal Maps for Automatic 
Texture Atlas Generation" paper, as we are looking at the faces 
normals, the segmentation and expand charts algorithms works as well on 
quads (did not look at actual graphite code but data structures are 
differents). That means that this part can be made on actual blender 
stuctures .  It implies that a quad belong to an uniq chart. Was this 
your actual plan ?

- To do the parametrization and construct the matrix we need tris, but 
as no flip can occur we know from start that the shared edge of the 2 
tris taken from a quad will have same uv coords in both tris. So we 
could keep the triangulation implicit, simply passing two tris to the 
matrix when encountering a quad mface. As there is 2 valid 
decomposition of a quad into tris, we simply need a flag to distinguish 
them. Note that for a non flat quad, one decomposition is much better 
than the other, the one along the diagonal curve with less curvature (a 
rough metric is easy to do by checking angles from center of faces).

- Constructed matrix is passed to superLU, and we get back 
corresponding UV

- validation and packing parts as described in paper. It may even be 
valuable to do this with graphite code.

when reconstructing UV in quad tfaces the second triangle give only 4th 
UV .

Only the validating part of the charts can be a little tricky as a 
degenerate quads can intersect themselves, but we cannot allow cutting 
it.

By keeping the triangulation implicit we have no bookeeping problems i 
suppose as things are kept in the original order and we need only to 
add a flag to tface.


Do I undestood your intents, and what do you think of this ?

Now what are the interfaces between the differents parts ?

In what file, do you plan to put functions ? editsima is the likely 
canditate, but perhaps LCSM should have his own file
-- 
Jean-luc