In the question posted here...:
Geometry nodes - Align Instance object to face orientation
...a very usefull solution was provided to the problem of aligning instances in Geometry Nodes to the normal, while rotating the normal to have one axis of the normal face the closest edge of the face.
In my use case I would need to have one particular axis of the normal (say, the X-axis) to face the longest edge of the face.
So, is there a way to align the Z axis to point in the direction of the normal while the X-axis always points to the longest edge on the face?
In the above screenshot, the Z-Axis is aligned to the normal, using the solution in the above mentioned link. Also in some cases the X-Axis is pointing towards the longest edge (solution aims at aligning to closest edge). However, in some of the cases the X or Y-axis are not aligned to any edge. My aim is to have the X-axis always point to the longest edge, wich is always the edge of the face that is pointing outwards of the model.
Please note that the instances (gizmo's) in this screenshot are only on selected faces, which are the faces that face each other, and not the faces that are pointing in or out of the model. Any possible answer does not need to take this feature into account (is a problem already solved).
Thank you!!
Blend file here: https://www.dropbox.com/s/zoeoo7sqvv9pfjp/Align%20to%20normal%20and%20longest%20edge.blend?dl=0