SweetHome3D

March 22, 2011 at 1:28 pm (Computer Science, Graphics) (, , , , , , , , , , )


So at one point while working on a program for my thesis I was using a free, open-source floorplan suite called SweetHome 3D. I have to say it is pretty impressive for what it is; the stock files include a floorplan editor, a decent library of objects to place, and a built-in raytracer to render your houses. If you have a use for something like that or just want to play around with home design, give it a shot.

What I was doing with it however, was modifying the source code to add in new features and embed it into another program. At first glance the code seemed very well designed and used plenty of design patterns. It keeps in line with the MVC paradigm, but this ended up being somewhat annoying for adding features. It turns out you have to modify a HUGE number of files just to add a basic features and make it accessible in the menu. I’ll note here that the plug-in system is MUCH simpler to use, however it is very limiting in what you can do with it.

It’s been months since I’ve worked with the API so I can’t remember the exact number of tiny changes I had to make to which files, but it took me a long time to track them all down. In the end though, I wrote a tool that lets you place a red dot anywhere in the floorplan. Yes that seems pretty lame, but I wanted to see how much work it would be to add something useful and how I would do that.

Embedding this software into another Java program wasn’t that bad actually. Since Java’s API is fairly awesome once you get used to it (awesome in the sense that you can actually have a clue what people are doing in open-sourced code), I managed to mount the floorplan scene on a GUI widget and plug that into my program. This makes it much fancier than having to open files using the SH3D suite as an external program.

If anyone else is trying to do this type of thing I can probably make some suggestions based on the notes I kept, but I’ll only help you if you’ve bothered to check out the API yourself first.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: