From bea82a4501d1d2542139affe8455faefe7c6eca9 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Tue, 7 Jan 2020 08:46:11 +0100 Subject: [PATCH] Fixed density calculation is wrong for resin cost calculation (#3460) --- src/slic3r/GUI/Tab.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index adc923b64..353e822e3 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -3444,15 +3444,15 @@ void TabSLAMaterial::build() DynamicPrintConfig new_conf = *m_config; if (opt_key == "bottle_volume") { - double new_bottle_weight = boost::any_cast(value)/(new_conf.option("material_density")->getFloat() * 1000); + double new_bottle_weight = boost::any_cast(value)*(new_conf.option("material_density")->getFloat() / 1000); new_conf.set_key_value("bottle_weight", new ConfigOptionFloat(new_bottle_weight)); } if (opt_key == "bottle_weight") { - double new_bottle_volume = boost::any_cast(value)*(new_conf.option("material_density")->getFloat() * 1000); + double new_bottle_volume = boost::any_cast(value)/(new_conf.option("material_density")->getFloat() * 1000); new_conf.set_key_value("bottle_volume", new ConfigOptionFloat(new_bottle_volume)); } if (opt_key == "material_density") { - double new_bottle_volume = new_conf.option("bottle_weight")->getFloat() * boost::any_cast(value) * 1000; + double new_bottle_volume = new_conf.option("bottle_weight")->getFloat() / boost::any_cast(value) * 1000; new_conf.set_key_value("bottle_volume", new ConfigOptionFloat(new_bottle_volume)); }