Normal Transformations for Overhang Reduction Master thesis Carlos - - PowerPoint PPT Presentation
Normal Transformations for Overhang Reduction Master thesis Carlos - - PowerPoint PPT Presentation
Normal Transformations for Overhang Reduction Master thesis Carlos Eduardo Leal de Castro Advisor: Dr. Leonardo Sacht Universidade Federal de Santa Catarina February 18, 2020 3D printing and Overhangs Related Work The group SO (3) and
SLIDE 1
SLIDE 2
3D printing and Overhangs Related Work The group SO(3) and Generalized Euler Sequences Objective Functions Implementation and results Future Work
SLIDE 3
3D printing and Overhangs Related Work The group SO(3) and Generalized Euler Sequences Objective Functions Implementation and results Future Work
SLIDE 4
3D printing and Overhangs
4
The 3D printing process is gaining space in many areas around the world. Its versatility can be used to print artistic objects, architectural mockups, as well as delicate objects as prosthesis and real representations of human organs.
Figure: Images from World Economic Forum Youtube v´ ıdeo (left) and Aniwaa website (right).
SLIDE 5
3D printing and Overhangs
5
b) a) c) d) e)
A plastic filament (a) is heated by a nozzle (b), allowing the template (c) to be printed over the horizontal platform (e), that moves on the vertical direction. Some sloping parts of the template need supports (d) to be printed.
SLIDE 6
3D printing and Overhangs
6
To deal with overhangs, 3D printers print columns to support the parts of this solid that have no material underneath them. This extra material must be removed from the solid, leading to a waste of material, time and money.
SLIDE 7
3D printing and Overhangs
7
Some overhangs are tolerable. Each printer comes with a standard limiting angle to tolerate these overhangs. Given a θ limit angle, the printer only prints a support if the part of the solid that will be printed maintains an angle with the horizontal plane smaller than θ.
SLIDE 8
Our proposal
8
We propose a model for the overhang problem based on the normal field of a surface and we propose an optimization framework to find a global rotation of the surface that minimizes the amount of overhanging support.
SLIDE 9
Structure of the thesis
9
◮ Preliminary concepts ◮ Modeling the problem
e3 n(f)
α(f)
◮ fmincon and optimization ◮ Implementation and results
π x-axis y-axis
- π
π 2
- π
2
SLIDE 10
Libraries
10
The libraries we are working with are libigl [3] (C++) and gptoolbox [4] (Matlab).
Figure: Images from Libigl website https://libigl.github.io/.
SLIDE 11
3D printing and Overhangs Related Work The group SO(3) and Generalized Euler Sequences Objective Functions Implementation and results Future Work
SLIDE 12
Related Work
12
◮ (HU et al, 2014), (YAO et al, 2015), (KARASIK, FATTAL, WERMAN, 2019) Some of these solutions partition the surface into smaller parts such that each subpart has little or no overhangs.
SLIDE 13
Related Work
13
◮ (ZHANG et al, 2015), (WANG, ZANNI, KOBBELT, 2016) These articles propose altering the surface to improve the final quality of the printed piece.
SLIDE 14
Related Work
14
◮ (VANEK, GALICIA, BENES, 2014) The authors propose to change the geometry of the supports to minimize the waste of material.
SLIDE 15
Alexander’s method
15
Before creating their support structures, (VANEK; GALICIA; BENNES, 2014) states that the simplest way to reduce the need for supports is finding an orientation for the surfaces using (ALEXANDER; ALLEN; DUTTA, 1998) method.
Figure: Pipeline of Vanek-Galicia-Bennes method. Figure taken from (VANEK; GALICIA; BENNES, 2014).
SLIDE 16
Alexander’s method
16
This method considers three types of faces on the surface: unsupported faces, faces that need support and faces touched from above by the support structure. Support Surface touched from above Unsupported faces Supported faces
SLIDE 17
Surface Representation
17
A solid can be represented by its vertex matrix V ∈ Rn×3, V = {v1, v2, . . . , vn}, n = |V|, in which each vertex vi ∈ R1×3 has the x, y, z coordinates of the vertex i = 1, . . . , n and can represent its surface mesh storing the set of vertex indices in a matrix F ∈ Rm×3, m = |F|.
vi vj vk
Fl
The matrix F has in each row the indices of rows of V that, together, form a triangle mesh.
SLIDE 18
Alexander’s method
18
If we look at the triangle formed by the thickness of layer zt, the height h and the angle θ between them, we have that hfac = Afac (zt| cos(θ)|) = Afac (zt|ˆ n, e3|) , (1)
Layers of material Model surface zt h
θ
where ˆ n, ˆ n = 1 is the normal vector to the surface.
SLIDE 19
Alexander’s method
19
◮ For faces that need support to be printed, they assume some inaccuracy to them and, then, add some additional value R ∈ R+, obtaining hfacs = Afac (zt|ˆ n, e3| + R) (2)
SLIDE 20
Alexander’s method
20
Taking the results of equations 1, 2 and summing over all faces
- f surface, we obtain the objective function of Alexander’s
method: min
N N−Nsup
- i=1
Ai
- zt|ˆ
ni,ˆ b|
- +
Nsup
- i=1
Ai
- zt|ˆ
ni,ˆ b| + R
- +
Nrays
- i=1
RAproj, (3) where N is the normal field of surface, N is the total number of polygonal faces, Nsup is the number of faces that need support underneath them and Nrays is the number of faces that are touched by support from above.
SLIDE 21
Alexander method
21
Some results using Alexander’s method:
Usual Orientation Usual Orientation Alexander's Orientation Alexander's Orientation
SLIDE 22
3D printing and Overhangs Related Work The group SO(3) and Generalized Euler Sequences Objective Functions Implementation and results Future Work
SLIDE 23
The group SO(3)
23
Definition
The set describing all rotations in 3D is given by SO(3) = {R ∈ R3×3|RT R = I and detR = 1}
SLIDE 24
The group SO(3)
23
Definition
The set describing all rotations in 3D is given by SO(3) = {R ∈ R3×3|RT R = I and detR = 1}
Theorem (Euler’s Rotational Theorem)
Given any R ∈ SO(3), it is possible to find u ∈ R3, u = 1 and θ ∈ (−π, π] such that R = Ru(θ).
SLIDE 25
The group SO(3)
23
Definition
The set describing all rotations in 3D is given by SO(3) = {R ∈ R3×3|RT R = I and detR = 1}
Theorem (Euler’s Rotational Theorem)
Given any R ∈ SO(3), it is possible to find u ∈ R3, u = 1 and θ ∈ (−π, π] such that R = Ru(θ).
SLIDE 26
The group SO(3)
24
Theorem (Generalized Euler Sequences)
Consider three axis u1, u2, u3 ∈ R3, ui = 1, ui = (ux
i uy i uz i )T ,
i = 1, 2, 3, and let a unique angle α ∈ (−π, π] such that uT
1 u2 =
uT
2 u3 = 0, sin(α) = uT 3 U1u2 and cos(α) = uT 3 u1.
So, for any R ∈ SO(3), exists (θ1, θ2, θ3) ∈ (−π, π] × [−α, π − α] ×(−π, π] such that R = Ru3(θ3)Ru2(θ2)Ru1(θ1).
x y z R
SLIDE 27
Observe that:
- 1. If we choose u1 = (1 0 0)T , u2 = (0 1 0)T and
u3 = (0 0 1)T , we have that:
cos(α) = uT
3 u1 = 0 and sin(α) = uT 3 U1u2 = 1.
Therefore, α = π
2 and (θ1, θ2, θ3) ∈ (−π, π] ×
- −π
2 , π 2
- × (−π, π].
- 2. The z-axis rotation will not change the need for support.
SLIDE 28
Normals
26
vi vj vk nijk
Given a vertex matrix V ∈ Rn×3, n = |V| and a triangle f = (i, j, k) of its triangle mesh F ∈ Rm×3, the normal vector to the triangle f is n(f) = (vj − vi) ∧ (vk − vi) (vj − vi) ∧ (vk − vi), where ∧ : R3 − → R3 is the Euclidean cross product.
SLIDE 29
3D printing and Overhangs Related Work The group SO(3) and Generalized Euler Sequences Objective Functions Implementation and results Future Work
SLIDE 30
Normal field
28
We analyze overhanging parts of our printing solid using the normal field of its surface. The faces that have normals belonging to the white region of the sphere on the figure can be printed without supports and the ones that have normals in the green region need supports to be printed.
SLIDE 31
Objective Functions
29
Given a triangle mesh matrix F the function α : F − → R, α(f) = arccos
- n(f)T e3
- ,
where e3 = (0, 0, 1)T , defines the angle of the normal of each triangle with the vertical direction.
e3 n(f)
α(f)
SLIDE 32
Objective Functions
30
We can measure the residual error of each normal angle and the threshold angle and sum over all triangles of mesh. The normal field that minimizes this sum is the solution of min
N
- f∈F
max
- α(f) − π
2
- − θ, 0
- ,
(4) for a printer limit angle θ.
SLIDE 33
Tests result
31
Initial results, obtained on MATLAB, shows that for every tested surface we find an x-axis and y-axis angle global rotation that find a minimum value to equation (4). Surface(.obj) x-axis y-axis Initial Minim camel b 136o −2o 235.29 150.19 horse quad −60o −30o 565.53 215.28 bunny 124o 46o 812.80 346.33 decimated-knight
- 92o
30o 120.44 43.18 decimated-max 64o −10o 1051.7 431.93 cow 112o 42o 883.05 266.99 arm −100o 54o 2141.8 409.98 heart −128o 50o 1574 831.86 skull −32o 14o 295.14 268.10
SLIDE 34
Tests result
32
With some 3D printer software, we can measure the lenght and weight of material in each impression on a 3D printer. Some results is shown on table. Surface (.obj) Initial arcCOS Human skull 5.38m / 16g 4.53m / 14g Horse 6.09m / 18g 5.41m / 16g Max 10.05m / 30g 7.47m / 22g Human heart 13.14m / 39g 11.39m / 34g Knight 5.79m / 17g 5.62m / 16g
SLIDE 35
Tests result
33
We also show 2D graphs that show the variation of the value in equation (4) on those combinations.
Figure: These graphs represent the value (in a gradient color) of sum
- f max in equation 4 in a x-axis and y-axis rotation of cow.obj (left)
and armadillo.obj (right) surface.
SLIDE 36
Problems in paradise
34
Using the objective function min
N
- f∈F
max
- α(f) − π
2
- − θ, 0
- ,
for a printer limit angle θ, we have the following problem:
- 1. This method does not obtain better results for all surfaces,
if we consider the volume of material:
Surface(.obj) Initial arcCOS Bunny 7.85m / 23g 8.78m / 26g Camel 6.04m / 18g 6.65m / 20g Cow 7.16m / 21g 8.35m / 25g Arm 1.86m / 39min 1.23m / 54min
SLIDE 37
Surface normal “Least squares”
35
xy-plane z xy-plane z xy-plane z n(f)
As the normal vector n(f) approaches the xy-plane, the value
- f its z-coordinate will approach zero. Note that the sequence in
the image {nzk}k={1,2,3} ⊂ R of z-coordinate values is such that nzk → 0 if the sequence of rotation on n(f) leads to the xy-plane.
SLIDE 38
Surface normal “Least squares”
36
For any n(f) ∈ N, n(f) = (n(f)x n(f)y n(f)z)T normal vector of the face f ∈ F and the projection of n(f) on the xy-plane Prxy(n(f)) = (n(f)x n(f)y 0)T , we have n(f)−Prxy(n(f)) = n(f)z .
SLIDE 39
Surface normal “Least squares”
37
If we look at the norm of each difference vector n(f) − Prxy(n(f)), the closer to zero is the norm
- f this vector, the less need for
support the triangle f has.
SLIDE 40
Objective function
38
Thus, we now can consider this difference vector norm for all triangles in a surface and find the solution to the problem min
N
- f∈F
WfPrxy(n(f)) − n(f)2, (5) where Wf ∈ R is a weight value applied to each norm Wf = Af
- eT
3
- R · 1
3 (vf1 + vf2 + vf3)
- − minV
z
- ,
where e3 = (0 0 1)T , vf1, vf2, vf3 ∈ R3 are vertices of the triangle, Af is the area of the triangle and minV
z ∈ R is the
minimal value of all z-coordinates of the vertices of V.
SLIDE 41
Objective function
39
Subtracting the factor minV
z
is important to measure the approximate ammount of support volume on each iteration. Printer plate
minz
V
SLIDE 42
3D printing and Overhangs Related Work The group SO(3) and Generalized Euler Sequences Objective Functions Implementation and results Future Work
SLIDE 43
fmincon
41
To solve the minimization problem presented in equation 5 we use a Matlab function called fmincon. This function uses: ◮ the finite difference method to approximate the gradient of the function, ◮ an Interior-point algorithm with logarithmic barrier penalty method; ◮ and Broyden–Fletcher–Goldfarb–Shanno (BFGS) Quasi-Newton method as descent direction.
SLIDE 44
Finite difference method
42
The central-difference formula, given by ∂fǫ ∂xi (x) ≈ f(x + ǫei) − f(x − ǫei) 2ǫ , has a truncation error in order of O(ǫ2) for each i = 1, . . . , n. So, putting each one into a vector, we define the central-difference gradient by ∇ǫf(x) = ∂fǫ ∂x1 (x) ∂fǫ ∂x2 (x) . . . ∂fǫ ∂xn (x). (6)
SLIDE 45
Penalty barrier
43
The logarithmic barrier function is used, i.e., if the problem that we want to solve is min f(x) s.t. x ∈ Ω, with Ω = {x ∈ Rn | g(x) ≤ 0}, the method adds the function φ(x) = − m
i=1 ln (−gi(x)) to the objective function and
converts the problem to min f(x) + αφ(x) s.t. x ∈ Rn, (7) where α > 0 is a penalty parameter.
SLIDE 46
Broyden, Fletcher, Goldfarb, and Shanno (BFGS)
44
This method was developed by Broyden, Fletcher, Goldfarb, and Shanno as a Quasi-Newton method that only requires the gradient (or its approximation) of the objective function to find a descent direction and uses an approximation Bk ∈ Rn×n of the Hessian ∇2f(xk) that is computed at every iteration by solving Bkdk = −∇f(xk) (8)
SLIDE 47
fmincon
45
◮ V; F; TOL > 0; ◮ φ(x0) = α0
- ln
- π − x0
1
- + ln
- π + x0
1
- + ln
π 2 − x0
2
- + ln
π 2 + x0
2
- ◮ g(x0) =
f∈F Ff(x0) − φ(x0);
◮ ∇ǫg(x0); While dk > TOL or −∇ǫg(xk)T dk > TOL or ∇ǫg(x0) > TOL
- 1. Compute search direction
Bkdk = −∇ǫg(xk);
- 2. Set xk+1 = xk + tkdk where tk satisfies the Wolfe conditions;
- 3. Compute Bk+1;
- 4. Choose αk+1 < αk;
- 5. Compute ∇ǫg(xk+1);
- 6. k ←
− k + 1;
- 7. Return to step 1;
end
SLIDE 48
Function graph
46
Looking at the graph of the function applied to the Knight surface, we notice that the objective function is not convex and has some different local minima.
SLIDE 49
Random initial point
47
The teal surface on the left would be printed in 136 minutes with 3g of material loss (support that would be wasted) and the pink surface on the right would be printed in 149 minutes with 5g of material loss.
SLIDE 50
Multiple constraint division (M.C.D.)
48
Setting h = π 4 , we have 32 different initial points and we got results that are close to what was found in the previous tests, but with a much faster outcome.
SLIDE 51
Randomly chosen starting points (R.C.S.P.)
49
π x-axis y-axis
- π
π
2
- π
2
The second test that we did was also a multistart method and chose random starting points to the minimization problem. We can see one of the tests with randomly chosen starting points with 32 initial points.
SLIDE 52
Surfaces tested
50
SLIDE 53
Results and tests comparison
51
◮ Run time:
Surface xmin Time Tests Time (M.C.D.) Time (R.C.S.P.) Arm ( -2.7444 0.0799 ) 839.97s 17.56s 17.79s Human skull ( 3.1004 −0.4287 ) 240.30s 9.46s 9.17s Horse ( −1.4316 0.2639 ) 282.88s 10.91s 9.68s Max ( -2.9084
- 0.0235 )
467.67s 7.16s 9.95s Human heart ( −2.6011 0.0370 ) 687.55s 13.03s 12.94s Knight ( −1.4726 0.0074 ) 56.89s 5.21s 4.36s Bunny ( −0.1788 0.5579 ) 299.01s 16.41s 12.91s Camel ( 2.9598
- 1.4669 )
210.65s 5.16s 5.35s Cow ( −1.5708 −0.0924 ) 251.59s 6.81s 7.37s
SLIDE 54
Results and tests comparison
52
◮ Material length and printing time: Surface Usual Orientation Our Orientation Arm 4.82m / 1h40min 3.32m / 1h16min Human skull 5.11m / 1h48min 4.30m / 1h40min Horse 5.80m / 2h03min 3.51m / 1h33min Max 9.47m / 3h03min 6.43m / 2h15min Human heart 12.85m / 4h34min 10.74m / 4h10min Knight 5.57m / 2h14min 4.06m / 1h42min Bunny 7.52m / 2h38min 7.10m / 2h30min Camel 5.81m / 2h08min 3.88m / 1h34min Cow 6.86m / 2h28min 4.65m / 2h04min
SLIDE 55
Some examples on Slic3r
53
Usual Orientation Our Orientation
Usual Orientation Our Orientation
SLIDE 56
Results and tests comparison
54
◮ Material length and printing time: Surface Our Orientation Alexander’s Orientation Arm 3.32m / 1h16min 4.14m / 1h45min Human skull 4.30m / 1h40min 5.60m / 1h52min Horse 3.51m / 1h33min 6.39m / 2h12min Max 6.43m / 2h15min 6.46m / 2h15min Human heart 10.74m / 4h10min 11.31m / 4h21min Knight 4.06m / 1h42min 5.65m / 2h18min Bunny 7.10m / 2h30min 8.63m / 2h54min Camel 3.88m / 1h34min 5.79m / 2h10min Cow 4.65m / 2h04min 6.73m / 2h24min
SLIDE 57
Some examples on Slic3r
55
Our Orientation Alexander's Orientation Our Orientation Alexander's Orientation
SLIDE 58
3D printing and Overhangs Related Work The group SO(3) and Generalized Euler Sequences Objective Functions Implementation and results Future Work
SLIDE 59
Future Work
57
After having the optimal global rotation determined, we plan to ◮ Develop all Matlab code in C/C++; ◮ Fully differentiable weight function; ◮ Global optimization method ◮ Organize an article for an important conference in the area
SLIDE 60
Future Work
58
◮ Horizontal partitioning of the surface;
0.1 0.2 0.15 0.3 0.4 0.5 0.1 0.6 0.05 0.5 0.4 0.3
- 0.05
0.2 0.1
- 0.1
- 0.1
- 0.2
- 0.3
- 0.15
- 0.4
- 0.5
SLIDE 61
ALEXANDER, P.; ALLEN, S.; DUTTA, D. Part
- rientation and build cost determination in layered
- manufacturing. Computer-Aided Design, Elsevier, v. 30, n.
5, p. 343–356, 1998. BOTSCH, M. et al. Polygon mesh processing. AK Peters/CRC Press, 2010. JACOBSON, A., PANOZZO, D., libigl: A simple C++ geometry processing library, ONLINE: http://libigl.github.io/libigl/, 2017. JACOBSON, A. et al. gptoolbox: Geometry Processing Toolbox ONLINE: http://github.com/alecjacobson/gptoolbox, 2018. VANEK, J., GALICIA, J.A.C., BENES, B., Clever Support: Efficient Support Structure Generation for Digital Fabrication, Computer Graphics Forum, volume 33, number 5, 2014.
SLIDE 62
WANG, W. M., ZANNI, C., KOBBELT, L., Improved Surface Quality in 3D Printing by Optimizing the Printing Direction, Proceedings of the 37th Annual Conference of the European Association for Computer Graphics, 2016. KARASIK, E., FATTAL, R., WERMAN, M., Object Partitioning for Support-Free 3D-Printing, Computer Graphics Forum, volume 38, number 2, 2019. DAI, C., WANG, C.L.C., WU, C., LEFEBVRE, S., FANG, G., LIU, Y. Support-free Volume Printing by Multi-axis Motion, ACM Transactions on Graphics, volume 33, number 5, 2014. HU, R., LI, H., ZHANG, H., COHEN-OR, D., Approximate Pyramidal Shape Decomposition, ACM Transactions on Graphics (Proc. of SIGGRAPH Asia 2014), volume 33, number 6, 2014.
SLIDE 63
Thank you! http://mtm.ufsc.br/∼leo/msc Carlos/index.html
Usual Orientation Our Orientation