8 ms·
I wouldn't call 3MF great. The format is text based. This means if you have 1GB model, you gonna have to print 1GB of float numbers when saving the model, and p
by Const-me 5y ago
I wouldn't call 3MF great. The format is text based. This means if you have 1GB model, you gonna have to print 1GB of float numbers when saving the model, and parse 1GB of float numbers when loading.
Text formats are good when human readable, but no sane person gonna read 1GB of data. Not even 100MB. Both numbers are reasonable now for very high-poly models.
They should have designed a true binary format, instead of zipped XML. Speaking of the STL format, it can be either binary or text depending on the header. When they have measured size, pretty sure they have used text variant of STL, otherwise they'd get similar sizes.
Also, the format is rather complex. One of the reasons why STL is so popular, only needs couple pages of code to support, almost regardless on the programming language. For optimal compatibility, one needs the official C++ only lib3mf library to read/write 3MF files.
- deugtniet 5y agoI think 3MF has some real practical benefits as outlined in the article. It may take a lot of file space, but that can be solved in a new version, specified in the header files, in the same way it was done with STL. As with any format, the tooling needs to develop, and then C++ is not a bad idea to write a library in I think. I guess there's space for both file formats tbh. If you are sure your STL is correct, and are sure about the dimensioning, go for it. If you want to be a little safer, go for 3MF, with the drawback of a little larger filesize.
- Const-me 5y ago> that can be solved in a new version Yeah, if in a next version they will move vertex/index buffer data from XML into binary files in the same ZIP (3MF are ZIP files), will be better already. Printing and parsing numbers is surprisingly expensive when you have a gigabyte of them. > C++ is not a bad idea to write a library C++ is fine by itself. Still, should the format be simpler, the official library would be optional, as people would be able to implement support in any language without FFI. It’s hard to do in practice, which leaves the official library as the only practical option, IMO. At least that’s what I did when a client asked me to support that format.
- numpad0 5y agoI don't get why a new polygon data format is needed at all. Sculpted models are always on polygons, and that's good, but almost as much bulk of 3D models are CAD models "rasterized" into triangle polygons and that's just pain. Aside from patents and/or rights reasons, why can't we just pass around CAD data to feed CNC machines?
- Const-me 5y agoSome parts of the 3MF are actually good. I like the spec documents winding order of the meshes. The format includes units, and these optional 4x4 transformation matrices — both are useful. As for need of the new formats, for one, modern CAD formats are insanely complex. These IGES/STEP/BREP files require many megabytes of very complicated code to deal with, such as this library https://github.com/tpaviot/oce https://github.com/tpaviot/oce These formats may even contain proprietary extensions. Also, they need non-trivial processing power to handle. Many people wouldn’t want a Core i7 with gigabytes of RAM in their 3D printers, inflates hardware cost and software complexity. Besides, we now have high-resolution 3D scanners, and CAE software which algorithmically optimizes models by running numerical simulations. They both output triangle meshes instead of CAD files. Scanners often output point clouds one can convert into triangles, but hard to convert into CAD formats. I just don’t like the 3MF implementation too much. XML is fine for kilobytes of data, but not many megabytes. If I would be designing that format, I would probably made it binary. Maybe EBML https://en.wikipedia.org/wiki/Extensible_Binary_Meta_Language https://en.wikipedia.org/wiki/Extensible_Binary_Meta_Languag... would work for that; it does fine for MKV videos, which is also a huge pile of structured data with non-trivial performance constraints for producers and especially parsers. Another minor thing, it was not the best idea to make name start with a digit. Most programming languages forbid identifiers like that for their classes / functions / namespaces / modules.
- mch82 5y agoThere are a few goals for 3MF. One is to have a common format that is portable across tools made by the big companies participating in the consortium. Another is support for specifying material in addition to shape. STL can represent a part, but can’t distinguish it as a specific metal or plastic. STL also can’t specify color. Those properties can be used in engineering software to simplify analysis and visualization. 3MF also supports multiple parts, which is useful in a multi-material build. For example, when a dentist 3D prints a mouth model they might use white for the teeth, red for the jaws, and a removable support material. With STL each of those sub-models would be a separate file, meaning the 3D printer operator would need to properly position them and choose appropriate materials at build time.
- formerly_proven 5y agohttps://en.wikipedia.org/wiki/3D_Manufacturing_Format#Sample_file https://en.wikipedia.org/wiki/3D_Manufacturing_Format#Sample... It's not the dumbest engineering data format I've seen (seen many, this is at least one you can parse). But ffs, just use HDF5 people.
- Const-me 5y ago> It's not the dumbest engineering data format I've seen It’s not, but should the models be binary, the format would be much better. > just use HDF5 Last time I checked (a few years ago), HDF5 was only possible to handle with the official C++ library. That library didn’t even support multithreading, when I tried to write 2 HDF5 files from 2 concurrent thread, the program crashed with broken data structures in some global variables deep inside the HDF5 library. My computer has 16 hardware threads, the servers I’m targeting often have more of them, and I’d like to actually use that hardware. Single-threaded libraries aren’t OK in my books; not in 2021.
- formerly_proven 5y agoHDF5 supports parallel I/O with MPI, which works fine for HPC applications, but I can see how this might be a reason against HDF5.
- deleted 5y ago[deleted]
- ggrrhh_ta 5y agoIt's a pity, also, some other limitations (for example with strings in HDF5 files, etc.). The format itself is to me, the closest to "the ultimate format", however, yes, library/tools support is a bit disappointing and it is sad. I came here to say that 3MF can be serialized into HDF5 - keeping the advantages of both, the textual description (which is much much more futureproof when one looks 10/15/20 years in the future) while having a one-to-one fast access counterpart.
- Const-me 5y ago
- ggrrhh_ta 5y agoI know that it is counterintuitive, but storing doubles in binary format can take (for many use cases) much more space than storing the text. Each double, uncompressed is 8 bytes, 3.2e-3 is only 6 bytes, a 1 digit integer is 1 byte, a 5 digit integer is 3 bytes less than the double to store it... Also, when humans enter data in some specific units they want to see the same number back (and not a rounded -in binary- version of it, although very good algorithms exist to that end). Text compression of number data is extremely efficient. Having cross-platform binary formats is complex and binary formats go stale much sooner. Having humans peek at the file in text mode and debut or use simple command line tools with copied and pasted data is also useful for exploration purposes. The best of both worlds is to have a text representation coupled with one-to-one binary encoding; but as I pointed out, many times, the binary format actually takes, unintuitively, more space...
- Const-me 5y ago> much more space than storing the text In other cases it’s the opposite. Convert a model from millimeters to inches, and that 1.0/25.4 multiplier gonna cause decimal representation to be much longer than 8 digits. Mechanical engineers are doing things like that pretty often. > when humans enter data in some specific units I don’t think it’s a reasonable expectation for a human to type 100 MB, or 1GB of numbers. People do work with triangle meshes that large. These models were made by specialized hardware or software tools, not by entering numbers. It’s the same story with images: they have too many megapixels now, and people aren’t entering millions of RGB numbers. Instead, people using scanners, digital cameras, and Photoshop to deal with these volumes of data. > Text compression of number data is extremely efficient The most expensive part is not compression, it’s printing and parsing. That code is very hard to vectorize or parallelize. When software reads or writes large continuous buffer of binary data like std::vector in C++, the throughput is often limited by physical disk. On many modern computers that’s at least 100 MBytes/sec, often much faster. I think it’s borderline impossible to print or parse float numbers that fast. Especially given that in 3MF, there’s some XML producer/parser down the stack who needs to escape/unescape these strings.
- willis936 5y ago
- threatripper 5y agoReading those numbers is only a minor part compared to processing the data in the slicer. While you are right, that a better format could be imagined I would call it a minor or even non-issue. After compressing the file sizes should not be so much different as the raw data suggests. > Text formats are good when human readable, but no sane person gonna read 1GB of data. People are regularly editing the resulting G-Code file which is even bigger in size. They use old fashioned text editors for this which works because it's not binary but simple text with readable numbers. Then those huge files are processed with little 8-Bit computers which have barely enough processing power to move the motors.
- ddingus 5y agoAll true! Some common edits are: Change in process parameters mid program, speed / feed rate tweaks to optimize production jobs, tool number change to run job on different machine / tool setup. Big G-code files are my favorite text editor test.
- ddingus 5y agoPersonally, I much prefer text for manufacturing data. File size isn't a big deal for the intended use cases and that file contains setup information anyone can read and make use of. That's actually worth the format tradeoffs right there. G-code generated from these files often contains that info, and some additional info specific to the job created. Same benefits of plain text. Often, I get these files and that information being available, easy to read without having to have specific software is a huge win. Humans do read these files :D