Patent ID: 8534209

Claim:
A sewing machine comprising: a transport portion that moves an embroidery frame that holds a work cloth on which embroidery is sewn; a contact detection portion that is disposed on an inner peripheral side of the embroidery frame and that detects contact with the embroidery frame that is moved by the transport portion; a first position identification portion that causes the transport portion to move the embroidery frame in a first direction and that identifies a first position at which contact with the embroidery frame is detected by the contact detection portion; a second position identification portion that causes the transport portion to move the embroidery frame in a second direction and that identifies a second position at which contact with the embroidery frame is detected by the contact detection portion, the second direction orthogonally intersecting the first direction; a direction determination portion that determines a third direction that is a direction of a diagonal line of a first virtual rectangle, which is calculated from the first position identified by the first position identification portion and the second position identified by the second position identification portion; a third position identification portion that causes the transport portion to move the embroidery frame in the third direction determined by the direction determination portion, and that identifies a third position at which contact with the embroidery frame is detected by the contact detection portion; and an area setting portion that, based on a second virtual rectangle that is calculated from the third position identified by the third position identification portion, sets a sewable area that is an area on which an embroidery pattern can be sewn within the embroidery frame.