clipPolygon = e => {
const raw = tetrahedralMarkleyRaw;
if (e === undefined) e = .001;
const lin = (s, e, n) => d3.range(n).map(i => s + ((e - s) * i) / n);
const x0 = -7 + e;
const x1 = 1 - e;
const y0 = e;
const y1 = 1.5 / sqrt3_4 - e;
const ring = []
.concat(
lin(y0, y1, 38).map(y => [x0, y]),
lin(x0, x1, 9).map(x => [x, y1]),
lin(y1, y0, 38).map(y => [x1, y]),
lin(x1, x0, 9).map(x => [x, y0])
)
.map(d => raw.invert(...d).map(d => d * degrees));
ring.push(ring[0]);
return {
type: "Polygon",
coordinates: [ring]
};
}