convert multiple files from .LWO to .OBJ or similar - stl

I need to convert many files from .lwo format to .obj or .stl. I have too many to convert "by hand", meaning I don't want to use online tools or import/export the files one by one in Blender or similar.
So I'm trying to do so with a program that would load up each file, convert, then save a new stl . The files are numbered "file000001", "file000002", etc. to make importing easier.
Is there any program out there that will do this? If not, how would I go about accomplishing my goal?
As far as languages go, I am most effective with Processing/Java. I found this which might be similar but doesn't relate to LWOs.
Thanks for any help.

I just found assimp which has a command line tool to convert different file types. Thanks everyone who answered!

I'm sure you can find a few editors that import .lwo and export .obj
For example, Wings3D does that and free/opensource/lightweight.
Wings is scriptable using erlang.
Blender has LWO importer too, but it's not enabled by default. you need to go to Preferences > Addons and enable it there:
Blender has a Python API which should be easy to pickup.
This would allow you to write a script that does a batch conversion (reads a directory, traverses files, imports .lwo, transforms (scales/rotates if needed), exports .obj)
Perhaps if you search enough maybe there is a 3d file format batch converter already out there and .lwo/.obj are old enough formats so might be likely to be supported.
If you want to implement something from scratch, you need to look into each file format (e.g. lightwave object, obj ) to be able to parse and export.
Hopefully there's a java library that for you. I'd start with a 3D java game engine. For example here's a java .LWO importer found via JMonkey.

Related

CSV to JSON benchmarks

I'm working on a project that uses parallel methods to convert text from one form to another. We're going to implement a CSV to JSON converter to demonstrate the speedups that are possible using our parallel framework.
We want to benchmark our converter once it's finished. What are the fastest libraries/stand-alone programs/etc out there that are capable of doing CSV-JSON conversion? I found a list of potential candidates here:Large CSV to JSON/Object in Node.js, but I'm not sure how fast the listed options are. In the worst case I'll benchmark them myself, but if someone already knows what the "best in class" converters are it'd save me some time.
Looks like the maintainer of csvtojson has developed a benchmark application. I think I can add my csv to json converter to his benchmark project to test my converter.
if your project can consider in-browser apps, I suggest csvtojson as it is by far the speediest converter on the market as of 2017.
I created it myself so I may be a bit biaised, but I specifically developed it for a bigger project that required big csv to json crunching.
Tell me if it served.

Convert Jupiter Tessellation(JT) files to JSON to render in THREE.js

How do I render .JT files in THREE.js? I checked following options and could not get anything to proceed with:
checked in Three.js on different loaders which are available - didn't get loader for JT files. Please let me know if there is anything already present which I am missing in three.js.
http://www.johannes-raida.de/jnetcad.htm - if I have to write my own conversion method, at this of point, not sure how to proceed with. any pointer will be helpful
Any help or pointers will be appriciated.
Thanks in advance,
Pradeep
JNetCAD won't help you a huge amount unless you write it as a web service. Its Java (server side code) while three.js is client side. If you wanted to go down this route though, you could create a small RESTful web service that took a .JT file as input and returned the converted JSON. This does require a fair amount of Java knowledge though.
Unless you specifically need on-the-fly transformation, you're probably going to find it a lot easier to just run the .JT file through the tool yourself and work directly from a supported format. This is what they have done on the JNetCAD web page to good effect.

What is the best way to open and read an excel file from a Flex Application

What is the best way to open and parse and excel file from a Flex Application built using Adobe Flash Builder 4.5. I have done tons of research, most lead me to external libraries, I could deal with that if that is the best approach, but prefer a built in method.
Thanks
There is no "built-in method" to read Excel files in Flash. If you've found some libraries that claim to do it, give them a shot; you really don't want to try doing it yourself.
Try this library.
http://code.google.com/p/as3xls/
If it's an option, it may be simpler to export the Excel file as a .CSV and then load and parse that. It's a much simpler file format, and if your Excel sheet contains simple data it is going to be much easier to do.
Otherwise the library that rejo mentioned (http://code.google.com/p/as3xls/) will help. Excel is a complicated file format, it's best not to go it alone.

What is the best file format to parse?

Scenario: I'm working on a rails app that will take data entry in the form of uploaded text-based files. I need to parse these files before importing the data. I can choose the file type uploaded to the app; the software (Microsoft Access) used by those uploading has several export options regarding file type.
While it may be insignificant, I was wondering if there is a specific file type that is most efficiently parsed. This question can be viewed as language-independent, I believe.
(While XML is commonly parsed, it is not a feasible file type for sake of this project.)
If it is something exported by Access, the easiest would be CSV; particularly since Ruby contains a CSV parser in the standard library. You will have to do some work determining the dialect of CSV (what it uses for delimiter, how it handles quotes); I don't know how robust the ruby parser is with those issues, but you also should have some control from Microsoft Access.
You might want to take a look at JSON. It's a lightweight format, and in contrast to XML it's really easy and clean to parse without requiring a huge library on the backend.
It can represent types like strings, numbers, assosiative arrays (objects), and lists of such
I would suggest n-SV (where n is some character) for data that does not include n. That will make lexing the files a matter of a split.
If you have more flexible data, I would suggest JSON.
If you've HAVE to roll your own parser, I would suggest CSV or some form of a delimiter separated format.
If you are able to use other libraries, there are plenty of options. JSON looks quite fascinating.

How to analyze binary file?

I have a binary file. I don't know how it's formatted, I only know it comes from a delphi code.
Does it exist any way to analyze a binary file?
Does it exist any "pattern" to analyze and deserialize the binary content of a file with unknown format?
Try these:
Deserialize data: analyze how it's compiled your exe (try File Analyzer). Try to deserialize the binary data with the language discovered. Then serialize it in a xml format (language-indipendent) that every programming language can understand
Analyze the binary data: try to save various versions of the file with little variation and use a diff program to analyze the meaning of every bit with an hex editor. Use it in conjunction with binary hacking techniques (like How to crack a Binary File Format by Frans Faase)
Reverse Engineer the application: try getting code using reverse engineering tools for the programming language used for build the app (found with File Analyzer). Otherwise use disassembler analysis tool like IDA Pro Disassembler
For my hobby project I had to reverse engineer some old game files. My approaches were:
Have a good hex editor.
Look for readable words in the binary file. Note how their distribution is. If the distance between them is constant you know it is a listing.
Look for 2-3 consequent zeros. Might indicate an int32 value.
Some dwords might be pointers into the file.
Try to identify reoccurring patterns in the file.
Seeing lots of C0-CF might indicate RLE compressed data.
I've developed Hexinator (Window & Linux) and Synalyze It! (macOS) exactly for this purpose. These applications allow you to see the binary files like in other hex editors but additionally you can create a "grammar" with the specifics of a binary file format. The grammar contains all the building blocks and is used to parse the file automatically.
Thus you can keep the knowledge you gain in the analysis and apply it to multiple files simultaneously. You can also color-code the bits and pieces of file formats for a quick overview in the hex editor.
The parsing results are displayed in a tree view where you can also modify the files easily (applying endianness et cetera).
Reverse engineering a binary file when you have some idea of what it represents is a very time consuming process. If you have no idea what it is then it will be even harder.
It is possible though, but you have to have a pretty good reason for doing so.
The first step would be to open it up in a hex editor of your choice and see if you can find any English text to point you in the direction of what the file is even supposed to represent. From there, Google "Reverse Engineering binary files", there are much more knowledgeable people than me that have written guides about it.
The "strings" program from GNU binutils is very useful. It will print the strings of printable characters in a file, quite often giving a clue to what a file contains or a program does.
If the data represents serialized Delphi objects, you should start reading about the Delphi serialization process. If that's the case, I think your best bet would be to load it using Delphi and continue your analysis from the IDE. Some informations about Delphi serialization can be found here.
EDIT: if the file does contain serialized delphi objects, then you should write a small delphi program that loads it, and "convert" the data yourself to something neutral, like xml. If you manage to do this, you should check and see if delphi supports serializing to xml. Then, you could access those objects from any language.
The unix "file" command is really useful - I don't know if there is anything like it in windows. You run it like this:
file myfile.ext
And it spits out a text description based on the magic numbers and data contained therein.
Probably it is contained within cygwin.
If you have access to the application that creates the file, you can apply changes to the application, then save the file and see the effects (Keep in mind that numbers are probably stored in little endian):
First create the file repeatedly. If the files are not binary equal, the current date/time is probably stored in the area where hte differences occur.
Maybe you want to repeat that with the software running under different environments, to see if OS version etc are stored, but this is rather unusual.
Next you can try to change single variables and create several files that only differ in the value of this variable. This helps you identify where this variable is stored.
That way you can also exclude variables that are not stored in the file: If you change them, but the files created are identical, they are not stored.
In order to test the hypotheses you worked out with the steps above, edit one of the files and have the application read it.
If you don't have access to the application itself, I suggest that you forget about it and find another way to solve your problem. There is a very high probability that it will be faster...
If file does not give a meaningful answer, you may want to try TRiD by Marco Pontello to determine whether your data is stored in a known format.
Get the Delphi application and open it in IDA Pro freeware version, and find where it writes the file, and decode how it writes the file that way.
Unless it's plan text.
Do you know the program that uses it? If so you can hook that programs write to file function and get an idea of what data its writing, the size of the data and where.
More Info: http://www.codeproject.com/KB/DLL/Win32APIHooking_Trouble.aspx
Unlike traditional hex editors which only display the raw hex bytes of a file, 010 Editor can also parse a file into a hierarchical structure using a Binary Template. The results of running a Binary Template are much easier to understand and edit than using just the raw hex bytes.
http://www.sweetscape.com/010editor/
Try to open it in a hex editor and analyse.