Additive Manufacturing Project
Part A
Report
Submitted By:
Anoop Kumar Singh (M24MEA001)
Sanidhya Mishra (M24MEA014)
Under the Esteemed Guidance of:
Dr. Rajit Ranjan
Advanced Manufacturing and Design
Department of Mechanical Engineering
Indian Institute of Technology Jodhpur
Submission Date: 12 September, 2025
Abstract
This report presents the development and implementation of a MATLAB-based integrated
toolkit for analyzing an STL model under the Additive Manufacturing course (MEL7330). The
toolkit encompasses STL model import, 3D visualization, and layer-by-layer slicing to compute
accurate cross-sectional areas. These results are employed to estimate build time, energy re-
quirements, and material consumption. Overhang analysis (with a 45° threshold) is performed
to identify self-supporting and support-requiring surfaces, and the total support area is quantita-
tively evaluated. Additionally, rigid body transformations (rotation and translation) are applied
using homogeneous matrices, highlighting the significant impact of transformation order on the
final geometry. The part volume is estimated using two complementary approaches—facet-based
integration and voxelization. The voxel-based approach is particularly effective in quantifying
the volume of support structures and their ratio to the total build volume. The developed
framework integrates key capabilities such as STL preprocessing, geometric transformations,
slicing, area and volume computation, support analysis, and visualization into a single pipeline.
To reinforce numerical outcomes, placeholders have been reserved for relevant figures, graphs,
and screenshots throughout the report.
1
Contents
1 CAD File Selection and Justification 3
1.1 Selected CAD Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Justification for Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 MATLAB Implementation and Results 4
2.1 Reading the STL File and Facet Information . . . . . . . . . . . . . . . . . . . . 4
2.2 Slicing Operation and Visualization . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 Build Time Estimation via Cross-Sectional Area . . . . . . . . . . . . . . . . . . 5
2.4 Support area requirement (45° threshold) . . . . . . . . . . . . . . . . . . . . . . 6
2.5 STL translation and rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.6 Part Volume Estimation (Facet-Based) . . . . . . . . . . . . . . . . . . . . . . . . 7
2.7 Supports from Autodesk Meshmixer (Reference) . . . . . . . . . . . . . . . . . . 7
2.8 Fully solid supports using voxelization . . . . . . . . . . . . . . . . . . . . . . . . 8
3 Discussion and Conclusion 9
A MATLAB Code 10
2
1 CAD File Selection and Justification
1.1 Selected CAD Model
The CAD model selected for this study is the All-in-One 3D Printer Test (Remixed Version),
an open-source benchmarking geometry originally available on Printables. In the present work,
the model has been modified to include additional benchmarking features such as a stringing
test and engraved text at the bottom surface, thereby extending its applicability for process
evaluation.
1.2 Justification for Selection
The remixed All-in-One 3D Printer Test model was chosen owing to its intermediate geometric
complexity and comprehensive coverage of additive manufacturing challenges. It integrates
flat planes, curved features, and localized intricate geometries, making it highly suitable for
demonstrating slicing, cross-sectional computation, and support analysis.
Key benchmarking elements embedded in the model include bridging sections, bed-level indi-
cators, stringing and calibration tests, overhangs, cooling performance zones, and small-feature
details. These features collectively enable evaluation of extrusion stability, dimensional accu-
racy, heat management, and overall print quality.
A notable advantage of this model is the inclusion of multiple overhangs, which allow systematic
study of support requirements. In particular, support area estimation under a 45◦ threshold
can be directly visualized and quantified, providing a robust basis for comparing analytical and
voxel-based support generation methods. The combination of these attributes makes the chosen
CAD model an effective and technically relevant artifact for the present study.
Figure 1: CAD model visualization.
3
2 MATLAB Implementation and Results
All MATLAB code per-task and results are written at last.
2.1 Reading the STL File and Facet Information
The STL file was imported using a custom stlread function, which extracts the complete
triangular mesh representation of the model.
• Total facets: The geometry is represented by 162,044 triangular facets.
• Vertices and normals: Coordinates of facet vertices and their associated normals were
extracted and stored in variables vertices and normal for subsequent processing.
• Redundancy note: As per the STL format, geometry is defined as a collection of inde-
pendent triangular facets. Consequently, vertices shared across adjacent facets are stored
multiple times, resulting in coordinate redundancy. This behavior is inherent to the STL
representation and does not affect downstream computations.
2.2 Slicing Operation and Visualization
The STL model was sliced into 100 layers using a plane–triangle intersection method at evenly
spaced Z-levels. For each slice, intersection edges were extracted and overlaid on the original
geometry, highlighted in red to illustrate the layered structure. This provides both qualitative
validation of the slicing algorithm and a visual understanding of the part’s layer distribution
for additive manufacturing.
Figure 2: Slicing visualization showing 100 slice layers (front view).
4
Figure 3: Slicing visualization showing layer distribution (isometric view).
2.3 Build Time Estimation via Cross-Sectional Area
To approximate build time under the assumption of a constant material deposition rate, the
cross-sectional area of each slice was computed and then accumulated across all layers. The
resulting total cross-sectional area provides a first-order proxy for print duration, while the
number of slices and average layer height characterize the slicing resolution.
Metric Value Units
Total cross-sectional area (summed) 415,109.22 mm2
Number of slices 100 –
zmax − zmin
Average layer height mm
100
Table 1: Summary of computed cross-sectional areas and slicing parameters.
Figure 4: Cross-section area vs. height.
5
2.4 Support area requirement (45° threshold)
Support requirement estimated by analyzing facet normals relative to build direction. Facets
that are downward-facing and whose angle from horizontal is less than the threshold are flagged
for support.
Metric Value Units
Support area required 11,211.39 mm2
Safe area (no support) 32,552.81 mm2
Overhang threshold 45 °
Table 2: Support area estimation results (45° threshold).
Figure 5: Support area visualization (safe regions = green, support regions = red).
Figure 6: Support area visualization (bottom view).
6
2.5 STL translation and rotation
Rigid transforms were implemented with homogeneous matrices. Comparison was made between
rotate then translate and translate then rotate.
Figure 7: Comparison: Rotate→Translate (cyan) vs Translate→Rotate (magenta).
2.6 Part Volume Estimation (Facet-Based)
The part volume was computed using a facet-based method, where the 3D model is represented
as a mesh of triangular facets. For each triangular facet, a tetrahedron is formed by connecting
the facet to the origin of the coordinate system. The signed volume of each tetrahedron is
calculated and summed over all facets to obtain the total volume of the part. This method
ensures accurate volume estimation even for complex geometries.
Metric Value Units
Estimated part volume (facet-based) 47,614.19 mm3
Table 3: Estimated volume of the part calculated using the facet-based tetrahedron method.
2.7 Supports from Autodesk Meshmixer (Reference)
Support structures were additionally generated using Autodesk Meshmixer to provide a visual
reference and enable qualitative comparison with the automated support estimation. Represen-
tative screenshots from Meshmixer are shown below.
7
Figure 8: Cura support view.
2.8 Fully solid supports using voxelization
Voxelization-based support generation produces fully solid vertical supports downwards from
selected overhang voxels.
Metric Value Units
Voxel size 1.0 mm
Support volume (voxel) 2,094.00 mm3
Support fraction of part volume 3.69 %
Table 4: Voxelized support generation summary.
Figure 9: Cura support view.
8
3 Discussion and Conclusion
The results from the facet-based support analysis provide a clear understanding of regions re-
quiring additional material during printing. The facet-based analytic support detection method,
which uses facet normals and an overhang threshold, effectively identifies these critical regions.
Once identified, they are converted into manufacturable, fully-solid vertical supports through
voxelization. For the selected model and a 45° threshold, the voxelized solid supports constitute
approximately 3.69% of the total part volume, representing a reasonable material overhead
for FDM printing. Additionally, the per-slice area distribution, shown in Figure, offers insight
into layer-wise print time, which can be estimated based on the deposition or print-head speed.
Potential future improvements include implementing minimum support area filtering to remove
isolated single-voxel supports, refining voxel resolution to improve accuracy, and comparing
different support strategies, such as sparse versus fully solid supports. Overall, the proposed
methodology demonstrates a reliable approach for predicting and visualizing support require-
ments in additive manufacturing workflows.
9
A MATLAB Code
1 clc
2 clear all
3 close all
4 % === Main Code ===
5 [ Face , vertices , normal ] = stlread (" D :\ Documents \ Downloads \
A l l _ i n _ O n e _ 3 D _ P r i n t e r _ T e s t . stl ") ;
6
7 % % === Slicing and Visualization ===
8 figure ;
9 patch ( ’ Faces ’ , Face , ’ Vertices ’ , vertices , ...
10 ’ FaceColor ’ , ’ cyan ’ , ’ EdgeColor ’ , ’ none ’ , ’ FaceAlpha ’ , 0.3) ;
11 camlight ; lighting gouraud ;
12 axis equal ; view (3) ;
13 title ( ’ Original STL Model ’) ;
14 hold on ;
15
16 % --- Slicing parameters ---
17 numSlices = 100;
18 zmin = min ( vertices (: ,3) ) ;
19 zmax = max ( vertices (: ,3) ) ;
20 zLevels = linspace ( zmin , zmax , numSlices ) ;
21
22 % --- Perform slicing ---
23 for zi = zLevels
24 planeZ = zi ;
25 sliceEdges = [];
26
27 % Loop through each triangle
28 for i = 1: size ( Face ,1)
29 verts = vertices ( Face (i ,:) ,:) ;
30 zVals = verts (: ,3) ;
31
32 % Check if plane intersects triangle
33 if ( min ( zVals ) <= planeZ ) && ( max ( zVals ) >= planeZ )
34 pts = [];
35 for j = 1:3
36 k = mod (j ,3) +1;
37 z1 = zVals ( j ) ; z2 = zVals ( k ) ;
38 if ( z1 - planeZ ) *( z2 - planeZ ) < 0
39 t = ( planeZ - z1 ) / ( z2 - z1 ) ;
40 p = verts (j ,:) + t *( verts (k ,:) - verts (j ,:) ) ;
41 pts = [ pts ; p ];
42 elseif z1 == planeZ
43 pts = [ pts ; verts (j ,:) ];
44 end
45 end
46
47 % If 2 intersection points slice edge
48 if size ( pts ,1) == 2
49 sliceEdges = [ sliceEdges ; pts ];
50 end
51 end
52 end
53
54 % Plot slice as red line segments
55 if ~ isempty ( sliceEdges )
56 for k = 1:2: size ( sliceEdges ,1) -1
57 plot3 ( sliceEdges ( k : k +1 ,1) , sliceEdges ( k : k +1 ,2) , sliceEdges ( k : k +1 ,3)
, ...
58 ’r - ’ , ’ LineWidth ’ , 2) ;
59 end
10
60 end
61 end
Listing 1: Main MATLAB script used for slicing, support detection, transform ops, volume and
voxelized support generation.
1 zmin = min ( vertices (: ,3) ) ;
2 zmax = max ( vertices (: ,3) ) ;
3 layerHeight = ( zmax - zmin ) / numSlices ; % layer thickness
4 zLevels = linspace ( zmin , zmax , numSlices ) ;
5
6 totalArea = 0; % sum of cross - section areas
7 sliceAreas = zeros ( numSlices ,1) ; % store per - slice areas
8
9 for idx = 1: numSlices
10 planeZ = zLevels ( idx ) ;
11 sliceEdges = [];
12
13 % --- Collect triangle - plane intersections ---
14 for i = 1: size ( Face ,1)
15 verts = vertices ( Face (i ,:) ,:) ;
16 zVals = verts (: ,3) ;
17
18 % Check if plane intersects this triangle
19 if ( min ( zVals ) <= planeZ ) && ( max ( zVals ) >= planeZ )
20 pts = [];
21 for j = 1:3
22 k = mod (j ,3) +1;
23 z1 = zVals ( j ) ; z2 = zVals ( k ) ;
24 if ( z1 - planeZ ) *( z2 - planeZ ) < 0
25 t = ( planeZ - z1 ) / ( z2 - z1 ) ;
26 p = verts (j ,:) + t *( verts (k ,:) - verts (j ,:) ) ;
27 pts = [ pts ; p ];
28 elseif z1 == planeZ
29 pts = [ pts ; verts (j ,:) ];
30 end
31 end
32 if size ( pts ,1) == 2
33 sliceEdges = [ sliceEdges ; pts ];
34 end
35 end
36 end
37
38 % --- Convert edges to 2 D projection ( XY only ) and compute area ---
39 if ~ isempty ( sliceEdges )
40 xyPoints = unique ( round ( sliceEdges (: ,1:2) ,5) , ’ rows ’) ;
41 if size ( xyPoints ,1) > 2
42 k = convhull ( xyPoints (: ,1) , xyPoints (: ,2) ) ;
43 A = polyarea ( xyPoints (k ,1) , xyPoints (k ,2) ) ;
44 sliceAreas ( idx ) = A ;
45 totalArea = totalArea + A ;
46 end
47 end
48 end
49
50 fprintf ( ’ Total Cross - Sectional Area ( summed ) : %.2 f mm ^2\ n ’ , totalArea ) ;
Listing 2: Slicing area computation and area vs height plotting.
1 % % === Support Area Estimation ( Threshold 45 ) ===
2 overhangThresh = 45; % degrees from horizontal ; typical FDM ~45
3 buildDir = [0 0 1];
4
11
5 % --- Normalize normals safely ---
6 nn = normal ;
7 nn_norm = sqrt ( sum ( nn .^2 ,2) ) ;
8 nn ( nn_norm == 0 , :) = repmat ([0 0 -1] , sum ( nn_norm ==0) , 1) ; % fallback for
degenerate faces
9 n = nn ./ max ( nn_norm , eps ) ;
10
11 % --- Dot product with build direction (Z - axis ) ---
12 nz = n * buildDir ’; % projection along + Z
13 downMask = nz < -1e -6; % only consider downward - facing facets
14
15 % --- Angle from horizontal (0 = flat bottom , 90 = vertical wall ) ---
16 cosArg = - nz ( downMask ) ; % positive for downward
17 cosArg = min (1 , max (0 , cosArg ) ) ; % clamp for numerical safety
18 beta = acosd ( cosArg ) ; % angle from horizontal
19
20 % --- Support mask : faces within threshold AND facing downward ---
21 supportMask = false ( size ( nz ) ) ;
22 supportMask ( downMask ) = beta < overhangThresh ;
23
24 supportIdx = find ( supportMask ) ;
25 safeIdx = setdiff (1: size ( Face ,1) , supportIdx ) ;
26
27 % --- Calculate areas ---
28 supportArea = 0;
29 safeArea = 0;
30 for i = supportIdx (:) ’
31 v = vertices ( Face (i ,:) ,:) ;
32 supportArea = supportArea + 0.5 * norm ( cross ( v (2 ,:) - v (1 ,:) , v (3 ,:) - v
(1 ,:) ) ) ;
33 end
34 for i = safeIdx (:) ’
35 v = vertices ( Face (i ,:) ,:) ;
36 safeArea = safeArea + 0.5 * norm ( cross ( v (2 ,:) - v (1 ,:) , v (3 ,:) - v (1 ,:) ) ) ;
37 end
38
39 fprintf ( ’ Support Area Required : %.2 f mm ^2\ n ’ , supportArea ) ;
40 fprintf ( ’ Safe Area ( no support ) : %.2 f mm ^2\ n ’ , safeArea ) ;
41
42 % % === Part Volume Estimation ===
43 partVolume = 0;
44 for i = 1: size ( Face ,1)
45 % Triangle vertices
46 v1 = vertices ( Face (i ,1) ,:) ;
47 v2 = vertices ( Face (i ,2) ,:) ;
48 v3 = vertices ( Face (i ,3) ,:) ;
49
50 % Signed volume of tetrahedron formed by (0 , v1 , v2 , v3 )
51 vol = dot ( v1 , cross ( v2 , v3 ) ) / 6;
52 partVolume = partVolume + vol ;
53 end
54 partVolume = abs ( partVolume ) ;
55 fprintf ( ’ Estimated Part Volume : %.2 f mm ^3\ n ’ , partVolume ) ;
56
57 % % === Voxelization Parameters ===
58 voxelSize = 1.0; % mm resolution ( smaller = more accurate , slower )
59 % Bounding box of part
60 minXYZ = min ( vertices ) ;
61 maxXYZ = max ( vertices ) ;
62
63 [ xGrid , yGrid , zGrid ] = ndgrid ( minXYZ (1) : voxelSize : maxXYZ (1) , ...
64 minXYZ (2) : voxelSize : maxXYZ (2) , ...
65 minXYZ (3) : voxelSize : maxXYZ (3) ) ;
12
66 gridPoints = [ xGrid (:) , yGrid (:) , zGrid (:) ];
67
68 % % Step 1: Inside / outside test
69 try
70 inside = inpolyhedron ( Face , vertices , gridPoints ) ;
71 catch
72 error ( ’ Function inpolyhedron not found . Please install it from MATLAB
FileExchange . ’) ;
73 end
74
75 nx = numel ( minXYZ (1) : voxelSize : maxXYZ (1) ) ;
76 ny = numel ( minXYZ (2) : voxelSize : maxXYZ (2) ) ;
77 nz = numel ( minXYZ (3) : voxelSize : maxXYZ (3) ) ;
78 insideGrid = reshape ( inside , [ nx , ny , nz ]) ;
79
80 % % Step 2: Compute centroids of overhang ( support ) faces
81 faceCenters = zeros ( size ( supportFaces ,1) ,3) ;
82 for f = 1: size ( supportFaces ,1)
83 v1 = vertices ( supportFaces (f ,1) ,:) ;
84 v2 = vertices ( supportFaces (f ,2) ,:) ;
85 v3 = vertices ( supportFaces (f ,3) ,:) ;
86 faceCenters (f ,:) = ( v1 + v2 + v3 ) / 3;
87 end
88 % ... ( dropping supports down to build platform and computing supportGrid )
89 % --- Compute volumes
90 voxelVolume = voxelSize ^3;
91 partVolumeVoxel = sum ( insideGrid (:) ) * voxelVolume ;
92 supportVolume = sum ( supportGrid (:) ) * voxelVolume ;
93 supportFraction = supportVolume / partVolumeVoxel ;
94 fprintf ( ’ Support Volume Required : %.2 f mm ^3\ n ’ , supportVolume ) ;
95 fprintf ( ’ Support Fraction of Part Volume : %.2 f %%\ n ’ , supportFraction *100) ;
Listing 3: Support area via normals, rotation/translation, volume calc and voxelization
(excerpt).
13