Load file in DST format

Thanks! Yeah! I wrote a .toTexture( size ) method on the result that renders it to a renderTarget so you could use it as a texture on something.

@Zahra_Jafarpisheh do you have any other files along with the .dst file? Perhaps the colors are stored there? You can drag (small) files into this discourse I think.

1 Like

Note that I have a model in GLTF format and I want the DST file to be placed on one of its meshes and have exactly the same shape as the simulation, i.e. the fabric folds.

Yeah. Did you manage to find out where the colors for the threads are located with DST format?

With that loader I made, there is a .toTexture() option that gives you back a texture that you could apply to a mesh.

1 Like

please help me and write code

there’s a start… i’ll tweak it more tomorrow… off to bed!

1 Like

very cool! What is the most common/well supported embroidery format in your opinion?

I made that DST loader but it has issues, for instance, not storing color information…

Would be neat if it could be extended to some other popular formats…

Ahh that’s great info… and yeah I had to implement the reading of the color stop+jump threads in the format… I’ll take a look at EMB…

1 Like

Yeah! I saw that… but none of the free example files I found on the web contained anything in the headers, so I guess that’s not commonly used… If I had an example .dst file with those colors in the header, I could make my parser parse them… do you have one by chance?

Appreciate the example file. If i revisit this, I may look into writing an .emb importer, but for now, it’s still just dst.

I made an interactive glitch that shows how one could make a configurator for placing .dst decals on a mesh… thought you might get a kick out of it:

1 Like

Yeah help yourself!

It’s been a few years since I started digitizing designs into embroidery file formats like DST, PES, OFM, JEF, HUS, and more. The logo creation process is almost the same for any kind of embroidery file. You only need to know about the embroidery software. Now, why have I come to this thread? I have been searching for two things for 15 days: 1) How can I view the logo in a DST file without having the software? 2) Is there any converter that can create files in these formats? I am not a coder, so many things you guys discuss are hard to understand. I am not sure how you open the stitch file in a Google browser, LOL, because whenever I receive a file from my clients, I need to first open my embroidery software, WILCOM, to see what’s there.

Also I saw 100s of online coverters and all are FAKE except one image2emb because they are actually the digitizers who convert your design manually. On their page PES file converter they said its not possible in this world to get instant conversion of these logo in embroidery file formats :zipper_mouth_face: Its require 4-6 hours to craft dst file.

Is that true?

Short answer:
1.)
You can use this loader I made to view the DST file in a browser. It’s not guaranteed to work, but it has worked with the DST files I tested it on. You also have to manually specify which colors to use. I had to make some guesses to get the ones in my demo to look good. Sometimes the files have color hints, sometimes they don’t.

  1. Is there any converter that can create files in these formats?
    I don’t know but I think perhaps not? though it is possible in theory, but probably wouldn’t create as good a result as having a human do the design in the embroidery software.

The DST file is just a collection of stitch start and end points on a piece of fabric.
These aren’t created automatically. You start with the logo, then you have to use the embroidery software to scan the areas of color and then manually figure out/decide how to trace threads back and forth to reproduce the same shape so that it looks pleasing. The orientation of the threads and the choice of threads and colors, has an impact on the final design. There are also smaller threads that go along the back of the design to help support it, and have something to tie the threads off and anchor the design to things.

The DST file is the machine representation of stitching that design…,. and the stitching machine itself is not a high tech computer driven thing… it’s driven by a special purpose (cheap) microcontroller that Only understands where to stick the needle in (x,y start and end points), which spool of thread to use (it doesn’t know or care about which color! and that information often isn’t even in the DST file! just spool 1,spool 2, 3, etc.)… it takes that info and drives the embroidery needle at high speed to create the final design on the fabric.

When they do this in the factory, the factory worker has to select the right color thread spools and set the machine up for that specific design.

What I did in my DST loader is simulate that machine… and instead of thread, i draw quads with a texture of a small piece of thread on them, so when they are combined side by side it looks like the embroidery.

So… I’m not converting or creating DST files, just reading them. To create them is a manual process done by the embroidery artist using the embroidery software, and that’s why it takes hours to do… The actual process itself is probably relatively short (maybe an hour or so I’m guessing for a simple design? Perhaps much longer for complex/larger designs?), but its also the planning, and scheduling of that artists time, that takes the bulk of the time I would assume.

I could probably write software that creates the DST file from images, but it would only be an automated guess about how to make it, and probably would struggle to capture the artistic intent in the design. I think there are a lot of small artistic choices that go into these designs, and I would say that making them look good is very much an art.

That all said… maybe this is something that is possible, and just hasn’t been done yet?

If you want to chat more about it, feel free to DM me. Also search the forum here for DST, i think some people have already started building software around my loader…

2 Likes

@manthrax Thank you so much for your response. Sorry for the noob question, but is there an easy process where I can just insert my dst path and see the output? I mean, I’m not tech-savvy. I saw your GitHub link and downloaded the folder. Now, is there a step-by-step guide available? Also, do I need to download any software to open these .js files?

image

Create an account on glitch.com

Then go here:

click ā€œRemixā€ to make a copy under your own account…

Drag your DST file into the ā€œassetsā€ section on the left…

Click the ā€œCopy URLā€ … now glitches URL to your file is in the clipboard…

Then go into ā€œtest.jsā€ line 76

Select the URL inside the quotes there… and paste over your new URL

The preview window on the right should reload and you will see your DST. Maybe. :smiley:

3 Likes

@riley_breean just as an alternative, there is now an online custom DST Viewer based on the work of @manthrax.

This is a desktop viewer which allows loading DST model file either locally or via URL but drag-n-drop and ZIP files are not currently supported.

It might not be perfect but seems to be working fine with features that are implemented.

3 Likes

Lol :heart_eyes: :star_struck:, OMG, check it out—it’s working, hehehe, wow! There is a color issue, but the most important thing is that I can see exactly what the logo looks like inside the DST. Before this, I was using specific embroidery software to open this and couldn’t use the DST file on my mobile. Even my client had to view it via software. @GitHubDragonFly , thanks once again for this; it will at least work 80% for me.

2 Likes

I may use this on my website and in circle those need to see. I cannot determine the stitch type but can determine the density of logo. Superb!

@riley_breean that’s nice, those 80% sound good to me even though I don’t deal with embroidery at all.

Just as an FYI:

  • there is now also a mobile friendly version of this viewer available and it can be accessed here
  • all of my viewers, both desktop and mobile, can be accessed from the main webpage so bookmark whatever you might be able to use
1 Like

Fantastic @GitHubDragonFly @riley_breean glad you got some things working!

1 Like

@manthrax this probably wouldn’t have happened without your deciphering the DST format and creating the loader. Some users might not be comfortable with using the glitch and that’s why I bothered creating this viewer. I will share those 80% with you and with me keeping 20% out of it.

@riley_breean here is some additional information about the DST Viewer, just in case if you haven’t figured it out yourself yet:

  • Currently, the colors will always be random for any DST model but are clickable so they could be changed to the original colors. Once you get original colors set on the model then you can use the Export options and export the model to a PNG file or some other 3D formats, like GLB or 3DM or OBJ or PLY …

    • My other viewers are kind of set to handle these exports properly but material’s depthTest value might not be propagated properly in all exports (at least my version of 3DM / OBJ exporter and loader should have no issues while my GLTF Viewer does now have the DT button for switching the material’s depthTest)
  • Hitting the reset button, RST, should reload the model and randomize it’s colors again

  • The mobile version of the viewer is stripped down to almost bare functionality

1 Like