Under what conditions is this allowed or forbidden? From this source, it seems as if it is allowed while sleeping.
As your source states, there is no definitive text to prohibit pointing your feet toward the qiblah. However, and this is a major principle in the science of usool al-fiqh - 'urf (custom) determines the law. So if you live in a society or come from a background wherein pointing your feet at something is considered derogatory or insulting to that object, then this would not be allowed under the general category of not mocking or disrespecting the deen and it's sha'air (signs). And if pointing your feet at something carries no such meaning, then as the shaykh said in his answer, there is nothing prohibiting it.
And Allah knows better!
There is no obligatory rule about this. but in Shia Fiqh there is two different type sleeping direction. one is for a Muslim who is in dying situation (Muhtazar) (some minutes before death) which his feet should be extended towards the Kabah.
And other is for sleeping that it is recommended to sleep so that the direction of body is 90 degree with direction of Kaaba and also the face be toward Kaaba.
But generally it is recommended to never a Muslim Pointing his feet towards any direction. and the reason said by shia scholars is that all the world is witnessed by God and God is watching us and we are in front of God (not means physically. But like two who meet) and this is derogatory and is not suitable for who God is watching him.
So shia scholars never extend their leg in any direction. But this is not obligatory.
Also for who is in dying situation it is needed to his leg be extended. it said by some who witnessed death of some scholars that when their family extended their leg before death he said: oh! how much is it comfortable to extend feet!
Anyway it is only for respect to God who is watching us but is not obligatory.