Fix crashing if slicing with non organic tree support (#14074)

Fix non organic tree support crashing

Fix Orca crashing during slicing if non organic tree support is used
This commit is contained in:
Kiss Lorand
2026-06-07 08:31:52 +03:00
committed by GitHub
parent 236a8f3941
commit 454b6c0045
2 changed files with 35 additions and 3 deletions

View File

@@ -1332,7 +1332,12 @@ static void make_perimeter_and_infill(ExtrusionEntitiesPtr& dst, const ExPolygon
dst = std::move(loops_entities);
}
}
dst.erase(std::remove_if(dst.begin(), dst.end(), [](ExtrusionEntity *entity) { return static_cast<ExtrusionEntityCollection *>(entity)->empty(); }), dst.end());
// Orca: Some entities are direct paths, so check the type before testing for an empty collection.
dst.erase(std::remove_if(dst.begin(), dst.end(), [](ExtrusionEntity *entity) {
return entity != nullptr && entity->is_collection() && static_cast<ExtrusionEntityCollection *>(entity)->empty();
}), dst.end());
if (infill_first) {
// sort regions to reduce travel
Points ordering_points;