[
 {
  "approach": "Pure vector ray geometry with r = i - 2(i.n)n, worked in the groove frame t = x_hat, cross-section in (y,z), surface z=0, +z out of the metal.\n\nSTEP 0 - facet normals. Every facet of a prismatic groove is a ruled surface whose generator is t, so its unit normal is perpendicular to t:\n  land            n = (0,0,1)\n  wall, +y side   n = (0, -cos a, sin a) = (0, -0.5, 0.8660254),  a = 60 deg\n  wall, -y side   n = (0, +cos a, sin a)\n  cylindrical bottom (the tip sphere swept along t is a CIRCULAR CYLINDER of radius R, axis parallel to t through (y=0, z=z_c)):  n = (0, -y, z_c - z)/R  -> (0,0,1) at the deepest point\n  ridge, +y side  n = (0, +sin p, cos p), p = atan(7.9/27.8) = 15.8985 deg\nAll have n.t = 0 exactly.\n\nSTEP 1 - geometry reconciliation (needed before any optics; see caveats). With d = 17.841, R = 12.5 the phrase \"centre at depth R below rim\" is impossible (it would put the trough bottom at z = -25 and the arc through (0,0)). The unique self-consistent reading is: cylinder axis at z_c = -(d - R) = -5.341, deepest point z = -17.841, crossover at (y,z) = (+-R sin 60, z_c - R cos 60) = (+-10.8253, -11.5910), i.e. h0 = 6.25 measured UP FROM THE BOTTOM. Then the 60-deg wall from that point reaches z = 0 at\n  a_c = R sin a + (d - h0) tan a = 10.8253 + 11.5910 * 1.7320508 = 30.9015  == 30.9 (given). Verified.\nThe wall extrapolates to a virtual apex at (0, -17.8401), so along-wall arc-length coordinates from the apex are s_cross = 12.4996 and s_rim = a_c/sin a = 35.6802 (used for the two-bounce window).\n\nSTEP 2 - invariance. r.t = (i - 2(i.n)n).t = i.t - 2(i.n)(n.t) = i.t - 0 = i.t. By induction the along-groove component is conserved through ANY number of bounces off ANY facet of the groove (land, both walls, cylindrical bottom, and even the ridge geometry). Brute-force check: 2e5 random unit i, random chains of 1..5 reflections off random normals perpendicular to t, max |r.t - i.t| = 1.2e-15, max ||r|-1| = 1.2e-15.\n\nSTEP 3 - dimensional reduction. Write i = c t + s e_hat with c = i.t, s = sqrt(1-c^2), e_hat a unit vector in the cross-section plane. Since n has no t-component, reflection acts only on e_hat: r = c t + s e_hat', |e_hat'| = 1. So the entire problem (which facet is hit, how many bounces, shadowing, escape) is the 2D problem for e_hat, and the 3D answer is that 2D answer with the conserved c riding along. This is the single most useful fact for the simulator: solve the cross-section once per in-plane direction, then sweep c for free.\n\nSTEP 4 - 2D reflection as an azimuth map. In the cross-section measure azimuth phi from +y toward +z. A facet whose tangent line lies at angle mu maps phi -> 2mu - phi. Land mu = 0; +y wall mu = 90 - a = 30 deg; -y wall mu = 90 + a = 150 deg; ridge mu = -+p. Two successive walls compose to a pure rotation: phi -> phi + 2(mu2 - mu1) = phi + 4a = phi + 240 deg.\n\nSTEP 5 - normal incidence on a straight wall (exact algebra). i = (0,0,-1), n = (0,-cos a, sin a):\n  i.n = -sin a = -0.8660254\n  r = i + 2 sin a * n = (0, -2 sin a cos a, -1 + 2 sin^2 a) = (0, -sin 2a, -cos 2a) = (0, -sin120, -cos120) = (0, -0.8660254, +0.5)\n  |r| = 1; angle(r, +z) = arccos(cos 2a)... = arccos(0.5) = 60 deg = 2(90 - a); elevation above the surface = 2a - 90 = 30 deg; the ray is thrown toward the far side of the groove.\nSpecial property of exactly 120 deg included angle: this r is PARALLEL to the opposite wall (r . n_opposite = 0 identically), so at normal incidence the once-reflected ray grazes the far face and never hits it - the marginal, zero-measure boundary of the two-bounce regime. Numerically confirmed: launched from the deepest wall point it crosses z = 0 at y = -9.24 and clears the far ridge crest by 4.6 um.\n\nSTEP 6 - two bounces. Wedge unfolding bounds the number of specular bounces on the two flats at ceil(180/Theta) = ceil(180/120) = 2, so 3+ flat-wall bounces are impossible for a 120 deg V. Existence window from the sine rule plus finite wall length, then verified by brute-force 2D tracing of the truncated profile (walls + cylinder + both ridges): window (14.48, 45.52) deg, analytic cutoffs 14.476 and 45.524 deg. Peak yield near 29-30 deg.\n\nSTEP 7 - projected areas per unit groove length, projected on z=0, over one full pitch 61.8 + 2*27.8 = 117.4.",
  "wall_normal_deg_from_vertical": 30,
  "deflection_normal_incidence_deg": 60,
  "cone_property_holds": true,
  "cone_half_angle_rule": "psi = arccos(i.t), measured from the +t axis: angle(r,t) = angle(i,t) = psi for every reflected ray, after any number of bounces off any prismatic facet. Written with the forward sense of propagation, the cone opens about the axis sign(i.t)*t with half-angle arccos|i.t|. Parametrically, choosing any orthonormal pair u,v spanning the plane perpendicular to t,\n  r = (i.t) t + sqrt(1 - (i.t)^2) * (cos X * u + sin X * v),\nwhere only the azimuth X depends on which facet was hit (X = 180 deg + 2*beta - X_in for a facet whose in-plane normal is tilted beta from the vertical). Hence:\n  - flat land: one point on the cone (beta = 0)\n  - the two straight walls: two discrete points, beta = -+30 deg, i.e. in-plane azimuth shifted by -+60 deg from the flat-mirror specular direction\n  - the cylindrical bottom: a CONTINUOUS ARC of the same cone, beta sweeping 0..60 deg each side as written in the spec (0..30 deg for the tangency-consistent crossover), so the in-plane azimuth fan is 4*beta_max = 240 deg wide (120 deg wide if tangent-consistent), centred on the flat-mirror specular direction\n  - the ridge, if it were specular, would add beta = -+15.9 deg (a 31.8 deg deflection at normal incidence); being torn metal it instead scatters off the cone.\nDegenerate case: i.t = 0 (illumination in the plane perpendicular to the groove) gives psi = 90 deg, the cone flattens into the single plane perpendicular to t, and the whole reflected set is a straight line of directions - the classic in-plane case. The opposite extreme i.t -> +-1 (light along the groove) collapses the cone to the groove direction itself.\nEquivalent grazing form: if the elevation of the source above the surface is E and its azimuth relative to the groove axis is A, then cos psi = |i.t| = cos E * cos A, so psi = arccos(cos E cos A).",
  "wall_pattern_conic": "The reflected bundle from one illuminated point of the groove is a right circular cone with apex at that point, axis t (which lies in the surface plane), half-angle psi = arccos(i.t). Its intersection with a flat wall is therefore a conic section. Let beta be the angle between the cone axis t and the wall plane (beta = 0 when the groove runs parallel to the wall, beta = 90 deg when the groove points straight at the wall). The eccentricity is\n  e = cos beta / cos psi.\n  beta > psi  -> e < 1, ELLIPSE (a closed loop; a CIRCLE when beta = 90 deg, centred where t pierces the wall)\n  beta = psi  -> e = 1, PARABOLA (wall parallel to a generator of the cone)\n  beta < psi  -> e > 1, HYPERBOLA (one branch)\nDerivation (axis = x, wall = plane y = D): cone points (cos psi, sin psi cos X, sin psi sin X) scaled to y = D give X_screen = D cot psi * sec X, Z_screen = D tan X, so X_screen^2/(D cot psi)^2 - (Z_screen/D)^2 = 1, a hyperbola with e = sqrt(1 + tan^2 psi) = 1/cos psi = cos(0)/cos psi, matching the formula at beta = 0.\nPractical consequences for the render: (1) a groove drawn parallel to the wall ALWAYS paints a hyperbolic arc, bowing away from the wall-groove intersection - this is the familiar bowed streak of brushed metal; (2) as the groove azimuth rotates through the direction that points at the wall, the pattern morphs hyperbola -> parabola -> ellipse -> circle; (3) if i.t = 0 the conic degenerates to a straight line (the trace of the plane perpendicular to t); (4) only part of the conic is lit, because the facet-normal range is finite and the ridges occlude - you see an arc or a branch segment, with two bright points on it from the flat walls and a bright point from the un-cut land; (5) a finite illuminated groove LENGTH is a family of cones translated along t, so the true pattern is that conic swept/thickened along its t-translation, i.e. a narrow band rather than a mathematical curve.",
  "two_bounce": {
   "possible": true,
   "incidence_condition": "Because the along-groove component only rides along, the bounce count depends solely on the projection of i into the cross-section plane. Define eps = the in-plane tilt of that projection away from the inward vertical, measured TOWARD the far wall (eps = 0 is normal incidence in the cross-section; eps is unrelated to i.t). Necessary in-plane condition from the infinite wedge: 0 < eps < a = 60 deg (at eps = 0 the once-reflected ray is exactly parallel to the far face, at eps = 60 deg the incident ray is parallel to the near face - both are grazing, zero-measure boundaries). Wedge unfolding bounds the total at ceil(180/120) = 2 flat bounces; three or more flat-wall bounces are IMPOSSIBLE in a 120 deg V. Truncation then narrows the window: with s = arc length from the virtual apex along a wall, the physical wall spans s in [s_cross, s_rim] = [12.4996, 35.6802], and the sine rule in the triangle (apex, P1, P2) - apex angle 2a = 120 deg, angle at P1 = 60 deg - eps, angle at P2 = eps - gives s2 = s1 * sin(60 deg - eps)/sin(eps). Requiring s2 <= s_rim (else the ray leaves over the far rim) and s2 >= s_cross (else it lands on the cylindrical bottom instead) yields the exact window tan(eps) > sin60/(s_rim/s_cross + cos60) = 0.8660/(2.8545+0.5) = 0.25818 -> eps > 14.476 deg, and tan(eps) < sin60/(s_cross/s_rim + cos60) = 0.8660/(0.35032+0.5) = 1.01839 -> eps < 45.524 deg. Brute-force 2D tracing of the truncated profile reproduces this window exactly (first wall->wall events at 14.6 deg, last at 45.4 deg, none at 14.3 or 45.6 deg), with the yield peaking at eps ~ 29-30 deg. Adding the 7.9-high ridge as an opaque absorber with a vertical inner lip at the rim clips the upper edge to about 38.7 deg, because the large-eps solutions need the first hit near the rim and the lip shadows exactly that strip; the deepest wall point is fully ridge-shadowed for eps > 45.85 deg (from -11.591 + (30.9-10.825)/tan(eps) > 7.9). The cylindrical bottom is a separate matter: being concave it is not wall-limited and the tracer finds cyl->cyl and cyl->cyl->cyl chains for |eps| < ~25 deg, plus mixed cyl->wall paths.",
   "net_deflection_deg": "120 deg for in-plane rays. Derivation: two reflections compose to a rotation of the cross-section direction by twice the angle between the mirror lines: phi -> phi + 2(mu2 - mu1) with mu1 = 90 - a = 30 deg and mu2 = 90 + a = 150 deg, i.e. phi -> phi + 4a = phi + 240 deg == phi - 120 deg. Equivalently, for a dihedral of included angle Theta the deviation is 360 deg - 2*Theta = 360 - 240 = 120 deg, independent of where and at what angle the ray struck (checked numerically at eps = 0.001, 5, 15, 30, 45, 59.999 deg: deviation 120.000 deg in every case; incoming in-plane azimuth 270 - eps leaves as 150 - eps, so the exit direction ranges from 150 deg (grazing the far wall) at eps -> 0 up to 90 deg (straight up) at eps -> 60 deg). In full 3D the along-groove component is untouched, so with c = i.t: i.r = c^2 + (1 - c^2) cos(4a) = 1.5 c^2 - 0.5, giving a total deflection of arccos(1.5 c^2 - 0.5): 120.00 deg at c = 0, 116.10 deg at c = 0.2, 97.18 deg at c = 0.5, 62.61 deg at c = 0.8 - the two-bounce ray still lies on the same cone r.t = i.t.",
   "retroreflection": "No. A 120 deg V does not retroreflect. Retroreflection needs deviation 180 deg, i.e. rotation by 180 deg, i.e. 4a = 180 deg -> a = 45 deg -> included angle Theta = 90 deg. Here 4a = 240 deg, so the exit direction is 120 deg from the entrance, never antiparallel; concretely, incoming azimuth 270 - eps exits at 150 - eps, which equals the reverse direction 90 - eps only if 150 = 90 (false). Two further points: (i) even a 90 deg PRISMATIC V retroreflects only in the cross-section plane - because r.t = i.t is conserved, r = -i is impossible for any prismatic groove unless i.t = 0; true 3D retroreflection requires a trihedral corner cube, which a translationally invariant groove can never be; (ii) the 120 deg groove is in fact the worst case for light return - at exact normal incidence the single-bounce ray leaves parallel to the opposite face at only 30 deg above the horizon, so the groove throws light sideways along its own cone rather than back at the source. That sideways throw, not retroreflection, is what makes the engraved line read as a bright streak from off-axis and near-black from the lamp direction."
  },
  "projected_area_fractions": {
   "spherical": 0.184418,
   "straight_wall": 0.341988,
   "ridge": 0.473595,
   "basis": "Projected onto z = 0, per unit groove length, normalised over one full pitch = 61.8 + 2*27.8 = 117.4 um. Projected widths: cylindrical (blunt-tip) bottom 2*A0 = 2*R sin60 = 21.6506; two straight walls 2*(a_c - A0) = 2*(30.9 - 10.8253) = 40.1494 (sum 61.8 exactly, as required); two ridges 2*27.8 = 55.6. Fractions 21.6506/117.4 = 0.1844176, 40.1494/117.4 = 0.3419878, 55.6/117.4 = 0.4735945, sum = 1.000000. Note there is NO un-cut mirror land left in this tiling - the ridge toes meet, so the pitch is exactly 117.4 um and 47.36 percent of the projected area is non-mirror torn metal while 52.64 percent is specular. TRUE (unprojected) areas per unit length, if you need them for energy bookkeeping: walls 40.1494/cos30 = 46.3605, ridges 55.6/cos15.9 = 57.8118, cylindrical arc 2*R*a = 2*12.5*(60 deg in rad) = 26.1799 (total wetted 130.35 vs 117.4 projected). If you adopt the tangency-consistent crossover A0 = R cos60 = 6.25 instead, the fractions become spherical 0.106474, straight_wall 0.419932, ridge unchanged 0.473595."
  },
  "key_equations": [
   "Reflection: r = i - 2(i.n)n, with |r| = |i| = 1.",
   "Prismatic facet condition: n.t = 0 for the land n = (0,0,1), the walls n = (0, -+cos a, sin a), the swept-tip cylinder n = (0, -y, z_c - z)/R, and the ridges n = (0, +-sin p, cos p) - all normals lie in the plane perpendicular to t.",
   "Along-groove invariance: r.t = i.t - 2(i.n)(n.t) = i.t; by induction r_k.t = i.t for k bounces (numerically max error 1.2e-15 over 2e5 random 1-5 bounce chains).",
   "Cone of reflected directions: angle(r,t) = psi = arccos(i.t); r = (i.t) t + sqrt(1-(i.t)^2)(cos X u + sin X v), only X varies.",
   "Dimensional reduction: i = c t + s e_hat, c = i.t, s = sqrt(1-c^2); reflection maps e_hat -> e_hat' by the 2D rule and leaves c alone, so the full 3D trace equals the 2D cross-section trace plus a constant c.",
   "2D azimuth map for a facet whose tangent line is at angle mu: phi -> 2mu - phi. Land mu = 0, +y wall mu = 90 - a = 30 deg, -y wall mu = 90 + a = 150 deg, ridge mu = -+15.8985 deg. In terms of the normal tilt beta from vertical: phi_out = 180 deg + 2 beta - phi_in.",
   "Wall normal tilt from vertical = 90 deg - a = 30 deg; normal-incidence deflection = 2(90 deg - a) = 60 deg from vertical, i.e. 2a - 90 = 30 deg above the horizon. Exactly: r = (0, -sin 2a, -cos 2a) = (0, -0.8660254, 0.5).",
   "Marginal 120-deg identity: 2(90 - a) reflected direction is parallel to the far wall iff a = 60 deg, so r . n_opposite = 0 at normal incidence (verified to 6.6e-5 with the rounded input numbers).",
   "Two-mirror composition: phi -> phi + 2(mu2 - mu1) = phi + 4a = phi + 240 deg; deviation = 360 deg - 2*Theta = 120 deg for Theta = 120 deg; retroreflection (deviation 180 deg) requires Theta = 90 deg.",
   "3D two-bounce deviation: cos(angle(i,r)) = i.r = c^2 + (1-c^2)cos 4a = 1.5 c^2 - 0.5.",
   "Max bounces in a 2D wedge by unfolding: N_max = ceil(180 deg / Theta) = ceil(180/120) = 2.",
   "Two-bounce sine rule on the truncated wall: s2 = s1 sin(a - eps)/sin(eps) with a = 60 deg, s in [s_cross, s_rim] = [12.4996, 35.6802]; window tan(eps) > sin a/(s_rim/s_cross + cos a) = 0.25818 (eps > 14.476 deg) and tan(eps) < sin a/(s_cross/s_rim + cos a) = 1.01839 (eps < 45.524 deg).",
   "Conic on a flat wall: e = cos(beta)/cos(psi), beta = angle between t and the wall plane; ellipse beta > psi, parabola beta = psi, hyperbola beta < psi, circle beta = 90 deg, straight line psi = 90 deg.",
   "Cross-section closure (verifies the input set): a_c = R sin a + (d - h0) tan a = 10.8253 + 11.5910*1.7320508 = 30.9015 = a_c given; equivalently a_c = d tan a = 30.9015; virtual apex depth a_c/tan a = 17.8401.",
   "Ridge occlusion: a ray crossing z = 0 at lateral position y_c inside the groove escapes over the far crest only if tan(elevation) > 7.9/|y_rim - y_c|; the deepest wall point is fully shadowed for in-plane tilt tan(eps) > (a_c - A0)/(7.9 + d - h0) = 20.075/19.491, eps > 45.85 deg.",
   "Projected fractions: (2 R sin a) : 2(a_c - R sin a) : (2*27.8) / 117.4 = 0.184418 : 0.341988 : 0.473595."
  ],
  "caveats": [
   "INPUT INCONSISTENCY 1 (resolved, but you should fix the spec): 'sphere centre at depth R below rim' is impossible with d = 17.841 and R = 12.5 - it would put the trough bottom at z = -25 (deeper than d) and put the arc through (y,z) = (0,0), i.e. zero depth on the axis. The only self-consistent reading, and the one used throughout here, is centre at depth d - R = 5.341 below the rim (equivalently R above the deepest point), so h0 = 6.25 is measured UP FROM THE BOTTOM, not down from the rim. With that reading every quoted number closes: A0 = 10.8253, crossover depth 11.5910, a_c = 30.9015.",
   "INPUT INCONSISTENCY 2 (not resolvable - two of your three numbers must move): for a cone whose wall is a = 60 deg from the axis, TANGENTIAL blunting by a sphere of radius R touches at polar angle 90 - a = 30 deg, giving A0 = R cos a = 6.25 and h0 = R(1 - sin a) = 1.6747 - not A0 = R sin a and h0 = R(1 - cos a) as written (those formulas belong to a 60 deg included-angle tip, i.e. 30 deg from the axis). Consequences: (a) as specified there is a 30 deg NORMAL-DIRECTION KINK at |y| = 10.8253 (cylinder normal 60 deg from vertical meeting a wall normal 30 deg from vertical), so the profile is not C1 and the reflected fan is double-covered over beta in 0..30 deg rather than smoothly continued; (b) a truly tangent blunted 120 deg tip cannot have R = 12.5, d = 17.841 and a_c = 30.9 at once - either a_c = 34.25 (if d = 17.841 is the true maximum depth) or d = 15.907 (if a_c = 30.9 is the pinned measurement). Pick one before locking the mesh; the projected fractions change to spherical 0.1065 / wall 0.4199 in the tangent-consistent version, and the cylinder's normal sweep halves from 0..60 deg to 0..30 deg, which visibly narrows the bright fan from the groove bottom.",
   "PRISMATIC IS AN ASSUMPTION, AND IT FAILS LOCALLY. The cone property needs the tool to be DRAGGED along t so the sphere sweeps a cylinder. Wherever the tip plunges, dwells, lifts, reverses, or two grooves cross, the surface is a pit of revolution (true sphere / cone) whose normals have n.t != 0; there i.t is not conserved and the reflected set is a 2D spray, not a 1D cone. Expect bright isotropic dots at groove ends, direction changes, and crossings - in a plotter drawing these are exactly the stroke endpoints and corners, i.e. the visually loaded places. Budget them separately.",
   "RIDGES BREAK THE CONE, NOT BY GEOMETRY BUT BY MICROSTRUCTURE. The triangular ridge IS prismatic (normal 15.9 deg from vertical, tilted outward; if it were mirror-finished it would add a 31.8 deg specular deflection on the same cone). What breaks the invariance is that it is torn/smeared metal: model it as a rough diffuse/high-roughness lobe (Oren-Nayar or GGX with alpha ~ 0.3-0.6), which scatters off the cone into the whole hemisphere. Since the ridges are 47.36 percent of the projected area, they supply the dominant broadband pedestal/haze while only 52.64 percent of the area feeds the sharp conical streak. Getting that ratio right matters more to perceived contrast than any refinement of the specular algebra.",
   "RIDGE OCCLUSION IS FIRST-ORDER AND MODEL-SENSITIVE. The 7.9 um crest sits AT the rim, so the literal triangle has a vertical inner cliff from (a_c, 0) to (a_c, 7.9). That cliff both shadows the deep wall for in-plane tilts eps > 45.85 deg and clips shallow escapes (tan(elevation) > 7.9/distance-to-crest). It also moves the two-bounce upper cutoff from 45.52 deg (no ridge) to about 38.7 deg. Real pile-up is a rounded lip whose inner face continues the groove wall upward instead of a cliff, which changes both numbers; if your tip model has the real lip profile, use it, because this single choice swings the double-bounce population by roughness of 20 percent.",
   "NO FRESNEL, NO POLARISATION. r = i - 2(i.n)n gives directions only. Bare 304 stainless in the visible has R ~ 0.55-0.65 at these incidences, and it differs for s and p, so a two-bounce path carries only ~0.3-0.4 of the incident flux and is measurably more coloured and more polarised than a one-bounce path; the p/s ratio also rotates on each bounce because the two walls have different planes of incidence. If you want the streak brightness (not just its shape) to be right, apply complex-index Fresnel per bounce with the correct s/p decomposition relative to each facet's plane of incidence.",
   "GEOMETRIC OPTICS IS FINE, PERFECT MIRRORS ARE NOT. The 61.8 um groove is far larger than the wavelength, so ray optics is sound in the bulk, but (a) the rim, the cylinder-wall crossover, and the ridge crest are wavelength-scale edges that diffract, and (b) a No. 8 finish still has sub-micron microroughness. Both spread each mathematically sharp direction by a few tenths of a degree to a few degrees. The cone is therefore a thin RIBBON of finite angular width, not a curve - render it as a narrow anisotropic GGX lobe wrapped on the cone, not as a delta.",
   "SINGLE INCIDENT DIRECTION IS THE BIGGEST IDEALISATION. A real spotlight of angular radius sigma smears psi by +-sigma and the pattern becomes the union of cones - a band whose width is usually dominated by sigma rather than by roughness. For a source at finite distance the axis t is still fixed but psi varies along the groove, so the wall pattern is a family of conics, not one conic; a long groove under a near source paints a caustic-edged band. Compute psi per point, not per groove.",
   "INTER-GROOVE INTERREFLECTION IS UNMODELLED HERE. At normal incidence the single-bounce wall ray leaves at only 30 deg above the horizon, so on a surface of many parallel grooves it can strike the neighbouring ridge or the next groove. The census above included one groove plus its own two ridges only. With the ridge toes touching (pitch exactly 117.4 um) neighbour interaction is guaranteed for shallow exits; it will darken the grazing lobe and tint it.",
   "NUMERICAL PRECISION NOTES. a_c = d tan 60 = 30.9015 vs 30.9 as quoted (0.005 percent); with 30.9 the wall angle is 59.998 deg rather than 60, which is why the computed normal tilt printed as 30.0019 deg and the parallel-to-far-wall dot product came out 6.6e-5 instead of 0. All reported angles are exact for the idealised a = 60 deg; use exact trig (not the rounded 30.9 / 17.841) inside the tracer to avoid a slow drift in multi-bounce chains.",
   "The two-bounce window quoted in eps is a CROSS-SECTION quantity. Do not confuse it with the 3D angle of incidence: a source high above the groove but nearly along it (large i.t) can still have a small eps and behave exactly like a near-normal in-plane ray, just with everything tilted onto a narrower cone. Always project i onto the plane perpendicular to t before applying the window."
  ]
 },
 {
  "approach": "Explicit numerical ray trace of the cross-section in Python/numpy (no analytic shortcuts for the distributions). Because the surface is prismatic, the tracer works in the 2-D plane (u,z) perpendicular to t and carries the along-t component d_t = i·t along unmodified; d_t is then re-checked against the input at the end, so t-conservation is measured rather than assumed. Profile built exactly from the supplied numbers as a closed polyline + circular arc, replicated 10 periods either side so cross-groove escape and neighbour hits are real: [ridge 15.864 deg] - [vertical rim step 0 to 7.9 at |u|=30.9] - [straight wall to (10.8253, -11.5910)] - [circular arc R=12.5, centre (0, -5.3410), lower 120 deg] - mirrored. Segment/arc intersection with first-hit selection (this automatically gives shadowing and masking), specular reflect, repeat to a bounce cap of 200 (64/12 in earlier passes). 200001 parallel rays per period for the main cases, 40001-120001 for sweeps. Verified two ways: (1) flat mirror gives exactly one bounce per ray with max |D_out - specular| = 0.000e+00 at 0/15/30/45/60/75 deg; (2) ray count in = ray count out with all rays leaving upward (d_z>0), 100.0000% at every angle tested with the cap at 64+. Scripts: {temporary_worktree}/scratchpad/groove_trace.py (main), diag.py, diag2.py (sequence/threshold/variant diagnostics).",
  "wall_normal_deg_from_vertical": 30.002,
  "deflection_normal_incidence_deg": 60.004,
  "cone_property_holds": true,
  "cone_half_angle_rule": "Half-angle psi = arccos(i·t), i.e. exactly the angle between the incident direction and the groove axis. Measured: every outgoing ray satisfies r·t = i·t identically; over 25 (polar, azimuth) incidence cases the spread of angle(r,t) across the whole period was 0.000e+00 deg (max |d_t_out - d_t_in| = 2.8e-14 in a separate 4x4 sweep), holding for 1, 2, 3 and up to 70 bounces. So the outgoing set lies on a single cone about +t of half-angle psi, and only the azimuth about t is redistributed. Corollary measured: for a groove running parallel to the plane of incidence the multi-bounce fraction is completely independent of incidence angle (8.3398% at 15, 30, 45, 60 and 75 deg, identical to normal incidence), because the in-cross-section direction is unchanged.",
  "wall_pattern_conic": "The cone of half-angle psi about t, seen as a source, cuts a flat wall in a conic. With alpha = angle between t and the wall's NORMAL (so 90-alpha is the angle between t and the wall plane): ellipse if psi + alpha < 90 deg (circle when alpha = 0, wall perpendicular to the groove), parabola if psi + alpha = 90 deg exactly, hyperbola if psi + alpha > 90 deg. Verified numerically by sampling 2000 cone generators and testing the sign of g·m for psi = 20/45/70 crossed with alpha = 0/20/45/60/70/90: 18/18 cases matched the rule. The common studio case - groove axis lying in the wall plane (alpha = 90 deg, e.g. horizontal grooves on a vertical wall) - is always a hyperbola for any psi > 0, which is the familiar scratch/brushed-metal streak. Only one branch is lit (the plane must not cut the mirror-image cone).",
  "two_bounce": {
   "possible": true,
   "incidence_condition": "Measured, and it depends ONLY on the cross-section incidence angle theta_u = atan(i_u / |i_z|), not on the 3-D incidence angle (the along-t component is inert). Wall-to-wall double bounce: 0.0000% for |theta_u| <= 14.4 deg, first appears at 14.6 deg (0.085% of the period), rises to a maximum of 11.40% at theta_u = 30 deg, falls to 0.475% at 45 deg and is 0.0000% from 45.6 deg upward. So the window is 14.5 deg <~ |theta_u| <~ 45.5 deg. At exactly normal incidence there is NO wall-to-wall bounce (0.0000% of 200001 rays): the ray leaving the wall at 60 deg from vertical crosses the groove and clears the far rim, exiting over the open sky above the arc (measured exit crossing z=0 at u = -9.25 from the wall foot, inside the |u| < 10.83 aperture). All-facet multi-bounce (>=2 hits of any kind) is nonzero everywhere: 8.34% at normal incidence (100% of it via the concave arc or the rim step, never wall-wall), 16.93% at 15 deg, 18.43% at 30 deg, 13.66% at 45 deg, 23.68% at 60 deg, 31.84% at 75 deg, 52.64% at 85 deg. Restricted to the mirror-finish facets only (excluding the 47.36% ridge footprint) those become 15.84% / 32.16% / 35.01% / 22.97% / 22.14% / 60.49% / 100%.",
   "net_deflection_deg": "Exactly 120 deg of rotation of the propagation direction, independent of the incoming direction. Measured: the two wall normals are both 30.0019 deg from vertical with opposite tilt, so the included (dihedral) angle of the V is gamma = 119.9962 deg; the composition of the two reflections is a rotation by 2*gamma = 239.992 deg = -120.008 deg. The tracer returns -120.0075 deg for every incoming direction swept from -40 to +40 deg from vertical (constant to 1e-4 deg), i.e. 120.000 deg for a nominal exactly-30 deg wall. The angle between the twice-reflected ray and the reversed incident ray is 59.9925 deg (0 would be retroreflection). Special measured case: at theta_u = 30 deg the two-bounce output is exactly the flat-surface specular direction (in 30 deg, out 30.004 deg on the other side), because the first reflection off the light-facing wall comes off exactly horizontal.",
   "retroreflection": "No. A 120 deg V does not retroreflect. Two plane mirrors meeting at dihedral gamma compose to a rotation by 2*gamma, which equals 180 deg (reversal) only for gamma = 90 deg. Here 2*gamma = 240 deg = -120 deg, so the ray is turned by 120 deg, 60 deg short of reversal - measured 59.9925 deg from reversal for all seven incoming directions tested. What DOES send light straight back is a single bounce, not two: at theta_u = 30 deg the light-facing wall is hit at exactly normal incidence (i = -n) and retroreflects in one bounce (measured single-wall outgoing angle 30.004 deg, i.e. straight back along the incoming path). Similarly at theta_u = 60 deg the single wall bounce returns light straight up (measured 0.004 deg from vertical). The single-bounce law measured over 12 angles is theta_out = |2*eps - theta_in| for the illuminated wall and theta_out = 2*eps + theta_in for the opposite wall while that stays below 90 deg (eps = 30.0019 deg): 0->60.004; 10->50.004 and 70.004; 15->45.004 and 75.004; 20->40.004 and 80.004; 30->30.004; 45->15.004; 60->0.004; 75->14.996."
  },
  "projected_area_fractions": {
   "spherical": 0.184417,
   "straight_wall": 0.341989,
   "ridge": 0.473594,
   "basis": "Measured by shooting 400001 vertical rays across one period and tallying the first facet hit; per unit groove length, projected onto the surface plane z=0, over the full period 2*30.9 + 2*27.8 = 117.4 um (61.8 groove + 2 x 27.8 ridge). Matches the analytic footprints to 6 decimals: sphere 2*A0 = 21.6506 um -> 0.184418; walls 2*(a_c - A0) = 40.1494 um -> 0.341988; ridge 2*27.8 = 55.6 um -> 0.473595; vertical rim step 0.000 (zero projected area, but it is hit by up to 25.1% of rays at 75 deg incidence). Sum = 1.000000, so on this basis there is NO un-cut mirror land left in the period - the ridges consume everything between grooves. For reference the developed (true) surface lengths per period are sphere 26.1799, wall 46.3752, ridge 57.7994, step 15.8 um, total 146.1545, i.e. fractions 0.179121 / 0.317306 / 0.395468 / 0.108105."
  },
  "key_equations": [
   "Geometry closes exactly on the supplied numbers: sphere centre at z = -(d-R) = -5.3410, arc ends at z = -(d-h0) = -11.5910 with lateral offset A0 = 10.8253, and the straight run to the rim measures 20.0747 wide by 11.5910 deep = 30.0019 deg from horizontal, landing exactly on a_c = 30.9 (= d*tan60 = 30.9015). Wall normal 30.0019 deg from vertical; ridge slope 15.8637 deg.",
   "Verification 1 (flat surface): every ray exactly 1 bounce, max |D_out - specular| = 0.000e+00 at 0/15/30/45/60/75 deg.",
   "Verification 2 (energy): rays in = rays out = 100.0000% leaving upward at every incidence tested (60001 rays each at 0, +-15, +-30, 45, 60, 75 deg) with the bounce cap at 64+. Zero absorbed, zero lost.",
   "Verification 3 (t-conservation): max |d_t_out - d_t_in| = 2.8e-14 and max ||r|| - 1 = 2.8e-14 over 16 (d_t, angle) combinations; spread of angle(r,t) across the period = 0.000e+00 deg in all 25 cone-property cases.",
   "Normal incidence deflection off a straight groove wall = 60.004 deg from vertical (= 2 x 30.0019; 60.0000 for a nominal 30 deg wall), and it is a single delta - all 68398 wall-first rays (34.199% of the period) exit at 60.004 deg, in one bounce, crossing to the far side of the groove.",
   "Normal incidence outgoing distribution over one period: 47.360% ridge (single delta at 31.727 deg = 2 x 15.8637, but non-specular metal), 34.199% wall (single delta at 60.004 deg), 18.441% arc spread continuously over 0 to 67.411 deg. Bounce histogram 91.661% / 6.477% / 1.862% for 1/2/3 bounces; mean outgoing polar angle 41.37 deg.",
   "Normal incidence multi-bounce is entirely a dimple-and-lip effect, never a V effect: sequences measured as sphere-sphere 4.201%, sphere-rimstep 1.715%, sphere-wall-rimstep 1.310%, sphere-wall 0.561%, sphere-sphere-rimstep 0.552%; wall-wall 0.000%. 45.2% of the rays that land on the concave arc bounce again. The two-bounce zone is exactly u0 in +-[5.9304, 10.8248], width 4.8944 um on each side.",
   "45 deg incidence, groove PERPENDICULAR to the plane of incidence (i·t = 0): 86.337% / 6.000% / 7.664% for 1/2/3 bounces, 13.663% multi-bounce (22.97% among mirror facets only). First hits: ridge 47.359%, wall 27.469%, arc 18.442%, vertical rim step 6.730%. Outgoing polar angle 0.001 to 76.727 deg, mean 28.49 deg, with 55.1% of the mirror-facet rays piled into the 15-20 deg bin (the wall delta at 15.004 deg = |2*30 - 45|). Identical statistics for -45 deg by symmetry.",
   "45 deg incidence, groove PARALLEL to the plane of incidence (i·t = sin45 = 0.70711): bounce statistics identical to normal incidence (91.661/6.477/1.862%), because the cross-section problem is unchanged; but every outgoing ray sits on the 45 deg cone about t, so the polar angle from +z spans only 45.000 to 74.240 deg (mean 58.92) and the outgoing azimuth about z spans +-42.7 deg from t. Wall delta at 69.298 deg; ridge delta at 53.027 deg.",
   "Wall-wall two-bounce fraction of the period vs cross-section incidence: 0.000% at <=14.4 deg, 0.085% at 14.6, 0.353% at 15, 2.387% at 18, 7.435% at 25, 11.397% at 30 (peak), 9.535% at 33, 3.047% at 42, 0.475% at 45, 0.000% at >=45.6 deg.",
   "Two reflections in the 120 deg V rotate the direction by -120.0075 deg regardless of the incoming direction (constant over -40..+40 deg), leaving the ray 59.9925 deg short of reversal: no retroreflection. Retroreflection instead occurs in ONE bounce at 30 deg cross-section incidence (normal incidence on the facet).",
   "Projected area fractions over the 117.4 um period, measured with 400001 vertical rays: arc 0.184417, straight walls 0.341989, ridge 0.473594, vertical rim step 0.000000, sum 1.000000 - agreeing with 21.6506/40.1494/55.6/0.0 um analytic footprints to 1e-6.",
   "Conic-on-a-wall rule verified 18/18: ellipse for psi + alpha < 90, parabola at 90, hyperbola above (alpha = angle from t to the wall normal)."
  ],
  "caveats": [
   "The spec's blend point is NOT tangent, and the trace exposes it. At |u| = A0 = 10.8253 the arc normal is 60.0000 deg from vertical while the wall normal is 30.0019 deg, a measured 29.998 deg slope discontinuity - a sharp CONVEX circumferential edge 11.59 um deep inside the groove. For a genuine 120 deg included cone (half-angle 60 deg from the axis) blunted by a tangent sphere the crossover is A0 = R*cos60 = 6.2500 at h0 = R*(1-sin60) = 1.6747 (the supplied A0 = R*sin60, h0 = R*(1-cos60) are the sin/cos-swapped pair). As specified, the sphere bulges 1.93 um DEEPER than the sharp cone at u = 6.25, i.e. the 'blunting' adds material removal at the tip instead of removing it. I traced the tangent variant too (same d, wall exactly 30 deg, so a_c becomes 34.2509 and the period 124.1018): projected fractions shift a lot - arc 0.1007, wall 0.4513, ridge 0.4480 - and normal-incidence multi-bounce collapses from 8.34% to 1.08%, while the wall deltas (60/45/30/15/0 deg) are unchanged. If the real tip is tangent-blended, the arc-driven numbers above are overstated by roughly 2x and a_c/period must be re-derived. All other numbers are given for the geometry exactly as specified.",
   "The rim is geometrically ambiguous as specified and it matters. 'Ridge peak height 7.9 AT the rim' plus 'groove half-width 30.9 at z = 0' forces a 7.9 um vertical cliff at |u| = 30.9. I modelled it as a vertical facet facing the groove; it has zero projected area but is struck by 3.57% of rays at normal incidence and 25.1% at 75 deg, and it manufactures multi-bounce (e.g. rimstep-wall-wall 3.88% at 30 deg, rimstep-wall-sphere 6.25% at 45 deg). The alternative reading - the wall continues up to the crest at |u| = 44.58, no step, groove 25.74 deep, period 144.77 - was also traced: normal-incidence multi-bounce drops to 5.66%, wall-wall at 30 deg rises to 15.54%, and projected fractions become arc 0.1496 / wall 0.4664 / ridge 0.3841. Pin this down before trusting any multi-bounce number to better than a factor of ~1.5.",
   "The period is assumed to be exactly 117.4 um, i.e. ridges of adjacent grooves touch and there is zero un-cut mirror land. This is what 'the full 61.8 + 2*27.8 span' asks for, but it is a strong statement: the whole surface is either dimple, wall, or torn ridge, and the No. 8 mirror contributes nothing. Any real pitch larger than 117.4 um adds flat mirror land, which scales every fraction above by 117.4/pitch and adds a pure specular delta with the remaining weight. Overlapping grooves (pitch < 117.4) would truncate the ridges instead.",
   "Reflectance is not modelled - this is pure geometry with ray counts, not radiometry. Every 'fraction' is a fraction of projected area / incident rays, not of energy. Stainless at visible wavelengths is roughly 55-65% reflective, so a two-bounce path carries about 0.35 of a one-bounce path and the multi-bounce populations are far dimmer than their area share suggests. The groove will read noticeably darker than the surrounding mirror for that reason alone.",
   "47.36% of the projected area (the ridge) is torn/smeared metal, so the specular deltas I report for it (31.727 deg at normal incidence, 53.027 deg in the parallel-groove case) are placeholders for what should be a wide lobe or a diffuse BRDF. Treat the ridge as the dominant scattering term and the arc+wall (52.64%) as the specular term; the mirror-only statistics are reported separately above for that reason.",
   "The concave spherical dimple supports long-lived whispering-gallery paths. At 30 deg cross-section incidence 1 ray in 60001 needed 70 bounces to escape (115 bounces for a neighbour 1e-3 um away), and the exit direction is chaotically sensitive to the entry point - 29.54 to 30.69 deg over a 2e-3 um span. With a 12-bounce cap these appeared as 0.05% 'stuck' rays. Physically they are irrelevant (0.6^70 is zero energy) but a renderer must cap bounce depth or it will spend unbounded time there.",
   "Geometric optics only. With R = 12.5 um and features 6-56 um wide against ~0.5 um light the ray limit is reasonable, but the two convex edges (the rim at |u| = 30.9 and the 30 deg kink at |u| = 10.83) will diffract, and the periodic 117.4 um structure is a grating - it will produce diffraction orders separated by only about 0.25 deg, which will smear each delta I report. The single-groove cone/hyperbola result is the incoherent envelope of that, not the fine structure.",
   "Single distant source direction. Every sharp feature above (the 60.004 deg wall delta, the 31.727 deg ridge delta) is a Dirac in outgoing angle only for a perfectly collimated source; a real spotlight of angular radius sigma convolves each delta to about 2*sigma wide for a single facet bounce. The reported continua from the arc are genuine, not source-broadened.",
   "A measure-zero set of rays lands exactly on vertices (the rim corner, the kink, the arc endpoints) where the normal is undefined; with 200001 rays per period these show up as a handful of odd paths and cannot bias the reported percentages beyond the ~5e-6 sampling resolution. Sampling is uniform in u0 (projected area weighting), which is the correct weighting for a distant source."
  ]
 },
 {
  "approach": "Microfacet/BRDF formalism specialised to a PRISMATIC (1-D) surface, then verified by exact 2-D ray tracing of the literal cross-section.\n\nFRAME. t = groove direction (unit, in z=0); u = z_hat x t (cross-groove horizontal); z_hat = up. Because the groove is translationally invariant along t, EVERY facet normal is perpendicular to t, so a single scalar suffices: the facet tilt th about t, n(th) = cos(th) z_hat - sin(th) u, th>0 meaning the normal leans toward -u. Cross-section coordinate y measured along u.\n\nFACET INVENTORY (per period P, per unit length along t; a_c=30.9, A0=R sin60=10.825318, R=12.5, junction depth z_j=(A0-a_c)tan30=-11.5901, sphere centre at z=-(d-R)=-5.341).\n* mirror land (uncut plane): th = 0, footprint P-117.4.\n* two straight walls: normal exactly 30 deg from vertical -> two DELTA functions at th = +/-30 deg, footprint (a_c-A0)=20.074682 each, true arclength (a_c-A0)/cos30 = 23.180 each.\n* cylindrical bottom (the \"spherical\" cross-section swept along t): a CONTINUOUS ARC. Parametrised by polar angle from nadir, the outward normal tilt equals that polar angle, so th runs over [-60,+60] deg (as-specified crossover at A0=R sin60). True arclength density is UNIFORM in th (ds = R dth); projected density is R cos(th) dth. Total projected width 2R sin60 = 2A0 = 21.650635, i.e. the identity int_{-60}^{60} R cos th dth = 2A0 closes exactly.\n* two ridge slopes (NON-mirror): tilt 15.8637 deg = atan(7.9/27.8), leaning OUTWARD (opposite sense to the wall on the same side), footprint 27.8 each, true length 28.900 each.\n* two ridge INNER faces: as literally specified (peak 7.9 AT the rim, falling outward), each rim carries a VERTICAL cliff of height 7.9, i.e. two deltas at th = +/-90 deg with true area 7.9 each and ZERO projected area. They carry no projected area but they do the shadowing (see two_bounce).\n\nNDF -> DIRECTIONAL DISTRIBUTION (the two are NOT the same object).\nThe NDF is a distribution on the facet-normal sphere, supported on the single great circle n.t = 0. Reflection off n(th) is d = i - 2(i.n)n; writing the reflection as M(th) = Rot_t(th) M(0) Rot_t(-th) and using M(0)Rot_t(psi)M(0) = Rot_t(-psi) gives d(th) = Rot_t(2 th) d(0). So the outgoing direction moves around the cone about t at TWICE the rate the facet normal turns: phi_out = phi_spec + 2 th, Jacobian dphi/dth = 2 exactly (verified to 1e-12), and the transverse extent stays zero -> the scattering distribution is a LINE distribution (a 1-D density on a cone), not a 2-D lobe. Hence: three delta spikes (land, two walls) plus a continuous band of angular width 4 th_c = 240 deg from the arc, all lying on one cone.\n\nVERIFICATION (scripts in {temporary_worktree}/scratchpad/: ndf_derivation.py, ndf_trace2.py, ndf_debug.py, ndf_final.py). Checked: profile self-consistency to 1e-9; NDF normalisation int D(n)(n.z_hat) dw = 1 to 2e-6 (quadrature); d.t - i.t = 2.2e-16 over 300 random multi-bounce chains with random t; dphi/dth = 2.000000000000; two-mirror deflection = arccos((3c^2-1)/2) to 1e-6; conic classification against a generator count; and a full 2-D trace of the literal cross-section (2001 rays across the mouth, all four facet families, ridge cliffs included) to locate every multi-bounce window.",
  "wall_normal_deg_from_vertical": 30,
  "deflection_normal_incidence_deg": 60,
  "cone_property_holds": true,
  "cone_half_angle_rule": "gamma = arccos(i . t), measured about the +t axis: the set of reflected directions is exactly {d : d.t = i.t}, a right circular cone of half-angle gamma whose axis is the groove direction t.\n\nReason: every facet normal of a prismatic groove satisfies n.t = 0, so d.t = i.t - 2(i.n)(n.t) = i.t for every facet, at every point, for ANY number of bounces. gamma is therefore independent of facet tilt, of groove depth, of which facet family is hit, and of the bounce count. Equivalently, with omega_i = -i (pointing back at the source), the outgoing cone half-angle about -t is arccos(-i.t) = arccos(omega_i.t): the outgoing ray makes the same angle with the groove as the incident ray does, i.e. the groove acts as a mirror only in the plane perpendicular to t and as a translation-invariant \"wire\" along t. This is the Kossel/grazing-grating cone.\n\nPopulated arc of that cone, in azimuth phi measured about t (phi = 0 at the flat-mirror specular direction, positive in the same sense as th):\n* land / uncut mirror: delta at phi = 0.\n* straight walls: deltas at phi = +/-60 deg (= 2 x 30 deg).\n* cylindrical bottom: continuous band phi in [-120, +120] deg, with linear density (dPhi/dphi) proportional to (1/2) R |n.i| F(theta_loc) V (the 1/2 is dth/dphi).\n* wall-wall double bounce: a delta at phi = phi_i -/+ 120 deg, where phi_i is the azimuth of the INCIDENT direction itself (not of the specular direction), because two reflections compose to Rot_t(2(th_2 - th_1)) = Rot_t(-/+120 deg).\nDegenerate cases: gamma = 90 deg (i perpendicular to t) collapses the cone into the plane perpendicular to t (a flat fan); gamma = 0 (i along t) collapses it to the single direction t. Only the half of the cone with d.z_hat > 0 escapes; the rest is masked and feeds the multiple-bounce terms.",
  "wall_pattern_conic": "A cone of directions launched from a point traces a CONIC SECTION on any flat wall, because the reflected-direction cone (apex at the groove point, axis t, half-angle gamma) is itself a right circular cone and a plane cuts it in a conic.\n\nExact criterion. Let psi = angle between the cone axis t and the wall PLANE (psi = 90 deg - angle(t, m_hat), m_hat = wall normal; note t is horizontal here, so psi = arcsin|t.m_hat|). Directions lying in the wall plane make angles with t ranging over [psi, 180-psi], so the plane is parallel to 0, 1 or 2 generators:\n* gamma < psi -> ellipse (0 parallel generators). Special case psi = 90 deg (groove pointing straight at the wall, t normal to it): a CIRCLE centred on the wall, angular radius gamma.\n* gamma = psi -> parabola (exactly 1 parallel generator).\n* gamma > psi -> hyperbola (2 parallel generators); you see one branch.\nIn dot-product form: ellipse iff (i.t)^2 + (t.m_hat)^2 > 1, parabola iff = 1, hyperbola iff < 1.\nDegenerate: gamma = 90 deg gives a straight LINE (the cone has flattened into a plane); gamma = 0 gives a point; a wall containing the apex gives two crossing lines.\n\nPractically, for a vertical gallery wall and horizontal grooves: grooves running parallel to the wall (t.m_hat = 0, psi = 0) always give HYPERBOLAS - the streaks bow away from the groove direction, and they are hyperbolic for every incidence except the degenerate gamma = 90. Grooves aimed at the wall (t.m_hat = +/-1, psi = 90 deg) give circles/ellipses. Intermediate azimuths cross the parabola exactly when the incident direction satisfies arccos|i.t| = arcsin|t.m_hat|. Since only three points plus one 240-deg band of the cone are populated (see cone_half_angle_rule), what actually lands on the wall is: two bright points on the conic at +/-60 deg of azimuth from the specular point, the specular point itself from the uncut land, and a continuous arc of the same conic from the cylindrical bottom - all on ONE conic per groove point. Because the artwork's grooves are curved, t rotates along a stroke, so each stroke paints a one-parameter family of these conics and what the eye sees is the envelope (a caustic), not a single conic.",
  "projected_area_fractions": {
   "spherical": 0.184418,
   "straight_wall": 0.341988,
   "ridge": 0.473595,
   "basis": "Projected (foreshortened) area onto the plane z=0, per unit length along t. Each facet's contribution is its cross-section arclength times cos(facet tilt), i.e. simply its lateral footprint in y. Denominator = the full 61.8 + 2*27.8 = 117.4 um span (one groove plus both ridges), so no uncut mirror land is included and the three numbers sum to exactly 1. Exact values: spherical (cylindrical bottom) 2*A0/117.4 = 2*R*sin60/117.4 = 21.650635/117.4 = 0.1844176754; straight walls 2*(a_c-A0)/117.4 = 40.149365/117.4 = 0.3419877760; ridges 2*27.8/117.4 = 55.6/117.4 = 0.4735945486. The identity int_{-60}^{+60} R cos(th) dth = 2 R sin60 = 2*A0 is what makes the arc's projected width equal 21.650635 exactly. NOTE: the two vertical ridge inner faces (height 7.9 each at |y| = a_c, tilt +/-90 deg) have exactly ZERO projected area, which is why these three close to unity even though they are not the whole surface; by TRUE (unforeshortened) arclength the split is instead spherical 0.179141, walls 0.317229, ridge slopes 0.395516, ridge cliffs 0.108114. If a real pitch P > 117.4 is used, multiply all three by 117.4/P and add a land fraction (P-117.4)/P at th = 0."
  },
  "two_bounce": {
   "possible": true,
   "incidence_condition": "Only the IN-PLANE projection of i matters (the t-component rides along untouched), so state it with alpha = signed angle of i's cross-section projection from the downward vertical, positive toward +u; alpha < 0 means the light arrives over the +u rim and travels toward -u. The condition is independent of i.t.\n\nStep 1 (which facet): the +u ('near') wall is illuminated for |alpha| < 60 deg (grazing at exactly 60 deg, where i is parallel to that wall).\n\nStep 2 (does the once-reflected ray cross to the far wall): the reflected ray is d = (-cos(beta), sin(beta)) in (u,z) with beta = alpha + 30 deg, i.e. beta is its elevation above the horizontal. It heads toward the far wall's plane iff d.n_far < 0 iff sin(beta-30) < 0 iff beta < 30 deg iff alpha < 0. At alpha = 0 (normal incidence) beta = 30 deg exactly and the ray is EXACTLY PARALLEL to the opposite wall (verified: r.(wall direction) = 1.0 to 1e-16) - the 120 deg V grazes instead of double-bouncing at normal incidence. At alpha = -30 deg the reflected ray is exactly horizontal (beta = 0) and strikes the mirror-image point of the far wall.\n\nStep 3 (does it land on the far wall segment): with the first hit at lateral y0 in [A0, a_c], the perpendicular distance from that point to the far wall plane is exactly y0, so the second hit is at lateral -y2 with y2 = y0 * k(beta), k(beta) = cos(beta)/sin(30 deg - beta) - 1. Requiring A0 <= y2 <= a_c gives A0/k <= y0 <= a_c/k. Over the whole wall this closes to |beta| < beta_max with tan(beta_max) = (rho-1)/(sqrt(3)(rho+1)), rho = a_c/A0 = 2.8544197 -> beta_max = 15.523802 deg. So for the bare V + arc: wall-to-wall double bounce iff |alpha + 30 deg| < 15.523802 deg, i.e. alpha in (-45.523802, -14.476198) deg, and mirrored (+14.476198, +45.523802) for light from the other side. Below A0/k the ray hits the cylindrical bottom instead (still a two-bounce, just wall->arc) and above a_c/k it escapes over the far rim.\n\nStep 4 (the ridges, which as specified put a 7.9 um vertical cliff at each rim): a wall point (y0, z0) sees the source only if the sight line clears its own ridge PEAK at (a_c, 7.9), i.e. z0 + (a_c - y0) cot|alpha| > 7.9, so the near wall is lit only DEEP, y0 < y_sh(alpha) = a_c - 7.9/(cot|alpha| - tan30) - the strip just below the rim is always self-shadowed, and the whole near wall goes dark for |alpha| > 45.8465 deg. Combining with step 3 (A0/k(beta) <= y0 <= min(y_sh, a_c/k)) the true windows are:\n  wall->wall OCCURS for alpha in (-38.940006, -14.476198) deg,\n  and the twice-reflected ray ESCAPES to the far field only for alpha in (-38.940006, -21.059994) deg;\n  outside that upper edge the doubly-reflected ray runs into the FAR ridge's inner cliff (sequence wall-wall-ridge) and is absorbed/diffusely scattered. Both edges confirmed by ray tracing (first ww hits appear at alpha = -38.5, last escaping at -21.5 on a 0.5 deg grid).\nOther two-bounce families are also real and are broader: wall->arc, arc->wall and arc->arc. At exactly normal incidence, of the flux entering the mouth the trace gives 64.9% single wall bounce, 19.1% single arc bounce, 8.0% arc->arc, ~5% terminating on a ridge face; arc facets with |th| > 45 deg necessarily send their ray below the horizon (2 th > 90 deg) and cannot escape without a second bounce.",
   "net_deflection_deg": "In-plane (i perpendicular to t): exactly 120 deg. Derivation: two reflections compose to a rotation, M(th_2)M(th_1) = Rot_t(2(th_2 - th_1)); with th_1 = +30 deg and th_2 = -30 deg this is Rot_t(-120 deg) (Rot_t(+120 deg) for the opposite bounce order), so the cross-section direction is turned by 120 deg. Equivalently the classical two-mirror rule: deviation = 360 deg - 2*alpha_dihedral = 360 - 2*120 = 120 deg, the dihedral angle between the walls being 180 - 30 - 30 = 120 deg (= the included cone angle). The turn is INDEPENDENT of where and at what angle the ray strikes - only the number and identity of the facets matter.\n\nFull 3-D, with c = i.t: only the in-plane part rotates, so the angle between i and the final direction is Delta = arccos( c^2 + (1-c^2) cos(120 deg) ) = arccos( (3 c^2 - 1)/2 ). Verified numerically: c = 0 -> 120.000000 deg, c = 0.3 -> 111.407583, c = 0.6 -> 87.707557, c = 0.9 -> 44.356801, each matching the closed form to 1e-6. The exit direction sits on the same cone, at azimuth phi_i -/+ 120 deg; in the cross-section it leaves at polar angle |alpha + 60 deg| from the vertical, tilted toward -u (e.g. alpha = -30 -> exits at 30 deg from vertical, which happens to coincide with the flat-mirror specular direction; alpha = -45 -> 15 deg; alpha = -15 -> 45 deg).",
   "retroreflection": "NO - a 120 deg V cannot retroreflect, in-plane or otherwise. Retroreflection needs Delta = 180 deg, i.e. (3c^2 - 1)/2 = -1, i.e. c^2 = -1/3: no real solution. The maximum possible two-bounce deviation is 120 deg, attained only for light arriving perpendicular to the groove (c = 0), and it falls off as arccos((3c^2-1)/2) as the light tilts along the groove. Geometrically: two reflections give the rotation Rot_t(2*alpha_dihedral) = Rot_t(240 deg) = Rot_t(-120 deg), and reversal requires Rot_t(180 deg), i.e. alpha_dihedral = 90 deg. Only a 90 deg V (60 deg included tip angle would be wrong; a 90 deg included angle, walls at 45 deg) retroreflects, and then only in the cross-section plane - it is a 2-D roof mirror, so it reverses the in-plane part while preserving the t-component, giving true retroreflection only for c = 0. Practical consequence for this tip: the grooves never throw light back at the spotlight; they always throw it 120 deg away (or less, as the stroke turns along the beam), which is exactly why the strokes read as bright cones/streaks off-axis rather than as retroreflective glitter. A third bounce is also available in principle (Rot_t of a further 2*Delta th), but the trace finds triple-plus sequences are rare and always end on a ridge face or exit below the escaping-flux threshold, and each bounce costs a factor of the metal reflectance (~0.6 for 304 in the visible), so the two-bounce lobe is already only ~0.36 of the incident flux it carries."
  },
  "key_equations": [
   "Frame: t = groove direction in z=0; u = z_hat x t; facet tilt th about t; n(th) = cos(th) z_hat - sin(th) u; all facets satisfy n.t = 0.",
   "Wall normal: th_wall = 90 deg - a = 90 - 60 = 30 deg from vertical (a = 60 deg = cone half-angle from the axis). n_wall = (0, -/+ sin30, cos30).",
   "NDF, projected-area form (this is D(n) with the (n.z_hat) weight folded in; per period P, per unit length along t, units 1/rad): D_perp(th) = (1/P) [ (P - 117.4) delta(th) + (a_c - A0)(delta(th - 30 deg) + delta(th + 30 deg)) + R cos(th) 1_{|th| <= 60 deg} + 27.8 (delta(th - 15.8637 deg) + delta(th + 15.8637 deg))_ridge + 0 * (delta(th - 90 deg) + delta(th + 90 deg))_cliff ].",
   "Straight walls = two delta functions in facet-normal space; cylindrical bottom = one continuous arc, UNIFORM in th by true area (ds = R dth) and proportional to cos(th) by projected area; the ridge slopes are two more deltas but are NOT mirrors; the two rim cliffs are deltas at th = +/-90 deg with zero projected weight.",
   "Closure identity: int_{-60}^{+60} R cos(th) dth = 2 R sin(60 deg) = 2 A0 = 21.650635 um = the arc's projected width; and 2A0 + 2(a_c - A0) + 2(27.8) = 117.4 exactly.",
   "Full spherical NDF: D(n) = [D_perp(th)/cos(th)] * delta(n.t), normalised by int D(n) (n.z_hat) dw = int D_perp(th) dth = 1 (checked to 2e-6 by quadrature).",
   "Microfacet BRDF: f_r = F(theta_d) G(omega_i, omega_o) D(h) / (4 (n_bar.omega_i)(n_bar.omega_o)), h = (omega_i + omega_o)/|omega_i + omega_o|; the standard 1/(4 omega_o.h) half-vector Jacobian is already inside that 4.",
   "Prismatic delta transform (the reason the BRDF is a line distribution): h.t = 0 <=> omega_o.t = -omega_i.t <=> d.t = i.t, and delta(h.t) = 2 cos(theta_d) delta(omega_o.t - (-omega_i.t)); so f_r is supported on a curve, not an area, and has no 2-D lobe to speak of.",
   "Facet-normal -> direction map and its Jacobian (the 1-D form, which is the honest one here): d(th) = Rot_t(2 th) d(0), hence phi_out = phi_spec + 2 th and dphi/dth = 2 exactly (verified to 1e-12). Arclength on the unit sphere along the cone: ds = sin(gamma) dphi = 2 sin(gamma) dth.",
   "Directional scattering distribution, per unit azimuth phi about the cone (this is the object to render, distinct from the NDF): dPhi/dphi = E_perp * (1/2) * l(th) * |n(th).i| * F(theta_loc) * V(th, alpha), with th = (phi - phi_spec)/2, l(th) = true arclength density (l = R for the arc; l = (a_c - A0)/cos30 as a delta for each wall), and the 1/2 = dth/dphi is the Jacobian.",
   "Local incidence angle on a facet of tilt th, with c = i.t and alpha the in-plane tilt of i from the vertical: cos(theta_loc) = sqrt(1 - c^2) * cos(th - alpha); the facet is lit only where cos(th - alpha) > 0. As c -> 1 (light along the groove) every facet goes to grazing, F -> 1, and the cone shrinks - the bright anisotropic streak.",
   "Cone (Kossel) invariant: d.t = i.t for every bounce; half-angle gamma = arccos(i.t) about +t.",
   "Normal incidence off a wall: r = i - 2(i.n)n = (0, -sin60, cos60) for i = -z_hat, i.e. 2 * th_wall = 60 deg from vertical - and r is EXACTLY parallel to the opposite wall (r . (0,-cos30,sin30) = 1), so the 120 deg V grazes rather than double-bounces at normal incidence.",
   "Second-hit position: from a first hit at lateral y0 on the near wall, the perpendicular distance to the far wall plane is exactly y0, and the second hit is at lateral y2 = y0 * k(beta), k(beta) = cos(beta)/sin(30 deg - beta) - 1, beta = alpha + 30 deg = elevation of the once-reflected ray. Identities: k(0) = 1, k(beta) k(-beta) = 1, k(-30 deg) = 0, k -> inf as beta -> 30 deg.",
   "Double-bounce window (bare V): A0/k <= y0 <= a_c/k closes to tan(beta_max) = (rho - 1)/(sqrt(3)(rho + 1)) with rho = a_c/A0 = 2.8544197, beta_max = 15.523802 deg, i.e. alpha in (-45.523802, -14.476198) deg.",
   "Ridge self-shadowing (with the specified 7.9 um rim cliff): a near-wall point is lit only if z0 + (a_c - y0) cot|alpha| > 7.9, i.e. y0 < y_sh(alpha) = a_c - 7.9/(cot|alpha| - tan30); the near wall is wholly dark for |alpha| > 45.8465 deg. This narrows the double-bounce window to (-38.940006, -14.476198) deg, and the ESCAPING part to (-38.940006, -21.059994) deg.",
   "Two-mirror composition: M(th_2) M(th_1) = Rot_t(2(th_2 - th_1)); walls at +/-30 deg give Rot_t(-/+120 deg). Deviation = 360 deg - 2 * alpha_dihedral with alpha_dihedral = 120 deg -> 120 deg. In 3-D: Delta = arccos((3 c^2 - 1)/2), c = i.t; max 120 deg at c = 0; retroreflection would need c^2 = -1/3.",
   "Conic on a flat wall: with psi = angle(t, wall plane) = arcsin|t.m_hat|, the pattern is an ellipse for gamma < psi, a parabola for gamma = psi, a hyperbola for gamma > psi; equivalently ellipse iff (i.t)^2 + (t.m_hat)^2 > 1.",
   "Geometry consistency identities (all verified): a_c = A0 + (d - h0) tan60 = 30.9001; d = a_c / tan60 = 17.8402 (the SHARP-cone depth); junction depth = (A0 - a_c) tan30 = -11.5901 = -(d - h0); perpendicular distance from the sphere centre to the wall plane = R cos(30 deg) = 10.8253 < R, so the arc dips R(1 - cos30) = 1.6747 um past the cone surface; arc paraxial focal line at R/2 = 6.25 above the trough bottom, i.e. at z = -11.591, inside the groove."
  ],
  "caveats": [
   "THE TIP MODEL IS NOT SELF-CONSISTENT AS A BLUNTED 120 DEG CONE, and this is not a rounding issue. A sphere of radius R tangent to a cone of half-angle a from the axis meets it at lateral R cos(a) and height R(1 - sin(a)) above the tip, i.e. 6.25 and 1.6747 um for a = 60 deg. The supplied crossover uses A0 = R sin(60) = 10.8253 and h0 = R(1 - cos 60) = 6.25 - the standard formulas but with the axis half-angle (60 deg) substituted where the surface half-angle (30 deg) belongs. Source: {repo_path}/only-surprise/engine/stylus.py lines 69-70 (H0_UM = TIP_R_UM*(1-COS_A), A0_UM = TIP_R_UM*SIN_A with HALF = 60 deg) feeding contact_radius_um() at lines 87-88. Consequences that matter optically: (a) the arc's normal at the junction is 60 deg from vertical while the wall's is 30 deg, so there is a 30 deg NORMAL DISCONTINUITY and a re-entrant (void-side) edge at (|y|, z) = (10.8253, -11.5901); (b) the arc dips R(1-cos30) = 1.6747 um BEYOND the cone surface, i.e. the model removes more metal than a rigid convex indenter could; (c) the stated depth d = 17.841 is exactly the SHARP-cone depth a_c/tan60, so the blunting has been applied without the depth or width being corrected for it. A tangency-consistent alternative is A0 = 6.25, h0 = 1.6747, which makes the arc span only th in [-30, +30] deg with the wall deltas sitting exactly at the ARC ENDPOINTS (a C1 profile) and gives a_c = 34.25 at d = 17.841 (or d = 15.90 at a_c = 30.9). I answered with the geometry AS GIVEN, because the projected fractions were requested on the 61.8 + 2*27.8 basis; if the tangent version is adopted, the arc band on the cone shrinks from 240 deg to 120 deg of azimuth, the fractions become spherical 0.1065, walls 0.4199, ridge 0.4736, and both re-entrant edges disappear.",
   "The re-entrant junction edge is not cosmetic: in the trace it is the occluder that ends the double-bounce window (rays aimed just above the far junction clip it), and it adds two sharp diffracting lines inside every groove. Real plastic flow would not leave it. If you adopt the tangent-consistent profile, re-derive the two-bounce edges - the -38.94 deg edge is set by ridge shadowing plus this edge, not by the V alone (the bare-V edge is -45.5238 deg).",
   "As literally specified ('peak height 7.9 AT the rim'), each rim carries a 7.9 um VERTICAL CLIFF facing the groove. It has zero projected area - which is exactly why the three requested fractions sum to 1 - but it is 10.8% of the true surface, it is the thing that shadows the near wall from the rim downward (so the lit part of a wall is its DEEP part, not the part near the rim), and it is what absorbs the escaping double-bounce ray for alpha in (-21.06, -14.48) deg. If the real pile-up lip is rounded or overhanging instead, both the illumination limit y_sh(alpha) and the escape window change; if it overhangs, expect additional blocking at low elevation.",
   "The ridges hold 47.36% of the projected area - MORE than the groove itself - and they are torn, plastically smeared metal, not mirror. Nothing above models them: they need their own rough/diffuse BRDF (a wide GGX at roughness ~0.3-0.5, or Lambertian with reduced albedo) plus multiple scattering, and their 15.86 deg tilt biases that diffuse lobe outward, away from the groove. Any brightness prediction is dominated by this term, not by the specular deltas.",
   "Delta functions are idealisations. The wall facets are only 20.07 um wide, so single-slit-scale diffraction broadens each specular spike to roughly lambda/w = 0.55/20.07 = 0.027 rad = 1.6 deg FWHM in the visible; the finite spotlight subtends its own angle (a 5 cm source at 3 m is ~1 deg) and doubles into ~2 deg after reflection; and the No. 8 finish itself has residual microroughness. Convolve the line distribution with that kernel before rendering, or the cone will alias to nothing. The groove period (117.4 um) is >> lambda so geometric optics is right for the pattern's shape; only the spike widths are wave-limited.",
   "Smith-type shadowing/masking G is INVALID here. It assumes uncorrelated random heights; this surface is deterministic, periodic and correlated, and its shadowing is exactly computable - I give it in closed form (y_sh(alpha) = a_c - 7.9/(cot|alpha| - tan30), plus the k(beta) interval for masking). Use those, not a statistical G.",
   "Fresnel and absorption are not folded into the geometric statements. 304 stainless is ~0.55-0.65 reflectance in the visible at normal incidence, rising toward grazing, and s/p differ strongly at the 60 deg local incidence that a wall sees at normal illumination - so the two wall spikes are noticeably polarised, and the double-bounce spike is polarised twice over (its brightness carries roughly R^2 ~ 0.36, and its polarisation state is the product of two non-normal reflections at different orientations). If polarisation matters, propagate the full Jones/Mueller product, not a scalar F.",
   "The cone property is EXACT only for a truly prismatic groove. It fails wherever t is not constant: at the start/stop of a stroke (where a dragged conical tip really does leave a spherical, not cylindrical, bowl - a spherical bottom scatters into a 2-D lobe rather than onto a cone), at crossings, and along any curved stroke over a spot larger than the local radius of curvature. In this work the strokes ARE curved, so treat gamma = arccos(i.t) as a per-point statement and integrate the resulting family of cones along each stroke; the visible feature is that family's envelope.",
   "The projected fractions deliberately exclude the uncut mirror land, because the requested 117.4 um basis is exactly one groove plus both ridges. Real coverage depends on the groove pitch P, which was not given: multiply all three by 117.4/P and add (P - 117.4)/P of land at th = 0. Since the land is a No. 8 mirror, that delta will dominate the rendered image wherever it is unshadowed - the grooves are a small-area, high-contrast perturbation on a mirror, so render the land specular and the grooves as an added line-distribution, not as an averaged microfacet lobe.",
   "Multiple bounces are not a small correction for the arc. At normal incidence the trace gives 8.0% of the entering flux as arc->arc (the bottom is a concave cylinder whose paraxial focal line, R/2 = 6.25 above the trough, lies at z = -11.591, INSIDE the groove) and any arc facet with |th| > 45 deg necessarily sends its ray below the horizon, so it cannot escape without a second bounce. A single-scattering microfacet evaluation will therefore over-predict the arc band's outer wings by roughly a factor of two and lose the energy that the correct answer moves elsewhere on the cone.",
   "Numbers quoted to 6 decimals are consequences of the inputs as given (d = 17.841 is itself a rounded value: a_c/tan60 = 17.8402, and using it shifts the sphere-centre-to-wall distance from R cos30 = 10.82532 to 10.82456). Do not read the last digits of the two-bounce window edges (-38.940006, -21.059994, -14.476198) as physical precision; they are exact for this idealised profile and move by a few tenths of a degree under the tangency correction or any rim rounding."
  ]
 }
]