Commit Graph
100 Commits
Author SHA1 Message Date
Vojtech Bubnik f02821a82d Renamed the "marlinfirmware" firmware flavor to "marlin2". 2021-06-29 17:55:26 +02:00
Vojtech Bubnik 85d4e1c60b Workaround of boost::filesystem::copy_file() incompatibility
on some file systems (eCrypt ...)
Should fix #4716 #6588
2021-06-28 13:18:52 +02:00
Vojtech Bubnik e6295bbfe8 Fix of wxWidgets3.0 again wxGetApp not declared in this scope #6655 2021-06-28 07:45:13 +02:00
Vojtech Bubnik 211110ce53 Fixing some compiler warnings. 2021-06-27 17:45:41 +02:00
Vojtech Bubnik e4e8c5df12 As an example of using the enum_bitmask infrastructure for type safe
sets of optional boolean parameters, the cut function "keep upper",
"keep lower" and "flip lower" boolean parameters were converted into
a single type safe enum_bitmask. Such a coding style is certainly
wordier than the original code, but much safer and more readable
than the error prone "boolean, boolean, boolean" function call
parameter list.
2021-06-27 17:36:25 +02:00
Vojtech Bubnik 0f3cabb5d9 Support for forward compatibility of configurations, user and system
config bundles, project files (3MFs, AMFs). When loading these files,
the caller may decide whether to substitute some of the configuration
values the current PrusaSlicer version does not understand with
some reasonable default value, and whether to report it. If substitution
is disabled, an exception is being thrown as before this commit.
If substitution is enabled, list of substitutions is returned by the
API to be presented to the user. This allows us to introduce for example
new firmware flavor key in PrusaSlicer 2.4 while letting PrusaSlicer
2.3.2 to fall back to some default and to report it to the user.

When slicing from command line, substutions are performed by default
and reported into the console, however substitutions may be either
disabled or made silent with the new "config-compatibility" command
line option.

Substitute enums and bools only.  Allow booleans to be parsed as
    true: "1", "enabled", "on" case insensitive
    false: "0", "disabled", "off" case insensitive
This will allow us in the future for example to switch the draft_shield
boolean to an enum with the following values: "disabled" / "enabled" / "limited".

Added "enum_bitmask.hpp" - support for type safe sets of options.
See for example PresetBundle::load_configbundle(...
LoadConfigBundleAttributes flags) for an example of intended usage.

WIP: GUI for reporting the list of config substitutions needs to be
implemented by @YuSanka.
2021-06-27 16:57:05 +02:00
Vojtech Bubnik ad336e2cc0 Because of a crash in PrusaSlicer 2.3.0/2.3.1 when showing an update
notification with some locales, we don't want PrusaSlicer 2.3.0/2.3.1
to show this notification. On the other hand, we would like PrusaSlicer
2.3.2 to show an update notification of the upcoming PrusaSlicer 2.4.0.
Thus we will let PrusaSlicer 2.3.2 and couple of follow-up versions
to download the version number from an alternate file until
the PrusaSlicer 2.3.0/2.3.1 are phased out, then we will revert to
the original name.
2021-06-25 17:54:43 +02:00
Vojtech Bubnik 9b70efc46a Windows specific: Transactional saving of PrusaSlicer.ini to ensure
that configuration could be recovered in the case PrusaSlicer.ini
is corrupted during saving. The config is first written into a temp file
marked with a MD5 checksum. Once the file is saved, it is
copied to a backup file first, then moved to PrusaSlicer.ini.

When loading PrusaSlicer.ini fails, the backup file will be loaded
instead, however only if its MD5 checksum is valid.

The following "Fixes" comments are for github triggers. We implemented
a workaround, not a fix, we don't actually know how the data corruption
happens and why. Most likely the "Move file" Windows API is not atomic
and if PrusaSlicer crashes on another thread while moving the file,
PrusaSlicer.ini will only be partially saved, with the rest of the file
filled with nulls. We did not "fix" the issue, we just hope that our
workaround will help in majority of cases.

Fixes prusaslicer wont open 2.3 windows 10 #5812
Fixes Won't Open - Windows 10 #4915
Fixes PrusaSlicer Crashes upon opening with "'=' character not found in
line error" #2438
Fixes Fails to open on blank slic3r.ini %user%\AppData\Roaming\Slic3rPE
2021-06-25 16:44:06 +02:00
Vojtech Bubnik 204ae62449 Slight improvement in cost of background slicing cancellation. 2021-06-23 16:37:18 +02:00
Vojtech Bubnik 3a5a0575ef Fixed after removing TBB deprecated APIs 2021-06-23 15:24:05 +02:00
Vojtech Bubnik d3233d66fb Fixing previous commit 2021-06-22 10:05:03 +02:00
Vojtech Bubnik c0715866ff Win32 specific: SEH handler on background thread. Catches Windows
structured exceptions (hard crashes, segmentation faults...),
converts them to Slic3r::HardCrash exceptions and displays the exception
using the usual PrusaSlicer way.
The SEH handler is installed on the main background slicing thread
as of now, therefore hard crashes in TBB worker threads are not handled.
2021-06-22 09:54:08 +02:00
Vojtech Bubnik d0411223be TriangleSelector:
1) Fixing yesterday's regression in deserialization of older painted 3MFs
   (order of triangle children is now reversed, thus the serialization
    / deserialization has to take it into account).
2) WIP extraction into facets to triangulate T-joints.
2021-06-16 10:52:00 +02:00
Vojtech Bubnik 154e552006 TriangleSelector optimizations:
1) When splitting a triangle, vertices are now properly shared with
   the neighbor triangles, if these are already split.
   Please note that the splitting may not be regular if the splitting
   thershold is changed between splitting calls. Still the new code
   shares the vertices accross shared edges properly.
2) Triangles resp. vertices are newly reused after deleted using
   linked lists of released triangles resp. vertices.
   This mechanism replaces the old mechanism of reusing already split
   triangles.
2021-06-15 14:43:46 +02:00
Vojtech Bubnik 2f8190e6d0 Workaround of boost::filesystem::copy_file() incompatibility
on some file systems (eCrypt ...)
Should fix #4716 #6588
2021-06-14 12:19:13 +02:00
Vojtech Bubnik e17b57d6bd Fixing previous TriangleSelector refactoring. 2021-06-11 17:59:33 +02:00
Vojtech Bubnik 403bb926c8 Fixed regression bug after PrintRegions refactoring:
Fixed crash if an object is outside the print bed, its modifier inside
the print bed and the modifier gets deleted.
2021-06-11 17:29:16 +02:00
Vojtech Bubnik 6bade1b24a TriangleSelector - some memory optimization.
Don't store traingle normal, but reference the source triangle,
which stores its normal.
2021-06-11 12:27:58 +02:00
Vojtech Bubnik 74ab3e108e TriangleSelector refactoring for readability and a bit of performance,
added some comments, improved encapsulation through private attributes,
removed recursive call through std::function etc.
2021-06-11 11:02:47 +02:00
Vojtech Bubnik 4ada2ed093 TriangleSelector::get_facets() refactoring to share vertices.
TriangleSelector::valid refactored to m_valid and valid()
and bool members moved next to each other to shrink data structure
size due to memory alignment.
2021-06-10 12:43:31 +02:00
Vojtech Bubnik 95f4690e25 Support / seam / MMU painting serialization / deserialization:
Changed the serialization structure
	std::map<int, std::vector<bool>>
to a significantly more compact
	std::pair<std::vector<std::pair<int, int>>, std::vector<bool>>
Such change shall significantly improve efficiency of Undo / Redo stack.
2021-06-10 09:26:30 +02:00
Vojtech Bubnik 8d325008d1 Small MMU segmentation optimization 2021-06-04 08:46:02 +02:00
Vojtech Bubnik 9efe58e6c7 Merge remote-tracking branch 'remotes/origin/master' into vb_print_regions 2021-06-02 18:25:11 +02:00
Vojtech Bubnik 2d9953069a Removed unnecessary const_cast calls inside Camera. 2021-06-02 12:19:55 +02:00
Vojtech Bubnik a1283277d3 Fixing a regression crash in Preset Hints. 2021-06-02 11:28:55 +02:00
Vojtech Bubnik 0bfc53f5a5 VertexFaceIndex: vertex index to incident face indices built for
indexed_triangle_set.
2021-06-01 19:30:26 +02:00
Vojtech Bubnik 49c2fc160d Merge remote-tracking branch 'remotes/origin/master' into vb_print_regions 2021-06-01 12:46:37 +02:00
Vojtech Bubnik 9aa520baf3 Fix of previous commit: Mixed up ClipperLib::pftPositive and pftNonZero 2021-06-01 12:33:14 +02:00
Vojtech Bubnik 73e0099c55 Merge remote-tracking branch 'remotes/origin/master' into vb_print_regions 2021-06-01 11:19:53 +02:00
Vojtech Bubnik 7681eb8496 PrintRegion refactoring: Fixed a crash when an object is moved from outside
the print bed inside and it becomes printable.
2021-06-01 11:12:55 +02:00
Vojtech Bubnik 206bef7623 -fno-omit-frame-pointer disabled for Windows ASAN builds 2021-06-01 11:12:14 +02:00
Vojtech Bubnik 20ba7c0a1f New parameter "Slicing Mode" for supporting 3DLabPrint airplane models.
S3D's strategy for merging self intersecting models is "Even / Odd"
which PrusaSlicer now supports as an alternative to "Positive" rule.
Also added a "Close Holes" option to fill in all internal structures.
3D-Labprint Models aren't sliceable (till years) #3062 #3708
2021-06-01 11:10:12 +02:00
Vojtech Bubnik df87f1b929 Fixed some compiler warnings 2021-05-31 14:48:26 +02:00
Vojtech Bubnik 033d9f3a5e Merge remote-tracking branch 'remotes/origin/master' into vb_print_regions 2021-05-31 14:05:53 +02:00
Vojtech Bubnik 8c95212aae Bugfix of PrintRegion refactoring: Correct invalidation of regions
on object transformation.
2021-05-31 14:04:45 +02:00
Vojtech Bubnik f5c7d14e85 Bugfix after refactoring of PrintRegions: Fixed handling of cached_volume_ids 2021-05-28 15:55:18 +02:00
Vojtech Bubnik fe96a20b50 Fixed compilation on GCC 2021-05-28 15:22:00 +02:00
Vojtech Bubnik 7d3b2b5b6e Merge branch 'vb_print_regions' of https://github.com/Prusa3d/PrusaSlicer into vb_print_regions 2021-05-28 15:14:41 +02:00
Vojtech Bubnik c02f95dfd6 Bugfixes after PrintRegion refactoring. 2021-05-28 15:14:34 +02:00
Vojtech Bubnik 3e28b4c967 Fix of previous commit 2021-05-27 16:14:54 +02:00
Vojtech Bubnik 99301f89f6 Merge remote-tracking branch 'remotes/origin/master' into vb_print_regions 2021-05-27 16:12:53 +02:00
Vojtech Bubnik 818cb703ed Refactored the ModelVolume bounding box to Eigen::AlignedBox<float>,
separated splitting of LayerRegions by MMU segmentation to its own
function.
2021-05-27 16:12:34 +02:00
Vojtech Bubnik f1754e538e Added a new icon for a "negative" volume (as of now it is the same
as of a printable volume)
2021-05-27 14:35:39 +02:00
Vojtech Bubnik b5aa09e5ba WIP: Integration of MMU painting into the slicing back-end. 2021-05-27 14:29:51 +02:00
Vojtech Bubnik 9e4d483453 Merge branch 'vb_print_regions' of https://github.com/Prusa3d/PrusaSlicer into vb_print_regions 2021-05-26 16:15:01 +02:00
Vojtech Bubnik 409e1c5cc8 Some fixes after preceding merge. Moved mmu_segmented_region_max_width
from PrintConfig to PrintObjectConfig.
2021-05-26 16:14:52 +02:00
Vojtech Bubnik 980ca195f5 Merge remote-tracking branch 'remotes/origin/lh_multi_material_segmentation' into vb_print_regions 2021-05-26 15:23:35 +02:00
Vojtech Bubnik 0d081c90f0 Merge remote-tracking branch 'remotes/origin/master' into vb_print_regions 2021-05-26 14:38:34 +02:00
Vojtech Bubnik 7f1f0d29d0 Will gcc accept this? 2021-05-26 14:33:24 +02:00
Vojtech Bubnik cba1950a4e Fixing compilation on gcc. 2021-05-26 14:30:25 +02:00
Vojtech Bubnik e24026bfa5 Making the "Default" extruder transparent for modifier meshes and layer
range modifiers.
2021-05-26 14:25:33 +02:00
Vojtech Bubnik b3195614cf WIP PrintRegion refactoring: Another round of bug fixing, negative volumes
seem to work.
2021-05-26 12:41:06 +02:00
Vojtech Bubnik 8ab6a615d0 Fixed another compiler warning 2021-05-25 21:17:07 +02:00
Vojtech Bubnik dd79a2b832 Fixing some compiler warnings 2021-05-25 20:46:31 +02:00
Vojtech Bubnik 8a297be74e Fixing another clang complaint 2021-05-25 20:03:05 +02:00
Vojtech Bubnik c3cd2c7f55 Fixing an OSX clang quirk. 2021-05-25 19:27:20 +02:00
Vojtech Bubnik 9b9354a2aa WIP: Rework of PrintRegions, bunch of bug fixes. 2021-05-25 18:12:38 +02:00
Vojtech Bubnik 701a0c9576 Two more bugs squished. 2021-05-24 18:07:12 +02:00
Vojtech Bubnik 72d1faa03e WIP PrintRegion refactoring: Squashed some bugs. 2021-05-24 16:55:34 +02:00
Vojtech Bubnik c8bdc62af4 Fixing compilation on Linux 2021-05-24 15:12:04 +02:00
Vojtech Bubnik 04014db136 Fixing compilation on Linux 2021-05-24 15:08:07 +02:00
Vojtech Bubnik 92b4f0542a Another compilation fix. 2021-05-24 15:00:08 +02:00
Vojtech Bubnik fd97a49ccc Fixing the previous commit. 2021-05-24 14:36:27 +02:00
Vojtech Bubnik e658fe0698 WIP: PrintRegion refactoring, it finally compiles!
Config/PrintConfig refactoring to support operator< for StaticPrintConfig
derived containers.
2021-05-24 14:10:04 +02:00
Vojtech Bubnik 740773db85 WIP: Refactoring of PrintRegions. It nearly compiles! 2021-05-21 17:57:37 +02:00
Vojtech Bubnik ef9004cee4 Fix of its_collect_mesh_projection_points_above()
Fix of perl integration tests after introduction of not using the mesh
below the print bed.
2021-05-20 13:58:27 +02:00
Vojtech Bubnik ff6623b0f4 Fixing 2021-05-19 16:51:25 +02:00
Vojtech Bubnik 116e2b2112 Fixing the slice_mesh() after recent refactoring. 2021-05-19 16:09:45 +02:00
Vojtech Bubnik 68b0d92183 Merge remote-tracking branch 'remotes/origin/master' into vb_print_regions 2021-05-19 14:00:21 +02:00
Vojtech Bubnik 31942e03db Optimization of its_collect_mesh_projection_points_above(): Reserve points. 2021-05-19 13:59:34 +02:00
Vojtech Bubnik e952aded78 cut_mesh(): new parameter to optionally not triangulate the caps. 2021-05-19 13:52:47 +02:00
Vojtech Bubnik 66cf7ea9d3 Extracting its_collect_mesh_projection_points_above() out of
its_convex_hull_2d_above(), so that the projected points may get
collected over multiple volumes before applying Geometry::convex_hull()
2021-05-19 13:39:56 +02:00
Vojtech Bubnik 5644b98d3b Factored out convex hull calculation from ModelObject::convex_hull_2d()
to Geometry::convex_hull().
Update Geometry::convex_hull() to handle duplicate points.
2021-05-19 13:23:19 +02:00
Vojtech Bubnik 8db2d96c75 Point::ccw() optimization: Calculate with int64, not doubles. 2021-05-19 12:01:30 +02:00
Vojtech Bubnik 6b54f34ce1 New functions: its_convex_hull_2d_above() 2021-05-19 11:35:42 +02:00
Vojtech Bubnik 682c405fc2 Merge remote-tracking branch 'remotes/origin/master' into vb_print_regions 2021-05-19 09:40:24 +02:00
Vojtech Bubnik f5f912e6e9 WIP: Refactoring of PrintRegions 2021-05-19 09:38:51 +02:00
Vojtech Bubnik c28cd957d5 New utility function its_merge_vertices().
Implemented contour simplification inside slice_mesh_ex().
2021-05-18 17:57:55 +02:00
Vojtech Bubnik 3481898d4d Fixed missing include 2021-05-18 16:15:54 +02:00
Vojtech Bubnik 78c0199523 TriangleMeshSlicer: Optimized out unnecessary transformations. 2021-05-18 16:12:49 +02:00
Vojtech Bubnik 70b4915f9c TriangleMeshSlicer: Got rid of admesh! 2021-05-18 15:05:30 +02:00
Vojtech Bubnik 308d6b7809 WIP: Reworked slicing
1) Slicing code moved to TriangleMeshSlicer.cpp,hpp from TriangleMesh.cpp,hpp
2) Refactored to use as little as possible of admesh.
2021-05-17 20:25:59 +02:00
Vojtech Bubnik 2b9e41e695 Fix of a special case in auto color print feature, which crashed with
single layer PrintObjects.
Fixes Segmentation fault (GLib-GObject null pointer) #6516
2021-05-14 14:57:41 +02:00
Vojtech Bubnik 221af991c2 Fixed update of PrintRegions after removing an object.
The bug has been introduced during recent PrintRegion refactoring.
2021-05-14 11:52:33 +02:00
Vojtech Bubnik 5828decfc7 Fixing multi-material printing after recent refactoring (d21b9aa to 1c6333e) 2021-05-10 09:32:24 +02:00
Vojtech Bubnik 5c35fa4539 Commenting source of Polygon::centroid() algorithm 2021-05-07 11:54:25 +02:00
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