Fix for SPE-2674 1/2

issue in file SPE-2674_mini13-armor-runner-v8.3mf
This commit is contained in:
Filip Sykala - NTB T15p 2025-02-10 17:23:37 +01:00 committed by Lukas Matena
parent eec3b8e7d6
commit 409900a4c9
3 changed files with 10 additions and 4 deletions

View File

@ -2048,13 +2048,13 @@ coord_t get_longest_distance(const IslandPartChanges& changes, Position* center
return farest_from_change; return farest_from_change;
const NodeDistance *prev_node_distance = farest_distnace; const NodeDistance *prev_node_distance = farest_distnace;
const NodeDistance *node_distance = nullptr; const NodeDistance *node_distance = prev_node_distance;
// iterate over longest path to find center(half distance) // iterate over longest path to find center(half distance)
while (prev_node_distance->shortest_distances[change_index].distance > half_distance) { while (prev_node_distance->shortest_distances[change_index].distance >= half_distance) {
node_distance = prev_node_distance; node_distance = prev_node_distance;
size_t prev_index = node_distance->shortest_distances[change_index].prev_node_distance_index; size_t prev_index = node_distance->shortest_distances[change_index].prev_node_distance_index;
// case with center on change neighbor is already handled, so prev_index should be valid // case with center on change neighbor is already handled, so prev_index should be valid
assert(prev_index != no_index); assert(prev_index != no_index && prev_index<node_distances.size());
prev_node_distance = &node_distances[prev_index]; prev_node_distance = &node_distances[prev_index];
} }
@ -2144,7 +2144,7 @@ std::pair<size_t, std::vector<size_t>> merge_negihbor(IslandParts &island_parts,
} }
} }
return std::make_pair(index, remove_indices); return std::make_pair(modified_index, remove_indices);
} }
/// <summary> /// <summary>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -389,6 +389,7 @@ ExPolygons createTestIslands(double size)
ExPolygon(PolygonUtils::create_equilateral_triangle(scale_(18.6))), ExPolygon(PolygonUtils::create_equilateral_triangle(scale_(18.6))),
create_cylinder_bottom_slice(), create_cylinder_bottom_slice(),
load_svg(dir + "lm_issue.svg"), // change from thick to thin and vice versa on circle load_svg(dir + "lm_issue.svg"), // change from thick to thin and vice versa on circle
load_svg(dir + "SPE-2674.svg"), // center of longest path lay inside of the VD node
// still problem // still problem
// three support points // three support points