这是indexloc提供的服务,不要输入任何密码
Skip to content

GustavHager/FloorplanToBlender3d

 
 

Repository files navigation

powerpoint

Table of Contents (click to expand)

About

The virtualisation of real life object has been a hot topic for several years. As I started learning about 3d modelling in Blender3d I thought of this 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.

Install

Several packages and programs are required to run this program.

  • Blender3d
  • Python3

If you have Python3 pip installed you can install required packages by running:

 pip install -r requirements.txt

Or install them manually by running :

pip install

  • bpy (python for blender)
  • python-cv (OpenCV)
  • numpy
  • configparser
  • json
  • imutils
  • pyfiglet
  • shutil
  • configparser

Clone or download this repo:

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

Run

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

Run (Old but still working!)

This tutorial takes you through the execution of this program in examples.

  1. Receive floorplan as image, from pdf or by using other method (for example paint)
  2. Set image file path in Examples/floorplan_to_datafile.py
  3. Run ´floorplan_to_datafile.py´ to create data files for your floorplan.
  4. Edit path in floorplan_to_datafile.py to generated data files.
  5. Start blender
  6. Open Blender text editor
  7. Open floorplan_to_3dObject_in_blender.py in blender by pressing the text editor, then alt+o and find the file
  8. Run script

Demo

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 that this demo only uses default settings. For instance coloring is by default random.

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!

License

GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007

COPYRIGHT @ Grebtsew 2019

About

Create 3d rooms in blender from floorplans.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%