question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to calculate thread length?

See original GitHub issue

This is not an issue, just a question I couldn’t find an answer to. I would be really thankful if someone can provide some help with this. I’m trying to come up with a formula to calculate the thread length needed for a pattern. I tried the distance formula between 2 stitches ( d = sqrt(a^2 + b^2) ) :

file = "../assets/e4-1053.DST"
pattern = pyembroidery.read(file)

distance = []
for i in range(0, len(pattern.stitches)-1, 1):
    if pattern.stitches[i][2] == pyembroidery.STITCH:
        a_x = pattern.stitches[i][0]
        a_y = pattern.stitches[i][1]
        b_x = pattern.stitches[i+1][0]
        b_y = pattern.stitches[i+1][1]
        d_x = a_x - b_x
        d_y = a_y - b_y
        distance.append(math.sqrt(pow(d_x/10,2) + pow(d_y/10,2)))

threadlen = sum(distance)
print(threadlen)

the result for this example is about 19.2m

I know this is missing the distance the thread has to travel at each stitch point passing through the fabric, but the result is way too far off compared to what I get when I open the same file in Wilcom truesizer where I get 55m.

What am I missing?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:17 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
tatarizecommented, Mar 24, 2021

I think wilcom’s equation is something like total_length * 1.375 + 2 * thickness * stitches. It seems to be about 37-38% longer than the raw distance. I’m guessing because material floof or they actually measured it and took the average additional length such things did. Since the thread isn’t perfectly taught.

0reactions
tatarizecommented, Mar 24, 2021

I would assume wilcom probably actually measured it. And made a pretty good guess. Comparing it to other software is likely fine but the real gold standard should be comparing it to how close it actually comes to being correct with those lengths. If you run a 200m spool, does it die where that estimate suggested it would? Etc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Calculate Fastener Minimum Thread Engagement ...
The thread engagement length is multiplied by a ratio of the shear areas and ultimate tensile strengths of the respective materials. Thread ......
Read more >
How to Determine the Thread Length of a Bolt
Need to know how to determine the amount of thread on a bolt? For a hex cap screw the rule of thumb is...
Read more >
Bolt Thread Length
Bolts that are longer than 6″ have a thread length of twice the diameter plus 1/2″. For example, a 1/2 x 6 hex...
Read more >
How To Calculate Length Of Screw Thread?
As an intuitively convincing method, you could consider straightening out the arc into a line of length 212π and then stretching it along ......
Read more >
How Long is the Thread Length of a Metric Bolt
For Bolts over 200mm in length ... Multiply the diameter by 2 and add 25mm – this is the minimum length that the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found