Skip to content

Commit 56cf4c5

Browse files
committed
Add truss tests
1 parent 30323d0 commit 56cf4c5

File tree

2 files changed

+668
-1
lines changed

2 files changed

+668
-1
lines changed

anastruct/preprocess/truss.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,9 @@ def __init__(
10681068
ceiling_x = width / 2 - (peak_height - ceiling_y) / np.tan(roof_pitch)
10691069

10701070
# Validate geometry: ceiling must be at or above the wall intersection
1071-
if ceiling_y < wall_y or ceiling_x < wall_x:
1071+
# Use tolerance for floating point comparison
1072+
tolerance = 1e-6
1073+
if ceiling_y < wall_y - tolerance or ceiling_x < wall_x - tolerance:
10721074
raise ValueError(
10731075
f"Attic height ({ceiling_y:.2f}) is too low. "
10741076
f"Minimum attic height for this configuration is {wall_y:.2f}. "

0 commit comments

Comments
 (0)