Current methods for fabricating lenses rely on mechanical processing of the lens or mould, such as grinding, machining and polishing. The complexity of these fabrication processes and the required specialized equipment prohibit rapid prototyping of optical components. This work presents a simple method, based on free-energy minimization of liquid volumes, which allows us to quickly shape curable liquids into a wide range of spherical and aspherical optical components, without the need for any mechanical processing. After the desired shape is obtained, the liquid can be cured to produce a solid object with nanometric surface quality. We provide a theoretical model that accurately predicts the shape of the optical components, and demonstrate rapid fabrication of all types of spherical lenses (convex, concave, meniscus), cylindrical lenses, bifocal lenses, toroidal lenses, doublet lenses and aspheric lenses. The method is inexpensive and can be implemented using a variety of curable liquids with different optical and mechanical properties. In addition, the method is scale invariant and can be used to produce even very large optical components, without a significant increase in fabrication time. We believe that the ability to easily and rapidly create optical components, without the need for complex and expensive infrastructure, will provide researchers with new affordable tools for fabricating and testing optical designs.