Unrolling cylinders and cones

Status: outline

This chapter is scaffolded, not written. Section 1 and the failure modes below are real; sections 2 to 5 are placeholders. PRD 15.3 fixes the seven-part shape used here and states the standard: a dedicated chapter that takes a reader from novice to able to implement — not a literature dump and not a proof, but a constructive path. Do not delete a section heading to avoid filling it in.

1. The problem in one paragraph

These are the two cases with exact closed forms, and between them they cover most real work. A cylinder’s parameterization is conformal, so the unroll is literally (x, y) = (r * v, r * u) and is isometric to machine precision. A cone develops into a circular sector, which makes the template a curved band rather than a rectangle — correct, not a bug. The trap is entirely in the setup: the cone’s apex is not where the CAD kernel’s origin is, and using origin as the apex produces a template with a plausible, wrong developed sweep angle (PRD 6.2, 6.3).

2. The minimum background

To be written. Develop the notation from scratch, defining every symbol at first use.

3. The derivation

To be written. In steps small enough that a reader can check each one individually.

4. The algorithm

To be written. Pseudocode using the real function names in this codebase, so a reader can move from the page to the source without a translation step.

5. A worked numerical example

To be written. With actual numbers a reader can reproduce, and the expected output printed in full. This section is what separates a chapter that can be implemented from one that can only be admired.

6. Failure modes

  • Treating Cone.origin as the apex. It is a point on the axis, and Cone.radius is the radius at that origin. Compute apex = origin - (radius / tan(half_angle)) * axis.

  • Not unwrapping the circumferential angle continuously along the ordered curve, so the template jumps by a full circumference at the seam (PRD 7.3).

  • Unwrapping, and then trusting the window it leaves (PRD 7.15). Unwrapping fixes a branch of the angle, not an origin: it anchors the whole run on the curve’s first sample, which is wherever the CAD kernel’s edge happens to start. The reference head-tube cope came out spanning -450° to -90° — every point correct relative to every other, and the datum line drawn one full circumference off the sheet. Since adding a whole period moves no point on the surface, the window is free to choose and must therefore be chosen on purpose: mighty_miter.core.unroll.cylinder.canonical_wrap puts x = 0 on the datum, re-indexing a closed curve so a full wrap runs [0, 2πr].

  • Failing to guard the near-cylindrical cone, where sin(half_angle) -> 0 puts the apex at infinity. The fallback to the cylinder case must be triggered by a tolerance derived from the accuracy budget, not by a hard-coded angle.

7. References

  • do Carmo, M. P. (1976), chapter 4-2 (isometries and developments). The formal statement that these developments are isometries.