liveBook · Manning

Set intersection

As explained in Geometry for Programmers

A geometric or set operation whose result consists of elements shared by the combined objects.

Set intersection keeps only what two objects share. Geometrically, that shared part may be a point, a line, or a region. Two nonparallel lines in a plane meet at a point; two nonparallel planes in 3D meet along a line. The same idea turns a system of linear equations into a geometric search for the common place satisfying every equation. section 2.3.1 section 3.1.1

The result depends on the representation. For equations, intersection identifies common solutions. For a line joined to an arc, the intersection point helps position the pieces, while an orthogonality condition makes the join smooth. For solid-like models, intersection retains the area or volume that belongs to both inputs. section 3.1.1 section 5.3.2 section 10.2.2

Common ways to express an intersection include:

  • Solve several line, plane, or hyperplane equations together. Their shared solution is the intersection; in a two-variable system it is a point, and in a three-variable system it is where all planes meet. section 3.1.1
  • Combine signed distance functions with maximum. A point remains inside the result only when both input functions are negative. section 10.2.2
  • Apply a Boolean operation to voxel models or image masks. Only pixels or voxels filled in both models remain. section 12.3.4

Intersecting two circle SDFs

For two circle functions Z1 and Z2, compute Z = maximum(Z1, Z2). Negative values mark points inside both circles, so the negative region is their overlap. This is a concise constructive-solid-geometry operation, but the combined function is not necessarily a true distance function: it can still model the shape while no longer reporting the true distance to it. section 10.2.2

Figure 10.13 An intersection of two SDFs is negative when both SDFs are negative and positive otherwise.
10-13

The plotted overlap makes the sign rule visible: only the region inside both circles remains negative. section 10.2.2

Intersection is especially practical when a representation makes membership cheap to test. Voxel and mask operations work like element-by-element Boolean values and are described as simple and usually faultproof, unlike Boolean operations on boundary representations. That robustness supports multistep modeling workflows. SDF composition is also compact, though algorithms needing true distances require care after combinations. section 10.2.2 section 12.3.4

How Geometry for Programmers covers it

How deep it goes
Explains geometric and Boolean interpretations, gives a maximum-based SDF implementation, and notes that composition may lose true-distance behavior.
Examples
Uses intersecting lines and planes, a two-trains linear system, an arc-line join, overlapping circles, and filled voxel or image-mask regions.
What it assumes
Introduces intersections through geometry and equations; arc construction temporarily avoids requiring prior dot-product knowledge.
What you can do after
Apply it via signed distance functions or voxel masks to retain the region shared by two modeled shapes.
How it connects
Connects linear equations, hyperplanes, signed distance functions, Boolean operations, voxel models, image masks, arcs, line segments, and dot products.

Also explained in

Compare how 5 books explain set intersection →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Geometry for Programmers. The section links point to the parts of the book it draws on.