Page 1 of 1

Selfcoded Key-Bitting-Calculator (HTML & Javascript)

PostPosted: Sat Jul 04, 2015 11:28 am
by woodpicker
About
Reading http://keypicking.com/viewtopic.php?f=120&t=10132 (Code cutting question), I got the idea to code my own Key-Bitting-Calculator (HTML&Javascript) much like http://kstoerz.com/locksport/bitting/. Since I finally got it done and hijacking threads isn't very nice, I am posting the release in this separate thread.

Features
  • Calculate bitting code from measured depths (metric / imperial system)
  • Calculate depths from bitting code
  • Estimate the most fitting bitting-system for measured depths
  • Create a key-image (Options: shift, profile type(lines / key-like with adjustable cut-angle), adjustable spacing, measure-grid in background(none / metric / imperial), dpi, cut-position-markings, displayable lines for spacing and bitting-levels)
  • Create key-image as SVG, too*
  • Import / export (CSV/XML/SQL) of bitting-system-data
  • Create SQL-commands for export
  • Define your blank-dimensions
  • Code / HTML / SVG / XML should be valid and pretty much human-readable

I am open for feedback / bug-reports

* Does not work with IE

Re: Selfcoded Key-Bitting-Calculator (HTML & Javascript)

PostPosted: Sat Jul 04, 2015 2:25 pm
by macgng
damn that is cool, really like the key image it creates! nice job :D

Re: Selfcoded Key-Bitting-Calculator (HTML & Javascript)

PostPosted: Sat Jul 04, 2015 2:55 pm
by Josephus
I like it. I like your depth charts too, both of them.

This might be worth doing.

*edit, I have wanted a fully automated way to get cutting depths from a picture in one go on my phone. There are websites that do it but giving some random website access to your phone number and key depths feels like a really bad idea.

Re: Selfcoded Key-Bitting-Calculator (HTML & Javascript)

PostPosted: Mon Jul 06, 2015 8:30 am
by woodpicker
Nice to hear, that it is used.

Doing apps could be nice, but since smartphones have browsers, too, I can't see why one would need one. Maybe it is just because I barely use my smartphone, so idk. I just tested it with Android 4.0.4: Kind of like IE - renders the image and calculates as wanted but svg-rendering fails and download of canvas is not possible. Maybe my code is bugged, will have to see about that.

About the image analysis:
I totally agree about sending images to servers. Could you post some links to the websites you are refering to? I am curious how they did it / what features they have.

The way one could try to do it with html/javascript would use input(type="file") for loading local images with js and draw it into a canvas. After that it one *should* have access to the pixel-data to try autodetecting(edge detection probably) the key. Otherwise one would need to manually mark cuts and the back of the key (don't know the proper term) and most likely have some scale in the background.
And that manual case is far away from being a
fully automated way


The only other option I can see is to do it properly with java, though I personally like web-technology more(bytecode / binaries can't be checked on the fly like javascript). Apart from that I have no experience with creating apps so some research would have to be done first.

Re: Selfcoded Key-Bitting-Calculator (HTML & Javascript)

PostPosted: Mon Jul 06, 2015 10:56 am
by jeffmoss26
Very cool!!

Re: Selfcoded Key-Bitting-Calculator (HTML & Javascript)

PostPosted: Mon Jul 06, 2015 6:33 pm
by Josephus
https://keysduplicated.com/

https://key.me/

I wish I could be of any help, but the only coding I do is not user-friendly at all. Command line or remote admin stuff. I'd just end up throwing an image through OpenCV to present a list of cutting depths and call it good enough :D

Re: Selfcoded Key-Bitting-Calculator (HTML & Javascript)

PostPosted: Tue Jul 07, 2015 12:25 pm
by woodpicker
Can't figure out how they would do the analysis, most likely my math that gets me stuck. Btw: Nothing wrong with command-lines, toolchaining rules :D !

Status-Update
  • IE-Bugs (Canvas-download, SVG-rendering) halfway fixed, somewhat ugly but works
  • Image-analysis prepared, have to fill in the calculation, test-gui works for now.
  • Succesful (at least it looks fine) experiments with 3d-models. See the attachments, the script creates .jscad-files for use with http://openjscad.org/. One can export them to stl / amf / x3d there.

The best part is that http://openjscad.org/ is capable of union() and intersection() which means we could "cut out" our raw-key to fit a lock. Provided one has a cutting-shape, but that should be doable (manuall / tool for images), too.
I don't know about scale with 3d-printers though, since I don't own one and I never did anything CAD-like.

Re: Selfcoded Key-Bitting-Calculator (HTML & Javascript)

PostPosted: Mon Jul 23, 2018 1:37 pm
by VRMAD1
Let me know if you would be interested in developing a commercial version of this software with extended capabilities. I am looking for a consultant to help us develop a service around this type of application. We have an initial prototype implemented in Python by another developer and a preliminary mechanical enclosure design. You could work on the project remotely. Let me know what you think...

Re: Selfcoded Key-Bitting-Calculator (HTML & Javascript)

PostPosted: Tue Jul 24, 2018 3:52 pm
by castle 2
I would do "enter your credit card details here" things to the first attractive young female who coded an ANDROID friendly software offering to this cause, and (should it{rather inconceivably, I couldn't imagine for a MOMENT that it WOULD be}-)- a chap who coded such a magical gift, I would possibly consent to to them imagining themselves in my (hopefully not still-being-WORN-) shoes for the duration of the pre specified arduous chore I have reluctantly agreed to, in the hopes of my obtaining the dreamed for programming...

Lol

Can't say fairer than that

Re: Selfcoded Key-Bitting-Calculator (HTML & Javascript)

PostPosted: Wed Jul 25, 2018 9:37 pm
by chieflittlehorse
Well I don't know how to use this yet, but I'll figure it out.

Been wanting to commercialize my master keying programs but it's only in the Excel spreadsheet format so there's no way I can protect it.

But I can basically use my MK Program with my android as they have the MS Excel app for android.

I guess I'll just keep the program to myself and just sell bitting lists to people who need them.

CLH!

Re: Selfcoded Key-Bitting-Calculator (HTML & Javascript)

PostPosted: Thu Jul 26, 2018 12:49 am
by macgng
i got it to work in Safari, but Chrome had some console errors running the javascript.