Skip to content

derekcbr/FloorplanToBlender3d

 
 

Repository files navigation

license dockerhub size watcher commit

Demo

Table of Contents (click to expand)

About

The virtualisation of real life objects has been a hot topic for several years. As I started learning about 3d modelling in Blender3d I thought of the idea to use simple imaging on floorplans to automatically create corresponding 3d models. It is much easier than it sounds and uses a low amount of resources, enabling it to be used on low hardware. By utilizing Blender3d, all created objects will be easy to transfer to any other 3d rendering program. Such as Unity, Unreal Engine or CAD.

How-To

This part contains information about how to setup and execute this program.

NOTE : Using other versions of the required programs and libraries than specified in Dockerfiles might require changes in the implementation. It is only guaranteed that this implementation will work if the assigned versions and all requirements are met.

NOTE : To avoid any version related problems use the Docker implementation.

Run on Docker

Firstly you need to install a suitable Docker environment on your device. This project contains a DockerFile which uses the Ubuntu 18.04 image so make sure your docker environment is set to linux containers.

This project is linked to Docker Hub which means a maintained and prebuilt container can be pulled directly by running:

 docker pull grebtsew/floorplan-to-blender
 # run the container:
 docker run -it grebtsew/floorplan-to-blender

NOTE : For more information about how the dockerfile and docker-compose files can be used to build and run the image to add your own content read more here.

To pull and run the container together in a one line command run:

 docker-compose run ftb

Run locally on OS

This tutorial will describe how to install this implementation directly on your device. If you are a Linux/Ubuntu user, look at Dockerfile for better instructions.

These are the programs that are required to run this implementation.

With a suiteable blender, python and python pip installed you can have Python3 pip install all required packages by running:

 pip install -r requirements.txt

Clone or download this repo:

git clone https://github.com/grebtsew/FloorplanToBlender3d.git

Run Tutorial

This tutorial takes you through the execution of this program.

  1. Receive floorplan as image, from pdf or by using other method (for example paint)
  2. Run python script create_blender_project_from_floorplan.py
  3. Follow instructions
  4. Created floorplan.blender files will be saved under ./target

NOTE : For more information about alternative ways of executing the implementation read more here.

Demos

Create Floorplan in Blender3d

Here we demo the program. First of we need a floorplan image to process. We use example.png, see below: Floorplanexample

Next up we execute our script and answer the questions: gif1

Finally we can open the newly created floorplan.blender file and see the result: gif2

NOTE: This demo only uses default settings. For instance coloring is by default random.

Documentation

For more information and tutorial of how to use the ftb library do checkout docs!

Testing

Vital and core functionality are tested with pytest. To run tests yourself enter Testing-folder and run:

pytest

References and Imports

During the development of this project I have been searching alot and copied code from StackOverflow. I share links to copied code and other contributors here:

Contribute

Let me know if you want to contribute to this project, also if you want me to add more functions or answer questions, let me know!

Known Issues

These are some known and relevant issues with the current implementation:

  • Floorplan images needs to be quite small for detections to work at this time. If you plan on using a large image, consider downscaling it.
  • Required programs and libraries might change in future versions, this might require some changes in this implementation for it to work. If you insist on not using the versions specified in Dockerfile, a coding effort might be required.

License

GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007

COPYRIGHT @ Grebtsew 2019

About

Create 3d rooms in blender from floorplans.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.1%
  • Dockerfile 1.9%