def rectangularity(data): mesh = convex_hull_transformation(data["poly_data"]) volume = mesh.volume min_max_point = np.array(mesh.bounds).reshape((-1, 2)) differences = np.abs(np.diff(min_max_point, axis=1)) obb_volume = np.prod(differences) rectangularity_result = volume / (obb_volume if obb_volume != 0 else 0.000000000001) return {"scalar_rectangularity": rectangularity_result}
def sphericity(data): mesh = convex_hull_transformation(data["poly_data"]) sphericity_result = sphericity_computation(mesh) return {"scalar_sphericity": min(sphericity_result, 1.0)}
def compactness(data): mesh = convex_hull_transformation(data["poly_data"]) compactness_result = compactness_computation(mesh) return {"scalar_compactness": compactness_result}
def convex_hull_volume(data): mesh = convex_hull_transformation(data["poly_data"]) convex_hull_volume_result = mesh.volume return {"scalar_convex_hull_volume": convex_hull_volume_result}