Skip to content

Commit

Permalink
Merge branch 'main' into CURA-9474_non_vertex_seams
Browse files Browse the repository at this point in the history
  • Loading branch information
rburema authored Jun 18, 2024
2 parents bab5a09 + 6e231e5 commit d6f171f
Show file tree
Hide file tree
Showing 80 changed files with 357 additions and 206 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/conan-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,32 @@ jobs:

conan-package-create-macos:
needs: [ conan-recipe-version, conan-package-export ]
if: ${{ ((github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || github.event_name == 'pull_request') }}
if: ${{ ((github.event_name == 'push' && (github.ref_name == 'main' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || github.event_name == 'pull_request') }}
uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-macos.yml@main
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
secrets: inherit

conan-package-create-windows:
needs: [ conan-recipe-version, conan-package-export ]
if: ${{ ((github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || github.event_name == 'pull_request') }}
if: ${{ ((github.event_name == 'push' && (github.ref_name == 'main' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || github.event_name == 'pull_request') }}
uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-windows.yml@main
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
secrets: inherit

conan-package-create-linux:
needs: [ conan-recipe-version, conan-package-export ]
if: ${{ ((github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || github.event_name == 'pull_request') }}
if: ${{ ((github.event_name == 'push' && (github.ref_name == 'main' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || github.event_name == 'pull_request') }}
uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-linux.yml@main
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
secrets: inherit

conan-package-create-wasm:
needs: [ conan-recipe-version, conan-package-export ]
if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }}
uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-wasm.yml@main
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
secrets: inherit
5 changes: 5 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ def build(self):
self.run("objcopy --only-keep-debug --compress-debug-sections=zlib CuraEngine CuraEngine.debug")
self.run("objcopy --strip-debug --strip-unneeded CuraEngine")
self.run("objcopy --add-gnu-debuglink=CuraEngine.debug CuraEngine")
elif self.settings.os == "Macos":
self.run("dsymutil CuraEngine")

self.output.info("Uploading debug symbols to sentry")
build_source_dir = self.build_path.parent.parent.as_posix()
Expand All @@ -217,6 +219,9 @@ def build(self):
self.run(f"sentry-cli --auth-token {os.environ['SENTRY_TOKEN']} releases set-commits -o {sentry_org} -p {sentry_project} --commit \"Ultimaker/CuraEngine@{self.conan_data['commit']}\" {self.version}")
self.run(f"sentry-cli --auth-token {os.environ['SENTRY_TOKEN']} releases finalize -o {sentry_org} -p {sentry_project} {self.version}")

def deploy(self):
copy(self, "CuraEngine*", src=os.path.join(self.package_folder, "bin"), dst=self.install_folder)

def package(self):
match self.settings.os:
case "Windows":
Expand Down
2 changes: 1 addition & 1 deletion include/BeadingStrategy/LimitedBeadingStrategy.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class LimitedBeadingStrategy : public BeadingStrategy
coord_t getOptimalThickness(coord_t bead_count) const override;
coord_t getTransitionThickness(coord_t lower_bead_count) const override;
coord_t getOptimalBeadCount(coord_t thickness) const override;
virtual std::string toString() const override;
std::string toString() const override;

coord_t getTransitioningLength(coord_t lower_bead_count) const override;

Expand Down
2 changes: 1 addition & 1 deletion include/BeadingStrategy/OuterWallInsetBeadingStrategy.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class OuterWallInsetBeadingStrategy : public BeadingStrategy
coord_t getOptimalBeadCount(coord_t thickness) const override;
coord_t getTransitioningLength(coord_t lower_bead_count) const override;

virtual std::string toString() const;
std::string toString() const override;

private:
BeadingStrategyPtr parent_;
Expand Down
2 changes: 1 addition & 1 deletion include/BeadingStrategy/RedistributeBeadingStrategy.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class RedistributeBeadingStrategy : public BeadingStrategy
coord_t getTransitioningLength(coord_t lower_bead_count) const override;
double getTransitionAnchorPos(coord_t lower_bead_count) const override;

virtual std::string toString() const;
std::string toString() const override;

protected:
/*!
Expand Down
16 changes: 8 additions & 8 deletions include/BeadingStrategy/WideningBeadingStrategy.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ class WideningBeadingStrategy : public BeadingStrategy

virtual ~WideningBeadingStrategy() override = default;

virtual Beading compute(coord_t thickness, coord_t bead_count) const override;
virtual coord_t getOptimalThickness(coord_t bead_count) const override;
virtual coord_t getTransitionThickness(coord_t lower_bead_count) const override;
virtual coord_t getOptimalBeadCount(coord_t thickness) const override;
virtual coord_t getTransitioningLength(coord_t lower_bead_count) const override;
virtual double getTransitionAnchorPos(coord_t lower_bead_count) const override;
virtual std::vector<coord_t> getNonlinearThicknesses(coord_t lower_bead_count) const override;
virtual std::string toString() const override;
Beading compute(coord_t thickness, coord_t bead_count) const override;
coord_t getOptimalThickness(coord_t bead_count) const override;
coord_t getTransitionThickness(coord_t lower_bead_count) const override;
coord_t getOptimalBeadCount(coord_t thickness) const override;
coord_t getTransitioningLength(coord_t lower_bead_count) const override;
double getTransitionAnchorPos(coord_t lower_bead_count) const override;
std::vector<coord_t> getNonlinearThicknesses(coord_t lower_bead_count) const override;
std::string toString() const override;

protected:
BeadingStrategyPtr parent_;
Expand Down
2 changes: 1 addition & 1 deletion include/ExtruderPlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class ExtruderPlan
* \param maximum_cool_min_layer_time Maximum minimum layer time for all extruders in this layer
* \param time_other_extr_plans Time spend on other extruders in this layer
*/
void forceMinimalLayerTime(double maximum_cool_min_layer_time, double time_other_extr_plans);
bool forceMinimalLayerTime(double maximum_cool_min_layer_time, double time_other_extr_plans);

/*!
* @return The time needed for (un)retract the path
Expand Down
9 changes: 8 additions & 1 deletion include/FffGcodeWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ class FffGcodeWriter : public NoCopy
*/
void processRaft(const SliceDataStorage& storage);

void startRaftLayer(const SliceDataStorage& storage, LayerPlan& gcode_layer, const LayerIndex layer_nr, size_t layer_extruder, size_t& current_extruder);

void endRaftLayer(const SliceDataStorage& storage, LayerPlan& gcode_layer, const LayerIndex layer_nr, size_t& current_extruder, const bool append_to_prime_tower = true);

/*!
* Convert the polygon data of a layer into a layer plan on the FffGcodeWriter::layer_plan_buffer
*
Expand Down Expand Up @@ -660,8 +664,11 @@ class FffGcodeWriter : public NoCopy
* \param[in] storage where the slice data is stored.
* \param gcode_layer The initial planning of the gcode of the layer.
* \param extruder_nr The extruder to switch to.
* \param append_to_prime_tower Indicates whether we should actually prime the extruder on the prime tower (normal
* case before actually using the extruder) or just do the basic priming (i.e. on first
* layer before starting the print
*/
void setExtruder_addPrime(const SliceDataStorage& storage, LayerPlan& gcode_layer, const size_t extruder_nr) const;
void setExtruder_addPrime(const SliceDataStorage& storage, LayerPlan& gcode_layer, const size_t extruder_nr, const bool append_to_prime_tower = true) const;

/*!
* Add the prime tower gcode for the current layer.
Expand Down
15 changes: 12 additions & 3 deletions include/LayerPlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class Comb;
class SliceDataStorage;
class LayerPlanBuffer;


/*!
* The LayerPlan class stores multiple moves that are planned.
*
Expand Down Expand Up @@ -100,8 +99,11 @@ class LayerPlan : public NoCopy
coord_t comb_move_inside_distance_; //!< Whenever using the minimum boundary for combing it tries to move the coordinates inside by this distance after calculating the combing.
Shape bridge_wall_mask_; //!< The regions of a layer part that are not supported, used for bridging
Shape overhang_mask_; //!< The regions of a layer part where the walls overhang
Shape seam_overhang_mask_; //!< The regions of a layer part where the walls overhang, specifically as defined for the seam
Shape roofing_mask_; //!< The regions of a layer part where the walls are exposed to the air

bool min_layer_time_used = false; //!< Wether or not the minimum layer time (cool_min_layer_time) was actually used in this layerplan.

const std::vector<FanSpeedLayerTimeSettings> fan_speed_layer_time_settings_per_extruder_;

enum CombBoundary
Expand Down Expand Up @@ -282,6 +284,13 @@ class LayerPlan : public NoCopy
*/
void setOverhangMask(const Shape& polys);

/*!
* Set seam_overhang_mask.
*
* \param polys The overhung areas of the part currently being processed that will require modified print settings w.r.t. seams
*/
void setSeamOverhangMask(const Shape& polys);

/*!
* Set roofing_mask.
*
Expand Down Expand Up @@ -670,12 +679,12 @@ class LayerPlan : public NoCopy
template<typename T>
unsigned locateFirstSupportedVertex(const T& wall, const unsigned start_idx) const
{
if (bridge_wall_mask_.empty() && overhang_mask_.empty())
if (bridge_wall_mask_.empty() && seam_overhang_mask_.empty())
{
return start_idx;
}

const auto air_below = bridge_wall_mask_.unionPolygons(overhang_mask_);
const auto air_below = bridge_wall_mask_.unionPolygons(seam_overhang_mask_);

unsigned curr_idx = start_idx;

Expand Down
2 changes: 0 additions & 2 deletions include/PrimeTower.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ class PrimeTower

public:
bool enabled_; //!< Whether the prime tower is enabled.
bool would_have_actual_tower_; //!< Whether there is an actual tower.
bool multiple_extruders_on_first_layer_; //!< Whether multiple extruders are allowed on the first layer of the prime tower (e.g. when a raft is there)

/*
* In which order, from outside to inside, will we be printing the prime
Expand Down
9 changes: 8 additions & 1 deletion include/gcodeExport.h
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,14 @@ class GCodeExport : public NoCopy

void writeFanCommand(double speed);

void writeTemperatureCommand(const size_t extruder, const Temperature& temperature, const bool wait = false);
/*!
* \brief Write a GCode temperature command
* \param extruder The extruder number
* \param temperature The temperature to bo set
* \param wait Indicates whether we should just set the temperature and keep going, or wait for the temperature to be reach before going further
* \param force_write_on_equal When true, we should write the temperature command even if the actual set temperature is the same
*/
void writeTemperatureCommand(const size_t extruder, const Temperature& temperature, const bool wait = false, const bool force_write_on_equal = false);
void writeBedTemperatureCommand(const Temperature& temperature, const bool wait = false);
void writeBuildVolumeTemperatureCommand(const Temperature& temperature, const bool wait = false);

Expand Down
21 changes: 21 additions & 0 deletions include/raft.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ class Raft
*/
static size_t getTotalExtraLayers();

/*!
* \brief Get the amount of layers for the raft base.
* \note This is currently hard-coded to 1 because we have yet no setting for the base
*/
static size_t getBaseLayers();

/*! \brief Get the amount of layers for the raft interface. */
static size_t getInterfaceLayers();

/*! \brief Get the amount of layers for the raft top. */
static size_t getSurfaceLayers();

enum LayerType
{
RaftBase,
Expand All @@ -70,6 +82,15 @@ class Raft
* \return The type of layer at the given layer index.
*/
static LayerType getLayerType(LayerIndex layer_index);

private:
/*!
* \brief Get the amount of layers to be printed for the given raft section
* \param extruder_nr_setting_name The name of the setting to be fetched to get the proper extruder number
* \param target_raft_section The name of the setting to be fetched to get the number of layers
* \return The number of layers for the given raft section, or 0 if raft is disabled
*/
static size_t getLayersAmount(const std::string& extruder_nr_setting_name, const std::string& target_raft_section);
};

} // namespace cura
Expand Down
8 changes: 4 additions & 4 deletions src/BeadingStrategy/BeadingStrategyFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@ BeadingStrategyPtr BeadingStrategyFactory::makeStrategy(
wall_add_middle_threshold,
inward_distributed_center_wall_count);
spdlog::debug("Applying the Redistribute meta-strategy with outer-wall width = {}, inner-wall width = {}", preferred_bead_width_outer, preferred_bead_width_inner);
ret = make_unique<RedistributeBeadingStrategy>(preferred_bead_width_outer, minimum_variable_line_ratio, move(ret));
ret = make_unique<RedistributeBeadingStrategy>(preferred_bead_width_outer, minimum_variable_line_ratio, std::move(ret));

if (print_thin_walls)
{
spdlog::debug("Applying the Widening Beading meta-strategy with minimum input width {} and minimum output width {}.", min_feature_size, min_bead_width);
ret = make_unique<WideningBeadingStrategy>(move(ret), min_feature_size, min_bead_width);
ret = make_unique<WideningBeadingStrategy>(std::move(ret), min_feature_size, min_bead_width);
}
if (outer_wall_offset > 0)
{
spdlog::debug("Applying the OuterWallOffset meta-strategy with offset = {}", outer_wall_offset);
ret = make_unique<OuterWallInsetBeadingStrategy>(outer_wall_offset, move(ret));
ret = make_unique<OuterWallInsetBeadingStrategy>(outer_wall_offset, std::move(ret));
}

// Apply the LimitedBeadingStrategy last, since that adds a 0-width marker wall which other beading strategies shouldn't touch.
spdlog::debug("Applying the Limited Beading meta-strategy with maximum bead count = {}", max_bead_count);
ret = make_unique<LimitedBeadingStrategy>(max_bead_count, move(ret));
ret = make_unique<LimitedBeadingStrategy>(max_bead_count, std::move(ret));
return ret;
}
} // namespace cura
Loading

0 comments on commit d6f171f

Please sign in to comment.