Skip to content

Structure_Engine: Fixed problem with mirroring and flipping tapered bar - #3625

Open
Iain11 wants to merge 4 commits into
developfrom
BHoM_Engine-#3616-new-fixing-problem-with-mirroring-and-flipping-tapered-bar--#3622
Open

Iain11 wants to merge 4 commits into
developfrom
BHoM_Engine-#3616-new-fixing-problem-with-mirroring-and-flipping-tapered-bar--#3622

Conversation

@Iain11

@Iain11 Iain11 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Issues addressed by this PR

Spatial_Engine: Mirror doesn't return correct extrusion for tapered bar
New PR due to merging the old one with branch

Closes #3616

Reversed the order in which values are assigned to keys for the different heights of a tapered bar when mirrored.

Test files

Mirror

Flip

@Iain11 Iain11 added the type:bug Error or unexpected behaviour label Oct 9, 2026
@Iain11 Iain11 self-assigned this Oct 9, 2026
@Iain11 Iain11 changed the title BHoM_Engine #3616 fixing problem with mirroring and flipping tapered bar BHoM_Engine #3616 fixing problem with mirroring and flipping tapered bar new Oct 9, 2026
@peterjamesnugent peterjamesnugent changed the title BHoM_Engine #3616 fixing problem with mirroring and flipping tapered bar new Geometry_Engine #3616 fixing problem with mirroring and flipping tapered bar new Nov 2, 2026
@peterjamesnugent peterjamesnugent changed the title Geometry_Engine #3616 fixing problem with mirroring and flipping tapered bar new Structure_Engine #3616 fixing problem with mirroring and flipping tapered bar new Nov 2, 2026

@IsakNaslundBh IsakNaslundBh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the issue with this is that it fixes one issue (mirror) but introduces another.

The Flip method has the intention of the Bar staying identical in terms of how it functions and works, that is, it is supposed to essentially meant to be the same bar, just with order of things reversed.

The mirror on the other hand I think should flip the section along the length of the bar.

So, will need to differentiate the two cases, as I think what we have now is correct for flip.

This should solve the issues of the profile being mirrored, when using the flip method.
@Iain11 Iain11 changed the title Structure_Engine #3616 fixing problem with mirroring and flipping tapered bar new Structure_Engine: fixed problem with mirroring and flipping tapered bar Nov 25, 2026
@Iain11 Iain11 changed the title Structure_Engine: fixed problem with mirroring and flipping tapered bar Structure_Engine: Fixed problem with mirroring and flipping tapered bar Nov 25, 2026

@IsakNaslundBh IsakNaslundBh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Think the general structure looks good.

See some comments below.

While at this, could you also have a look at the reinforcement of the ConcreteSection and check if it needs a similar fix?

You could try to create some ConcreteSection with like Longitudinal/Perimiter reinforcement that does not run all the way, and check that it works after Flip/Mirror.

You can call the ReinforcingBars method to check how it looks before and after.

Comment thread Structure_Engine/Modify/Flip.cs Outdated
[Input("bar", "The Bar to flip.")]
[Output("bar", "The Bar with flipped end Nodes.")]
public static Bar Flip(this Bar bar)
public static Bar Flip(this Bar bar, Boolean isMirroring = false)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Role this back I think. Dont think we want this as an input here (unless @peterjamesnugent told you to add this in).

Comment thread Structure_Engine/Modify/Flip.cs Outdated
if (bar.SectionProperty != null)
{
ISectionProperty flippedSectionProperty = Flip(bar.SectionProperty);
ISectionProperty flippedSectionProperty = Flip(bar.SectionProperty, isMirroring);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
ISectionProperty flippedSectionProperty = Flip(bar.SectionProperty, isMirroring);
ISectionProperty flippedSectionProperty = Flip(bar.SectionProperty, false);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is if we remove the isMirroring on the Bar input

Comment thread Structure_Engine/Modify/Flip.cs Outdated
/***************************************************/

private static ISectionProperty Flip(this ISectionProperty section)
private static ISectionProperty Flip(this ISectionProperty section, Boolean isMirroring)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
private static ISectionProperty Flip(this ISectionProperty section, Boolean isMirroring)
private static ISectionProperty Flip(this ISectionProperty section, bool isMirroring)

please change all others as well

Comment thread Structure_Engine/Modify/Flip.cs Outdated
Comment on lines +450 to +451
flippedProfiles.Reverse();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
flippedProfiles.Reverse();
}
}
flippedProfiles.Reverse();

The reverse needs to happen avter the foreach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Error or unexpected behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spatial_Engine: Mirror doesn't return correct extrusion for tapered bar

2 participants