based on paper by: rahul khardekar, sara mcmains mechanical engineering university of california,...

34
FAST LAYERED MANUFACTURING SUPPORT VOLUME COMPUTATION ON GPUS Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical Conferences FADY MASSARWI 1

Upload: madison-holland

Post on 13-Dec-2015

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

1

FAST LAYERED MANUFACTURING SUPPORT VOLUME COMPUTATION ON

GPUS

Based on paper by:Rahul Khardekar, Sara McMains

Mechanical EngineeringUniversity of California, Berkeley

ASME 2006 International Design Engineering Technical Conferences

FADY MASSARWI

Page 2: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

2

Outline• Introduction.• Previous work.• GPU.• Depth rendering.• Computing volume of support on the GPU.• Results.• Improvements.• Recent work.

Page 3: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

3

Introduction3D Printing techniques

• Additive manufacturing.• The model is sliced and filled.• Each slice is glued with its previous slice.

Page 4: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

4

Slicing

• Parallel slices.• Depends on the slicing direction.• Which slicing direction to choose ?• Several consideration are taken into account when

choosing slicing direction:– Printing time.– Accuracy, especially in sharp features.– Strength.– Surface finish.– Volume of support.

Page 5: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

5

Support Structures

• Another printed material that should be removed after printing.

• Why ?– Overhanging layers– Hollow parts

• Types– Same material – porous structures that are manually

removed– Several materials – material that dissolves with cold

water.

Page 6: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

6

Support Structures

• Why minimize ?– Less material, lower cost.– Reduce printing time.– Less damage to the model.

• Support Structures 4 W.

Page 7: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

7

Volume of Support

• The amount of support volume depends on the slicing/printing z direction.

• Given a triangulated mesh M, what is the build direction d that minimizes the volume of the support structures V ?

• V(M,d): complex non-differentiable function.• Need a method to compute V(M,d).– Challenges:

• Speed.• Accuracy.

Page 8: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

8

Previous related work

• Thompson & Crawford [97] – find a direction that results in a zero support.

• Allen & Dutta [95] – Find direction that gives the minimal volume of support by examining directions parallel and orthogonal to the model convex hull.

• Majhi et al. [99] shows that Allen & Dutta’s algorithm is wrong is not sufficient.

• Majhi et al. [98] & Agarwal et al. [00], presents an algorithm for finding the minimal volume of support, but only for convex models.

• Other geometric methods for computing the volume of support are time consuming.

Page 9: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

9

The GPU• Graphics Processing Unit.• Very efficient in parallel computing.

– Nvidia GTX 980:• 2048 Cores• Texture fill rate: 144 GigaTexels/sec.• 4 GB memory• Supports OpenGL 4.4• 3000 NIS

– Nvidia GTX660:• 960 Cores• Texture fill rate: 78.4 GigaTexels/sec.• 2 GB memory• Supports OpenGL 4.3• 1000 NIS

• Serial memory model. (not appropriate for random access)• Leading companies: Nvidia, ATI.• OpenGL: API for GPUs

– Client – Server architecture.

Page 10: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

10

GPGPU

• General Purpose GPU.• Due to its fast parallel computing, GPU is used

for general non-rendering tasks.• Algorithms are adapted to benefit from the

GPU capabilities.• OpenCL – Open Computation Library– ViennaCL: fast sparse system solver using OpenCL.

• CUDA: Compute Unified Device Architecture – by Nvidia

Page 11: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

11

GPU vs CPU

Page 12: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

12

GPU –rendering pipeline

• Traditional GPUs had a fixed functionality.– OpenGL 1.2.

• Modern GPUs allow programmable stages

Page 13: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

13

GPU – pipeline 2

• Each fragment has several attributes:– Color– Depth

• Each fragment is passed two tests (if requested)– Depth test: hidden surfaces removal.– Stencil test: limiting the rendering area

• Fragment that doesn’t pass the tests is not passed to the framebuffer.

Page 14: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

14

OpenGL• Early OpenGL: Direct mode– Pass the geometry each frame.

• From OpenGL 3, Direct mode is deprecated.• GLSL: OpenGL Shading Language– Maintained by Khronos group.

Page 15: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

15

Mesh orientation

• Oriented mesh has a consistent normal orientation of its faces.– CCW: Normals are facing outside the mesh.– CW: Normals are facing inside the mesh.

• Given a view vector V, and a face F having normal N.– F is front facing if <V,N> is negative (CCW).– Back facing otherwise.

Page 16: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

16

Depth rendering

• Z-buffer algorithm– Each pixel stores in a depth buffer the closest fragment color.– Screen space algorithm.

• Depth Peeling:– Technique for rendering transparent objects.– Use Two depth buffers

• One is the result of previous rendering iteration.

Page 17: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

17

Depth peeling

View direction

Page 18: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

18

Depth peeling implementation

• Use two depth buffer• First buffer is the depth stored from previous

step.– Discard fragments if their Z value is less than the

value in the buffer.• Second buffer is used for regular Z-buffer.– Discard fragments if their Z value is greater than

the value in the buffer.• Copy second buffer to first after each iteration.

Page 19: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

Usage of GPU to compute the VOS

• Use depth peeling-like algorithm

• The volume of support is divided into two categories:– Space between areas visible

from printing direction and the printing base.• First layer.

– Space between front faces and back faces that hides them.

Printing base19

Page 20: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

20

The Algorithm• Input:

– M : oriented closed manifold mesh.– V : printing direction.

• Output: – Volume of support of M from V direction.

1) Initialization– Initialize height_texture, a floating point texture, with screen dimensions and 0

value.– Object bounding box calculation using the GPU. – Calculate pixel area.

2) Setup Camera– Orthographic projection– Looks at the center of the model BBOX.– Placed at the center of the BBOX in XY and minimal BBOX Z at the printing direction.

Page 21: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

21

The Algorithm (2)3. Render the first layer using standard Z-buffer and save the depth

to height_texture.4. n=0.5. while (true) {

5.1 Render the (n+1)th front facing layer. 5.2 If (there is no front faces in previous step) break; 5.3 Render the (n)th backfacing layers (only on pixels rendered in step 4.1 – using stencil test) 5.4 Substract depths from step 4.1 and 4.2 and save to a temporary texture. 5.5 Add the result of 4.4 to height_texture.}

6. S The sum of all values in height_texture.7. Return (S*pixel_area).

Page 22: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

22

Accumulating texture

• Sum values of four pixels

(i,j), (i,j+N/2), (i+N/2,j), (i+N/2,j+N/2)

and store it in pixel (i,j).

• Iterate until no division is allowed.– log(N) iterations.

Page 23: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

23

Results

• Frame buffer 1024*1024.• GPU: NVIDIA 6800 GO• CPU: Pentium 1.6 GHz• 512 MB RAM

• Compared with Insight printing software (Stratasys)

Page 24: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

24

Results - Accuracy

• 99% accuracy

Page 25: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

25

Results - Performance

Page 26: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

26

Results - Performance

Page 27: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

27

Results – Running time vs Resolution

Page 28: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

28

Discussion - Conclusion

• Significantly faster than software implementations.

• 1% accuracy error.• Several error sources:– Triangulation error (compared with the designed

model).– Discretization error (pixel size)– Floating point error.

Page 29: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

29

Speed Improvement

• Other algorithm with one rendering pass.– Initialize for each pixel a buffer of values– Add the printing plane to the model.– Render the object and store the z values of all

fragments on the same pixel.– After rendering, sort the values at each pixel, and

sum the differences between each pair.

Page 30: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

30

Speed improvement

Pixel buffer

Page 31: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

31

Accuracy Improvements

• Accuray – Use the geometry shader to better rasterize thin triangles.

• Calculate exact voxel volume, by computing intersection between triangle and box – time consuming.

Page 32: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

32

Recent work• J. Vanek , J. A. G. Galicia, B. Benes.

“Clever Support: Efficient Support Structure Generation for Digital Fabrication”, Eurographics Symposium on Geometry Processing 2014.

• Find orientation with minimal hanging areas.• Sample these areas according to printer resolution.• Build a trees of support from all sample points by growing

support structures from each point.• Automatic• Reduce printing time by 30% and printed material by 40%.

Page 33: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

33

Recent work

Page 34: Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical

34

Thank you