Grasshopper

algorithmic modeling for Rhino

In this video, I explain how to setup a Grasshopper definition that will write the G-code for 2D shape milling on a 3-axis milling machine. G-codes are the codes that position the tool and do the actual work, as opposed to M-codes which manages the machine. Actually, there are a whole host of different codes that can be written to control a CNC mill, however G-codes are what we are most interested in for this definition as it will allow us to streamline our fabrication process by sending the parametric data from Grasshopper directly to a CNC mill.

In this example I write the tool path information for a 2D Vornoi Pattern generator, originally written by Sang Hoon Yoon. You can find his vornoi diagram definition on his site www.sac3.blogspot.com. This video explains how to use your data-structure (trees) to help weave together various text strings which control how the CNC mill head will operate.

I have formated the text strings to work with the open source ShopBot CAM software. This software is excellent for many reason, not least of which is the fact that it's free and has a large online help community... much like Grasshopper. It also allows the user to preview the cut even if their computer isn't connected to an actual CNC mill which can come in handy while testing out your cuts. Syntactically, ShopBot part files are setup slightly differently from traditional G-code which harkens back to the days when cutting files were stored on punched tape and it's format was optimized for brevity. You can find a lot of helpful resources on how to setup ShopBot part files in their Programming Handbook.

Views: 637

Comment

You need to be a member of Grasshopper to add comments!

Join Grasshopper

Comment by Chris Booth on September 30, 2020 at 8:27am

Hi again Andy - thanks for the quick reply and the links.

Very interesting - a great starting point for what I'm looking into. And I appreciate the 'name dropping' also!

In the surface video, strictly speaking you write into your (ShopBot) g-code the X,Y and Z coordinates of points on the actual surface, as opposed to the X,Y and Z coordinates of tool centre point coordinates necessary to reproduce the surface given the choice of tool.

But I'll get to that later - it doesn't stop your videos being the best explanations I've seen so far of how to get useable CNC code directly out of grasshopper. And thank you for that.

Comment by Andy Payne on September 30, 2020 at 7:27am

Hi Chris. You can find those two videos on my vimeo feed. https://vimeo.com/5796091 and https://vimeo.com/5813488

Comment by Chris Booth on September 30, 2020 at 4:58am

Hi Andy - I'm trying to get to the bottom of how to get useful g-code out of Rhino and Grasshopper.

I would like to watch this '2D shape milling' video and also your 'surface milling' video, but they don't seem to be here anymore! 

Comment by Andy Payne on March 30, 2014 at 9:16am

Hey Sam,

That definition was written quite a long time ago, and I'm not sure if it would even work now with the current version of GH.  But, there's a similar scritpt I wrote more recently and does essentially the same type of stuff and the definition is heavily annotated.  You can find the script here: http://www.liftarchitects.com/index/#/surface-patterns/  Hopefully this helps.  Post images if you get it working for your application :)

Comment by Sam Ng on March 30, 2014 at 12:37am

hi Andy, would you mind sharing the GH g-code file? I would like to try to generate g-code from Grasshopper and let my CNC router to do the job.

Comment by Kyle VK on November 18, 2011 at 7:11pm

Have you done any 4 axis gcode work in grasshopper? or gcodes aimed towards hotwire cutting?

thanks and great video!

About

Translate

Search

© 2022   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service