With the advent of additive manufacturing (AM), topology optimization (TO) has become increasingly important in structural design. A key component of structural design is generating the interior shape of an object under predefined force conditions and specific constraints. Fabricating such models by layer-based AM suffers from the problem of adding and removing interior supporting structures, which can produce artifacts in the final product. In this paper, we propose an algorithm to design a self-supporting porous structure by integrating overhang constraints into the topology optimization framework. A minimum thickness constraint is also built into the optimization process to automatically enforce printability of the resulting structures. We utilize triply periodic minimal surfaces (TPMSs) to represent interior structures which can be analyzed, optimized and stored directly using analytical functions. We apply several acceleration methods including super element strategy, multigrid algorithm and GPU-based solver to handle models comprising of several million of elements efficiently. Numerical results indicate that the optimized interior structures obtained by our approach exhibit improved printability as they largely satisfy manufacturing requirements on overhang angles and minimal thicknesses.