The geometrical description of the capillary systems adjusted for guiding X-rays is presented. Simple relationships between the reflection angle, the angle of the capillary wall inclination towards the capillary's main axis and the angle of the ray inclination in relation to the main axis are proved. Once established, the relationships help derive differential equations describing the profile of the capillary wall, in the small angle approximation. The equations can be made more general, by the deliberate assumption about the variability of the reflection angle along the reflecting surface. The way of calculating the forces necessary to draw capillaries of desired shape is then demonstrated. Finally, the full assembling of capillary shape with the variability of the reflection coefficient is suggested. Many solutions given in the paper apply to the case of total reflection X-ray mirrors.