How to Draw Floor Plans Using Blender and Python
Table of Contents (click to expand)
- Almost
- How-To
- Run on Docker
- Run locally on OS
- Run Tutorial
- ConfigFile
- StackingFile
- Demos
- Documentation
- Testing
- Contribute
- Known Bug
- License
About
The virtualization of real life objects has been a hot topic for several years. As I started learning nigh 3d modelling in Blender3d I idea of the idea to apply simple imaging on floorplans to automatically create corresponding 3d models. It is much easier than it sounds and uses a low corporeality of resources, enabling it to exist used on low hardware. By utilizing Blender3d, all created objects will be easy to transfer to whatever other 3d rendering program. Such as Unity, Unreal Engine or CAD.
Contents
This repository contains the floorplan to blender library FTBL along with example scripts for converting an image to a 3d model ./create_blender_project_from_floorplan.py. The repository as well contains a server that receives images and converts them into 3d models using the FTBL library. The Server contains a Swagger API gui and is monitored using a weavescope container. Read more than about the server implementation hither. To allow developers to utilize more than functionality a Jupyter tutorial has been added to the projection, explaining some of the development steps and functions of the library. Read more about the tutorial here. Stacking is now also added as a cadre characteristic read more about how to use stacking below.
How-To
This part contains information about how to setup and execute the example script.
NOTE : Using other versions of the required programs and libraries than specified in Dockerfiles might require changes in the implementation. It is just guaranteed that this implementation will work if the assigned versions and all requirements are met.
Notation : 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 projection contains a DockerFile
which uses the Ubuntu 18.04
image and so make sure your docker environment is ready to linux containers.
This projection is linked to Docker Hub which ways a maintained and prebuilt container can be pulled straight by running:
docker pull grebtsew/floorplan-to-blender
The dockerfile is divided into three modes. The script manner where the example script can exist tested. The server which starts a hosting server instance with a Swagger Api. The jupyter notebook where some tutorials and examples are further explained.
Past using the different docker-compose files these modes are automatically selected for you.
Notation : For more than 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:
# For Script mode: docker-compose run ftb # For Server fashion: Read more "./Server/README.md" docker-etch -f docker-compose.server.yml upward # For jupyter mode: Read more "./Docs/README.md" cd ./Docs docker-etch up
NOTE: When irresolute betwixt modes the container sometimes need to be rebuild, that tin exist done by adding the --build flag to the commands above.
Run locally on OS
This tutorial volition describe how to install this implementation directly on your device. If you lot are a Linux/Ubuntu
user, look at Dockerfile
for better instructions.
These are the programs that are required to run this implementation.
- Blender3d > 2.93
-
Python >== three.8.0
Clone or download this repo:
git clone https://github.com/grebtsew/FloorplanToBlender3d.git
With a suitable blender
, python
and python pip
installed y'all tin can have Python3 pip
install all required packages by running:
pip install -r requirements.txt
Run Tutorial
This tutorial takes you through the execution of this program.
- Receive floorplan as prototype, from pdf or by using other method (for example paint)
- (Optional) create a new ConfigFile in
Configs
folder or StackingFile inStacking
folder. - Run python script
create_blender_project_from_floorplan.py
- Follow instructions
- Created
floorplan.blender
files will be saved under./target
Annotation : For more information about alternative ways of executing the implementation read more here.
Update Settings in Config files
When the implementation run the first time a system.ini
and ``default.ini` file is created.
ConfigFile
With the new update of the implementation ConfigFiles
are added. These files draw information virtually each floorplan class instance. In this file model transform can be changed. If no config is added, default will be used. To generate a new default file remove or motion the old one. Next to the default config file is the system default config file containing boosted settings for the unabridged arrangement. All configs are placed within the Configs
binder.
StackingFile
With the new update the StackingFile
was added. StackingFiles are used to create worlds of floorplans at once. Using a self developed parsing language. See the example files in the Stacking
folder.
Demos
Create Floorplan in Blender3d
Here we demo the program. Beginning of we need a floorplan epitome to process. We use example.png
, see below:
Adjacent upward we execute our script and answer the questions:
Finally we tin can open up the newly created floorplan.blender file and encounter the result:
NOTE : This demo just uses default settings. For instance coloring is past default random.
Create several floorplans using Stacking
Hither nosotros instead use StackingFiles to create a earth containing several floorplans. Show the upshot.
Floorplan To Blender Server with Swagger API
The server implementation comes with an automatically generated Swagger API page.
Usages in other applications
If you are interested in lawmaking for these demos they are accessable in some other repository here.
AR foundation identify floorplans in world
AR foundation real life scaling of floorplans
AR foundation interior design of floorplans
AR foundation with MediaPipe Hands interactions
Documentation
For more information and tutorial of how to employ the ftb library exercise checkout docs!
Testing
Vital and cadre functionality are tested with pytest. To run tests yourself enter Testing
-folder and run:
Contribute
Allow me know if you want to contribute to this projection, as well if you want me to add more than functions or reply questions, let me know!
Known Issues
These are some known and relevant bug 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 epitome, consider downsizing it.
- Required programs and libraries might change in future versions, this might crave some changes in this implementation for it to work. If you insist on non using the versions specified in Dockerfile, a coding attempt might be required.
License
GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
COPYRIGHT @ Grebtsew 2021
Source: https://github.com/grebtsew/FloorplanToBlender3d
0 Response to "How to Draw Floor Plans Using Blender and Python"
Post a Comment