The Building module

The pi3d.Building module allows you to define a whole level or floor of a building using map files. Like the terrain maps used in the preceding example, the color of the pixels will be converted into different parts of the level. In our case, black is for the walls and white is used for the passages and halls, complete with ceilings:

The building layout is defined by the pixels in the image

The sections built by the Building object are defined by the Scheme used. The Scheme is defined by two sections, by the number of models, and then by the definitions for various aspects of the model, as seen in the following code:

Get Raspberry Pi 3 Cookbook for Python Programmers - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.