Back to Guide

Parking

This example is about how to use the Transformations included in the package to build your own models. Specifically, we are going to create a base substructure and repeat it all over the place. This substructure is a squared floor (or ceiling) with four columns in its corners:

import numpy as np
import pyny3d.geoms as pyny

# Geometry
base_place = pyny.Place(np.array([[0,0,3], [5,0,3], [5,5,3], [0,5,3]]))
pillars = [np.array([[0,0,0], [0.4,0,0], [0.4,0.4,0], [0,0.4,0]]),
           np.array([[4.6,0,0], [5,0,0], [5,0.4,0], [4.6,0.4,0]]),
           np.array([[4.6,4.6,0], [5,4.6,0], [5,5,0], [4.6,5,0]]),
           np.array([[0,4.6,0], [0.4,4.6,0], [0.4,5,0], [0,5,0]])]
base_place.add_extruded_obstacles(pillars)
base_space = pyny.Space(base_place)

structure = base_space.matrix(x=(3, 5), y=(3, 5), z=(2, 3), inplace=False)
atic = base_space.matrix(x=(2, 5), y=(2, 5), inplace=False)
atic.add_spaces([atic, base_space.move((5, 5, 3))])
atic = atic.move((5, 5, 6))
structure.add_spaces(atic)
## Viz
base_space.iplot()
structure.iplot()

# Shadows
S = structure.shadows(init='auto', resolution='high')
## Viz
S.viz.exposure_plot()
_images/parking.png

Base substructure, the whole structure and the simulation result, respectively.


Next tutorial: Ring