Skip to content

Commit

Permalink
fix(extra): Add the correct docstrings for set view
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey authored and Chris Mackey committed Mar 12, 2024
1 parent ccff8e5 commit ea21126
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
Binary file modified ladybug_grasshopper/icon/LB Set View.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions ladybug_grasshopper/json/LB_Set_View.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.7.0",
"version": "1.7.1",
"nickname": "SetView",
"outputs": [
[]
Expand All @@ -8,21 +8,21 @@
{
"access": "item",
"name": "_direction",
"description": "A sun vector from which the the Rhino view will be generated.\nUse the \"LB SunPath\" component to generate sun vectors.",
"description": "A vector for the direction that the viewport camera faces.",
"type": "Vector3d",
"default": null
},
{
"access": "item",
"name": "_position_",
"description": "The target point of the camera for the Rhino view that will be\ngenerated. This point should be close to the Rhino geometry that\nyou are interested in viewing from the sun. If no point is provided,\nthe Rhino origin will be used (0, 0, 0).",
"description": "A point for the position of the vieport camera in 3D space.\nIf no point is provided, the Rhino origin will be used (0, 0, 0).",
"type": "Point3d",
"default": null
},
{
"access": "item",
"name": "look_around_",
"description": "An optional interger for the width (in pixels) of the Rhino\nviewport that will be generated.",
"description": "Optional 2D point (aka. UV coordinates) to tilt the viewport\ncamera off from from the input _direction. Values for UV\ncoordinates must be between 0 and 1 and these correspond to a\ntilt of 90 degrees in either direction (with 0.5, 0.5 being\ncentered on the _direction). Inputting a native Grasshopper\nSlider MD component will allow the most control of view offsetting.",
"type": "Point3d",
"default": null
},
Expand All @@ -43,14 +43,14 @@
{
"access": "item",
"name": "lens_len_",
"description": "An optional interger for the height (in pixels) of the Rhino\nviewport that will be generated.",
"description": "An optional number that sets the lens length of the viewport\ncamera in mm. Typical values are around 20-50mm but wider angle\nviews can be achieved by lowering this number to 10 or less.\nIf unspecified, the lens length of the currently active Rhino\nviewport will be used.",
"type": "double",
"default": null
},
{
"access": "item",
"name": "mode_",
"description": "An optional text input for the display mode of the Rhino viewport\nthat will be generated. For example: Wireframe, Shaded, Rendered, etc.",
"description": "An optional text input for the display mode of the Rhino viewport\nthat will be generated. For example: Wireframe, Shaded, Rendered, etc.\nIf unspecified, the mode of the currenlty active Rhino viewport\nwill be used",
"type": "string",
"default": null
}
Expand Down
24 changes: 17 additions & 7 deletions ladybug_grasshopper/src/LB Set View.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,36 @@
-
Args:
_vector: A sun vector from which the the Rhino view will be generated.
Use the "LB SunPath" component to generate sun vectors.
_center_pt_: The target point of the camera for the Rhino view that will be
generated. This point should be close to the Rhino geometry that
you are interested in viewing from the sun. If no point is provided,
the Rhino origin will be used (0, 0, 0).
_direction: A vector for the direction that the viewport camera faces.
_position_: A point for the position of the vieport camera in 3D space.
If no point is provided, the Rhino origin will be used (0, 0, 0).
look_around_: Optional 2D point (aka. UV coordinates) to tilt the viewport
camera off from from the input _direction. Values for UV
coordinates must be between 0 and 1 and these correspond to a
tilt of 90 degrees in either direction (with 0.5, 0.5 being
centered on the _direction). Inputting a native Grasshopper
Slider MD component will allow the most control of view offsetting.
width_: An optional interger for the width (in pixels) of the Rhino
viewport that will be generated.
height_: An optional interger for the height (in pixels) of the Rhino
viewport that will be generated.
lens_len_: An optional number that sets the lens length of the viewport
camera in mm. Typical values are around 20-50mm but wider angle
views can be achieved by lowering this number to 10 or less.
If unspecified, the lens length of the currently active Rhino
viewport will be used.
mode_: An optional text input for the display mode of the Rhino viewport
that will be generated. For example: Wireframe, Shaded, Rendered, etc.
If unspecified, the mode of the currenlty active Rhino viewport
will be used
Returns:
report: The name of the viewport that was opened.
"""

ghenv.Component.Name = 'LB Set View'
ghenv.Component.NickName = 'SetView'
ghenv.Component.Message = '1.7.0'
ghenv.Component.Message = '1.7.1'
ghenv.Component.Category = 'Ladybug'
ghenv.Component.SubCategory = '4 :: Extra'
ghenv.Component.AdditionalHelpFromDocStrings = '2'
Expand Down
Binary file modified ladybug_grasshopper/user_objects/LB Set View.ghuser
Binary file not shown.

0 comments on commit ea21126

Please sign in to comment.