mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 10:32:20 +00:00
Fix compile error
This commit is contained in:
@@ -62,7 +62,7 @@ static bool is_valid_gcode(const std::string &gcode)
|
||||
return is_valid;
|
||||
}
|
||||
|
||||
Polygon chamfer_polygon(Polygon &polygon, double chamfer_dis = 2., double angle_tol = 30. / 180. * PI)
|
||||
static Polygon chamfer_polygon(Polygon &polygon, double chamfer_dis = 2., double angle_tol = 30. / 180. * PI)
|
||||
{
|
||||
if (polygon.points.size() < 3) return polygon;
|
||||
Polygon res;
|
||||
@@ -96,7 +96,7 @@ Polygon chamfer_polygon(Polygon &polygon, double chamfer_dis = 2., double angle_
|
||||
return res;
|
||||
}
|
||||
|
||||
Polygon rounding_polygon(Polygon &polygon, double rounding = 2., double angle_tol = 30. / 180. * PI)
|
||||
static Polygon rounding_polygon(Polygon &polygon, double rounding = 2., double angle_tol = 30. / 180. * PI)
|
||||
{
|
||||
if (polygon.points.size() < 3) return polygon;
|
||||
Polygon res;
|
||||
@@ -164,7 +164,7 @@ Polygon rounding_polygon(Polygon &polygon, double rounding = 2., double angle_to
|
||||
return res;
|
||||
}
|
||||
|
||||
Polygon rounding_rectangle(Polygon &polygon, double rounding = 2., double angle_tol = 30. / 180. * PI) {
|
||||
static Polygon rounding_rectangle(Polygon &polygon, double rounding = 2., double angle_tol = 30. / 180. * PI) {
|
||||
if (polygon.points.size() < 3) return polygon;
|
||||
Polygon res;
|
||||
res.points.reserve(polygon.points.size() * 2);
|
||||
@@ -222,7 +222,7 @@ Polygon rounding_rectangle(Polygon &polygon, double rounding = 2., double angle_
|
||||
return res;
|
||||
}
|
||||
|
||||
std::pair<bool, Vec2f> ray_intersetion_line(const Vec2f &a, const Vec2f &v1, const Vec2f &b, const Vec2f &c)
|
||||
static std::pair<bool, Vec2f> ray_intersetion_line(const Vec2f &a, const Vec2f &v1, const Vec2f &b, const Vec2f &c)
|
||||
{
|
||||
const Vec2f v2 = c - b;
|
||||
double denom = cross2(v1, v2);
|
||||
@@ -239,19 +239,19 @@ std::pair<bool, Vec2f> ray_intersetion_line(const Vec2f &a, const Vec2f &v1, con
|
||||
}
|
||||
return std::pair<bool, Vec2f>(false, Vec2f{0, 0});
|
||||
}
|
||||
Polygon scale_polygon(const std::vector<Vec2f> &points) {
|
||||
static Polygon scale_polygon(const std::vector<Vec2f> &points) {
|
||||
Polygon res;
|
||||
for (const auto &p : points) res.points.push_back(scaled(p));
|
||||
return res;
|
||||
}
|
||||
std::vector<Vec2f> unscale_polygon(const Polygon& polygon)
|
||||
static std::vector<Vec2f> unscale_polygon(const Polygon& polygon)
|
||||
{
|
||||
std::vector<Vec2f> res;
|
||||
for (const auto &p : polygon.points) res.push_back(unscaled<float>(p));
|
||||
return res;
|
||||
}
|
||||
|
||||
Polygon generate_rectange(const Line &line, coord_t offset)
|
||||
static Polygon generate_rectange(const Line &line, coord_t offset)
|
||||
{
|
||||
Point p1 = line.a;
|
||||
Point p2 = line.b;
|
||||
@@ -329,7 +329,7 @@ struct PointWithFlag
|
||||
int pair_idx; // gap_pair idx
|
||||
bool is_forward;
|
||||
};
|
||||
IntersectionInfo move_point_along_polygon(const std::vector<Vec2f> &points, const Vec2f &startPoint, int startIdx, float offset, bool forward, int pair_idx)
|
||||
static IntersectionInfo move_point_along_polygon(const std::vector<Vec2f> &points, const Vec2f &startPoint, int startIdx, float offset, bool forward, int pair_idx)
|
||||
{
|
||||
float remainingDistance = offset;
|
||||
IntersectionInfo res;
|
||||
@@ -391,7 +391,7 @@ IntersectionInfo move_point_along_polygon(const std::vector<Vec2f> &points, cons
|
||||
return res;
|
||||
};
|
||||
|
||||
void insert_points(std::vector<PointWithFlag> &pl, int idx, Vec2f pos, int pair_idx, bool is_forward)
|
||||
static void insert_points(std::vector<PointWithFlag> &pl, int idx, Vec2f pos, int pair_idx, bool is_forward)
|
||||
{
|
||||
int next = (idx + 1) % pl.size();
|
||||
Vec2f pos1 = pl[idx].pos;
|
||||
@@ -407,7 +407,7 @@ void insert_points(std::vector<PointWithFlag> &pl, int idx, Vec2f pos, int pair_
|
||||
}
|
||||
}
|
||||
|
||||
Polylines remove_points_from_polygon(const Polygon &polygon, const std::vector<Vec2f> &skip_points, double range, bool is_left ,Polygon& insert_skip_pg)
|
||||
static Polylines remove_points_from_polygon(const Polygon &polygon, const std::vector<Vec2f> &skip_points, double range, bool is_left ,Polygon& insert_skip_pg)
|
||||
{
|
||||
Polylines result;
|
||||
std::vector<PointWithFlag> new_pl; // add intersection points for gaps, where bool indicates whether it's a gap point.
|
||||
@@ -500,7 +500,7 @@ Polylines remove_points_from_polygon(const Polygon &polygon, const std::vector<V
|
||||
return result;
|
||||
}
|
||||
|
||||
Polylines contrust_gap_for_skip_points(const Polygon &polygon, const std::vector<Vec2f> & skip_points ,float wt_width,float gap_length,Polygon& insert_skip_polygon)
|
||||
static Polylines contrust_gap_for_skip_points(const Polygon &polygon, const std::vector<Vec2f> & skip_points ,float wt_width,float gap_length,Polygon& insert_skip_polygon)
|
||||
{
|
||||
if (skip_points.empty()) {
|
||||
insert_skip_polygon = polygon;
|
||||
@@ -515,7 +515,7 @@ Polylines contrust_gap_for_skip_points(const Polygon &polygon, const std::vector
|
||||
|
||||
};
|
||||
|
||||
Polygon generate_rectange_polygon(const Vec2f &wt_box_min ,const Vec2f & wt_box_max) {
|
||||
static Polygon generate_rectange_polygon(const Vec2f &wt_box_min ,const Vec2f & wt_box_max) {
|
||||
Polygon res;
|
||||
res.points.push_back(scaled(wt_box_min));
|
||||
res.points.push_back(scaled(Vec2f{wt_box_max[0], wt_box_min[1]}));
|
||||
|
||||
@@ -69,7 +69,7 @@ static bool is_valid_gcode(const std::string& gcode)
|
||||
return is_valid;
|
||||
}
|
||||
|
||||
Polygon chamfer_polygon(Polygon& polygon, double chamfer_dis = 2., double angle_tol = 30. / 180. * PI)
|
||||
static Polygon chamfer_polygon(Polygon& polygon, double chamfer_dis = 2., double angle_tol = 30. / 180. * PI)
|
||||
{
|
||||
if (polygon.points.size() < 3)
|
||||
return polygon;
|
||||
@@ -104,7 +104,7 @@ Polygon chamfer_polygon(Polygon& polygon, double chamfer_dis = 2., double angle_
|
||||
return res;
|
||||
}
|
||||
|
||||
Polygon rounding_polygon(Polygon& polygon, double rounding = 2., double angle_tol = 30. / 180. * PI)
|
||||
static Polygon rounding_polygon(Polygon& polygon, double rounding = 2., double angle_tol = 30. / 180. * PI)
|
||||
{
|
||||
if (polygon.points.size() < 3)
|
||||
return polygon;
|
||||
@@ -174,7 +174,7 @@ Polygon rounding_polygon(Polygon& polygon, double rounding = 2., double angle_to
|
||||
return res;
|
||||
}
|
||||
|
||||
Polygon rounding_rectangle(Polygon& polygon, double rounding = 2., double angle_tol = 30. / 180. * PI)
|
||||
static Polygon rounding_rectangle(Polygon& polygon, double rounding = 2., double angle_tol = 30. / 180. * PI)
|
||||
{
|
||||
if (polygon.points.size() < 3)
|
||||
return polygon;
|
||||
@@ -234,7 +234,7 @@ Polygon rounding_rectangle(Polygon& polygon, double rounding = 2., double angle_
|
||||
return res;
|
||||
}
|
||||
|
||||
std::pair<bool, Vec2f> ray_intersetion_line(const Vec2f& a, const Vec2f& v1, const Vec2f& b, const Vec2f& c)
|
||||
static std::pair<bool, Vec2f> ray_intersetion_line(const Vec2f& a, const Vec2f& v1, const Vec2f& b, const Vec2f& c)
|
||||
{
|
||||
const Vec2f v2 = c - b;
|
||||
double denom = cross2(v1, v2);
|
||||
@@ -252,14 +252,14 @@ std::pair<bool, Vec2f> ray_intersetion_line(const Vec2f& a, const Vec2f& v1, con
|
||||
}
|
||||
return std::pair<bool, Vec2f>(false, Vec2f{0, 0});
|
||||
}
|
||||
Polygon scale_polygon(const std::vector<Vec2f>& points)
|
||||
static Polygon scale_polygon(const std::vector<Vec2f>& points)
|
||||
{
|
||||
Polygon res;
|
||||
for (const auto& p : points)
|
||||
res.points.push_back(scaled(p));
|
||||
return res;
|
||||
}
|
||||
std::vector<Vec2f> unscale_polygon(const Polygon& polygon)
|
||||
static std::vector<Vec2f> unscale_polygon(const Polygon& polygon)
|
||||
{
|
||||
std::vector<Vec2f> res;
|
||||
for (const auto& p : polygon.points)
|
||||
@@ -267,7 +267,7 @@ std::vector<Vec2f> unscale_polygon(const Polygon& polygon)
|
||||
return res;
|
||||
}
|
||||
|
||||
Polygon generate_rectange(const Line& line, coord_t offset)
|
||||
static Polygon generate_rectange(const Line& line, coord_t offset)
|
||||
{
|
||||
Point p1 = line.a;
|
||||
Point p2 = line.b;
|
||||
@@ -349,7 +349,7 @@ struct PointWithFlag
|
||||
int pair_idx; // gap_pair idx
|
||||
bool is_forward;
|
||||
};
|
||||
IntersectionInfo move_point_along_polygon(
|
||||
static IntersectionInfo move_point_along_polygon(
|
||||
const std::vector<Vec2f>& points, const Vec2f& startPoint, int startIdx, float offset, bool forward, int pair_idx)
|
||||
{
|
||||
float remainingDistance = offset;
|
||||
@@ -412,7 +412,7 @@ IntersectionInfo move_point_along_polygon(
|
||||
return res;
|
||||
};
|
||||
|
||||
void insert_points(std::vector<PointWithFlag>& pl, int idx, Vec2f pos, int pair_idx, bool is_forward)
|
||||
static void insert_points(std::vector<PointWithFlag>& pl, int idx, Vec2f pos, int pair_idx, bool is_forward)
|
||||
{
|
||||
int next = (idx + 1) % pl.size();
|
||||
Vec2f pos1 = pl[idx].pos;
|
||||
@@ -428,7 +428,7 @@ void insert_points(std::vector<PointWithFlag>& pl, int idx, Vec2f pos, int pair_
|
||||
}
|
||||
}
|
||||
|
||||
Polylines remove_points_from_polygon(
|
||||
static Polylines remove_points_from_polygon(
|
||||
const Polygon& polygon, const std::vector<Vec2f>& skip_points, double range, bool is_left, Polygon& insert_skip_pg)
|
||||
{
|
||||
assert(polygon.size() > 2);
|
||||
@@ -519,7 +519,7 @@ Polylines remove_points_from_polygon(
|
||||
return result;
|
||||
}
|
||||
|
||||
Polylines contrust_gap_for_skip_points(
|
||||
static Polylines contrust_gap_for_skip_points(
|
||||
const Polygon& polygon, const std::vector<Vec2f>& skip_points, float wt_width, float gap_length, Polygon& insert_skip_polygon)
|
||||
{
|
||||
if (skip_points.empty()) {
|
||||
@@ -534,7 +534,7 @@ Polylines contrust_gap_for_skip_points(
|
||||
return remove_points_from_polygon(polygon, skip_points, gap_length, is_left, insert_skip_polygon);
|
||||
};
|
||||
|
||||
Polygon generate_rectange_polygon(const Vec2f& wt_box_min, const Vec2f& wt_box_max)
|
||||
static Polygon generate_rectange_polygon(const Vec2f& wt_box_min, const Vec2f& wt_box_max)
|
||||
{
|
||||
Polygon res;
|
||||
res.points.push_back(scaled(wt_box_min));
|
||||
|
||||
@@ -2873,7 +2873,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
|
||||
float a = dynamic_cast<const ConfigOptionFloat*>(proj_cfg.option("wipe_tower_rotation_angle"))->value;
|
||||
float tower_brim_width = dynamic_cast<const ConfigOptionFloat*>(m_config->option("prime_tower_brim_width"))->value;
|
||||
// BBS
|
||||
// float v = dynamic_cast<const ConfigOptionFloat*>(m_config->option("prime_volume"))->value;
|
||||
float v = dynamic_cast<const ConfigOptionFloat*>(m_config->option("prime_volume"))->value;
|
||||
Vec3d plate_origin = ppl.get_plate(plate_id)->get_origin();
|
||||
|
||||
const Print* print = m_process->fff_print();
|
||||
|
||||
@@ -1821,7 +1821,7 @@ Vec3d PartPlate::calculate_wipe_tower_size(const DynamicPrintConfig &config, con
|
||||
if (!use_global_objects && !contain_instance_totally(obj_idx, 0))
|
||||
continue;
|
||||
|
||||
BoundingBoxf3 bbox = m_model->objects[obj_idx]->bounding_box();
|
||||
BoundingBoxf3 bbox = m_model->objects[obj_idx]->bounding_box_exact();
|
||||
max_height = std::max(bbox.size().z(), max_height);
|
||||
}
|
||||
wipe_tower_size(2) = max_height;
|
||||
|
||||
Reference in New Issue
Block a user