based on paper by: rahul khardekar, sara mcmains mechanical engineering university of california,...
TRANSCRIPT
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
2
Outline• Introduction.• Previous work.• GPU.• Depth rendering.• Computing volume of support on the GPU.• Results.• Improvements.• Recent work.
3
Introduction3D Printing techniques
• Additive manufacturing.• The model is sliced and filled.• Each slice is glued with its previous slice.
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.
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.
6
Support Structures
• Why minimize ?– Less material, lower cost.– Reduce printing time.– Less damage to the model.
• Support Structures 4 W.
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.
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.
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.
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
11
GPU vs CPU
12
GPU –rendering pipeline
• Traditional GPUs had a fixed functionality.– OpenGL 1.2.
• Modern GPUs allow programmable stages
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.
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.
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.
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.
17
Depth peeling
View direction
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.
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
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.
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).
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.
23
Results
• Frame buffer 1024*1024.• GPU: NVIDIA 6800 GO• CPU: Pentium 1.6 GHz• 512 MB RAM
• Compared with Insight printing software (Stratasys)
24
Results - Accuracy
• 99% accuracy
25
Results - Performance
26
Results - Performance
27
Results – Running time vs Resolution
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.
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.
30
Speed improvement
Pixel buffer
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.
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%.
33
Recent work
34
Thank you