geometric modeling in graphics - uniba.sk
TRANSCRIPT
Geometric
Modeling
in Graphics
Martin SamuelΔΓk
www.sccg.sk/~samuelcik
Part 7: Surfaces
Surface
2D set of points, embedded in space E3
f: R2 β E3
Parametric surfaces
Set of all points X Ο΅ E3 such that X = f(u,v),
u Ο΅ <u0,u1>, v Ο΅ <v0,v1>
Plane: f(u,v)= S + uD1 + vD2
Sphere: f(u,v)=(r.cos(u).cos(v), r.cos(u).sin(v), r.sin(v)),
u Ο΅ <0,2Ο>, v Ο΅ <0, Ο>
Implicit surfaces
Set of all points X Ο΅ E3 such that f(X)=0
Plane: ax+by+cz+d = 0
Sphere: (x-sx)2 +(y-sy)
2 + (z-sz)2 βr2 = 0
Geometric Modeling in Graphics
Parametric surface Two parameters in surface function
Similar properties, algorithms like in curve case β putting
one parameter constant leads to isocurve
Visualization
Sampling domain using 2D grid points
Computing surface points using sampled points and f
Connecting surface points based on domain grid connections
and forming triangle or quad mesh
Uniform sampling
Adaptive sampling
Raytracing
Geometric Modeling in Graphics
Polynomial surface
f is polynomial function in both parameters
Monomial basis
π π’, π£ = ππππ’ππ£ππ
π=0ππ=0
Bezier surface
π π’, π£ = ππππ΅ππ(π’)π΅
ππ(π£)
ππ=0
ππ=0
Square domain: π’ β< 0,1 >, π£ β< 0,1 >
Bernstein basis: π΅ππ π’ =
ππ
(1 β π’)ππ’πβπ
Tensor product surface
Approximation surface
Interpolating π00, ππ0, π0π, πππ
Boundary curves are Bezier curves
Algorithms adopted from curve case
Geometric Modeling in Graphics
Polynomial surface
Bezier triangle
π π’, π£ = πππππ΅ππππ(π’, π£, 1 β π’ β π£)π
π=0,π=0,π=0π+π+π=π
Triangle domain: π’ β< 0,1 >, π£ β< 0,1 >, π’ + π£ β€ 1
Generalized Bernstein basis: π΅ππππ π’, π£, π€ =
π!
π!π!π!π’ππ£ππ€π
π’, π£, π€ β barycentric coordinates in domain
Approximation surface of order π
Interpolating ππ00, π0π0, π00π
Special adaptation of curve algorithms
Geometric Modeling in Graphics
Polynomial surface
Hermite bicubic surface
π π’, π£ = ππ»ππ»πππ
π = π’3 π’2 π’ 1 , V = π£3 π£2 π£ 1
π» =
2 β2 1 1β3 3 β2 10 0 1 01 0 0 0
π =
π00 π01 π00π£ π01
π£
π10 π11 π10π£ π11
π£
π00π’ π01
π’ π00π’π£ π01
π’π£
π10π’ π11
π’ π10π’π£ π11
π’π£
π00, π10, π01, π11- interpolated corner points
ππππ’, πππ
π£- tangent vectors in corner points
ππππ’π£- second order derivatives, twists, in corner points
Square domain: π’ β< 0,1 >, π£ β< 0,1 >
Geometric Modeling in Graphics
Polynomial surface
Coons surface (patch)
Given four boundary parametric curves
p π’, 0 , π π’, 1 , π 0, π£ , π(1, π£) meeting at four corners
π π’, π£ = π π’, 0 1 β π£ + π π’, 1 π€ + π 0, π£ 1 β π’ +π 1, π£ π’ β π 0,0 1 β π’ 1 β π£ β π 0,1 1 β π’ π£ βπ 1,0 π’ 1 β π£ β π 1,1 π’π£
Square domain: π’ β< 0,1 >, π£ β< 0,1 >
Geometric Modeling in Graphics
Spline surface
Piecewise polynomial in both parametric directions
Segments are polynomial surfaces with small order
Expecting order of continuity in both directions
Geometric Modeling in Graphics
Bezier spline surface Each segment is represented as Bezier surface
Usually linear, quadratic or cubic segments
Continuity guaranteed by constraints on control points
near boundary
Geometric Modeling in Graphics
Hermite bicubic spline surface
Geometric Modeling in Graphics
Given 2D grid of vertex points πππ; π = 0,1,β¦ , π; π = 0,1,β¦ ,π, grid of tangent vectors for vertex points in both directions πππ
π’, ππππ£; π = 0,1,β¦ , π; π = 0,1,β¦ ,π, grid of twist vectors for
each vertex point ππππ’π£; π = 0,1,β¦ , π; π = 0,1,β¦ ,π two
vectors of knot parameters π’0 < π’1 < β― < π’π, π£0 < π£1 < β― <π£π
Interpolation surface, interpolating each given vertex πππ and maintaining tangent vectors and twists at πππ
Interpolation of tangents and twists - C1 continuity
Each segment is represented in Hermite cubic surface form For π’ β< π’0, π’π >, π£ β< π£0, π£π >, pick span ππ such that π’ β<
π’π , π’π+1 >, π£ β< π£π , π£π+1 >
π’ =π’βπ’π
π’π+1βπ’π, π£ =
π£βπ£π
π£π+1βπ£π
Compute point on Hermite bicubic spline surface using Hermite bicubic surface for corners πππ , ππ+1π , πππ+1, ππ+1π+1 and parameters π’ , π£
Hermite cubic spline surface
Geometric Modeling in Graphics
Automatic computation of tangent vectors, knots from
given points and knot parameters
Automatic computation of knot vectors
Using approaches from curve Hermite cubic spline case for
each parameter separately
Twists β zero vectors β Ferguson surface
Curved PN triangles
Geometric Modeling in Graphics
https://www.cise.ufl.edu/research/SurfLab/papers/00ati.pdf
Given triangular mesh with vertex normals
Creating surface interpolating vertices of mesh and having given normals in that vertices
Piecewise polynomial mesh, creating one Bezier triangle for each triangle of mesh
Interpolating geometry β cubic Bezier triangle
Interpolating normals β quadratic Bezier triangle
Implemented in hardware
Curved PN triangles
Geometric Modeling in Graphics
π300 = π1, π030 = π2, π003 = π3
π€ππ = ππ β ππ . ππ
π210 =2
3π1 +
1
3π2 β
π€12
3π1
π120 =2
3π2 +
1
3π1 β
π€21
3π2
π021 =2
3π2 +
1
3π3 β
π€23
3π2
π012 =2
3π3 +
1
3π2 β
π€32
3π3
π102 =2
3π3 +
1
3π1 β
π€31
3π3
π201 =2
3π1 +
1
3π3 β
π€13
3π1
π =1
3π1 +
1
3π2 +
1
3π3
πΈ =1
6π210 +
1
6π120 +
1
6π021 +
1
6π012 +
1
6π102 +
1
6π201
π111 =3
2πΈ β
1
2V
B-spline surface
Geometric Modeling in Graphics
Compact representation of approximating spline surfaces
Tensor product surface
Input
Polynomial degrees ππ’, ππ£
2D grid of control pointsπππ; π = 0, β¦ , ππ’; π = 0, β¦ , ππ£
2 vectors of knot parameters π’0, π’1, β¦ , π’ππ’, π£0, π£1, β¦ , π£ππ£
ππ’ = ππ’ + ππ’ + 1,ππ£ = ππ£ + ππ£ + 1
π΅ππππ’ππ£ π’, π£ = ππππππ’
π π’ πππ£π π£
ππ£π=0
ππ’π=0
Rectangle domain: π’ β< π’ππ’, π’ππ’+1), π£ β< π£ππ£
, π£ππ£+1)
Using B-spline basis function same as in curve case
Similar properties and algorithms as in curve case, treating each parameter separately
B-spline surface
Geometric Modeling in Graphics
Surface subdivision algorithms
Geometric Modeling in Graphics
Producing extended set of control points without change in shape of original surface
Knot insertion, Boehm algorithm, degree elevation
Doo-Sabin subdivision
Corner and edge cutting algorithm
Uniform knot insertion into biquadratic B-spline surface
Originally for regular 2D grid of control points extended for arbitrary meshes, producing polygons of arbitrary size
Catmull-Clark subdivision
Uniform knot insertion into bicubic B-spline surface
Originally for regular 2D grid of control points extended for arbitrary meshes, producing only quads
Surface subdivision algorithms
Geometric Modeling in Graphics
NURBS surface
Geometric Modeling in Graphics
Non-Uniform Rational B-spline surface
Defining weights (real numbers) π€ππ for each control point
Embedding B-spline surface into space with additional dimension β into projective, homogenous space
πππ = π₯ππ , π¦ππ , π§ππ β ππππ = (π€πππ₯ππ , π€πππ¦ππ , π€πππ§ππ , π€ππ)
Evaluation, algorithms in projective space
Projection of result point back to affine space
ππ = π₯, π¦, π§, π€ β π = (π₯
π€,π¦
π€,π§
π€)
π π΅ππππ’ππ£ π’, π£ = π€ππππππ
ππ’π π’ πππ£
π π£ππ£π=0
ππ’π=0
π€πππππ’
π π’ πππ£π π£
ππ£π=0
ππ’π=0
NURBS ruled surface
Geometric Modeling in Graphics
For each point there is line (segment) passing through that point and lying on surface
Connecting two NURBS curves using line segments
Compacting both curves to have same degree and same knot vector β linear transformation of parameter, knot insertion, degree elevation
Putting control points of curves into 2D
ππ£ = 1
Knot vector for π£ direction - (0,0,1,1)
NURBS surface of revolution
Geometric Modeling in Graphics
Rotating NURBS curve around line (coordinate axis)
π’-direction β given NURBS curve
π£-direction β parameters of circular arc as NURBS curve
Control points β rotated control points of given NURBS curve around given line forming control points for circular arc as NURBS curve
Implicit surface
Geometric Modeling in Graphics
Set of all points π β π¬π such that π(π) = 0
Sphere: x2+y2+z2-r2=0
Easy computation if some point is on surface
Defining interior, exterior, border regions by sign of π
Hard to generate points on surface
"Metaballs", "Blobbies", "Soft objectsβ
Smooth
Implicit surface
Geometric Modeling in Graphics
Generation from primitives (points, lines, β¦)-π1, π2, β¦ , ππ Simulating energy field around primitives π·π π - Distance of point π and primitive ππ
π π = π΅(π·π π )ππ=0 β F
F β isovalue, field strength Blobby molecules
π΅ π = ππβππ2, π΅ π =
π
π2
Metaballs
π΅ π = π(1 β3π2
π2 ) for 0 β€ π β€π
3
π΅ π =3π
2(1 β
π
π)2 for
π
3β€ π β€ π
π΅ π = 0 for π β€ π
Soft Objects
π΅ π = π(1 β4π6
9π6 +17π4
9π4 β22π2
9π2 ) for 0 β€ π β€ π
π΅ π = 0 for π β€ π
Two point primitives, varying isovalue F
Implicit surface
Geometric Modeling in Graphics
Boolean operations on two objects represented as implicit surfaces with functions ππ΄, ππ΅
Union
ππ΄βͺπ΅ π = min (ππ΄(π), ππ΅(π))
ππ΄βͺπ΅ π = βπβπππ΄ π β πβπππ΄ π + 1
Intersection
ππ΄β©π΅ π = max (ππ΄(π), ππ΅(π))
ππ΄β©π΅ π = βπβπππ΄ π + πβπππ΄ π + 1
Difference
ππ΄βπ΅ π = max (ππ΄(π),βππ΅(π))
ππ΄βπ΅ π = ππππ΄ π + ππππ΄ π + 1
Implicit surface
Geometric Modeling in Graphics
Smooth approximation of several implicit surfaces
π π = π1 π . π2 π β¦ππ π β πΆ
Morphing, metamorphosis of two surfaces
π π = (1 β π)π1 π + ππ2 π , π β< 0,1 >
Implicit surface
Geometric Modeling in Graphics
Visualization algorithms http://dl.acm.org/citation.cfm?id=2732197 Points generation
Distributing particles over implicit surface
Spatial decomposition Sampling implicit function in finite uniform grid points Generating surface triangles for each cell separately Marching cubes, marching tetrahedra
Surface tracing Creating triangles by tracing surface from starting point Marching triangles
Ray-tracing Simulating rays from eye through screen into scene Each ray given in parametric form π = π + π‘π·, π‘ β πΉ Finding intersection of ray and surface Solving π π + π‘π· = 0 directly or using numerical methods
(Newton..)
Implicit surface
Geometric Modeling in Graphics
Differential geometry
Geometric Modeling in Graphics
Parametric surface
Tangent vectors β ππ’ =ππ π’,π£
ππ’, ππ£ =
ππ π’,π£
ππ£
Normal vector β N = ππ’π₯ππ£
Curvature is based on curve case
For each direction from tangent plane β perpendicular plane to surface β intersection curve β curvature
Principal curvatures = min, max curvatures π1, π2
Mean curvature - π» =π1+π2
2, Gaussian curvature - πΎ = π1. π2
Implicit surface
Gradient, normal vector - π»f = N =ππ
ππ₯,ππ
ππ¦,ππ
ππ§= (ππ₯, ππ¦, ππ§)
Surface is regular at point if gradient is not zero vector
Curvatures determined from parametric case
The End for today
Geometric Modeling in Graphics