Electronics DIY blog

DIY is fun and is food for the brain and spirit. Don't be afraid to learn.



Sunday, October 13, 2013

SketchUp 3D to GCode plugin

Since the CNC build is very slow due to the lack of time to do any real iron working I've turned into an old quest that was still pending.

A year or so ago I started experimenting with the SketchUp API to have some fun and learn something new.
I've never programmed with Ruby before but my C and C# experience made it pretty easy to learn it in no time.
Then I came to an idea. Make a plugin to convert a SketchUp model directly to GCode.
I debated for a couple of months on the API classes to try to see how I would pull this off. Other things came and I put this project aside.
Early this week I decided to pick this up again. After some intense brainstorming to my self I came with an idea that seemed to work. And it did but the process do scan the model involved boolean operations on SketchUp solids (a hole bunch of them actually) and that is a performance killer.
When I increased resolution SketchUp would stall.

NOOOOO... I found a solution and it was too slow. But then the math concepts I learn in high school came to my head and BAZINGA...

Yeah baby...
What I'm showing here are the results of my SketchUp to GCode converter plugin.

This is in a pre-alpha stage right now, so I'm not going to go in to much detail about this, but I can tell you that it works... :-D

Here are a couple of examples (SketchUp model vs NCPlot- this displays the GCode)

SketchUp modelGCode plot
Example 1
Generated GCode - Dual pass mode
Example 2
Generated GCode - Single pass mode
With some small adaptations this can be used to produce plastic printing GCode too.
I'm developing some more features on this.

Stay tuned...

1 comment: