mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-22 14:50:59 +00:00
Merge upstream/main into belt-printer
Brings belt-printer up to main4b4a261787. Resolutions: - G-code header (#15897, #15915): main moved the header, config and thumbnail block later in _do_export; write_belt_header() moves with it, still after the thumbnails and outside the BTT_TFT gate. - _extrude: first-layer acceleration keeps the per-path first-layer plane test with main's cached nozzle index (#16028); main's set_speed out-param form (#16108) everywhere else. - GCodeWriter (#16108): the arc-to-polyline fallback for machine mappings that cannot express G2/G3 now runs in the out-param extrude_arc_to_xy, which is the overload GCode calls, and appends to the caller's string. - GCodeProcessorResult: the belt fields join main's forwarding assign. - Clipper2 (#15969): belt arrange helpers take Slic3r::Point; the tree support join types lose their ClipperLib qualifier. - CLI arrange (#15837): belt printers still reserve no wipe tower. - Wipe tower options (#15841): the two new sparse-layer toggles are hidden for belt printers like the rest of the tower options. - Keyboard shortcuts (#15706): main's registry replaces the old key switch; the belt view toggle is re-registered in the next commit. - Print::process: the belt purge-plan undo runs before main's SliceStarted event. - scripts/filament_id_snapshot.json: deleted on main (a77209af8f). - Includes and appended tests: union of both sides.
This commit is contained in:
commit
bbb94724ba
11471 files changed
+2992690
-2720441
No files matched your search
@@ -8,17 +8,31 @@
|
||||
#include "GLModel.hpp"
|
||||
#include "I18N.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <boost/iostreams/device/mapped_file.hpp>
|
||||
|
||||
#include "LibVGCode/LibVGCodeWrapper.hpp"
|
||||
// needed for tech VGCODE_ENABLE_COG_AND_TOOL_MARKERS
|
||||
#include "libslic3r/Technologies.hpp"
|
||||
#include "libslic3r/Color.hpp"
|
||||
#include "libslic3r/Point.hpp"
|
||||
#include "libslic3r/BoundingBox.hpp"
|
||||
#include <cstddef>
|
||||
#include "libslic3r/Config.hpp"
|
||||
#include "libvgcode/include/GCodeInputData.hpp"
|
||||
#include <iterator>
|
||||
#include "libvgcode/include/PathVertex.hpp"
|
||||
#include <libvgcode/include/Types.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <float.h>
|
||||
#include <set>
|
||||
#include "slic3r/GUI/MeshUtils.hpp"
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
@@ -153,7 +167,10 @@ public:
|
||||
GCodeWindow gcode_window;
|
||||
float m_scale = 1.0;
|
||||
bool m_show_marker = false;
|
||||
void render(const bool has_render_path, float legend_height, const libvgcode::Viewer* viewer, uint32_t gcode_id, int canvas_width, int canvas_height, int right_margin, const libvgcode::EViewType& view_type);
|
||||
// The tool marker at the current move, drawn in 3D.
|
||||
void render_marker(const bool has_render_path, int canvas_width, int canvas_height, const libvgcode::EViewType& view_type);
|
||||
// The marker's position window and the G-code window, both ImGui.
|
||||
void render_overlay(const bool has_render_path, float legend_height, const libvgcode::Viewer* viewer, uint32_t gcode_id, int canvas_width, int canvas_height, int right_margin, const libvgcode::EViewType& view_type);
|
||||
};
|
||||
struct ExtruderFilament
|
||||
{
|
||||
@@ -226,7 +243,8 @@ private:
|
||||
std::vector<libvgcode::EViewType> view_type_items;
|
||||
std::vector<std::string> view_type_items_str;
|
||||
int m_view_type_sel = 0;
|
||||
int m_last_extruder_count_default_applied{0}; // 0=unset, 1=single, 2+=multi
|
||||
// ORCA: which default view type was last applied, see apply_default_view_type(). Empty until the first one is applied.
|
||||
std::string m_applied_default_view_type_key;
|
||||
std::vector<EMoveType> options_items;
|
||||
|
||||
bool m_legend_visible{ true };
|
||||
@@ -249,6 +267,8 @@ mutable bool m_no_render_path { false };
|
||||
// turn off (hotkey B) to inspect the raw machine-frame G-code.
|
||||
|
||||
libvgcode::Viewer m_viewer;
|
||||
// ORCA: section view, as the viewer has it. What it cuts away casts no shadow.
|
||||
std::array<float, 4> m_clipping_plane{ 0.0f, 0.0f, 0.0f, 1.0f };
|
||||
bool m_loaded_as_preview{ false };
|
||||
|
||||
public:
|
||||
@@ -278,7 +298,20 @@ public:
|
||||
//BBS: add all plates filament statistics
|
||||
void render_all_plates_stats(const std::vector<const GCodeProcessorResult*>& gcode_result_list, bool show = true) const;
|
||||
//BBS: GUI refactor: add canvas width and height
|
||||
void render(int canvas_width, int canvas_height, int right_margin);
|
||||
// Shells, toolpaths and the sequential marker, drawn in 3D.
|
||||
void render_scene(int canvas_width, int canvas_height);
|
||||
// Legend, sliders, the marker's position window and the G-code window, all ImGui.
|
||||
void render_overlay(int canvas_width, int canvas_height, int right_margin);
|
||||
// ORCA: realistic view. Depth-only pass drawing the toolpaths as the light sees them, into
|
||||
// the shadow map the caller has bound, and the map they sample back in render_scene.
|
||||
void render_shadow_casters(const Transform3d& light_view_matrix, const Transform3d& light_projection_matrix, const Vec3d& light_position);
|
||||
void set_shadow_map(int texture_unit, const Transform3d& light_view_projection, float intensity, float texel_size);
|
||||
// ORCA: tone applied to the shaded toolpaths, paying back the light the lighting term,
|
||||
// the shadow and the SSAO pass each take off. 1.0/1.0 is a no-op.
|
||||
void set_tone(float exposure, float saturation);
|
||||
// ORCA: section view
|
||||
void set_clipping_plane(const ClippingPlane& plane);
|
||||
void set_light_top_dir(const Vec3d& direction);
|
||||
//BBS
|
||||
// void _render_calibration_thumbnail_internal(ThumbnailData& thumbnail_data, const ThumbnailsParams& thumbnail_params, PartPlateList& partplate_list, OpenGLManager& opengl_manager);
|
||||
// void _render_calibration_thumbnail_framebuffer(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, const ThumbnailsParams& thumbnail_params, PartPlateList& partplate_list, OpenGLManager& opengl_manager);
|
||||
@@ -302,6 +335,10 @@ public:
|
||||
std::vector<float> get_layers_times() const { return m_viewer.get_layers_estimated_times(); }
|
||||
|
||||
const std::array<size_t,2> &get_layers_z_range() const { return m_viewer.get_layers_view_range(); }
|
||||
size_t get_vertices_count() const { return m_viewer.get_vertices_count(); }
|
||||
size_t get_layers_count() const { return m_viewer.get_layers_count(); }
|
||||
// ORCA: realistic view. Changes whenever the toolpaths casting shadows do.
|
||||
size_t shadow_casters_signature() const;
|
||||
|
||||
const SequentialView& get_sequential_view() const { return m_sequential_view; }
|
||||
void update_sequential_view_current(unsigned int first, unsigned int last);
|
||||
@@ -325,6 +362,16 @@ public:
|
||||
void set_view_type(libvgcode::EViewType type) {
|
||||
m_viewer.set_view_type(type);
|
||||
}
|
||||
// ORCA: select a view type in the preview combo box and apply it
|
||||
void select_view_type(libvgcode::EViewType type);
|
||||
// ORCA: apply the "preview_default_view_type" preference, see the definition for the supported values
|
||||
void apply_default_view_type();
|
||||
|
||||
// ORCA: stable, locale independent name of a view type, as stored in the application config
|
||||
static std::string view_type_to_config_name(libvgcode::EViewType type);
|
||||
static bool view_type_from_config_name(const std::string& name, libvgcode::EViewType& type);
|
||||
// ORCA: (config value, translated label) pairs for the "preview_default_view_type" preference combo box
|
||||
static std::vector<std::pair<std::string, std::string>> default_view_type_choices();
|
||||
void reset_visible(libvgcode::EViewType type) {
|
||||
if (type == libvgcode::EViewType::FeatureType) {
|
||||
auto roles = m_viewer.get_extrusion_roles();
|
||||
@@ -374,6 +421,8 @@ public:
|
||||
private:
|
||||
//BBS: always load shell at preview
|
||||
//void load_shells(const Print& print);
|
||||
// Canvas height minus the room the horizontal slider takes.
|
||||
int sequential_view_height(int canvas_height) const;
|
||||
void render_toolpaths();
|
||||
void render_shells(int canvas_width, int canvas_height);
|
||||
|
||||
|
||||
Reference in new issue
Block a user