|
|
|
|
#include <implicit_surface_network_solver.hpp>
|
|
|
|
|
#include <subface_integrator.hpp>
|
|
|
|
|
|
|
|
|
|
EXTERN_C_BEGIN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void implicit_network_solver::generate_polymesh(stl_vector_mp<Eigen::Vector3d>& output_vertices,
|
|
|
|
|
stl_vector_mp<uint32_t>& output_polygon_faces,
|
|
|
|
|
stl_vector_mp<uint32_t>& output_vertex_counts_of_face)
|
|
|
|
|
{
|
|
|
|
|
// generate polymesh
|
|
|
|
|
m_timers.push_timer("generate_polymesh");
|
|
|
|
|
flat_hash_map_mp<uint32_t, parametric_plane_t> output_parameteric_planes;
|
|
|
|
|
build_implicit_network_by_blobtree(m_settings,
|
|
|
|
|
*m_blobtree,
|
|
|
|
|
output_vertices,
|
|
|
|
|
output_polygon_faces,
|
|
|
|
|
output_vertex_counts_of_face,
|
|
|
|
|
output_parameteric_planes);
|
|
|
|
|
|
|
|
|
|
auto integrator = internal::integrator_t(m_blobtree->subfaces, output_parameteric_planes);
|
|
|
|
|
|
|
|
|
|
double area = integrator.calculate(4, internal::area_integrand);
|
|
|
|
|
|
|
|
|
|
std::cout << "Generated mesh area: " << area << std::endl;
|
|
|
|
|
|
|
|
|
|
m_timers.pop_timer("generate_polymesh");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EXTERN_C_END
|