Accurate registration and alignment of scan data is critical for worn-region modelling and repair in a variety of industries, particularly turbine blades, blisks and aerfoils. This can also include identification and machining of rest-material for CAM tool path generation.
This blog, demonstration and accompanying code example show how Polygonica can be used to automate accurate scan alignment to isolate regions for tool path planning.


Note that the models used and results created should be considered proof-of-concepts, intended to demonstrate how Polygonica's supported APIs can be used. In particular, no attention has been paid to creating additive paths that optimise welding properties such as isotropic strength.
Additive repair workflow
Although Polygonica has a full pipeline for creating good quality meshes from scan data, in many cases the scanners used in industries such as aerospace and energy will create a reasonable quality mesh directly from the hardware - so for this example we'll take that as our starting point.
The basic workflow for this demonstration involves:
- automatic repair of the mesh created by the scanner
- aligning the scan of the worn part with the original design part
- computing smooth boundaries of the worn region on the design part
- computing a milling toolpath to remove material in the worn region creating a smooth clean surface
- computing an additive toolpath to add material to fill the volume of missing material
- export the toolpaths to a MachineWorks demo to visualise the results




Automatic mesh repair
It's rare for a mesh from any type of scanner to be completely manifold and free from artefacts. For some operations, such as registration and alignment, this may not matter too much, but for operations such as identifying regions and their boundaries, as well as creating 3D volumes and offsetting, results will be greatly improved if you are working with higher quality mesh data.
Polygonica's automatic mesh-healing has been described by users as 'magic' and forms the first step in many mesh-based workflows, additive repair being no different. Polygonica will automatically make the mesh watertight and manifold, as well as remove self-intersections and foldovers.
Feature-based alignment
Polygonica's alignment algorithms are feature-based. That is they attempt to identify specific features that are common to both the reference mesh and the mesh to be registered. These are then used as the basis for an initial global alignment. This approach has the advantage that accurate and performant registration can be achieved for parts that differ significantly in certain regions e.g. where the part has been significantly worn, or an in-process part where there are large areas that still need to be machined away.
Following the initial feature-based registration, an error-minimisation step occurs, which can optionally be controlled based on prioritisation of important regions of the part and also client-specified threshold values. The result is that very accurate alignment can be automatically achieved.


Computing smooth boundary curves
Polygonica has extensive functionality for working with both regions and curves lying on a mesh surface, and these are used to compute a smoothed boundary of the region to be repaired or machined on the original reference part.
The nearest distance between points on the two parts are compared based on a tolerance such that parts of the scanned mesh which lie further from the reference part than the tolerance are marked as worn regions. These regions can be filtered, with small gaps between regions being filled to join adjacent regions, and small islands being removed as these are most probably caused by noise from the scanner rather than actual wear on the part.
3D polycurves lying on the surface of the part are created from the boundaries of the regions. These curves are both smoothed and offset outwards across the surface to provide a clean boundary of the region in which repairs are needed.
Alternatively, the resulting polycurve create by Polygonica can easily be mapped to a parametric curve in a CAD engine so that it can be used to constrain path generation in an existing CAM system.
Creation of solid volumes
The boundary curve and surface region it contains are used as the basis to create solid volumes representing the space in which 'trimming' is required i.e. the worn surface is first tidied by CNC milling operations. A second volume is created representing the region in which material must be added to repair the part.
These operations make extensive use of Polygonica's advanced Boolean and offsetting algorithms, as well as other supporting functions such as hole-filling, advanced smoothing and surface remeshing.
Subtractive and additive path planning
Although Polygonica is not dedicated to subtractive path planning or CNC toolpath generation, it provides a number of very useful functions in this area for those working with polygon meshes.
For 2D operations Polygonica supports planar slicing and 2D profile operations such as Booleans and offset.
For multi-axis operations Polygonica supports fast 3D offsets, creation of intersection curves (non-planar slicing), constant distance offset of 3D curves across a surface and curve simplification to a tolerance.


Simulation of results in MachineWorks
MachineWorks is a different set of proprietary software libraries, also available from the developers of Polygonica. They are widely used in the CAM industry for fast simulation of both subtractive and additive CNC toolpaths.
For the purposes of demonstration we export the 3-axis and 5-axis paths created by Polygonica to see the results using the MachineWorks simulation engine.



To watch a live demo of the repair process please head to the Polygonica YouTube channel or click the links below.
If you'd like to study the example code used for this blog then please get in touch via the website Contact form.




