Commit Graph

19000 Commits

Author SHA1 Message Date
tamasmeszaros
e0fc337b2d Get rid of window size parameter from import interface
Make 'Balanced' the default import quality
2022-04-26 09:38:03 +02:00
tamasmeszaros
5ecf29f303 Separate existing sla archive import code 2022-04-26 09:38:03 +02:00
Pavel Mikuš
1b1f523e3b
Merge pull request #8242 from prusa3d/pm_occlusion_guided_seams
Implementation of occlusion guided seam placement - balance between visibility and angle sharpness.
Improvements in seam drawing and alignment, via cubic splines.
Spline/Polynomial fitting functions.
Refactoring of Point structure - angle functions.
Triangular mesh subdivision function.
Various small additions/refactoring.
! Macro which replaces std::deque with boost version on Windows builds.
2022-04-25 17:53:30 +02:00
PavelMikus
7cccb736de Reverted perl perimeter test bypass 2022-04-25 17:34:22 +02:00
PavelMikus
77b5885f7d fix build problems 2022-04-25 12:42:51 +02:00
PavelMikus
b5a5926bbe Implemented alignment of inner seams, especially in concave angles where the perpendicular
projection is suboptimal.
2022-04-25 12:42:51 +02:00
PavelMikus
e377e58cd2 Updated weights for curve fitting, ensured snapping to sharp corners
Fixed debug exports after refactorings.
2022-04-25 12:42:51 +02:00
Godrak
43d9166382 nomralize weights of points before curve fitting and fitted value interpolation 2022-04-25 12:42:51 +02:00
PavelMikus
68cf4db58e interpolate fitted and original position during b spline alignment -
push points with large weight more towards their original position
2022-04-25 12:42:51 +02:00
PavelMikus
137fa35238 Postpone seam picking for spNearest configuration to the place_seam method. 2022-04-25 12:42:51 +02:00
PavelMikus
83f3ca27dc reworked and improved the find_next_seam_in_layer method:
Now uses find nearby_points with radius to save some computations
if all points are far.
From the nearby points, it finds the nearest and best point, and tries
to use them in this order (preivously only nearest was considered).
This helps to snap the alignment to nearby sharp corners if present.
2022-04-25 12:42:51 +02:00
PavelMikus
04d4a0d4f7 when searching for central enforcer (for alignment purposes), find properly the first
enforced segment. Fixed issue where if the enforced segment was painted over the start/end of the
perimeter, part of the enforced points was not considered.
2022-04-25 12:42:51 +02:00
Vojtech Bubnik
2dfabb7e69 Fixing missing include. 2022-04-25 12:42:51 +02:00
Vojtech Bubnik
399b7f79e8 Little more refactoring of SeamPlacer. 2022-04-25 12:42:51 +02:00
Vojtech Bubnik
8c2e6aba79 On MSVC, std::deque degenerates to a list of pointers, which defeats
its purpose of reducing allocator load and memory fragmentation.
https://github.com/microsoft/STL/issues/147#issuecomment-1090148740
Slic3r::deque<> compiles to boost::container::deque<> on Windows,
to std::deque<> on other systems.
SeamPlacer newly uses Slic3r::deque<>.
2022-04-25 12:42:51 +02:00
Vojtech Bubnik
adb467286f Documented the seam placement corner penalty with an image. 2022-04-25 12:42:51 +02:00
Vojtech Bubnik
853b8adf80 Little refactoring of SeamPlacer.
Moved color mapping functions to Color.hpp
Removed the "extern" keyword from Color.hpp
2022-04-25 12:42:51 +02:00
Vojtech Bubnik
f5709345ad GCode export: Replaced std::strings in G-code comments with string_views.
Seam placer: Detecting perimeter by the pointer and size of the
comment_perimeter string_view, only placing seams for perimeters.
2022-04-25 12:42:51 +02:00
PavelMikus
fb2621c03c Negative volumes raycasting fix - normal was flipped between iterations, incorrect algorithm for hit detection
Debug files export fix after refactoring
2022-04-25 12:42:51 +02:00
Vojtech Bubnik
8ce36e9137 Refactoring of SeamPlacer:
Replaced shared_ptr<> with deque.
Merged multiple vectors into one.
Refactoring using common helper functions (prev/next_idx_modulo(),
angle(), ...)
AABBTreeIndirect::intersect_ray_all_hits(): Reuse memory of the hits cache.
2022-04-25 12:42:51 +02:00
PavelMikus
3b8cfc62da fixed drawing seams on multipart objects
removed oversampling for blockers
improved drawing seams over sharp features
2022-04-25 12:42:51 +02:00
PavelMikus
47fc39a4ba fixed misleanding or wrong comments of the fitting function 2022-04-25 12:42:51 +02:00
PavelMikus
ae89d65e3e added description for the parameter count increase 2022-04-25 12:42:51 +02:00
PavelMikus
396d3215bd Refactoring of curve fitting algorithm:
removal of artificial extension at the ends of the curve
removal of observation points normalization
added clamping of parameter index which compensates for under-represented spline segments
added parameter for level of freedom at the ends of the curve
2022-04-25 12:42:51 +02:00
Vojtech Bubnik
c19770189f Follow-up to 1c9ba291fe32bc4a4c78cabbab0639b0c164f23f
Refactoring of Curves.hpp for better memory management and vectorization
2022-04-25 12:42:51 +02:00
Vojtech Bubnik
42e802c1b8 Refactoring of Curves.hpp for better memory management and vectorization
(replaced vector of vectors with Eigen 2D matrices).
2022-04-25 12:42:51 +02:00
Vojtech Bubnik
bd8ce6fabd Follow-up to 9cb51caead9dee5c4d12a4ef5f925b5efeb00b75
Fixing compilation on GCC
2022-04-25 12:42:51 +02:00
Vojtech Bubnik
e95d19b560 WIP, FIXME: Worked around a Perl integration test failure
in t/perimeters.t, see the comment
FIXME skip the 1st layer in the test 'loops start on concave point if any'

The failure is due to the seam smoothing, which brings the seam too far
away from the external perimeter at the 1st layer, which uses significantly
wider extrusion rate than the other layers. Moving the seam point from
the external perimeter causes an error when projecting the seam point
back to the external perimeter, where the projection lands not exactly
at a corner point, creating a short segment at the end of a polygon loop.
2022-04-25 12:42:51 +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
PavelMikus
156a60017d fixed ExPolygons dealocation while using EdgeGrid
fixed warnings in Bicubic.h file
2022-04-25 12:42:51 +02:00
PavelMikus
965803822e remove invalid comment 2022-04-25 12:42:51 +02:00
PavelMikus
1164449d4e compute overhang distance using SDF
detect embedded (inner) perimeter points and prefer them for seam placement
2022-04-25 12:42:51 +02:00
PavelMikus
191e788aa0 make Random seams disaligned 2022-04-25 12:42:51 +02:00
PavelMikus
15135ef2ed fixes, central enforced point preference 2022-04-25 12:42:51 +02:00
PavelMikus
5c23d471de BSplines, Polynomial fitting 2022-04-25 12:42:51 +02:00
PavelMikus
bbcd6be250 Implemented piecewise data (curve) fitting with variable kernels 2022-04-25 12:42:51 +02:00
PavelMikus
bb89b630d9 implemented occlusion estimation for objects with negative volumes 2022-04-25 12:42:51 +02:00
PavelMikus
ca259caf33 fix ccw angle computation in Point.cpp 2022-04-25 12:42:51 +02:00
PavelMikus
177a1fd54a finalize integration into GCode.cpp export functions, remove unused
edge grids
2022-04-25 12:42:51 +02:00
PavelMikus
6dbc7149be parameter fixes, alignemnt for enforcers simplified 2022-04-25 12:42:51 +02:00
PavelMikus
c640fb854f bug fix: using trafo() instead of trafo_centred() caused
misalignment between occlusion mesh and seam candidates
2022-04-25 12:42:51 +02:00
PavelMikus
2274965079 alignment from best candidate 2022-04-25 12:42:51 +02:00
PavelMikus
eccf1c1553 refactored raycasting - inverted direction of raycasting - now each face is tested
fixed bug with custom seam drawings - square distance parameter named incorrectly
2022-04-25 12:42:51 +02:00
PavelMikus
a9f5330ad2 using gauss function to smoothen criteria skips 2022-04-25 12:42:51 +02:00
Godrak
ab3c8d0fe8 implemented smooth angle penalty function 2022-04-25 12:42:51 +02:00
PavelMikus
a92d5038bd debug export svg info,
fixing problem with weird seam placement caused by disconnected scoring function
2022-04-25 12:42:51 +02:00
PavelMikus
962282c9ef split occlusion and enforcers/blockers into separate functions
added weights to polynomial fitting
2022-04-25 12:42:51 +02:00
PavelMikus
f837759928 fixed problem with multipart objects
fixed bug : model volume trafo was not considered
2022-04-25 12:42:51 +02:00
PavelMikus
a775bf2978 improved enforcers blockers oversampling, renamed parameter 2022-04-25 12:42:51 +02:00
PavelMikus
8f7b86915a oversample polygons where necessary, due to seam enforcers & blockers 2022-04-25 12:42:51 +02:00