You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 11, 2024. It is now read-only.
I got this exception after performing a welding operation:
IndexOutOfRangeException: Index was outside the bounds of the array.
The exception is thrown by GetPrimaryPolygonDescribers() in SurfaceUtility.cs
From what I understand, the code is unable to find 3 non-colinear vertices because it is given 4 vertices at the same location.
(Btw, I think this code could be improved to be more robust by using an intermediate variable in the for-loop instead of using the variable vertexIndex3)
Steps to reproduce:
Create a box
Go to vertex editing mode
Weld 4 top vertices togheter using 'Weld selection to Mid-Point'
Go to face editing mode
Select the object in the hierarchy in order to select all the faces
[EDIT] I use Unity Version 2019.4.1f1 (LTS)
[EDIT2] After some debugging, it seems we never remove any polygon in EndWeld() because the method TryRemoveExtraneousVertices() doesn't allow polygons with less than 3 vertices. It makes sense because this is the definition of a polygon... but this is inconsistent with the final phase of EndWeld() that expects this behaviour (there is a comment that says 'remove faces that now have < 3 vertices')