Continue refactor, and provide user options to regenerate vector base layer / annotation layer of drawings. See #1153.

This commit is contained in:
Dion Moult
2021-05-16 22:15:55 +10:00
parent f2352e9a17
commit 537efdcb53
12 changed files with 361 additions and 315 deletions
-12
View File
@@ -97,18 +97,6 @@ def get_project_collection(scene):
return colls[0]
def get_active_drawing(scene):
"""Get active drawing collection and camera"""
props = scene.DocProperties
if props.active_drawing_index is None or len(props.drawings) == 0:
return None, None
try:
drawing = props.drawings[props.active_drawing_index]
return scene.collection.children["Views"].children[f"IfcGroup/{drawing.name}"], drawing.camera
except (KeyError, IndexError):
raise RuntimeError("missing drawing collection")
def ortho_view_frame(camera, margin=0.015):
"""Calculates 2d bounding box of camera view area.