For spherical cutters (a.k.a. ball-nose), the vertex-test (green dots), and the facet-test (blue dots), are fairly trivial. The edge-test (red-dots) is slightly more involved. Here, unlike before, I tried doing it without too many calls to "expensive" functions like sin(), cos() and sqrt(). The final result of taking the maximum of all tests is shown in the "all" image which shows cutter-locations colour-coded based on the type of cutter-contact.
The logical next step is the toroidal, or bull-nose cutter. Again the edge-test is the most difficult, and I never really understood where the geometry of the offset-ellipse shows up... anyone care to explain?
After the kd-tree search is done, I've added an overlap-check which leaves only triangles with a bounding box intersecting the cutter's bounding box for the drop-cutter algorithm. It's seems like a band-aid kind of hack to get it working, I think if the tree-search would be bug free the overlap check would not be needed...
The HD-version of the video is much better, once youtube has finished processing.
I've continued to translate into C++ the old cam-experiments I wrote in C#. The kd-tree search for which triangles lie under the cutter seems to work, and the best way to visualize what is going on is through a video. Trying Vimeo for a change, to see if it's any better than youtube for these CAD/CAM-visualizations, since they advertise HD.
There are 360 original frames captured from VTK, and the original was created with
mogrify -format jpg -quality 97 *.png
followed by (copy/pasted from some site google found for me...)
OK, so the video doesn't really show what is going on with the kd-tree search at all 🙂 . It only shows two toolpaths, one coloured in many colours which is calculated without the kd-tree, and another one (offset upwards for clarity) that is calculated, much faster, using the kd-tree.
This is about my third rewrite of this fairly simple cam-algorithm where the cutter is dropped from above until it touches a triangle. It's now in C++ with Boost-python bindings and with visualization using vtk.
The cutter-location points are calculated by bringing the cutter into contact with the vertices of the triangle (green cl-points), the edges (red cl-points), and the facet (blue cl-points). Then the cl-point with the highest Z-value is selected as the final cutter location. At the white points we did not make contact with the triangle at all.
If you look closely enough, all surfaces in the world are made of triangles, even Tux:
Due to compression, the video might not show enough detail, so here's a screenshot:
I wonder if anyone is still interested in this stuff? Given enough time I would like to develop waterline-paths and an octree-based cutting simulator also. It would help if these algorithms were incorporated in a CAD-program, or someone would develop a GUI.
Number of wires from servo-motor to controller on my lathe build: 19.
1: Motor power U
2: Motor power V
3: Motor power W
4: Hall sensor +5V
5: Hall sensor U
6: Hall sensor V
7: Hall sensor W
8: Hall sensor GND
9: Encoder +5V
10: Encoder A
11: Encoder B
12: Encoder Z
13: Encoder GND
14: +Limit switch Common
15: +Limit switch N.O.
16: +Limit switch N.C.
17: -Limit/Home switch Common
18: -Limit/Home switch N.O.
19: -Limit/Home switch N.C.
The motor currents go through the AMP-connecor, everything else through the 25-pin D-connector.
I'm glad the lathe only has two servos (and a spindle), I would go mad with a 5-axis machine...
We've done the CAD design, CAM-toolpaths, and CNC-machining for a set of RG65 model yacht (looks roughly like this) fin and rudder moulds. They will be shipped to the customer on Monday.
From time to time I get enquiries about making moulds like this, for fins, rudders, bulbs, etc., from people around the world. Usually by people who've gone to a professional mould-shop or cnc-workshop with their drawings, and suffered a bit of sticker-shock when they've seen the quote. For this set of moulds we asked 500 euros, which is not a lot I claim. Production and delivery in one week or less after the final CAD-drawings were available.
If you're interested in CNC-cut moulds in aluminium or steel, please send your ideas, preferably a CAD drawing, and I'll send you a rough quote. Keep in mind that our machine has a working XY envelope of ca 500x200 mm, so no single parts can be bigger than this. There are lots of examples of what we do in this blog, you might like: bumper mould (2010 Jan), Rudder mould (2009 Dec), IOM MDF plug (2009 Feb), Microscope part (2009 Sep), IOM Fin moulds (2008 Jun), Telescope rings (2008 May).
Drilled four holes for AMP-connectors and used a hole-punch to make cut-outs for eight 25-pin D-connectors. The four motor-connectors will provide 3-phase power to the spindle-servo, the X- and Z-servos, and a high-speed live-tool spindle. The servos have three Hall-signals and three(single-ended) or six(differential) encoder signals which will enter the cabinet through the D-connectors. I'm using these since I'll use 25-pin printer-cables for the Hall/Encoder signals. There are eight D-connectors just to provide some room for expansion. Three will be in immediate use for the three servos, one for limit/home switches, and one or two will be used for a jog-pendant. That still leaves three 25-pin connectors unused (tool-changer? tool-length probe? etc.)
In 2006 I made optoisolator cards for the cnc-mill project, but now with the lathe I am using servo-drives and a VFD which mostly already have optoisolated inputs, so I will use these very simple breakout boards instead. There are two pitch-standards for the screw-terminals, an imperial one with a pitch of 5.08 mm (i.e. 0.2 inches), and a metric one with 5.0 mm pitch. These boards are for 5.0 mm.
I put together this small computer which will be used to control the lathe. The components for this kind of box are quite inexpensive: D945GCLF2 motherboard including 1.6 GHz Atom330 CPU, 76 eur Codegen MX31 case including 420W PSU, 46 eur
2Gb DDR2 memory stick, 46eur
Samsung 320Gb HDD, 44eur
Labtec keyaboard + mouse, 17eur