# Lecture_008_Introduction_to_Geometry

## Encodings of Geometry

Challenges: can't find the best representation

• curved vs. not curved geometry

• simulate dynamic cloth, changing over time

• fluid droplets merge

• complex geometry with detail in scale (instancing)

• volumetric shape (fury dog)

• shape of protein is important characteristics

Explicit Encoding: all points are given directly (easy to find all points, relatively easy to check point belonging, hard to check 3D relation)

• triangle meshes

• polygon mesh

• point cloud

• subdivision surfaces

• NURBS

Implicit Encoding (decision problem): find the best way to encode functions (hard to find all points, easy to check point belonging, easy to check 3D relation)

• level set

• algebraic surface

• L-system

• constructive solid geometry

• blobby surfaces

• fractals

## Implicit Encoding

Algebraic Surfaces: surface is a zero set of polynomial in $x, y, z$.

• very hard to come up with polynomial encoding with shapes in mind

Constructive Solid Geometry: building complicated shapes using boolean operations

Blending Irregular Shape with Distance Function

Blobby Surfaces: blend surfaces together

Fractals: constructed by checking whether a point is in the mandelbrot set (whether it will converge on some repeated operation)

• Iterated function system

Implicit Representation

• compact representation

• easy to determine whether a point is in the shape

• distance query is easy

• no sampling error

• easy to change topology

• expensive to iterate

• difficult to model

## Explicit Encoding

Level Set:

• good for captured data such as MRI

• good for fluid simulation

• storage intensive (could be solved by encoding using spherical harmonics by storing just surface)

Side note: 3D printer operates in $O(n^3)$ because it fills the interior. Laser cut operates in $O(n^2)$ because it just cuts the surface and stack up together. Resin printer operates in $O(n)$ span because it shoots a screen of beams to solidify objects.

Pointcloud: $(x, y, z)$ sometimes augmented with normal vector $\vec{n}$

• easy to represent any shape

• hard to interpolate (no locality), undersampled region

• hard to do processing and simulation

• irregular neighborhood

• triangle mesh

• vertice list
• triangle list
• in some sense, linear interpolation of pointcloud

## Bernstein Basis

If we write polynomials like $a + bx + cx^2 + dx^3 + ...$ it is not obvious how we should adjust the polynomial to achieve certain shape. However, Bernstein Basis provides a new encoding to polynomials that is intuitive to adjust.

Bezier Curves: it is a curve expressed in Bernstein Basis.

\gamma(x) = \sum_{k = 0}^n B_{n, k}(s)p_k

where $p_k$ is control point for $k$ degree polynomials.

Properties of Bezier Curves:

• curve go through endpoints

• curve tangent to end segments

• curve fully contained in convex hull bounded by control points (nice for rasterization)

• high degree bezier curves is hard to control (so we often piece together many Bezier curves)

Font format sometimes use degree 4 Bezier due to lack of computation in the past

Tensor Product: points on the surface is given by two functions each control variation fo $u$ and $v$.

Bezier Patches: sum of tensor products of Berstein basis.

It is not obvious why those patches can be connected to form a smooth surface. So there are many spline patch schemes: NURBS, Gregory, Pm, polar.

Trade offs: degree of freedom, continuity, difficulty of editing, generality

Rational B-spline: Bezier can't express conics. But this can be achieved by adding homogeneous coordinates and projection back to plane.

Non-Uniform Rational BSpline (NURBS)

• non-uniform: knots at arbitrary location

• rational: expressed in homogeneous coordinates (control strength of vertex), and divide

• B-Spline: piecewise polynomial curve

Subdivision Surface: repeatedly split by taking weighted average to get new positions

• Possible Rules: Catmull-Clark (quads), Loops (triangles)

• easy to model

• harder to interpolate

• poor continuity

• hard to evaluate limit

Table of Content