Merge branch 'master' into refactor
Conflicts: src/half_edge.c
This commit is contained in:
commit
0ecd0d8e9f
42
obj/plane_center_missing.obj
Normal file
42
obj/plane_center_missing.obj
Normal file
@ -0,0 +1,42 @@
|
||||
# This file uses centimeters as units for non-parametric coordinates.
|
||||
|
||||
v -0.500000 -0.000000 0.500000
|
||||
v -0.166667 -0.000000 0.500000
|
||||
v 0.166667 -0.000000 0.500000
|
||||
v 0.500000 -0.000000 0.500000
|
||||
v -0.500000 -0.000000 0.166667
|
||||
v -0.166667 -0.000000 0.166667
|
||||
v 0.166667 -0.000000 0.166667
|
||||
v 0.500000 -0.000000 0.166667
|
||||
v -0.500000 0.000000 -0.166667
|
||||
v -0.166667 0.000000 -0.166667
|
||||
v 0.166667 0.000000 -0.166667
|
||||
v 0.500000 0.000000 -0.166667
|
||||
v -0.500000 0.000000 -0.500000
|
||||
v -0.166667 0.000000 -0.500000
|
||||
v 0.166667 0.000000 -0.500000
|
||||
v 0.500000 0.000000 -0.500000
|
||||
vt 0.000000 0.000000
|
||||
vt 0.333333 0.000000
|
||||
vt 0.666667 0.000000
|
||||
vt 1.000000 0.000000
|
||||
vt 0.000000 0.333333
|
||||
vt 0.333333 0.333333
|
||||
vt 0.666667 0.333333
|
||||
vt 1.000000 0.333333
|
||||
vt 0.000000 0.666667
|
||||
vt 0.333333 0.666667
|
||||
vt 0.666667 0.666667
|
||||
vt 1.000000 0.666667
|
||||
vt 0.000000 1.000000
|
||||
vt 0.333333 1.000000
|
||||
vt 0.666667 1.000000
|
||||
vt 1.000000 1.000000
|
||||
f 1/1 2/2 6/6 5/5
|
||||
f 2/2 3/3 7/7 6/6
|
||||
f 3/3 4/4 8/8 7/7
|
||||
f 5/5 6/6 10/10 9/9
|
||||
f 7/7 8/8 12/12 11/11
|
||||
f 9/9 10/10 14/14 13/13
|
||||
f 10/10 11/11 15/15 14/14
|
||||
f 11/11 12/12 16/16 15/15
|
114
obj/plane_chessboard_missing.obj
Normal file
114
obj/plane_chessboard_missing.obj
Normal file
@ -0,0 +1,114 @@
|
||||
# This file uses centimeters as units for non-parametric coordinates.
|
||||
|
||||
v -0.333333 -0.000000 0.500000
|
||||
v -0.166667 -0.000000 0.500000
|
||||
v 0.000000 -0.000000 0.500000
|
||||
v 0.166667 -0.000000 0.500000
|
||||
v 0.333333 -0.000000 0.500000
|
||||
v 0.500000 -0.000000 0.500000
|
||||
v -0.500000 -0.000000 0.333333
|
||||
v -0.333333 -0.000000 0.333333
|
||||
v -0.166667 -0.000000 0.333333
|
||||
v 0.000000 -0.000000 0.333333
|
||||
v 0.166667 -0.000000 0.333333
|
||||
v 0.333333 -0.000000 0.333333
|
||||
v 0.500000 -0.000000 0.333333
|
||||
v -0.500000 -0.000000 0.166667
|
||||
v -0.333333 -0.000000 0.166667
|
||||
v -0.166667 -0.000000 0.166667
|
||||
v 0.000000 -0.000000 0.166667
|
||||
v 0.166667 -0.000000 0.166667
|
||||
v 0.333333 -0.000000 0.166667
|
||||
v 0.500000 -0.000000 0.166667
|
||||
v -0.500000 0.000000 0.000000
|
||||
v -0.333333 0.000000 0.000000
|
||||
v -0.166667 0.000000 0.000000
|
||||
v 0.000000 0.000000 0.000000
|
||||
v 0.166667 0.000000 0.000000
|
||||
v 0.333333 0.000000 0.000000
|
||||
v 0.500000 0.000000 0.000000
|
||||
v -0.500000 0.000000 -0.166667
|
||||
v -0.333333 0.000000 -0.166667
|
||||
v -0.166667 0.000000 -0.166667
|
||||
v 0.000000 0.000000 -0.166667
|
||||
v 0.166667 0.000000 -0.166667
|
||||
v 0.333333 0.000000 -0.166667
|
||||
v 0.500000 0.000000 -0.166667
|
||||
v -0.500000 0.000000 -0.333333
|
||||
v -0.333333 0.000000 -0.333333
|
||||
v -0.166667 0.000000 -0.333333
|
||||
v 0.000000 0.000000 -0.333333
|
||||
v 0.166667 0.000000 -0.333333
|
||||
v 0.333333 0.000000 -0.333333
|
||||
v 0.500000 0.000000 -0.333333
|
||||
v -0.500000 0.000000 -0.500000
|
||||
v -0.333333 0.000000 -0.500000
|
||||
v -0.166667 0.000000 -0.500000
|
||||
v 0.000000 0.000000 -0.500000
|
||||
v 0.166667 0.000000 -0.500000
|
||||
v 0.333333 0.000000 -0.500000
|
||||
vt 0.166667 0.000000
|
||||
vt 0.333333 0.000000
|
||||
vt 0.500000 0.000000
|
||||
vt 0.666667 0.000000
|
||||
vt 0.833333 0.000000
|
||||
vt 1.000000 0.000000
|
||||
vt 0.000000 0.166667
|
||||
vt 0.166667 0.166667
|
||||
vt 0.333333 0.166667
|
||||
vt 0.500000 0.166667
|
||||
vt 0.666667 0.166667
|
||||
vt 0.833333 0.166667
|
||||
vt 1.000000 0.166667
|
||||
vt 0.000000 0.333333
|
||||
vt 0.166667 0.333333
|
||||
vt 0.333333 0.333333
|
||||
vt 0.500000 0.333333
|
||||
vt 0.666667 0.333333
|
||||
vt 0.833333 0.333333
|
||||
vt 1.000000 0.333333
|
||||
vt 0.000000 0.500000
|
||||
vt 0.166667 0.500000
|
||||
vt 0.333333 0.500000
|
||||
vt 0.500000 0.500000
|
||||
vt 0.666667 0.500000
|
||||
vt 0.833333 0.500000
|
||||
vt 1.000000 0.500000
|
||||
vt 0.000000 0.666667
|
||||
vt 0.166667 0.666667
|
||||
vt 0.333333 0.666667
|
||||
vt 0.500000 0.666667
|
||||
vt 0.666667 0.666667
|
||||
vt 0.833333 0.666667
|
||||
vt 1.000000 0.666667
|
||||
vt 0.000000 0.833333
|
||||
vt 0.166667 0.833333
|
||||
vt 0.333333 0.833333
|
||||
vt 0.500000 0.833333
|
||||
vt 0.666667 0.833333
|
||||
vt 0.833333 0.833333
|
||||
vt 1.000000 0.833333
|
||||
vt 0.000000 1.000000
|
||||
vt 0.166667 1.000000
|
||||
vt 0.333333 1.000000
|
||||
vt 0.500000 1.000000
|
||||
vt 0.666667 1.000000
|
||||
vt 0.833333 1.000000
|
||||
f 1/1 2/2 9/9 8/8
|
||||
f 3/3 4/4 11/11 10/10
|
||||
f 5/5 6/6 13/13 12/12
|
||||
f 7/7 8/8 15/15 14/14
|
||||
f 9/9 10/10 17/17 16/16
|
||||
f 11/11 12/12 19/19 18/18
|
||||
f 15/15 16/16 23/23 22/22
|
||||
f 17/17 18/18 25/25 24/24
|
||||
f 19/19 20/20 27/27 26/26
|
||||
f 21/21 22/22 29/29 28/28
|
||||
f 23/23 24/24 31/31 30/30
|
||||
f 25/25 26/26 33/33 32/32
|
||||
f 29/29 30/30 37/37 36/36
|
||||
f 31/31 32/32 39/39 38/38
|
||||
f 33/33 34/34 41/41 40/40
|
||||
f 35/35 36/36 43/43 42/42
|
||||
f 37/37 38/38 45/45 44/44
|
||||
f 39/39 40/40 47/47 46/46
|
134
obj/plane_cross_face_missing.obj
Normal file
134
obj/plane_cross_face_missing.obj
Normal file
@ -0,0 +1,134 @@
|
||||
# This file uses centimeters as units for non-parametric coordinates.
|
||||
|
||||
v -0.500000 -0.000000 0.500000
|
||||
v -0.333333 -0.000000 0.500000
|
||||
v -0.166667 -0.000000 0.500000
|
||||
v 0.000000 -0.000000 0.500000
|
||||
v 0.166667 -0.000000 0.500000
|
||||
v 0.333333 -0.000000 0.500000
|
||||
v 0.500000 -0.000000 0.500000
|
||||
v -0.500000 -0.000000 0.333333
|
||||
v -0.333333 -0.000000 0.333333
|
||||
v -0.166667 -0.000000 0.333333
|
||||
v 0.000000 -0.000000 0.333333
|
||||
v 0.166667 -0.000000 0.333333
|
||||
v 0.333333 -0.000000 0.333333
|
||||
v 0.500000 -0.000000 0.333333
|
||||
v -0.500000 -0.000000 0.166667
|
||||
v -0.333333 -0.000000 0.166667
|
||||
v -0.166667 -0.000000 0.166667
|
||||
v 0.000000 -0.000000 0.166667
|
||||
v 0.166667 -0.000000 0.166667
|
||||
v 0.333333 -0.000000 0.166667
|
||||
v 0.500000 -0.000000 0.166667
|
||||
v -0.500000 0.000000 0.000000
|
||||
v -0.333333 0.000000 0.000000
|
||||
v -0.166667 0.000000 0.000000
|
||||
v 0.000000 0.000000 0.000000
|
||||
v 0.166667 0.000000 0.000000
|
||||
v 0.333333 0.000000 0.000000
|
||||
v 0.500000 0.000000 0.000000
|
||||
v -0.500000 0.000000 -0.166667
|
||||
v -0.333333 0.000000 -0.166667
|
||||
v -0.166667 0.000000 -0.166667
|
||||
v 0.000000 0.000000 -0.166667
|
||||
v 0.166667 0.000000 -0.166667
|
||||
v 0.333333 0.000000 -0.166667
|
||||
v 0.500000 0.000000 -0.166667
|
||||
v -0.500000 0.000000 -0.333333
|
||||
v -0.333333 0.000000 -0.333333
|
||||
v -0.166667 0.000000 -0.333333
|
||||
v 0.000000 0.000000 -0.333333
|
||||
v 0.166667 0.000000 -0.333333
|
||||
v 0.333333 0.000000 -0.333333
|
||||
v 0.500000 0.000000 -0.333333
|
||||
v -0.500000 0.000000 -0.500000
|
||||
v -0.333333 0.000000 -0.500000
|
||||
v -0.166667 0.000000 -0.500000
|
||||
v 0.000000 0.000000 -0.500000
|
||||
v 0.166667 0.000000 -0.500000
|
||||
v 0.333333 0.000000 -0.500000
|
||||
v 0.500000 0.000000 -0.500000
|
||||
vt 0.000000 0.000000
|
||||
vt 0.166667 0.000000
|
||||
vt 0.333333 0.000000
|
||||
vt 0.500000 0.000000
|
||||
vt 0.666667 0.000000
|
||||
vt 0.833333 0.000000
|
||||
vt 1.000000 0.000000
|
||||
vt 0.000000 0.166667
|
||||
vt 0.166667 0.166667
|
||||
vt 0.333333 0.166667
|
||||
vt 0.500000 0.166667
|
||||
vt 0.666667 0.166667
|
||||
vt 0.833333 0.166667
|
||||
vt 1.000000 0.166667
|
||||
vt 0.000000 0.333333
|
||||
vt 0.166667 0.333333
|
||||
vt 0.333333 0.333333
|
||||
vt 0.500000 0.333333
|
||||
vt 0.666667 0.333333
|
||||
vt 0.833333 0.333333
|
||||
vt 1.000000 0.333333
|
||||
vt 0.000000 0.500000
|
||||
vt 0.166667 0.500000
|
||||
vt 0.333333 0.500000
|
||||
vt 0.500000 0.500000
|
||||
vt 0.666667 0.500000
|
||||
vt 0.833333 0.500000
|
||||
vt 1.000000 0.500000
|
||||
vt 0.000000 0.666667
|
||||
vt 0.166667 0.666667
|
||||
vt 0.333333 0.666667
|
||||
vt 0.500000 0.666667
|
||||
vt 0.666667 0.666667
|
||||
vt 0.833333 0.666667
|
||||
vt 1.000000 0.666667
|
||||
vt 0.000000 0.833333
|
||||
vt 0.166667 0.833333
|
||||
vt 0.333333 0.833333
|
||||
vt 0.500000 0.833333
|
||||
vt 0.666667 0.833333
|
||||
vt 0.833333 0.833333
|
||||
vt 1.000000 0.833333
|
||||
vt 0.000000 1.000000
|
||||
vt 0.166667 1.000000
|
||||
vt 0.333333 1.000000
|
||||
vt 0.500000 1.000000
|
||||
vt 0.666667 1.000000
|
||||
vt 0.833333 1.000000
|
||||
vt 1.000000 1.000000
|
||||
f 1/1 2/2 9/9 8/8
|
||||
f 2/2 3/3 10/10 9/9
|
||||
f 3/3 4/4 11/11 10/10
|
||||
f 4/4 5/5 12/12 11/11
|
||||
f 5/5 6/6 13/13 12/12
|
||||
f 6/6 7/7 14/14 13/13
|
||||
f 8/8 9/9 16/16 15/15
|
||||
f 9/9 10/10 17/17 16/16
|
||||
f 10/10 11/11 18/18 17/17
|
||||
f 11/11 12/12 19/19 18/18
|
||||
f 12/12 13/13 20/20 19/19
|
||||
f 13/13 14/14 21/21 20/20
|
||||
f 15/15 16/16 23/23 22/22
|
||||
f 16/16 17/17 24/24 23/23
|
||||
f 17/17 18/18 25/25 24/24
|
||||
f 19/19 20/20 27/27 26/26
|
||||
f 20/20 21/21 28/28 27/27
|
||||
f 22/22 23/23 30/30 29/29
|
||||
f 23/23 24/24 31/31 30/30
|
||||
f 25/25 26/26 33/33 32/32
|
||||
f 26/26 27/27 34/34 33/33
|
||||
f 27/27 28/28 35/35 34/34
|
||||
f 29/29 30/30 37/37 36/36
|
||||
f 30/30 31/31 38/38 37/37
|
||||
f 31/31 32/32 39/39 38/38
|
||||
f 32/32 33/33 40/40 39/39
|
||||
f 33/33 34/34 41/41 40/40
|
||||
f 34/34 35/35 42/42 41/41
|
||||
f 36/36 37/37 44/44 43/43
|
||||
f 37/37 38/38 45/45 44/44
|
||||
f 38/38 39/39 46/46 45/45
|
||||
f 39/39 40/40 47/47 46/46
|
||||
f 40/40 41/41 48/48 47/47
|
||||
f 41/41 42/42 49/49 48/48
|
444
obj/quad_edges_missing.obj
Normal file
444
obj/quad_edges_missing.obj
Normal file
@ -0,0 +1,444 @@
|
||||
# This file uses centimeters as units for non-parametric coordinates.
|
||||
|
||||
v -0.300000 -0.500000 0.500000
|
||||
v -0.100000 -0.500000 0.500000
|
||||
v 0.100000 -0.500000 0.500000
|
||||
v 0.300000 -0.500000 0.500000
|
||||
v -0.500000 -0.300000 0.500000
|
||||
v -0.300000 -0.300000 0.500000
|
||||
v -0.100000 -0.300000 0.500000
|
||||
v 0.100000 -0.300000 0.500000
|
||||
v 0.300000 -0.300000 0.500000
|
||||
v 0.500000 -0.300000 0.500000
|
||||
v -0.500000 -0.100000 0.500000
|
||||
v -0.300000 -0.100000 0.500000
|
||||
v -0.100000 -0.100000 0.500000
|
||||
v 0.100000 -0.100000 0.500000
|
||||
v 0.300000 -0.100000 0.500000
|
||||
v 0.500000 -0.100000 0.500000
|
||||
v -0.500000 0.100000 0.500000
|
||||
v -0.300000 0.100000 0.500000
|
||||
v -0.100000 0.100000 0.500000
|
||||
v 0.100000 0.100000 0.500000
|
||||
v 0.300000 0.100000 0.500000
|
||||
v 0.500000 0.100000 0.500000
|
||||
v -0.500000 0.300000 0.500000
|
||||
v -0.300000 0.300000 0.500000
|
||||
v -0.100000 0.300000 0.500000
|
||||
v 0.100000 0.300000 0.500000
|
||||
v 0.300000 0.300000 0.500000
|
||||
v 0.500000 0.300000 0.500000
|
||||
v -0.300000 0.500000 0.500000
|
||||
v -0.100000 0.500000 0.500000
|
||||
v 0.100000 0.500000 0.500000
|
||||
v 0.300000 0.500000 0.500000
|
||||
v -0.500000 0.500000 0.300000
|
||||
v -0.300000 0.500000 0.300000
|
||||
v -0.100000 0.500000 0.300000
|
||||
v 0.100000 0.500000 0.300000
|
||||
v 0.300000 0.500000 0.300000
|
||||
v 0.500000 0.500000 0.300000
|
||||
v -0.500000 0.500000 0.100000
|
||||
v -0.300000 0.500000 0.100000
|
||||
v -0.100000 0.500000 0.100000
|
||||
v 0.100000 0.500000 0.100000
|
||||
v 0.300000 0.500000 0.100000
|
||||
v 0.500000 0.500000 0.100000
|
||||
v -0.500000 0.500000 -0.100000
|
||||
v -0.300000 0.500000 -0.100000
|
||||
v -0.100000 0.500000 -0.100000
|
||||
v 0.100000 0.500000 -0.100000
|
||||
v 0.300000 0.500000 -0.100000
|
||||
v 0.500000 0.500000 -0.100000
|
||||
v -0.500000 0.500000 -0.300000
|
||||
v -0.300000 0.500000 -0.300000
|
||||
v -0.100000 0.500000 -0.300000
|
||||
v 0.100000 0.500000 -0.300000
|
||||
v 0.300000 0.500000 -0.300000
|
||||
v 0.500000 0.500000 -0.300000
|
||||
v -0.300000 0.500000 -0.500000
|
||||
v -0.100000 0.500000 -0.500000
|
||||
v 0.100000 0.500000 -0.500000
|
||||
v 0.300000 0.500000 -0.500000
|
||||
v -0.500000 0.300000 -0.500000
|
||||
v -0.300000 0.300000 -0.500000
|
||||
v -0.100000 0.300000 -0.500000
|
||||
v 0.100000 0.300000 -0.500000
|
||||
v 0.300000 0.300000 -0.500000
|
||||
v 0.500000 0.300000 -0.500000
|
||||
v -0.500000 0.100000 -0.500000
|
||||
v -0.300000 0.100000 -0.500000
|
||||
v -0.100000 0.100000 -0.500000
|
||||
v 0.100000 0.100000 -0.500000
|
||||
v 0.300000 0.100000 -0.500000
|
||||
v 0.500000 0.100000 -0.500000
|
||||
v -0.500000 -0.100000 -0.500000
|
||||
v -0.300000 -0.100000 -0.500000
|
||||
v -0.100000 -0.100000 -0.500000
|
||||
v 0.100000 -0.100000 -0.500000
|
||||
v 0.300000 -0.100000 -0.500000
|
||||
v 0.500000 -0.100000 -0.500000
|
||||
v -0.500000 -0.300000 -0.500000
|
||||
v -0.300000 -0.300000 -0.500000
|
||||
v -0.100000 -0.300000 -0.500000
|
||||
v 0.100000 -0.300000 -0.500000
|
||||
v 0.300000 -0.300000 -0.500000
|
||||
v 0.500000 -0.300000 -0.500000
|
||||
v -0.300000 -0.500000 -0.500000
|
||||
v -0.100000 -0.500000 -0.500000
|
||||
v 0.100000 -0.500000 -0.500000
|
||||
v 0.300000 -0.500000 -0.500000
|
||||
v -0.500000 -0.500000 -0.300000
|
||||
v -0.300000 -0.500000 -0.300000
|
||||
v -0.100000 -0.500000 -0.300000
|
||||
v 0.100000 -0.500000 -0.300000
|
||||
v 0.300000 -0.500000 -0.300000
|
||||
v 0.500000 -0.500000 -0.300000
|
||||
v -0.500000 -0.500000 -0.100000
|
||||
v -0.300000 -0.500000 -0.100000
|
||||
v -0.100000 -0.500000 -0.100000
|
||||
v 0.100000 -0.500000 -0.100000
|
||||
v 0.300000 -0.500000 -0.100000
|
||||
v 0.500000 -0.500000 -0.100000
|
||||
v -0.500000 -0.500000 0.100000
|
||||
v -0.300000 -0.500000 0.100000
|
||||
v -0.100000 -0.500000 0.100000
|
||||
v 0.100000 -0.500000 0.100000
|
||||
v 0.300000 -0.500000 0.100000
|
||||
v 0.500000 -0.500000 0.100000
|
||||
v -0.500000 -0.500000 0.300000
|
||||
v -0.300000 -0.500000 0.300000
|
||||
v -0.100000 -0.500000 0.300000
|
||||
v 0.100000 -0.500000 0.300000
|
||||
v 0.300000 -0.500000 0.300000
|
||||
v 0.500000 -0.500000 0.300000
|
||||
v 0.500000 -0.300000 -0.300000
|
||||
v 0.500000 -0.300000 -0.100000
|
||||
v 0.500000 -0.300000 0.100000
|
||||
v 0.500000 -0.300000 0.300000
|
||||
v 0.500000 -0.100000 -0.300000
|
||||
v 0.500000 -0.100000 -0.100000
|
||||
v 0.500000 -0.100000 0.100000
|
||||
v 0.500000 -0.100000 0.300000
|
||||
v 0.500000 0.100000 -0.300000
|
||||
v 0.500000 0.100000 -0.100000
|
||||
v 0.500000 0.100000 0.100000
|
||||
v 0.500000 0.100000 0.300000
|
||||
v 0.500000 0.300000 -0.300000
|
||||
v 0.500000 0.300000 -0.100000
|
||||
v 0.500000 0.300000 0.100000
|
||||
v 0.500000 0.300000 0.300000
|
||||
v -0.500000 -0.300000 -0.300000
|
||||
v -0.500000 -0.300000 -0.100000
|
||||
v -0.500000 -0.300000 0.100000
|
||||
v -0.500000 -0.300000 0.300000
|
||||
v -0.500000 -0.100000 -0.300000
|
||||
v -0.500000 -0.100000 -0.100000
|
||||
v -0.500000 -0.100000 0.100000
|
||||
v -0.500000 -0.100000 0.300000
|
||||
v -0.500000 0.100000 -0.300000
|
||||
v -0.500000 0.100000 -0.100000
|
||||
v -0.500000 0.100000 0.100000
|
||||
v -0.500000 0.100000 0.300000
|
||||
v -0.500000 0.300000 -0.300000
|
||||
v -0.500000 0.300000 -0.100000
|
||||
v -0.500000 0.300000 0.100000
|
||||
v -0.500000 0.300000 0.300000
|
||||
vt 0.425000 0.000000
|
||||
vt 0.475000 0.000000
|
||||
vt 0.525000 0.000000
|
||||
vt 0.575000 0.000000
|
||||
vt 0.375000 0.050000
|
||||
vt 0.425000 0.050000
|
||||
vt 0.475000 0.050000
|
||||
vt 0.525000 0.050000
|
||||
vt 0.575000 0.050000
|
||||
vt 0.625000 0.050000
|
||||
vt 0.375000 0.100000
|
||||
vt 0.425000 0.100000
|
||||
vt 0.475000 0.100000
|
||||
vt 0.525000 0.100000
|
||||
vt 0.575000 0.100000
|
||||
vt 0.625000 0.100000
|
||||
vt 0.375000 0.150000
|
||||
vt 0.425000 0.150000
|
||||
vt 0.475000 0.150000
|
||||
vt 0.525000 0.150000
|
||||
vt 0.575000 0.150000
|
||||
vt 0.625000 0.150000
|
||||
vt 0.375000 0.200000
|
||||
vt 0.425000 0.200000
|
||||
vt 0.475000 0.200000
|
||||
vt 0.525000 0.200000
|
||||
vt 0.575000 0.200000
|
||||
vt 0.625000 0.200000
|
||||
vt 0.425000 0.250000
|
||||
vt 0.475000 0.250000
|
||||
vt 0.525000 0.250000
|
||||
vt 0.575000 0.250000
|
||||
vt 0.375000 0.300000
|
||||
vt 0.425000 0.300000
|
||||
vt 0.475000 0.300000
|
||||
vt 0.525000 0.300000
|
||||
vt 0.575000 0.300000
|
||||
vt 0.625000 0.300000
|
||||
vt 0.375000 0.350000
|
||||
vt 0.425000 0.350000
|
||||
vt 0.475000 0.350000
|
||||
vt 0.525000 0.350000
|
||||
vt 0.575000 0.350000
|
||||
vt 0.625000 0.350000
|
||||
vt 0.375000 0.400000
|
||||
vt 0.425000 0.400000
|
||||
vt 0.475000 0.400000
|
||||
vt 0.525000 0.400000
|
||||
vt 0.575000 0.400000
|
||||
vt 0.625000 0.400000
|
||||
vt 0.375000 0.450000
|
||||
vt 0.425000 0.450000
|
||||
vt 0.475000 0.450000
|
||||
vt 0.525000 0.450000
|
||||
vt 0.575000 0.450000
|
||||
vt 0.625000 0.450000
|
||||
vt 0.425000 0.500000
|
||||
vt 0.475000 0.500000
|
||||
vt 0.525000 0.500000
|
||||
vt 0.575000 0.500000
|
||||
vt 0.375000 0.550000
|
||||
vt 0.425000 0.550000
|
||||
vt 0.475000 0.550000
|
||||
vt 0.525000 0.550000
|
||||
vt 0.575000 0.550000
|
||||
vt 0.625000 0.550000
|
||||
vt 0.375000 0.600000
|
||||
vt 0.425000 0.600000
|
||||
vt 0.475000 0.600000
|
||||
vt 0.525000 0.600000
|
||||
vt 0.575000 0.600000
|
||||
vt 0.625000 0.600000
|
||||
vt 0.375000 0.650000
|
||||
vt 0.425000 0.650000
|
||||
vt 0.475000 0.650000
|
||||
vt 0.525000 0.650000
|
||||
vt 0.575000 0.650000
|
||||
vt 0.625000 0.650000
|
||||
vt 0.375000 0.700000
|
||||
vt 0.425000 0.700000
|
||||
vt 0.475000 0.700000
|
||||
vt 0.525000 0.700000
|
||||
vt 0.575000 0.700000
|
||||
vt 0.625000 0.700000
|
||||
vt 0.425000 0.750000
|
||||
vt 0.475000 0.750000
|
||||
vt 0.525000 0.750000
|
||||
vt 0.575000 0.750000
|
||||
vt 0.375000 0.800000
|
||||
vt 0.425000 0.800000
|
||||
vt 0.475000 0.800000
|
||||
vt 0.525000 0.800000
|
||||
vt 0.575000 0.800000
|
||||
vt 0.625000 0.800000
|
||||
vt 0.375000 0.850000
|
||||
vt 0.425000 0.850000
|
||||
vt 0.475000 0.850000
|
||||
vt 0.525000 0.850000
|
||||
vt 0.575000 0.850000
|
||||
vt 0.625000 0.850000
|
||||
vt 0.375000 0.900000
|
||||
vt 0.425000 0.900000
|
||||
vt 0.475000 0.900000
|
||||
vt 0.525000 0.900000
|
||||
vt 0.575000 0.900000
|
||||
vt 0.625000 0.900000
|
||||
vt 0.375000 0.950000
|
||||
vt 0.425000 0.950000
|
||||
vt 0.475000 0.950000
|
||||
vt 0.525000 0.950000
|
||||
vt 0.575000 0.950000
|
||||
vt 0.625000 0.950000
|
||||
vt 0.425000 1.000000
|
||||
vt 0.475000 1.000000
|
||||
vt 0.525000 1.000000
|
||||
vt 0.575000 1.000000
|
||||
vt 0.825000 0.000000
|
||||
vt 0.775000 0.000000
|
||||
vt 0.725000 0.000000
|
||||
vt 0.675000 0.000000
|
||||
vt 0.875000 0.050000
|
||||
vt 0.825000 0.050000
|
||||
vt 0.775000 0.050000
|
||||
vt 0.725000 0.050000
|
||||
vt 0.675000 0.050000
|
||||
vt 0.875000 0.100000
|
||||
vt 0.825000 0.100000
|
||||
vt 0.775000 0.100000
|
||||
vt 0.725000 0.100000
|
||||
vt 0.675000 0.100000
|
||||
vt 0.875000 0.150000
|
||||
vt 0.825000 0.150000
|
||||
vt 0.775000 0.150000
|
||||
vt 0.725000 0.150000
|
||||
vt 0.675000 0.150000
|
||||
vt 0.875000 0.200000
|
||||
vt 0.825000 0.200000
|
||||
vt 0.775000 0.200000
|
||||
vt 0.725000 0.200000
|
||||
vt 0.675000 0.200000
|
||||
vt 0.825000 0.250000
|
||||
vt 0.775000 0.250000
|
||||
vt 0.725000 0.250000
|
||||
vt 0.675000 0.250000
|
||||
vt 0.175000 0.000000
|
||||
vt 0.225000 0.000000
|
||||
vt 0.275000 0.000000
|
||||
vt 0.325000 0.000000
|
||||
vt 0.125000 0.050000
|
||||
vt 0.175000 0.050000
|
||||
vt 0.225000 0.050000
|
||||
vt 0.275000 0.050000
|
||||
vt 0.325000 0.050000
|
||||
vt 0.125000 0.100000
|
||||
vt 0.175000 0.100000
|
||||
vt 0.225000 0.100000
|
||||
vt 0.275000 0.100000
|
||||
vt 0.325000 0.100000
|
||||
vt 0.125000 0.150000
|
||||
vt 0.175000 0.150000
|
||||
vt 0.225000 0.150000
|
||||
vt 0.275000 0.150000
|
||||
vt 0.325000 0.150000
|
||||
vt 0.125000 0.200000
|
||||
vt 0.175000 0.200000
|
||||
vt 0.225000 0.200000
|
||||
vt 0.275000 0.200000
|
||||
vt 0.325000 0.200000
|
||||
vt 0.175000 0.250000
|
||||
vt 0.225000 0.250000
|
||||
vt 0.275000 0.250000
|
||||
vt 0.325000 0.250000
|
||||
f 1/1 2/2 7/7 6/6
|
||||
f 2/2 3/3 8/8 7/7
|
||||
f 3/3 4/4 9/9 8/8
|
||||
f 5/5 6/6 12/12 11/11
|
||||
f 6/6 7/7 13/13 12/12
|
||||
f 7/7 8/8 14/14 13/13
|
||||
f 8/8 9/9 15/15 14/14
|
||||
f 9/9 10/10 16/16 15/15
|
||||
f 11/11 12/12 18/18 17/17
|
||||
f 12/12 13/13 19/19 18/18
|
||||
f 13/13 14/14 20/20 19/19
|
||||
f 14/14 15/15 21/21 20/20
|
||||
f 15/15 16/16 22/22 21/21
|
||||
f 17/17 18/18 24/24 23/23
|
||||
f 18/18 19/19 25/25 24/24
|
||||
f 19/19 20/20 26/26 25/25
|
||||
f 20/20 21/21 27/27 26/26
|
||||
f 21/21 22/22 28/28 27/27
|
||||
f 24/24 25/25 30/30 29/29
|
||||
f 25/25 26/26 31/31 30/30
|
||||
f 26/26 27/27 32/32 31/31
|
||||
f 29/29 30/30 35/35 34/34
|
||||
f 30/30 31/31 36/36 35/35
|
||||
f 31/31 32/32 37/37 36/36
|
||||
f 33/33 34/34 40/40 39/39
|
||||
f 34/34 35/35 41/41 40/40
|
||||
f 35/35 36/36 42/42 41/41
|
||||
f 36/36 37/37 43/43 42/42
|
||||
f 37/37 38/38 44/44 43/43
|
||||
f 39/39 40/40 46/46 45/45
|
||||
f 40/40 41/41 47/47 46/46
|
||||
f 41/41 42/42 48/48 47/47
|
||||
f 42/42 43/43 49/49 48/48
|
||||
f 43/43 44/44 50/50 49/49
|
||||
f 45/45 46/46 52/52 51/51
|
||||
f 46/46 47/47 53/53 52/52
|
||||
f 47/47 48/48 54/54 53/53
|
||||
f 48/48 49/49 55/55 54/54
|
||||
f 49/49 50/50 56/56 55/55
|
||||
f 52/52 53/53 58/58 57/57
|
||||
f 53/53 54/54 59/59 58/58
|
||||
f 54/54 55/55 60/60 59/59
|
||||
f 57/57 58/58 63/63 62/62
|
||||
f 58/58 59/59 64/64 63/63
|
||||
f 59/59 60/60 65/65 64/64
|
||||
f 61/61 62/62 68/68 67/67
|
||||
f 62/62 63/63 69/69 68/68
|
||||
f 63/63 64/64 70/70 69/69
|
||||
f 64/64 65/65 71/71 70/70
|
||||
f 65/65 66/66 72/72 71/71
|
||||
f 67/67 68/68 74/74 73/73
|
||||
f 68/68 69/69 75/75 74/74
|
||||
f 69/69 70/70 76/76 75/75
|
||||
f 70/70 71/71 77/77 76/76
|
||||
f 71/71 72/72 78/78 77/77
|
||||
f 73/73 74/74 80/80 79/79
|
||||
f 74/74 75/75 81/81 80/80
|
||||
f 75/75 76/76 82/82 81/81
|
||||
f 76/76 77/77 83/83 82/82
|
||||
f 77/77 78/78 84/84 83/83
|
||||
f 80/80 81/81 86/86 85/85
|
||||
f 81/81 82/82 87/87 86/86
|
||||
f 82/82 83/83 88/88 87/87
|
||||
f 85/85 86/86 91/91 90/90
|
||||
f 86/86 87/87 92/92 91/91
|
||||
f 87/87 88/88 93/93 92/92
|
||||
f 89/89 90/90 96/96 95/95
|
||||
f 90/90 91/91 97/97 96/96
|
||||
f 91/91 92/92 98/98 97/97
|
||||
f 92/92 93/93 99/99 98/98
|
||||
f 93/93 94/94 100/100 99/99
|
||||
f 95/95 96/96 102/102 101/101
|
||||
f 96/96 97/97 103/103 102/102
|
||||
f 97/97 98/98 104/104 103/103
|
||||
f 98/98 99/99 105/105 104/104
|
||||
f 99/99 100/100 106/106 105/105
|
||||
f 101/101 102/102 108/108 107/107
|
||||
f 102/102 103/103 109/109 108/108
|
||||
f 103/103 104/104 110/110 109/109
|
||||
f 104/104 105/105 111/111 110/110
|
||||
f 105/105 106/106 112/112 111/111
|
||||
f 108/108 109/109 2/114 1/113
|
||||
f 109/109 110/110 3/115 2/114
|
||||
f 110/110 111/111 4/116 3/115
|
||||
f 100/118 94/117 113/122 114/123
|
||||
f 106/119 100/118 114/123 115/124
|
||||
f 112/120 106/119 115/124 116/125
|
||||
f 113/122 84/121 78/126 117/127
|
||||
f 114/123 113/122 117/127 118/128
|
||||
f 115/124 114/123 118/128 119/129
|
||||
f 116/125 115/124 119/129 120/130
|
||||
f 10/10 116/125 120/130 16/16
|
||||
f 117/127 78/126 72/131 121/132
|
||||
f 118/128 117/127 121/132 122/133
|
||||
f 119/129 118/128 122/133 123/134
|
||||
f 120/130 119/129 123/134 124/135
|
||||
f 16/16 120/130 124/135 22/22
|
||||
f 121/132 72/131 66/136 125/137
|
||||
f 122/133 121/132 125/137 126/138
|
||||
f 123/134 122/133 126/138 127/139
|
||||
f 124/135 123/134 127/139 128/140
|
||||
f 22/22 124/135 128/140 28/28
|
||||
f 126/138 125/137 56/141 50/142
|
||||
f 127/139 126/138 50/142 44/143
|
||||
f 128/140 127/139 44/143 38/144
|
||||
f 89/145 95/146 130/151 129/150
|
||||
f 95/146 101/147 131/152 130/151
|
||||
f 101/147 107/148 132/153 131/152
|
||||
f 79/149 129/150 133/155 73/154
|
||||
f 129/150 130/151 134/156 133/155
|
||||
f 130/151 131/152 135/157 134/156
|
||||
f 131/152 132/153 136/158 135/157
|
||||
f 132/153 5/5 11/11 136/158
|
||||
f 73/154 133/155 137/160 67/159
|
||||
f 133/155 134/156 138/161 137/160
|
||||
f 134/156 135/157 139/162 138/161
|
||||
f 135/157 136/158 140/163 139/162
|
||||
f 136/158 11/11 17/17 140/163
|
||||
f 67/159 137/160 141/165 61/164
|
||||
f 137/160 138/161 142/166 141/165
|
||||
f 138/161 139/162 143/167 142/166
|
||||
f 139/162 140/163 144/168 143/167
|
||||
f 140/163 17/17 23/23 144/168
|
||||
f 141/165 142/166 45/170 51/169
|
||||
f 142/166 143/167 39/171 45/170
|
||||
f 143/167 144/168 33/172 39/171
|
2090
obj/teapot.obj
Normal file
2090
obj/teapot.obj
Normal file
File diff suppressed because it is too large
Load Diff
22
obj/testcube2_mitSpitze_offen.obj
Normal file
22
obj/testcube2_mitSpitze_offen.obj
Normal file
@ -0,0 +1,22 @@
|
||||
v -1.0 0.000000 1.0
|
||||
v 1.0 0.000000 1.0
|
||||
v -1.0 1.0 1.0
|
||||
v 1.0 1.0 1.0
|
||||
v -1.0 1.0 -1.0
|
||||
v 1.0 1.0 -1.0
|
||||
v -1.0 0.000000 -1.0
|
||||
v 1.0 0.000000 -1.0
|
||||
v -1.0 -2.000000 1.0
|
||||
v -1.0 -2.000000 -1.0
|
||||
v 1.0 -2.000000 -1.0
|
||||
v 1.0 -2.000000 1.0
|
||||
v 0.0 2.0 0.0
|
||||
f 1 2 4 3
|
||||
f 5 6 8 7
|
||||
f 2 8 6 4
|
||||
f 7 1 3 5
|
||||
f 4 6 13
|
||||
f 6 5 13
|
||||
f 12 11 8 2
|
||||
f 1 7 10 9
|
||||
f 7 8 11 10
|
57
obj/two_boxes.obj
Normal file
57
obj/two_boxes.obj
Normal file
@ -0,0 +1,57 @@
|
||||
# This file uses centimeters as units for non-parametric coordinates.
|
||||
|
||||
v -0.500000 0.500000 0.500000
|
||||
v 0.500000 0.500000 0.500000
|
||||
v -0.500000 1.500000 0.500000
|
||||
v 0.500000 1.500000 0.500000
|
||||
v -0.500000 1.500000 -0.500000
|
||||
v 0.500000 1.500000 -0.500000
|
||||
v -0.500000 0.500000 -0.500000
|
||||
v 0.500000 0.500000 -0.500000
|
||||
v 0.500000 -0.500000 1.500000
|
||||
v 1.500000 -0.500000 1.500000
|
||||
v 0.500000 0.500000 1.500000
|
||||
v 1.500000 0.500000 1.500000
|
||||
v 1.500000 0.500000 0.500000
|
||||
v 0.500000 -0.500000 0.500000
|
||||
v 1.500000 -0.500000 0.500000
|
||||
vt 0.375000 0.000000
|
||||
vt 0.625000 0.000000
|
||||
vt 0.375000 0.250000
|
||||
vt 0.625000 0.250000
|
||||
vt 0.375000 0.500000
|
||||
vt 0.625000 0.500000
|
||||
vt 0.375000 0.750000
|
||||
vt 0.625000 0.750000
|
||||
vt 0.375000 1.000000
|
||||
vt 0.625000 1.000000
|
||||
vt 0.875000 0.000000
|
||||
vt 0.875000 0.250000
|
||||
vt 0.125000 0.000000
|
||||
vt 0.125000 0.250000
|
||||
vt 0.375000 0.000000
|
||||
vt 0.625000 0.000000
|
||||
vt 0.625000 0.250000
|
||||
vt 0.375000 0.250000
|
||||
vt 0.625000 0.500000
|
||||
vt 0.375000 0.500000
|
||||
vt 0.625000 0.750000
|
||||
vt 0.375000 0.750000
|
||||
vt 0.625000 1.000000
|
||||
vt 0.375000 1.000000
|
||||
vt 0.875000 0.000000
|
||||
vt 0.875000 0.250000
|
||||
vt 0.125000 0.000000
|
||||
vt 0.125000 0.250000
|
||||
f 1/1 2/2 4/4 3/3
|
||||
f 3/3 4/4 6/6 5/5
|
||||
f 5/5 6/6 8/8 7/7
|
||||
f 7/7 8/8 2/10 1/9
|
||||
f 2/2 8/11 6/12 4/4
|
||||
f 7/13 1/1 3/3 5/14
|
||||
f 9/15 10/16 12/17 11/18
|
||||
f 11/18 12/17 13/19 2/20
|
||||
f 2/20 13/19 15/21 14/22
|
||||
f 14/22 15/21 10/23 9/24
|
||||
f 10/16 15/25 13/26 12/17
|
||||
f 14/27 9/15 11/18 2/28
|
57
obj/two_boxes_bad_form.obj
Normal file
57
obj/two_boxes_bad_form.obj
Normal file
@ -0,0 +1,57 @@
|
||||
# This file uses centimeters as units for non-parametric coordinates.
|
||||
|
||||
v -0.500000 0.500000 0.500000
|
||||
v -0.126683 1.189065 0.767661
|
||||
v -0.500000 1.500000 0.500000
|
||||
v 0.500000 1.500000 0.500000
|
||||
v -0.500000 1.500000 -0.500000
|
||||
v 0.500000 1.500000 -0.500000
|
||||
v -0.500000 0.500000 -0.500000
|
||||
v 0.500000 0.500000 -0.500000
|
||||
v 0.500000 -0.500000 1.500000
|
||||
v 1.500000 -0.500000 1.500000
|
||||
v 0.500000 0.500000 1.500000
|
||||
v 1.500000 0.500000 1.500000
|
||||
v 1.500000 0.500000 0.500000
|
||||
v 0.500000 -0.500000 0.500000
|
||||
v 1.500000 -0.500000 0.500000
|
||||
vt 0.375000 0.000000
|
||||
vt 0.625000 0.000000
|
||||
vt 0.375000 0.250000
|
||||
vt 0.625000 0.250000
|
||||
vt 0.375000 0.500000
|
||||
vt 0.625000 0.500000
|
||||
vt 0.375000 0.750000
|
||||
vt 0.625000 0.750000
|
||||
vt 0.375000 1.000000
|
||||
vt 0.625000 1.000000
|
||||
vt 0.875000 0.000000
|
||||
vt 0.875000 0.250000
|
||||
vt 0.125000 0.000000
|
||||
vt 0.125000 0.250000
|
||||
vt 0.375000 0.000000
|
||||
vt 0.625000 0.000000
|
||||
vt 0.625000 0.250000
|
||||
vt 0.375000 0.250000
|
||||
vt 0.625000 0.500000
|
||||
vt 0.375000 0.500000
|
||||
vt 0.625000 0.750000
|
||||
vt 0.375000 0.750000
|
||||
vt 0.625000 1.000000
|
||||
vt 0.375000 1.000000
|
||||
vt 0.875000 0.000000
|
||||
vt 0.875000 0.250000
|
||||
vt 0.125000 0.000000
|
||||
vt 0.125000 0.250000
|
||||
f 1/1 2/2 4/4 3/3
|
||||
f 3/3 4/4 6/6 5/5
|
||||
f 5/5 6/6 8/8 7/7
|
||||
f 7/7 8/8 2/10 1/9
|
||||
f 2/2 8/11 6/12 4/4
|
||||
f 7/13 1/1 3/3 5/14
|
||||
f 9/15 10/16 12/17 11/18
|
||||
f 11/18 12/17 13/19 2/20
|
||||
f 2/20 13/19 15/21 14/22
|
||||
f 14/22 15/21 10/23 9/24
|
||||
f 10/16 15/25 13/26 12/17
|
||||
f 14/27 9/15 11/18 2/28
|
57
obj/two_boxes_bad_form_2.obj
Normal file
57
obj/two_boxes_bad_form_2.obj
Normal file
@ -0,0 +1,57 @@
|
||||
# This file uses centimeters as units for non-parametric coordinates.
|
||||
|
||||
v -0.500000 0.500000 1.410815
|
||||
v -0.126683 1.189065 0.767661
|
||||
v -0.500000 1.500000 0.500000
|
||||
v 0.500000 1.500000 1.646091
|
||||
v -0.500000 1.500000 -0.500000
|
||||
v 1.684732 1.500000 -0.500000
|
||||
v -0.500000 0.500000 -0.500000
|
||||
v 0.500000 0.042936 -0.500000
|
||||
v 0.500000 -0.500000 1.500000
|
||||
v 1.500000 -0.500000 1.500000
|
||||
v -1.185403 0.500000 1.500000
|
||||
v 1.500000 0.500000 1.500000
|
||||
v 1.500000 0.500000 0.500000
|
||||
v -0.908913 -0.500000 0.500000
|
||||
v 1.500000 -1.425600 0.500000
|
||||
vt 0.375000 0.000000
|
||||
vt 0.625000 0.000000
|
||||
vt 0.375000 0.250000
|
||||
vt 0.625000 0.250000
|
||||
vt 0.375000 0.500000
|
||||
vt 0.625000 0.500000
|
||||
vt 0.375000 0.750000
|
||||
vt 0.625000 0.750000
|
||||
vt 0.375000 1.000000
|
||||
vt 0.625000 1.000000
|
||||
vt 0.875000 0.000000
|
||||
vt 0.875000 0.250000
|
||||
vt 0.125000 0.000000
|
||||
vt 0.125000 0.250000
|
||||
vt 0.375000 0.000000
|
||||
vt 0.625000 0.000000
|
||||
vt 0.625000 0.250000
|
||||
vt 0.375000 0.250000
|
||||
vt 0.625000 0.500000
|
||||
vt 0.375000 0.500000
|
||||
vt 0.625000 0.750000
|
||||
vt 0.375000 0.750000
|
||||
vt 0.625000 1.000000
|
||||
vt 0.375000 1.000000
|
||||
vt 0.875000 0.000000
|
||||
vt 0.875000 0.250000
|
||||
vt 0.125000 0.000000
|
||||
vt 0.125000 0.250000
|
||||
f 1/1 2/2 4/4 3/3
|
||||
f 3/3 4/4 6/6 5/5
|
||||
f 5/5 6/6 8/8 7/7
|
||||
f 7/7 8/8 2/10 1/9
|
||||
f 2/2 8/11 6/12 4/4
|
||||
f 7/13 1/1 3/3 5/14
|
||||
f 9/15 10/16 12/17 11/18
|
||||
f 11/18 12/17 13/19 2/20
|
||||
f 2/20 13/19 15/21 14/22
|
||||
f 14/22 15/21 10/23 9/24
|
||||
f 10/16 15/25 13/26 12/17
|
||||
f 14/27 9/15 11/18 2/28
|
@ -28,7 +28,6 @@
|
||||
#include "err.h"
|
||||
#include "filereader.h"
|
||||
#include "half_edge.h"
|
||||
#include "print.c"
|
||||
#include "vector.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
@ -299,6 +298,7 @@ static void fill_vertices(VERTICES obj_v, HE_vert *vertices, int32_t *vc)
|
||||
vertices[*vc].edge = NULL;
|
||||
vertices[*vc].edge_array = NULL;
|
||||
vertices[*vc].eac = 0;
|
||||
vertices[*vc].dc = 0;
|
||||
|
||||
/* allocate color struct and set preliminary colors */
|
||||
vertices[*vc].col = malloc(sizeof(color));
|
||||
@ -366,8 +366,10 @@ bool vec_normal(HE_vert const * const vert, vector *vec)
|
||||
for (uint32_t i = 0; i < ec; i++) {
|
||||
vector new_vec;
|
||||
|
||||
FACE_NORMAL(edge_array[i], &new_vec);
|
||||
ADD_VECTORS(vec, &new_vec, vec);
|
||||
if (edge_array[i]->face) {
|
||||
FACE_NORMAL(edge_array[i], &new_vec);
|
||||
ADD_VECTORS(vec, &new_vec, vec);
|
||||
}
|
||||
}
|
||||
|
||||
/* normalize the result */
|
||||
@ -484,9 +486,9 @@ HE_obj *parse_obj(char const * const obj_string)
|
||||
{
|
||||
int32_t vc = 0, /* vertices count */
|
||||
fc = 0, /* face count */
|
||||
ec = 0; /* edge count */
|
||||
ec = 0, /* edge count */
|
||||
dec = 0; /* dummy edge count */
|
||||
char *string = NULL;
|
||||
|
||||
HE_vert *vertices = NULL;
|
||||
HE_edge *edges = NULL;
|
||||
HE_face *faces = NULL;
|
||||
@ -539,6 +541,7 @@ HE_obj *parse_obj(char const * const obj_string)
|
||||
edges[ec].face = &(faces[i]);
|
||||
edges[ec].pair = NULL; /* preliminary */
|
||||
vertices[fv_arr_id].edge = &(edges[ec]); /* last one wins */
|
||||
vertices[fv_arr_id].dummys = NULL; /* preliminary */
|
||||
|
||||
/* Skip j == 0 here, so we don't underrun the arrays,
|
||||
* since we always look one edge back. The first edge
|
||||
@ -589,34 +592,52 @@ HE_obj *parse_obj(char const * const obj_string)
|
||||
edges[i].pair = edges[i].vert->edge_array[j];
|
||||
edges[i].vert->edge_array[j] = NULL;
|
||||
|
||||
/* this is a trick to make sure the
|
||||
* edge member of HE_vert is never
|
||||
* a border-edge (unless there are only
|
||||
* border edges), otherwise
|
||||
* get_all_emanating_edges() would break
|
||||
* for vertices that are at the edge
|
||||
* of an open object */
|
||||
edges[i].vert->edge = &(edges[i]);
|
||||
|
||||
pair_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!pair_found) { /* we have a border edge */
|
||||
/* add dummy edge, so get_all_emanating_edges()
|
||||
* does not break */
|
||||
edges[ec + i].face = NULL;
|
||||
edges[ec + i].next = NULL;
|
||||
edges[ec + i].pair = &(edges[i]);
|
||||
edges[ec + i].vert = edges[i].next->vert;
|
||||
edges[i].pair = &(edges[ec + i]);
|
||||
/* create dummy pair edge if we have a border edge */
|
||||
if (!pair_found) {
|
||||
uint32_t *vert_dc = &(edges[i].next->vert->dc);
|
||||
|
||||
REALLOC(edges[i].next->vert->dummys,
|
||||
sizeof(HE_edge*) * (*vert_dc + 1));
|
||||
|
||||
/* NULL-face indicates border-edge */
|
||||
edges[ec + dec].face = NULL;
|
||||
/* we don't know this one yet */
|
||||
edges[ec + dec].next = NULL;
|
||||
/* set both pairs */
|
||||
edges[ec + dec].pair = &(edges[i]);
|
||||
edges[i].pair = &(edges[ec + dec]);
|
||||
/* set vertex */
|
||||
edges[ec + dec].vert = edges[i].next->vert;
|
||||
/* add the dummy edge to the dummys array of the vertex */
|
||||
edges[ec + dec].vert->dummys[*vert_dc] = &(edges[ec + dec]);
|
||||
(*vert_dc)++;
|
||||
|
||||
dec++;
|
||||
}
|
||||
}
|
||||
|
||||
/* set up obj help struct */
|
||||
/* now we have to connect the dummy edges together */
|
||||
for (uint32_t i = 0; i < (uint32_t) dec; i++) { /* for all dummy edges */
|
||||
/* vertex the dummy edge points to */
|
||||
HE_vert *vert = edges[ec + i].pair->vert;
|
||||
|
||||
/* iterate over the dummy array */
|
||||
for (uint32_t j = 0; j < vert->dc; j++) {
|
||||
if (vert == vert->dummys[j]->vert)
|
||||
edges[ec + i].next = vert->dummys[j];
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
obj = (HE_obj*) malloc(sizeof(HE_obj));
|
||||
CHECK_PTR_VAL(obj);
|
||||
|
||||
obj->edges = edges;
|
||||
obj->vertices = vertices;
|
||||
obj->faces = faces;
|
||||
@ -629,6 +650,7 @@ HE_obj *parse_obj(char const * const obj_string)
|
||||
free(obj_f[i]);
|
||||
free(obj_f);
|
||||
for (uint32_t i = 0; i < (uint32_t)vc; i++) {
|
||||
free(vertices[i].dummys);
|
||||
free(vertices[i].edge_array);
|
||||
free(obj_v[i]);
|
||||
}
|
||||
|
@ -147,11 +147,23 @@ struct HE_vert {
|
||||
*/
|
||||
HE_edge **edge_array;
|
||||
|
||||
/**
|
||||
* Similar as the edge_array acceleration structure,
|
||||
* except that it is used for connecting the
|
||||
* dummy edges.
|
||||
*/
|
||||
HE_edge **dummys;
|
||||
|
||||
/**
|
||||
* Element count of the edge_array.
|
||||
*/
|
||||
uint32_t eac;
|
||||
|
||||
/**
|
||||
* Element count of dummys.
|
||||
*/
|
||||
uint32_t dc;
|
||||
|
||||
/**
|
||||
* Color of the vertex.
|
||||
*/
|
||||
|
@ -469,14 +469,19 @@ void test_parse_obj5(void)
|
||||
while(next_edge != start_edge) {
|
||||
CU_ASSERT_PTR_NOT_NULL(next_edge);
|
||||
CU_ASSERT_PTR_NOT_NULL(next_edge->pair->pair);
|
||||
/* check if edges have all the same face */
|
||||
CU_ASSERT_EQUAL(next_edge->face, &(obj->faces[i]));
|
||||
|
||||
/* check if pairs are consistently set */
|
||||
CU_ASSERT_EQUAL(next_edge->pair->pair, next_edge);
|
||||
CU_ASSERT_NOT_EQUAL(next_edge->pair, next_edge);
|
||||
|
||||
/* check if vertices are consistent with edges */
|
||||
CU_ASSERT_PTR_NOT_NULL(next_edge->vert->edge);
|
||||
CU_ASSERT_EQUAL(next_edge->vert->edge->vert, next_edge->vert);
|
||||
CU_ASSERT_EQUAL(next_edge->vert, next_edge->pair->next->vert);
|
||||
|
||||
/* check if edges have all the same face */
|
||||
CU_ASSERT_EQUAL(next_edge->face, &(obj->faces[i]));
|
||||
|
||||
next_edge = next_edge->next;
|
||||
}
|
||||
}
|
||||
@ -516,12 +521,13 @@ void test_parse_obj6(void)
|
||||
/* check if pairs are consistently set */
|
||||
CU_ASSERT_EQUAL(edge->pair->pair, edge);
|
||||
CU_ASSERT_NOT_EQUAL(edge->pair, edge);
|
||||
|
||||
/* check if neighbor vertex is consistently connected
|
||||
* to half-edge */
|
||||
CU_ASSERT_NOT_EQUAL(edge->pair->vert, edge->vert);
|
||||
CU_ASSERT_PTR_NOT_NULL(edge->pair->vert->edge);
|
||||
CU_ASSERT_EQUAL(edge->pair->next->vert, edge->vert);
|
||||
CU_ASSERT_EQUAL(edge->vert->edge->vert, edge->vert);
|
||||
CU_ASSERT_EQUAL(edge->pair->next->vert, edge->vert);
|
||||
|
||||
edge = edge->pair->next;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user