diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2012-03-16 00:10:07 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2012-03-16 00:10:07 +0400 |
commit | c9d0de49b9d5c42d8d1f04a9d712c0d7bb0a5673 (patch) | |
tree | 0f2e8f683a98f465bfa3ff0fbb44789f1fd1f4ca /source/blender/blenkernel/BKE_mesh.h | |
parent | e24d221e2a3f2b420121472a0f181fe6e44bacf0 (diff) |
mesh_validate code for bmesh (i.e. polys/loops).
Everything seems to work well (many tests making random changes over various meshes went good), but the code is a bit complex and hard to follow, due to the various possibilities of invalid poly/loop combinations… Code also makes more operations than previous tri/quad faces version (hence is a bit slower), but I don’t think we can do otherwise, it’s just the price for bmesh flexibility. ;)
Note: added the py script I used to make the tests, under source/tests/...
Diffstat (limited to 'source/blender/blenkernel/BKE_mesh.h')
-rw-r--r-- | source/blender/blenkernel/BKE_mesh.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index 7771cc7db46..63d3a1f309a 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -160,7 +160,8 @@ void mesh_get_texspace(struct Mesh *me, float r_loc[3], float r_rot[3], float r_ /* if old, it converts mface->edcode to edge drawflags */ void make_edges(struct Mesh *me, int old); -void mesh_strip_loose_faces(struct Mesh *me); +void mesh_strip_loose_faces(struct Mesh *me); /* Needed for compatibility (some old read code). */ +void mesh_strip_loose_polysloops(struct Mesh *me); void mesh_strip_loose_edges(struct Mesh *me); /* Calculate vertex and face normals, face normals are returned in *faceNors_r if non-NULL @@ -268,11 +269,14 @@ int mesh_center_bounds(struct Mesh *me, float cent[3]); void mesh_translate(struct Mesh *me, float offset[3], int do_keys); /* mesh_validate.c */ +/* XXX Loop v/e are unsigned, so using max uint_32 value as invalid marker... */ +#define INVALID_LOOP_EDGE_MARKER 4294967295u int BKE_mesh_validate_arrays( - struct Mesh *me, + struct Mesh *me, struct MVert *mverts, unsigned int totvert, struct MEdge *medges, unsigned int totedge, - struct MFace *mfaces, unsigned int totface, + struct MLoop *mloops, unsigned int totloop, + struct MPoly *mpolys, unsigned int totpoly, struct MDeformVert *dverts, /* assume totvert length */ const short do_verbose, const short do_fixes); int BKE_mesh_validate(struct Mesh *me, int do_verbose); |