mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user