Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Rob2309
Copy link
Contributor

@Rob2309 Rob2309 commented Aug 3, 2025

Changes

This PR makes the door and window tools place objects on the side of a wall that was actually clicked on.
Previously, the door / window would always be placed on the baseline of the wall, which seems unintuitive to me.
The door/window will also be oriented in a way that always makes the same side protrude out of the wall side.

The flip tool (shift + f) now also moves doors and windows to the other side of a wall when flipping them. For example, if a door protudes 1cm out of the wall, flipping it will make it protude 1cm out of the other side of the wall, instead of flipping it in place.
This could also be split out into a new tool if the behavior of the flip tool should stay unchanged.

The occurrence preview was also updated to match the actual orientation of the created occurrence (at least for every edge case I could think of). This also applies to non-door/window elements.

Door / Window Tool

Before image image The door is placed on the wrong side of the wall. The preview does not match the final positioning.
After image image The door is placed on the side of the wall that was actually clicked on. The preview matches the final positioning.

BuildingStorey display

This PR also fixes displaying the door/window on the default storey height, even if snapped to another storey.

Before image The door is shown on the default storey, which does not match its final location
After image The door is correctly shown on the storey of wall it is snapped to

Flip tool

Before image image The door is flipped in place. The door would now open into the wall
After image image The door is flipped and moved to the other side of the wall. The door still opens to the outside of the wall.

@theoryshaw
Copy link
Member

very cool!
...
If you're in this headspace, would suggest looking at this one too..
#3254

@Rob2309
Copy link
Contributor Author

Rob2309 commented Aug 4, 2025

very cool! ... If you're in this headspace, would suggest looking at this one too.. #3254

Will take a look at this :)

@Rob2309
Copy link
Contributor Author

Rob2309 commented Aug 4, 2025

very cool! ... If you're in this headspace, would suggest looking at this one too.. #3254

It seems like this PR also fixes #3254, at least with my quick tests.

@theoryshaw
Copy link
Member

Cool I will try too...
....
This also a relevant discussion
https://community.osarch.org/discussion/1422/how-to-mirror-an-element

@Rob2309
Copy link
Contributor Author

Rob2309 commented Aug 4, 2025

Cool I will try too... .... This also a relevant discussion https://community.osarch.org/discussion/1422/how-to-mirror-an-element

I already thought about adding a separate "door mirror" operator that changes the handedness and actually mirrors the door instead of rotating it. However, this should probably be a separate PR to keep this one concise.

@theoryshaw
Copy link
Member

This might play into it as well, to have a more generic solution...
#4432

@theoryshaw
Copy link
Member

It seems like this PR also fixes #3254, at least with my quick tests.

yes, seems to work great! thank you.

@Rob2309
Copy link
Contributor Author

Rob2309 commented Aug 7, 2025

I just opened another PR (#7003) that further builds on this PR and allows mirroring doors and other products.
It's a separate PR to allow merging this one without having to resolve all issues with mirroring.

@theoryshaw
Copy link
Member

I defer to @Andrej730 on the ultimate pull here.

@theoryshaw
Copy link
Member

theoryshaw commented Aug 8, 2025

The other aspect (and I don't even think the original functionality accomodated) is when flipping a door/window/etc, it would be nice if the attached IfcOpeningElement flipped as well. There are a lot of times in design, the IfcOpeningElement is multi-faceted, and not just a simple extrusion.

test file:
door flipping - Copy.ifc.txt

20250808_1251.2.mp4

@Rob2309
Copy link
Contributor Author

Rob2309 commented Aug 8, 2025

Did not think about this yet. I will work on that :)

@theoryshaw
Copy link
Member

Awesome.
Also there's this that might be related: #6392
Sorry for piling on. :) I just want to inform the roadmap. As you can see the plumbing on these changes runs deep. :)

@Rob2309
Copy link
Contributor Author

Rob2309 commented Aug 8, 2025

Awesome. Also there's this that might be related: #6392 Sorry for piling on. :) I just want to inform the roadmap. As you can see the plumbing on these changes runs deep. :)

Just for my understanding, how do you associate a custom opening with an object type?

@Rob2309
Copy link
Contributor Author

Rob2309 commented Aug 8, 2025

I just pushed a commit that copies the flipped objects matrix to the opening. This will result in it having the same position. For your test file this seems to work well. I am not quite sure if always setting the same position is correct though.

@theoryshaw
Copy link
Member

Just for my understanding, how do you associate a custom opening with an object type?

The only way i know how, is to convert an extrusion to a tessellation...
If i understood your question, correctly.

20250808_1512.mp4

@Rob2309
Copy link
Contributor Author

Rob2309 commented Aug 8, 2025

The only way i know how, is to convert an extrusion to a tessellation...
If i understood your question, correctly.

Ok I think I just found out how you do it. You just edit the opening and bonsai reuses this edited opening even for newly placed windows of the same type, correct?

@theoryshaw
Copy link
Member

correct.

@Rob2309
Copy link
Contributor Author

Rob2309 commented Aug 8, 2025

Ok I just tested a bit more, the opening positioning seems to work ok for all cases I could think of...

@theoryshaw
Copy link
Member

theoryshaw commented Aug 8, 2025

The only other thing i can think of is accomodating sloped walls or slabs, but what's here is awesome enough. Thanks!

@Rob2309
Copy link
Contributor Author

Rob2309 commented Aug 8, 2025

I would need to get familiar with sloped walls first, but I could try to add this in the future...

@Rob2309 Rob2309 mentioned this pull request Aug 12, 2025
@Rob2309
Copy link
Contributor Author

Rob2309 commented Aug 16, 2025

Is there anything that needs to be done before this PR can be merged?

@theoryshaw
Copy link
Member

I think this is great, but differ to @Andrej730 for the ultimate review, and pull.

@Andrej730
Copy link
Contributor

@Rob2309

Looks good to me.

A few notes:

  1. Please apply black formatting - https://docs-unstable.bonsaibim.org/guides/development/code_style.html
  2. Euler((0, 0, radians(180.0))).to_matrix().to_4x4() - please use Matrix.Rotation for simplicity.

@Rob2309
Copy link
Contributor Author

Rob2309 commented Aug 18, 2025

Thanks for the feedback, the suggested changes should now be included.

@Andrej730 Andrej730 merged commit ef24bb5 into IfcOpenShell:v0.8.0 Aug 19, 2025
2 of 3 checks passed
@Andrej730
Copy link
Contributor

Thank you.

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.

3 participants