This paper proposes a method for a snake robot to fit ordered points and thus generate body shape. A non-smooth backbone curve consisting of straight line segments is constructed by sequentially connecting the ordered points, and then the bending and twist angles at the singularities are obtained iteratively to obtain the joint angles of the snake robot. Fitting the shape of a snake robot using this method does not depend on obtaining a backbone curve with known curvature and torsion, greatly expanding the applicability of the fitting method. In this paper, the validity of the fitting method is verified by simulation, which generates a shape that resembled a biological snake coiled on the ground.