mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-10 18:56:13 +00:00
clean up comments
This commit is contained in:
@@ -501,10 +501,8 @@ SCENARIO("Nozzle-group metadata .3mf round-trip", "[3mf][MultiNozzle]") {
|
||||
|
||||
|
||||
// A mixed-color filament occupies an ordinary filament slot, and painting with it stores an
|
||||
// ordinary extruder state — a project saved by BambuStudio encodes filament 5 of a 5-slot setup
|
||||
// as paint state 5, with the mix described by the parallel filament_mixed_* project arrays. This
|
||||
// pins both halves of that contract at the .3mf layer: the project keys and the painted states
|
||||
// must come back exactly as written.
|
||||
// ordinary extruder state: a project saved by BambuStudio encodes filament 5 of a 5-slot setup
|
||||
// as paint state 5, with the mix described by the parallel filament_mixed_* project arrays.
|
||||
SCENARIO("Mixed-color filament setup and painting round-trip through a .3mf", "[3mf][MixedFilament]") {
|
||||
GIVEN("a painted model whose project config describes a mixed filament in the last slot") {
|
||||
Model model;
|
||||
|
||||
@@ -101,10 +101,9 @@ TEST_CASE("check_mixed_filament_type_consistency flags mismatched component type
|
||||
|
||||
TEST_CASE("a support-flagged component reads as its own filament type for the consistency check", "[FilamentMixer]")
|
||||
{
|
||||
// Sidebar::update_mixed_filament_list and Sidebar::has_broken_mixed_filament derive each
|
||||
// component's type through DynamicPrintConfig::get_filament_type, which folds the
|
||||
// filament_is_support flag into the type — so toggling that flag alone changes the verdict
|
||||
// and Plater::on_config_change has to refresh the mixed list on filament_is_support too.
|
||||
// The sidebar derives each component's type through DynamicPrintConfig::get_filament_type,
|
||||
// which folds filament_is_support into the type, so toggling that flag alone flips the
|
||||
// verdict and the mixed filament list has to be refreshed on filament_is_support too.
|
||||
DynamicPrintConfig plain_pla;
|
||||
plain_pla.set_key_value("filament_type", new ConfigOptionStrings({"PLA"}));
|
||||
plain_pla.set_key_value("filament_is_support", new ConfigOptionBools({false}));
|
||||
@@ -193,8 +192,8 @@ TEST_CASE("blend_color_multi weights components", "[FilamentMixer]")
|
||||
}
|
||||
|
||||
SECTION("Mixing a color with itself stays close to that color") {
|
||||
// The mixer is a degree-4 polynomial fit of pigment behaviour, so a round trip through
|
||||
// it is near-identity rather than exact (the model documents a mean Delta-E around 2).
|
||||
// The mixer is a degree-4 polynomial fit of pigment behaviour, so mixing a color with
|
||||
// itself lands near it rather than exactly on it; allow a small per-channel drift.
|
||||
std::string mixed = blend_color_multi({"#123456", "#123456"}, {1, 1});
|
||||
REQUIRE(mixed.size() == 7);
|
||||
auto comp = [](const std::string &hex, int i) {
|
||||
|
||||
@@ -614,12 +614,10 @@ TEST_CASE("set_num_filaments keeps mixed-color arrays in step with the filament
|
||||
}
|
||||
}
|
||||
|
||||
// A mix is described by 1-based indices into the project's filament list. Orca's per-printer
|
||||
// preset memory rebuilds that list from the selected printer's snapshot (filament_%02u /
|
||||
// filament_colors) at startup and on every printer selection, so the mixed arrays must be stored
|
||||
// in the SAME per-printer snapshot: kept globally (as BambuStudio does — its filament list is a
|
||||
// single global snapshot too) they end up indexing a list they were never saved against, and used
|
||||
// to be reset on every printer selection instead, losing the mixes over an app restart.
|
||||
// A mix is described by 1-based indices into the project's filament list, which Orca rebuilds
|
||||
// from the selected printer's snapshot (filament_%02u / filament_colors) at startup and on every
|
||||
// printer selection. Held anywhere but that same per-printer snapshot, the mixed arrays end up
|
||||
// indexing a filament list they were never saved against.
|
||||
TEST_CASE("Mixed-color filament metadata is snapshotted per printer, with its filament list", "[Preset][Bundle][FilamentMixer]")
|
||||
{
|
||||
PresetBundle bundle;
|
||||
@@ -674,10 +672,9 @@ TEST_CASE("A multi-point gradient curve survives the app-config snapshot", "[Pre
|
||||
}
|
||||
|
||||
// A multi-tool printer sizes the filament list from its nozzle count. Mixed-color slots are extra
|
||||
// virtual filaments at the tail of that list with no nozzle of their own, so the sync has to add
|
||||
// them on top. Sizing to the nozzle count alone truncates them — and because that sync runs right
|
||||
// after a project is loaded, it silently drops the project's mixes and then lets the filament-count
|
||||
// change strip every painted facet above the new count.
|
||||
// virtual filaments at the tail of that list with no nozzle of their own, so the count has to
|
||||
// allow for them: sizing to the nozzle count alone drops the project's mixes and strips every
|
||||
// painted facet above the new count.
|
||||
TEST_CASE("Sizing the filament list to a multi-tool nozzle count keeps mixed slots", "[Preset][Bundle][FilamentMixer]")
|
||||
{
|
||||
// The 5-slot layout of a 4-tool project carrying one mix of filaments 2 and 3.
|
||||
|
||||
@@ -99,7 +99,7 @@ TEST_CASE("Extruder states above 17 are encoded in a second nibble", "[TriangleS
|
||||
}
|
||||
|
||||
// Model.cpp writes these hex strings into the 3MF for colored mesh imports; the selector must
|
||||
// decode exactly the states that table assigns to them.
|
||||
// decode exactly the states CONST_FILAMENTS assigns to them.
|
||||
TEST_CASE("Extruder states match the CONST_FILAMENTS hex encoding", "[TriangleSelector]")
|
||||
{
|
||||
struct Case { const char *hex; int state; };
|
||||
|
||||
Reference in New Issue
Block a user