mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-03 05:22:06 +00:00
Forgot to commit these files for the georeferencing updates
This commit is contained in:
@@ -46,19 +46,11 @@ def edit_georeferencing(ifc, georeference):
|
|||||||
|
|
||||||
|
|
||||||
def get_cursor_location(georeference):
|
def get_cursor_location(georeference):
|
||||||
georeference.set_coordinates("local", georeference.get_cursor_location())
|
location = georeference.get_cursor_location()
|
||||||
|
if georeference.has_blender_offset:
|
||||||
|
georeference.set_coordinates("blender", location)
|
||||||
def convert_local_to_global(georeference):
|
else:
|
||||||
coordinates = georeference.xyz2enh(georeference.get_coordinates("local"))
|
georeference.set_coordinates("local", location)
|
||||||
georeference.set_coordinates("map", coordinates)
|
|
||||||
georeference.set_cursor_location()
|
|
||||||
|
|
||||||
|
|
||||||
def convert_global_to_local(georeference):
|
|
||||||
coordinates = georeference.enh2xyz(georeference.get_coordinates("map"))
|
|
||||||
georeference.set_coordinates("local", coordinates)
|
|
||||||
georeference.set_cursor_location()
|
|
||||||
|
|
||||||
|
|
||||||
def convert_angle_to_coord(georeference, type):
|
def convert_angle_to_coord(georeference, type):
|
||||||
|
|||||||
@@ -222,17 +222,13 @@ class Georeference(blenderbim.core.tool.Georeference):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def set_coordinates(cls, io, coordinates):
|
def set_coordinates(cls, io, coordinates):
|
||||||
if io == "local":
|
props = bpy.context.scene.BIMGeoreferenceProperties
|
||||||
bpy.context.scene.BIMGeoreferenceProperties.local_coordinates = ",".join([str(o) for o in coordinates])
|
setattr(props, f"{io}_coordinates", ",".join([str(o) for o in coordinates]))
|
||||||
elif io == "map":
|
|
||||||
bpy.context.scene.BIMGeoreferenceProperties.map_coordinates = ",".join([str(o) for o in coordinates])
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_coordinates(cls, io):
|
def get_coordinates(cls, io):
|
||||||
if io == "local":
|
props = bpy.context.scene.BIMGeoreferenceProperties
|
||||||
return [float(co) for co in bpy.context.scene.BIMGeoreferenceProperties.local_coordinates.split(",")]
|
return [float(co) for co in getattr(props, f"{io}_coordinates").split(",")]
|
||||||
elif io == "map":
|
|
||||||
return [float(co) for co in bpy.context.scene.BIMGeoreferenceProperties.map_coordinates.split(",")]
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_cursor_location(cls):
|
def get_cursor_location(cls):
|
||||||
@@ -383,3 +379,7 @@ class Georeference(blenderbim.core.tool.Georeference):
|
|||||||
)
|
)
|
||||||
angle = tool.Cad.normalise_angle(angle)
|
angle = tool.Cad.normalise_angle(angle)
|
||||||
gprops.model_project_north = str(angle)
|
gprops.model_project_north = str(angle)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def has_blender_offset(cls) -> bool:
|
||||||
|
return bpy.context.scene.BIMGeoreferenceProperties.has_blender_offset
|
||||||
|
|||||||
Reference in New Issue
Block a user