CGAL Fix Model: New for Linux and Mac (#12155)

* CGAL Fix Model

Multi OS fix model with CGAL

Co-Authored-By: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* Clean unused variables

* Early exit

* Validation

* Orca comments

* Steps to fix

* Simplify fixer

* BY10 to BYCGAL Full refactor

* repair_polygon_soup

* Revert "repair_polygon_soup"

This reverts commit cb88841e7a72a42c148e144fbf0cab146a54c3c8.

* CGAL 6.1.1

Update CGAL.cmake

* Update MeshBoolean.cpp

* Revert "CGAL 6.1.1"

This reverts commit c581887adb5f84ec4af97b320067b152f8812f49.

* Funca with RF

New remake, it seems to be working fine...
por ahora

Co-Authored-By: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* Update src/libslic3r/MeshBoolean.cpp

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* Include cleanup

Co-Authored-By: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* Update Part list

Revert "Update Part list"

This reverts commit 95cab337d7ea602682ee00be2986ef941d0b06c2.

Reapply "Update Part list"

This reverts commit e401bec579f64b97e3f6deeb4131a8e5a79a146d.

* Comments

* Update FixModelByCgal.cpp

* Remove no 3d parts

Co-Authored-By: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* Remove netfabb and w10 sdk

Co-Authored-By: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* Update src/slic3r/Utils/FixModelByCgal.cpp

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

* redundant check

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Revet: suggestion from @RF47

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>

---------

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Ian Bassi
2026-04-24 05:28:28 -03:00
committed by GitHub
parent c26b6a2ef0
commit a274b0e0ac
20 changed files with 421 additions and 584 deletions

View File

@@ -112,7 +112,6 @@
#include "ConfigWizard.hpp"
#include "SyncAmsInfoDialog.hpp"
#include "../Utils/ASCIIFolding.hpp"
#include "../Utils/FixModelByWin10.hpp"
#include "../Utils/UndoRedo.hpp"
#include "../Utils/PresetUpdater.hpp"
#include "../Utils/Process.hpp"
@@ -4731,7 +4730,7 @@ struct Plater::priv
bool can_split_to_volumes() const;
bool can_arrange() const;
bool can_layers_editing() const;
bool can_fix_through_netfabb() const;
bool can_fix_through_cgal() const;
bool can_simplify() const;
bool can_smooth_mesh() const;
bool can_set_instance_to_object() const;
@@ -10240,10 +10239,10 @@ void Plater::priv::on_object_select(SimpleEvent& evt)
selection_changed();
}
//BBS: repair model through netfabb
//BBS: repair model through cgal
void Plater::priv::on_repair_model(wxCommandEvent &event)
{
wxGetApp().obj_list()->fix_through_netfabb();
wxGetApp().obj_list()->fix_through_cgal();
}
void Plater::priv::on_filament_color_changed(wxCommandEvent &event)
@@ -11217,15 +11216,15 @@ bool Plater::priv::can_delete_plate() const
return q->get_partplate_list().get_plate_count() > 1;
}
bool Plater::priv::can_fix_through_netfabb() const
bool Plater::priv::can_fix_through_cgal() const
{
std::vector<int> obj_idxs, vol_idxs;
sidebar->obj_list()->get_selection_indexes(obj_idxs, vol_idxs);
#if FIX_THROUGH_NETFABB_ALWAYS
#if FIX_THROUGH_CGAL_ALWAYS
// Fixing always.
return ! obj_idxs.empty() || ! vol_idxs.empty();
#else // FIX_THROUGH_NETFABB_ALWAYS
#else // FIX_THROUGH_CGAL_ALWAYS
// Fixing only if the model is not manifold.
if (vol_idxs.empty()) {
for (auto obj_idx : obj_idxs)
@@ -11239,7 +11238,7 @@ bool Plater::priv::can_fix_through_netfabb() const
if (model.objects[obj_idx]->get_repaired_errors_count(vol_idx) > 0)
return true;
return false;
#endif // FIX_THROUGH_NETFABB_ALWAYS
#endif // FIX_THROUGH_CGAL_ALWAYS
}
bool Plater::priv::can_simplify() const
@@ -17976,15 +17975,13 @@ void Plater::show_object_info()
int non_manifold_edges = 0;
auto mesh_errors = p->sidebar->obj_list()->get_mesh_errors_info(&info_manifold, &non_manifold_edges);
#ifndef __WINDOWS__
if (non_manifold_edges > 0) {
info_manifold += into_u8("\n" + _L("Tips:") + "\n" +_L("\"Fix Model\" feature is currently only on Windows. Please repair the model on Orca Slicer(windows) or CAD softwares."));
}
#endif //APPLE & LINUX
if (non_manifold_edges > 0) {
info_manifold += into_u8("\n" + _L("Tips:") + "\n" + _L("Use \"Fix Model\" to repair the mesh."));
}
info_manifold = "<Error>" + info_manifold + "</Error>";
info_text += into_u8(info_manifold);
notify_manager->bbl_show_objectsinfo_notification(info_text, is_windows10()&&(non_manifold_edges > 0), !(p->current_panel == p->view3D));
notify_manager->bbl_show_objectsinfo_notification(info_text, non_manifold_edges > 0, !(p->current_panel == p->view3D));
}
bool Plater::show_publish_dialog(bool show)
@@ -18161,7 +18158,7 @@ bool Plater::can_delete_plate() const { return p->can_delete_plate(); }
bool Plater::can_increase_instances() const { return p->can_increase_instances(); }
bool Plater::can_decrease_instances() const { return p->can_decrease_instances(); }
bool Plater::can_set_instance_to_object() const { return p->can_set_instance_to_object(); }
bool Plater::can_fix_through_netfabb() const { return p->can_fix_through_netfabb(); }
bool Plater::can_fix_through_cgal() const { return p->can_fix_through_cgal(); }
bool Plater::can_simplify() const { return p->can_simplify(); }
bool Plater::can_smooth_mesh() const { return p->can_smooth_mesh(); }
bool Plater::can_split_to_objects() const { return p->can_split_to_objects(); }