Skip to content

Commit

Permalink
Merge branch 'main' into CURA-9399_sharp_points
Browse files Browse the repository at this point in the history
  • Loading branch information
wawanbreton authored Jun 13, 2024
2 parents a15471f + e77eb50 commit c443378
Show file tree
Hide file tree
Showing 71 changed files with 313 additions and 184 deletions.
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
12 changes: 10 additions & 2 deletions include/LayerPlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ 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.
Expand Down Expand Up @@ -283,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 @@ -671,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
Loading

0 comments on commit c443378

Please sign in to comment.