End constructor
Implementation
factory End(WorldWall wall, int k) {
final d = wall.d;
final a = k == 0 ? d : -d;
final (l, r) = wall.offsets;
// The outward-looking left normal is perp(a); at the end (k == 1) it is
// the wall's right normal, so the faces swap sides and signs.
return End._(wall, k, a, k == 0 ? l : -r, k == 0 ? r : -l);
}