How to export UVs of a mesh with Box-Style Texture mapping correctly?

Hi, experts! I would like to export the mesh with Box-Style Texture mapping in the file below. However, it appears that the uv datas from Mesh.m_T is too large for the texture to map correctly to the face. I wonder how to obtain the correct uvs using OpenNurbs. Are there any transformations that need to be performed on the uv coordinates?
Here is the sample 3dm file.
simplify.3dm (2.2 MB)

@johnc - can you have a look at this?

@dale This is more @andy’s domain than mine.


The UVW scaling on the texture needs to be applied as the last transform in UV space.

In general there’s no guarantee that the ON_Mesh::m_T array has the correct texture coordinates. It’s best to set the texture coordinates before using them.
For texture mapping projections it is best to use ON_Mesh::SetCachedTextureCoordinates.
For Wcs and WcsBox projections something else needs to be done.

@johnc Do you know if there is an equivalent to CRhRdkTexture::WcsBoxMapping in openNURBS?


As far as I can tell, there isn’t. But it would be easy to add as it’s just a static function. If this will help the user please log it for me detailing everything [else] you need and I’ll add it.