Exemplo n.º 1
0
 def __init__(self,
              name,
              sorted_points,
              surface_type=None,
              is_name_set_by_user=False,
              is_type_set_by_user=False,
              states=None):
     """Initialize Honeybee Surface."""
     self._childSurfaces = ()
     self._states = []
     if not name:
         name = util.random_name()
         is_name_set_by_user = False
     self.name = (name, is_name_set_by_user)
     """Surface name."""
     self.points = sorted_points
     """A list of points as tuples or lists of (x, y, z).
     Points should be sorted. This class won't sort the points.
     (e.g. ((0, 0, 0), (10, 0, 0), (0, 10, 0)))
     """
     self.surface_type = (surface_type, is_type_set_by_user)
     """Surface type."""
     self.state = 0
     """Current state of the surface."""
     states = states or \
         (SurfaceState('default', SurfaceProperties(self.surface_type)),)
     for state in states:
         self.add_surface_state(state)
Exemplo n.º 2
0
    def from_rad_ep_properties(cls,
                               name,
                               sorted_points,
                               surface_type=None,
                               is_name_set_by_user=False,
                               is_type_set_by_user=False,
                               rad_properties=None,
                               ep_properties=None,
                               states=None):
        """Initialize Honeybee Surface.

        RadianceProperties and EPProperties will be used to create the initial state.
        """
        states = states or ()
        # create the surface first to get the surface type if not available
        _cls = cls(name, sorted_points, surface_type, is_name_set_by_user,
                   is_type_set_by_user)
        # replace the default properties for the initial state
        sp = SurfaceProperties(_cls.surface_type, rad_properties,
                               ep_properties)
        _cls._states[0] = SurfaceState('default', sp)

        for state in states:
            _cls.add_surface_state(state)

        return _cls
Exemplo n.º 3
0
    def __init__(self,
                 name,
                 sorted_points=None,
                 is_name_set_by_user=False,
                 rad_properties=None,
                 ep_properties=None,
                 states=None):
        """Init honeybee surface."""
        _surface_type = 5
        _is_type_set_by_user = True
        sorted_points = sorted_points or []

        states = states or ()
        HBAnalysisSurface.__init__(self, name, sorted_points, _surface_type,
                                   is_name_set_by_user, _is_type_set_by_user)

        sp = SurfaceProperties(self.surface_type, rad_properties,
                               ep_properties)
        self._states[0] = SurfaceState('default', sp)
        for state in states:
            self.add_surface_state(state)

        self.__isChildSurface = True
        # Parent will be set once the fen surface is added to a prent surface
        self._parent = None
        self._isCreatedFromGeo = False
Exemplo n.º 4
0
    def __init__(self, name, sorted_points=[], surface_type=None,
                 is_name_set_by_user=False, is_type_set_by_user=False,
                 rad_properties=None, ep_properties=None, states=None):
        """Init honeybee surface."""
        states = states or ()

        HBAnalysisSurface.__init__(self, name, sorted_points, surface_type,
                                   is_name_set_by_user, is_type_set_by_user)

        sp = SurfaceProperties(self.surface_type, rad_properties, ep_properties)
        self._states[0] = SurfaceState('default', sp)
        for state in states:
            self.add_surface_state(state)

        self._parent = None
        self._child_surfaces = []
        self._is_created_from_geo = False
Exemplo n.º 5
0
    def __init__(self, name, sortedPoints=None, isNameSetByUser=False,
                 radProperties=None, epProperties=None, states=None):
        """Init honeybee surface."""
        _surfaceType = 5
        _isTypeSetByUser = True
        sortedPoints = sortedPoints or []

        states = states or ()
        HBAnalysisSurface.__init__(self, name, sortedPoints, _surfaceType,
                                   isNameSetByUser, _isTypeSetByUser)

        sp = SurfaceProperties(self.surfaceType, radProperties, epProperties)
        self._states[0] = SurfaceState('default', sp)
        for state in states:
            self.addSurfaceState(state)

        self.__isChildSurface = True
        # Parent will be set once the fen surface is added to a prent surface
        self._parent = None
Exemplo n.º 6
0
    def __init__(self,
                 name,
                 sortedPoints=[],
                 surfaceType=None,
                 isNameSetByUser=False,
                 isTypeSetByUser=False,
                 radProperties=None,
                 epProperties=None,
                 states=None):
        """Init honeybee surface."""
        states = states or ()
        HBAnalysisSurface.__init__(self, name, sortedPoints, surfaceType,
                                   isNameSetByUser, isTypeSetByUser)

        sp = SurfaceProperties(self.surfaceType, radProperties, epProperties)
        self._states[0] = SurfaceState('default', sp)
        for state in states:
            self.addSurfaceState(state)

        self._parent = None
        self._childSurfaces = []
Exemplo n.º 7
0
    def __init__(self,
                 name,
                 sorted_points=[],
                 is_name_set_by_user=False,
                 rad_properties=None,
                 ep_properties=None,
                 states=None):
        """Init honeybee surface."""
        _surface_type = 6
        _is_type_set_by_user = True

        states = states or ()
        HBAnalysisSurface.__init__(self, name, sorted_points, _surface_type,
                                   is_name_set_by_user, _is_type_set_by_user)

        sp = SurfaceProperties(self.surface_type, rad_properties,
                               ep_properties)
        self._states[0] = SurfaceState('default', sp)
        for state in states:
            self.add_surface_state(state)

        self.__isChildSurface = True
        self.__parent = None