LDraw.org Discussion Forums
LDD2LDraw - a working LDD mesh converter - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html)
+--- Forum: LDraw Editors and Viewers (https://forums.ldraw.org/forum-11.html)
+--- Thread: LDD2LDraw - a working LDD mesh converter (/thread-13071.html)

Pages: 1 2 3


LDD2LDraw - a working LDD mesh converter - Earnest J. Banbury - 2014-05-21

Hi,
based on this brick viewer, I have written a converter, that creates LDraw files from LDD mesh files (*.g).
I've solved the problem of the files with the g1, g2, etc. extensions. These are subparts for a model, that are colored differently or textured. My converter can merge these into a single file.
I've attached an example of a part, that was originally split into two.

If there's enogh interest, I'm willing to upload the sources to Github and create a somewhat user friendly version (currently it's a command line tool.)

Greetings

Banbury


Re: LDD2LDraw - a working LDD mesh converter - Orion Pobursky - 2014-05-21

Looks great. More tools equals better parts so I, for one, would like to see you open the source.


Re: LDD2LDraw - a working LDD mesh converter - Willy Tschager - 2014-05-22

Bring it on! Heer is someone who want's to have a look at a very, very user friendly version.

w.


Re: LDD2LDraw - a working LDD mesh converter - Earnest J. Banbury - 2014-05-22

Here is a sample of the parts I converted so far.


Re: LDD2LDraw - a working LDD mesh converter - Philippe Hurbain - 2014-05-23

Have you looked at the possibility to generate edge lines? 3dxml2dat is able to to that, and generating them only from facet angle difference (as does Edger2) is far from optimal...


Re: LDD2LDraw - a working LDD mesh converter - Earnest J. Banbury - 2014-05-23

I've already discovered Edger2 on my own. The really interesting parts have very high face counts. Creating the lines manually would be prohibitive.
I'm looking into porting the edge creating algorithm to Java for inclusion into my own program. Do you know of a better way to create the lines than Edger does?


Re: LDD2LDraw - a working LDD mesh converter - Philippe Hurbain - 2014-05-23

As explained by Rolf, on each triangle LDD has information about normal at each vertex. If the normals are the same on matching vertices of two triangles, then a condline should be set. If the normals are different, then it's considered a sharp edge (independantly of facet angle) and a normal edge line should be set.
Quote:Creating the lines manually would be prohibitive.
Even using Edger2 automatic generation, there's still a LOT of manual work to do to sort out things between lines and condlines.


Re: LDD2LDraw - a working LDD mesh converter - Earnest J. Banbury - 2014-05-23

Philippe Hurbain Wrote:Even using Edger2 automatic generation, there's still a LOT of manual work to do to sort out things between lines and condlines.
But that's work someone else will have to do. I plan to use these parts in Blender. So I don't need the lines.


Re: LDD2LDraw - a working LDD mesh converter - Earnest J. Banbury - 2014-05-25

With the rather sparse interest in my converter, I have decided to forgo a release for the time being. (It's quite some work to create a release.)
Instead I'm going to convert all the LDD parts, that LDraw is missing. As a first step I have created a list of all LDD parts and (if applicable) their corresponding LDraw name. I have attached the file to this post.
Please note that the list contains some duplicates, since LDD has combined some parts into assemblies. There's an alias column that lists the original part number.
With over 1000 LDD parts to convert, there's no way to manually edit and correct every part. I will convert the files and create the edges with Edger2. I think that's still better than no parts.

PS: If someone wants just the source code, I will zip it and provide a download.


Re: LDD2LDraw - a working LDD mesh converter - Magnus Forsberg - 2014-05-25

Pardon me if I'm being blunt, but the low interest in your converter might come from the fact that what you are doing has allready been done.

Please have a look at Rolf Osterthuns site, digital-bricks.de

What we need is more part authors that are willing to adapt the meshes to Ldraw standards.
Please read this thread

But if you want to convert them all again, as an exercise or learning experience, go ahead.