示例#1
0
class UndergroundCeiling(SurfaceTypeBase):
    """Underground Ceiling."""

    typeId = 1.5
    """Surface type id."""
    radiance_material = Plastic.by_single_reflect_value("generic_wall", 0.5)
    """Default Radiance material."""
示例#2
0
    def from_json(cls, srf_json):
        """Create a surface from json object.

        The minimum schema is:
            {"name": "",
            "vertices": [[(x, y, z), (x1, y1, z1), (x2, y2, z2)]],
            "surface_material": {},  // radiance material json file
             "surface_type": null  // 0: wall, 5: window
            }
        """
        name = srf_json["name"]
        vertices = srf_json["vertices"]
        type_id = srf_json["surface_type"]
        srf_type = surfacetype.SurfaceTypes.get_type_by_key(type_id)
        HBsrf = cls(name, vertices, srf_type)
        # Check material type and determine appropriate "from_json" classmethod
        if "surface_material" in srf_json.keys():
            material_json = srf_json["surface_material"]
            type = material_json["type"]
            if type == "plastic":
                radiance_material = Plastic.from_json(material_json)
            elif type == "metal":
                radiance_material = Metal.from_json(material_json)
            elif type == "glass":
                radiance_material = Glass.from_json(material_json)
            else:
                # raise ValueError "The material type {} in the surface json is either
                # not currently suported or incorrect"
                # .format(srf_json["surface_material"])
                radiance_material = None
            HBsrf.radiance_material = radiance_material
        return HBsrf
示例#3
0
class Floor(SurfaceTypeBase):
    """Floor."""

    typeId = 2.0
    """Surface type id."""
    radiance_material = Plastic.by_single_reflect_value("generic_floor", 0.20)
    """Default Radiance material."""
示例#4
0
class Roof(SurfaceTypeBase):
    """Roof."""

    typeId = 1.0
    """Surface type id."""
    radiance_material = Plastic.by_single_reflect_value("generic_roof", 0.80)
    """Default Radiance material."""
示例#5
0
class Wall(SurfaceTypeBase):
    """Wall."""

    typeId = 0.0
    """Surface type id."""
    radiance_material = Plastic.by_single_reflect_value("generic_wall", 0.50)
    """Default Radiance material."""
示例#6
0
    def from_json(cls, srf_json):
        """Create a surface from json object.

        The minimum schema is:
            {"name": "",
            "vertices": [[(x, y, z), (x1, y1, z1), (x2, y2, z2)]],
            "surface_material": {},  // radiance material json file
             "surface_type": null  // 0: wall, 5: window
            }
        """
        name = srf_json["name"]
        vertices = srf_json["vertices"]
        type_id = srf_json["surface_type"]
        srf_type = surfacetype.SurfaceTypes.get_type_by_key(type_id)
        HBsrf = cls(name, vertices, srf_type)
        # Check material type and determine appropriate "from_json" classmethod
        if "surface_material" in srf_json.keys():
            material_json = srf_json["surface_material"]
            type = material_json["type"]
            if type == "plastic":
                radiance_material = Plastic.from_json(material_json)
            elif type == "metal":
                radiance_material = Metal.from_json(material_json)
            elif type == "glass":
                radiance_material = Glass.from_json(material_json)
            else:
                # raise ValueError "The material type {} in the surface json is either
                # not currently suported or incorrect"
                # .format(srf_json["surface_material"])
                radiance_material = None
            HBsrf.radiance_material = radiance_material
        return HBsrf
示例#7
0
class Context(SurfaceTypeBase):
    """Context surfaces."""

    typeId = 6
    """Surface type id."""
    radiance_material = Plastic.by_single_reflect_value(
        "generic_shading", 0.35)
    """Default Radiance material."""
示例#8
0
class Ceiling(SurfaceTypeBase):
    """Ceiling."""

    typeId = 3
    """Surface type id."""
    radiance_material = Plastic.by_single_reflect_value(
        "generic_ceiling", 0.80)
    """Default Radiance material."""
示例#9
0
class ExposedFloor(SurfaceTypeBase):
    """Exposed Floor.

    Part of the floor/slab the is cantilevered.
    """

    typeId = 2.75
    """Surface type id."""
    radiance_material = Plastic.by_single_reflect_value("generic_floor", 0.20)
    """Default Radiance material."""
示例#10
0
class SlabOnGrade(SurfaceTypeBase):
    """Slab on Grade.

    Any floor that is touching the ground. z=0
    """

    typeId = 2.5
    """Surface type id."""
    radiance_material = Plastic.by_single_reflect_value("generic_floor", 0.20)
    """Default Radiance material."""
示例#11
0
class UndergroundSlab(SurfaceTypeBase):
    """Underground slab.

    Any floor that is located under ground (z < 0)
    """

    typeId = 2.25
    """Surface type id."""
    radiance_material = Plastic.by_single_reflect_value("generic_floor", 0.20)
    """Default Radiance material."""