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

Structure_Engine: flipping of bars fixed to take release into account #3447

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

pawelbaran
Copy link
Member

@pawelbaran pawelbaran commented Dec 15, 2024

Issues addressed by this PR

Closes #3446

Test files

On SharePoint

Changelog

  • Updated Bar.Flip() to include updates to the SectionProperty, ShapeProfile, Releases and OrientationAngle.

Additional comments

The KiteProfile is the only one I cannot get to work - we may need to add a MirrorAboutY property to it.

@pawelbaran pawelbaran added the type:bug Error or unexpected behaviour label Dec 15, 2024
@pawelbaran pawelbaran self-assigned this Dec 15, 2024
@pawelbaran pawelbaran requested a review from rwemay as a code owner December 15, 2024 13:47
@pawelbaran
Copy link
Member Author

@peterjamesnugent @IsakNaslundBh when working on this one, I started thinking whether the orientation angle should not be negated too? Not entirely sure about it, but a part of me argued for that - happy for you to take over this and make an informed decision 👍

@pawelbaran
Copy link
Member Author

@BHoMBot check required

Copy link

bhombot-ci bot commented Dec 15, 2024

@pawelbaran to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check core
  • check null-handling
  • check serialisation
  • check versioning
  • check installer

@pawelbaran
Copy link
Member Author

@BHoMBot check unit-tests
@BHoMBot check dataset-compliance
@BHoMBot check copyright-compliance

Copy link

bhombot-ci bot commented Dec 15, 2024

@pawelbaran to confirm, the following actions are now queued:

  • check unit-tests
  • check dataset-compliance
  • check copyright-compliance

Copy link
Member

@peterjamesnugent peterjamesnugent left a comment

Choose a reason for hiding this comment

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

Happy that the script works as intended, minor change for the code if you think it's worth changing.

I have added a check for a horizontal bar, happy this works for the BarRelease.

As discussed offline, the orientational angle should update too, this needs to be set dependent on whether Bar is vertical if not:

  • If Bar is vertical, newOrientationAngle = -orientationalAngle + pi()
  • If Bar is not vertical ,newOrientationAngle = -orientationAngle

I have added a bit in the script to show this.

@pawelbaran pawelbaran force-pushed the BHoM_Engine-#3446-FlipBarBug branch from 9157e9c to 7893070 Compare December 27, 2024 15:16
@IsakNaslundBh
Copy link
Contributor

There is a method here: https://github.com/BHoM/ETABS_Toolkit/blob/develop/Etabs_Adapter/CRUD/Create/Bar.cs that potentially could be migrated over. Covers most things I think, but still to be double checked that all things are covered. Mirroring of sections is one thing that might need a bit of attention I think, which is not handled in that method.

@pawelbaran
Copy link
Member Author

I feel like I am least informed of us three @IsakNaslundBh @peterjamesnugent - is there a chance you could agree between your duo on how to finalise this PR? To me anything would work 😉

Copy link

bhombot-ci bot commented Jan 13, 2025

@pawelbaran just to let you know, I have provided a check-installer result to this Pull Request as it was detected to be linked to other Pull Requests in a series. The comment which triggered this check came from @BHoMBot on ETABS_Toolkit

Copy link

bhombot-ci bot commented Jan 13, 2025

The check installer has already been run previously and recorded as a successful check. This check has not been run again at this time.

@peterjamesnugent peterjamesnugent added the status:WIP PR in progress and still in draft, not ready for formal review label Jan 13, 2025
@peterjamesnugent peterjamesnugent self-assigned this Jan 13, 2025
Copy link
Contributor

@IsakNaslundBh IsakNaslundBh left a comment

Choose a reason for hiding this comment

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

See some comments below. Think general work on sections make sense.

One alternative approach to the general filtering for if a profile should be flipped or not, that would be broadening the scope of this though, is to add a new Quary method in spatial engine for IProfile, returning the level of symmetry for the profile. Would then also need to add an enum that is specifying this level of symmetry though, but then you ifstatement could be changed to something like if(profile.ISymmetry() = Symmetry.DoubleSymetric) => return oldprofile.

Not sure if that is widening the scope to much for this though, but just a thought, as I think that potentially could be useful elsewhere as well.

Comment on lines +201 to +202
Base.Compute.RecordError("The given shape profile does not have a FlipProfile method implemented.");
return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Would change this to a warning and return the old profile.

}
private static IProfile FlipProfile(KiteProfile oldProfile)
{
return oldProfile;
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is problematic, might be good to add a warning about it, or let it fallback to the other method

@@ -86,6 +120,87 @@ public static Stem Flip(this Stem stem)

return flipped;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Need method separator lines between all methods /***************************************************/

ISectionProperty flippedSectionProperty = Flip(bar.SectionProperty);
flipped.SectionProperty = flippedSectionProperty;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Think the offset also need to be handled here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:WIP PR in progress and still in draft, not ready for formal review type:bug Error or unexpected behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Structure_Engine: Bar.Flip() does not flip the release
3 participants