maria-korosteleva/GarmentCode

The order of stitching two edges

Closed this issue · 1 comments

Do you have any method for determining the correct stitching direction when combining two curves? The configuration only specifies which two curves should be stitched together, but it does not provide information on the direction of the stitching.

Pasting the response from the Maria. :)

In the most recent version of the JSON format (which is used in GarmentCodeData and PyGarment 2.0.0+), all the edges are expected to be stitched following the manifold property: a start vertex of one edge connects to the end vertex of the other edge, which creates the right side of fabric to right side of fabric connection.

There are exceptions, and they are marked with a "right_wrong" label in the stitch specification. If the mark is present you should use the other orientation (start to start). In our data, it's used for garments with lapels. Here is the core where we read this property:

stitch.swap = not (len(stitch_spec) == 3 and 'right_wrong' == stitch_spec[-1])