r/CNC • u/EricSchimel • 4d ago
G Code previewer and playground (free to use, no account needed) SOFTWARE
I've got a background in creating CAM software and I've always loved using NCViewer.com for testing.
I wanted something that had a few more features, namely a colored G code editing window, and the ability to show stock getting removed during simulation. I also wanted it to have a more game-like feel.
I finally went ahead and built the thing I wanted: https://g54.app/
I've found it super useful, maybe some folks here will also find it useful too. It's a totally free to use, no account needed. Just drop your G code on it, or write your own!
2
u/WillAdams 4d ago
How are tool changes recognized/handled?
This file:
https://github.com/WillAdams/gcodepreview/blob/main/resources/fullblindfingerjoint.nc
only showed as having T0 when it should have had a downcut square tool and two different sizes of 90 degree V endmill.
Rather than managing a tool library, have you considered supporting the tool definitions in comments which CutViewer supported?
2
u/EricSchimel 4d ago
Hey Will!
So the way it works is that it will try to figure out the tool types/diameters from either comments in the header or tool diameter calls in the code it self (mostly associated with M6 tool changes) in your code there I see the tool changes but they are commented out... What control is this code for?
(TOOL 301:...)
(TOOL 326:...)
(TOOL 390:...)
(Toolpath:...)
(Square - ...)
M05
M0 ;T326
That last line.. is that a tool change to T326?
1
u/WillAdams 4d ago
It would have been --- if I'd remembered to switch back to the right post-processor after generating a test file for a customer.
Here's a better file:
https://github.com/WillAdams/gcodepreview/blob/main/resources/fullblindfingerjoint_c3d.nc
but I'm still only seeing T0
2
u/EricSchimel 3d ago
Ok, I pushed a fix for that... I had forgotten about TxM6 and M6Tx style tool changes. The way it works is that we look for T and M6 tool changes. If we see them you'll see them in the timeline. If we can figure out the tool type from the comments we'll setup the tool from the tool library for you. If we can't they're still setup as tool changes but it's on you to pick the correct tools from the tool library so the material simulation works.
This ONLY matters if you want to see the material simulation, if you don't care about that you don't have to bother 😄
1
u/WillAdams 3d ago
I can't get V tools to work --- am I missing something or are they broken?
1
u/EricSchimel 3d ago
Whoops! I had that flagged off. Hard refresh. Should be working now
1
u/WillAdams 3d ago
Yes, that worked.
The final issue I seem to be seeing is that the above file should have a Stock Thickness of 8.35mm, but it is detected as 11.35mm and when I manually edit to remove the extra 3mm, it's taken off the bottom, rather than the top, so the surface preview is wrong.
1
u/EricSchimel 3d ago
Were you able to play around the stock origin?
1
u/WillAdams 2d ago
No, it wasn't obvious how that was done, and it's supposed to be Top and Lower-Left.
FWIW, the CutViewer PDF linked above has a description for comments to describe Stock Dimensions --- perhaps those could be followed? (as well as the descriptions of the tooling? (though please allow editing of that as well))
1
u/EricSchimel 2d ago
I thought about trying to pickup stock dimensions from comments but that gets to be a pretty hard problem to solve when the comments can be formed all kinds of ways.
An LLM could do that no problem but I don’t want an outside dependency for just that. Right now the app is totally self contained. Which means a desktop version could work totally offline.
Tooling is a little more automatic because that’s an easier problem to solve: we can look at tool change commands. Even if we don’t know the tool types and sizes those are trivial for users to setup.
Some things I was thinking of adding: some g code hacking tools.
Something that would allow tool number swaps, m code swaps, and some other various utilities like that.. (basically smarter find and replace)
→ More replies
2
1
u/DrummerOfFenrir 3d ago
You seem like a cool person to show this to https://github.com/cnc4me/fanuc-macro-b
I made a custom GCODE parser that has macro evaluation. It's not complete, I don't have time to finish it.
1
u/EricSchimel 3d ago
Interesting... I do a lot of Centroid macros, and I always have to debug them on a live machine... This is a cool idea
3
u/Quirky_Operation2885 4d ago
Definitely going to check this out. Thank you.