def eval_mesh(self, mesh, pointcloud_tgt, normals_tgt, points_iou, occ_tgt, remove_wall=False):
    ' Evaluates a mesh.\n\n        Args:\n            mesh (trimesh): mesh which should be evaluated\n            pointcloud_tgt (numpy array): target point cloud\n            normals_tgt (numpy array): target normals\n            points_iou (numpy_array): points tensor for IoU evaluation\n            occ_tgt (numpy_array): GT occupancy values for IoU points\n        '
    if ((len(mesh.vertices) != 0) and (len(mesh.faces) != 0)):
        if remove_wall:
            (pointcloud, idx) = mesh.sample((2 * self.n_points), return_index=True)
            eps = 0.007
            (x_max, x_min) = (pointcloud_tgt[:, 0].max(), pointcloud_tgt[:, 0].min())
            (y_max, y_min) = (pointcloud_tgt[:, 1].max(), pointcloud_tgt[:, 1].min())
            (z_max, z_min) = (pointcloud_tgt[:, 2].max(), pointcloud_tgt[:, 2].min())
            (x_max, x_min) = ((x_max + eps), (x_min - eps))
            (y_max, y_min) = ((y_max + eps), (y_min - eps))
            (z_max, z_min) = ((z_max + eps), (z_min - eps))
            mask_x = ((pointcloud[:, 0] <= x_max) & (pointcloud[:, 0] >= x_min))
            mask_y = (pointcloud[:, 1] >= y_min)
            mask_z = ((pointcloud[:, 2] <= z_max) & (pointcloud[:, 2] >= z_min))
            mask = ((mask_x & mask_y) & mask_z)
            pointcloud_new = pointcloud[mask]
            idx_new = np.random.randint(pointcloud_new.shape[0], size=self.n_points)
            pointcloud = pointcloud_new[idx_new]
            idx = idx[mask][idx_new]
        else:
            (pointcloud, idx) = mesh.sample(self.n_points, return_index=True)
        pointcloud = pointcloud.astype(np.float32)
        normals = mesh.face_normals[idx]
    else:
        pointcloud = np.empty((0, 3))
        normals = np.empty((0, 3))
    out_dict = self.eval_pointcloud(pointcloud, pointcloud_tgt, normals, normals_tgt)
    if ((len(mesh.vertices) != 0) and (len(mesh.faces) != 0)):
        occ = check_mesh_contains(mesh, points_iou)
        if (occ_tgt.min() < 0):
            occ_tgt = (occ_tgt <= 0).astype(np.float32)
        out_dict['iou'] = compute_iou(occ, occ_tgt)
    else:
        out_dict['iou'] = 0.0
    return out_dict
Evaluates a mesh.

Args:
    mesh (trimesh): mesh which should be evaluated
    pointcloud_tgt (numpy array): target point cloud
    normals_tgt (numpy array): target normals
    points_iou (numpy_array): points tensor for IoU evaluation
    occ_tgt (numpy_array): GT occupancy values for IoU points
def eval_mesh(self, mesh, pointcloud_tgt, normals_tgt, points_iou, occ_tgt, remove_wall=False):
    ' Evaluates a mesh.\n\n        Args:\n            mesh (trimesh): mesh which should be evaluated\n            pointcloud_tgt (numpy array): target point cloud\n            normals_tgt (numpy array): target normals\n            points_iou (numpy_array): points tensor for IoU evaluation\n            occ_tgt (numpy_array): GT occupancy values for IoU points\n        '
    if ((len(mesh.vertices) != 0) and (len(mesh.faces) != 0)):
        if remove_wall:
            (pointcloud, idx) = mesh.sample((2 * self.n_points), return_index=True)
            eps = 0.007
            (x_max, x_min) = (pointcloud_tgt[:, 0].max(), pointcloud_tgt[:, 0].min())
            (y_max, y_min) = (pointcloud_tgt[:, 1].max(), pointcloud_tgt[:, 1].min())
            (z_max, z_min) = (pointcloud_tgt[:, 2].max(), pointcloud_tgt[:, 2].min())
            (x_max, x_min) = ((x_max + eps), (x_min - eps))
            (y_max, y_min) = ((y_max + eps), (y_min - eps))
            (z_max, z_min) = ((z_max + eps), (z_min - eps))
            mask_x = ((pointcloud[:, 0] <= x_max) & (pointcloud[:, 0] >= x_min))
            mask_y = (pointcloud[:, 1] >= y_min)
            mask_z = ((pointcloud[:, 2] <= z_max) & (pointcloud[:, 2] >= z_min))
            mask = ((mask_x & mask_y) & mask_z)
            pointcloud_new = pointcloud[mask]
            idx_new = np.random.randint(pointcloud_new.shape[0], size=self.n_points)
            pointcloud = pointcloud_new[idx_new]
            idx = idx[mask][idx_new]
        else:
            (pointcloud, idx) = mesh.sample(self.n_points, return_index=True)
        pointcloud = pointcloud.astype(np.float32)
        normals = mesh.face_normals[idx]
    else:
        pointcloud = np.empty((0, 3))
        normals = np.empty((0, 3))
    out_dict = self.eval_pointcloud(pointcloud, pointcloud_tgt, normals, normals_tgt)
    if ((len(mesh.vertices) != 0) and (len(mesh.faces) != 0)):
        occ = check_mesh_contains(mesh, points_iou)
        if (occ_tgt.min() < 0):
            occ_tgt = (occ_tgt <= 0).astype(np.float32)
        out_dict['iou'] = compute_iou(occ, occ_tgt)
    else:
        out_dict['iou'] = 0.0
    return out_dict