mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-11 01:41:03 +00:00
Merge upstream main: color mixing feature and related fixes
Brings in 54 upstream commits, the bulk of them the BambuStudio-ported color mixing / mixed filament subsystem (#15347) plus its follow-ups, along with the Assimp-backed colored OBJ import, warning-policy build changes, and assorted profile and localization updates. Two conflicts, both "each side added at the same point", resolved by keeping both: - Print::validate() -- our IMEX multi-color block and upstream's new gradient mixed filament warning were inserted at the same spot after the empty extruders check. They test unrelated conditions, so both are kept, each with its own closing brace. - tests/libslic3r/test_3mf.cpp -- our three IMEX per-plate round-trip scenarios and upstream's mixed-filament round-trip scenario both append to the end of the file, and each side added one include. All four scenarios and both includes are kept. Everything else merged cleanly, including GCode.cpp, ToolOrdering.cpp, PartPlate.cpp and PrintConfig.cpp. Upstream left the is_extruder_used block untouched, so the IMEX supplement still applies, and estimate_wipe_tower_polygon is unchanged, so the prime tower hull work is unaffected. Not addressed here, and worth its own change: a mixed filament is a virtual slot that no nozzle carries, while physical_extruder_map routes logical slots to physical heads. Print::extruders() lists mixed slots under their own id whereas tool_ordering.all_extruders() lists them post-expansion, so the IMEX pem lookups have no defined answer for a mixed slot. Upstream's own guards reject a mixed filament where a physical slot is required; IMEX likely wants the same. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -423,7 +423,7 @@ void GCodeViewer::SequentialView::Marker::render_position_window(const libvgcode
|
||||
if (properties_shown) {
|
||||
float label_w = 0.0f;
|
||||
float value_w = 0.0f;
|
||||
properties_rows.reserve(13);
|
||||
properties_rows.reserve(14);
|
||||
auto add_row = [&properties_rows, &label_w, &value_w](std::string label, std::string value) {
|
||||
label_w = std::max(label_w, ImGui::CalcTextSize(label.c_str()).x);
|
||||
value_w = std::max(value_w, ImGui::CalcTextSize(value.c_str()).x);
|
||||
@@ -436,6 +436,27 @@ void GCodeViewer::SequentialView::Marker::render_position_window(const libvgcode
|
||||
add_row(_u8L("Width"), buff);
|
||||
if (is_extrusion) sprintf(buff, ("%.3f " + _u8L("mm")).c_str(), vertex.height); else strcpy(buff, NA_CSTR);
|
||||
add_row(_u8L("Height"), buff);
|
||||
// ORCA: Length of the move ending at the current vertex. Arc moves (G2/G3) are discretized
|
||||
// into several vertices sharing the same gcode line id, so accumulate the whole run to report
|
||||
// the arc length instead of the length of a single chord.
|
||||
if (vertex_id > 0 && (is_extrusion || vertex.is_travel() || vertex.is_wipe())) {
|
||||
const size_t vertices_count = viewer->get_vertices_count();
|
||||
size_t first_id = vertex_id;
|
||||
while (first_id > 0 && viewer->get_vertex_at(first_id - 1).gcode_id == vertex.gcode_id)
|
||||
--first_id;
|
||||
size_t last_id = vertex_id;
|
||||
while (last_id + 1 < vertices_count && viewer->get_vertex_at(last_id + 1).gcode_id == vertex.gcode_id)
|
||||
++last_id;
|
||||
float length = 0.0f;
|
||||
for (size_t i = std::max<size_t>(first_id, 1); i <= last_id; ++i) {
|
||||
length += (libvgcode::convert(viewer->get_vertex_at(i).position) -
|
||||
libvgcode::convert(viewer->get_vertex_at(i - 1).position)).norm();
|
||||
}
|
||||
sprintf(buff, ("%.3f " + _u8L("mm")).c_str(), length);
|
||||
}
|
||||
else
|
||||
strcpy(buff, NA_CSTR);
|
||||
add_row(_u8L("Length"), buff);
|
||||
sprintf(buff, "%d", vertex.layer_id + 1);
|
||||
add_row(_u8L("Layer"), buff);
|
||||
sprintf(buff, ("%.1f " + _u8L("mm/s")).c_str(), vertex.feedrate);
|
||||
|
||||
Reference in New Issue
Block a user