Described embodiments include a method for use with a catheter that includes at least one flexible arm to which are coupled a plurality of electrodes. The method includes calculating, by a processor, respective estimated locations of the electrodes while the catheter is within a portion of a body of a subject, fitting a model of the catheter, which models the flexible arm as a piecewise-linear element that includes a plurality of linear segments, to the estimated locations, ascertaining for each of the electrodes, based on respective orientations of one or more of the linear segments per the fitting, whether the electrode is in contact with tissue of the subject, and updating a map of the portion of the body of the subject, in response to ascertaining that at least one of the electrodes is in contact with the tissue. Other embodiments are also described.