QuickOp - A basic operation GCODE generator

For the longest time, I’ve really wanted to build some kind of free and open source application to give back to the open source community. Unfortunately, every idea I’ve ever had was either already done way better than I ever could, or was far too niche to justify continued development. Then one day as I was manually entering GCODE moves to face a piece of pine, I decided to write a JavaScript function to auto generate the repetitive moves. That’s when it hit me, I could write an application that you pass some basic parameters to and it spits out generic, non-model-specific GCODE!

I frequently need to prepare my stock using my MPCNC and that usually entails firing up Fusion 360, modeling my rough stock, creating a setup, choosing a tool, setting my facing operation parameters, and exporting the GCODE. This is a giant pain in the butt for me as I’d much rather just key in the parameters and generate some GCODE moves that don’t really need to worry all that much about the actual model itself.

Enter QuickOp: https://github.com/KasimAhmic/QuickOp

QuickOp aims to be multiple things:

  1. Simple. I want people to be able to key in their parameters and be off to the races. No CAD, no CAM, just GCODE.
  2. Hackable. I want to build a solid foundation so that anyone can create additional operations with minimal (hopefully none) futzing around with boring things like logging, writing to a file, calculating stats, etc.
  3. Reliable. The GCODE that QuickOp spits out should be safe to use on any machine and should be consistently good with any set of arbitrary (but reasonable) parameters.
  4. Pluggable. QuickOp is being developed more so as a library than anything else at the moment. I want people to be able to include it in their projects so they can have a high quality GCODE generator under the hood for basic operations. Think CNC.js with a built-in generator widget for facing, drilling, etc. operations.

QuickOp DOES NOT aim to be:

  1. A replacement for proper CAM software. If you need to mill a 3D relief, or engrave a fancy pants font, use some other CAM software.

All that said, the project really only just started a week ago so it has a LONG way to go :slight_smile:. But that’s why I’m making this post; I’d like to get some community feedback early on so I don’t end up developing a mess on top of a mess.

If you’re a developer and are interested in contributing, I’d be happy to take any feedback/criticism you have (or better yet, pull requests :wink: ). Again, I’m trying to develop as high a quality application as I can muster so nothing is too minor to point out!

If you’re not a developer, I’d appreciate any feature requests or suggestions for what you’d like to see in QuickOp. Eventually, I’ll build out a UI for running it in both a browser and locally on your computer so I’ll definitely need ideas for what people want to see there.

A not-very-set-in-stone roadmap for the project is as follows:

  • Finish the Spiral Facing operation
  • Add a Polygon generator (cuts out various shapes)
  • Add proper build and release processes
  • Upload the package to NPM
  • Create a UI for browser usage
  • Port the UI for running on your computer via Electron
  • Look into making a widget for CNC.js

I look forward to any feedback you guys have! Feel free to open issus or pull requests over on the GitHub page: https://github.com/KasimAhmic/QuickOp

Happy milling!

6 Likes

I am not sure if you are aware of my javascript gcode generator.

It looks like you are aiming for something similar, although mine is aimed more at test patterns and less oriented toward ‘useful’ gcode operations. But I do use it to generate surfacing toolpaths for cutting boards. I can even use it on mobile. When I am in the garage I use my phone to operate OctoPrint (on v1pi) and I can use the test pattern generator on my phone, download gcode to my phone, and upload to OctoPrint without going to my desk.

Personally I think the online web usage (and free github hosting) is huge, and would help 1000x in terms of adoption, compared to requiring potential users to have node.js.

You are free to steal any pieces from my gcode generator if you wish. It looks like I didn’t specify a license but you can consider it to be MIT-style, do whatever you want. It’s sort of a dumping ground for my own personal gcode tests and by no means a polished application.

3 Likes

Ah yes, this is awesome! This is more or less what I was going for and you’ve given me a few ideas for additions to my code base, thanks!

I agree that making it browser first is going to increase adoption so that’s why when I get to the UI, I’ll make it work in browsers first before messing around with Electron and the like.

2 Likes

Very neat! There is definitely a lot of opportunity in this space to add value. I was going to mention Jamie’s project, but I also have to mention my project, sandify, which targets sand machines and plotters. So more for art than toolpaths. But it does output (and sort of input) gcode (mostly G1). I spent a lot of time on the intersection code and Bobnik even made some moveable masks that refuse the intersection code. Those might be useful for pocket patterns. There is also a few cases where Bob uses Dijkstra to find the best path between disjointed objects, which may be useful for you. It is licensed MIT.

I also agree with Jamie that there is so much power in web apps. Especially static ones hosted on GitHub. I have tried many times to get dinky applications off the ground, but they require too much support. Having things run in any web browser really moves a lot of barriers to entry.

There are also some projects from Kiri:moto for CAM, which is clearly a different direction (cam for 3D models). And there are a few other pattern generators (mostly aimed at svg for plotting). Work by Mark Roland and Maks Surguy come to mind.

Very cool. This should be a lot of fun for you.

2 Likes

Yeah I haven’t put too much thought into the UI or hosting yet tbh but I think GitHub pages is going to be a good candidate here. I’ve not messed around with it in over 5 years so I’ll need to brush up on how it all works but so long as I can deploy a React application, there should be no problem.

My only concern thus far is performance. JavaScript (or I guess more correctly, TypeScript) is certainly not the ideal language to use for heavy calculation. Python or Java would’ve likely been much better languages to use but then would have required some sort of backend infrastructure to get it off the ground so that’s not exactly ideal atm. So far, the generators I’ve created are all pretty light on resources but they can absolutely be given parameters that will bring browsers to their knees. As an admittedly contrived example, imagine doing 0.001 mm width of cut passes in a facing operation of a 1m x 1m board. My laptop ran out of memory during that test lol

All told, and like you said, I’m having a lot of fun getting these generators working right and overcoming these technical challenges. My only pain point is that I didn’t pay enough attention in my college Algebra and Trig classes :sweat_smile:

1 Like

If you want performance, there is always webassembly. I have done a couple of hello world programs and got opencv working (meaning I did the canned demo). The horsepower is there, and there are no cloud fees.

I had looked into it because someday I want to make a web program that processes an image to TSP art, as a pure web client app, so no cloud expenses and convenient, zero-install for users. Maybe as early as 2026.

1 Like

You can take a look at the sandify GitHub actions. I started with create-react-app and it adds a npm deploy script. I have the actions set up to test every PR, but only deploy when I make a release.

Webasm seems like magic to me. I have been meaning to try converting some of the sandify slow stuff in it. But JavaScript is work well enough. @bobnik has done a great job reorganizing the redux so the calculations and display aren’t recomputing the same thing.

2 Likes

Michael from TeachingTech just pointed out another g-code generator I was not aware of:

This is aimed at generating for printers but I think this could have some ideas worth stealing for a CNC g-code generator. In particular it has a visualizer that would be pretty handy while you’re picking options or dimensions for your operation.

2 Likes