Skip to content

Commit

Permalink
Merge pull request #270 from gramaziokohler/icons_and_tool_palette
Browse files Browse the repository at this point in the history
default dimensions for Beams in Grasshopper Component
  • Loading branch information
chenkasirer authored Sep 6, 2024
2 parents 1dbfaac + 6c7fd6b commit 90a1b27
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 5 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/compas_timber/ghpython/components/CT_BeamDecompose/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 14 additions & 2 deletions src/compas_timber/ghpython/components/CT_Beam_fromCurve/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ def RunScript(self, centerline, z_vector, width, height, category, updateRefObj)
if not centerline:
self.AddRuntimeMessage(Warning, "Input parameter 'Centerline' failed to collect data")
if not width:
self.AddRuntimeMessage(Warning, "Input parameter 'Width' failed to collect data")
length = self._get_centerline_length(centerline)
width = [length / 20]
if not height:
self.AddRuntimeMessage(Warning, "Input parameter 'Height' failed to collect data")
length = self._get_centerline_length(centerline)
height = [length / 10]

# reformat unset parameters for consistency
if not z_vector:
Expand Down Expand Up @@ -96,3 +98,13 @@ def _get_guid_and_geometry(self, line):
guid = line
geometry = rhino_obj.Geometry
return guid, geometry

def _get_centerline_length(self, centerline):
centerline_length = []
for i in centerline:
centerline_length.append(rs.CurveLength(i))
if centerline_length:
length_average = sum(centerline_length) / len(centerline_length)
else:
length_average = 1
return length_average
Binary file modified src/compas_timber/ghpython/components/CT_Beam_fromCurve/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/compas_timber/ghpython/components/CT_DrillHole/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/compas_timber/ghpython/components/CT_Feature_Trim/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/compas_timber/ghpython/components/CT_FindByGuid/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/compas_timber/ghpython/components/CT_Model/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"name": "Beams",
"description": "Collection of Beams",
"typeHintID": "none",
"scriptParamAccess": 1
"scriptParamAccess": 1,
"flatten": true
},
{
"name": "JointRules",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/compas_timber/ghpython/components/CT_ShowBeamFaces/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/compas_timber/ghpython/components/CT_ShowBeamIndex/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nickname": "FeatureErrors",
"category": "COMPAS Timber",
"subcategory": "Show",
"description": "Shows infomation helpdul for debugging feature application errors.",
"description": "Shows information useful for debugging feature application errors.",
"exposure": 4,
"ghpython": {
"isAdvancedMode": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nickname": "JoiningErrors",
"category": "COMPAS Timber",
"subcategory": "Show",
"description": "Shows infomation helpful for debugging errors occured while attempting to join beams.",
"description": "Shows information useful for debugging errors that occurred while attempting to join beams.",
"exposure": 4,
"ghpython": {
"isAdvancedMode": true,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 90a1b27

Please sign in to comment.