cross posting, since this is also pretty random: <...
# random
o
cross posting, since this is also pretty random: https://kotlinlang.slack.com/archives/C1JMF6UDV/p1749941627578469
s
Did you ask AI about it? Maybe one of all the models we have today gives a clue.
r
Your Zs are floats but you use a List of Int, so the sorting is done after casting, which could explain the results you are getting. Also this is quite inefficient
o
@Stefan Oltmann i didn't, but it would indeed have given a clue about the mistake, which was that the sorting key was the vertex index, rather than the z-coordinate itself. using
minOf
instead of
minBy
does what i intended
@romainguy the list of ints are indices into the vertex array. no casting, just a semi-opaque layer of indirection. i'll agree with you that it's inefficient, in addition to being not very readable
👍 1