The advent of spatial control over the phase and amplitude of light waves has profoundly transformed photonics, enabling major advances from imaging and information technology to biomedical optics. Here, we propose a novel approach to deterministic phase-front shaping through a planar thermo-optical module using designed microheaters to locally shape the refractive index distribution. When combined with a genetic algorithm optimisation, this SmartLens can produce free-form optical wavefront modifications. Individually or in arrays, it can generate complex functions based on either pure, or a combination of, Zernike polynomials, including lenses or aberration correctors of electrically-tuneable magnitude. This simple and compact concept complements the existing optical shaping toolbox by offering low chromatic aberrations, polarisation-insensitive and transmission-mode components which can be readily integrated into existing optical systems.