I am preparing a new version of QLMesh with LDraw models support. Except the size of the models library I had to embed into the executable, the conversion process is quite fast event for large models, as you see on attached pictures. Nice thing is, that I was able to integrate it nicely with Open Asset Library, so the final result is quite consistent.
One of the main goal for QLMesh was to add some new formats I have been working with quite often, like Photoshop files of bdf fonts.
For 3D it is LDraw formats and DAZ Studio models.
LDraw is one of my favourite. I am currently working on extending Assimp to support .ldr and .mpd files. One of the major challenge is actually not drawing but embedding library definitions into the plugin. Original library it is about 250MB (compressed to ~40MB). That's quite large for Quicklook plugin. I started to work on some heavy compression/optimalization and current result is:
-rw-r--r-- 1 piecuchp staff 40M May 12 17:18 parts.db
-rw-r--r-- 1 piecuchp staff 2.2M May 12 17:18 parts.db.gz
That's much better. 2MB can be easily embedded into plugin, eg. using assembler module like this:
_ldrawlib: incbin "parts.db.gz"
_ldrawlib_size: dd $-_ldrawlib
and later build with e.g. nasm:
/opt/local/bin/nasm -fmacho64 ldraw_lib.asm -o ldraw_lib.o
Sometimes less is more. Working on reading gzip stream, I had to remove one of the compression optimisation. The uncompressed file is slightly bigger, but compressed one much smaller:
-rw-r--r-- 1 piecuchp staff 41M Jun 17 12:03 parts.db
-rw-r--r-- 1 piecuchp staff 1.5M Jun 17 12:03 parts.db.gz
Sadly, this is not the end of the story I had to increase the precision of the float numbers in the database (it is now 17 bits - sign:8bit:8bit) - it increased the size but also significantly affected the compression ratio:
-rw-r--r-- 1 piecuchp staff 67M Jul 11 08:55 parts.db
-rw-r--r-- 1 piecuchp staff 41M Jul 11 08:55 parts.db.gz
Seems like I am gonna have to live with such database for a while.
I have prepared another update to QLMesh: ver. 2.1 add performance improvements (plugin is better handling big bitmaps), major update of Open Asset Library and support for new format: Photoshop Patterns (PAT) files - both RGB and CMYK formats are supported. New version is also build against OSX SDK 10.13, since I have finally updated my MacBook to Sierra.
For QLMesh (and some other projects), I am running my own fork of Asset Import Library. The difference: it is amalgamated build - all sources are merged into one file (including dependencies). Since Assimp recently switched to miniz, I have replaced remaining references to zlib with miniz - so zlib is not required too.
drwxr-xr-x 85 piecuchp staff 2890 Jan 17 23:34 assimp
-rw-r--r-- 1 piecuchp staff 4921627 Jan 17 23:34 assimp.cpp
-rw-r--r-- 1 piecuchp staff 2893785 Jan 17 23:34 private\assimp.h
Everything you need to buid the assimp is:
g++ -c -std=c++11 code-portable/assimp.cpp
or just add assimp.cpp to your project/IDE (you can find code-portable directory in my repo.
One disclaimer: I have only tested this amalgamation under OSX with QLMesh). Main reason for this amalgamation is that it makes compilation/recompilation on different platforms with different configurations rather easier.
Side-effect is that single-file assimp.cpp compiles really fast (like 10x faster on my MacBook than original project files).
I am quite happy I finally had time to release a new version of QLMesh. With multitude of 3d files on my disk, having such a quick tool is always nice welcome.
But also relaying on built-in OSX 3d generator (for .obj and .collada) made the whole code simpler and cleaner - previous version had a lot of code that suppose to work only in non-sandboxed environment (like texture support in 3d view). But after AppStore release most of this code was not in use.
Now what would be good to have is finally support for Daz3D models and formats and my long-lasting missing feature: LDraw format support.