Surface quality control is an essential requirement in both additive manufacturing and conventional casting industries. Porosity is one of the most common and harmful surface defects because it reduces fatigue strength, corrosion resistance, and the overall reliability of mechanical components. In this work, I propose a three-dimensional point cloud based approach for detecting surface porosity in additive manufacturing. A line laser scanner is used to acquire high-density point clouds of the workpiece surface. The point clouds are then preprocessed through plane calibration, radius filtering, and a feature-preserving non-uniform simplification method. A multi-scale semantic segmentation model is designed to separate porosity regions from smooth surfaces. The model uses PointNet to extract local high-dimensional features under three distance neighborhoods with radii of 2 mm, 4 mm, and 6 mm, and concatenates these features into a comprehensive descriptor. After semantic segmentation, mean-shift clustering and tangent-plane projection are applied to count the number of defects and compute their cross-sectional area and depth. The proposed method reaches 94.46% training accuracy and 98.15% detection accuracy on an industrial data set. Because the geometric appearance of porosity in additive manufacturing is similar to that in castings, the proposed pipeline can be adapted to sand foundry defect detection.
1 Introduction
Additive manufacturing has developed rapidly in the past decade. It is a bottom-up material accumulation process that creates three-dimensional parts layer by layer. This technology offers many advantages, such as high material utilization, no mould requirement, and the ability to build complex geometries. However, surface quality remains one of the key challenges that prevent additive manufacturing from being widely adopted in safety-critical industries. During deposition and solidification, gas can be trapped in the molten pool and form pores on the surface. These pores are often irregularly distributed, small in size, and difficult to identify with non-contact imaging methods. The same problem is encountered in sand foundry defect detection, where gas holes and shrinkage pores can appear randomly on casting surfaces.
Traditional surface inspection methods include manual visual inspection, ultrasonic testing, X-ray inspection, and infrared thermography. Manual inspection is subjective, slow, and unsuitable for modern automated production lines. Ultrasonic testing requires a coupling medium and large equipment. X-ray inspection is expensive and requires radiation protection. Infrared thermography has moderate cost but is sensitive to environmental interference. With the progress of optical sensors and computer vision, image-based inspection has become the mainstream method for surface defect detection. However, image-based methods have serious limitations for porosity detection. Pores are three-dimensional concavities, and a two-dimensional image cannot accurately represent their depth and volume. Moreover, the lighting condition in an additive manufacturing chamber changes constantly because of the bright arc, spatter, and fumes. Therefore, the stability of image acquisition cannot be guaranteed.
Three-dimensional point clouds solve many of these problems. A point cloud is a set of spatial coordinates that explicitly describes the surface geometry of an object. Compared with a grey image, a point cloud contains richer information about depth, curvature, normal vectors, and local shape. In recent years, the cost of laser scanners has decreased, and the resolution has improved. This makes point cloud based surface inspection feasible in modern factories. I therefore select a point cloud as the main data modality in this study. The developed algorithm can also be applied to sand foundry defect detection because the geometric signatures of gas pores in castings are similar to those in additively manufactured parts.

In this work, a Gocator 2150 line laser sensor is used to capture the surface point cloud of a workpiece. The raw point cloud contains not only the workpiece surface but also the substrate and some outlier points. Therefore, the data must be preprocessed. I first calibrate the scanner position by plane fitting and coordinate rotation. Then I extract the region of interest by analysing the height distribution. After that, I establish a grid-based spatial index to accelerate neighborhood searches. For denoising, I compare bilateral filtering, radius filtering, and statistical filtering, and select radius filtering as the most suitable method. For simplification, I propose a feature-preserving non-uniform method that uses curvature information to distinguish normal regions from possible defect regions. Finally, a multi-scale semantic segmentation model based on PointNet is used to classify each point as normal or defective. The proposed system is fully automatic and can be integrated into an additive manufacturing monitoring loop. The same geometric processing pipeline can be transferred to sand foundry defect detection, which is a long-standing quality control problem in casting production.
2 Related Work and Key Algorithms
This section introduces the key technologies used in the proposed system. Section 2.1 describes the PointNet model. Section 2.2 reviews common point cloud filtering algorithms. Section 2.3 explains spatial index structures that are used to accelerate neighborhood queries. These technologies form the basis of the defect detection algorithm.
2.1 PointNet
PointNet was one of the first deep neural networks that process raw point clouds in an end-to-end manner. The input to PointNet is an n by 3 matrix that stores the three-dimensional coordinates of n points. PointNet has three important modules: T-Net, multi-layer perceptron, and max pooling. The T-Net estimates a transformation matrix to align the point cloud to a canonical orientation. The multi-layer perceptron extracts point-wise features, and the max pooling layer aggregates all point features into a global feature vector.
The T-Net module is a small neural network that outputs a 3 by 3 transformation matrix. The transformation matrix is applied to the input point cloud to ensure rotation invariance. A batch normalization layer is used to normalize the features during training. The batch normalization operation can be written as
$$
y = \frac{x – \mu}{\sqrt{\sigma^2 + \epsilon}} \cdot \gamma + \beta,
$$
where μ is the mean, σ is the standard deviation, γ is a scaling factor, and β is a bias term. The multi-layer perceptron in PointNet is implemented with one-dimensional convolutions. The first convolutional layer maps the 3-dimensional input coordinates to 64-dimensional features. The second and third convolutional layers map the features to 128 and 1024 dimensions, respectively. After max pooling, the output is a 1 by 1024 global feature vector. This feature vector can be used for classification or segmentation.
PointNet has a major weakness: it does not capture local neighborhood information. Consequently, it is not accurate when applied directly to large-scale point cloud segmentation. However, PointNet is an excellent local feature extractor. In the proposed method, I use PointNet on small neighborhoods to obtain local high-dimensional features. This local feature extraction strategy is important for detecting small surface defects such as porosity in additive manufacturing and sand foundry defect detection.
2.2 Point Cloud Filtering Algorithms
Raw point clouds usually contain noise, outliers, and redundant data. Several filtering algorithms are commonly used to improve point cloud quality.
Voxel Filter: Voxel filtering is a down-sampling method. The point cloud is divided into cubic voxels with a user-defined edge length L. For each voxel, all points are replaced by their centroid. The centroid coordinates are calculated as
$$
\bar{x} = \frac{1}{n}\sum_{i=1}^{n} x_i, \quad
\bar{y} = \frac{1}{n}\sum_{i=1}^{n} y_i, \quad
\bar{z} = \frac{1}{n}\sum_{i=1}^{n} z_i,
$$
where n is the number of points in the voxel. Voxel filtering greatly reduces the number of points, but it tends to smooth out small geometric features. This is a serious problem for porosity detection because pores are small and can be destroyed by aggressive simplification.
Bilateral Filter: Bilateral filtering is a non-linear smoothing method. It considers both spatial distance and feature difference. For a point p, the filtered position is
$$
p’ = p + \delta_p \cdot n_p,
$$
where np is the normal vector at p, and δp is a weight calculated from neighboring points. Bilateral filtering preserves edges while smoothing Gaussian noise. However, it is computationally expensive and not effective for random outliers.
Radius Filter: Radius filtering is a direct outlier removal method. For each point, the algorithm counts the number of neighboring points inside a sphere with radius r. If this number is smaller than a threshold t, the point is considered as an outlier and removed. Radius filtering is simple, fast, and effective for point clouds with relatively uniform density. It preserves the geometry of defect regions well because pores still have enough neighboring points.
Statistical Filter: Statistical filtering assumes that the mean distance from a point to its k nearest neighbors follows a Gaussian distribution. If the mean distance is outside the interval μ + nσ, the point is rejected. Statistical filtering is good at removing isolated points, but it can incorrectly remove points in sparse defect regions. Therefore, I select radius filtering as the denoising method for the proposed system.
2.3 Spatial Index Structures
Point cloud data are unordered. To search for the neighbors of a query point, a spatial index is usually required. Three common spatial index structures are octree, Kd-tree, and grid.
Octree: The octree recursively divides a bounding box into eight child boxes. Each node has either zero or eight children. The octree is easy to implement and works well for distance queries. However, the construction time and memory usage are higher than those of other structures when the point cloud is large.
Kd-tree: The Kd-tree is a binary tree that partitions a multidimensional space. In three dimensions, each split plane is parallel to one of the coordinate axes. The Kd-tree can support both k-nearest-neighbor and distance-radius search, but distance search is not straightforward to implement efficiently.
Grid: The grid method divides the bounding box into small cubes with a fixed edge length L. The number of cells in each direction is
$$
n_x = \left\lfloor \frac{x_{\max} – x_{\min}}{L} \right\rfloor + 1, \quad
n_y = \left\lfloor \frac{y_{\max} – y_{\min}}{L} \right\rfloor + 1, \quad
n_z = \left\lfloor \frac{z_{\max} – z_{\min}}{L} \right\rfloor + 1.
$$
The grid method is very efficient for radius search because adjacent points are stored in neighboring cells. The relationship between index structures and search methods is shown in Table 2.1.
| Index Structure | K-Nearest Neighbor | Distance Radius |
|---|---|---|
| Octree | Supported | Supported |
| Kd-tree | Supported | Not directly supported |
| Grid | Supported | Supported |
3 Proposed Method
The proposed method consists of three main stages: data acquisition and calibration, point cloud preprocessing, and semantic segmentation based defect detection. The entire pipeline is designed to be automatic and robust. Although the target application is additive manufacturing, the same pipeline can be used for sand foundry defect detection because porosity appears as concave regions with high curvature in both cases.
3.1 Line Laser Scanning System and Calibration
A Gocator 2150 line laser sensor is used in this study. The sensor emits a line laser and captures the reflected light with a CCD array. The measurement principle is based on laser triangulation. The scanner has a measurement range of 400 mm, a field of view of 158-365 mm, a scanning speed of 170-5000 Hz, and a Z-direction resolution of 0.019-0.06 mm. The main specifications are listed in Table 3.1.
| Parameter | Value |
|---|---|
| Laser line profile points | 640 |
| Measurement range | 400 mm |
| Field of view | 158-365 mm |
| Net distance | 300 mm |
| Scanning speed | 170-5000 Hz |
| Z-direction linearity | ±0.01% |
| Z-direction resolution | 0.019-0.06 mm |
| X-direction resolution | 0.3-0.6 mm |
| Z-direction repeatability | 0.2 mm |
| Working temperature | 0-50 °C |
In practical applications, the scanner is installed beside the welding torch. The installation angle is often not exactly perpendicular to the workpiece surface. The tilt angle ranges from 0.5 to 2 degrees, which causes a height deviation of up to 2 mm at the edge of a long workpiece. To correct this problem, I use the RANSAC algorithm to fit the largest plane of the workpiece. The plane equation is
$$
z = a_0 x + a_1 y + a_2.
$$
After fitting, the normal vector of the plane is L = (-a0, -a1, 1). The angle θ between L and the Z-axis positive vector is calculated. Then the entire point cloud is rotated by the Rodrigues rotation formula:
$$
R = \begin{bmatrix}
1 – \cos\theta + a^2 \cos\theta & b(1 – \cos\theta) – c\sin\theta & a(1 – \cos\theta) + b\sin\theta \\
b(1 – \cos\theta) + c\sin\theta & 1 – \cos\theta + b^2 \cos\theta & c(1 – \cos\theta) – a\sin\theta \\
a(1 – \cos\theta) – b\sin\theta & b(1 – \cos\theta) + a\sin\theta & 1 – \cos\theta + c^2 \cos\theta
\end{bmatrix}.
$$
This rotation restores the horizontal orientation of the workpiece. I tested the calibration method on 30 workpieces. After rotation, the angle between the fitted surface normal and the Z-axis became almost zero, which confirms that the calibration is accurate.
3.2 Workpiece Surface Region Extraction
The workpiece is printed on a substrate. Therefore, the raw point cloud contains substrate points that are not part of the inspection region. I extract the workpiece surface by analyzing the height histogram. The point cloud is divided into bins with a step of 0.2 mm. The number of points in each height interval is counted. For the topmost layer, I search for the first local minimum from high to low. This height is denoted as Hm. To preserve the edge features, I set a margin Ht and compute the actual segmentation height as
$$
H = H_m – H_t.
$$
For the workpieces used in this study, Ht is set to 2 mm. Points below this height are removed. The remaining point cloud contains only the surface to be inspected.
3.3 Grid-Based Index Construction
After region extraction, the point cloud still contains about one million points. To accelerate neighborhood search, I construct a grid index. The bounding box of the point cloud is divided into cubic cells. The cell edge length L is determined according to the search type. For k-nearest-neighbor search, the optimal edge length is estimated as
$$
L = \sqrt[3]{\frac{(x_{\max}-x_{\min})(y_{\max}-y_{\min})(z_{\max}-z_{\min}) \cdot 3k}{2N}},
$$
where N is the total number of points and k is the number of neighbors. For distance-radius search, the edge length is set to L = 2r, where r is the search radius. I compared the grid method with Kd-tree and octree. The grid method consistently achieves the fastest search speed because it avoids the overhead of traversing a deep tree.
3.4 Denoising
After region extraction, some outliers remain near the edges of the workpiece. These outliers are caused by the scanning process and by reflections from the substrate. I compared radius filtering and statistical filtering on the same workpiece. Radius filtering with a radius of 2 mm removes most outliers while preserving the shape of pores. Statistical filtering removes a larger number of points, but it also removes some points in the pore regions. Therefore, I select radius filtering as the denoising algorithm in the proposed system.
3.5 Feature-Preserving Non-Uniform Point Cloud Simplification
Voxel filtering is a common method for point cloud simplification. It replaces all points in each voxel with the centroid of the voxel. I tested this method on a workpiece with a pore. The results show that voxel filtering removes about 90% of the points but also removes about 60% of the pore points. This feature loss is unacceptable for defect detection. To solve this problem, I propose a feature-preserving non-uniform simplification algorithm.
The algorithm first computes the curvature of each point. For a point pi, its neighboring points are found by distance-radius search. The centroid of the neighborhood is
$$
\bar{p} = \frac{1}{n}\sum_{j=1}^{n} p_j.
$$
The covariance matrix of the neighborhood is
$$
C = \sum_{p \in Q} (p – \bar{p})(p – \bar{p})^T.
$$
The eigenvalues of C are λ0 ≤ λ1 ≤ λ2. The curvature of the point is defined as
$$
\delta = \frac{\lambda_0}{\lambda_0 + \lambda_1 + \lambda_2}.
$$
Curvature represents the local surface change. In a pore region, the curvature is significantly higher than on a flat surface. I set a curvature threshold of 0.0015. If the average curvature of a grid cell is smaller than the threshold, the cell is considered a normal region. If the curvature is larger, the cell is considered a possible defect region. In normal regions, all points are replaced by the centroid of the cell. In possible defect regions, the point cloud is down-sampled by random sampling at the original density. The original density ρ is computed as
$$
\rho = \frac{N}{N_{valid}},
$$
where N is the total number of points and Nvalid is the number of non-empty cells. The simplification result compares favourably with voxel filtering. Table 3.2 shows the number of points before and after simplification for different grid sizes.
| Grid size / mm | Total points | Defect region points |
|---|---|---|
| Original | 1072049 | 165 |
| 0.4 voxel | 704938 | 104 |
| 0.6 voxel | 377353 | 74 |
| 0.8 voxel | 198546 | 56 |
| 1.0 voxel | 115339 | 34 |
| 1.2 voxel | 77158 | 26 |
| 2.0 proposed | 62228 | 156 |
It can be observed that the proposed method reduces the total number of points to about 5% of the original point cloud while retaining most of the points in the defect region. This is crucial for subsequent semantic segmentation because the defect geometry remains intact.
3.6 Multi-Scale Semantic Segmentation Model
After simplification, the work surface is divided into normal regions and possible defect regions. The normal regions are directly labelled as defect-free. The possible defect regions need to be further analysed. I propose a multi-scale semantic segmentation model based on PointNet. The model assigns a binary label to every point in the possible defect regions, where the labels are “normal” and “porosity”.
For a point p, I search for neighboring points at three different scales: 2 mm, 4 mm, and 6 mm. At each scale, the number of points in the neighborhood varies. To create a fixed-size input for PointNet, I use farthest point sampling to select 48 points from the neighborhood. If the neighborhood contains fewer than 48 points, the existing points are repeated until the total reaches 48. This ensures that PointNet receives a fixed 48 by 3 input matrix.
Each of the three neighbourhood point sets is fed into a PointNet branch. Each branch outputs a 1024-dimensional global feature. The three feature vectors are concatenated into a single 3072-dimensional vector. The combined feature vector is then passed through a multi-layer perceptron with four layers: 3072, 1024, 512, 256, and finally a 2-dimensional output. A softmax function is used to output the probability that the point belongs to a pore.
The reason for using multiple scales is that pores have different sizes. A small scale captures the local shape of a small pore, while a large scale captures the transition from the pore to the surrounding flat surface. This multi-scale strategy improves the robustness of the model. The same strategy is also effective for sand foundry defect detection because shrinkage pores and gas holes have similar multi-scale geometric characteristics.
3.7 Defect Quantification
After semantic segmentation, the point cloud contains a set of points that are labelled as pores. These points may belong to several separate pores. I use mean-shift clustering to group them into individual defects. Mean shift is a non-parametric density-based clustering algorithm. It starts from a point and iteratively moves to the region of the highest density. For a point pi, the mean shift vector is computed as
$$
M_r(p_i) = \frac{\sum_{j=1}^{n} G(p_j – p_i) w(p_j) p_j}{\sum_{j=1}^{n} G(p_j – p_i) w(p_j)} – p_i.
$$
The clustering process repeats until the shift vector is smaller than a threshold. All points that converge to the same local maximum are assigned to the same cluster. The number of clusters is the number of detected pores.
For each cluster, I find the boundary points by performing a k-nearest-neighbor search in the full point cloud. If a neighbor of a defect point is labelled as normal, the defect point is considered a boundary point. The boundary points are used to fit a tangent plane by least squares. Then all defect points are projected onto the tangent plane. The cross-sectional area of the defect is the area of the projected polygon, and the maximum depth is the maximum distance between the defect points and the tangent plane.
4 Experiments and Analysis
This section presents the experimental results. The proposed method is evaluated on real workpieces produced by an additive manufacturing process. The experimental environment is a Windows 10 64-bit system with an Intel i5-9300H CPU, 8 GB RAM, and an NVIDIA 1080Ti graphics card. The programming language is Python 3.8.
The data set consists of 34 real workpieces with 54 surface pores. I augment the data set by rotation, translation, and scaling. The augmented data set contains 68 workpieces and 108 pores. The training set and test set are split at a ratio of 8:2. Thus, 27 augmented workpieces are used for training and 5 are used for testing. The test workpieces are not included in training.
4.1 Model Parameter Selection
The important hyperparameters of the semantic segmentation model include the optimizer, the learning rate, and the dropout rate. I set the dropout rate to 0.4. I compare the Adam optimizer and the SGD optimizer with learning rates from 0.001 to 0.01. The training accuracy results are shown in Table 4.1.
| Optimizer | 0.001 | 0.002 | 0.003 | 0.004 | 0.005 | 0.006 | 0.007 | 0.008 | 0.009 | 0.01 |
|---|---|---|---|---|---|---|---|---|---|---|
| Adam | 93.15 | 93.05 | 92.96 | 93.35 | 93.55 | 93.95 | 93.15 | 93.45 | 93.75 | 93.55 |
| SGD | 93.54 | 93.63 | 94.10 | 93.49 | 94.46 | 93.17 | 93.32 | 93.65 | 93.54 | 94.18 |
From Table 4.1, the highest training accuracy is achieved with the SGD optimizer and a learning rate of 0.005. The training accuracy is 94.46%. I therefore use these parameters in the final model.
4.2 Overall Detection Results
The trained model is applied to the test set. The detection result is evaluated in terms of the comprehensive accuracy, missed detection rate, and false detection rate. A defect is considered correctly detected if the predicted defect region overlaps the ground-truth defect region. Table 4.2 shows the overall detection result.
| Type | Number of real defects | Number of detected defects | Missed defects | False defects | Comprehensive accuracy | Missed rate | False rate |
|---|---|---|---|---|---|---|---|
| Porosity | 54 | 54 | 1 | 0 | 98.15% | 1.85% | 0% |
The comprehensive accuracy is 98.15%, and the false detection rate is zero. These results indicate that the proposed model is effective for detecting surface porosity in additive manufacturing. The model can also be used for sand foundry defect detection because the same type of geometric anomaly is present in castings.
4.3 Qualitative Results
I tested the proposed method on several real workpieces. In one example, the workpiece contains two large pores. The point cloud acquired by the line laser scanner clearly shows two concave regions. After semantic segmentation, the pore regions are marked in red. The output point cloud correctly separates the pore boundaries from the smooth surface. In another example, the workpiece contains three small pores. The model detects all three pores and preserves their three-dimensional shapes. The depth and curvature of each pore are visible in the segmented point cloud. These qualitative results show that the proposed method can detect pores of different sizes and shapes.
4.4 Quantitative Evaluation of Defect Measurements
To evaluate the defect quantification algorithm, I compare the computed cross-sectional area and depth with manually measured values. Six pores from three workpieces are selected for this experiment. The numerical results are shown in Table 4.3.
| Pore ID | Computed area / mm2 | Manual area / mm2 | Area error / % | Computed depth / mm | Manual depth / mm | Depth error / % |
|---|---|---|---|---|---|---|
| 1 | 6.2 | 6.8 | -8.8 | 2.8 | 2.9 | -3.4 |
| 2 | 11.9 | 12.5 | -4.8 | 2.2 | 2.3 | -4.3 |
| 3 | 13.3 | 13.9 | -4.3 | 3.6 | 3.6 | 0.0 |
| 4 | 14.3 | 14.9 | -4.0 | 3.2 | 3.5 | -8.5 |
| 5 | 6.2 | 6.6 | -6.1 | 2.7 | 3.0 | -10.0 |
| 6 | 10.8 | 11.1 | -2.7 | 2.9 | 3.2 | -9.3 |
The area error and depth error are both within 10%. The manual measurement tends to include the surrounding transition zone of the pore, which is slightly larger than the automatically detected region. The discrepancy is acceptable for industrial inspection. In sand foundry defect detection, the same level of accuracy is sufficient for quality classification and process feedback.
4.5 Search Efficiency Comparison
The grid index is used in all experiments. I compare the grid method with Kd-tree and octree on ten representative workpieces. Table 4.4 shows the time in seconds for k-nearest-neighbor search with k = 20, 30, and 40.
| Workpiece | Number of points | Grid k20 | Grid k30 | Grid k40 | Kd-tree k20 | Kd-tree k30 | Kd-tree k40 | Octree k20 | Octree k30 | Octree k40 |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 566293 | 16.9 | 18.1 | 25.1 | 40.4 | 42.5 | 44.3 | 39.6 | 40.1 | 43.1 |
| 2 | 46112 | 1.5 | 1.8 | 2.6 | 3.3 | 3.5 | 3.5 | 3.0 | 3.0 | 3.3 |
| 3 | 42007 | 1.3 | 1.6 | 2.2 | 3.0 | 3.1 | 3.3 | 2.6 | 2.6 | 2.8 |
| 4 | 416922 | 17.1 | 22.6 | 34.2 | 29.3 | 30.1 | 32.3 | 30.0 | 30.1 | 33.4 |
| 5 | 1087268 | 36.3 | 40.5 | 53.9 | 80.0 | 84.2 | 89.1 | 80.1 | 81.4 | 82.3 |
| 6 | 561303 | 19.4 | 23.7 | 32.0 | 40.7 | 43.2 | 44.9 | 39.3 | 41.1 | 43.0 |
| 7 | 26267 | 1.2 | 1.6 | 1.6 | 1.8 | 1.9 | 2.0 | 1.8 | 1.8 | 2.1 |
| 8 | 509786 | 18.9 | 20.1 | 24.9 | 36.4 | 36.7 | 38.0 | 35.8 | 36.2 | 37.1 |
| 9 | 215413 | 27.2 | 27.1 | 27.2 | 15.1 | 15.9 | 16.3 | 12.6 | 13.2 | 14.5 |
| 10 | 508303 | 18.6 | 20.3 | 23.8 | 35.9 | 37.0 | 38.0 | 32.3 | 35.2 | 35.9 |
In most cases, the grid method is faster than Kd-tree and octree. For workpiece 9, the Kd-tree and octree are faster because the point cloud has a special distribution. However, for the majority of workpieces in this study, the grid method provides the best search performance.
I also compare the distance-radius search time between the grid method and the octree. The results are shown in Table 4.5.
| Workpiece | Grid r=2 | Grid r=4 | Grid r=6 | Octree r=2 | Octree r=4 | Octree r=6 |
|---|---|---|---|---|---|---|
| 1 | 14.7 | 26.7 | 38.5 | 42.1 | 42.8 | 43.9 |
| 2 | 1.7 | 2.7 | 3.8 | 3.2 | 3.2 | 4.3 |
| 3 | 1.3 | 2.3 | 3.2 | 2.9 | 3.1 | 3.2 |
| 4 | 17.5 | 26.7 | 35.7 | 43.0 | 43.5 | 45.1 |
| 5 | 34.4 | 57.7 | 79.2 | 87.2 | 90.1 | 91.3 |
| 6 | 19.8 | 31.3 | 42.8 | 45.5 | 45.9 | 47.6 |
| 7 | 0.7 | 1.3 | 1.8 | 2.9 | 3.0 | 3.8 |
| 8 | 9.6 | 19.2 | 28.8 | 28.8 | 29.2 | 30.8 |
| 9 | 4.2 | 8.4 | 12.6 | 22.2 | 22.4 | 24.0 |
| 10 | 9.7 | 19.5 | 28.9 | 29.0 | 29.3 | 29.9 |
The grid method is consistently faster for distance-radius searches. This is because the grid index can directly locate the neighboring cells of a query point. The octree has to traverse down from the root node for every query, which increases the computation time. Therefore, the grid index is the best choice for the proposed defect detection algorithm.
4.6 Simplification Performance Comparison
I compare the proposed feature-preserving simplification method with the traditional voxel filter. Three workpieces are used in this experiment. The results are shown in Table 4.6.
| Workpiece | Original points | Proposed points | Proposed simplification rate / % | Proposed time / s | Voxel points | Voxel simplification rate / % | Voxel time / s |
|---|---|---|---|---|---|---|---|
| 1 | 26267 | 6640 | 25.3 | 0.09 | 1885 | 7.2 | 0.05 |
| 2 | 566293 | 48578 | 8.5 | 1.79 | 15774 | 2.7 | 1.05 |
| 3 | 565480 | 41051 | 7.2 | 1.11 | 14363 | 2.5 | 0.96 |
The proposed method has nearly the same computational speed as voxel filtering. The simplification rate is different because the proposed method preserves the high-curvature defect regions. In Table 4.7, I compare the number of points in each pore region before and after simplification.
| Pore ID | Original points | Proposed points | Voxel points |
|---|---|---|---|
| 1 | 86 | 86 | 19 |
| 2 | 51 | 50 | 8 |
| 3 | 53 | 50 | 11 |
| 4 | 48 | 48 | 8 |
| 5 | 36 | 35 | 7 |
| 6 | 85 | 85 | 11 |
The proposed method preserves more than 97% of the pore points, while voxel filtering preserves only about 15% to 25% of the pore points. This experiment clearly demonstrates that the proposed simplification strategy is superior for defect detection. In sand foundry defect detection, the same preservation of small pores is important because the defect size is directly used for quality evaluation.
5 Conclusion and Future Work
In this work, I propose a complete point cloud based surface porosity detection system for additive manufacturing. The system includes scanner calibration, workpiece surface extraction, grid-based indexing, denoising, feature-preserving simplification, multi-scale semantic segmentation, and defect quantification. The proposed feature-preserving simplification method effectively reduces the point cloud size while maintaining the geometric details of pore regions. The multi-scale semantic segmentation model based on PointNet achieves a training accuracy of 94.46% and a detection accuracy of 98.15%. The quantitative errors of cross-sectional area and depth are both within 10%. The experimental results demonstrate that the proposed method is reliable and efficient for industrial surface inspection. The method can also be extended to sand foundry defect detection because the geometric characteristics of porosity in castings are similar to those in additively manufactured parts.
There are several directions for future work. First, the current method mainly focuses on pore defects. I plan to extend the model to detect cracks, lack of fusion, and undercut defects. Second, the multi-scale semantic segmentation model can be improved by incorporating more advanced local feature extractors such as PointNet++ or PointSIFT. Third, the scanning and processing pipeline can be optimized to support real-time inspection in an automated production line. Finally, the robustness of the proposed method should be further tested on different materials and different additive manufacturing processes. I believe that point cloud based surface inspection will play an increasingly important role in both additive manufacturing and sand foundry defect detection in the future.
