LDConfig.ldr - New syntax

From LDraw.org

Jump to: navigation, search

This page list ideas and proposals for additional syntax.

Contents

Names v. Index

(Joshua)

I would actually like to see a new syntax defined where the color name was used instead of an index. Something like:

1 TLG_BLACK 3747b.dat

(which would actually might turn more into:)

include ("3747b.dat", TLG_BLACK) or maybe submodel ("3747b.dat", TLG_BLACK)

The beauty of such a syntax is that it could EASILY be parsed/"compiled" into "raw" and current LDRAW syntax, for backwards compatibility with existing tools, if needed.

In the end, the user should be seeing color names (and names she or he prefers to use, no matter how "wacky") in the UI of an app, and the underlying color ID shouldn't really be a visible concern.

There would be a "compiler" that would take this new syntax (benefit of matrix numbers and much easier for humans to parse and use) and turn it into existing syntax. So it would take a command that asked for a submodel in red, and turn it into a 1 4 ... line. This would allow the new use, making parts and models much easier to specify, compatible with existing technologies. And it would be set to turn TLG_bright_red and red and RED and whatever else you wanted, into the existing ldraw index for red.

[NOTE from Joshua: This is actually part of a much larger syntax plan that I have been working on offline. It would involve a rewrite of the LDRAW "language", where the current syntax would be the lower-level "assembly language" version of the code, and the higher-level language would be a more textual language that looks more procedural, where parts and models are defined relative to one another without a lot of hard-coded numbers. A "compiler" would take this new language and output the existing syntax. The language would allow for features such as connection points, automatic mirroring of subparts, possibly extrusion and other advanced solids definitions that would be "realized" by the compiler into hard-coded values as exist in the current part and model files. The mention here simply talks about how the language would affect color values]

(Scott)

Localization of Color Names as different files: LDconfig_TLG.ldr, LDconfig_Ita.ldr, LDconfig_esp.ldr


Additional columns

(Scott)

I'd like to see three more columns added:

  • Color Value 2 (for speckle, glitter, and dithered colors)
  • Alpha 1 (a value of how much light is reflected and how much is absorbed or passed through)
  • Alpha 2 (to allow transparency of colors)

This is the way that MLCAD renders colors and is a much more powerful system than just a single color value and a flag indicating that a part should be transparent.

Speckle (response to Color Value 2)

(Joshua)

Following existing syntax, it would be likely best expressed as a new "SPECKLE" or "DIFFUSE" option (with a standard color parameter). GLITTER would make a great option too, also taking a color specification as a parameter.

Dithering (response to Color Value 2)

(Joshua)

I'm not sure about dithered. You'd want and need one for the new "in-mould" mixed colors. That one's a lot trickier. There need to be some variables specified that describe how to randomize the two colors in the right way to simulate the horizontal or vertical layers they do the colors in. I sense parameters such as TURBIDITY popping up for those.

Here are some references if what I was just referring to seems foreign:

http://www.peeron.com/inv/parts/6082cx1
http://www.peeron.com/inv/parts/6083px1
http://www.peeron.com/inv/parts/47847px1
http://www.peeron.com/inv/parts/47847px2
http://www.peeron.com/inv/parts/47847px3

These things are becoming surprising common, since 2005.

Version

(Joshua)

The spec should maybe include a global command for specifying whether the .ldr is STRICT or not; and should also include some sort of VERSION command.

Useful links

LDraw.org Colour Definition Language Extension: http://www.ldraw.org/Article299.html

Wikipedia Cheatsheet: http://en.wikipedia.org/wiki/Wikipedia:Cheatsheet
Wikipedia Help Table: http://en.wikipedia.org/wiki/Help:Table

Personal tools