mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
Fixed density calculation is wrong for resin cost calculation (#3460)
This commit is contained in:
parent
4f1f507d5a
commit
bea82a4501
1 changed files with 3 additions and 3 deletions
|
@ -3444,15 +3444,15 @@ void TabSLAMaterial::build()
|
||||||
DynamicPrintConfig new_conf = *m_config;
|
DynamicPrintConfig new_conf = *m_config;
|
||||||
|
|
||||||
if (opt_key == "bottle_volume") {
|
if (opt_key == "bottle_volume") {
|
||||||
double new_bottle_weight = boost::any_cast<double>(value)/(new_conf.option("material_density")->getFloat() * 1000);
|
double new_bottle_weight = boost::any_cast<double>(value)*(new_conf.option("material_density")->getFloat() / 1000);
|
||||||
new_conf.set_key_value("bottle_weight", new ConfigOptionFloat(new_bottle_weight));
|
new_conf.set_key_value("bottle_weight", new ConfigOptionFloat(new_bottle_weight));
|
||||||
}
|
}
|
||||||
if (opt_key == "bottle_weight") {
|
if (opt_key == "bottle_weight") {
|
||||||
double new_bottle_volume = boost::any_cast<double>(value)*(new_conf.option("material_density")->getFloat() * 1000);
|
double new_bottle_volume = boost::any_cast<double>(value)/(new_conf.option("material_density")->getFloat() * 1000);
|
||||||
new_conf.set_key_value("bottle_volume", new ConfigOptionFloat(new_bottle_volume));
|
new_conf.set_key_value("bottle_volume", new ConfigOptionFloat(new_bottle_volume));
|
||||||
}
|
}
|
||||||
if (opt_key == "material_density") {
|
if (opt_key == "material_density") {
|
||||||
double new_bottle_volume = new_conf.option("bottle_weight")->getFloat() * boost::any_cast<double>(value) * 1000;
|
double new_bottle_volume = new_conf.option("bottle_weight")->getFloat() / boost::any_cast<double>(value) * 1000;
|
||||||
new_conf.set_key_value("bottle_volume", new ConfigOptionFloat(new_bottle_volume));
|
new_conf.set_key_value("bottle_volume", new ConfigOptionFloat(new_bottle_volume));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue