Quick fix for invalidation of support spots search

This commit is contained in:
PavelMikus 2022-07-28 15:47:34 +02:00
parent 1d4f41a2fd
commit ea76977602
4 changed files with 15 additions and 4 deletions

View File

@ -1194,8 +1194,10 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_
update_apply_status(false);
}
// Invalidate just the supports step.
for (const PrintObjectStatus &print_object_status : print_objects_range)
for (const PrintObjectStatus &print_object_status : print_objects_range) {
update_apply_status(print_object_status.print_object->invalidate_step(posSupportSpotsSearch));
update_apply_status(print_object_status.print_object->invalidate_step(posSupportMaterial));
}
if (supports_differ) {
// Copy just the support volumes.
model_volume_list_update_supports(model_object, model_object_new);

View File

@ -436,7 +436,7 @@ void PrintObject::generate_support_spots()
Vec3f point = Vec3f(inv_transform * support_point.position);
Vec3f origin = Vec3f(
inv_transform * Vec3f(support_point.position.x(), support_point.position.y(), 0.0f));
selector.enforce_spot(point, origin, 0.6f);
selector.enforce_spot(point, origin, 1.0f);
}
model_volume->supported_facets.set(selector.selector);

View File

@ -13,7 +13,7 @@ struct Params {
const float bridge_distance_decrease_by_curvature_factor = 3.0f; // allowed bridge distance = bridge_distance / (this factor * (curvature / PI) )
const float min_distance_between_support_points = 3.0f; //mm
const float support_points_interface_radius = 0.6f; // mm
const float support_points_interface_radius = 1.0f; // mm
const float gravity_constant = 9806.65f; // mm/s^2; gravity acceleration on Earth's surface, algorithm assumes that printer is in upwards position.
const float max_acceleration = 9*1000.0f; // mm/s^2 ; max acceleration of object (bed) in XY (NOTE: The max hit is received by the object in the jerk phase, so the usual machine limits are too low)

View File

@ -414,7 +414,6 @@ void GLGizmoFdmSupports::get_data_from_backend()
if (mv->is_model_part()){
mesh_id++;
mv->supported_facets.assign(mvs[mv->id().id]->supported_facets);
mv->supported_facets.touch();
m_triangle_selectors[mesh_id]->deserialize(mv->supported_facets.get_data(), true);
m_triangle_selectors[mesh_id]->request_update_render_data();
}
@ -510,6 +509,16 @@ void GLGizmoFdmSupports::auto_generate()
if (not_painted || dlg.ShowModal() == wxID_YES) {
Plater::TakeSnapshot snapshot(wxGetApp().plater(), _L("Autogenerate support points"));
int mesh_id = -1.0f;
for (ModelVolume *mv : mo->volumes) {
if (mv->is_model_part()) {
mesh_id++;
mv->supported_facets.reset();
m_triangle_selectors[mesh_id]->reset();
m_triangle_selectors[mesh_id]->request_update_render_data();
}
}
this->waiting_for_autogenerated_supports = true;
wxGetApp().CallAfter([this]() { reslice_FDM_supports(); });
}