Example of torus designed using a rotational sweep. The periodic spline cross section is rotated about an axis of rotation specified in the plane of the cross section.
Implicit/mathematical definition. Difficult to implement.








An example of visualization. Proteins are too complex to describe verbally
A topographic map of Marfa, Texas. Topographical maps are the most common utilization of isolinear plots.
Examples:
Spatial Data Structures
We will use heirarchical tree structures to store object information.
Why?
Let's start with 2D.
Quadtrees
Based on the dividedandconquer principle, a quadtree is a data structure that recursively subdivides a plane into 4 quadrants.
The decision to subdivide is based on an attribute of the current quadrant. If the quadrant is heterogeneous with respect to this attribute, further subdivision occurs. If it is homogeneous, or we have reached the desired level of detail, we stop subdividing.
We will apply quadtrees to storing planar polygons. Our attribute will be whether current quadrant is filled by the interior of a polygon:
The succesive subdivisions can be reprensented as a tree with heterogeneous quadrants as nodes and homogeneous quadrants as leaves.
Here, we are grouping by color:
F: Full ; E: Empty; P: Partially Full
For an area containing 2^n by 2^n pixels, a quadtree representation contains at most n levels.
Octrees
Octrees are based on the same principle, but divide regions of 3D space (usually into cubes).
The scene is subdivided at each step with three mutually perpendicular planes, aligned with the Cartesian coordinate planes.
Individual partitions of 3D space are called Voxels (Volume Elements).
Applications: raycasting, shadowcasting.
Octrees, like Quadtrees, use a node structure to store the volume elements:
In this figure, the octree has been refined twice. First, the root is refined into eight cells, each representing an octant of the root's domain. Then, one of the root's children is refined yet again.
Here is an example of a fully subdivided torus:
BSP Trees
Binary SpacePartitiong Trees subdivide space into 2 halves at every step.
The plane of subdivision can have any position and orientation. This reduces tree depth and search time as compared to an octree.
BSP Trees for Polygons
We can represent a polygon with a BSP tree.
Let each face of the polygon coincide with a partitioning plane of the
tree.
Now, each node of the tree encodes a face of the polygon.
Each leaf of the tree is either inside or outside of the polygon.
It is easy to find out if a given point is inside the polygon; put it in the tree and see if it ends up in a + or  leaf (also have case of point exactly on a plane)