mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-10 06:21:48 +08:00
Filtering not closest surface cuts
This commit is contained in:
parent
553f484588
commit
f1acbf1bfe
@ -745,22 +745,32 @@ SurfaceCut Slic3r::cut_surface(const indexed_triangle_set &model,
|
|||||||
#endif // DEBUG_OUTPUT_DIR
|
#endif // DEBUG_OUTPUT_DIR
|
||||||
|
|
||||||
std::vector<bool> is_best_cut(cutAOIs.size(), {false});
|
std::vector<bool> is_best_cut(cutAOIs.size(), {false});
|
||||||
for (const priv::ProjectionDistance &d : best_projection)
|
for (const priv::ProjectionDistance &d : best_projection) {
|
||||||
|
if (d.aoi_index == std::numeric_limits<uint32_t>::max()) continue;
|
||||||
is_best_cut[d.aoi_index] = true;
|
is_best_cut[d.aoi_index] = true;
|
||||||
std::vector<size_t> best_cut_indices;
|
}
|
||||||
for (size_t i = 0; i < cutAOIs.size(); ++i)
|
|
||||||
if (is_best_cut[i]) best_cut_indices.push_back(i);
|
|
||||||
|
|
||||||
// cut off part + filtrate cutAOIs
|
// Filter cuts - No best cuts are removed
|
||||||
priv::merge_cuts(cutAOIs, cgal_model, best_cut_indices);
|
for (size_t i = cutAOIs.size(); i > 0; --i) {
|
||||||
#ifdef DEBUG_OUTPUT_DIR
|
size_t index = i - 1;
|
||||||
priv::store(cutAOIs, cgal_model, DEBUG_OUTPUT_DIR + "merged-aois/");
|
if (is_best_cut[index]) continue;
|
||||||
// only debug
|
cutAOIs.erase(cutAOIs.begin() + index);
|
||||||
#endif // DEBUG_OUTPUT_DIR
|
}
|
||||||
|
|
||||||
|
// std::vector<size_t> best_cut_indices;
|
||||||
|
// for (size_t i = 0; i < cutAOIs.size(); ++i)
|
||||||
|
// if (is_best_cut[i]) best_cut_indices.push_back(i);
|
||||||
|
//
|
||||||
|
// // cut off part + filtrate cutAOIs
|
||||||
|
// priv::merge_cuts(cutAOIs, cgal_model, best_cut_indices);
|
||||||
|
//#ifdef DEBUG_OUTPUT_DIR
|
||||||
|
// priv::store(cutAOIs, cgal_model, DEBUG_OUTPUT_DIR + "merged-aois/");
|
||||||
|
// // only debug
|
||||||
|
//#endif // DEBUG_OUTPUT_DIR
|
||||||
|
|
||||||
// Filter out NO top one cuts
|
//// Filter out NO top one cuts
|
||||||
priv::filter_cuts(cutAOIs, cgal_model, shapes,
|
//priv::filter_cuts(cutAOIs, cgal_model, shapes,
|
||||||
shape_point_2_index, projection, vert_shape_map);
|
// shape_point_2_index, projection, vert_shape_map);
|
||||||
|
|
||||||
// conversion map between vertex index in cgal_model and indices in result
|
// conversion map between vertex index in cgal_model and indices in result
|
||||||
// used instead of std::map
|
// used instead of std::map
|
||||||
|
Loading…
x
Reference in New Issue
Block a user