vtk 라이브러리를활용한 cad &...

26
Gyeongmo Nam([email protected]) This document is the informational asset of Doosan Heavy Industries & Construction. Thus, unauthorized access, revision, distribution and copying of this document are strictly prohibited. VTK 라이브러리를 활용한 CAD & 데이터 후처리 [2019 8 th OpenFOAM Korea Users’ Community Conference] 2019.09.26 두산중공업

Upload: others

Post on 04-Jun-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

Gyeongmo Nam([email protected])

This document is the informational asset of Doosan Heavy Industries & Construction. Thus, unauthorized access, revision,

distribution and copying of this document are strictly prohibited.

VTK 라이브러리를활용한 CAD & 데이터후처리

[2019 8th OpenFOAM Korea Users’ Community Conference]

2019.09.26

두산중공업

Page 2: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

Introduction to The Democratization of Computational

Fluid Dynamics

1

Objects

Introduction to VTK and it’s installation & configuration

From simple to complicated(?) examples

VTK Library

Examples

CONTENTS

Page 3: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

CONTENTS

2

The Democratization of

Computational Fluid Dynamics

CFD는소수의전유물이여야하는가?

출처 : www.mentor.com

Difficult to use

Complicated pre-processing

Needs long time to see results

Requires huge investment in hardware & S/W

Etc.

Objects

VTK Library

Examples

Conclusion

Page 4: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

CONTENTS

3

On Going Project

Objects

VTK Library

Examples

CFD

CAD

POST

MESH

Integrated Graphical User Interface Program

Conclusion

Page 5: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

CONTENTS

4

On Going Project

Objects

VTK Library

Examples

CAD MESH PostCFD

Integrated Graphical User Interface Program

Salome

PlatformOpenFOAM

SnappyHexMesh

OpenFOAM

Solvers

Paraview

Easy to use

- Designer oriented GUI

Low cost

- Open source s/w

Heavy Program

- Individual program installation

Time delay occur when execute third-party program

with script

Conclusion

Page 6: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

CONTENTS

5

On Going Project

Objects

VTK Library

Examples

CAD MESH PostCFD

Integrated Graphical User Interface Program

VTK

OpenFOAM

SnappyHexMesh

OpenFOAM

Solvers

VTK

Time Reduction : a geometry made in 1~3 seconds

No need to install Salome & Paraview

Conclusion

Page 7: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

6

Objects

VTK Library

Examples

CONTENTS

Definition

Features

Applications

Installation

Configuration

Conclusion

Page 8: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

7

Objects

VTK Library

Examples

CONTENTS

• Visualization Tool Kit

- Open Source (BSD license)

- 3D Computer Graphics

- Scientific Visualization

- Mesh and Image Processing

• Managed by Kitware Inc.

• Solutions

- Paraview, 3D Slicer

Definition

출처 : vtk.org

Conclusion

Page 9: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

8

Objects

VTK Library

Examples

CONTENTSFeatures

• Provides binding to another code

languages

- Tcl/TK

- Python

- Java

• Object-oriented

Interpreted Wrapper

(Tcl, Java, Python)

Compiled Core

(C++)

System Architecture

Conclusion

Page 10: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

9

Objects

VTK Library

Examples

CONTENTSApplications

• Visualization

- 3D Image

- Information visualization

- Etc.

• Image Processing

- Medical Image

- Registration

- Etc.

• Computer Vision

- 3D reconstruction

- Video Analysis

- Etc. 출처:www.kitware.eu

Conclusion

Page 11: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

10

Objects

VTK Library

Examples

CONTENTSVisualization Pipeline

출처 : The VTK User’s Guide

Conclusion

Page 12: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

11

Objects

VTK Library

Examples

CONTENTSActiViz

출처 : The VTK User’s Guide

• 3D Visualization ToolKit for .NET/C#

• Open-source software system for 3D Visualization wrapped in

C#

• Built around the Visualization ToolKit

• Supports a wide variety of visualization algorithms including

scalar, vector, tensor, texture, and volumetric methods

• Includes advanced modeling techniques

- implicit modeling, polygon reduction, mesh smoothing,

cutting, contouring, and Delauny triangulation

Conclusion

Page 13: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

12

Objects

VTK Library

Examples

CONTENTSInstallation

1. Go to “https://www.kitware.eu/product/activiz”

2. Download

3. Install

Conclusion

Page 14: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

13

Objects

VTK Library

Examples

CONTENTSConfiguring

1 2

3Conclusion

Page 15: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

14

Objects

VTK Library

Examples

CONTENTSConfiguring

Conclusion

Page 16: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

15

Objects

VTK Library

Examples

CONTENTSVTK Tutorials

Conclusion

Page 17: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

16

Objects

VTK Library

Examples

CONTENTSSphere Rendering

vtkSphereSource sphere = vtkSphereSource.New();

sphere.SetThetaResolution(32);

sphere.SetPhiResolution(32);

sphere.SetRadius(0.5);

sphere.SetCenter(0,0,0);

vtkPolyDataMapper mapper = vtkPolyDataMapper.New();

mapper.SetInputConnection(sphere.GetOutputPort());

Mapper.Update();

vtkActor point = vtkActor.New();

point.SetMapper(mapper);

point.GetProperty().SetColor(0, 1, 0);

point.SetPosition(0,0,0);

vtkRenderer render = vtkRenderer.New();

render = this.renWin.RenderWindow.GetRenderers().GetFirstRenderer();

render.AddActor(point);

this.renWin.refresh();

Conclusion

using Kitware.VTK;

Page 18: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

17

Objects

VTK Library

Examples

CONTENTS

Conclusion

Import STL

Export STL

User Defined Geometries

Sliced Contour

Post-Examples

Page 19: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

18

Objects

VTK Library

Examples

CONTENTSImport STL

string filePath = “D:\Examples\test.stl”;

vtkSTLReader STL_Reader = new vtkSTLReader();

STL_Reader.SetFileName(filePath);

STL_Reader.Update();

vtkDataSetMapper STL_Mapper = new vtkDataSetMapper();

STL_Mapper.SetInputConnection(STL_Reader.GetOutputPort());

STL_Mapper.Update();

vtkActor STL_Actor= new vtkActor();

STL_Actor.SetMapper(STL_Mapper);

STL_Actor.GetProperty().SetEdgeColor(0, 0, 0);

STL_ActorGetProperty().SetColor(0.75, 0.75, 0.75);

STL_Actor.GetProperty().SetOpacity(0.3);

vtkRenderer render = vtkRenderer.New();

render = this.renWin.RenderWindow.GetRenderers().GetFirstRenderer();

render.AddActor(point)

Conclusion

Page 20: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

19

Objects

VTK Library

Examples

CONTENTSExport STL

vtkTransform Transform = new vtkTransform();

Transform.PostMultiply();

Transform.Translate(1.0, -2.2, 4.5);

vtkTransformFilter transformFilter = vtkTransformFilter.New();

transformFilter.SetTransform(Transform);

transformFilter.SetInputConnection(previewMapper.GetInputConnection(0, 0));

transformFilter.Update();

vtkDataSetSurfaceFilter surface_filter = vtkDataSetSurfaceFilter.New();

surface_filter.SetInputConnection(transformFilter.GetOutputPort());

vtkTriangleFilter triangle_filter = vtkTriangleFilter.New();

triangle_filter.SetInputConnection(surface_filter.GetOutputPort());

string filePath = “D:\Examples\test.stl”;

vtkSTLWriter writer = vtkSTLWriter.New();

writer.SetInputConnection(triangle_filter.GetOutputPort());

writer.SetFileName(filePath);

writer.Write();

Conclusion

Page 21: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

20

Objects

VTK Library

Examples

CONTENTSUser Defined Geometries

Cylinder Box Flow Around

Cylinder

Conclusion

Page 22: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

21

Objects

VTK Library

Examples

CONTENTSUser Defined Geometries

Guide Vane Orifice ETC

Conclusion

Page 23: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

22

Objects

VTK Library

Examples

CONTENTSSlice Contour

vtkPlane Plane = vtkPlane.New();

Plane.SetOrigin(0,0,0);

Plane.SetNormal(0,1,0);

vtkCutter Cut = vtkCutter.New();

Cut.SetCutFunction(Plane);

Cut.SetInputConnection(Reader.GetOutputPort());

Cut.Update();

vtkDataSetMapper Mapper = vtkDataSetMapper.New();

Mapper.SetInputConnection(Cut.GetOutputPort());Conclusion

Page 24: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

23

Objects

VTK Library

Examples

CONTENTSPost-Examples

Slice Contour Data Clip

Probe Flow Network

Conclusion

Page 25: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

CONTENTS

IS

THIS

USERFUL

?

24

Objects

VTK Library

Conclusion

Examples

Page 26: VTK 라이브러리를활용한 CAD & 데이터후처리nextfoam.co.kr/proc/DownloadProc.php?fName=191007182414... · Gyeongmo Nam(gyeongmo.nam@doosan.com) This document is the informational

25