UV-coordinates for planar and non-planar faces

Hello,

when I use BRep_Tool::Triangulation() to get the UV-coordinates for each face of a solid (via UVNodes()), I noticed that for planar faces, the UV-values are in relation to the length and width of the face (i.e. the maximum value of U (V) corresponds to the length (width) of the face). On the other hand, for non-planar faces, the UV-values range from zero to one.

Is it possible to change this behaviour, so that the UV-values for non-planar faces are also in relation to the length and width of the face (measured along the surface)?
Or is there a possiblity to calculate the length of a face along the U- and V-direction (to do the scaling of the UV-values myself)?

The reason for asking is that I want to map a texture on the faces and therefore need the UV-coordinates as absolute values.

Thanks in advance,

Georg

Mariusz's picture

Hi Georg,

Have you found solution for this issue ?

Regards,
Mariusz

Benjamin Bihler's picture

Hi!

Computing face dimensions along UV-coordinate axes, might be done by interpolating UV-Points on the surface (see class Geom2dAPI_Interpolate), converting this curve to the space (see GeomLib::BuildCurve3d) and then measuring curve lengths in the space (see CPnts_AbscissaPoint).

Benjamin

Mariusz's picture

Hi Benjamin,

  Thank You, works like a charm.

Best Regards,
Mariusz