The post-slice check stored the extruders that can't print each filament as bits in an int. From the 32nd extruder on, the shift overflowed, and on x86 extruder 33's bit landed on extruder 1. limit_filament_maps and the printable area mask are now 64-bit, which covers MAXIMUM_EXTRUDER_NUMBER. Printers with up to 31 extruders get the same values as before.
The tests check the area, height and filament type limits on nozzles 2, 32, 33 and 64, and slice a cube on nozzle 64 of a 64-nozzle printer.
(cherry picked from commit 5ea64864ef)
* Fix center of mass details, belt preview and section view bugs
Fixes the center of mass bugs from #16781 (center of mass a-d and
rendering b).
- The details box follows its marker, so zooming toward the cursor
could slide it under the mouse, where ImGui took the wheel and
zooming stopped. The wheel now zooms over the box.
- Esc closes the details box. A click on a marker now focuses the 3D
view first, so Esc reaches it after typing in a sidebar field.
- On belt printers the Preview markers stayed in the raw G-code frame
while the upright view draws the toolpaths back-transformed. The
masses now get the toolpaths' transform. It shears, so the second
moments are kept as a full 3x3 matrix to keep the moments of
inertia right, and the bounding box rows are left out for a map
that mixes the axes, where the box of the mapped corners would be
far too large.
- At the top layer of the slider the solid marker of what is printed
so far covered the faded finished-print one, which could not be
clicked. At the top layer only the finished print's markers show,
drawn solid.
- The section view cuts a marker away when its center is on the cut
side, as it does the toolpaths' option markers.
* Keep the belt bounding box and store six second moments
- Belt prints keep the bounding box rows in the details. The G-code
back-transform moves from GCodeViewer into
BeltTransformPipeline::build_gcode_back_transform(), and on a belt
print the processor keeps a second box per mass, of each segment's
ends and bead height mapped by its linear part. ObjectMass::transform()
moves that box by the translation, instead of dropping the box that
the shear would blow up.
- A mass stores its second moments as the diagonal and the three cross
terms instead of a full matrix, which is built only to transform it.
(cherry picked from commit e66569a966)
The post-slice check compared each path with the bounding box of the region its nozzle can't reach. When the nozzle's printable area is inset on two or more sides, that region is L-, U- or frame-shaped and its box covers the whole bed, so every slice failed. The check now tests the path's box against the region itself, and the same result sets limit_filament_maps.
Fixes#15746
(cherry picked from commit b7ecf1b295)
The G-code processor remembers where a pause, color change or custom
G-code vertex sits in the move list, so it can move that vertex to the
first extrusion after it. A pause flushes the time planner first, which
inserts actual speed moves ahead of the vertex, so the remembered index
pointed at an earlier move: the previous layer's last extrusion was
moved instead, a real move was erased, and the time blocks queued after
the vertex were left one move off.
Shift the remembered index by the moves each flush inserts before it,
and shift the queued blocks after the erase. The Preview numbers layers
from the move order, so the stray move showed up as extra layers and
listed pauses on the wrong layer.
Opened or drag-dropped G-code files ignored `; MANUAL_TOOL_CHANGE` comments, so the preview showed every move on the first filament. Only `apply_config(const PrintConfig&)` read `manual_filament_change`, and loading a file goes through `apply_config(const DynamicPrintConfig&)`. Read the option there too, initialize the flag to false, and add a regression test.
* Rebuild the G-code line offsets after post-processing scripts run in place
* Clamp the G-code window reads to the mapped file size
* Add tests for rebuilding the G-code line offsets
* Include <mutex>, <ios> and boost/filesystem/operations.hpp where they are used
* Keep the preview's G-code lines and highlight in step with post-processing scripts
---------
Co-authored-by: SoftFever <103989404+SoftFever@users.noreply.github.com>
Co-authored-by: SoftFever <softfeverever@gmail.com>
* perf: write post-processed G-code without a per-line copy
* perf: size the post-process line map from the first pass
* test: line ends of the exported G-code
* test: include the headers the line-ends test and gcode() helper use
* Ignore Clipper, libpng, mcut and Boost.Polygon Internals in clang-tidy
Each only works through a wrapper or umbrella header: libslic3r/clipper.hpp or clipper_z.hpp configure Clipper before including it, png.h pulls in libpng's config headers, and Boost.Polygon's headers only compile through polygon.hpp or voronoi.hpp.
* Ignore minilzo's Config Headers in clang-tidy
lzoconf.h and lzodefs.h are internal to minilzo.h, which is what the code includes.
* Add Missing Includes Across the Remaining Sources and Tests
Covers src/slic3r/Utils, src/slic3r/plugin, src/slic3r/Config, src/libvgcode, src/dev-utils, src/OrcaSlicer.cpp and tests/, the directories left after src/slic3r/GUI and src/libslic3r. Generated with clang-tidy misc-include-cleaner. libvgcode's own headers are included by relative path as in the rest of that library, and Catch2 and pybind11 with angle brackets as elsewhere in the repo.
* Make the GUI and Test Headers Compile on Their Own
Each now includes, or forward-declares, what it uses instead of relying on what its includers happened to include first. Headers that only compile on one platform, or that nothing built includes, are left alone.
* Keep Windows and nanosvg Setup Ahead of the Added Includes
OrcaSlicer.cpp and several tests set _WIN32_WINNT, WIN32_LEAN_AND_MEAN or NOMINMAX before including Windows.h, and the profile validator defines NANOSVG_IMPLEMENTATION before any libslic3r header. The added includes had landed above those blocks, which broke the Windows build.
* Add the GUI Includes the First Pass Missed
Covers headers that only became editable once they compiled on their own, and wx symbols whose suggested header changed as the clang-tidy ignore list grew after the src/slic3r/GUI pass.
* Keep the Added Test Includes Below the NOMINMAX Guard
test_marchingsquares.cpp and test_texture_displacement.cpp had includes inside #ifndef NOMINMAX, which the tests inherit as defined on Windows from libslic3r, so those were skipped there. .clang-tidy also ignores the MSVC STL and UCRT internals, Boost.Multiprecision's fwd.hpp and CPython's Windows include directory, as in #16068.