By exploring the nature of the analogy between optimum trusses and optimum layouts of discontinuities, a novel numerical analysis method for rock/soil masses is proposed in this paper. The procedure is used to determine the critical layout of discontinuities and associated upper bound limit analysis for stability problems. The alternative approximation procedure to the traditional finite element method might involve discretization of a given body using a suitably large number of nodes laid out on a grid, with the failure mechanism comprising the most critical subset of potential discontinuities interconnecting these nodes. Potential discontinuities which interlink nodes laid out across the problem domain are permitted to crossover one another, giving a much wider search space than when such discontinuities are located only at the edges of finite elements of fixed topology. Highly efficient SOCP (second-order cone programming) solvers can be employed when certain popular failure criteria are specified (e.g. Hoek-Brown and Mohr-Coulomb). Stress/velocity singularities are automatically identified and visual interpretation of the output is straightforward. Several numerical examples including rock slope are studied by the new method, and the results are very close to those calculated by using analytical method and FEM.