''' Provide me with a python function that can reduce the number of polygons in a 3D asset by 50% ''' import pymesh def reduce_polygons(mesh): target_num_faces = len(mesh.faces) // 2 decimator = pymesh.QuadricEdgeCollapseDecimator(mesh) decimated_mesh = decimator.collapse(target_num_faces) return decimated_mesh import pymesh # Load the input mesh input_mesh = pymesh.load_mesh("input.obj") # Reduce the number of polygons by 50% output_mesh = reduce_polygons(input_mesh) # Save the output mesh pymesh.save_mesh("output.obj", output_mesh)