diff --git a/src/blenderbim/Makefile b/src/blenderbim/Makefile index 84b93701ca..fc2c644ea3 100644 --- a/src/blenderbim/Makefile +++ b/src/blenderbim/Makefile @@ -115,7 +115,7 @@ endif cp -r blenderbim/* dist/blenderbim/ # Provides IfcOpenShell Python functionality - cd dist/working && wget https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-$(PYNUMBER)-v0.7.0-1b1fd1e-$(PLATFORM)64.zip + cd dist/working && wget https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-$(PYNUMBER)-v0.7.0-cb8cfd7-$(PLATFORM)64.zip cd dist/working && unzip ifcopenshell-python* cp -r dist/working/ifcopenshell dist/blenderbim/libs/site/packages/ diff --git a/src/blenderbim/blenderbim/tool/georeference.py b/src/blenderbim/blenderbim/tool/georeference.py index 5a22ab5c42..2c92eb2729 100644 --- a/src/blenderbim/blenderbim/tool/georeference.py +++ b/src/blenderbim/blenderbim/tool/georeference.py @@ -242,7 +242,7 @@ class Georeference(blenderbim.core.tool.Georeference): @classmethod def set_ifc_grid_north(cls): - x_angle = -bpy.context.scene.sun_pos_properties.north_offset + x_angle = bpy.context.scene.sun_pos_properties.north_offset props = bpy.context.scene.BIMGeoreferenceProperties props.map_conversion.get("XAxisAbscissa").string_value = str(cos(x_angle)) props.map_conversion.get("XAxisOrdinate").string_value = str(sin(x_angle)) diff --git a/src/blenderbim/test/tool/test_georeference.py b/src/blenderbim/test/tool/test_georeference.py index 028ab83d44..4dd8661e25 100644 --- a/src/blenderbim/test/tool/test_georeference.py +++ b/src/blenderbim/test/tool/test_georeference.py @@ -334,9 +334,21 @@ class TestSetIfcGridNorth(NewFile): subject.set_ifc_grid_north() assert round(float(props.map_conversion.get("XAxisAbscissa").string_value), 3) == 1.0 assert round(float(props.map_conversion.get("XAxisOrdinate").string_value), 3) == 0.0 + bpy.context.scene.sun_pos_properties.north_offset = math.radians(-45) + subject.set_ifc_grid_north() + assert round(float(props.map_conversion.get("XAxisAbscissa").string_value), 3) == 0.707 + assert round(float(props.map_conversion.get("XAxisOrdinate").string_value), 3) == -0.707 bpy.context.scene.sun_pos_properties.north_offset = math.radians(45) subject.set_ifc_grid_north() assert round(float(props.map_conversion.get("XAxisAbscissa").string_value), 3) == 0.707 + assert round(float(props.map_conversion.get("XAxisOrdinate").string_value), 3) == 0.707 + bpy.context.scene.sun_pos_properties.north_offset = math.radians(135) + subject.set_ifc_grid_north() + assert round(float(props.map_conversion.get("XAxisAbscissa").string_value), 3) == -0.707 + assert round(float(props.map_conversion.get("XAxisOrdinate").string_value), 3) == 0.707 + bpy.context.scene.sun_pos_properties.north_offset = math.radians(-135) + subject.set_ifc_grid_north() + assert round(float(props.map_conversion.get("XAxisAbscissa").string_value), 3) == -0.707 assert round(float(props.map_conversion.get("XAxisOrdinate").string_value), 3) == -0.707 @@ -354,4 +366,16 @@ class TestSetBlenderGridNorth(NewFile): props.map_conversion.get("XAxisAbscissa").string_value = "0.707" props.map_conversion.get("XAxisOrdinate").string_value = "-0.707" subject.set_blender_grid_north() + assert round(math.degrees(bpy.context.scene.sun_pos_properties.north_offset)) == -45 + props.map_conversion.get("XAxisAbscissa").string_value = "0.707" + props.map_conversion.get("XAxisOrdinate").string_value = "0.707" + subject.set_blender_grid_north() assert round(math.degrees(bpy.context.scene.sun_pos_properties.north_offset)) == 45 + props.map_conversion.get("XAxisAbscissa").string_value = "-0.707" + props.map_conversion.get("XAxisOrdinate").string_value = "0.707" + subject.set_blender_grid_north() + assert round(math.degrees(bpy.context.scene.sun_pos_properties.north_offset)) == 135 + props.map_conversion.get("XAxisAbscissa").string_value = "-0.707" + props.map_conversion.get("XAxisOrdinate").string_value = "-0.707" + subject.set_blender_grid_north() + assert round(math.degrees(bpy.context.scene.sun_pos_properties.north_offset)) == -135 diff --git a/src/ifcopenshell-python/ifcopenshell/util/geolocation.py b/src/ifcopenshell-python/ifcopenshell/util/geolocation.py index 2018f51702..85a23b6120 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/geolocation.py +++ b/src/ifcopenshell-python/ifcopenshell/util/geolocation.py @@ -114,7 +114,7 @@ def global2local(matrix, eastings, northings, orthogonal_height, x_axis_abscissa # Used for converting the X and Y vectors of the X Axis in IFC grid north geolocation def xaxis2angle(x, y): - return math.degrees(math.atan2(y, x)) + return math.degrees(math.atan2(y, x)) * -1 # Used for converting the X and Y vectors of the Y Axis in IFC true north geolocation