Your constraint seems correct to me. I can sample locally without any problem - not sure what do you mean by it does not work.
You might find this related discussion helpful: Sampling uniformly in a triangular support
1 Like