CAM processing in HTML

Why do CAM processing in HTML and JavaScript?
– Good question, I see several advantages:

  • Works on almost all platforms
  • Can be stored local, on file server or internet (web server)
  • Easy to alter code (just using a text editor – no development platform needed)
  • Can be run directly (does not need to be compiled)
  • User interface and graphics is integrated
  • One single html file is all that is needed (but it looks better with the images)
  • Complete program with images is less then 150kB

The main disadvantage is that the program is quite slow on larger files. But for almost all my jobs it runs fast enough (using chrome).

What exactly does the program do?

– The program simply coverts a neutral polyline- or drill format to cnc code according to your specification. It is up to you to create good paths for the mill, there is no magic going on and you have full control. For 90% of my jobs this program is all I need and it is much faster to work with then full blown CAM programs.

This is a screenshot of the 2D single cut mode.

  1. Paste the polylines in the first text box (generated by this rhino script)
  2. Press sort to reduce travel time
  3. Enter cutting parameters
  4. Press generate
  5. Copy the generated CNC code and paste it in a file for the mill.

Try it here!


The program was written specifically for my equipment. It is very unlikely that your mill is configured exactly like mine. Position of zero, cutting speeds, position of tools etc is likely different. Test the code at very slow speed first to make sure it works with your equipment. Always keep one hand at the emergency switch :)

Please note that each program start by moving to x=0 first. This is to avoid cutting in the tool length sensor. In other equipment this move could easily cut in a clamping fixture or the mill itself. Remove it if you don’t need it!

Running untested code on expensive and powerful machines is always risky. I do not take any responsibility if the machine damage itself or worse, someone.

10 Replies to “CAM processing in HTML”

    1. Not really, for most mills a curve still ends up in as polyline due to stepper motors or digital feedback loops on servo motors. It is actually just a matter of resolution. I can provide a polyline with same or higher resolution than the stepper motor giving the same result as curves. The beauty of this solution is in its simplicity.

  1. How you do the image effect of html image? ^^ Thanks in advance

    1. Quite easy,
      1 – screenshot (screenshot captor) of html file (in crimson edit)
      2 – photoshop transform (ctrl-a + ctrl-t) then drag right side corners together.
      3 – save ;)

Comments are closed.

%d bloggers like this: