polygon offsetting take 1

I’ve been toying with generating tool paths with javascript for a while now. Until now my workflow for generating gcode (cnc commands) goes something like this.

  1. Roughly sketch and iterate on sticky notes.
  2. When the design appears sound, make it permanent by drawing coordinates in a notebook
  3. convert the coordinates in the notebook to javascript
  4. test in the gcode-simulator
  5. setup the cnc and shoot the gcode over to it

I’m a firm believer of automation, but this workflow is not automated at all! In an ideal situation the design is created on the computer and is iterated on immediately by simulating. When it’s ready, a “go” button shoots the gcode to the cnc.

Sidenote: If you’re curious what one of the gcode generators look like, here’s an example: https://gist.github.com/tmpvar/4975923

Ok, back to the matter at hand.  One of the biggest issues with automatically generating tool paths is calculating tool offsets. There are a variety of ways to do this, but in essence it is ensuring that the rotating cutter does not cross the polygon boundaries that you are attempting to cut out.  This is important, as mechanical parts need to be dimensionally correct.

I’ve made several attempts at getting this working consistently, but there have always been issues with certain types of polygons.  I decided to start over and work up a series of posts describing decisions and current status.  Here we go!


The concept here is pretty simple:

  1. loop through each point in a polygon
  2. get a perpendicular vector to the current line and make its length delta
  3. store a much longer line which is parallel to the original line and positioned at the end of the delta vector
  4. loop through the lines and collect intersections
  5. return intersections

Results (Grey is the original polygon, Green is the polygon offset):


Not bad for 30 lines of code!  There are a few problems though, I’ll be addressing those in the next few days and reporting problems/solutions here.  If you’re interested in following the development of the code you can find the repo over on github: https://github.com/tmpvar/polyoffset 

軟體下載---SolidCAM 2013 SP7

SolidCAM 2013 SP7 | 5.4 Gb
Languages: Chinese Simplified, Chinese Traditional, Czech, Danish, Dutch, English, French, German, Hebrew,
Hungarian, Italian, Japanese, Korean, Polish, Portuguese, Russian, Spanish, Turkish

SolidCAM, the leader in integrated CAM, has released an Servise Pack 07 to SolidCAM 2013, is the most complete and powerful integrated CAM solution for SolidWorks.

SolidCAM provides seamless single-window integration and full associativity with the SolidWorks design model, so you can program your CNC’s directly inside SolidWorks and even watch your toolpaths automatically update when the design model changes. With modules covering lathes, 2.5D milling machines, all the way up to 5-axis and even the most complex Millturns, you simply won’t outgrow SolidCAM.

About SolidCAM Inc.

SolidCAM Inc. is a world leader in advanced tool path generation technology (CAM) running directly inside SolidWorks. SolidCAM features a full line of CNC machine programming software solutions ranging from 2 axis lathes and 3 axis mills to extremely complex multi-axis MillTurn machines and Wire Edm. All products run directly inside SolidWorks and provide the user with a true “SolidWorks look and feel” for ease of use and maximum efficiency. Along with the integrated interface and scalability for new machines, SolidCAM also has its patented “iMachining” that powers users to new levels of productivity and profits, through unmatched cycle time reduction and unrivaled tool life.

visit my blog

Name: SolidCAM
Version: 2013 SP7 build 59593
Home: www.solidcam.com
Interface: multilanguage
OS: Windows XP / Vista / Seven / 8
System Requirements: SolidWorks 2012-2015
Size: 5.4 Gb

Special Thanks Team SolidSQUAD-SSQ

No mirrors please

The advantages of running CNC machines. Drew up the fcg pocket for my AR lower. Just need to add some toolpaths, and I’ll be able to finish my 80% lower in 10 minutes. #ar15 #AR #lower #receiver #fcg #cnc #machinist #igmilitia #molonlabe by nickrows — http://ift.tt/1lhpMO4

Meet the Mill!

On August 2 we held a “Meet The Mill” event at Splatspace for the ShapeOko2 CNC mill/router which we won from Inventables. Inventables had sent us a set of aluminum and walnut bottle openers, and several members and non-members used the Easel design and toolpath software to design the engraving on their bottle openers.

There’s definitely a learning curve when it comes to optimizing bit size and type vs. the design so as to get adequate detail while minimizing milling time, and we made considerable progress during this event.

via Splat Space | Durham’s Hackerspace http://ift.tt/Y6TP0p

Clearing away lots of aluminum today during first operation on these parts. Enjoy the last day of the weekend, those of you who have today off - let’s get ready for another big week! #cnc #cncporn #cncmachining #toolpath #tooling #toolanddie #machining #machinist #instamachininst #manufacturer #manufacturing #aluminum by lakewoodmachine — http://ift.tt/Yl3XTi