NEW: add best_object_pos for auto-arranging

For i3 printers, best object position may not be the bed center,
we need to align objects to the specified best_object_pos.

Jira: STUDIO-4133

Change-Id: I06e31e597d2dd8288eb24a52d836cc8a134a4111
This commit is contained in:
chunmao.guo
2023-08-21 13:08:32 +08:00
committed by Lane.Wei
parent c2f8993828
commit 142499871e
13 changed files with 48 additions and 20 deletions

View File

@@ -37,8 +37,9 @@ struct NfpPConfig {
BOTTOM_RIGHT,
TOP_LEFT,
TOP_RIGHT,
DONT_ALIGN //!> Warning: parts may end up outside the bin with the
DONT_ALIGN, //!> Warning: parts may end up outside the bin with the
//! default object function.
USER_DEFINED
};
/// Which angles to try out for better results.
@@ -50,6 +51,8 @@ struct NfpPConfig {
/// Where to start putting objects in the bin.
Alignment starting_point;
TPoint<RawShape> best_object_pos;
/**
* @brief A function object representing the fitting function in the
* placement optimization process. (Optional)
@@ -1100,6 +1103,11 @@ private:
cb = bbin.maxCorner();
break;
}
case Config::Alignment::USER_DEFINED: {
ci = bb.center();
cb = config_.best_object_pos;
break;
}
default: ; // DONT_ALIGN
}