Skip to content

Commit

Permalink
fix(graphic): Updating visualization components to work with core lib…
Browse files Browse the repository at this point in the history
…rary changes
  • Loading branch information
chriswmackey authored and Chris Mackey committed Jun 7, 2019
1 parent f191551 commit 8368ff5
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 20 deletions.
20 changes: 10 additions & 10 deletions plugin/grasshopper/src/LadybugPlus_Color Mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@

ghenv.Component.Name = "LadybugPlus_Color Mesh"
ghenv.Component.NickName = 'colorMesh'
ghenv.Component.Message = 'VER 0.0.04\nJUN_03_2019'
ghenv.Component.Message = 'VER 0.0.04\nJUN_06_2019'
ghenv.Component.Category = "LadybugPlus"
ghenv.Component.SubCategory = "03 :: Extra"
ghenv.Component.AdditionalHelpFromDocStrings = "1"

try:
from ladybug.resultmesh import ResultMesh
from ladybug.graphic import GraphicContainer
from ladybug_rhino.togeometry import to_mesh3d
from ladybug_rhino.fromgeometry import from_mesh3d
from ladybug_rhino.fromobjects import legend_objects
Expand All @@ -59,19 +59,19 @@
if offset_dom_:
lb_mesh = lb_mesh.height_field_mesh(
_values, (offset_dom_.T0, offset_dom_.T1))
res_mesh = ResultMesh(_values, lb_mesh, legend_par_)
graphic = GraphicContainer(_values, lb_mesh.min, lb_mesh.max, legend_par_)

# generate titles
if legend_title_ is not None:
res_mesh.legend_parameters.title = legend_title_
graphic.legend_parameters.title = legend_title_
if global_title_ is not None:
title = text_objects(global_title_, res_mesh.lower_title_location,
res_mesh.legend_parameters.text_height,
res_mesh.legend_parameters.font)
title = text_objects(global_title_, graphic.lower_title_location,
graphic.legend_parameters.text_height,
graphic.legend_parameters.font)

# draw rhino objects
lb_mesh = res_mesh.colored_mesh
lb_mesh.colors = graphic.value_colors
mesh = from_mesh3d(lb_mesh)
legend = legend_objects(res_mesh.legend)
legend = legend_objects(graphic.legend)
colors = [color_to_color(col) for col in lb_mesh.colors]
legend_par = res_mesh.legend_parameters
legend_par = graphic.legend_parameters
23 changes: 13 additions & 10 deletions plugin/grasshopper/src/LadybugPlus_Legend Parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
minimum of the values associated with the legend will be used.
max_: A number to set the upper boundary of the legend. If None, the
maximum of the values associated with the legend will be used.
num_segs_: An interger representing the number of steps between
seg_count_: An interger representing the number of steps between
the high and low boundary of the legend. The default is set to 11
and any custom values input in here should always be greater than or
equal to 2.
Expand Down Expand Up @@ -57,7 +57,7 @@

ghenv.Component.Name = "LadybugPlus_Legend Parameters"
ghenv.Component.NickName = 'legendPar'
ghenv.Component.Message = 'VER 0.0.04\nMAY_31_2019'
ghenv.Component.Message = 'VER 0.0.04\nJUN_06_2019'
ghenv.Component.Category = "LadybugPlus"
ghenv.Component.SubCategory = "03 :: Extra"
ghenv.Component.AdditionalHelpFromDocStrings = "1"
Expand All @@ -74,11 +74,14 @@
if base_plane_:
base_plane_ = to_plane(base_plane_)

leg_par = LegendParameters(min=min_, max=max_, number_of_segments=num_segs_,
colors=colors_, continuous_legend=continuous_leg_,
number_decimal_places=num_decimals_,
include_larger_smaller=larger_smaller_,
vertical_or_horizontal=vert_or_horiz_,
base_plane=base_plane_,
segment_height=seg_height_, segment_width=seg_width_,
text_height=text_height_, font=font_)
leg_par = LegendParameters(min=min_, max=max_, segment_count=seg_count_,
colors=colors_, base_plane=base_plane_)

leg_par.continuous_legend = continuous_leg_
leg_par.decimal_count = num_decimals_
leg_par.include_larger_smaller = larger_smaller_
leg_par.vertical = vert_or_horiz_
leg_par.segment_height = seg_height_
leg_par.segment_width = seg_width_
leg_par.text_height = text_height_
leg_par.font = font_
Binary file modified plugin/grasshopper/userObjects/LadybugPlus_Color Mesh.ghuser
Binary file not shown.
Binary file not shown.
Binary file modified plugin/grasshopper/userObjects/Ladybug_Generate Point Grid.ghuser
Binary file not shown.

0 comments on commit 8368ff5

Please sign in to comment.