Code: Select all
void
cpLoopIndexes(cpVect *verts, int count, int *start, int *end)
{
// ...
for(int i=1; i<count; i++){
// ...
if(...){
min = v;
(*start) = i;
} else if(...){
max = v;
(*end) = i;
}
}
}
Code: Select all
// Degenerate case, all poins are the same.
int start, end;
cpLoopIndexes(verts, count, &start, &end);
if(start == end){
I should probably submit a pull request but I'm being lazy, because I'm in the middle of porting.