Sometimes one gets an STL file that has multiple parts in it, and one would like to extract the parts separately (e.g., recently, I wanted to extract a single link from someone's chainmail STL). One could use Meshmixer or something like that, but a simpler solution would be nicer.
I made a simple javascript page that does that. You just select a file, and then you can download the parts separately (or a combination of a subset of parts). The javascript runs all in your browser: nothing is uploaded to a server.
Running the splitter on a rendering of "STL Split" yields nine parts, one for each letter other than the "i", and two for the "i".
Usage note:
Currently, this will fail in a funny way if your object has an inner surface completely contained within an outer surface, namely a hole completely surrounded by material. The split will result in two meshes, one for the outer surface and an inside-out mesh for the hole. I haven't figured out how to fix this yet. For now, you can handle it manually by combining the outside and inside mesh parts.
Technical notes:
Source code is here. MIT licensed.
The output is binary STL. The input can be either binary or ASCII STL. If you use binary STL as input, the code is guaranteed not to introduce any new round-off errors--the original 32-bit float coordinates are completely unchanged.
The javascript is sensitive to errors in the STL (e.g., points very close together count as separated).
If you want less sensitivity, I have a much slower python script here that lets you specify a tolerance.
Currently, color is not supported, but it would be easy to add that.
The demo image uses this library.
split2.stl | 83.6KB |