Wiki

Clone wiki

Homemaker / Home

This page is a step-by-step walkthrough of the Homemaker software.

Homemaker

Homemaker is a new way to design an old kind of building.

Instead of designing standardised houses and scattering them over a site, or designing typical floor plates and stacking them into a tower, Homemaker uses evolution to design every house from scratch every time. Designing every house to suit its setting gives us more compact and better fitting buildings.

Before you start

These instructions are written for Linux. The code is portable, so I expect it to work on Windows with Cygwin, and also on OS X, but these are untested.

The software is currently stored as git repositories on Bitbucket. You will need Urb and Homemaker to regenerate the example project. To actually create a new project you will need some command-line tools from File::DXF. To generate a 3D model for rendering you will need Molior and File::DXF. To generate IFC output you will also need File::IFC.

The following git commands will retrieve the source of these Perl modules:

$ mkdir ~/src
$ cd ~/src
$ git clone https://bitbucket.org/brunopostle/urb.git
$ git clone https://bitbucket.org/brunopostle/homemaker.git
$ git clone https://bitbucket.org/brunopostle/file-dxf.git
$ git clone https://bitbucket.org/brunopostle/molior.git
$ git clone https://bitbucket.org/brunopostle/file-ifc.git

Installation is normal for a Perl module, in each folder:

$ perl Makefile.PL
$ make test
$ sudo make install

Note that the first perl Makefile.PL command will list any missing Perl modules, you can install them using CPAN. e.g. to fetch Math::Polygon from CPAN and install in one go use this command:

$ sudo cpan Math::Polygon

Quick start

The sections below show how to create your own projects with multiple buildings and manage the evolution with the queue manager, if you just want to see the software in action try evolving a single building from the examples in the 'Urb' Perl module:

$ cd examples/sixteenth/00
$ urb-evolve.pl init.dom

Wait at least an hour to let the evolution do its work, then 'Ctrl-C' the process to stop it (or just wait for it to finish by itself). The result will be a single .dom file with a long hashed filename consisting of random-looking characters. Generate a 3D model in various formats using the 'dom2dxf.sh' bash script:

$ dom2dxf.sh c0edf7e610876ad8c66a60d9ea9104dc.dom

Set up a project from scratch

This section tells you how to use DXF files to describe the geometry of your site. If you don't have a CAD tool to create these DXF files, you don't really need it, the .dom file format is simple enough to create in a text editor. Otherwise, if you just want to get up and running, this section can be skipped by using example project files in the Homemaker sources.

First we need to create a project folder and subfolders for each of the plots in the site - Homemaker supports designing multiple houses simultaneously, each house will have its own plot.

One way to define the plots is to create a DXF file containing the plot outlines, each plot needs to be drawn as a four-sided POLYLINE in an anti-clockwise direction. Note that all units are metres, the plots can be at different levels indicated by the POLYLINE ELEVATION property. The dxf2dom.pl script for extracting these outlines can be found in the File::DXF Perl module.

View of four-plots.dxf

The picture shows the example DXF file contained in the ~/src/homemaker/t/data/four-plots folder. You can use this as a test:

$ dxf2dom.pl ~/src/homemaker/t/data/four-plots/four-plots.dxf

This will create a folder called four-plots, with subfolders for each plot.

Currently for each subfolder you will need to edit the init.dom file that describes the empty plot to indicate which boundaries are 'private', i.e. non-street boundaries where a wall can't have openings. This will improve, currently there is no graphical way to configure this.

If you want to change the default optimisation parameters, run the urb-default.pl script in the project level folder, or in each plot folder individually, this creates patterns.config and costs.config files with the default parameters, edit them to suit.

Unless your site is in a desert there will be neighbouring buildings, these are represented in one or more very simple YAML files with a .walls extension in the shared project folder. For now there is a dxf2walls.pl script to convert DXF LINE entities with THICKNESS attributes into this format. Note that the test four-plots.dxf file above also contains some lines defining some walls, so you can use this:

$ dxf2walls.pl ~/src/homemaker/t/data/four-plots/four-plots.dxf four-plots/buildings.walls

That's everything, note that there is an example project in the Homemaker sources already set up as described above (~/src/homemaker/t/data/four-plots/project).

Insert this job into the queue manager

Use homemaker-enqueue.pl to insert the project folder created above into the queue:

$ export HOMEMAKER_QUEUE=~/homemaker/queue
$ export HOMEMAKER_DATA=~/homemaker/data
$ homemaker-enqueue.pl four-plots

Note that Homemaker creates some files to maintain the state of the project in a format that can be accessed by multiple processes. Above I have told it to create these in a 'homemaker' folder in my $HOME. If you place this in a shared network location you can use multiple machines to process the job.

Alternatively you can insert the example project from the Homemaker sources:

$ homemaker-enqueue.pl ~/src/homemaker/t/data/four-plots

You can check the status of the queue like so:

$ homemaker-status.pl

Note that you can have as many jobs in the queue as you like, they will be processed in order.

Process the jobs in the queue

To actually process the jobs, you need to start one or more Homemaker daemon processes:

$ homemaker.pl

Note that the machine running this daemon only needs the 'Urb' and 'Homemaker' Perl modules installed. The daemon will sleep on completion, but will then pick up and process any jobs that you subsequently add to the queue.

Dequeueing takes a very long time, each building is evolved over hundreds of generations, multiple times. So if you have multiple processors you might want to create multiple Homemaker daemon processes:

$ homemaker.pl & homemaker.pl & homemaker.pl & homemaker.pl &

If the $HOMEMAKER_QUEUE and $HOMEMAKER_DATA folders are writable on the network then you can run Homemaker processes on different machines. Not much data is passed back and forth, so these machines don't need to be close by.

You can check progress using the same tool as before:

$ homemaker-status.pl

Extracting 3D models

Once the evolution has finished, you can export some 3D geometry in Collada format, suitable for rendering in Blender etc... Supply the homemaker-export.pl tool with the project name and a filename with the correct file extension:

$ homemaker-export.pl four-plots /path/to/four-plots.dae

(This command needs to be run on a machine with the full set of Perl modules listed above installed)

There are other available formats, check the pod documentation using perldoc homemaker-export.pl for more details. You can find some example output in Collada and (experimental) IFC format in the ~/src/homemaker/t/data/four-plots folder.

The following images are of this Collada 3D output, unaltered and rendered in Blender:

Result rendered in Blender Result rendered in Blender Result rendered in Blender Result rendered in Blender

Customising the style of the buildings

The default style of the buildings is defined by a collection of YAML and DXF files that ship with the 'Molior' perl module. To customise these files, create a copy of the 'lib/auto/Molior' folder, and use the 'SHARE_DIR' environment variable to point the software at this folder instead:

$ export SHARE_DIR=~/homemaker/mystyle

The style uses a system of inheritance, with each sub-folder representing a style that can be summoned via the 'style:' attribute in the '.dom' file. Look at how this is inheritance is implemented in the 'courtyard' style (alternative style submissions are welcome).

Limitations

This software is work in progress, so expect missing and incomplete results. The default parameters for the pattern language that forms the design fitness criteria have not been tuned (July 2020) - so if, for example, your stairs are too narrow, this is a bug that needs to be fixed.

Further reading

The 'Urb' wiki has a series of four articles describing the rationale behind the software, Start reading here.

Questions?

Contact me with any questions, there is not yet (2019) a mailing list for this project. You can also ask at the OSArch community forum, tag your post with @brunopostle and I will notice it.

Creative Commons License

© 2014 Bruno Postle (mail: bruno at postle dot net, twitter: @brunopostle). This work is licensed under a Creative Commons Attribution 3.0 Unported License.

Updated