Load file in DST format

I have a file in DST format that I want to place as a texture on the model

This format? Embroidery format DST - EduTech Wiki

yse yse For embroidery

Interesting… First I’ve heard of the format… found a bit more info here for anyone reading: Technical Info

I couldn’t find any loaders but I was curious about it… so i (chatGPT) wrote some code to read a .dst file and stuff it into a THREE.Line geometry… it’s kiiinda working?

With some tweaks it might be useful…

edit: I put it in a glitch…



with hand filled out palettes:


How to load the model in DST format exactly with its original colors
Because this program gives color to the performance manually

@manthrax I’ve wanted to have a look at your glitch but every time I open it I get an alert with an error message saying:

There was an error starting the editor. Maybe try to reload?

A reload does not solve the issue. Can you share your code differently somehow?

The code is located at the following address

1 Like

That’s super weird! What browser? Glitch is… pretty glitchy… Does it open in an incognito window? Are other glitches broken?

I could try fiddle or codepen but then I’d have to host the data files somewhere else and whatnot… lemme know if incog doesn’t work and what a preferred alternative to host it is?

(heres the whole thing if u want to run it locally…)

three-dst-embroidery-2024-01-16_164205.tgz (1.5 MB)

(edit: I’m gonna try to put in codepen and hotlink the assets from glitch)
(edit2: Starting on Jan 30th, your Free plan will be limited to 20 sandboxes. ) … I’m gonna try jsfiddle instead…
(edit3: i’m too dumb to figure out how to add a new source file in jsfiddle…)
I’m gonna throw it on a github page…

EDIT4: Here is the github repo hosting the demo as well: GitHub - manthrax/dst-format: a .dst embroidery file format loader for threejs

@Mugen87 @Zahra_Jafarpisheh


Latest Chrome on macOS.

That did the trick! :+1:

1 Like

Looking at the code, couldn’t you use the wide line classes by default? Meaning the classes from webgl_lines_fat?

Wouldn’t this make the quads parameter obsolete since you can process the stitches uniformly?

I use the uvs to map the string texture+normalmap to the quads… and it looks kinda flat/ugly without texture+normal. Do the fatlines support texturing?
I also wouldn’t be able to perturb the normal at the edges of the quads which I was hoping to add to make the threads look more round when rendered, and it would also add another dependency outside of just pure three. I’d also thought of just removing the wireframe mode entirely, since I’ve added the threadWidth parameters… and the main use case for OP was outputting the designs to a texture presumably for some kind of design picker or smth…

1 Like

They have texture coordinates but I have never used them in practice so I can’t tell how well textures map.


Yes, they have, but in an unusual range (keep in mind, this is for every instanced segment): three.js/examples/jsm/lines/LineSegmentsGeometry.js at 534737d242a82239d7e89457ba6005810a361153 · mrdoob/three.js · GitHub

I had to modify line’s material to have UV coords (maybe not what exactly you’re looking for, but as an example): Generative (Fat Lines + texture + Selective Bloom)


Cool! yeah… thanks for the info. I think I’ll stick with quads. It’s working fine and if there’s any performance concern, users can just draw it to a texture and use that… but good info r.e. Line2… I may use it for something in the future. Lines could be nice to get the end cap/mitre, but i feel like it would complicate things a bit and introduce a dependency. Writing out just a quad per line is pretty fast and feels pretty interactive when regenerating. Also the resulting geometry is pretty generic and can be exported to most other formats which might be complicated with lines.

1 Like

Please answer this question
How to load the model in DST format exactly with its original colors
Because this program gives color to the performance manually

DST format does not store the colors anywhere that I could find…

I have a model that I want to give this DST file to the material of one of its meshes, what should I do?

It may be best to provide the DST file here, is the material you’re referencing a seperate material entity / file alongside the DST?

Ps @manthrax that’s awesome work there!! Wondering if you’ve thought about the possibility of using this sort of geometry / mesh as a decal :grimacing::thinking::sweat_smile:?

1 Like