Commit Graph
100 Commits
Author SHA1 Message Date
Vojtech Bubnik 52b3c655ff Fixed Polygon::centroid()
Ported Polygon unit tests from Perl to C++.
2021-05-07 11:42:21 +02:00
Vojtech Bubnik 1c26367ba1 Merge branch 'master' of https://github.com/Prusa3d/PrusaSlicer 2021-05-07 09:45:33 +02:00
Vojtech Bubnik 68fabfea62 Fix of Polygon::area(). 2021-05-07 09:45:27 +02:00
Vojtech Bubnik feefbc575a Refactored PrintObject::m_region_volumes for extensibility.
WIP for multi-material painting.
2021-05-06 15:48:38 +02:00
Vojtech Bubnik dd72016159 FDM backend refactoring for const correctness, clarity ... 2021-05-06 15:08:57 +02:00
Vojtech Bubnik b5573f959b Refactoring for code clarity: Replaced this->m_xxx with m_xxx
as the m_ prefix already signifies a class local variable.
2021-05-06 14:43:36 +02:00
Vojtech Bubnik f16d4953be Removing offset2 from Perl bindings and other minor cleanup. 2021-05-06 14:29:20 +02:00
Vojtech Bubnik 1c6333e557 Fixing Perl integration 2021-05-06 13:58:37 +02:00
Vojtech Bubnik 0ca6b12da1 Print/PrintObject/PrintRegion refactoring:
Newly the PrintObjects own PrintRegions and Print contains references
to PrintRegions owned by PrintObjects, so that a PrintRegion of the same
content is referenced by Print only once.

The refactoring is a WIP to support multi-material painting.
2021-05-06 13:01:09 +02:00
Vojtech Bubnik ee15f00574 FDM backend refactoring: Return PrintRegion by reference, not by pointer.
Added PrintRegion hashing.
2021-05-05 18:13:58 +02:00
Vojtech Bubnik b8db1922f7 Fixing perl bindings 2021-05-05 17:03:11 +02:00
Vojtech Bubnik 714149dab2 WIP: Moving ownership of PrintRegions to PrintObjects. 2021-05-05 16:21:55 +02:00
Vojtech Bubnik d21b9aa089 Fixing perl integration 2021-05-05 15:05:52 +02:00
Vojtech Bubnik a7c67415c7 Another try of fixing compilation on gcc. 2021-05-05 14:34:54 +02:00
Vojtech Bubnik 18001fbb4e Fixing compilation on gcc 2021-05-05 14:32:19 +02:00
Vojtech Bubnik d6c5961eb0 Factored out the Print::apply() method and its dependending free functions
into PrintApply.cpp module.
2021-05-05 14:30:09 +02:00
Vojtech Bubnik 72ce8cb28d PrintRegion refactoring: Getting rid of the Print pointer. 2021-05-05 14:17:36 +02:00
Vojtech Bubnik 9537c4e8d0 Fixed a perl test that was mistkanely adjusted after ClipperLib refactoring. 2021-05-05 13:30:19 +02:00
Vojtech Bubnik 5764d8984c Fixed perl unit tests 2021-05-05 13:27:00 +02:00
Vojtech Bubnik a2de09e11e Fixing unit tests. 2021-05-05 13:19:01 +02:00
Vojtech Bubnik 7d4b3f2992 Fix of safety_offset() after ClipperUtils refactoring.
Fixes Solid infill where there should be none #6482
Also the safety offsetting was revised to be enabled only where needed,
the "do safety offset" is now easy to discover by
a new ApplySafetyOffset::Yes enum, and safety offset over union, which
is better done by offset() / offset_ex() has been replaced with
new union_safety_offset() / union_safety_offset_ex() functions, which
better convey their meaning and which could be better optimized than
union() with the safety offset applied.
2021-05-05 12:16:47 +02:00
Vojtech Bubnik fd3dd1611c Fixed alignment of sparse infill over multiple layers of the same region,
which was broken with 68666de521b1cb15e41ac6728c0e8d3b4b0d4ed0
"Reworked the "new" bridging to respect the bridge_flow_ratio
by maintaining extrusion spacing, but modifying the extrusion width
and / or height."
2021-05-04 18:27:53 +02:00
Vojtech Bubnik 00835c7367 Fixing compilation on clang in debug mode. 2021-05-04 16:13:40 +02:00
Vojtech Bubnik 1aef86f650 Implemented generic mechanism for executing tasks on UI thread synchronously
from the background slicing thread, that supports cancellation.
The generic mechanism is used for generating thumbnails into G-code and
Fixes Fix deadlock when canceling the slicing while gcode is creating thumbnails #6476
Thanks @supermerill for pointing out the issue.
2021-05-04 16:07:32 +02:00
Vojtech Bubnik 5cc6dc59dc Fixed compilation with GCC 2021-05-04 11:22:38 +02:00
Vojtech Bubnik a7368b9deb Fixing thread-safe StaticConfig creations #6477
fix un-threadsafe code for creating config enum hashtable. #6475
2021-05-04 11:03:26 +02:00
Vojtech Bubnik ab74ea5c90 One more fix after merge. 2021-05-03 15:30:10 +02:00
Vojtech Bubnik 2aadc1cefa Fixing after merge. 2021-05-03 15:28:03 +02:00
Vojtech Bubnik eb66111eda Merge branch 'vb_clipper_optimization' 2021-05-03 15:24:04 +02:00
Vojtech Bubnik ef07644bf2 Merge branch 'master' of https://github.com/Prusa3d/PrusaSlicer 2021-05-03 15:23:57 +02:00
Vojtech Bubnik 7563c885a1 Fixing compiler warnings 2021-05-03 15:00:23 +02:00
Vojtech Bubnik 0e6e60705d Fixing one unit test, which seems to indicate that the refactoring
fixed one issue (hopefully it was not that a newly introduced bug
hides an old one).
2021-05-03 14:12:08 +02:00
Vojtech Bubnik 96f8744e05 Another fix for C++ conformant compilers 2021-05-03 11:55:23 +02:00
Vojtech Bubnik c7c7983e77 Fixing compilation on C++ conforming compilers 2021-05-03 11:50:05 +02:00
Vojtech Bubnik 09a80d954c Further rework of ClipperUtils: Replaced many to_polygons() /
to_expolygons() calls with templated ClipperUtils variants to avoid
memory allocation and copying.
2021-05-03 11:39:53 +02:00
Vojtech Bubnik 9fbba855ef Clipper optimization:
1) Removed the already commented-out scaling / unscaling when doing
   "safe offsetting"
2) Removed some of the "safe offsetting" at calls where it never was used.
3) Reworked Clipper & ClipperUtils to pass Polygons / ExPolygons / Surfaces
   as input parameters without conversion to ClipperLib::Paths. This
   should save a lot of memory allocation and copying.
4) Reworked conversions from ClipperLib::Paths & PolyTree to Polygons /
   ExPolygons to use the move operator to avoid many unnecessary allocations.
5) Reworked some "union with safe ofsetting" to "offset_ex", which should
   be cheaper.
2021-04-30 11:49:57 +02:00
Vojtech Bubnik b327314b02 Layer::make_perimeters() - when merging regions, use OffsetEx instead
of safety offset of UnionEx, which may not be robust.
2021-04-29 11:05:11 +02:00
Vojtech Bubnik d1cfdcb49e Refactoring of StaticPrintConfig & derived classes:
1) Using boost::preprocessor to reduce code duplicities when defining
   new configuration values.
2) Implemented static hash() and operator== on StaticPrintConfig derived
   classes to support hash tables of instances thereof.
2021-04-26 18:37:10 +02:00
Vojtech Bubnik 9f4e9da5c6 Merge branch 'tm_vb_clipper_eigen' 2021-04-23 11:44:25 +02:00
Vojtech Bubnik 1d588dad90 Fixed Perl bindings of Clipper after Clipper was adapted to Slic3r::Point 2021-04-23 11:02:16 +02:00
Vojtech Bubnik 3b86cb3a3c Added missing files 2021-04-22 09:26:07 +02:00
Vojtech Bubnik 8d0950ce12 Convincing ClipperLib to use Slic3r's own Point type internally. 2021-04-21 20:15:49 +02:00
Vojtech Bubnik bb8112f099 and the final Perl unit test fix 2021-04-21 15:47:28 +02:00
Vojtech Bubnik dcfa1d10cf Yet another Perl test 2021-04-21 15:46:47 +02:00
Vojtech Bubnik ee53894c40 Another last perl unit test fix 2021-04-21 15:43:41 +02:00
Vojtech Bubnik 39deffdf5b One more perl unit test fix 2021-04-21 15:40:43 +02:00
Vojtech Bubnik c013b73308 Fixing perl unit tests 2021-04-21 15:38:00 +02:00
Vojtech Bubnik 542d95a593 Fixing unit tests 2021-04-21 15:31:06 +02:00
Vojtech Bubnik 0c1953a929 Further fixes of the first_layer_height refactoring. 2021-04-21 14:34:49 +02:00
Vojtech Bubnik ba94fa4867 Fixed unit tests. 2021-04-21 13:30:32 +02:00
Vojtech Bubnik d9ed9149ae 1) Moved first_layer_heigth frrom PrintObjectConfig to PrintConfig.
Thus the first_layer_height is no more object specific. That makes
   a lot of sense due to the brim calculation being performed over
   all layers at once and due to future merging of supports of
   different objects at first layer.
2) Because now first_layer_height is print specific, the relative
   first layer height derived from the object layer height was partially
   disabled: First the relative first layer height is converted to
   an absolute value when importing config, second the side text
   was changed from "mm or %" to "mm". Still the UI allows entering %.

Both changes may be controversial, let's wait for user feedback.
2021-04-21 12:09:43 +02:00
Vojtech Bubnik 48a93e40fb After issuing the color change custom G-code, which is most likely
just M600, reset the internal retract counter, so that a retract
will happen after the firmware returns from M600 to the initial position.

Fixes "Blobs on print after manual color change #6362"
2021-04-15 16:29:30 +02:00
Vojtech Bubnik eb428d48fc Merge branch 'master' of https://github.com/Prusa3d/PrusaSlicer 2021-04-15 13:48:29 +02:00
Vojtech Bubnik d5ddf8b00e RemovableManager on OSX: Testing for dictionary values for nullness.
Hopefully it fixes Can not start slicer on mac Bigsur #5719
2021-04-15 13:48:20 +02:00
Vojtech Bubnik 0625788583 Fixed obvious bug in move operator, discovered by clang lint ran by Tamas. 2021-04-14 14:25:30 +02:00
Vojtech Bubnik 7112ac61b6 Replacing ClipperLib::IntPoint with Eigen point as a first step to
make the ClipperLib paths and polygons compatible with Slic3r paths
and polygons without conversions and memory allocations.
2021-04-14 09:22:51 +02:00
Vojtech Bubnik 29cd8aac26 WIP: Fix of arrangement after reducing ClipperLib::cInt
from int64_t to int32_t
2021-04-13 16:35:46 +02:00
Vojtech Bubnik c1179fc2c7 Marked the unsafe ClipperUtils offset functions with CLIPPERUTILS_UNSAFE_OFFSET
Replaced some of the unsafe offset functions with safe variants.
Please test the
1) print bed from STL function
2) concentric infill
2021-04-13 13:28:37 +02:00
Vojtech Bubnik e8643125d8 Clipper / ClipperUtils:
1) Let Clipper use int32_t for representing its coordinates. This
   reduces memory and allows to skip conversion between Slic3r Polygon
   and Clipper polygon.
2) Disable additional offset before executing the Clipper Offset algorithm.
   We don't see any reason for that and it required 64bit Clipper coordinates,
   which were disabled with 1).
2021-04-13 11:31:54 +02:00
Vojtech Bubnik dbd1c09523 FDM snug supports: New parameter "closing radius", inspired by Cura's
support_join_distance
2021-04-12 14:56:36 +02:00
Vojtech Bubnik 558deca789 Configs should point to PrusaSlicer-alpha, not beta in alpha stage. 2021-04-09 08:11:40 +02:00
Vojtech Bubnik ef6ce8792d Fix of brim under supports 2021-04-08 16:36:52 +02:00
Vojtech Bubnik 8fd731f7a0 New FDM support sparse infill zig-zag algorithm.
Fixed some old support and infill issues.

Fixes support problem #4295
Fixes Parts of interface layer extends beyond supports and cannot be printed
Fixes support missing under horizontal overhang #6058
Fixes Slicer double-traces small sections of Rectilinear Supports, causes
Fixes plastic buildup and nozzle crashes #4951
Fixes Add "Angle Interface layers" #2969
2021-04-08 15:29:40 +02:00
Vojtech Bubnik e94a4da954 Merge branch 'master' of https://github.com/Prusa3d/PrusaSlicer 2021-03-29 14:15:27 +02:00
Vojtech Bubnik acce99f29b Fixed some compilation warnings in MutablePolygon.cpp 2021-03-29 14:15:18 +02:00
Vojtech Bubnik 13c178b7f7 Enabling ASAN on MSVC 2021-03-25 10:12:02 +01:00
Vojtech Bubnik 10c3e82917 Updated version number,
alpha stores configs in alpha directory.
2021-03-23 13:50:53 +01:00
Vojtech Bubnik af9c7c967f Implementing a new switch for the shape of support towers:
expanded to a grid (the old way) vs.
snug (like the upstream Slic3r, Cura or Ideamaker).

Snug supports suffered from the degeneracies when merging overhang islands
over a large number of layers when projecting the support towers down.
We borrowed the idea & a bit of code from Cura by simplifying the support
polygons by closing the concave cracks, see the smooth_outward() function
and the MutablePolygon class.

Fixes Support problems with models with hole in the walls. #555
Fixes Support in the Air #740
Fixes [Bug] Supports generated beyond bed edges (X<0 and X>250) and where none are needed. #902
Fixes Unable to remove support material/can't change support "inflation distance" #2708
Fixes FR: support inflation and support conform to boundary #4783
Fixes Support blocker not working on this model #1346
Fixes Unnecessary support material #1993
Fixes support blocker enforcer issue #6240
2021-03-23 11:06:45 +01:00
Vojtech Bubnik 00295919bf Fixes of MutablePolygon 2021-03-23 11:06:45 +01:00
Vojtech Bubnik 6f3f3624c5 Fixing FDM support bottom zero interface layers, where one dense
interface layer was errorneously created.

Follow-up to 00db3dc419
73b88e6ce0
referencing the issues fixed by the above commits:
Fixes Allow to disable raft under support structures. #3772
Fixes Separate counts for floor and roof support interface layers #4288
2021-03-19 13:39:20 +01:00
Vojtech Bubnik 4745948b84 Fixed compilation on Linux 2021-03-19 11:35:09 +01:00
Vojtech Bubnik 9f09f03228 Refactoring of FDM support generator:
1) If "support on build plate only" is enabled, the support columns are
   newly trimmed to not land on top of an object. However this may make
   the column too small to be stable.
2) Support enforcers newly take precedence over "supports on build plate only"
   and over "don't support bridges".
3) Some refactoring of the support generator code for clarity: Reduced
   some of the worst spagetti offenders.

Fixes Support generated even if support on build only activated #915
Fixes Bug: supports on build plate only #1340
Fixes Bottom interface layer is not generated , support on build plate only. (long open defect) #4199
Fixes option "supports on build plate only" does not work #3980

Fixes No support interface layers generated #1997
Fixes Feature Request: Option to combine results of 'support from build plate only' and 'support enforcers only' #2801
Fixes Support interface isn't generated: build plate only + blocked by model + support enforcer #3831
Fixes Support Enforcer don't create interface layers #5748
Fixes Support Enforcers Don't Have Top Loops/Raft #1870
Fixes Don't cancel support enforcers with "don't support bridges" #5105
2021-03-19 11:21:35 +01:00
Vojtech Bubnik a95607d7bf Fixing an FDM support generator bug, where some of the support columns
were missing abruptly when going down.
The issue was caused by extracting support areas from a grid and
filtering the extracted islands by intersection with the input islands.
Sometimes the input islands were a bit bigger than the extracted contour,
thus some of the samples of the input islands did not fall into
the extracted contour.
2021-03-17 12:25:49 +01:00
Vojtech Bubnik d0febbec32 Disable the new Toggle fullscreen menu item on OSX, it adds its own. 2021-03-16 08:54:46 +01:00
Vojtech Bubnik fc0e2d578f Checking for removable media on Chrome OS. 2021-03-15 17:42:18 +01:00
Vojtech Bubnik d695e090ef Changing the Fullscreen hotkey to Ctrl+Cmd+F for OSX 2021-03-15 17:11:36 +01:00
Vojtech Bubnik b9c4d29fe9 call detect_platform() after SLIC3R_LOGLEVEL env variable is read 2021-03-15 17:00:49 +01:00
Vojtech Bubnik 01406fd521 Worked around some quirky Linux file system issues. Namely
the Chromebooks share their file system to Linux using the 9p file
system, which does not support setting file ownership. Newly PrusaSlicer
will detect platform and it will not panick if copy_file() cannot set
file ownership after copying. It just logs the incident, and on
chromebooks the loglevel for that incident is "Info", not "Error".

Adjusted the full screen mode to contain menu bar.
Moved Platform.cpp/hpp to libslic3r
2021-03-15 16:19:22 +01:00
Vojtech Bubnik fb9d537b58 Merge branch 'master' of https://github.com/Prusa3d/PrusaSlicer 2021-03-15 10:36:22 +01:00
Vojtech Bubnik ba5e8860cb Fixing some compilation warnings 2021-03-15 10:36:03 +01:00
Vojtech Bubnik 95c5763b83 Fixed typo in previous commit. 2021-03-15 09:55:57 +01:00
Vojtech Bubnik 932336612c Full screen toggle 2021-03-15 09:55:57 +01:00
Vojtech Bubnik 75ad7f262e Linux with precompiled headers wants Config.hpp header in PrintConfig.cpp 2021-03-15 09:55:57 +01:00
Vojtech Bubnik 33b63b35a2 Added detection of Microsoft WSL/WSL2 Linux flavors.
Added tracing of the platform detection.
2021-03-15 09:55:57 +01:00
Vojtech Bubnik 2c76c42baa Linux/OSX don't like an "BSD" symbol? 2021-03-15 09:55:57 +01:00
Vojtech Bubnik 8b4b6afd7b Fix of previous commit. 2021-03-15 09:55:57 +01:00
Vojtech Bubnik a9c3d270e6 ConfigOptions: GUI type as enum, not string.
Fixing compilation error in the new Platform code.
Fixing one issue in FDM support after splitting the top/bottom
interface layers.
2021-03-15 09:55:57 +01:00
Vojtech Bubnik 051ba0e6f4 New files missing from the previous commit. 2021-03-15 09:55:57 +01:00
Vojtech Bubnik ca8cf0a9f1 Detecting platform, namely reading /proc/version to detect Chromium OS.
Disabling Eject on Chromium, detecting removable media the Chromium way.
2021-03-15 09:55:57 +01:00
Vojtech Bubnik 2b19708720 Further ChromeOS support: Detect removable media mounted through ChromeOS 2021-03-15 09:55:57 +01:00
Vojtech Bubnik 9c80c6a4af Disable multi-sampling with virgl (VirtualGL) on Linux.
Namely, on ChromeOS virgl flips red/blue channels at least on some computers with multi-sampling enabled.
It seems it is sufficient to disable multi-sampling after the OpenGL context is created.
2021-03-15 09:55:57 +01:00
Vojtech Bubnik 2494a8f384 Allowing ints with open enums in combo boxes. 2021-03-15 09:55:57 +01:00
Vojtech Bubnik 73b88e6ce0 Splitting FDM support gap to top / bottom, introducing
support_material_bottom_contact_distance
Fixing Crash in support generation after fcb714c (repro attached) #6195
2021-03-15 09:55:57 +01:00
Vojtech Bubnik f3f10ff002 Follow up on https://github.com/prusa3d/PrusaSlicer/pull/5219#issuecomment-794515454
Initializing random generator in PlacholderParser from system clock.
2021-03-15 09:55:56 +01:00
Vojtech Bubnik 00db3dc419 WIP: Splitting the number of top / bottom support interface layers.
If the new support_material_bottom_interface_layers is left at default -1,
then support_material_interface_layers is used for both top and bottom
interface layers.
If support_material_interface_layers == 0, then neither top nor bottom
interface layers are being extruded.
2021-03-15 09:55:56 +01:00
Vojtech Bubnik adcbe4347c Fixed unit tests. 2021-03-15 09:55:56 +01:00
Vojtech Bubnik f01f02154c Reworked the "new" bridging to respect the bridge_flow_ratio
by maintaining extrusion spacing, but modifying the extrusion width
and / or height.
2021-03-15 09:55:56 +01:00
Vojtech Bubnik 8e27e355c2 Fixing unit tests. 2021-03-15 09:55:56 +01:00
Vojtech Bubnik ceea9de8b8 WIP: Refactored bridging flow from normal flow, new config value
'thick_bridges' to switch between the Slic3r vs. S3D/Cura/Ideamaker
way of printing 1st object layer over supports.
Simplified the PresetHints.
2021-03-15 09:55:56 +01:00
Vojtech Bubnik 8adb495e7d Fix of 589d2be442 2021-03-08 11:29:52 +01:00