You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
1.4 KiB
23 lines
1.4 KiB
|
4 days ago
|
#pragma once
|
||
|
|
// sdf_visualizer.hpp
|
||
|
|
// ──────────────────────────────────────────────────────────────────────────────
|
||
|
|
// 将 baked_blobtree 在指定二维截面上的 SDF 分布写入文本文件,
|
||
|
|
// 供 visualize_sdf.py 读取并渲染热力图。
|
||
|
|
//
|
||
|
|
// 使用方法(在 main.cpp 中):
|
||
|
|
// #include "sdf_visualizer.hpp"
|
||
|
|
// // bake 完成后、solve 之前:
|
||
|
|
// dump_sdf_slice(baked_blobtree, "sdf_slice.txt");
|
||
|
|
// // 然后命令行运行:python visualize_sdf.py sdf_slice.txt
|
||
|
|
// ──────────────────────────────────────────────────────────────────────────────
|
||
|
|
|
||
|
|
#include <string>
|
||
|
|
#include "../../network_process/include/prim_gen.hpp" // baked_blobtree_t, aabb_t …
|
||
|
|
|
||
|
|
// 在世界坐标 XZ 平面(y = y_slice)按 grid_res×grid_res 网格
|
||
|
|
// 对每个 subface 采样 SDF,结果写入 output_path。
|
||
|
|
void dump_sdf_slice(const baked_blobtree_t& tree,
|
||
|
|
const std::string& output_path = "sdf_slice.txt",
|
||
|
|
double y_slice = 0.0,
|
||
|
|
int grid_res = 256,
|
||
|
|
double extra_margin = 0.2);
|