WISH : Make unroller more consistent

I wish the unroller always started from the first face of a mesh to unroll it.


Unroller inconsistent.gh (239.9 KB)

It “kinda” does, but not always, which is a big problem when you want to lay them on the XY plane and arrange them neatly for further processing.

I see what you mean.
The problem is though, the ordering of the face data of a mesh strip doesn’t necessarily have any connection to the actual order of those faces along that strip, so the first face in the face list could well be somewhere in the middle. This component looks through the face list until the first face it encounters which only has one adjacent face, then keeps that fixed while unrolling successive adjacent faces.
You could perhaps make the unroll for each strip as it is, and also after reversing the face order (which should result in the other end staying fixed), then choose which one to keep based on whichever criteria you think should define what counts as the geometric start of each strip (eg proximity to a particular curve).

1 Like

Hmmm… Or you could just look at the list of faces in order instead of randomly !
In my case, it would always pick the first face because it has no neighbor, and for a good reason : that’s how I built it…

Moreover, if you advertise this, it’s an incentive to build the mesh accordingly, and take control over these pesky unrollings.

It definitely doesn’t look at them randomly. As I said above, I believe it looks at them in exactly the order of the mesh face list data structure it is given. I’ll double check this though.

Well why would it bother going all the way through the list when the first item fits the criteria ?
That’s my point ! If the component was indeed predictable in it’s pick of the first face, I wouldn’t be struggling with this issue…

Reversing the face order doesn’t even work : those meshes that were flattened from the “wrong” end will still be flattened from the same face if I reverse the face order :

I had a look at my code and think I see where the issue is.
It does indeed use the first face of the list as the fixed one if that face has only 1 neighbour. It’s just that if the mesh is not triangulated it triangulates the mesh first.

The triangulation is necessary because there is no guarantee when it is given a quad mesh that every face will be perfectly planar. However, using the default triangulator, there’s no guarantee that the first triangle of the first end face is actually the triangle on the end.
I think I can change this so that it picks that triangle.

In the meantime though, if you triangulate your mesh before feeding it to the unroller, the first face in the list should always be the one that is kept fixed, provided it actually is an end face.

Hmm… well, the result is exactly the same if I triangulate my quads, because that’s also what your component does, and it does it in the exact same way.
But if I actually build a tri mesh myself, I can control which triangle face is first.

Thanks for your help, at least I know how to hustle my way out of this !

1 Like

It works with tris, indeed.

1 Like