@@ -173,6 +173,25 @@ def test_singularities_to_polygon():
173173 square_bow_tie_sings = ld .get_singularity_functions (square_bow_tie )
174174 square_with_L_hole_sings = ld .get_singularity_functions (square_with_L_hole )
175175
176+ real_world_singularities = [
177+ ld .Singularity (
178+ x0 = 0.034367933446777243 ,
179+ x1 = 0.051573454339195024 ,
180+ m = 29.060439560440315 ,
181+ y0 = 0.0 ,
182+ precision = 6 ,
183+ eps = 1e-12 ,
184+ ),
185+ ld .Singularity (
186+ x0 = 0.051573454339195024 ,
187+ x1 = 11.704999999999998 ,
188+ m = 0.0 ,
189+ y0 = 0.5 ,
190+ precision = 6 ,
191+ eps = 1e-12 ,
192+ ),
193+ ]
194+
176195 assert (
177196 ld .singularities_to_polygon (square_45_sings [0 ] + square_45_sings [1 ]).wkt
178197 == "POLYGON ((0 0, 0 0, 5 10, 5 10, 10 0, 10 0, 0 0))"
@@ -202,13 +221,22 @@ def test_singularities_to_polygon():
202221 == "POLYGON ((1 0, 1 10, 3 10, 3 0, 1 0))"
203222 )
204223 assert (
205- ld .singularities_to_polygon ([
206- ld .Singularity (x0 = 0 , x1 = 4 , m = 0.0 , y0 = 5 , precision = 6 , eps = 1e-12 ),
207- ld .Singularity (x0 = 0 , x1 = 2.5 , m = 0.0 , y0 = 40 , precision = 6 , eps = 1e-12 )
208- ]).wkt
224+ ld .singularities_to_polygon (
225+ [
226+ ld .Singularity (x0 = 0 , x1 = 4 , m = 0.0 , y0 = 5 , precision = 6 , eps = 1e-12 ),
227+ ld .Singularity (x0 = 0 , x1 = 2.5 , m = 0.0 , y0 = 40 , precision = 6 , eps = 1e-12 ),
228+ ]
229+ ).wkt
209230 == "POLYGON ((0 0, 0 45, 2.5 45, 2.5 5, 4 5, 4 0, 0 0))"
210231 )
211232
233+ # This test fails due to an error in filtering
234+ assert (
235+ ld .singularities_to_polygon (real_world_singularities ).wkt
236+ == "POLYGON ((0 0, 0.034368 0, 0.051573 0.5, 0.051573 0.5, 11.705 0.5, 11.705 0, 0 0))"
237+ )
238+
239+
212240def test_overlap_region_to_singularity ():
213241 assert ld .overlap_region_to_singularity (
214242 ld .Overlap (6.0 , 10.0 , 0.0 , 0.0 , 0.0 , 10.0 ), 6
0 commit comments