The idea
I'm testing how to put those rules on the CAD model itself. The idea is to check a defect's location and size against the relevant limit and show which rule determined the result.
1Background
Consider a weld that contains several small pores. Its inspection can depend on how large they are, how many there are and how close together they lie. ISO 5817 defines quality levels B, C and D for weld imperfections. The drawing or contract determines which level applies. An image can tell you what is visible, while the rule tells you which measurements to use for the decision.
2What I am building
I'm writing rules for ISO 5817 welds, EN 1371-1 casting inspections and IACS UR W24 propellers. Each rule can apply to a particular group of CAD faces and can check the type, size, count or spacing of defects.
I use the CAD faces to identify which region a measurement belongs to. A region might have a limit on the size of one indication or a limit on the spacing between several. Keeping the rule with the region makes it possible to show the measurements and the clause behind each decision.

In one benchmark test I would keep the images and measured geometry fixed and change only the required quality level. If the relevant limit is crossed, the verdict should change. This tests whether the system uses the inspection rule even when the visual evidence stays the same.
3The benchmark
The turbine-wheel prototype had few examples of real defects. I'm building a benchmark with CAD variants from eight cast, forged and machined part families. I model the defects in the geometry and render each part under different lighting directions.
Modelling a dent in the geometry gives it a measurable depth and lets the highlights and shadows move when the light changes. I vary the surrounding surface finish with the manufacturing process, so a cast surface gives the detector a different background from a machined one.

