-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Triangulator for dummies #324
Comments
Hi @Artorias93, I've seen your message in #134. In short, yes, this is possible (with some restrictions). Best, |
Omg, thank you for your flash reply! |
Hi @Artorias93, I've started pushing components into the package codebase, required for the feature, and designing the proper implementation following all the tests we've conducted in the #134 thread. I believe the best approach would be to provide two additional utilities (with possible parameter overloads) in the
The first utility will be a function that handles everything, modifying Mesh in place after a successful triangulation. Internally, it will call the second utility. The second utility will provide more advanced functionality but will require additional work from the user (MeshData, NativeList, etc.). It will offer full native support with customization and can be executed using Below is a draft of the API (subject to change). My goal is to implement this properly and, I hope, release it next month. If you have any suggestions or feature requests regarding the API, please let me know. I will also continue researching the issues mentioned in #134. Best, public static class Utilities { ...
public enum UVMap { None, Planar, Barycentric };
public enum Axis { XY, XZ, YX, YZ, ZX, ZY }
public static void RetriangulateMesh(Mesh mesh, TriangulationSettings settings, Allocator allocator,
Axis axis = Axis.XY,
UVMap uvMap = UVMap.None,
int uvChanelIndex = 0,
bool recalculateBounds = true,
bool recalculateNormals = true,
bool recalculateTangents = true
)
{ ... }
[BurstCompile]
public struct RetriangulateMeshJob : IJob
{
RetriangulateMeshJob(MeshData meshData, NativeList<int> triangles, NativeList<Vector3> positions, NativeList<Vector2> uvs, Args args, Allocator allocator,
Axis axis = Axis.xy,
UVMap uvMap = UVMap.None,
int uvChanelIndex = 0,
... )
{ ... }
public void Execute() { ... }
} |
Hi @andywiecko!
Thank you so much for your work!
I think it might be useful to have a method that accepts as parameters only a mesh, a parameter of type TriangulatorSettings (with default, customizable value) and eventually a bool for UVs support, and performs input reclamation so as to provide Triangulator with the ones it expects, in the correct format.
Ideally, it would be a method that completely ignores everything about the mesh, whether it is convex, concave, whether it has holes, whether it does not, and returns the mesh processed by Triangulator correctly (perhaps even with support for remapping UVs).
Something like:
Do you think it could be possible?
The text was updated successfully, but these errors were encountered: