post changes after merging BS1.7.4

Remove tracking etc..
This commit is contained in:
SoftFever 2023-08-26 18:24:13 +08:00
parent e65b11a831
commit 2a478ab4f9
615 changed files with 46215 additions and 54844 deletions

View file

@ -71,9 +71,12 @@ Model& Model::assign_copy(const Model &rhs)
// BBS
this->plates_custom_gcodes = rhs.plates_custom_gcodes;
this->curr_plate_index = rhs.curr_plate_index;
this->calib_pa_pattern.reset();
if (rhs.calib_pa_pattern) {
this->calib_pa_pattern = std::make_unique<CalibPressureAdvancePattern>(CalibPressureAdvancePattern(*rhs.calib_pa_pattern));
this->calib_pa_pattern = std::make_unique<CalibPressureAdvancePattern>(
CalibPressureAdvancePattern(*rhs.calib_pa_pattern)
);
}
// BBS: for design info
@ -104,7 +107,8 @@ Model& Model::assign_copy(Model &&rhs)
// BBS
this->plates_custom_gcodes = std::move(rhs.plates_custom_gcodes);
this->curr_plate_index = rhs.curr_plate_index;
this->calib_pa_pattern = std::move(rhs.calib_pa_pattern);
this->calib_pa_pattern.reset();
this->calib_pa_pattern.swap(rhs.calib_pa_pattern);
//BBS: add auxiliary path logic
// BBS: backup, all in one temp dir
@ -810,7 +814,7 @@ std::string Model::get_backup_path()
std::time_t t = std::time(0);
std::tm* now_time = std::localtime(&t);
std::stringstream buf;
buf << "/bamboo_model/";
buf << "/orcaslicer_model/";
buf << std::put_time(now_time, "%a_%b_%d/%H_%M_%S#");
buf << pid << "#";
buf << this->id().id;
@ -1378,19 +1382,11 @@ const BoundingBoxf3& ModelObject::raw_bounding_box() const
}
// This returns an accurate snug bounding box of the transformed object instance, without the translation applied.
BoundingBoxf3 ModelObject::instance_bounding_box(size_t instance_idx, bool dont_translate) const
{
BoundingBoxf3 bb;
const Transform3d& inst_matrix = this->instances[instance_idx]->get_transformation().get_matrix(dont_translate);
for (ModelVolume *v : this->volumes)
{
if (v->is_model_part())
bb.merge(v->mesh().transformed_bounding_box(inst_matrix * v->get_matrix()));
}
return bb;
BoundingBoxf3 ModelObject::instance_bounding_box(size_t instance_idx, bool dont_translate) const {
return instance_bounding_box(*this->instances[instance_idx], dont_translate);
}
BoundingBoxf3 ModelObject::instance_bounding_box(const ModelInstance& instance, bool dont_translate) const {
BoundingBoxf3 ModelObject::instance_bounding_box(const ModelInstance &instance, bool dont_translate) const {
BoundingBoxf3 bbox;
const auto& inst_mat = instance.get_transformation().get_matrix(dont_translate);
for (auto vol : this->volumes) {
@ -1400,6 +1396,7 @@ BoundingBoxf3 ModelObject::instance_bounding_box(const ModelInstance& instance,
return bbox;
}
//BBS: add convex bounding box
BoundingBoxf3 ModelObject::instance_convex_hull_bounding_box(size_t instance_idx, bool dont_translate) const
{
@ -2461,7 +2458,6 @@ void ModelObject::bake_xy_rotation_into_meshes(size_t instance_idx)
assert(instance_idx < this->instances.size());
const Geometry::Transformation reference_trafo = this->instances[instance_idx]->get_transformation();
if (Geometry::is_rotation_ninety_degrees(reference_trafo.get_rotation()))
// nothing to do, scaling in the world coordinate space is possible in the representation of Geometry::Transformation.
return;
@ -3250,6 +3246,7 @@ double Model::findMaxSpeed(const ModelObject* object) {
double solidInfillSpeedObj = Model::printSpeedMap.solidInfillSpeed;
double topSolidInfillSpeedObj = Model::printSpeedMap.topSolidInfillSpeed;
double supportSpeedObj = Model::printSpeedMap.supportSpeed;
double smallPerimeterSpeedObj = Model::printSpeedMap.smallPerimeterSpeed;
for (std::string objectKey : objectKeys) {
if (objectKey == "inner_wall_speed"){
perimeterSpeedObj = object->config.opt_float(objectKey);
@ -3265,8 +3262,10 @@ double Model::findMaxSpeed(const ModelObject* object) {
supportSpeedObj = object->config.opt_float(objectKey);
if (objectKey == "outer_wall_speed")
externalPerimeterSpeedObj = object->config.opt_float(objectKey);
if (objectKey == "small_perimeter_speed")
smallPerimeterSpeedObj = object->config.opt_float(objectKey);
}
objMaxSpeed = std::max(perimeterSpeedObj, std::max(externalPerimeterSpeedObj, std::max(infillSpeedObj, std::max(solidInfillSpeedObj, std::max(topSolidInfillSpeedObj, std::max(supportSpeedObj, objMaxSpeed))))));
objMaxSpeed = std::max(perimeterSpeedObj, std::max(externalPerimeterSpeedObj, std::max(infillSpeedObj, std::max(solidInfillSpeedObj, std::max(topSolidInfillSpeedObj, std::max(supportSpeedObj, std::max(smallPerimeterSpeedObj, objMaxSpeed)))))));
if (objMaxSpeed <= 0) objMaxSpeed = 250.;
return objMaxSpeed;
}