Phase transition in a stochastic geometry model with applications to statistical mechanics