def convex_hulls(self, max_components=-1, allow_non_hulls=False,
                     planar_vertex_count=DEFAULT_PLANAR_HULL_VERTEX_THRESHOLD):
        self.stitch_vertices()
        self.remove_degenerate_primitives()
        self.remove_redundant_vertexes()

        components = self.connected_components()
        if max_components != -1 and len(components) > max_components:
            raise ValueError("Mesh has %d connected components which is more than specified max of %d" %
                             (len(components), max_components))

        if allow_non_hulls:
            triangles = Mesh()
            triangles.positions = [ ]
            triangles.primitives = [ ]

        ret = [ ]
        for (vertices, primitives) in components:
            convex = self.is_convex(vertices, primitives)
            closed = self.simply_closed(primitives)
            planar = self.is_planar(vertices)

            if convex and planar:
                if self.is_convex_planar(vertices) and len(vertices) >= planar_vertex_count:
                    print "Converted to planar convex hull!"
                    ret.append(self.make_planar_convex_hull(vertices))
                else:
                    if allow_non_hulls:
                        triangles.extend_mesh(vertices, primitives)
                    else:
                        raise ValueError("A component of the mesh was not able to be converted")

            elif convex and closed:
                mesh = self.make_convex_hull(vertices)
                if mesh == None:
                    if allow_non_hulls:
                        print "Failed to turn convex closed mesh into convex hull!"
                        triangles.extend_mesh(vertices, primitives)
                    else:
                        raise ValueError("A component of the mesh was not able to be converted")
                else:
                    # Ensure that convex hull can be re-computed correctly as this will be performed
                    # By WebGL physics device.
                    if mesh.make_convex_hull() == None:
                        if allow_non_hulls:
                            print "Convex hull failed to be re-computed!"
                            triangles.extend_mesh(vertices, primitives)
                        else:
                            raise ValueError("A component of the mesh was not able to be converted")
                    else:
                        print "Converted to convex hull!"
                        ret.append(mesh)

            else:
                # Cannot convert component to a convex hull.
                if allow_non_hulls:
                    triangles.extend_mesh(vertices, primitives)
                else:
                    raise ValueError("A component of the mesh was not able to be converted")

        if len(triangles.positions) == 0:
            triangles = None

        return (ret, triangles)

# pylint: enable=R0902
# pylint: enable=R0904

#######################################################################################################################

# pylint: disable=C0111
reserved is 0.
dataset/ETHPy150Open turbulenz/turbulenz_tools/turbulenz_tools/tools/mesh.py/Mesh.convex_hulls--crossover with--dataset/ETHPy150Open typesupply/woffTools/Lib/woffTools/test/test_validate.py/headerReservedTest1