Commit Graph

159 Commits

Author SHA1 Message Date
enricoturri1966
529d897e2e Added missing include 2021-09-27 13:02:56 +02:00
enricoturri1966
78c830860a Follow-up of 721e396edc - Same fix applied to GCodeProcessor::process_G28() and GCodeProcessor::process_M402() 2021-09-27 12:08:26 +02:00
enricoturri1966
a261214b3b #7016 - Fixed GCodeProcessor::process_M132() 2021-09-27 11:35:58 +02:00
enricoturri1966
e196338ca3 #7008 - GCodeViewer - Fixed loading of gcodes generated by SuperSlicer 2021-09-27 11:22:36 +02:00
Vojtech Bubnik
46abac6f5c Fix of prusa-gcodeviewer changes modification time of the viewed gcode file #7005
This is a regression wrt. PrusaSlicer 2.4.0-alpha1 due to the G-code
processing optimization and parallelization.
Related to GCode Viewer changes files modified date in windows #5079
2021-09-27 10:02:54 +02:00
Vojtech Bubnik
978e42f57c Fixed visualization of G-code lines in G-code viewer (3D view).
Improved speed of parsing external G-code.
2021-09-21 15:30:37 +02:00
Vojtech Bubnik
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
enricoturri1966
1cf2eeb391 Tech ENABLE_RETRACT_ACCELERATION set as default 2021-09-17 08:21:25 +02:00
enricoturri1966
762e7f9474 Tech ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER set as default 2021-09-14 15:05:33 +02:00
enricoturri1966
660ffbad58 Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_fix_options_z 2021-09-09 10:34:47 +02:00
enricoturri1966
0e39d8a815 ENABLE_GCODE_VIEWER_STATISTICS - Fixed calculation of time required by GCodeProcessor 2021-09-09 09:35:58 +02:00
Vojtech Bubnik
ca9d1ff6e1 Follow-up to b5a007a683
WIP to G-code export parallelization through pipelining:
GCodeProcessor is called during the G-code export,
the G-code is no more reopened and re-read, but it is pipelined
from the G-code generator.
2021-09-08 15:06:12 +02:00
enricoturri1966
f437cd535d Tech ENABLE_FIX_PREVIEW_OPTIONS_Z - Enable fixing the z position of seams (and other options) in preview 2021-09-08 14:30:40 +02:00
Vojtech Bubnik
09a34639f7 Fix of recent GCode / GCodeProcessor refactoring: Don't close a FILE
twice.
2021-09-07 17:58:06 +02:00
Vojtech Bubnik
1c60fa2704 GCodeProcessor collects positions of line ends for GCodeViewer,
GCodeViewer no more parses G-code just to extract line end positions.
Removed start_mapping_gcode_window(), void stop_mapping_gcode_window(),
they are no more needed.
2021-09-07 15:42:56 +02:00
Vojtech Bubnik
0baa4ebef0 GCodePostProcessor - use C files instead of C++ streams, C files are faster.
Also fixed a regression - crashes on undefined cancellation callback.
2021-09-07 14:20:21 +02:00
enricoturri1966
58338a9e3d Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer 2021-09-07 12:25:35 +02:00
enricoturri1966
df30579753 GCodeViewer - Fixed crash when importing gcode generated with Simplify3D and switching to tool view 2021-09-07 12:25:30 +02:00
Vojtech Bubnik
d854048809 Optimization of GCodeProcessor for speed. 2021-09-07 11:18:12 +02:00
enricoturri1966
ee7cc2aacb Revert of 7b4c98d727, clamp toolpaths widths increased to 2mm and added default values for toolpaths width and height 2021-09-07 09:41:14 +02:00
Vojtech Bubnik
4c77ae8f4a Pimped up GCodeProcessor::TimeProcessor::post_process():
replaced implicit lambda capture with explicit listing of captured
context for readability and code correctness. Captured this as const.
2021-09-06 18:08:13 +02:00
enricoturri1966
bd42f9e76e #6828 - Clamping of toolpaths width performed only for gcodes files produced by 3rd part softwares (Tech ENABLE_CLAMP_TOOLPATHS_WIDTH) 2021-09-06 14:31:10 +02:00
Vojtech Bubnik
dc7b3bedb8 G-code processor tiny change: In place initialization 2021-09-03 17:22:53 +02:00
enricoturri1966
b5c8e2629c Removed debug code 2021-08-19 09:47:01 +02:00
enricoturri1966
0e6b9aa65b Added retract acceleration member variable to GCodeProcessor and modified GCodeProcessor::process_M204() method 2021-08-19 09:38:51 +02:00
Vojtech Bubnik
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
enricoturri1966
5dabae7d0d Fixed import of color print view from gcode files into GCodeViewer 2021-07-23 11:27:07 +02:00
enricoturri1966
63ae8756bb Tech ENABLE_SEAMS_VISUALIZATION set as default 2021-07-22 12:58:33 +02:00
enricoturri1966
3dcf5f1156 Tech ENABLE_START_GCODE_VISUALIZATION set as default 2021-07-22 12:32:08 +02:00
enricoturri1966
58f3fa37b1 Tech ENABLE_EXTENDED_M73_LINES set as default 2021-07-22 09:55:39 +02:00
enricoturri1966
4537263265 Tech ENABLE_GCODE_WINDOW set as default 2021-07-22 09:37:02 +02:00
enricoturri1966
cef1a00d86 Tech ENABLE_VALIDATE_CUSTOM_GCODE set as default 2021-07-22 09:13:12 +02:00
enricoturri1966
cb873bd88c Tech ENABLE_GCODE_LINES_ID_IN_H_SLIDER set as default 2021-07-22 08:35:21 +02:00
enricoturri1966
22c7f22268 GCodeViewer -> Fixed loading of machine limits data from config contained into gcode files 2021-07-20 09:38:35 +02:00
Lukas Matena
e80ef16a5b Added a missing locale switch needed for custom gcode validation when switching tabs 2021-07-12 09:38:32 +02:00
Vojtech Bubnik
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
enricoturri1966
3cb502c954 GCode Viewer -> Fixed used filament for gcode files produced by other slicers 2021-06-15 09:39:33 +02:00
Lukas Matena
03c6bdfe9a Fixed a memory leak during locales switching on macOS and
removed frequent locales switching during gcode processing
2021-06-05 07:09:23 +02:00
enricoturri1966
1ae72e2a33 Fixed calculation of used filament for gcode viewer (take data from gcode file) 2021-05-27 12:25:59 +02:00
Lukas Matena
183a702be0 Fixed second batch of locale-dependent calls 2021-05-24 12:20:29 +02:00
Lukas Matena
1cb432a4ae Fixed first batch of locale-dependent calls 2021-05-24 12:20:29 +02:00
YuSanka
2372f3b029 Fix of #2825 - Add the length of each filament used 2021-05-07 12:48:34 +02:00
enricoturri1966
1552641824 Follow-up of 15c32d636d -> Small refactoring 2021-05-04 13:31:07 +02:00
enricoturri1966
0b01436982 Seams detection for gcode saved with other slicers 2021-05-04 12:45:51 +02:00
enricoturri1966
868c1ecd41 Fixed conflicts after merge with master 2021-04-30 14:54:58 +02:00
enricoturri1966
3fe61c2887 Tech ENABLE_SEAMS_VISUALIZATION -> Added threshold to place seams 2021-04-27 15:12:45 +02:00
enricoturri1966
9516470b2f Tech ENABLE_SEAMS_VISUALIZATION -> Fixed build on Mac 2021-04-27 11:11:21 +02:00
enricoturri1966
343eb6006b Tech ENABLE_SEAMS_VISUALIZATION -> 1st installment of seams visualization in preview 2021-04-27 09:45:15 +02:00
enricoturri1966
f9ddb38f04 Extrusions in custom start g-code forced to be at first layer height level 2021-04-22 15:15:19 +02:00
enricoturri1966
25df2fb8f2 Do not convert custom gcode extrusion to travel 2021-04-09 12:52:11 +02:00