26 Commits

Author SHA1 Message Date
Jan Bařtipán
2b01d14f7b Catch2 updated to v3.8, all tests migrated 2025-02-06 15:55:09 +01: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
Vojtech Bubnik
a0441dac14 ArcWelder:
Reducing the chance of creating segments shorter than G-code quantization
distance.
Improving fitting by non-linear least squares.
2023-10-02 09:59:06 +02:00
Vojtech Bubnik
3cfe2f4a3a Merge branch 'vb_arc_welder' into master_262 2023-08-28 15:50:00 +02:00
tamasmeszaros
0b31ef6e1e Beginning of arrange gen2 2023-08-16 09:59:10 +02:00
Vojtech Bubnik
3df8da662e WIP Arc discretization, arc interpolation and unit tests. 2023-07-14 11:20:55 +02:00
Vojtech Bubnik
19062b4d5f ArcWelder path interpolation based on the work by Brad Hochgesang @FormerLurker.
WIP GCode/SmoothPath.cpp,hpp cache for interpolating extrusion path with arches.
Removed Perl test t/geometry.t, replaced with C++ tests.
Refactored ExtrusionEntity and derived classes to hold extrusion attributes in new ExtrusionFlow/ExtrusionAttributes classes.
Reworked path ordering in G-code export to never copy polylines, but to work with a new "flipped" attribute.
Reworked G-code export to interpolate extrusion paths with smooth paths and to extrude those smooth paths.
New parameters: arc_fitting, arc_fitting_tolerance
Renamed GCode class to GCodeGenerator
Moved GCodeWriter.cpp/hpp to GCode/
Moved Wipe from from GCode.cpp,hpp to GCode/Wipe.cpp,hpp
Moved WipeTowerIntegration from GCode.cpp,hpp to GCode/WipeTowerIntegration.cpp,hpp
New variant of douglas_peucker() to simplify range of iterators in place.
Refactored wipe in general and wipe on perimeters / hiding seams.

WIP: Convert estimate_speed_from_extrusion_quality() and its application to smooth paths.
WIP: Cooling buffer to process G2G3, disable arc fitting for filters that cannot process it.
2023-07-13 11:54:42 +02:00
Vojtech Bubnik
9cde96993e Reworked the ClipperLib / Polygon types to use
the tbb::scallable_allocator to better scale on multiple threads.
2023-04-20 11:31:44 +02:00
Lukas Matena
70be93d112 Fixed issue with Euler angles:
the function to extract Euler angles did not work reliably in some of the corner cases.
The bug was not present in 2.5.0 release.
2022-09-23 13:23:40 +02:00
Vojtech Bubnik
d4b8d4d0f3 Further Perl unit test porting to C++ and Perl interface reduction:
Ported cooling, gap fill, thin walls and polyline unit tests.
2022-05-05 17:57:57 +02:00
Vojtech Bubnik
7d02647ebf Removed various Point::ccw() and Point::ccw_angle() methods, they were
provided for Perl bindings and their semantic was confusing.
Implemented free function angle() to measure angle between two vectors.
Reworked Polygon::convex/concave_points(), changed the meaning of their
angle threshold parameter.
Removed some unused methods from Perl bindings and tests.
Reworked the "wipe inside at the external perimeter" function
after Point::ccw_angle() was removed.
2022-04-25 12:42:51 +02:00
Vojtech Bubnik
cc44089440 New BuildVolume class was created, which detects build volume type (rectangular,
circular, convex, concave) and performs efficient collision detection agains these build
volumes. As of now, collision detection is performed against a convex
hull of a concave build volume for efficency.

GCodeProcessor::Result renamed out of GCodeProcessor to GCodeProcessorResult,
so it could be forward declared.

Plater newly exports BuildVolume, not Bed3D. Bed3D is a rendering class,
while BuildVolume is a purely geometric class.

Reduced usage of global wxGetApp, the Bed3D is passed as a parameter
to View3D/Preview/GLCanvas.

Convex hull code was extracted from Geometry.cpp/hpp to Geometry/ConvexHulll.cpp,hpp.
New test inside_convex_polygon().
New efficent point inside polygon test: Decompose convex hull
to bottom / top parts and use the decomposition to detect point inside
a convex polygon in O(log n). decompose_convex_polygon_top_bottom(),
inside_convex_polygon().

New Circle constructing functions: circle_ransac() and circle_taubin_newton().

New polygon_is_convex() test with unit tests.
2021-11-16 10:15:51 +01:00
Vojtech Bubnik
d78a5acba9 Numerical improvements to Welzel minimum enclosing circle algorithm 2021-10-30 11:18:36 +02:00
Vojtech Bubnik
497905406b New code for minimum enclosing circle by randomized Welzl algorithm.
Split the circle code from Geometry.cpp/hpp to Geometry/Circle.cpp,hpp
2021-10-27 15:12:29 +02:00
Vojtech Bubnik
743b99d22c Unit tests to the new optimized implementation of
Line::parallel_to() a Line::perpendicular_to().
2021-10-25 12:03:44 +02:00
Vojtech Bubnik
be236eda85 Renamed Geometry::intersect() to Geometry::convex_polygons_intersect()
to convey its true meaning.
2021-10-23 15:29:18 +02:00
tamasmeszaros
4cc1b2740d Don't report intersection if two polygons are only touching. 2021-10-04 14:16:13 +02:00
tamasmeszaros
9fce0ce3a6 Fix compile issues and overlapping polygon fails 2021-10-01 18:27:37 +02:00
Lukas Matena
476b48ed11 Revert "Merge branch 'tm_convex_intersect_rotcalip'"
This reverts commit 627d8bcaefb3c46864324554f663403495d9ef43, reversing
changes made to 66d44627248b8e412143298541b5a8397f8a0af5.

The change breaks build on mac
2021-09-30 16:49:00 +02:00
tamasmeszaros
234f062ad4 Fast convex polygon intersection test with rotating calipers 2021-09-30 15:49:12 +02:00
Vojtech Bubnik
239d588c5d 1) Implemented anchoring of infill lines to perimeters with length
limited anchors, while before a full perimeter segment was always
   taken if possible.
2) Adapted the line infills (grid, stars, triangles, cubic) to 1).
   This also solves a long standing issue of these infills producing
   anchors for each sweep direction independently, thus possibly
   overlapping and overextruding, which was quite detrimental
   in narrow areas.
3) Refactored cubic adaptive infill anchroing algorithm
   for performance and clarity.
2020-11-05 17:32:40 +01:00
bubnikv
4cff569b62 Improvements of infill path planning:
Implementation of 2-opt pairwise exchange iterative improvement
algorithm with an extension to a chain of segments, where
the chain of segments may get flipped during the exchange operation.
The 2-opt exchange algorithm may be quite slow.
2019-11-22 15:33:20 +01:00
bubnikv
dd59945098 Fix of a typo in KDTreeIndirect.
Improvement of the infill path planning.
Regression fix of Gyroid infill crashes.
Some unit tests for elephant foot and path planning.
2019-11-14 17:02:32 +01:00
bubnikv
2e7e95adae Disabled broken tests, ported some more tests to C++,
removed Perl tests that were already ported to C++.
2019-10-25 18:23:42 +02:00
bubnikv
90d5712091 Filling in the autos in the tests so it is readible and it compiles on OSX 2019-10-16 09:28:27 +02:00
bubnikv
42a858b999 Added test projects for libslic3r and fff_print.
Added test_geometry.cpp from upstream slic3r, thanks @lordofhyphens
Added circle_taubin_newton() for circle center calculation, thanks @lordofhyphens
2019-10-15 09:40:40 +02:00