Skip to content

Commit

Permalink
Update project structure to match BambuStudio's support code (#6967)
Browse files Browse the repository at this point in the history
This PR moves the code around without any functional changes, so that all code related to supports now placed at the same location & structure as BambuStudio.

This makes merging updates from BambuStudio much easier in the future.
  • Loading branch information
SoftFever authored Oct 7, 2024
2 parents 5b6fa0b + e73593c commit 72a797d
Show file tree
Hide file tree
Showing 28 changed files with 7,416 additions and 15,955 deletions.
22 changes: 7 additions & 15 deletions src/libslic3r/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -307,29 +307,21 @@ set(lisbslic3r_sources
SlicingAdaptive.hpp
Support/SupportCommon.cpp
Support/SupportCommon.hpp
Support/SupportDebug.cpp
Support/SupportDebug.hpp
Support/SupportLayer.hpp
# Support/SupportMaterial.cpp
# Support/SupportMaterial.hpp
Support/SupportParameters.cpp
Support/SupportMaterial.cpp
Support/SupportMaterial.hpp
Support/SupportParameters.hpp
Support/OrganicSupport.cpp
Support/OrganicSupport.hpp
Support/TreeSupport.cpp
Support/SupportSpotsGenerator.cpp
Support/SupportSpotsGenerator.hpp
Support/TreeSupport.hpp
Support/TreeSupportCommon.cpp
Support/TreeSupport.cpp
Support/TreeSupport3D.cpp
Support/TreeSupport3D.hpp
Support/TreeSupportCommon.hpp
Support/TreeModelVolumes.cpp
Support/TreeModelVolumes.hpp
SupportMaterial.cpp
SupportMaterial.hpp
PrincipalComponents2D.cpp
PrincipalComponents2D.hpp
SupportSpotsGenerator.cpp
SupportSpotsGenerator.hpp
TreeSupport.hpp
TreeSupport.cpp
MinimumSpanningTree.hpp
MinimumSpanningTree.cpp
Surface.cpp
Expand Down
1 change: 0 additions & 1 deletion src/libslic3r/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "Geometry/ConvexHull.hpp"
#include "I18N.hpp"
#include "ShortestPath.hpp"
#include "Support/SupportMaterial.hpp"
#include "Thread.hpp"
#include "Time.hpp"
#include "GCode.hpp"
Expand Down
25 changes: 10 additions & 15 deletions src/libslic3r/PrintObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include "Layer.hpp"
#include "MutablePolygon.hpp"
#include "PrintConfig.hpp"
#include "SupportMaterial.hpp"
#include "SupportSpotsGenerator.hpp"
#include "Support/SupportMaterial.hpp"
#include "Support/SupportSpotsGenerator.hpp"
#include "Support/TreeSupport.hpp"
#include "Surface.hpp"
#include "Slicing.hpp"
Expand All @@ -19,7 +19,6 @@
#include "Fill/FillAdaptive.hpp"
#include "Fill/FillLightning.hpp"
#include "Format/STL.hpp"
#include "TreeSupport.hpp"
#include "format.hpp"

#include <float.h>
Expand Down Expand Up @@ -3521,18 +3520,14 @@ void PrintObject::combine_infill()

void PrintObject::_generate_support_material()
{
PrintObjectSupportMaterial support_material(this, m_slicing_params);
support_material.generate(*this);

if (this->config().enable_support.value && is_tree(this->config().support_type.value)) {
if (this->config().support_style.value == smsOrganic ||
// Orca: use organic as default
this->config().support_style.value == smsDefault) {
fff_tree_support_generate(*this, std::function<void()>([this]() { this->throw_if_canceled(); }));
} else {
TreeSupport tree_support(*this, m_slicing_params);
tree_support.generate();
}
if (is_tree(m_config.support_type.value)) {
TreeSupport tree_support(*this, m_slicing_params);
tree_support.throw_on_cancel = [this]() { this->throw_if_canceled(); };
tree_support.generate();
}
else {
PrintObjectSupportMaterial support_material(this, m_slicing_params);
support_material.generate(*this);
}
}

Expand Down
Loading

0 comments on commit 72a797d

Please sign in to comment.