示例#1
0
文件: mesh.cpp 项目: reuk/wayverb
double estimate_volume(const mesh& mesh) {
    const auto& nodes = mesh.get_structure().get_condensed_nodes();
    const auto num_inside =
    std::count_if(cbegin(nodes), cend(nodes), [](const auto& i) {
        return is_inside(i);
    });
    const auto spacing = mesh.get_descriptor().spacing;
    const auto node_volume = spacing * spacing * spacing;
    return node_volume * num_inside;
}
示例#2
0
文件: mesh.cpp 项目: reuk/wayverb
bool is_inside(const mesh& m, size_t node_index) {
    return is_inside(m.get_structure().get_condensed_nodes()[node_index]);
}