Freshly updated Ldraw.xml


Re: Freshly updated Ldraw.xml
#26
Hello all,

I've been tinkering with this file on and off since 2007. Great to see a renewed interest in making it better.

I don't think it is possible to "crack" the code and make a tool that can simply translate the values. Each pair of Ldraw-LDD parts seams to have it own set of values.


How to add a new part?

This is an empty example, and a good start.
Code:
<!-- description text-->
<Brick ldraw="XXXXX.dat" lego="YYYYY" />
<Transformation ldraw="XXXXX.dat" tx="0" ty="0" tz="0" ax="0" ay="1" az="0" angle="0"/>

Only one line, the third, is really needed if the partnumbers are identical between Ldraw and LDD.


First line is simply a text string, most often the Ldraw description. Mike Gallagher used to add some more info. I would love to see both the Ldraw description and the LDD equivalent. After all, it is a translation file.

Second line is necessary if there is a difference in partnumbers between Ldraw and LDD. It makes the connection between them. If we decide to renumber a Ldraw part, e.g by adding a suffix to the partnumber and/or create a moved to-file, the ldraw.xml needs to be updated aswell.

Third line is the translation code.
tx, ty and tz moves the part in steps. 0.04 units in ldd = 1 ldu.
We have the origin in the middle of the brick. LDD have the origin in the first stud. Or somewere else.
The x-axis is inversed.

Philo Wrote:ax, ay and az define the direction of the vector around which the rotation is to be performed. Angle of the rotation is expressed in radian (angle in radian = angle in degrees * Pi / 180)
Any a-value between 0 and +/-1 is possible.
90 degrees = 1.570796
180 degrees = 3.141592
More than one rotation direction is possible in the same translation, but only one angle.


These simple rules are most often enough to make a new part work.
Some parts are more difficult to translate. Angled Technic Beams or Panels are really tricky, since they often have very different origin and position in LDD and Ldraw.

The translation code also seem to evolve over time. The current translation code for part 30377 is today very different from the one I originally made and sent to Mike Gallagher. I have a feeling that the LDD-team have adapted some of there parts to our coordinate system.

I'm no programmer, nor good at math, so please don't expect me to explain/understand any of these math-rules.
I'm just good at finding patterns and making analyzes.

Attached here is a document I made back then and an excel-sheet with some simple tools I've used.


Attached Files
.pdf   A more correct ldraw.xml is possible.pdf (Size: 170.97 KB / Downloads: 3)
.txt   omvandlingsfaktor.xls.txt (Size: 58 KB / Downloads: 2)
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Re: Freshly updated Ldraw.xml - by Jarema - 2015-09-30, 20:21
Re: Freshly updated Ldraw.xml - by Jarema - 2015-10-01, 18:36
Re: Freshly updated Ldraw.xml - by Jarema - 2015-09-30, 21:29
put ldraw.xml to github? - by Steffen - 2015-10-03, 11:31
Re: Freshly updated Ldraw.xml - by Magnus Forsberg - 2015-10-13, 20:41

Forum Jump:


Users browsing this thread: 1 Guest(s)