<<

Visualization for Runner System Design in

Thesis

Presented in Partial Fulfillment for the Requirements for the Degree Master of Science in the Graduate School of the Ohio State University

By

Zhaohui Ning, M.A

Graduate Program in Industrial & System Engineering

The Ohio State University

2009

Thesis Committee:

Dr. R.Allen Miller, Adviser

Dr. Jerald R. Brevick

Copyright by

Zhaohui Ning

2009

Abstract

The research focuses on the development of a die casting runner system design

process, and the visualization of this process. It provides a simple and flexible data

representation for the runner system data and a user interface in CastView to create this

data. The design process includes two steps. The first step is to create profiles. The

second step is to create runner system data. Profile creation utilizes b-spline curve fitting

algorithms to generate profiles with a uniform number of profile points from user defined sketches with a none-uniform number of sketch points. Runner system surfaces are

created by sweeping interpolated profiles along user defined curve paths. To fully define

runner system surfaces and promise their smoothness, curve paths’ shapes and

interpolation methods need to be defined. Different shapes and different interpolation

methods can be applied to a sweep path. In the implementation presented here, circle is

used for path shape and s-function interpolation is applied to normal and planar points.

With these configurations, smooth sweep runner system surfaces have been illustrated.

ii

Dedication

Dedicated to my parents, wife and friends

iii

Acknowledgments

I would like to express my sincere gratitude to my advisor, Dr. R. Allen Miller, for his guidance, support and encouragement over these years. He has been so enthusiasm and dedicated as a great researcher.

I would like to state my sincere appreciation to Dr. Jerald R. Brevick for enhancing me with the background knowledge and encouraging me at time I need.

I would like to say thanks to my parents, who brought me up, bestowed me capacities and skills and taught me never to give up.

I would also like to say thanks to my friends in China, whose sincerity gave me so much strength to face difficulties.

At last, I would like to express my deepest gratitude to my beloved wife, Hongyan He, who gave me so much support, attention and consideration for more than ten years.

iv

Vita

January 1st, 1974 …………………………… Born – Qingdao, Shandong, P. R. China

September, 1992 – July, 1996 ……………… B.S. Mechanical Engineering Qingdao University Qingdao, P. R. China

September, 1996 – March, 1999 …………… M.S. Mechanical Engineering Shanghai University Shanghai, P. R. China

September, 2003 – Present ………………… Graduate Research Associate Industrial and Systems Engineering The Ohio State University Ohio, USA

Fields of Study

Major Field: Industrial & System Engineering Minor Field: Computer Science and Engineering Areas of Interest: CAD/CAM, Computer Graphics and Animation, Software Engineering, Game Development

v

Table of Contents

1.TU INTRODUCTIONUT...... 1

1.1.TU Die Casting...... UT 1

1.2.TU Die Casting ProcessUT ...... 2

1.3.TU Thesis OutlineUT ...... 3

2.TU DIE CASTING DIE DESIGNUT ...... 4

2.1.TU Die Casting DieUT ...... 4

2.2.TU Die Casting ShotUT ...... 5

2.2.1.TU CavityUT ...... 5

2.2.2.TU BiscuitUT ...... 5

2.2.3.TU RunnerUT ...... 5

2.2.4.TU GateUT ...... 6

2.2.5.TU OverflowUT ...... 7

2.3.TU Die Casting Design PrinciplesUT ...... 8

2.3.1.TU Runner design guidelinesUT ...... 8

2.3.2.TU Fan gate design guidelinesUT ...... 8

2.4.TU CastViewUT ...... 9

3.TU PROBLEM STATEMENT AND RESEARCH OBJECTIVESUT ...... 12

3.1.TU Problem StatementUT ...... 12

3.2.TU Research ObjectivesUT ...... 15

4.TU DIE CASTING DESIGN LITERATURE REVIEWUT ...... 17

4.1.TU Parametric DesignUT ...... 17

4.2.TU Die Design SystemsUT ...... 17

4.3.TU Die Casting Process Studies...... UT 22

4.4.TU ConclusionsUT ...... 26

5.TU CAGD LITERATURE REVIEWUT ...... 28

5.1.TU IntroductionUT ...... 28

5.2.TU Bezier CurveUT ...... 28

5.3.TU B-spline CurveUT ...... 29

5.4.TU Open Uniform B-spline CurveUT ...... 30

5.5.TU B-spline Knot InsertionUT ...... 30

5.6.TU B-spline Curve Fitting...... UT 32

5.7.TU SurfacesUT ...... 35

5.7.1.TU Ruled SurfaceUT ...... 35

5.7.2.TU Coons SurfaceUT ...... 36

5.7.3.TU B-spline SurfaceUT ...... 38

5.8.TU Ray-Curve IntersectionUT ...... 38

5.8.1.TU Bisection MethodUT ...... 39

vi

5.8.2.TU Regula-Falsi MethodUT ...... 40

5.8.3.TU Newton Raphson MethodUT ...... 42

5.9.TU Curve-Curve IntersectionUT ...... 43

5.9.1.TU Newton Raphson MethodUT ...... 43

5.9.2.TU Bezier Clipping MethodUT ...... 44

5.9.3.TU Recursive Subdivision MethodUT ...... 46

5.10.TU Curve-Surface IntersectionUT ...... 48

5.11.TU Surface-Surface IntersectionUT ...... 48

6.TU ALGORITHM DEVELOPMENTUT ...... 50

6.1.TU Surface LoftingUT ...... 50

6.1.1.TU Problem StatementUT ...... 50

6.1.2.TU SolutionUT ...... 51

6.2.TU Surface Sweeping...... UT 52

6.2.1.TU Problem StatementUT ...... 52

6.2.2.TU SolutionUT ...... 53

6.3.TU Ray-Curve IntersectionUT ...... 54

6.4.TU Curve-Curve IntersectionUT ...... 54

6.4.1.TU Problem StatementUT ...... 54

6.4.2.TU SolutionUT ...... 55

6.4.3.TU Convex Hull ConstructionUT ...... 56

6.4.4.TU Point Outside Convex Hull CheckUT ...... 58

6.4.5.TU Convex Hull Overlapping CheckUT ...... 58

6.5.TU ConclusionUT ...... 60

7.TU SYSTEM DEVELOPMENTUT ...... 61

7.1.TU System DesignUT ...... 61

7.2.TU Sweep pathUT ...... 62

7.2.1.TU Line Shape Sweep pathUT ...... 62

7.2.2.TU Circle Shape Sweep pathUT ...... 63

7.2.3.TU Point Shape Sweep pathUT ...... 64

7.3.TU Interpolation MethodsUT ...... 65

7.3.1.TU Linear InterpolationUT ...... 65

7.3.2.TU S-function InterpolationUT ...... 65

7.3.3.TU Linear Vector InterpolationUT...... 66

7.3.4.TU S-function Vector InterpolationUT ...... 67

7.4.TU Profile Definition ProcessUT ...... 70

7.4.1.TU Profile Data StructureUT ...... 71

7.4.2.TU Sketch DefinitionUT ...... 71

7.4.3.TU Fitting Curve GenerationUT ...... 74

7.4.4.TU Approximation Curve GenerationUT...... 74

7.4.5.TU Interpolation Points GenerationUT ...... 77

vii

7.5.TU Runner System Definition ProcessUT ...... 78

7.5.1.TU Runner Data StructureUT...... 78

7.5.2.TU Parting PlaneUT ...... 79

7.5.3.TU Trajectory DefinitionUT ...... 81

7.5.4.TU Profile AssignmentUT ...... 82

7.5.5.TU Sweep path Definition...... UT 85

7.5.6.TU Sweep ProcessUT ...... 87

7.5.7.TU Solid GenerationUT ...... 89

8.TU CONCLUSION AND FUTURE WORKUT ...... 91

8.1.TU ConclusionUT ...... 91

8.2.TU Future WorkUT ...... 92

REFERENCESTU UT ...... 93

viii

List of Figures

FigureTU 1: Die Casting Products (NADCA [29])UT ...... 1

FigureTU 2: Diagram of the Die Casting Process (NADCA [34])UT ...... 2

FigureTU 3: Die Casting Shot (NADCA [29])UT ...... 4

FigureTU 4: Runner System Example (with Die Cavities, NADCA [29])UT ...... 6

FigureTU 5: Common Gate Shapes (NADCA [29])UT ...... 7

FigureTU 6: Main Interface of CastViewUT ...... 9

FigureTU 7: Runner System Design of CastViewUT ...... 10

FigureTU 8: Fill Simulation of CastViewUT ...... 10

FigureTU 9: Thermal Simulation of CastViewUT...... 11

FigureTU 10: User Defined Polygon SketchUT ...... 12

FigureTU 11: User Defined Trajectory TreeUT...... 13

FigureTU 12: Result Runner System SolidUT ...... 13

FigureTU 13: Curve Based ApproachUT ...... 14

FigureTU 14: Flow chart of die design system (Kim [14])UT ...... 18

FigureTU 15: Flow chart for die layout design (Kim [14])UT ...... 19

FigureTU 16: The flowchart of gating feature creation and retrieval (Wu [12])UT ...... 20

FigureTU 17: System architecture and menu options (Wu [12])UT...... 20

FigureTU 18: Flowchart of the die design system for die casting (Woon [5])UT ...... 21

FigureTU 19: Modeling of runner and gating with branch angle Ө (Sulaiman [20])UT ...... 23

FigureTU 20: Possible output vector from voxel a (Wang [6])UT ...... 25

FigureTU 21: Surfaces Commonly Used in Engineering Design ([48])UT ...... 35

FigureTU 22: Extrusions and Lofted Surfaces ([41])UT ...... 36

FigureTU 23: Coons Surface ([48])UT...... 37

FigureTU 24: Bisection Method ([43])UT ...... 39

FigureTU 25: Regula-Falsi Method ([44])UT ...... 40

FigureTU 26: Newton Raphson Method ([45])UT ...... 42

FigureTU 27: Newton Raphson Method ([39])UT ...... 43

FigureTU 28: The Fat Line for a Bezier Curve ([39])UT ...... 44

FigureTU 29: Sederberg-Nishita Bezier Clipping ([39])UT ...... 45

FigureTU 30: Four-sided Region Intersection ([47])UT ...... 47

FigureTU 31: Surface Lofting ProblemUT ...... 51

FigureTU 32: Surface Sweeping ProblemUT ...... 52

FigureTU 33: Surface Sweeping ResultUT ...... 53

FigureTU 34: Convex Hull SubdivisionUT ...... 56

FigureTU 35: Point outside Convex Hull CheckUT ...... 57

FigureTU 36: Failure of Inside/Outside CheckUT ...... 58

FigureTU 37: Convex Hull Overlapping CheckUT ...... 59

FigureTU 38: Line Shape Sweep pathUT ...... 62

FigureTU 39: Circle Shape Sweep pathUT ...... 63

FigureTU 40: Point Shape Sweep pathUT ...... 64

FigureTU 41: Smoothstep S-functionUT ...... 66

FigureTU 42: Linear and S-function Planar Point Interpolation ComparisonUT ...... 66

FigureTU 43: Vector InterpolationUT ...... 67 ix

FigureTU 44: Linear and S-function Vector Interpolation ComparisonUT ...... 68

FigureTU 45: Linear and S-function Interpolation ResultsUT ...... 68

FigureTU 46: Profile ExampleUT ...... 70

FigureTU 47: Profile Data StructureUT ...... 71

FigureTU 48: Profile Sketch ViewUT ...... 72

FigureTU 49: Profile Sketch Definition InterfaceUT ...... 72

FigureTU 50: Profile Fitting Curve ViewUT ...... 73

FigureTU 51: Profile Fitting Curve Generation InterfaceUT ...... 73

FigureTU 52: Profile Approximation Curve ViewUT ...... 74

FigureTU 53: Profile Approximation Curve Generation InterfaceUT ...... 75

FigureTU 54: Profile Interpolation Points ViewUT...... 76

FigureTU 55: Profile Interpolation Points Generation InterfaceUT ...... 76

FigureTU 56: Runner Data StructureUT ...... 78

FigureTU 57: Parting Plane Open DialogUT ...... 79

FigureTU 58: Runner Trajectory ViewUT ...... 80

FigureTU 59: Runner Trajectory Definition InterfaceUT ...... 80

FigureTU 60: Runner Profile Assignment ViewUT ...... 82

FigureTU 61: Pick TrajectoriesUT ...... 82

FigureTU 62: Runner Profile Assignment InterfaceUT ...... 84

FigureTU 63: Runner Path ViewUT ...... 84

FigureTU 64: Sweep path ExampleUT...... 85

FigureTU 65: Pick Connecting TrajectoriesUT ...... 85

FigureTU 66: Runner Path Definition InterfaceUT ...... 86

FigureTU 67: Runner Sweep ViewUT...... 87

FigureTU 68: Runner Sweep Definition InterfaceUT ...... 88

FigureTU 69: Runner Solid Generation InterfaceUT ...... 89

FigureTU 70: Runner Solid ViewUT ...... 90

x

CHAPTER 1

1. INTRODUCTION

1.1. Die Casting

Die casting is a part of the casting industry. Die casting is a versatile process for producing engineered metal parts by forcing molten metal under high pressure into reusable steel molds. These molds, called dies, can be designed to produce complex shapes with a high degree of accuracy and repeatability. Parts can be sharply defined, with smooth or textured surfaces, and are suitable for a wide variety of attractive and serviceable finishes (NADCA [34]).

Figure 1: Die Casting Products (NADCA [29]) 1

Castings of all kinds are used in 90% of all manufactured products. The die casting industry produces over one-third of all metal . Over 500 die casting plants produce castings for many markets (NADCA [29]).

Die Casting produces components at high production rates. It uses a range of durable metal alloys and it faithfully captures the most intricate design details. The advantage of Die Casting is it can produce components of either high volume or lower volume at low costs (NADCA [29]).

1.2. Die Casting Process

There are four major steps in the die casting process. First, the mold is sprayed with lubricant and closed. The lubricant both helps control the temperature of the die and it also assists in the removal of the casting. Molten metal is then injected into the die under high pressure. The high pressure assures a casting as precise and as smooth as the mold. Typically it is around 100 megapascals. Once the cavity is filled then the pressure is maintained until the casting has become solid (though this period is usually made short as possible by water cooling the mold). Finally, the die is opened and the casting is ejected.

Figure 2: Diagram of the Die Casting Process (NADCA [34])

2

The design of a die is primarily determined by the shape of the finished components. However, other factors may also impact the design and should be considered in the design. For example, the sizing of a gate can have an influence on the die life. An optimum casting condition requires a heat balance between the cooling system and the hot parts (runners, gates, overflows). This means that the design of the runner, gate and overflow system is of great importance. To process parts which are difficult to be filled, an overflow may be located to help casting metal to flow into those parts. To handle multi-cavity dies with identical impressions, it is important that all runners have the same path length and cross-sectional area and the gates and overflows are identical.

1.3. Thesis Outline

Chapter 2 has a brief introduction to the die casting process and runner system define principles. Chapter 3 has a problem statement and a list of research objectives. Chapter 4 has a review of die casting system design related literatures. Chapter 5 has a review of CAGD (computer aided geometry design) related literatures. Chapter 6 includes some developed (CAGD related) algorithms. These algorithms are either used now or are developed for potential uses of future development. Chapter 7 shows the development of the system which includes methods, user interfaces and results. Chapter 8 includes some conclusion and suggestions for future works.

3

CHAPTER 2

2. DIE CASTING DIE DESIGN

2.1. Die Casting Die

Casting die has four functions. 1) Hold molten metal in the shape of the desired casting. 2) Provide a means for molten metal to get into the space where it is held in desired shape. 3) Remove heat from molten metal to solidify it. 4) Provide for removal of the solidified metal (NADCA [29]).

Figure 3: Die Casting Shot (NADCA [29]) 4

2.2. Die Casting Shot

A die casting shot is the injection of metal into the die. It includes all of the material injected into the die. Shot elements include Biscuit, Runner, Overflows and Casting. Figure 3 is an illustration of a shot in a cold chamber system (overflows are not illustrated).

2.2.1. Cavity

The cavity is the void or empty space in the die that fills with metal to make the casting. Figure 3 has an illustration of a casting formed from a cavity.

2.2.2. Biscuit

The biscuit is the excess of ladled metal remaining in the shot sleeve of a cold chamber die casting machine. It is part of the cast shot and is removed from the die with the casting (NADCA [35]). Figure 3 has an illustration of a biscuit of a cold chamber system.

2.2.3. Runner

The runner is the die passage connecting or plunger holes of a die to the gate where molten metal enters the cavity or cavities. It is the die casting alloy distribution system within the casting die (NADCA [29]). Figure 4 is an illustration of a runner system (Wu [12]).

The Runner System of a die-casting die consists of a series of passages through which the molten metal can flow into the die and then into the interior of the die to fill the cavity. A plunger is used to push the molten metal into the gating system.

With the movement of the plunger, molten metal is forced into the cavity through

5

channels which are called runners. The runners are usually approximately trapezoidal in cross section. There may be more than one runner radiating from the biscuit or sprue, and any one runner may split into two or more as required to direct the molten metal to various locations. As the runner approaches the cavity, it blends from the trapezoidal shape into a slit-like opening, and then enters the cavity. The blended portion is called the “gate runner” and the slit-like opening into the cavity is called the “gate”.

The basic function of the Runner System is to provide a system of passageways for the molten metal to flow through to get into the cavity. Once in the cavity, the metal will solidify into the desired casting.

Figure 4: Runner System Example (with Die Cavities, NADCA [29])

2.2.4. Gate

Gate is the passage for molten metal which connects runner with die cavity. Gate is the metal entry point to the casting cavity that generally provides the smallest restriction in the alloy flow path, located at the edge of the casting. It is part of the runner feed system 6

(NADCA [29]). Gate design includes gate location design and gate shape design.

Figure 5: Common Gate Shapes (NADCA [29])

The position of the gates and the thickness and width of the land are critical for the injection speed of the metal. The gates should be designed to make the injected metal flowing smoothly and freely into all parts of the cavity. Excessive turbulence of casting metal can cause erosion of the die.

2.2.5. Overflow

An overflow is a reservoir for the first metal to flow through the cavity. An overflow is a small pocket located around the edge of the casting. Vents (path from the die cavity to outside the die) from overflows provide a path for air to get out of the die. Strategically placed overflows can be used to add heat in a cold area of the die. Overflow also helps ejecting the casting from the die (NADCA [29]).

7

2.3. Die Casting Design Principles

A successful configuration of a die casting design has three objectives. First, it fills the cavity completely with metal. Second, solidify quickly without defects. Third, metals eject readily from the die. These objectives can be achieved by six basic principles (NADCA [29]).

1. Wall thickness should be as consistent as possible. 2. Intersections of walls, ribs and gussets should blend with transitions and adequate radius. 3. is highly desirable on surfaces parallel to the direction of die draw. 4. Eliminate or minimize sharp corners. 5. Avoid undercuts. This may require operations or additional die components, such as retractable slides. 6. Dimensions with critical tolerances should be contained in only one die member.

2.3.1. Runner design guidelines

1. Runner area must be ever-decreasing from sleeve or sprue to gate. 2. Runner design must be smooth and rounded. 3. Smooth and ever-decreasing runners can be made much smaller and more efficient, saving money and energy. 4. Start at the casting, increase area 3% to 5% at every bend, and 3% to 10% at a Y junction. 5. If possible, make the distance to each cavity the same.

2.3.2. Fan gate design guidelines

1. Area reduction must be even from runner to gate. 2. This means one side must be curved - if not done, gate traps air, makes porosity. 3. Straight fan has curved depth. 8

4. Curved fan has curved sides. 5. Flow angle should be less than 30° if possible; 45 ° should be considered the maximum. 6. Higher flow angles mean metal does not flow in edges of gate. 7. Ratio of gate width to gate length is about 1.5 max to meet desired flow angles 8. Area reduction from the runner to the gate is typically should be 5% to 35%. 9. Runner should be straight for a minimum of about .5 in at entry if possible.

2.4. CastView

The best way to improve design efficiency and precision is to apply computer techniques aiding the design processes. Modern computers and the availability of commercial simulation codes have opened new avenues in designing, prototyping and analyzing the die casting system.

Figure 6: Main Interface of CastView

9

CastView is a die design software developed by the Industrial and System Engineering Department under the supervision of Dr. R. Allen Miller. It is an effective tool to quickly evaluate key features that affect the diecastability of a part design has been developed. It can be easily integrated with any CAD tools. Figure 6 is an illustration of the main interface of CastView, and Figure 7 is an illustration of the runner system design interface of CastView.

Figure 7: Runner System Design of CastView

Figure 8: Fill Pattern Simulation of CastView

CastView is designed to help minimize flow-related filling problems, thermal problems in

10

the die casting die, and solidification-related defects in the cast part. Figure 8 is an illustration of the fill pattern simulation process of CastView, and Figure 9 is an illustration of the thermal simulation process of CastView.

Figure 9: Thermal Simulation of CastView

CastView is developed in C++, using Microsoft Foundational Classes (MFC) and the OpenGL library. It is executable under Microsoft Windows environment.

11

CHAPTER 3

3. PROBLEM STATEMENT AND RESEARCH OBJECTIVES

3.1. Problem Statement

Die casting die design consists of the selection of materials for die casting alloys, the application of shrinkage, and the development of a casting plan including designs of casting, gate, runner, and overflow. While manufacturing die design is in demand for high-precision work and short delivery dates, in most cases, it is designed by determining product geometry. This requires experience and know-how and experts who have skills in die manufacture (Choi [10]).

For the runner system design in die casting, traditionally, inputs of a design system include: user defined polygon sketches (Figure 10), a user defined trajectory tree (Figure 11) and other user defined parameters. Output of the design system is a closed runner system solid (Figure 12) that can be triangulated into STL data format.

Figure 10: User Defined Polygon Sketch 12

Considering that user defined polygon sketches might have different number of points at different locations and parting planes might be stepped, the implementation of the design system is not trivial.

Figure 11: User Defined Trajectory Tree

Figure 12: Result Runner System Solid

In a curve base approach, runner system objects are constructed from relatively simple geometries like polygon profiles and b-spline curves. A surface is described virtually in B-Spline curves defined by users.

13

A typical design process following the curve based approach is described below.

1) Design runner profiles and gate profiles (Figure 10). 2) Design runner system trajectories (Figure 11). 3) Assign profiles to trajectories (Figure 13, a). 4) Generate edges between profile points (Figure 13, b). 5) Generate curves based on edges (Figure 13, c). 6) Identify facets from curves and edges (Figure 13, d). 7) Triangulate identified facets (Figure 13, e).

Figure 13: Curve Based Approach

14

The curve based approach does not use a real surface representation. It is still possible to fulfill runner system design objectives, because both input and output of the design progress are triangle meshes.

This approach does have some drawbacks. i. It requires extra user operations on defining curves which is very complex and not intuitive. ii. Users can not control shape of surfaces visually. iii. Smoothness of a result surface (in polygon representation) can not be promised and undercuts can possibly be produced. iv. Algorithms developed in this approach are sensitive to user errors as surfaces need to be detected from user defined data. v. Extra problems might arise due to the lack of a surface representation. For example, when doing surface-surface intersection, a zigzag intersection line might be produced.

3.2. Research Objectives

The goal of this research is to provide users a modeling tool to create runner system geometries. This modeling tool provides a convenient way to create smooth runner system sweep surfaces from user defined polygon sketches. It allows user to control result surfaces with no need of specific knowledge.

Particular objectives of this research are: 1. To implement a method to convert user defined polygon sketches to B-spline curve based profile. 2. To develop a method to make a user defined trajectory tree concrete to represent flow paths. 3. To develop a method to generate smooth sweep surfaces based on generated runner profiles and flow paths.

15

4. To implement a profile definition and a runner system definition interface.

16

CHAPTER 4

4. DIE CASTING DESIGN LITERATURE REVIEW

4.1. Parametric Design

For years the estimation of gating dimensions has been based on previous experience and application of various empirical and complex equations. Even today, the exact requirements of the gating system to guarantee the production of high-quality casting is not fully understood, but only general rules are available.

Shehata [8] wrote a computer program to generate die diagram based on the geometry input of casting and select die casting machine based on database of available machine capabilities in concerned . The program can be used to calculate die characteristics such as filling time, gating dimensions and number of die cavities. Also, it gives the machine characteristics such as plunger diameter, melt pressure and injection flow rate. Moreover, cooling times, cooling channel locations, and flow rates are estimated and presented.

4.2. Die Design Systems

There have been some recent studies on automated or semi-automated design of individual die elements, but there is little published work in these areas. Most published work has concentrated on the gating system of die design. (Woon [5])

17

Kim [14] proposed an easy die design system for die casting product. The system is composed of three sub-systems (Figure 14). Specific rules and equations for the runner–gate system are presented to avoid too many trials and errors with expensive equipment. This system makes it possible for engineers to make an automatic and efficient die design, and will result in reduction of expense and time. But this system supports only simple shapes, and can not be applied for solidification, flow analysis, and numerical control machining data because it is constructed with simple wire frames.

Figure 14: Flow chart of die design system (Kim [14])

Choi [10] improved Kim [14] ’s system. In this study, a die design system for the die casting process has been developed which presents an algorithm for the automation of die design, especially of the runner–gate system. In addition, specific rules and equations for the runner–gate system have been presented to avoid too much trial and errors of expensive equipment. This makes it possible for engineers to make automatic and efficient die design of die casting and it will result in the reduction of cost and time

18

required. However, the system is only applicable for simple shapes such as the cap-shape. Moreover, the system can only be used for single impression dies and products that have no undercuts.

Figure 15: Flow chart for die layout design (Kim [14])

Wu [12] developed a prototype design of a gating system for a die-casting using a P-Q2 technique and feature-based parametric design. The flowchart of the system is illustrated in Figure 16. To determine process parameters, the system contains an algorithm (“Flow Estimation” in Figure 16) to find an optimal design that characterized by filling time and gate velocity. Other knowledge in designing the gating system is also applied to evaluate the user-input data against a known criterion or to determine the geometric parameters of the gate elements. The system support user-defined gating feature creation. The gating features are created in five steps: 1. Solid model creation. 19

2. Constraints definition. 3. Control parameters definition. 4. Origin and coordinate system definition. 5. Attributes definition.

Figure 16: The flowchart of gating feature creation and retrieval (Wu [12])

Figure 17: System architecture and menu options (Wu [12])

20

The system is developed on the commercial Unigraphics CAD system. Below is the system architecture (Figure 17).

Figure 18: Flowchart of the die design system for die casting (Woon [5])

Woon [5] proposed a system consists of seven distinct modules. With these modules, designers are able to create a die casting die from a product part model. The flowchart of the system is illustrated below (Figure 18). The proposed system integrates the different stages of die design process and at the same time facilitates the editing of die casting design during or after the course of the design process. The approach undertaken in this research includes: 21

(1) Feature-based and constraint-based modeling. (2) Parametric design. (3) Geometric and topological information extraction technique from a B-rep model. A prototype die design system was developed by the author using the commercial SolidWorks 2001 CAD system through API (Application Programming Interface).

With CAD systems reviewed above, die design still depends on the designer’s skills because at the design stage, designers are unable to analyze metal flow, velocity, and heat transfer in a die.

4.3. Die Casting Process Studies

Lia [22] presented a feasible way to optimize the runner design automatically by integrating optimization theory with a flow/thermo-simulation program. Lia used the finite element method to treat continuity, momentum and the energy equation in the flow of a one-dimensional tube. An optimization technique was implemented to get an optimal design based on minimization of pressure decrease and the real temperature variation at the entrance of the multi-gates. The Simplex method is used to solve the optimization problem.

Sulaiman [20] used network to simulate a runner and gating system with four gates. The network analysis method can be used to model simple runner and gating system where the overall flow direction can be determined successfully (Figure 19).

Tai [18, 19] used runner-optimization design and the abductive network in modeling the die casting process according to the experimental data. The abductive network is composed of a number of functional nodes. Once the die-casting parameters (high-speed injector position, runner injection angle, runner sectional ratio) are given, the die-casting performance (runner residual stress and temperature of the point near the die cavity surface) can be predicted accurately by this network. The optimal die-casting parameters can be searched for by a simulation annealing optimization algorithm with a performance

22

index.

Figure 19: Modeling of runner and gating with branch angle Ө (Sulaiman [20])

Zhang [21] developed an integrated CAD/CAE system for die casting. In this approach, die designers can determine the location, the shape and the dimension of the runner and gating systems of die castings according to the characteristics of the die-casting machine, the geometry of the casting, and the properties of the alloy. After the design process, the CAE program is used to undertake the sophisticated calculations of the fluid flow and to check if there are some defects related to the filling and solidification processes. Through the interactive process of CAD/CAE, an ideal design can be provided with the best filling pattern and the optimal thermal condition for both the die and the die casting.

A numerical simulation technique was applied for optimization of the runner and gating system by Hu [16]. CASTFLOW was used for computer aided gating design. 23

Commercial CAE package MAGMAsoft was used for numerical analysis.

At the present time, the prevailing method is still numerical simulation, which is based on mass conservation, momentum conservation and energy conservation. Due to the complexity of the equations, the equation solving is usually a time consuming task. Furthermore, the simulation systems require that the user has much experience and understanding of fluid dynamics. These disadvantages limit the utility of numerical simulation and the number of “what-if” questions, especially at the early design stage.

Die casting design software CastView uses a geometric reasoning based algorithm for fill pattern analysis. In this qualitative method, the flow behavior is calculated using the cavity geometric information. This way it can obtain analysis result very quick.

This algorithm is based on below assumptions: • The flow does not change direction until it is obstructed by a cavity wall or a previously filled region. • When the flow encounters an obstruction, the volume is uniformly distributed over the nearest unfilled regions. • Conservation of volume is considered over the distribution within a neighborhood of the voxel that metal is exiting. • An empty voxel can be filled by metal exiting a voxel or can be filled from multiple voxels, i.e., it can have one or more parent voxels. • Due to the discrete voxel space, there are limited directions for flow from a voxel. In this algorithm, an interior voxel can have five sets of flow vectors but a gate voxel has less vectors. • If the flow front is completely obstructed, the flow direction is reversed and each voxel acts as a point source of a wave.

In discrete voxel space, an input flow vector is "rounded" to the nearest discrete vector available.

24

Figure 20: Possible output vector from voxel a (Wang [6])

When the flow is obstructed, the algorithm will: 1) Search the first set of nearest voxels for empty voxels; 2) If there are empty voxels, distribute the voxel material over the empty voxels and calculate new flow vectors; 3) If there are no empty voxels in the first set, search the second set; 4) If there are no empty voxels in all five sets, consider the path to be completely blocked.

When the flow front is completely obstructed and the part is not completely filled, the algorithm will do the following: 1) Reverse the flow direction; 2) Each constructed voxel acts as a point source of a wave; 3) From each source voxel, search nearest empty (available) voxels; 4) New flow vectors from new voxels are calculated; 5) Flow calculation continues.

Wang [6] improved the algorithm. 1) Included metal speed for voxels. The speed is rounded to a small number of speed levels to save the computation storage expense, based on the condition that the fill sequence is the concern, rather than the dynamic change with time.

25

2) Corrected the wrong flow pattern when there is an obstruction by calculating the flow vector based on available empty voxels, original flow vector and near flow vectors. 3) When a flow hits an obstruction, the flow vector is calculated by the sum of original vector and position vector (vector from current voxel to empty voxel). 4) An option is provided to allow the user to specify if he wants the cavity fill to start at multiple gates simultaneously. 5) Fixed the non-symmetric problem caused by the calculation sequence through reversing the sequence of calculation at each step. 6) Reduced the dispersal of neighboring voxels by grouping flow front and balancing their vectors and speeds. 7) Special efforts are performed to promise the efficiency of implementation, including: pre-computing tables of geometry information, rounding real data to integers, saving variables for later use and optimizing data structure and computation.

4.4. Conclusions

Generally speaking, die design still depends on passing on experience, due to lack of analytical ability in die and melting metal flow and heat transfer. Present die design tends to make limited use of modeling of deformation resulting from material and thermal expansion and shrinkage of the die.

Although finite-element analysis software is capable of analyzing the flow conditions of the injected metal, as well as the stress, strain and temperature distribution conditions of the product (workpiece) under various injection conditions, the establishment of an analytical model is very difficult. Apart from understanding the die and metal flow and the solidification process, the user should be fully acquainted with the basic finite-element software (Tai [18]).

Various analytical finite element method (FEM) tools have been developed for flow 26

processes, including die casting, but they only give information about whether the predetermined die design is correct. Current shop practice uses trial-and-error methods to determine new die designs (Kim [14]).

27

CHAPTER 5

5. CAGD LITERATURE REVIEW

5.1. Introduction

Die geometry design is an important part of a die design process. Since the early 60’s Bezier and B-spline representations have been evolved as the major tool to handle curves and surfaces. In this chapter, some fundermental Bezier and B-spline related concepts and approaches are interduced. These concepts and approaches can be used to help developing a geometrically more intuitive and more meaningful design tool for our die design system.

5.2. Bezier Curve

The definition of Bezier curve is given as below by [37] (p19).

n P(t) = ∑ Bi J n,i (t) 0 ≤ t ≤ 1 i=0 Where the blending function is

⎛n⎞ i n−i 0 J n,i (t) = ⎜ ⎟t (1− t) (0) ≡ 1 ⎝ i ⎠ with

⎛n⎞ n! 0 ⎜ ⎟ = (0) ≡ 1 ⎝ i ⎠ i!(n − i)!

A Bezier curve can also be evaluated in de Casteljau algorithm. The definition of de Casteljau algorithm is given as below by [40] (p45). 28

3 Given: b0 ,b1 ,K,bn ∈ Ε and t ∈ R , set

r r−1 r−1 ⎧ r = 1,K,n bi (t) = (1− t)bi (t) + tbi+1 (t) ⎨ ⎩i = 0,K,n − r

0 n n and bi (t) = bi . Then b0 (t) is the point with parameter value t on the Bezier curve b ,

n n hence b (t) = b0 (t) . The polygon P formed by b0 ,b1 ,K,bn is called the Bezier polygon or control polygon of the curve b n .

In this project, the smoothstep S-function (section 7.3.2) used is indeed a special case of a Bezier curve of degree three in one-dimensional space with the second control point (value) equals to the first and the third control point (value) equals to the last.

5.3. B-spline Curve

The definition of B-spline curve is given as below by [37] (p44). Letting P(t) be the position vector along the curve as a function of the parameter t, a B-spline curve is given by

n+1 P(t) = ∑ Bi N i,k (t) tmin ≤ t < tmax , 2 ≤ k < n +1 (1) i=1

Where Bi are the position vectors of the n + 1 control polygon vertices, and N i,k are normalized B-spline basis functions.

For the ith normalized B-spline basis function of order k (degree k - 1), the basis functions N i,k (t) are defined by the Cox-de Boor recursion formulas. Specifically

⎧1 if x i ≤ t < x i+1 N i,1 (t) = ⎨ (2) ⎩0 otherwise

(t − xi )N i,k −1 (t) (xi+k − t)N i+1,k −1 (t) N i,k (t) = + (3) xi+k −1 − xi xi+k − xi+1

The values of xi are elements of a knot vector satisfying the relation xi ≤ xi+1 . The

29

parameter t varies from tmin to tmax along the curve P(t) .

In the current implementation of this project, B-spline curves are used to help converting user defined polygon sketches into profiles with a uniform number of interpolation points. In future development, B-spline surfaces can also be considered to represent runner system sweep surface data.

5.4. Open Uniform B-spline Curve

In a uniform knot vector, individual knot values are evenly spaced. Examples are [0 1 2 3 4] ([37], p48). An open uniform knot vector has a multiplicity of knot values at the ends equal to the order k of the B-spline basis function. Internal knot values are evenly spaced. An example knot vector of order 2 using integer increments is [0 0 1 2 3 4 4].

The behavior of an open B-spline curve is in many respects analogous to that of a Bezier curve (section 5.1). In fact, when the order of a B-spline curve is equal to the number of control polygon vertices, the B-spline basis reduces to the Bernstein basis. Consequently, the resulting B-spline curve is identical to a Bezier curve ([37], p60).

In this project, open uniform B-spline curve is the only type of B-spline curve used. The reason of choosing open uniform B-spline curve is that it allows convenient control of a curve’s start and end points.

5.5. B-spline Knot Insertion

The basic idea behind knot insertion is to increase the flexibility of the curve (or surface) basis, and hence of the curve, without changing the shape of the curve (or surface). The success of the idea depends on the fact that there are an infinite number of control polygons with more than the minimum number of vertices that represent identical B-spline curves. Subsequent manipulation of the new control polygon vertices is used to 30

change the curve shape ([37], p106).

Consider the original curve P(t) defined by

n+1 P(t) = ∑ Bi N i,k (t) i=1

with knot vector [X ] = [x1 x2 ... xn+k +1 ] After knot insertion, the new curve is R(s) defined by

m+1 R(s) = ∑C j M j,k (s) j=1

with knot vector [Y] = [y1 y2 ... ym+k +1 ]

where m > n. The objective is to determine the new control polygon vertices,C j , such that P(t) = R(s) . By the Oslo algorithm, the new C j s are

n+1 k C j = ∑ ai, j Bi 1 ≤ i ≤ n, 1 ≤ j ≤ m i=1

k where the ai, j s are given by the recursion relation

1 ⎧1 x i ≤ y j < x i+1 ai, j = ⎨ ⎩0 otherwise

k y j+k −1 − xi k −1 xi+k −y j+k −1 k −1 ai, j = ai, j + ai+1, j xi+k −1 − xi xi+k − xi+1

With m = n, the Oslo algorithm can be used to convert any forms of B-spline curve into another form, for example open uniform B-spline form.

In the current implementation of this project, the B-spline knot insertion algorithm is not used. But in case real B-spline surfaces are used to represent runner system sweep surface data in the future, the B-spline knot insertion algorithm can be used to split a B-spline curve into pieces to allow a better control of the surface contours along the flow direction. Section 6.1.2 explains the problem and the solution in details. And also, if we need to allow more manipulation over runner system profile curves, the B-spline knot insertion

31

algorithm can also be used.

5.6. B-spline Curve Fitting

The B-spline curve fitting problem is to determine a control polygon that generates a B-spline curve for a set of known data points. [37, p89] includes some algorithms to solve these kinds of problems.

If a data point lies on the B-spline curve, then it must satisfy below equation for each of j data point.

D1 (t1 ) = N1,k (t1 )B1 + N 2,k (t1 )B2 + ... + N n+1,k (t1 )Bn+1

D2 (t2 ) = N1,k (t2 )B1 + N 2,k (t2 )B2 + ... + N n+1,k (t2 )Bn+1 …

D j (t j ) = N1,k (t j )B1 + N 2,k (t j )B2 + ... + N n+1,k (t j )Bn+1 where 2 ≤ k ≤ n +1 ≤ j . This system of equations is more compactly written in matrix form as []D = [][]N B

T Where []D = []D1 (t1 ) D2 (t2 ) ... D j (t j )

T []B = [B1 B2 ... Bn+1 ]

⎡N1,k (t1 ) K K N n+1,k (t1 )⎤ ⎢ ⎥ M O M []N = ⎢ ⎥ ⎢ M O M ⎥ ⎢ ⎥ ⎣⎢N1,k (t j ) K K N n+1,k (t j )⎦⎥

The parameter value t j for each data point is a measure of the distance of the data point along the B-spline curve. One useful approximation for this parameter value uses the chord length between data points. Specifically, for j data points the parameter value at the lth data point is

t1 = 0

32

l D − D tl ∑s=2 s s−1 = j l ≥ 2 tmax D − D ∑s=2 s s−1

The maximum parameter value, tmax , is usually taken as the maximum value of the knot vector.

If 2 ≤ k ≤ n +1 = j , then the matrix [N] is and the control polygon is obtained directly by matrix inversion, []B = [N ][]-1 D 2 ≤ k ≤ n +1 = j In this case, the resulting B-spline curve passes through each data point. A curve fit is obtained.

A fairer or smoother curve is obtained by specifying fewer control polygon points that data points, i.e., 2 ≤ k ≤ n +1 < j . Here, [N] is no longer square; the problem is overspecified and can only be solved in a mean sense. The control polygon for a B-spline curve that fairs or smoothes the data is given by []D = [][]N B

[][]N T D = [][][]N T N B

-1 []B = [] [][]N T N []N T [D] Both of these techniques assume that the matrix [N] is known. Provided that the order of the B-spline basis k, the number of control polygon vertices n+1, and the parameter values along the curve are known, then the basis functions N i,k (t j ) and hence the matrix []N can be obtained.

In this project, B-spline curve fitting algorithms are used to generate B-spline profile curves from user defined polygon sketches. And in the current implementation, it is also used to generate B-spline curves with constraints over B-spline control points. Though B-spline curves with constraints are not needed in the current implementation, in the future, if real B-spline surfaces are used to represent runner system sweep surface data, it

33

provides a way to promise better contours along flow direction than the solution introduced in Section 6.1.2.

34

5.7. Surfaces

Surfaces commonly used in engineering design are illustrated in Figure 21. They include plane surfaces (a), single-curved surfaces (b), double-curved surfaces (c), ruled surfaces (d), warped surfaces (e) and freeform surfaces (f) ([48]).

Figure 21: Surfaces Commonly Used in Engineering Design ([48])

5.7.1. Ruled Surface

Ruled surfaces are probably the next simplest surfaces after planes. Special cases of these are extrusions. These are surfaces obtained by sweeping a vector along a curve. Definition of extrusion surface is given below. In Figure 22, (a) is an illustration of an extrusion surface ([41], p482).

35

Given a curve f :[a,b] → R3 and a vector v ∈ R 3 , the parametric surface p :[a,b]×[0,1] → R 3 defined by p(u,t) = f (u) + tv is called an extrusion. The vector v is called the sweep vector for the extrusion.

Figure 22: Extrusions and Lofted Surfaces ([41])

Lofted surfaces are ruled surfaces that interpolate two curves. Definition of lofted surface is given below. In Figure 22, (b) is an illustration of an extrusion surface ([41], p483)

Given two curves f , g :[a,b] → R 3 , the parametric surface p :[a,b]×[0,1] → R 3 defined by p(u,v) = (1− v) f (u) + vg(u) is called a lofted surface.

5.7.2. Coons Surface

Coons surface is a kind of freeform surface. The surface is created by using digitized or wireframe data provided by the product designer or the engineer. The surface is made up of a composite blend of multiple patches defined by curves. The simplest form of the Coons surface is a single patch created by four boundary curves ([48]). See Figure 23 (a). To state our goal more precisely: it is to find a parameterization p(u,v) , u,v ∈[0,1], that interpolates the four given boundary curves p(0,v) , p(1,v) , p(u,0) and p(u,1) .

36

Coons’ approach builds on the lofted surface parameterizations for the boundary curve pairs p(0,v) , p(1,v) and p(u,0) , p(u,1) . Define operations P1 and P2 on a function of two variables p(u,v) by

(P1 p)(u,v) = (1− u) p(0,v) + up(1,v)

(P2 p)(u,v) = (1− v) p(u,0) + vp(u,1)

Figure 23: Coons Surface ([48])

The Coons formula is:

p(u,v) = P1 p(u,v) + P2 ( p − P1 p)(u,v) = P1 p(u,v) + P2 p(u,v) − P2 P1 p(u,v) p(u,v) = (1− v) p(u,0) + vp(u,1) + (1− u) p(0,v) + up(1,v) − (1− u)(1− v) p(0,0) − (1− u)vp(0,1) − u(1− v) p(1,0) − uvp(1,1) The Coons surface can be expressed in matrix form as follows: ⎛− p(0,0) − p(0,1) p(0,v)⎞⎛1− v⎞ ⎜ ⎟⎜ ⎟ p(u,v) = (1− u u 1)⎜ − p(1,0) − p(1,1) p(1,v) ⎟⎜ v ⎟ ⎜ ⎟⎜ ⎟ ⎝ p(u,0) p(u,1) 0 ⎠⎝ 1 ⎠

In the current implementation of this project, Coons surface is not used. It can potentially

37

be used to generate top and bottom surfaces at branch positions of a runner system.

5.7.3. B-spline Surface

The B-spine surface combines the advantages of both the Coons and Bezier surfaces. Data points can be used to map the surface and the surface can be modified by manipulating the control points. Moving control points only affects the immediate area, so that designers have a local control over the surface ([48]).

The definition of B-spline surface is given as below by [37] (p179).

n+1 m+1 Q(u, w) = ∑∑Bi, j N i,k (u)M j,l (w) i=1 j=1 where N i,k (u) and M j,l (w) are the B-spline basis functions in the biparametric u and w directions, respectively. The definition for the basis functions is the same as that of B-spline curve on each u and w directions.

In the current implementation of this project, B-spline surface is not used. It can potentially be used to represent runner system sweep surface data, hence to allow manual manipulation of surfaces created.

5.8. Ray-Curve Intersection

To find the intersection of one smooth curve parameterized by function P(u) and one ray parameterized by function Q(v) equals to solve an equation of the form P(u) = Q(v). A two dimensional ray and curve intersection problem have two unknown variables and equations (constraints) on two dimensions. So it is solvable. A common solution to the problem is to convert the two variables problem into a one variable problem. For example, perform coordinate transformation before intersection calculation to make the ray coincident with one axis. This way, only equation of one dimension is needed to solve for one variable u. In another word, a two dimensional ray-curve intersection problem can be 38

expressed in a one dimensional value-curve intersection problem. In three dimension space, the same thing can be done. A three dimensional plane-curve intersection problem can be expressed in a one dimensional value-curve intersection problem too. So, generally speaking, these intersection problems can all be classified into the category of a one variable equation solving problem.

In mathematics, equation solving is the problem of finding what values fulfill a condition stated as equality (equation). Usually, this condition involves expressions with variables (unknowns), which are to be substituted by values in order for the equality to hold ([42]). Generally speaking, linear, quadratic and cubic equations can be solved directly. For equations with order higher than cubic, it is usually hard to solve them directly. These equations are usually solved in numerical ways. Bisection method, Regula-Falsi method and Newton Raphson method are methods commonly used.

In the current implementation of this project, ray-curve intersection is not used. It can potentially be used to allow more manipulation over runner system profile curves. And also, if real B-spline surfaces are used to represent runner system sweep surface data, ray-curve intersection can be used to help doing surface-surface intersection.

5.8.1. Bisection Method

Figure 24: Bisection Method ([43])

39

The Bisection Method algorithm is described in [43]: 1. f(a) f(b) < 0 2. c = (a + b) / 2 3. check f(a) f(c) < 0, if not, them f(c) f(b) < 0 if (f(a) f(c) < 0 ), b= c else if ( f(c) f(b) < 0 ), a = c else f(c) = 0 4. repeat

The Bisection Method does not use value of f(x). Only use their signs. The Bisection Method converges slowly, but it is very stable, which means as long as f(x) is continuous, the method will always converge into a fixed tolerance. Figure 24 illustrates an example of the Bisection Method.

5.8.2. Regula-Falsi Method

Figure 25: Regula-Falsi Method ([44])

The Regula-Falsi Method algorithm is described in [44]: 40

1. f(a) f(b) < 0 2. c = ( a f(b) – b f(a) ) / ( f(b) – f(a) ) 3. Check f(a) f(c) < 0, if not, them f(c) f(b) < 0 if (f(a) f(c) < 0 ), b= c else if ( f(c) f(b) < 0 ), a = c else f(c) = 0 4. repeat

The Regula-Falsi Method uses a weighted average of f(x). It converges faster than bisection method, but it may not be able to converge into a fixed tolerance. Figure 25 illustrates an example of the Regula-Falsi Method.

41

5.8.3. Newton Raphson Method

The Newton Raphson Method algorithm is described in [45]:

Input initial guess p0 , tolerance TOL, maximum iterations N 0 . 1. Set i = 1

2. While i ≤ N 0 do steps 3 ~ 6

' 3. Set p = p0 − f ( p0 ) / f ( p0 )

4. If p − p0 < TOL, then OUTPUT p and STOP 5. Set i = i + 1

6. Set p0 = p 7. OUTPUT FAILURE and STOP

Figure 26: Newton Raphson Method ([45])

The Newton Rphoson Method uses the first order derivative of f(x). It converges very fast.

But the Newton Rphoson Method needs a good initial guess p0 , otherwise, it may not be able to converge. Figure 26 illustrates an example of the Newton Rphoson Method.

42

5.9. Curve-Curve Intersection

In the current implementation of this project, curve-curve intersection is not used. But if real B-spline surfaces are used to represent runner system sweep surface data in the future, curve-curve intersection can be used to help doing surface-surface intersection. Section 6.4 introduces the problem and a solution in details.

5.9.1. Newton Raphson Method

To find the intersection of two smooth curves parameterized by functions p(u) and q(v) amounts to solving an equation of the form f (u,v) = p(u) - q(v) = 0 ([39], p546).

Figure 27: Newton Raphson Method ([39])

1. Pick a point p0 = (x0 , y0 ) = p(u0 ) on the curve p(u) .

2. Find the intersection of the tangent line L0 to p(u) at p0 with the curve q(v) .

Tangent line is defined byp0 + t p′(u0 ) . Let v0 be a solution. Now find the

intersection of the tangent line L1 to q(v) at p1 = q(v0 ) with the curve p(u) .

Let this point be p2 = p(u1 ) . 43

3. Continue this process, getting sequences ui , vi , and pi . Stop when pi − pi+1 is sufficiently small.

See Figure 27. The method works as long as the tangents keep intersecting the curves. Numerical techniques for tracing curves work pretty well if one does not run into any singularities. The problem at singularities is that the approximation that one is using for the curve fails to be sufficiently accurate at such points.

5.9.2. Bezier Clipping Method

The Bezier Clipping method is a bounding box type approach ([39], p547). Define a fat line as the region between two parallel lines. Associate a fat line to an arbitrary Bezier curve p(u) . Letpi = (xi , yi ) , i = 0, 1, ..., n, be the control points of p(u) . See Figure 28.

Let L be the line through p0 and pn . Represent the line by an equation of the form ax + by + c=0. Define d(x,y) = ax + by + c. It is easy to see that d(x,y) is just the signed distance from a point (x,y) to L. Let di = d(xi , yi ) and set d min = min{}d 0 ,d 0 ,...,d n , d max = max{}d 0 ,d 0 ,...,d n . The convex hull property of Bezier curves implies that the curve is contained in the fat line defined by the two lines L1 and L2, which are parallel to

L and a distance of dmin and d max from L, respectively.

Figure 28: The Fat Line for a Bezier Curve ([39]) 44

Let d(u) be the signed distance from p(u) to L.

n d(u) = ∑ Bi,n (u)d i di = axi + byi + c i=0 Define the parametric curve.

n D(u) = ∑ Bi,n (u)Di = (u,d(u)) i=0 whereDi = (ti ,di ) andti = i / n .

Figure 29: Sederberg-Nishita Bezier Clipping ([39])

If D(u) ≤ d min or D(u) ≥ d max , then p(u) will not lie on the curve q(u) . Therefore one can trim away those parts of p(u) .We now subdivide the Bezier curve p(u) at umin and umax using the de Casteljau algorithm and only keep the part over [umin ,umax ].After clipping p(u) against q(u) , we repeat this process, this time clipping q(u) against the fat line associated to the clipped p(u) . We alternate back and forth between clipping against p(u) and q(u) until we arrive at our intersection point.

The fat line clipping algorithm may not converge if we only clip little at each stage. To solve this problem, we can subdivide the curve and do a Bezier clip of the other curve with the two halves. This solves our convergence problem, but if curves are almost 45

tangent or two intersections are very close, then the algorithm reduces to a divide- and-conquer binary search type algorithm in the neighborhood of those points.

5.9.3. Recursive Subdivision Method

Lane and Riesenfeld described a subdivision approach in [46]. The algorithm is used to find all the intersections of two arbitrary polynomial or spline curves or surfaces. Instead of using convex hull of curves, the algorithm uses bounding box of convex hulls. If we cannot prove that the curves do not intersect, i.e., their minmax boxes do intersect, then we simply subdivide the two curves and reapply the test to all appropriate combinations of these two segments. When two minmax boxes are sufficiently small yet still overlap we declare that a point of intersection has been found. Below we give recursive versions for this algorithm for finding a point of intersection between two curves or two surfaces.

Given P ≡ []P0 ,L, Pm andQ ≡ [Q0 ,L,Qn ] the coefficients of two Bernstein polynomials. PROCEDURE CURVE_INTERSECT (P, m, Q, n) Step 1. [Test for Overlap] If max(P) < min(Q) or min(P) > max(Q) return. Step 2. [Test for Convergence]. Let l(A, B) be the line segment from point A to point B and let d(A, B) be the distance between the two points. Then if

d(l(P0 , Pm ), Pi ) < Tolerance, i=1,…,m-1, and d(l(Q0 ,Qmn ),Qi ) < Tolerance,

i=1,…,n-1, output l(P0 , Pm ) ∧ l(Q0 ,Qn ) (may be empty) and return. Step 3. [Subdivide and Retest]. CURVESPLIT (P, m, R, S) CURVESPLIT (Q, n, T, U) CURVE INTERSECT (R, m, T, n) CURVE INTERSECT (R, m, U, n) CURVE INTERSECT (S, m, T, n) CURVE INTERSECT (S, m, U, n) return.

46

Turner improved the algorithm in [47]. He uses two approximations that contained the curve between them. Turner called the region between the two curves a curve-bounding area. For intersecting situations, Turner defined a special condition that guarantees a curve-curve intersection point. It is described as below. If these two curve bounding areas intersect in a four-sided region in which each vertex of the region is formed by the intersection of a different pair of bounds (one bound from each of the two curves), then the two curves must intersect within this four-sided region. Figure 30 illustrates the intersection situation.

Figure 30: Four-sided Region Intersection ([47])

If the curve bounding areas of two curves do not intersect, then the curves will not intersect. If they intersect, then a subdivision process is applied to get a new set of two curves so that the region between them is a closer fit to the original curve. The preceding result suggests a hybrid method: Use subdivision until the preceding condition is satisfied (or until the bounds are found not to intersect). Then apply a numerical method to compute the actual coordinates of the intersection point. (Any of the corner points of the four-sided region determined by the two pairs of bounds provides a good starting value for numerical methods.)

47

5.10. Curve-Surface Intersection

Assuming that the curve is parameterized by q(t) and the surface by p(u,v), we need to solve the equation r(t,u,v)= q(t) -p(u,v)= 0. A Newton-Raphson approach curve-surface intersection method is described in [39]. The idea is to start with a guess (t0 ,u0 , v0 ) for a solution to the equation and then define a sequence (ti ,ui , vi ) that converges to an actual solution. Assume that we have already defined ri = (ti ,ui , vi ), I >= 0. Using the linear function h(t,u,v) = r(ti ,ui ,vi ) + Dr(ti ,ui ,vi )(t − ti ,u − ui ,v − vi ) as an approximation to the function r(t,u,v) in a neighborhood of (ti ,ui , vi ), we get the next iterate (ti+1 ,ui+1 , vi+1 )

t u v by solving h(t,u,v) = 0. Let qi = q′(ti ) , pi = pu (ui ,vi ) , and pi = pv (ui ,vi ) . It is easy

t u v to show that h(t,u,v) = ri + qi (t − ti ) − pi (u − ui ) − pi (v − vi ) . So, we need to solve

t u v ri + qi (t − ti ) − pi (u − ui ) − pi (v − vi ) = 0 .

The sequence (ti ,ui , vi ) will converge to a point in the intersection of our curve and surface provided that we do not run into the usual problems associated to Newton-Raphson methods. Getting all the intersection points hinges on being able to come up with enough initial guesses.

5.11. Surface-Surface Intersection

General surface intersection algorithms are particularly important in geometric modeling, such as in the boundary evaluation algorithm of CSG and NC cutter path generation. Unfortunately, finding such intersections is a very difficult problem and no algorithm that is both efficient and correct is known at the moment. Efficient algorithms have problems near singularities or almost-singularities because computers only have finite precision. Accurate and robust algorithms are currently too slow. Some are based on algebraic geometry methods that do not apply to nonalgebraic surfaces ([39], p557).

The subdivision approach (Lane and Riesenfeld, [46]) described in section 5.9.3 applies 48

to surface-surface intersection too. The problem can be described as below.

Given P ≡ [Pij ] , i=0,1,…,m; j=0,1,…,n and Q ≡ [Qij ] , i=0,1,…,p; j=0,1,…,q the coefficients of two nondegenerate Bernstein polynomials surfaces on [][]0,1 × 0,1 , find the curves of intersection (if any) of the two surfaces.

Surface intersection proceeds as with the curve intersection algorithm, except that instead of producing points as the intersection of line segments, the surface algorithm line segments as the intersection of planar segments. Since these line segments are found in a somewhat arbitrary order, they must be sorted by endpoint matchup to form a connected curve. In all probability this sorting can be done on (xyz) coefficients alone, but since parametric surfaces can be multivalued the proper sorting key is the parametric values associated with each endpoint. These parametric values are easily tracked during the subdivision process ([46], p44).

In the current implementation of this project, surface-surface intersection is not used. But if real B-spline surfaces are used to represent runner system sweep surface data in the future, surface-surface intersection is a problem that needs to be solved. Suppose surface-surface intersection problems can be converted to curve-curve intersection problems, section 6.4 introduces the curve-curve intersection problem and a solution in details.

49

CHAPTER 6

6. ALGORITHM DEVELOPMENT

6.1. Surface Lofting

In the runner and gate design system, generally, surfaces are constructed in one of two ways. They correspond to a surface lofting and a surface sweeping problem respectively from CAGD point of view.

6.1.1. Problem Statement

The first surface construction approach is to construct a surface from two curves. This is used to construct surfaces on side of runners. Two curves come from profiles attached to ends trajectories. Paths between these curves are straight lines. So, this is a problem of generating lofted surfaces.

The definition of the lofted surface has been given in section 5.7.1. However, there is a problem to be solved before we can apply the surface definition. The problem is: b-spline curves are defined separately considering only their own shapes. Knots of the curves are less likely to be considered. So, the number of b-spline spans (and also, control points) might be different. Even if they are the same, if we simply construct the b-spline surface from control points of these curves without any handling of their knot vectors, the constructed surface might have unacceptable contours, and hence have unacceptable shapes.

50

Figure 31 (a) illustrates a lofted surface constructed directly from two open uniform b-spline curves of five control points. Both curves have the same knot vector [0 0 0 0 0.5 1 1 1 1] and have two spans. We can see the constructed b-spline surface has non-parallel contours on the w direction. The simple reason for this situation is: at knot value 0.5, which is the separation of two spans, these two curves evaluated two totally irrelevant points.

Figure 31: Surface Lofting Problem

This situation might be what is expected in some applications. But in our runner and gate design system, the w direction of surfaces corresponds to the flow direction. A careless design of contours might cause turbulence of the flow. Figure 31 (b) illustrates the effect we are expecting. On each curve an extra point is inserted to match the point with knot value 0.5 on the other curve.

6.1.2. Solution

Figure 31 (b) is rendered in three separate surfaces. To allow this, each curve has been separated into three pieces before the surface construction. The way to find the parameter

51

value of the matching point is not hard. Plane-curve intersection can do it. Currently we intersect curves with planes parallel to xoz plane, to promise y values of new curve points match corresponding points on the other curve. To represent curve pieces in a typical b-spline data structure, multiple coincident vertices or internal knots can be used.

6.2. Surface Sweeping

The second surface construction approach is surface sweeping. This is used to generate sweep surfaces between neighboring trajectories. Figure 32 illustrates the situation.

6.2.1. Problem Statement

Figure 32: Surface Sweeping Problem

It is actually a filleting problem. But for the first step, we suppose two end curves are known. Two guide curves (pink curves in Figure 32) are constructed by users. So, the problem is how to construct a b-spline surface from four boundary curves.

Section 6.1 discussed how to generate b-spline curves with the same knot vector and 52

number of control points. For here, we suppose each pair of boundary curves have the same knot vector and number of control points. So, for the resulting b-spline surface, knot vectors for the u and w directions come directly from boundary curves. The issue is how to construct control point nets from the boundary curves’ control points.

6.2.2. Solution

Section 5.7.2 explained Coons surface. Here, we treat the control polygons of four boundary curves as curves, and apply Coons formula directly to these control polygons. Suppose I and j are indices of control points along u, w directions. B(i, j) returns the control point of boundary curves. The formula below is used to calculate control points of the result sweeping b-spline surface. ⎛− B(0,0) − B(0,1) B(0, j)⎞⎛1− j ⎞ ⎜ ⎟⎜ ⎟ B(i, j) = (1− i i 1)⎜ − B(1,0) − B(1,1) B(1, j) ⎟⎜ j ⎟ ⎜ ⎟⎜ ⎟ ⎝ B(i,0) B(i,1) 0 ⎠⎝ 1 ⎠

Figure 33: Surface Sweeping Result

Figure 33 shows the result of an arbitrary test case. Four boundary curves are rendered in

53

blue color. The control net of the result B-spline surface is generated in method provided above.

6.3. Ray-Curve Intersection

Comparing these three ray-curve intersection algorithms described in section 5.8, we choose the bisection method for our runner and gate design system. As we are not doing real time calculation, bisection method’s slow speed is not a problem. It only requires a parameter range to start the calculation and it is very stable that for sure to give one result.

The problem of ray-curve intersection in 2D space has two unknown variables. We need to get rid of one variable to convert it to a single variable problem. Space transformation works, but it generates an extra copy of the data. So we choose to do the distance calculation in 2D space, and check the distance between the current curve point and the ray in each iteration. This method can be extended to any dimension to solve the problem of intersecting a hyper plane with a curve in x-dimensional space. The distance between current point and the hyper plane is used for tolerance check during iterations. So, a ray in 2D space and a value in 1D space can be treated to be hyper planes in 2D and 1D space respectively. The point to plane distance calculation can be done in a dot product operation to the plane normal.

6.4. Curve-Curve Intersection

6.4.1. Problem Statement

Three curve-curve intersection algorithms have been discussed in section 5.9. They are Newton Raphson Method, Bezier Clipping Method and Recursive Subdivision Method. The Newton Raphson Method ([39], p546) requires a good starting point, which is hard to decide. In cases the starting point is not suitable, the algorithm will not converge. For some subdivision based algorithms, like the Bezier Clipping Method ([39], p547), they

54

need to use ray-curve intersection, which is an expensive operation. And due to the rough approximation of the B-Spline convex hull, this expensive operation needs to be done a lot of times in worst cases. Lane and Riesenfeld’s Recursive Subdivision Method ([46]) utilizes the subdivision property of b-spline curves. It does not need a starting point, and does not use ray-curve intersection. It might converge slower than the Newton Raphson Method, but it is very stable.

Generally speaking, a hybrid method is always a good choice, but it is more like an implementation issue. For this reason, the Recursive Subdivision Method utilizing curves’ original convex hulls was studied. This method might be dismissed at the first place in most textbooks, because convex hull based calculation is treated to be expensive for recursive situations. In below sections, some convex hull related algorithms are provided. Based on these algorithms, the original convex hull based recursive subdivision method has become acceptable in our application, which does not require frequent real time calculations.

6.4.2. Solution

The problem can be described as follows. For two b-spline curve spans p(u) and q(v) in two-dimensional space, find all intersection points between them. The problem is defined for b-spline spans to simplify the subdivision operation, but it can be easily extended to b-spline curves. Whether to find one intersection point or all intersection points doesn’t make too much difference for a subdivision based algorithm.

My current solution is described as follows. Convert each b-spline span into open uniform knot vector form, in another word, Bezier span. Subdivide each span recursively. At each recursion level, find the convex hull of their control points. Check overlapping of all four combinations of convex hulls. If any pair of convex hulls overlaps, subdivide them. Continue this recursive process until the required precision has been reached.

55

After subdividing a Bezier span, convex hulls of the two minor Bezier spans intersect at one point. So, converting b-spline spans into Bezier spans can reduce the chance of overlapping between subdivided minor convex hulls, hence reduce the computation complexity. And also, Bezier span has very nice subdivision features. The subdivision operation of a Bezier span (curve) involves only middle point calculations.

Only two operations are performed at each subdivision level. One is the convex hull construction operation. The other is the convex hulls overlapping check. I will discuss them separately below.

Figure 34: Convex Hull Subdivision

6.4.3. Convex Hull Construction

There are many convex hull construction algorithms. For example, Jarvis’ march algorithm does it in a time complexity ofO(n 2 ) . Graham’s scan algorithm does it in a time complexity of O(n log n) or O(n) , if points have been sorted. Even the fastest algorithm might still be expensive in a recursive calculation. But in b-spline’s convex hull 56

subdivision process, convex hull construction only needs to be performed a limited number of times, so it is not exactly expensive in b-spline’s convex hull subdivision process.

Figure 34 illustrates four levels subdivision of a Bezier span. At each level, the curve span is subdivided between parameter 0.2 and 0.7. We can see, at the top level, both the curve and its control polygon have self-intersection. But after a few levels of subdivision, self-intersection is gone. This is easy to understand, because subdivision (convex hull) is an approximation of the original curve. As the subdivision goes deeper, the approximation is more like a straight line. With this consideration, we can choose any convex hull construction algorithm listed above. The reason is this operation only needs to be performed a limited number of times. After that, the convex hull can be constructed in the order of control points.

Figure 35: Point outside Convex Hull Check

57

6.4.4. Point Outside Convex Hull Check

A point outside convex hull check can be done in a series of point on side of line checks. The algorithm presented here returns extra region information, which can help to perform convex hull overlapping check.

From Figure 35, we can see, the region that a point locates can be identified by a series of convex hull edges. These edges are simply edges for which the point locates to the right. For example, when points locate in region A, they are outside edge e0 only. In region B, they are outside edges e0 and e1. In region C, they are outside edge e1 only. In region D, they are outside edges e0, e1 and e2. Utilizing this property, the point outside convex hull check can returns the start and end indices of associated edge to indicate the region that the point locates in. This information is later utilized in convex hull overlapping check.

6.4.5. Convex Hull Overlapping Check

A straight forward implementation of convex hull overlapping check is to check the intersection of each pair of line segments. Time complexity of this method isO(n 2 ) . Another idea is to perform the check based on point on side of line check. But simple inside/outside check can not identify all overlapping situations. Figure 36 illustrates a failure of using points inside/outside check to perform convex hull overlapping check. All points are outside the other convex hull, but two convex hulls do overlap.

Figure 36: Failure of Inside/Outside Check

58

Convex Hulls have a property. If two convex hulls do not overlap, then there exists a line that can separate them into different sub-spaces. See the blue line in Figure 37 for example. Also, if two convex hulls do not overlap, then at least one edge of them can separate them into different sub-spaces. Let us call edges satisfying this statement separation edges. In Figure 37, these two red lines are two separation edges of the two convex hulls. See the example illustrated in Figure 37. Suppose a separation edge e4 exists. So, all points of the convex hull A locate outside e4. When we run the point outside convex hull check described in section 0, each point will have an associated list of edges. As long as a separation edge exists on the other convex hull, associated list of edges of all points will have a common edge. So to check convex hull overlapping, we only need to perform this kind of operations on each convex hull.

Figure 37: Convex Hull Overlapping Check

Performing point outside convex hull check on all points of a convex hull and comparing result edges lists to find common edge is not as complex as it sounds to be. Because points and edges are stored in order, later checks only need to be done on existing lists. For example, if the first point is only outside one edge of the other convex hull, later points only need to compare to this edge and no need to check all edges. 59

6.5. Conclusion

The surface lofting and surface sweeping algorithms introduced above provide ways to create B-spline surfaces to represent runner system sweep surface data. The ray-curve intersection and curve-curve intersection algorithms can help to solve surface-surface intersection problem. With the runner system surface creation scheme introduced in section 7.1, a whole system solution for the runner system design is formed.

60

CHAPTER 7

7. SYSTEM DEVELOPMENT

7.1. System Design

The basic idea of our solution is to generate profiles with a uniform number of profile points from user defined polygon sketches with a non-uniform number of sketch points. These generated profiles are attached to a user defined trajectory tree. Profiles of different shapes and attached to different positions can be interpolated conveniently because profiles have uniform number of profile points. The trajectory tree is treated as the conceptual design of the runner system. To make it concrete, sweep paths need to be generated based on the trajectory tree. A sweep path can be evaluated within its parameter range, which is usually 0 to 1. Point positions and directions of these sweep paths can be evaluated for a specified parameter. Normals on the sweep path are generated from interpolation. With position, direction and normal generated for a specified parameter, a coordinate system can be decided. Profiles with a uniform number of profile points are attached and located according to the coordinate system. To map between profiles of different shapes, a two dimensional interpolation is applied.

This solution includes two steps: the profile generation step and the runner system surface generation step. The profile generation step utilizes B-spline curve fitting algorithms described in section 5.6 to generate profiles with a uniform number of profile points from user defined polygon sketches (section 7.4). The runner system surface generation step let the user define sweep paths, attach profiles and interpolate sweep

61

paths and attached profiles to generate smooth surfaces (section 7.5).

7.2. Sweep path

To generate smooth sweep surfaces, the user needs to define sweep paths. Profiles are transformed and attached to interpolated coordinate systems along the sweep paths to generate sweep surfaces.

A sweep path is a parameterized geometry shape in three-dimensional space that provides smooth transformation between connecting paths. For convenience, the parameter t of a sweep path always ranges between 0 and 1. To promise the smoothness of the result sweep surface, the distance along the sweep path must be a linear function of the parameter t.

According to the definition, a sweep path can have any shape. So far, three basic shapes have been considered. They are: line shape, circle shape and point shape. In the current stage of this project, only the circle shape sweep path has been implemented.

Figure 38: Line Shape Sweep path

7.2.1. Line Shape Sweep path

The line shape sweep path is used to provide smooth transformation on a straight line.

62

For a given line l0 defined by start point p0 and end point p1 , a line shape sweep path can be defined by specifying its start and end points’ parameters on line l0 . An example line shape sweep path is illustrated in Figure 39.

For any parameter t within range 0 ≤ t ≤ 1, a line shape sweep path gives a linearly interpolated point position on the line and a constant line direction.

7.2.2. Circle Shape Sweep path

The circle shape sweep path is used to provide smooth transformation between two intersecting lines. For two intersecting lines l0 and l1 defined by three points p0 , p1 , p2 in space, a circle shape sweep path can be defined by specifying the radius of the circle arc. The creation of the circle arc is a simple geometry problem and is illustrated in Figure 39.

Figure 39: Circle Shape Sweep path

The construction procedure is as follows. Construct a plane from p0 , p1 , p2 . Offset l0 and l1 on the plane for a distance of r. The intersection point of these two offset lines is the center of the circle. The total angle of the arc can be calculated with a dot product between e01 and e12 .

63

For any parameter t within range 0 ≤ t ≤ 1, circle shape sweep path gives a point position on the circle and a direction of the circle arc by linearly interpolating the total angle of the circle arc.

7.2.3. Point Shape Sweep path

The point shape sweep path is used to provide smooth transformation on a fixed point.

For a given point p0 , a point shape sweep path can be defined by specifying a start direction and an end direction. An example point shape sweep path is illustrated in Figure 39.

Figure 40: Point Shape Sweep path

Point shape sweep path is not trivial, because though its spatial position is fixed its directions still must be interpolated by parameter t . A point shape sweep path will generate a sharp corner on one side of the resulting sweep surface.

64

7.3. Interpolation Methods

After a sweep path shape has been defined, different interpolation methods can be applied to different properties of the sweep path. These properties mainly involve only the normal and planar points. For a point shape sweep path, direction is an additional property that needs to be interpolated. In this research project, two types of interpolations are implemented. They are: linear interpolation and s-function interpolation.

7.3.1. Linear Interpolation

For one dimension values, linear interpolation can be expressed with the help of parameter t as:

v(t) = v0 ∗ (1− t) + v1 ∗t 0 ≤ t ≤ 1 For higher dimension points, linear interpolation can be done by applying the calculation on each dimension separately.

7.3.2. S-function Interpolation

A version of S-function called smoothstep is described in [49, p30]. The function curve is illustrated in Figure 41. This function is a cubic function. It is expressed below: float smoothstep(float a, float b, float x) { if (x < a) return 0; if (x >= b) return 1; x = (x - a)/(b - a);return (x*x * (3 - 2*x)); }

Let a=0, b=1, we get the simplified version of this S-function: sfunc(t) = t 2 ∗ (3 − 2 ∗t) 0 ≤ t ≤ 1

65

Figure 41: Smoothstep S-function

This is the S-function we are using in our current implementation. As with linear interpolation, if we need to apply this interpolation to higher dimension points, we can simply apply it to each dimension separately.

At the current stage of this project, S-function interpolation provides satisfying smooth result for a blending of any constant values. Figure 42 illustrates a comparison between result surfaces generated from a linear (a) and a S-function (b) planar point interpolations.

(a) (b) Figure 42: Linear and S-function Planar Point Interpolation Comparison

7.3.3. Linear Vector Interpolation

Given two vectors v0 , v1 , a linear vector interpolation interpolate v0 and v1 linearly.

66

To interpolate vectors, we can not apply a linear interpolation directly to each dimension of these two vectors. Because it will result in an interpolation in point positions. We need to interpolate vectors’ angles and lengths separately. This can be described as a geometry problem. The illustration of the solution is shown in Figure 43.

Figure 43: Vector Interpolation

The calculation of the result vector can be done in a geometry approach.. Construct a plane from v0 , v1 . Calculate total angle between v0 and v1 with a dot product. For specified t within range 0 ≤ t ≤ 1, interpolate the total angle linearly to get direction of the interpolation vector. Interpolate length of v0 and v1 linearly in t. multiply the interpolated length to interpolated vector direction to get result interpolated vector v. Figure 44 (a) is an illustration of linearly interpolated vectors with origin of vectors offseted linearly. We can treat this calculation process as a function. Let’s call it v(t) = interpolate_vector (v0 , v1 , t) , to be referenced later.

7.3.4. S-function Vector Interpolation

Higher order vector interpolations can be achieved by simply using the interpolation result as linear vector interpolation’s input. For example, if we want to interpolate vectors in S-function interpolation, we get below interpolation equation:

67

v(t) = interpolate_vector (v0 , v1 , sfunc(t))

(a) (b)

Figure 44: Linear and S-function Vector Interpolation Comparison

(a) (b)

Figure 45: Linear and S-function Interpolation Results

68

Figure 44 illustrates a comparison of a linear vector interpolation and an s-function vector interpolation. In (a), the start and end vectors are interpolated linearly. In (b), the start and end vectors are interpolated in s-function. Offsets are added to vectors linearly to t to illustrate the tendency. We can see, in (b) vector directions blends into the start and the end vector much smoothly compared to (a).

Figure 45 illustrates a comparison between result sweep surfaces of a linear vector interpolation and an s-function interpolation. Circle shape sweep paths are used for both cases. For the linear interpolation case (a), linear normal interpolation and linear planar point interpolation are applied. For the S-function interpolation case (b), S-function normal interpolation and S-function planar point interpolation are applied. We can see that (b) has a much smoother transformation at the beginning and the ending position of the result surface compared to (a).

69

7.4. Profile Definition Process

There are two versions of profiles. A polygon profile is a closed polygon shape in two-dimensional space with top and bottom edge to be horizontal. A curve profile is a polygon profile. It has extra curve data to help generate the resulting polygon profile. Figure 46 illustrates a simple curve profile. The polygon in red color with three points on each side is a copy of the source polygon profile. Curves and their control line strips in green and blue colors are B-spline curves constructed to help generating the result polygon profile. Points in purple color with five of them on each side are points interpolated from a constructed B-spline curve. They form the result polygon profile.

The definition process of a curve profile takes four steps. It includes: sketch definition (7.4.2), fitting curve generation (0), approximation curve generation (7.4.4) and interpolation point generation (0).

Figure 46: Profile Example

The goal of the profile definition process is to generate a new set of interpolation points with controllable number of them from user defined sketch points with arbitrary number of sketch points, utilizing B-Spline curve fitting algorithm introduced in section 5.6. The runner system sweep surface generation process relies on a uniform number of points on

70

the profiles.

7.4.1. Profile Data Structure

The polygon profile is cvProfile which includes only a list of polygon points. The curve profile is BsProfile. It contains a source polygon profile (pSketchPoints) and curves (pFittingCurve, pApproxCurve) that are generated to produce final interpolation points. BsProfile inherits from cvProfile and cvProfile’s pPoints variable is used to hold result interpolation points. Figure 47 illustrates data structures of these two versions of profiles.

Figure 47: Profile Data Structure

In the current implementation of this project, only cvProfile is used in the runner system definition process. BsProfile is used to communicate with the profile definition user interface to help generating cvProfile data with controllable number of points. After cvProfile data is generated, BsProfile is not used anymore.

7.4.2. Sketch Definition

A sketch of a curve profile is a polygon profile that is defined in a curve profile to serve as the source data. The first step of creating a curve profile is to let the user pick on a sketch plane to define a sketch polygon profile. An example sketch is illustrated in Figure

71

48.

The sketch polygon is separated into top, bottom, left and right pieces. Top and bottom is always a horizontal line. Currently, don’t separate these four pieces automatically from a user defined polygon; instead, we let the user define left and right side separately.

Figure 48: Profile Sketch View

Figure 49: Profile Sketch Definition Interface

72

Figure 49 illustrates the sketch definition interface. The [Left Side] and [Right Side] radio buttons are used to choose which side of the profile sketch are we defining. The [Insert], [Move] and [Delete] radio buttons are used to switch between three editing modes. Currently they are not implemented.

Figure 50: Profile Fitting Curve View

Figure 51: Profile Fitting Curve Generation Interface

73

7.4.3. Fitting Curve Generation

A fitting curve of a curve profile is a B-spline curve that is generated from a profile sketch with B-spline curve fitting algorithms introduced in section 5.6. The second step of creating a curve profile is to generate a fitting curve. An example B-spline fitting curve and its control line strip are illustrated in green color in Figure 50.

Figure 51 illustrates the fitting curve generation interface. The [Left Side] and [Right Side] radio buttons are used to choose which side of the profile are we generating a fitting curve for. The degree D of the fitting curve can be specified from the fitting curve generation interface. The number of control points N equal number of sketch points as described in section 5.6. Number of knots equals to N +D+1.

7.4.4. Approximation Curve Generation

An approximation curve of a curve profile is a B-spline curve that is generated from a profile fitting curve with B-spline curve fitting algorithms introduced in section 5.6. The third step of creating a curve profile is to generate an approximation curve. An example approximation curve and its control line strip are illustrated in blue color in Figure 52.

Figure 52: Profile Approximation Curve View

The goal of this step is to generate a B-spline curve that has constraints on B-spline

74

control points’ locations. This step is only necessary if real B-spline surfaces are used to represent the runner system surface data and contours along the flow direction of B-spline surfaces need to be controlled. In the current implementation of this project, we are not using real B-spline surfaces. Instead, we use quad meshes generated from profile interpolation points (section 0) to represent the runner system surface data. So, this step is not necessary in the current implementation. It is used now only for testin.

To generate an approximation curve from a fitting curve, fitting curve must first be sampled. Then, the B-spline curve fitting algorithms introduced in section 5.6 are used to generate an approximation curve. In the example illustrated in Figure 52, 16 sample points are calculated from the fitting curve.

Figure 53: Profile Approximation Curve Generation Interface

Figure 53 illustrates the approximation curve generation interface. The [Left Side] and [Right Side] radio buttons are used to choose the approximation curve for the side of the 75

profile are we generating. [Number of Sample Points], [Degree] and [Number of Control Points] can be specified from the approximation curve generation interface.

Figure 54: Profile Interpolation Points View

Figure 55: Profile Interpolation Points Generation Interface

76

7.4.5. Interpolation Points Generation

Interpolation points of a profile are two-dimensional points that are generated from interpolating a profile fitting curve or a profile approximation curve. Interpolation points form the result polygon profile. The fourth step of creating a curve profile is to generate interpolation points. Example interpolation points are illustrated in purple color in Figure 54.

To generate interpolation points, a B-spline curve is interpolated within its parameter range for a specified number of times.

Figure 55 illustrates the interpolation points generation interface. The [Left Side] and [Right Side] radio buttons are used to choose which side interpolation points of the profile are we generating. [Number of interpolation points] can be specified from the interpolation points generation interface.

77

7.5. Runner System Definition Process

The runner system definition process takes five steps. It includes: trajectory definition (section 0), profiles assignment (section 7.5.4), sweep path definition (section 0), sweeping process (section 0) and solid generation (0).

The construction of the runner system surfaces relies on a precondition that all attached profiles have same number of points on the same side. The profile definition process described in section 7.4 is used to generate required profiles from user defined sketch points containing an arbitrary number of sketch points.

Figure 56: Runner Data Structure

7.5.1. Runner Data Structure

There are two versions of profile data. One is cvProfile which includes only lists of polygon points. The other is BsProfile, which contains sketch and curves that are defined or generated to produce final interpolation points. BsProfile inherits from cvProfile and 78

cvProfile’s points variable is used to hold result interpolation points. Figure 56 illustrated data structures of these two versions of profiles.

7.5.2. Parting Plane

A parting plane of a die casting die is one plane or a series of planes in three-dimensional space that separate the cover side of the die from the ejector side of the die. A parting plane can be stepped as the one illustrated in Figure 58. In CastView, a parting plane is generated in a die configuration process. The runner system definition process depends on a preloaded parting plane. In the current implementation of this runner system definition process, a parting plane is loaded from a for convenience. After a user clicked the [Tools / Sketch / Runner Sketch] menu, a file open dialog (Figure 57) will pop up automatically to let the user select a parting plane file. After a parting plane has been loaded, the runner system definition dialog (Figure 59) will show. It has five pages. Each page corresponds to a runner system definition step.

Figure 57: Parting Plane Open Dialog

79

Figure 58: Runner Trajectory View

Figure 59: Runner Trajectory Definition Interface

80

7.5.3. Trajectory Definition

A trajectory tree is a tree style data structure defined on a parting plane in three- dimensional space. It represents the runner system’s connectivity conceptually. The first step of defining a runner system is to generate a trajectory tree. Figure 58 illustrates an example trajectory tree.

Figure 59 illustrates the corresponding user interface of the trajectory definition step. The group of [Editing method] radio buttons allows users to switch the method of editing. In the current implementation of this project, only the [Insert Point] [Editing method] is implemented.

Figure 58 illustrates the corresponding 3D view of the trajectory definition step. Blue points indicate trajectory nodes. Blue lines connecting two trajectory nodes are used to indicate the connectivity between these two nodes. A user can double click the left mouse button on a parting plane to add a new trajectory node, or click on an existing node to select it. A currently selected node is highlighted in red color. To add a node other than the root node, an existing node must be currently selected to define its connectivity. The last selected node is highlighted in light blue color. It is not used in the trajectory definition step, but it is used in other runner system definition steps.

The group of [Positioning method] radio buttons of the trajectory definition user interface allows users to switch between different methods of placing a new node. In the [Normal] method, a new node is added to the exact position a user has clicked. In the [Horizental] method, after a user has clicked a point, the point will be projected to an XOY plane that passes through the currently selected node to decide the position of the new node. The [Mirror] button allows users to mirror the currently selected node based on an XOY plane that passes through the parent node of the currently selected node.

81

7.5.4. Profile Assignment

The second step of defining a runner system is to let the user assign previously defined curve profiles (section 7.4) to the trajectory tree defined in the trajectory definition step (section 0). For each trajectory, two profiles need to be assigned to its start and end point positions respectively. Figure 60 illustrates a trajectory tree with all profiles assigned. Profiles are rendered in white color.

Figure 60: Runner Profile Assignment View

(a) (b)

Figure 61: Pick Trajectories

82

Figure 62 illustrates the corresponding user interface of the profile assignment step. A user can pick a branch of trajectories and assign profiles to each trajectory on the branch. To select a branch of trajectories, a user can double click to select two trajectory nodes (Figure 61, a) and then click the [Pick] button. After a branch of trajectories have been picked, they will be highlighted in red color as illustrated in Figure 61 (b).

Profiles are loaded from files by clicking these two [Load…] buttons. To assign profiles to the selected branch of trajectories, there are two ways. One way is to specify a start profile and an end profile. In this way, each trajectory on the selected branch will be assigned with a profile that is a linear interpolation of the start and end profile. The other way is to specify a start profile and a way of scaling it. In this way, each trajectory on the selected branch will be assigned with a profile that scaled in the specified way from the start profile. There are three elements a profile that can be scaled. These are profile area, u direction length and w direction length. A user can specify scale factors to two of these three elements to scale a profile. After methods above have been specified, clicking the [Apply] button will perform the attaching operation.

83

Figure 62: Runner Profile Assignment Interface

Figure 63: Runner Path View

84

Figure 64: Sweep path Example

7.5.5. Sweep path Definition

The third step of defining a runner system is to let the user define sweep paths (section 7.2) based on the trajectory tree defined in the trajectory definition step (section 0). Figure 63 illustrates a trajectory tree with fully defined sweep paths. Sweep paths are rendered in yellow color. A sweep path is rendered in a polygon approximation with a specified number of interpolations. As illustrated in Figure 64, directions and normals of a sweep path are also rendered.

Figure 65: Pick Connecting Trajectories

85

Figure 66: Runner Path Definition Interface

To define a sweep path, a user needs to select two connecting trajectories in the 3D view window, and set parameters of the sweep path. To select two connecting trajectories, a user only need to double click a trajectory, then the picked trajectory and its parent trajectory will be selected (Figure 65).

To specify parameters of the sweep path, the sweep path definition interface (Figure 66) is used. First, a user needs to specify the size of the path by specify either a radius or a distance from the intersection point of these two trajectories. Then a user needs to specify methods used for normal and planar point interpolations. Specifying S-function interpolation methods (section 7.3.2) for both of them can promises a smooth result. A user also needs to specify number of interpolations. A sweep path will be interpolated for the specified number of times in the final solid generation step (section 0). After these parameters mentioned above have been specified, clicking the [Apply] button will generate a new sweep path.

86

Figure 67: Runner Sweep View

7.5.6. Sweep Process

The meaning of the runner system sweep process is to generate profiles at specified interpolation positions for all defined sweep paths. After this process, a runner system is fully defined. The fourth step of defining a runner system is called the sweep process. But it actually only prepares for sweeping. This step generates sweep path profiles from trajectory profiles attached to trajectories in the profile assignment step (section 7.5.4). Figure 67 illustrates a trajectory tree with automatically generated sweep path profiles. Figure 67 looks similar to Figure 60, but they are actually different, because sweep path profiles are attached to ends of sweep paths, while trajectory profiles are attached to ends of trajectories. After all sweep path profiles have been attached, a runner system is fully defined.

87

Figure 68: Runner Sweep Definition Interface

Figure 68 illustrates the corresponding user interface of the sweeping step. It allows three ways of generating sweep path profiles. The generations of profiles at ends of sweep paths are all the same for these three different ways. An end profile is generated by interpolating the child trajectory that is associated with the sweep path. The generation of profiles at the start of sweep paths is different. The [copy parent shape] option will generate a start profile by interpolating profiles of the associated parent trajectory directly. The [copy child shape] option will generate a start profile by copying the end profile of a sweep path. The [divide parent shape] option will generate start profiles by dividing an interpolated parent trajectory profile according to areas of end profiles of sweep paths attached to the same trajectory node. The reason that different ways of generating start sweep path profiles are expected is that it allows users to control areas and shapes of result runners explicitly at branch positions. In the current implementation of this project, only the [copy parent shape] option is implemented.

88

Figure 69: Runner Solid Generation Interface

7.5.7. Solid Generation

The last step of defining a runner system is to generate a solid from previously defined runner system data. A solid model is a set of surfaces that form an enclosed space. To generate a solid model of the runner system, a traversal need to be performed on the defined sweep path tree to identify facets formed by connecting corresponding profile points of neighboring profiles. In the current implementation of this project, a solid is not generated yet, but the runner system is rendered in solid mode. Figure 70 is an illustration of a rendered solid.

Figure 69 illustrates the user interface of the solid generation interface. The [Toogle display] button toogles OpenGL rendering mode between wireframe, hidden line and shaded mode.

89

Figure 70: Runner Solid View

90

CHAPTER 7

8. CONCLUSION AND FUTURE WORK

8.1. Conclusion

The profile creation method introduced in this project utilizes b-spline curve fitting algorithms to generate uniform interpolation points from user-defined none-uniform sketch points. In this way, hard problems like generating smooth surfaces from polygon profiles of different number of points have been avoided without losing simplicity or flexibility.

Sweep paths introduced in this project is a concrete data representation of the runner system defined conceptually by a user defined trajectory tree. Sweep paths resemble to machining paths, with no need of providing details like tool sizes. They can make sure generated surfaces are machinable and reasonable.

Sweep paths and interpolation methods introduced in this project can help designers to create smooth runner system surfaces in a simple, flexible and controllable way.

The profile definition and the runner system definition user interface implemented in this project can be used to generate basic data required to construct a runner system.

91

8.2. Future Work

In the implementation of this project, a fixed sweep path configuration was used. Circle is used for the sweep path shape. S-function interpolation is used for normals. Linear interpolation is used for planar profile points. While, actually other interpolation methods can be used for same purpose with possibly better results. At this stage, only linear interpolation and s-function interpolation has been implemented. With the introduction of other higher order interpolation methods, for example b-spline interpolation method, smoother runner system surfaces can be generated. With higher order smoothness along flow direction, flow patterns can be controlled in a better way.

Another issue is how to organize different interpolation methods. Different interpolation methods require different kinds of inputs. To be able to apply them easily, a uniform function interface and user interface need to be developed for different interpolation methods.

With the introduction of higher order interpolation methods and controls over them, branch intersection might eliminate it current constraints and promise nice results for branch situations. And therefore, flexibility and simplicity of this approach can be increased.

In the current implementation of this project, profiles are utilized all the way from the beginning to the end, but no area calculation has been performed. If an area based calculation can be added, this solution will fit better to a die casting die design process.

Currently, a fan gate can be created in the same way like a piece of runner. But to support the creation of tangent gates and overflows, current implementation possibly need to be modified.

92

REFERENCES

1. K.S. Lee, J.C. Lin, “Design of the runner and gating system parameters for a multi-cavity injection mould using FEM and neural network”, International Journal of Advanced Manufacturing Technology, (2006) 27: 1089–1096.

2. Kevin Alam, Musa R. Kamal, “A robust optimization of injection molding runner balancing”, Computers and Chemical Engineering, 29 (2005), 1934–1944.

3. M. Masoumi, H. Hu, “Effect of Gating Design on Mold Filling”, AFS Transactions 2005.

4. Jerald Brevick, R. Allen Miller, “Final Report on Understanding the Relationship between Filling”, 2004.

5. Y. K. Woon, K. S. Lee, “Development of a die design system for die casting”, International Journal of Advanced Manufacturing Technology, (2004) 23: 399–411.

6. Dongtao Wang, “Equilibrium temperature analysis and fill pattern reasoning for die casting process”, Ph.D’s Thesis, The Ohio State University, 2004.

7. Lin Suo, “Graphical user interface for sketching overflows, runners and gates”, Master’s Thesis, The Ohio State University, 2004.

8. Farouk Shehata, Mohamed Abd-Elhamid, “Computer aided foundry die-design”, Materials and Design, 24 (2003), 577–583.

93

9. X. Dai a, X. Yang, J. Campbell b, J. Wood, “Effects of runner system design on the mechanical strength of Al-7Si-Mg alloy castings”, Materials Science and Engineering, A354 (2003), 315-325.

10. J. C. Choi, T. H. Kwon, J. H. Park, J. H. Kim, C. H. Kim, “A Study on Development of a Die Design System for Die Casting”, International Journal of Advanced Manufacturing Technology, (2002) 20:1–8

11. Lee, K.S., Luo, C., “Application of Case-Based Reasoning in Die-Casting Die Design”, International Journal of Advanced Manufacturing Technology, 20 (2002), 284-295.

12. S. H. Wu, K. S. Lee, J. Y. H. Fuh, “Feature-Based Parametric Design of a Gating System for a Die-Casting Die”, International Journal of Advanced Manufacturing Technology, (2002) 19:821–829.

13. Paul Cleary, Joseph Ha, Vladimir Alguine, Thang Nguyen, “Flow modelling in casting processes”, Applied Mathematical Modelling, 26 (2002) 171–190.

14. Chang-Ho Kim, Taek Hwan Kwon, “A runner-gate design system for die casting”, Materials and Manufacturing Processes, 16(6), 789–801 (2001).

15. J. C. Lin, Optimum gate design of free-form injection mould using the abductive network. Int J Adv Manuf Technol, 2001,17:294–304

16. B.H. Hu, K.K. Tong, X.P. Niu, I. Pinwill, “Design and optimization of runner and gating systems for the die casting of thin-walled telecommunication parts through numerical simulation” , Journal of Materials Processing Technology, 105 (2000), 128-133.

17. R. C. Givler, D. B. Saylors, “Efficient runner networks for investment castings”, International Journal for Numerical Methods in Engineering, 2000, 48:1601-1614.

94

18. C. C. Tai, J.C. Lin, “The optimal position for the injection gate of a die-casting die”, Journal of Materials Processing Technology, 86 (1999), 87-100.

19. C.C Tai, J.C Lin, “A runner-optimization design study of a die-casting die”, Journal of Materials Processing Technology, 84 (1998), 1–12.

20. Shamsuddin Sulaiman, Tham Chee Keen, “Flow Analysis along the Runner and Gating System of a Casting Process”, Journal of Materials Processing Technology, Volume 63, issue 1-3 (January, 1997), p. 690-695.

21. W. S. Zhang, S. M. Xiong, B. C. Liu, Study on a CAD/CAE system of die casting. J Mater Process Tech, 1997, 63:707–711

22. C. S. Lia, Y. K. Shen, “Optimum design of runner system balancing in injection molding”, Previews of Heat and Mass Transfer, Vol: 21, Issue: 3, May 6, 1995, 257.

23. R. Yagel, S. C. Lu, A. B. Rebello, R.A. Miller, “Volume-Based Reasoning and Visualization of Diecastability”, 1995.

24. Rohinton K. Irani, Srinivas Kodiyalam, David O. Kazmer, “Runner System Balancing for Injection Molds using Approximation Concepts and Numerical Optimization”, 1992.

25. W. R. Jong, K. K. Wang, Automatic and optimal design of runner systems in based on the flow simulation. SPE Annual Technical Conference, 1990, pp 554–560

26. Youquan Liu, Xuehui Liu, Enhua Wu, Real-Time 3D Fluid Simulation on GPU with Complex Obstacles.

27. Rebello, A. B., Visualization of the filling of die-casting dies, PhD dissertation, The Ohio State University, 1997.

28. Harris, Fast Fluid Dynamics Simulation on the GPU, GPU Gems, 2004

95

29. NADCA, NADCA Course Modules.

30. NADCA website, https://www.diecasting.org/publications/cgi-bin/quikstore.pl?search=yes&hits_seen=& product=300D&category=gating,software&keywords=&detail=yes&page=search.html &template=database_list_page&and=

31. NADCA website, https://www.diecasting.org/publications/cgi-bin/quikstore.pl?search=yes&hits_seen=& product=316-CD&category=design,software&keywords=castview&detail=yes&page= search.html&template=database_list_page&and=

32. Simulated Annealing Flow Chart, http://members.aol.com/btluke/simanf2.htmHTU UTH

33. John Kluz, Moldmaking and Die Cast Dies for Trainees

34. NADCA website, http://www.diecasting.org/faq/default.htmHTU UTH

35. NADCA website, http://www.diecasting.org/faq/glossary.htmHTU UTH

36. Sarfraz M, “Advances in Geometric Modeling”, 2004

37. David F. Rogers, “An Introduction to NURBS: With Historical Perspective”, 2001

38. Hartmut Prautzsch, Wolfgang Boehm, Marco Paluszny, “Bezier and B-Spline Techniques”, 2002

39. Max K. Agoston, “Computer Graphics and Geometric Modeling: Implementations and Algorithms”, 2005

40. Gerald Farin, “Curves and Surfaces for CAGD: A Practical Guide”, 2002

41. David Salomon, “Curves and Surfaces for Computer Graphics”, 2006

42. http://en.wikipedia.org/wiki/Equation_solvingHTU UTH

43. http://www.physics.arizona.edu/~resHTU trepo/475A/Notes/sourcea/node16.html UTH 96

44. http://www.physics.arizona.edu/~resHTU trepo/475A/Notes/sourcea/node17.html UTH

45. http://www.physics.arizona.edu/~resHTU trepo/475A/Notes/sourcea/node18.html UTH

46. Lane, J.M., and Riesenfeld, R.F., “A Theoretical Development for the Computer Generation and Display of Piecewise Polynomial Surfaces,” IEEE Transactions on Pattern Analysis and Machine Intelligence, PAMI-2(1), January 1980, 35–46

47. Turner, Joshua U., “Accurate Solid Modeling Using Polyhedral Approximations” CG&A, 8(3), May 1988, 14–28.

48. http://www.engr.sjsu.edu/youssefi/me265/notes/Surfaces.pptHTU UTH

49. David S. Ebert, “Texture & Modeling: A Procedure Approach”

97