honeybee_plus.radiance.view module

Create a radiance view.

class honeybee_plus.radiance.view.View(name=None, view_point=None, view_direction=None, view_up_vector=None, view_type=0, view_h_size=60, view_v_size=60, x_resolution=64, y_resolution=64, view_shift=0, view_lift=0)[source]

Bases: object

A radiance view.

view_point

Set the view point (-vp) to (x, y, z). This is the focal point of a perspective view or the center of a parallel projection. Default: (0, 0, 0)

view_direction

Set the view direction (-vd) vector to (x, y, z). The length of this vector indicates the focal distance as needed by the pixel depth of field (-pd) in rpict. Default: (0, 0, 1)

view_up_vector

Set the view up (-vu) vector (vertical direction) to (x, y, z) default: (0, 1, 0).

view_type
Set view type (-vt) to one of the choices below.

0: Perspective (v) 1: Hemispherical fisheye (h) 2: Parallel (l) 3: Cylindrical panorma (c) 4: Angular fisheye (a) 5: Planisphere [stereographic] projection (s)

For more detailed description about view types check rpict manual page: (http://radsite.lbl.gov/radiance/man_html/rpict.1.html)

view_h_size

Set the view horizontal size (-vh). For a perspective projection (including fisheye views), val is the horizontal field of view (in degrees). For a parallel projection, val is the view width in world coordinates.

view_v_size

Set the view vertical size (-vv). For a perspective projection (including fisheye views), val is the horizontal field of view (in degrees). For a parallel projection, val is the view width in world coordinates.

x_resolution

Set the maximum x resolution (-x) to an integer.

y_resolution

Set the maximum y resolution (-y) to an integer.

view_shift

Set the view shift (-vs). This is the amount the actual image will be shifted to the right of the specified view. This option is useful for generating skewed perspectives or rendering an image a piece at a time. A value of 1 means that the rendered image starts just to the right of the normal view. A value of −1 would be to the left. Larger or fractional values are permitted as well.

view_lift

Set the view lift (-vl) to a value. This is the amount the actual image will be lifted up from the specified view.

Usage:

v = View() # set x and y resolution v.x_resolution = v.y_resolution = 600 # add a fore clip v.add_fore_clip(distance=100) print(v)

> -vtv -vp 0.000 0.000 0.000 -vd 0.000 0.000 1.000 -vu 0.000 1.000

0.000 -vh 60.000 -vv 60.000 -x 600 -y 600 -vo 100.000

# split the view into a view grid gridViews = v.calculate_view_grid(2, 2) for g in gridViews:

print(g)

> -vtv -vp 0.000 0.000 0.000 -vd 0.000 0.000 1.000 -vu 0.000 1.000

0.000 -vh 29.341 -vv 32.204 -x 300 -y 300 -vs -0.500 -vl -0.500 -vo 100.000

> -vtv -vp 0.000 0.000 0.000 -vd 0.000 0.000 1.000 -vu 0.000 1.000

0.000 -vh 29.341 -vv 32.204 -x 300 -y 300 -vs 0.500 -vl -0.500 -vo 100.000

> -vtv -vp 0.000 0.000 0.000 -vd 0.000 0.000 1.000 -vu 0.000 1.000

0.000 -vh 29.341 -vv 32.204 -x 300 -y 300 -vs -0.500 -vl 0.500 -vo 100.000

> -vtv -vp 0.000 0.000 0.000 -vd 0.000 0.000 1.000 -vu 0.000 1.000

0.000 -vh 29.341 -vv 32.204 -x 300 -y 300 -vs 0.500 -vl 0.500 -vo 100.000

ToString()[source]

Overwrite .NET ToString.

add_fore_clip(distance)[source]

Set view fore clip (-vo) at a distance from the view point.

The plane will be perpendicular to the view direction for perspective and parallel view types. For fisheye view types, the clipping plane is actually a clipping sphere, centered on the view point with radius val. Objects in front of this imaginary surface will not be visible. This may be useful for seeing through walls (to get a longer perspective from an exterior view point) or for incremental rendering. A value of zero implies no foreground clipping. A negative value produces some interesting effects, since it creates an inverted image for objects behind the viewpoint.

calculate_view_grid(x_div_count=1, y_div_count=1)[source]

Return a list of views for grid of views.

Views will be returned row by row from right to left. :param x_div_count: Set number of divisions in x direction (Default: 1). :param y_div_count: Set number of divisions in y direction (Default: 1).

Returns

A tuple of views. Views are sorted row by row from right to left.

get_view_dimension(max_x=None, max_y=None)[source]

Get dimensions for this view as x, y.

This method is same as vwrays -d

property isView

Return True for view.

property name

View name.

save_to_file(working)[source]

Save view to a file.

to_rad_string()[source]

Return full Radiance definition.

view_direction = (0, 0, 1)

Set the view direction (-vd) vector to (x, y, z).

view_h_size = None

Set the view horizontal size (-vs). For a perspective projection (including fisheye views), val is the horizontal field of view (in degrees). For a parallel projection, val is the view width in world coordinates.

view_lift = None

Set the view lift (-vl) to a value. This is the amount the actual image will be lifted up from the specified view.

view_point = (0, 0, 0)

Set the view point (-vp) to (x, y, z).

view_shift = None

Set the view shift (-vs). This is the amount the actual image will be shifted to the right of the specified view.

property view_type

Set and get view type (-vt) to one of the choices below (0-5). 0: Perspective (v), 1: Hemispherical fisheye (h), 2: Parallel (l), 3: Cylindrical panorma (c), 4: Angular fisheye (a), 5: Planisphere [stereographic] projection (s)

view_up_vector = (0, 1, 0)

Set the view up (-vu) vector (vertical direction) to (x, y, z).

view_v_size = None

Set the view vertical size (-vv). For a perspective projection (including fisheye views), val is the horizontal field of view (in degrees). For a parallel projection, val is the view width in world coordinates.

x_resolution = None

Set the maximum x resolution (-x).

y_resolution = None

Set the maximum y resolution (-y).