Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed surface model GH Components #284

Merged
merged 4 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Fixed `AttributeError` in `SurfaceModel`.
* Updated example scripts.
* Calling `process_joinery` in `SurfaceModel`.
* Renamed `ShowSurfaceModelBeamType` to `ShowBeamsByCategory`.
* Changed `SurfaceModel` component input handling to give warnings instead of errors.

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from compas_timber.design import DebugInfomation
from compas_timber.design import SurfaceModel


class SurfaceModelComponent(component):
def RunScript(self, surface, stud_spacing, beam_width, frame_depth, z_axis, options, CreateGeometry=False):
# minimum inputs required
Expand All @@ -22,7 +21,18 @@ def RunScript(self, surface, stud_spacing, beam_width, frame_depth, z_axis, opti
raise TypeError("Expected a compas.geometry.Surface, got: {}".format(type(surface)))
if not stud_spacing:
self.AddRuntimeMessage(Warning, "Input parameter 'spacing' failed to collect data")
if not isinstance(stud_spacing, float):
return
if stud_spacing is not None and not isinstance(stud_spacing, float):
raise TypeError("stud_spacing expected a float, got: {}".format(type(stud_spacing)))
if not beam_width:
self.AddRuntimeMessage(Warning, "Input parameter 'beam_width' failed to collect data")
return
if beam_width is not None and not isinstance(beam_width, float):
raise TypeError("stud_spacing expected a float, got: {}".format(type(stud_spacing)))
if not frame_depth:
self.AddRuntimeMessage(Warning, "Input parameter 'frame_depth' failed to collect data")
return
if frame_depth is not None and not isinstance(frame_depth, float):
raise TypeError("stud_spacing expected a float, got: {}".format(type(stud_spacing)))
if z_axis is not None and not isinstance(z_axis, RhinoVector):
raise TypeError("Expected a compas.geometry.Vector, got: {}".format(type(z_axis)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from compas_timber.ghpython.ghcomponent_helpers import rename_gh_output


class SurfaceModelJointRule(component):
class ShowBeamsByCategory(component):
def __init__(self):
super(SurfaceModelJointRule, self).__init__()
super(ShowBeamsByCategory, self).__init__()
self.beam_type = None
if ghenv.Component.Params.Output[0].NickName == "type":
self.joint_type = None
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "ShowSurfaceModelBeamTypes",
"name": "ShowBeamsByCategory",
"nickname": "ShowBeamType",
"category": "COMPAS Timber",
"subcategory": "Show",
"description": "allows user to visualize beam types in surface model.",
"description": "allows user to visualize beam categories in timber model.",
"exposure": 2,
"ghpython": {
"isAdvancedMode": true,
Expand Down
Loading