LDraw.org Discussion Forums

Full Version: OMR + TEXMAPped unofficial file = ???
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
OMR specification requires to include unofficial files (a very good thing!), but what to do when this unofficial part contains TEXMAP images? Can we imagine a way to include these images in MPD? How to make this compatible with applications that support TEXMAP (afaik LDView, LDCad, LeoCAD and Bricksmith)?

And a 2016 good new year's resolution: have TEXMAP images on Parts Tracker !
This is a very good question.

At present I only can think about a file entry for the picture also! I think that the spec for MPD files already allows this. The only problem we need to solve is that the reader apps needs to be aware of that and can handle it.

just my 5 cent
Yes, one of my aims too.
Michael Heidemann Wrote:At present I only can think about a file entry for the picture also! I think that the spec for MPD files already allows this. The only problem we need to solve is that the reader apps needs to be aware of that and can handle it.
This would need multiple things...

1. Binairy encoding (in order to keep the mpd text based)
2. A new meta to encapsulate said data in one or multiple lines (e.g. 0 !BINDATA FJSJ2321ssdKSKL3LKdDLJSLsdaKFDJL3432LKJ21LJLSJLD.............)
3. A new mpd '0 FILE' variant to identify the subfile as a texture (e.g. 0 !BINFILE TEXMAP image.png)
4. Adjustment to the texture image lookup rules.

All this means it won't work in existing texmap supporting programs out of the box, but it won't break existing mpd support ether.
a solution for embedding images into MPDs could be to use the Data URI scheme:
https://en.wikipedia.org/wiki/Data_URI_scheme
This has the advantage of
- it provides a MIME type
- it allows to use charset UTF-8
- it is text-based
- it is an already established standard (we don't have to re-invent the wheel)

For example, a small image of a red dot could be represented inside an MPD like this:
Code:
0 FILE reddot.png
0 red dot
0 Name: reddot.png
0 Author: Wikipedia
0 !DATA data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==
That sounds good. But why do we need the line "Name: xxxx" and also the line above?

If the line "0 File xxxxx" contain a name with the extension ".png" then it has to be a picture with that name!

We should keep it as simple as possible.
Yes, of course. The example above results from saving a dummy MPD file with MLCad and then just adding the !DATA line.
Please add a simple file with picture to this thread that make use of TEXMAP. So we are able to let our thoughts flow Smile
Exemple of a TEXMAPped part: http://www.ldraw.org/cgi-bin/ptdetail.cg...13710a.dat
Texture file attached here
[attachment=1926]
Thank you.

Now I need to find a way to transform the picture in Visual Basic Smile
Got it!

The DATA according to Firefox is like follows:

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlsAAAEFCAYAAADUqSJrAAAgAElEQVR4nOydd3CbVbr/c3937sydO3fuX3tnduYSYAGnhxBKElpCCQkJsIQaOlkgENgQCKEmWUIglARCKIHNEkKsYtmyLNlqli2523LvluTee3vVe/n+/nhjxYokW7Ily07OZ+aZBenV+57zSvj97DnPec4iEAiEsLDb7dBoNMiUZ4CTmIB4xnnEM86DxWZCKEpDkbIQmkYNRkZG4HK5Yt1cAoFAIMSYRbFuAIGwUPB4PGhQNSCBw.......

Sadly the code is too long for the forum.
Pages: 1 2 3 4