evil-mad / plotink Goto Github PK
View Code? Open in Web Editor NEWCommon files for Inkscape extensions to drive EggBot, WaterColorBot, and similar plotter-type machines
License: MIT License
Common files for Inkscape extensions to drive EggBot, WaterColorBot, and similar plotter-type machines
License: MIT License
Where do I put these libraries?
Into Inkscape User Extensions?
Hello,
I haven't see this convention before at the file level. In ebb_serial.py:
def __init__(self):
ebbVersion = "none"
Is this intentional? This is usually not found outside a Class.
distutils is deprecated; we should find a replacement for LooseVersion in distutils.version, as found in ebb_serial.py.
Typical advise is to use packaging.version.Version
I see that you have provided a lot of inkscape extension files. Thank you very much for your help! But I had a problem. I'm currently using a pancake printer called pancakebot, and I want to make it into an inkscape extension file, I need to extend the function of the plugin, don't need many layers, just need it to draw the line path!
I'm not a programmer, so I talked to programmers around me, and they all said it's hard, they can't make it, I don't know if you can make it, but if you can, you're awesome! You can be the teacher of many programmers!!
This link is the software information for the pancake printer, which is open source.
When comports has an error, we should handle that error gracefully.
Partial traceback:
File "/home/ubuntu/.config/inkscape/extensions/axidraw_deps/plotink/ebb_serial.py", line 57, in findPort
com_ports_list = list(comports())
File "/home/ubuntu/.config/inkscape/extensions/axidraw_deps/serial/tools/list_ports_linux.py", line 102, in comports
for info in [SysFS(d) for d in devices]
File "/home/ubuntu/.config/inkscape/extensions/axidraw_deps/serial/tools/list_ports_linux.py", line 102, in <listcomp>
for info in [SysFS(d) for d in devices]
File "/home/ubuntu/.config/inkscape/extensions/axidraw_deps/serial/tools/list_ports_linux.py", line 48, in __init__
num_if = int(self.read_line(self.usb_device_path, 'bNumInterfaces'))
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
The TypeError itself is pyserial/pyserial#550 and occurs whenever no ports are found on Linux.
maybe add a note about this to the README? (speaking of README suggestions, currently the word "both" is followed by a list of more than 2 things.)
Working with python 3.9 in an interactive session, we can try:
from plotink import plot_utils
segment = [[1,1],[-1,-1]]
bounds = [[0,0], [3, 3]]
plot_utils.clip_segment(segment, bounds)
Which returns (True, [[1, 1], [0, 0.0]])
.
With bounds = [[1e-6,1e-6], [3, 3]]
, we get (True, [[1, 1], [1e-06, 1.0000000000287557e-06]])
.
However, with bounds = [[1e-9, 1e-9], [3, 3]]
, a (seemingly) endless loop can occur that needs to be manually aborted.
Printing out the new segment generated at the end of each iteration yields:
[[1, 1], [1e-09, 9.999999717180685e-10]]
[[1, 1], [9.999999717180685e-10, 1e-09]]
[[1, 1], [1e-09, 9.999999717180685e-10]]
[[1, 1], [9.999999717180685e-10, 1e-09]]
[[1, 1], [1e-09, 9.999999717180685e-10]]
[[1, 1], [9.999999717180685e-10, 1e-09]]
[...]
This is clearly a repeating cycle, driven by comparisons that approach the edges of numeric precision.
Cohen–Sutherland clipping normally resolves in two iterations, and edge cases could can be constructed that take four iterations. To resolve the issue -- which is critical -- it seems reasonable to add a failsafe loop counter, that exits with True
and the current clipped segment after four iterations.
Migrating part of the issue from evil-mad/axidraw#5 :
From the SVG spec: http://www.w3.org/TR/css3-values/#absolute-lengths
the "pt" unit is defined as exactly 1/72 inch. Other units including as "Q", "pc" are not presently recognized when getting document size.
ebb_serial.query
and ebb_serial.command
both have inkex.errormsg
calls that directly print error messages.
Those, in turn are called widely in the various functions in ebb_motion.
For handling a wider variety of use cases, we need to revise these functions so that they no longer directly print error messages.
Possible solutions:
(1) Modify these functions (and those that call them) to return an error message.
(2) Add the functions to a class, such that the error status can be added to a string variable in that class, something along the lines of ebb_serial.error_msg
, that can be accessed by scripts that import ebb_serial.
from plotink import text_utils
text_utils.format_hms(179.999)
Returns:
'2:60 (Minutes, seconds)'
Hi folks!
Would it be possible to tag the commits which correspond to pypi releases?
https://pypi.org/project/plotink/#history
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.