

Despite a rapid growth in decision support software, it still takes a lot of skill, knowledge and experience to understand how best to CNC machine a particular CAD design. It’s not simply a matter of generating a toolpath that produces the correct geometry at the end of the job – setup time, machining time and the physics of tool wear, force and vibrations all come into play.
One of the key starting points in the assessment process is determining what cutting tools can be used, given the size and shape of geometry on the part: pockets, islands, fillets, blends and freeform surfaces with varying curvature.
If you choose a large radius cutter, you can remove more material during each tool motion, but there may be smaller features on the part that you cannot access due to the size of the tool. If you choose a small radius cutter, you can potentially machine those small fillets and pockets, but your machining time is going to increase dramatically. Machining time translates directly into cost.
Polygonica’s new Medial Ball Analysis quickly computes the radius of the maximum sphere that can be fitted at points on the surface, making it easy to determine the maximum curvature of cutting tool that can be used to machine a particular region. Although aimed at parts with many complex freeform surfaces, the algorithm is also very useful for performing a fast assessment of machinability for prismatic parts and regions.
Detecting machinable features
Polygonica’s feature detection is designed to recognise machinable features on the polygon mesh; These include:
- Machined Planes
- Pockets
- Islands
- Holes
- Drilled Holes
- Chamfers
- Fillets
- Embossed text and labels
For each feature a range of parameters is returned, including parametric definitions of the geometry such as depth of pockets, heights of islands and radii for fillets and blends. Based on this information it is easy to decide what radius of cutting tool is needed to machine the feature.
Analysing freeform surfaces
This is all well and good, as far as it goes, particularly for prismatic parts. But many parts also contain freeform surfaces, which don’t decompose gracefully into portions of spheres, cylinders or tori.
How can you determine the optimum cutting tool radii to balance speed of material removal with accessibility on concave freeform surfaces, so minimizing remaining rest material after each cutting pass?
The new Medial Ball algorithm computes the largest sphere that can be fitted at a point on the surface of the part, across a range of sample points along the surface:
Although this doesn’t take into account all the accessibility restrictions that may face a particular cutter / holder combination, it does give an idea of what size of cylindrical ball end cutter can be fitted into the region surrounding a particular point on the surface.
The results can then be fed into auto-quoting algorithms, or displayed using a colour map in order to give a user a quick visual assessment of the types of tools that might be needed to machine the part.


Compensating for a faceted model
One of the difficulties in this type of analysis is that a triangle mesh model is not an accurate mathematical representation of the true surface, but an approximation.
This can affect the computed results. A point selected on a facet can be some distance from the true surface, affecting the values computed for the radius of the sphere that is fitted. Additionally, in concave regions the planar facets themselves introduce local concavities because there is a step change between the face normals of adjacent facets, such that the radius of the medial ball tends towards zero as the queried points approach their shared edge.
In addition, polygon meshes often have small local mesh errors and vertex coordinate noise resulting from the different ways meshes are created and handled in 3D software systems, and transported between them. Polygonica provides best-in-class mesh healing, but even in a watertight, manifold and self-intersection free mesh there can be misalignments in faceting at boundaries and other artefacts that cause challenges for analysis algorithms.
Polygonica provides a number of ways to mitigate such issues.
Polygonica’s feature detection is based on Polygonica’s own surface fitting algorithms, which are very robust with respect to micro features and vertex noise. Additionally, Polygonica provides mechanisms that allow Polygonica’s surface detection to be augmented by information from the CAD model, if it is available.
Polygonica’s medial ball analysis makes a number of adjustments internally to compute the medial ball radius from an estimate of the true surface, as opposed to from the facets directly. This is based on an analysis of the surrounding curvature, but callbacks are provided so the necessary information can be read directly from the CAD model if it is available.
Advantages of a faceted model
The big advantage of using a faceted model for this type of analysis is that it is, in general, much faster - querying lots of position and curvature information from mathematically defined freeform surfaces can become very slow.
Our side by side testing shows that the results Polygonica creates from the facetted representation of the true surface are in most cases very near to the results that can be obtained by using the original mathematical surface itself.
Given a reasonable quality tessellation Polygonica is able to assess curvature well enough for a typical auto-quoting analysis. If ultimate accuracy is required the CAD surface can be used to inform the algorithm, but runtimes will be longer.
Example code is available for a number of BREP-based libraries including the HOOPS Exchange SDK from Tech Soft 3D.


You can see the medial ball algorithm in action in the video below. If you’d like to learn more, or to evaluate Polygonica please don’t hesitate to get in touch.








