Most CNC workflows start with a 3D model, which is then passed to CAM software to be converted into the G-code language that CNC machines love and understand. G-code, however, is simple enough that rudimentary coding skills are all you need to start writing your very own programmatic CNC tool paths. Any language that can output plain text is fully capable of enabling you to directly control powerful motors and rapidly spinning blades.
[siemenc] shows us how to use Grasshopper – a visual node-based programming system for Rhino 3D – to output G-code that makes some interesting patterns and shapes in wood when fed to a ShopBot. Though the Rhino software is a bit expensive and thus is not too widely available, [siemenc] walks through some background, theory, and procedures that could be useful and inspirational no matter what software or programming language you’re using to create your bespoke G-code.
For links to code and related blog posts, plus more lovely pictures of intricately carved plywood, check out [siemenc]’s personal site as well.
[via Bantam Tools]
SketchUp.
SketchUp has Grashopper? News to me!
I did do some Ruby scripting in SketchUp many moons ago. And my first Rhino “thing” was done using RhinoScript (which is just VBA). Using the API actually helped me to understand Rhino (well enough to do some damage), since the GUI really just generates calls to the API. For me, the scripting provided an on-ramp that made it easier to learn (writing code was 2nd nature .. wrangling rhino with a mouse and keyboard less so).
FWIW, Antimony is a node-based solid modeller where each component field can contain Python formulas which can reference any field in any component as a variable.
Nice .. I am going to check that out.
Interesting. It sort of looks like a Pythonish interpretation of OpenSCAD, with the output as UML-ish or SQL db design diagrams.
Actually, you can use it without using a single line of code. It can be used entirely node-based. That is what makes it so useful. Now if only *someone* with the tools and skills would compile Windows binaries. :sigh:
This reminds me of some youtube tutorials of using python scripts in FreeCAD to generate CNC Toolpath data.
Did some searching, came up with user sliptonic on youtube.
FreeCAD Path: Custom paths with Python – Part 1
you can use excel and vba to generate things like that.I used it to print 3D bee combs for a beekeper.
There are a number of Python scripts here that make G-code for simple tasks:
https://github.com/linuxcnc/simple-gcode-generators
(Pocketing, engraving, airfoils for foam cutters, that sort of thing)
Or there is a C-like language that outputs G-code:
http://tsemsb.blogspot.com/2010/04/cgcc-gcode-with-c-constructs.html
Or you can just write G-code by hand, I wrote up a fairly mathematical example here: http://bodgesoc.blogspot.com/2016/11/cams.html