Line filter for opencamlib

When generating toolpaths with drop-cutter ("axial tool-projection", if you like fancy words) the path ends up being composed of lots of short linear segments. It makes sense to filter this list of points and take out any middle points that lie on a straight line between neighboring points. Here's a first attempt at such a line-filter.

The lower points is the raw output from drop cutter, while the filtered points are offset vertically for clarity. There are 6611 CL-points in the raw data, but only 401 CL-points after filtering.

The next step is to come up with an arc-filter which detects circular arcs in the list of CL-points. All CNC-machines have G2/3 circular arc motion in the principal planes (xy, xz, yz). Then the number of moves will go even further down from 401 points.

This is just something to live with, having chosen the triangulated model approach to CAM. First we have pure and exact shapes in CAD which get tessellated into zillions of tiny triangles, from these we generate a sampled toolpath consisting of lots and lots of points, and finally we filter to get back those "pure" "exact" and "nice" line-segments and arcs.
line-filter

The relevant part of the code looks like this. It might be a bit prettier to use the remove_if STL algorithm? Also, there's no check that p1 actually lies between p0 and p2.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
    typedef std::list<clpoint>::iterator cl_itr;
    cl_itr p0 = clpoints.begin();
    cl_itr p1 = clpoints.begin();
    p1++;
    cl_itr p2 = p1;
    p2++;
    for(  ; p2 != clpoints.end(); ) {
        Point p = p1->closestPoint(*p0, *p2);
        if ( (p- *p1).norm() < tol )  { // p1 is to be removed
            p1 = clpoints.erase(p1);
            p2++;
        } else {
            p0++;
            p1++;
            p2++;
        }
    }

full code here.

Pikanto nr2-rig sailing

Had a chance to sail the PIKANTO in nr2 rig conditions today with pretty good results. More comments to follow later...

Note to self: ran out of Malin Stainless Steel Leader, 80 lbs, which we use for stays and shrouds. Must buy more. Are there any other fishing wires that are good for IOM stays/shrouds?

Looks like they have Malin here: http://www.tackledirect.com/malinleader.html

Radians vs. DiamondAngle

Over at Freesteel, Julian talks about using a "DiamondAngle" in the interval [0,4] for representing a plane angle instead of the usual radian in [0,2PI]. The argument is that using diangles there is an exact floating-point number for north/south/east/west, and that conversion to/from diangles is faster because it doesn't involve calling trigonometric functions.

I did a test with this, converting 10 million uniformly distributed radian angles to/from unit-vectors, and ditto for diangles. Converting diangles to unit-vectors is ca 25% faster than calling sin() and cos(), while the reverse transform is almost 3x faster than calling atan2. Runtimes in seconds below:

compare radians to diangles
cos/sin 1.13
atan2 0.78
dia2vec 0.83
vec2dia 0.27
Download code(diangle_test.cpp) and cmake-file(CMakeLists.txt).
I will use a diangle to specify a position on the ellipse, for the offset-ellipse solver, which is central to the edge-drop function of drop-cutter for toroidal tools.

Lathe tool-post and tools

My order from RDG tools arrived today. The quick change tool post if T00, or Myford-size, for 12 or 12.7 mm tools, and included three holders. I also got a pack of five extra holders for a total of eight. There's a set of seven 12mm carbide-insert turning tools, and an internal threading tool for metric (60 degree) threads.

toolpost_and_tools

The order with ER11 and ER25 straight-shank collet chucks including sets of collets from CTC hasn't arrived yet. Since it comes from Hong Kong it will probably go through customs and I will have to pay VAT...

Links - 2010 Jul 1

Lathe parting tool

I've ordered a bunch of tooling from RDG (http://www.rdgtools.co.uk/), Chronos (http://www.chronos.ltd.uk/), and CTC (http://www.ctctools.biz/) for the lathe. There's at least one more of these deep-discount tool stores: http://www.arceurotrade.co.uk/. These stores sell tools of mostly Chinese origin, but I think they will do just fine for hobby use, and the price-level certainly is only a fraction of what European tooling costs. If anyone knows more of these let me know!

The first things to arrive were a set of center drills and this Glanze parting tool from Chronos. I've settled on only a "Myford-size" T00 tool-post which has holders for max. 13 mm tools.

Sunday Ten

On average this is 4-hour marathon pace, or 5:40/km, but accelerating towards the end - once the motor warms up it feels quite easy run at 5:30-5:20 pace, at least for 10k at a time...

No long run (which now is defined as ~20k) last week then. Rest is good too...