gradientspace / geometry3Sharp

C# library for 2D/3D geometric computation, mesh algorithms, and so on. Boost license.
http://www.gradientspace.com
Boost Software License 1.0
1.71k stars 389 forks source link

UV unwrapping of custom mesh #51

Open Perissinotto opened 6 years ago

Perissinotto commented 6 years ago

Hi! I am using Unity and I would like to dynamic unwrap a mesh during the game. The problem is that UnityEditor namespace (that contains the only unwrap function) cannot be used in standalone version (.exe). So I am searching an alternative way to do so. Since this library works with mesh geometry I searched a function to UV unwrap custom mesh in an automatic way but I didn't found any. I was wondering if this feature is implemented or there is some future plan to do it. Thanks anyway for the great work.

rms80 commented 6 years ago

MeshLocalParam can be used to do local unwraps. I have not yet implemented any energy-based parameterization/unwrap techniques. I'm not familiar with the unity function, I don't know if it inserts cuts into closed meshes, but that is something separate from the unwrapping algorithms, generally. Same goes for allocating texture space. That would be outside the scope of this library, I think.

You might have a look at https://github.com/Microsoft/UVAtlas, this is a command-line tool but you could call it at runtime to generate UVs.

Perissinotto commented 6 years ago

Thanks a lot for the reply. I will try