fix(build): more Point3 typing for polyline.points access in GCode.cpp
This commit is contained in:
@@ -10199,8 +10199,8 @@ std::optional<PreferredSeamPoint> GCode::texture_mapping_seam_hiding_hint(const
|
||||
};
|
||||
|
||||
for (size_t point_idx = 1; point_idx < points.size(); ++point_idx) {
|
||||
const Point &a = points[point_idx - 1];
|
||||
const Point &b = points[point_idx];
|
||||
const Point3 &a = points[point_idx - 1];
|
||||
const Point3 &b = points[point_idx];
|
||||
const double len_mm = unscale<double>((b - a).cast<double>().norm());
|
||||
if (len_mm <= EPSILON)
|
||||
continue;
|
||||
@@ -10239,8 +10239,8 @@ std::optional<PreferredSeamPoint> GCode::texture_mapping_seam_hiding_hint(const
|
||||
if (best_path != nullptr &&
|
||||
best_candidate.segment_index > 0 &&
|
||||
best_candidate.segment_index < best_path->polyline.points.size()) {
|
||||
const Point &a = best_path->polyline.points[best_candidate.segment_index - 1];
|
||||
const Point &b = best_path->polyline.points[best_candidate.segment_index];
|
||||
const Point3 &a = best_path->polyline.points[best_candidate.segment_index - 1];
|
||||
const Point3 &b = best_path->polyline.points[best_candidate.segment_index];
|
||||
const double len_mm = unscale<double>((b - a).cast<double>().norm());
|
||||
if (len_mm > EPSILON) {
|
||||
const float best_path_outer_width_mm = std::max(
|
||||
@@ -10991,8 +10991,8 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
|
||||
const size_t end_idx = path.polyline.points.size() - 1;
|
||||
size_t best_idx = 0;
|
||||
for (size_t point_idx = 1; point_idx < end_idx; ++point_idx) {
|
||||
const Point &candidate = path.polyline.points[point_idx];
|
||||
const Point &best = path.polyline.points[best_idx];
|
||||
const Point3 &candidate = path.polyline.points[point_idx];
|
||||
const Point3 &best = path.polyline.points[best_idx];
|
||||
if (candidate.x() < best.x() || (candidate.x() == best.x() && candidate.y() < best.y()))
|
||||
best_idx = point_idx;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user