nilsschmidt1337 / ldparteditor

The LDraw™ Part Editor. Create and edit LDraw™ Parts quick and easy.
http://nilsschmidt1337.github.io/ldparteditor/
MIT License
43 stars 8 forks source link

As a user I want to use the !DATA meta command. #980

Closed nilsschmidt1337 closed 1 year ago

nilsschmidt1337 commented 1 year ago

Syntax:

!DATA
Format: 0 !DATA <filename>
Where:
<filename> is the filename of the following encoded data.

Blocks starting with the 0 !DATA statement contain binary data encoded using a multitude of 0 !: lines.
Each of those lines contain a chunk of base64 encoded data which a parser must combine before decoding. 
No other LDraw statements may be used inside a !DATA block.

PNG-Standard: https://en.wikipedia.org/wiki/PNG Base-64-Standard: https://datatracker.ietf.org/doc/html/rfc4648#section-4

Example:

0 Testcase
0 Name: new.dat
0 Author: Nils Schmidt [BlackBrick89]
0 !LDRAW_ORG Unofficial_Part
0 !LICENSE Licensed under CC BY 2.0 and CC BY 4.0 : see CAreadme.txt

0 BFC CERTIFY CCW

0 !DATA sticker.png
0 !: iVBORw0KGgoAAAANSUhEUgAAAFAAAAB4CAIAAADqjOKhAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
0 !: jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEUSURBVHhe7du9DcIwFABhk5WgQLSsQM0UjMEU
0 !: 1BQsQIsoYAt6NkAYxQV/JQ7WvfuKkFTR6UmOFJzR9bJLkXTlNwyD6QymM5ju5Tl8m67KGUt3XJcz
0 !: J/yY8HZ/6C8BFvNZPoaesMF0BtMZTGcwncF0BtMZTGcwncF0BtMZTGcwnf8t0bmLh85gOoPpDKYz
0 !: mM5gOoPpDKYzmM5gunDBf3tN+/zqNKt367cbOeGUTstxf1nJZHPOx68T/u3XB5/7/zMXLTqD6Qym
0 !: M5jOYDqD6QymM5jOYDqD6QymM5jOYDqD6QymM5jOYLpwwW3t8ajBXTxtTHgwLlp0BtMZTGcwncF0
0 !: BtMZTNfKZzyDiT3hCFy06IIFp3QH/CBMh66aBy4AAAAASUVORK5CYII=

0 !TEXMAP START PLANAR 0 0 0 10 0 0 0 10 0 sticker.png
0 !: 4 16 0 0 0 10 0 0 10 10 0 0 10 0
0 !TEXMAP FALLBACK
4 16 0 0 0 10 0 0 10 10 0 0 10 0
0 !TEXMAP END
nilsschmidt1337 commented 1 year ago

Closed with commit fe40235.