Test edit object placement. See #1711

This commit is contained in:
Dion Moult
2021-10-04 13:14:38 +11:00
parent cd965fd4a9
commit 6e6cbcef6f
16 changed files with 192 additions and 49 deletions
@@ -1,9 +1,11 @@
class Usecase:
def __init__(self, file, **settings):
self.file = file
self.settings = {"unit_type": "LENGTHUNIT", "name": "METRE"}
self.settings = {"unit_type": "LENGTHUNIT", "name": "METRE", "prefix": None}
for key, value in settings.items():
self.settings[key] = value
def execute(self):
return self.file.create_entity("IfcSIUnit", UnitType=self.settings["unit_type"], Name=self.settings["name"])
return self.file.create_entity(
"IfcSIUnit", UnitType=self.settings["unit_type"], Name=self.settings["name"], Prefix=self.settings["prefix"]
)
@@ -53,7 +53,7 @@ def local2global(matrix, eastings, northings, orthogonal_height, x_axis_abscissa
x /= np.linalg.norm(x)
y = np.cross(np.array([0, 0, 1]), x)
intermediate = (
np.matrix(
np.array(
[
[x[0], y[0], 0, 0],
[x[1], y[1], 0, 0],
@@ -81,7 +81,7 @@ def global2local(matrix, eastings, northings, orthogonal_height, x_axis_abscissa
result[2, 3] = (result[2, 3] - orthogonal_height) / scale
return (
np.linalg.inv(
np.matrix(
np.array(
[
[x[0], y[0], 0, 0],
[x[1], y[1], 0, 0],