|
From: James W. <ja...@fr...> - 2008-09-16 11:43:16
|
Roger Holmes wrote: > On 16 Sep, 2008, at 18:23, James Walker wrote: > >> What about doing the sanity check in e3geom_trimesh_new, so it would >> cover TriMeshes created by means other than reading 3DMF? > > Yes that would be better. Am I right in thinking there is no way for > an application to change a TriMesh after e3geom_trimesh_new creates > it, other than recreating it totally. I know the main attribute set > might be shared with other things but that is all that can get changed > "when you're not looking" I think. It is also possible for the application to change the TriMesh using Q3TriMesh_SetData or Q3TriMesh_LockData. The function e3geom_trimesh_optimize is called in 3 places: e3geom_trimesh_new, E3TriMesh_SetData, and E3TriMesh_UnlockData (in the read-write case), so that might be a reasonable place to fix bogus edges. Or else have a separate validation function that is called just before e3geom_trimesh_optimize in each place. While we're at it, it might make sense to sanity-check the point indices of faces and edges, but in those cases there is not a reasonable way to fix a problem, so the validation function should probably be able to cause a kQ3Failure result. -- James W. Walker, Innoventive Software LLC <http://www.frameforge3d.com/> |