I’ve been studying geometric representations and computer graphics for some time now, and I haven’t seen anyone talk about shapes and geometry in an accessible way. So in this post, I’ll quickly go over what shapes really are, and where they come from.

A shape is an object with volume and a surface. There are all sorts of technicalities that arise when definining volumes and surfaces, mainly involving self-intersections, holes, and edges. We’re mainly interested in modeling objects that arise in physics and real-world scenarios, so for our purposes, a shape will simply be defined as the form of any rigid object you might find in reality. This vague definition serves to include reasonable objects, like dice and coffee cups, and excludes horrifying pathologies that are best consigned to dark corners of mathematicians' imaginations. Note that although fluids and deformable objects change with time, at any given instant these kinds of objects have a rigid geometry. Things like smoke and foam that have no clear surface and possibly fractal structure, however, are excluded.

More precisely, shapes are:

**connected**: there exists a continuous path between any two points on the shape’s surface. This means we’re talking about a single object and not a collection of objects.**closed**: the shape’s surface doesn’t have an edge, like a circle floating in space. Furthermore, the surface doesn’t extend to infinity like a plane.- This gives us a further property:
**completeness**. There are no holes or missing points in the surface.

- This gives us a further property:
**manifold**: the surface has no multi-way junctions, where more than two sheets meet. In mathematical terminology, this states that a neighborhood of every point is homeomorphic to Euclidean space.

Under these assumptions, our shapes will always divide 3D space into two regions. One region has finite volume, and we’ll call this the **interior** of the shape; the other region will be called the **exterior**. The surface of the shape, known as the **boundary**, is not part of either the exterior or the interior. The shape itself is the set union of the interior and boundary.

Let’s take a moment to talk about dimension. Reality is 3-dimensional, as any point in space can be uniquely determined by 3 values. Surfaces have dimension 2; for example, any location on Earth’s surface is fully described by longitude and latitude. So shapes, as we defined them above, consist of a 2D surface bounding a 3D volume located in 3D space.

If the surface doesn’t contain any sharp points or creases, we can approximate small regions around each point on the surface with a plane. This is analogous to the tangent line in single-variable calculus, and as the area of the small region goes to zero, the approximation plane will become tangent to the surface at the point. Such a surface is **differentiable**. Any vector perpendicular to this plane is called a **normal vector** to the surface at the point. All of these normals lie on a line, and we’ll usually be interested in the unit normal: the unique unit-length vector perpendicular to the tangent plane pointing towards the exterior. We can pick the exterior-pointing normal consistently because of the assumption of closedness above. Even if a surface is non-differentiable at points, under the assumption of closedness, we can approximate it arbitrarily well with a surface that’s differentiable everywhere.

## How do surfaces arise?

Surfaces usually show up in three ways: level sets, images of functions, and piecewise combinations of the preceding forms. Let’s go over each one of these.

### Level sets

Level sets are solutions to equations of the form \(\mathbf{F}(\mathbf{x}) = k\). Suppose \(\mathbf{x} \in \mathbb{R}^n\); then, a level set of \(\mathbf{F}\) is a surface in at most \(n\) dimensions. Under certain conditions, the level set will be a surface of dimension \(n-1\); this is the case we’re interested in. Level sets are also called isosurfaces or isocontours.

### Images

The *image* of a function is the set of the output values for all possible input values. For example, the image of \(f(x) = x^2\) over \(x \in \mathbb{R}\) is the nonnegative reals. Images are frequently called parametrizations; for example, the unit sphere is parametrized by the transformation \(\left( \sin \phi \cos \theta, \sin\phi \sin\theta, \cos\phi\right)\), for \(\phi \in [0, \pi], \theta \in [0, 2\pi]\).

### Piecewise combinations

Imagine that we chop up portions of the above two types of surfaces, and align the boundaries (important!). Then, we’ll get a surface defined by different equations at different points. For example, a cylinder is a piecewise combination of two circles (sections of a plane), and a hollow tube defined by the equation \(x^2 + y^2 = r\) and some constraints on the \(z\)-coordinate. If we align the tangent planes along the boundaries, then the resultant shape will be differentiable if the components are themselves differentiable.

That’s all for now; hopefully, you have a slightly deeper understanding of shapes and geometry. If you want to study the mathematics of surfaces, the relevant fields are differential geometry (calculus on surfaces) and topology (the study of connectedness).

*If you liked this post, you might like my current project, AGI notes. You can also follow me on Twitter.*