You are on page 1of 45

Additive Manufacturing

MMT 558
Lecture - 4
Manipulation of STL Files
Dr. Manjesh Kumar
Assistant Professor
Department of Mechanical Engineering
SRM University AP
Andhra Pradesh ‒ 522502, India
Contact No. +918100804553
Email : manjesh.k@srmap.edu.in,
phdmanjesh@gmail.com 1
Contents 2

 Orientation of the STL file


o Rotation
o Translation
 Support Structure
o Type of support structures
o Support Structure Zone
 Optimal Part Orientation
o Cost Minimization Model
o Surface Quality Improvement Model
o Support Minimization Model
o Multi-Objective Model
STL: Rotation 3

Z Z
𝑦1 = 𝐿 cos 𝛼 𝑧2 = 𝐿 sin 𝜃 + 𝛼

𝑧1 = 𝐿 sin 𝛼 𝑧2 = 𝐿 sin 𝜃 cos 𝛼 + 𝐿 sin 𝛼 cos 𝜃


𝑧2 𝜃𝑥
L 𝒛𝟐 = 𝐲𝟏 𝐬𝐢𝐧 𝜽 + 𝒛𝟏 𝐜𝐨𝐬 𝜽
𝑧1
𝛼
𝑧1 𝑦2 = 𝐿 cos(𝜃 + 𝛼)
𝛼

𝑦1 𝑦2 = 𝐿 cos 𝜃 cos 𝛼 − 𝐿 sin 𝜃 sin 𝛼


Y
𝑦1 𝒚𝟐 = 𝒚𝟏 𝐜𝐨𝐬 𝜽 − 𝒛𝟏 𝐬𝐢𝐧 𝜽
Z 𝑦2

𝒙𝟐 = 𝟏 𝒙𝟏 + 𝟎 𝒚𝟏 + 𝟎 𝒛𝟏

 Y
𝒚𝟐 = 𝟎 𝒙𝟏 + 𝒚𝟏 𝐜𝐨𝐬 𝜽 − 𝒛𝟏 𝐬𝐢𝐧 𝜽
𝒛𝟐 = 𝟎 𝒙𝟏 + 𝐬𝐢𝐧 𝜽 𝐲𝟏 + 𝐜𝐨𝐬 𝜽 𝒛𝟏
𝑥2 1 0 0 𝑥1
𝑦2 = 0 cos 𝜃 − sin 𝜃 𝑦1
X 𝑧2 0 sin 𝜃 cos 𝜃 𝑧1
STL: Rotation 4

In the Cartesian Coordinate system the rotation of a point about the x-axis, y-axis or z-axis can be obtain
by multiplying with the rotation matrix:

1 0 0
𝑅 𝜃𝑥 = 0 cos 𝜃𝑥 − sin 𝜃𝑥
0 sin 𝜃𝑥 cos 𝜃𝑥
Z
cos 𝜃𝑦 0 sin 𝜃𝑦
𝑅 𝜃𝑦 = 0 1 0
−sin 𝜃𝑦 0 cos 𝜃𝑦
Y
cos 𝜃𝑧 − sin 𝜃𝑧 0
𝑅 𝜃𝑧 = sin 𝜃𝑧 cos 𝜃𝑧 0
0 0 1
X
STL: Rotation 5

The coordinates of the rotated point can be given as:


𝑖 𝑖
𝑝𝑘𝑥 𝑝𝑘𝑥
𝑖 𝑖
𝑝𝑘𝑦 = 𝑹 𝜽𝒙 /𝜽𝒚 /𝜽𝒛 𝑝𝑘𝑦
𝑖 𝑖
𝑝𝑘𝑧 𝑛
𝑝𝑘𝑧

𝑝1 𝑖
(𝑝𝑘𝑥 𝑖
, 𝑝𝑘𝑦 𝑖
, 𝑝𝑘𝑧 ) are the coordinates of the 𝑘𝑡ℎ (𝑘 = 1,2,3) vertex of the 𝑖 𝑡ℎ triangle,
Z
𝑖 = 1, 2, 3 … 𝑁 (N is the number of triangles).
𝑛ො
In the similar fashion the normal of the triangle can be rotated.
Y
𝑛𝑥𝑖 𝑛𝑥𝑖
𝑝2
𝑛𝑦𝑖 = 𝑹 𝜽𝒙 /𝜽𝒚 /𝜽𝒛 𝑛𝑦𝑖
𝑛𝑧𝑖 𝑛
𝑛𝑧𝑖
𝑝3 X
where (𝑛𝑥𝑖 , 𝑛𝑦𝑖 , 𝑛𝑧𝑖 ) are the coordinates of the outward normal of the 𝑖 𝑡ℎ facet
STL: Translation 6

The coordinates of the rotated point can be given as:


𝑖 𝑖
𝑝𝑘𝑥 𝑥 𝑝𝑘𝑥
𝑖 𝑖
𝑝𝑘𝑦 = 𝑦 + 𝑝𝑘𝑦
𝑖
𝑝𝑘𝑧 𝑧 𝑝𝑖
𝑛 𝑘𝑧

𝑝1 𝑖
(𝑝𝑘𝑥 𝑖
, 𝑝𝑘𝑦 𝑖
, 𝑝𝑘𝑧 ) are the coordinates of the 𝑘𝑡ℎ (𝑘 = 1,2,3) vertex of the 𝑖 𝑡ℎ triangle,
Z
𝑖 = 1, 2, 3 … 𝑁 (N is the number of triangles).
𝑛ො
The normal vector will not change
Y
𝑛𝑥𝑖 𝑛𝑥𝑖
𝑝2
𝑛𝑦𝑖 = 𝑛𝑦𝑖
𝑛𝑧𝑖 𝑛
𝑛𝑧𝑖
𝑝3 X
where (𝑛𝑥𝑖 , 𝑛𝑦𝑖 , 𝑛𝑧𝑖 ) are the coordinates of the outward normal of the 𝑖 𝑡ℎ facet
STL: MATLAB Code 7
STL: Support Structure 8

The support structure is mainly required while creating the overhanging features. In some AM processes
the explicit support structures are not required such as in the case of binder jetting & Powder – Bed Fusion
(sintering) the remaining loose powder act as a support material. However, in some AM process the
support structures need to be created in during the pre-processing.

The support structure is a sacrificial material added to support the overhanging features. There are other
type of sacrificial material also used in AM and those will be discussed later.
STL: Support Structure 9

For a given STL file and build direction the support structure can be easily calculated based on the facet
normal of the tringles of the STL file and build direction. If the build direction is vertical (+Z) then the
triangles those are having normal pointing upward will not required the support structures and the normal
pointing downwards may required the support structures.

𝑝1 𝑝1
Z Z Z
𝑛ො
𝑛ො 𝑝1

Y Y
𝑝2 Y
𝑝2 𝑝3 𝑝2
𝑛ො
𝑝3 X X X
𝑝3
STL: Support Structure 10

Lets assume that the AM process can support the maximum overhang 𝑑 with the layer thickness 𝑡.
+Z

𝜃
t
T D
t
d

Therefore if the angle 𝛼 between the build direction (𝑘)෠ and the
triangle normal is greater than 𝜃, the support will be required 𝑡
tan 𝜋 − 𝜃 =
𝛼 = cos −1 𝑛𝑥𝑖 𝑖Ƹ + 𝑛𝑦𝑖 𝑗Ƹ + 𝑛𝑧𝑖 𝑘෠ . 𝑘෠ 𝑑 t
𝜋− 𝜃
𝛼 = cos −1 (𝑛𝑧𝑖 )
𝑡 d
where (𝑛𝑥𝑖 , 𝑛𝑦𝑖 , 𝑛𝑧𝑖 ) are the coordinates of the outward normal 𝜃=𝜋− tan−1
of the 𝑖 𝑡ℎ facet 𝑑
STL: Support Structure 11

In an AM process the maximum possible layer overhang can be 1 mm. The build direction +Z. The
minimum possible layer thickness is 3 mm. Find out the critical value of the z-component of the facet
normal of the triangles of an STL file beyond that the support is be required.

3
𝜃= 180° − tan−1 = 180° − 60° = 120°
1

𝛼 = cos −1 𝑛𝑧𝑖

For no Support 𝛼<𝜃 For no critical 𝛼=𝜃

cos −1 𝑛𝑧𝑖 = 120°


𝑛𝑧𝑖 = cos 120°
𝑛𝑧𝑖 = −0.5
For Support 𝑛𝑧𝑖 < −0.5
STL: Support Structure 12

Supports are extended until they intersect either with the base platform or another upward facing surface
of the part. (In the shown example the triangles with facet normal having angle greater than 120° with the
+Z axis are in yellow color)
STL: MATLAB Code 13
STL: Support Structure 14

Calculation
A (𝑥, 𝑦, 𝑧)
1. Support Generation from Facets
𝑁𝑥 , 𝑁𝑦 , 𝑁𝑧
Equation of a line 𝐴𝐴′ passing through a point (𝑥, 𝑦, 𝑧) and parallel to a vector

𝑋−𝑥 𝑌−𝑦 𝑍−𝑧 A’(𝑥′, 𝑦′, 𝑧′)


= = =𝛼
𝑁𝑥 𝑁𝑦 𝑁𝑧
The line will pass through A’

𝑥′ − 𝑥 𝑦′ − 𝑦 𝑧′ − 𝑧
= = =𝛼 1
𝑁𝑥 𝑁𝑦 𝑁𝑧
Get 𝛼:
Point A’ is on the plane
𝑁𝑥 𝛼𝑁𝑥 + 𝑥 + 𝑁𝑦 𝛼𝑁𝑦 + 𝑦 + 𝑁𝑧 𝛼𝑁𝑧 + 𝑧 − a = 0 3
𝑁𝑥 𝑥′ + 𝑁𝑦 𝑦′ + 𝑁𝑧 𝑧′ − 𝑎 = 0 2
STL: Support Structure 15

Calculation
1. Support Generation from Facets
If the build direction is +Z (𝑁𝑥 = 0, 𝑁𝑦 = 0, 𝑁𝑧 = 1) and base is at 𝑋𝑌 plane (𝑎 = 0)

𝑝1 Form equation 3:

𝑁𝑥 𝛼𝑁𝑥 + 𝑥 + 𝑁𝑦 𝛼𝑁𝑦 + 𝑦 + 𝑁𝑧 𝛼𝑁𝑧 + 𝑧 − a = 0


Z 1× 𝛼×1+𝑧 =0
𝑝3 𝑛ො
Build Direction

𝛼 = −𝑧
𝑝2 𝑝′1
Y Form equation 2:

𝑥′ − 𝑥 𝑦′ − 𝑦 𝑧′ − 𝑧
= = =𝛼
𝑁𝑥 𝑁𝑦 𝑁𝑧
𝑝′3 𝑝′2
𝑥 ′ = 𝑥, 𝑦 ′ = 𝑦, 𝑧 ′ = 0
X
STL: Support Structure 16

Calculation
1. Support Generation from Facets
The volume of the support structure can be obtained as:
𝑛 𝑛
𝑝1
𝑉𝑠𝑝 = ෍ 𝑉𝑖 = ෍ 𝐴𝑖 × ℎ𝑖
𝑖=1 𝑖=1
Z
𝑝3 𝑛ො
Where 𝑛 is the total number of down-facing
Build Direction

𝑝2 𝑝′1 facets of the STL file, requiring the support. 𝐴𝑖 is


Y
the project area of facet 𝑖 onto the horizontal
slicing plane, and ℎ𝑖 the average support height
evaluated from the corresponding facet to either
𝑝′3 𝑝′2
the platform or the next interesting facet, which
ever is less.
X
STL: Support Structure 17

Calculation
1. Support Generation from Facets
Self Supporting
Part
region

Support
Projected
on Part
Support
Projected
on base

Substrate/Base/Platform
STL: Support Structure 18

Example
The build direction of the object shown is +Z and support is not required for facet normal having angle
greater than 120° from the build direction.
1. Determine the projected area of the support required for the given facets. (Ignore the base support)
2. How many triangles you will examine for support calculation? Also highlight locations of these
triangles.

Build Direction
STL: Support Structure 19

Example

(Ignore the base support)


STL: Support Structure 20

facet normal -0.500000 0.000000 -0.866025 facet normal 0.000000 0.000000 -1.000000 facet normal 0.866025 0.000000 -0.500000
outer loop outer loop outer loop
vertex 80.000000 0.000000 0.000000 vertex 50.000000 -0.000001 17.320511 vertex 30.000000 -0.000001 17.320511
vertex 50.000000 -10.000001 17.320511 vertex 30.000000 -10.000001 17.320511 vertex 20.000000 -10.000000 -0.000000
vertex 50.000000 -0.000001 17.320511 vertex 30.000000 -0.000001 17.320511 vertex 20.000000 0.000000 0.000000
endloop endloop endloop
Endfacet endfacet endfacet
facet normal -0.500000 0.000000 -0.866025 facet normal 0.000000 0.000000 -1.000000 facet normal 0.866025 0.000000 -0.500000
outer loop outer loop outer loop
vertex 80.000000 -10.000000 -0.000000 vertex 50.000000 -10.000001 17.320511 vertex 30.000000 -10.000001 17.320511
vertex 50.000000 -10.000001 17.320511 vertex 30.000000 -10.000001 17.320511 vertex 20.000000 -10.000000 -0.000000
vertex 80.000000 0.000000 0.000000 vertex 50.000000 -0.000001 17.320511 vertex 30.000000 -0.000001 17.320511
endloop endloop endloop
endfacet endfacet endfacet

𝑛𝑧𝑖 < cos 𝛼


𝑛𝑧𝑖 < cos 120°
𝑛𝑧𝑖 < −0.5
STL: Support Structure 21

facet normal -0.500000 0.000000 -0.866025 facet normal 0.000000 0.000000 -1.000000
outer loop outer loop
vertex 80.000000 0.000000 0.000000 vertex 50.000000 -0.000001 17.320511
vertex 50.000000 -10.000001 17.320511 vertex 30.000000 -10.000001 17.320511
vertex 50.000000 -0.000001 17.320511 vertex 30.000000 -0.000001 17.320511
endloop endloop
Endfacet endfacet
facet normal -0.500000 0.000000 -0.866025 facet normal 0.000000 0.000000 -1.000000
outer loop outer loop
vertex 80.000000 -10.000000 -0.000000 vertex 50.000000 -10.000001 17.320511
vertex 50.000000 -10.000001 17.320511 vertex 30.000000 -10.000001 17.320511
vertex 80.000000 0.000000 0.000000 vertex 50.000000 -0.000001 17.320511
endloop endloop
endfacet endfacet

As the build direction is +Z 𝑥 ′ = 𝑥, 𝑦 ′ = 𝑦, 𝑧 ′ = 0


STL: Support Structure 22

vertex 80 0 0 vertex 80 -10 0 vertex 50 0 0 vertex 50 -10 0


vertex 50 -10 0 vertex 50 -10 0 vertex 30 -10 0 vertex 30 -10 0
vertex 50 0 0 vertex 80 0 0 vertex 30 0 0 vertex 50 0 0
A1= A2= A3= A4=

1
Area (2D Triangle) = 𝑥1 𝑦2 − 𝑦3 + 𝑥2 𝑦3 − 𝑦1 + 𝑥3 𝑦1 − 𝑦2
2
STL: Support Structure 23

1. Support Generation from Facets Calculation


2. Support Generation from Contours

In this method, first the contours are generated by


slicing the entire object. Then these contours are used
to generate the support structures. There are two
popular methods:

2a. Containment
2b. Optimal method

2a. Containment
The area to be supported is determined by projecting
all the contours on a plane and then merged to get the
external support. This big contour is then subtracted
from the contours at each slice to determine the
internal contour for support
STL: Support Structure 24

1. Support Generation from Facets Calculation


2. Support Generation from Contours
2a. Containment
STL: Support Structure 25

1. Support Generation from Facets Calculation


2. Support Generation from Contours
2b. Optimal method

In this method, first the contours are generated by 𝑛𝑡ℎ slice


slicing the entire object. Then these contours are used
to generate the support structures. 𝑛−1 𝑡ℎ slice

𝑛𝑡ℎ slice

𝑛−1 𝑡ℎ slice
STL: Support Structure 26

1. Support Generation from Facets Calculation


2. Support Generation from Contours
STL: Support Structure 27

Example
Generate the support for the given object utilizing the optimal slicing contour method.
Show the stale and fresh support.
STL: Optimal Orientation 28

The orientation of the part during its fabrication can affect its quality and cost. Following
are the most popular models for obtaining the optimal orientation of the part:

1. Cost Minimization Model


2. Support Minimization Model
3. Multi-Objective Model
STL: Optimal Orientation 29

Cost Minimization Model


The generic cost model is defined as:

𝐶𝑡 = 𝐶𝑝𝑟𝑒 + 𝐶𝑏𝑢𝑖𝑙𝑑 + 𝐶𝑚𝑎𝑡 + 𝐶𝑝𝑜𝑠𝑡

Total cost

Pre-processing cost

Machine utilization cost for building the object

Material cost (main & support)

Post processing cost

Assume that the part is available and no cost is required to create the model
STL: Optimal Orientation 30

Cost Minimization Model


The pre processing cost involves:

𝐶𝑝𝑟𝑒 = 𝑇𝑝𝑜𝑠 + 𝑇𝑠𝑢𝑝 + 𝑇𝑠𝑙𝑖 + 𝑇𝑝𝑎𝑡ℎ 𝑅𝑠𝑡𝑎𝑓𝑓 + 𝑅𝑐𝑜𝑚𝑝 + 𝑇𝑠𝑒𝑡𝑢𝑝 . 𝑅𝑠𝑡𝑎𝑓𝑓 + 𝑅𝑚𝑎𝑐ℎ

Machine Utilization rate


Model position time
𝐶
𝑀+
𝑅𝑚𝑎𝑐ℎ = 𝑇
Support generation time 360
15
Staff cost/hr
Model Slicing time
Annual Maintenance (M=15%C)
Toolpath generation time
Machine setup time
Staff cost/hr
C= initial machine cost
Computing facility cost/hr T= machine life
STL: Optimal Orientation 31

Cost Minimization Model


The build cost involves:

𝐶𝑏𝑢𝑖𝑙𝑑 = 𝑇𝑏𝑢𝑖𝑙𝑑 × 𝑅𝑚𝑎𝑐ℎ

Machine Utilization rate 𝐶


𝑀+𝑇
𝑅𝑚𝑎𝑐ℎ =
360
15
Build time

Annual Maintenance (M=15%C)

C= initial machine cost

T= machine life
STL: Optimal Orientation 32

Cost Minimization Model

The build time in 7 AM Processes


STL: Optimal Orientation 33

Cost Minimization Model


The material cost involves:

𝐶𝑚𝑎𝑡 = 𝐶𝑚𝑎𝑡−𝑚𝑜𝑑𝑒𝑙𝑙𝑖𝑛𝑔 + 𝐶𝑚𝑎𝑡−𝑠𝑢𝑝𝑝𝑜𝑟𝑡

Main material cost

Support material cost


STL: Optimal Orientation 34

Cost Minimization Model


The post-processing cost involves:

𝐶𝑝𝑜𝑠𝑡 = 𝑇𝑝𝑜𝑠𝑡 × 𝑅𝑠𝑡𝑎𝑓𝑓 + 𝐶𝑚𝑖𝑠𝑐

Post processing cost

Staff cost/hr

Cost such as: UV-oven for SLA, HIP for Metal, Water works for FDM
STL: Optimal Orientation 35

Cost Minimization Model


The generic cost model is defined as:

𝐶𝑡 = 𝐶𝑝𝑟𝑒 + 𝐶𝑏𝑢𝑖𝑙𝑑 + 𝐶𝑚𝑎𝑡 + 𝐶𝑝𝑜𝑠𝑡

Total cost

Pre-processing cost

Machine utilization cost for building the object

Material cost (main & support)

Post processing cost


STL: Optimal Orientation 36

Support Minimization Model


𝑛 𝑛

𝑉𝑒 = ෍ 𝑉𝑖 = ෍ 𝐴𝑖 × ℎ𝑖
𝑖=1 𝑖=1

Where 𝑛 is the total number of down-facing facets of the STL file, requiring the support.
𝐴𝑖 is the project area of facet 𝑖 onto the horizontal slicing plane, and ℎ𝑖 the average
support height evaluated from the corresponding facet to either the platform or the next
interesting facet, which ever is less.
STL: Optimal Orientation 37

Multi-Objective Model
The optimal orientation of the object is a multi-objective problem with an appropriate
weightage for each of the individual criteria.
• Maximize the number of perpendicular surfaces
• Maximize the number of up-facing horizontal surfaces
• Maximize the number of holes with their axes in the build direction
• Maximize the number of curved cross section drawn in the horizontal plane
• Maximize the area of the base surface
• Minimize the number of sloped surface
• Minimize the number of trapped volumes.
STL: Optimal Orientation 38

Multi-Objective Model
• Maximize the number of perpendicular surfaces
STL: Optimal Orientation 39

Multi-Objective Model
• Maximize the number of up-facing horizontal surfaces
STL: Optimal Orientation 40

Multi-Objective Model
• Maximize the number of holes with their axes in the build direction
STL: Optimal Orientation 41

Multi-Objective Model
• Maximize the number of curved cross section drawn in the horizontal plane
STL: Optimal Orientation 42

Multi-Objective Model
• Maximize the area of the base surface
STL: Optimal Orientation 43

Multi-Objective Model
• Minimize the number of sloped surface
STL: Optimal Orientation 44

Multi-Objective Model
• Minimize the number of trapped volumes.
STL: Optimal Orientation 45

Multi-Objective Model
The optimal orientation of the object is a multi-objective problem with an appropriate
weightage for each of the individual criteria.
• Maximize the number of perpendicular surfaces
• Maximize the number of up-facing horizontal surfaces
• Maximize the number of holes with their axes in the build direction
• Maximize the number of curved cross section drawn in the horizontal plane
• Maximize the area of the base surface
• Minimize the number of sloped surface
• Minimize the number of trapped volumes.

You might also like