Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
wawanbreton committed Oct 22, 2024
2 parents e3ac68c + 9a264cb commit 5b798aa
Show file tree
Hide file tree
Showing 25 changed files with 527 additions and 250 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ target_compile_definitions(_CuraEngine
$<$<AND:$<BOOL:${ENABLE_PLUGINS}>,$<BOOL:${ENABLE_REMOTE_PLUGINS}>>:ENABLE_REMOTE_PLUGINS>
$<$<BOOL:${OLDER_APPLE_CLANG}>:OLDER_APPLE_CLANG>
CURA_ENGINE_VERSION=\"${CURA_ENGINE_VERSION}\"
CURA_ENGINE_HASH=\"${CURA_ENGINE_HASH}\"
$<$<BOOL:${ENABLE_TESTING}>:BUILD_TESTS>
PRIVATE
$<$<BOOL:${WIN32}>:NOMINMAX>
Expand Down
5 changes: 3 additions & 2 deletions conandata.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
version: "5.9.0-alpha.0"
version: "5.9.0-beta.1"
commit: "unknown"
requirements:
- "scripta/0.1.0@ultimaker/testing"
requirements_arcus:
- "arcus/5.4.1"
requirements_plugins:
- "curaengine_grpc_definitions/0.2.1"
requirements_cura_resources:
- "cura_resources/(latest)@ultimaker/testing"
- "cura_resources/5.9.0-beta.1"
1 change: 1 addition & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def generate(self):

tc = CMakeToolchain(self)
tc.variables["CURA_ENGINE_VERSION"] = self.version
tc.variables["CURA_ENGINE_HASH"] = self.conan_data["commit"]
tc.variables["ENABLE_ARCUS"] = self.options.enable_arcus
tc.variables["ENABLE_TESTING"] = not self.conf.get("tools.build:skip_test", False, check_type=bool)
tc.variables["ENABLE_BENCHMARKS"] = self.options.enable_benchmarks
Expand Down
6 changes: 4 additions & 2 deletions include/InsetOrderOptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ class InsetOrderOptimizer
const Point2LL& model_center_point,
const Shape& disallowed_areas_for_seams = {},
const bool scarf_seam = false,
const bool smooth_speed = false);
const bool smooth_speed = false,
const Shape& overhang_areas = Shape());

/*!
* Adds the insets to the given layer plan.
Expand Down Expand Up @@ -114,6 +115,7 @@ class InsetOrderOptimizer
Shape disallowed_areas_for_seams_;
const bool scarf_seam_;
const bool smooth_speed_;
Shape overhang_areas_;

std::vector<std::vector<const Polygon*>> inset_polys_; // vector of vectors holding the inset polygons
Shape retraction_region_; // After printing an outer wall, move into this region so that retractions do not leave visible blobs. Calculated lazily if needed (see
Expand All @@ -128,7 +130,7 @@ class InsetOrderOptimizer
*
* \param closed_line The polygon to insert the seam point in. (It's assumed to be closed at least.)
*
* \return The index of the inserted seam point, or std::nullopt if no seam point was inserted.
* \return The index of the inserted seam point, or the index of the closest point if an existing one can be used.
*/
std::optional<size_t> insertSeamPoint(ExtrusionLine& closed_line);

Expand Down
56 changes: 12 additions & 44 deletions include/LayerPlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ class LayerPlan : public NoCopy
*/
void setSeamOverhangMask(const Shape& polys);

/*!
* Get the seam overhang mask, which contains the areas where we don't want to place the seam because they are overhanding
*/
const Shape& getSeamOverhangMask() const;

/*!
* Set roofing_mask.
*
Expand Down Expand Up @@ -677,50 +682,6 @@ class LayerPlan : public NoCopy
const bool is_top_layer,
const bool is_bottom_layer);


/*!
* Given a wall polygon and a start vertex index, return the index of the first vertex that is supported (is not above air)
*
* Uses bridge_wall_mask and overhang_mask to determine where there is air below
*
* \param wall The wall polygon
* \param start_idx The index of the starting vertex of \p wall
* \return The index of the first supported vertex - if no vertices are supported, start_idx is returned
*/
template<typename T>
size_t locateFirstSupportedVertex(const T& wall, const size_t start_idx) const
{
if (bridge_wall_mask_.empty() && seam_overhang_mask_.empty())
{
return start_idx;
}

const auto air_below = bridge_wall_mask_.unionPolygons(seam_overhang_mask_);

size_t curr_idx = start_idx;

while (true)
{
const Point2LL& vertex = cura::make_point(wall[curr_idx]);
if (! air_below.inside(vertex, true))
{
// vertex isn't above air so it's OK to use
return curr_idx;
}

if (++curr_idx >= wall.size())
{
curr_idx = 0;
}

if (curr_idx == start_idx)
{
// no vertices are supported so just return the original index
return start_idx;
}
}
}

/*!
* Write the planned paths to gcode
*
Expand Down Expand Up @@ -942,6 +903,13 @@ class LayerPlan : public NoCopy
* \return The distance from the start of the current wall line to the first bridge segment
*/
coord_t computeDistanceToBridgeStart(const ExtrusionLine& wall, const size_t current_index, const coord_t min_bridge_line_len) const;

/*!
* \brief Calculates whether the given segment is to be treated as overhanging
* \param p0 The start point of the segment
* \param p1 The end point of the segment
*/
bool segmentIsOnOverhang(const Point3LL& p0, const Point3LL& p1) const;
};

} // namespace cura
Expand Down
Loading

0 comments on commit 5b798aa

Please sign in to comment.