mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 02:31:09 +00:00
black .
This commit is contained in:
@@ -174,7 +174,7 @@ class TestGetCartesianPointCoordinateOffset(NewFile):
|
||||
props = bpy.context.scene.BIMGeoreferenceProperties
|
||||
props.has_blender_offset = True
|
||||
obj.BIMObjectProperties.cartesian_point_offset = "1,2,3"
|
||||
assert np.allclose(subject.get_cartesian_point_offset(obj), np.array((1., 2., 3.)))
|
||||
assert np.allclose(subject.get_cartesian_point_offset(obj), np.array((1.0, 2.0, 3.0)))
|
||||
|
||||
def test_get_null_if_not_a_cartesian_point_offset_type(self):
|
||||
obj = bpy.data.objects.new("Object", None)
|
||||
|
||||
@@ -250,14 +250,16 @@ class TestGenerateSpace(NewFile):
|
||||
mesh = space.data
|
||||
assert isinstance(mesh, bpy.types.Mesh)
|
||||
assert len(mesh.vertices) == 8
|
||||
TEST_VERTS = sorted((
|
||||
((5.0, 5.0, 10.0)),
|
||||
((-5.0, 5.0, 10.0)),
|
||||
((-5.0, -5.0, 10.0)),
|
||||
((5.0, -5.0, 10.0)),
|
||||
((-5.0, 5.0, 0.0)),
|
||||
((-5.0, -5.0, 0.0)),
|
||||
((5.0, 5.0, 0.0)),
|
||||
((5.0, -5.0, 0.0)),
|
||||
))
|
||||
TEST_VERTS = sorted(
|
||||
(
|
||||
((5.0, 5.0, 10.0)),
|
||||
((-5.0, 5.0, 10.0)),
|
||||
((-5.0, -5.0, 10.0)),
|
||||
((5.0, -5.0, 10.0)),
|
||||
((-5.0, 5.0, 0.0)),
|
||||
((-5.0, -5.0, 0.0)),
|
||||
((5.0, 5.0, 0.0)),
|
||||
((5.0, -5.0, 0.0)),
|
||||
)
|
||||
)
|
||||
assert np.allclose(TEST_VERTS, sorted([tuple(v.co) for v in mesh.vertices]))
|
||||
|
||||
@@ -52,7 +52,9 @@ class TestAddPorts(NewFile):
|
||||
for port, expected_matrix in zip(ports, expected_matrices, strict=True):
|
||||
port_matrix = tool.Model.get_element_matrix(port)
|
||||
port_matrix.translation *= si_conversion
|
||||
assert np.allclose(port_matrix, expected_matrix, atol=1.0e-5), f"Matrix does not match:\n{port_matrix}\n{expected_matrix}"
|
||||
assert np.allclose(
|
||||
port_matrix, expected_matrix, atol=1.0e-5
|
||||
), f"Matrix does not match:\n{port_matrix}\n{expected_matrix}"
|
||||
|
||||
def test_run(self):
|
||||
# default use
|
||||
|
||||
Reference in New Issue
Block a user