New in-browser CAM: jscut

tbfleming
Posts: 89
Joined: Sat May 31, 2014 12:04 pm

New in-browser CAM: jscut

Post by tbfleming » Sat May 31, 2014 2:01 pm

I got frustrated with MakerCam dragging things around when I click, so I thought I'd try rolling my own CAM in JavaScript. It's very alpha (I started about a week ago), but I've already got it cutting on a Shapeoko at my local makerspace:



It's GPL and it's on GitHib: https://github.com/tbfleming/jscut. I welcome pull requests; it still needs a lot of improvement. I placed a live version at http://jscut.org/.

The wobblyness in the video (the cross on the t should be nearly straight) is from the Y axis; we only have a single Y stepper on it right now.

WillAdams
Posts: 8489
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: New in-browser CAM: jscut

Post by WillAdams » Sat May 31, 2014 7:11 pm

Great!

I added it to the wiki:

|2.5D||[http://jscut.org/ jscut]||Converts SVG files to CNC cutting paths. GPL, source available on [https://github.com/tbfleming/jscut github].

I noticed this in the interface: Curve To Line Conversion --- have you considered instead doing an approximation of Bezier curves using arcs?
Shapeoko 3XL #0006 w/Makita RT0701 Router w/0.125″ and ¼″ Elaire precision collets
Nomad 883 Pro #596 (bamboo)

tbfleming
Posts: 89
Joined: Sat May 31, 2014 12:04 pm

Re: New in-browser CAM: jscut

Post by tbfleming » Sat May 31, 2014 8:04 pm

I'm using a polygon library (http://sourceforge.net/projects/jsclipper/) to do the boolean operations and the offsetting. If there's a similar library that does the same to curved paths then I might switch.

tbfleming
Posts: 89
Joined: Sat May 31, 2014 12:04 pm

Re: New in-browser CAM: jscut

Post by tbfleming » Sun Jun 15, 2014 3:54 pm

A 2.5D CAM needs a 3D cut preview, so I added one! A demo with already-produced gcode is at http://jscut.org/RenderPath.html. The live version at http://jscut.org now includes the preview built in. The GCODE preview uses WebGL.

Image

McOtis
Posts: 80
Joined: Sun Feb 09, 2014 12:21 am
Location: Maryland

Re: New in-browser CAM: jscut

Post by McOtis » Wed Jun 18, 2014 12:25 am

Is there a way to specify cutting direction?

tbfleming
Posts: 89
Joined: Sat May 31, 2014 12:04 pm

Re: New in-browser CAM: jscut

Post by tbfleming » Mon Jun 23, 2014 11:10 pm

McOtis wrote:Is there a way to specify cutting direction?
There is now; I just added Direction to Selected Operation.

PsyKo
Posts: 430
Joined: Thu Aug 30, 2012 8:42 pm
Location: France

Re: New in-browser CAM: jscut

Post by PsyKo » Tue Jun 24, 2014 6:58 am

Nice !

I'm interested about how do the cut preview work ?
Do you calculate the new geometry ?
Does it use some shader ?
Shapeoko #736
Kress 800, Z Axis upgrade, dual Y, 600mm X&Y rails, metal spacers and V Wheels, home switches, 4th axis
Goko - Free CNC Control Software - http://www.shapeoko.com/forum/viewtopic ... 380#p44380

tbfleming
Posts: 89
Joined: Sat May 31, 2014 12:04 pm

Re: New in-browser CAM: jscut

Post by tbfleming » Tue Jun 24, 2014 4:50 pm

PsyKo wrote:Nice !
Thanks!
PsyKo wrote:I'm interested about how do the cut preview work ?
Do you calculate the new geometry ?
Does it use some shader ?
I render it in two passes:
  1. Rasterize path. The GPU runs a pair of shaders to convert the path to a 1024x1024 height map. The shaders throw out the portion of the path that exceeds the stop time, which is controlled by the slider. The height map is a texture; it stores the height in the red channel. The shaders live in rasterizePathVertexShader.txt and rasterizePathFragmentShader.txt.
  2. Render height map. A pair of shaders convert the height map to a triangle mesh and draw them. These shaders live in renderHeightMapVertexShader.txt and renderHeightMapFragmentShader.txt.
The javascript code converts the path to a format that rasterizePathVertexShader.txt can handle.

It reruns the second pass when you rotate the view. It reruns both passes when you move the slider.

lordmundi
Posts: 207
Joined: Wed Jan 01, 2014 4:02 am
Location: Friendswood, TX
Contact:

Re: New in-browser CAM: jscut

Post by lordmundi » Tue Jun 24, 2014 10:50 pm

this is really great. just tried it out. and I really appreciate that you made it open source.

I think between this and easel, there is starting to be some great simple options for web based cam stuff. This is really cool.

I've mentioned this to the easel folks - it would be really need to tie this in with folks' dropbox account. That way they can save their work and come back to it later (in some file format specific to jscut) and also, operations like downloading the gcode could also go straight to their dropbox. If they are running dropbox on the machine that is hooked into their CNC machine - BAM... no file transfers needed - the file will be waiting for them by the time they get in the garage :)

The other reason I mention it is because it is a way to get the web app into a fully functional app level with web storage without jscut.org needing to provide or pay for it.

great stuff. and thanks again for sharing it with the world. keep us updated with changes!

halfnormal
Posts: 227
Joined: Thu Nov 21, 2013 6:44 am
Location: Flagstaff AZ

Re: New in-browser CAM: jscut

Post by halfnormal » Wed Jun 25, 2014 8:02 pm

lordmundi wrote:I've mentioned this to the easel folks - it would be really need to tie this in with folks' dropbox account. That way they can save their work and come back to it later (in some file format specific to jscut) and also, operations like downloading the gcode could also go straight to their dropbox. If they are running dropbox on the machine that is hooked into their CNC machine - BAM... no file transfers needed - the file will be waiting for them by the time they get in the garage :)
If you have a Google drive, this is very simple. Google drive saves files locally to a folder and then syncs to the cloud. Any computer with Gdrive installed can then access the folder locally or in the cloud.

Post Reply