ENH: fix 0 space exception when slicing
JIRA: none. found by cli slicing Signed-off-by: salt.wei <salt.wei@bambulab.com> Change-Id: I47a754e99e193394b0d34cd05e27304910af521f
This commit is contained in:
parent
3059b49199
commit
adce446e38
|
@ -123,11 +123,11 @@ static ExtrusionPaths thick_polyline_to_extrusion_paths_2(const ThickPolyline& t
|
||||||
if (start_index != i){
|
if (start_index != i){
|
||||||
path = ExtrusionPath(role);
|
path = ExtrusionPath(role);
|
||||||
double length = lines[start_index].length();
|
double length = lines[start_index].length();
|
||||||
double sum = lines[start_index].length() * lines[start_index].a_width;
|
double sum = lines[start_index].length() * 0.5 * (lines[start_index].a_width + lines[start_index].b_width);
|
||||||
path.polyline.append(lines[start_index].a);
|
path.polyline.append(lines[start_index].a);
|
||||||
for (int idx = start_index + 1; idx < i; idx++) {
|
for (int idx = start_index + 1; idx < i; idx++) {
|
||||||
length += lines[idx].length();
|
length += lines[idx].length();
|
||||||
sum += lines[idx].length() * lines[idx].a_width;
|
sum += lines[idx].length() * 0.5 * (lines[idx].a_width + lines[idx].b_width);
|
||||||
path.polyline.append(lines[idx].a);
|
path.polyline.append(lines[idx].a);
|
||||||
}
|
}
|
||||||
path.polyline.append(lines[i].a);
|
path.polyline.append(lines[i].a);
|
||||||
|
|
Loading…
Reference in New Issue