-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I ran into issue where calling function convhull_3d_build multiple times with the same input causes different results. The bug exist only when used with CONVHULL_3D_USE_SINGLE_PRECISION.
Repro:
#include <stdlib.h>
#define CONVHULL_3D_ENABLE
#define CONVHULL_3D_USE_SINGLE_PRECISION /* optional */
#include "../convhull_3d.h"
int main(int argc, const char * argv[])
{
ch_vec3 vert[] =
{
{ 4.243597, 2.029179, -0.815667 },
{ 4.417669, 0.039982, -0.928770 },
{ -2.428492, 1.198822, 3.519505 },
{ -2.254420, -0.790374, 3.406402 },
{ 3.153918, 2.029179, -2.492747 },
{ 3.327990, 0.039982, -2.605850 },
{ -3.518171, 1.198822, 1.842424 },
{ -3.344099, -0.790374, 1.729321 },
};
for (int ii = 0; ii < 10; ++ii)
{
printf("%d\n", ii);
int* indices = NULL;
int numFaces;
convhull_3d_build(vert, 8, &indices, &numFaces);
free(indices);
}
return 0;
}Program hits this assert:
Line 923 in 88eca3c
| assert(detA>0.0); |
> gcc bug.c -lm -o bug; and ./bug
0
1
2
bug: ../convhull_3d.h:923: convhull_3d_build: Assertion `detA>0.0' failed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working