Refactor infill rotation (#10587)

* refactor Infill rotation template

* clean up comments

* set default solid_infill_rotate_template to empty

* Fix an issue that infill_direction solid_infill_direction not working as expected

* update based on feedback
This commit is contained in:
SoftFever
2025-09-02 22:53:56 +08:00
committed by GitHub
parent b100915eba
commit 266bfeb9e2
8 changed files with 300 additions and 253 deletions

View File

@@ -119,8 +119,8 @@ public:
coordf_t overlap;
// in radians, ccw, 0 = East
float angle;
// Orca: enable angle shifting for layer change
float rotate_angle{ M_PI/180.0 };
// Orca: is_using_template_angle
bool is_using_template_angle{false};
// In scaled coordinates. Maximum lenght of a perimeter segment connecting two infill lines.
// Used by the FillRectilinear2, FillGrid2, FillTriangles, FillStars and FillCubic.
// If left to zero, the links will not be limited.
@@ -182,7 +182,6 @@ protected:
overlap(0.),
// Initial angle is undefined.
angle(FLT_MAX),
rotate_angle(M_PI/180.0),
link_max_length(0),
loop_clipping(0),
// The initial bounding box is empty, therefore undefined.
@@ -204,7 +203,7 @@ protected:
ExPolygon expolygon,
ThickPolylines& thick_polylines_out) {}
virtual float _layer_angle(size_t idx) const { return rotate_angle; }
virtual float _layer_angle(size_t idx) const { return is_using_template_angle ? 0.f : (idx & 1) ? float(M_PI/2.) : 0.f; }
virtual std::pair<float, Point> _infill_direction(const Surface *surface) const;