Study notes for Ian Stroud, Boundary Representation Modelling Techniques (Springer, 2006).

The final technical chapter covers the “unsexy” pieces that determine whether your modeller feels industrial: tolerance policy, debugging workflow, and error handling discipline.

1) Geometric tolerances: a policy, not a constant

Tolerances appear everywhere:

  • point coincidence tests
  • angular comparisons for tangency
  • deciding whether two edges should merge
  • classification decisions in Booleans
  • trimming and loop closure

The chapter emphasizes choosing tolerance values based on how elements are compared and on the scale of geometry.

2) Debugging: make failures explain themselves

A kernel needs:

  • trace logs for operators
  • debug visualizations (draw intersection curves, highlight invalid loops)
  • reproducible test cases (command replay)

Without this, even correct algorithms become unmaintainable.

3) Error handling: messages, codes, and tracebacks

A professional system distinguishes:

  • user-facing failures (explainable, actionable)
  • internal failures (assertions, invariants broken)
  • recoverable vs non-recoverable errors

Return codes and structured tracebacks turn modelling into an engineering system rather than a black box.

Chapter outline (from the book)

Major sections

  • 16.2 Debugging

Selected subsections

  • 16.2 Debugging
  • 16.3 Error handling
  • 16.3.1 Error messages
  • 16.3.2 Return codes and tracebacks

Implementation checklist

  • Define tolerance categories (position/angle/relative), and use them consistently.
  • Centralize comparisons (IsCoincident, IsParallel, IsSameSurfaceWithinTol, …).
  • Standardize error reporting:
    • operator stage
    • entity IDs involved
    • numeric context (tolerances used, computed distances/angles)
  • Maintain a regression suite and a command replay harness.

The “industrial maturity” checklist

  • central tolerance policy
  • deterministic operator outcomes
  • structured error reporting
  • reproducible traces
  • regression suite

If you have these, your kernel will improve rapidly. If you don’t, progress will stall.

Practical exercises

  • Define error categories and a return-code enum for your kernel.
  • Implement a debug flag that dumps a minimal reproduction package for any failed operator (inputs + parameters).