731 Commits

Author SHA1 Message Date
Lukas Matena
7c108ccb16 Fixed unit tests for seq printing (failing after the new test was added into Print::validate) 2025-02-17 11:03:16 +01:00
Lukas Matena
15823c3776 Fixed conflicts, fixed compilation of tests 2025-02-17 11:03:13 +01:00
Martin Šach
61291d9219 SPE-2495: Do not put scarft seam start on overhangs and blockers
Update the function offset_along_lines to offset along
perimeters and add a stop condition.
2025-02-14 12:02:29 +01:00
Martin Šach
b037828aef SPE 2549: Use 'bridge' annotation in seam placement
Add 'bridge' annotated points to the perimeter used for
seam placement.
2025-02-14 12:02:29 +01:00
Lukáš Hejl
ba4116577c Fix building of tests in RelWithDebInfo mode on Windows. 2025-02-13 14:11:45 +01:00
Lukáš Hejl
53199bccf7 Fix compilation of test_gcodewriter.cpp. 2025-02-13 10:31:39 +01:00
jalapenopuzzle
419d857a4b #13420 GCodeWriter Correct Z speed too high and add unit tests
#13402 test_gcodewriter.cpp add travel_speed_z tests

These tests fail with the legacy implementation of GCodeWriter::travel_to_xyz_force() because it does not decompose the speed into it's components according to the movement unit vector.

#13420 Correct Z speed too high
2025-02-12 17:05:19 +01:00
jalapnopuzzle
c83f164ed5 #13420 GCodeWriter separate XYZ_EPSILON consistent with XYZF_EXPORT_DIGITS and add unit tests
#13420 test_gcodewriter.cpp add tests for XYZF_EXPORT_DIGITS

Check that movement GCodes are emitted / not emitted according to XYZF_EXPORT_DIGITS.
The new tests demonstrate that XYZF_EXPORT_DIGITS is NOT respected.

#13420 GCodeWriter separate XYZ_EPSILON consistent with XYZF_EXPORT_DIGITS

The value of EPSILON=1e-4 (0.0001) in libslicer3r.h is inconsistent with XYZF_EXPORT_DIGITS=3 (0.001).
This change addresses the inconsistency by introducing XYZ_EPSILON which is computed from XYZ_EXPORT_DIGITS, and changing all relevant GCodeWriter functions which used EPSILON to use XYZ_EPSILON instead.
2025-02-12 17:05:19 +01:00
Jan Bařtipán
cbd4dbc58f Fixed slic3r_jobs_tests.cpp include 2025-02-11 17:22:02 +01:00
Jan Bařtipán
2aab8f1245 test_infill_above_bridges: migrated to newer catch2 2025-02-07 10:29:49 +01:00
Jan Bařtipán
b72d9a4c58 Merge branch 'jb_catch2_update_to_v3.8' 2025-02-07 10:25:04 +01:00
Martin Šach
20687bc27a Use slowdown above bridges 2025-02-06 23:13:50 +01:00
Martin Šach
fc7ab914a1 Create method for infill above bridges identification 2025-02-06 23:13:50 +01:00
Jan Bařtipán
2a593e6d29 Tests: added missing headers 2025-02-06 16:59:53 +01:00
Jan Bařtipán
2b01d14f7b Catch2 updated to v3.8, all tests migrated 2025-02-06 15:55:09 +01:00
jalapenopuzzle
944844131c Fix fff_print_tests and add documentation (PR#13886 from @jalapenopuzzle)
PrusaSlicer/src/libslic3r/GCodeReader.cpp:24: char Slic3r::get_extrusion_axis_char(const Slic3r::GCodeConfig&): Assertion `axis.size() <= 1' failed.
The set_deserialise_strict() method converts 'A' to the string "65" instead of "A". Perhaps this should be fixed more robustly.

Fix fff_print_tests test name Temeperatures -> Temperatures

Fix fff_print_tests All travel moves happen within skirt

Remove the last travel_moves point which returns to the origin (0,0) which is outside the convex hull. This point was causing CHECK(convex_hull.contains(travel_move)) to fail.

Fix fff_print_tests "Used Filament" test Assertion `std::abs(length) < 1000.0' failed

The test configured a retract_length of 10000000 which is larger than the asserted maximum retraction length of 1000.
PrusaSlicer/src/libslic3r/GCode/GCodeWriter.cpp:473: std::string Slic3r::GCodeWriter::_retract(double, double, std::string_view): Assertion `std::abs(length) < 1000.0' failed.
Fixed by doing the print with two different (legal) retraction lengths and checking that the total_used_filament agrees in both cases.

Fix fff_print_tests "Slicing with retraction and lifting" remove illegal negative restart_extra test case

Negative restart_extra is asserted against at PrusaSlicer/src/libslic3r/Extrucer.cpp:58

How to build - add instructions on how to run the unit tests
2025-02-04 09:24:12 +01:00
Lukáš Hejl
1a91c94c47 SPE-2496: Fix negative extrusion widths produced by Arachne.
Adjustment of bead widths by DistributedBeadingStrategy could sometimes lead to removing one of the beads.
When this happened, the negative bead widths were produced.
2025-01-21 14:43:29 +01:00
YuSanka
c5b525ba3f Functions, related to load information from files are extracted from the Model into FileReader
+ GalleryDialog:: load_files() is renamed to add_files_to_custom_dir()
2025-01-13 14:13:04 +01:00
Martin Šach
5be84c56b3 Remove invalid usage of std::filesystem in tests.
The std::filesystem::path methods cannot be compiled for
macOS 10.12. It did not manifest because we compile the
tests only on arm where the target is 11.0.
2025-01-06 16:12:06 +01:00
Lukáš Hejl
fc0feed553 SPE-2597: Fix clipping logic for clipping arcs with negative radius.
When we are clipping the arc with a negative radius (we are taking the longer angle here), we have to check if we still need to take the longer angle after clipping.
Otherwise, we must flip the radius sign to take the shorter angle.
2024-12-13 10:29:23 +01:00
Martin Šach
372a025356 Conditional arrange after load
Decide if we should rearrange after load based on the version
in 3mf config. Rearrange if the version < 2.9.0-alpha1.
In any other case do not rearrange (even if the version is missing).
2024-12-10 11:26:39 +01:00
Martin Šach
45eda1a00f Arrange: Avoid dependency of arrange on multiple beds
Drop the BedsGrid::Gap type alias as it brings more problems than it
solves.
2024-11-20 16:04:15 +01:00
Martin Šach
5199d8fb48 Arrange: Move arrange into separate cmake targets
- Create a slicer specific arrange target
- Create a general arrange target from the arrange core
2024-11-20 16:04:15 +01:00
Martin Šach
3e33631abf Arrange: Use arrange for multiple beds.
- Support multiple wipe towers
- Arrange to grid directly within the arrange algorithm
- Suporrt arranging just the current bed
- Support fill bed with instances
- Add arrange selected on current bed
- Add arrange current bed keyboard shortcuts
- Fix cut not arranging properly (set instance bed after cut to the active bed, use arrange current bed selection only after cut)
- Fix shift-D on arrange
- Add window with options to the bed arrange button
2024-11-20 16:04:15 +01:00
Lukas Matena
fae06e0773 Vectorization of the wipe tower 2024-11-20 16:04:15 +01:00
Martin Šach
f1027116e7 Try to fix flatpak arm build.
Flatpak arm build seems to fail on precision in a single test.
Allow for bigger margin.
2024-11-12 17:50:32 +01:00
Lukáš Hejl
ed2cdfec61 SPE-2486: Implement support for PerimeterRegions that will apply configurations affecting just perimeters only to parts of perimeters instead of creating different LayerRegion. 2024-11-12 15:22:58 +01:00
Martin Šach
00010de0ee Fine tune the seam smooth/sharp angle arm length 2024-11-11 10:59:20 +01:00
Lukáš Hejl
225d52b084 Generalize the implementation of the Douglas Peucker algorithm to allow using a custom predicate to decide if points between the anchor and the floater should be removed. 2024-11-08 10:13:34 +01:00
Lukáš Hejl
dfdc407fd6 Distill a test case for failing assert(p != prev) inside GCodeGenerator::_extrude(). 2024-11-04 15:13:18 +01:00
Martin Šach
5033d18824 Fix implementation of inner seam offsetting. 2024-09-26 14:43:09 +02:00
Martin Šach
aa6132ebb6 Scarf seam implementation. 2024-09-26 14:43:09 +02:00
Filip Sykala - NTB T15p
8700c12cc0 Fix for: 70a9520cc3 (r146291258) 2024-09-19 13:53:44 +02:00
Martin Šach
a56bd7e21d Fix invalid extrusion expand value in SeamGeometry 2024-08-16 14:02:46 +02:00
Martin Šach
a91a7d6b0e Better detection of bridge orientation.
Before, partial bridges were calculated. For each of these an angle
has been choosen and after that all the bridges have been merged.
Becouse of the merge a single angle had to be picked.
The first angle that the algorithm has stumbled upon has been picked,
resulting in sub-optimal bridging directions.

Now the partial bridges are calcualted, then merged and then
the angle is decided over the whole merged bridge.
This approach at least ensures that the orientation is the best possible
for the merged bridge.
2024-07-17 14:14:45 +02:00
Martin Šach
21116995d7 Refactor CMake and improve #includes.
* 1. Remove all global include_directories.
* 2. Move 3d party dependencies from src to budled deps if possible.
* Unify and enforce one way of including headers:
    e.g. #include "libslic3r/GCode.hpp" vs #include "GCode.hpp"
    (always use the "libslic3r/GCode.hpp" option).
* Make all dependencies (also header only) a cmake target.
2024-07-08 15:36:46 +02:00
Lukáš Hejl
669c931b77 SPE-2298: Fix crash caused by a numerical issue during testing if a Voronoi vertex is inside a corner of a polygon. 2024-06-18 07:50:04 +02:00
Lukáš Hejl
c44ffed475 SPE-2298: Add detection of Voronoi diagram with parabolic edge without a focus point. 2024-06-18 07:50:04 +02:00
Lukáš Hejl
4de0fdebda Enable most of the Voronoi diagram test cases because most of them are correctly detected and handled. 2024-06-18 07:50:03 +02:00
tamasmeszaros
ac2580caf0 SLA z correction:
first SLA Z correction prototype

Change Z correction controlling parameter to integer layer count

Add z correction mm conversion text as description label under Z correction

Fixed a crash when switching pages in material tab
2024-06-14 15:32:10 +02:00
Martin Šach
f6396f59e9 Refactor seams - due to new rear implementation shells are now only required for aligned seams. 2024-06-14 14:55:50 +02:00
Martin Šach
7d6563641c Change implementation of rear seam.
Use line distancer to obtain the nearest line to a rear point.
Be smart about choosing the rear point.
2024-06-14 14:55:50 +02:00
Martin Šach
8ed0614b90 Gracefuly handle cases where the geometetry is not the same as generated perimeters 2024-05-13 11:23:45 +02:00
Martin Šach
9a1dcc4720 Handle special seam case of just 2 or 3 perimeters.
If there are only 2 or 3 perimeters on a layer, exactly two of them are
external and just one of them is a hole, then the seams should be
choosen next to each other on the external perimeters.
2024-05-06 10:28:16 +02:00
Martin Šach
e60b8b1193 Seam placement improvements.
Previously there was an algirithm that was fitting a curve through
the resulting seam points. This worked for smooth models, but was
failing for some very basic cases (such as a cylinder).

The new algorithm builds on the previously implemented visibility
algirithm but does not do the curve fitting anymore.

Now the code is more separated for the four seam placement
options (rear, random, aligned, nearest).

Nearest and random are handled as one would expect.
Aligned is handled in a more "brute force" manner
(trying multiple seams and picking the best one)
and rear smartly switches between two modes
(center straight line projection and max y).
2024-05-06 10:11:32 +02:00
Lukáš Hejl
2de1f3aa45 SPE-2256: Fix the issue that we used the old Voronoi graph during the detection of invalid Voronoi diagrams.
This happens because we didn't set a modified flag that is required to be set before we use the new Voronoi graph.
Possibly related to #12385
2024-04-30 12:48:46 +02:00
Lukáš Hejl
a3190d94d0 SPE-1804: Single perimeter for top and bottom layers working with both perimeter generators.
Co-authored-by: supermerill <merill@free.fr>
Co-authored-by: Morton Jonuschat <mjonuschat@gmail.com>
Co-authored-by: Vovodroid <vovodroid@users.noreply.github.com>
Co-authored-by: qing.zhang <qing.zhang@bambulab.com>
Co-authored-by: lane.wei <lane.wei@bambulab.com>
2024-04-24 10:06:56 +02:00
Lukas Matena
d03ec72d3f Comment-out a failing test for now 2024-04-16 12:54:25 +02:00
Lukas Matena
9dc7b70084 Merge branch 'master_27x' 2024-03-27 16:37:47 +01:00
David Kocik
f624c55f6f Store PrusaLink passwords in wxsecretstore 2024-03-25 10:22:30 +01:00