Commit Graph

17211 Commits

Author SHA1 Message Date
Bruno Postle dbe2c541c7 Orientation slot feature now has limited scope
No support for setting up blender orientation slots for multiple
containers or for non-spatial elements.  Setting the default container
switches to an appropriate orientation slot if the orientation of this
container isn't global.
2025-03-22 08:40:20 +00:00
Bruno Postle 7d4a017c15 Don't create orientation slots for all spaces
Trying to create orientation slots for all spaces could potentially
involve a lot of duplicate method calls because blender has no way to
query the list of existing orientation slots, so we can't check to see
if setting a slot is necessary.

So this patch now simply creates/overwrites and uses a single
orientation slot whenever the user switches the default spatial
container, and then only if the spatial orientation is non-world.
2025-03-14 19:17:50 +00:00
Bruno Postle 14f5aa7c4f Merge branch 'v0.8.0' into orientation_slots 2025-02-24 22:07:27 +00:00
Bruno Postle c585c789ac Follow orientation through ContainedInStructure
create_orientation_slots() can be given an element and it will find the
highest matching parent product orientation via elements and/or
spatial elements
2025-02-24 21:53:42 +00:00
Bruno Postle 891752a569 Move blender object manipulation to inner loop
create_orientation_slots() can be called a lot of times recursively, so
only do creation and deletion of dummy objects when absolutely necessary
2025-02-24 19:56:37 +00:00
Bruno Postle 6faef6564e s/element/product/ in create_orientation_slots()
This method should work with anything that has an ObjectPlacement, ie.
an IfcProduct
2025-02-24 19:38:29 +00:00
Thomas Krijnen 70182d943d Update build_osx.yml 2025-02-24 17:11:01 +01:00
Andrej730 0bd4451ce9 Fix issue not cleaning up the mesh after 76277c35d2 bonsai-0.8.2-alpha2502241432 2025-02-24 19:31:36 +05:00
Andrej730 899ada0019 Fix purge unused types test after 3bb4243 bonsai-0.8.2-alpha2502241356 bonsai-0.8.2-alpha2502241354 bonsai-0.8.2-alpha2502241353 2025-02-24 18:52:35 +05:00
Andrej730 f6ae711f6c Fix feature tests failing due to AuthoringData changes
relating_type_id now relies on type_elements which relies on ifc_class_current and they wasn't updated when ifc_class was changed.

Typical failing test looked like "TypeError: bpy_struct: item.attr = val: expected a string enum, not int".
2025-02-24 18:52:35 +05:00
Andrej730 1d815cdb67 Fix issue reloading AuthoringData from workspace at every draw call
If data was already loaded for BIMTool ("all") this ` elif ifc_element_type == "all" and AuthoringData.data["ifc_element_type"] is not None:` would always fail and this `AuthoringData.data["ifc_element_type"] != ifc_element_type` would always result to True, constantly recalculating data on every draw call.

This may uncover some issues that were hidden by the constant update (e.g. the bug fixed in the next commit).

Simplified it so now ifc_element_type is almost always referring to either ifc class or None. It's still using "all" in the BIMTool itself but then it's converted to None when passed to draw methods.
2025-02-24 18:52:35 +05:00
Andrej730 ce6339869d Fix some feature tests 2025-02-24 18:52:35 +05:00
Andrej730 5eb9cb2ee4 len(get_inverse) -> get_total_inverses 2025-02-24 18:52:35 +05:00
Andrej730 6eda4e389c typing 2025-02-24 18:52:34 +05:00
Andrej730 0783f8082e black . 2025-02-24 18:52:34 +05:00
Thomas Krijnen 3854afb34d Update build-all.py; --force when fetch tags 2025-02-24 14:01:48 +01:00
Thomas Krijnen 0b2321f478 Add template keyword 2025-02-24 13:33:53 +01:00
Thomas Krijnen 5510fb1e3c Add constexpr 2025-02-24 13:30:45 +01:00
Thomas Krijnen 7331f7361f Workaround explicit in-class specialization to if constexpr #6206 2025-02-24 13:30:24 +01:00
Andrej730 e06684e274 Comment out outdated code #6200 bonsai-0.8.2-alpha2502241147 2025-02-24 16:46:32 +05:00
Andrej730 57d6e9b544 Fix error reassigning class for structural items bonsai-0.8.2-alpha2502241032 2025-02-24 15:15:54 +05:00
Andrej730 5fa0aa03e4 util.schema.is_a - use c++ implementation 2025-02-24 15:15:54 +05:00
Andrej730 1d2ac9426d Fix error during class reassignment after 43cc7a0 2025-02-24 15:15:54 +05:00
Andrej730 e79a85a4fd bim.edit_container_attributes - remove deprecated operator
Currently you can edit container name directly from spatial manager, so this operator is no longer needed (and it also was missing from UI either way).
2025-02-24 15:15:54 +05:00
Andrej730 076a6c152d fix typo 2025-02-24 15:15:54 +05:00
Andrej730 76277c35d2 Fix for 365393aa07
ahh, forgot that representation is already removed at this point
bonsai-0.8.2-alpha2502241001
2025-02-24 15:01:00 +05:00
Thomas Krijnen a81b4a7dbb Create build_all.yml 2025-02-24 10:30:49 +01:00
Andrej730 ee8a3927b4 Fix displaying some attr types names after e8cb9e7 #6216 bonsai-0.8.2-alpha2502240921 2025-02-24 14:20:49 +05:00
Andrej730 365393aa07 Fix #6209 after 67bac44 bonsai-0.8.2-alpha2502240902 2025-02-24 14:01:24 +05:00
Bruno Postle 62bd495a9e Create transform orientation slots #6128
Blender supports named UCS coordinate systems. Refreshing the spatial
decomposition panel now creates orientation slots for each unique
spatial element orientation.

Additionally, setting the default spatial container selects an
appropriate orientation slot. eg. if a building is rotated, selecting to
work in a storey will set the orientation to the building orientation.

These slots are only created/updated in the spatial decomposition panel,
maybe they should also be created when loading the file and other
places.

The blender API doesn't currently allow listing custom orientation slots
for deletion, so if a spatial element is deleted or renamed, the old
orientation slot will persist for the rest of the session.
2025-02-23 22:29:42 +00:00
Thomas Krijnen 9289e1d0cc Try catch to keep the people happy #6176 2025-02-23 15:50:31 +01:00
Thomas Krijnen c30b5cbc08 Add std::array typemap #6137 #6191 #6196 2025-02-23 15:22:36 +01:00
Thomas Krijnen 9736345d79 Test case #6173 2025-02-23 14:46:31 +01:00
Thomas Krijnen 5599e52184 Option to retain original edges in cgal for non-boolean non-face-with-voids inputs #6173 2025-02-23 14:46:10 +01:00
Andrej730 b93cbbf989 black . 2025-02-23 13:29:12 +00:00
Thomas Krijnen ce26af5a7e Use ProfileType in mapping #6175 2025-02-23 11:01:17 +01:00
Dion Moult 973c9e2ec9 See #1227. Implement axis updating for new wall join code. bonsai-0.8.2-alpha2502230759 2025-02-23 18:59:17 +11:00
Dion Moult 29a890662e See #6201. Another typing regression fix. bonsai-0.8.2-alpha2502230731 2025-02-23 18:30:58 +11:00
Dion Moult b42c3ba8c2 See #1227. Wall layer test script now supports atstart/atend combo test cases and materials. bonsai-0.8.2-alpha2502230628 2025-02-23 17:28:14 +11:00
Dion Moult a7509dbe29 See #1227. Experimental support for 3D layerset slicing. 2025-02-23 17:27:32 +11:00
Dion Moult 23158b1b7e Fix #6201. Regression in creating drawings due to typing in 67bac441ad bonsai-0.8.2-alpha2502230103 2025-02-23 12:02:50 +11:00
Richard Brice 8c16f394c1 Updates alignment api
Fixes mapping of vertical alignment parabola business logic to geometry. Adds creation function of h and v alignment. Adds stationing referent at start of alignment. Fixes utility functions
bonsai-0.8.2-alpha2502230028
2025-02-22 16:16:59 -08:00
Richard Brice 12f8a1f769 Adds utility to stringize station values 2025-02-22 16:15:00 -08:00
Richard Brice 7ffd2742d6 Fixes bug mapping geometry for IfcSectionedSolidHorizontal that was introduced in 26ba761 2025-02-22 16:11:10 -08:00
Richard Brice 6429fe34ed Implements IfcHierarchyHelper.addRelatedObject for IfcRelDefinesByType 2025-02-22 16:11:06 -08:00
Jonas Frei d38f56e82d fix: bug in initialization of gltf serialiser fixed 2025-02-22 15:31:45 +01:00
Dion Moult c549dea943 See #1227. Test script for priority-aware wall layer joins. bonsai-0.8.2-alpha2502220901 2025-02-22 20:01:17 +11:00
Andrej730 894c05e138 Fix old typo in 686f4a0 bonsai-0.8.2-alpha2502211346 2025-02-21 18:45:23 +05:00
Andrej730 92c2fc0b7f Fix errors regarding added PredefinedType to IfcAnnotations in IFC4X3 #6200
In IFC4X3 IfcAnnotation now has PredefinedType and checking ObjectType isn't enough.
2025-02-21 18:45:23 +05:00
Andrej730 ee2fa739bb remove_deep2 - fix traversing same element twice
(I hope I don't miss anything, no tests seem to fail and performance is increased significantly) but because `subelement_queue` initiated with the `traverse` all `element`'s subelements will be traversed inside `while` loop twice - once as a part of initial queue and another time when `element` is traversed inside the loop and all those elements added to the queue again.
Now we just initiate the `queue` with the `element` and it will be traversed inside the loop like any other element.
2025-02-21 18:45:12 +05:00