+# Decomposes mesh, and sets global error information if failed.
+# - returns None on fail
+# - returns world on success
+def cxr_decompose_globalerr( mesh_src ):
+ global cxr_error_inf
+
+ err = c_int32(0)
+ world = libcxr_decompose.call( mesh_src, pointer(err) )
+
+ if world == None:
+ cxr_view_mesh = None
+ cxr_batch_lines()
+
+ cxr_error_inf = [\
+ ("No Error", "There is no error?"),\
+ ("Bad input", "Non manifold geometry is present in the input mesh"),\
+ ("Bad result","An invalid manifold was generated, try to simplify"),\
+ ("Bad result","Make sure there is a clear starting point"),\
+ ("Bad result","Implicit vertex was invalid, try to simplify"),\
+ ("Bad input","Non coplanar vertices are in the source mesh"),\
+ ("Bad input","Non convex polygon is in the source mesh"),\
+ ("Bad result","Undefined failure"),\
+ ("Invalid Input", "Undefined failure"),\
+ ][err.value]
+
+ scene_redraw()
+
+ return world
+