This commit is contained in:
Mario Voigt 2024-01-18 00:37:40 +01:00
parent da9aa9bd80
commit 9fd854e237
2 changed files with 18 additions and 0 deletions

View File

@ -50,6 +50,7 @@
<param name="invisible_shapes" type="bool" gui-text="Invisible shapes">false</param> <param name="invisible_shapes" type="bool" gui-text="Invisible shapes">false</param>
<param name="non_path_shapes" type="bool" gui-text="Non-path shapes">false</param> <param name="non_path_shapes" type="bool" gui-text="Non-path shapes">false</param>
<param name="pointy_paths" type="bool" gui-text="Pointy paths">false</param> <param name="pointy_paths" type="bool" gui-text="Pointy paths">false</param>
<param name="combined_paths" type="bool" gui-text="Combined paths">false</param>
<param name="transformations" type="bool" gui-text="Transformations">false</param> <param name="transformations" type="bool" gui-text="Transformations">false</param>
<separator/> <separator/>
<param name="short_paths" type="bool" gui-text="Short paths">false</param> <param name="short_paths" type="bool" gui-text="Short paths">false</param>

View File

@ -90,6 +90,7 @@ class LaserCheck(inkex.EffectExtension):
pars.add_argument('--cosmestic_dashes', type=inkex.Boolean, default=False) pars.add_argument('--cosmestic_dashes', type=inkex.Boolean, default=False)
pars.add_argument('--invisible_shapes', type=inkex.Boolean, default=False) pars.add_argument('--invisible_shapes', type=inkex.Boolean, default=False)
pars.add_argument('--pointy_paths', type=inkex.Boolean, default=False) pars.add_argument('--pointy_paths', type=inkex.Boolean, default=False)
pars.add_argument('--combined_paths', type=inkex.Boolean, default=False)
pars.add_argument('--transformations', type=inkex.Boolean, default=False) pars.add_argument('--transformations', type=inkex.Boolean, default=False)
pars.add_argument('--short_paths', type=inkex.Boolean, default=False) pars.add_argument('--short_paths', type=inkex.Boolean, default=False)
pars.add_argument('--short_paths_min', type=float, default=1.000) pars.add_argument('--short_paths_min', type=float, default=1.000)
@ -800,6 +801,22 @@ class LaserCheck(inkex.EffectExtension):
for pointyPath in pointyPaths: for pointyPath in pointyPaths:
inkex.utils.debug("id={}".format(pointyPath.get('id'))) inkex.utils.debug("id={}".format(pointyPath.get('id')))
'''
Combined paths make trouble with vector sorting algorithm. Check which paths could be broken apart
'''
if so.checks == "check_all" or so.combined_paths is True:
inkex.utils.debug("\n---------- Combined paths - should be broken apart")
combinedPaths = []
for element in shapes:
if isinstance(element, inkex.PathElement):
break_paths = element.path.break_apart()
if len(break_paths) > 2:
combinedPaths.append([element, len(break_paths)])
if so.show_issues_only is False:
inkex.utils.debug("{} combined paths in total".format(len(combinedPaths)))
for combinedPath in combinedPaths:
inkex.utils.debug("id={} has sub paths: {}".format(combinedPath[0].get('id'), combinedPath[1]))
''' '''
Transformations often lead to wrong stroke widths or mis-rendering in end software. The best we Transformations often lead to wrong stroke widths or mis-rendering in end software. The best we