mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-02 15:52:14 +00:00
ENH:add rib wall wipe tower
jira: none Change-Id: I9699cc74e206851284949f89230e986435b9e1b7 (cherry picked from commit eabfa6b272590698886ecec33b89207605b91993) (cherry picked from commit 1d33d1c37d4dada1cd1129ff16fe46d07933ad26)
This commit is contained in:
@@ -600,6 +600,7 @@ struct FakeWipeTower
|
||||
float rotation_angle;
|
||||
float cone_angle;
|
||||
Vec2d plate_origin;
|
||||
BoundingBoxf real_bbx;
|
||||
|
||||
void set_fake_extrusion_data(Vec2f p, float w, float h, float lh, float d, float bd, Vec2d o)
|
||||
{
|
||||
@@ -624,6 +625,12 @@ struct FakeWipeTower
|
||||
cone_angle = ca;
|
||||
plate_origin = o;
|
||||
}
|
||||
void set_bbx()
|
||||
{
|
||||
real_bbx.min += pos.cast<double>();
|
||||
real_bbx.max += pos.cast<double>();
|
||||
}
|
||||
|
||||
void set_pos(Vec2f p) { pos = p; }
|
||||
void set_pos_and_rotation(const Vec2f& p, float rotation) { pos = p; rotation_angle = rotation; }
|
||||
|
||||
@@ -632,8 +639,10 @@ struct FakeWipeTower
|
||||
int d = scale_(depth);
|
||||
int w = scale_(width);
|
||||
int bd = scale_(brim_width);
|
||||
Point minCorner = {scale_(pos.x()), scale_(pos.y())};
|
||||
Point maxCorner = {minCorner.x() + w, minCorner.y() + d};
|
||||
//Point minCorner = {scale_(pos.x()), scale_(pos.y())};
|
||||
//Point maxCorner = {minCorner.x() + w, minCorner.y() + d};
|
||||
Point minCorner = {scale_(real_bbx.min.x()), scale_(real_bbx.min.y())};
|
||||
Point maxCorner = {scale_(real_bbx.max.x()), scale_(real_bbx.max.y())};
|
||||
|
||||
std::vector<ExtrusionPaths> paths;
|
||||
for (float h = 0.f; h < height; h += layer_height) {
|
||||
@@ -641,13 +650,13 @@ struct FakeWipeTower
|
||||
path.polyline = {minCorner, {maxCorner.x(), minCorner.y()}, maxCorner, {minCorner.x(), maxCorner.y()}, minCorner};
|
||||
paths.push_back({path});
|
||||
|
||||
if (h == 0.f) { // add brim
|
||||
ExtrusionPath fakeBrim(ExtrusionRole::erBrim, 0.0, 0.0, layer_height);
|
||||
Point wtbminCorner = {minCorner - Point{bd, bd}};
|
||||
Point wtbmaxCorner = {maxCorner + Point{bd, bd}};
|
||||
fakeBrim.polyline = {wtbminCorner, {wtbmaxCorner.x(), wtbminCorner.y()}, wtbmaxCorner, {wtbminCorner.x(), wtbmaxCorner.y()}, wtbminCorner};
|
||||
paths.back().push_back(fakeBrim);
|
||||
}
|
||||
//if (h == 0.f) { // add brim
|
||||
// ExtrusionPath fakeBrim(ExtrusionRole::erBrim, 0.0, 0.0, layer_height);
|
||||
// Point wtbminCorner = {minCorner - Point{bd, bd}};
|
||||
// Point wtbmaxCorner = {maxCorner + Point{bd, bd}};
|
||||
// fakeBrim.polyline = {wtbminCorner, {wtbmaxCorner.x(), wtbminCorner.y()}, wtbmaxCorner, {wtbminCorner.x(), wtbmaxCorner.y()}, wtbminCorner};
|
||||
// paths.back().push_back(fakeBrim);
|
||||
//}
|
||||
}
|
||||
return paths;
|
||||
}
|
||||
@@ -746,6 +755,7 @@ struct WipeTowerData
|
||||
float depth;
|
||||
std::vector<std::pair<float, float>> z_and_depth_pairs;
|
||||
float brim_width;
|
||||
BoundingBoxf bbx;
|
||||
float height;
|
||||
|
||||
void clear() {
|
||||
@@ -1039,6 +1049,7 @@ public:
|
||||
const Calib_Params& calib_params() const { return m_calib_params; }
|
||||
Vec2d translate_to_print_space(const Vec2d &point) const;
|
||||
float get_wipe_tower_depth() const { return m_wipe_tower_data.depth; }
|
||||
BoundingBoxf get_wipe_tower_bbx() const { return m_wipe_tower_data.bbx; }
|
||||
|
||||
// scaled point
|
||||
Vec2d translate_to_print_space(const Point &point) const;
|
||||
|
||||
Reference in New Issue
Block a user