-
Notifications
You must be signed in to change notification settings - Fork 446
Added a QR code generator. #488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I really like the idea. I am not sure if I like the reality of it as much. This huge QR code looks like it take quite a bit longer to engrave than cutting most boxes. But may be there is a way to fix that. We could try to filter out all settings that are unchanged from the defaults. Yes, this makes it more likely that the link will produce something slightly different. Otoh these links won't survive changes to the generator most of the time. I also wonder if there is a better way to render the QR code. Lines are much cheaper than engraved areas. Otoh QR codes are made from areas. So I don't know if one really can cheat there. As for the implementation: This has no business being in drawing.py. The best place is probably |
|
Sorry to destroy your idea of creating an But I see the information/data management problem. |
|
Well, I think an "exact replica" isn't really needed. The link is even more useful than a exact replica as it allows making changes. For exact replicas we could add the git SHA1 of the current commit. I don't think I want to add proper versioning to Boxes.py itself. But with the SHA1 people that really care can run the exact version that was used the first time around. |
|
I was wondering the same things, re: the comical size of the QR code and the versioning of the generator. I like the idea of embedding the SHA1 slug, if you really want to get back exactly. In fact, maybe it's not impossible to create a docker that will happily update itself to whatever revision needed. Might be worth some thought. For the comical size, keeping only things different from the default will shorten it a lot, but maybe not even enough. I think the ideal thing in terms of size is to use a URL shortener like bit.ly or similar. Unfortunately that comes with some infrastructure being somewhere -- either in a commercial service like bit.ly, or somewhere else. Not sure I love the idea of being reliant on some external state somewhere that can be wiped out at the drop of a hat. On the other, other hand, I could definitely see myself printing the QR code onto a sticker instead of engraving it, so the size isn't as critical in that case. |
|
I found a pretty easy to use URL shortener. It would be pretty easy to run and keep a database around. I can't imagine the database would get that big, but who knows. It's easy enough to test out locally with: and |
|
What if there's just a QR code button that downloads the QR code, as opposed to attempting to embed it into the SVG somewhere? Is that better or worse? I just implemented that here , and you can try it live here: https://boxes-hel7lmi2ba-uw.a.run.app/ It still needs to filter out all the default parameters to make a sane-sized qr code. I'd just remove the qrcode checkbox if it makes sense to have a button. By the way, I just learned how to use google Cloud RUN and it seems really cool. I just push to a branch, and it automatically deploys to the |
Yep. And it's dependent on the output format.
What do you mean by 'inserted into the layout'? Do you mean into one of the pieces? In that case, it will be a challenge to figure out how to insert it and choose which piece fits best.
Oh, on the 'laser computer'. Yeah, that's handy. |
9e2f70b to
dcc833c
Compare
|
I reworked the code a bit. Now the qr code generation is roughly in the right place in the code, next to the burn bar. It doesn't yet get the URL and/or the settings. My questions:
Currently, it just outputs a random number so you can see that things change when you reload. Also, you can try it live at https://boxes.crome.org/ |
6ce3c20 to
44a1157
Compare
f88070a to
07a4d1d
Compare
07a4d1d to
c781b65
Compare
|
OK, this still needs a bit more work to craft this into proper commits. But things are already starting to come together. |
|
Nice! I'm out of town at the moment but will check it out when I get back. |
c781b65 to
f1fe22a
Compare
|
Things are now where the need to be. One more round with the buffing wheel and this should be good to go. |
f1fe22a to
f80515a
Compare
|
Ok, last few minor issues/ decisions: Naming |
Hmm, not quite sure what you mean. Wouldn't --qrcode be on cli and .qrcode() be a method?
I just put them there as options to talk about. Both could be useful. Any idea what percent of people use the cli? I'd guess pretty low.
Do we need a separate button at all, or is embedded the only thing really needed. My reason for a download PNG button as opposed to embedded only is to print a sticker, which isn't necessarily simple given a light burn file. |
May be I should write these post when I am already asleep and they would make more sense... As I added a
Yeah, let's just add the http link. Hmm, we could add a command to get the qrcode to the cli. I can look into that, but let's not stress about that now.
Yeah, but showing the qrcode on the screen allows people to snatch it with their phone right away. Some people seem to find it difficult to just save a file from their browser. Otoh I am not sure if I really want two qrcode buttons. The number of buttons to choose from under the generator settings is getting a bit too long. |
f80515a to
48d50cb
Compare
with only the changed parameters
that adds a QR code with the URL or CLI parameters to the drawing
48d50cb to
693e3d1
Compare
|
OK, enough talking... |








Maybe a goofy idea, but I like the idea of creating an exact replica of whatever is in my hand. This pr adds a QR code of the URL (to lightburn output only at the moment)
Downsides:
Upside: