824 {
831 Point maxCorner = { minCorner.x() + w +
bd, minCorner.y() + d +
bd };
832
834
835 std::vector<ExtrusionPaths> paths;
836 for (float hh = 0.f; hh < h; hh += lh) {
837
838 if (hh != 0.f) {
839
840 size_t i = 0;
843 break;
846 maxCorner = { minCorner.x() + w, minCorner.y() + d };
847 }
848
849
851 path.polyline = Polyline3(Polyline{{ minCorner, {maxCorner.x(), minCorner.y()}, maxCorner, {minCorner.x(), maxCorner.y()}, minCorner }});
852 paths.push_back({ path });
853
854
855
857 path.polyline = Polyline3(Polyline{{ {minCorner.x(), y}, {maxCorner.x(), y} }});
858 paths.back().emplace_back(path);
859 }
860
861
862 if (cone_base_R > 0.) {
863 path.polyline.clear();
864 double r = cone_base_R * (1 - hh/
height);
865 for (
double alpha=0; alpha<2.01*
M_PI; alpha+=2*
M_PI/20.)
866 path.polyline.points.emplace_back(
Point::new_scale(
width/2. + r * std::cos(alpha)/cone_scale_x,
depth/2. + r * std::sin(alpha)));
867 paths.back().emplace_back(path);
868 if (hh == 0.f) {
870 path.polyline.clear();
871 for (
double alpha=0; alpha<2.01*
M_PI; alpha+=2*
M_PI/20.)
873 width/2. + cone_base_R * std::cos(alpha)/cone_scale_x * (1. + cone_scale_x*bw/cone_base_R),
874 depth/2. + cone_base_R * std::sin(alpha) * (1. + bw/cone_base_R))
875 );
876 paths.back().emplace_back(path);
877 }
878 }
879 }
880
881
882 if (hh == 0.f) {
885 }
886 }
887
888
890 for (ExtrusionPath& p : ps) {
893 }
894 }
895
896 return paths;
897 }
#define M_PI
Definition ExtrusionSimulator.cpp:31
static Point new_scale(coordf_t x, coordf_t y)
Definition Point.hpp:214
static std::pair< double, double > get_wipe_tower_cone_base(double width, double height, double depth, double angle_deg)
Definition WipeTower2.cpp:2151
int64_t coord_t
Definition libslic3r.h:48
constexpr T deg2rad(const T angle)
Definition Geometry.hpp:312
std::vector< ExtrusionPath > ExtrusionPaths
Definition ExtrusionEntity.hpp:395
float cone_angle
Definition Print.hpp:764
float rotation_angle
Definition Print.hpp:763
std::vector< std::pair< float, float > > z_and_depth_pairs
Definition Print.hpp:761