This article presents a general nonlinear formulation for the topology optimization of planar truss structures. The novelty of this article is that element intersection is described in terms of a continuous intersection factor. The Heaviside function is used to map the element cross-sectional area to intersection properties. Therefore, the intersection feature is described by a continuous and differentiable function. The topology optimization model is hence set as a ground-structure method by simultaneously including constraints on element intersection and cinematic stability of nodes. The latter is also described by a continuous function. Three test cases are presented to demonstrate the validity of the proposed approach. Unlike mixed integer programming, the number of design cycles does not change much as the number of design variables increases.