698 Commits

Author SHA1 Message Date
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
Martin Šach
ea9dfa9a8d Use path generation even on layer change 2024-03-20 14:42:27 +01:00
Martin Šach
f850433e2b Cancel instance before moving to a next object in sequential print 2024-03-14 15:42:52 +01:00
Martin Šach
0207819b57 Split objects in the middle of travel. This works only for single extruder setups (no toolchanges), but is a step forward 2024-03-14 15:42:52 +01:00
Martin Šach
28d935b0b3 Improve cancel object label placement.
* Make LabelObjects hold more state
* Place cancel object labels at proper positions in the gcode
2024-03-14 15:42:52 +01:00
Martin Šach
78cd2f9e68 Move IndexRange.hpp to LayerRegion.hpp and fix warnings 2024-03-05 14:35:41 +01:00
Martin Šach
555424ffbb Fix test of layer region expansion - angle can be N * pi, not just 0. 2024-03-05 14:35:41 +01:00
Martin Šach
bb2186cbcf Refactor: expand_merge_surfaces now uses expansion_zones.
This enables addition of other expansion zones in the future.
For example to make sure bridges are anchored properly even
if there is top fill next to them.
2024-03-05 14:35:41 +01:00
Martin Šach
4d0bae1d3f Refactor: Move bridge expansion to separate function.
This will enable using it in the other expansion calls.
2024-03-05 14:35:41 +01:00
Martin Šach
81d9724436 Refactor: Allow any number of expansion zones in expand_bridges.
Split the function expand_bridges_detect_orientations into
multiple functions. And allow any number of expansion zones
by using a vector instead of explicitly listing the
parameters.
2024-03-05 14:35:41 +01:00
Martin Šach
9797110a96 Refactor: Move "LayerRegion" to separate header and add a test.
Move declarations associated with LayerRegion to a separate header file.
Add test for bridge surface expansion to enable further refactoring.
2024-03-05 14:35:40 +01:00
Lukas Matena
1f87c498cd Merge branch 'master_27x' 2024-02-20 23:01:02 +01:00
Martin Šach
0b4e406b28 Add missing point to the rectangular travel 2024-02-19 15:24:48 +01:00
Martin Šach
5f9f5be614 Add lift to first travel move on layer. Add retraction_length 0 to test, to avoid lifting back up and going back down. 2024-02-14 16:58:47 +01:00
Lukáš Hejl
8784ca0ecf SPE-1729: Try to compute the Voronoi diagram again on modified ExPolygon when an invalid Voronoi diagram is produced during the calculation of the medial axis.
There are several ExPolygons with very thin lines and holes formed by very close (1-5nm) vertices that are on the edge of our resolution. Those thin lines and holes are both unprintable and cause the Voronoi diagram to be invalid.
So, we filtered out such thin lines and holes and tried to compute the Voronoi diagram again.
2024-02-08 15:40:20 +01:00
Lukáš Hejl
fb84f3113a Introduce wrapper class around boost::polygon::voronoi_diagram. 2024-02-08 15:40:02 +01:00
Lukas Matena
a42223f963 Merge branch 'master_27x' 2024-01-26 13:07:19 +01:00
Martin Šach
8cbea4982a Add lift before the first travel move in GCode.cpp 2024-01-23 09:00:58 +01:00
tamasmeszaros
e24be7891e FIxed the issue but TMArrangeKernel needed changes
fixing object function not favoring existing pile to stick to

Trying to fix problem with shit+arrange not sticking to existing objects
2024-01-17 14:42:17 +01:00
Martin Šach
97ba0fb478 Fix retraction test 2024-01-17 13:09:26 +01:00
Martin Šach
f9283728d6 During first layer change, do not actually move z.
This enables the user to set his own z in start gcode. Fixes #11843.
2024-01-17 12:22:22 +01:00
Lukáš Hejl
da57489874 Implement lift before obstacles that take into account already extruder extrusions on the current layer.
Ignore the first intersection of the travel path with the object from which the travel starts.

Created a new class TravelObstacleTracker, for wrapping all data structures related to lift before obstacles.
2024-01-17 12:22:22 +01:00
Lukáš Hejl
2fc9299c65 Use max value of double instead of std::optional in get_first_crossed_line_distance() and get_obstacle_adjusted_slope_end(). 2024-01-17 12:22:22 +01:00
Lukáš Hejl
5858cbf0f7 Fix warnings in Travels tests. 2024-01-17 12:22:22 +01:00
SachCZ
7f397cd7b3 Implement ramping layer change using a tag in gcode
During layer change, instead of generating the gcode, generate a placeholder tag. Then at the end of layer processing replace this tag with a ramping travel move.
This solves the issue, that one does not know the starting point of the current layer where the layer change gcode would be originally generate.
The ramping layer changes uses smoothing of the ramping travel. Also it is adjusted in such a way that it increases the ramp angle when the travel is too short, to always reach the next layer.
2024-01-17 12:22:19 +01:00
SachCZ
24e3254697 Smooth z-hop curve to avoid unreasonably high jerk setting.
* Replace the ramping travel with a smooth ramping travel on marlin 2 under the right circumstances.
2024-01-17 12:21:36 +01:00
Martin Šach
b287bbc5dc Remove obsolete cmake find script and also remove Fill.hpp 2024-01-08 10:27:38 +01:00
Martin Šach
6b0dcc658d Fix narrowing conversion and memory leak in tests 2024-01-08 10:27:38 +01:00
Martin Šach
6b01ae30db Rewrite xs/t/15_config.t to c++. 2024-01-08 10:27:38 +01:00
Martin Šach
9164dd55e6 Rewrite xs/t/09_polyline.t to c++ 2024-01-08 10:27:38 +01:00
Martin Šach
37a707b05f Rewrite xs/t/03_point.t to c++ 2024-01-08 10:27:38 +01:00
Martin Šach
f78ab3e788 Rewrite xs/t/10_line.t to c++ 2024-01-08 10:27:38 +01:00
Martin Šach
3e28ea3379 Rewrite layers.t to c++ 2024-01-08 10:27:38 +01:00
Martin Šach
6e871a874a Rewrite gcode.t to c++ 2024-01-08 10:27:38 +01:00