'4': 'Sky View' } if all_required_inputs(ghenv.Component) and _run: # process the view_type_ and set the default values vt_str = VIEW_TYPES[_view_type] _resolution_ = _resolution_ if _resolution_ is not None else 1 _offset_dist_ = _offset_dist_ if _offset_dist_ is not None \ else 0.1 / conversion_to_meters() if _geo_block_ is None: _geo_block_ = True if vt_str in ('Sky Exposure', 'Sky View') else False # create the gridded mesh from the geometry study_mesh = to_joined_gridded_mesh3d(_geometry, _grid_size, _offset_dist_) points = [from_point3d(pt) for pt in study_mesh.face_centroids] hide_output(ghenv.Component, 1) # get the view vectors based on the view type patch_wghts = None if vt_str == 'Horizontal Radial': lb_vecs = view_sphere.horizontal_radial_vectors(30 * _resolution_) elif vt_str == 'Horizontal 30-Degree Offset': patch_mesh, lb_vecs = view_sphere.horizontal_radial_patches( 30, _resolution_) patch_wghts = view_sphere.horizontal_radial_patch_weights( 30, _resolution_) elif vt_str == 'Spherical': patch_mesh, lb_vecs = view_sphere.sphere_patches(_resolution_) patch_wghts = view_sphere.sphere_patch_weights(_resolution_) else: patch_mesh, lb_vecs = view_sphere.dome_patches(_resolution_)
for seg in windrose.orientation_lines] freq_line = [from_polygon2d(poly, _center_pt_.z) for poly in windrose.frequency_lines] windrose_lines = [from_polygon2d(poly, _center_pt_.z) for poly in windrose.windrose_lines] fac = (i + 1) * windrose.compass_radius * 3 center_pt_2d = Point2D(_center_pt_.x + fac, _center_pt_.y) # collect everything to be output mesh.append(msh) all_compass.append(compass) all_orient_line.append(orient_line) all_freq_line.append(freq_line) all_windrose_lines.append(windrose_lines) all_legends.append(legend) title.append(titl) calm = windrose.zero_count if isinstance(speed_data.header.data_type, Speed) else None calm_hours.append(calm) histogram.append(objectify_output('WindRose {}'.format(i), windrose.histogram_data)) # convert nested lists into data trees compass = list_to_data_tree(all_compass) orient_line = list_to_data_tree(all_orient_line) freq_line = list_to_data_tree(all_freq_line) windrose_line = list_to_data_tree(all_windrose_lines) legend = list_to_data_tree(all_legends) hide_output(ghenv.Component, 5) # keep the devault visual simple # compute direction angles and prevailing direction theta = 180.0 / windrose._number_of_directions angles = [(angle + theta) % 360.0 for angle in windrose.angles[:-1]] prevailing = windrose.prevailing_direction