Merge branch 'fs_fix_SPE-2095' into master_27x

This commit is contained in:
Filip Sykala - NTB T15p 2024-01-18 09:40:15 +01:00
commit b3beeb9193

View File

@ -102,6 +102,9 @@ struct DataCreateObject
// Define which gizmo open on the success // Define which gizmo open on the success
GLGizmosManager::EType gizmo; GLGizmosManager::EType gizmo;
// additionl rotation around Z axe, given by style settings
std::optional<float> angle = {};
}; };
/// <summary> /// <summary>
@ -330,6 +333,12 @@ void CreateObjectJob::process(Ctl &ctl)
offset -= m_result.center(); offset -= m_result.center();
Transform3d::TranslationType tt(offset.x(), offset.y(), offset.z()); Transform3d::TranslationType tt(offset.x(), offset.y(), offset.z());
m_transformation = Transform3d(tt); m_transformation = Transform3d(tt);
// rotate around Z by style settings
if (m_input.angle.has_value()) {
std::optional<float> distance; // new object ignore surface distance from style settings
apply_transformation(m_input.angle, distance, m_transformation);
}
} }
void CreateObjectJob::finalize(bool canceled, std::exception_ptr &eptr) void CreateObjectJob::finalize(bool canceled, std::exception_ptr &eptr)
@ -1485,7 +1494,13 @@ bool start_create_object_job(const CreateVolumeParams &input, DataBasePtr emboss
{ {
const Pointfs &bed_shape = input.build_volume.bed_shape(); const Pointfs &bed_shape = input.build_volume.bed_shape();
auto gizmo_type = static_cast<GLGizmosManager::EType>(input.gizmo); auto gizmo_type = static_cast<GLGizmosManager::EType>(input.gizmo);
DataCreateObject data{std::move(emboss_data), coor, input.camera, bed_shape, gizmo_type}; DataCreateObject data{std::move(emboss_data), coor, input.camera, bed_shape, gizmo_type, input.angle};
// Fix: adding text on print bed with style containing use_surface
if (data.base->shape.projection.use_surface)
// Til the print bed is flat using surface for Object is useless
data.base->shape.projection.use_surface = false;
auto job = std::make_unique<CreateObjectJob>(std::move(data)); auto job = std::make_unique<CreateObjectJob>(std::move(data));
return queue_job(input.worker, std::move(job)); return queue_job(input.worker, std::move(job));
} }