Energies with respect to a measure and applications to low dimensional structures