X, Y, and Z — all of these are examples of geometric regions. And despite their many differences, they can all be represented as the same mathematical object. My goal for the rest of this post is to explain what a region is, how they are all secretly just point sets, and why that even matters.
What are regions anyway?
Geometric regions are how we represent objects spatially. That is, when you want an object to have a sense of position and/or orientation. You may also want to compare it to other objects using concepts like distance and direction. This makes regions crucial when you want to represent objects in the real world.
Regions are defined by points and spaces, so let’s discuss those first. If you’ve taken a math class, you probably already have some intuition regarding these.
Imagine a piece of graph paper in front of you. You could take a pen and draw a dot somewhere on the paper. This dot is what we call a point. Points do not have a size, but they do have a location. We can describe this location using a list of numbers, called coordinates. Each coordinate corresponds to a distinct direction, and determines how far you would have to move along that direction to arrive at the point. Since our graph paper has two distinct directions (horizontal and vertical) we could describe our point using two coordinates.
[Image: Grid paper]
Now if you picture the graph paper as a whole, and all the possible points you could draw on it, it would give you a sense of what a space is. To be more precise, we could say that the space in this example is the set of all the infintely many points you could potentially draw on the paper. And since we define the points using two coordinates, we would describe this space as 2-dimensional.
[Image: Grid Space]
With that same graph paper, imagine drawing some shape and coloring it in. This shape now represents a region of our space. Thinking of our space a set of points, the region now represents a subset of our space. We can also view our region as dividing all points in our space as either inside or outside the region.
[Image: Region]
Unlike the individual points that make it up, our region does have a meaningful concept of size, or rather multiple of them. The most intuitive one for our region would be the area, but we could also consider things like perimeter or the bounding box size.
Formalizing Regions
With that intuition built, let’s look at how we would formalize the defintiion of spaces and regions.
A space is essentially just a colletion of points, where each point is itself just a list of numbers. The amount of numbers (called coordinates) each point uses is known as the dimension of the space.
Spaces are more formally defined by (1) how many coordinates they use (dimension), (2) what type of coordinates they use (real, integer, etc.), (3) the metric used on those points, and (4) the domain of the space.
When you (hopefully) learned to count, you probably used a simple 1-dimensional space called the “number line”. This space has the special name , where the means it uses a single coordinate and the means that the coordinate can be any real number. As you got older, you were probably introduced to its siblings and . You may have referred to these by their other name — the Cartesian coordinate system.
[Image: 3 real spaces]
The rest of this post will focus on and , since they tend to be the most commonly used.
If you have worked with colors on a computer, you are probably familar with the RGB color space. This is a 3-dimensional space where each of the three coordinates corresponds to how much red, green, and blue the color contains, respectively.
Spaces can use different types of numbers for their coordinates (integers, complex, etc.), but for now let’s just focus on spaces that use the reals (5.23, -0.6, 234, etc.).
Spherical, cylindrical, etc.
Point Clouds
Region Representations
Explicit Regions
Implicit Regions
Pros and Cons
Region Operations
Older
Specifying Regions
With that intuition built, let’s look at how we would go about specifying a region.
The first step is deciding what space to use.
Generalizations
With that intuition in place, let’s formalize these definitions. This is not just math jargon, but should make later steps more precise and clear.
Point: An ordered list of coordinates, each of which corresponds to a direction in its space.
Space: A set of points
Region: awd
Geometric regions are how we represent an object spatially. That is, you want it to have a sense of position and orientation. You may also want to compare it to other objects using concepts like distance and direction. To do so, you first need to decide what space you’re using.
Spaces
A space is essentially just a colletion of points, where each point is itself just a list of numbers. The amount of numbers (called coordinates) each point uses is known as the dimension of the space.
Spaces are more formally defined by (1) how many coordinates they use (dimension), (2) what type of coordinates they use (real, integer, etc.), (3) the metric used on those points, and (4) the domain of the space.
When you (hopefully) learned to count, you probably used a simple 1-dimensional space called the “number line”. This space has the special name , where the means it uses a single coordinate and the means that the coordinate can be any real number. As you got older, you were probably introduced to its siblings and . You may have referred to these by their other name — the Cartesian coordinate system.
[Image: 3 real spaces]
The rest of this post will focus on and , since they tend to be the most commonly used.
If you have worked with colors on a computer, you are probably familar with the RGB color space. This is a 3-dimensional space where each of the three coordinates corresponds to how much red, green, and blue the color contains, respectively.
Spaces can use different types of numbers for their coordinates (integers, complex, etc.), but for now let’s just focus on spaces that use the reals (5.23, -0.6, 234, etc.).
Spherical, cylindrical, etc.
Regions
Once you have your space, you can define a region by dividing all points in that space as either inside or outside the region.
[Image]
And that’s all a region is — a way to specify certain parts of a space.
Region as Point Sets
To formally describe spaces and regions, we need to discuss them in terms of sets. This is not just math jargon, but will actually come in handy as we go on.
A set is a collection of elements that are:
- Unordered
- Distinct (no duplicates allowed)
They can contain zero elements, a finite number of elements, or infinitely many elements. If a set contains an element, we can say that element is a member of the set. If all elements in a set are a member of another set, then we can say that set is a subset of the other set.
Armed with this knowledge, we can know define a space as just a set of points. A region is then simply a subset of that space.
That’s all well and good, but how do we actually specify the myriad of different types of regions?
Point Clouds
Let’s start with the most straightforward region type — point clouds! A point cloud is a literal list of points, so it can clearly be mapped to a point set.
We can try to represent continuous shapes like circles or spheres by just adding more points.
This sort of works, and for some applications like rendering a 3D scanned object it might be okay. However, it has a few significant downsides.
- Requires a lot of memory
- Lacks connectivity information (what are the neighboring points? what is the topology?)
- Contains gaps (problem when zooming in or performing ray casts)
In short, point clouds are a simple but expensive way to approximate a region. Can we instead define a set that accurately represents continuous regions?
Yes! Though to do so we need to use an infinite set of points. As you probably guessed, we can’t just list a set of infinite points with our finite time and memory. Instead, we need to specify our regions according to some rules.
For example, we can define a unit circle as the set of all points at distance 1 from the origin, which written mathematically looks like this:
Alternatively, we could use the functions and to directly generate all the points on the circle.
While these two representations produce equivalent point sets, they represent the two main categories of methods for representing infinite point sets.
OLD
So far I’ve avoided the formal definitions for spaces and regions, but they will actually be more
So far I’ve discussed spaces as collections of points, but at the risk of being too mathematically rigorous, let’s describe them more formally as sets.
A set is just a collection of things that is (1) unordered and (2)
At the risk of being mathematically rigorous, let’s give a more form
More formally, we can say a region is defined as a set of points. In case you’re not familiar, a set is just a fancy name for an unordered list with no duplicate elements. For a point to be within a region, it must be a member of its point set. Using this definition, we can piggyback off of set theory to do some cool stuff.
If you’re looking for a more formal definition, you can say that given a space as a set of points, a region within that space is a subset of that space.
If you’ve ever been in a math class, you’re probably already familiar with a few spaces.
If you have worked with colors on a computer, you are probably familar with the RGB color space. This is a 3-dimensional space where each of the three coordinates corresponds to how much red, green, and blue the color contains, respectively.
To start with, you first need to decide which space your object lives in.
A space is just a set (i.e. collection) of points. When choosing a space, one picks the space’s dimension (how many numbers each point uses) and its metric (how points relate to each other). The most common spaces are either 2 or 3 dimensional with a Euclidean metric, though there’s infinitely many to choose from. You could even go with a non-Euclidean metric like hyperbolic space if you’re looking for something more exotic.
What are regions anyway?
Whether it’s a 3D character model in a game or the 2D curves that form the letter B in a font, when we want to represent an object in some space we turn to geometric regions.
While the ways we represent regions can seem so different, they share an underlying definition that let’s us analyze and operate on them in a unified manner.
In short, regions are just a defined area within a space. It doesn’t matter if the space is 2D, 3D, 37D, whatever. As long as we can say that any given point is either inside or outside the region, then we’re good. You can even use non-Euclidean spaces, if you’re into that kind of thing.
There is a separate concept of intrinsic geometry that is independent of any specific space. Instead, it describes the measurements and connections between elements of the region and uses that to derive properties of the region. But I’m pretty sure you need a be a licensed mathematician to legally use them.
There is a separate concept of intrinsic geometry that is independent of any specific space. Instead, it describes the measurements and connections between elements of the region and uses that to derive properties of the region. But I’m pretty sure you need a be a licensed mathematician to legally use them.
More formally, we can say a region is defined as a set of points. In case you’re not familiar, a set is just a fancy name for an unordered list with no duplicate elements. For a point to be within a region, it must be a member of its point set. Using this definition, we can piggyback off of set theory to do some cool stuff.
In the rest of this post I’m going to cover the variety of ways we represent regions and how it all comes back to point sets. Also, to save on time I’m going to avoid talking about the additional information like colors and surface normals that regions often carry with them.
Point Clouds
Let’s start with the most straightforward region type — point clouds! A point cloud is a literal list of points, so it can clearly be mapped to a point set.
We can try to represent continuous shapes like circles or spheres by just adding more points.
This sort of works, and for some applications like rendering a 3D scanned object it might be okay. However, it has a few significant downsides.
- Requires a lot of memory
- Lacks connectivity information (what are the neighboring points? what is the topology?)
- Contains gaps (problem when zooming in or performing ray casts)
In short, point clouds are a simple but expensive way to approximate a region. Can we instead define a set that accurately represents continuous regions?
Yes! Though to do so we need to use an infinite set of points. As you probably guessed, we can’t just list a set of infinite points with our finite time and memory. Instead, we need to specify our regions according to some rules.
For example, we can define a unit circle as the set of all points at distance 1 from the origin, which written mathematically looks like this:
Alternatively, we could use the functions and to directly generate all the points on the circle.
While these two representations produce equivalent point sets, they represent the two main categories of methods for representing infinite point sets.
Region Operations (Bounds, Center, Distance, Signed Distance)
References
-
Geometry Lecture Video: https://www.youtube.com/watch?v=MakhXtIX2YM
-
Hyperbolica: https://store.steampowered.com/app/1256230/Hyperbolica/