We present a method to reconstruct a pipe or a canal surface from a point cloud (a set of unorganized points). A pipe surface is defined by a spine curve and a constant radius of a swept sphere, while a variable radius may be used to define a canal surface. In this paper, by using the shrinking and moving least-squares methods, we reduce a point cloud to a thin curve-like point set which will be approximated to the spine curve of a pipe or canal surface. The distance between a point in the thin point cloud and a corresponding point in the original point set represents the radius of the pipe or canal surface.