#include <vector>
#include <string>
#include <stdexcept>
#include <cmath>
#include <algorithm>
#include <memory>
#include <cstdio>
// Qhull库头文件
extern "C" {
#include "qhull_a.h"
}
// 为VS2010提供snprintf兼容实现
#ifdef _MSC_VER
inline int snprintf(char *buffer, size_t size, const char *format, ...) {
va_list args;
va_start(args, format);
int result = _vsnprintf(buffer, size, format, args);
va_end(args);
// 如果_vsnprintf返回-1,表示输出被截断
if (result == -1) {
result = static_cast<int>(s