Moving grid axes are now synchronised automatically

This commit is contained in:
Dion Moult
2021-10-28 19:35:22 +11:00
parent b67d56ada1
commit 72d9bc9256
3 changed files with 42 additions and 0 deletions
+15
View File
@@ -41,6 +41,7 @@ def replace_variables(value):
@given("an empty Blender session")
@when("an empty Blender session")
def an_empty_ifc_project():
IfcStore.purge()
bpy.ops.wm.read_homefile(app_template="")
@@ -140,6 +141,12 @@ def the_object_name_is_selected(name):
additionally_the_object_name_is_selected(name)
@given(parsers.parse('the object "{name}" is moved to "{location}"'))
@when(parsers.parse('the object "{name}" is moved to "{location}"'))
def the_object_name_is_selected(name, location):
the_object_name_exists(name).location += Vector([float(co) for co in location.split(",")])
@given(parsers.parse('the object "{name}" is placed in the collection "{collection}"'))
@when(parsers.parse('the object "{name}" is placed in the collection "{collection}"'))
def the_object_name_is_placed_in_the_collection_collection(name, collection):
@@ -428,6 +435,14 @@ def the_object_name_is_at_location(name, location):
).length < 0.1, f"Object is at {obj_location}"
@then(parsers.parse('the object "{name}" bottom left corner is at "{location}"'))
def the_object_name_is_at_location(name, location):
obj_corner = Vector(the_object_name_exists(name).bound_box[0])
assert (
obj_corner - Vector([float(co) for co in location.split(",")])
).length < 0.1, f"Object has corner {obj_corner}"
@then(parsers.parse('the object "{name}" is contained in "{container_name}"'))
def the_object_name_is_contained_in_container_name(name, container_name):
ifc = an_ifc_file_exists()