mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 19:35:55 +08:00
Verify layerHeight conf value before use
This commit is contained in:
parent
c4c8b7608e
commit
535191c1e9
@ -317,10 +317,16 @@ ConfigSubstitutions import_sla_archive(
|
|||||||
if (profile_in.empty()) { // missing profile... do guess work
|
if (profile_in.empty()) { // missing profile... do guess work
|
||||||
// try to recover the layer height from the config.ini which was
|
// try to recover the layer height from the config.ini which was
|
||||||
// present in all versions of sl1 files.
|
// present in all versions of sl1 files.
|
||||||
auto lh_str = arch.config.find("layerHeight")->second.data();
|
if (auto lh_opt = arch.config.find("layerHeight");
|
||||||
double lh = std::stod(lh_str); // TODO replace with std::from_chars
|
lh_opt != arch.config.not_found())
|
||||||
profile_out.set("layer_height", lh);
|
{
|
||||||
profile_out.set("initial_layer_height", lh);
|
auto lh_str = lh_opt->second.data();
|
||||||
|
try {
|
||||||
|
double lh = std::stod(lh_str); // TODO replace with std::from_chars
|
||||||
|
profile_out.set("layer_height", lh);
|
||||||
|
profile_out.set("initial_layer_height", lh);
|
||||||
|
} catch(...) {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the archive contains an empty profile, use the one that was passed as output argument
|
// If the archive contains an empty profile, use the one that was passed as output argument
|
||||||
|
Loading…
x
Reference in New Issue
Block a user