This article revolves around the total perimeter functional, one particular version of the perimeter of a shape O contained in a fixed computational domain D measuring the total area of its boundary ¿O, as opposed to its relative perimeter, which only takes into account the regions of ¿O strictly inside D. We construct and analyze approximate versions of the total perimeter which make sense for general “density functions” u, as generalized characteristic functions of shapes. Their use in the context of density-based topology optimization is particularly convenient insofar as they do not involve the gradient of the optimized function u. Two different constructions are proposed: while the first one involves the convolution of the function u w...