FBTBForums.net Forum Index FBTBForums.net

...has been nuked!

 
 ChatChat    FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Upcoming: New version of LdrDat2Dxf/Obj

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    FBTBForums.net Forum Index -> LEGO/Star Wars Software
View previous topic :: View next topic  
Author Message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Sat Aug 18, 2007 1:58 am    Post subject: Upcoming: New version of LdrDat2Dxf/Obj Reply with quote

I'm now working on C project, recreating my 2 converters, only not on VB.NET... It means it will convert much faster and with less dependencies. Very Happy

I don't know if anyone uses it, but I certainly do and I got tired of MS .NET giant dependency and slowness. Oh yeah I will also ty to make it interval(wrong word) and not recursive, giving my program a GIANT speed boost too.

Of course I'm starting over, since I lost source code for those 2 old programs.
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Sat Aug 18, 2007 4:50 pm    Post subject: Reply with quote

Stuff I have done:

Reading entire input, creating transform stack in order to process 3d data.
Many functions related to processing types of data in LDR or DAT format from ldraw.
Stack codes nearly all done, I still haven't finished delete stack yet. Razz

Stuff I still haven't finished on:
Code to do actual subpart to parent transformation math.
Output to one of those formats ( DXF or OBJ )
Options such as no studs and ignore errors.

Project to be done next:
Recompile to work in windows (currently Linux only)
Front-ends for both Linux and Windows. Command line is hard to do for regular people. I lived it in old win3.11/DOS days so I didn't have any problems. Wink
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Sun Aug 19, 2007 12:19 am    Post subject: Reply with quote

Oh boy. Time for tons of troubleshooting.

Here's the funniest picture of first actual object conversion.


Anyone can guess what part that is supposed to be? Wink


Glass so internal is visible.


The hole at bottom is missing. Razz You can see where it's placed, floating behind the object.

Those are SO HARD to troubleshoot. This time it should be a little easier since I can use original converter and compare the results and see what went wrong. One thing is that it's so noticeably faster even on small (one brick) object. It takes almost literally NO time to make file.

Stuff to do:
Fix errors. Most likely case is that 4 point poly is being incorrectly made into 3 point poly?
Option as parameters such as no stud, ignore errors, etc...
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Sun Aug 19, 2007 6:17 pm    Post subject: Reply with quote

Darn! Almost got it right.





Oh well. Some troubleshooting.

Things to do:
Object subpart source directory (currently just assumes that it's in program root directory).
Options such as no studs, grouping.
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Mon Aug 20, 2007 7:34 am    Post subject: Reply with quote

I made a dumb mistake. Math code just processed the first stack and ignored the rest of stack. As a result, some of necessary transforms were missing. For example a subpart were correctly transformed into main coordinate system, but subpart of subpart would only be transformed once, leaving subpart of subpart in subpart coordinate system, making a mess. It would get worse and worse as subpart reference get deeper and deeper. for example if the depth was 5 files, it would be missing 4 transforms, making a huge mess.

I didn't bother posting a picture this time, because it looks just like a standard 1x1 brick now.

I still laugh when I see first conversion. That lego brick looks mean. Very Happy

Things left to do:
Front-ends for both OS
Windows version of this program ( probably just need little tweaking )
Proper source directory and sub-parts search functions. Right now it just finds files in same directory as program itself.
Options such as no stud and ignore sub-part reference errors.
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Fri Aug 24, 2007 12:27 am    Post subject: Reply with quote

I'm pretty close to being done now. It's much further along now, with most features done now. For example, colors and grouping works perfectly for OBJ now.

I'm still not sure what to do on GUI design. I never designed a GUI in C before. I think I will use some IDE for windows, however, as long as it doesn't have big dependencies.

Stuff to be done:
GUI for Windows and Linux
DXF support (Yes, one program to export both formats. I rock. Wink)
Make some options actually functional. Parameters work, values gets altered, but it does nothing to actual conversion of format. For example, remove studs parameter becomes 1 when I use -ns option, but it doesn't remove any studs.

Things to figure:
DXF format... ARGH! I figured it out long ago, but I have forgotten. I'm still figuring how to do faces and grouping.
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Mon Sep 03, 2007 1:09 am    Post subject: Reply with quote

With college, I'm been making a slow progress. The program is nearly finished, however. All it needs is some polish and new GUI programs for windows and linux.

Things done since then:
No studs options works, but sometimes crashes for some reason. Pointer problems.
Ignore file not found/cannot open errors works.
Grouping is done too. 2 types of grouping: by step and by line # (typically means group by parts )

Things to do:
Windows support (via conditional compiling, something I have to learn ) .
DXF support ( too busy to figure out at this time ).
GUI for windows and linux.
Find and fix slip studs options (crash by pointer problem sometimes).
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Thu Sep 06, 2007 2:53 am    Post subject: Reply with quote

Well I just finished coding... The program is fully functional with all options working. I even added -q and -v ( quiet and verbose ) options.




I added light to highlight the gaps. Notice that all cylinders, for some reason, are slanted. Also, one brick is bisected with a plane for some reason??

Apparently I somehow broke it on process of adding new features. Sad Once again, troubleshooting. Razz
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Wed May 14, 2008 4:26 am    Post subject: Reply with quote

Wow! It have been a while...

I learned a whole lot about c++, so I decided to convert my project to c++.

I also took Linear Algebra, so I learned a lot more about transformations, so I could make it much simpler, so it is now quite literally 10 times or more faster. That is from C version, not the vb.net. The current probably is over 100 times faster than vb.net version. Funny how experience progress, huh?

Unfortunately it is even more broken. See picture below. It's supposed to be my infamous carplane. I suspect I messed up with math calculations somewhere...




I have decided to use wxwidgets to create front-end for this program Linux and Windows support is a must because I use both.
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Zedsier
Undead!


Joined: 31 Jul 2006
Location: Slave I, California

PostPosted: Wed May 14, 2008 11:56 pm    Post subject: Reply with quote

Dude...what?
_________________
Back to top
View user's profile Send private message AIM Address
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Sat May 17, 2008 1:50 am    Post subject: Reply with quote

Sorry you couldn't understand what is going on. I recommend re-reading first post. I'm developing a new version of converter basically...

Finally I made it work! I found quite a number of bugs. First bug was that basically stack were not getting its variables set correctly. That was the reason model were messed up most times. Others relate to file opening problems.

This were first functional ( but something were broken... ) picture.

I found that first level conversion worked okay, but sub-part conversion were broken. I found out that conversion stack variables ( matrix ) weren't set the way I expected. I fixed it.

I tried out the fixed code.

OOPS I forgot to fix x, y, and z transformation. Transformation matrix were fine, but part position x,y,z were not transformed at all. Razz

I fixed that bug, and it worked perfectly. However I wanted matrix transformation to be done only once. Not each sub-part transformation. That would add up to massive math calculations. That is the reason Vb.net version of ldrdat2obj/dxf were slow. The other reason were the fairly bad code. Razz
Anyway I made it easy by just transforming the sub-part matrix to its parent transformation matrix. (Gonna love linear algebra!) But something went really wrong...

Oops I misremember the method. I did it backwards. I just flipped variables around and it worked perfectly.

This is test version with all removable parts options enabled. That mean there is no studs, hollow studs, and tubes on bottom. Looks slick, huh?


With now functional converter, what I have to do left is to use WxWidgets to build a GUI for it. I will try to build it in such way that command line and GUI versions are easily maintained. Changing this to work in windows requires me to change just 3 lines, all dependant on / or \ slash directories.
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
ZombieWaldo
Destroyed!


Joined: 28 Mar 2005
Location: SoCal, USA

PostPosted: Sat May 17, 2008 11:18 am    Post subject: Reply with quote

Junsier wrote:
Dude...what?


Isn't it obvious? He's making some sort of Modern Art Generator Laughing


Actually, I wanna use this one as an avatar now. Very Happy


Pretty cool project. Way beyond my full comprehension, but cool none the less...
_________________
The best flickr ever. I kid you not.
Back to top
View user's profile Send private message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Sat May 17, 2008 1:07 pm    Post subject: Reply with quote

Thanks. Smile You can have the orginial OBJ file of the messy one if you want. I used free version of Bryce to render all those pictures.
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Zombie_Fisto
Undead!


Joined: 04 May 2007
Location: Zombie infected Boston Garden.

PostPosted: Tue May 20, 2008 7:52 pm    Post subject: Reply with quote

Looks good to me! Your progress is excellent. But then again. Anything in this feild would be excellent by my standards, considering I have no experience whatsoever in terms of computer programs such as these. But it looks good!
_________________
ZombieSolo wrote:
/me takes a chunk out of Kit's arm... *nom nom nom*

Vidzombie wrote:
/slurps up Kit's remaining mess.
Back to top
View user's profile Send private message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Tue May 20, 2008 11:13 pm    Post subject: Reply with quote

Thanks. Smile

So far, I have a functional GUI, but conversion doesn't work due to differences and problems. WxWidgets is still very new to me, and that is giving me problems. Razz

Right now, it runs, and crashes as soon as it starts working on first sub-part. So far, it seems that I'm not changing too much code, so I can actually split files into parts that belong to GUI version and another that belongs to command line version only. That means if bugs is ever found, it will be very easy for me to fix all versions.
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Wed May 21, 2008 11:41 pm    Post subject: Reply with quote

*Sigh* I got conversion to work, but it's actually slower than vb.net version. I will have to find out why it is so slow. No stud, etc version of carplane took about 20 minutes, and it was only halfway finished.

That is puzzling because I hardly changed any of converter code at all. I intended to do that because I want to combine command line and gui codes so bug fixing would be really easy. Maybe I can simply use command line version by calling it with parameters set by gui.

That idea have 2 major benefits... first is very simple bug-swatting because there is only one code to fix. Second is command line version is... fast. It finishes carplane in about 2 seconds. ( vb.net version: 1 minute, wxwidgets version, 20+ minutes )

Both will be simple to compile for both windows and linux, so it won't make too much of a difference for me to compile for both OS.
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Mon May 26, 2008 1:42 pm    Post subject: Reply with quote

Hmm that was interesting. I fixed the slowness issue. Apparently it was load of debug messages. For some reason the programming env I am using handles stdout fairly slowly. Well it's fixed.

I just added standard menu and status bar.

I plan to add multi-threading so gui will respond to events while busy converting a file. Or maybe just a timer and wxwidget version of doevents() will do... Depends on how effective it is and coding complexity. Why do additional 100 lines when 10 will do? Smile
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Thu May 29, 2008 1:36 am    Post subject: Reply with quote

Gui freeze while conversion still happens, but that is on hold while I change code so the actual code that does the conversion is a class of its own. That way, commandline and GUI versions will share same conversion functions without any problems.

In fact, I added something very nifty. I can make it so it will pass messages to whatever function I assign to conversion, so commandline will show messages as stdout text, while GUI version will display it in status bar, which is very different method without ANY changes to conversion code at all. Very easy and lazy way to fix bugs in future.

I love Linux way of separation of interface and functions.
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Zombie Fett
Destroyed!


Joined: 20 Jan 2008
Location: Connection Failed. Please Try Again... Brains.

PostPosted: Thu May 29, 2008 2:03 am    Post subject: Reply with quote



That's about what happened to my head when I read this thread.

What ever your doing, it sounds real cool. Now exscuse me while I try to put my head back together.
_________________
Oh, signatures are so over rated. =D
Me is dead.
Me has Flickr, does you?
Back to top
View user's profile Send private message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Thu May 29, 2008 2:43 pm    Post subject: Reply with quote

That's funny. Smile
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Thu Jun 05, 2008 2:28 am    Post subject: Reply with quote

It's relatively close to being finished. So far there is two major problems I have to solve.

First is inability to pass pointer of class member function to outside the class. I'm still a newbie on this subject, so I'm having problems with this. This is to simplify conversion code so both command line and GUI versions can just use same code and I don't have to bug fix 2 separate versions of conversion code.

Second is somewhat problematic. The GUI freezes and doesn't even get re-drawn when conversion is on progress. I think I can solve this problem by just adding Update(); to code run by conversion code ( related to above ).

Oh by the way, I only work on this once or twice a week, in case you guys have been thinking I'm hard at work on this. Wink
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Fri Jun 06, 2008 4:53 am    Post subject: Reply with quote

I solved both problems by making function not a class member function and making that function call yield, the wxwidget's version of vb's doevents which makes program process other events, such as drawing gui and processing any click events and such.

So the gui freeze problem is gone, as well as effective status bar messages now.

I then modified program so it can stop conversion at nearly any time. That way, if there's some problem such as forgetting to use no stud option and starting conversion on some huge model, user can just stop conversion and change options.

I started conversion on world trade center model file, and tested the cancel button. It crashed so hard... I checked around and apparently program wasn't happy about leaving a whole bunch of open files.

By the way, WTC model file after conversion is around 100 MB, and that's without 2 kinds of studs and tubes in bottom of brick and plates! That's crazy, huh? Highest I ever went with this model was over 250 MB... I forgot the exact # but it was huge. So big obj file viewer couldn't load it. Very Happy

Anyway about the bug... it was pretty simple fix. I used the conversion functions own method of exiting in case of file error to gracefully stop conversion without crashing.

Well right now it's working really great. Right now it needs some tweaking and effectiveness fixes. I don't want any memory leaks anywhere, and I'm sure some methods can be written a little better/faster.

Once that is done, I will improve commandline to use some same source files as gui version so bugfixes will be very simple to do.

Once that's done, I guess I'll have to use vmware or something to run stripped down version of windows xp with development environment so I can make windows versions.
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Wed Jun 11, 2008 3:23 am    Post subject: Reply with quote

Final modification was to make program a little more friendly when file already exists. It used to just refuse to run as long as file exists, because overwriting it may be a bad idea. Now it just asks if user wants to overwrite or to cancel.

I then went back to command line version and modified it to use same classes as wxwidgets uses to convert formats. I didn't get much major problems other than figuring how to modify my Makefile. Razz Oh since the idea of more friendly question on whether overwriting the file or not was such a good idea, I added it to command-line version too.

My idea of using virtual machine to run windows on my KUbuntu laptop weren't such a good idea. There were problems everywhere, and new problems such as drivers kept appearing, so I gave it up, and will work on windows version on my computer. For some reason, working on a program is harder in my room than outside... Razz

Anyway the code is very nearly OS-independent, so I hope that making a windows version will be quick...
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Iare Zombite
Undead!


Joined: 04 Feb 2005
Location: Between chair and monitor.

PostPosted: Wed Jul 09, 2008 3:50 pm    Post subject: Reply with quote

Looks like windows development of wxwidget app is a little hard.

Maybe I will just make a seperate windows version. I still haven't decided on what to do at this point.
_________________

Cake is NOT A LIE!!!
(Yes, the virus worked on me somehow... Razz )
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    FBTBForums.net Forum Index -> LEGO/Star Wars Software All times are GMT - 5 Hours
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group