A system for use with a catheter that includes at least one flexible arm to which are coupled a plurality of electrodes (22a, 22b, 22c, 22d), the system comprising: an electrical interface; and a processor, configured: to receive, via the electrical interface, a plurality of signals, to calculate, from the received signals, respective estimated locations of the electrodes while the catheter is within a portion of a body of a subject, to fit 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, to ascertain, for each electrode 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 to update 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, wherein the processor is configured to ascertain whether the electrode is in contact with the tissue by: calculating one or more deflection angles, each of which being formed by an intersection of a respective one of the linear segments, oriented per the fitting, with a respective other line, computing a deflection measure as a function of the deflection angles, and ascertaining whether the electrode is in contact with the tissue, by comparing the deflection measure to a threshold. an electrical interface; and a processor, configured: to receive, via the electrical interface, a plurality of signals, to calculate, from the received signals, respective estimated locations of the electrodes while the catheter is within a portion of a body of a subject, to fit 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, to ascertain, for each electrode 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 to update 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, to receive, via the electrical interface, a plurality of signals, to calculate, from the received signals, respective estimated locations of the electrodes while the catheter is within a portion of a body of a subject, to fit 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, to ascertain, for each electrode 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 to update 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, wherein the processor is configured to ascertain whether the electrode is in contact with the tissue by: calculating one or more deflection angles, each of which being formed by an intersection of a respective one of the linear segments, oriented per the fitting, with a respective other line, computing a deflection measure as a function of the deflection angles, and ascertaining whether the electrode is in contact with the tissue, by comparing the deflection measure to a threshold. calculating one or more deflection angles, each of which being formed by an intersection of a respective one of the linear segments, oriented per the fitting, with a respective other line, computing a deflection measure as a function of the deflection angles, and ascertaining whether the electrode is in contact with the tissue, by comparing the deflection measure to a threshold.