27
Outline Discretisation Curves / surfaces Structured grids Unstructured grids Representation of 2D/3D Curves and Surfaces AP Georgy Gimel’farb [email protected] 1 / 27

Representation of 2D/3D Curves and Surfaces€¦ · y x x 3 = x 3(s) x 4 = x 4(s) x 2 = x 2(s) x 1 = x 1(s) 6/27. OutlineDiscretisationCurves / surfacesStructured gridsUnstructured

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Representation of 2D/3D Curves and Surfaces

AP Georgy Gimel’[email protected]

1 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

1 Discretisation

2 Curves / surfaces

3 Structured grids

4 Unstructured grids

Recommended reading:

• M. Shaefer, Computational Engineering - Introduction to Numerical Methods, Springer, 2006: Chapter 3and 8

• G. E. Farin, Curves and Surfaces for CAGD: A Practical Guide. Academic Press, 2002: Chapter 5

2 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Spatial Discretisation

x

y

x

y

x

z

• Discrete 1D, 2D, or 3D spatial domain: a grid (or lattice)

• Most practical objects have very complex geometry• Spatial discretisation of the problem domain is also called grid

generation• May be a very time-consuming task!

Main interdependent problems:

• Efficient generation of the grid

• Grid’s impact onto the accuracy and the efficiency of thesubsequent computation

3 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

A Practical Example of Discrete 3D Surfaceshttp://tetruss.larc.nasa.gov/usm3d v52/TESTCASES.html

4 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

A Practical Example of Discrete 3D Surfaceshttp://tetruss.larc.nasa.gov/usm3d v52/TESTCASES.html

5 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Geometric Description

Volume modelling:

• A number of chosen simple objects (e.g., cubes, cylinders, spheres,

etc.) combined by Boolean algebra operations

− =

Most common approach: Boundary modelling:

• Specifying and composing curvilinear boundary curves (2Dcase) or surfaces (3D case)

y

x

x3 = x3(s)

x4 = x4(s)

x2 = x2(s)

x1 = x1(s)

6 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Numerical Grids

• Discretisation of the problemdomain:

• Grid structure – defined bygrid cells

• 2D cells – defined by grid lines• 3D cells – defined by grid

surfaces defined again by gridlines

• The more regular the grid, themore efficient the computationalalgorithms

• But the regular grid is less flexiblein modelling complex geometry of aproblem domain

Gridcell

Grid pointGrid line

7 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Bezier Curves and Surfaces

Usual description of curves and curvilinear surfaces:

1 Bezier curves

2 B-splines (basis splines) generalising the Bezier curves• Any spline is represented as a linear combination of B-splines

Bezier curve x = x(s) of degree n over the range a ≤ s ≤ b:

x(s) =n∑i=0

biBni (s) witn n+ 1 control points bi; i = 0, . . . , n

Bezier surface x = x(s, t); a1 ≤ s ≤ b1; a2 ≤ t ≤ b2:

x(s, t) =n∑i=0

m∑k=0

bi,kBni (s)Bm

k (t)

8 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Bernstein Polynomials

Control points for Bezier curves and surfaces are combined withthe Bernstein polynomials:

Bni (s) =

1(b− a)n

(n

i

)(s− a)i(b− s)n−i

where(ni

)are the binomial coefficients:(

n

i

)={ n!

i!(n−i)! if 0 ≤ i ≤ n0 otherwise

Polynomials Bni (s) =

(ni

)si(1− s)n−i of degree n = 1..4; 0 ≤ s ≤ 1

n Bn0 (s) Bn

1 (s) Bn2 (s) Bn

3 (s) Bn4 (s)

1 1− s s2 (1− s)2 2s(1− s) s2

3 (1− s)3 3s(1− s)2 3s2(1− s) s3

4 (1− s)4 4s(1− s)3 6s2(1− s)2 4s3(1− s) s4

9 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Bernstein Polynomials: 0 ≤ s ≤ 1

B30(s) B3

3(s)

B32(s)B3

1(s)

Example: Cubic polynomialsB3

0(s) = (1− s)3; B31(s) = 3s(1− s)2;

B32(s) = 3s2(1− s), and B3

3(s) = s3

Properties of the polynomialsBni (s) =

(ni

)si(1− s)n−i

• Recursive definition: B00(s) = 1{

Bni (s) = (1− s)Bn−1

i (s) + sBn−1i−1 (s)

Bni (s) = 0 for j < 0 and j > n

• Partition of unity:n∑i=0

Bni (s) = 1

• Bezier curve of degree 1 ⇒ linear

interpolation between the end points:

B10(s) = 1− s

B11(s) = s

}x(s) = b0(1− s) + b1s

10 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Bezier Curve of Degree 3; 0 ≤ s ≤ 1: An Example

x(s) =3∑

i=0

bi

(3i

)si(1− s)i

= b0(1− s)3 + 3b1s(1− s)2 + 3b2s2(1− s) + b3s

3

= b0 + 3s(b1 − b0) + 3s2(b2 − 2b1 + b0) + s3(b3 − 3b2 + 3b1 − b0)

• Movement of one control point affects the whole curve

• Bni (s) has only one maximum at s = i

n in [0, 1], so themovement of bi mostly affects the curve around theparameter value s = i

n

y

x

x = (x(s), y(s))s = 0b0

b1

b2

s = 1 b3

11 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Bezier Curve of Degree 3; 0 ≤ s ≤ 1: An Example (cont.)

Movement of one control point (b1):

y

xs = 0b0

b1

b2

s = 1 b3

y

xs = 0b0

b1

b2

s = 1 b3

12 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Bezier Curve of Degree 3; 0 ≤ s ≤ 1: An Example (cont.)

Movement of one control point (b2):

y

xs = 0b0

b1

b2

s = 1 b3

y

xs = 0b0

b1

b2

s = 1 b3

13 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Problems in Boundary Modelling

• Gaps, discontinuities, overlaps between neighbouring surfacesor curves

• Bezier surfaces provide a good basis for corrections• Simple conditions for the control points near the boundary for

smooth transitions between the neighbouring surface pieces• E.g., continuity of first and second derivatives

y

x

x3(s)

x4(s)

x1(s)

x2(s)

y

x

x3(s)

x4(s)

x1(s)

x2(s)

14 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Structured Grids

• Generating a structured grid – a unique mapping

(x, y) = (x(i, j), y(i, j)) or (i, j) = (i(x, y), j(x, y))

• i = 0, 1, . . . , N and j = 0, 1, . . . ,M – discrete values in theregular logical or computational domain

• (x, y) – continuous coordinates in the (generally) irregularphysical or problem domain

Problem domainy

xx(i, 0) x(N, j)

x(0, j) x(i,M) ⇒

Logical domainj

i

00

1

1

2

.

.

.

. . .

M

N

15 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Structured Grids

• Properties of a structured grid are controlled by thecomponents of the Jacobi matrix (or Jacobian) J of themappings (i, j)→ (x, y) or (x, y)→ (i, j):

J =

[∂i∂x

∂i∂y

∂j∂x

∂j∂x

]

• These components are called metrics of the grid

• For the uniqueness of the mapping – the non-zerodeterminant of J:

det(J) =∂i

∂x

∂j

∂y− ∂j

∂x

∂i

∂y6= 0

16 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Algebraic Grid Generation

• Initialisation: Prescribe grid points at the boundary of theproblem domain (in physical coordinates x = [x, y]):

x(i, 0) = xs(i); x(i,M) = xn(i) for i = 0, . . . , Nx(0, j) = xw(j); x(N, j) = xe(j) for j = 0, . . . ,M

xn(i)

xs(i)

xe(j)

xw(j)

xs(N) = xe(0)

• Locations of the prescribed gridpoints – on the correspondingboundary curves

• Compatibility conditions for thecorner points:

xs(0) = xw(0); xs(N) = xe(0)xn(0) = xw(M); xn(N) = xe(M)

17 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Algebraic Grid Generation

xn(i)

xs(i)

xe(j)

xw(j)

xs(N) = xe(0)

• Linear (or transfinite) interpolation to determine interiorpoints of the domain from the boundary grid points (belowαi = i

N and βj = jM ):

x(i, j) = (1− βj)xs(i) + βjxn(i) + (1− αi)xw(j) + αixe(j)

− αi (βjxn(N) + (1− βj)xs(N))

− (1− αi) (βjxn(0) + (1− βj)xs(0))

18 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Algebraic Grid Generation: An Example

Boundary points( n – “north”; s – “south”; e – “east”; w – “west”):

i 0 1 2 3 4xn(i) (0.5, 1.5) (1.3, 0.52) (2.03, 1.1) (2.65, 0.475) (3, 0)xs(i) (0, 0) (0.35,−0.15) (0.65,−0.35) (0.85,−0.7) (1,−1)j 0 1 2 3 4

xw(j) (0, 0) (0.285, 0.2) (0.5, 0.5) (0.6, 1) (0.5, 1.5)xe(j) (1,−1) (1.4,−0.55) (1.85,−0.1) (2.4, 0.125) (3, 0)

Transfinite interpolation of the points x(i, j):

j/i 0 1 2 3 40 (0, 0) (0.35,−0.15) (0.65,−0.35) (0.85,−0.7) (1,−1)1 (0.285, 0.2) (0.682, 0.186) (1.025, 0.025) (1.265,−0.3) (1.4,−0.55)2 (0.5, 0.5) (0.975, 0.598) (1.39, 0.45) (1.7, 0.125) (1.85,−0.1)3 (0.6, 1) (1.206, 1.103) (1.748, 0.863) (2.181, 0.431) (2.4, 0.125)4 (0.5, 1.5) (1.3, 1.52) (2.03, 1.1) (2.65, 0.475) (3, 0)

19 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Algebraic Grid Generation: An Example

x

y

(0,0)

(0.285,0.2)

(0.5,0.5)

(0.6,1.0)

(0.5,1.5)

(0.35,-0.15)

(0.65,-0.35)

(0.85,-0.7)

(1,-1)

(2.65,0.475)

(2.03,1.1)

(1.3,1.52)

(3,0)(2.4,0.125)

(1.85,-0.1)

(1.4,-0.55)

(0.682,0.186)(1.025,0.025)

(1.265,-0.3)

(0.975,0.598)(1.39,0.45)

(1.7,0.125)

(1.206,1.103)

(1.748,0.863)

(2.181,0.431)

i

j

(0,0) (4,0)

(0,4)

»x(2, 1)y(2, 1)

–= 0.75

»0.65

−0.35

–+ 0.25

»2.031.10

–+ 0.5

»0.285

0.2

–+ 0.5

»1.4

−0.55

− 0.5

„0.25

»30

–+ 0.75

»1

−1

–«− 0.5

„0.25

»0.51.5

–+ 0.75

»00

–«

=

»0.4875 + 0.5075 + 0.1425 + 0.7− 0.75− 0.0625−0.2625 + 0.275 + 0.1− 0.275 + 0.375− 0.1875

–=

»1.0250.025

–20 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Algebraic Grid Generation

• Generalisation of the transfinite interpolation• Prior problem domain partitioning into different sub-domains• Usage of higher-order interpolation rules

• Higher discretisation accuracy – clustering grid lines in regionswith high gradients of the variables• Stretching functions concentrate grid points along a curve

• Simple stretching function to concentrate grid points xi;i = 1, . . . , N − 1, at the right end of the interval [x0, xN ]:

xi = x0 +γi − 1

γN − 1(xN − x0)

• Control parameter (expansion factor) γ; 0 < γ < 1: the closerγ is to zero, the denser the grid points are near xN :

γ = 0.5γ = 0.7γ = 0.9γ = 1.0

21 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Unstructured Grids: Delaunay Triangulation

• Unique triangulation of a given set of grid points fulfillingcertain properties

• Bowyer-Watson algorithm• Based on the property that the circle through three points

(circumcircle) of an arbitrary triangle contains no other points

• The circumcircle of a triangle is uniquely determined:its midpoint is at the intersection point of theperpendicular bisectors of the triangle sides

• Initialisation: a very coarse problem domain triangulation• Successive addition of points:

• Deleting all triangles containing the new point• Connecting the new point with the corner points of the

polygon which results from the deletion of the triangles

22 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Delauney Triangulation

Inserting a new point in a Delauney triangulation with theBowyer-Watson algorithm:

• This triangulation can be started from scratch by defining asuper-triangle fully containing the problem domain

• After having inserted all points, all triangles which containone or more vertices of the super-triangle are removed

23 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Delauney Triangulation

• If locations at which the grid points should be added areprescribed, the Bowyer-Watson algorithm is carried out aslong as all points are inserted

• Alternatively, it can be combined with a procedure for anautomatic generation of grid points• One possible approach – a priority list on the basis of the

diameter of the circumcircle• The triangle with the highest priority is checked whether the

diameter of its circumcircle is larger than a given threshold• If this criterion is fulfilled, the midpoint of the circumcircle is

chosen as a new grid point• Then the obtained new triangles are inserted into the grid and

added to the priority list• Termination when no more triangle fulfils the above criterion

24 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Advancing Front Method

For a prescribed distribution of the interior grid points

1 Initialisation: Number successively all edges along the outerboundary of the problem domain clockwise and the inner boundaries(if exist) counter-clockwise to define the advancing front by thevector a of the full numbering

2 For the last edge in a: search all grid points on or within theadvancing front; select the point with the smallest sum of thedistances to the two grid points of the last edge, and form a newtriangle with the selected and the two points of the last edge

3 Delete from a the edges of the new triangle, which are contained ina; adjust the numbering of the remaining edges, and add the edgesof the new triangle, which are not contained in a, at the end of a

4 Repeat Steps 2 and 3 until all edges in a are deleted

The interior points can be automatically selected rather than prescribed.

25 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Advancing Front Method

Grid point distribution

⇒ ⇒ ⇒

⇒ ⇒

• Steps of unstructured grid generation: the blue thick lines representthe respective actual advancing fronts

26 / 27

Outline Discretisation Curves / surfaces Structured grids Unstructured grids

Pros and Cons of Grid Generation Methods

• Advancing front methods:+ Simple automatic generation of the interior grid points

ensuring “good” quality of the triangles+ Boundary of the problem domain is represented by grid lines

• Boundary discretisation defines the starting point of themethod and is not modified during the process

– Relatively high computational effort for checking if the pointsgenerated are admissible and have tolerable distances

• Delauney triangulations+ Less computationally intensive than advancing front methods

• No complex checking of intersections and minimal distances

– No boundary integrity is guaranteed for non-convex problemdomains• Triangles can be located (at least partially) outside the

problem domain• Difficulties for generalisations for the 3D case

27 / 27