mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 02:49:12 +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):
|
||||
georeference.set_coordinates("local", georeference.get_cursor_location())
|
||||
|
||||
|
||||
def convert_local_to_global(georeference):
|
||||
coordinates = georeference.xyz2enh(georeference.get_coordinates("local"))
|
||||
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()
|
||||
location = georeference.get_cursor_location()
|
||||
if georeference.has_blender_offset:
|
||||
georeference.set_coordinates("blender", location)
|
||||
else:
|
||||
georeference.set_coordinates("local", location)
|
||||
|
||||
|
||||
def convert_angle_to_coord(georeference, type):
|
||||
|
||||
@@ -222,17 +222,13 @@ class Georeference(blenderbim.core.tool.Georeference):
|
||||
|
||||
@classmethod
|
||||
def set_coordinates(cls, io, coordinates):
|
||||
if io == "local":
|
||||
bpy.context.scene.BIMGeoreferenceProperties.local_coordinates = ",".join([str(o) for o in coordinates])
|
||||
elif io == "map":
|
||||
bpy.context.scene.BIMGeoreferenceProperties.map_coordinates = ",".join([str(o) for o in coordinates])
|
||||
props = bpy.context.scene.BIMGeoreferenceProperties
|
||||
setattr(props, f"{io}_coordinates", ",".join([str(o) for o in coordinates]))
|
||||
|
||||
@classmethod
|
||||
def get_coordinates(cls, io):
|
||||
if io == "local":
|
||||
return [float(co) for co in bpy.context.scene.BIMGeoreferenceProperties.local_coordinates.split(",")]
|
||||
elif io == "map":
|
||||
return [float(co) for co in bpy.context.scene.BIMGeoreferenceProperties.map_coordinates.split(",")]
|
||||
props = bpy.context.scene.BIMGeoreferenceProperties
|
||||
return [float(co) for co in getattr(props, f"{io}_coordinates").split(",")]
|
||||
|
||||
@classmethod
|
||||
def get_cursor_location(cls):
|
||||
@@ -383,3 +379,7 @@ class Georeference(blenderbim.core.tool.Georeference):
|
||||
)
|
||||
angle = tool.Cad.normalise_angle(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