Skip to content

Draft: Apply engraving fixes

Closes #3

Closes #4

@dantiel added a few small fixes to gcodetools.

I haven't managed to create a unit test because for me, "Engraving" with "draw calculation paths" enabled raises an error:

Traceback (most recent call last):
  File "gcodetools.py", line 5931, in <module>
    Gcodetools().run()
  File "/home/jonathan/source/inkscape/share/extensions/inkex/base.py", line 147, in run
    self.save_raw(self.effect())
  File "gcodetools.py", line 5882, in effect
    self.options.active_tab()
  File "gcodetools.py", line 4980, in tab_engraving
    node.path = CubicSuperPath([cspm])
  File "/home/jonathan/source/inkscape/share/extensions/inkex/paths.py", line 1456, in __init__
    self.append(item)
  File "/home/jonathan/source/inkscape/share/extensions/inkex/paths.py", line 1512, in append
    raise ValueError(f"Unknown super curve list format: {item}")
ValueError: Unknown super curve list format: [[[529.9167, 430.6593], [529.9167, 430.6593], [529.9167, 430.6593], 0, 0, -1, -1], [[559.8325, 572.5397], [559.8325, 572.5397], [559.8325, 572.5397], 0, 0, -1, -1],  
...

(truncated by me)

I can fix this by changing line 4980 to

node.path = CubicSuperPath([[i[0:3] for i in cspm]])

but someone else familiar with the extension would have to verify that the result is as expected.

Merge request reports