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

GH_UI_overhaul #169

Merged
merged 34 commits into from
Jan 24, 2024
Merged

GH_UI_overhaul #169

merged 34 commits into from
Jan 24, 2024

Conversation

obucklin
Copy link
Contributor

@obucklin obucklin commented Jan 17, 2024

This is a major rework of the Grasshopper UI.

I added two new Joint Rule components:
-TopologyRule allows users to define a joint type to be applied on a detected topology. This has default joints in case none are defined
-DirectRule allows users to directly define joints between a pair of beams.

I changed the Category rule component to take JointOption components as input instead of text tags.

I changed the Automatic rules component to process the new rule types. The rules are applied such that Direct rules override all other rules, and category rules override topology rules.

I added JointOptions class to connections/joint.py which is a container for joint type and kwargs for specific joint parameters

I added JointOption GH components for each implemented joint type, which act as the input to define joint type in the Rule components

I changed JointDefinition class, Assembly GH component, and Automatic Rules GH component to allow kwargs passthrough for joint parameters

What type of change is this?

  • Bug fix in a backwards-compatible manner.
  • New feature in a backwards-compatible manner.
  • Breaking change: bug fix or new feature that involve incompatible API changes.
  • Other (e.g. doc update, configuration, etc)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I added a line to the CHANGELOG.md file in the Unreleased section under the most fitting heading (e.g. Added, Changed, Removed).
  • I ran all tests on my computer and it's all green (i.e. invoke test).
  • I ran lint on my computer and there are no errors (i.e. invoke lint).
  • I added new functions/classes and made them available on a second-level import, e.g. compas_timber.datastructures.Beam.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)
    GH_UI_Sample.zip

@chenkasirer
Copy link
Contributor

@obucklin cool! can you attach a Rhino+GH doc which demonstrates the new UI?

@obucklin
Copy link
Contributor Author

@obucklin cool! can you attach a Rhino+GH doc which demonstrates the new UI?

yeah where do I do that?

@chenkasirer
Copy link
Contributor

@obucklin cool! can you attach a Rhino+GH doc which demonstrates the new UI?

yeah where do I do that?

you can zip them and drag and drop onto the main PR comment

@obucklin
Copy link
Contributor Author

@obucklin cool! can you attach a Rhino+GH doc which demonstrates the new UI?

yeah where do I do that?

you can zip them and drag and drop onto the main PR comment

OK Done. Also ready for review. Thanks!!

Copy link
Contributor

@chenkasirer chenkasirer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the new flow! left first round of comments.
Please run invoke format and invoke lint and fix any issues.

@@ -167,6 +167,14 @@ def __init__(self, beam):
self.processings = []
self._et_element = None


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to many spaces around method, run invoke format

@@ -167,6 +167,14 @@ def __init__(self, beam):
self.processings = []
self._et_element = None


def reference_surface_from_beam_face(self, beam_face):
""" Finds the reference surface with normal that matches the normal of the beam face argument"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parameters and Returns missing in docstring

CHANGELOG.md Show resolved Hide resolved
src/compas_timber/connections/l_butt.py Outdated Show resolved Hide resolved
src/compas_timber/connections/l_butt.py Outdated Show resolved Hide resolved
Comment on lines 15 to 18




Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lots of spaces. run auto-formatter

def comply(self, beams):
try:
return set(self.beams) == set(beams)
except KeyError:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When is a KeyError raised?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm good point. what kind of error should we raise? maybe comply should check for topo match...?

src/compas_timber/connections/joint.py Outdated Show resolved Hide resolved
Comment on lines +10 to +11
args = {"cutoff": Cutoff}
options = JointOptions(FrenchRidgeLapJoint, **args)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like FrenchRidgeLapJoint doesn't take a parameter cutoff:

def __init__(self, beam_a=None, beam_b=None, gap=0.0, frame=None, key=None):

Copy link
Contributor

@chenkasirer chenkasirer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

There's a couple of issues still open (rule priorities), but I think we can address them in other PRs since this one is big enough.

Pending the build (Actions) all completing fine, and assuming the concept is OK with everyone (e.g. @jonashaldemann) I say we can merge this.

@chenkasirer chenkasirer merged commit ce30cc9 into main Jan 24, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants