Skip to content

Commit 96a2abf

Browse files
authored
Merge branch 'main' into CURA-12814
2 parents d5cb2be + 8bfb59a commit 96a2abf

63 files changed

Lines changed: 3299 additions & 1668 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ endif ()
4343

4444
set(engine_SRCS # Except main.cpp.
4545
src/Application.cpp
46-
src/bridge.cpp
4746
src/ConicalOverhang.cpp
4847
src/ExtruderPlan.cpp
4948
src/ExtruderTrain.cpp
@@ -65,6 +64,7 @@ set(engine_SRCS # Except main.cpp.
6564
src/multiVolumes.cpp
6665
src/path_ordering.cpp
6766
src/PathAdapter.cpp
67+
src/PathOrderMonotonic.cpp
6868
src/Preheat.cpp
6969
src/PrimeTower/PrimeTower.cpp
7070
src/PrimeTower/PrimeTowerNormal.cpp
@@ -98,6 +98,12 @@ set(engine_SRCS # Except main.cpp.
9898
src/BeadingStrategy/WideningBeadingStrategy.cpp
9999
src/BeadingStrategy/OuterWallInsetBeadingStrategy.cpp
100100

101+
src/bridge/bridge.cpp
102+
src/bridge/ExpansionRange.cpp
103+
src/bridge/SegmentOverlappingData.cpp
104+
src/bridge/TransformedSegment.cpp
105+
src/bridge/TransformedShape.cpp
106+
101107
src/communication/ArcusCommunication.cpp
102108
src/communication/ArcusCommunicationPrivate.cpp
103109
src/communication/CommandLine.cpp
@@ -177,6 +183,7 @@ set(engine_SRCS # Except main.cpp.
177183
src/geometry/Point3LL.cpp
178184
src/geometry/Polygon.cpp
179185
src/geometry/Shape.cpp
186+
src/geometry/PointMatrix.cpp
180187
src/geometry/PointsSet.cpp
181188
src/geometry/SingleShape.cpp
182189
src/geometry/PartsView.cpp

doc/bridging_skin_support.svg

Lines changed: 139 additions & 0 deletions
Loading

include/ExtruderPlan.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class ExtruderPlan
4242
FRIEND_TEST(ExtruderPlanPathsParameterizedTest, BackPressureCompensationFull);
4343
FRIEND_TEST(ExtruderPlanPathsParameterizedTest, BackPressureCompensationHalf);
4444
FRIEND_TEST(ExtruderPlanTest, BackPressureCompensationEmptyPlan);
45-
friend class FffGcodeWriterTest_SurfaceGetsExtraInfillLinesUnderIt_Test;
45+
friend class DISABLED_FffGcodeWriterTest_SurfaceGetsExtraInfillLinesUnderIt_Test;
4646
#endif
4747
public:
4848
size_t extruder_nr_{ 0 }; //!< The extruder used for this paths in the current plan.

include/FffGcodeWriter.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "FanSpeedLayerTime.h"
1212
#include "GCodePathConfig.h"
1313
#include "LayerPlanBuffer.h"
14+
#include "LinesOrderingMethod.h"
1415
#include "gcodeExport.h"
1516
#include "utils/LayerVector.h"
1617
#include "utils/NoCopy.h"
@@ -38,7 +39,7 @@ struct MeshPathConfigs;
3839
class FffGcodeWriter : public NoCopy
3940
{
4041
friend class FffProcessor; // Because FffProcessor exposes finalize (TODO)
41-
friend class FffGcodeWriterTest_SurfaceGetsExtraInfillLinesUnderIt_Test;
42+
friend class DISABLED_FffGcodeWriterTest_SurfaceGetsExtraInfillLinesUnderIt_Test;
4243

4344
private:
4445
coord_t max_object_height; //!< The maximal height of all previously sliced meshgroups, used to avoid collision when moving to the next meshgroup to print.
@@ -591,6 +592,7 @@ class FffGcodeWriter : public NoCopy
591592
* minimise travel moves (``false``).
592593
* \param[out] added_something Whether this function added anything to the layer plan
593594
* \param fan_speed fan speed override for this skin area
595+
* \param forced_small_area_width A specific value to be used for small_area_width when generating the infill, or nullopt to use the normal value
594596
*/
595597
void processSkinPrintFeature(
596598
const SliceDataStorage& storage,
@@ -603,10 +605,11 @@ class FffGcodeWriter : public NoCopy
603605
const AngleDegrees skin_angle,
604606
const coord_t skin_overlap,
605607
const Ratio skin_density,
606-
const bool monotonic,
608+
const LinesOrderingMethod ordering,
607609
const bool is_roofing_flooring,
608610
bool& added_something,
609-
double fan_speed = GCodePathConfig::FAN_SPEED_DEFAULT) const;
611+
double fan_speed = GCodePathConfig::FAN_SPEED_DEFAULT,
612+
std::optional<coord_t> forced_small_area_width = std::nullopt) const;
610613

611614
/*!
612615
* see if we can avoid printing a lines or zig zag style skin part in multiple segments by moving to
@@ -746,9 +749,8 @@ class FffGcodeWriter : public NoCopy
746749
* \param mesh the mesh containing the layer of interest
747750
* \param part \param part The part for which to create gcode
748751
* \param infill_line_width line width of the infill
749-
* \return true if there needs to be a skin edge support wall in this layer, otherwise false
750752
*/
751-
static bool partitionInfillBySkinAbove(
753+
static void partitionInfillBySkinAbove(
752754
Shape& infill_below_skin,
753755
Shape& infill_not_below_skin,
754756
const LayerPlan& gcode_layer,

include/LayerPlan.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class LayerPlan : public NoCopy
5757
friend class LayerPlanBuffer;
5858
#ifdef BUILD_TESTS
5959
friend class AddTravelTest;
60-
friend class FffGcodeWriterTest_SurfaceGetsExtraInfillLinesUnderIt_Test;
60+
friend class DISABLED_FffGcodeWriterTest_SurfaceGetsExtraInfillLinesUnderIt_Test;
6161
friend class AntiOozeAmountsTest;
6262
FRIEND_TEST(AntiOozeAmountsTest, ComputeAntiOozeAmounts);
6363
#endif
@@ -167,6 +167,8 @@ class LayerPlan : public NoCopy
167167

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

170+
std::map<const SliceMeshStorage*, MixedLinesSet> infill_lines_; //!< Infill lines generated for this layer
171+
170172
const std::vector<FanSpeedLayerTimeSettings> fan_speed_layer_time_settings_per_extruder_;
171173

172174
enum CombBoundary
@@ -417,6 +419,10 @@ class LayerPlan : public NoCopy
417419
*/
418420
void planPrime(double prime_blob_wipe_length = 10.0);
419421

422+
void setGeneratedInfillLines(const SliceMeshStorage* mesh, const MixedLinesSet& infill_lines);
423+
424+
const MixedLinesSet getGeneratedInfillLines(const SliceMeshStorage* mesh) const;
425+
420426
/*!
421427
* Add an extrusion move to a certain point, optionally with a different flow than the one in the \p config.
422428
*
@@ -785,7 +791,8 @@ class LayerPlan : public NoCopy
785791
const coord_t exclude_distance = 0,
786792
const coord_t wipe_dist = 0,
787793
const Ratio flow_ratio = 1.0_r,
788-
const double fan_speed = GCodePathConfig::FAN_SPEED_DEFAULT);
794+
const double fan_speed = GCodePathConfig::FAN_SPEED_DEFAULT,
795+
const bool interlaced = false);
789796

790797
/*!
791798
* Add a spiralized slice of wall that is interpolated in X/Y between \p last_wall and \p wall.

include/LayerPlanBuffer.h

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#ifndef LAYER_PLAN_BUFFER_H
55
#define LAYER_PLAN_BUFFER_H
66

7+
#include <condition_variable>
78
#include <list>
89
#include <vector>
910

@@ -17,6 +18,7 @@ namespace cura
1718
class LayerPlan;
1819
class ExtruderPlan;
1920
class GCodeExport;
21+
struct LayerIndex;
2022

2123
/*!
2224
* Class for buffering multiple layer plans (\ref LayerPlan) / extruder plans within those layer plans, so that temperature commands can be inserted in earlier layer plans.
@@ -57,6 +59,9 @@ class LayerPlanBuffer
5759
*/
5860
std::list<LayerPlan*> buffer_;
5961

62+
std::mutex buffer_mutex_;
63+
std::condition_variable buffer_condition_variable_;
64+
6065
public:
6166
LayerPlanBuffer(GCodeExport& gcode)
6267
: gcode_(gcode)
@@ -66,11 +71,6 @@ class LayerPlanBuffer
6671

6772
void setPreheatConfig();
6873

69-
/*!
70-
* Push a new layer plan into the buffer
71-
*/
72-
void push(LayerPlan& layer_plan);
73-
7474
/*!
7575
* Push a new layer onto the buffer and handle the buffer.
7676
* Write a layer to gcode if it is popped out of the buffer.
@@ -85,6 +85,15 @@ class LayerPlanBuffer
8585
*/
8686
void flush();
8787

88+
/*!
89+
* Gets the layer plan for the given layer, once it has been completed. It will wait for completion if necessary
90+
* @param layer_nr The layer number to get the plan for
91+
* @return The completed layer plan
92+
* @warning Make sure you always ask for a layer plan below the one that is being processed. Since the layers processing is started bottom to top and the engine can be run
93+
* mono-threaded, asking for a layer above could lead to a deadlock because the processing of this layer will never start.
94+
*/
95+
const LayerPlan* getCompletedLayerPlan(const LayerIndex& layer_nr) const;
96+
8897
private:
8998
/*!
9099
* Process all layers in the buffer

include/LinesOrderingMethod.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (c) 2025 UltiMaker
2+
// CuraEngine is released under the terms of the AGPLv3 or higher
3+
4+
#ifndef LINES_ORDERING_METHOD_H
5+
#define LINES_ORDERING_METHOD_H
6+
7+
8+
namespace cura
9+
{
10+
11+
enum class LinesOrderingMethod
12+
{
13+
Basic, // Lines are ordered by shortest distance
14+
Monotonic, // Lines are ordered so that they will always form a continuous print along a direction
15+
Interlaced, // Similar to monotonic, but with 2 passes so that adjacent lines will not be printed just after each other
16+
};
17+
18+
} // namespace cura
19+
20+
#endif

0 commit comments

Comments
 (0)