3dxml2dat


3dxml2dat
#1
Hey,

some time ago Philo described a method to convert LDD parts into LDraw parts (http://news.lugnet.com/cad/?n=17697). In the <VertexBuffer> section, Philo referred to, there is next to the <Positions> tag also a <Normals> tag. With these normals there is a calculable way to differ between normal lines (linetype 2) and optional lines (linetype 5).

I wrote a small console application based on .NET 3.5 that can make these calculations. The application is kind of simple and silly; but if you play it right it might help you a lot: you have to add the desired part in the LDD without rotating the view. Than take the 3D screenshot and extract the 3dxml file out of the 3dxml archive. Open the 3dxml file and search for the <VertexBuffer> section. Copy the <Positions> and <Normals> line into a new textfile and save it (e.g. file.txt). Call the new console application with the new file as argument and you will get an LDraw part with lines and optional lines.

Please remember: "Getting the shape is only the tip of the iceberg!". This tool is ment to help part authors to create parts. Please make them LDraw parts first before you add them to the parts tracker.

You can download the tool at http://digital-bricks.de/download/3dxml2dat.zip
The application can be downloaded as it is. I do not take charge for errors or any kind of damage to your system that is caused by this tool.

There are a few options you can play with:
Code:
Usage: 3dxml2dat.exe [Options] <inputFileName>

Options:
  [-scale <value>]: scale the mesh with factor <value> (default is 25)
  [-out <outputFileName>]: write the result in <outputFileName> (default is <inputFileName>.dat)
  [-optionalLines <true|false>]: draw optional lines (default is <true> )
  [-normals <true|false>]: draw normals (default is <false> )
  [-ymin <value>]: the lowest y will be at <value>

Rolf
Reply
Re: 3dxml2dat
#2
I like this tool) But one question. If I delete some triangles, how automatically delete edges and condlines?
Reply
Re: 3dxml2dat
#3
Is this tool maybe also worth to be supported by LETGui for easier handling?

Just let me know your thoughts about this. If it is useful I would happily add it to LETGui.
Reply
Re: 3dxml2dat
#4
Well, I think it is no longer appropriate, to search for special lines in a text file and copy them into another text file only to send them through a converter. The burden is disproportionate. I have implemented a new version of the 3dxml2dat application. It is still a console application but this time it can handle the 3dxml files themselves, packed as well as unpacked.

The application has been designed to work with 3D screen prints (3dxml files) that were taken from the LDD using the program Dassault Systems 3DVIA Screenprint. It translates all the 3D data that it finds inside the 3dxml file into LDraw compatible data. On the one hand this means that there may be several parts in the source that will be transferred all, but on the other hand that the plane for the base grid will be transferred as well.

This new version of the application is also able to extract the images from the 3dxml files. They are stored in Truevisions TGA file format.

There are still some options you can experiment with:
Code:
Usage: 3dxml2dat.exe [Options] <inputFileName>
Options:
  [-scale <value>]: scale the mesh with factor <value> (default is 25)
  [-out <outputFileName>]: write the result in <outputFileName> (default is <inputFileName>.dat)
  [-optionalLines <true|false>]: draw optional lines (default is <true>)
  [-normals <true|false>]: draw normals (default is <false>)
  [-images <true|false>]: extract the contained images (default is <false>)

You can download the application at http://www.digital-bricks.de/download/3d....0.634.zip. The application can be downloaded as it is. I do not take charge for errors or any kind of damage to your system that is caused by this tool.

Rolf
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 1 Guest(s)