shutterfreak

LDD export (tweaking ldraw.xml) - new rules

Recommended Posts

Hi all,

I'm trying to export a complex LDD model into LDraw to make meaningful building instructions.

Some of the conversion rules in the ldraw.xml file are incorrect, even from the "unofficial" ldraw.xml file version 4.40.

Here's already one corrected export rule, please feel free to check by means of attached LXF example featuring the part:

<!-- Technic Rotor Blade Small with Axle and Pin Connector End 99012 25 -->
<Brick ldraw="XXXXX.dat" lego="XXXXX" />
<Transformation ldraw="99012.dat" tx="0" ty="-1.1825" tz="0" ax="1" ay="-1" az="1" angle="2.094395102"/>

(You will note that the teal pin should also be rotated 90 degrees along its longitudinal axis to be identically oriented in LDD and in LDraw. But it is not functionally breaking LDraw conversion in LDD.)

I hope this is the proper place to post such instructions.

I am sure that the same transform (except for different translation settings) also applies to a bunch of curved panels and wings, and to linear actuators as well. I'll try to research this later if I have more time.

Best regards,

Olivier

99012_dat example.lxf

Share this post


Link to post
Share on other sites

And here's the correct transformation for the Technic curved 11x3 panel #62531:

<!-- Technic Panel Curved 11 x 3 62531 19 -->
<Transformation ldraw="62531.dat" tx="-0.38" ty="1.62" tz="-3.2" ax="-1" ay="0" az="-1" angle="3.1415926535897932384626433832795" />

In attachment the source file.

62531 example.lxf

Edited by shutterfreak

Share this post


Link to post
Share on other sites

And here's the correct transformation code for the Technic small linear actuators #92693:

 <!-- Technic Linear Actuator Small Body 92694 17 -->
<Brick ldraw="XXXXX.dat" lego="XXXXX" />
<Transformation ldraw="92694.dat" tx="0" ty="0.02" tz="-0.41" ax="0" ay="1" az="0" angle="1.570796327"/>

<!-- Technic Linear Actuator Small Axle Actuator 92695 17 -->
<Brick ldraw="XXXXX.dat" lego="XXXXX" />
<Transformation ldraw="92695.dat" tx="0" ty="0.02" tz="0.8" ax="0" ay="1" az="0" angle="1.570796327"/>

<!-- Technic Linear Actuator Small Pisto 92696 17 -->
<Brick ldraw="XXXXX.dat" lego="XXXXX" />
<Transformation ldraw="92696.dat" tx="0" ty="0.02" tz="6.8" ax="0" ay="1" az="0" angle="1.570796327"/>

In attachment a small sample containing the part.

Part 92693.lxf

Edited by shutterfreak

Share this post


Link to post
Share on other sites

And here's the correct transform code for the fairing panels 21 (#11946) and 22 (#11947):

 <!-- Technic Panel Fairing Smooth 21 Thin Short 11946 19 -->
<Brick ldraw="XXXXX.dat" lego="XXXXX" />
<Transformation ldraw="11946.dat" tx="0" ty="0" tz="0.4" ax="-1" ay="-1" az="1" angle="2.094395102"/>

<!-- Technic Panel Fairing Smooth 22 Thin Short 11947 10 -->
<Brick ldraw="XXXXX.dat" lego="XXXXX" />
<Transformation ldraw="11947.dat" tx="0" ty="0" tz="0.4" ax="-1" ay="1" az="-1" angle="2.094395102"/>

Snippet in attachment.

Parts 11946-7.lxf

Share this post


Link to post
Share on other sites

Last one for this session: Technic beam 1x2 with cross axle and hole (#60483):

<!-- Technic Beam 2 Liftarm with Hole and Axlehole 60483.dat 19 check -->
<Transformation ldraw="60483.dat" tx="0" ty=".40" tz="-0.03" ax="-.57735026918962576450914878050196" ay=".57735026918962576450914878050196" az=".57735026918962576450914878050196" angle="2.0943951023931954923084289221863" />

Sample in attachment so you can test.

Part 60483.lxf

Share this post


Link to post
Share on other sites

Here's yet another one: Technic Transmission Changeover Catch (#6641):

<!-- Technic Transmission Changeover Catch 6641.dat 21 -->
<Transformation ldraw="6641.dat" tx="0" ty="-.01" tz="-0.245" ax="1" ay="1" az="0" angle="3.141593"/>

Sample attached.

Part_6641.lxf

Share this post


Link to post
Share on other sites

This one was simply missing so the part didn't show up in converted models:

<!-- 15462 - Transform added by Olivier Biot -->
<!-- Technic Axle 5 with Stop 15462.dat -->
<Brick ldraw="XXXXX.dat" lego="XXXXX" />
<Transformation ldraw="15462.dat" tx="-2.0" ty=".02" tz="0" ax="0" ay="1" az="0" angle="4.712389"/>

Small LDD file in attachment.

15462.lxf

Share this post


Link to post
Share on other sites

Hmmm maybe you could complete it all and we shall bow in your presence :) I've been hoping it got finished as I want to convert MoCs to Ldraw and then onto various 3d programs but I don't have the knowledge to do it (the ldraw.xml that is)

Share this post


Link to post
Share on other sites

@shutterfreak

A question. Did you modify the original ldraw.xml file or you started working from the Mike's (gallaghersart) file?

If you miss it, read this (quite old) topic as reference.

EDIT: reading the first post I've seen you started from Mike's file.

Did you try to contact him to update the file in order to provide a single up-to-date solution?

Edited by Calabar

Share this post


Link to post
Share on other sites

Here another one that was missing:

<!--  15462 - Transform added by Olivier Biot -->    
<!-- Technic Panel  1 x  3 x 11 15462  -->
<!-- FYI - Technic Panel  1 x  5 x 11 64782: Transformation ldraw="64782.dat" tx="2.4" ty="0" tz="-2" ax="0" ay="1" az="0" angle="3.141593"/ -->
<Transformation ldraw="15458.dat" tx="2.4" ty="0" tz="-1.2" ax="0" ay="1" az="0" angle="3.141593"/>

Share this post


Link to post
Share on other sites

@shutterfreak

A question. Did you modify the original ldraw.xml file or you started working from the Mike's (gallaghersart) file?

If you miss it, read this (quite old) topic as reference.

EDIT: reading the first post I've seen you started from Mike's file.

Did you try to contact him to update the file in order to provide a single up-to-date solution?

I'm unsure where the data should be provided hence I started a thread here.

Share this post


Link to post
Share on other sites

Mike provided a modified ldraw.xml file, where he inserted the missing and fixed the incorrect transformations.

Take a look at his website (linked above) as reference.

Once the ldraw.xml file is updated, other users simply have to place it in the proper LDD directory and export using the built-in function.

This is the better way to reach as much user as possible.

Edited by Calabar

Share this post


Link to post
Share on other sites

Mike provided a modified ldraw.xml file, where he inserted the missing and fixed the incorrect transformations.

Take a look at his website (linked above) as reference.

Once the ldraw.xml file is updated, other users simply have to place it in the proper LDD directory and export using the built-in function.

This is the better way to reach as much user as possible.

That's where I started from.

However there's no place mentioned where fixes for incorrect / missing transforms could be shared...

By the way, I have some difficulty re-creating the Power Functions 9V battery box.

Apparently LDD creates the box from 2 building blocks, the box with both battery lids but without switch (design ID 59510), and the switch (design ID 59165).

However, LDraw uses 4 parts: the body without lids and switch (919.dat), two lids (918.dat) and the switch (920.dat).

So Lego design 59165 (switch) can be mapped to "920.dat", but I don't know yet how to map Lego design "59510" to the assembly "919.dat" + 2 x "918.dat".

How should I do this?

Share this post


Link to post
Share on other sites

Here's the transform for positioning the PF battery box switch:

<!-- LPV 9V battery box 4 x 11 x 7 switch - 920.dat -->
<Brick ldraw="920.dat" lego="59165" />
<Transformation ldraw="920.dat" tx="0.4" ty="0.4" tz="0.02" ax="0" ay="1" az="0" angle="1.570796"/>

Still need to figure out how to assemble the body and the 2 covers as one element as a replacement for Lego design ID 59510...

Probably a similar approach needs to be followed to re-create the M motor by means of 59142.dat and 59143.dat.

Edited by shutterfreak

Share this post


Link to post
Share on other sites
However there's no place mentioned where fixes for incorrect / missing transforms could be shared...

I think there are two things you can do:

The first is try to contact gallaghersart and offer your collaboration to improve the ldraw.xml file that he shares on his website.

If you can't contact him, you could simply edit the ldraw.xml file and share the updated version in this topic. At this aim you can use the firts post of this topic to attach the last version of the file and list the impovements (editing the post each time you update the file), and maybe create a new post to explain every change in details (as you are doing now).

About the Battery Box, I can't help now.

Edited by Calabar

Share this post


Link to post
Share on other sites

Here's the LPF M motor transform code:

<!-- LPF M Motor - 58120.dat -->
<Brick ldraw="58120.dat" lego="59143" />
<Transformation ldraw="58120.dat" tx="0.4" ty="-1.18" tz="-0.4" ax="0" ay="1" az="0" angle="1.570796"/>

I still need to correct the transformation of the "power brick".

Share this post


Link to post
Share on other sites

PF 9V Power brick:

<!--  Electric Power Functions Connector Top (Needs Work) 58124 18 -->
<Brick ldraw="XXXXX.dat" lego="XXXXX" />
<Transformation ldraw="58124.dat" tx="-0.4" ty="-0.64" tz="-0.4" ax="0" ay="1" az="0" angle="3.141593"/>

PF 9V (6xAA) Battery box:

<!-- LPF 9V battery box 4 x 11 x 7 body - 919.dat -->
<Brick ldraw="919.dat" lego="59510" />
<Transformation ldraw="919.dat" tx="-4.4" ty="-1.6" tz="0.8" ax="0" ay="1" az="0" angle="0"/>

Share this post


Link to post
Share on other sites

Technic red transmission ring (#6539):

<!--  Technic Transmission Red Driving Ring 6539.dat 21  -->
<Transformation ldraw="6539.dat" tx="0" ty="0" tz="-0.8" ax="1" ay="0" az="0" angle="1.57079"/>

Share this post


Link to post
Share on other sites

Plate 2x2 with one pin hole to the side:

<!-- Plate, Modified 2 x 2 with Pin Hole - Full Cross Support Underneath 10247 10 ?? -->
<Brick ldraw="XXXXX.dat" lego="XXXXX" />
<Transformation ldraw="10247.dat" tx="-0.4" ty="-0.32" tz="-0.4" ax="0" ay="1" az="0" angle="-1.570796327"/>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.