dapperfu / inkscape_LaserGCode2

Inkscape -> GRBL Laser GCode
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

NameError: name 'P' is not defined #2

Open maxim-kukushkin opened 3 years ago

maxim-kukushkin commented 3 years ago

I followed the instructions in the readme file and cloned inkscape_ExtensionDevTools and inkscape_LaserGCode2, but on execution of the plugin in Inkscape I'm getting the following stack trace:

Traceback (most recent call last):
  File "/home/myuser/.config/inkscape/extensions/inkscape_LaserGCode2/laser2.py", line 1766, in <module>
    laser_gcode().run()
  File "/usr/share/inkscape/extensions/inkex/base.py", line 140, in run
    self.save_raw(self.effect())
  File "/home/myuser/.config/inkscape/extensions/inkscape_LaserGCode2/laser2.py", line 1759, in effect
    self.laser()
  File "/home/myuser/.config/inkscape/extensions/inkscape_LaserGCode2/laser2.py", line 1603, in laser
    layer_curve = self.parse_curve(p, layer)
  File "/home/myuser/.config/inkscape/extensions/inkscape_LaserGCode2/laser2.py", line 793, in parse_curve
    curve.append(biarc(sp1, sp2, 0, 0))
  File "/home/myuser/.config/inkscape/extensions/inkscape_LaserGCode2/laser2.py", line 535, in biarc
    P0, P4 = P(sp1[1]), P(sp2[1])
NameError: name 'P' is not defined

Looking through the source code it's indeed not clear where P is supposed to come from. Perhaps there's some dependency that I'm missing?

OS: Arch Linux (latest packages at the moment of submission of the issue) Python: 3.9.1 Inkscape: 1.0.1

dapperfu commented 3 years ago

Looking at my last commit I cut out a lot of dead code and didn't check it well. This is a slow burn project aimed at teaching me Inkscape/GCode.

The project it was forked from now has a github, it should still work:

https://github.com/JTechPhotonics/J-Tech-Photonics-Laser-Tool

There is also this project: https://github.com/ChrisWag91/Inkscape-Lasertools-Plugin

maxim-kukushkin commented 3 years ago

aah, I see. Thanks for the info!