mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 03:05:33 +00:00
Add tests for boundary
This commit is contained in:
@@ -676,6 +676,14 @@ class AddBoundary(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
+ tool.Ifc.get().by_type("IfcVirtualElement")
|
+ tool.Ifc.get().by_type("IfcVirtualElement")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for building_element in building_elements:
|
||||||
|
if obj := tool.Ifc.get_object(building_element):
|
||||||
|
if tool.Ifc.is_moved(obj):
|
||||||
|
bonsai.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=obj)
|
||||||
|
|
||||||
|
if tool.Ifc.is_moved(space_obj):
|
||||||
|
bonsai.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=space_obj)
|
||||||
|
|
||||||
# Don't generate boundaries of building elements that we've already got bounaries for.
|
# Don't generate boundaries of building elements that we've already got bounaries for.
|
||||||
for boundary in space.BoundedBy:
|
for boundary in space.BoundedBy:
|
||||||
if boundary.RelatedBuildingElement in building_elements:
|
if boundary.RelatedBuildingElement in building_elements:
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ markers =
|
|||||||
aggregate
|
aggregate
|
||||||
attribute
|
attribute
|
||||||
boolean
|
boolean
|
||||||
|
boundary
|
||||||
brick
|
brick
|
||||||
bsdd
|
bsdd
|
||||||
classification
|
classification
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
@boundary
|
||||||
|
Feature: Boundary
|
||||||
|
|
||||||
|
Scenario: Add boundary from space
|
||||||
|
Given an empty IFC project
|
||||||
|
And I load the demo construction library
|
||||||
|
And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType"
|
||||||
|
And the variable "element_type" is "[e for e in {ifc}.by_type('IfcWallType') if e.Name == 'WAL100'][0].id()"
|
||||||
|
And I set "scene.BIMModelProperties.relating_type_id" to "{element_type}"
|
||||||
|
And I press "bim.add_occurrence"
|
||||||
|
And the cursor is at "1.1,0,0"
|
||||||
|
And I press "bim.add_occurrence"
|
||||||
|
And the object "IfcWall/Wall.001" is selected
|
||||||
|
And I press "bim.hotkey(hotkey='S_R')"
|
||||||
|
And the cursor is at "0,.9,0"
|
||||||
|
And I press "bim.add_occurrence"
|
||||||
|
And the cursor is at "-1,0,0"
|
||||||
|
And I press "bim.add_occurrence"
|
||||||
|
And the object "IfcWall/Wall.003" is selected
|
||||||
|
And I press "bim.hotkey(hotkey='S_R')"
|
||||||
|
And the object "IfcWall/Wall.003" is moved to "0,0,0"
|
||||||
|
And the cursor is at "0.5,0.5,0"
|
||||||
|
And I deselect all objects
|
||||||
|
And I press "bim.generate_space"
|
||||||
|
When I select the object "IfcSpace/Space"
|
||||||
|
And I press "bim.add_boundary"
|
||||||
|
Then the object "IfcRelSpaceBoundary/None" exists
|
||||||
|
And the object "IfcRelSpaceBoundary/None.001" exists
|
||||||
|
And the object "IfcRelSpaceBoundary/None.002" exists
|
||||||
|
And the object "IfcRelSpaceBoundary/None.003" exists
|
||||||
@@ -731,3 +731,27 @@ Scenario: Create a MEP bend between intersecting segments at the same location
|
|||||||
And the object "IfcDuctSegment/Seg2" dimensions are "0.4,0.2,4.5"
|
And the object "IfcDuctSegment/Seg2" dimensions are "0.4,0.2,4.5"
|
||||||
And the object "IfcDuctFitting/DuctFitting" is at "0.0, 0.5, 1.0"
|
And the object "IfcDuctFitting/DuctFitting" is at "0.0, 0.5, 1.0"
|
||||||
And the object "IfcDuctFitting/DuctFitting" dimensions are "0.7, 0.2, 0.7"
|
And the object "IfcDuctFitting/DuctFitting" dimensions are "0.7, 0.2, 0.7"
|
||||||
|
|
||||||
|
Scenario: Generate a space from cursor location
|
||||||
|
Given an empty IFC project
|
||||||
|
And I load the demo construction library
|
||||||
|
And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType"
|
||||||
|
And the variable "element_type" is "[e for e in {ifc}.by_type('IfcWallType') if e.Name == 'WAL100'][0].id()"
|
||||||
|
And I set "scene.BIMModelProperties.relating_type_id" to "{element_type}"
|
||||||
|
And I press "bim.add_occurrence"
|
||||||
|
And the cursor is at "1.1,0,0"
|
||||||
|
And I press "bim.add_occurrence"
|
||||||
|
And the object "IfcWall/Wall.001" is selected
|
||||||
|
And I press "bim.hotkey(hotkey='S_R')"
|
||||||
|
And the cursor is at "0,.9,0"
|
||||||
|
And I press "bim.add_occurrence"
|
||||||
|
And the cursor is at "-1,0,0"
|
||||||
|
And I press "bim.add_occurrence"
|
||||||
|
And the object "IfcWall/Wall.003" is selected
|
||||||
|
And I press "bim.hotkey(hotkey='S_R')"
|
||||||
|
And the object "IfcWall/Wall.003" is moved to "0,0,0"
|
||||||
|
When the cursor is at "0.5,0.5,0"
|
||||||
|
And I deselect all objects
|
||||||
|
And I press "bim.generate_space"
|
||||||
|
Then the object "IfcSpace/Space" exists
|
||||||
|
And the object "IfcSpace/Space" dimensions are "1,0.8,3"
|
||||||
|
|||||||
Reference in New Issue
Block a user