mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-17 20:57:26 +00:00
* Remove Unused Project Includes and Forward-Declare Where a Type Is Only Referenced Generated with include-what-you-use and applied conservatively. Only OrcaSlicer's own headers, the ones under src/ and tests/, are removed or forward-declared; standard-library and third-party includes are left alone. An include is removed only when both the Release and the Debug configuration leave it unused, never from inside a conditional block, and never from a file with platform-specific blocks, which only gain includes. Files whose only use of a header sits behind a feature or debug macro (libvgcode's OpenGL ES and marker code, the ARACHNE/TESTS_EXPORT_SVGS debug output) keep their includes. clonable_ptr.hpp gains #pragma once; it had no include guard and was only safe while Config.hpp was its sole includer. * Remove Unused Project Includes From Files With Platform-Specific Code A Linux include-what-you-use run cannot see the code inside _WIN32, __APPLE__ or __linux__ blocks, so its verdict is only taken where nothing the removed header declares, directly or through what it includes, is named inside those blocks. Removals also have to hold in both the Release and Debug configuration and never touch a line inside a conditional block. * Restore the libslic3r Precompiled Header and Direct Includes Lost in the Platform Pass The platform-file pass treated pchheader.hpp as an ordinary header and emptied it, and left GUI_Preview.hpp and 14 other files relying on headers they no longer reached directly. * Restore MainFrame.hpp in ParamsDialog.cpp for the Windows-Only Reparent Call * Include Headers That Files Reached Through Ones the Cleanup Removed * Drop Includes Duplicated by the Cleanup or by Main's Own Additions * Leave PreciseSeam.cpp as Main Has It After the Precise Seam Rework
245 lines
8.7 KiB
C++
245 lines
8.7 KiB
C++
#ifndef slic3r_FillRectilinear_hpp_
|
|
#define slic3r_FillRectilinear_hpp_
|
|
|
|
#include "../libslic3r.h"
|
|
|
|
#include "libslic3r/BoundingBox.hpp"
|
|
#include "libslic3r/ExtrusionEntity.hpp"
|
|
#include "libslic3r/ExPolygon.hpp"
|
|
#include "FillBase.hpp"
|
|
#include "libslic3r/Polyline.hpp"
|
|
#include <initializer_list>
|
|
#include <cstddef>
|
|
#include <vector>
|
|
#include <utility>
|
|
#include "libslic3r/Point.hpp"
|
|
#include "libslic3r/Polygon.hpp"
|
|
|
|
namespace Slic3r { class Flow; }
|
|
|
|
namespace Slic3r {
|
|
|
|
class PrintRegionConfig;
|
|
class Surface;
|
|
|
|
class FillRectilinear : public Fill
|
|
{
|
|
public:
|
|
Fill* clone() const override { return new FillRectilinear(*this); }
|
|
~FillRectilinear() override = default;
|
|
Polylines fill_surface(const Surface *surface, const FillParams ¶ms) override;
|
|
bool is_self_crossing() override { return false; }
|
|
|
|
protected:
|
|
// Fill by single directional lines, interconnect the lines along perimeters.
|
|
bool fill_surface_by_lines(const Surface *surface, const FillParams ¶ms, float angleBase, float pattern_shift, Polylines &polylines_out);
|
|
|
|
|
|
// Fill by multiple sweeps of differing directions.
|
|
struct SweepParams {
|
|
float angle_base;
|
|
float pattern_shift;
|
|
};
|
|
bool fill_surface_by_multilines(const Surface *surface, FillParams params, const std::initializer_list<SweepParams> &sweep_params, Polylines &polylines_out);
|
|
bool fill_surface_trapezoidal(const Surface *surface, FillParams params, Polylines &polylines_out, int Pattern_type);
|
|
|
|
// The extended bounding box of the whole object that covers any rotation of every layer.
|
|
BoundingBox extended_object_bounding_box() const;
|
|
};
|
|
|
|
class FillAlignedRectilinear : public FillRectilinear
|
|
{
|
|
public:
|
|
Fill* clone() const override { return new FillAlignedRectilinear(*this); }
|
|
~FillAlignedRectilinear() override = default;
|
|
|
|
protected:
|
|
// Always generate infill at the same angle.
|
|
virtual float _layer_angle(size_t idx) const override { return 0.f; }
|
|
};
|
|
|
|
class FillMonotonic : public FillRectilinear
|
|
{
|
|
public:
|
|
Fill* clone() const override { return new FillMonotonic(*this); }
|
|
~FillMonotonic() override = default;
|
|
Polylines fill_surface(const Surface *surface, const FillParams ¶ms) override;
|
|
bool no_sort() const override { return true; }
|
|
};
|
|
|
|
class FillMonotonicLine : public FillRectilinear
|
|
{
|
|
public:
|
|
Fill* clone() const override { return new FillMonotonicLine(*this); }
|
|
~FillMonotonicLine() override = default;
|
|
Polylines fill_surface(const Surface *surface, const FillParams ¶ms) override;
|
|
bool no_sort() const override { return true; }
|
|
};
|
|
|
|
class FillGrid : public FillRectilinear
|
|
{
|
|
public:
|
|
Fill* clone() const override { return new FillGrid(*this); }
|
|
~FillGrid() override = default;
|
|
Polylines fill_surface(const Surface *surface, const FillParams ¶ms) override;
|
|
bool is_self_crossing() override { return true; }
|
|
|
|
protected:
|
|
// The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill.
|
|
float _layer_angle(size_t idx) const override { return 0.f; }
|
|
};
|
|
|
|
class FillLateralLattice : public FillRectilinear
|
|
{
|
|
public:
|
|
Fill* clone() const override { return new FillLateralLattice(*this); }
|
|
~FillLateralLattice() override = default;
|
|
Polylines fill_surface(const Surface *surface, const FillParams ¶ms) override;
|
|
|
|
protected:
|
|
// The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill.
|
|
float _layer_angle(size_t idx) const override { return 0.f; }
|
|
};
|
|
|
|
class FillTriangles : public FillRectilinear
|
|
{
|
|
public:
|
|
Fill* clone() const override { return new FillTriangles(*this); }
|
|
~FillTriangles() override = default;
|
|
Polylines fill_surface(const Surface *surface, const FillParams ¶ms) override;
|
|
bool is_self_crossing() override { return true; }
|
|
|
|
protected:
|
|
// The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill.
|
|
float _layer_angle(size_t idx) const override { return 0.f; }
|
|
};
|
|
|
|
class FillStars : public FillRectilinear
|
|
{
|
|
public:
|
|
Fill* clone() const override { return new FillStars(*this); }
|
|
~FillStars() override = default;
|
|
Polylines fill_surface(const Surface *surface, const FillParams ¶ms) override;
|
|
bool is_self_crossing() override { return true; }
|
|
|
|
protected:
|
|
// The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill.
|
|
float _layer_angle(size_t idx) const override { return 0.f; }
|
|
};
|
|
|
|
class FillCubic : public FillRectilinear
|
|
{
|
|
public:
|
|
Fill* clone() const override { return new FillCubic(*this); }
|
|
~FillCubic() override = default;
|
|
Polylines fill_surface(const Surface *surface, const FillParams ¶ms) override;
|
|
bool is_self_crossing() override { return true; }
|
|
|
|
protected:
|
|
// The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill.
|
|
float _layer_angle(size_t idx) const override { return 0.f; }
|
|
};
|
|
|
|
// Added QuarterCubic pattern from Cura
|
|
class FillQuarterCubic : public FillRectilinear
|
|
{
|
|
public:
|
|
Fill* clone() const override { return new FillQuarterCubic(*this); }
|
|
~FillQuarterCubic() override = default;
|
|
Polylines fill_surface(const Surface *surface, const FillParams ¶ms) override;
|
|
|
|
protected:
|
|
// The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill.
|
|
float _layer_angle(size_t idx) const override { return 0.f; }
|
|
};
|
|
|
|
class FillLateralHoneycomb : public FillAlignedRectilinear
|
|
{
|
|
public:
|
|
Fill* clone() const override { return new FillLateralHoneycomb(*this); }
|
|
~FillLateralHoneycomb() override = default;
|
|
Polylines fill_surface(const Surface *surface, const FillParams ¶ms) override;
|
|
};
|
|
|
|
|
|
class FillSupportBase : public FillRectilinear
|
|
{
|
|
public:
|
|
Fill* clone() const override { return new FillSupportBase(*this); }
|
|
~FillSupportBase() override = default;
|
|
Polylines fill_surface(const Surface *surface, const FillParams ¶ms) override;
|
|
|
|
protected:
|
|
// The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill.
|
|
float _layer_angle(size_t idx) const override { return 0.f; }
|
|
};
|
|
|
|
// Orca: Introduced FillMonotonicLines from Prusa slicer, inhereting from FillRectilinear
|
|
// This replaces the FillMonotonicLineWGapFill from BBS
|
|
class FillMonotonicLines : public FillRectilinear
|
|
{
|
|
public:
|
|
Fill* clone() const override { return new FillMonotonicLines(*this); }
|
|
~FillMonotonicLines() override = default;
|
|
Polylines fill_surface(const Surface *surface, const FillParams ¶ms) override;
|
|
bool no_sort() const override { return true; }
|
|
};
|
|
|
|
//Orca: Replaced with FillMonotonicLines, inheriting from FillRectilinear
|
|
/*class FillMonotonicLineWGapFill : public Fill
|
|
{
|
|
public:
|
|
~FillMonotonicLineWGapFill() override = default;
|
|
void fill_surface_extrusion(const Surface *surface, const FillParams ¶ms, ExtrusionEntitiesPtr &out) override;
|
|
bool is_self_crossing() override { return false; }
|
|
|
|
protected:
|
|
Fill* clone() const override { return new FillMonotonicLineWGapFill(*this); };
|
|
bool no_sort() const override { return true; }
|
|
|
|
private:
|
|
void fill_surface_by_lines(const Surface* surface, const FillParams& params, Polylines& polylines_out);
|
|
};*/
|
|
|
|
class FillZigZag : public FillRectilinear
|
|
{
|
|
public:
|
|
Fill* clone() const override { return new FillZigZag(*this); }
|
|
~FillZigZag() override = default;
|
|
|
|
bool has_consistent_pattern() const override { return true; }
|
|
};
|
|
|
|
class FillCrossZag : public FillRectilinear
|
|
{
|
|
public:
|
|
Fill *clone() const override { return new FillCrossZag(*this); }
|
|
~FillCrossZag() override = default;
|
|
|
|
bool has_consistent_pattern() const override { return true; }
|
|
};
|
|
|
|
class FillLockedZag : public FillRectilinear
|
|
{
|
|
public:
|
|
Fill *clone() const override { return new FillLockedZag(*this); }
|
|
~FillLockedZag() override = default;
|
|
LockRegionParam lock_param;
|
|
|
|
void fill_surface_extrusion(const Surface *surface, const FillParams ¶ms, ExtrusionEntitiesPtr &out) override;
|
|
|
|
bool has_consistent_pattern() const override { return true; }
|
|
void set_lock_region_param(const LockRegionParam &lock_param) override { this->lock_param = lock_param;};
|
|
void fill_surface_locked_zag(const Surface * surface,
|
|
const FillParams & params,
|
|
std::vector<std::pair<Polylines, Flow>> &multi_width_polyline);
|
|
};
|
|
|
|
Points sample_grid_pattern(const ExPolygon &expolygon, coord_t spacing, const BoundingBox &global_bounding_box);
|
|
Points sample_grid_pattern(const ExPolygons &expolygons, coord_t spacing, const BoundingBox &global_bounding_box);
|
|
Points sample_grid_pattern(const Polygons &polygons, coord_t spacing, const BoundingBox &global_bounding_box);
|
|
|
|
} // namespace Slic3r
|
|
|
|
#endif // slic3r_FillRectilinear_hpp_
|