Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/load_distribution/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
loads on beams or other linear elements.
"""

__version__ = "0.1.3"
__version__ = "0.1.4"

from load_distribution.load_distribution import *
4 changes: 3 additions & 1 deletion src/load_distribution/load_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ def singularities_to_polygon(los: list[Singularity], xy: bool = False) -> Polygo
if prev_x is not None and not math.isclose(prev_x, sing.x0):
x_acc.append(sing.x0)
x_acc.append(sing.x0 + eps)
x_acc.append(sing.x1 - 10 * eps)
x_acc.append(sing.x1 - eps)
x_acc.append(sing.x1)
x_acc.append(sing.x1 + eps)
prev_x = sing.x1

# There are two scenarios: sing functions that describe trapezoids/triangles
Expand Down
11 changes: 8 additions & 3 deletions tests/test_load_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ def test_singularities_to_polygon():

assert (
ld.singularities_to_polygon(square_45_sings[0] + square_45_sings[1]).wkt
== "POLYGON ((0 0, 0 0, 5 10, 5 10, 10 0, 0 0))"
# == "POLYGON ((0 0, 5 10, 5 10, 10 0, 10 0, 0 0))"
== "POLYGON ((0 0, 0 0, 5 10, 5 10, 10 0, 10 0, 0 0))"
)
assert (
ld.singularities_to_polygon(
Expand All @@ -202,7 +201,13 @@ def test_singularities_to_polygon():
).wkt
== "POLYGON ((1 0, 1 10, 3 10, 3 0, 1 0))"
)

assert (
ld.singularities_to_polygon([
ld.Singularity(x0=0, x1=4, m=0.0, y0=5, precision=6, eps=1e-12),
ld.Singularity(x0=0, x1=2.5, m=0.0, y0=40, precision=6, eps=1e-12)
]).wkt
== "POLYGON ((0 0, 0 45, 2.5 45, 2.5 5, 4 5, 4 0, 0 0))"
)

def test_overlap_region_to_singularity():
assert ld.overlap_region_to_singularity(
Expand Down
Loading