Final-year Geometric Modelling Course

Chapter 12

Applications and techniques

Machining simulation

Checking part programs for NC machine tools is an expensive business for industry. If you just plot the toolpath on a computer screen you may see a few gross errors, but you can't tell very much. Some companies cut wax or foam, but that ties up an expensive machine tool.

Increasingly, geometric models are used.

Each tool movement sweeps out a volume. If you union all the volumes together and subtract them from a geometric model of the blank, you get as a result the object that would be cut. Clearly this needs a set-theoretic modeller, or a b-rep modeller with a set-theoretic input system.

This shows a view of the University of Bath Virtual Manufacturing System machining a cam on a vertical-axis NC mill. This takes the idea of simulation one stage further, and allows the user to control the machines in real time. The computer can play back NC part programs, edit them, or create new ones. The results are new NC part programs, and geometric models of the finished components.


Toolpath generation

What about generating part programs automatically from geometric models of the designs to be made? Clearly this would be much more satisfactory than merely checking the paths to see if they were correct. Unfortunately, toolpath generation is a hard computational problem, though many useful commercial systems exist that will handle most of the difficulties.

Generating toolpaths needs solutions to two problems:

 
1. Offsetting
2. Collision detection
Offsetting

Generally, the centre of a cutting tool needs to move at a fixed distance from the surface that is being cut:

We have already seen one solution to the problem of generating such offset toolpaths in Chapter 4. How might we make an entire offset surface for the centre of the tool to move in? For bi-parametric patches this is tricky.

One way is to compute a set of normal vectors at fixed parametric intervals...

...then to fit a new parametric surface through the points using Lagrangian interpolation.

We can then sample at parameter values t on the original surface and the corresponding t' on the offset surface. Note that these won't necessarily line up, so our error value, e, will always be bigger than or equal to the true error. This is good, because it never gives us false confidence. When we find that the errors are too big, we insert extra normal offset points into the Lagrangian interpolation.

This has the advantage that it offsets a parametric surface to another one (though the second usually has higher degree), but the disadvantage is that the result is only an approximation.

How about offsetting one of our implicit surfaces from set-theoretic geometric modelling? The algebra for this is actually quite easy (in principle), and also easy to understand.

Suppose the original surface is  and the offset we want is  a distance d away from the original surface.

This is what we know:

[1] is the original surface equation. [2] is just Pythagoras on the distance, d; it's saying that the point on the surface R must be d away from P. [3], [4], and [5] are saying that the distance must be measured at right angles to the original surface, P; the partial derivatives together make up the grad of the surface - a vector at right-angles to it.

We can treat these equations as simultaneous and eliminate variables to leave the equation for R. To do this we will probably need to use a computer algebra system that offers equation solution by Gröbner bases. But be warned - this can take the computer a long time. When the answer finally emerges and we plot it we will get:

Equation [2] didn't say which side the offset surface was to be on, of course...

Both the parametric and implicit offsetting calculations will happily generate self-intersecting surfaces, as we've seen before in the course:

This means that the cutter is too big for the concavity into which we're trying to drive it.

Collision detection

Here is a simple example. The flat-ended cutter is machining the lower surface. If, in order to plan the path, only the surface being cut is examined, then the cutter may collide with other parts of the model. With curved surfaces the collision may even be with the very surface that is being cut.

The solution to this is continually to compute the intersection of the cutting tool and the geometric model of the object to be cut. This intersection should always be empty (testing for an empty model is called a null-object test). If it isn't, a collision has occurred. However, all these intersection calculations are an expensive thing to do. Much work has been done on simplifying this (see, for example, Stephen Cameron's work on S-bounds), but it is still a research issue.


Finite-element mesh generation

Here is a finite element mesh for a piston that was generated automatically from a geometric model of the piston by the research group led by Cecil Armstrong. Only a quarter of it is worth bothering with, as symmetries can be used to speed up the calculation for the whole object.

Generating such meshes automatically for any arbitrary geometric model is a notoriously difficult problem. The starting point is usually a structure known as the Voronoi diagram:

This is a two-dimensional Voronoi diagram of 12 points - the diagram is the thick lines. Each point has a Voronoi territory that is the region nearer to the point than to any other. If you connect all points that share a piece of territorial boundary, you get a triangulation of the points that is called the Delaunay triangulation (the fine lines).

You can make a similar structure in three dimensions, and the triangles become tetrahedra. Some FE mesh generators work by covering the surface of the model with points and adding extra ones in its interior, then using all the Delaunay tetrahedra of the points that lie inside the model (all the tetrahedra completely fill the convex hull of the model, so you have to throw some tetrahedra away that lie in concavities) as the mesh. A lot of work has been done on how optimally to distribute the points over and within the model.

Here is an example of Delaunay tetrahedra generated to fill a simple cylinder.

Unfortunately, FE people don't much like tetrahedra as a mesh; they prefer the bricks (or hexahedral mesh) that you can see on the piston picture. This preference is for reasons of numerical accuracy and computational efficiency when the differential equations that the mesh is intended to solve are integrated.

To make such a hexahedral mesh, the medial axis transform of the model is computed. The medial axis transform is very closely related to the idea of a Voronoi diagram, and is indeed often computed from it. It is the locus of all points inside the model that are equidistant from two or more surfaces of the model; it is rather like the Voronoi territorial boundaries. The above picture shows the medial axis (dotted lines) for a cuboid with a cylindrical hole through it.

Given the medial axis transform a series of comparatively simple rules (essentially describing how the mesh blocks join up in the various sorts of corners) can then be used to make a hexahedral mesh. Note that the mesh can be made fine in thin sections, where stresses are likely to be greatest. This is how the piston model was meshed.


Back to: Final-year Geometric Modelling Course Home Page

© Adrian Bowyer 1996