An Introduction to Geometry Design Algorithms Fathi El-Yafi Project and Software Development Manager Engineering Simulation 1
Geometry: Overview Geometry Basics Definitions Data Semantic Topology Mathematics Hierarchy CSG Approach BREP Approach Curves Surfaces 2
Geometry: Concept Basics vertices: x,y,z location 3
Geometry: Concept Basics vertices: x,y,z location curves: bounded by two vertices 4
Geometry: Concept Basics vertices: x,y,z location curves: bounded by two vertices surfaces: closed set of curves 5
Geometry: Concept Basics vertices: x,y,z location curves: bounded by two vertices surfaces: closed set of curves volumes: closed set of surfaces 6
Geometry: Concept Basics vertices: x,y,z location curves: bounded by two vertices surfaces: closed set of curves volumes: closed set of surfaces body: collection of volumes 7
Geometry: Concept Basics vertices: x,y,z location curves: bounded by two vertices surfaces: closed set of curves loops: ordered set of curves on surface volumes: closed set of surfaces body: collection of volumes 8
Geometry: Concept Basics vertices: x,y,z location curves: bounded by two vertices coedges: orientation of curve w.r.t. loop surfaces: closed set of curves (loops) loops: ordered set of curves on surface volumes: closed set of surfaces body: collection of volumes 9
Geometry: Concept Basics vertices: x,y,z location curves: bounded by two vertices coedges: orientation of curve w.r.t. loop surfaces: closed set of curves (loops) shell: oriented set of surfaces comprising a volume volumes: closed set of surfaces (shells) loops: ordered set of curves on surface body: collection of volumes 10
Geometry: Concept Basics vertices: x,y,z location curves: bounded by two vertices coedges: orientation of curve w.r.t. loop surfaces: closed set of curves (loops) shell: oriented set of surfaces comprising a volume volumes: closed set of surfaces (shells) loops: ordered set of curves on surface body: collection of volumes 11
Geometry: Concept Basics vertices: x,y,z location coface: oriented surface w.r.t. shell shell: oriented set of surfaces comprising a volume curves: bounded by two vertices volumes: closed set of surfaces (shells) coedges: orientation of curve w.r.t. loop loops: ordered set of curves on surface surfaces: closed set of curves (loops) body: collection of volumes 12
Geometry: Concept Basics Surface 11 Volume 2 Volume 1 Manifold Geometry: Each volume maintains its own set of unique surfaces Volume 2 Surface 7 Surface 8 Surface 9 Surface 10 Surface 11 Volume 1 Surface 1 Surface 2 Surface 3 Surface 4 Surface 5 Surface 6 Surface 7 13
Geometry: Concept Basics Volume 1 Non-Manifold Geometry: Volumes share matching surfaces Volume 2 Volume 2 Surface 7 Surface 8 Surface 9 Surface 10 Volume 1 Surface 1 Surface 2 Surface 3 Surface 4 Surface 5 Surface 6 Surface 7 14
Geometry: Data Model Wireframe Surface Volume Geometrical Data Separated from Attributes Attributes Colors Parameters Etc. Graphical Objects Visible Parts 15
Semantic: Surface-Volume-Deflection-Defects 16
Semantic: Surfaces and Features 17
Semantic: Detail 18
Semantic: Detail-Mesh Bounding Box 19
Semantic: Decomposition Curvature Mesh STL-Mesh FEM 20
Wireframe Model: Limits 21
Basics of Topology Topology? Concept of interior and exterior Orientation Reliable calculation of basic parameters: volume, center of gravity, axis of inertia Contour = oriented surface and limited area Tree construction 22
Relations: (Geometry, Topology) Geometry Topology Volume Solid Surface face Contour Curve Vertex Edge Point 23
Topology: Mathematics A contour grips" to its interior Either S is a Set of R 3 Adhesion : A(S) P A( S) : any neighborhood of P contains a point of S Interior : I(S) P I( S) if V(P) S Boundary : B(S) P B( S) if P A( S) and P A( C(S)) where C(S) refers to the complementary of S in R 3 24
Topology: Mathematics Open : S = A(S) Closed : S = I(S) Regular Solid S = A(I(S)) : adhesion of its interior = R(S) 25
Topology: Mathematics Operator of Regularization A B = R(A B) A B = R(A B) A - B = R(A-B) C(A) = R(C(A)) A B A A B R(A B) A - B R(A B) 26
Topology: Mathematics Operator of Regularization A B A B A B C(A)/B R(C(A)/B) 27
Topology: Mathematics Euler Formula: V+F = E+2 Polyhedron Type of Faces F V E Tetrahedron Equilateral Triangles 4 4 6 Octahedron Equilateral Triangles 8 6 12 Cube Squares 6 8 12 Dodecahedron Pentagons 12 20 30 Icosahedrons Equilateral Triangles 20 12 30 F = number of faces, V = number of vertices E = number of edges 28
Topology: Mathematics Cauchy Proof (1789-1857) V+F=E+2 V+F=E+1 V+F+1=(E+1)+1 V+F=E+1 V+F=E+1 V+F=E+1 (V-2)+F=(E-2)+1 V+F=E+1 3+1=3+1!! 29
Topology: Mathematics Mesh Examples F = 3844 V = 1924 E = V + F 2 = 5766 F = 47566 V = 23793 E = S + F 2 = 71357 30
Topology : Hierarchy 31
CSG : Constructive Solid Geometry Constructive Representation Parametric Volume Primitives Transformations Boolean Operators: Union, common, subtract Advantage : Concept of Graph Simple Description Simulation of Object «Manufacturing» 32
CSG: Primitive Components 33
CSG: Boolean Operators Union U 34
CSG: Boolean Operators Union U 35
CSG: Boolean Operators Subtract - U 36
CSG: Boolean Operators Common 37
CSG: Boolean Operators Fillet 38
Geometry: Curves x, y, z function of u, continuous first order Lap back point s(u) u Multiple point Arc length, abscissa curvilinear 2 2 2 2 ds = dx + dy + dz τ(s) τ(s+ds) s( u) u u 0 2 2 2 dx dy dz = + + du du du du u=u 0 39
Geometry: Curvature 40
Geometry: Curvature 41
Geometry: Curvature O n Ray of Osculator Circle = Curvature Ray OM = n ρ M For the curve with the equation y = f(x): Parametric curve: 42
Geometry: Vector and Tangential Frenet Reference 2 dx d x 2 ds ds 2 2 dom dy d OM d y τ ( u) = et n( u) = 2 2 ds ds ds ds dz 2 d z ds 2 ds n = Principal normal t OM(s+dh2) OM(s) OM(s+dh1) 43
Geometry: Torsion M(s+ds) M(s) Osculator Plane at M(s) Torsion 44
Geometry: Propeller Circular 2 d x d x = -R s in θ = -R c o s θ 2 x = R c o s d d θ θ θ 2 d y d y y = R s in θ, = R c o s θ, = -R s in θ 2 d θ d θ z = p θ d z 2 = p d z d θ = 0 2 d θ 2 2 2 2 2 2 2 2 a in s i d s = d x + d y + d z = R + p e t d o n c s = R + p θ d x R 2 d x R = - s in θ = - c o s θ d s 2 2 2 2 2 R + p d s R + p 2 d y R d τ d y R R τ = c o s θ e t = - s in θ a v e c ρ = d s 2 2 R + p d s d s R + p R + p 2 d z p d z = = 0 2 2 2 d s R + p d s 2 2 2 2 2 p s in θ 2 2 R p + -p d b p b = τ n c o s θ e t = T d o n c T = 2 2 R + p d s R + p R 2 2 R + p 2 2 45
Geometry: Propeller Circular -0.5-1 3 0 Discretizing -1 0.5 1 1-1 -0.5 0 0.5 0.5 1 0-0.5-1 3-0.5 0 0.5 1 2 2 1 1 0 0 46
Geometry: Frenet - Serret Reference, Equations, Curvature, Torsion The Frenet - Serret equations are a convenient framework for analyzing curvature. T(s) is the unit tangent to the curve as a function of path length s. N(s) is the unit normal to the curve B(s) is the unit binormal; the vector cross product of T(s) and N(s). Frenet Reference: Frenet Equations: For any parametric function f(t), the expression of the curvature and the torsion are the following: 47
Geometry: Curvature Gaussian, Average Gaussian Curvature Average Curvature Curvature Cmap 48
Geometry: Curvature Gaussian, Average Sphere Gaussian Curvature = 1 R 2 Average Curvature = 1 _ R 49
Geometry: Curvature Gaussian, Average Torus Gaussian Average 50
Geometry: Curvature Torus 51
Geometry: Surfaces of Revolution 1-1 0.5-0.5 0 0 0.5-0.5-1 4 1 3 2 1 0-1 1-0.5 0 0.5 1 0.5 1-0.5 0-1 -4-2 0 2 4-4 -2 0 2 4 0.5 0-0.5-1 -1-0.5 0 0.5 1 52
Geometry: Particular Surfaces Mobius Strip: 'Endless Ribbon' 10 0-10 -25 0 25 50-40 -20 0 20 40 53
Geometry: Particular Surfaces The Klein Bottle 54
Geometry: Particular Surfaces The Klein Bottle 55
Geometry: Particular Surfaces The Klein Bottle: Curvature 56
Geometry: Particular Surfaces The Kuen Surfaces x=2*(cos(u)+u*sin(u))*sin(v)/(1+u*u*sin(v)*sin(v)) y=2*(sin(u)-u*cos(u))*sin(v)/(1+u*u*sin(v)*sin(v)) z=log(tan(v/2))+2*cos(v)/(1+u*u*sin(v)*sin(v)) 57
Geometry: Particular Surfaces The Dini Surfaces x=a*cos(u)*sin(v) y=a*sin(u)*sin(v) z=a*(cos(v)+log(tan((v/2))))+b*u a=1,b=0.2,u={ 0,4*pi},v={0.001,2} 58
Geometry: Particular Surfaces Asteroid x= pow (a*cos(u)*cos(v),3) y= pow (b*sin(u)*cos(v),3) z= pow (c*sin(v),3) 59
Geometry: Particular Surfaces The «Derviche» 60
Geometry: Curves Lagrange Interpolating Polynomial The Lagrange interpolating polynomial is the polynomial P(x) of degree <= (n-1) that passes through the n points (x 1,y 1 = f(x 1 )), x 2,y 2 = f(x 2 )),..., x n,y n = f(x n )), and is given by: 61
Geometry: Curves Lagrange Interpolating Polynomial Where: Written explicitly: 62
Geometry: Curves Cubic Spline Interpolating Polynomial A cubic spline is a spline constructed of piecewise third-order polynomials which pass through a set of m control points. The second derivative of each polynomial is commonly set to zero at the endpoints, since this provides a boundary condition that completes the system of m -2 equations. This produces a so-called "natural" cubic spline and leads to a simple tridiagonal system which can be solved easily to give the coefficients of the polynomials. However, this choice is not the only one possible, and other boundary conditions can be used instead. 63
Geometry: Curves Cubic Spline Interpolating Polynomial Consider 1-dimensional spline for a set of n+1 points (y 1, y 2,.., y n ), let the ith piece of the spline be represented by: Where t is a parameter and i = 0,, n-1 then Rearranging all these equations, leads to the following beautifully symmetric tridiagonal system: If the curve is instead closed, the system becomes 64
Geometry: Curves Cubic Spline/Lagrange 2 1 2 1-1 -2 1 2 3 4 5 6 7-1 1 2 3 4 5 6 7-3 -4-2 -5-3 65
Geometry: Curves Bézier Given a set of n + 1 control points P 0, P 1,.., P n, the corresponding Bèzier curve (or Bernstein- Bèzier curve) is given by: Where B i,n (t) is a Bernstein polynomial and. A "rational" Bézier curve is defined by: where p is the order, B i,p are the Bernstein polynomials, P i are control points, and the weight W i of P i is the last ordinate of the homogeneous Point P iw. These curves are closed under perspective transformations, and can represent conic sections exactly. 66
Geometry: Curves Bézier:Properties The Bézier curve always passes through the first and last control points. The curve is tangent to P1 P0 and Pn Pn-1 at the endpoints. The curve lies within the convex hull of the control points. 67
Geometry: Curves Bézier:Properties A desirable property is that the curve can be translated and rotated by performing these Operations on the control points. Undesirable properties of Bézier curves are their numerical instability for large numbers of control points, and the fact that moving a single control point changes the global shape of the curve. 68
Geometry: Curves Bézier: Bernstein Polynomials B in (t) = C ni (t-1) n-i t i, C ni = n! / i!(n-i)! B j i (t) = (1-t)B j-1 i (t) + t B j-1 i-1 (t) B 1 0 (t) = (1-t)B 0 0 (t) + t B -10 (t) B 1 1 (t) = (1-t)B 0 1 (t) + t B 00 (t) B 0 2 (t) = (1-t)B 0 1 (t) + t B -11 (t) 69
Geometry: Curves Bézier: Bernstein Polynomials B i j (t) = (1-t)B i j-1 (t) + t B i-1 j-1 (t) Unit Partition: Σ i=0,n B in (t) = 1 0<=B in (t)<= 1 B in (0) = 0 et B in (1) = 0 B 0n (0) = 1 B nn (1) = 1 70
Geometry: Curves B-Spline A B-Spline is a generalization of the Bézier curve. Let a vector known as the knot vector be defined T = {t 0, t 1,, t m }, where T is a no decreasing sequence with, and define control points P 0,..., P n. Define the degree as: p = m-n-1 The "knots t p+1,..., t m-p-1 are called internal knots. 71
Geometry: Curves B-Spline Define the basis functions as: Then the curve defined by: is a B-spline. Specific types include the non periodic B-spline (first p+1 knots equal 0 and last p+1 equal to 1; illustrated above) and uniform B-spline (internal knots are equally spaced). A B-spline with no internal knots is a Bézier curve. A curve is p - k times differentiable at a point where k duplicate knot values occur. 72
Geometry: Curves NURBS-Curve A non uniform rational B-spline curve defined by: where p is the order, N i,p are the B-Spline basis functions, P i are control points, and the weight W i of P i is the last ordinate of the homogeneous point P iw. These curves are closed under perspective transformations, and can represent conic sections exactly. 73
Geometry: Curves Conics P(t) = i = 3 i = 0 i = 3 wi Ni, 2( t) Pi( t) i =00 wi Ni, 2( t) Parabola w=1 (0,0,0,1,1,1) Hyperbole w=4 Ellipse w=1/4 74
Geometry: Curves Arcs NURBS of degree 2 Control points (Isosceles triangle) Knot vector (0,0,0,1,1,1) 75
Geometry: Curves Circles (0, 0, 0, 1/3, 1/3, 2/3, 2/3, 1, 1, 1) (0, 0, 0, 1/4, 1/4, 1/2, 1/2, 3/4, 3/4, 1, 1, 1) 76
Geometry: Surfaces Bézier A given Bézier surface of order (n, m) is defined by a set of (n + 1)(m + 1) control points ki,j. evaluated over the unit square, where: is a Bernstein polynomial, and is the binomial coefficient. 77
Geometry: Surfaces Bézier S(u,v) = Σ i=0,n Σ j=0,m B in (u) B jm (v) P ij (n+1)(n+1) points P ij P i (v) = Σ j=0,m B jm (v)p ij 78
Geometry: Surfaces NURBS NURBS are nearly ubiquitous for computer-aided design (CAD), manufacturing (CAM), and engineering (CAE) and are part of numerous industry wide used standards, such as IGES, STEP, ACIS, Parasolid. 79
Geometry: Surfaces NURBS: Properties NURBS curves and surfaces are useful for a number of reasons: They are invariant under affine as well as perspective transformations. They offer one common mathematical form for both standard analytical shapes (e.g., conics) and free-form shapes. They provide the flexibility to design a large variety of shapes. They reduce the memory consumption when storing shapes (compared to simpler methods). They can be evaluated reasonably quickly by numerically stable and accurate algorithms. They are generalizations of non-rational B-Splines and non-rational and rational Bézier curves and surfaces. 80