A virtual stylus method for non-destructive roughness profile measurement of additive manufactured lattice structures

Surface roughness is traditionally evaluated with contact profilometry; however, these methods are not compatible with complex additive manufactured lattice structures due to limited physical access. For these scenarios, computed tomography (CT) is often used to provide qualitative insight into surface roughness but does not directly yield roughness profile data. This research describes a hybrid approach for the non-destructive quantification of roughness profile data for lattice structures based on the mathematical reconstruction and interpretation of CT data. Formal analyses are applied to propose the theoretical minimum CT voxel size required to characterise surface roughness for a specified sampling length. The method is verified against optical data for nominally flat metallic specimens and applied to metallic and polymeric cylinders fabricated by powder bed fusion and material extrusion respectively. This research also assesses the influence of CT reconstruction thresholding as a process variable and finds that roughness profile data is only weakly influenced by thresholding settings, due to scattering effects at the surface — a novel finding that provides certainty for the industrial application of this method. The ability of the proposed method to accurately characterise the inherent surface roughness of these processes as well as the effect of specimen orientation is thus demonstrated, enabling full geometric characterisation supporting subsequent certification analysis. The method can be algorithmically implemented in combination with the generative design of complex lattice structures to support structural certification requirements.


Introduction
Additive manufacturing (AM) provides unique technical and economic advantages including the ability to fabricate highly complex geometry, compatibility with generative design methods, and the opportunity for inexpensive fabrication of low-volume niche and customised parts [1,2]. These attributes enable the innovative engineering design of highly complex and high-value commercial products, many of which have technical requirements that are fundamentally correlated with surface roughness, including ( Fig. 1): • Medical implants, whereby the interaction between additive manufactured implant and biological tissues is highly dependent on the associated surface roughness. Powder bed fusion (PBF) AM technologies are often applied, resulting in a surface roughness in the micrometre scale; this roughness has been demonstrated to influence bone ingrowth (osseointegration) [3] and interaction with bacterial biofilm formation [4]. • Hydraulic and thermo-fluidic applications control fluid flow and associated heat transfer. These geometrically complex systems are potentially challenging for traditional manufacture, and PBF provides an opportunity for the fabrication of near-net conformal flow structures [5] as well as enabling part-consolidation for reduced risk and cost [6]. These commercial PBF applications require that the roughness aspects and influence on fluid response are measured and accommodated. • Dynamically loaded structures are susceptible to the fatigue failure mode, which is highly dependent on surface roughness [7]. Additive manufactured structures are associated with geometric surface roughness attributes including the effect of layer wise manufacture (resulting in the stair-step profile), adhered powder particles, and AM-specific processing parameters such as laser scan path [8]. The effect of these AM roughness attributes on fatigue response is poorly understood [9].
As highlighted by the above points, the physical characteristics of additive manufactured surfaces and part topologies have unique requirements for surface roughness characterisation. However, acquiring surface measurements using traditional methods requires line-of-sight access which is not possible for many additive manufactured parts featuring overhanging surfaces, internal surfaces, and complex topologies. To address this gap, a method is proposed to characterise additive manufactured surfaces with greater certainty, using existing technologies that are not restricted by line-of-sight. The method is validated against traditional methods for surface characterisation on parts with accessible surfaces and is then applied to more complex geometries. Importantly, the limitations of roughness measurement as relates to the image resolution are examined. Furthermore, investigation of the image filtering reveals a weak dependence of the measured profile roughness across a wide range of thresholding values.

Background on roughness characterisation
To understand the research gap, we first look at current definitions of roughness and their application to AM.

Standard measures of roughness
Surface roughness is formally characterised in terms of the variation in local geometry. Profile measurements are performed along a surface contour,z(x) , whereas areal measures consider a two-dimensional surface projection, z(x, y) . International Standards Organisation (ISO) standard measurements of profile roughness have been defined (Table 1) to characterise roughness aspects of interest over a given sample length, l, including arithmetic mean deviation (R a ), root-mean-square deviation (R q ), peak and valley height (R p ,R v ), and peak-to-valley height (R z ). The roughness of a surface is related to the variations of the surface height which occur at short wavelengths, while medium and longer wavelengths are respectively referred to as waviness and form. Filtering is used to separate roughness variation from the waviness and form. Gaussian, spline,

Medical implants
Thermo-fluidic applicaƟons Dynamically loaded structures Fig. 1 High-value engineering applications with roughness-critical functional requirements. Inset identifies challenging location for roughnessmeasurement (Elsevier permission 5343451242605 [2]) Table 1 Standard profile roughness parameters [10,11] 1 Evaluated over the sample length, l . Alternative standards may use R z to represent an average of ten-point heights 2 Total height of profile, R t , is based off the entire evaluation length rather than individual sample lengths within the evaluation length. Hence, R t ≥ R z

Roughness parameter Profile
Arithmetic mean deviation and their related robust filters are recommended by ISO for roughness filtering. Other filtering methods proposed in the literature include Fourier transforms, wavelet transforms, and singular spectrum analysis [12].

Surface roughness characteristics associated with AM
AM processes introduce multiple new surface textures not previously observed via other traditional manufacturing methods [13]. These include the stair-step effect, AM process effects, design parameter influences, and the material feedstock. For powder bed fusion, these effects include stair stepping, partially melted particles; globules of solidified meltpool [14]; open surface pores; and surface roughness influenced by the local scan pattern and melt pool dynamics. For material extrusion (MEX) specimens, these effects include stair stepping, rounded peaks, relatively deep valleys, and a cusp geometry at the abutment of adjacent tracks [15,16]. Surface roughness parameters can quantify the effect of variation in AM process parameters on manufacturing quality [17], where, for example, lower scan speed and increased power have been observed to reduce R a of the upward-facing surface [18], but increase R a for the lateral surface roughness due to increased balling [14]. Roughness of surfaces produced by AM can be influenced by post-processing. Sun et al. showed that both chemical etching and surface machining reduced surface roughness (R a and R z ) by approximately 70% for PBF Ti-6Al-4 V specimens, thereby increasing strength and extending strain to failure to within the range of mill-annealed samples [19].

Selection of parameters for surface characterisation associated with AM
The surface roughness parameters listed previously in Table 1 are some of the most commonly reported [20]. However, the complexity of additive manufactured surfaces may not be sufficiently described by these parameters. The selection of appropriate roughness parameters to characterise specific surface texture can be achieved through an analysis of variance, and when analysed across multiple length scales also provides the appropriate decomposition scale 1 [21]. The ability for standard roughness parameters to reveal underlying AM attributes is being assessed, including stair-stepping effects [22] and the size and spacing of adjacent tracks on the upper surface of MEX or PBF fabricated parts [23,24].
Filtering methods have been proposed that better quantify deep surface recesses [25] as have non-standard parameters for better representing the quality of additively manufactured surfaces. For example, Cabanettes et al. investigated roughness parameters that are sensitive to metal AM build and postprocessing surface variations [13]. These include surface skewness, S sk , to capture stair-stepping effect; surface fractal dimension, S fd , and root mean square gradient, S dq , of the upward facing surface increase with build inclination; and the profile R sm parameter to measure the spacing of parallel scan tracks. Elsewhere, surface skewness, S sk , indicated valleys due to open pores on the surface of high speed sintered polymer specimens, while kurtosis, S ku , showed sharp peaks and valleys [26].

Roughness measurement
Roughness characterisation is directly dependent on the limitations of physical measurement strategies. This section explores the current state of the art.

Contact and non-contact methods for acquiring surface roughness
There are multiple methods available for measuring surface variation, including tactile and non-contact methods, each having specific attributes to consider. Tactile methods require direct physical contact between the mechanical probe and the surface for measurement. The probe travels along a surface profile, recording vertical deflections. A mechanical filtering effect is introduced on the valleys which is dependent on the size of the probe tip; as the size of the tip increases, contact is made with the highest peaks only [15,27].
There are a variety of non-contact methods for acquiring surface roughness, many of which may be classified as optical methods (involving the visible range of the electromagnetic spectrum). Early optical methods often used fringe methods [28] and examined an area of the surface rather than a single profile. Confocal microscopy, coherence scanning interferometry, and focus variation microscopy are currently amongst the most prominent measurement methods [17,29].
Measurement of surface deviation at higher resolution, including the nanometre scale, requires wavelengths of the electro-magnetic spectrum that are shorter than the visible range of optical microscopes. Newer scanning microscopes including scanning electron microscope (SEM) [30], scanning tunnelling microscope (STM), and atomic force microscope (AFM) offer these finer scale measurements.
The aforementioned non-contact methods provide nondestructive measurement of surfaces to which they have lineof-sight, but they cannot measure internal surfaces such as exist in an additive manufactured lattice structure. Computed tomography is the only viable commercial method for nondestructive evaluation of these internal surfaces [31].

Computed tomography-based methods for surface roughness measurement
Computed tomography (CT) projects high-energy electromagnetic radiation (X-rays) at an object of interest from a range of directions. The object absorbs and scatters a proportion of the incident X-rays, the proportion being dependent on the atomic number of the object's material, its thickness along the X-ray trajectory, and the energy distribution of the X-rays. The transmitted X-rays are then recorded as a transmission image (these images include a perspective angle due to the source position). Reconstruction techniques are then applied to convert the transmission images to a series of greyscale images representing parallel cross-sectional slices. The differentiation and identification of objects and features within these greyscale images are commonly achieved through selection of greyscale levels, known as thresholding. The volumes and surfaces identified by the thresholding can be saved in an appropriate digital format (such as STL -STerioLithography or Standard Tesselation Language; DICOM -Digital Imaging and Communications in Medicine; or 3MF -3D Manufacturing Format) for further processing. Unlike contact or optical profilometry, CT allows nondestructive imaging of internal surfaces; however, roughness is not directly observable in CT data. In response, several methods have been proposed for the evaluation of surface roughness from CT data, including: • Extraction of profile edges of an object from a single 2D slice of the 3D CT data, providing profile roughness parameters, P a , P q , and P t [32]. Figure 2a and b show results extracted from a carefully aligned face-centred cubic (FCC) lattice, providing profiles for a strut's upper and lower surfaces. • Conversion of CT-based STL surface data to point cloud data and then input to a commercial surface characterisation software [33]. The ten steps of the conversion process were trimming, vertex extraction, alignment, deviation check, cropping, elimination of re-entrant features, project to plane, cropping, filtering, and finally areal roughness parameter calculation. Figure 2c and

Limitations of CT to roughness measurement
Despite the opportunities enabled by CT methods, several technical limitations and challenges exist for their application to roughness measurement [34,35]: • Scaling: The magnification factor for detector pixel size to voxel size is determined as the ratio of source-todetector distance (SDD) and source-to-rotation-centre distance (SRD).
-Inaccuracies in SRD is the main source of errors in voxel size [35]. -Focus drift due to tube temperature variation also affects SRD [36].
• Cone-beam/Feldkamp artefacts: For common cone-beam source and flat panel detector arrangements, the projection of the object shifts in both the X and Y directions, so the accurate reconstruction is very sensitive to the alignment of the source, the rotation axis, and the detector [37]. • Practical limitations on resolution: Guidelines for current industrial scanners suggest that the highest possible resolution is 2000 times smaller than the largest width of the sample [38]; this can reduce to 1000 times smaller when scanning to eliminate certain imaging artefacts. • Blurring of images: With the increased magnification associated with placing the object closer to the source comes the increase of blurring caused by the finite size of the X-ray spot [37]. • Beam hardening: The penetration of X-rays through materials reduces with photon energy. So, fewer photons transverse thicker and denser materials making these regions appear duller.
-Image reconstruction algorithms often incorrectly assume linear attenuation causing a cupping artefact, [35], or capping artefact if overcorrected [34], commonly observed at the centre of cylindrical samples. -Dark bands or streaks between two dense objects are another symptom of beam hardening [34]. -Beam filtering removes lower energy photons from the beam, which can reduce the effects of beam hardening [34], but at the expense of reduced intensity and longer scan times.
• Scatter: Coherent (Rayleigh) and incoherent (Compton) scatter contribute to the signal and error of the CT image and particularly at the object boundary [35].
• Partial volume effects: Objects captured in the projection images from some positions and not from others can cause shading artefacts in the image [34]. • Reconstruction of volume data: Algorithms are used to convert projection data into volume data, each with their own benefits and limitations. Filtered back projection (FBP) is relatively fast but lacks corrective measures, while iteration methods enable additional corrections but with time and computational cost [34]. More recently, machine learning has been applied for CT reconstruction [39]. • Processing of volume data: The identification of object surfaces within the volume data can be challenging. Dissimilar materials may be distinguished by change in intensity; however, the change at the interface tends to be broad due to many of the above phenomena. Thresholding to identify surface interface is one of the simplest techniques but may be influenced by local errors [35]. • User preference and experience: Choice of measurement parameters, setup of the workpiece, and expertise in postprocessing influence the results of CT-based dimensional measurement [37].
To reduce errors, master objects with known dimensions can be used to calibrate for voxel size scaling and reduce the contribution of threshold selection to the total dimensional errors [36]. Where accessible, the near coherent beam of a synchrotron X-ray beam can reduce issues relating to scaling and cone beam dispersion common to other systems.
Of the factors identified above, the CT resolution which sets the imaging scaling and the greyscale threshold selected to identify the material surface are perhaps the simplest for the user to control, made at the start and end of the image acquisition process, respectively. The influence of resolution and threshold on the accuracy of surface roughness measurement from CT data will be explored.

Proposed CT-based roughness measurement
CT technology and image analysis methods enable opportunities to acquire roughness measurements of surfaces that do not have direct line of sight or access for a contact profilometer. This is particularly important for complex additive manufactured components, for example, lattice type structures composed of cylindrical strut elements. However, there is a need to better understand the effect of CT data resolution and thresholding on the evaluation of surface roughness. The present work introduces a method for extracting roughness profiles along cylindrical strut elements and then compares the roughness measurements from the CT-based profile with measurements from a microscope using focus variation. In this comparison, the effect of CT resolution and greyscale thresholding on the roughness measurement is explored. Drawing inspiration from the Nyquist Sampling Theorem [40], the impact of CT resolution upon the measured surface roughness is investigated to highlight the limitations of the method with current CT technology. The proposed CT-based roughness measurement, or virtual stylus method consists of several sequential stages to acquire profile roughness from CT data (Fig. 3). These stages are CT image thresholding (Section 3.1), image registration and axis determination (Section 3.2), and image profile extraction, filtering, and analysis (Section 3.3). Finally, the roughness metrics are calculated for the original and filtered profiles (Section 4.4). This proposed method is applied to determine the profile roughness of otherwise inaccessible surfaces of lattice strut element samples fabricated by various AM technologies (these samples are described in Section 6).

Step 1: Image thresholding
The identification of an objects surface boundary from CT images is a critically important step. Each material will scatter specific X-rays energy based on its atomic density, thickness, and surface texture. Thresholding is used to isolating a solid object from the surrounding environment according to the distribution of greyscale values (Fig. 4). The ISO50 method selects the threshold value to be the mean of the air and material peaks [41], while the Otsu method [42] uses cumulative moments of an image's greyscale histogram to better account for the distributions of air and solid material.

Step 2: Axis determination and image registration
Once the image stack is binarized, the cylindrical strut can be isolated (Fig. 5a). This is achieved through the evaluation of the centroid and principal moments of inertia. The strut central axis is identified as the principal axis associated with the minimum principal moment of inertia. Alternatively, the central axis may be determined by fitting a line through centroids of consecutive strut cross-sections. This image registration allows the identification of cross-sectional planes (and associated profiles) at selected angles, θ, around the central axis (Fig. 5c).

Step 3: Image profile extraction, filtering, and analysis
From each generated cross-section image, the profiles are found using the edge detection algorithm presented by Alghamdi et al. [43], with the additional capability of distinguishing the internal and external profile at re-entrant features. The algorithm examines the binary array representing the vertically aligned binarized image composing of ones and zeros. The ones represent solid material, the zeros represent air. At each row, the algorithm finds the start and end of all runs of consecutive ones representing contiguous strut material. Each profile is then filtered using convolution of the Gaussian filter [44] with cutoff, c , to separate the shortwave length roughness from the longer wave length waviness and form (Fig. 6). The end effects region is removed before roughness parameters are calculated according to Table 1.

Step 4: Roughness evaluation
Once the surface profiles are extracted from the images and filtered, roughness parameters, R a , R q , R p , R v , and R z as defined in Table 1, are then determined for each image profile. Where sufficient length is available, the filtered profile can be split into a number of samples with specified sample length, l . Analogous parameters for the unfiltered profile (P a , P q , etc.) and the long-wave (waviness) (W a , W q , etc.) are also evaluated for each cross-section image.

Convergence assessment
In the following subsections, the minimum sample length required to achieve convergence of the profile roughness parameters is investigated (Section 5.1), as is the influence of CT resolution and thresholding upon accuracy and repeatability of roughness parameter calculations (Section 5.2).

Minimum sample length
Given a proxy surface profile z(x) represented by a sinusoidal waveform (Eq. 1), where a is the profile amplitude and the wavelength of the sine wave. The expected values of the profile roughness parameters may be determined by evaluating the integrals provided in Table 1 for a sample length, l.
In the limit, l → ∞ , each of the profile roughness parameters converges to a specific limit value which is either constant or proportional to the amplitude, but independent of the associated wavelength. These limit values for the integrals are also determined when l is a precise integer multiples of . In practical terms, each profile roughness parameter requires a finite minimum sample length for its finite integral to converge on the limit value within a specified tolerance. Table 2 shows the limit value for each of the profile roughness parameters, along with the sample length, measured in wavelengths, required to achieve the convergence tolerance of 10%, 5%, and 1%. R z converges quickest, reaching (1) z(x) = asin 2 x λ its limit value within one wavelength; meanwhile, R p and R v oscillate anti-synchronously to one-another due to a continuously shifting mean line, both returning to the limit value at sample lengths that are integer multiples of the sinusoidal wavelength. R a and R q approach within 5% of their limit values inside of two wavelengths, but take more than five wavelengths to remain within 1% of the limit value. These convergence results indicate a theoretical minimum sample length required to correctly identify the contribution of a single sinusoidal wavelength within each of the roughness parameters.
The results of Table 2 are based on analytical solutions of integral equations within a finite length. The representation of the profile by pixels, as occurs in the processing of greyscale and binary images such as those from CT reconstruction, introduces further limitations on the accuracy of the calculation of the roughness parameters due to the relative resolution of the pixels defining the waveform.

Resolution limitations
To explore errors in profile roughness measurements associated with imaging resolution, the sinusoidal proxy surface profile of Eq. 1 is now considered at different levels of pixelation. The imaging resolution determines the voxel size, V L , and the associated accuracy of this voxelised approximation. Using computational analysis, the resolution required to achieve an acceptable level of measurement accuracy can be determined. An example of the voxel approximation is shown in Fig. 7. Implementing the 50% global thresholding value in a similar manner to other work [45], the voxels with 50% or more of their volume contained inside the profile were classified as solid regions and the remaining classified as void. The error in the voxel approximation characterisation, E R , is quantified by finding the difference between the roughness of the profile, R , and voxel approximation, R * (Eq. 2).
(2) E R = |R − R * | In this analysis, only voxel sizes less than or equal to the wavelength were considered. Figure 8 shows the error climbing to a maximum at V L / = 0.5, where the voxel representation can take the form at a continuous height. Voxel sizes larger than half the wavelength which return an error less than the maximum are caused by aliasing, as the Nyquist Table 2 Profile roughness parameter limit values for roughness profile, z(x) = asin(2 x∕ ) , and required sample lengths (in wavelengths, λ) to achieve 10%, 5%, and 1% errors *R sk at 0.1, 0.05, and 0.01 Fig. 7 Voxel approximation of sinusoidal profile, denoted by solid red line. Voxel length, V L , wavelength, , roughness approximation, R t . * , and true roughness, R t , are defined, where R t = 2 × a, with a being the amplitude of the sinusoidal profile sampling theorem suggests. Previous imaging investigations support this, stating that a resolution approximately half the dimension of features of interest is required in order to accurately represent them [46]. This can be seen in Fig. 8 where no clear trend in the error data exists above V L /λ = 0.5. Therefore, the domain limit was set at V L / =1 to show the aliasing effects. The data was considered to have converged once the error is less than 10%, i.e., E R /R < 0.1.
Surface roughness metrics R a , R q , and R t were used to quantify error as all are commonly reported. R a and R t required V L to be at most 8% of the wavelength to converge, while R q converged when V L was less than 12% of the wavelength. However, the required voxel size to reach convergence as a percentage of the total profile height is listed in Table 3. With the exception of ∕a = 5, each of the roughness approximations in Fig. 8 had converged when V L < ∕10.

Case study -real profiles with re-entrant features
The voxel size analysis used for the sinusoidal wave was then applied to case study profiles extracted from [47]. These profiles were extracted from images representing a 3.6-mm length sample at 0.003 mm/pixel resolution. Error plots based on external and internal surface characterisations for five profiles are shown in Fig. 9a and b, respectively. For external characterisation, if multiple z coordinates exist for a single x coordinate, only the highest point will contribute to the roughness, the same principle as line-of-sight characterisation; see Fig. 9c. For internal characterisation, if multiple z coordinates exist for a single x coordinate, only the lowest point will contribute to the roughness; see Fig. 9d. A re-entrant surface feature is an example where the two methods would yield different results. The total profile height ranges from 59 to 80 for profiles 1 to 5. The roughness values of these profiles obtained using the methods in this paper were within the standard deviation set in the original published work (Fig. 10).
Converged voxel approximations for profile 3 are shown in Fig. 9c and d. The required V L to achieve convergence as a percentage of the profile height across all case study profiles is shown in Table 3. Convergence occurred for R t when V L was 6% and 8% of profile height, for the sine wave investigation and for the external characterisation of the case study profiles, respectively. Theoretically, these two cases follow the methodology of a line-of-sight characterisation. All case study profile errors converged with a larger relative V L than the theoretical sine wave error. For the case study Fig. 8 Measurement error for R a , R q , and R t of sinusoidal profile. Error, E, normalized by the roughness, R, is plotted against voxel length, V L , normalized by wavelength, . Full range of the investigation is shown in the upper figure; for clarity, a smaller range of the same data is shown in the lower figure profiles, R a and R q converged with a larger relative V L when compared to R t . A pixel size approximately 1/7th the R t value was required for the profile parameters R a , R q , and R t to converge within 10% of the values calculated for each curve extracted from profile images.

Analysis and results
To validate the proposed virtual stylus method, a variety of samples were fabricated to represent AM technologies, materials, and geometries of interest, including (Table 4): The additive manufactured specimens (Table 4) were characterised by the proposed virtual stylus method and are assessed according to the impact of threshold values on acquired surface roughness, in comparison with optical methods. These outcomes are used to compare metal PBF and polymer MEX AM roughness attributes and to quantify the roughness of upward and downward facing strut elements.

Roughness assessment of flat dog-bone specimens
To benchmark the CT-based roughness characterisation, focus variation with the Alicona optical profilometer was used to characterise the same regions of interest. The results of both methods have been listed in Table 5 for comparison. The CT data was generated at two resolutions, 10 μm and 5 μm, and then processed using internal and external profiles which differ at open pores, and reentrant features. The external method follows the same principle as a line-of-sight technique, considering the highest points of the surface profile. Conversely, the internal method considers the lowest point of the surface profile. External and internal methods are plotted in Fig. 9c and d, respectively. In the case of 10 µm resolution scans, external and internal methods yield near identical results. At 5 µm resolution, the differences between methods are evident at this level of precision. This demonstrates that 10 µm resolution is not sufficient to capture overhanging and re-entrant features for these samples.
The roughness values obtained from optical profilometer and 5 µm resolution CT data show a high similarity for 50° and 70° samples using both external and internal methods. Ten-micrometre resolution CT roughness data of the same angles tend to underestimate the surface roughness in comparison. This is caused by the higher voxel size of 10 µm scans smoothing out the surface and unable to represent acute features which can then be realized using a smaller voxel size in 5 µm scans. Roughness data from 90° samples does not show the same level of similarity with the optical profilometer characterisation; however, the measurement discrepancy is less in 5 µm data than 10 µm data.

Roughness assessment of metallic solid struts manufactured with PBF
The threshold value influences the identification of the external and internal surfaces of the strut, affecting the principal axes, the measured diameter, internal porosity, and the roughness. To explore this effect, the threshold value of the CT data is applied iteratively through the greyscale range, and at each threshold value, the strut geometry extracted using the method described in Section 4.2, and the profiles roughness determined as described in Section 4.3. From the CT data of a single strut, Fig. 11b shows the effect of greyscale threshold value, G t , on the total material volume and largest connected material volume (designated as the strut) and the pore volume, while Fig. 11c and d show the range of mean diameter, D mean , and roughness, R a , determined from profiles along the strut taken around the strut at a set of angles (θ defined in Fig. 5) in 15° increments. These graphs highlight that there is a significant change in volumes with threshold as the greyscale versus voxel count histogram nears a peak in Fig. 11a. The pore volume given in Fig. 11b remains low as it includes only fully enclosed pores, while the large cavity visibly growing with threshold in the 2D slices is actually an open cavity in 3D, connecting to the external environment outside of the region of interest.
There is a small but observable reduction in the strut volume compared to the total material volume around 110 greyscale value (Fig. 11b), indicating that as the threshold is increased, some material is becoming isolated from the main cluster of material. The diameter (Fig. 11c) and roughness (Fig. 11d) show sharp changes around 140 greyscale, as a result of the external surface profiles splitting as seen in the later binarized images of Fig. 11. An important consequence of these observations is that the roughness is largely unchanging across a significant threshold range while the strut volume is reducing at a greater rate, from both internal and external erosions. The greyscale intensity is higher at the external surface than for the inner material of the strut, likely a result of X-ray scatter at the surface and cupping in the image reconstruction.
It is well known that downward facing surfaces will have inferior roughness to upward facing surfaces. For this reason, we investigate the variation of roughness around the circumference of cylindrical struts. Figure 12 shows R a for each of the nine Ti6Al4V struts. The struts fabricated with inclination of 30° relative to the build plate, i.e., α = 30°, show a large variation in the roughness as it is measured along the axis at different orientations θ (with increments Δθ = 1 5°). The peak roughness aligns with the 0°/180° plane, i.e., the plane with the larger diameter as determined by the middle principal axis of inertia. θ = 180° corresponds to the downward facing surface, while θ = 0° corresponds to the upward facing surface. For the 0.6 mm and 1 mm, the minimum R a is near the side surfaces at θ = 90° and θ = 270°, while the upward facing surface, at θ = 0°, has an intermediate R a . In contrast, the minimum R a for the 0.2-mm-diameter strut is on the upward facing surface. The remaining struts, fabricated at inclinations of α = 60° and α = 90°, have relatively consistent roughness, in the range 0.005-0.015 mm, as measured along the axis at different orientations. The middle principal axis was observed to align with the upward and downward facing surfaces for the α = 30° struts. The roughness on the side surfaces of the 30° struts are similar in magnitude to those measured on the 60° and 90° struts.

Roughness assessment of polylactic acid solid struts manufactured by MEX
The roughness of the inclined printed polymer struts shows characteristics related to the additive manufacturing process. As observed in Fig. 13, PBF struts feature rough surfaces with attached particles, particularly on the downward facing surface. The profile of the MEX struts shows characteristic bulges that are determined by the diameter of the extruded filament. Some profiles highlight deep crevices where there is a lack of fusion within layers and between layers due to the tool path and at the ends of the filament. Figure 14 shows the cylindrical polymer strut unwrapped with the circumferential coordinate linearized to aid visualisation of the radial variation of the surface. For these examples, there is a continuous valley region that is created where the filaments start and align in consecutive layers. A deep valley is visible running the length of the α = 45° sample (Fig. 14c), while a line of shallower and shorter valleys are visible in the α = 90° sample (Fig. 14d); these occur where scan pattern repeats across layers and filament ends align in adjacent layers. Figure 15 shows the profile roughness change with orientation around the PLA struts. Each curve represents a 2-mm nominal diameter strut with different build inclination angle. The largest measured roughness values are seen in the struts with low build inclination. The roughness of the low build inclination struts varies by rotation angle, and this appears to be dominated by the relative position of the start and end of the filament. For these inclined samples, the angular location of the start and ending of the filament is consistent along the length of the strut, so the profiles through these regions show higher roughness than other profiles from around the strut. The higher inclination angles also show this behaviour but to a lesser magnitude.
The horizontally built strut (α = 0°) shows both the highest and lowest roughness depending on the profile orientation around the strut. With its filament layers aligned with the strut axis, those unsupported on the downward facing surface tend to droop and show high roughness as the measured profile jumps between disjointed filaments. Meanwhile, those on the side and upward facing surface provide lowest roughness, with the filaments laying parallel to the strut axis.

Discussion
The proposed virtual stylus method enables traditional profile parameters to be obtained non-destructively; however, the voxelised representation of surface geometry can lead to errors in the accurate measurement of the profile roughness.
Through investigation of profile roughness of a sinusoidal profile with amplitude, a , and wavelength, , it was found for roughness parameters to converge within 10% of the theoretical values of R a = 2a∕ and R q = a∕ √ 2 , that the required voxel size was less than 8% and 12% of , respectively. This voxel size requirement was also dependent on the ratio ∕a < 5.
The relationship between voxel size and error in roughness parameters was investigated using five published profile images. For the real surface profiles, they converged with a larger voxel size relative to the sine wave investigation. This is due to the irregular spacing between peaks and valleys, and also the variation in the extremities of such features. Similar explorations by [48] found that a pixel size less than 1/5th of the mean peak lateral spacing was required to keep measurement errors for R a and R q within 10% of the values measured using optical microscopy.

Practical implications of resolution
The implications of the error, E, with voxel resolution, V L , is that it places additional limits on the range of For low inclination angles, the largest roughness was found near the downward facing surface (approximately 180°). At higher inclination angles, the largest roughness appears on the side of struts (approximately 90° and 270°); these profiles pass through the start and end of the filament with each layer measurable roughness by a given CT system. The preferred sampling lengths for a given range of profile roughness as recommended by ISO [49], and reproduced in Table 6, are presented graphically as vertical lines in the chart of R z versus sampling length in Fig. 16. A shaded region is shown representing interpolation between these recommended ranges indicating possible non-standard sampling lengths. Overlayed with this region are the achievable roughness measurements for the two CT systems used in this work. These lines represent the lower limits based on their specified minimum resolution and detector size (Table 7) and the 10% error convergence. These intersect the recommended shaded region at the upper end of the sample length and roughness range.
Where available, a non-square detector or a helical scan method elongated in the sampling direction could enable a system to extend the achievable sample length bounds.
The minimum voxel size is the main limiting factor for the proposed CT-based roughness measurement method. With minimum voxel size of 1 μm, the smallest reliable roughness measurements using the proposed method are of the order of 10 μm. To improve on this limitation, the use of partial volume methods to provide sub-voxel identification of the surface is likely to bring the smallest measurable roughness closer to the minimum voxel size.

Effect of threshold on measured results
The selection of image greyscale threshold was observed to have a strong influence on the measured specimen volume, but was found to have a lower effect on the measured surface roughness. The greyscale values within the solid were lower than those at the outer surface. Therefore, internal cavities were seen to increase, while the sharpness of the outer surface was less affected. This finding is important in that it shows that the CT-based identification of the external surface provides a margin for threshold selection which does not significantly affect roughness of the external surface. Furthermore, the variability of surface deviation with threshold could be used to aid in the selection of an appropriate threshold value for other purposes.
This CT-based method significantly improves on the optical silhouette profile method developed by Alghamdi [43], which is suitable only for external convex surfaces, with line of sight to the profile, and loses accuracy as the surface curvature is reduced. Furthermore, the measured profile from the silhouette can be influenced by adjacent profile features in a manner analogous to using a broad edge rather than a fine round tip on a tactile probe. With this analogy, it becomes apparent that the silhouette method is best applied at edges and profiles on tight curvatures. In contrast, the proposed CT-based method allows access to any surface profile discernible from the CT data, whether external or internal, convex or concave, effectively recreating a cross-sectional  16 Recommended and achievable profile roughness sampling lengths for example CT systems (given in Table 7). The ISO recommendations for roughness bounds for a given sampling length (Table 6) as well as non-standard ranges interpolated between the ISO recommended ranges. Limitations, due to the minimum voxel size and the detector size for the CT systems used in this paper, restrict measurements to the upper most roughness scales recommended by the standard  [51] slice from the reconstructed volume that is not impeded by line-of-sight requirements, just the appropriate selection of the intersecting plane for defining the profile.

Conclusions
The paper describes the virtual stylus method for evaluating profile surface roughness from CT data. This method enables non-destructive measurement of surfaces that are not accessible by standard tactile or optical methods. The virtual stylus method responds to the commercial requirement for systematic methods to non-destructively acquire roughness data for complex AM geometry in a mode that can be algorithmically applied. The proposed method is demonstrated for solid cylinders as are relevant to high-value AM lattice structures, extracting profiles from the external surfaces within planes revolved around the central axis.
For high-quality CT data, the identification of the external surface and the calculation of its profile roughness change slightly over a range of image greyscale threshold values. This is attributed to X-ray scattering effect at the specimen surface, locally increasing the greyscale intensity at the surface boundary. A secondary observation is that internal surface boundaries are not as sharply defined as external surface boundaries. This is attributed to reduced scattering at the internal surface boundaries and implies that roughness measurements are more reliable for external surfaces than for internal surfaces.
A fundamental study of the effect of CT image pixilation on measured roughness of a sinusoidal profile indicates that to achieve 90% accuracy for R a , R q , and R t , the proposed method requires pixel resolution to be 6% of the total profile height or less. Investigation into pixel resolution of case study profiles, using external characterisation, showed that the roughness parameters R a and R q achieved 90% accuracy when pixel size reached approximately 20% of the profile height. However, R t required the pixel size to be less than 11% of the profile height to achieve the same accuracy. Using internal characterisation did not yield significant changes in convergence limits compared to traditional external characterisation, which follows the outer profile of the surface contour.
The virtual stylus method is limited by the attainable CT resolution, which is determined by the relative distances of the source, object and detector, and by the size and pixel density of the detector array. For current industrial CT systems using cone beam source to distinguish a micron scale surface roughness, these physical limitations restrict the object to millimetre scale. Therefore, the cone beam system is not able to provide fine roughness measurements on larger parts using the current method.
While the method has been demonstrated for flat plates and cylindrical structures, the virtual stylus method is fundamentally compatible with roughness measurements on any surface, including on curved internal surface structures, such as conformal cooling channels. The method can also be extended to accommodate areal roughness parameters for surfaces with larger area and less curvature than the small cylindrical samples investigated in this study.