fix back in create links

This commit is contained in:
Mario Voigt 2021-10-18 16:52:55 +02:00
parent 62b1968f36
commit f55b36b8a6
2 changed files with 7 additions and 10 deletions

View File

@ -50,7 +50,7 @@
</param> </param>
<param name="keep_selected" type="bool" gui-text="Keep selected elements">false</param> <param name="keep_selected" type="bool" gui-text="Keep selected elements">false</param>
<param name="no_convert" type="bool" gui-text="Do not create output path(s) (cosmetic style only)">false</param> <param name="no_convert" type="bool" gui-text="Do not create output path(s) (cosmetic style only)">false</param>
<param name="breakapart" type="bool" gui-text="Break apart output path(s) into segments" gui-description="Performs CTRL + SHIFT + K to break the new output path into it's parts">false</param> <param name="breakapart" type="bool" gui-text="Break apart output path(s) into segments" gui-description="Performs CTRL + SHIFT + K to break the new output path into it's parts. Recommended to enable because default break apart of Inkscape might produce pointy paths.">true</param>
<param name="show_info" type="bool" gui-text="Print length, pattern and filtering information/errors" gui-description="Warning: might freeze Inkscape forever if you have a lot of nodes because we create too much print output. Use for debugging only!">false</param> <param name="show_info" type="bool" gui-text="Print length, pattern and filtering information/errors" gui-description="Warning: might freeze Inkscape forever if you have a lot of nodes because we create too much print output. Use for debugging only!">false</param>
<param name="skip_errors" type="bool" gui-text="Skip errors">false</param> <param name="skip_errors" type="bool" gui-text="Skip errors">false</param>
</vbox> </vbox>

View File

@ -59,7 +59,7 @@ class LinksCreator(inkex.EffectExtension):
pars.add_argument("--length_filter_unit", default="mm", help="Length filter unit") pars.add_argument("--length_filter_unit", default="mm", help="Length filter unit")
pars.add_argument("--keep_selected", type=inkex.Boolean, default=False, help="Keep selected elements") pars.add_argument("--keep_selected", type=inkex.Boolean, default=False, help="Keep selected elements")
pars.add_argument("--no_convert", type=inkex.Boolean, default=False, help="Do not create segments (cosmetic gaps only)") pars.add_argument("--no_convert", type=inkex.Boolean, default=False, help="Do not create segments (cosmetic gaps only)")
pars.add_argument("--breakapart", type=inkex.Boolean, default=False, help="Performs CTRL + SHIFT + K to break the new output path into it's parts") pars.add_argument("--breakapart", type=inkex.Boolean, default=True, help="Performs CTRL + SHIFT + K to break the new output path into it's parts. Recommended to enable because default break apart of Inkscape might produce pointy paths.")
pars.add_argument("--show_info", type=inkex.Boolean, default=False, help="Print some length and pattern information") pars.add_argument("--show_info", type=inkex.Boolean, default=False, help="Print some length and pattern information")
pars.add_argument("--skip_errors", type=inkex.Boolean, default=False, help="Skip errors") pars.add_argument("--skip_errors", type=inkex.Boolean, default=False, help="Skip errors")
@ -283,15 +283,12 @@ class LinksCreator(inkex.EffectExtension):
length = length - dash length = length - dash
idash = (idash + 1) % len(dashes) idash = (idash + 1) % len(dashes)
dash = dashes[idash] dash = dashes[idash]
if sub[-1] != sub[i] and sub[i][0] != sub[i][1]: #avoid pointy paths if idash % 2:
if idash % 2: new.append([sub[i]])
new.append([sub[i]]) else:
else: new[-1].append(sub[i])
new[-1].append(sub[i])
i += 1 i += 1
if new[-1][0] == new[-1][0]: #avoid pointy paths
new.remove(new[-1])
style.pop('stroke-dasharray') style.pop('stroke-dasharray')
element.pop('sodipodi:type') element.pop('sodipodi:type')
csp = CubicSuperPath(new) csp = CubicSuperPath(new)