Given an affine algebraic variety $V$ such that $\Gamma(V,\mathcal{O}_V)$ is a UFD, its sheaf of ring can be determined easily since one can show that:

$$\Gamma(D(f_1) \cup \cdots \cup D(f_n),\mathcal{O}_V) \simeq \Gamma(D(h),\mathcal{O}_V),$$ where $h=\mathrm{gcd}(f_1, \ldots, f_n)$.

It is then natural to ask whether we can characterize the set of affine algebraic varieties $V$ such that $\Gamma(V,\mathcal{O}_V)$ is a UFD? Are there any geometric interpretations?

Thanks you!