liveBook · Manning

Set union

As explained in Geometry for Programmers

A geometric union is a Boolean set operation containing every point belonging to at least one of two or more shapes.

A set union contains every point belonging to at least one shape. For signed distance functions (SDFs), a point is inside the union when at least one input function is negative, so the union is computed with the minimum function. section 10.2.2

The representation determines both the implementation and its practical trade-offs:

  • SDFs reduce union to a one-line minimum operation, making shape composition inexpensive and convenient. section 10.2.2
  • Voxel models apply union like Boolean masks: retain pixels filled in either input model, with generally simple and robust implementations. section 12.3.4
  • CAD curves and surfaces require finding intersections, splitting geometry, classifying pieces, and preserving orientation, making union comparatively complex and potentially slow. section 11.1.2

Union of two circles

Represent two radius-6 circles centered at (-2, 0) and (2, 0) with SDFs Z1 and Z2. Compute Z = minimum(Z1, Z2); the result is negative wherever either circle contains the point. section 10.2.2

How Geometry for Programmers covers it

How deep it goes
Explains geometric semantics, minimum-based SDF implementation, voxel-mask behavior, and CAD construction costs.
Examples
Demonstrates two overlapping circles, NumPy array minima, filled voxel pixels, and CAD curve decomposition.
What it assumes
Assumes basic shapes and Boolean operations, while explaining SDF sign semantics and voxel-mask behavior directly.
What you can do after
Apply union via NumPy minima, Boolean voxel masks, or geometry-processing workflows while recognizing representation-specific costs.
How it connects
Connects set union with signed distance functions, intersection, subtraction, voxel models, and boundary representations.

Also explained in

Compare how 4 books explain set union →

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.