Exemplo n.º 1
0
def test_to_from_dict_with_states():
    """Test the Shade from_dict method with radiance properties."""
    pts = (Point3D(0, 0, 0), Point3D(0, 0, 3), Point3D(1, 0,
                                                       3), Point3D(1, 0, 0))
    shd = Shade('TreeTrunk', Face3D(pts))
    shd1 = StateGeometry.from_vertices(
        'tree_foliage1', [[0, 0, 5], [2, 0, 5], [2, 2, 5], [0, 2, 5]])
    shd2 = StateGeometry.from_vertices(
        'tree_foliage2', [[0, 0, 5], [-2, 0, 5], [-2, 2, 5], [0, 2, 5]])

    trans1 = Glass.from_single_transmittance('TreeTrans1', 0.5)
    trans2 = Glass.from_single_transmittance('TreeTrans2', 0.27)
    trans3 = Glass.from_single_transmittance('TreeTrans3', 0.14)
    trans4 = Glass.from_single_transmittance('TreeTrans4', 0.01)

    tr1 = RadianceShadeState(trans1)
    tr2 = RadianceShadeState(trans2)
    tr3 = RadianceShadeState(trans3, [shd1])
    tr4 = RadianceShadeState(trans4, [shd1.duplicate(), shd2])
    states = (tr1, tr2, tr3, tr4)

    shd.properties.radiance.dynamic_group_identifier = 'DeciduousTrees'
    shd.properties.radiance.states = states

    ad = shd.to_dict()
    new_shade = Shade.from_dict(ad)
    assert new_shade.properties.radiance.dynamic_group_identifier == \
        shd.properties.radiance.dynamic_group_identifier
    state_ids1 = [state.modifier for state in states]
    state_ids2 = [
        state.modifier for state in new_shade.properties.radiance.states
    ]
    assert state_ids1 == state_ids2
    assert new_shade.to_dict() == ad
Exemplo n.º 2
0
def test_to_from_dict_with_states():
    """Test the Door from_dict method with radiance properties."""
    dr = Door.from_vertices('front_door',
                            [[0, 0, 0], [10, 0, 0], [10, 0, 10], [0, 0, 10]])
    shd1 = StateGeometry.from_vertices(
        'wall_overhang1', [[0, 0, 10], [10, 0, 10], [10, 2, 10], [0, 2, 10]])
    shd2 = StateGeometry.from_vertices(
        'wall_overhang2', [[0, 0, 5], [10, 0, 5], [10, 2, 5], [0, 2, 5]])

    ecglass1 = Glass.from_single_transmittance('ElectrochromicState1', 0.4)
    ecglass2 = Glass.from_single_transmittance('ElectrochromicState2', 0.27)
    ecglass3 = Glass.from_single_transmittance('ElectrochromicState3', 0.14)
    ecglass4 = Glass.from_single_transmittance('ElectrochromicState4', 0.01)

    tint1 = RadianceSubFaceState(ecglass1)
    tint2 = RadianceSubFaceState(ecglass2)
    tint3 = RadianceSubFaceState(ecglass3, [shd1])
    tint4 = RadianceSubFaceState(ecglass4, [shd1.duplicate(), shd2])
    states = (tint1, tint2, tint3, tint4)

    dr.properties.radiance.dynamic_group_identifier = 'ElectrochromicDoor1'
    dr.properties.radiance.states = states

    drd = dr.to_dict()
    new_door = Door.from_dict(drd)
    assert new_door.properties.radiance.dynamic_group_identifier == \
        dr.properties.radiance.dynamic_group_identifier
    state_ids1 = [state.modifier for state in states]
    state_ids2 = [
        state.modifier for state in new_door.properties.radiance.states
    ]
    assert state_ids1 == state_ids2
    assert new_door.to_dict() == drd
Exemplo n.º 3
0
def test_to_from_dict_with_states():
    """Test the Aperture from_dict method with radiance properties."""
    ap = Aperture.from_vertices(
        'wall_aperture', [[0, 0, 0], [10, 0, 0], [10, 0, 10], [0, 0, 10]])
    shd1 = StateGeometry.from_vertices(
        'wall_overhang1', [[0, 0, 10], [10, 0, 10], [10, 2, 10], [0, 2, 10]])
    shd2 = StateGeometry.from_vertices(
        'wall_overhang2', [[0, 0, 5], [10, 0, 5], [10, 2, 5], [0, 2, 5]])

    ecglass1 = Glass.from_single_transmittance('ElectrochromicState1', 0.4)
    ecglass2 = Glass.from_single_transmittance('ElectrochromicState2', 0.27)
    ecglass3 = Glass.from_single_transmittance('ElectrochromicState3', 0.14)
    ecglass4 = Glass.from_single_transmittance('ElectrochromicState4', 0.01)

    tint1 = RadianceSubFaceState(ecglass1)
    tint2 = RadianceSubFaceState(ecglass2)
    tint3 = RadianceSubFaceState(ecglass3, [shd1])
    tint4 = RadianceSubFaceState(ecglass4, [shd1.duplicate(), shd2])
    states = (tint1, tint2, tint3, tint4)

    ap.properties.radiance.dynamic_group_identifier = 'ElectrochromicWindow1'
    ap.properties.radiance.states = states
    tint4.gen_geos_from_tmtx_thickness(0.05)

    ad = ap.to_dict()
    new_aperture = Aperture.from_dict(ad)
    assert new_aperture.properties.radiance.dynamic_group_identifier == \
        ap.properties.radiance.dynamic_group_identifier
    state_ids1 = [state.modifier for state in states]
    state_ids2 = [
        state.modifier for state in new_aperture.properties.radiance.states
    ]
    assert state_ids1 == state_ids2
    assert new_aperture.to_dict() == ad
Exemplo n.º 4
0
def test_set_states():
    """Test the setting of states on an Aperture."""
    pts = (Point3D(0, 0, 0), Point3D(0, 0, 3), Point3D(1, 0,
                                                       3), Point3D(1, 0, 0))
    ap = Aperture('TestWindow', Face3D(pts))
    shd1 = StateGeometry.from_vertices(
        'wall_overhang1', [[0, 0, 10], [10, 0, 10], [10, 2, 10], [0, 2, 10]])
    shd2 = StateGeometry.from_vertices(
        'wall_overhang2', [[0, 0, 5], [10, 0, 5], [10, 2, 5], [0, 2, 5]])

    ecglass1 = Glass.from_single_transmittance('ElectrochromicState1', 0.4)
    ecglass2 = Glass.from_single_transmittance('ElectrochromicState2', 0.27)
    ecglass3 = Glass.from_single_transmittance('ElectrochromicState3', 0.14)
    ecglass4 = Glass.from_single_transmittance('ElectrochromicState4', 0.01)

    tint1 = RadianceSubFaceState(ecglass1)
    tint2 = RadianceSubFaceState(ecglass2)
    tint3 = RadianceSubFaceState(ecglass3)
    tint4 = RadianceSubFaceState(ecglass4)
    states = (tint1, tint2, tint3, tint4)

    tint3.add_shade(shd1)
    with pytest.raises(AssertionError):
        tint4.add_shades([shd1, shd2])
    tint4.add_shades([shd1.duplicate(), shd2])

    with pytest.raises(AssertionError):
        tint1.gen_geos_from_tmtx_thickness(0.05)
    with pytest.raises(AssertionError):
        tint1.gen_geo_from_vmtx_offset(0.1)
    with pytest.raises(AssertionError):
        tint1.gen_geo_from_dmtx_offset(0.1)

    with pytest.raises(AssertionError):
        ap.properties.radiance.states = states
    ap.properties.radiance.dynamic_group_identifier = 'ElectrochromicWindow1'
    ap.properties.radiance.states = states

    for state in ap.properties.radiance.states:
        assert state.parent.identifier == 'TestWindow'

    new_ap = ap.duplicate()

    assert ap.properties.radiance.dynamic_group_identifier == \
        new_ap.properties.radiance.dynamic_group_identifier == 'ElectrochromicWindow1'
    assert len(new_ap.properties.radiance.states) == 4
    for i, state in enumerate(new_ap.properties.radiance.states):
        assert state.modifier.identifier == 'ElectrochromicState{}'.format(i +
                                                                           1)
    assert len(new_ap.properties.radiance.states[2].shades) == 1
    assert len(new_ap.properties.radiance.states[3].shades) == 2
Exemplo n.º 5
0
def shade_state_abridged_tree_foliage(directory):
    shd1 = StateGeometry.from_vertices(
        'tree_foliage1', [[0, 0, 5], [2, 0, 5], [2, 2, 5], [0, 2, 5]])
    shd2 = StateGeometry.from_vertices(
        'tree_foliage2', [[0, 0, 5], [-2, 0, 5], [-2, 2, 5], [0, 2, 5]])
    trans1 = Glass.from_single_transmittance('TreeTrans1', 0.5)
    trans2 = Glass.from_single_transmittance('TreeTrans2', 0.27)
    shd1.modifier = trans1
    shd2.modifier = trans2
    tr4 = RadianceShadeState(shades=[shd1, shd2])

    dest_file = os.path.join(directory, 'shade_state_abridged_tree_foliage.json')
    with open(dest_file, 'w') as fp:
        json.dump(tr4.to_dict(abridged=True), fp, indent=4)
Exemplo n.º 6
0
def reflect_state_shades():
    """Check to be sure that dynamic shades are reflected with their parent."""
    pts = (Point3D(1, 1, 2), Point3D(2, 1, 2), Point3D(2, 2,
                                                       2), Point3D(1, 2, 2))
    ap = Shade('TestShade', Face3D(pts))
    pts_1 = (Point3D(0, 0, 0), Point3D(2, 0, 0), Point3D(2, 2,
                                                         0), Point3D(0, 2, 0))
    shade = StateGeometry('RectangleShade', Face3D(pts_1))

    tint1 = RadianceShadeState(shades=[shade])
    ap.properties.radiance.dynamic_group_identifier = 'DeciduousTrees'
    ap.properties.radiance.states = [tint1]
    tint1.gen_geos_from_tmtx_thickness(0.05)

    new_ap = ap.duplicate()
    origin_1 = Point3D(1, 0, 2)
    normal_1 = Vector3D(1, 0, 0)
    plane_1 = Plane(normal_1, origin_1)
    new_ap.reflect(plane_1)
    new_shd = new_ap.properties.radiance.states[0].shades[0]
    assert new_shd.geometry[-1].x == pytest.approx(1, rel=1e-3)
    assert new_shd.geometry[-1].y == pytest.approx(1, rel=1e-3)
    assert new_shd.geometry[-1].z == pytest.approx(2, rel=1e-3)
    assert new_shd.geometry[1].x == pytest.approx(0, rel=1e-3)
    assert new_shd.geometry[1].y == pytest.approx(2, rel=1e-3)
    assert new_shd.geometry[1].z == pytest.approx(2, rel=1e-3)
Exemplo n.º 7
0
def rotate_state_shades():
    """Check to be sure that dynamic shades are rotated with their parent."""
    pts = (Point3D(0, 0, 2), Point3D(2, 0, 2), Point3D(2, 2,
                                                       2), Point3D(0, 2, 2))
    ap = Aperture('TestWindow', Face3D(pts))
    pts_1 = (Point3D(0, 0, 0), Point3D(2, 0, 0), Point3D(2, 2,
                                                         0), Point3D(0, 2, 0))
    shade = StateGeometry('RectangleShade', Face3D(pts_1))

    tint1 = RadianceSubFaceState(shades=[shade])
    ap.properties.radiance.dynamic_group_identifier = 'ElectrochromicWindow1'
    ap.properties.radiance.states = [tint1]
    tint1.gen_geos_from_tmtx_thickness(0.05)

    new_ap = ap.duplicate()
    origin = Point3D(0, 0, 0)
    axis = Vector3D(1, 0, 0)
    new_ap.rotate(axis, 180, origin)
    new_shd = new_ap.properties.radiance.states[0].shades[0]
    assert new_shd.geometry[0].x == pytest.approx(0, rel=1e-3)
    assert new_shd.geometry[0].y == pytest.approx(0, rel=1e-3)
    assert new_shd.geometry[0].z == pytest.approx(-2, rel=1e-3)
    assert new_shd.geometry[2].x == pytest.approx(2, rel=1e-3)
    assert new_shd.geometry[2].y == pytest.approx(-2, rel=1e-3)
    assert new_shd.geometry[2].z == pytest.approx(-2, rel=1e-3)
Exemplo n.º 8
0
def test_set_states():
    """Test the setting of states on a Shade."""
    pts = (Point3D(0, 0, 0), Point3D(0, 0, 3), Point3D(1, 0,
                                                       3), Point3D(1, 0, 0))
    shd = Shade('TreeTrunk', Face3D(pts))
    shd1 = StateGeometry.from_vertices(
        'tree_foliage1', [[0, 0, 5], [2, 0, 5], [2, 2, 5], [0, 2, 5]])
    shd2 = StateGeometry.from_vertices(
        'tree_foliage2', [[0, 0, 5], [-2, 0, 5], [-2, 2, 5], [0, 2, 5]])

    trans1 = Glass.from_single_transmittance('TreeTrans1', 0.5)
    trans2 = Glass.from_single_transmittance('TreeTrans2', 0.27)
    trans3 = Glass.from_single_transmittance('TreeTrans3', 0.14)
    trans4 = Glass.from_single_transmittance('TreeTrans4', 0.01)

    tr1 = RadianceShadeState(trans1)
    tr2 = RadianceShadeState(trans2)
    tr3 = RadianceShadeState(trans3)
    tr4 = RadianceShadeState(trans4)
    states = (tr1, tr2, tr3, tr4)

    tr3.add_shade(shd1)
    with pytest.raises(AssertionError):
        tr4.add_shades([shd1, shd2])
    tr4.add_shades([shd1.duplicate(), shd2])

    with pytest.raises(AssertionError):
        shd.properties.radiance.states = states
    shd.properties.radiance.dynamic_group_identifier = 'DeciduousTrees'
    shd.properties.radiance.states = states

    for state in shd.properties.radiance.states:
        assert state.parent.identifier == 'TreeTrunk'

    new_shd = shd.duplicate()

    assert shd.properties.radiance.dynamic_group_identifier == \
        new_shd.properties.radiance.dynamic_group_identifier == 'DeciduousTrees'
    assert len(new_shd.properties.radiance.states) == 4
    for i, state in enumerate(new_shd.properties.radiance.states):
        assert state.modifier.identifier == 'TreeTrans{}'.format(i + 1)
    assert len(new_shd.properties.radiance.states[2].shades) == 1
    assert len(new_shd.properties.radiance.states[3].shades) == 2
Exemplo n.º 9
0
def aperture_state_abridged_shades(directory):
    mod = Trans('DiffusingShade', 0.7, 0.7, 0.7, 0.01, 0, 0.45, 0.01)
    mod_dir = Glass.from_single_transmittance('DiffusingShadeDirect', 0.03)
    mod_shd = Plastic('ShadeMat', 0.65, 0.65, 0.65)
    pts_1 = (Point3D(0, 0, 0), Point3D(2, 0, 0), Point3D(2, 2, 0), Point3D(0, 2, 0))
    pts_2 = (Point3D(0, 0, 2), Point3D(2, 0, 0), Point3D(2, 2, 2), Point3D(0, 2, 2))
    shade1 = StateGeometry('RectangleShade1', Face3D(pts_1))
    shade2 = StateGeometry('RectangleShade2', Face3D(pts_2))
    shade1.modifier = mod_shd
    shade2.modifier = mod_shd
    rad_state = RadianceSubFaceState(mod, [shade1, shade2])
    rad_state.modifier_direct = mod_dir

    dest_file = os.path.join(directory, 'aperture_state_abridged_shades.json')
    with open(dest_file, 'w') as fp:
        json.dump(rad_state.to_dict(abridged=True), fp, indent=4)
Exemplo n.º 10
0
def scale_state_shades():
    """Check to be sure that dynamic shades are scaled with their parent."""
    pts = (Point3D(1, 1, 2), Point3D(2, 1, 2), Point3D(2, 2,
                                                       2), Point3D(1, 2, 2))
    ap = Shade('TestShade', Face3D(pts))
    pts_1 = (Point3D(0, 0, 0), Point3D(2, 0, 0), Point3D(2, 2,
                                                         0), Point3D(0, 2, 0))
    shade = StateGeometry('RectangleShade', Face3D(pts_1))

    tint1 = RadianceShadeState(shades=[shade])
    ap.properties.radiance.dynamic_group_identifier = 'DeciduousTrees'
    ap.properties.radiance.states = [tint1]
    tint1.gen_geo_from_vmtx_offset(0.05)
    tint1.gen_geo_from_dmtx_offset(0.1)

    new_ap = ap.duplicate()
    new_ap.scale(2)
    new_shd = new_ap.properties.radiance.states[0].shades[0]
    assert new_shd.geometry[0] == Point3D(2, 2, 4)
    assert new_shd.geometry[1] == Point3D(4, 2, 4)
    assert new_shd.geometry[2] == Point3D(4, 4, 4)
    assert new_shd.geometry[3] == Point3D(2, 4, 4)
Exemplo n.º 11
0
def move_state_shades():
    """Check to be sure that dynamic shades are moved with their parent."""
    pts = (Point3D(0, 0, 0), Point3D(0, 0, 3), Point3D(1, 0,
                                                       3), Point3D(1, 0, 0))
    ap = Shade('TestShade', Face3D(pts))
    pts_1 = (Point3D(0, 0, 0), Point3D(2, 0, 0), Point3D(2, 2,
                                                         0), Point3D(0, 2, 0))
    shade = StateGeometry('RectangleShade', Face3D(pts_1))

    tint1 = RadianceShadeState(shades=[shade])
    ap.properties.radiance.dynamic_group_identifier = 'DeciduousTrees'
    ap.properties.radiance.states = [tint1]
    tint1.gen_geos_from_tmtx_thickness(0.05)

    vec_1 = Vector3D(2, 2, 2)
    new_ap = ap.duplicate()
    new_ap.move(vec_1)
    new_shd = new_ap.properties.radiance.states[0].shades[0]
    assert new_shd.geometry[0] == Point3D(2, 2, 2)
    assert new_shd.geometry[1] == Point3D(4, 2, 2)
    assert new_shd.geometry[2] == Point3D(4, 4, 2)
    assert new_shd.geometry[3] == Point3D(2, 4, 2)
    from honeybee.typing import clean_and_id_rad_string, clean_rad_string
except ImportError as e:
    raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))

try:
    from honeybee_radiance.dynamic import StateGeometry
except ImportError as e:
    raise ImportError('\nFailed to import honeybee_radiance:\n\t{}'.format(e))

try:  # import the ladybug_rhino dependencies
    from ladybug_rhino.togeometry import to_face3d
    from ladybug_rhino.grasshopper import all_required_inputs
except ImportError as e:
    raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))


if all_required_inputs(ghenv.Component):
    geo = []  # list of geometries that will be returned

    # set default name
    name = clean_and_id_rad_string('StateGeo') if _name_ is None \
        else clean_and_id_rad_string(_name_)

    # create the StateGeometry
    i = 0  # iterator to ensure each geometry gets a unique name
    for rh_geo in _geo:
        for lb_face in to_face3d(rh_geo):
            hb_geo = StateGeometry('{}_{}'.format(name, i), lb_face, _modifier_)
            if _name_ is not None:
                hb_geo.display_name = _name_
            geo.append(hb_geo)
Exemplo n.º 13
0
def model_radiance_dynamic_states(directory):
    room = Room.from_box('Tiny_House_Zone', 5, 10, 3)
    garage = Room.from_box('Tiny_Garage', 5, 10, 3, origin=Point3D(5, 0, 0))

    south_face = room[3]
    south_face.apertures_by_ratio(0.5, 0.01)
    shd1 = StateGeometry.from_vertices(
        'outdoor_awning', [[0, 0, 2], [5, 0, 2], [5, 2, 2], [0, 2, 2]])

    ecglass1 = Glass.from_single_transmittance('ElectrochromicState1', 0.4)
    ecglass2 = Glass.from_single_transmittance('ElectrochromicState2', 0.27)
    ecglass3 = Glass.from_single_transmittance('ElectrochromicState3', 0.14)
    ecglass4 = Glass.from_single_transmittance('ElectrochromicState4', 0.01)

    tint1 = RadianceSubFaceState(ecglass1)
    tint2 = RadianceSubFaceState(ecglass2)
    tint3 = RadianceSubFaceState(ecglass3, [shd1])
    tint4 = RadianceSubFaceState(ecglass4, [shd1.duplicate()])
    states = (tint1, tint2, tint3, tint4)
    south_face.apertures[0].properties.radiance.dynamic_group_identifier = \
        'ElectrochromicWindow'
    south_face.apertures[0].properties.radiance.states = states

    shd2 = Shade.from_vertices('indoor_light_shelf',
                               [[0, 0, 2], [-1, 0, 2], [-1, 2, 2], [0, 2, 2]])
    ref_1 = Plastic.from_single_reflectance('outdoor_light_shelf_0.5', 0.5)
    ref_2 = Plastic.from_single_reflectance('indoor_light_shelf_0.70', 0.7)
    light_shelf_1 = RadianceShadeState(ref_1)
    light_shelf_2 = RadianceShadeState(ref_2)
    shelf_states = (light_shelf_1, light_shelf_2)
    shd2.properties.radiance.dynamic_group_identifier = 'DynamicLightShelf'
    shd2.properties.radiance.states = shelf_states
    room.add_indoor_shade(shd2)

    north_face = room[1]
    north_face.overhang(0.25, indoor=False)
    door_verts = [
        Point3D(2, 10, 0.1),
        Point3D(1, 10, 0.1),
        Point3D(1, 10, 2.5),
        Point3D(2, 10, 2.5)
    ]
    door = Door('Front_Door', Face3D(door_verts))
    north_face.add_door(door)

    aperture_verts = [
        Point3D(4.5, 10, 1),
        Point3D(2.5, 10, 1),
        Point3D(2.5, 10, 2.5),
        Point3D(4.5, 10, 2.5)
    ]
    aperture = Aperture('Front_Aperture', Face3D(aperture_verts))
    triple_pane = Glass.from_single_transmittance('custom_triple_pane_0.3',
                                                  0.3)
    aperture.properties.radiance.modifier = triple_pane
    north_face.add_aperture(aperture)

    tree_canopy_geo = Face3D.from_regular_polygon(
        6, 2, Plane(Vector3D(0, 0, 1), Point3D(5, -3, 4)))
    tree_canopy = Shade('Tree_Canopy', tree_canopy_geo)
    sum_tree_trans = Trans.from_single_reflectance('SummerLeaves', 0.3, 0.0,
                                                   0.1, 0.15, 0.15)
    win_tree_trans = Trans.from_single_reflectance('WinterLeaves', 0.1, 0.0,
                                                   0.1, 0.1, 0.6)
    summer = RadianceShadeState(sum_tree_trans)
    winter = RadianceShadeState(win_tree_trans)
    tree_canopy.properties.radiance.dynamic_group_identifier = 'DeciduousTree'
    tree_canopy.properties.radiance.states = (summer, winter)

    ground_geo = Face3D.from_rectangle(10, 10, Plane(o=Point3D(0, -10, 0)))
    ground = Shade('Ground', ground_geo)
    grass = Plastic.from_single_reflectance('grass', 0.3)
    snow = Plastic.from_single_reflectance('snow', 0.7)
    summer_ground = RadianceShadeState(grass)
    winter_ground = RadianceShadeState(snow)
    ground.properties.radiance.dynamic_group_identifier = 'SeasonalGround'
    ground.properties.radiance.states = (summer_ground, winter_ground)

    east_face = room[2]
    east_face.apertures_by_ratio(0.1, 0.01)
    west_face = garage[4]
    west_face.apertures_by_ratio(0.1, 0.01)
    Room.solve_adjacency([room, garage], 0.01)

    model = Model('Tiny_House', [room, garage],
                  orphaned_shades=[ground, tree_canopy])

    model_dict = model.to_dict(included_prop=['radiance'])

    dest_file = os.path.join(directory, 'model_radiance_dynamic_states.json')
    with open(dest_file, 'w') as fp:
        json.dump(model_dict, fp, indent=4)
Exemplo n.º 14
0
def test_writer_to_rad_folder_dynamic():
    """Test the Model to.rad_folder method with dynamic geometry."""
    room = Room.from_box('Tiny_House_Zone', 5, 10, 3)
    garage = Room.from_box('Tiny_Garage', 5, 10, 3, origin=Point3D(5, 0, 0))

    south_face = room[3]
    south_face.apertures_by_ratio(0.5, 0.01)
    shd1 = StateGeometry.from_vertices(
        'outdoor_awning', [[0, 0, 2], [5, 0, 2], [5, 2, 2], [0, 2, 2]])

    ecglass1 = Glass.from_single_transmittance('ElectrochromicState1', 0.4)
    ecglass2 = Glass.from_single_transmittance('ElectrochromicState2', 0.27)
    ecglass3 = Glass.from_single_transmittance('ElectrochromicState3', 0.14)
    ecglass4 = Glass.from_single_transmittance('ElectrochromicState4', 0.01)

    tint1 = RadianceSubFaceState(ecglass1)
    tint2 = RadianceSubFaceState(ecglass2)
    tint3 = RadianceSubFaceState(ecglass3, [shd1])
    tint4 = RadianceSubFaceState(ecglass4, [shd1.duplicate()])
    states = (tint1, tint2, tint3, tint4)
    south_face.apertures[0].properties.radiance.dynamic_group_identifier = \
        'ElectrochromicWindow'
    south_face.apertures[0].properties.radiance.states = states

    shd2 = Shade.from_vertices(
        'indoor_light_shelf', [[0, 0, 2], [-1, 0, 2], [-1, 2, 2], [0, 2, 2]])
    ref_1 = Plastic.from_single_reflectance('outdoor_light_shelf_0.5', 0.5)
    ref_2 = Plastic.from_single_reflectance('indoor_light_shelf_0.70', 0.7)
    light_shelf_1 = RadianceShadeState(ref_1)
    light_shelf_2 = RadianceShadeState(ref_2)
    shelf_states = (light_shelf_1, light_shelf_2)
    shd2.properties.radiance.dynamic_group_identifier = 'DynamicLightShelf'
    shd2.properties.radiance.states = shelf_states
    room.add_indoor_shade(shd2)

    north_face = room[1]
    north_face.overhang(0.25, indoor=False)
    door_verts = [Point3D(2, 10, 0.1), Point3D(1, 10, 0.1),
                  Point3D(1, 10, 2.5), Point3D(2, 10, 2.5)]
    door = Door('Front_Door', Face3D(door_verts))
    north_face.add_door(door)

    aperture_verts = [Point3D(4.5, 10, 1), Point3D(2.5, 10, 1),
                      Point3D(2.5, 10, 2.5), Point3D(4.5, 10, 2.5)]
    aperture = Aperture('Front_Aperture', Face3D(aperture_verts))
    triple_pane = Glass.from_single_transmittance('custom_triple_pane_0.3', 0.3)
    aperture.properties.radiance.modifier = triple_pane
    north_face.add_aperture(aperture)

    tree_canopy_geo = Face3D.from_regular_polygon(
        6, 2, Plane(Vector3D(0, 0, 1), Point3D(5, -3, 4)))
    tree_canopy = Shade('Tree_Canopy', tree_canopy_geo)
    sum_tree_trans = Trans.from_single_reflectance('SummerLeaves', 0.3, 0.0, 0.1, 0.15, 0.15)
    win_tree_trans = Trans.from_single_reflectance('WinterLeaves', 0.1, 0.0, 0.1, 0.1, 0.6)
    summer = RadianceShadeState(sum_tree_trans)
    winter = RadianceShadeState(win_tree_trans)
    tree_canopy.properties.radiance.dynamic_group_identifier = 'DeciduousTree'
    tree_canopy.properties.radiance.states = (summer, winter)

    ground_geo = Face3D.from_rectangle(10, 10, Plane(o=Point3D(0, -10, 0)))
    ground = Shade('Ground', ground_geo)
    grass = Plastic.from_single_reflectance('grass', 0.3)
    snow = Plastic.from_single_reflectance('snow', 0.7)
    summer_ground = RadianceShadeState(grass)
    winter_ground = RadianceShadeState(snow)
    ground.properties.radiance.dynamic_group_identifier = 'SeasonalGround'
    ground.properties.radiance.states = (summer_ground, winter_ground)

    east_face = room[2]
    east_face.apertures_by_ratio(0.1, 0.01)
    west_face = garage[4]
    west_face.apertures_by_ratio(0.1, 0.01)
    Room.solve_adjacency([room, garage], 0.01)

    model = Model('Tiny_House', [room, garage], orphaned_shades=[ground, tree_canopy])

    folder = os.path.abspath('./tests/assets/model/rad_folder_dynamic')
    model.to.rad_folder(model, folder)

    model_folder = ModelFolder(folder)

    ap_dir = model_folder.aperture_group_folder(full=True)
    assert os.path.isfile(os.path.join(ap_dir, 'states.json'))
    group_name = south_face.apertures[0].properties.radiance.dynamic_group_identifier
    assert os.path.isfile(os.path.join(ap_dir, '{}..black.rad'.format(group_name)))
    for i in range(len(south_face.apertures[0].properties.radiance.states)):
        d_file = (os.path.join(ap_dir, '{}..default..{}.rad'.format(group_name, i)))
        assert os.path.isfile(d_file)
    for i in range(len(south_face.apertures[0].properties.radiance.states)):
        d_file = (os.path.join(ap_dir, '{}..direct..{}.rad'.format(group_name, i)))
        assert os.path.isfile(d_file)

    out_scene_dir = model_folder.dynamic_scene_folder(full=True, indoor=False)
    assert os.path.isfile(os.path.join(out_scene_dir, 'states.json'))
    grp_name = tree_canopy.properties.radiance.dynamic_group_identifier
    for i in range(len(tree_canopy.properties.radiance.states)):
        d_file = (os.path.join(out_scene_dir, '{}..default..{}.rad'.format(grp_name, i)))
        assert os.path.isfile(d_file)
    for i in range(len(tree_canopy.properties.radiance.states)):
        d_file = (os.path.join(out_scene_dir, '{}..direct..{}.rad'.format(grp_name, i)))
        assert os.path.isfile(d_file)
    grp_name = ground.properties.radiance.dynamic_group_identifier
    for i in range(len(ground.properties.radiance.states)):
        d_file = (os.path.join(out_scene_dir, '{}..default..{}.rad'.format(grp_name, i)))
        assert os.path.isfile(d_file)
    for i in range(len(ground.properties.radiance.states)):
        d_file = (os.path.join(out_scene_dir, '{}..direct..{}.rad'.format(grp_name, i)))
        d_file = (os.path.join(out_scene_dir, '{}..direct..{}.rad'.format(grp_name, i)))
        assert os.path.isfile(d_file)

    in_scene_dir = model_folder.dynamic_scene_folder(full=True, indoor=True)
    assert os.path.isfile(os.path.join(in_scene_dir, 'states.json'))
    grp_name = shd2.properties.radiance.dynamic_group_identifier
    for i in range(len(shd2.properties.radiance.states)):
        d_file = (os.path.join(in_scene_dir, '{}..default..{}.rad'.format(grp_name, i)))
        assert os.path.isfile(d_file)
    for i in range(len(shd2.properties.radiance.states)):
        d_file = (os.path.join(in_scene_dir, '{}..direct..{}.rad'.format(grp_name, i)))
        assert os.path.isfile(d_file)

    # clean up the folder
    nukedir(folder, rmdir=True)