Why the boundary needs mathematics
Part one recorded a solid as topology pointing at geometry, and checked the topology by counting. Two questions stayed open, and both need numbers before any algorithm can start. Given a face, which side holds the material? Given a formula, where does it sit in space?
A normal answers the first question: one arrow per face saying which way is out. A frame answers the second: one origin plus three directions saying where each formula lives. What follows defines both, starting from the difference between a point and a vector.
Each section below follows the same shape: the definition, the rule, why the rule holds, a figure, and one number small enough to check by hand. A short script recomputes every one of them; the reading list says how. Later parts spend what is set up here. Part three writes the ten curves and surfaces a kernel knows in closed form, each as a canonical shape in a placement of section five, and shows where a parametrisation fails to produce a normal. Derivatives return in parts six and ten, where projection and intersection iterate on them.
Points, vectors, directions
A point marks a place and nothing else. A vector marks a displacement between two places: it has a length and an orientation, and no position. A direction is a vector whose length is one, and which must stay one. A kernel stores each as three numbers and treats them as three types, because a transformation moves them differently.
Translate everything by . A point moves: is . A vector does not. Take two points and and the vector between them. After the translation it is : the cancels. So the translation does not apply to a vector, and a direction behaves like the vector.
A rigid motion is a rotation and a translation together. The rotation applies to all three types. The translation applies to the point only. A direction also has to be renormalised if the transformation had any scaling in it, or it is no longer a direction.
Point
has a position and nothing else, so a translation moves it
Vector
has length and orientation but no position, so the translation part does not apply to it
Direction
a vector constrained to length 1, and it stays 1 through any rigid motion
A normal is a direction, so it must ignore translations. Stored in the same type as a point, it moves with the part instead, and the face reports the wrong side on exactly the parts of a model that were moved: the assembled ones. The shape looks correct. The inside/outside test from part one breaks. Section six adds the second half of the bug: under a scale that is not the same in every direction, a normal does not even move like a tangent.
We keep the types apart in notation throughout the series. A point is a bare letter. A vector or a direction carries an arrow. Read as a sentence: start at the place , then walk along the arrow .
The dot product
The dot product multiplies two vectors into one number:
multiply component by component, then add. The result is a plain number, not a vector.
Three things fall out of it. Length: a vector dotted with itself is its squared length, so . Angle: . Perpendicularity: the dot product is zero exactly when the two are at right angles.
Take and . The dot product is 1. The lengths are 1 and , so and the angle between them is 45°.
The dot product also drops a perpendicular. Given a vector and a unit direction, is the part of along . Projecting (3, 4, 0) onto the x direction gives (3, 0, 0), of length . Part six inverts curves and surfaces with this operation, thousands of times per model.
The cross product
The cross product multiplies two vectors into a third vector, perpendicular to both:
each component combines the other two. Dotting the result with either input gives zero, which is the check that it stands perpendicular to both.
Its length is the area of the parallelogram the two inputs span: . For (1, 0, 0) and (0, 1, 0) the product is (0, 0, 1) and the area of the unit square is 1. For (4, 0, 0) and (1, 2, 0) it is (0, 0, 8): a base of 4 times a height of 2.
Order matters. Swapping the inputs negates the result: . The right-hand rule says which of the two perpendicular directions the product takes: point the fingers from the first input toward the second, and the thumb gives the product. The formula itself knows nothing about hands. It always gives (1, 0, 0) × (0, 1, 0) = (0, 0, 1), first axis times second axis equals third, in whatever frame the coordinates are read in. Whether that third axis is where a right thumb points depends on the frame being right-handed, which the next section defines.
Frames, placements and handedness
A frame is an origin plus three directions that are pairwise perpendicular and each of unit length. Call them , and . Any point is then an origin plus three walks, one along each direction, and the three walks are a matrix product:
where O is the origin and the three arrowed letters are the frame’s directions, which are also the three columns of M. The numbers x, y, z are the point’s coordinates in the frame. A point has no arrow because a point is not a vector.
So a frame is a matrix plus a translation, and every rule this article proves about matrices applies to frames. A kernel uses that twice over. Every curve and surface it knows in closed form is stored as two separate things: a canonical shape, written in the simplest possible position, and a placement, a frame that says where that position is in space. A circle is not stored as a general circle in space. It is stored as a radius, one number describing a circle at the origin of the XY plane, plus an origin and a frame.
Placements come in three sizes, depending on what the geometry needs:
| Placement | Is | Enough for |
|---|---|---|
| a point and one direction | an axis | a line; and the axis of revolution of every surface in part three but the plane |
| a point and two directions | a frame for a plane | any of the four conics (a conic is a planar curve, so a plane is all it needs) |
| a point and three directions | a full frame | any of the five surfaces |
Two frames fit the definition for any choice of and , because can point either way along the remaining perpendicular. The cross product tells them apart:
plus for a right-handed (direct) frame, minus for a left-handed (indirect) one.
The determinant puts the same test in one number. For three directions it is , the signed volume of the box the three span: its size is the volume, and its sign says on which side of the first two the third one lies. For a frame the box is a unit cube, so only the sign is left: +1 for right-handed, −1 for left-handed, with nothing between. It is also the determinant of the matrix M above.
Every frame built from scratch in this series is right-handed: its third direction is computed as the cross product of the first two, so it cannot come out the other way. A mirror is the only operation that produces a left-handed one. The convention has consequences. Reverse and every cross product computed from it reverses too. The most important of these is the surface normal, which is how a face knows which side is material. So a mirrored frame gives more than a mirrored picture: it gives a surface whose outside is its inside. The next two sections show how that happens.
The 3D figures in this series are generated, and the first version of the generator projected the axes so that X ran to the lower right and Y to the lower left. That arrangement is the mirror of a right-handed frame: the turn from the projected X to the projected Y goes the opposite way from the one the viewpoint should see. No drawing in part one showed it, because none of them labelled their axes. A labelled triad drawn that way would have contradicted every statement about normals in this series, and most readers would have sensed the problem without seeing it. The generator now checks the handedness of its own projection before it draws anything.
Rotations and mirrors
A transform is a 3×3 matrix plus a translation, the same shape as a frame. The matrix does the turning, stretching and reflecting; the translation moves the result. This section is about the matrix. When it is orthogonal, its columns are a frame: pairwise perpendicular unit directions. Orthogonal matrices keep every length and every angle, so orthonormality survives them.
The determinant sorts them. At +1 the matrix is a rotation: the solid turns in space. At −1 it is a mirror: every length and angle is still kept, and still no turning produces it. Try it with three fingers of the right hand, each at right angles to the other two: thumb along X, index along Y, middle finger along Z. Now the mirror image: thumb along X, index along −Y, middle along Z. Turn the right hand any way you like; it cannot make that. The left hand makes it at once. Two fingers would not show this, because any two perpendicular directions can be turned onto any other two. Handedness needs all three.
The cross product tracks the difference. For any invertible matrix:
the cross product of two transformed vectors is the transformed cross product, scaled by the determinant, where the transform is the inverse transpose of M rather than M itself.
Check it on a matrix that is neither a rotation nor a mirror. Take M with rows (2, 1, 0), (0, 1, 3) and (1, 0, 1), whose determinant is 5, and the vectors and . Then and , and their cross product is (−2, −3, 14). On the other side, , and multiplying it by gives (−2, −3, 14) again.
The general form has a payoff. A normal is a cross product of two tangents, and tangents move by M, so the rule says that normals move by , up to a scale. For a rotation that is the same as M. For a scale that differs between directions it is not. Stretch x by 2. The tangent (1, 1, 0) becomes (2, 1, 0). The normal (1, −1, 0), perpendicular to it, moved like a tangent becomes (2, −1, 0), and its dot product with the new tangent is 3: no longer perpendicular. Moved by it becomes (0.5, −1, 0), and the dot product is 0. This is the second half of the normal bug: a kernel that moves a normal with the matrix it uses for points is wrong under such a scale, even after it drops the translation.
For an orthogonal matrix the inverse transpose is the matrix itself, and the rule shortens:
a rotation carries the cross product along. A mirror carries it along and reverses it.
Mirror the frame of the last section in the plane y = 0. The columns go from (X, Y, Z) to (X, −Y, Z):
a right-handed frame goes in, a left-handed one comes back, and the determinant goes from +1 to −1. Nobody flipped anything; the arithmetic did it.
Parameters and normals
A parametrised surface turns a rectangle of parameters into points in space. Its two partial derivatives, and , are the tangents along each parameter. Their cross product is the normal:
the direction of the normal comes from the order of the parameters. Swap them and it points the other way.
Take the cylinder of radius in a right-handed frame, . Its tangents are and . At , , the unit normal works out to (0.7648, 0.6442, 0), which is exactly the radial direction (cos 0.7, sin 0.7, 0). The normal points away from the axis.
Now mirror the whole surface in y = 0, with the matrix M of the last section. There are two ways to hold the image, and neither keeps everything. Keep the formula and use the mirrored frame (X, −Y, Z): then , so every parameter lands on the image of the point it had before. But that frame is left-handed, and the normal comes out inward: this is the surface whose outside is its inside, from section five. At , , the normal dotted with the outward radial direction is −2, where the original gave +2. Keep a right-handed frame instead, and the same point set needs a reversed parameter, , which negates and turns the normal back outward. One choice keeps the parameters, the other keeps the outward side. A kernel must pick, per surface, and record the pick. Part one called that pick orientation.
What the boundary stores
A closed surface divides space into two regions. A consistent outward normal names one of them material. That pair, the skin plus its normals, answers the question part one opened with: for any point in space, material or air.
Part three writes the ten geometries those skins are cut from: the five curves and five surfaces a kernel knows in closed form, each as a canonical shape in a placement. Parts six and ten differentiate them. Everything they compute rests on what this article set up: three types that move differently, the dot product for lengths, angles and projections, the cross product for areas and normals, the right-handed frame, and the matrix rule for the cross product when the frame changes sides.
Reading list
Sources
- G. Strang, Introduction to Linear Algebra, 6th ed., Wellesley-Cambridge Press, 2023. Read directly, for the four facts this article is built from: length and angle from the dot product, area from the cross product, handedness as the sign of the determinant, and the cross product under a matrix.
- I. Stroud and H. Nagy, Solid Modelling and CAD Systems: How to Survive a CAD System, Springer, 2011. Read directly, for where each fact is spent inside a modeller: placements as origin plus directions, normals as cross products of surface derivatives, and orientation as the record of which side is material.
Method
- Every number printed above, in the text and in the figures, is recomputed from its definition by a plain Python script with no dependencies, which fails if any of them disagrees: the translated points, the 45° angle, the projection, the cross products and the parallelogram area, the determinant of both frames, the frame written as a matrix, both sides of the matrix identity on a matrix that is not orthogonal, the normal under a stretch, the mirror triple, and the cylinder normal in the right-handed frame, in the mirrored frame and with the reversed parameter.
- The point, vector and direction panels and the placed circle are generated by the same program as part three’s figures, which checks that its own axis triad is right-handed before drawing. The other six figures are flat schematics drawn to the numbers their captions print, in the site’s colour tokens.