mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-18 11:20:21 +00:00
black .
This commit is contained in:
@@ -86,7 +86,7 @@ class MaterialCreator:
|
||||
|
||||
def parse_element_type_material_styles(self, element: ifcopenshell.entity_instance) -> None:
|
||||
if self.mesh["ios_materials"]:
|
||||
return # Already has materials assign to the representation itself
|
||||
return # Already has materials assign to the representation itself
|
||||
# Otherwise, we need to check for material styles on the element, since
|
||||
# create_shape on types only works on representations.
|
||||
context = tool.Ifc.get().by_id(self.mesh.BIMMeshProperties.ifc_definition_id).ContextOfItems
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -36,7 +36,11 @@ class TestIfc2Sql:
|
||||
TEST_FILE = Path(__file__).parent / "files" / "basic.ifc"
|
||||
tmp = tempfile.NamedTemporaryFile(delete=False, suffix=".ifcsqlite")
|
||||
sqlite_path = ifcpatch.execute(
|
||||
{"file": ifcopenshell.open(TEST_FILE), "recipe": "Ifc2Sql", "arguments": ["sqlite", None, None, None, tmp.name]}
|
||||
{
|
||||
"file": ifcopenshell.open(TEST_FILE),
|
||||
"recipe": "Ifc2Sql",
|
||||
"arguments": ["sqlite", None, None, None, tmp.name],
|
||||
}
|
||||
)
|
||||
assert isinstance(sqlite_path, str)
|
||||
assert sqlite_path.endswith(".ifcsqlite")
|
||||
|
||||
Reference in New Issue
Block a user