Fix #7353: Fix section annotations squashed in section views

Add target view detection to generate_section_reference_points() to create
appropriate geometry for each view type. Plan views get horizontal lines
(clip_segment), section/elevation views get vertical lines (elevate_segment).
This commit is contained in:
Ryan Schultz
2025-11-15 07:52:07 -06:00
parent fe80620a5d
commit 36cb625c4e
+14 -3
View File
@@ -1732,11 +1732,22 @@ class Drawing(bonsai.core.tool.Drawing):
im = camera.matrix_world.inverted()
v1, v2 = [im @ Vector((m @ np.append(v, 1.0))[:3]) for v in [v1, v2]]
target_view = cls.get_drawing_target_view(drawing)
bounds = helper.ortho_view_frame(camera.data)
if not (points := helper.clip_segment(bounds, [v1, v2])):
if target_view in ("PLAN_VIEW", "REFLECTED_PLAN_VIEW"):
# For plan views, clip to XY bounds and set Z=0
if not (points := helper.clip_segment(bounds, [v1, v2])):
return
for v in points:
v.z = 0
elif target_view in ("ELEVATION_VIEW", "SECTION_VIEW"):
# For section/elevation views, elevate the segment vertically
if not (points := helper.elevate_segment(bounds, [v1, v2])):
return
else:
return
for v in points:
v.z = 0
return points
@classmethod