mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 10:06:47 +00:00
Implement getting and setting true north rotation independent of grid north
This commit is contained in:
@@ -2,12 +2,14 @@ class Data:
|
||||
is_loaded = False
|
||||
map_conversion = {}
|
||||
projected_crs = {}
|
||||
true_north = {}
|
||||
|
||||
@classmethod
|
||||
def purge(cls):
|
||||
cls.is_loaded = False
|
||||
cls.map_conversion = {}
|
||||
cls.projected_crs = {}
|
||||
cls.true_north = None
|
||||
|
||||
@classmethod
|
||||
def load(cls, file):
|
||||
@@ -15,6 +17,7 @@ class Data:
|
||||
return
|
||||
cls.map_conversion = {}
|
||||
cls.projected_crs = {}
|
||||
cls.true_north = {}
|
||||
if file.schema == "IFC2X3":
|
||||
return
|
||||
for context in file.by_type("IfcGeometricRepresentationContext", include_subtypes=False):
|
||||
@@ -28,4 +31,9 @@ class Data:
|
||||
if cls.projected_crs["MapUnit"]:
|
||||
cls.projected_crs["MapUnit"] = map_conversion.TargetCRS.MapUnit.get_info()
|
||||
break
|
||||
for context in file.by_type("IfcGeometricRepresentationContext", include_subtypes=False):
|
||||
if not context.TrueNorth:
|
||||
continue
|
||||
cls.true_north = context.TrueNorth.DirectionRatios
|
||||
break
|
||||
cls.is_loaded = True
|
||||
|
||||
Reference in New Issue
Block a user