Commit Graph

154 Commits

Author SHA1 Message Date
93317618dd Save/Load repaired errors from/to a mesh statistics to/from a 3MF 2021-10-06 10:57:28 +02:00
afd8bf9424 Several minor improvements and fixed warnings 2021-10-01 14:31:22 +02:00
4ae477d84e Fixed import of multi-material AMF files, broken due to admesh eradication. 2021-10-01 13:34:22 +02:00
2352c07443 Follow-up to 3ee259b602
1) Added parsing of 3MF PrusaSlicer generator semantic version
2) For 3MFs generated by >= "2.4.0-alpha1" and < "2.4.0-alpha3",
   remove unreferenced vertices on loading. This should shrink the incorrectly
   generated 3MFs back.
3) Added check for an empty mesh, which could have crashed PrusaSlicer on 3MF parsing.
2021-09-30 12:18:43 +02:00
f3a185f243 Fixed warnings 2021-09-30 09:00:01 +02:00
8087c7fcbb #7011 - Follow-up of 3ee259b602 - Modified volumes' indices rebase 2021-09-27 16:03:09 +02:00
c75c12e0a5 #7010 - Fixed import of volumes from 3mf. This is a regression wrt. PrusaSlicer 2.4.0-alpha1 due to the 3mf import optimization introduced with 8a2a9dba2f 2021-09-27 14:14:05 +02:00
53a5c23d0f Eradicated admesh from TriangleMesh:
TriangleMesh newly only holds indexed_triangle_set and
TriangleMeshStats. TriangleMeshStats contains an excerpt of stl_stats.
TriangleMeshStats are updated when initializing with indexed_triangle_set.

Admesh triangle mesh fixing is newly only used when loading an STL.
AMF / 3MF / OBJ file formats are already indexed triangle sets, thus
they are no more converted to admesh stl_file format, nor fixed
through admesh repair machinery. When importing AMF / 3MF / OBJ files,
volume is calculated and if negative, all faces are flipped. Also
a bounding box and number of open edges is calculated.

Implemented its_number_of_patches(), its_num_open_edges()
Optimized its_split(), its_is_splittable() using a visitor pattern.

Reworked QHull integration into TriangleMesh:
    1) Face normals were not right.
    2) Indexed triangle set is newly emitted instead of duplicating
       vertices for each face.

Fixed cut_mesh(): Orient the triangulated faces correctly.
2021-09-20 17:12:22 +02:00
e932289777 Replaced atof and atoi inside 3MF attribute parsing with fast_float::from_chars and boost::spirit that are faster. 2021-09-14 11:09:43 +02:00
15ce5d271b Fixed conflicts after merge with master 2021-09-01 13:28:10 +02:00
a79d268c0e Added versioning of the structure of stored data for all three painting gizmos (fdm supports, seam and multi-material). 2021-08-31 15:05:11 +02:00
d9fd4d5610 Brim separation from object, follow up to 82373334bc
1) Changed the name of the variable "brim_offset" to "brim_separation"
   for clarity.
2) Added legacy conversion after loading an old 3MF that does not define
   then new "brim_separation" variable: The "brim_separation" is being
   filled in with the "elefant_foot_compensation" value to produce
   equal brim separation to the old PrusaSlicer that saved that 3MF file.
2021-08-31 12:22:44 +02:00
cf9c2f5614 Fixed volume name when loading a 3mf, saved with 3rd part software, as project 2021-08-30 11:46:26 +02:00
41461d868d Fixed conflicts after merge with master 2021-08-26 12:47:32 +02:00
d5d79c5654 Tech ENABLE_SAVE_COMMANDS_ALWAYS_ENABLED -> 1st installment: Allow to save/load empty projects 2021-08-26 10:38:14 +02:00
3da95ea901 #5798 - Fixed naming of single part objects when loaded from 3mf files produced by 3rd part softwares 2021-08-23 11:23:31 +02:00
1b17c9489a Tech ENABLE_FIX_MIRRORED_VOLUMES_3MF_IMPORT_EXPORT - fixed export/import to/from 3mf file of mirrored volumes 2021-08-20 11:24:48 +02:00
94c05f1dd9 Follow-up to 7c01ddf996
1) Starting with this commit, configuration block exported into G-code
   is delimited by "; prusaslicer_config = begin" and "; prusaslicer_config = end".
   These delimiters look like any other key / value configuration pairs
   on purpose to be compatible with older PrusaSlicer config parsing from G-code.
2) Config parser from G-code newly searches for "; generated by ..."
   comment over the complete G-code, thus it is compatible with various
   post processing scripts extending the G-code at the start.
3) Config parser from G-code parses PrusaSlicer version from
   the "; generated by PrusaSlicer ...." header and if the G-code was
   generated by PrusaSlicer 2.4.0-alpha0 and newer, it expects that
   the G-code already contains the "; prusaslicer_config = begin / end"
   tags and it relies on these tags to extract configuration.
4) A new simple and robust parser was written for reading project configuration
   from 3MF / AMF, while a heuristic parser to read config from G-code located
   at the end of the G-code file was used before.
2021-08-12 15:27:46 +02:00
bc5cc8e463 follow-up to a86e7107a5:
Make is_converted_from_meters / is_converted_from_inches exclusive-or.
Maybe it would be better to make a single enum from the two booleans,
if they are exclusive-or?
2021-08-05 15:35:44 +02:00
2203ada89c Tech ENABLE_RELOAD_FROM_DISK_FOR_3MF set as default 2021-07-21 14:10:05 +02:00
e2603b1652 Removed unnecessary backward compatibility with old multi-material painted 3MF from the early stage of development. 2021-07-12 13:37:33 +02:00
c5304750d9 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
e4f36339e8 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
4809689dcb Merge remote-tracking branch 'remotes/origin/lh_multi_material_segmentation' into vb_print_regions 2021-05-26 15:23:35 +02:00
183a702be0 Fixed second batch of locale-dependent calls 2021-05-24 12:20:29 +02:00
97a85eb487 WIP: MMU segmentation without top and bottom layers 2021-04-19 07:04:50 +02:00
ef8718327b WIP: Duplicated the FDM support gizmo for the MMU segmentation 2021-04-19 07:01:11 +02:00
2c55aed37c Fix of 589d2be442 2021-03-08 11:29:52 +01:00
1b1785703d Fix of Repair with Netfabb does not work on builds after 2.3.0 release (Windows 10) #6193
This is more a workaround than a fix: Windows 10 3D model fixing API refuses
to load a zip64 encoded 3MF. We need to get in touch with Microsoft on that
issue, for now the 3MFs generated for the Windows 10 3D model fixing API
will be limited to 4GB. Saving a bigger 3MF will fail.
2021-03-08 09:36:21 +01:00
8cf75cf037 Fix of Improve Support material adhesion by base type interface layers
under soluble supports. #5823
Implemented as a pull request #5903 by @spiky2021
and reworked.

commit c7993e619225553a2c4078787907b9ebbd9ac759
Author: spiky2021 <77010315+spiky2021@users.noreply.github.com>
Date:   Thu Feb 11 12:39:25 2021 +0100

    Base type interfaces for soluble interface supports

    At the moment soluble support material adhesion is weak due to sparse support layers under soluble support layers. I reported as issue #5823 with pictures, as well.
    I modified two methods to the SupportMaterial Class including their headers.
    The new methods add two base type interface layers to the support structure, in case the extruders are different and soluble support is choosen.
    Since it is conditionally activated, it in general doesn't need a GUI input. But a GUI option number of base interface layers may enabled users to adapt this feature to their needs.
    This is my second try to provide a pull request on this topic. Reset my fromer repository, because first I merged this and all other changes to my master and couldn't provide separate pull request anymore.
2021-02-15 18:07:44 +01:00
0b07af417e Improving 3MF import: checking for invalid data. 2021-02-12 16:46:49 +01:00
72fcba1202 SPE-1103 Added menu items for the conversation of the volumes from/to meters
Related to #4521
2021-02-10 20:34:05 +01:00
6fc7007f51 Merge pull request #5963 from wavexx/remove_undeeded_includes
Remove unneeded inclusion of boost::nowide
2021-02-10 10:43:56 +01:00
e40485fc8a Fixed some clang warnings 2021-02-09 19:23:58 +01:00
f968cfd2d5 Fixing Clang warnings 3 2021-02-08 17:52:29 +01:00
e44b586442 Removed debug code 2021-02-08 13:23:11 +01:00
831f47f4f8 Fixing some compiler warnings on Linux 2021-02-08 11:58:03 +01:00
6936660d3d Fix of #5888 - Pause Print M117 message not saved after reloading .3mf project 2021-02-05 19:39:28 +01:00
0afcf8bfdf 3MF and AMF error reporting: Use boost::log instead of printf(). 2021-02-05 15:20:23 +01:00
8186736502 Improved AMF/3MF security when parsing invalid meshes. 2021-02-05 14:19:51 +01:00
a5c8dfab7f Remove unneeded inclusion of boost::nowide 2021-02-03 20:41:04 +01:00
517f71e893 #5071 - Reload from disk for 3mf files 2021-02-01 14:33:07 +01:00
256bdc757b 3mf export - Do not export unneeded space 2021-01-27 15:53:44 +01:00
22e6eb58d1 3mf export - Removed export of duplicated line into model config file 2021-01-27 12:26:46 +01:00
0b9a0c82e7 Fixes after merge. 2021-01-27 09:35:39 +01:00
cf3020fc97 Refactoring of 3MF file export to use the new homebrewed miniz
streaming interface. This shall fix high memory consumption and
crashes when exporting extremely large 3MF files.
2021-01-27 09:18:17 +01:00
14b6687537 WIP: Exporting 3MFs through a streaming interface. 2021-01-27 09:18:16 +01:00
1e9ba4b838 Merge pull request #5544 from hzeller/fix-assignment-of-charliteral-to-writable-charptr
Fix assignment of string literals to char*.
2021-01-05 13:11:29 +01:00
7904fddb80 Escape special xml characters when writing metadata into the model file
This should fix #5577
2021-01-04 14:21:24 +01:00
286672558c Fix assignment of string literals to char*.
Fix some char *foo = "string literal" assignments that
really should be assigned to const char*.

(they also happen to be constexpr, but that only prevents
to assign something later to foo, but does not alter
the char* type).

Signed-off-by: Henner Zeller <h.zeller@acm.org>
2020-12-20 13:40:25 -08:00