extract explicit mesh with topology information from implicit surfaces with boolean operations, and do surface/volume integrating on them.
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.

38 lines
1.2 KiB

#include <iostream>
#include <array>
#include "mimalloc.h"
#include <solve.h>
int main()
{
mi_version();
auto primitive_data_center = create_primitive_data_center();
auto box = create_primitive(primitive_data_center, PRIMITIVE_TYPE_BOX);
std::cout << "primitive created..." << std::endl;
auto runtime_blobtree = create_blobtree();
auto node_iter1 = blobtree_add_primitive_node(runtime_blobtree, box);
auto baked_blobtree = bake_blobtree(runtime_blobtree);
destroy_blobtree(runtime_blobtree);
std::cout << "blobtree created..." << std::endl;
s_settings settings{};
settings.resolution = 21;
settings.scene_aabb_margin = 1e-5;
settings.restricted_primitive_bounding_test = true;
settings.integrand_density = 32;
auto solver = create_solver(baked_blobtree, settings);
auto result = generate_polymesh(solver);
print_statistics(solver);
destroy_solver(solver);
destroy_baked_blobtree(baked_blobtree);
destroy_primitive(box);
destroy_primitive_data_center(primitive_data_center);
return 0;
}