|
|
@ -1,7 +1,7 @@ |
|
|
#include <process.hpp> |
|
|
#include <process.hpp> |
|
|
#include <post_topo.hpp> |
|
|
#include <post_topo.hpp> |
|
|
|
|
|
|
|
|
void map_chain_to_parameteric_plane(const baked_blobtree_t& tree, |
|
|
void map_chain_to_parametric_plane(const baked_blobtree_t& tree, |
|
|
const stl_vector_mp<Eigen::Vector3d>& vertices, |
|
|
const stl_vector_mp<Eigen::Vector3d>& vertices, |
|
|
const stl_vector_mp<polygon_face_t>& faces, |
|
|
const stl_vector_mp<polygon_face_t>& faces, |
|
|
const stl_vector_mp<stl_vector_mp<uint32_t>>& patches, |
|
|
const stl_vector_mp<stl_vector_mp<uint32_t>>& patches, |
|
|
@ -10,7 +10,7 @@ void map_chain_to_parameteric_plane(const baked_blobtree_t& |
|
|
const flat_hash_map_mp<uint32_t, stl_vector_mp<uint32_t>>& chain_of_patch, |
|
|
const flat_hash_map_mp<uint32_t, stl_vector_mp<uint32_t>>& chain_of_patch, |
|
|
const flat_hash_map_mp<uint32_t, uint32_t>& vertex_old_index_to_unique_index, |
|
|
const flat_hash_map_mp<uint32_t, uint32_t>& vertex_old_index_to_unique_index, |
|
|
const dynamic_bitset_mp<>& chain_end_vertex_signular_flag, |
|
|
const dynamic_bitset_mp<>& chain_end_vertex_signular_flag, |
|
|
flat_hash_map_mp<uint32_t, parameteric_plane_t>& parameteric_planes) |
|
|
flat_hash_map_mp<uint32_t, parametric_plane_t>& parametric_planes) |
|
|
{ |
|
|
{ |
|
|
flat_hash_map_mp<uint32_t, stl_vector_mp<uint32_t>> patch_of_subface{}; |
|
|
flat_hash_map_mp<uint32_t, stl_vector_mp<uint32_t>> patch_of_subface{}; |
|
|
for (const auto& [patch_index, _] : chain_of_patch) { |
|
|
for (const auto& [patch_index, _] : chain_of_patch) { |
|
|
@ -26,11 +26,11 @@ void map_chain_to_parameteric_plane(const baked_blobtree_t& |
|
|
const auto subface_index = subface_index_; |
|
|
const auto subface_index = subface_index_; |
|
|
const auto& subface = subfaces[subface_index].object_ptr.get(); |
|
|
const auto& subface = subfaces[subface_index].object_ptr.get(); |
|
|
auto mapping_func = subface.fetch_param_mapping_evaluator(); |
|
|
auto mapping_func = subface.fetch_param_mapping_evaluator(); |
|
|
auto& parameteric_plane = parameteric_planes[subface_index]; |
|
|
auto& parametric_plane = parametric_planes[subface_index]; |
|
|
auto& chain_vertices = parameteric_plane.chain_vertices; |
|
|
auto& chain_vertices = parametric_plane.chain_vertices; |
|
|
auto& chain_group_indices = parameteric_plane.chain_group_indices; |
|
|
auto& chain_group_indices = parametric_plane.chain_group_indices; |
|
|
auto& chain_vertex_flags = parameteric_plane.vertex_special_flags; |
|
|
auto& chain_vertex_flags = parametric_plane.vertex_special_flags; |
|
|
auto& chain_other_subface_indices = parameteric_plane.chain_other_subface_indices; |
|
|
auto& chain_other_subface_indices = parametric_plane.chain_other_subface_indices; |
|
|
chain_group_indices.reserve(patch_indices.size()); |
|
|
chain_group_indices.reserve(patch_indices.size()); |
|
|
|
|
|
|
|
|
unique_chain_indices.clear(); |
|
|
unique_chain_indices.clear(); |
|
|
@ -81,16 +81,16 @@ void map_chain_to_parameteric_plane(const baked_blobtree_t& |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void remap_parameteric_plane_vertices(flat_hash_map_mp<uint32_t, parametric_plane_t>& parameteric_planes) |
|
|
void remap_parametric_plane_vertices(flat_hash_map_mp<uint32_t, parametric_plane_t>& parametric_planes) |
|
|
{ |
|
|
{ |
|
|
for (auto& [_, parameteric_plane] : parameteric_planes) { |
|
|
for (auto& [_, parametric_plane] : parametric_planes) { |
|
|
auto& uv_bounds = parameteric_plane.uv_bounds; |
|
|
auto& uv_bounds = parametric_plane.uv_bounds; |
|
|
for (auto& chain_vertices : parameteric_plane.chain_vertices) { |
|
|
for (auto& chain_vertices : parametric_plane.chain_vertices) { |
|
|
for (auto& vertex : chain_vertices) uv_bounds = uv_bounds.extend(vertex); |
|
|
for (auto& vertex : chain_vertices) uv_bounds = uv_bounds.extend(vertex); |
|
|
} |
|
|
} |
|
|
assert(uv_bounds.sizes().minCoeff() > epsilon); |
|
|
assert(uv_bounds.sizes().minCoeff() > epsilon); |
|
|
const auto uv_bounds_rpc = uv_bounds.sizes().cwiseInverse().array(); |
|
|
const auto uv_bounds_rpc = uv_bounds.sizes().cwiseInverse().array(); |
|
|
for (auto& chain_vertices : parameteric_plane.chain_vertices) { |
|
|
for (auto& chain_vertices : parametric_plane.chain_vertices) { |
|
|
std::transform(chain_vertices.begin(), |
|
|
std::transform(chain_vertices.begin(), |
|
|
chain_vertices.end(), |
|
|
chain_vertices.end(), |
|
|
chain_vertices.begin(), |
|
|
chain_vertices.begin(), |
|
|
|