Reconciles the belt-printer branch with upstream PRs through #13723. Six
files had conflicts; three additional files needed manual follow-up fixes
where the auto-merge produced code that referenced upstream-renamed fields
or changed function signatures.
Notable reconciliations:
- TreeSupport.cpp: kept belt-floor early-exit branches around HEAD's
drop-down logic, folded upstream's `(distance_to_top > 0 ? 1 : 0)`
formula into the non-belt-floor path (upstream PR #11812). Dropped dead
`roof_enabled`/`force_tip_to_roof` locals.
- TreeSupport3D.cpp: combined upstream's safety-offset + remove_small
changes with HEAD's belt-floor clip in the per-slice trim loop. Dropped
HEAD's `else` block (superseded by upstream's rewritten bottom-contact
propagation) and re-added the belt-floor clip into the new propagation
loop. Gated the propagation on belt printers to prevent OOM when
belt-floor clipping produces empty initial slices.
- TriangleSelector.{cpp,hpp}: merged both new `select_patch` parameters
(HEAD's `up_direction` and upstream's `select_partially`); body uses
`dot(up_direction)` for the overhang angle check and forwards
`select_partially` to `select_triangle`.
- SupportMaterial.cpp: `slicing_params.soluble_interface` →
`zero_gap_interface_bottom` in HEAD's `detect_belt_floor_bottom_contacts`,
matching upstream's same-purpose rename at line 2495.
- Custom.json, GCodeWriter.cpp: simple additive merges (kept entries /
includes from both sides).
Verified by building OrcaSlicer (RelWithDebInfo) after a full deps
rebuild (Eigen v5.0.1, libigl v2.6.0 are now managed deps) and slicing
a scaled Benchy on the NORMALIZER belt-printer profile without OOM.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Conflicts resolved in src/libslic3r/GCode.cpp and src/slic3r/GUI/GUI_Factories.cpp.
GCode.cpp: combined upstream's air-filtration per-extruder gating
(activate_air_filtration_during_print / _on_completion), the new
extrusion-role-change gcode lambda, ZAA's path.z_contoured arc-fit
disable, raft-aware slow_down_layers branch, and Vec3d/Line3 ZAA
plumbing with the local belt-printer changes (path_on_first_layer,
effective_layer_index_for_point, should_disable_arc_fitting). All
auto-merged m_writer.X() calls converted to m_writer->X() to match
the local unique_ptr<GCodeWriter> refactor.
GUI_Factories.cpp: inserted brim_flow_ratio in the Support category
list and renumbered around the local build_plate_tilt_x/y entries.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* reduces number of clicks to change filament in objectlist
* dont set minimum width in dropdown if use_content_width == true
---------
Co-authored-by: Hanno Witzleb <hannowitzleb@gmail.com>
Co-authored-by: yw4z <ywsyildiz@gmail.com>
* Restore SVG/text→Support crash guard (#5070), disable change_part_type()
The crash fix from #5070 prevented converting SVG/text modifiers to Support
Blocker / Support Enforcer by hiding those entries in the old SingleChoiceDialog
opened from ObjectList::change_part_type(). When the "Change type" UI was
reworked into a submenu that calls ObjectList::set_volume_type() directly, the
guard was left behind in the unused change_part_type() path -- the submenu path
had no protection, silently reintroducing the #5070 crash on the submenu route
(ModelVolume::set_type() does not clear text_configuration / emboss_shape, so
the stale emboss state stays attached to a support volume).
- Guard set_volume_type(): reject SUPPORT_BLOCKER / SUPPORT_ENFORCER when any
selected volume is SVG or text, showing the same error as before.
- Wrap ObjectList::change_part_type() in #if 0 instead of deleting it: the
function is unused since the submenu rework, but keeping it in commented-out
form preserves traceability with upstream Bambu Studio (avoids merge
conflicts on each BBL sync). Suggested by RF47, confirmed by ianalexis.
* Log instead of showing user error; action guard is defense-in-depth only
Per review feedback from RF47: with the UI-side guard in #13120, the
set_volume_type() action-time check is a pure safety net -- a healthy UI
should never let the user reach it. Showing a modal error dialog would
therefore either confuse a user who did nothing wrong (if the UI guard
is bypassed by a future refactor/plugin/shortcut) or be dead code at
runtime. Log the event for developers instead, keep the early return so
the crash is still prevented.
* identified code for snapping to buidlplate
* rename internal name to ensure_on_bed to be consistent, saves option in 2mf, finish Move UI, use in both ensure_on_bed() functions
* makes auto_drop a per-object setting, removes global setting
* remove adUndef, add auto_drop to constructor/serialize
* fixes drop() button
* add "auto_drop" checkmark to "load as single object" dialog,
nothing changes if auto_drop == yes || "load as single object",
if auto_drop == false and "load as single object" == false the objects now retain their relative position to each other
* retains auto_drop (and printable) state when assembling or splitting objects,
adds ObjectList::printable_state_changed() overload to be able to only provide ModelObject* vector
* adds dialog when splitting to ask if auto_drop should be disabled,
only shows when auto_drop enabled and atleast one volume floating
* adds arrow indicator on bounding box if auto_drop == false
* removes unneeded code, keeps "auto_drop" naming consistent
* makes for loop simpler in set_printable, set_auto_drop and get_auto_drop,
makes get_auto_drop const,
fixes wording in Snapshot text
---------
Co-authored-by: Hanno Witzleb <hannowitzleb@gmail.com>
Co-authored-by: SoftFever <softfeverever@gmail.com>
Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
* Add runtime display backend detection for Wayland support
Add LinuxDisplayBackend utility to detect X11 vs Wayland at runtime
using GDK_IS_X11_DISPLAY / GDK_IS_WAYLAND_DISPLAY macros. This is
the foundation for removing the forced GDK_BACKEND=x11 and enabling
native Wayland support.
- New files: LinuxDisplayBackend.hpp/.cpp with get_linux_display_backend(),
is_running_on_wayland(), and is_running_on_x11()
- Propagate wxHAVE_GDK_X11 / wxHAVE_GDK_WAYLAND from FindGTK3.cmake
as compile definitions to libslic3r_gui
- No-op on non-Linux platforms (returns Unknown / false)
* Fix Phase 1 code quality: pragma once, source ordering, static cache
* Make X11 initialization conditional for Wayland support
Remove the unconditional GDK_BACKEND=x11 force that blocked native
Wayland. Replace with conditional logic:
- EGL safety fallback: re-force X11 only when wxUSE_GLCANVAS_EGL is
off and WAYLAND_DISPLAY is set, with a warning log
- XInitThreads() only called when DISPLAY is set (X11 in use)
- __GLX_VENDOR_LIBRARY_NAME only set when DISPLAY is present (GLX-specific)
- WEBKIT_DISABLE_COMPOSITING_MODE only set under XWayland (both
DISPLAY and WAYLAND_DISPLAY present)
- Guard X11/Xlib.h include with __has_include for robustness
- Restore display validation to accept either DISPLAY or WAYLAND_DISPLAY
This is Phase 2 of the Wayland support plan.
* Fix Phase 2: safer EGL macro check, add clarifying comments
* Add GLAD2 library and replace GLEW linkage in build system
Set up GLAD2 as a static library to replace GLEW for OpenGL loading.
GLAD2 supports both GLX and EGL, which is required for Wayland support.
- Create src/glad/ with pre-generated GLAD2 sources (GL 4.6 compat)
- Add src/glad/CMakeLists.txt building glad as a static library
- Wire glad into src/CMakeLists.txt before libvgcode
- Modify libvgcode to use shared glad for GL path (keeps local copy
only for GLES2/Emscripten) to avoid duplicate symbol conflicts
- Replace GLEW::GLEW with glad in libslic3r_gui link libraries
Note: GLEW is kept in deps for OpenCSG. Code migration from GL/glew.h
to glad/gl.h headers will follow in Phase 3B+3C.
* Fix Phase 3A+3D: libvgcode GLAD include, dead files, dlopen dep, OpenGL link var
* Migrate from GLEW to GLAD: replace headers and API calls across codebase
Replace all #include <GL/glew.h> with <glad/gl.h> across 49 source files.
Migrate GLEW API calls to GLAD equivalents:
- glewInit/glewExperimental -> gladLoaderLoadGL()
- GLEW_EXT_* / GLEW_ARB_* extension checks -> GLAD_GL_EXT_* / GLAD_GL_ARB_*
- Remove GLEW-specific EGL/GLX mismatch #error guards (not needed with GLAD)
- Replace unavailable EXT symbols with core GL equivalents in
GLCanvas3D.cpp (GL_MAX_SAMPLES, glRenderbufferStorageMultisample,
glBlitFramebuffer, GL_READ/DRAW_FRAMEBUFFER)
- Update log messages from glewInit to gladLoadGL
* Fix Phase 3B+3C: remove GLEW find, clean EXT symbols, update attribution
- Remove find_package(GLEW) block from root CMakeLists.txt since GLEW
is no longer linked by any main application code
- Remove "glew" from SLIC3R_STATIC option description
- Replace all remaining EXT framebuffer symbols with core equivalents
in render_thumbnail_framebuffer_ext and _rectangular_selection_picking_pass
- Update AboutDialog credits from GLEW to GLAD
* Enable EGL in wxWidgets and add runtime GLX/EGL selection for Wayland
- Set wxUSE_GLCANVAS_EGL=ON in wxWidgets build and Flatpak manifest
- Add PreferGLX() call on X11 sessions for driver compatibility
- Remove Phase 2 safety fallback (EGL is now always compiled in)
- Guard SwapBuffers against hidden canvases to prevent Wayland stalls
* Fix Phase 4: move PreferGLX to app startup, fix FPS counter guard
Move wxGLCanvas::PreferGLX() from OpenGLManager::create_wxglcanvas()
(static initializer) to GUI_App::on_init_inner() before any wxGLCanvas
is constructed. This prevents a race where SkipPartCanvas could trigger
wxGLBackend::Init() before the GLX preference is set. The new location
also adds explicit is_running_on_wayland() detection with a warning for
unknown backends.
Move increment_fps_counter() inside the IsShownOnScreen() guard so FPS
is only counted when a frame is actually swapped.
* Update GLFW from 3.3.7 to 3.4 for runtime Wayland/X11 backend selection
Replace the compile-time GLFW_USE_WAYLAND flag (which locked to a single
backend) with GLFW 3.4's GLFW_BUILD_WAYLAND + GLFW_BUILD_X11 flags that
build both backends and auto-select at runtime based on the available
display server. This enables the CLI thumbnail renderer to work on both
Wayland and X11 sessions without separate builds.
* wayland: Fix UI call sites that rely on global screen coordinates
On Wayland, wxGetMousePosition() returns (0,0) and SetPosition() is a
no-op for top-level windows. Fix the highest-impact call sites:
- GLCanvas3D: Use cached m_mouse.position from event handlers instead
of wxGetMousePosition() + ScreenToClient() in get_local_mouse_position()
- Plater: Use event-relative coords via ClientToScreen(e.GetPosition())
instead of wxGetMousePosition() in 3 leave-window handlers
- BBLTopbar: Use event.GetPosition() and FindToolByPosition() directly
in mouse handlers instead of wxGetMousePosition()/FindToolByCurrentPosition()
- Search: Use focus-based dismiss logic on Wayland instead of
wxGetMousePosition()-based rect checks in SearchDialog and
SearchObjectDialog
- GUI_App: Skip SetPosition() in window_pos_restore() on Wayland where
it is a no-op; still restore size and maximize state
- Button: Position tooltip relative to button widget via ClientToScreen
instead of wxGetMousePosition()
* Fix SearchDialog Wayland dismiss: guard against search_line focus
* flatpak: Add Wayland socket permission for native Wayland support
* spec
* Fix crash on Wayland when wxWidgets lacks EGL support
Restore the safety fallback that forces GDK_BACKEND=x11 when wxWidgets
was not built with wxUSE_GLCANVAS_EGL=ON. Without this, the GLX backend
tries to access a non-existent X11 display on native Wayland, crashing
in wxGLCanvas::IsDisplaySupported() with SIGSEGV at offset 0xe4.
Also add a defense-in-depth guard in detect_multisample() that skips
the IsDisplaySupported call entirely on Wayland without EGL.
Root cause: deps/wxWidgets must be rebuilt after enabling EGL. The
compile-time check in OrcaSlicer.cpp detects the mismatch and falls
back safely.
* Fix EGL detection: use wxHAS_EGL instead of wxUSE_GLCANVAS_EGL
wxUSE_GLCANVAS_EGL is a CMake build option, NOT a C++ preprocessor
macro. The actual macro defined in wxWidgets setup.h is wxHAS_EGL.
All compile-time EGL checks were using the wrong macro, causing
the safety fallback to always trigger even with a properly built
EGL-enabled wxWidgets.
* Fix GL function pointers invalidated on Wayland/EGL
gladLoaderLoadGL() dlopen's libGL.so.1 to resolve GL function pointers
via dlsym, then immediately dlclose's the handle. On X11/GLX this is
fine because the GLX context keeps libGL.so mapped. On Wayland/EGL,
nothing else holds libGL.so open, so dlclose unmaps it and all function
pointers become dangling — causing SIGSEGV on the first GL call.
Fix: on Wayland, use gladLoadGL(eglGetProcAddress) which resolves
function pointers through the EGL loader without opening/closing
libGL.so.
* fix crash on start and various rendering issues
* fix crash on close
* small refactor
* move GPU selection to desktop file
* clean up a bit
* clean up more
* fix appimage error
- Fix support clipping z-shift calculation by removing coordinate-space
mismatch and sync belt_floor_z_shift with global_z_offset; fix
invalidation so posSupportMaterial no longer resets slicing params
- Add belt floor polygon clipping to non-organic tree support
(slim/strong/hybrid) with collision surface integration in
TreeSupportData, belt extension layers, and first-layer brim
suppression
- Add belt floor clipping to organic tree support pipeline with virtual
belt raft layers, per-layer polygons in TreeModelVolumes, and
post-generation layer trimming; fix pre-existing processing_last_mesh
bug in calculateCollision()
Fix belt floor support clipping: z-shift, invalidation, and global offset
- Fix support clipping z-shift calculation by removing coordinate-space
mismatch (raw_bounding_box min.z vs trafo_centered m_belt_min_z) and
sync belt_floor_z_shift with global_z_offset in global shear mode
- Fix invalidation so posSupportMaterial no longer resets slicing params,
preventing the exact posSlice z-shift from being overwritten by the
bounding-box approximation on support-only setting changes
- Remove double-counting of global z_offset on support layers — support
already inherits the offset from object layers during generation
This Work Was Co-Authored-By Claude Opus 4.6 (1M context) <noreply@anthropic.com>
UI: gray out inactive belt sub-options, rename to mesh transforms, move to Advanced
Fix mesh clipping through build plate after belt shear/scale transform
Generalize G-code viewer designed-view toggle for full belt transform
Clip support layers to transformed belt floor plane
Supports below the tilted build plate (Z = shear_factor * from_axis - min_z)
are now clipped via half-plane intersection after generation. Belt floor
parameters stored in SlicingParameters and populated in both update_slicing_parameters()
and the static slicing_parameters() overload.
Make belt G-code viewer toggle more prominent, add B keyboard shortcut
- Add separator + teal "Belt Printer" header in legend panel
- Append [B] hint to checkbox label
- Add B key shortcut in GLCanvas3D to toggle designed/machine view
- Read belt_printer_angle from loaded G-code headers to enable belt view
Add per-axis global transform option for belt printer shear
New belt_shear_{x,y,z}_global bool configs. When enabled, shear incorporates
instance shift so objects at different bed positions get position-aware
transform (Z += factor * instance_shift_on_from_axis).
Fix global shear: use layer Z offset instead of mesh transform, add config invalidation
- Global shear offset applied as post-slicing layer print_z adjustment
instead of mesh transform (which was absorbed by min_z normalization
or shifted mesh out of slice range)
- Register all belt transform options in Print::invalidate_state_by_config_options
to trigger posSlice re-slicing (the fallback only invalidated Print steps,
not PrintObject steps — belt changes had no effect without manual re-slice)
- Belt gcode remap options added to steps_gcode (gcode-export only)
- Skip empty-first-layer check for belt objects with global Z offset
WIP: split instances for global shear, relative Z offsets, debug logging
- PrintApply: when belt global mode active, prevent instance grouping by
adding unique Z perturbation to trafo — each copy becomes its own
PrintObject with independent layers
- PrintObjectSlice: compute global Z offset relative to minimum Y shift
across all PrintObjects (lowest-Y object stays at Z=0)
- Debug logging (warning level) for belt global shift values and offsets
Known issues:
- Cached posSlice results cause stale offsets when mixing copies with
individually-added objects — need to compute min baseline outside slice()
- Supports still generate to Z=0 instead of object's global Z offset
Fix global shear for copied objects: disable shared-object layer optimization
When belt global Z shear is active, each object needs unique layer Z
values based on its bed position. The shared-object optimization was
causing copies to reuse the source object's layers (and its Z offset)
instead of computing their own position-based offset.
started work on getting supports to work properly
one step forward, one step back
this version didn't quite work. Getting somewhere though
about to add UI controllable tests
added configuration options for supports
tweak CLAUDE.md to be more aggressive for my machine. This commit should probably be pulled out before contributing upstream
still chasing down some bugs
moving objects between slices no longer results in improper Z-height because of caching
added more data to the debug logs
Z offset is getting more global again
still not quite there, I think there's a fundamental logic flaw?
hunting for bugs
finally have a functional fix
Add belt floor clipping to tree supports (organic and non-organic)
- Add belt floor polygon clipping to non-organic tree support
(slim/strong/hybrid) in draw_circles() and terminate nodes at the
belt surface instead of the horizontal build plate
- Add belt floor clipping to organic tree support pipeline with virtual
belt raft layers for sub-floor branch generation, per-layer belt
floor polygons in TreeModelVolumes, and post-generation layer trimming
- Fix pre-existing processing_last_mesh bug in TreeModelVolumes that
prevented m_anti_overhang (support blockers) from ever being applied;
skip empty first layer check for belt printers
Commits:
current approach: make a face surface to build supports to
closer!
supports now terminate on shear plane, now need to get shear plane to correct Z height
nearly there
chasing down logic issues still
committing for checkpoint, this still does not work
still got logic problems...
cull support clipping
stashing changes for now. Going to focus on getting the global shear OFF support generation dialed first.
beginning per object shear calcs
Local shear transform is on correct Z offset now
local shear finally works now and needs more testing
global shear works now, needs thorough testing
debugging non-45 degree angles
debugging part 2
supports at all angles work now
remove debug logging
Add belt floor collision to non-organic tree support pipeline
- Integrate belt floor as a collision surface in TreeSupportData so
branches route around the belt naturally, replacing the explicit
termination checks in drop_nodes()
- Add belt extension layers below the object after draw_circles() to
allow support geometry to extend to the diagonal belt surface instead
of terminating at a horizontal first layer
- Fix coordinate overflow in belt floor polygons (scale_(1e4) exceeds
int32), skip first-layer brim expansion for belt printers, and
extend empty first layer check bypass to all belt modes
add debug logging, Z translate for tree supports
still not seeing any cutoff surface yet
adding debug options
attempt #2 at trees
if hit Z buildplate stop but don't set to_buildplate true
getting closer
tree support almost there, just need to get rid of the circles at the beginning
getting closer
belt / shear plane clip works, need to figure out the buidlplate plane issues
more logic, added debugging logs
supports now extend somewhat below Z=0 in global shear mode
fix bad alloc, add 10mm below build plate
fully works now
shear transform + prusa tree support generation works now.
pull out debug logging
- Wrap GetToolTipCtrl() call in GUI_App.cpp with #if wxVERSION_NUMBER < 3300
guard, as this API may not be accessible in wxWidgets 3.3. The dark tooltip
theming is cosmetic and non-critical.
- Add explicit #include <wx/utils.h> to 7 source files that use functions from
that header (wxGetMousePosition, wxLaunchDefaultBrowser, wxGetDisplaySize,
wxBell) but relied on transitive includes. This preempts breakage from
wxWidgets 3.3 reducing transitive includes.
Files with wx/utils.h added: BBLTopbar.cpp, CreatePresetsDialog.cpp,
CameraPopup.cpp, GLCanvas3D.cpp, GCodeViewer.cpp, GUI_ObjectList.cpp,
FilamentMapPanel.cpp.
Skipped BindDialog.cpp and FilamentPickerDialog.cpp as they already include
wx/wx.h which provides wx/utils.h transitively.
Part of wxWidgets 3.1.5 -> 3.3.2 upgrade.
### Description
A couple of warning dialogs still used a caption containing "**BambuStudio warning**". It is a leftover from the original BambuStudio codebase.
### This PR
- removes the explicit caption so the dialogs use the standard application warning title instead.
### Result
- removes the remaining Bambu reference while keeping the visible behavior consistent with the rest of the UI.
- addresses point 1. of "New ports from Bambu Studio" section from #12684
### Screenshots
- **Before:**
<img width="1352" height="277" alt="image" src="https://github.com/user-attachments/assets/d107acaa-f159-496a-b14e-93cd149bf355" />
- **After:**
<img width="1356" height="278" alt="image" src="https://github.com/user-attachments/assets/e111b5b3-9b3e-4b13-b20d-f98e5173ea16" />
* Initial changes allowing you to change the type of multiple parts at once by selecting them all.
* Removed second occurance of Change type in right click menu
* Ready to go feature change
* Remove accidental file creation
* Removing excessive std::cerr
---------
Co-authored-by: SoftFever <softfeverever@gmail.com>
for cut and text object
jira:github 5195
Change-Id: I17cd57fef0e4882167643174ae2ba36023cbe349
(cherry picked from commit f7e49a3846ee9887924b777f5b2cb154d1b5cc1f)
some fix to
Ib37896f9101d93ca63c7edb0b1e6328045a5ddb3
I4b5c8e158b073b302db6faad77bb8ca0f70f766a
Change-Id: Iec62a4df45159bac3db63c48feef16ec1aa35ae7
(cherry picked from commit 6fb06eb7790c1469d433f5ecec97d5be966e94af)
* SPE-2486: Refactor function apply_mm_segmentation() to prepare support for fuzzy skin painting.
(cherry picked from commit 2c06c81159f7aadd6ac20c7a7583c8f4959a5601)
* SPE-2585: Fix empty layers when multi-material painting and modifiers are used.
(cherry picked from commit 4b3da02ec26d43bfad91897cb34779fb21419e3e)
* Update project structure to match Prusa
* SPE-2486: Add a new gizmo for fuzzy skin painting.
(cherry picked from commit 886faac74ebe6978b828f51be62d26176e2900e5)
* Fix render
* Remove duplicated painting gizmo `render_triangles` code
* SPE-2486: Extend multi-material segmentation to allow segmentation of any painted faces.
(cherry picked from commit 519f5eea8e3be0d7c2cd5d030323ff264727e3d0)
---------
Co-authored-by: Lukáš Hejl <hejl.lukas@gmail.com>
* SPE-2486: Implement segmentation of layers based on fuzzy skin painting.
(cherry picked from commit 800b742b950438c5ed8323693074b6171300131c)
* SPE-2486: Separate fuzzy skin implementation into the separate file.
(cherry picked from commit efd95c1c66dc09fca7695fb82405056c687c2291)
* Move more fuzzy code to separate file
* Don't hide fuzzy skin option, so it can be applied to paint on fuzzy
* Fix build
* Add option group for fuzzy skin
* Update icon color
* Fix reset painting
* Update UI style
* Store fuzzy painting in bbs_3mf
* Add missing fuzzy paint code
* SPE-2486: Limit the depth of the painted fuzzy skin regions to make regions cover just external perimeters.
This reduces the possibility of artifacts that could happen during regions merging.
(cherry picked from commit fa2663f02647f80b239da4f45d92ef66f5ce048a)
* Update icons
---------
Co-authored-by: yw4z <ywsyildiz@gmail.com>
* Make the region compatible check a separate function
* Only warn about multi-material if it's truly multi-perimeters
* Improve gizmo UI & tooltips
---------
Co-authored-by: Lukáš Hejl <hejl.lukas@gmail.com>
Co-authored-by: yw4z <ywsyildiz@gmail.com>