mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Test edit object placement. See #1711
This commit is contained in:
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user